- From: Adam Souzis <adam-l@souzis.com>
- Date: Fri, 02 Apr 2004 11:41:55 -0800
- To: Jeremy Carroll <jjc@hplb.hpl.hp.com>
- Cc: Jakob <jakob.voss@s1999.tu-chemnitz.de>, www-rdf-interest@w3.org
Here's a rule (from RxPath) for mapping QNames to URIs that works around this "last URI reference char must end in a XML NameChar" limitation. Probably won't help your case but one could imagine a future version of RDF/XML adopting something similar if such a minor limitation warranted fixing. RxPath needs such a rule since it must be able to generate a QName from any possible RDF URI ref. The rule is defined here: http://rx4rdf.liminalzone.org/RxPathSpec#id148914988 Basically the rule is before concatenating the namespace URI and the local name of the QName remove one underscore from the local name if the local name consists only of one or more underscores. With this rule you can split any URI to a namespace, XML name pair by appending an underscore to the XML name if the URI ends with either a undercore or a non-NameChar. -- adam Jeremy Carroll wrote: > > Jakob wrote: > >> Hi, >> >> As far as I do understand the way to express a triple in XML is >> >> <rdf:Description rdf:about="http://www.mydomain.com/my_subject.html"> >> <predicates:my-predicate >> rdf:resource="http://www.mydomain.com/my_object.html"/> >> </rdf:Description> >> >> Since characters of XML-Tagnames are more restricted than characters >> in URLs I >> wonder how to express triples where the predicate URL contains special >> characters like ':', '&' and '%'? Its not quite common but possible >> for some >> nodes (especially in my application ;-) >> >> Thanks a lot, >> Jakob Voss >> > > It's OK as long as the predicate ends in a NCName (e.g. a single letter) > > _:a http://example.org/x%20y&z "" . > > can be written > > <rdf:Description> > <eg:z xmlns:eg="http://example.org/x%20y&"/> > </rdf:Description> > > not pretty ... if you have a predicate that does not end in a NCName > e.g. it ends in a special character or %79 or then it is a known > limitation with RDF/XML that you can't serialize that. > > Jeremy > > >
Received on Friday, 2 April 2004 14:41:41 UTC