Tabnine Logo
ReasonerRegistry.getOWLReasoner
Code IndexAdd Tabnine to your IDE (free)

How to use
getOWLReasoner
method
in
org.apache.jena.reasoner.ReasonerRegistry

Best Java code snippets using org.apache.jena.reasoner.ReasonerRegistry.getOWLReasoner (Showing top 20 results out of 315)

origin: apache/jena

public WebOntTestHarness() {
  testDefinitions = loadAllTestDefinitions();
  reasoner = ReasonerRegistry.getOWLReasoner();
  initResults();
}
origin: org.apache.jena/jena-core

public WebOntTestHarness() {
  testDefinitions = loadAllTestDefinitions();
  reasoner = ReasonerRegistry.getOWLReasoner();
  initResults();
}
origin: apache/jena

/**
 * Bug that exposed prototypes of owl:Thing despite hiding being switched on.
 */
public void testHideOnOWLThing() {
  Reasoner r = ReasonerRegistry.getOWLReasoner();
  Model data = ModelFactory.createDefaultModel();
  InfModel inf = ModelFactory.createInfModel(r, data);
  StmtIterator things = inf.listStatements(null, RDF.type, OWL.Thing);
  TestUtil.assertIteratorLength(things, 0);
}
origin: apache/jena

/**
 * Create, or retrieve from cache, an OWL reasoner already bound
 * to the test tbox.
 */
public Reasoner makeReasoner() {
  if (reasonerCache == null) {
    Model tbox = FileManager.get().loadModel(testTbox);
    reasonerCache = ReasonerRegistry.getOWLReasoner().bindSchema(tbox.getGraph());
  }
  return reasonerCache;
}

origin: org.apache.jena/jena-core

/**
 * Bug that exposed prototypes of owl:Thing despite hiding being switched on.
 */
public void testHideOnOWLThing() {
  Reasoner r = ReasonerRegistry.getOWLReasoner();
  Model data = ModelFactory.createDefaultModel();
  InfModel inf = ModelFactory.createInfModel(r, data);
  StmtIterator things = inf.listStatements(null, RDF.type, OWL.Thing);
  TestUtil.assertIteratorLength(things, 0);
}
origin: org.apache.jena/jena-core

/**
 * Create, or retrieve from cache, an OWL reasoner already bound
 * to the test tbox.
 */
public Reasoner makeReasoner() {
  if (reasonerCache == null) {
    Model tbox = FileManager.get().loadModel(testTbox);
    reasonerCache = ReasonerRegistry.getOWLReasoner().bindSchema(tbox.getGraph());
  }
  return reasonerCache;
}

origin: apache/jena

  /**
   * 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());
  }

origin: org.apache.jena/jena-core

  /**
   * 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());
  }

origin: apache/jena

/**
 * Layering one reasoner on another leads to exposed functors which
 * used to trip up validation
 */
public void testLayeredValidation() {
  Model ont = FileManager.get().loadModel("testing/reasoners/bugs/layeredValidation.owl");
  InfModel infModel =
    ModelFactory.createInfModel(ReasonerRegistry.getOWLReasoner(), ont);
  OntModel model = ModelFactory.createOntologyModel(OntModelSpec.OWL_MEM_RULE_INF,
    infModel);
  ValidityReport validity = model.validate();
  assertTrue(validity.isClean());
}
origin: apache/jena

/**
 * Test  problems with inferring equivalence of some simple class definitions,
 * reported by Jeffrey Hau.
 */
public void testEquivalentClass1() {
  Model base = ModelFactory.createDefaultModel();
  base.read("file:testing/reasoners/bugs/equivalentClassTest.owl");
  InfModel test = ModelFactory.createInfModel(ReasonerRegistry.getOWLReasoner(), base);
  String NAMESPACE = "urn:foo#";
  Resource A = test.getResource(NAMESPACE + "A");
  Resource B = test.getResource(NAMESPACE + "B");
  assertTrue("hasValue equiv deduction", test.contains(A, OWL.equivalentClass, B));
}
origin: apache/jena

/**
 * Report of problems with cardinality v. maxCardinality usage in classification,
 * from Hugh Winkler.
 */
public void testCardinality1() {
  Model base = ModelFactory.createDefaultModel();
  base.read("file:testing/reasoners/bugs/cardFPTest.owl");
  InfModel test = ModelFactory.createInfModel(ReasonerRegistry.getOWLReasoner(), base);
  String NAMESPACE = "urn:foo#";
  Resource aDocument = test.getResource(NAMESPACE + "aDocument");
  Resource documentType = test.getResource(NAMESPACE + "Document");
  assertTrue("Cardinality-based classification", test.contains(aDocument, RDF.type, documentType));
}
origin: org.apache.jena/jena-core

/**
 * Layering one reasoner on another leads to exposed functors which
 * used to trip up validation
 */
public void testLayeredValidation() {
  Model ont = FileManager.get().loadModel("testing/reasoners/bugs/layeredValidation.owl");
  InfModel infModel =
    ModelFactory.createInfModel(ReasonerRegistry.getOWLReasoner(), ont);
  OntModel model = ModelFactory.createOntologyModel(OntModelSpec.OWL_MEM_RULE_INF,
    infModel);
  ValidityReport validity = model.validate();
  assertTrue(validity.isClean());
}
origin: org.apache.jena/jena-core

/**
 * Test  problems with inferring equivalence of some simple class definitions,
 * reported by Jeffrey Hau.
 */
