SmartDataAnalytics / RdfProcessingToolkit

Command line interface based RDF processing toolkit to run sequences of SPARQL statements ad-hoc on RDF datasets, streams of bindings and streams of named graphs with support for processing JSON, CSV and XML using function extensions
https://smartdataanalytics.github.io/RdfProcessingToolkit/
Other
40 stars 3 forks source link

Namespaces are note recognized inside of insert graph patterns #5

Closed GordianDziwis closed 5 years ago

GordianDziwis commented 6 years ago
LOAD <dcat.ttl>

PREFIX dct: <http://purl.org/dc/terms/>
PREFIX dcat: <http://www.w3.org/ns/dcat#>
INSERT {
?distribution
  eg:workload ?sourceString ;
  dcat:accessURL ?distribution ;
  eg:resultGraph ?distribution .
}
WHERE {
  ?distribution dct:isFormatOf ?sourceDistribution .
  ?sourceDistribution dcat:downloadURL ?sourceFile .
  ?sourceFile url:text ?source .
  BIND(STRDT(?source, xsd:json) AS ?sourceString)
}

# Create stops
INSERT {
  GRAPH ?x { ?s a dcat:Stop }  <--- not recognized
  GRAPH ?x { ?s eg:stopId ?i }
}
Aklakan commented 5 years ago

The reason this happened is, that originally each query was processed in isolation; so when iterating over sparql queries of an InputStream, prefix declarations on one query did not carry over to later ones.

Default behaviour of the iterator changed, so that prefix declarations now pertain to the rest of the stream until overridden by another prefix declaration.