|Required 'id' attributes (was: More detailed 'speed change' definitions) [message #1125]
||Wed, 07 November 2012 14:25
Registered: March 2008
Hello Dirk and others,|
The following aspect was quite overseen, sorry for that.
I changed the follow-up to railML.misc because of the more general
Dirk Bräuer <dirkbraeuer(at)irfpde> writes:
> <speedChange id="sc3"...>
> Can we have the ‚id’ of a speed change as an optional attribute? Since
> we have many, many speed changes and seldom the need to refer to them
> I do (optionally) want to save some space and effort.
* The "id" attribute provides good facilities to fetch single elements
(with its attributes and sub-elements) from an XML file irrespective
of an existing reference in the XML file.
* There are other often-used XML standards that use the same mechanism:
e.g. GML (Geographic Markup Language)
<attribute name="id" type="ID">
<documentation>The attribute gml:id supports provision of a handle
for the XML element representing a GML Object. Its use is
mandatory for all GML objects. It is of XML type ID, so is
constrained to be unique in the XML document within which it
<complexType name="AbstractGMLType" abstract="true">
<attribute ref="gml:id" use="required"/>
This attribute is required for all GML objects irrespective any
A huge amount of XML Schemas in the Geographic field of application
base on the above mentioned XML Schema.
* It is already a very smart implementation for identification.
The following example shows up a typical alternative from the banking
* There are algorithms for different programming languages for the
ID-generation in general.
e.g. generate-id() in XPath (staying at the XML-world) ;-)
* The _required_ attribute may only be changed into "optional" for the
next major release.
I hope it clarifies the issue a bit.
Crosspost & Followup-To: railML.misc
Schema Coordinator: railML.common
|Re: Required 'id' attributes (was: More detailed 'speed change' definitions) [message #1126 is a reply to message #1125]
||Thu, 08 November 2012 20:52
Registered: August 2008
thank you for the reply.
Some of the aspects on 'id's in RailML
> * There are other often-used XML standards that use the same mechanism:
Yes, of course, all strict-relational data models do so.
(Strict-relational data models need to have Id's.)
In RailML, we also have some hierarchy (so RailML is not
strict-relational) and, more important, we do not know about the data
model of the reading/writing software. So I would say it is bad to force
it to strict-relational data models.
Additionally, we do not have 'id's at each <elements>, so the selection of
elements with id (out of all elements) is a rather arbitrary one. If your
arguments would be accepted: Wouldn't we need to provide 'id's at all
<elements>, would we?
So to come out of this current "arbitrariness" I thought about the rule
"no 'id' without a 'ref' to it". So: If we need a reference, we have to
provide both 'id' and 'ref'.
That would lead us to a rather logic structure: Hierarchy (<elements>)
combined with non-hierarchic references with 'id's.
The question on the meaning of 'id's in RailML (as a primary key for
relational data models) is a more general one - not specially on speed
changes, so I will end this arguing here and open a new topic at "misc".
|Re: Required 'id' attributes [message #1128 is a reply to message #1126]
||Fri, 09 November 2012 21:17
Registered: January 2011
> Additionally, we do not have 'id's at each <elements>, so the selection
> of elements with id (out of all elements) is a rather arbitrary one. If
> your arguments would be accepted: Wouldn't we need to provide 'id's at
> all <elements>, would we?
That's a good remark and actually I prefer defining IDs for all elements
within a railML file instead of marking existing IDs as optional
parameters. However, as Susanne already mentioned, this is a topic for