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

ASF GitHub Bot commented on JENA-1424:
--------------------------------------

GitHub user afs opened a pull request:

    https://github.com/apache/jena/pull/311

    JENA-1424: load http

    There is also a has a minor change to `RDFParser`/`RDFParserBuilder` to put 
the convenience operations for parse-to-graph and parse-to-dataset on a 
`RDFParser`, not just on `RDFParserBuilder`.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/afs/jena JENA-1424-LOAD-http

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/jena/pull/311.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #311
    
----
commit f0255f1a032753dc8c8c39f83555f8c85945de7c
Author: Andy Seaborne <[email protected]>
Date:   2017-11-15T23:26:27Z

    RDFParser.parse for graph and datasetgraph

commit c3d6d17894b98f5fb340964cdd8e2f269e27acf0
Author: Andy Seaborne <[email protected]>
Date:   2017-11-15T23:26:47Z

    JENA-1424: LOAD with conneg

----


> LOAD ... INTO GRAPH relies too much on filename extension
> ---------------------------------------------------------
>
>                 Key: JENA-1424
>                 URL: https://issues.apache.org/jira/browse/JENA-1424
>             Project: Apache Jena
>          Issue Type: Bug
>    Affects Versions: Jena 3.5.0
>         Environment: Ubuntu 16.04
>            Reporter: Osma Suominen
>            Priority: Minor
>
> I tried to perform this SPARQL Update on an empty TDB:
> {noformat}
> LOAD <http://api.finto.fi/rest/v1/yso/data> INTO GRAPH 
> <http://www.yso.fi/onto/yso/>
> {noformat}
> but got this error from tdbupdate:
> {noformat}
> $ tdbupdate --loc tdb --update=load-yso.ru 
> org.apache.jena.update.UpdateException: Attempt to load quads into a graph
>         at 
> org.apache.jena.sparql.modify.UpdateEngineWorker.visit(UpdateEngineWorker.java:146)
>         at 
> org.apache.jena.sparql.modify.request.UpdateLoad.visit(UpdateLoad.java:64)
>         at 
> org.apache.jena.sparql.modify.UpdateVisitorSink.send(UpdateVisitorSink.java:46)
>         at 
> org.apache.jena.sparql.modify.UpdateVisitorSink.send(UpdateVisitorSink.java:26)
>         at org.apache.jena.atlas.iterator.Iter.sendToSink(Iter.java:546)
>         at org.apache.jena.atlas.iterator.Iter.sendToSink(Iter.java:553)
>         at 
> org.apache.jena.sparql.modify.UpdateProcessorBase.execute(UpdateProcessorBase.java:59)
>         at arq.update.execOneFile(update.java:105)
>         at arq.update.execUpdate(update.java:81)
>         at arq.cmdline.CmdUpdate.exec(CmdUpdate.java:63)
>         at jena.cmd.CmdMain.mainMethod(CmdMain.java:93)
>         at jena.cmd.CmdMain.mainRun(CmdMain.java:58)
>         at jena.cmd.CmdMain.mainRun(CmdMain.java:45)
>         at tdb.tdbupdate.main(tdbupdate.java:37)
> {noformat}
> So basically Jena is complaining that I'm trying to load quads into a graph. 
> But that's not true. The URL specified in the LOAD actually performs content 
> negotiation and then redirects (302) either to an RDF/XML or a Turtle 
> serialization (with the proper Content-type headers), both are graphs not 
> quads.
> The problem seems to be that UpdateEngineWorker checks the URL specified in 
> the LOAD as if it were a filename and throws an exception if its file 
> extension doesn't match the known graph formats. In this case there is no 
> extension so it won't match.
> The check was introduced 6 months ago in this commit:
> https://github.com/apache/jena/commit/931a437bb49fecdb1cb70a5e6225e27141dec86c#diff-d0b3b8995c502712dac778f5bb61bc9dR146
> If I use the URL that the above URL redirects to, which contains a .ttl file 
> extension, loading works fine:
> {noformat}
> LOAD <http://api.finto.fi/download/yso/yso-skos.ttl> INTO GRAPH 
> <http://www.yso.fi/onto/yso/>
> {noformat}
> But this means that the LOAD ... INTO GRAPH ... command cannot be used with 
> arbitrary Linked Data URIs, just ones that happen to contain a file extension 
> like .ttl or .rdf or .nt.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to