Difference between revisions of "Template:Edge"

From AtlasWiki
Jump to: navigation, search
(trying out using {{!}} as a possible fix)
(trying out ReplaceAsterisks as a possible solution)
Line 73: Line 73:
 
Knowing only the origin node, we want to be able to discover this edge, the destination node, the multiplicity from the origin node, and the short description of this edge.
 
Knowing only the origin node, we want to be able to discover this edge, the destination node, the multiplicity from the origin node, and the short description of this edge.
  
--></noinclude>{{#arraymap:{{{connects|}}}| ; | PredSuccMult | [[edge from {{#explode:PredSuccMult|,|0}}::{{#explode:PredSuccMult|,|1}},{{#explode:PredSuccMult|,|3}},{{{description|}}}{{!}} ]] | }}<noinclude><!--
+
--></noinclude>{{#arraymap:{{{connects|}}}| ; | PredSuccMult | [[edge from {{#explode:PredSuccMult|,|0}}::{{#explode:PredSuccMult|,|1}},{{ReplaceAsterisks|{{#explode:PredSuccMult|,|3}}}},{{{description|}}}{{!}} ]] | }}<noinclude><!--
  
  
Line 79: Line 79:
 
Knowing only the destination node, we want to be able to discover this edge, the predecessor node, the multiplicity of incoming edges of this type, and the short description of this edge.
 
Knowing only the destination node, we want to be able to discover this edge, the predecessor node, the multiplicity of incoming edges of this type, and the short description of this edge.
  
--></noinclude>{{#arraymap:{{{connects|}}}| ; | PredSuccMult | [[edge to {{#explode:PredSuccMult|,|1}}::{{#explode:PredSuccMult|,|0}},{{#explode:PredSuccMult|,|2}},{{{description|}}}{{!}} ]] | }}
+
--></noinclude>{{#arraymap:{{{connects|}}}| ; | PredSuccMult | [[edge to {{#explode:PredSuccMult|,|1}}::{{#explode:PredSuccMult|,|0}},{{ReplaceAsterisks|{{#explode:PredSuccMult|,|2}}}},{{{description|}}}{{!}} ]] | }}

Revision as of 10:57, 25 March 2014


This template, for use on edge kind pages, takes in a short description of this edge, and a list of the kinds of connections this edge can form (the predecessor node kind, successor node kind, and multiplicities at each end), and stores that information in properties so it can be retrieved by knowing either the edge kind, the predecessor kind, or the successor kind, using a single query.

It also produces a table summarizing this information.

For example, this is the template call that would be used on a page "Edge" to indicate that "Edge" is an edge kind, that connects either a "Foo" node kind to a "Bar" node kind, or to a "Baz" node kind, with each "Bar" node being associated with exactly one "Foo" node, and each "Baz" node optionally being associated with exactly one "Foo" node:

{{Edge | extends = Another Type of Edge, Yet Another Type of Edge | description = Connects a Foo to a Bar or a Baz | references = ... | connects = Foo,Bar,1,*;Foo,Baz,0..1,* }}

As with the Metaclass template, the extends and references parameters are optional.

The visible output of this will be a metaclass table describing the edge, plus a table summarizing the connections:

Metaclass Edge
Extends Another Type of EdgeYet Another Type of Edge
Description Connects a Foo to a Bar or a Baz
References ...
Predecessor Multiplicity Successor
Foo 1 ➞ ✱ Bar
Foo 0..1 ➞ ✱ Baz

In addition, the following properties will be created:

edge from [predecessor]::[successor],[multiplicity],[description of this edge]

edge to [successor]::[predecessor],[multiplicity],[description of this edge]


For the above example, the properies will be:

edge from Foo::Bar,*,Connects a Foo to a Bar or a Baz

edge to Bar::Foo,1,Connects a Foo to a Bar or a Baz

edge from Foo::Baz,*,Connects a Foo to a Bar or a Baz

edge to Baz::Foo,0..1,Connects a Foo to a Bar or a Baz


Metaclass Edge
Description {{{description}}}
Predecessor Multiplicity Successor
Node Kind 1 ➞ ✱ Node Kind
Node Kind ✱ ➞ 1 Node Kind