the-qa-company / qEndpoint

A highly scalable RDF triple store with full-text and GeoSPARQL support
https://the-qa-company.com/products/qEndpoint
Other
66 stars 8 forks source link

Queries failing on new multi-section dictionary lang #409

Closed D063520 closed 1 year ago

D063520 commented 1 year ago

Part of the endpoint? (leave empty if you don't know)

Description of the issue

I get this error:

java.lang.NullPointerException: Cannot invoke "com.the_qa_company.qendpoint.core.enums.RDFNodeType.ordinal()" because "nodeType" is null
    at com.the_qa_company.qendpoint.store.HDTConverter.idToValue(HDTConverter.java:210)
    at com.the_qa_company.qendpoint.store.HDTConverter.idToObjectHDTResource(HDTConverter.java:252)
    at com.the_qa_company.qendpoint.store.HDTConverter.idToHDTValue(HDTConverter.java:316)
    at com.the_qa_company.qendpoint.utils.VariableToIdSubstitution$Substituor.meet(VariableToIdSubstitution.java:66)
    at org.eclipse.rdf4j.query.algebra.Var.visit(Var.java:97)
    at org.eclipse.rdf4j.query.algebra.StatementPattern.visitChildren(StatementPattern.java:343)
    at org.eclipse.rdf4j.query.algebra.helpers.AbstractQueryModelVisitor.meetNode(AbstractQueryModelVisitor.java:582)
    at org.eclipse.rdf4j.query.algebra.helpers.AbstractQueryModelVisitor.meet(AbstractQueryModelVisitor.java:465)
    at org.eclipse.rdf4j.query.algebra.StatementPattern.visit(StatementPattern.java:334)
    at org.eclipse.rdf4j.query.algebra.BinaryTupleOperator.visitChildren(BinaryTupleOperator.java:105)

when executing this query:

PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX schema: <http://schema.org/>
PREFIX geo: <http://www.opengis.net/ont/geosparql#>
PREFIX bag: <http://bag.basisregistraties.overheid.nl/def/bag#>

SELECT ?s0 ?pageRank ?label ?description ?image ?coordinates ?latitude ?longitude
  ?timeSeries ?osmRelation ?youtube ?github ?twitter ?facebook ?instagram ?homepage
  ?orcid ?linkedin ?doi ?geometry ?wikipedia
WHERE {
  {
    SELECT ?s0
    WHERE {
      VALUES ?s0 { <http://vocabulary.semantic-web.at/cocktails/2d85fb1b-96cb-4c48-8df5-707032f34e71> }
    }
  }

  OPTIONAL {
    ?s0 <http://www.w3.org/2000/01/rdf-schema#label> ?label .
    FILTER (lang(?label) = "en" || lang(?label) = "")
  }
  OPTIONAL {
    ?s0 <http://www.w3.org/2004/02/skos/core#prefLabel> ?label .
    FILTER (lang(?label) = "en" || lang(?label) = "")
  }
  OPTIONAL {
    ?s0 <http://purl.org/dc/terms/title> ?label .
    FILTER (lang(?label) = "en" || lang(?label) = "")
  }
  OPTIONAL {
    ?s0 <http://xmlns.com/foaf/0.1/givenName> ?label .
    FILTER (lang(?label) = "en" || lang(?label) = "")
  }
  OPTIONAL {
    ?s0 <http://purl.org/dc/elements/1.1/title> ?label .
    FILTER (lang(?label) = "en" || lang(?label) = "")
  }
  OPTIONAL {
    ?s0 <http://www.w3.org/ns/sosa/hasSimpleResult> ?label .
    FILTER (lang(?label) = "en" || lang(?label) = "")
  }
  OPTIONAL {
    ?s0 <http://www.w3.org/2000/01/rdf-schema#description> ?description .
    FILTER (lang(?description) = "en" || lang(?description) = "")
  }
  OPTIONAL {
    ?s0 <http://schema.org/description> ?description .
    FILTER (lang(?description) = "en" || lang(?description) = "")
  }
  OPTIONAL {
    ?s0 <http://www.wikidata.org/prop/direct/P18> ?image .
  }
  OPTIONAL {
    ?s0 <http://www.wikidata.org/prop/direct/P625> ?coordinates .
  }
  OPTIONAL {
    ?s0 <http://www.w3.org/2003/01/geo/wgs84_pos#lat> ?latitude .
    ?s0 <http://www.w3.org/2003/01/geo/wgs84_pos#long> ?longitude .
  }
  OPTIONAL {
    ?s0 <http://www.w3.org/ns/sosa/resultTime> ?timeSeries .
  }
  OPTIONAL {
    ?s0 <http://www.wikidata.org/prop/direct/P402> ?osmRelation .
  }
  OPTIONAL {
    ?s0 <http://www.wikidata.org/prop/direct/P165> ?youtube .
  }
  OPTIONAL {
    ?s0 <http://www.wikidata.org/prop/direct/P2037> ?github .
  }
  OPTIONAL {
    ?s0 <http://www.wikidata.org/prop/direct/P2002> ?twitter .
  }
  OPTIONAL {
    ?s0 <http://www.wikidata.org/prop/direct/P2013> ?facebook .
  }
  OPTIONAL {
    ?s0 <http://www.wikidata.org/prop/direct/P2003> ?instagram .
  }
  OPTIONAL {
    ?s0 <http://www.wikidata.org/prop/direct/P856> ?homepage .
  }
  OPTIONAL {
    ?s0 <http://www.wikidata.org/prop/direct/P496> ?orcid .
  }
  OPTIONAL {
    ?s0 <http://www.wikidata.org/prop/direct/P6634> ?linkedin .
  }
  OPTIONAL {
    ?s0 <http://www.wikidata.org/prop/direct/P356> ?doi .
  }
  OPTIONAL {
    ?s0 <http://www.opengis.net/ont/geosparql#hasGeometry> ?geometry .
  }
  OPTIONAL {
    ?wikipedia schema:about ?s0 ;
               schema:isPartOf <https://en.wikipedia.org/> .
  }
}
LIMIT 1000

on top of the following HDT file.

index_big.hdt.zip

Excepted behavior

No response

Obtained behavior

No response

How to reproduce

No response

Endpoint version

1.13.4

Do I want to contribute to fix it?

None

Something else?

No response

D063520 commented 1 year ago

I still get errors. For example for this query:

PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT * WHERE {
 ?s0 <http://purl.org/voc/vrank#pagerank> ?pageRank .
} LIMIT 10

com.the_qa_company.qendpoint.store.exception.EndpointStoreException: Can't find HDT ID: 0

D063520 commented 1 year ago

The same query I posted at the beginning of the issue is now returning:

Cannot invoke "java.lang.CharSequence.toString()" because the return value of "com.the_qa_company.qendpoint.core.dictionary.Dictionary.idToString(long, com.the_qa_company.qendpoint.core.enums.TripleComponentRole)" is null

The problematic part seams to be:

OPTIONAL{ ?wikipedia schema:about ?s0 ; schema:isPartOf <https://en.wikipedia.org/> .}