rdfjenaontologytriplestoretdb

Persisting data in Jena TDB triple store


I am using Jena TDB to persist RDF data. Before this I searched how to persist data in TDB and I came through the question at this link. Answer provided by Ryan clearly mentions the difference between various concepts, and one of the point I got about datasets is:

"A Dataset is like a DataSource, but its triples are static - you don't expect new ones to be added or existing ones to be deleted. These guys are read-only"

Keeping this in mind, I stored some rdf data in a named model within dataset. Now when I try to store/append some new data to this it clearly overwrites the previous one. So, this is doing clearly opposite to what Ryan has mentioned, i.e, read only nature. So the various points for which I need clarification include:

  1. Is Ryan correct about what he has discussed about dataset?
  2. If answer to point # 1 is yes, then why I am able to overwrite?
  3. Does TDB check for duplication before persisting data. I am asking this because I tried to insert a couple of duplicate RDF statements and I was expecting an increase in the count of rdf statements but there was no increase in count!

Solution

  • After receiving feedback and tweaking Jena, I found answers to all points as:

    1. Is Ryan correct about what he has discussed about dataset?

      From Joshua's comment and reading API I found that Jena framework has been improved a lot, so Ryan's explanation about datasets is not valid anymore.

    2. Does TDB check for duplication before persisting data. I am asking this because I tried to insert a couple of duplicate RDF statements and I was expecting an increase in the count of rdf statements but there was no increase in count!

      I tried to insert the duplicate statements in the same named graph but I did not find any increase in the count. I believe that TDB is not checking for duplication (not mentioned in documentation), but what it does if a same statement already exists in the graph it simply replaces existing one with the new one. As a result of this it does not result in any count increase.