...
Some additional processing must be done to transform an application/n-triples
response into a valid application/sparql-update
payload before sending to Fuseki or Sesame. The fcrepo component contains some processors in org.fcrepo.camel.processor
to handle this case. The examples below assume that messages have already been routed based on eventType
(see below) and passed to the appropriate queue.
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
from("activemqdirect:topic:fedora")delete") .process(new SparqlDescribeProcessor()) .to("fcrepohttp4:localhost:80803030/fedora/rest?accept=application/n-triplesdb/query") .process(new SparqlUpdateProcessorSparqlDeleteProcessor()) .setHeader(Exchange.CONTENT_TYPE).constant("application/sparql-updateto("http4:localhost:3030/db/update"); from("direct:new") .to("fcrepo:localhost:8080/rest?accept=application/n-triples") .process(new SparqlInsertProcessor()) .to("http4:localhost:3030/db/update"); from("direct:update") .process(new SparqlDescribeProcessor()) .to("http4:localhost:3030/db/query") .process(new SparqlDeleteProcessor()) .to("http4:localhost:3030/db/update") .to("fcrepo:localhost:8080/rest?accept=application/n-triples") .process(new SparqlInsertProcessor()) .to("http4:localhost:3030/db/update"); |
Event-based Routing
...