- changed title to Sequence directive
- edited description
Sequence directive
Although sequencing of elements can be handled by a custom adapter, there are many situations where a sequence (linked list) of nodes can be automatically created.
For example, the London underground network consists of a network of stations each of which is on one or more tube lines. For a given segment of a line (some lines have mutiple branches) it should be possible to link the stations for that segment in an ordered sequence in the graph.
This could be enabled by the addition of a sequence directive, perhaps on an edge descriptor, e.g.
{"type": "NEXT_STATION", "sequence": { "of": "Station", "by", "TrackSegment", "index": "trackSegmentIndex" }
The sequence directive takes 3 attributes:
-
of : the type of node (label) to be sequenced (mandatory)
-
by : a discriminator type(label) to allow multiple sequences to be created (optional)
-
index : a property indicating the order in the sequence (optional). If omitted, the natural ordering will be used, i.e. the order in which objects arrive.
In other words, the sequence directive operates a bit like a filter and order by SQL clause:
select * from Stations where trackSegment = 4, order by trackSegmentIndex
Comments (1)
-
reporter - Log in to comment