Replies: 2 comments 8 replies
-
Well there's Commons RDF but that's essentially a dead project because none of the contributing projects could agree on anything 🤣 Turning this around could we think about inverting the control flow here? Part of the overhead right now AFAIK is that we have to hand full control over to Titanium and then convert its final output data model back into Jena's data model. If instead Titanium had an output interface in the vein of Jena's StreamRDF then we could hand a Jena specific implementation of that interface to Titanium. Then Titanium call the relevant methods on its interface as it produces triples which Jena can then immediately convert to its own types in a streaming fashion. I don't know if this is feasible within the JSON-LD processing model but perhaps worth considering. WDYT? |
Beta Was this translation helpful? Give feedback.
-
Current Titanium API works as a supplier (PULL), and accepts only complete data (PULL). requirements
PUSH: Titanium -> Jena// Jena calls toRDF
void JsonLd.toRDF(jsonld).options(...).produce(consumer);
//Titanium writes RDF to the provided consumer inside produce method
loop [
// Jena provided code called inside produce method
consumer.dataset(...);
consumer.accept(...)
]
// Jena gets back full control and might close the consumer
consumer.end(); // can be dropped, as toRDF's done writing PUSH: Jena -> Titanium// Jena calls fromRDF
<RDFConsumer, Supplier<JsonArray>> consumer = JsonLd.fromRDF().options(...).consumeAndSupply();
// Jena writes RDF to the consumer
loop [
consumer.dataset(...).accept(...).accept(...).accept(...) // Flow?
.dataset(...).accept(...);
]
// Jena closes the consumer
consumer.end();
// Jena gets JSON-LD
JsonArray jsonld = consumer.get(); // could act as end() APIinterface RDFConsumer {
dataset(name);
accept(resource, predicate, value, datatype);
accept(resource, predicate, value);
// end can be dropped to keep it minimal
end();
} Just brainstorming, thank you for the comments. |
Beta Was this translation helpful? Give feedback.
-
Let's collaborate on a new repository with RDF dataset interfaces that would allow seamless integration between Jena & Titanium and maybe other libs, like URDNA2015, N-QUADS Reader/Writer (bundled with Titanium now) etc.
The interface(s) should be minimal and single purpose, to exchange RDF dataset, i.e. reading. It is hard, and there are existing attempts, but something like micro-jars, containing only minimum necessary, single purpose, interfaces could be a way to deal with limitations/features coming from strongly typed language and dependencies linking enforcing strong consistency. In comparison to the JavaScript world where compatibility is declared.
Beta Was this translation helpful? Give feedback.
All reactions