Package com.hp.hpl.jena.rdf.model

Examples of com.hp.hpl.jena.rdf.model.Model.createResource()


    public static Model createModel()
    {
        Model model = ModelFactory.createDefaultModel() ;
       
        Resource r1 = model.createResource("http://example.org/book#1") ;
        Resource r2 = model.createResource("http://example.org/book#2") ;
        Resource r3 = model.createResource("http://example.org/book#3") ;
       
        r1.addProperty(DC.title, "SPARQL - the book")
          .addProperty(DC.description, "A book about SPARQL") ;
       
View Full Code Here


    {
        Model model = ModelFactory.createDefaultModel() ;
       
        Resource r1 = model.createResource("http://example.org/book#1") ;
        Resource r2 = model.createResource("http://example.org/book#2") ;
        Resource r3 = model.createResource("http://example.org/book#3") ;
       
        r1.addProperty(DC.title, "SPARQL - the book")
          .addProperty(DC.description, "A book about SPARQL") ;
       
        r2.addProperty(DC.title, "Advanced techniques for SPARQL") ;
View Full Code Here

    private static Model make()
    {
        String BASE = "http://example/" ;
        Model model = ModelFactory.createDefaultModel() ;
        model.setNsPrefix("", BASE) ;
        Resource r1 = model.createResource(BASE+"r1") ;
        Resource r2 = model.createResource(BASE+"r2") ;

        r1.addProperty(RDFS.label, "abc") ;
        r2.addProperty(RDFS.label, "def") ;
View Full Code Here

    {
        String BASE = "http://example/" ;
        Model model = ModelFactory.createDefaultModel() ;
        model.setNsPrefix("", BASE) ;
        Resource r1 = model.createResource(BASE+"r1") ;
        Resource r2 = model.createResource(BASE+"r2") ;

        r1.addProperty(RDFS.label, "abc") ;
        r2.addProperty(RDFS.label, "def") ;

        return model  ;
View Full Code Here

  /**
   * @return
   */
  private Model createAuthenticationModel() {
    Model userModel = ModelFactory.createDefaultModel();
    Resource userBeta = userModel.createResource(FOAF.Person);
    userBeta.addProperty(ACCOUNTMANAGER.userName, username);
    userBeta.addProperty(ACCOUNTMANAGER.passwordSha1, Util.sha1(password));
    return userModel;
  }
 
View Full Code Here

    return userModel;
  }
 
  private Model createAuthorizationModel() {
    Model userModel = ModelFactory.createDefaultModel();
    Resource userBeta = userModel.createResource(FOAF.Person);
    Resource userSource = userModel.createResource(userSourceURL);
    userBeta.addProperty(AUTHORIZATION.mayImpersonate, userSource);
    userBeta.addProperty(ACCOUNTMANAGER.userName, username);
    return userModel;
  }
View Full Code Here

  }
 
  private Model createAuthorizationModel() {
    Model userModel = ModelFactory.createDefaultModel();
    Resource userBeta = userModel.createResource(FOAF.Person);
    Resource userSource = userModel.createResource(userSourceURL);
    userBeta.addProperty(AUTHORIZATION.mayImpersonate, userSource);
    userBeta.addProperty(ACCOUNTMANAGER.userName, username);
    return userModel;
  }
View Full Code Here

    // Model model1 = modelWithStatements("_a dc:subject 'test1';
    // http://www.google.com/ foaf:maker 'ygf'");
    Model model1 = modelWithStatements("_a dc:subject _b");
    Model model2 = ModelFactory.createDefaultModel();
    model2.createResource().addProperty(DC.subject, "test2");
    graphs[0] = new FCAGraphImpl(model1);
    graphs[1] = new FCAGraphImpl(model2);
    clock.setTime(new W3CDateFormat()
    .parse("2006-05-01T16:30:00Z"));
    store.updateGraph(source, graphs[0]);
View Full Code Here

    Model model = JenaUtil.getModelFromGraph(graph);
    ResIterator resIter = model.listSubjectsWithProperty(ACCOUNTMANAGER.userName, username);
    if (resIter.hasNext()) {
      return resIter.nextResource();
    } else {
      return model.createResource();
    }
  }

  /* (non-Javadoc)
   * @see java.security.Policy#refresh()
View Full Code Here

   */
  public void handle(Request request, TypedResponse<Graph> response) throws HandlerException {
    Set<Source> sources = store.getSources();
    Model resultModel = ModelFactory.createDefaultModel();
    for (Source source : sources) {
      Resource sourceRes = resultModel.createResource(source.getURIRef());
      sourceRes.addProperty(RDF.type, METAMODEL.Source);
    }
    Subject subject = Subject.getSubject(AccessController.getContext());
    Set<GVSPrincipal> gvsPrincipals = subject.getPrincipals(GVSPrincipal.class);
    for (GVSPrincipal principal : gvsPrincipals) {
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.