This content has been marked as final. Show 5 replies
Are you trying to load triples using JDBC? If so, both Jena Adapter and Sesame Adapter provides functions you can use directly.
Please refer to the following document for details.
If you have a good reason to do it yourself, then you can try something like:
addStmt = (OraclePreparedStatement)
"INSERT INTO " + tableName + " (" + colName + ")" +
"VALUES(SDO_RDF_TRIPLE_S( ?, ?, ?, ?, ? ) )"));
There are some tricky things to watch out for, including escaping, long literal handling, JDBC batching, etc.
Note that this kind of data loading is incremental. It is recommended for a small amount of data.
If you have tons of data, you need to use bulk loader
for better performance. The same document describes various data loading in details.
I am trying to load these using JPA with Hibernate as my implementation. So I am not sure how I would use the Jena or Sesame in combination with Hibernate? I know how to get Hibernate to use custom insert statements, now the question is how can I use the non-default constructor of the SDO_RDF_TRIPLE_S object using JDBC. I would like to use the constructor that takes the Model, Subject, Property, and Object.
You can modify the example provided to make it a four-parameter constructor. That one has five parameters in total. Just remove the last parameter.
That works fine. Is this preferred way of inserting RDF data? Can you not use Oracle Object types to accomplish this?
Haven't spent much time looking into the data loading using object types. It may work fine.