[ 
https://issues.apache.org/jira/browse/JENA-1463?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16329393#comment-16329393
 ] 

ASF subversion and git services commented on JENA-1463:
-------------------------------------------------------

Commit bfd45548aa808fe44c558115ad6bd5fcb393ac6c in jena's branch 
refs/heads/master from [~stain]
[ https://git-wip-us.apache.org/repos/asf?p=jena.git;h=bfd4554 ]

JENA-1463: test @base/xml:base file://example.com/


> 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
>             Fix For: Jena 3.7.0
>
>
> 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)

Reply via email to