Help talk:Graph format

From semantic-mediawiki.org

Contents

Thread titleRepliesLast modified
Alternatives for GraphViz extension018:52, 20 September 2021
Alternatives for GraphViz extension018:46, 20 September 2021
Error: Image is invalid or non-existent.118:15, 2 July 2015
Version of GraphViz019:43, 16 December 2014
Can I use only one graph in a page ?205:43, 18 June 2014
Legend & Color without label?015:56, 13 May 2014
Nameproperty014:39, 8 November 2013
Missing parameter documentation in 1.8?201:30, 15 February 2013
Graph background color (or transparency)?021:49, 5 February 2013
graphlink=Yes KO ?515:48, 1 February 2013

Alternatives for GraphViz extension

graph result format can now work with Extension "External Data" and without the defunct Extension "GraphViz". See an example at https://traditio.wiki/%D0%A2%D1%80%D0%B0%D0%B4%D0%B8%D1%86%D0%B8%D1%8F:%D0%9F%D0%BE%D0%BD%D1%8F%D1%82%D0%B8%D1%8F/graphviz.

The necessary settings are:

// GraphViz:
$edgExeName         ['graphviz']     = 'GraphViz';
$edgExeUrl          ['graphviz']     = 'https://graphviz.org/';
$edgExeCommand      ['graphviz']     = 'dot -K$layout$ -Tsvg';
$edgExeParams       ['graphviz']     = ['layout' => 'dot'];
$edgExeParamFilters ['graphviz']     = ['layout' => '/^dot|neato|twopi|circo|fdp|osage|patchwork|sfdp$/'];
$edgExeInput        ['graphviz']     = 'dot';
$edgExePreprocess   ['graphviz']     = 'EDConnectorExe::wikilinks4dot';
$edgExePostprocess  ['graphviz']     = 'EDConnectorExe::innerXML';
$edgExeTags         ['graphviz']     = 'graphviz';
18:46, 20 September 2021

Error: Image is invalid or non-existent.

After updating to MW 1.25, updating and installing these packages:

 "mediawiki/semantic-forms": "^3.3",
 "mediawiki/semantic-media-wiki": "^2.2",
 "mediawiki/semantic-result-formats": "^2.1",
 "mediawiki/graph-viz": "*",
 "mediawiki/image-map": "@dev"

I see

Error: Image is invalid or non-existent.

Here's what I see in the logs:

[Thu Jul 02 09:00:04 2015] [error] [client 199.166.207.207] PHP Warning:  Missing argument 4 for GraphViz::graphvizParserHook(), called in /opt/webs/su.nicer.info/docs/mw/extensions/SemanticResultFormats/formats/graphviz/SRF_Graph.php on line 115 and defined in /opt/webs/su.nicer.info/docs/mw/extensions/GraphViz/GraphViz_body.php on line 784, referer: http://su.nicer.info/mw/index.php?title=Main_Page&action=edit
[Thu Jul 02 09:00:04 2015] [error] [client 199.166.207.207] PHP Notice:  Undefined variable: frame in /opt/webs/su.nicer.info/docs/mw/extensions/GraphViz/GraphViz_body.php on line 802, referer: http://su.nicer.info/mw/index.php?title=Main_Page&action=edit

fwiw, the platform's dot - graphviz version 2.26.3 (20100126.1600)

Thanks.

15:05, 2 July 2015

Despite the error messages, I discovered the problem was an out of date $wgTmpDirectory so it's working now.

18:15, 2 July 2015
 

Version of GraphViz

After upgrading a wiki to MW 1.24 I noticed that an older GraphViz version wouldn't work anymore. I then updated. Except for the graphname parameter our SRF graphs seem to work again. Since I hardly can believe that one should use a 2-year old graphviz version from the SVN I also changed the documentation page of this wiki. Hopefully, this is was right, else please undo :)

To fix the graphname problem: I think that new GraphViz versions rather want something like this: <graphviz renderer="neato" caption="Graph for example no. 2">. I am getting the following kind of error message:

