Discussion:
URI splitting based on xml ncname
Tobias Hammerschmidt
2016-03-23 21:54:46 UTC
Permalink
---------- Weitergeleitete Nachricht ----------
Von: "Tobias Hammerschmidt" <***@gmail.com>
Datum: 23.03.2016 22:47
Betreff: Re: URI splitting based on xml ncname
An: "Andy Seaborne" <***@seaborne.org>
Cc:

Hi Andy,

thanks for your reply - looks like I've used the wrong mail account when
sending the question to the list so my fault. Regarding your answer I would
interpret the stackoverflow explanation so that there could be issues with
serialization in certain formats (rdf/xml) when the fragment is not a valid
NCName. However I would like to know whether there might be other code
locations in jena which are likekly to misbehave in case local name is null
(due to invalid NCName) for instance. Think this is not answered on
stackoverflow.

Best regards,
Tobias
Hi there,
list, or you sent a message before replying to the acknowledgement. Your
email has ended up in the moderators inbox. If you are not subscribed,
you will not see replies to your question.
Please could you subscribe by sending an email to
then reply to the confirmation.
After that, please could you re-send the message.
You will then receive all replies that are sent to the list.
http://jena.apache.org/help_and_support/index.html
Andy
PS The answer to your question in the the SO link you reference!
Hi all,
as stated in
http://stackoverflow.com/questions/29263937/jenas-getlocalname-doesnt-return-numeric-localname-with-turtle
jena performs splitting of node
uris based on NCName. Now if the uri fragment is not a valid NCName only
the
longest valid NCName starting at the end of the fragment will be used as
the
local name. In the worst case no local name can be determined at all for
instance if the fragment consists only of digits because the NCName can't
start with a digit. Is there any important usage of a nodes local name and
namespace within jena which mandates usage of valid NCNames as fragments
only
or is it safe to use uri fragments which are not valid NCNames?
Best regards,
Tobias
Tobias Hammerschmidt
2016-03-24 06:58:43 UTC
Permalink
Hi all,

as stated in
http://stackoverflow.com/questions/29263937/jenas-getlocalname-doesnt-return-numeric-localname-with-turtle
jena performs splitting of node uris based on NCName. Now if the uri
fragment is not a valid NCName only the
longest valid NCName starting at the end of the fragment will be used as
the local name. In the worst case no local name
can be determined at all for instance if the fragment consists only of
digits because the NCName can't start with a digit.
Is there any important usage of a nodes local name and namespace within
jena which mandates usage of valid NCNames as
fragments only or is it safe to use uri fragments which are not valid
NCNames? I would interpret the stackoverflow
explanation this way: there could be issues with serialization in certain
formats (rdf/xml) when the fragment is not a valid
NCName. However I would like to know whether there might be other code
locations in jena which are likekly to break
for instance in case the local name is null (due to invalid NCName). Think
this is not answered on stackoverflow.

Best regards,
Tobias


Diese E-Mail wurde von einem virenfreien GerÀt gesendet, geschÌtzt von
Avast.
www.avast.com
<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
<#DDB4FAA8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
Andy Seaborne
2016-03-24 17:43:32 UTC
Permalink
Hi all,
as stated in
http://stackoverflow.com/questions/29263937/jenas-getlocalname-doesnt-return-numeric-localname-with-turtle
jena performs splitting of node uris based on NCName. Now if the uri
fragment is not a valid NCName only the
longest valid NCName starting at the end of the fragment will be used as
the local name. In the worst case no local name
can be determined at all for instance if the fragment consists only of
digits because the NCName can't start with a digit.
Is there any important usage of a nodes local name and namespace within
jena which mandates usage of valid NCNames as
fragments only or is it safe to use uri fragments which are not valid
NCNames? I would interpret the stackoverflow
explanation this way: there could be issues with serialization in certain
formats (rdf/xml) when the fragment is not a valid
NCName. However I would like to know whether there might be other code
locations in jena which are likekly to break
for instance in case the local name is null (due to invalid NCName). Think
this is not answered on stackoverflow.
Best regards,
Tobias
Diese E-Mail wurde von einem virenfreien Gerät gesendet, geschützt von
Avast.
www.avast.com
<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
<#DDB4FAA8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
The splitting code is in 'SplitIRI'

There are 3 cases : split for RDF/XML, split for Turtle, which includes
Turtle's encoding mechanism, and a general split, which is Turtle
without the use of \.

For historical reasons, Resource.getLocalName, is the RDF/XML split.

I'm fairly sure the split is not used internally except for output to
RDF/XML or to Turtle. Prefix names are just about appearance,

Andy

Loading...