Package org.openrdf.model

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


              stmts.add(factory.createStatement(iiURI, RDFS.LABEL, Literals.createLiteral(factory, ii)));
            }     
          }
             
          stmts.add(factory.createStatement(iiURI, RDF.TYPE, eURI)); // entity
          stmts.add(factory.createStatement(miURI, usedURI, iiURI)); // used         
        }
      }
    }
   
    File file = new File(root, PROV_FILE);
View Full Code Here


    ValueFactory vf = new ValueFactoryImpl();
    URI uri1 = vf.createURI(ns1, "r1");
    URI uri2 = vf.createURI(ns2, "r2");
    URI uri3 = vf.createURI(ns3, "r3");
    Statement st = vf.createStatement(uri1, uri2, uri3);

    StringWriter writer = new StringWriter();
    RDFWriter rdfWriter = rdfWriterFactory.getWriter(writer);
    rdfWriter.handleNamespace("", ns1);
    rdfWriter.handleNamespace("", ns2);
View Full Code Here

    ValueFactory vf = new ValueFactoryImpl();
    URI uri1 = vf.createURI(ns1, "r1");
    URI uri2 = vf.createURI(ns2, "r2");
    URI uri3 = vf.createURI(ns3, "r3");
    Statement st = vf.createStatement(uri1, uri2, uri3);

    StringWriter writer = new StringWriter();
    RDFWriter rdfWriter = rdfWriterFactory.getWriter(writer);
    rdfWriter.handleNamespace("1", ns1);
    rdfWriter.handleNamespace("_", ns2);
View Full Code Here

          URI predicate = (URI)bindingSet.getValue("predicate");
          Value object = bindingSet.getValue("object");
          Resource context = (Resource)bindingSet.getValue("context");

          if (context == null) {
            return vf.createStatement(subject, predicate, object);
          }
          else {
            return vf.createStatement(subject, predicate, object, context);
          }
        }
View Full Code Here

          if (context == null) {
            return vf.createStatement(subject, predicate, object);
          }
          else {
            return vf.createStatement(subject, predicate, object, context);
          }
        }
      };

      return new GraphQueryResultImpl(getParsedQuery().getQueryNamespaces(), stIter);
View Full Code Here

          Value subj = bindings.getValue("subject");
          Value pred = bindings.getValue("predicate");
          Value obj = bindings.getValue("object");

          if (subj instanceof Resource && pred instanceof URI && obj != null) {
            statements.add(vf.createStatement((Resource)subj, (URI)pred, obj));
          }
        }
      }
      finally {
        bindingsIter.close();
View Full Code Here

      URI person2 = addFoafPerson(vf, con, "http://lab.linkeddata.deri.ie/test#lushan-han", "Lushan Han", "lushan@umbc.edu");
      URI person3 = addFoafPerson(vf, con, "http://lab.linkeddata.deri.ie/test#wenjia-li", "Wenjia Li", "wenjia@umbc.edu");
   
      //office numbers
      URI officeNumberProp = vf.createURI("http://lab.linkeddata.deri.ie/test#officeNumber");
      con.add(vf.createStatement(person1, officeNumberProp, vf.createLiteral(329)));
      con.add(vf.createStatement(person2, officeNumberProp, vf.createLiteral(377)));
      con.add(vf.createStatement(person3, officeNumberProp, vf.createLiteral(377)));
   
      //advisor
      URI advisor = vf.createURI("http://lab.linkeddata.deri.ie/test#anupam-joshi");
View Full Code Here

      URI person3 = addFoafPerson(vf, con, "http://lab.linkeddata.deri.ie/test#wenjia-li", "Wenjia Li", "wenjia@umbc.edu");
   
      //office numbers
      URI officeNumberProp = vf.createURI("http://lab.linkeddata.deri.ie/test#officeNumber");
      con.add(vf.createStatement(person1, officeNumberProp, vf.createLiteral(329)));
      con.add(vf.createStatement(person2, officeNumberProp, vf.createLiteral(377)));
      con.add(vf.createStatement(person3, officeNumberProp, vf.createLiteral(377)));
   
      //advisor
      URI advisor = vf.createURI("http://lab.linkeddata.deri.ie/test#anupam-joshi");
      con.add(vf.createStatement(advisor, vf.createURI("http://xmlns.com/foaf/0.1/name"), vf.createLiteral("Anupam Joshi")));
View Full Code Here

   
      //office numbers
      URI officeNumberProp = vf.createURI("http://lab.linkeddata.deri.ie/test#officeNumber");
      con.add(vf.createStatement(person1, officeNumberProp, vf.createLiteral(329)));
      con.add(vf.createStatement(person2, officeNumberProp, vf.createLiteral(377)));
      con.add(vf.createStatement(person3, officeNumberProp, vf.createLiteral(377)));
   
      //advisor
      URI advisor = vf.createURI("http://lab.linkeddata.deri.ie/test#anupam-joshi");
      con.add(vf.createStatement(advisor, vf.createURI("http://xmlns.com/foaf/0.1/name"), vf.createLiteral("Anupam Joshi")));
      URI advisorType = vf.createURI("http://lab.linkeddata.deri.ie/test#Advisor");
View Full Code Here

      con.add(vf.createStatement(person2, officeNumberProp, vf.createLiteral(377)));
      con.add(vf.createStatement(person3, officeNumberProp, vf.createLiteral(377)));
   
      //advisor
      URI advisor = vf.createURI("http://lab.linkeddata.deri.ie/test#anupam-joshi");
      con.add(vf.createStatement(advisor, vf.createURI("http://xmlns.com/foaf/0.1/name"), vf.createLiteral("Anupam Joshi")));
      URI advisorType = vf.createURI("http://lab.linkeddata.deri.ie/test#Advisor");
      con.add(vf.createStatement(advisor, RDF.TYPE, advisorType));
      con.add(vf.createStatement(person1, RDF.TYPE, advisorType));
   
      //university
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.