Page MenuHomePhabricator

SELECT * on query with no variables and property path results in NotMaterializedException
Closed, ResolvedPublic

Description

Example 1:

SELECT * WHERE {
  wd:Q4176 wdt:P31/wdt:P279 wd:Q16970.
}

Example 2, more stable against changes on Wikidata:

SELECT * WHERE {
  wikibase:Dump a/^a wikibase:Dump.
}


Caused by: org.openrdf.query.QueryEvaluationException: com.bigdata.rdf.internal.NotMaterializedException: TermId(248U)
at com.bigdata.rdf.sail.Bigdata2Sesame2BindingSetIterator.hasNext(Bigdata2Sesame2BindingSetIterator.java:188)
at info.aduna.iteration.IterationWrapper.hasNext(IterationWrapper.java:68)
at org.openrdf.query.QueryResults.report(QueryResults.java:155)
at org.openrdf.repository.sail.SailTupleQuery.evaluate(SailTupleQuery.java:76)
at com.bigdata.rdf.sail.webapp.BigdataRDFContext$TupleQueryTask.doQuery(BigdataRDFContext.java:1713)
at com.bigdata.rdf.sail.webapp.BigdataRDFContext$AbstractQueryTask.innerCall(BigdataRDFContext.java:1569)
at com.bigdata.rdf.sail.webapp.BigdataRDFContext$AbstractQueryTask.call(BigdataRDFContext.java:1534)
at com.bigdata.rdf.sail.webapp.BigdataRDFContext$AbstractQueryTask.call(BigdataRDFContext.java:747)
... 4 more
Caused by: com.bigdata.rdf.internal.NotMaterializedException: TermId(248U)
at com.bigdata.rdf.internal.impl.AbstractIV.getValue(AbstractIV.java:993)
at com.bigdata.rdf.sail.Bigdata2Sesame2BindingSetIterator.getBindingSet(Bigdata2Sesame2BindingSetIterator.java:298)
at com.bigdata.rdf.sail.Bigdata2Sesame2BindingSetIterator.hasNext(Bigdata2Sesame2BindingSetIterator.java:140)
... 11 more

It works if the query has a simple predicate instead of a path:

SELECT * WHERE {
  wikibase:Dump a schema:Dataset.
}

Selecting some bogus variable explicitly also works:

SELECT ?_ WHERE {
  wikibase:Dump a/^a wikibase:Dump.
}

(Yes, I know all of these should really be ASK queries.)

Event Timeline

Restricted Application added a project: Discovery. · View Herald TranscriptJun 23 2017, 5:59 PM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript
Smalyshev triaged this task as Low priority.Jun 23 2017, 7:37 PM
Smalyshev added a project: Upstream.

Yeah this looks like ASK queries. Still shouldn't NME, but this is probably low-priority issue.

Change 533109 had a related patch set uploaded (by Igor Kim; owner: Igor Kim):
[wikidata/query/blazegraph@master] T168741 Fix NME in query with no variables and property path

https://gerrit.wikimedia.org/r/533109

Change 533109 merged by Smalyshev:
[wikidata/query/blazegraph@master] T168741 Fix NME in query with no variables and property path

https://gerrit.wikimedia.org/r/533109

debt closed this task as Resolved.Sep 5 2019, 6:46 PM
debt claimed this task.