Description: |
XML parsers do not have to preserve order of child elements (even though most parsers do in practise).
RDF does not define order at all.
For some relations (including isSerialCompoundLink) we need to specify order.
Proposal: use the "next" relation for both XML and RDF, although their use is different. For RDF, also add the ListItem
class and item relation.
Example:
<!--
link A link B link C
O--------------O--------------O--------------O
(--------------------------------------------)
link Z
-->
XML:
<nml:Link id="urn:ogf:network:example.net:2012:linkZ">
<nml:capacity>1000000000</nml:capacity>
<nml:Relation type="serialcompound">
<!-- this is a list -->
<nml:Link nm:idRef="urn:ogf:network:example.net:2012:linkA">
<!-- specify order of the list using the next relation -->
<nml:Relation type="next">
<nml:Link nm:idRef="urn:ogf:network:example.net:2012:linkB"/>
</nml:Relation>
</nml:Link>
<nml:Link nm:idRef="urn:ogf:network:example.net:2012:linkB">
<!-- specify order of the list using the next relation -->
<nml:Relation type="next">
<nml:Link nm:idRef="urn:ogf:network:example.net:2012:linkC"/>
</nml:Relation>
</nml:Link>
<nml:Link nm:idRef="urn:ogf:network:example.net:2012:linkC">
</nml:Relation>
</nml:Link>
RDF:
@prefix nml: <http://example.ogf.org/schemas/nml/>; .
@prefix nmlrel: <http://example.ogf.org/schemas/nml-relation/>; .
@prefix ex: <urn:ogf:network:example.net:2012> .
ex:linkZ a nml:Link ;
nml:capacity 1000000000 ;
nmlrel:isSerialCompoundLink ex:linkZ_1 .
ex:linkZ_1 a nml:ListItem ;
nml:item ex:linkA ;
nmlrel:next ex:linkZ_2 .
ex:linkZ_2 a nmlrel:ListItem ;
nml:item ex:linkB ;
nmlrel:next ex:linkZ_3 .
ex:linkZ_3 a nmlrel:ListItem ;
nml:item ex:linkC . |