buda-base / jena-issues

place to register issues with jena before raising at apache
0 stars 0 forks source link

failure in org.apache.jena.query.text.TextQueryPF.lambda #1

Open xristy opened 6 years ago

xristy commented 6 years ago

The query:

select ?s ?lbl
where {
  (?s ?sc ?lbl) text:query (skos:altLabel "er dao"@zh-latn-pinyin-x-ndia)
} limit 100

fails with following in catalina.out:

[2018-10-09 18:49:29] Fuseki     INFO  [843] POST http://buda1.bdrc.io:13180/fuseki/bdrcrw/query
[2018-10-09 18:49:29] Fuseki     INFO  [843] Query = PREFIX owl: <http://www.w3.org/2002/07/owl#> PREFIX adm: <http://purl.bdrc.io/ontology/admin/> PREFIX bdo: <http://purl.bdrc.io/ontology/core/> PREFIX bdr: <http://purl.bdrc.io/resource/> PREFIX text: <http://jena.apache.org/text#> PREFIX skos: <http://www.w3.org/2004/02/skos/core#> PREFIX lang: <http://ontologi.es/lang/core#> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> PREFIX bd: <http://www.bigdata.com/rdf#> PREFIX : <http://purl.bdrc.io/ontology/core/>  #select (count(?s) as ?c) #select ?s ?p ?o select ?s ?p ?lbl where { #  graph ?g { #  ?s skos:prefLabel ?lbl   (?s ?sc ?lbl) text:query (skos:altLabel "er dao"@zh-latn-pinyin-x-ndia) #    ?s skos:prefLabel ?lbl . #    ?s adm:status ?status #  filter (lang(?lbl) = "zh-x-phon-en") #  filter (lang(?lbl) != "en") #  filter (not exists {?s skos:prefLabel ?lbl} ) #  filter (?status != bdr:StatusReleased) #  } } LIMIT 100
[2018-10-09 18:49:29] QueryIterPlainWrapper ERROR QueryFatalException
org.apache.jena.sparql.ARQInternalErrorException: check(?lbl, null): null node value
    at org.apache.jena.sparql.engine.binding.BindingBase.checkPair(BindingBase.java:124)
    at org.apache.jena.sparql.engine.binding.BindingHashMap.checkAdd(BindingHashMap.java:96)
    at org.apache.jena.sparql.engine.binding.BindingHashMap.add(BindingHashMap.java:86)
    at org.apache.jena.query.text.TextQueryPF.lambda$resultsToQueryIterator$0(TextQueryPF.java:233)
    at org.apache.jena.atlas.iterator.Iter$2.next(Iter.java:270)
    at org.apache.jena.sparql.engine.iterator.QueryIterPlainWrapper.moveToNextBinding(QueryIterPlainWrapper.java:56)

rdfs:label also fails similarly.

OTOH, the query:

select ?s ?lbl
where {
  (?s ?sc ?lbl) text:query (skos:prefLabel "er dao"@zh-latn-pinyin-x-ndia)
} limit 100

works fine!

The same failure happens if the language tag is changed to zh-latn-pinyin

xristy commented 6 years ago

Well there is some sort of a problem in that there should not be such a failure; HOWEVER, the problem is created by my not expressing the query correctly. I left the outer quotes off of the query string.

If the query is issued thusly:

select ?s ?lbl
where {
  (?s ?sc ?lbl) text:query (skos:altLabel "\"er dao\""@zh-latn-pinyin-x-ndia)
 } limit 100

then sensible results are returned.