You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jena.apache.org by Andy Seaborne <an...@apache.org> on 2023/03/02 10:03:25 UTC

Re: Evolving RDF/XML support and ARP.


On 26/02/2023 17:08, Andy Seaborne wrote:
> 
> 
> On 24/02/2023 14:24, Andy Seaborne wrote:
>> Issue for updating ARP to use IRIx, as described below.
>>
>> https://github.com/apache/jena/issues/1773
>>
>> Draft PR:
>>
>> https://github.com/apache/jena/pull/1774
> 
> This has xmlinput0 (the state of ARP 4.7.0, using jena-iri directly) 
> with ARP0 and RDFXMLReader0 as classes.
> 
> The package xmlinput is the updated RDF/XML parsing code. The class ARP 
> in xmlinput is deprecated as a warning that running ARP without the rest 
> of Jena is not going to continue except while xmlinput0 exists.
> 
>      Andy

Merged.

It would be good if users that have "file:" ontology imports try out the 
development build now this is merged.

The treatment of file URIs with a relative file path is different 
between RDF/XML and other formats that resolve URIs: Turtle/TriG and SPARQL.

Base = file:///home/somePath/
Turtle::

PREFIX ex: <file:///example/>
<x> ex:p <file:rel> .

gives for the object:
     <file:///home/somePath/rel> .

whereas

RDF/XML::

<rdf:RDF
    xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#'
    xmlns:ex='file:///example/'>
   <rdf:Description rdf:about="x">
     <ex:p rdf:resource="file:rel"/>
   </rdf:Description>
</rdf:RDF>

gives
     <file:rel> .

RDF/XML is treating a file: URL as an opaque URL (terminology from RFC 
2396 which disappeared in RFC 3986).

PR:1774 makes RDF/XML resolve relative "file:" paths at parsing time.

This impacts tracking owl:imports where there are "file:" URLs with a 
filesystem-relative path. It matters when reading a local RDF/XML file 
from a different directory to where the file resides.  There is a change 
to track imports by resolved URI rather than unresolved URI. (Actually, 
it'll depend whether the import is referenced from Turtle or from RDF/XML.)

The better to handle relative URI references is not to include the scheme.

Generally to preserve relative URIs, the safe way is have a custom URI 
scheme "relative:" and remove that after processing.

     Andy