Package com.hp.hpl.jena.reasoner

Examples of com.hp.hpl.jena.reasoner.Reasoner.bind()


     *
     * @param model the Model containing both instance data and schema assertions to be inferenced over
     */
    public static InfModel createRDFSModel(Model model) {
         Reasoner reasoner = ReasonerRegistry.getRDFSReasoner();
         InfGraph graph = reasoner.bind( model.getGraph() );
         return new InfModelImpl( graph );
    }

    /**
     * Return a Model through which all the RDFS entailments
View Full Code Here


        u.addGraph( base );
        u.setBaseGraph( base );

        Reasoner r = spec.getReasoner();
        // if we have a reasoner in the spec, bind to the union graph and return
        return r == null ? (Graph) u : r.bind( u );
    }


    /**
     * <p>Answer the union graph that contains the imports closure for this ontology</p>
View Full Code Here

            configuration.addProperty(ReasonerVocabulary.PROPtraceOn, "true")
                         .addProperty(ReasonerVocabulary.PROPderivationLogging, "true");
        }
        Reasoner reasoner = reasonerF.create(configuration);
        long t1 = System.currentTimeMillis();
        InfGraph graph = reasoner.bind(premises.getGraph());
        Model result = ModelFactory.createModelForGraph(graph);
       
        if (stats && graph instanceof FBRuleInfGraph) {
//            ((FBRuleInfGraph)graph).resetLPProfile(true);
        }
View Full Code Here

            conclusions = loadFile(conclusionsRes.toString());
        }
       
        // Construct the inferred graph
        Reasoner reasoner = reasonerF.create(configuration);
        InfGraph graph = reasoner.bind(premises.getGraph());
        Model result = ModelFactory.createModelForGraph(graph);
       
        // Check the results against the official conclusions
        boolean correct = true;
        int goodResult = PASS;
View Full Code Here

  public void testCreateInfModel()
  {
    final String rule = "-> (eg:r eg:p eg:v).";
    final Reasoner r = new GenericRuleReasoner(Rule.parseRules(rule));
    final InfGraph ig = r
        .bind(ModelFactory.createDefaultModel().getGraph());
    final InfModel im = ModelFactory.createInfModel(ig);
    JenaTestBase.assertInstanceOf(InfModel.class, im);
    Assert.assertEquals(1, im.size());
  }
View Full Code Here

        u.addGraph( base );
        u.setBaseGraph( base );

        Reasoner r = spec.getReasoner();
        // if we have a reasoner in the spec, bind to the union graph and return
        return r == null ? (Graph) u : r.bind( u );
    }


    /**
     * <p>Answer the union graph that contains the imports closure for this ontology</p>
View Full Code Here

                new Triple(c, p, c)});
               
        // Case of data and rule axioms but no schema
        List<Rule> rules = Rule.parseRules("-> (d p d).");
        reasoner =  createReasoner(rules);
        infgraph = reasoner.bind(data);
        TestUtil.assertIteratorValues(this,
            infgraph.find(null, null, null),
            new Object[] {
                new Triple(p, sP, q),
                new Triple(q, sP, r),
View Full Code Here

        Graph data = Factory.createGraphMem();
        data.add(new Triple(a, p, b));
        data.add(new Triple(b, p, c));
        data.add(new Triple(b, p, d));
        Reasoner reasoner =  createReasoner(rules);
        InfGraph infgraph = reasoner.bind(data);
        TestUtil.assertIteratorValues(this,
            infgraph.find(null, r, null),
            new Object[] {
                new Triple(a, r, c),
                new Triple(a, r, d)
View Full Code Here

        data.add(new Triple(a, p, b));
        data.add(new Triple(b, q, c));
        data.add(new Triple(a, s, b));
        data.add(new Triple(b, s, d));
        Reasoner reasoner =  createReasoner(rules);
        InfGraph infgraph = reasoner.bind(data);
        TestUtil.assertIteratorValues(this,
            infgraph.find(null, r, null),
            new Object[] {
                new Triple(a, r, b),
                new Triple(b, r, c),
View Full Code Here

        data.add(new Triple(a, p, b));
        data.add(new Triple(b, q, c));
        data.add(new Triple(a, s, b));
        data.add(new Triple(b, s, d));
        Reasoner reasoner =  createReasoner(rules);
        InfGraph infgraph = reasoner.bind(data);
        TestUtil.assertIteratorValues(this,
            infgraph.find(null, r, null),
            new Object[] {
                new Triple(a, r, b),
                new Triple(b, r, c),
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.