[ https://issues.apache.org/jira/browse/JENA-1463?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16326158#comment-16326158 ]
ASF subversion and git services commented on JENA-1463: ------------------------------------------------------- Commit 1d037e80dfd8a91e9c4042f65695cadec4b17097 in jena's branch refs/heads/master from [~andy.seaborne] [ https://git-wip-us.apache.org/repos/asf?p=jena.git;h=1d037e8 ] JENA-1463: Fix for file://host/path > RDF/XML parsing of file://hostname/ base URI miswrites URI > ---------------------------------------------------------- > > Key: JENA-1463 > URL: https://issues.apache.org/jira/browse/JENA-1463 > Project: Apache Jena > Issue Type: Bug > Components: ARQ, RDF/XML > Affects Versions: 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 > Reporter: Stian Soiland-Reyes > Assignee: Andy Seaborne > Priority: Major > > 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: > {code:xml} > <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> > {code} > using > {code} > RDFDataMgr.read(m, load("file-base.rdf"), Lang.RDFXML); > {code} > (Note, load() returns a InputStream, no explicit base) > it comes out wrongly as: > {code} > <file:///example.com/nested/foo.txt> > <http://www.w3.org/2000/01/rdf-schema#seeAlso> <file:///example.com/bar.txt> . > {code} > 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: > {code} > @base <file://example.com/nested/> . > @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . > <foo.txt> rdfs:seeAlso </bar.txt> . > {code} > becomes: > {code} > <file://example.com/nested/foo.txt> > <http://www.w3.org/2000/01/rdf-schema#seeAlso> <file://example.com/bar.txt> . > {code} > Equivalent RDF/XML without xml:base and passing file://example.com/nested/ as > Base also fails: > {code:java} > RDFDataMgr.read(m, load("rel.rdf"), "file://example.com/nested/", > Lang.RDFXML); > {code} -- This message was sent by Atlassian JIRA (v7.6.3#76005)