public void testEquivalentClass1() {
  Model base = ModelFactory.createDefaultModel();
  base.read("file:testing/reasoners/bugs/equivalentClassTest.owl");
  InfModel test = ModelFactory.createInfModel(ReasonerRegistry.getOWLReasoner(), base);
  String NAMESPACE = "urn:foo#";
  Resource A = test.getResource(NAMESPACE + "A");
  Resource B = test.getResource(NAMESPACE + "B");
  assertTrue("hasValue equiv deduction", test.contains(A, OWL.equivalentClass, B));
}
origin: org.apache.jena/jena-core

/**
 * Report of problems with cardinality v. maxCardinality usage in classification,
 * from Hugh Winkler.
 */
public void testCardinality1() {
  Model base = ModelFactory.createDefaultModel();
  base.read("file:testing/reasoners/bugs/cardFPTest.owl");
  InfModel test = ModelFactory.createInfModel(ReasonerRegistry.getOWLReasoner(), base);
  String NAMESPACE = "urn:foo#";
  Resource aDocument = test.getResource(NAMESPACE + "aDocument");
  Resource documentType = test.getResource(NAMESPACE + "Document");
  assertTrue("Cardinality-based classification", test.contains(aDocument, RDF.type, documentType));
}
origin: apache/jena

  /**
   * 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);
    assertTrue(! omodel.contains(s));
  }

origin: org.apache.jena/jena-core

  /**
   * 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);
    assertTrue(! omodel.contains(s));
  }

origin: org.apache.jena/jena-core

  /**
   * Report of functor literals leaking out of inference graphs and raising CCE
   * in iterators.
   */
  public void testFunctorCCE() {
    Model base = ModelFactory.createDefaultModel();
    base.read("file:testing/reasoners/bugs/cceTest.owl");
    InfModel test = ModelFactory.createInfModel(ReasonerRegistry.getOWLReasoner(), base);

//        boolean b =
      anyInstancesOfNothing(test);
    ResIterator rIter = test.listSubjects();
    while (rIter.hasNext()) {
//            Resource res =
        rIter.nextResource();
    }
  }

origin: apache/jena

  /**
   * Report of functor literals leaking out of inference graphs and raising CCE
   * in iterators.
   */
  public void testFunctorCCE() {
    Model base = ModelFactory.createDefaultModel();
    base.read("file:testing/reasoners/bugs/cceTest.owl");
    InfModel test = ModelFactory.createInfModel(ReasonerRegistry.getOWLReasoner(), base);

//        boolean b =
      anyInstancesOfNothing(test);
    ResIterator rIter = test.listSubjects();
    while (rIter.hasNext()) {
//            Resource res =
        rIter.nextResource();
    }
  }

origin: apache/jena

/**
 * Report of NPE during processing on an ontology with a faulty intersection list,
 * from Hugh Winkler.
 */
public void testIntersectionNPE() {
  Model base = ModelFactory.createDefaultModel();
  base.read("file:testing/reasoners/bugs/bad-intersection.owl");
  boolean foundBadList = false;
  try {
    InfGraph infgraph = ReasonerRegistry.getOWLReasoner().bind(base.getGraph());
    ExtendedIterator<Triple> ci = infgraph.find(null, RDF.Nodes.type, OWL.Class.asNode());
    ci.close();
  } catch (ReasonerException e) {
    foundBadList = true;
  }
  assertTrue("Correctly detected the illegal list", foundBadList);
}
origin: org.apache.jena/jena-core

/**
 * Report of NPE during processing on an ontology with a faulty intersection list,
 * from Hugh Winkler.
 */
public void testIntersectionNPE() {
  Model base = ModelFactory.createDefaultModel();
  base.read("file:testing/reasoners/bugs/bad-intersection.owl");
  boolean foundBadList = false;
  try {
    InfGraph infgraph = ReasonerRegistry.getOWLReasoner().bind(base.getGraph());
    ExtendedIterator<Triple> ci = infgraph.find(null, RDF.Nodes.type, OWL.Class.asNode());
    ci.close();
  } catch (ReasonerException e) {
    foundBadList = true;
  }
  assertTrue("Correctly detected the illegal list", foundBadList);
}
org.apache.jena.reasonerReasonerRegistrygetOWLReasoner

Javadoc

Prebuilt standard configuration for the default OWL reasoner. This configuration is hybrid forward/backward reasoner.

Popular methods of ReasonerRegistry

  • getOWLMicroReasoner
    Prebuilt standard configuration a micro-OWL reasoner. This just supports property axioms, and class
  • getRDFSReasoner
    Return a prebuilt standard configuration for the default RDFS reasoner
  • makeDirect
    Return a property Node which represents the direct version of a transitively closed property. See ma
  • <init>
    Constructor is hidden - go via theRegistry
  • getFactory
    Return the factory for the given reasoner.
  • getTransitiveReasoner
    Return a prebuilt standard configuration for the default subclass/subproperty transitive closure rea
  • register
    Register a Reasoner.
  • theRegistry
    Return the single global instance of the registry

Popular in Java

  • Reading from database using SQL prepared statement
  • getContentResolver (Context)
  • setScale (BigDecimal)
  • getSystemService (Context)
  • Rectangle (java.awt)
    A Rectangle specifies an area in a coordinate space that is enclosed by the Rectangle object's top-
  • FileNotFoundException (java.io)
    Thrown when a file specified by a program cannot be found.
  • SocketTimeoutException (java.net)
    This exception is thrown when a timeout expired on a socket read or accept operation.
  • Random (java.util)
    This class provides methods that return pseudo-random values.It is dangerous to seed Random with the
  • HttpServlet (javax.servlet.http)
    Provides an abstract class to be subclassed to create an HTTP servlet suitable for a Web site. A sub
  • DateTimeFormat (org.joda.time.format)
    Factory that creates instances of DateTimeFormatter from patterns and styles. Datetime formatting i
  • CodeWhisperer alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now