Difference between revisions of "Template:ListEdges"

From AtlasWiki
Jump to: navigation, search
(additional cases of FULLPAGENAME->PAGENAME)
(Now lists inherited edges if a "parents" property is given a comma-separated list of all parents (intermediate work done at ListEdgesWIP))
Line 1: Line 1:
<noinclude>For use on node kind pages; will eventually automatically lists all known kinds of in and out edges to/from this kind of node, and the kinds of nodes those edges come from.
+
<noinclude>For use on node kind pages, automatically lists edges declared on the current page.
  
Currently lists just the node/edge pairs that point explicitly to/from this kind of node, ignoring superkinds.
+
If the parameter "parents" is given a comma-separated list of the parents of the node, inherited edges will also be listed.
 
</noinclude>{{#ask: [[edge to {{PAGENAME}}::+]]
 
</noinclude>{{#ask: [[edge to {{PAGENAME}}::+]]
 
| ?edge to {{PAGENAME}}
 
| ?edge to {{PAGENAME}}
Line 26: Line 26:
 
{{!}}}  
 
{{!}}}  
 
}}<noinclude><!--
 
}}<noinclude><!--
 +
 +
If we were given inheritance information, discover and list the inherited edges as well.
 +
 +
--></noinclude>{{#if:{{{parents|}}}|{{#arraydefine:parents|{{{parents}}}|,|}}
 +
{{{!}} class="xcsgtable"
 +
{{!}}-
 +
! Inherited From !! In Edge  !! Predecessor (Comes From) !! Multiplicity !! Description
 +
{{#arrayprint:parents||@@@@|&#32;
 +
{{InheritEdgesTo|@@@@}}}}
 +
{{!}}} }}<noinclude><!--
  
 
Next we get the out edges:
 
Next we get the out edges:
Line 43: Line 53:
 
}} }}<noinclude><!--
 
}} }}<noinclude><!--
  
Finally, we print the out edges table:
+
We print the out edges table:
  
 
--></noinclude>{{#switch:{{#arraysize:outEdges}}| 0 = | #default =  
 
--></noinclude>{{#switch:{{#arraysize:outEdges}}| 0 = | #default =  
Line 52: Line 62:
 
{{!}}|var|[[{{#explode:var|$SEP$|0}}]] {{!}}{{!}} [[{{#explode:var|$SEP$|1}}]] {{!}}{{!}} {{#explode:var|$SEP$|2}} {{!}}{{!}} {{ReconstructLinks|{{#explode:var|$SEP$|3}}}} }}
 
{{!}}|var|[[{{#explode:var|$SEP$|0}}]] {{!}}{{!}} [[{{#explode:var|$SEP$|1}}]] {{!}}{{!}} {{#explode:var|$SEP$|2}} {{!}}{{!}} {{ReconstructLinks|{{#explode:var|$SEP$|3}}}} }}
 
{{!}}}  
 
{{!}}}  
}}
+
}}<noinclude><!--
 +
 
 +
And the inherited out edges table:
 +
 
 +
--></noinclude>{{#if:{{{parents|}}}|
 +
{{{!}} class="xcsgtable"
 +
{{!}}-
 +
! Inherited From !! Out Edge  !! Successor (Points To) !! Multiplicity !! Description
 +
{{#arrayprint:parents||@@@@|&#32;
 +
{{InheritEdgesFrom|@@@@}}}}
 +
{{!}}} }}

Revision as of 18:17, 21 April 2014

For use on node kind pages, automatically lists edges declared on the current page.

If the parameter "parents" is given a comma-separated list of the parents of the node, inherited edges will also be listed.