1 2 Previous Next 16 Replies Latest reply on Nov 4, 2016 1:30 PM by rareddy Go to original post
      • 15. Re: need help getting JENA JDBC to work with Teiid
        omarbkhan

        Ramesh,

         

        Great news!!!!! Success!!!!  This totally worked! (with slight modification)

         

        Thank you soooo much ! :-)


        I altered the module.xml slightly. I removed tdb and added two lines:

         

        <module xmlns="urn:jboss:module:1.3" name="org.apache.jena">

            <properties>

                <property name="jboss.api" value="private"/>

            </properties>

            

            <resources>

              <resource-root path="collection-0.6.jar"/>

              <resource-root path="commons-csv-1.0.jar"/>

              <resource-root path="httpclient-4.2.6.jar"/>

              <resource-root path="httpclient-cache-4.2.6.jar"/>

              <resource-root path="httpcore-4.2.5.jar"/>

              <resource-root path="jena-arq-3.1.0.jar"/>

              <resource-root path="jena-base-3.1.0.jar"/>

              <resource-root path="jena-cmds-3.1.0.jar"/>

              <resource-root path="jena-core-3.1.0.jar"/>

              <resource-root path="jena-iri-3.1.0.jar"/>

              <resource-root path="jena-shaded-guava-3.1.0.jar"/>

              <resource-root path="jena-jdbc-driver-remote-3.1.0.jar"/>

              <resource-root path="jena-jdbc-core-3.1.0.jar"/>

              <resource-root path="jsonld-java-0.7.0.jar"/>

            </resources>

         

         

            <dependencies>

                <module name="javax.api"/>

                <module name="org.slf4j"/>

                <module name="org.apache.log4j"/>

                <module name="org.apache.commons.cli"/> <!--1.2 needs 1.3-->

                <module name="org.apache.commons.codec"/> <!-- 1.10 needs 1.9 -->

                <module name="org.apache.commons.io"/>

                <module name="org.apache.commons.lang" slot="3.3.2"/>

                <module name="com.fasterxml.jackson.core.jackson-core"/>

                <module name="com.fasterxml.jackson.core.jackson-annotations"/>

                <module name="com.fasterxml.jackson.core.jackson-databind"/>

                <module name="org.apache.thrift" /> <!--9.1 needs 9.2 -->

                <module name="org.apache.log4j" />      

                <module name="org.slf4j" />

                <module name="org.slf4j.jcl-over-slf4j" />

                <module name="org.slf4j.ext"/>

                <module name="org.apache.xerces"/>

                <module name="javax.xml.bind.api"/>

                <module name="javax.xml.rpc.api"/>

                <module name="javax.xml.soap.api"/>

                <module name="javax.xml.stream.api"/>

                <module name="javax.xml.ws.api"/>

            </dependencies>

        </module>

         

         

         

        Fyi, I had issues trying to figure out how to declare the native call, but that is probably secondary - because I got it to work regardless. I thought the translator would have automatically installed the virtual procedure once I overrode, but I had to do it manually. Which is something I could have overlooked in the documentation (I did of course test it with FILTER,too , and confirm that is working now!)

         

        SELECT  REGEXP_REPLACE(s,'^.*(#|/)','') as s, REGEXP_REPLACE(p,'^.*(#|/)','') as p, REGEXP_REPLACE(o,'^.*(#|/)','') as o  FROM (

        SELECT x.* FROM (call JDBC_Jena.native('

        select ?s ?p ?o WHERE {?s ?p ?o } LIMIT 100')) w, ARRAYTABLE (w.tuple COLUMNS "s" string, "p" string, "o" string) x ) p

         

        so how can we capture this so others can benefit ? Or  in fact since the JENA libraries are apache include in a further release of Teiid, I really think having this would help semantic RDF adoption if such a tool would do this out of the box. It would allow other people to reap the rewards of our efforts and the JENA team ?

        • 16. Re: need help getting JENA JDBC to work with Teiid
          rareddy

          Omar,

           

          Once you write the translator and has some functionality, then we can talk about adding it to the Teiid project itself. Take looke at Developer's guide to how to write a translator. The biggest hurdle is how to convert SQL into JENA specific queries. There are plenty of examples, and ask questions if you need.

           

          Ramesh..

          1 2 Previous Next