Tabnine Logo
ReasonerFactory.create
Code IndexAdd Tabnine to your IDE (free)

How to use
create
method
in
org.apache.jena.reasoner.ReasonerFactory

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

origin: org.apache.jena/jena-core

/**
 * Return a prebuilt standard configuration for the default RDFS reasoner
 */
 public static Reasoner getRDFSReasoner() {
   if (theRDFSReasoner == null) theRDFSReasoner = RDFSRuleReasonerFactory.theInstance().create(null);
   return theRDFSReasoner;
 }
origin: apache/jena

/**
 * Prebuilt mini configuration for the default OWL reasoner. This omits bNode
 * introduction rules which has significant performance gain in some cases and
 * avoids breaking the find contract.
 */
public static Reasoner getOWLMiniReasoner() {
  if (theOWLMiniReasoner == null) theOWLMiniReasoner = OWLMiniReasonerFactory.theInstance().create(null);
  return theOWLMiniReasoner;
}
origin: apache/jena

/**
 * Prebuilt standard configuration for the default OWL reasoner. This configuration is
 * hybrid forward/backward reasoner.
 */
public static Reasoner getOWLReasoner() {
  if (theOWLReasoner == null) theOWLReasoner = OWLFBRuleReasonerFactory.theInstance().create(null);
  return theOWLReasoner;
}
origin: apache/jena

@Override
public Reasoner create( Resource configuration )
  {
  return rf.create( configuration ).bindSchema( schema );
  }
origin: org.apache.jena/jena-core

/**
 * Return a prebuilt standard configuration for the default subclass/subproperty transitive closure reasoner.
 */
public static Reasoner getTransitiveReasoner() {
  if (theTRANSITIVEReasoner == null) theTRANSITIVEReasoner = TransitiveReasonerFactory.theInstance().create(null);
  return theTRANSITIVEReasoner;
}
origin: apache/jena

/**
 * Return a prebuilt standard configuration for the default RDFS reasoner
 */
 public static Reasoner getRDFSReasoner() {
   if (theRDFSReasoner == null) theRDFSReasoner = RDFSRuleReasonerFactory.theInstance().create(null);
   return theRDFSReasoner;
 }
origin: apache/jena

@Override
public Reasoner create( Resource configuration )
  {
  GenericRuleReasoner result = (GenericRuleReasoner) r.create( configuration );
  result.addRules( rules );
  return result;
  }
origin: org.apache.jena/jena-core

/**
 * Prebuilt standard configuration a micro-OWL reasoner. This just supports property axioms,
 * and class inheritance sufficient to power the OntAPI.
 */
public static Reasoner getOWLMicroReasoner() {
  if (theOWLMicroReasoner == null) theOWLMicroReasoner = OWLMicroReasonerFactory.theInstance().create(null);
  return theOWLMicroReasoner;
}
origin: apache/jena

/**
   Answer a Reasoner created according to the underlying factory, and then 
   loaded with this Wrapper's rules (if the Reasoner is a RuleReasoner) and
   bound to this Wrapper's schemas (in an unspecified order).
 */
@Override
public Reasoner create( Resource ignored )
  { Reasoner result = factory.create( config );
  return schemaUnion.isEmpty() ? result : result.bindSchema( schemaUnion ); }
origin: org.apache.jena/jena-core

/**
   Answer a Reasoner created according to the underlying factory, and then 
   loaded with this Wrapper's rules (if the Reasoner is a RuleReasoner) and
   bound to this Wrapper's schemas (in an unspecified order).
 */
@Override
public Reasoner create( Resource ignored )
  { Reasoner result = factory.create( config );
  return schemaUnion.isEmpty() ? result : result.bindSchema( schemaUnion ); }
origin: apache/jena

/**
 * Return a prebuilt simplified configuration for the default RDFS reasoner
 */
 public static Reasoner getRDFSSimpleReasoner() {
   if (theRDFSSimpleReasoner == null) {
     theRDFSSimpleReasoner = RDFSRuleReasonerFactory.theInstance().create(null);
     theRDFSSimpleReasoner.setParameter(ReasonerVocabulary.PROPsetRDFSLevel, ReasonerVocabulary.RDFS_SIMPLE);
   }
   return theRDFSSimpleReasoner;
 }
origin: apache/jena

/**
 * Build the query tests for the given reasoner.
 */
private static void constructQuerytests(TestSuite suite, String manifest, ReasonerFactory rf, Resource config) throws IOException {
  ReasonerTester tester = new ReasonerTester(manifest);
  Reasoner r = rf.create(config);
  for ( String test : tester.listTests() )
  {
    suite.addTest( new TestReasonerFromManifest( tester, test, r ) );
  }
}

origin: apache/jena

private Model createForwardChainingModel() {
  Model baseModel = ModelFactory.createDefaultModel();
  Model schemaModel = ModelFactory.createDefaultModel();
  Model configurationRuleReasoner = ModelFactory.createDefaultModel();
  org.apache.jena.rdf.model.Resource configuration = configurationRuleReasoner.createResource();
  configuration.addProperty(ReasonerVocabulary.PROPruleMode, "forward");
  configuration.addProperty(ReasonerVocabulary.PROPsetRDFSLevel, ReasonerVocabulary.RDFS_SIMPLE);
  Reasoner ruleReasoner = RDFSRuleReasonerFactory.theInstance().create(configuration);
  InfModel inf = ModelFactory.createInfModel(ruleReasoner, schemaModel, baseModel);
  inf.read(new ByteArrayInputStream(TURTLE_RDF.getBytes()), "", "TURTLE");
  return inf;
}
origin: org.apache.jena/jena-core

