gklyne / milarq

Automatically exported from code.google.com/p/milarq
0 stars 0 forks source link

Query with fewer variables than index data causes internal server error #2

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

Issue the following query via claros_test_server:
{{{
PREFIX rdf:    <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs:   <http://www.w3.org/2000/01/rdf-schema#>
PREFIX crm:    <http://purl.org/NET/crm-owl#>
PREFIX claros: <http://purl.org/NET/Claros/vocab#>
PREFIX pf:     <http://jena.hpl.hp.com/ARQ/property#>
PREFIX xsd:    <http://www.w3.org/2001/XMLSchema#>
PREFIX arqfn:  <java:uk.ac.ox.zoo.sparqlite.>
ASK
            {
              LET (?crmtypetarget := "LEKYTHOS")
              GRAPH ?g
              {
                ?s claros:subject-not-before ("LEKYTHOS" ?beg)
                ; rdf:type ?t
                .
                OPTIONAL { ?s crm:P102.has_title [ rdf:type crm:E35.Title ; rdf:value ?desc ] }
                OPTIONAL { ?s crm:P70I.is_documented_in ?lnk }
                ?s crm:P14I.was_classified_by
                   [ crm:P42.assigned
                     [ rdfs:label ?crmtypetarget
                     ]
                   ] .
                FILTER ( ?beg >= -0525 ) .
                FILTER ( ?end <= -0475 ) .
              }
            }
}}}

Results in an internal server error being reported.

Repeating the query with, say, "?s claros:subject-not-before ("LEKYTHOS" ?beg 
?end)" works fine.

(See WEB_INF/data/combined area in claros_test_server project for full config 
details.)

