Update Triple RDF - Jena

Hello,
I would like to know if it's possible to update RDF triples stored in database using Jena or by an other way?
More precisely, in one hand, I would like to load an owl file with Jena and edit some individuals (create, delete, edit properties, etc...). Then save the results in a new OWL file. But how could these modifications can be reflected in my RDF triple table?
One way would be to store only owl files instead of RDF triples and save a new copy of the owl file or erase the previous one but I'm absolutely not satisfied about that. Indeed, if you erase only one individual (an entity), you have to load the entire file, do your update and then save again.
It would be nice, if anyone can help me.
Olivier

Thanks a lot for your very helpful answer.
I tried Jena Adaptor 2.0 with Oracle Enterprise Edition 11g release 1 and the first example in the jena adaptor readme file:
Oracle oracle = new Oracle(szJdbcURL, szUser, szPass);
Model model = ModelOracleSem.createOracleSemModel(oracle, szModelName);
model.getGraph().add(Triple.create(
Node.createURI("http://example.com/John"),
Node.createURI("http://example.com/fatherOf"),
Node.createURI("http://example.com/Mary")));
model.close();
oracle.dispose();
I'm using Jena 2.5.6 which is highly recommanded to work with Jena Adaptor 2.0. However, this code results in a NoClassDefFoundError:
Exception in thread "main" java.lang.NoClassDefFoundError: com/hp/hpl/jena/sparql/engine/main/OpExecutor
When I looked into the arq.jar library where this class should be, I didn't find it in version 2.5.6 of Jena but in version 2.5.7 or higher.
So when I replaced the arq.jar containing the OpExecutor class, the code is correctly executed.
Do you know anything about that?
Hope to read you again
Thanks

