On 06/02/12 18:05, Dick Murray wrote:
On 06/02/12 17:31, Dave Reynolds wrote:
Hi Dick,

On 06/02/12 16:49, Dick Murray wrote:

Why's the checkLocalName() called in some constructors but not others..?

I can't authoritatively answer that, it does seem inconsistent and may
be just historic anomaly.

Though the fundamental lesson here is to stick to Property URIs which
are legal within the normative RDF syntax (RDF/XML) otherwise
something will bite you eventually :)

Also the Util.splitNamespace starts at the end goes back to the last /
(i.e. before the 99) then winds forwards to the end and returns 31.
Hence the localName is "".

Correct.

The notion of localName here is precisely that of XML QNames, i.e. it
must be a trailing NCName (which can't start with a digit), which
means that your URIs have an empty local name, which is why they can't
be used for properties in RDF/XML syntax, which is why they are best
avoided.

Dave
Hi Dave.

Thanks for the reply and after I bit of digging I found the following;

Practical restrictions of an NCName

The practical restrictions of NCName are that it cannot contain several
symbol characters like |:|, |@|, |$|, |%|, |&|, |/|, |+|, |,|, |;|,
whitespace characters or different parenthesis. Furthermore an NCName
cannot begin with a number, dot or minus character although they can
appear later in an NCName.

And even a RegEx to check for NCName validity;

|[\i-[:]][\c-[:]]*|

Specifically for me it's the "cannot begin with a number" as I was
aiming to create predicates based on a column index.

Though the fundamental lesson here is to stick to Property URIs
which are legal within the normative RDF syntax (RDF/XML) otherwise
something will bite you eventually :)

It's definitely the RDF/XML which isn't happy! If you create a statement
with the #99 property from the model it can output in Turtle but throws
an exception for RDF/XML.

Thanks again.
It can get more confusing ... :-)

http://example/property/12a813

can be used in RDF/XML as a property with a namespace of "http://example/property/123"; leaving "a813" as the local part. Jena will choose a namespace if it can - it split the final segment of the URI to do that.

        Andy

Reply via email to