Can QName be used without a local name part?

Hello everyone!

I'm wondering if it is possible to use QNames in the form of 'prefix:' (without a local name, e.g. the part after the colon).

Say a prefix foo is assigned to the full URI of some property.

@prefix foo: <http://example.org/terms/#veryLongPropertyName> .
<#a> foo: <#b> .

This way publishers could use custom names, which could be handy for various reasons (shortening, translating etc.).

I just realized this is not possible in RDF/XML serialization, because the tag name cannot be empty, according to the spec. [1]

<rdf:Description about="#a">
 <foo: rdf:Resource="#b">
</rdf:Description>

Anyways, what do you think about this idea? Is there any solution/hack for the implementation in RDF/XML? Is there any other way to do this?

  1. http://www.w3.org/TR/REC-xml/#NT-NameStartChar

This is why I like standards specifications--because they let you look up definitive answers to questions like this. Production 27 at http://www.w3.org/TeamSubmission/turtle/#sec-grammar-grammar shows that the local name is optional in Turtle.

Interestingly, the SPARQL spec doesn't mention qnames. http://www.w3.org/TR/REC-xml-names/#ns-qualnames makes it official that local names are required in XML.

Yes this should be valid in Turtle, Notation 3 and SPARQL as far as I am aware.

As you say this is obviously not valid in RDF/XML