I have a string message from an AMQP message broker that consists of RDF statements. I want to covert it into a Jena model using Java and then merge the converted model with another one into single model. How can I do this?
相关问题
- Calculate the depth of subclass in the OWL ontolog
- Are topic exchanges the only exchanges that suppor
- MVC2 - Consume RSS feed with RDF and namespace htt
- Routing messages in RabbitMQ topic exchange that d
- RDFlib 'on disk' store
相关文章
- RDF libraries for Scala [closed]
- The difference between blank nodes and variables i
- How to turn a SPARQL/SPIN query/rule into an RDF s
- Triple extraction from a sentance
- boundary for arbitrary property path in SPARQL 1.1
- sparql complete tree from subject
- Jena Fuseki assembler file + TDB + OWL reasoner
- AMQP Delay Delivery and Prevent Duplicate Messages
This can be divided into three logical steps. Some of these, you may have already done:
Model
.As the first two are domain-specific, you will not likely find much help here unless you can provide some example input. Additionally, that would likely be considered a separate question (eg: 'how can I partition a string based on presence of RDF syntax?')
For the third, it's extremely quick and easy to do. Let us assume that you have a document in the
N-Triples
Format that you have extracted from the rest of your text. The following JUnit test demonstrates the ability to parse that and interact with its content.Edit/Part II
After seeing your comment, I felt it prudent to add another note regarding the merging of models. In Jena, you can merge models by adding all of their triples together. This can create some leftover models that end up being garbage collected, which may not necessarily be the best scenario for your system.
In this example, the two source models now need collecting. It would be wise to either use one of the existing models as the destination for all the triples, or to create a model of the union of the two underlying graphs (resulting in both graphs being re-used):
I also leave an assumption in place that you are able to get
String
objects from your AMQP server, so that #3 from the first half of this answer is still relevant to your scenario.