You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jena.apache.org by Panagiotis Papadakos <pa...@gmail.com> on 2013/03/07 20:22:24 UTC

Resource getLocalName() and number in URI fragment

Helllo everybody.

I have a number of classes that have a URI with a number in fragment
like the following: http://www.semanticweb.org/ontologies/2012/lala#2013.

In this case using getLocalName() on this specific OntClass
returns an empty string"". Is this a valid behavior?
I was expecting it to return "2013".

Thank you.

Regards
Papadakos Panagiotis

Re: Resource getLocalName() and number in URI fragment

Posted by Andy Seaborne <an...@apache.org>.
On 07/03/13 19:22, Panagiotis Papadakos wrote:
> Helllo everybody.
>
> I have a number of classes that have a URI with a number in fragment
> like the following: http://www.semanticweb.org/ontologies/2012/lala#2013.
>
> In this case using getLocalName() on this specific OntClass
> returns an empty string"". Is this a valid behavior?
> I was expecting it to return "2013".
>
> Thank you.

getLocalName() returns the best localname compatible with RDF/XML that 
it can.

qnames in XML can't start with a digit (prefix names in turtle can) so 
getLocalName() is deciding the URI is best split as:

"http://www.semanticweb.org/ontologies/2012/lala#2013"
""

which is correct albeit not what you might want.

	Andy

>
> Regards
> Papadakos Panagiotis
>