Package com.hp.hpl.jena.reasoner

Examples of com.hp.hpl.jena.reasoner.Reasoner


                {ReasonerRegistry.getRDFSSimpleReasoner(), Boolean.TRUE},
        };
        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 = m.createResource();
            }
            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

    public ValidityReport testResults() {
        Model t = FileManager.get().loadModel(BASE_DIR + tbox);
        Model a = FileManager.get().loadModel(BASE_DIR + abox);
        // Work around non-deterministic bug in bindSchema
        //        Reasoner r = rf.create(null).bindSchema(t);
        Reasoner r = rf.create(null);
        a.add(t);
        InfModel im = ModelFactory.createInfModel(r, a);
        return im.validate();
    }
View Full Code Here

     * Test bug with leaking variables which results in an incorrect "range = Nothing" deduction.
     */
    public void testRangeBug() {
        Model model = FileManager.get().loadModel("file:testing/reasoners/bugs/rangeBug.owl");
//        Model m = ModelFactory.createDefaultModel();
        Reasoner r = ReasonerRegistry.getOWLReasoner();
        InfModel omodel = ModelFactory.createInfModel(r, model);
        String baseuri = "http://decsai.ugr.es/~ontoserver/bacarex2.owl#";
//        Resource js = omodel.getResource(baseuri + "JS");
        Resource surname = omodel.getResource(baseuri + "surname");
        Statement s = omodel.createStatement(surname, RDFS.range, OWL.Nothing);
View Full Code Here

     * Test change of RDF specs to allow plain literals w/o lang and XSD string to be the same.
     */
    public void testLiteralBug() {
        Model model = FileManager.get().loadModel("file:testing/reasoners/bugs/dtValidation.owl");
//        Model m = ModelFactory.createDefaultModel();
        Reasoner r = ReasonerRegistry.getOWLReasoner();
        InfModel infmodel = ModelFactory.createInfModel(r, model);
        ValidityReport validity = infmodel.validate();
        assertTrue (validity.isValid());
    }
View Full Code Here

        tBox.read(new ByteArrayInputStream(sourceT.getBytes()), "http://example.org/foo");

        Model aBox = ModelFactory.createDefaultModel();
        aBox.read(new ByteArrayInputStream(sourceA.getBytes()), "http://example.org/foo");

        Reasoner reasoner = ReasonerRegistry.getOWLReasoner();
        reasoner = reasoner.bindSchema(tBox);

        OntModelSpec spec = new OntModelSpec(OntModelSpec.OWL_MEM_RULE_INF);
        spec.setReasoner(reasoner);

        OntModel m = ModelFactory.createOntologyModel(spec, aBox);
View Full Code Here

        if (!conclusionsType.equals(FalseDocument)) {
            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

  @Test
  public void testDeclaredProperties() {
    String ns = "urn:test:";

    Reasoner r = PelletReasonerFactory.theInstance().create();
    // ReasonerRegistry.getOWLMicroReasoner();

    OntModelSpec spec = new OntModelSpec( OntModelSpec.OWL_DL_MEM );
    spec.setReasoner( r );
    OntModel model = ModelFactory.createOntologyModel( spec, null );
View Full Code Here

 
  protected MultiValueMap<ATermAppl, ATermAppl> run(Collection<ATermAppl> classes) {
    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

            // Inferencing over the configuration data let us detect some rdf:type
            // properties out of rdfs:domain and rdfs:range properties
            // A simple rdfs reasoner is enough for this task.
            Model schema = ModelFactory.createDefaultModel();
            schema.read(schemaURL);
            Reasoner reasoner = ReasonerRegistry.getRDFSSimpleReasoner().bindSchema(schema);
            InfModel inf = ModelFactory.createInfModel(reasoner, config);

            // If we do inferencing, we can easily check for consistency.
            ValidityReport reports = inf.validate();
            if (!reports.isValid())
View Full Code Here

TOP

Related Classes of com.hp.hpl.jena.reasoner.Reasoner

Copyright © 2018 www.massapicom. 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.