gklyne / milarq

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

Using MILARQ index property with non-list object causes server error #6

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
This server log shows the offending query and resulting error.

Changing the first line of the main query to

    { ?s claros:s-term-bysubject ("oinochoe")  . }

resolves the problem.

Note that I have created a new index with just one argument - the subject - to 
avoid having to use ORDER BY clauses to get consistent results for testing.

{{{
15:22:27 TRACE - zoo.sparqlite.Processor        :: [1] initialised request 
processor [http-8080-1]
15:22:27 INFO  - zoo.sparqlite.Processor        :: [1] begin processing request 
for path /combined
15:22:27 TRACE - zoo.sparqlite.Processor        :: [1] check if the endpoint 
exists [http-8080-1]
15:22:27 TRACE - zoo.sparqlite.Processor        :: [1] completed check endpoint 
exists in 0 ms [http-8080-1]
15:22:27 TRACE - zoo.sparqlite.Processor        :: [1] check the 
well-formedness of the request [http-8080-1]
15:22:27 TRACE - zoo.sparqlite.RequestWrapper   :: processing POST
15:22:27 TRACE - zoo.sparqlite.RequestWrapper   :: checking content type of 
POST request
15:22:27 TRACE - zoo.sparqlite.RequestWrapper   :: found content type: 
application/x-www-form-urlencoded
15:22:27 TRACE - zoo.sparqlite.RequestWrapper   :: split by ';' first token: 
'application/x-www-form-urlencoded'
15:22:27 TRACE - zoo.sparqlite.RequestWrapper   :: content type ok
15:22:27 TRACE - zoo.sparqlite.RequestWrapper   :: found query param: #
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#>
SELECT * WHERE
{ GRAPH ?g
  {
    { ?s claros:s-term-bysubject  "oinochoe"  . }
    {
      ?s crm:P14I.was_classified_by
          [ rdf:type crm:E17.Type_Assignment ;
            crm:P42.assigned
              [ a crm:E55.Type ; crm:P127.has_broader_term claros:Shape ; rdfs:label ?lit ]
          ] .
      FILTER regex( ?lit,  "oinochoe" , 'i')
    }
    { ?s rdf:type ?t . }
    { ?s claros:subject-objectType ?typ ; }
    {
      { ?s crm:P102.has_title [ rdf:type crm:E35.Title ; rdf:value ?desc ] }
      { ?s crm:P70I.is_documented_in ?link }
    }
  }
} OFFSET 5 LIMIT 5
15:22:27 TRACE - zoo.sparqlite.RequestWrapper   :: check query syntax
15:22:27 TRACE - zoo.sparqlite.RequestWrapper   :: using ARQ syntax
15:22:28 TRACE - zoo.sparqlite.RequestWrapper   :: parsed query ok
15:22:28 INFO  - zoo.sparqlite.Processor        :: [1] 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#>
SELECT * WHERE
{ GRAPH ?g
  {
    { ?s claros:s-term-bysubject  "oinochoe"  . }
    {
      ?s crm:P14I.was_classified_by
          [ rdf:type crm:E17.Type_Assignment ;
            crm:P42.assigned
              [ a crm:E55.Type ; crm:P127.has_broader_term claros:Shape ; rdfs:label ?lit ]
          ] .
      FILTER regex( ?lit,  "oinochoe" , 'i')
    }
    { ?s rdf:type ?t . }
    { ?s claros:subject-objectType ?typ ; }
    {
      { ?s crm:P102.has_title [ rdf:type crm:E35.Title ; rdf:value ?desc ] }
      { ?s crm:P70I.is_documented_in ?link }
    }
  }
} OFFSET 5 LIMIT 5
15:22:28 TRACE - zoo.sparqlite.Processor        :: [1] completed check request 
form in 137 ms [http-8080-1]
15:22:28 TRACE - zoo.sparqlite.Processor        :: [1] apply query policy rules 
[http-8080-1]
15:22:28 TRACE - zoo.sparqlite.QueryPolicy      :: apply query policy
15:22:28 TRACE - zoo.sparqlite.QueryPolicy      :: apply query form policy
15:22:28 TRACE - zoo.sparqlite.QueryPolicy      :: apply dataset description 
policy
15:22:28 TRACE - zoo.sparqlite.QueryPolicy      :: apply limit ceiling policy
15:22:28 TRACE - zoo.sparqlite.QueryPolicy      :: apply variable predicates 
policy
15:22:28 TRACE - zoo.sparqlite.QueryPolicy      :: no variable predicate policy 
found
15:22:28 TRACE - zoo.sparqlite.QueryPolicy      :: apply filter policy
15:22:28 TRACE - zoo.sparqlite.QueryPolicy      :: no variable predicate policy 
found
15:22:28 TRACE - zoo.sparqlite.Processor        :: [1] completed query policy 
in 3 ms [http-8080-1]
15:22:28 TRACE - zoo.sparqlite.Processor        :: [1] create a query execution 
[http-8080-1]
15:22:28 TRACE - zoo.sparqlite.EndpointTDB      :: exists guard condition
15:22:28 TRACE - sparqlite.config.Config        :: loading description model 
from 
/mnt/sdb3/home/graham/workspace35/.metadata/.plugins/org.eclipse.wst.server.core
/tmp1/wtpwebapps/claros_demo_server/WEB-INF/tdb/combined.ttl
15:22:28 TRACE - sparqlite.config.Config        :: description root is 
file:///mnt/sdb3/home/graham/workspace35/.metadata/.plugins/org.eclipse.wst.serv
er.core/tmp1/wtpwebapps/claros_demo_server/WEB-INF/tdb/combined.ttl#dataset
15:22:28 WARN  - jena.tdb.exec                  :: No BGP optimizer
15:22:28 TRACE - sparqlite.config.Config        :: description root is 
file:///mnt/sdb3/home/graham/workspace35/.metadata/.plugins/org.eclipse.wst.serv
er.core/tmp1/wtpwebapps/claros_demo_server/WEB-INF/tdb/combined.ttl#dataset
15:22:28 TRACE - sparqlite.config.Config        :: dataset root is 
file:///mnt/sdb3/home/graham/workspace35/.metadata/.plugins/org.eclipse.wst.serv
er.core/tmp1/wtpwebapps/claros_demo_server/WEB-INF/tdb/combined.ttl#dataset
15:22:28 TRACE - sparqlite.config.Config        :: LARQ location 
claros_demo_server/WebContent/WEB-INF/data/combined/lucene-literals provided
15:22:28 TRACE - zoo.sparqlite.EndpointTDB      :: create query execution
15:22:28 TRACE - zoo.sparqlite.EndpointTDB      :: set larq index
15:22:28 TRACE - zoo.sparqlite.Processor        :: [1] completed create query 
execution in 465 ms [http-8080-1]
15:22:28 TRACE - zoo.sparqlite.Processor        :: [1] execute the query 
[http-8080-1]
15:22:28 TRACE - zoo.sparqlite.Processor        :: [1] execute SELECT query 
[http-8080-1]
15:22:28 TRACE - zoo.sparqlite.Processor        :: [1] handle an unexpected 
exception [http-8080-1]
15:22:28 ERROR - zoo.sparqlite.Processor        :: [1] caught unexpected 
exception: caught exception during query execution: Single argument, list 
expected (object) to http://purl.org/NET/Claros/vocab#s-term-bysubject
com.hp.hpl.jena.query.QueryBuildException: Single argument, list expected 
(object) to http://purl.org/NET/Claros/vocab#s-term-bysubject
    at com.hp.hpl.jena.sparql.pfunction.PropertyFunctionBase.build(PropertyFunctionBase.java:61)
    at propertyfunctions.genericIndex.build(genericIndex.java:43)
    at com.hp.hpl.jena.sparql.procedure.ProcEval.build(ProcEval.java:55)
    at com.hp.hpl.jena.sparql.engine.main.OpExecutor.execute(OpExecutor.java:149)
    at com.hp.hpl.jena.sparql.engine.main.ExecutionDispatch.visit(ExecutionDispatch.java:79)
    at com.hp.hpl.jena.sparql.algebra.op.OpPropFunc.visit(OpPropFunc.java:55)
    at com.hp.hpl.jena.sparql.engine.main.ExecutionDispatch.exec(ExecutionDispatch.java:33)
    at com.hp.hpl.jena.sparql.engine.main.OpExecutor.executeOp(OpExecutor.java:103)
    at com.hp.hpl.jena.sparql.engine.main.OpExecutor.execute(OpExecutor.java:186)
    at com.hp.hpl.jena.sparql.engine.main.ExecutionDispatch.visit(ExecutionDispatch.java:93)
    at com.hp.hpl.jena.sparql.algebra.op.OpSequence.visit(OpSequence.java:64)
    at com.hp.hpl.jena.sparql.engine.main.ExecutionDispatch.exec(ExecutionDispatch.java:33)
    at com.hp.hpl.jena.sparql.engine.main.OpExecutor.executeOp(OpExecutor.java:103)
    at com.hp.hpl.jena.sparql.engine.main.OpExecutor.execute(OpExecutor.java:362)
    at com.hp.hpl.jena.sparql.engine.main.ExecutionDispatch.visit(ExecutionDispatch.java:241)
    at com.hp.hpl.jena.sparql.algebra.op.OpSlice.visit(OpSlice.java:39)
    at com.hp.hpl.jena.sparql.engine.main.ExecutionDispatch.exec(ExecutionDispatch.java:33)
    at com.hp.hpl.jena.sparql.engine.main.OpExecutor.executeOp(OpExecutor.java:103)
    at com.hp.hpl.jena.sparql.engine.main.OpExecutor.execute(OpExecutor.java:79)
    at com.hp.hpl.jena.sparql.engine.main.QC.execute(QC.java:40)
    at com.hp.hpl.jena.sparql.engine.main.QueryEngineMain.eval(QueryEngineMain.java:52)
    at com.hp.hpl.jena.tdb.solver.QueryEngineTDB.eval(QueryEngineTDB.java:112)
    at com.hp.hpl.jena.sparql.engine.QueryEngineBase.evaluate(QueryEngineBase.java:124)
    at com.hp.hpl.jena.sparql.engine.QueryEngineBase.createPlan(QueryEngineBase.java:98)
    at com.hp.hpl.jena.sparql.engine.QueryEngineBase.getPlan(QueryEngineBase.java:86)
    at com.hp.hpl.jena.tdb.solver.QueryEngineTDB$QueryEngineFactoryTDB.create(QueryEngineTDB.java:177)
    at com.hp.hpl.jena.sparql.engine.QueryExecutionBase.getPlan(QueryExecutionBase.java:266)
    at com.hp.hpl.jena.sparql.engine.QueryExecutionBase.startQueryIterator(QueryExecutionBase.java:243)
    at com.hp.hpl.jena.sparql.engine.QueryExecutionBase.execResultSet(QueryExecutionBase.java:248)
    at com.hp.hpl.jena.sparql.engine.QueryExecutionBase.execSelect(QueryExecutionBase.java:94)
    at uk.ac.ox.zoo.sparqlite.Processor.executeQuery(Processor.java:145)
    at uk.ac.ox.zoo.sparqlite.Processor.exec(Processor.java:64)
    at uk.ac.ox.zoo.sparqlite.ServletBase.doCommon(ServletBase.java:25)
    at uk.ac.ox.zoo.sparqlite.ServletTDB.doCommon(ServletTDB.java:55)
    at uk.ac.ox.zoo.sparqlite.ServletTDB.doPost(ServletTDB.java:47)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
    at java.lang.Thread.run(Thread.java:619)
15:22:28 TRACE - zoo.sparqlite.Processor        :: [1] try to send error 
response, code: 500, details: caught exception during query execution: Single 
argument, list expected (object) to 
http://purl.org/NET/Claros/vocab#s-term-bysubject [http-8080-1]
15:22:28 TRACE - zoo.sparqlite.Processor        :: [1] perform any final 
cleanup, release resources etc. [http-8080-1]
15:22:28 TRACE - zoo.sparqlite.Processor        :: [1] finalising request 
handler [http-8080-1]
15:22:28 TRACE - zoo.sparqlite.Processor        :: [1] close query execution 
[http-8080-1]
15:22:28 TRACE - zoo.sparqlite.Processor        :: [1] close endpoint 
[http-8080-1]
15:22:28 TRACE - zoo.sparqlite.EndpointTDB      :: close larq index
15:22:28 TRACE - zoo.sparqlite.EndpointTDB      :: close dataset
15:22:28 TRACE - zoo.sparqlite.Processor        :: [1] flush buffer 
[http-8080-1]
15:22:28 INFO  - zoo.sparqlite.Processor        :: [1] request processing 
completed in 689 ms
}}}

Original issue reported on code.google.com by gk-goo...@ninebynine.org on 14 Sep 2010 at 2:31

GoogleCodeExporter commented 9 years ago
If the object is not a list, pretend it's the corresponding one-element list.

Original comment by ehog.he...@googlemail.com on 17 Sep 2010 at 8:32

GoogleCodeExporter commented 9 years ago

Original comment by ehog.he...@googlemail.com on 17 Sep 2010 at 8:34