Uploaded image for project: 'Apache Jena'
  1. Apache Jena
  2. JENA-1772

jena-text-es: exception if no limit supplied to text:query.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • Jena 3.12.0
    • Jena 3.14.0
    • Text
    • None

    Description

      Taken from:

      https://stackoverflow.com/questions/58457087/does-the-text-query-es-module-require-limit-in-the-sparql-syntax

      if there is no limit in the text:query, there is a exception from ElasticSearch.

      PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
      PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
      PREFIX text: <http://jena.apache.org/text#>
      
      SELECT ?subject ?object
      WHERE {
          ?subject text:query ('Whatever').
          ?subject rdfs:label ?object .
      }
      

      causes:

      [2019-10-18 14:27:56] Fuseki     INFO  [31] Query = PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>   PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>   PREFIX text: <http://jena.apache.
      org/text#>  SELECT ?subject ?object WHERE { ?subject text:query ('Whatever'). ?subject rdfs:label ?object . }
      [2019-10-18 14:27:56] Fuseki     WARN  [31] RC = 500 : [size] parameter cannot be negative, found [-1]
      java.lang.IllegalArgumentException: [size] parameter cannot be negative, found [-1]
              at org.elasticsearch.search.builder.SearchSourceBuilder.size(SearchSourceBuilder.java:382)
              at org.elasticsearch.action.search.SearchRequestBuilder.setSize(SearchRequestBuilder.java:204)
              at org.apache.jena.query.text.es.TextIndexES.query(TextIndexES.java:403)
              at org.apache.jena.query.text.es.TextIndexES.query(TextIndexES.java:378)
              at org.apache.jena.query.text.TextQueryPF.performQuery(TextQueryPF.java:346)
              at org.apache.jena.query.text.TextQueryPF.query(TextQueryPF.java:284)
              at org.apache.jena.query.text.TextQueryPF.variableSubject(TextQueryPF.java:247)
              at org.apache.jena.query.text.TextQueryPF.exec(TextQueryPF.java:211)
              at org.apache.jena.sparql.pfunction.PropertyFunctionBase$RepeatApplyIteratorPF.nextStage(PropertyFunctionBase.java:106)
      

      Attachments

        Issue Links

          Activity

            People

              andy Andy Seaborne
              andy Andy Seaborne
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 20m
                  20m