Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
Jena 3.0.1, Jena 3.1.0, Jena 3.1.1, Jena 3.2.0, Jena 3.3.0, Jena 3.4.0, Jena 3.5.0, Jena 3.6.0
-
None
Description
Similar to JENA-1462, but there seems to be special handling of file: URLs in RDF/XML parsing, where parsing an RDF/XML file like:
<rdf:RDF xml:base="file://example.com/nested/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"> <rdf:Description rdf:about="foo.txt"> <rdfs:seeAlso rdf:resource="/bar.txt"/> </rdf:Description> </rdf:RDF>
using
RDFDataMgr.read(m, load("file-base.rdf"), Lang.RDFXML);
(Note, load() returns a InputStream, no explicit base)
it comes out wrongly as:
<file:///example.com/nested/foo.txt> <http://www.w3.org/2000/01/rdf-schema#seeAlso> <file:///example.com/bar.txt> .
Notice the hostname somehow became part of the path, now with a file:/// with no hostname.
*Note: *https://tools.ietf.org/html/rfc8089#section-2 says that file URIs can have a hostname, as well as the obvious hostname "localhost", this is typically used to address Windows shares no remote hosts.
Equivalent in Turtle parses fine:
@base <file://example.com/nested/> . @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . <foo.txt> rdfs:seeAlso </bar.txt> .
becomes:
<file://example.com/nested/foo.txt> <http://www.w3.org/2000/01/rdf-schema#seeAlso> <file://example.com/bar.txt> .
Equivalent RDF/XML without xml:base and passing file://example.com/nested/ as Base also fails:
RDFDataMgr.read(m, load("rel.rdf"), "file://example.com/nested/", Lang.RDFXML);
Attachments
Issue Links
- relates to
-
JENA-1462 RDF/XML parsing fails on newer/provisional/private URI schemes in base URI
- Closed
- links to