1

I'd like to use Jena but not with TDB nor SDB, I already have a custom Triples Database (currently persistence is done with Cassandra).

Can I use Jena to load / manipulate RDF models from input and store them on my custom DB?

In other words: What glues together TDB with Jena, and can I intervene in this glue by implementing some interface(s) using my custom DB?

user40171
  • 155
  • 5

1 Answers1

2

TDB is just a storage layer like any other (it does not "cheat" in the way it wires into the rest of jena.)

Anything that implements DatasetGraph can be used for a triples database. There is an extensive hierarchy of support code for different styles of implementation such as all quads, triples+quads, triples only. See the type hierarchy below interface DatasetGraph; TDB uses DatasetGraphCaching.

See the code for how TDB wires into execution (summary: QC.setFactory).

(for longer discussion, dev@jena.apache.org is probably easier for details such as what aspects you care about most.)

AndyS
  • 16,345
  • 17
  • 21
  • Hey @AndyS, can you elaborate the line `See the code for how TDB wires into execution (summary: QC.setFactory).` please. – meditat Feb 22 '22 at 12:26
  • The answer is 7 years old ... nowadays, see `TDB2.init` which calls `QueryEngineTDB.register()`. For TDB2, `DatasetGraphTDB extends DatasetGraphStorage` and `DatasetGraphStorage` is part of the transaction and storage framework DBOE. – AndyS Feb 22 '22 at 14:24
  • I also want to change the storage layer, which class should I look @AndyS? thanks – meditat Feb 24 '22 at 04:11
  • `DatasetGraphStorage` but it would help somewhat if you describe what sort of storage you are looking at considering. Different systems have different capabilities. – AndyS Feb 24 '22 at 10:25
  • I am trying to replace TDB with JanusGraph – meditat Feb 25 '22 at 05:44
  • They have different data models so you have to design the mapping of RDF to Janus. It's not going to be a simple one-class replacement. The other thing is to do some investigation because there is already material on the web about RDF and Janus graph. `DatasetGraphStorage` is a possible place but it depends on what you are trying to achieve overall. – AndyS Feb 25 '22 at 22:59