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

Examples of com.hp.hpl.jena.rdf.model.InfModel.listStatements()


     

    String rules = SYM_RULE;
    Reasoner ruleReasoner = new GenericRuleReasoner(Rule.parseRules(rules));
    InfModel inf = ModelFactory.createInfModel(ruleReasoner, model);
    for ( Statement stmt : inf.listStatements().toList() ) {
      log.debug("^^ " +stmt);
    }
  }

  private static void _characterizeSkosRelations(Model model) {
View Full Code Here


    }
    log.debug("\n" +"RULES:\n" +rules);
    InfModel inf = ModelFactory.createInfModel(ruleReasoner, model);
    log.debug("\n" +JenaUtil2.getOntModelAsString(inf, "N3"));
    int noTotal = 0;
    for ( Statement stmt : inf.listStatements().toList() ) {
      log.debug("^^ " +stmt);
      noTotal++;
    }
    log.debug("Total: " +noTotal);
View Full Code Here

        if(filtered){
            Set<Statement> original = new HashSet<Statement>();
            original.addAll(data.listStatements().toSet());
            log.debug(" original statements are: {}",original.size());
            InfModel i = run(data);
            Set<Statement> inferred = i.listStatements().toSet();
            log.debug(" inferred statements are: {}",inferred.size());
            return prune(original, inferred);
        }else{
            return run(data).listStatements().toSet();
        }
View Full Code Here

        if(filtered){
            Set<Statement> original = new HashSet<Statement>();
            original.addAll(data.listStatements().toSet());
            log.debug(" original statements are: {}",original.size());
            InfModel i = run(data, rules);
            Set<Statement> inferred = i.listStatements().toSet();
            log.debug(" inferred statements are: {}",inferred.size());
            return prune(original, inferred);
        }else{
            return run(data, rules).listStatements().toSet();
        }
View Full Code Here

        r.addProperty(p, l);
       
        List<Rule> rules = Rule.parseRules("(?r eg:p ?v) -> (?v eg:q ?r).");
        GenericRuleReasoner reasoner = new GenericRuleReasoner(rules);
        InfModel inf = ModelFactory.createInfModel(reasoner, base);
        TestUtil.assertIteratorValues(this, inf.listStatements(), new Statement[]{asserted});
       
        Model deductions = inf.getDeductionsModel();
        TestUtil.assertIteratorValues(this, deductions.listStatements(), new Statement[]{});
       
        Graph safeGraph = deductions.getGraph();
View Full Code Here

        System.out.println("But does that have an R property?");
        Statement s3 = ((Resource)s.getObject()).getProperty(R);
        System.out.println(" - " + s3);
        System.out.println("List all instances of C");
        int count = 0;
        for (Iterator<Statement> i = infmodel.listStatements(null, RDF.type, C); i.hasNext(); ) {
            Statement st = i.next();
            System.out.println(" - " + st);
            count++;
        }
        System.out.println("OK");
View Full Code Here

        r.addProperty(p, l);
       
        List<Rule> rules = Rule.parseRules("(?r eg:p ?v) -> (?v eg:q ?r).");
        GenericRuleReasoner reasoner = new GenericRuleReasoner(rules);
        InfModel inf = ModelFactory.createInfModel(reasoner, base);
        TestUtil.assertIteratorValues(this, inf.listStatements(), new Statement[]{asserted});
       
        Model deductions = inf.getDeductionsModel();
        TestUtil.assertIteratorValues(this, deductions.listStatements(), new Statement[]{});
       
        Graph safeGraph = deductions.getGraph();
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.