Similar Messages

  • Update on RDF Triple

    Hi,
    I have to update the set of triples.
    Is it possible to update the RDF Triple with update statement?
    I am not sure about the below syntax and statement (While trying the below statment getting an error ORA-00927: missing equal sign)
    example
    update articles_rdf_data a
    set a.triple.get_subject()='http://nature.example.com/test'
    where a.triple.get_subject()='http://nature.example.com/Article1';
    Please help me to find a solution to update triple
    Version: Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - 64bit Production
    Regards,
    Kavitha.

    Try the following (used model name as 'M1', replace it as appropriate):
    update articles_rdf_data a
    set a.triple=sdo_rdf_triple_s('M1','http://nature.example.com/test',a.triple.get_property(),a.triple.get_obj_value())
    where a.triple.get_subject()='http://nature.example.com/Article1'
    or a.triple.get_subject()='<http://nature.example.com/Article1>';

  • Concurrent writing to a model

    Hello,
    We are trying to find the best solution to write concurrently to the same semantic model. We have at times more than 20+ threads requesting to update triples in the semantic model. We are currently creating a synchronized block around the operation that all of the threads use to only allow one of the threads access to the editable model. When we did not use the syncronized block the INS and DEL triggers on the Application Table creating deadlocks.
    Is there a best practice for writing to the same model at the same time? Any guidence would be helpful.
    Thanks
    -MichaelB
    Edited by: MichaelB on Feb 8, 2012 9:55 AM

    The scenario that causes the deadlock is exactly the same as what occurs during concurrent DML into a relational table with a unique constraint.
    Underneath, the semantic store too has a uniqueness constraint defined to prevent duplicate RDF triples in the same RDF model. So, suppose one transaction T1 inserts triple (a,b,c), a second trans T2 inserts triple (d,e,f). Then the first transaction T1 tries to insert the triples (d,e,f), but it blocks because this triple has already been inserted by the yet-to-be-committed transaction T2. Now, when the second transaction T2 tries to insert triple (a,b,c), it blocks as well because this triple has already been inserted by the yet-to-be-uncommitted transaction T1. So, this circularity brings us to a deadlock and Oracle would raise ORA-00060: deadlock detected while waiting for resource.
    Since this is exactly how deadlock may occur in any relational table with unique constraints defined on it, the best practice for avoiding deadlock would be the same for concurrent inserts into the same RDF model.
    Hope this helps.

  • Help Insert Data

    Hi i am student doing a project for my school and i trying to insert data
    i am inserting triples with jena adapter into my Oracle Database from a .nt file. 4 tables are being created FAMILY_NS, FAMILY_TPL, RDFB_FAMILY and RDFC_FAMILY. my data are in N-Triple format.i want to know why i can't view my data through sql-developer in my database.do i store those data or not?
    here is the code i use to insert data into my database
    import java.io.*;
    import com.hp.hpl.jena.query.*;
    import com.hp.hpl.jena.graph.*;
    import com.hp.hpl.jena.rdf.model.*;
    import com.hp.hpl.jena.util.*;
    import oracle.spatial.rdf.client.jena.*;
    public class Bulk {
    public static void main(String[] args) throws Exception
    String szJdbcURL = "jdbc:oracle:thin:@192.168.2.3:1521:orcl";
    String szUser = "kostas";
    String szPasswd = "welcome";
    String szModelName = "Family";
    Oracle oracle = new Oracle(szJdbcURL, szUser, szPasswd);
    GraphOracleSem graph = new GraphOracleSem(oracle, szModelName);
    PrintStream psOut = System.out;
    String dirname = "C:\\users\\CoCo\\Desktop\\file";
    File fileDir = new File(dirname);
    String[] szAllFiles = fileDir.list();
    // loop through all the files in a directory
    for (int idx = 0; idx < szAllFiles.length; idx++) {
    String szIndFileName = dirname + File.separator + szAllFiles[idx];
    psOut.println("process to [ID = " + idx + " ] file " + szIndFileName);
    psOut.flush();
    try {
    // Model model = FileManager.get().loadModel("C:\\users\\CoCo\\Desktop\\file\\example.nt");
    InputStream is = new FileInputStream(szIndFileName);
    graph.getBulkUpdateHandler().prepareBulk(
    is, // input stream
    "http://www.recshop.fake/cd", // base URI
    "N-TRIPLE", // data file type: can be RDF/XML, N-TRIPLE, etc.
    null, // tablespace
    null, // flags
    null, // listener
    null // staging table name.
    is.close();
    catch (Throwable t) {
    psOut.println("Hit exception " + t.getMessage());
    Edited by: CoCo on Oct 18, 2011 6:14 AM
    Edited by: CoCo on Oct 18, 2011 6:15 AM

    You haven't run completeBulk yet.
    Please search for completeBulk in the following document.
    http://download.oracle.com/docs/cd/E16338_01/appdev.112/e11828/sem_jena.htm
    Thanks,
    Zhe Wu

  • Migration to reports 6i

    Hi, I have a problem with a reports 6i in batch mode.
    I am doing a migration reports 3.0 to a reports 6i, about 1000 reports.
    My comand line is this:
    for %%F in (%1\*.rdf) do C:\orant\BIN\Rwcon60.exe userid="%2" stype=rdffile source=%%F dtype=repfile compile_all=yes upgrade_plsql=yes overwrite=yes batch=yes
    %1 is my route
    %2 is my user database connection
    This bat file generate the .rep files but It doesn't update my .rdf files, but I need to update this files (.rdf) to appropiate version 6i.
    could you help me?
    I hope yours advices.
    Thanks in advance.

    I have found the solution.
    First convert .rdf version 3.0 to .rdf version 6i
    Second convert .rdf version 6i to .rep version 6i
    Put the script (%1 my route) (%2 database connection)
    for %%F in (%1\*.rdf) do C:\orant\BIN\Rwcon60.exe userid="%2" stype=rdffile source=%%F dtype=rdffile compile_all=yes upgrade_plsql=yes overwrite=yes batch=yes logfile=log.txt
    for %%F in (%1\*.rdf) do C:\orant\BIN\Rwcon60.exe userid="%2" stype=rdffile source=%%F dtype=repfile compile_all=yes upgrade_plsql=yes overwrite=yes batch=yes logfile=log.txt

  • Export a model in RDF/XML format without Jena?

    Hi,
    Are there means to export RDF triples in RDF/XML format without using Jena or any other Java staff?
    Thanks.

    Hi Dmitry,
    Unfortunately we do not have the code within SEM_APIS to do the task. This is something we already discussed with Development at some point in a case for another customer.
    What we have for now that you may already are aware of is the use of the jena framework to generate N-Triple or RDF/XML output
    There are a couple of notes:
    How To Use Jena Adapter To Extract A Model To Move From One Database To Another Database (Doc ID 1124288.1)
    How To Move Semantic Models From One Database To Another (Doc ID 1347754.1)
    Same code in those notes can be used to generate RDF/XML changing the line
    model.write(os, "N-TRIPLE");
    to
    model.write(os, "RDF/XML");
    The formats you can output are: "RDF/XML", "RDF/XML-ABBREV", "N-TRIPLE" and "N3". The default value is represented by null is "RDF/XML".
    I know this implies the extra work of installing java JDK and Jena framework but that is the only way for now.
    Regards!
    Jorge

  • Syntax of RDFS predicates and objects in triples?

    Hi,
    I am trying to create and load triples into the staging table from a flat file. My triples are like:
    <myProject:Observation>     rdfs:type     rdfs:Class
    <myProject:MouseWeight>     rdfs:subClassOf     <myProject:Observation>
    Will Oracle recognize this syntax of RDFS predicates and objects [and hence use them in a right way for inferencing, etc..]? Or should I use URL-based syntax, e.g. <http://www.w3.org/2000/01/rdf-schema#Class> instead of rdfs:Class?
    Thanks for your answers,
    Dmitry.

    1) Here is an updated script for bulk load for 11.2.0.3:
    -- Assuming semantic network has been created, user rdfuser has been created, RDF model family has been created
    -- load from flat file to staging table
    create table stable (
    RDF$STC_sub varchar2(4000) not null,
    RDF$STC_pred varchar2(4000) not null,
    RDF$STC_obj varchar2(4000) not null
    host sqlldr userid=rdfuser/rdfuser control=bulkload.ctl data=family.nt direct=true discardmax=0 bad=d0.bad discard=d0.rej log=d0.log errors=1000000
    -- MDSYS needs some privileges for doing bulk-load
    grant INSERT on family_rdf_data to MDSYS;
    grant SELECT on stable to MDSYS;
    -- invoke bulk-load from staging table
    exec sem_apis.bulk_load_from_staging_table('FAMILY','rdfuser','stable', flags => ' PARSE ');
    2) Here is sample RDF data (in file family.nt):
    <http://x.org/family/John> <http://x.org/family/fatherOf> <http://x.org/family/Suzie> .
    <http://x.org/family/John> <http://x.org/family/fatherOf> <http://x.org/family/Matt> .
    <http://x.org/family/Janice> <http://x.org/family/motherOf> <http://x.org/family/Suzie> .
    <http://x.org/family/Janice> <http://x.org/family/motherOf> <http://x.org/family/Matt> .
    <http://x.org/family/Sammy> <http://x.org/family/fatherOf> <http://x.org/family/Cathy> .
    <http://x.org/family/Sammy> <http://x.org/family/fatherOf> <http://x.org/family/Jack> .
    <http://x.org/family/Suzie> <http://x.org/family/motherOf> <http://x.org/family/Cathy> .
    <http://x.org/family/Suzie> <http://x.org/family/motherOf> <http://x.org/family/Jack> .
    <http://x.org/family/Matt> <http://x.org/family/fatherOf> <http://x.org/family/Tom> .
    <http://x.org/family/Matt> <http://x.org/family/fatherOf> <http://x.org/family/Cindy> .
    <http://x.org/family/Martha> <http://x.org/family/motherOf> <http://x.org/family/Tom> .
    <http://x.org/family/Martha> <http://x.org/family/motherOf> <http://x.org/family/Cindy> .
    <http://x.org/family/Cathy> <http://x.org/family/sisterOf> <http://x.org/family/Jack> .
    <http://x.org/family/Jack> rdf:type <http://x.org/family/Male> .
    <http://x.org/family/Tom> rdf:type <http://x.org/family/Male> .
    <http://x.org/family/Cindy> rdf:type <http://x.org/family/Female> .
    <http://x.org/family/Person> rdf:type rdfs:Class .
    <http://x.org/family/Male> rdfs:subClassOf <http://x.org/family/Person> .
    <http://x.org/family/Female> rdfs:subClassOf <http://x.org/family/Person> .
    <http://x.org/family/siblingOf> rdf:type rdf:Property .
    <http://x.org/family/parentOf> rdf:type rdf:Property .
    <http://x.org/family/brotherOf> rdfs:subPropertyOf <http://x.org/family/siblingOf> .
    <http://x.org/family/sisterOf> rdfs:subPropertyOf <http://x.org/family/siblingOf> .
    <http://x.org/family/brotherOf> rdfs:domain <http://x.org/family/Male> .
    <http://x.org/family/sisterOf> rdfs:domain <http://x.org/family/Female> .
    <http://x.org/family/fatherOf> rdfs:subPropertyOf <http://x.org/family/parentOf> .
    <http://x.org/family/motherOf> rdfs:subPropertyOf <http://x.org/family/parentOf> .
    <http://x.org/family/fatherOf> rdfs:domain <http://x.org/family/Male> .
    <http://x.org/family/motherOf> rdfs:domain <http://x.org/family/Female> .
    <http://x.org/family/Cathy> <http://x.org/family/height> "5.8"^^xsd:decimal .
    <http://x.org/family/Jack> <http://x.org/family/height> "6"^^xsd:integer .
    <http://x.org/family/Tom> <http://x.org/family/height> "05.75"^^xsd:decimal .
    <http://x.org/family/Cindy> <http://x.org/family/height> "06.00"^^xsd:decimal .

  • Import of RDF-Triple - HOW?

    Hello,
    i have some problem:
    I have just installed Oracle 11g. Now, i want to upgrade the database so that I can import RDF-Triple of the type "N3" into my Database. My questions now are:
    1. What do I have to do, to be able to import these triples? Is there any tutorial, that explaines, how I can upgrade for RDF-Import?
    2. When I successfully upgraded my database, how can I import my triples? Can I import N3-TRIPLES or do I have to convert them?
    It would be nice, if anyone can help me.
    Chris

    Hello guys,
    I am trying to Import some N3-Triple to my Database.
    I opened SQL*PLUS and logged in with user: 'SYSTEM'
    First, I installed the RDF-stuff with SQL'PLUS by typing @catsem11i.sql;
    Then, i did the following steps:
    1) CREATE TABLESPACE rdf_tablespace
    DATAFILE '/local/oracle/app/oracle/oradata/THESEUSDl/rdf_tablespace.dat' SIZE 1024M REUSE
    AUTOEXTEND ON NEXT 256M MAXSIZE UNLIMITED
    SEGMENT SPACE MANAGEMENT AUTO;
    2) EXECUTE SDO_RDF.CREATE_RDF_NETWORK('rdf_tablespace');
    3) GRANT EXECUTE ON MDSYS.RDF_APIS_INTERNAL TO SYS;
    4) CREATE TABLE RDF_DATA (id NUMBER, triple SDO_RDF_TRIPLE_S);
    5) EXECUTE SDO_RDF.CREATE_RDF_MODEL('RDF', 'RDF_DATA', 'TRIPLE');
    Well, then I took my littel Java-file for importing the triples:
    here is my code:
    import java.io.IOException;
    import java.io.InputStream;
    import java.io.PrintStream;
    import java.sql.SQLException;
    import oracle.spatial.rdf.client.jena.GraphOracleSem;
    import oracle.spatial.rdf.client.jena.ModelOracleSem;
    import oracle.spatial.rdf.client.jena.Oracle;
    import oracle.spatial.rdf.client.jena.OracleBulkUpdateHandler;
    import com.hp.hpl.jena.graph.GraphUtil;
    import com.hp.hpl.jena.rdf.model.Model;
    import com.hp.hpl.jena.rdf.model.ModelFactory;
    import com.hp.hpl.jena.util.FileManager;
    public class Import {
         * @param args
         * @throws ClassNotFoundException
         * @throws SQLException
         * @throws IOException
         public static void main(String[] args) throws ClassNotFoundException,
                   SQLException, IOException {
              PrintStream psOut = System.out;
              String tbs = "rdf_tablespace";
              int method = 1;
              String className = "oracle.jdbc.driver.OracleDriver"; // path of driver
              // class
              Class.forName(className); // Load the Driver
              String DB_URL = "jdbc:oracle:thin:@URL:1521:THESEUSDB"; // URL of database
              String DB_USER = "SYSTEM"; // database user id
              String DB_PASSWD = "secret_pw"; // database password
              String DB = "Oracle"; // database type
              // Create database connection
              Oracle oracle = new Oracle(DB_URL, DB_USER, DB_PASSWD);
              // darf nicht mit einer zahl anfangen
              String modelName = "onehoundred";
              // create or open the default model
              Model model = ModelFactory.createDefaultModel();
              GraphOracleSem graph = new GraphOracleSem(oracle, modelName);
              // read data
              String filename = "C:\\Path\\sp2b_100000.n3";
              InputStream is = FileManager.get().open(filename);
              // for n3 files
              model.read(is, "", "N3");
              is.close();
              ModelOracleSem modelDest = ModelOracleSem.createOracleSemModel(oracle,
                        modelName);
              GraphOracleSem g = modelDest.getGraph();
              g.dropApplicationTableIndex();
              //batch
                   psOut.println("start batch load");
                   ((OracleBulkUpdateHandler) g.getBulkUpdateHandler()).addInBatch(
                             GraphUtil.findAll(model.getGraph()), tbs);
                   psOut.println("end size " + modelDest.size());
              g.rebuildApplicationTableIndex();
              modelDest.close();
              // Close the database connection
              oracle.dispose();
              System.out.println("Ready.");
    I run it - it takes about 3 minutes - and the i get the following result:
    start batch load
    end size 100073
    Ready.
    So far, so good. But now, i have a little problem. If i look into my Database (with DBVisualizer) , i cannot find my imported triples...
    I don't understand why. In my Java Code, I have "String tbs = "rdf_tablespace"" which I also created before with SQL*Plus. And in that tablespace should be my table "RDF_DATA", i guess. So do I understand anything wrong? Did I forget any step?
    Who can help? I am very desperate right now :-)

  • After updating to the latest iphone 4 software, my triple click to voice over no longer works. I have double and triple checked all settings and it just doesn't work anymore. Advice?

    After updating my iphone 4 last, my triple click to voice over stopped working. I have checked all settings and it just isn't working anymore. Is this an issue with the latest update? Any way to fix this?

    Try resetting your phone:
    Press the sleep/wake button & home button at the same time, keep pressing until you see the Apple logo, then release.
    Then, recheck your Settings: Settings>General>Accessibility>Triple-click Home...

  • [Jena RDF] Error message ORA-13199

    Hello all, ,
    I use D2Rq for transformation of SGBD(SQLserveur at Oracle a semantic graph c12 through, used file .ttl)
    My error message is the following result:
    java.sql.SQLException: ORA-13199: During LBV: [04-NOV-14 03.07.15.421063000 PM -05:00]
    ORA-13199: Element Parse Error: Invalid numeric value [debug info: GCVN-numeric: 114.4000015258789E0] (value: "114.4000015258789E0"^^<http://www.w3.org/2001/XMLSchema#decimal>) [
    ORA-06512: at "MDSYS.MD", line 1723
    ORA-06512: at "MDSYS.MDERR", line 17
    ORA-06512: at "MDSYS.SDO_RDF", line 86
    ORA-06512: at "MDSYS.SDO_RDF_INTERNAL", line 1307
    ORA-06512: at line 1
    ORA-06512: at "MDSYS.SDO_RDF_INTERNAL", line 2826
    I am looking for a solution with Jena API? Or a way to hide exhibitors decimal (E0) !!
    Any suggestions would be welcome
    Ce message a été modifié par : 2773504

    Hello everyone, 
    I use d2rq to the transformation of relational and RDF file with the Association d2rq attached.
    The result is that when I recovered figures initially BigDecimale (in the relational database) I transform them ^^Double or ^^Decimal I have the scientific concept that is used with an E?
    Message: ORA-13199: Element Parse Error: Invalid numeric value [debug info: GCVN-numeric: 114.4000015258789E0] (value: "114.4000015258789E0"^^<http://www.w3.org/2001/XMLSchema#decimal>)
    How it is possible to resolve this behavior?
    Thins.

  • I updated the software which was supposed to allow deleting photos from photos and it worked for a time and now only let's me delete a few of them.  Also I found that the photo section tripled some of the photos and I can't get rid of them.  What is going

    I updated the software as required for the iPad and now I can no longer delete photos from the app in the photo section.  I had been able to do it but now there are multiple photos of the same pic and I can't remove any of them.  What is wrong?

    Photos in the Camera Roll or in the Imported Images album can be deleted within the album. One the album and select the icon with the curved arrow. Then tap on the photo or photos you want to delete to select them. Finally tap delete.
    For photos in other albums you delete them by moving them out of the albums they were in on your computer. If you're using a Mac open iTunes on your Mac and move the photos out of the album then go through the sync process with your iPad.
    If you're using a pc then move the photos out of the folders they are in and go through the sync process.

  • Address book has triple entries on after updating to cloud. How do I fix this?

    my address book in my phone has triple entered all addresses after I have joined the cloud with the new 4s iphone. How do I fix this?

    Try resetting the phone with the home and power buttons held in until the Apple logo appears, then turn location services on (or off and back on if it is already on).

  • Initial setup of triple store for use with Jena

    I have an instance of Oracle 11g that I want to use as the Persistent data layer for Jena. Can anyone point me to a good tutorial covering this?
    I'm quite confused as to whether there's anything on the database server itself I actually need to configure, or whether I can just go to town creating models directly via the Jena API.
    Thanks from an oracle noob,
    joe

    For 11g server, there is no need to configure anything special to the database to use Jena. (Of course, you need to do catsem11i.sql and then invoke sem_apis.create_sem_network...)
    On the client side, you do need to download Jena Adaptor 2.0 (see the following links)
    http://www.oracle.com/technology/tech/semantic_technologies/htdocs/documentation.html
    http://www.oracle.com/technology/software/tech/semantic_technologies/index.html
    After than, just include sdordfclient.jar in your classpath together with ojdbc5.jar and Jena
    libraries.
    The following readme has some code snippets.
    http://www.oracle.com/technology/tech/semantic_technologies/documentation/jenaadaptor2_readme.html
    Cheers,
    Zhe Wu

  • Error commiting update

    Hello again,
    We have a function that executes periodically, updating semantic data (removing and adding triples of different resources).
    But occasionally, that same method has thrown the exception listed below, with is strange because nothing changes in each iteration.
    Any idea about this? Thanks
    com.hp.hpl.jena.shared.JenaException: java.sql.SQLException: ORA-55312: parse failed for triple: id-form: 1155603932193326894 5351557915217640050 4442928618316056940
    ORA-06512: at "MDSYS.MD", line 1723
    ORA-06512: at "MDSYS.MDERR", line 38
    ORA-06512: at "MDSYS.SDO_RDF_INTERNAL", line 5341
    ORA-06512: at "MDSYS.OFERTAFORMATIVA_INS", line 37
    ORA-04088: error during execution of trigger 'MDSYS.OFERTAFORMATIVA_INS'
         at oracle.spatial.rdf.client.jena.OracleTransactionHandler.commit(OracleTransactionHandler.java:110)
         at com.hp.hpl.jena.rdf.model.impl.ModelCom.commit(ModelCom.java:1080)
         at org.fundacionctic.ogd.data.service.OracleJenaService.addResource(OracleJenaService.java:112)
         at org.fundacionctic.ogd.data.service.OracleJenaService.addRDF(OracleJenaService.java:418)
         at org.fundacionctic.ogd.data.XMLDataSource.updateData(XMLDataSource.java:59)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         at org.springframework.util.MethodInvoker.invoke(MethodInvoker.java:276)
         at org.springframework.scheduling.support.MethodInvokingRunnable.run(MethodInvokingRunnable.java:76)
         at org.springframework.scheduling.timer.DelegatingTimerTask.run(DelegatingTimerTask.java:66)
         at java.util.TimerThread.mainLoop(Timer.java:512)
         at java.util.TimerThread.run(Timer.java:462)
    Caused by: java.sql.SQLException: ORA-55312: parse failed for triple: id-form: 1155603932193326894 5351557915217640050 4442928618316056940
    ORA-06512: at "MDSYS.MD", line 1723
    ORA-06512: at "MDSYS.MDERR", line 38
    ORA-06512: at "MDSYS.SDO_RDF_INTERNAL", line 5341
    ORA-06512: at "MDSYS.OFERTAFORMATIVA_INS", line 37
    ORA-04088: error during execution of trigger 'MDSYS.OFERTAFORMATIVA_INS'
         at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:439)
         at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:395)
         at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:802)
         at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:436)
         at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:186)
         at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:521)
         at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:205)
         at oracle.jdbc.driver.T4CPreparedStatement.executeForRows(T4CPreparedStatement.java:1008)
         at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1307)
         at oracle.jdbc.driver.OraclePreparedStatement.sendBatch(OraclePreparedStatement.java:3753)
         at oracle.jdbc.driver.PhysicalConnection.commit(PhysicalConnection.java:3652)
         at oracle.jdbc.driver.PhysicalConnection.commit(PhysicalConnection.java:3680)
         at oracle.spatial.rdf.client.jena.OracleTransactionHandler.commit(OracleTransactionHandler.java:106)
         ... 13 more

    More details about this...
    We detected most of the exceptions thrown were related with locale issues. For our locale, ES-es, we inserted doubles values with a comma decimal delimiter, this way:
    resource.addProperty(prop,"-5,866197",(RDFDatatype) XSDDatatype.XSDdouble);
    That worked most of the time. But we noticed that some of our threads did not get the correct locale sometimes when were launched. We think that was the cause of the problem. When we fixed that, the vast majority of exceptions have gone away.
    Except in just two cases... when we get again one of the exceptions described above. For example, the insertion of this triple...
    [http://oracleto:8080/asturias/comun/gobierno/Direccion/592, http://www.w3.org/2003/01/geo/wgs84_pos#lat, "43,5353225"^^http://www.w3.org/2001/XMLSchema#double]
    throws the exception below:
    com.hp.hpl.jena.shared.JenaException: java.sql.SQLException: ORA-55312: fallo en el análisis para el triple: id-form: 5214721031104623137 5351557915217640050 5511382174874133559
    ORA-06512: en "MDSYS.MD", línea 1723
    ORA-06512: en "MDSYS.MDERR", línea 38
    ORA-06512: en "MDSYS.SDO_RDF_INTERNAL", línea 5341
    ORA-06512: en "MDSYS.LOCALIZACION_INS", línea 37
    ORA-04088: error durante la ejecución del disparador 'MDSYS.LOCALIZACION_INS'
         at oracle.spatial.rdf.client.jena.OracleTransactionHandler.commit(OracleTransactionHandler.java:110)
         at com.hp.hpl.jena.rdf.model.impl.ModelCom.commit(ModelCom.java:1080)
         at org.fundacionctic.ogd.data.service.OracleJenaService.addResource(OracleJenaService.java:119)
         at org.fundacionctic.ogd.data.service.OracleJenaService.addRDF(OracleJenaService.java:434)
         at org.fundacionctic.ogd.data.service.OracleJenaService.addRDF(OracleJenaService.java:460)
         at org.fundacionctic.ogd.data.D2RDataSource.updateData(D2RDataSource.java:69)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         at org.springframework.util.MethodInvoker.invoke(MethodInvoker.java:276)
         at org.springframework.scheduling.support.MethodInvokingRunnable.run(MethodInvokingRunnable.java:76)
         at org.springframework.scheduling.timer.DelegatingTimerTask.run(DelegatingTimerTask.java:66)
         at java.util.TimerThread.mainLoop(Timer.java:512)
         at java.util.TimerThread.run(Timer.java:462)
    Caused by: java.sql.SQLException: ORA-55312: fallo en el análisis para el triple: id-form: 5214721031104623137 5351557915217640050 5511382174874133559
    ORA-06512: en "MDSYS.MD", línea 1723
    ORA-06512: en "MDSYS.MDERR", línea 38
    ORA-06512: en "MDSYS.SDO_RDF_INTERNAL", línea 5341
    ORA-06512: en "MDSYS.LOCALIZACION_INS", línea 37
    ORA-04088: error durante la ejecución del disparador 'MDSYS.LOCALIZACION_INS'
         at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:439)
         at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:395)
         at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:802)
         at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:436)
         at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:186)
         at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:521)
         at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:205)
         at oracle.jdbc.driver.T4CPreparedStatement.executeForRows(T4CPreparedStatement.java:1008)
         at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1307)
         at oracle.jdbc.driver.OraclePreparedStatement.sendBatch(OraclePreparedStatement.java:3753)
         at oracle.jdbc.driver.PhysicalConnection.commit(PhysicalConnection.java:3652)
         at oracle.jdbc.driver.PhysicalConnection.commit(PhysicalConnection.java:3680)
         at oracle.spatial.rdf.client.jena.OracleTransactionHandler.commit(OracleTransactionHandler.java:106)
         ... 14 more
    And it is strange, because when we add that triple in a simple junit test, the insertion is finished with no problems. The test code:
              Oracle oracle = new Oracle(jdbcUrl, null, null);
              ModelOracleSem m = ModelOracleSem.createOracleSemModel(oracle,modelo);
              Resource r = m.createResource("http://oracleto:8080/asturias/comun/gobierno/Direccion/129");
              Property p = m.createProperty("http://www.w3.org/2003/01/geo/wgs84_pos#long");
              RDFNode o = m.createTypedLiteral("43,5353225",(RDFDatatype) XSDDatatype.XSDdouble);
              Statement stmt = m.createStatement(r, p, o);
              m.begin();
              m.add(stmt);
              m.commit();
              oracle.dispose();
    Any idea?

  • RDF + Virtual Private Database mechanism - r/w privileges to subject, ...

    Hi, is there a way how to give RDF subject/property/object read/write permissions with VPD policy? I only can give SELECT/UPDATE/DELETE permission to whole application table, but can I give read/write permissions to RDF subject, property or object?
    Edited by: user1000476 on 29.4.2011 10:22

    Hi,
    It is not supported to use the export/import for RDF data.
    In order to load the model into the Test Database, it is necessary to have the data in a file in N-Triple format.
    if you do not have the original data in N-Triple format or RDF/XML, then you need to extract it from the Prod database.
    Once you have the file in N-Triple format you can use the Bulk Loading method using Sql*Loader.
    From the Production database where the model is, you can extract the model out to an N-Triple file using the Jena Adaptor.
    In order to dump an existing model to N-Triple format to load it in another databasae do the following:
    cd <JENA_DIR>/lib
    create file dump_model.java:
    dump_model.java
    import java.io.*;
    import com.hp.hpl.jena.query.*;
    import com.hp.hpl.jena.rdf.model.Model;
    import com.hp.hpl.jena.util.FileManager;
    import oracle.spatial.rdf.client.jena.*;
    public class dump_model
    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);
    OutputStream os = new FileOutputStream("./output.nt");
    model.write(os, "N-TRIPLE");
    os.close();
    model.close();
    oracle.dispose();
    Change the commands according to the versions of Jena and Arq, this example is from past versions.
    To compile:
    javac -classpath ./:./jena-2.6.2.jar:./sdordfclient.jar:./ojdbc5.jar:slf4j-api-1.5.6.jar:log4j-1.2.13.jar:slf4j-log4j12-1.5.6.jar:arq-2.8.1.jar:xercesImpl-2.7.1.jar dump_model.java
    Change:
    rdfusr rdfusr family to <user> <password> <model_name>
    @machine.domain:1521:orcl with your connection info: @machine.domain:port:SID
    -- To run:
    java -classpath ./:./jena-2.6.2.jar:./sdordfclient.jar:./ojdbc5.jar:slf4j-api-1.5.6.jar:log4j-1.2.13.jar:slf4j-log4j12-1.5.6.jar:arq-2.8.1.jar:xercesImpl-2.7.1.jar:iri-0.7.jar:icu4j-3.4.4.jar dump_model jdbc:oracle:thin:@machine.domain:1521:orcl rdfusr rdfusr family
    The N-Triple file output.nt should be created in <JENA_DIR>/lib
    The NTriple file can be used to load the model into another database.
    To donwload the Jena Adaptor go to:
    http://www.oracle.com/technetwork/database/options/semantic-tech/downloads/index-156999.html
    click on "Download the Jena Adaptor for Oracle Database 11g Release 2 (ZIP - 772KB)"
    This version of Jena Adaptor needs:
    Jena 2.6.3, ARQ 2.8.5, Java JDK 1.6
    Regards!
    Jorge

