Package com.hp.hpl.jena.reasoner

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


        Node r = NodeFactory.createURI("http://www.hpl.hp.com/semweb/2003/eg#r");
        Node C1 = NodeFactory.createURI("http://www.hpl.hp.com/semweb/2003/eg#C1");
        data.add(new Triple(a, p, b));
        List<Rule> rules = Rule.parseRules(Util.loadRuleParserFromResourceFile("testing/reasoners/bugs/rdfs-error1.brules"));
        Reasoner reasoner =  createReasoner(rules);
        InfGraph infgraph = reasoner.bind(data);
        TestUtil.assertIteratorValues(this,
            infgraph.find(b, ty, C1),
            new Object[] {
                new Triple(b, ty, C1)
            } );
View Full Code Here


     *
     * @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

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

        Model data = ModelFactory.createDefaultModel();
        for (int i = 0; i < testSpec.length; i++) {
            Object[] test = testSpec[i];
            Reasoner r = (Reasoner)test[0];
            Boolean safe = (Boolean)test[1];
            InfGraph ig = r.bind(data.getGraph());
            assertEquals(r.toString(), safe.booleanValue(), ig.getCapabilities().findContractSafe());
        }
    }
}
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

        Model data = ModelFactory.createDefaultModel();
        for (int i = 0; i < testSpec.length; i++) {
            Object[] test = testSpec[i];
            Reasoner r = (Reasoner)test[0];
            Boolean safe = (Boolean)test[1];
            InfGraph ig = r.bind(data.getGraph());
            assertEquals(r.toString(), safe.booleanValue(), ig.getCapabilities().findContractSafe());
        }
    }
}
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

    addClasses( classes );
    addClasses( m_Names.getAllAnons() );
   
    Reasoner reasoner = new GenericRuleReasoner(new ArrayList<Rule>(m_Rules));
   
    InfGraph inf = reasoner.bind( m_Facts );
    inf.prepare();
   
    MultiValueMap<ATermAppl, ATermAppl> subsumers = getSubsumptions(inf);
    for( ATermAppl c : classes ) {
      subsumers.add( ATermUtils.BOTTOM, 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.