Re: from XML namespaces to RDF URIs

I would suggest not reading too much into the comments in the Jena code.
They are from one Jena developer to another, explaining the motivations.

The use of XML Schema namespace within RDF is almost entirely to do with 
the datatypes defined in XML Schema part 2.

Within XML Schema, the appropriate namespace is the one without the hash.

When serializing RDF in N3, in particular, it is possible to use the 
abbreviation xsd:int, for example, for which the prefix should expand to 
the namespace URI with a #.

Since Jena is an RDF and OWL framework, and not an XML Schema framework, 
we find it more useful to use the XML Schema namespace with a #.

I am pretty sure that this comment is *not* trying to make anything more 
of the issue than that.

Jeremy


Max Voelkel wrote:
> Hi, and thanks Leo!
> 
> http://www.w3.org/TR/2004/PR-webarch-20041105/#xml-namespaces says:
> ---
> For flat namespaces, concatenation is one useful mapping.
> 
> *If* namespace URIs that end with a hash (“#”) are chosen, then simple
> concatenation of the namespace URI and the local name creates a URI for a
> secondary resource (the identified term). This technique is used for many
> [RDFXML] namespaces.
> ---
> *If not* ... the document says nothing.
> 
> LS> if in doubt, read the jena code, they are the reference impl anyway:
> 
> LS>    24     /**
> LS>    25      * The XSD namespace. This is the real XML Schema namespace
> LS>    26      * and so lacks the RDF-friendly # character.
> LS>    27      * @deprecated in order to transition to RDF-friendly version replaced by {@link #getURI()}
> LS>    28      */
> LS>    29     public static String NS = XSDDatatype.XSD;
> 
> LS> http://jena.cvs.sourceforge.net/jena/jena2/src/com/hp/hpl/jena/vocabulary/XSD.java?revision=1.12&view=markup
> 
> LS>    31     /**
> LS>    32      * The RDF-friendly version of the XSD namespace
> LS>    33      * with trailing # character.
> LS>    34      */
> LS>    35     public static String getURI() { return NS + "#"; }
> LS>    36 
> This  means,  the  Jena-people  re-refined  the  concatenation  rules  for *this
> particular*  namespace.  For  semantic  web  to work, all other RDF implementors
> should choose the same way.
> 
> It would be nice to find a document from W3C that says:
> ---
> 
> uri(ns,localname) =
>   if (ns.endsWith("#") or ns.endsWith("/"))
>     return ns + localname
>   else
>     return ns + "#" + localname
> 
> ---
>     
> Kind Regards,
> Max
> --
>        Max Völkel
>        voelkel@fzi.de | www.Xam.de
>        office     +49 721 96 54-854
>        mobile     +49 171 83 59 678
> --
> FZI Forschungszentrum Informatik an der Universität Karlsruhe
> Haid-und-Neu-Str. 10-14, D-76131 Karlsruhe
> Tel.: +49-721-9654-0, Fax: +49-721-9654-959
> Stiftung des bürgerlichen Rechts, Az: 14-0563.1 Regierungspräsidium Karlsruhe.
> Vorstand: Prof. Dr.-Ing. Rüdiger Dillmann, Dipl. Wi.-Ing. Michael Flor
> Prof. Dr. Dr.-Ing. Jivka Ovtcharova, Prof. Dr. rer. nat. Rudi Studer
> Vorsitzender des Kuratoriums: Ministerialdirigent Günther Leßnerkraus
> 
> 

Received on Friday, 14 December 2007 14:41:07 UTC