Maybe you are looking for

  • Recommend a simple iphone password app that backs up to an Excel file?

    Need a simple password application for iphone (5C). App should reside entirely on the phone not the cloud, backup by wifi to computer, backup to or export the entire password file to an Excel file, have a search function for subjects, click to enter

  • Service not available 'Communities'

    Hi, 'Communities' application was working fine in my c3 phone till yesterday. now it is giving error 'service is not available' but i'm able to use internet on other applicarions in my c3. pl. help me out! Thanks

  • My iphone 4 is dead with water damage. Is there a way to recover data from the dead phone.

    My iphone 4 is dead with water damage. Is there a way to recover data from the dead phone. Could any one help where exectly the memory chip (not RAM) resides in the phone. Is it on the motherboard or a seperate component in the phone?

  • Why the CPU temperature is so high?

    My NB Model #MB466, the CPU temperature is 40-50C under normal running and the fan is 2000rpm (I use iStat). When the CPU usage is about 80%, the temperature goes up to 70 or 80C, I can feel it, especially the bottom area of the screen, and the fan g

  • Canon 5D Mark III = Light Leak & Exposure warning

    For those keen on the new 5DM3.... a warning about the exposure metering. It's been reported that using the LCD light in dark environments will affecting the metering. Ambient light on the top LCD will enter the exposure metering circuits to again me