11 Replies Latest reply on Aug 23, 2010 7:47 PM by alwu-Oracle

    Joseki result not complete

    784525
      Hi,
      I've run into another problem when executing queries against Joseki. For one of the queries, the xml result isn't well formed. It has an opening <sparql> tag, and numerous results, but not all of the results I expected to receive and no closing xml tags. It's like the result output got truncated. To make things more interesting, it appears that some variables have the wrong values bound to them. (vars which should only be textual containing numeric values and vice versa)

      The original query had to be modified changing ?comment to ?comm as a binding variable since that's a reserved word.

      I'm wondering if the data load could have screwed up encountering a rdf predicate named "comment"? I used SQL*Loader to stage the triples in a staging table and then ran sem_apis.bulk_load_from_staging_table to populate the model. It returned no errors whatsoever, and aside from the truncated output, Joseki doesn't throw any exceptions either.

      The Query I executed can be found below, I've uploaded the Tomcat log, the dataset I loaded, the truncated results Joseki returned, and the results I expected to get back. You can download all of these files here.

      PREFIX bsbm-inst: <http://www4.wiwiss.fu-berlin.de/bizer/bsbm/v01/instances/>
      PREFIX bsbm: <http://www4.wiwiss.fu-berlin.de/bizer/bsbm/v01/vocabulary/>
      PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
      PREFIX dc: <http://purl.org/dc/elements/1.1/>

      SELECT ?label ?comm ?producer ?productFeature ?propertyTextual1 ?propertyTextual2 ?propertyTextual3
      ?propertyNumeric1 ?propertyNumeric2 ?propertyTextual4 ?propertyTextual5 ?propertyNumeric4
      WHERE {
      <http://www4.wiwiss.fu-berlin.de/bizer/bsbm/v01/instances/dataFromProducer26/Product1222> rdfs:label ?label .
      <http://www4.wiwiss.fu-berlin.de/bizer/bsbm/v01/instances/dataFromProducer26/Product1222> rdfs:comment ?comm .
      <http://www4.wiwiss.fu-berlin.de/bizer/bsbm/v01/instances/dataFromProducer26/Product1222> bsbm:producer ?p .
      ?p rdfs:label ?producer .
      <http://www4.wiwiss.fu-berlin.de/bizer/bsbm/v01/instances/dataFromProducer26/Product1222> dc:publisher ?p .
      <http://www4.wiwiss.fu-berlin.de/bizer/bsbm/v01/instances/dataFromProducer26/Product1222> bsbm:productFeature ?f .
      ?f rdfs:label ?productFeature .
      <http://www4.wiwiss.fu-berlin.de/bizer/bsbm/v01/instances/dataFromProducer26/Product1222> bsbm:productPropertyTextual1 ?propertyTextual1 .
      <http://www4.wiwiss.fu-berlin.de/bizer/bsbm/v01/instances/dataFromProducer26/Product1222> bsbm:productPropertyTextual2 ?propertyTextual2 .
      <http://www4.wiwiss.fu-berlin.de/bizer/bsbm/v01/instances/dataFromProducer26/Product1222> bsbm:productPropertyTextual3 ?propertyTextual3 .
      <http://www4.wiwiss.fu-berlin.de/bizer/bsbm/v01/instances/dataFromProducer26/Product1222> bsbm:productPropertyNumeric1 ?propertyNumeric1 .
      <http://www4.wiwiss.fu-berlin.de/bizer/bsbm/v01/instances/dataFromProducer26/Product1222> bsbm:productPropertyNumeric2 ?propertyNumeric2 .
      OPTIONAL { <http://www4.wiwiss.fu-berlin.de/bizer/bsbm/v01/instances/dataFromProducer26/Product1222> bsbm:productPropertyTextual4 ?propertyTextual4 }
      OPTIONAL { <http://www4.wiwiss.fu-berlin.de/bizer/bsbm/v01/instances/dataFromProducer26/Product1222> bsbm:productPropertyTextual5 ?propertyTextual5 }
      OPTIONAL { <http://www4.wiwiss.fu-berlin.de/bizer/bsbm/v01/instances/dataFromProducer26/Product1222> bsbm:productPropertyNumeric4 ?propertyNumeric4 }
      }
        • 1. Re: Joseki result not complete
          alwu-Oracle
          Hi,

          I loaded the dataset and run the query from Jena API directly. No problems found. I can see the complete output (in XML).
          Then I used Chrome to connect to Joseki (http://<host>:7001/joseki), pasted in the exact SPARQL query (I cleared out the XSLT style sheet field),
          and clicked "Submit Query," again, I see a complete query result.

          Result snippet shown below.

          <?xml version="1.0"?>
          <sparql xmlns="http://www.w3.org/2005/sparql-results#">
          <head>
          <variable name="label"/>
          <variable name="comm"/>
          <variable name="producer"/>
          <variable name="productFeature"/>
          <variable name="propertyTextual1"/>
          <variable name="propertyTextual2"/>
          <variable name="propertyTextual3"/>
          <variable name="propertyNumeric1"/>
          <variable name="propertyNumeric2"/>
          <variable name="propertyTextual4"/>
          <variable name="propertyTextual5"/>
          <variable name="propertyNumeric4"/>
          </head>
          <results>
          <result>
          ...

          <binding name="propertyNumeric4">
          <literal datatype="http://www.w3.org/2001/XMLSchema#decimal">175</literal>
          </binding>
          </result>
          </results>
          </sparql>

          Thanks,

          Zhe Wu
          • 2. Re: Joseki result not complete
            alwu-Oracle
            Now regarding to the variable binding order mixed up, does it help to add the following to the beginning of your SPARQL query?

            PREFIX ORACLE_SEM_FS_NS: <http://oracle.com/semtech#PLAIN_SQL_OPT=F>

            Thanks,

            Zhe Wu
            • 3. Re: Joseki result not complete
              766393
              Hi,

              @Zhe :
              I had the same kind of result (incomplete XML) when I used Joseki to query results containing very large literals :
              Oracle RDF / Joseki : issue with large literals
              You gave me a fix to the CLOB issue. But this fix created the second issue that nyoung is having here : mixed up variable binding.
              I just tried your PLAIN_SQL_OPT=F option and it solved my problem.

              Are the two issues related ? Is there a downside to using this option systematically ?

              Thanks,
              Cheers,

              Julien
              • 4. Re: Joseki result not complete
                alwu-Oracle
                Hi Julien,

                These two issues are not related. That is why we ask you for a reproducible test case. Still waiting for that...

                Are you using property path queries? If not, you can use this option systematically.

                Thanks,

                Zhe Wu
                • 5. Re: Joseki result not complete
                  766393
                  Hi,

                  Thanks for your reply.
                  If these issues are not related I will stop disturbing nyoung's thread and get back to you regarding the other issue by email.

                  Thanks,
                  Regards,
                  Julien
                  • 6. Re: Joseki result not complete
                    alwu-Oracle
                    Thanks. Not a problem at all.

                    Zhe Wu
                    • 7. Re: Joseki result not complete
                      784525
                      Hi Zhe,
                      I originally tried submitting the query through the Joseki web page on Firefox, but Chrome exhibits the same behavior. Our software is using Java's HttpURLConnection class to submit SPARQL requests and read HTTP responses, it is getting the same results as well.

                      I assume you are running Joseki on WebLogic? Reading through Joseki's docs, it mentions that it tries to stream responses while a database connection may not have finished returning all of its results yet, I wonder if there are some differences in how Tomcat handles that vs WebLogic.

                      Also, I tried the query with the PREFIX you mentioned at the top and ?comment as a variable, but received an error:

                      "Error: URI = oracle : java.sql.SQLException: ORA-00936: missing expression"

                      Is there a some patch I need to apply to enable that functionality?
                      • 8. Re: Joseki result not complete
                        alwu-Oracle
                        Yes we are using WebLogic Server. Tomcat may behave differently from WebLogic Server. Can you run this query without going through HTTP? Does that make a difference?

                        When that PREFIX is present, you still need to use ?comm as you did before.

                        Thanks,

                        Zhe Wu
                        • 9. Re: Joseki result not complete
                          715399
                          Also, some of the Berlin SPARQL Benchmark queries use a variable called ?date, which is also a reserved keyword in Oracle. You might want to rename those variables as well.

                          Vladimir
                          • 10. Re: Joseki result not complete
                            784525
                            Hi Zhe,
                            We've installed WebLogic. Deploying joseki to it and running the query against it returns a complete result, so I guess the issues lie in differences between WebLogic and Tomcat. Thank you for help.
                            • 11. Re: Joseki result not complete
                              alwu-Oracle
                              Great news! Thanks for the update.

                              Zhe