I am using the Blazegraph Database to run a very simple query. For my dataset, I have .ttl and .nq files. I am loading the files using Blazegraph's Bulk Data Loader. Here is my query:
SELECT DISTINCT ?g
WHERE {
GRAPH ?g { ?s ?p ?o }
}
I expect an output of the distinct graph names. However, here is the error I am getting:
java.util.concurrent.ExecutionException: java.util.concurrent.ExecutionException: com.bigdata.rdf.sparql.ast.QuadsOperationInTriplesModeException: Use of WITH and GRAPH constructs in query body is not supported in triples mode.
In my RWStore.properties, here are the two main flags for setup (there are more but these are the related ones):
com.bigdata.rdf.sail.truthMaintenance=false
com.bigdata.rdf.store.AbstractTripleStore.quads=true
This is how I am loading the files and running the jar:
java -Xmx4g -cp /pathto/blazegraph.jar com.bigdata.rdf.store.DataLoader -verbose -namespace kb /pathto/RWStore.properties /pathto/data
java -server -Xmx4g -jar -Djetty.host=0.0.0.0 /pathto/blazegraph.jar
Also, here is something to note: I am able to run the same queries when I manually load the files via python (sparql.SPARQLServer.update(file)). I don't get this error then.
Can someone help me with this error? I can't find any solution anywhere!
I found a solution! The problem was because of the different format of the files being loaded by BulkDataLoader. Triples don't have a named graph while quads do, and so while querying, there was a mismatch which is the error in my question. This isn't the case when you manually upload the files (via workbench or python).
These are the changes I made:
quads.properties:
triples.properties:
For .nq files:
For .ttl files:
To start Blazegraph after loading files:
Hope this helps others facing a similar issue!