public PelletReasoner() { this(null, PelletReasonerFactory.theInstance().getCapabilities()); }
public static void usageWithDefaultModel() { System.out.println("Results with plain RDF Model"); System.out.println("----------------------------"); System.out.println(); // ontology that will be used final String ont = "http://protege.cim3.net/file/pub/ontologies/koala/koala.owl#"; final String ns = "http://protege.stanford.edu/plugins/owl/owl-library/koala.owl#"; // create Pellet reasoner final Reasoner reasoner = PelletReasonerFactory.theInstance().create(); // create an empty model final Model emptyModel = ModelFactory.createDefaultModel(); // create an inferencing model using Pellet reasoner final InfModel model = ModelFactory.createInfModel(reasoner, emptyModel); // read the file model.read(ont); // print validation report final ValidityReport report = model.validate(); printIterator(report.getReports(), "Validation Results"); // print superclasses final Resource c = model.getResource(ns + "MaleStudentWith3Daughters"); printIterator(model.listObjectsOfProperty(c, RDFS.subClassOf), "All super classes of " + c.getLocalName()); System.out.println(); }
public PelletReasoner create() { return new PelletReasoner(getCapabilities()); }
public static void usageWithDefaultModel() { System.out.println("Results with plain RDF Model"); System.out.println("----------------------------"); System.out.println(); // ontology that will be used final String ont = "http://protege.cim3.net/file/pub/ontologies/koala/koala.owl#"; final String ns = "http://protege.stanford.edu/plugins/owl/owl-library/koala.owl#"; // create Pellet reasoner final Reasoner reasoner = PelletReasonerFactory.theInstance().create(); // create an empty model final Model emptyModel = ModelFactory.createDefaultModel(); // create an inferencing model using Pellet reasoner final InfModel model = ModelFactory.createInfModel(reasoner, emptyModel); // read the file model.read(ont); // print validation report final ValidityReport report = model.validate(); printIterator(report.getReports(), "Validation Results"); // print superclasses final Resource c = model.getResource(ns + "MaleStudentWith3Daughters"); printIterator(model.listObjectsOfProperty(c, RDFS.subClassOf), "All super classes of " + c.getLocalName()); System.out.println(); }
public PelletReasoner create() { return new PelletReasoner(getCapabilities()); }
final Reasoner reasoner = PelletReasonerFactory.theInstance().create(); final Model emptyModel = ModelFactory.createDefaultModel(); final InfModel model = ModelFactory.createInfModel(reasoner, emptyModel);
public PelletReasoner(final Graph schema) { this(schema, PelletReasonerFactory.theInstance().getCapabilities()); }
public PelletReasoner create() { return new PelletReasoner(getCapabilities()); }
final Reasoner reasoner = PelletReasonerFactory.theInstance().create(); final Model emptyModel = ModelFactory.createDefaultModel(); final InfModel model = ModelFactory.createInfModel(reasoner, emptyModel);
public PelletReasoner(final Graph schema) { this(schema, PelletReasonerFactory.theInstance().getCapabilities()); }
@Override public PelletReasoner create(final Resource configuration) { return new PelletReasoner(null != configuration ? configuration.getModel() : getCapabilities()); }
@Test public void test248() { // Test case for #248 final String aOnt = "file:" + PelletTestSuite.base + "misc/pizza.owl"; final PelletReasoner aReasoner = PelletReasonerFactory.theInstance().create(); final InfModel aModel = ModelFactory.createInfModel(aReasoner, ModelFactory.createDefaultModel()); aModel.read(aOnt); final String aQuery = "PREFIX xsd:<http://www.w3.org/2001/XMLSchema#>\n" + "PREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#>\n" + "PREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#>\n" + "PREFIX owl:<http://www.w3.org/2002/07/owl#>\n" + "PREFIX pizza: <http://www.co-ode.org/ontologies/pizza/pizza.owl#>\n" + "SELECT ?v0 WHERE\n" + "{\n" + " ?v0 rdf:type ?v1.\n" + " ?v1 rdf:type owl:Restriction.\n" + " ?v1 owl:onProperty pizza:hasTopping.\n" + " ?v1 owl:allValuesFrom ?v2.\n" + "}"; // this should not thrown an InternalReasonerException, we want the unsupported query to be detected, and // the execution to fallback to using the mixed evaluator final QueryExecution qe = SparqlDLExecutionFactory.create(QueryFactory.create(aQuery), aModel); qe.execSelect(); }
public PelletReasoner() { this(null, PelletReasonerFactory.theInstance().getCapabilities()); }
@Override public PelletReasoner create(final Resource configuration) { return new PelletReasoner(null != configuration ? configuration.getModel() : getCapabilities()); }
@Test public void test196() { // Test case for #196 final String aOnt = "file:" + PelletTestSuite.base + "misc/pizza.owl"; final PelletReasoner aReasoner = PelletReasonerFactory.theInstance().create(); final InfModel aModel = ModelFactory.createInfModel(aReasoner, ModelFactory.createDefaultModel()); aModel.read(aOnt); final String aQuery = "PREFIX xsd:<http://www.w3.org/2001/XMLSchema#>\n" + "PREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#>\n" + "PREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#>\n" + "PREFIX owl:<http://www.w3.org/2002/07/owl#>\n" + "PREFIX pizza: <http://www.co-ode.org/ontologies/pizza/pizza.owl#>\n" + "SELECT ?v0 WHERE\n" + "{\n" + " ?v0 ?v1 owl:ObjectProperty.\n" + "}"; // this should not thrown an InternalReasonerException, we want the unsupported query to be detected, and // the execution to fallback to using the mixed evaluator final QueryExecution qe = SparqlDLExecutionFactory.create(QueryFactory.create(aQuery), aModel); qe.execSelect(); }
public PelletReasoner() { this(null, PelletReasonerFactory.theInstance().getCapabilities()); }
@Override public PelletReasoner create(final Resource configuration) { return new PelletReasoner(null != configuration ? configuration.getModel() : getCapabilities()); }
@Override public void setupGenerators(final Stream<OWLAxiom> ontologyAxioms) throws Exception { final OWLOntology ontology = openllet.owlapi.OWL.Ontology(ontologyAxioms); final Graph data = convertOntology(ontology, false); final Reasoner reasoner = PelletReasonerFactory.theInstance().create(); _openllet = (PelletInfGraph) reasoner.bind(data); final KnowledgeBase kb = _openllet.getKB(); if (_classify) { kb.setDoExplanation(true); _openllet.prepare(); kb.setDoExplanation(false); kb.realize(); } }
public PelletReasoner(final Graph schema) { this(schema, PelletReasonerFactory.theInstance().getCapabilities()); }
@Test public void test() { // test case for the bug reported in #247 final boolean uas = OpenlletOptions.USE_ANNOTATION_SUPPORT; OpenlletOptions.USE_ANNOTATION_SUPPORT = false; try { final String aOnt = "file:" + PelletTestSuite.base + "misc/ticket-247-test-case.rdf"; final PelletReasoner aReasoner = PelletReasonerFactory.theInstance().create(); final InfModel aModel = ModelFactory.createInfModel(aReasoner, ModelFactory.createDefaultModel()); aModel.read(aOnt); final String aQuery = "PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>\n" + "PREFIX owl: <http://www.w3.org/2002/07/owl#>\n" + "PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>\n" + "SELECT ?x WHERE { ?y rdfs:comment ?x . }"; final QueryExecution qe = SparqlDLExecutionFactory.create(QueryFactory.create(aQuery), aModel); // this should not produce an NPE qe.execSelect(); } finally { OpenlletOptions.USE_ANNOTATION_SUPPORT = uas; } }