[Nml-wg] NML namespace

Freek Dijkstra Freek.Dijkstra at sara.nl
Thu Jul 26 10:23:28 EDT 2012


All,

It turns out that namespaces in XML and RDF are used for a different
purpose, and in practice may look subtly different (e.g. the NML RDF
namespace contains a hash, while the NML XML variant does not).

A few high-level questions:
1. How do we want to translate URIs between RDF and XML?
   By a lookup table or by some general procedure?
2. Do we want to use (roughly) the same URI for the XML and RDF schema?
3. If you answered "yes" to question #2, what should be publish at
   this URI?

Ad 1: The advantage of a lookup table is that it works for all syntaxes
(URIs ending in hash, slash or anything else), but implementations need
to learn about the URI before they can support future extensions.
The advantage of a procedure is that is works for future NML extensions,
but requires that all NML extensions must adhere to a particular syntax.

Ad 2: Are we going to use "http://schemas.ogf.org/nml/2012/10/base" and
"http://schemas.ogf.org/nml/2012/10/base#" or do we prefer to publish
the schema at the defined location. In that case, we need distinct URI.
E.g. "http://schemas.ogf.org/nml/2012/10/base/xml" and
"http://schemas.ogf.org/nml/2012/10/base/rdf#".

Ad 3. A usual trick employed by OASIS is to put up a HTML page which
points to both the standard, and the schema(s). E.g.
"http://docs.oasis-open.org/tamie/xtemp/200909". There is also a (little
used?) standard to add computer readable pointers to the schemata in the
HMTL document. See http://www.rddl.org/



For those interested why XML and RDF distinction, here is some
background. XML uses namespaces to scope things: e.g. "The 'Node'
element in context of the 'http://schemas.ogf.org/nml/2012/10/base'
namespace". RDF uses namespace to create shortcuts for long URIs: e.g.
"http://schemas.ogf.org/nml/2012/10/base#Node can be abbreviated to
nml:Node if 'nml:' is a shortcut for
'http://schemas.ogf.org/nml/2012/10/base#'.

Here is an example to highlight the difference. In RDF, these two
statements are equivalent:

  @prefix ns:  http://example.net/myschema/ .
  ns:element a rdf:Resource

  @prefix ns:  http://example.net/myschema/elem .
  ns:ent a rdf:Resource

while the following XML statements are different:

  <ns:element xmlns:ns="http://example.net/myschema/" />

  <ns:ent xmlns:ns="http://example.net/myschema/elem" />

Hence, there is no 1-to-1 relation between RDF namespaces and XML
namespace, and a generic translation between the two does not exist.


Regards,
Freek


PS: for those who think things can not be this hairy, let me quote one
of the replies I got when I asked about this issue on the xml-dev list:



-------- Original Message --------
Subject: Re: [xml-dev] Same namespace for XSD and RDF
Date: Tue, 24 Jul 2012 22:01:54 -0400
From: Simon St.Laurent <simonstl at simonstl.com>
Reply-To: <simonstl at simonstl.com>
To: <xml-dev at lists.xml.org>

> At 2012-07-20 17:31 +0200, Freek Dijkstra wrote:
>> Our (standardisation) group has defined a schema, and wants a
>> representation of it in both XML and RDF. For ease of use, we like to
>> use the same namespace identifier, even at the drawback that we can't
>> publish both the XSD and OWL description at that same URL. Both XML
>> and RDF allow a schema name ending in a word
>> (http://example.org/myschema), or add a slash or hash "#" at the end.
>>
>> In particular, what are the EXACT rules for adding or removing a hash
>> (#) at the end of a namespace?
>
> There are none for the general case.  A namespace is a simple URI
> string that is used in conjunction with an element's name or an
> attribute's name to distinguish the construct from other constructs
> with the same name and a different URI string.
>
> Full stop.

Yes, absolutely, with one caveat.  Do not pause to think about this for
very long, or you will quickly find yourself recreating H.P. Lovecraft's
"The Dreams in the Witch House" with minor variations:

-----------------------------------
Whether the dreams brought on the fever or the fever brought on the
dreams Walter Gilman did not know. Behind everything crouched the
brooding, festering horror of the ancient town, and of the mouldy,
unhallowed garret gable where he wrote and studied and wrestled with
namespaces and media types when he was not tossing on the meagre iron
bed. His ears were growing sensitive to a preternatural and intolerable
degree...

Possibly Gilman ought not to have studied so hard. The proper relations
between resources, fragment identifiers, and namespaces are enough to
stretch any brain, and when one mixes them with folklore, and tries to
trace a strange background of cyberspace reality behind the ghoulish
hints of the Gothic tales and the wild whispers of the chimney-corner,
one can hardly expect to be wholly free from mental tension. Gilman came
from Haverhill, but it was only after he had entered college in Arkham
that he began to connect his hypermedia with the fantastic legends of
elder magic.
-------------------------------------

It's hard to improve upon Lovecraft, but that seems a reasonable update.

If you want to find out how it went with mere "non-Euclidean calculus
and quantum physics", see:

<http://www.dagonbytes.com/thelibrary/lovecraft/dreamswitchhouse.htm>

Thanks,
Simon St.Laurent
http://simonstl.com/
_______________________________________________________________________

XML-DEV is a publicly archived, unmoderated list hosted by OASIS
to support XML implementation and development. To minimize
spam in the archives, you must subscribe before posting.

[Un]Subscribe/change address: http://www.oasis-open.org/mlmanage/
Or unsubscribe: xml-dev-unsubscribe at lists.xml.org
subscribe: xml-dev-subscribe at lists.xml.org
List archive: http://lists.xml.org/archives/xml-dev/
List Guidelines: http://www.oasis-open.org/maillists/guidelines.php






More information about the nml-wg mailing list