Extension:Semantic Result Formats/graph format

From MediaWiki.org

Jump to: navigation, search

The result format graph, part of the Semantic Result Formats extension, uses the GraphViz application to show the connections between pages within the query results.

In order to run this format, the GraphViz MediaWiki extension must also be installed. Please use the improved version from Extension_talk:GraphViz#Improvement, including the local wiki URLs. Note that it may be a bit troublesome to install the GraphViz extension due to its current bad maintenance; it would be great if someone cleaned that up.

[edit] Additional query parameters

Parameter Type default Notes
graphname String QueryResult Names the graph
graphlabel Yes or No No Labels the edges
graphcolor Yes or No No Colors the edges
graphlink Yes or No No Links nodes to their wiki pages
graphlegend Yes or No No Displays a legend
rankdir LR,RL,TB or BT LR Specifies the direction of the graph L=left,R=right,T=top,B=bottom
graphsize pointf none Specifies the size of the graph

[edit] Semantic query example

{{#ask: [[Category:Person]]
| ?has child | ?knows
| format=graph
| graphcolor=Yes
| graphlink=Yes
| graphname=PeopleKnows
| graphlegend=Yes
| graphlabel=No
| graphsize=10,10
| rankdir=TB 
}}