The DB2® implementation
of JENA model API is limited in how you can use the Model.read() and Model.add(Model) APIs.
- Duplicate triples when using the Model.read() API
- If the input source contains duplicate triples, it is possible
that duplicates are not removed, because the JENA library implementation
of the Model.read() API uses bulk loading in batches
of 1000 triples. The DB2 RDF
store does not filter duplicate triples across these batches.
As
a workaround, always read the input source into an in-memory JENA
model and then add the in-memory model to the DB2 store by using the Model.add(model) API.
- Duplicate triples when using the Model.add(Model) API
- The Model.add(Model) API assumes the graph that
is being added does not exist in the data set. If the graph exists
and you are adding duplicate triples, the duplicate triple is not
removed.
The suggested approach for a DB2 RDF
store is listed here:
- The first time you add a graph, use the Model.add(Model) method.
- If you want to add or update triples to that existing graph,
use the following functions:
- model.add(s,p,v)
- model.add(statement)
- graph.add(Triple)
- Resource.addXX()
Remember: If you are adding a triple that exists,
an error message is returned.
In DB2 Version 10.1
Fix Pack 2 and later fix packs, both of the preceding limitations
are now removed in the DB2 product
implementation of the JENA API.