1 Reply Latest reply on Feb 23, 2016 7:33 PM by alwu-Oracle

    The method createOracleSemModel(Oracle, String) from the type ModelOracleSem refers to the missing type ModelOracleSem

    3180035

      Hi

      I am working on a project for a class where I am trying to store OWL data into Oracle 12c. To do so I am using Apache Jena Adapter. I followed the documentation https://docs.oracle.com/database/121/RDFRM/sem_jena.htm#RDFRM273 here on how to set up the environment.

       

      These are few problem/questions that I have that will help me move forward

      1] In oracle 12c should I create a PDB to store the OWL data ? If yes what are the steps ? I followed https://docs.oracle.com/database/121/RDFRM/sem_jena.htm#RDFRM242 but I keep getting Invalid common user or role error. I believe the documentation is not updated as per 12c.

      {Note: To keep thing moving I created a common user by adding c##}

       

      2] Secondly since I am new  to Jena I wanted to try the examples and see how it works. The example at https://docs.oracle.com/database/121/RDFRM/sem_jena.htm#RDFRM273

      uses libraries from HP which again is outdated. I replaced them with the new ones but get two errors which I am not able to resolve (marking below in red)

       

       

      import org.apache.jena.graph.Node;

      import org.apache.jena.graph.Triple;

      import org.apache.jena.query.Query;

      import org.apache.jena.query.QueryExecution;

      import org.apache.jena.query.QueryExecutionFactory;

      import org.apache.jena.query.QueryFactory;

      import org.apache.jena.query.ResultSet;

      import org.apache.jena.query.ResultSetFormatter;

      import org.apache.jena.rdf.model.Model;

       

      import spatial.rdf.client.jena.ModelOracleSem;

      import spatial.rdf.client.jena.Oracle;

       

      public class openRDFtoJENA {

       

        public static void main(String[] args) throws Exception

        {

          String szJdbcURL = args[0];

          String szUser    = args[1];

          String szPasswd  = args[2];

       

       

          String szModelName = args[3];

          Oracle oracle = new Oracle(szJdbcURL, szUser, szPasswd);

          Model model = ModelOracleSem.createOracleSemModel(oracle, szModelName);

      //The method createOracleSemModel(Oracle, String) from the type ModelOracleSem refers to the missing type ModelOracleSem

       

          model.getGraph().add(Triple.create(

                Node.createURI("http://example.com/John"),

                Node.createURI("http://example.com/fatherOf"),

                Node.createURI("http://example.com/Mary")));

      The method createURI(String) is undefined for the type Node

       

       

          Query query = QueryFactory.create(

              "select ?f ?k WHERE {?f <http://example.com/fatherOf> ?k .}");

          QueryExecution qexec = QueryExecutionFactory.create(query, model);

          ResultSet results = qexec.execSelect();

          ResultSetFormatter.out(System.out, results, query);

       

       

          model.close();

          oracle.dispose();

        }

      }