Examples of nextStatement()


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

    // iterate over template statements to replace placeholders
    Model metadata = ModelFactory.createDefaultModel();
    currentDocRepr = metadata.createResource();
    StmtIterator it = tplModel.listStatements();
    while (it.hasNext()) {
      Statement stmt = it.nextStatement();
      Resource subj = stmt.getSubject();
      Property pred = stmt.getPredicate();
      RDFNode  obj  = stmt.getObject();
     
      try {
View Full Code Here

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

    while ( changes ) {
      changes = false;
      StmtIterator stmtIt = metadata.listStatements();
      List<Statement> remList = new ArrayList<Statement>();
      while (stmtIt.hasNext()) {
        Statement s = stmtIt.nextStatement();
        if (    s.getObject().isAnon()
             && ! ((Resource) s.getObject().as(Resource.class)).listProperties().hasNext() ) {
          remList.add(s);
          changes = true;
        }
View Full Code Here

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

      if (dataset.hasProperty(p))
        return dataset.getProperty(p).getObject();
     
      // find pointer to the global configuration set...
      StmtIterator it = dataset.getModel().listStatements(null, CONF.dataset, dataset);
      Statement ptrStmt = it.nextStatement();
      if (ptrStmt == null) return null;
     
      // look in global config if nothing found so far
      Resource globalConfig = ptrStmt.getSubject();
      if (globalConfig.hasProperty(p))
View Full Code Here

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

      if (dataset.hasProperty(p))
        return dataset.getProperty(p).getObject();
     
      // find pointer to the global configuration set...
      StmtIterator it = dataset.getModel().listStatements(null, CONF.dataset, dataset);
      Statement ptrStmt = it.nextStatement();
      if (ptrStmt == null) return null;
     
      // look in global config if nothing found so far
      Resource globalConfig = ptrStmt.getSubject();
      if (globalConfig.hasProperty(p))
View Full Code Here

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

  private List<ResourceProperty> buildProperties() {
    Map<String,PropertyBuilder> propertyBuilders =
        new HashMap<String,PropertyBuilder>();
    StmtIterator it = resource.listProperties();
    while (it.hasNext()) {
      Statement stmt = it.nextStatement();
      if (isEmptyLiteral(stmt.getObject())) continue;
      Property predicate = stmt.getPredicate();
      String key = "=>" + predicate;
      if (!propertyBuilders.containsKey(key)) {
        propertyBuilders.put(key, new PropertyBuilder(
View Full Code Here

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

      //       already been made earlier when the model was built.
      propertyBuilders.get(key).addValue(stmt.getObject());
    }
    it = model.listStatements(null, null, resource);
    while (it.hasNext()) {
      Statement stmt = it.nextStatement();
      Property predicate = stmt.getPredicate();
      String key = "<=" + predicate;
      if (!propertyBuilders.containsKey(key)) {
        propertyBuilders.put(key, new PropertyBuilder(
            predicate, true, config.getVocabularyStore()));
View Full Code Here

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

    Iterator<Property> it = properties.iterator();
    while (it.hasNext()) {
      com.hp.hpl.jena.rdf.model.Property property = (com.hp.hpl.jena.rdf.model.Property) it.next();
      StmtIterator labelIt = resource.listProperties(property);
      while (labelIt.hasNext()) {
        RDFNode label = labelIt.nextStatement().getObject();
        results.add(label);
      }
    }
    return results;
  }
View Full Code Here

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

    // new statements to be added:
    List<Statement> n_stmts = new ArrayList<Statement>();
   
    StmtIterator existingStmts = model.listStatements();
    while ( existingStmts.hasNext() ) {
      Statement o_stmt = existingStmts.nextStatement();
      Resource sbj = o_stmt.getSubject();
      Property prd = o_stmt.getPredicate();
      RDFNode obj = o_stmt.getObject();
     
      boolean any_change = false;
View Full Code Here

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

    if ( ontRes != null ) {
      prexistStatements = new ArrayList<Statement>();
//      log.info("Getting pre-existing properties for OWL.Ontology individual: " +ontRes.getURI());
      StmtIterator iter = ontRes.listProperties();
      while ( iter.hasNext() ) {
        Statement st = iter.nextStatement();
        prexistStatements.add(st);
     
    }

   
View Full Code Here

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

    List<Statement> n_stmts = new ArrayList<Statement>();
   
    // check all statements in the model:
    StmtIterator existingStmts = model.listStatements();
    while ( existingStmts.hasNext() ) {
      Statement o_stmt = existingStmts.nextStatement();
      Resource sbj = o_stmt.getSubject();
      Property prd = o_stmt.getPredicate();
      RDFNode obj = o_stmt.getObject();
     
      // will indicate that o_stmt is affected by the namespace change:
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.