Help:Graph format

From semantic-mediawiki.org
Jump to: navigation, search
Graph format
Displays the relation between pages
Further Information
Provided by: Semantic Result Formats
Added: 1.4.2
Removed: still supported
Requirements: GraphViz
Format name: graph
Enabled by default: Indicates whether the result format is enabled by default upon installation of the respective extension. No
Authors: Frank Dengler, Jeroen De Dauw
Categories: graph
Group:
Table of Contents

↓ INFO ↓

The result format graph, part of the Semantic Result Formats extension, can be used to display result values as a graph showing the relation between pages. In order to work the GraphViz extension is required to be installed, too.

For recent versions, you should install a recent version of GraphViz that in turn also needs ImageMap. Both should be installed with composer. The following should work with MW 1.24, SMW 2.0 and SRF 2.0. Go to the root directory of your MW installation. Then, depending on your composer installation, either type

composer require mediawiki/graph-viz '*'
composer require mediawiki/image-map @dev

or

php composer.phar require mediawiki/graph-viz '*'
php composer.phar require mediawiki/image-map @dev

Also make sur to remove any require_once("$IP/extensions/GraphViz/GraphViz.php"); line from LocalSettings.ini.

Bug (as of Dec 2015): The graphname=... will break the code and therefore should not be used.

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
arrowdirection LR,RL,TB or BT LR Name since 1.5.4, for older versions, use "rankdir". Specifies the direction of the graph L=left,R=right,T=top,B=bottom
graphsize pointf none Specifies the size of the graph
nodeshape shape none Since 1.5.4. Sets the shape of graph nodes. Allowed values: box, box3d, circle, component, diamond, doublecircle, doubleoctagon, egg, ellipse, folder, hexagon, house, invhouse, invtrapezium, invtriangle, Mcircle, Mdiamond, Msquare, none, note, octagon, parallelogram, pentagon , plaintext, point, polygon, rect, rectangle, septagon, square, tab, trapezium, triangle, tripleoctagon
wordwraplimit whole positive number 25 Since 1.5.4. Wrap lines after these many characters for node text
nameproperty text none Since 1.5.4. A property to use instead of the subject
relation child/parent child Since 1.5.4. Is the subject or nameproperty a parent or child?

Example

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

External links

Enabling

This result format is not enabled by default on a wiki. To enable it the line
$srfgFormats[] = 'graph';
must be added to the file LocalSettings.php below the inclusion of the Semantic Result Formats extension.


This documentation page applies to all SMW versions from 1.4.2 to the most current version.
     

Help:Graph format en 1.4.2