trellis-ldp/trellis

Positioning / contrast with Jena

Closed this issue · 8 comments

Wondering how this project compares with Apache Jena

Are these two similar platforms, or are there differences that are worth considering so that users could pick the best option suited for them.

This project uses Jena extensively.

Jena provides tooling for processing RDF. Jena also provides a full Triplestore implementation (Fuseki). In contrast, the Linked Data Platform is a high level abstraction that combines RDF and RESTful HTTP APIs.

If you plan to build Linked Data (RDF) applications that read and write web-based resources, LDP (and Trellis) allows you to do that. If you don't especially care about LDP notions of containment or combining RDF and HTTP APIs, then Jena will likely serve your purposes.

Thank you @acoburn Glad to know that this project uses Jena.

Our requirement is inferencing / reasoning with linked data. Trellis looks like an interesting project and given your earlier confirmation that it can be used through HTTP APIs from any language client, it is appropriate for our tool chain.

However, it is not clear if functionalities such as inference (support by Jena) can be used on Trellis (through HTTP API from, say, JavaScript).

Do you have any examples of inferencing / reasoning or such similar advanced functionality (beyond just reading and writing linked data) with Trellis? It would greatly help us adopt Trellis for our POC.

Trellis does not, on its own, support any sort of inference.

That said, you can use Trellis with a Triplestore persistence layer (e.g. Jena Fuseki). If that Triplestore is configured to use an inference regime, then you will get that additional feature "for free".

One thing to consider, though, is that if your central use case revolves around RDF reasoning, you may want think about having your JavaScript client interact directly with the SPARQL 1.1 API that Fuseki provides. All the interactions would go over HTTP(S), so any client language would work.

I am interested in setting up Trellis with a Triplestore persistence layer and then querying the Triplestore directly, as you described.
Which brings me to my question:
How does Trellis persist its Mementos? Would I also be able to access previous versions of LDP RDF Sources by querying the Triplestore?

The docker container that uses a Triplestore stored Mementos in static files. If your Triplestore has inference enabled, those entailed triples will be in the Memento resources.

Here is what I would suggest:

Use the provided trellis-triplestore docker container. If you're using docker-compose, you can use this configuration as a starting point. For other orchestration systems (K8) you should be able to adjust from this baseline.

The important thing to change is the line with TRELLIS_TRIPLESTORE_RDF_LOCATION: . There, you will want to use a URL, pointing to a triplestore. This Jena documentation will be helpful, especially the part about "Configuring a remote RDFConnection". The value of that URL will be the location of the triplestore without the /query or /update portion of the URL.

Thank you for the information! My intention would have been to run queries like: “Give me all revisions of a specific resource containing a certain triple”, without retrieving all Mementos individually. Am I correct in believing that this is not possible, because only the “current state” is accessible through SPARQL?

In this case, you probably would want something a bit different than what I suggested earlier. If you would like to make a triple store query endpoint available to clients to perform those sorts of requests, you would probably want to have an independent (sidecar) triple store. That would involve more infrastructure and making use of the messaging system that comes with Trellis.

For instance, when a resource is created/modified/deleted, a message will be sent to the configured JMS/AMQP/Kafka topic where a message processor can handle any additional integration work. If you are familiar with Apache Camel, there are several examples here: https://github.com/trellis-ldp/camel-ldp-recipes. To support memento look-ups you'd need to adapt the triple store middleware, but it shouldn't be too complicated.

For more information about the messaging subsystem, please refer to https://github.com/trellis-ldp/trellis/wiki/Notifications