[Nml-wg] id/idRef

Freek Dijkstra Freek.Dijkstra at sara.nl
Fri Jul 20 10:49:20 EDT 2012


On 20-07-2012 16:00, Aaron Brown wrote:
> 
> On Jul 20, 2012, at 9:50 AM, Freek Dijkstra wrote:
> 
>> On 20-07-2012 15:31, Roman Łapacz wrote:
>>
>>> Fine by me. The only small possible problem I see is that this solution
>>> makes topology document quite static (not sure it's the right word;
>>> maybe less flexible to manipulate). I can imagine that a topology
>>> storage is split (even automatically) because of some reason and then
>>> we've got more than one document. During this operation references would
>>> have to be added in the right places.
>>
>> Good one. There actually seem two scenarios.
>>
>> 1. A document contains an internal reference. This may be useful for a
>> parser which does not parse the full XML at once, so it knows it should
>> continue.
>>
>> 2. A document contains an external reference. This may be useful for a
>> parser so it knows if it does not find certain information, it can not
>> conclude that that information is absent (it may simply be defined
>> elsewhere).
>>
>> In addition, in this second scenario a parser which encounters a network
>> object without properties and without the reference flag may raise a
>> warning because either the flag is missing, it is missing properties, or
>> there is a typo in the URI.
>>
>> My proposal only covers this second example.
>> You are right that this requires work when a topology description is
>> split or merged, but I think that is the case anyhow -- at least I see a
>> need for some checks and rewrites anyway before I'm going to accept a
>> Topology description from another domain before I add it "As is" to my
>> database.
> 
> I guess I'm not sure what the purpose is in differentiating "defined in
> the same document" vs. "defined in a different document".

In one case the parser should encounter the referred element before it's
done parsing, in the other case he may not.

> From my
> perspective, it's either "the network element i'm describing is defined
> here in the element being parsed", or "the network element i'm
> describing is defined somewhere outside the element being parsed".

More precisely:
0. "the network element i'm describing is defined here in the element
being parsed"
1. "the network element i'm describing is defined somewhere outside the
element being parsed, but elsewhere in this file".
2. "the network element I'm describing is defined somewhere outside the
file being parsed".

You're asking "why do we distinguish between 0+1 on one hand and 2 on
the other hand?"

Assume that my parser is finished with a file and found no property X
for network object N. If I than ask it "does network element N has
property X", in scenario 2, it will reply with "I don't know -- it may
be defined elsewhere", while in scenarios 0+1 it will reply with "it is
not defined". So the answer is: the logic is different.

May I counter this with the questions "why do we distinguish between 0
on one hand and 1+2 on the other hand?"

I have no objection to make the distinction, but wonder why. I presume
that all of the XML file is loaded into memory, and it is trivial to see
that a URI occurs elsewhere or not. (I'm aware of a method to parse XML
files element-by element so that full file does not need to be loaded in
memory, but I don't think this will be used for NML.)

Freek



More information about the nml-wg mailing list