SWRLB + Jena Adaptor ?

Hi, i wanna ask how to integrate Jena Adaptor with SWRLB . is it possible ?
Thanks

Actually, we don't want you to worry about the underlying machinery :)
When you use the Jena Adaptor's addInBatch API, then we use batch loading capabilities through JDBC.
When you use the Jena Adaptor's addInBulk API, then we create, through JDBC, staging table, populate it and also a separate table for long literals, invoke bulk loader, and finally add those triples with long literals. As you can see, there is no SQLLoader involved.*
Hope it helps,
Zhe Wu

Similar Messages

  • Jena adaptor doesn't use ID column in model _TPL table

    The Oracle semantic technology developers guide, recommends that the triple table for an RDF model have at least 2 columns, an ID column with values from a sequence, and a triple column. The Jena adaptor creates a table with only a triple column. This isn't consistent with recommended practice from the manual, and could be a problem for other software that expects this column. I'm not exactly sure what purpose the ID column serves except to distinguish mutiple copies of the same triple.
    Is it possible to configure the adaptor to do this?
    Currently I'm modifying my other software to conform to the Oracle RDF configuration that Jena prefers, but that might be a problem somewhere down the line.

    I don't think that ID column is recommended. The dev guide shows an application example with an ID column. It does not mean (or say) it is a recommended practice.
    For Jena Adaptor, one TRIPLE column is sufficient. An additional ID column does not provide additional value for the Jena functions provided.
    Cheers,
    Zhe Wu

  • SPARQL query through Jena adaptor not work when string literals used

    Hi,
    When I executed the following SPARQL query through Oracle Jena adaptor:
    SELECT ?personHasFirstName WHERE
    {?personHasFirstName foaf:firstName ?name . }
    I got the expected results.
    However it won't return anything when I narrowed the query to match a particular name like below:
    SELECT ?personHasFirstName WHERE
    {?personHasFirstName foaf:firstName \"Julie\" . }
    I also tried the Filter approach:
    SELECT ?personHasFirstName WHERE {?personHasFirstName foaf:firstName ?name . FILTER (?name =\"Julie\") }
    It still doesn't return any results.
    I saw from the release notes about the bug dealing with "\". My guess is that the above behavior is caused by that bug. What is the suggested way to walk-around this? Thanks,
    Weihua

    Could you please try this? It works as expected on my machine.
    GraphOracleSem graph = new GraphOracleSem( oracle, modelName);
    ModelOracleSem model = new ModelOracleSem(graph);
    Node sub = Node.createURI("http://test.com/employee123");
    Node pre = Node.createURI("http://xmlns.com/foaf/0.1/firstName");
    Node obj = Node.createLiteral("Julie");
    graph.add(Triple.create(sub, pre, obj));
    String queryString =
    " PREFIX foaf: <http://xmlns.com/foaf/0.1/> " +
    "SELECT ?person WHERE { ?person foaf:firstName \"Julie\" . } ";
    QueryExecution qexec = QueryExecutionFactory.create(
    QueryFactory.create(queryString), model);
    try {
    ResultSet results = qexec.execSelect();
    while (results.hasNext()) {
    QuerySolution soln = results.nextSolution();
    psOut.println("runQuery: soln " + soln);
    finally {
    if (qexec != null)
    qexec.close();
    output snippet:
    runQuery: soln ( ?person = <http://test.com/employee123> )

  • Jena adaptor and sqlldr

    Hi,
    I am trying jena adaptor API. I succeeded in different kind of loading. I would like to know if it is the same tool that this api uses. Mainly, I wonder if the bulk loader uses a stage table and sqlldr like we directly use it in oracle .
    Thanks for your precision,
    Dacko

    Actually, we don't want you to worry about the underlying machinery :)
    When you use the Jena Adaptor's addInBatch API, then we use batch loading capabilities through JDBC.
    When you use the Jena Adaptor's addInBulk API, then we create, through JDBC, staging table, populate it and also a separate table for long literals, invoke bulk loader, and finally add those triples with long literals. As you can see, there is no SQLLoader involved.*
    Hope it helps,
    Zhe Wu

  • Oracle Jena Adaptor

    We are pleased to announce the availability of the Oracle Jena Adaptor, that will enable the use of the Jena framework with Oracle RDF. Jena is an Open Source framework developed by Hewlett-Packard and is available under a BSD-style license; see http://jena.sf.net for details.
    The Jena adaptor software implements the well-known Jena Graph and Model APIs. It extends the capabilities of Oracle semantic data management (Oracle 10gR2 RDF and Oracle 11gR1 RDF/OWL) with a set of easy-to-use Java APIs. Enhancements have been done to the server side to accommodate those APIs.
    You can download the Oracle Jena Adaptor by visitng the Oracle Semantic Technologies page at http://www.oracle.com/technology/tech/semantic_technologies/index.html and clicking on 'Software' in the column on the right.
    Melli Annamalai
    Oracle Database Semantic Technologies

    It appears like the readme.txt is not included in the zip file kept at the down location. Can you verify this please?
    Thanks,
    Rajesh.

  • Two problems in BSBM benchmark of Oracle 10g with Jena Adaptor 2.0

    Hi, all.
    I'm proceeding BSBM benchmark for Oracle 10g with Jena Adaptor 2.0.
    I'm using the codes that were introduced in Jena Adaptor 2.0 guide document, and I've applied Jena patches to Oracle 10g (10.2.0).
    But, two problems are occured in benchmark process.
    The first problem is
         that 250k dataset(consisted of 250030 triples) loading time elapses over several hours, (See below code snippet.)
    and the other is
         that exceptions are occured in some sparql query execution.
    I used below queries which have no error in query syntax.
    I confirmed that through other benchmark tests.
    In case of oracle benchmark test, quey1 is ok. but, query2 makes exception.
    Please, look about the Exception message below.
    What should I do for getting much better benchmark result?
    I appreciate any help or any hint.
    Best regards ~
    ### Query 1 ###
    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 rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
    SELECT DISTINCT ?product ?label
    WHERE {
    ?product rdfs:label ?label .
    ?product a <http://www4.wiwiss.fu-berlin.de/bizer/bsbm/v01/instances/ProductType18> .
    ?product bsbm:productFeature <http://www4.wiwiss.fu-
    berlin.de/bizer/bsbm/v01/instances/ProductFeature833> .
    ?product bsbm:productFeature <http://www4.wiwiss.fu-
    berlin.de/bizer/bsbm/v01/instances/ProductFeature61> .
    ?product bsbm:productPropertyNumeric1 ?value1 .
         FILTER (?value1 > 136)
    ORDER BY ?label
    LIMIT 10
    ### Query 2 ###
    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 ?comment ?producer ?productFeature ?propertyTextual1 ?propertyTextual2 ?
    propertyTextual3
    ?propertyNumeric1 ?propertyNumeric2 ?propertyTextual4 ?propertyTextual5 ?propertyNumeric4
    WHERE {
    <http://www4.wiwiss.fu-berlin.de/bizer/bsbm/v01/instances/dataFromProducer11/Product536>
    rdfs:label ?label .
    <http://www4.wiwiss.fu-berlin.de/bizer/bsbm/v01/instances/dataFromProducer11/Product536>
    rdfs:comment ?comment .
    <http://www4.wiwiss.fu-berlin.de/bizer/bsbm/v01/instances/dataFromProducer11/Product536>
    bsbm:producer ?p .
    ?p rdfs:label ?producer .
    <http://www4.wiwiss.fu-berlin.de/bizer/bsbm/v01/instances/dataFromProducer11/Product536>
    dc:publisher ?p .
    <http://www4.wiwiss.fu-berlin.de/bizer/bsbm/v01/instances/dataFromProducer11/Product536>
    bsbm:productFeature ?f .
    ?f rdfs:label ?productFeature .
    <http://www4.wiwiss.fu-berlin.de/bizer/bsbm/v01/instances/dataFromProducer11/Product536>
    bsbm:productPropertyTextual1 ?propertyTextual1 .
    <http://www4.wiwiss.fu-berlin.de/bizer/bsbm/v01/instances/dataFromProducer11/Product536>
    bsbm:productPropertyTextual2 ?propertyTextual2 .
    <http://www4.wiwiss.fu-berlin.de/bizer/bsbm/v01/instances/dataFromProducer11/Product536>
    bsbm:productPropertyTextual3 ?propertyTextual3 .
    <http://www4.wiwiss.fu-berlin.de/bizer/bsbm/v01/instances/dataFromProducer11/Product536>
    bsbm:productPropertyNumeric1 ?propertyNumeric1 .
    <http://www4.wiwiss.fu-berlin.de/bizer/bsbm/v01/instances/dataFromProducer11/Product536>
    bsbm:productPropertyNumeric2 ?propertyNumeric2 .
    OPTIONAL { <http://www4.wiwiss.fu-
    berlin.de/bizer/bsbm/v01/instances/dataFromProducer11/Product536> bsbm:productPropertyTextual4 ?
    propertyTextual4 }
    OPTIONAL { <http://www4.wiwiss.fu-
    berlin.de/bizer/bsbm/v01/instances/dataFromProducer11/Product536> bsbm:productPropertyTextual5 ?
    propertyTextual5 }
    OPTIONAL { <http://www4.wiwiss.fu-
    berlin.de/bizer/bsbm/v01/instances/dataFromProducer11/Product536> bsbm:productPropertyNumeric4 ?
    propertyNumeric4 }
    ### Exception Message (in query 2 execution) ###
    Exception in thread "main" java.sql.SQLException: ORA-00936: missing expression
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
    at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:331)
    at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:288)
    at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:743)
    at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:216)
    at oracle.jdbc.driver.T4CPreparedStatement.executeForDescribe
    (T4CPreparedStatement.java:799)
    at oracle.jdbc.driver.OracleStatement.executeMaybeDescribe(OracleStatement.java:1038)
    at oracle.jdbc.driver.T4CPreparedStatement.executeMaybeDescribe
    (T4CPreparedStatement.java:839)
    at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1133)
    at oracle.jdbc.driver.OraclePreparedStatement.executeInternal
    (OraclePreparedStatement.java:3285)
    at oracle.jdbc.driver.OraclePreparedStatement.executeQuery
    (OraclePreparedStatement.java:3329)
    at oracle.spatial.rdf.client.jena.Oracle.executeQuery(Oracle.java:255)
    at oracle.spatial.rdf.client.jena.OracleSemQueryPlan.executeBindings
    (OracleSemQueryPlan.java:302)
    at com.hp.hpl.jena.sparql.engine.iterator.QueryIterBlockTriplesQH$StagePattern.<init>
    (QueryIterBlockTriplesQH.java:89)
    at com.hp.hpl.jena.sparql.engine.iterator.QueryIterBlockTriplesQH.nextStage
    (QueryIterBlockTriplesQH.java:55)
    at com.hp.hpl.jena.sparql.engine.iterator.QueryIterRepeatApply.makeNextStage
    (QueryIterRepeatApply.java:92)
    at com.hp.hpl.jena.sparql.engine.iterator.QueryIterRepeatApply.hasNextBinding
    (QueryIterRepeatApply.java:54)
    at com.hp.hpl.jena.sparql.engine.iterator.QueryIteratorBase.hasNext
    (QueryIteratorBase.java:69)
    at com.hp.hpl.jena.sparql.engine.iterator.QueryIterRepeatApply.makeNextStage
    (QueryIterRepeatApply.java:85)
    at com.hp.hpl.jena.sparql.engine.iterator.QueryIterRepeatApply.hasNextBinding
    (QueryIterRepeatApply.java:54)
    at com.hp.hpl.jena.sparql.engine.iterator.QueryIteratorBase.hasNext
    (QueryIteratorBase.java:69)
    at com.hp.hpl.jena.sparql.engine.iterator.QueryIterRepeatApply.makeNextStage
    (QueryIterRepeatApply.java:85)
    at com.hp.hpl.jena.sparql.engine.iterator.QueryIterRepeatApply.hasNextBinding
    (QueryIterRepeatApply.java:54)
    at com.hp.hpl.jena.sparql.engine.iterator.QueryIteratorBase.hasNext
    (QueryIteratorBase.java:69)
    at com.hp.hpl.jena.sparql.engine.iterator.QueryIterRepeatApply.makeNextStage
    (QueryIterRepeatApply.java:85)
    at com.hp.hpl.jena.sparql.engine.iterator.QueryIterRepeatApply.hasNextBinding
    (QueryIterRepeatApply.java:54)
    at com.hp.hpl.jena.sparql.engine.iterator.QueryIteratorBase.hasNext
    (QueryIteratorBase.java:69)
    at com.hp.hpl.jena.sparql.engine.iterator.QueryIterConvert.hasNextBinding
    (QueryIterConvert.java:47)
    at com.hp.hpl.jena.sparql.engine.iterator.QueryIteratorBase.hasNext
    (QueryIteratorBase.java:69)
    at com.hp.hpl.jena.sparql.engine.iterator.QueryIteratorWrapper.hasNextBinding
    (QueryIteratorWrapper.java:29)
    at com.hp.hpl.jena.sparql.engine.iterator.QueryIteratorBase.hasNext
    (QueryIteratorBase.java:69)
    at com.hp.hpl.jena.sparql.engine.ResultSetStream.hasNext(ResultSetStream.java:62)
    at benchmark.repository.oracle.OracleQuerying.getSelectQueryResult
    (OracleQuerying.java:148)
    at benchmark.repository.oracle.OracleQuerying.doSparqlQuery(OracleQuerying.java:101)
    at benchmark.repository.oracle.OracleQuerying.queryingData(OracleQuerying.java:90)
    at benchmark.repository.oracle.OracleQuerying.querying(OracleQuerying.java:49)
    at benchmark.repository.oracle.OracleQuerying.<init>(OracleQuerying.java:44)
    at benchmark.Benchmark.runTest(Benchmark.java:113)
    at benchmark.Benchmark.main(Benchmark.java:56)
    ### Loading Code Snippet ###
              String jdbcURL = "jdbc:oracle:thin:@" + Constants.HOST + ":1521:orcl";
              OracleDataSource ds = new OracleDataSource();
              ds.setURL(jdbcURL);
              ds.setUser(Constants.ORACLE_USER);
              ds.setPassword(Constants.ORACLE_PASSWORD);
              OracleConnection conn = (OracleConnection) ds.getConnection();
              oracle = new Oracle(conn);
              modelOracleSem = ModelOracleSem.createOracleSemModel(oracle, modelName);
              graphOracleSem = modelOracleSem.getGraph();
              graphOracleSem.createTables();
              graphOracleSem.clearRepository();
              for (int i = 0; i < fileList.length; i++) {
                   file = fileList;
                   if (file.isDirectory())
    continue;
                   inputFilePath = file.getAbsolutePath();
                   InputStream in = null;
                   try {
                        in = FileManager.get().open(inputFilePath);
                        if (in == null) {
                             throw new IllegalArgumentException("File: " + inputFilePath + " not found");
                        modelOracleSem.read(in, "", "N-TRIPLE");
                        modelOracleSem.commit();
                   } finally {
                        if (in != null)
                             in.close();

    Hi,
    The data loading was slow because incremental loading API was used. Please take a look at OracleBulkUpdateHandler. There is an addInBatch API that you can use.
    Now regarding queries, Jena Adaptor v2.0 was primarily designed for Oracle Database 11g Release 1.
    Recently, a new version of Jena Adaptor has been released and it's optimized for Oracle Database 11g
    Release 2.
    Is it possible to run your BSBM benchmark tests against Oracle Database 11g Release 2 using the latest
    Jena Adaptor (http://forums.oracle.com/forums/ann.jspa?annID=1179) ?
    Thanks,
    Zhe Wu

  • Sparql endpoint with Jena adaptor

    Hello,
    I'm using the Oracle-Jena adaptor. It works well. But we want now to get an sparql server (http sparql protocol)? Anyone here has any experience with that?

    Hi,
    It says the following in the readme instructions on how to install Jena adaptor.
    Please consult the Oracle® Database Semantic Technologies Developer's Guide 11g Release 2 (11.2) documentation for Jena Adaptor installation instructions.
    But can't seem to find the instructions in the developers guide, do you know if the installation instructions exist? if so can you point to the location?
    Thanks,

  • Ena Assemblers in the new Oracle Jena Adaptor?

    Hello,
    will there be Jena Assemblers in the new Oracle Jena Adaptor?
    I try to access the Oracle Spatial DBMS through Joseki, a Jena-HTTP Interface, and need Oracle Jena Assemblers for this.
    http://tech.groups.yahoo.com/group/jena-dev/message/35839
    By the way, can you tell me in round terms when native SPARQL/SPARUL-Support in Oracle Spatial is expexted?
    Thanks and Regards,
    Srdja Matovic

    Hmm. We haven't opened source this Oracle Jena Adaptor.
    Please let me know what exactly you are looking for. I may be able to help you quickly.
    Email me at alan dot wu at oracle dot com
    if you want to take this off line.
    Thanks.

  • One Tip on using Oracle Jena Adaptor

    To run Oracle Jena Adaptor smoothly, we recommend using the java executable under
    $ORACLE_HOME/jdk/bin
    and including in your classpath the JDBC library, ojdbc5.jar, under
    $ORACLE_HOME/jdbc/lib

    It appears like the readme.txt is not included in the zip file kept at the down location. Can you verify this please?
    Thanks,
    Rajesh.

  • Jena Driver Patch for Oracle 11.1.0.6 is missing

    I can no longer find the Jena Driver server-side patch for Oracle 11.1.0.6. I downloaded this a month ago from OTN but the link seems to have been removed. The installation guide is still available on the Jena Adaptor documentation page but I cannot locate the actual patch: jenadrv_patch111rdf.zip. Any idea what's going on?

    We are working on putting Oracle Jena Adaptor software on Metalink. After that, those links will be re-enabled on OTN.

  • Passing literal as bind variable in jena

    Dear all,
    We are able to use bind variables using the RDFVID id. However if we want to check for a literal using the jena/joseki adapter we are not able to perform the same action. In our case the literal is of type string.
    We are using:
    * WLS 12.1.0.3.
    * Jena adapter 2.11.1.
    * Joseki 3.4.4.
    * ARQ 2.9.2.
    We try to run the following query on the joseki end-point.
    PREFIX foaf: <http://xmlns.com/foaf/0.1/>
    PREFIX vcard: <http://www.w3.org/2001/vcard-rdf/3.0#>
    PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
    PREFIX oext: <http://oracle.com/semtech/jena-adaptor/ext/function#>
    PREFIX ORACLE_SEM_FS_NS: <http://oracle.com/semtech#no_fall_back,ALLOW_DUP=T,s2s>
    PREFIX ORACLE_SEM_HT_NS: <http://oracle.com/semtech#monitor>
    PREFIX ORACLE_SEM_UEAP_NS: <http://oracle.com/semtech#f$RDFVID%20in(ORACLE_ORARDF_RES2VID(?))>
    PREFIX ORACLE_SEM_UEPJ_NS: <http://oracle.com/semtech#f$RDFVID>
    PREFIX ORACLE_SEM_UEBV_NS: <http://oracle.com/semtech#"Lee">
    SELECT ?f
    WHERE
    { graph ?g { ?p vcard:N ?vn .
       ?vn vcard:Family ?f .
        ?p foaf:title "Sen." .}
    The result set is empty. Replacing the line 'PREFIX ORACLE_SEM_UEBV_NS: <http://oracle.com/semtech#"Lee">' by any variant is either given an error or the empty set. (Some variants are (&quot;Lee&quot; , Lee, "Lee", &#39;Lee&#39; )
    When we use the generated SQL from jena/joseki, we are able to get the right result if we run the same query in SQLDeveloper. The bind variable we have to use is "Lee" (the bind variable has the quotations included). This will give the correct result set back.
    Kind regards,
    Max

    Hi Max,
    In the UEBV field, you need to put in URL encoded String of "Lee"
    Please try the following and see if it helps.
    %22Lee%22
    Thanks,
    Zhe Wu

  • Problems in inferencing large owls with Jena

    I am trying to use Jena OWL Reasoner APIs (Mini and full OWL Reasoner) to make inferences on large OWL file (approx. 40k lines). But Jena is throwing a out of memory error even after increasing the JVM heap space to 1GB.
    I think it is because the Jena creates an in-memory model of the ontology and then inferences out of it.
    So, is there any way out towards solving this problem?
    One thing I need to mention is that the Pellet Reasoner when tied with Jena OntModel is giving inferences quickly. The Jena OWLMicroReasoner also is giving the inferences but it is taking much more time. But, the latter generates more inferences than those generated by the Pellet Reasoner.

    Hi,
    Your question seems to be Jena specific, not related to the Oracle Jena Adaptor. A discussion forum at Jena might be the more appropriate place to ask this question.
    Details on the Oracle Jena Adaptor, which allows Jena to be used with Oracle's semantic technology is at: Oracle Jena Adaptor
    Melli

  • Problem after Jena Patch

    I have just applied the Jena patch for 11g and I am now having trouble with the BatchLoader. The output from my batch command is:
    Note: You can use JVM properties -Ddb.user=<user> -Ddb.password=<password> -Ddb.host=<host> -Ddb.sid=<sid> -Ddb.port=<port> to configure database connection.
    JVM property -Dappend=true can be used to specify APPEND mode. By default, this option is false.
    JVM property -Dexchange=true can be used to allow table partition exchange which is faster and less space consuming.
    This option is less robust though. By default, it is false
    Connecting to jdbc:oracle:thin:@dev1.company.com:1521:MUM as user demo
    Append mode
    Copy existing data out
    Just load triples into one column
    Temporary table already exists!
    java.sql.SQLException: ORA-00955: name is already used by an existing object
    ORA-06512: at "MDSYS.SDO_RDF_INTERNAL", line 3449
    ORA-06512: at "MDSYS.SDO_RDF_INTERNAL", line 3485
    ORA-06512: at "MDSYS.RDF_APIS", line 910
    ORA-06512: at line 1
    at oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.java:74)
    at oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java:110)
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:171)
    at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:455)
    at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:413)
    at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:1030)
    at oracle.jdbc.driver.T4CCallableStatement.doOall8(T4CCallableStatement.java:191)
    at oracle.jdbc.driver.T4CCallableStatement.executeForRows(T4CCallableStatement.java:944)
    at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1222)
    at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3381)
    at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:3482)
    at oracle.jdbc.driver.OracleCallableStatement.execute(OracleCallableStatement.java:3839)
    at oracle.jdbc.driver.OraclePreparedStatementWrapper.execute(OraclePreparedStatementWrapper.java:1085)
    at oracle.spatial.rdf.client.NTripleConverter.loadNTriple(NTripleConverter.java:391)
    at oracle.spatial.rdf.client.BatchLoader.main(BatchLoader.java:302)
    I have tried dropping and re-creating all sorts of things, but I've stopped shy of dropping and re-creating the MDSYS user. Any thoughts on the cause of this problem?
    Message was edited by:
    StinkyMatt

    First more details on the location of the 11g patch:
    The patch is available on the Oracle Semantic Technologies page, it is just not labeled accurately (we are fixing that). Please go to http://www.oracle.com/technology/tech/semantic_technologies/index.html, click on 'software' in the right column, and then click on 'Download the Patch for Oracle Database 11gR1'. This patch is listed under the Oracle Jena Adaptor, and is also the general patch that can be used for 11g, including for using 11g with TopBraid Composer.
    I apologize for the delayed reply.
    Second, you could try the following, and the re-try the batch load:
    connect as mdsys
    exec sdo_rdf.cleanup_batch_load(<name_of_table_containing_triple_column>)
    If you are using Oracle11g, may I ask why you are not using the bulk loader? That will be faster. (see section 1.7 in the Oracle 11g Semantic Technologies documentation).
    Melli

  • [Jena] Debugging addInBulk()

    Hello,
    I am evaluating Oracle 11g with the Jena Adaptor 2.0. Currently I am trying to load customer records from one large file in N-TRIPLE format using addInBulk(). I did this successfully with a file with 100 sample records, and now I am trying it with 1000 (just a baby step towards ultimately being able to load all 200,000). Now I am getting the following error:
    [java] - addInBulk: [171042 ] sqle
    [java] java.sql.SQLException: ORA-01843: not a valid month
    [java] ORA-06512: at "MDSYS.SDO_RDF_INTERNAL", line 781
    [java] ORA-06512: at "MDSYS.SDO_RDF_INTERNAL", line 1886
    [java] ORA-06512: at "MDSYS.SDO_RDF", line 294
    [java] ORA-06512: at "MDSYS.RDF_APIS", line 542
    [java] ORA-06512: at line 1
    [java]
    [java] at oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.java:74)
    [java] at oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java:131)
    [java] at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:204)
    [java] at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:455)
    [java] at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:413)
    [java] at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:1034)
    [java] at oracle.jdbc.driver.T4CCallableStatement.doOall8(T4CCallableStatement.java:191)
    [java] at oracle.jdbc.driver.T4CCallableStatement.executeForRows(T4CCallableStatement.java:950)
    [java] at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1222)
    [java] at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3387)
    [java] at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:3488)
    [java] at oracle.jdbc.driver.OracleCallableStatement.execute(OracleCallableStatement.java:3840)
    [java] at oracle.jdbc.driver.OraclePreparedStatementWrapper.execute(OraclePreparedStatementWrapper.java:1086)
    [java] at oracle.spatial.rdf.client.jena.Oracle.executeCall(Oracle.java:474)
    [java] at oracle.spatial.rdf.client.jena.OracleBulkUpdateHandler.addInBulk(OracleBulkUpdateHandler.java:685)
    [java] at oracle.spatial.rdf.client.jena.OracleBulkUpdateHandler.addInBulk(OracleBulkUpdateHandler.java:472)
    [java] at oracle.spatial.rdf.client.jena.OracleBulkUpdateHandler.addInBulk(OracleBulkUpdateHandler.java:439)
    [java] at [redatced].OracleLoader.oracleBatchLoad(Unknown Source)
    [java] at [redacted].OracleLoader.main(Unknown Source)
    [java] java.sql.SQLException: ORA-01843: not a valid month
    [java] ORA-06512: at "MDSYS.SDO_RDF_INTERNAL", line 781
    [java] ORA-06512: at "MDSYS.SDO_RDF_INTERNAL", line 1886
    [java] ORA-06512: at "MDSYS.SDO_RDF", line 294
    [java] ORA-06512: at "MDSYS.RDF_APIS", line 542
    [java] ORA-06512: at line 1
    It's certainly possible that there is a glitch in my sample data - but my real question is, how do I debug and track down this problem? I am new to Oracle and I just can't figure out where to look and/or how to get more information about where in the data this is happening, what "month" it is choking on. Is there a log I could be looking at? Some way to turn on additional debugging output? Some clue as to exactly what statement is failing and what data is causing it to fail? I did some regex searching through the original N-TRIPLE source file to see if I could find something that looked like a date with a bad month, but no such date was apparent...
    Thanks very much for any help!
    Steve

    I have a bit more info - I added a StatusListener to the call to addInBulk(). This confirmed that all 171,042 triples were loaded (or so it claims) -- this error is happening in whatever post-processing happens after reporting the last triple loaded but before addInBulk() returns. This makes me suspect that this is actually a bug, or a configuration error on my part, rather than anything wrong with my test data.

  • Jena connection pooling

    Does anybody have suggestions regarding pooling of JDBC connections with the Oracle-Jena adaptor? We're using Jena in a web application, and at the moment we're using the oracle.spatial.rdf.client.jena.Oracle(String jdbcUrl, String username, String password) constructor. I'm assuming that under the covers this instantiates a brand-new JDBC connection. Is there significant overhead in setting up this connection? I notice that there is another constructor which will wrap an existing Oracle JDBC connection, which would allow us to manage our own connection pool. Would such an approach be worth our while?

    If you are using your JEE container to manage connection pools, then the interface that takes
    oracle.jdbc.OracleConnection is still not sufficient. Container pooling mechanisms don't return the
    physical connection when a connection is obtained from the pool. What you get is a container
    specific connection wrapper, that implements the java.sql.Connection interface.
    Clearly, the adaptor requires the Oracle semantic extensions, but is there any reason why it can't
    use the standard JDBC connection interface? This would facilitate things like use of container-managed
    connection pools as well as other types of JDBC wrappers. I've developed a wrapper that allows me
    to use OLS security with pooled connections, but I don't give the application direct access to the
    oracle.jdbc.OracleConnection instance.
    It's not clear from the Javadocs if the oracle.jdbc.OracleConnection passed to the Oracle constructor
    can be reused at some point.
    If the adaptor isn't making explict calls to the OracleConnection API is cleaning up the connection state
    at the end, then it should probably be changed to accept a standard JDBC connection object.

Maybe you are looking for