Tabnine Logo
Reasoner
Code IndexAdd Tabnine to your IDE (free)
Reasoner

How to use
Reasoner
in
org.apache.jena.reasoner

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

origin: apache/jena

/**
 * Build an inferred model by attaching the given RDF model to the given reasoner.
 * This form of the call allows two data sets to be merged and reasoned over -
 * conventionally one contains schema data and one instance data but this is not
 * a formal requirement.
 *
 * @param reasoner the reasoner to use to process the data
 * @param schema a Model containing RDFS schema data
 * @param model a Model containing instance data assertions, any statements added to the InfModel
 * will be added to this underlying data model.
 */
public static InfModel createInfModel(Reasoner reasoner, Model schema, Model model) {
   InfGraph graph = reasoner.bindSchema(schema.getGraph()).bind(model.getGraph());
   return new InfModelImpl( graph );
}
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

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

/**
 * Build an inferred model by attaching the given RDF model to the given reasoner.
 *
 * @param reasoner the reasoner to use to process the data
 * @param model the Model containing both instance data and schema assertions to be inferenced over, 
 * any statements added to the InfModel will be added to this underlying data model.
 */
public static InfModel createInfModel( Reasoner reasoner, Model model ) {
   InfGraph graph = reasoner.bind(model.getGraph());
   return new InfModelImpl(graph);
}
origin: apache/jena

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

data.add( new Triple(C2, RDFS.subClassOf.asNode(), C3) );
Reasoner reasoner = TransitiveReasonerFactory.theInstance().create(null);
assertTrue(reasoner.supportsProperty(RDFS.subClassOf));
assertTrue(! reasoner.supportsProperty(RDFS.domain));
InfGraph infgraph = reasoner.bind(data);
TestUtil.assertIteratorValues(this, 
  infgraph.find(C1, null, null), 
origin: apache/jena

if (om.getReasoner() != null) {
  if (om.getReasoner()
     .getReasonerCapabilities().contains( null, ReasonerVocabulary.supportsP, RDFS.subClassOf ))
origin: apache/jena

/**
  Answer the InfCapabilities of this InfGraph.
 */
@Override
public Capabilities getCapabilities() {
  if (capabilities == null) {
    return getReasoner().getGraphCapabilities();
  } else {
    return capabilities;
  }
}
origin: org.apache.jena/jena-core

/**
 * Build an inferred model by attaching the given RDF model to the given reasoner.
 *
 * @param reasoner the reasoner to use to process the data
 * @param model the Model containing both instance data and schema assertions to be inferenced over, 
 * any statements added to the InfModel will be added to this underlying data model.
 */
public static InfModel createInfModel( Reasoner reasoner, Model model ) {
   InfGraph graph = reasoner.bind(model.getGraph());
   return new InfModelImpl(graph);
}
origin: org.apache.jena/jena-core

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

data.add( new Triple(C2, RDFS.subClassOf.asNode(), C3) );
Reasoner reasoner = TransitiveReasonerFactory.theInstance().create(null);
assertTrue(reasoner.supportsProperty(RDFS.subClassOf));
assertTrue(! reasoner.supportsProperty(RDFS.domain));
InfGraph infgraph = reasoner.bind(data);
TestUtil.assertIteratorValues(this, 
  infgraph.find(C1, null, null), 
origin: org.apache.jena/jena-core

if (om.getReasoner() != null) {
  if (om.getReasoner()
     .getReasonerCapabilities().contains( null, ReasonerVocabulary.supportsP, RDFS.subClassOf ))
origin: org.apache.jena/jena-core

/**
  Answer the InfCapabilities of this InfGraph.
 */
@Override
public Capabilities getCapabilities() {
  if (capabilities == null) {
    return getReasoner().getGraphCapabilities();
  } else {
    return capabilities;
  }
}
origin: org.apache.jena/jena-core

/**
 * Build an inferred model by attaching the given RDF model to the given reasoner.
 * This form of the call allows two data sets to be merged and reasoned over -
 * conventionally one contains schema data and one instance data but this is not
 * a formal requirement.
 *
 * @param reasoner the reasoner to use to process the data
 * @param schema a Model containing RDFS schema data
 * @param model a Model containing instance data assertions, any statements added to the InfModel
 * will be added to this underlying data model.
 */
public static InfModel createInfModel(Reasoner reasoner, Model schema, Model model) {
   InfGraph graph = reasoner.bindSchema(schema.getGraph()).bind(model.getGraph());
   return new InfModelImpl( graph );
}
origin: org.apache.jena/jena-core

/**
 * Return a Model through which all the RDFS entailments
 * derivable from the given model are accessible. Some work is done
 * when the inferenced model is created but each query will also trigger some
 * additional inference work.
 *
 * @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 );
}
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

/**
 * 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: org.apache.jena/jena-core

/**
 * 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: org.apache.jena/jena-core

if (getGraph() instanceof InfGraph) {
  supportsIndAsThing = ((InfGraph) getGraph()).getReasoner()
                        .getReasonerCapabilities()
                        .contains( null, ReasonerVocabulary.supportsP, ReasonerVocabulary.individualAsThingP );
origin: apache/jena

/**
 * Return a Model through which all the RDFS entailments
 * derivable from the given data and schema models are accessible.
 * There is no strict requirement to separate schema and instance data between the two
 * arguments.
 *
 * @param model a Model containing instance data assertions
 * @param schema a Model containing RDFS schema data
 */
public static InfModel createRDFSModel( Model schema, Model model ) {
   Reasoner reasoner = ReasonerRegistry.getRDFSReasoner();
   InfGraph graph  = reasoner.bindSchema(schema.getGraph()).bind(model.getGraph());
   return new InfModelImpl( graph );
}
org.apache.jena.reasonerReasoner

Javadoc

The minimal interface to which all reasoners (or reasoner adaptors) conform. This only supports attaching the reasoner to a set of RDF graphs which represent the rules or ontologies and instance data. The actual reasoner requests are made through the InfGraph which is generated once the reasoner has been bound to a set of RDF data.

Most used methods

  • bind
    Attach the reasoner to a set of RDF data to process. The reasoner may already have been bound to spe
  • bindSchema
    This is most commonly used to attach an ontology (a set of tbox axioms in description logics jargon)
  • setParameter
    Set a configuration parameter for the reasoner. Parameters can identified by URI and can also be set
  • supportsProperty
    Determine whether the given property is recognized and treated specially by this reasoner. This is a
  • getGraphCapabilities
    Return the Jena Graph Capabilties that the inference graphs generated by this reasoner are expected
  • getReasonerCapabilities
    Return a description of the capabilities of this reasoner encoded in RDF. These capabilities may be
  • setDerivationLogging
    Switch on/off drivation logging. If set to true then the InfGraph created from the bind operation wi

Popular in Java

  • Making http post requests using okhttp
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • setContentView (Activity)
  • notifyDataSetChanged (ArrayAdapter)
  • ServerSocket (java.net)
    This class represents a server-side socket that waits for incoming client connections. A ServerSocke
  • Path (java.nio.file)
  • Locale (java.util)
    Locale represents a language/country/variant combination. Locales are used to alter the presentatio
  • SortedSet (java.util)
    SortedSet is a Set which iterates over its elements in a sorted order. The order is determined eithe
  • StringTokenizer (java.util)
    Breaks a string into tokens; new code should probably use String#split.> // Legacy code: StringTo
  • Servlet (javax.servlet)
    Defines methods that all servlets must implement. A servlet is a small Java program that runs within
  • Top 12 Jupyter Notebook extensions
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