OK.  after further examination the issue I am seeing is that the TURTLE
representation and the RDF-XML representation do not match.

If I read the XML document and serialize it out as RDF-XML get the expected
namespaces.  When I serialize it out as TURTLE there is no separator
between the namespace and the local name.  I can see that this is as
expected but means that once serialized to TURTLE some information is lost
in that Jena calculates the namespace to a different value.  I know that
this is due to the way namespaces are handled in Jena vs XML in that Jena
always carries the expanded version and the expansion of  <item xmlns="
http://example.com"; /> technically is <http://example.comitem /> but it
does make for strange reading.

i was wondering if it would make sense to have a utility/option that would
insert either '#' or '/' on RDF-XML namespaces that end with an valid
XMLName character.  But then the name is different across the systems.  So
I suppose that really is a bad idea.

Thanks for your time,
Claude

On Fri, Jul 5, 2019 at 10:00 AM Andy Seaborne <a...@apache.org> wrote:

> On 05/07/2019 08:20, Martynas Jusevičius wrote:
> >> When XML parser parses the document it internally adds a slash '/'
> > between  the namespace and  the local name.
> >
> > Are you sure that is the case? Sounds weird and likely non-conformant.
>
> It's possibly because one of the processors process has also applied
> "normalization" - it is not to do with namespaces, it is to do with URIs.
>
> > If you can’t change the existing XSLT stylesheet, you could pipeline the
> > RDF/XML through a second one which removes the slashes.
> >
> > This has little to do with Jena really.
>
> I agree.  Looks liek it is is the XML part.
>
> >
> > On Fri, 5 Jul 2019 at 09.59, Claude Warren <cla...@xenei.com> wrote:
> >
> >> Greetings,
> >>
> >> Background:
> >> I have an externally curated XML file that I run through an XSLT
> transform
> >> to create an RDF XML file to load into Jena.
> >>
> >> The namespace URIs in the XML  end with a valid XML nameChar (i,e, not a
> >> slash '/' or hash '#').  When XML parser parses the document it
> internally
> >> adds a slash '/' between  the namespace and  the local name.  Jena does
> >> not.
>
> In XML, qname is a pair (namespaceURI, localName).
>
> Core XML does not have the concept of making that a single string.
>
> The rule for turning that into an single URI is specific to RDF.
> The rule is concatenation.
>
> The RDF world used talk about qnames - that was sloppy language.
> Better is "prefixed name".  Turtle rdf:type is a short hand for a long
> URI. Not an XML qname.
>
> How in your XSLT process that becomes a single string is what you need
> to look at.
>
> Surely the XSLT script could perform URI processing?
>
> F&O talks about it (section 1.7.2) but there isn't an function that I
> could see.
>
> >> So:
> >> <item xmlns="http://example.com"; />
> >>
> >> in the XML parser and XSL transformer become:
>
> So how is that happening? XSLT rule?
>
> >> <http://example.com/item />
> >> but in Jena becomes
>
> when parsing RDF/XML.
>
> If the namespace is used a prefix in Turtle the same happens. Notice the
> change in terminology namespace -> prefix.
>
> >> <http://example.comitem />
>
> Possibly because the XML parser or XSLT processor also normalized the
> URI or has a rule involving the formation of the URI string.
>
> Have a look at the place where the qname becomes a single string output.
>
> >>
> >> As the xml is externally curated I can not easily change the xmlns
> elements
> >> to contain the XML parser inserted trailing slash.
> >>
> >> The XSLT namespaces must match the XML namespaces to correctly function.
> >>
> >> Question:
> >>
> >> Is there a flag that can be used during parsing of XML formatted RDF
> data
> >> that will cause the system to insert the XML expected slash '/' ?
>
> If happening in the XML parser you are using, one possibility is to
> parse the XML, write out then feed into ARP. Or add an XSLT step.
> Anything to kick in the XML processing part.
>
> >>
> >> Claude
>
>      Andy
>
> >>
> >> --
> >> I like: Like Like - The likeliest place on the web
> >> <http://like-like.xenei.com>
> >> LinkedIn: http://www.linkedin.com/in/claudewarren
> >>
> >
>


-- 
I like: Like Like - The likeliest place on the web
<http://like-like.xenei.com>
LinkedIn: http://www.linkedin.com/in/claudewarren

Reply via email to