This is a set of parser functions, #smm, #sgraph, #shypergraph and #mm2 to derive graphs from the semantic and non-semantic
relationships of a Semantic Mediawiki with functional integration with the
Semantic forms extension. At the moment I haven't got a web demo of it available
within a wiki but here are some of the outputs to give you a flavour. The software is GPL
Please see the README file for some further info on usage, or if you get the extension installed then an error in the usage should generate a
summary of the syntax, and highlight mistakes made. (e.g. typing {{#smm:help}} will output a summary of the options).
NOTE: All the in graph links have been removed in the examples below because they would be pointing to a localhost development server.
Click to go to get the code...
This shows a small graph built from the content of the wiki, this one happens to be an acyclic network with single parentage, but the function
is built to display networks. This is based on a partial rewrite of the mediawiki graphviz extension
and relies on a server installation of GraphViz.It has support for dot, neato, circo and the other rendering
engines supplied with graphviz
The function creates links to the underlying pages, and if the pages don't yet exist then allows for integration with the semantic forms extension,
in that a new form can be created and pre-populated based on that property. (by default these are coloured red or blue)
The parser function syntax for generating this map was:
{{#sgraph:resource=Interoperability ...this could have been a comma seperated list of pages
|property=hasSubtopic
|depth=3
|engine=dot
|svg=true
}}
This output format is a javascript svg file. It may not work on all browsers - tested on firefox. There is also support for png.
This shows a Freemind map generated
from a semantic network of parent-child relationships.
The colouring indicates whether the nodes exist within the wiki or are simply referred to and
don't yet exist. Normally the links are populated to click through to the page corresponding
to the node, or if the page doesn't exist again you can direct it to a semantic form to input structured
data.
The parser function syntax for generating this map was:
{{#smm:resource=Health informatics topics
|property=hasSubtopic
|depth=10
|height=800
|editform=Rsrc
|editquery=Rsrc[label]=@CHILD@&Rsrc[subtopicOf]=@PARENT@
}}
The last line defines how the semantic form is prepopulated.
If you omit a property the map will be generated using the wiki links, unless the resource is a
category in which case it will generate a category tree. There are a number of folding options to control the
display - in this map it is defaulting to folding branches with more than 10 items in it. Cyclic dependencies are identified during
the map creation and broken so that it can be displayed as a tree.
If you upload a Freemind map onto a wiki (see the README file for more details on enablig this) there is another parser function which
has syntax such as:
{{#mm2:image=uploadedmapname.mm
|editform=...form...
|editquery=...querystring...
}}
The function creates a copy of the map with links to content within the wiki if it can find pages based on the text of the Freemind nodes.
This allows for some brainstorming around the content of a wiki to be done in Freemind, and the wiki to be authored using semantic forms,
or the normal edit page, if you are not semantically inclined. The linked mindmap can be downloaded and manipulated and re-uploaded.
The same underlying information can be presented as a network graph using Hypergraph.
There are some fundamental differences here, the network does not need to be expressed as a tree, the map can take multiple resources
as input, and (theoretically at least) multiple properties as well, these can be passed as a comma seperated list.
The parser function syntax for generating this graph was:
{{#shypergraph:resource=Health informatics topics
|property=hasSubtopic
|depth=10
|height=800
|editform=Rsrc
|editquery=Rsrc[label]=@CHILD@
}}
Click and drag the graph to explore - look at HL7 nodes for most detail
Please let me know of issues / problems / suggestions through the sourceforge lists
Thanks
Rob.
property | type | list | values | checks | help |
---|---|---|---|---|---|
resource | page |
| the root node of the mind map, if a category the tree will be a category tree | ||
property | page |
| the property to traverse, if this is empty the tree will be built from wiki links | ||
depth | num | ||||
height | string | ||||
editform | string | a form name that can be used to edit red links, without "Form:" | |||
editquery | string | a query string that will be passed to semantic forms, seperator is ampersand | |||
fold | string |
| folding of generated map: by default branches with more than 10 items are folded |
property | type | list | values | checks | help |
---|---|---|---|---|---|
image | page |
| a page name in the image namespace that refers to an uploaded freemind map e.g. Image:map.mm, also map.mm should work | ||
height | string | ||||
editform | string | a form name that can be used to edit red links, without "Form:" | |||
editquery | string | a query string that will be passed to semantic forms, seperator is ampersand | |||
fold | string |
|
property | type | list | values | checks | help |
---|---|---|---|---|---|
resource | page | 1 |
| the initial nodes of the graph, can be one or many, if all are categories the graph will be a category graph | |
property | page |
| the properties to traverse for links, can be one or many, if this is empty the graph will be built from wiki links | ||
depth | num | deep graphs can be expensive | |||
engine | string |
| |||
editform | string | a form name that can be used to edit red links, without "Form:" | |||
editquery | string | a query string that will be passed to semantic forms, seperator is ampersand | |||
dotoptions | string | a dot string which is inserted at the top of the graph |
property | type | list | values | checks | help |
---|---|---|---|---|---|
resource | page | 1 |
| a set of pages that define the initial nodes of the graph, if all are catgories it will be a category graph | |
property | page | 1 |
| a set of properties that will be followed, if empty wikilinks will be used | |
colours | string | 1 |
| a list of colours for the property links - not yet implemented | |
depth | num | ||||
width | string | ||||
height | string | ||||
editform | string | a form name that can be used to edit red links, without "Form:" | |||
editquery | string | a query string that will be passed to semantic forms, seperator is ampersand |