本文整理汇总了Java中org.apache.jena.vocabulary.RDF.uri方法的典型用法代码示例。如果您正苦于以下问题:Java RDF.uri方法的具体用法?Java RDF.uri怎么用?Java RDF.uri使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.jena.vocabulary.RDF
的用法示例。
在下文中一共展示了RDF.uri方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: configure
import org.apache.jena.vocabulary.RDF; //导入方法依赖的package包/类
/**
* Configure the message route workflow.
*/
public void configure() throws Exception {
final Namespaces ns = new Namespaces("rdf", RDF.uri);
ns.add("premis", "http://www.loc.gov/premis/rdf/v1#");
/**
* A generic error handler (specific to this RouteBuilder)
*/
onException(Exception.class)
.maximumRedeliveries("{{error.maxRedeliveries}}")
.log("Index Routing Error: ${routeId}");
/**
* Handle fixity events
*/
from("{{fixity.stream}}")
.routeId("FcrepoFixity")
.to("fcrepo:{{fcrepo.baseUrl}}?preferInclude=ServerManged&accept=application/rdf+xml")
.filter().xpath(
"/rdf:RDF/rdf:Description/rdf:type" +
"[@rdf:resource='" + REPOSITORY + "Binary']", ns)
.log(LoggingLevel.INFO, LOGGER,
"Checking Fixity for ${headers[CamelFcrepoUri]}")
.delay(simple("{{fixity.delay}}"))
.to("fcrepo:{{fcrepo.baseUrl}}?fixity=true&accept=application/rdf+xml")
.choice()
.when().xpath(
"/rdf:RDF/rdf:Description/premis:hasEventOutcome" +
"[text()='SUCCESS']", ns)
.to("{{fixity.success}}")
.otherwise()
.log(LoggingLevel.WARN, LOGGER,
"Fixity error on ${headers[CamelFcrepoUri]}")
.to("{{fixity.failure}}");
}
示例2: testFixityOnBinary
import org.apache.jena.vocabulary.RDF; //导入方法依赖的package包/类
@Test
public void testFixityOnBinary() throws Exception {
final String webPort = System.getProperty("fcrepo.dynamic.test.port", "8080");
final String jmsPort = System.getProperty("fcrepo.dynamic.jms.port", "61616");
final String path = fullPath.replaceFirst("http://localhost:[0-9]+/fcrepo/rest", "");
final String fcrepoEndpoint = "mock:fcrepo:http://localhost:8080/fcrepo/rest";
final Namespaces ns = new Namespaces("rdf", RDF.uri);
ns.add("fedora", REPOSITORY);
ns.add("premis", "http://www.loc.gov/premis/rdf/v1#");
context.getRouteDefinition("FcrepoFixity").adviceWith(context, new AdviceWithRouteBuilder() {
@Override
public void configure() throws Exception {
mockEndpoints("*");
}
});
context.start();
getMockEndpoint(fcrepoEndpoint).expectedMessageCount(2);
getMockEndpoint("mock:success").expectedMessageCount(1);
template.sendBodyAndHeader("direct:start", "", FCREPO_URI,
"http://localhost:" + webPort + "/fcrepo/rest" + path);
assertMockEndpointsSatisfied();
final String body = getMockEndpoint("mock:success").assertExchangeReceived(0).getIn().getBody(String.class);
assertTrue(body.contains(
"<premis:hasSize rdf:datatype=\"http://www.w3.org/2001/XMLSchema#long\">74</premis:hasSize>"));
assertTrue(body.contains(
"<premis:hasMessageDigest rdf:resource=\"urn:sha1:" + digest + "\"/>"));
}