digraph{' .. newline .. 'rankdir=LR;'
row = result['result']['rows'][i]
while( row ~= nil )
do
--linkedwiki.print_r(row)
--define nodes
if row['subject_label'] then --set subject label
text = text .. '"' .. row['subject'] .. '"' .. '[label="'.. row['subject_label'] .. '" href="' .. row['subject'] .. '"]' .. newline
end
if row['object_label'] then --set object label
text = text .. '"' .. row['object'] .. '"' .. '[label="'.. row['object_label'] .. '" href="' .. row['object'] .. '"]' .. newline
end
--define edge
text = text .. '"' .. row['subject'] .. '" -> "' .. row['object'] .. '" ['
if row['edge'] then --link to edge
text = text .. 'href="'.. row['edge'] .. '"'
end
if row['edge_label'] then --set edge label
text = text .. 'label="'.. row['edge_label'] .. '"'
end
if row['edgetooltip'] then --add edge tooltip
text = text .. ' edgetooltip="' .. row['edgetooltip'] .. '"'
end
text = text .. ']' .. newline
i = i + 1
row = result['result']['rows'][i]
end
text = text .. '}