Index: trunk/extensions/SemanticResultFormats/GraphViz/SRF_Graph.php |
— | — | @@ -24,6 +24,7 @@ |
25 | 25 | protected $m_labelArray = array(); |
26 | 26 | protected $m_graphColors = array( 'black', 'red', 'green', 'blue', 'darkviolet', 'gold', 'deeppink', 'brown', 'bisque', 'darkgreen', 'yellow', 'darkblue', 'magenta', 'steelblue2' ); |
27 | 27 | protected $m_nameProperty = false; |
| 28 | + protected $m_parentRelation; |
28 | 29 | |
29 | 30 | protected function readParameters( $params, $outputmode ) { |
30 | 31 | SMWResultPrinter::readParameters( $params, $outputmode ); |
— | — | @@ -49,6 +50,8 @@ |
50 | 51 | if ( array_key_exists( 'nameproperty', $params ) ) { |
51 | 52 | $this->m_nameProperty = trim( $params['nameproperty'] ); |
52 | 53 | } |
| 54 | + |
| 55 | + $this->m_parentRelation = array_key_exists( 'relation', $params ) && strtolower( trim( $params['relation'] ) ) == 'parent'; |
53 | 56 | } |
54 | 57 | |
55 | 58 | protected function getResultText( /* SMWQueryResult */ $res, $outputmode ) { |
— | — | @@ -153,7 +156,7 @@ |
154 | 157 | } |
155 | 158 | |
156 | 159 | if ( !$isName ) { |
157 | | - $graphInput .= " \"$name\" -> \"$text\" "; |
| 160 | + $graphInput .= $this->m_parentRelation ? " \"$text\" -> \"$name\" " : " \"$name\" -> \"$text\" "; |
158 | 161 | |
159 | 162 | if ( $this->m_graphLabel && $this->m_graphColor ) { |
160 | 163 | $graphInput .= ' ['; |