Details
-
Bug
-
Status: Closed
-
Trivial
-
Resolution: Fixed
-
Fuseki 1.0.0
-
None
Description
A SPARQL Update query with a LOAD command requires a correct HTTP content-type (mime-type) to be returned with the GET request when downloading the file.
Should have 2 failovers:
1. Attempt to use file ending. .ttl == TTL .xml == RDF/XML and so on
2. Attempt to read the file with a different language (eg. if TTL fails, try RDF/XML)
The code for this seems to be here: https://svn.apache.org/repos/asf/jena/trunk/jena-arq/src/main/java/com/hp/hpl/jena/sparql/modify/UpdateEngineWorker.java
@Override
public void visit(UpdateLoad update)
{
String source = update.getSource() ;
Node dest = update.getDest() ;
try {
// Read into temporary storage to protect against parse errors.
TypedInputStream s = RDFDataMgr.open(source) ;
Lang lang = RDFLanguages.contentTypeToLang(s.getContentType()) ; //--- THIS IS WHERE THE BUG IS ---//
if ( RDFLanguages.isTriples(lang) )
else {
// Quads
if ( dest != null )
throw new UpdateException("Attempt to load quads into a graph") ;
DatasetGraph dsg = DatasetGraphFactory.createMem() ;
StreamRDF stream = StreamRDFLib.dataset(dsg) ;
RDFDataMgr.parse(stream, s, source) ;
Iterator<Quad> iter = dsg.find() ;
for ( ; iter.hasNext() ; )
}
} catch (RuntimeException ex)
{
if ( ! update.getSilent() )
}
}