Package org.openrdf.model

Examples of org.openrdf.model.ValueFactory.createURI()


   
    URI hadPlanURI  = factory.createURI(PROV_NAMESPACE, "hadPlan");
    URI hadAgentURI  = factory.createURI(PROV_NAMESPACE, "agent");
     
    URI platformURI = factory.createURI(NAMESPACE + "ducktape/", InetAddress.getLocalHost().getHostName() + "/" + Global.getSerialversionuid());
    URI workflowURI = factory.createURI(NAMESPACE + "workflow/", workflow.file().getAbsolutePath() + "/" + workflowMD5sum);
     
    // The software is the agent and the workflow is the plan
    stmts.add(factory.createStatement(platformURI, RDF.TYPE, agURI));
    stmts.add(factory.createStatement(workflowURI, RDF.TYPE, planURI));
   
View Full Code Here


    String moduleInstanceSumTimestamp = "module/instance/"+InetAddress.getLocalHost().getHostName()+"/"+workflowMD5sum+"/"+currentTimeMilis+"/";
    for (Module module : workflow.modules()) {
     
      for (ModuleInstance mi : module.instances()) {
        // Create provenance for the module (as an activity)
        URI miURI = factory.createURI(NAMESPACE + moduleInstanceSumTimestamp, module.name() + mi.moduleID());
        stmts.add(factory.createStatement(miURI, RDF.TYPE, acURI)); // Activity
        stmts.add(factory.createStatement(miURI, startAtURI, Literals.createLiteral(factory, new Date(mi.startTime())))); // Start time
        stmts.add(factory.createStatement(miURI, endAtURI, Literals.createLiteral(factory, new Date(mi.endTime())))); // end time     
        stmts.add(factory.createStatement(miURI, wawURI, platformURI)); // wasAssociatedWith
       
View Full Code Here

        stmts.add(factory.createStatement(bn, hadAgentURI, platformURI));
        stmts.add(factory.createStatement(miURI, qualAssoURI, bn));
       
        // Create provenance for the outputs (as entities)
        for (InstanceOutput io : mi.outputs()) {
          URI ioURI = factory.createURI(NAMESPACE + moduleInstanceSumTimestamp, module.name() + mi.moduleID() + "/output/" + io.name());
          stmts.add(factory.createStatement(ioURI, RDF.TYPE, eURI)); // entity
          stmts.add(factory.createStatement(ioURI, wgbURI, miURI)); // wasGeneratedBy
          stmts.add(factory.createStatement(ioURI, genAtURI, Literals.createLiteral(factory, new Date(io.creationTime())))); // generated at time
          stmts.add(factory.createStatement(ioURI, watURI, platformURI)); // wasAttributedTo
         
View Full Code Here

        // Create provenance for the inputs (as entities)
        for (InstanceInput ii : mi.inputs()) {
          URI iiURI = null;
         
          if (ii.instanceOutput() != null) {
            iiURI = factory.createURI(NAMESPACE + moduleInstanceSumTimestamp, ii.instanceOutput().module().name()
                + ii.instanceOutput().instance().moduleID() + "/output/" + ii.name());
          } else {
            iiURI = factory.createURI(NAMESPACE + moduleInstanceSumTimestamp, module.name() + mi.moduleID()
                + "/input/" + ii.name());
           
View Full Code Here

         
          if (ii.instanceOutput() != null) {
            iiURI = factory.createURI(NAMESPACE + moduleInstanceSumTimestamp, ii.instanceOutput().module().name()
                + ii.instanceOutput().instance().moduleID() + "/output/" + ii.name());
          } else {
            iiURI = factory.createURI(NAMESPACE + moduleInstanceSumTimestamp, module.name() + mi.moduleID()
                + "/input/" + ii.name());
           
            // If we can create a literal
            if (Literals.canCreateLiteral(ii.value())) {
              stmts.add(factory.createStatement(iiURI, valueURI, Literals.createLiteral(factory, ii.value())));
View Full Code Here

   
    private void testRepoContent(RepositoryConnection con) throws RepositoryException {
        final ValueFactory vf = con.getValueFactory();
        assertThat(con.size(), CoreMatchers.equalTo(new Long(34)));
        assertTrue(con.hasStatement(vf.createURI("http://localhost:8080/LMF/resource/hans_meier"), RDF.TYPE, FOAF.Person, true));
        assertTrue(con.hasStatement(vf.createURI("http://localhost:8080/LMF/resource/sepp_huber"), RDF.TYPE, FOAF.Person, true));
        assertTrue(con.hasStatement(vf.createURI("http://localhost:8080/LMF/resource/anna_schmidt"), RDF.TYPE, FOAF.Person, true));
    }

    private KiWiConfiguration getKiWiConfig() {
View Full Code Here

   
    private void testRepoContent(RepositoryConnection con) throws RepositoryException {
        final ValueFactory vf = con.getValueFactory();
        assertThat(con.size(), CoreMatchers.equalTo(new Long(34)));
        assertTrue(con.hasStatement(vf.createURI("http://localhost:8080/LMF/resource/hans_meier"), RDF.TYPE, FOAF.Person, true));
        assertTrue(con.hasStatement(vf.createURI("http://localhost:8080/LMF/resource/sepp_huber"), RDF.TYPE, FOAF.Person, true));
        assertTrue(con.hasStatement(vf.createURI("http://localhost:8080/LMF/resource/anna_schmidt"), RDF.TYPE, FOAF.Person, true));
    }

    private KiWiConfiguration getKiWiConfig() {
        final Properties p = loaderProps;
View Full Code Here

    private void testRepoContent(RepositoryConnection con) throws RepositoryException {
        final ValueFactory vf = con.getValueFactory();
        assertThat(con.size(), CoreMatchers.equalTo(new Long(34)));
        assertTrue(con.hasStatement(vf.createURI("http://localhost:8080/LMF/resource/hans_meier"), RDF.TYPE, FOAF.Person, true));
        assertTrue(con.hasStatement(vf.createURI("http://localhost:8080/LMF/resource/sepp_huber"), RDF.TYPE, FOAF.Person, true));
        assertTrue(con.hasStatement(vf.createURI("http://localhost:8080/LMF/resource/anna_schmidt"), RDF.TYPE, FOAF.Person, true));
    }

    private KiWiConfiguration getKiWiConfig() {
        final Properties p = loaderProps;
        KiWiConfiguration config = new KiWiConfiguration("loader-test",
View Full Code Here

        XMLGregorianCalendar calendar;
        ValueFactory vf = sail.getValueFactory();
        SailConnection sc = sail.getConnection();

        // Get an actual plain literal from the triple store.
        URI ford = vf.createURI(prefix + "ford");
        l = (Literal) toSet(sc.getStatements(ford, RDFS.COMMENT, null, false)).iterator().next().getObject();
        assertNotNull(l);
        assertNull(l.getLanguage());
        assertEquals("he really knows where his towel is", l.getLabel());
        assertNull(l.getDatatype());
View Full Code Here

        l = (Literal) toSet(sc.getStatements(ford, RDFS.COMMENT, null, false)).iterator().next().getObject();
        assertNotNull(l);
        assertNull(l.getLanguage());
        assertEquals("he really knows where his towel is", l.getLabel());
        assertNull(l.getDatatype());
        URI thor = vf.createURI(prefix + "thor");

        // Get an actual language-tagged literal from the triple store.
        URI foafName = vf.createURI("http://xmlns.com/foaf/0.1/name");
        Iterator<Statement> iter = toSet(sc.getStatements(thor, foafName, null, false)).iterator();
        boolean found = false;
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.