GraphViz
class GraphViz extends Serialiser
Class to serialise an EasyRdf\Graph to GraphViz
Depends upon the GraphViz 'dot' command line tools to render images.
See http://www.graphviz.org/ for more information.
Properties
protected | $prefixes | from Serialiser |
Methods
Check and cleanup parameters passed to serialise() method
Protected method to get the number of reverse properties for a resource If a resource only has a single property, the number of values for that property is returned instead.
Set the path to the GraphViz 'dot' command
Get the path to the GraphViz 'dot' command
Turn on/off the option to display labels instead of URIs.
Get the state of the use labels option
Turn on/off the option to only display nodes and edges with labels
Get the state of the only Only Labelled option
Set an attribute on the GraphViz graph
Get an attribute of the GraphViz graph
Convert an EasyRdf object into a GraphViz node identifier
Internal function to escape a string into DOT safe syntax
Internal function to escape an associate array of attributes and turns it into a DOT notation string
Internal function to create dot syntax line for either a node or an edge
Internal function to serialise an EasyRdf\Graph into a DOT formatted string
Details
in
Serialiser at line 54
protected
addPrefix($qname)
Keep track of the prefixes used while serialising
in
Serialiser at line 64
protected
checkSerialiseParams($format)
Check and cleanup parameters passed to serialise() method
in
Serialiser at line 85
protected
reversePropertyCount($resource)
Protected method to get the number of reverse properties for a resource If a resource only has a single property, the number of values for that property is returned instead.
at line 379
string
serialise(Graph $graph, Format|string $format, array $options = array())
Serialise an EasyRdf\Graph into a GraphViz dot document.
Supported output format names: dot, gif, png, svg
at line 72
GraphViz
setDotCommand(string $cmd)
Set the path to the GraphViz 'dot' command
Default is to search PATH for the command 'dot'.
at line 85
string
getDotCommand()
Get the path to the GraphViz 'dot' command
The default value is simply 'dot'
at line 104
GraphViz
setUseLabels(bool $useLabels)
Turn on/off the option to display labels instead of URIs.
When this option is turned on, then labels for resources will be displayed instead of the full URI of a resource. This makes it simpler to create friendly diagrams that non-technical people can understand.
This option is turned off by default.
at line 115
bool
getUseLabels()
Get the state of the use labels option
at line 134
GraphViz
setOnlyLabelled(bool $onlyLabelled)
Turn on/off the option to only display nodes and edges with labels
When this option is turned on, then only nodes (resources and literals) and edges (properties) will only be displayed if they have a label. You can use this option, to create concise, diagrams of your data, rather than the RDF.
This option is turned off by default.
at line 145
bool
getOnlyLabelled()
Get the state of the only Only Labelled option
at line 164
GraphViz
setAttribute(string $name, string $value)
Set an attribute on the GraphViz graph
Example: $serialiser->setAttribute('rotate', 90);
See the GraphViz tool documentation for information about the available attributes.
at line 177
string
getAttribute(string $name)
Get an attribute of the GraphViz graph
at line 187
protected
nodeName($entity)
Convert an EasyRdf object into a GraphViz node identifier
at line 205
protected
escape($input)
Internal function to escape a string into DOT safe syntax
at line 224
protected
escapeAttributes($array)
Internal function to escape an associate array of attributes and turns it into a DOT notation string
at line 238
protected
serialiseRow($node1, $node2 = null, $attributes = array())
Internal function to create dot syntax line for either a node or an edge
at line 255
protected
serialiseDot(Graph $graph)
Internal function to serialise an EasyRdf\Graph into a DOT formatted string
at line 355
renderImage(Graph $graph, $format = 'png')
Internal function to render a graph into an image