Error: SandBox_digraph_Liens_entre_modules_2.src:1: syntax error near line 1
context: digraph Liens >>> entre <<< modules 2 {size="10,500";node [shape=box];rankdir=TB; "4C-ID" [URL = "[[4C-ID]]"]; 

"Liens entre modules" was | graphname=Liens entre modules 2

19:41, 16 December 2014

Can I use only one graph in a page ?

Hi, When I ask for two graphs in the same page, both are the same. E.g. the following should be different:

{{#ask: [[Category:Bases psychopédagogiques des technologies éducatives]]
|? page suivante
| format=graph
| graphcolor=yes
| graphlink=yes
| nodeshape=box
| graphname=Liens entre modules
| graphlegend=yes
| graphlabel=yes
| graphsize=10,500
| rankdir=TB 
}}


{{#ask: [[Category:Bases psychopédagogiques des technologies éducatives]]
|? page suivante
|? page parente
| format=graph
| graphcolor=yes
| graphlink=yes
| nodeshape=box
| graphname=Liens entre modules 2
| graphlegend=yes
| graphlabel=yes
| graphsize=10,500
| rankdir=TB 
}}

Looking at the graphviz file names. It only creates one file as opposed to two.

-rw-r--r--  1 www-data www-data 117730 oct  1 19:08 SandBoxdigraph  .png
-rw-r--r--  1 www-data www-data   2340 oct  1 19:08 SandBoxdigraph  .map

In principle, Graphviz can do more than one drawing on a page.

SRF Version (latest from GIT master, 1.9 alpha)

Online example (wiki is public read / difficult signup)

- greetings ! Daniel PS: If you don't have time for fixing it (sorry my programming is too weak to help), we could add this limit to the documentation page.

19:21, 1 October 2013

The problem is in SRFGraph::getParamDefinitions (SRF_Graph.php). The solution is to change the first instance of "graphsize" to "graphname" in this function (making $params['graphname'] agree with 'srf_paramdesc_graphname').

02:51, 18 June 2014
 

Legend & Color without label?

When I just use graphcolor = yes and graphlegend = yes, all arrows stay black and no legend is displayed, only if I add graphlabel = yes, the colors and legend appear, but they are then made gratuitous by the labels. Is there any way to show the legend & colors without labels on the edges?

15:56, 13 May 2014

Nameproperty

All, I'm trying to use Graph with the 'nameproperty' variable.

E.g.

{{#ask: [[Category:City]]
| ?located in
| nameproperty=area
| format=graph
}}

That doesn't seem valid on this installation for me to test, but on my own installation of SMW, the 'nameproperty' variable seems to not work as I'd expect. I'd think the format would be "nameproperty=My Property Name", and then the nodes of the graph would take the value in that property for each page as the text label, but it doesn't work. It does work without trying to set nameproperty.

14:39, 8 November 2013

Missing parameter documentation in 1.8?

I use SRF 1.8 and realized by looking into PHP code, what about parameter 'relation=parent'?

14:17, 10 January 2013

Well, in case it's there, it should be supported by #smwdoc. I guess a bug should be opened for this.

22:16, 10 January 2013
 

After creating a bug I realised that the table on the help page was manually created. O_o I should have seen this in the first place. Apart of being angry about myself and my stupidity I just added the documentation for this parameter. Cheers

01:30, 15 February 2013
 

Graph background color (or transparency)?

I'm not sure to what degree this feature would be limited by the Extension:GraphViz or GraphViz itself, but being able to change the background color would be nice.

21:49, 5 February 2013

graphlink=Yes KO ?

Hello,

I am testing 1.8 ResultFormat extension, and it seems that we lost the "graphlink=Yes" functionality. with same database and previous extensions, links come back. Are you experimenting the same behaviour ?

13:51, 17 September 2012

I am experiencing the same thing, but haven't investigated further! Leo Wallentin (talk) 16:01, 25 October 2012 (CEST)

16:01, 25 October 2012
 

Same experience for SRF 1.8 it works with lower case graphlink=yes. Not sure why, maybe they changed boolean handling in Semantic Mediawiki

12:46, 10 January 2013

Ah, thanks!

13:16, 17 January 2013
 

Took the liberty of updating the Help Page. Maybe it will save some people the time it cost me. ;)

09:27, 1 February 2013

Thank you for doing so.

15:48, 1 February 2013