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 solutionmakes topology document quite static (not sure it's the right word;maybe less flexible to manipulate). I can imagine that a topologystorage is split (even automatically) because of some reason and thenwe've got more than one document. During this operation references wouldhave 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 aparser which does not parse the full XML at once, so it knows it shouldcontinue.2. A document contains an external reference. This may be useful for aparser so it knows if it does not find certain information, it can notconclude that that information is absent (it may simply be definedelsewhere).In addition, in this second scenario a parser which encounters a networkobject without properties and without the reference flag may raise awarning because either the flag is missing, it is missing properties, orthere is a typo in the URI.My proposal only covers this second example.You are right that this requires work when a topology description issplit or merged, but I think that is the case anyhow -- at least I see aneed for some checks and rewrites anyway before I'm going to accept aTopology description from another domain before I add it "As is" to mydatabase.I guess I'm not sure what the purpose is in differentiating "defined inthe 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 myperspective, it's either "the network element i'm describing is definedhere in the element being parsed", or "the network element i'mdescribing 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