public void testRuleReasonerWrapper()
  {
  MockFactory mock = new MockFactory();
  ReasonerFactory wrapped = wrap( mock );
  assertEquals( MockFactory.capabilities, wrapped.getCapabilities() );
  assertEquals( MockFactory.uri, wrapped.getURI() );
  assertEquals( MockFactory.reasoner, wrapped.create( null ) );
  assertEquals( Arrays.asList( new Object[] {"capabilities", "uri", "create"} ),  mock.done );
  }

origin: apache/jena

/**
 * Test the capabilities description.
 */
public void testRDFSDescription() {
  ReasonerFactory rf = RDFSFBRuleReasonerFactory.theInstance();
  Reasoner r = rf.create(null);
  assertTrue(r.supportsProperty(RDFS.subClassOf));        
  assertTrue(r.supportsProperty(RDFS.domain));        
  assertTrue( ! r.supportsProperty(OWL.allValuesFrom));        
}

origin: apache/jena

private void doTestRDFSSimple(String level) {
  Model model = ModelFactory.createDefaultModel();
  String NS = "http://jena.hpl.hp.com/example#";
  Property prop = model.createProperty(NS + "prop");
  model.add(prop, RDF.type, RDF.Property);
  Reasoner reasoner = RDFSRuleReasonerFactory.theInstance().create(null);
  reasoner.setParameter(ReasonerVocabulary.PROPsetRDFSLevel, level);
  InfModel im = ModelFactory.createInfModel(reasoner, model);
  assertTrue( im.contains(prop, RDFS.subPropertyOf, prop) );
}
origin: org.apache.jena/jena-core

public void testSchema()
  {
  Model schema = model( "P rdf:type owl:ObjectProperty" );
  Resource root = resourceInModel( "x rdf:type ja:ReasonerFactory; x ja:schema S" );
  Assembler sub = new NamedObjectAssembler( resource( "S" ), schema );
  ReasonerFactory rf = (ReasonerFactory) ASSEMBLER.open( sub, root );
  Reasoner r = rf.create( null );
  assertIsomorphic( schema.getGraph(), ((FBRuleReasoner) r).getBoundSchema() );
  }
origin: apache/jena

public void testSchema()
  {
  Model schema = model( "P rdf:type owl:ObjectProperty" );
  Resource root = resourceInModel( "x rdf:type ja:ReasonerFactory; x ja:schema S" );
  Assembler sub = new NamedObjectAssembler( resource( "S" ), schema );
  ReasonerFactory rf = (ReasonerFactory) ASSEMBLER.open( sub, root );
  Reasoner r = rf.create( null );
  assertIsomorphic( schema.getGraph(), ((FBRuleReasoner) r).getBoundSchema() );
  }
origin: org.apache.jena/jena-core

private void doTestRDFSSimple(String level) {
  Model model = ModelFactory.createDefaultModel();
  String NS = "http://jena.hpl.hp.com/example#";
  Property prop = model.createProperty(NS + "prop");
  model.add(prop, RDF.type, RDF.Property);
  Reasoner reasoner = RDFSRuleReasonerFactory.theInstance().create(null);
  reasoner.setParameter(ReasonerVocabulary.PROPsetRDFSLevel, level);
  InfModel im = ModelFactory.createInfModel(reasoner, model);
  assertTrue( im.contains(prop, RDFS.subPropertyOf, prop) );
}
origin: apache/jena

private static void testInfModel(Dataset ds0) {
  Txn.executeWrite(ds0, ()->{});
  Model baseModel = ds0.getDefaultModel(); 
  Model model = ModelFactory.createInfModel(RDFSRuleReasonerFactory.theInstance().create(null), baseModel);
  if ( model.getGraph().getTransactionHandler().transactionsSupported() ) {
    // InfModels do not support transactions per se - they particpate if includes in a suitabel dataset.
    model.begin();
    long x = Iter.count(model.listStatements());
    model.commit();
    assertTrue(x > 10);
  }
}

org.apache.jena.reasonerReasonerFactorycreate

Javadoc

Constructor method that builds an instance of the associated Reasoner

Popular methods of ReasonerFactory

  • getURI
    Return the URI labelling this type of reasoner
  • getCapabilities
    Return a description of the capabilities of this reasoner encoded in RDF. These capabilities may be

Popular in Java

  • Finding current android device location
  • setRequestProperty (URLConnection)
  • onCreateOptionsMenu (Activity)
  • getContentResolver (Context)
  • GridBagLayout (java.awt)
    The GridBagLayout class is a flexible layout manager that aligns components vertically and horizonta
  • BufferedReader (java.io)
    Wraps an existing Reader and buffers the input. Expensive interaction with the underlying reader is
  • ConnectException (java.net)
    A ConnectException is thrown if a connection cannot be established to a remote host on a specific po
  • SQLException (java.sql)
    An exception that indicates a failed JDBC operation. It provides the following information about pro
  • Collection (java.util)
    Collection is the root of the collection hierarchy. It defines operations on data collections and t
  • ReentrantLock (java.util.concurrent.locks)
    A reentrant mutual exclusion Lock with the same basic behavior and semantics as the implicit monitor
  • Top Sublime Text plugins
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