Examples of nextStatement()


Examples of com.hp.hpl.jena.rdf.model.StmtIterator.nextStatement()

        Model model = SDBFactory.connectDefaultModel(store) ;
       
        StmtIterator sIter = model.listStatements() ;
        for ( ; sIter.hasNext() ; )
        {
            Statement stmt = sIter.nextStatement() ;
            System.out.println(stmt) ;
        }
        sIter.close() ;
        store.close() ;
    }
View Full Code Here

Examples of com.hp.hpl.jena.rdf.model.StmtIterator.nextStatement()

    Gloze.logger.warn("drop: no schema mapping for resource: "+resource);
    StmtIterator si = resource.listProperties();
    if (!si.hasNext())
      Gloze.logger.warn("because no properties, is gloze.uri correctly defined?");
    else while (si.hasNext()) {
      Property p = si.nextStatement().getPredicate();
      // skip eg. RDF:type
      if (p.getNameSpace().equals(RDF.getURI())) continue;
      Gloze.logger.warn("because no matching property: "+p.getURI());
    }
    // try no-schema mapping
View Full Code Here

Examples of com.hp.hpl.jena.rdf.model.StmtIterator.nextStatement()

  }

  public boolean toXML(Document doc, Resource rez) throws Exception {
    StmtIterator i = rez.listProperties();
    while (i.hasNext()) {
      Statement s = i.nextStatement();
      Property p = s.getPredicate();
      element e = getElement(p.getURI());
      if (e!=null && e.toXML(doc, s.getObject(),this)) return true;   
    }
    return false;
View Full Code Here

Examples of com.hp.hpl.jena.rdf.model.StmtIterator.nextStatement()

 
  protected static Set<Statement> unsequenced(Resource rdf) {
    Set<Statement> s = new HashSet<Statement>();
    StmtIterator si = rdf.listProperties();
    while (si.hasNext()) {
      Statement stmt = si.nextStatement();
      // don't add ordinals
      if (stmt.getPredicate().getOrdinal()==0) s.add(stmt);
    }
    NodeIterator ni = rdf.getModel().getSeq(rdf).iterator();
    while (ni.hasNext()) {
View Full Code Here

Examples of com.hp.hpl.jena.rdf.model.StmtIterator.nextStatement()

    // TODO: This should re-use the logic from ResourceDescription and ResourceProperty to decide where to create these links
    // Add links to RDF documents with descriptions of the blank nodes
    Resource r = model.getResource(controller.getAbsoluteIRI());
    StmtIterator it = r.listProperties();
    while (it.hasNext()) {
      Statement stmt = it.nextStatement();
      if (!stmt.getObject().isAnon()) continue;
      String pathDataURL = controller.getValuesDataURL(stmt.getPredicate());
      if (pathDataURL == null) continue;
      ((Resource) stmt.getResource()).addProperty(RDFS.seeAlso,
          model.createResource(pathDataURL));
View Full Code Here

Examples of com.hp.hpl.jena.rdf.model.StmtIterator.nextStatement()

      ((Resource) stmt.getResource()).addProperty(RDFS.seeAlso,
          model.createResource(pathDataURL));
    }
    it = model.listStatements(null, null, r);
    while (it.hasNext()) {
      Statement stmt = it.nextStatement();
      if (!stmt.getSubject().isAnon()) continue;
      String pathDataURL = controller.getInverseValuesDataURL(stmt.getPredicate());
      if (pathDataURL == null) continue;
      ((Resource) stmt.getSubject().as(Resource.class)).addProperty(RDFS.seeAlso,
          model.createResource(pathDataURL));
View Full Code Here

Examples of com.hp.hpl.jena.rdf.model.StmtIterator.nextStatement()

      String uri = original.getNsPrefixURI(prefix);
      result.setNsPrefix(prefix, rewrite(uri));
    }
    StmtIterator it = original.listStatements();
    while (it.hasNext()) {
      Statement stmt = it.nextStatement();
      Resource s = stmt.getSubject();
      if (s.isURIResource()) {
        s = result.createResource(rewrite(s.getURI()));
      }
      Property p = result.createProperty(
View Full Code Here

Examples of com.hp.hpl.jena.rdf.model.StmtIterator.nextStatement()

    StmtIterator it = model.listStatements(null, RDF.type, CONF.Configuration);
    if (!it.hasNext()) {
      throw new IllegalArgumentException(
          "No resource with type conf:Configuration found in configuration file");
    }
    return new Configuration(it.nextStatement().getSubject());
  }
 
  private final PrefixMapping prefixes;
  private final String webBase;
  private final Collection<Property> labelProperties;
View Full Code Here

Examples of com.hp.hpl.jena.rdf.model.StmtIterator.nextStatement()

 
  public void addCustomMetadata(Model document, Resource documentResource) {
    if (customTemplate == null) return;
    StmtIterator it = customTemplate.listProperties();
    while (it.hasNext()) {
      Statement stmt = it.nextStatement();
      document.add(documentResource, stmt.getPredicate(), stmt.getObject());
    }
    it = customTemplate.getModel().listStatements(null, null, customTemplate);
    while (it.hasNext()) {
      Statement stmt = it.nextStatement();
View Full Code Here

Examples of com.hp.hpl.jena.rdf.model.StmtIterator.nextStatement()

      Statement stmt = it.nextStatement();
      document.add(documentResource, stmt.getPredicate(), stmt.getObject());
    }
    it = customTemplate.getModel().listStatements(null, null, customTemplate);
    while (it.hasNext()) {
      Statement stmt = it.nextStatement();
      if (stmt.getPredicate().equals(CONF.rdfDocumentMetadata)) {
        continue;
      }
      document.add(stmt.getSubject(), stmt.getPredicate(), documentResource);
    }
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.