5 Replies Latest reply on Apr 20, 2016 4:31 PM by alwu-Oracle

    ORA-00936: missing expression

    ruben.navarro

      I had the same problem described in this archived discussion: ORA-00936: missing expression

       

      "

      Hello,

      I wrote a SPARQL query that returned a variable called ?date. When I ran the query using the Jena Adaptor, I kept getting:

       

      java.sql.SQLException: ORA-00936: missing expression

       

      I think the SQL parser was not handling the ?date variable correctly. Insetadn, I think the parser interpreted ?date as the Oracle DATE keyword. When I changed the variable name to ?article_date, the problem went away. It's not a big problem, but I just wanted to point it out.

       

      Chuck

      "

       

      The driver I'm using is from 2015 and the supposed "enhancement to translate Oracle keywords" was mentioned in that discussion (which happened on 2008). Why wasn't it implemented yet? Or at least, why isn't a more understandable error code returned? Is there any plan on addressing that issue at some point in the (near?) future?

       

      This error is quite inconvenient and makes Oracle less "SPARQL 1.1 compliant".

       

      Cheers!

        • 1. Re: ORA-00936: missing expression
          alwu-Oracle

          Hi,

           

          Can you please send the exact version (size, date) of sdordfclient.jar?  This feature has been there for many years. We even have a test case using "?date"

           

          Thanks,


          Zhe Wu

          • 2. Re: ORA-00936: missing expression
            ruben.navarro

            The size is 1.1 MB, the created date is the 2nd of February of this year (but I'm not sure if that is the date at which we uploaded it to our server...). At any case, the jar version will not be older than August 2015.

            Can you check using the md5 sum? (which is 42e6958e9edacad97864b1cfad40b5bd).

             

            Also, the problem was reproduced using 'resource' as a variable name. It seems like not all the reserved keywords (https://docs.oracle.com/database/121/SQLRF/ap_keywd001.htm#SQLRF55621)  are covered by the fix.

             

            Thank you!

             

            Ruben

            • 3. Re: ORA-00936: missing expression
              alwu-Oracle

              Hi Ruben,

               

              That's very strange. I just tried the following two against the Fuseki endpoint. Both work fine. I also inspected the trace and the renaming works as expected.

               

              select ?s ?p ?date

              where {?s ?p ?date}

              limit 10

               

              and

               

              select ?s ?p ?resource

              where {?s ?p ?resource}

              limit 10

               

              The Jena Adapter client library has a different checksum though.

               

              % unzip -l rdf_semantic_graph_support_for_12c_and_jena211_protege_4.3.zip |grep sdordfclient_12c.jar

                1160471 02-02-16 03:01   jar/sdordfclient_12c.jar

               

              95681890a26a01033660ec51a8e54298  sdordfclient_12c.jar

               

              Thanks,

               

              Zhe Wu

              • 4. Re: ORA-00936: missing expression
                ruben.navarro

                Hi Zhe!

                 

                Does this mean, that the renaming happens in the Jena adapter library and not directly in the database (by the SEM_MATCH function)? That might explain the problem.

                At the moment, since older versions of the adapter had a bad performance with SPARQL 1.1 queries, the queries are sent directly to the server using SEM_MATCH (by-passing the Jena adapter logic). Do you think that might be the reason?

                To my understanding, this was already fixed (the complete query is sent as-is to the database), so we wouldn't need that work around anymore. I'll look into that in the near future.

                 

                Regarding the jar, we are still using sdordfclient.jar (not sdordfclient_12c.jar).

                 

                Thanks!

                 

                Ruben

                • 5. Re: ORA-00936: missing expression
                  alwu-Oracle

                  Hi Ruben,

                   

                  That's exactly the reason. The variable renaming happens in Jena Adapter.

                   

                  We simply cannot send a complete SPARQL 1.0 (or 1.1) query to the DB for execution without any modifications. It does not work. "?date" is just one of the reasons.

                   

                  Please try the latest Jena Adapter on MOS. Login to MOS and search for 22959933

                   

                  Hope it helps,


                  Zhe Wu