You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jena.apache.org by dafNi <dz...@gmail.com> on 2012/06/08 14:42:18 UTC

number as class/property/individual name

hello!

I have noticed that when I define (in RDF) one class/property/individual 
with a
number as a name, then when I use the method: getLocalName, the name is 
empty.
Does that have to do with java not letting variable names to be numbers?
Does that problem have a solution or I should just change the RDF file?

Thank you in advance
dafNi


Re: number as class/property/individual name

Posted by Chris Dollin <ch...@epimorphics.com>.
On Friday, June 08, 2012 03:42:18 PM dafNi wrote:

> I have noticed that when I define (in RDF) one class/property/individual 
> with a
> number as a name, then when I use the method: getLocalName, the name is 
> empty.
> Does that have to do with java not letting variable names to be numbers?

No.

It's to do with the RDF/XML rules for legal local names.

> Does that problem have a solution or I should just change the RDF file?

I'd change the RDF file. I'd also try to avoid getLocalName -- for this
reason. (Sometimes it's the best thing to do, often it's a sign you
should adjust your design.)

Chris
 
-- 
"I don't want to know what the Structuralists think! I want     /Archer's Goon/
 to know what YOU think!"

Epimorphics Ltd, http://www.epimorphics.com
Registered address: Court Lodge, 105 High Street, Portishead, Bristol BS20 6PT
Epimorphics Ltd. is a limited company registered in England (number 7016688)


Re: number as class/property/individual name

Posted by Andy Seaborne <an...@apache.org>.
On 08/06/12 13:42, dafNi wrote:
> hello!
>
> I have noticed that when I define (in RDF) one class/property/individual
> with a
> number as a name, then when I use the method: getLocalName, the name is
> empty.
> Does that have to do with java not letting variable names to be numbers?
> Does that problem have a solution or I should just change the RDF file?

It has to do with XML -- XML does not allowing qnames to have a local 
part starting with a number.

Solution:
1/ use Turtle.
2/ Just don't look at the RDF/XML - it moves triples around, just don't 
look at it.

	Andy

>
> Thank you in advance
> dafNi
>