An excerpt from the server console log shows:
{{{
17:37:17 TRACE - zoo.sparqlite.RequestWrapper   :: parsed query ok
17:37:17 INFO  - zoo.sparqlite.Processor        :: [3] query: PREFIX rdf:    
<http://www.w3.org/1999/02/22-rdf-syntax-ns#>
            PREFIX rdfs:   <http://www.w3.org/2000/01/rdf-schema#>
            PREFIX crm:    <http://purl.org/NET/crm-owl#>
            PREFIX claros: <http://purl.org/NET/Claros/vocab#>
            PREFIX pf:     <http://jena.hpl.hp.com/ARQ/property#>
            PREFIX xsd:    <http://www.w3.org/2001/XMLSchema#>
            PREFIX arqfn:  <java:uk.ac.ox.zoo.sparqlite.>
            ASK
            {
              LET (?crmtypetarget := "LEKYTHOS")
              GRAPH ?g
              {
                ?s claros:subject-not-before ("LEKYTHOS" ?beg)
                ; claros:subject-not-after ("LEKYTHOS" ?end)
                ; rdf:type ?t
                .
                OPTIONAL { ?s crm:P102.has_title [ rdf:type crm:E35.Title ; rdf:value ?desc ] }
                OPTIONAL { ?s crm:P70I.is_documented_in ?lnk }
                ?s crm:P14I.was_classified_by
                   [ crm:P42.assigned
                     [ rdfs:label ?crmtypetarget
                     ]
                   ] .
                FILTER ( ?beg >= -0525 ) .
                FILTER ( ?end <= -0475 ) .
              }
            }
17:37:17 TRACE - zoo.sparqlite.Processor        :: [3] completed check request 
form in 14 ms [http-8080-1]
17:37:17 TRACE - zoo.sparqlite.Processor        :: [3] apply query policy rules 
[http-8080-1]
17:37:17 TRACE - zoo.sparqlite.QueryPolicy      :: apply query policy
17:37:17 TRACE - zoo.sparqlite.QueryPolicy      :: apply query form policy
17:37:17 TRACE - zoo.sparqlite.QueryPolicy      :: apply dataset description 
policy
17:37:17 TRACE - zoo.sparqlite.QueryPolicy      :: apply limit ceiling policy
17:37:17 TRACE - zoo.sparqlite.QueryPolicy      :: apply variable predicates 
policy
17:37:17 TRACE - zoo.sparqlite.QueryPolicy      :: no variable predicate policy 
found
17:37:17 TRACE - zoo.sparqlite.QueryPolicy      :: apply filter policy
17:37:17 TRACE - zoo.sparqlite.QueryPolicy      :: no variable predicate policy 
found
17:37:17 TRACE - zoo.sparqlite.Processor        :: [3] completed query policy 
in 0 ms [http-8080-1]
17:37:17 TRACE - zoo.sparqlite.Processor        :: [3] create a query execution 
[http-8080-1]
17:37:17 TRACE - zoo.sparqlite.EndpointTDB      :: exists guard condition
17:37:17 TRACE - sparqlite.config.Config        :: loading description model 
from 
/usr/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp1/wtpwebapps/cl
aros_test_server/WEB-INF/tdb/combined.ttl
17:37:17 TRACE - sparqlite.config.Config        :: description root is 
file:///usr/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp1/wtpweb
apps/claros_test_server/WEB-INF/tdb/combined.ttl#dataset
17:37:17 WARN  - jena.tdb.exec                  :: No BGP optimizer
17:37:17 TRACE - sparqlite.config.Config        :: description root is 
file:///usr/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp1/wtpweb
apps/claros_test_server/WEB-INF/tdb/combined.ttl#dataset
17:37:17 TRACE - sparqlite.config.Config        :: dataset root is 
file:///usr/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp1/wtpweb
apps/claros_test_server/WEB-INF/tdb/combined.ttl#dataset
17:37:17 TRACE - sparqlite.config.Config        :: LARQ location 
claros_test_server/WebContent/WEB-INF/data/combined/literals provided
17:37:17 TRACE - zoo.sparqlite.EndpointTDB      :: create query execution
17:37:17 TRACE - zoo.sparqlite.EndpointTDB      :: set larq index
17:37:17 TRACE - zoo.sparqlite.Processor        :: [3] completed create query 
execution in 36 ms [http-8080-1]
17:37:17 TRACE - zoo.sparqlite.Processor        :: [3] execute the query 
[http-8080-1]
17:37:17 TRACE - zoo.sparqlite.Processor        :: [3] execute ASK query 
[http-8080-1]
17:37:17 TRACE - propertyfunctions.genericIndex :: build
17:37:17 TRACE - propertyfunctions.genericIndex :: enableIndex: URI 
http://purl.org/NET/Claros/vocab#subject-not-after, term LEKYTHOS
17:37:17 TRACE - propertyfunctions.genericIndex :: enableIndex: dir 
claros_test_server/WebContent/WEB-INF/data/combined/indexes/term-na
17:37:17 TRACE - propertyfunctions.genericIndex :: enableIndex: indexFullName 
claros_test_server/WebContent/WEB-INF/data/combined/indexes/term-na/LEKYTHOS
17:37:17 TRACE - propertyfunctions.genericIndex :: build
17:37:17 TRACE - propertyfunctions.genericIndex :: enableIndex: URI 
http://purl.org/NET/Claros/vocab#subject-not-before, term LEKYTHOS
17:37:17 TRACE - propertyfunctions.genericIndex :: enableIndex: dir 
claros_test_server/WebContent/WEB-INF/data/combined/indexes/term-nb
17:37:17 TRACE - propertyfunctions.genericIndex :: enableIndex: indexFullName 
claros_test_server/WebContent/WEB-INF/data/combined/indexes/term-nb/LEKYTHOS
>> gi: returning ( ?beg = "-525"^^xsd:int ) -> ( ?s = 
<http://www.beazley.ox.ac.uk/record/6A1497E1-FC0B-4155-A5FE-9A1EE4C975DF> ) -> 
( ?crmtypetarget = "LEKYTHOS" ) -> [Root]
17:37:17 ERROR - sparql.pfunction.PropertyFunctionBase$RepeatApplyIterator :: 
Fatal exception: Node: 
http://www.beazley.ox.ac.uk/record/6A1497E1-FC0B-4155-A5FE-9A1EE4C975DF
17:37:17 ERROR - engine.iterator.QueryIterProcedure :: Fatal exception: Node: 
http://www.beazley.ox.ac.uk/record/6A1497E1-FC0B-4155-A5FE-9A1EE4C975DF
17:37:17 TRACE - zoo.sparqlite.Processor        :: [3] handle an unexpected 
exception [http-8080-1]
17:37:17 ERROR - zoo.sparqlite.Processor        :: [3] caught unexpected 
exception: caught exception during query execution: Node: 
http://www.beazley.ox.ac.uk/record/6A1497E1-FC0B-4155-A5FE-9A1EE4C975DF
com.hp.hpl.jena.sparql.core.Var$NotAVariableException: Node: 
http://www.beazley.ox.ac.uk/record/6A1497E1-FC0B-4155-A5FE-9A1EE4C975DF
    at com.hp.hpl.jena.sparql.core.Var.alloc(Var.java:41)
    at propertyfunctions.genericIndex.execEvaluated(genericIndex.java:71)
    at com.hp.hpl.jena.sparql.pfunction.PropertyFunctionEval.exec(PropertyFunctionEval.java:32)
    at com.hp.hpl.jena.sparql.pfunction.PropertyFunctionBase$RepeatApplyIterator.nextStage(PropertyFunctionBase.java:92)
    at com.hp.hpl.jena.sparql.engine.iterator.QueryIterRepeatApply.makeNextStage(QueryIterRepeatApply.java:94)
    at com.hp.hpl.jena.sparql.engine.iterator.QueryIterRepeatApply.hasNextBinding(QueryIterRepeatApply.java:55)
    at com.hp.hpl.jena.sparql.engine.iterator.QueryIteratorBase.hasNext(QueryIteratorBase.java:69)
    at com.hp.hpl.jena.sparql.engine.iterator.QueryIterProcedure.hasNextBinding(QueryIterProcedure.java:57)
    at com.hp.hpl.jena.sparql.engine.iterator.QueryIteratorBase.hasNext(QueryIteratorBase.java:69)
    at com.hp.hpl.jena.tdb.solver.OpExecutorTDB.optimizeExecuteQuads(OpExecutorTDB.java:201)
    at com.hp.hpl.jena.tdb.solver.OpExecutorTDB.execute(OpExecutorTDB.java:148)
    at com.hp.hpl.jena.sparql.engine.main.ExecutionDispatch.visit(ExecutionDispatch.java:51)
    at com.hp.hpl.jena.sparql.algebra.op.OpQuadPattern.visit(OpQuadPattern.java:80)
    at com.hp.hpl.jena.sparql.engine.main.ExecutionDispatch.exec(ExecutionDispatch.java:33)
 ...( and more)
}}}

Original issue reported on code.google.com by gk-goo...@ninebynine.org on 9 Sep 2010 at 4:49

GoogleCodeExporter commented 9 years ago

Original comment by gk-goo...@ninebynine.org on 10 Sep 2010 at 10:25

GoogleCodeExporter commented 9 years ago
Problem cannot be reproduced.  Suspecting spurious report of fixed by other 
changes.

Original comment by gk-goo...@ninebynine.org on 17 Sep 2010 at 9:50