当前位置: 首页>>代码示例>>Java>>正文


Java RDF.uri方法代码示例

本文整理汇总了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}}");
}
 
开发者ID:fcrepo4-exts,项目名称:fcrepo-camel-toolbox,代码行数:39,代码来源:FixityRouter.java

示例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 + "\"/>"));
}
 
开发者ID:fcrepo4-exts,项目名称:fcrepo-camel-toolbox,代码行数:33,代码来源:RouteIT.java


注:本文中的org.apache.jena.vocabulary.RDF.uri方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。