
Hi Freek; On 12/13/10 11:53 AM, Freek Dijkstra wrote:
I choose some arbitrary names for some attributes; I'm happy to discuss that in another thread.
I guess I should rename this thread to "other" ;)
Jason Zurawski wrote:
<nml:link type="link" nm:id="urn:ogf:network:example.net:pathAC"> <nml:relation type="serialcompound" cl:type="partial"> <nml:segment nm:idRef="urn:ogf:network:example.net:segmentAB"/> </nml:relation> </nml:link>
Is there a reason you choose to introduce a new element (segment) instead of using link? I think we are all aware of the 'segment vs link' battles of past OGFs that have spanned many different working groups, and I was under the impression that the outcome was to use 'link' for all connections instead of switching between names.
I meant both to be a "nml:link" instance.
My example is indeed confusing, and comes from my background in using RDF/XML.
A better syntax proposal is indeed (note that nml:segment is replaced by nml:link, and nm:idRef is replaces by nm:id):
<nml:link type="link" nm:id="urn:ogf:network:example.net:pathAC"> <nml:relation type="serialcompound" cl:type="partial"> <nml:link nm:id="urn:ogf:network:example.net:segmentAB"/> </nml:relation> </nml:link>
I still think this is a little off. I would assume that 'segmentAB' belongs to someone already? If this is the case, it's defined already, so you would use an idRef (as a pointer) in the second enclosed link instead of an id. If it is not already defined, than the use of 'id' is appropriate, but brings up another issue of defining links within relations/other links. We have avoided this in the past. I would make the example as so (again, removing the use of the attribute namespaces since I also feel this is really confusing things): <nml:link id="urn:ogf:network:example.net:pathAC"> <nml:relation type="serialcompound"> <nml:link idRef="urn:ogf:network:example.net:segmentAB"/> </nml:relation> </nml:link> Lastly the inclusion of the 'type=partial' is still rather foreign to me, so I omitted it. Can you explain why you need to do this? Thanks; -jason
In case you are curious why I created such a convoluted example, read on. (it's off-topic for the NML-WG though, and you may want to skip it)
+------------------------------------------------+ | Link | +------------------------------------------------+ | id = urn:ogf:network:example.net:pathAC | | type = "link" | | ... | +------------------------------------------------+ | | | +------------------------------+ | | Relation | | +------------------------------+ |--| type = "serialcompound" | | | cl:type = "partial" | | | ... | | +------------------------------+ | | +------------------------------------------------+ | Link | +------------------------------------------------+ | id = urn:ogf:network:example.net:segmentAB | | ... | +------------------------------------------------+
In RDF, only objects can have properties. properties can not. So if I want to describe the above, I need to make both Links and Relations an object. The relation between two objects is always with a named attribute, so for RDF, one needs to create for the relation between a Link and a Relation object, and between a Relation and Link object, as in:
<nml:Link rdf:about="urn:ogf:network:example.net:pathAC"> <nml:linktype>link</nml:linktype> <nml:hasrelation> <!-- attribute --> <nml:Relation> <nml:relationtype>serialcompound</nml:relationtype> <cl:type>partial</cl:type> <nml:segment rdf:resource="urn:ogf:network:example.net:segmentAB"/> </nml:Relation> </nml:hasrelation> </nml:Link>
(observe that rdf:about is the same as nm:id, and rdf:resource is the same as nm:idRef)
In XML, this can be a lot shorter, so I picked XML for brevity, but indeed forget to use the object name (nml:Link) instead of the made-up attributed name (nml:segemnt).
Sorry for the confusion, Freek