l.QuestStatement - java.sql.SQLSyntaxErrorException: You have an error in your SQL synt

324 views
Skip to first unread message

svrs...@intec.ugent.be

unread,
Jan 11, 2019, 7:47:50 AM1/11/19
to ontop4obda
Dear all,

I'm trying to get my own example/testing implementation in Java OWL API running, but I keep on hitting the following exception:

l.QuestStatement - java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''), ']', '%5D'), '^', '%5E'), '`', '%60'), '{', '%7B'), '|', '%7C'), '}', '%7D')' at line 4
It is rather strange, as I can confgure and execute the mapping in Protege. So, it seems like a configuration issue, as I cannot possibly imagine with the following example there to be some kind of bug.

Any help/hints/clues? That would be wonderul! It feels like I am missing something obvious, but cannot find what. :-(

Kind regards,
Stijn Verstichel


I'm using MySQL as relational database with this in the properties file:
jdbc.url = jdbc:mysql://localhost/harmoneylocal?sessionVariables=sql_mode='ANSI'
jdbc.user = root
jdbc.password = urbis
jdbc.driverClass = com.mysql.jdbc.Driver

This seems to be some kind of translation issue and occurs even with the simplest mapping:
[MappingDeclaration] @collection [[
mappingId    urn:financial_sp mapping
target        :financialsp{id} a :ServiceProvider .
source        SELECT * FROM harmoneylocal.financial_sp;

With this ontology OWL file:
<?xml version="1.0"?>
<rdf:RDF xmlns="http://users.atlantis.ugent.be/svrstich/harmoney/clean.owl/"
     xml:base="http://users.atlantis.ugent.be/svrstich/harmoney/clean.owl/"
     xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
     xmlns:owl="http://www.w3.org/2002/07/owl#"
     xmlns:xml="http://www.w3.org/XML/1998/namespace"
     xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
     xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#">
    <owl:Ontology rdf:about="http://users.atlantis.ugent.be/svrstich/harmoney/clean.owl/"/>
   


    <!--
    ///////////////////////////////////////////////////////////////////////////////////////
    //
    // Classes
    //
    ///////////////////////////////////////////////////////////////////////////////////////
     -->

   


    <!-- http://users.atlantis.ugent.be/svrstich/harmoney/clean.owl/ServiceProvider -->

    <owl:Class rdf:about="http://users.atlantis.ugent.be/svrstich/harmoney/clean.owl/ServiceProvider"/>
</rdf:RDF>



<!-- Generated by the OWL API (version 4.2.8.20170104-2310) https://github.com/owlcs/owlapi -->


Guohui Xiao

unread,
Jan 15, 2019, 10:47:59 AM1/15/19
to ontop4obda
Dear Stijn,

1. Which version of Ontop, MySQL, and the jdbc driver are you using?

2. In Protege, in the "Ontop SPARQL" tab, if you right click the SPARQL query, you can see the full generated SQL query. Can you try to manually run the SQL query in MySQL and see if you have the same issue? You can also send us the SQL.

3. These REPLACE functions are used for encoding symbols and generating IRI-safe strings. If you don't need this feature, you can disable it. What you need to do is to use the latest Ontop v3-beta-2, and pPut the following line into the properties file.

ontop.iriSafeEncoding=false

Regards,

Guohui

On Friday, 11 January 2019 13:47:50 UTC+1, 
Reply all
Reply to author
Forward
0 new messages