A InfModelB extends the InfModel Class, with a backward chaining algorithm.
Only the loaded or added base-triples are stored. A find-query evaluates the inference rules and recursively tries to find the statements. InfModelB memorises "Dead-Ends" until the next add() command, thus makin a second find much faster. InfModelB is safe for loops in Ontologies, that would cause infinite loops. WARNING: A find(null,null,null) might take very long.
Located in /infModel/InfModelB.php (line 23)
Object | --Model | --MemModel | --InfModel | --InfModelB
Array that holds combinations of inference rules with distinct find-querys, that don't lead to any inference.
Inherited from InfModel
InfModel::$infRules
InfModel::$infRulesEntailIndex
InfModel::$infRulesTriggerIndex
InfModel::$statementRuleIndex
InfModel::$supportedInference
Inherited from MemModel
MemModel::$indexArr
MemModel::$indexed
MemModel::$parsedNamespaces
MemModel::$triples
Inherited from Model
Model::$baseURI
Model::$bNodeCount
Constructor You can supply a base_uri
Adds a new triple to the Model without checking, if the statement is already in the Model. So if you want a duplicate free Model use the addWithoutDuplicates() function (which is slower then add())
Tests if the Model contains the given triple.
TRUE if the triple belongs to the Model; FALSE otherwise.
General method to search for triples.
NULL input for any parameter will match anything. Example: $result = $m->find( NULL, NULL, $node ); Finds all triples with $node as object. Returns an empty MemModel if nothing is found. To improve the search speed with big Models, call index(INDEX_TYPE) before seaching.
It recursively searches in the statements and rules to find matching statements.
Returns a FindIterator for traversing the MemModel.
Disabled in InfModelB.
Searches for triples and returns the first matching statement.
NULL input for any parameter will match anything. Example: $result = $m->findFirstMatchingStatement( NULL, NULL, $node ); Returns the first statement of the MemModel where the object equals $node. Returns an NULL if nothing is found. You can define an offset to search for. Default = 0
Create a MemModel containing only the base triples (without inferred statements) of the current InfModelB.
Create a MemModel containing all the triples (including inferred statements) of the current InfModelB.
Returns a StatementIterator for traversing the Model.
Removes the triple from the MemModel.
TRUE if the triple is removed. FALSE otherwise.
Checks, if it touches any statements, that added inference rules to the model.
Saves the RDF,N3 or N-Triple serialization of the full InfModelB (including inferred triples) to a file.
You can decide to which format the model should be serialized by using a corresponding suffix-string as $type parameter. If no $type parameter is placed this method will serialize the model to XML/RDF format. Returns FALSE if the InfModelB couldn't be saved to the file.
Number of all inferable triples in the Model.
WARNING: uses a find(null,null,null) to find all statements! (might take a while)
Short Dump of the InfModelB.
Dumps of the InfModelB including ALL inferable triples.
Writes the RDF serialization of the Model including ALL inferable triples as HTML.
Writes the RDF serialization of the Model including ALL inferable triples as HTML table.
Writes the RDF serialization of the Model including ALL inferable triples.
This is the main inference method of the InfModelB The algorithm works as follows: Find all statements in the base model, that matches the current find-query.
Check all rules, if they are able to deliver infered statements, that match the current find-query. Don't use rules with queries, that lead to dead-ends and don't use a rule-query-combination that was used before in this branch (ontology loops). If a rule is possible do deliver such statements, get a new find-query, that is possible to find those statements, that are able to trigger this rule. Call this _infFind method wirh the new find-query and entail the resulting statements. If this rule, wasn't able to return any statements with this distinct query, add this combination to the dead-ends. Return the statements from the base triples and those, which were infered.
If $findOnlyFirstMatching is set to true, only the first match in the base-statements is entailed an returned (used in contains() and findFirstMatchingStatement() methods).
You can set an offset to look for the first matching statement by setting the $offset var.
It recursively searches in the statements and rules to find matching statements
Checks, if a single node matches a single find pattern.
TRUE if the node matches. FALSE otherwise.
Checks, if it touches any statements, that added inference rules to the model.
Inherited From InfModel
InfModel::InfModel()
InfModel::add()
InfModel::findRegex()
InfModel::findVocabulary()
InfModel::getSchema()
InfModel::replace()
InfModel::_addInfRule()
InfModel::_addInfruleToIndex()
InfModel::_addToInference()
InfModel::_findRuleEntailmentInIndex()
InfModel::_findRuleTriggerInIndex()
InfModel::_removeFromInference()
Inherited From MemModel
MemModel::MemModel()
MemModel::add()
MemModel::addModel()
MemModel::addNamespace()
MemModel::addParsedNamespaces()
MemModel::addWithoutDuplicates()
MemModel::close()
MemModel::contains()
MemModel::containsAll()
MemModel::containsAny()
MemModel::equals()
MemModel::find()
MemModel::findAsIterator()
MemModel::findCount()
MemModel::findFirstMatchingStatement()
MemModel::findFirstMatchOff()
MemModel::findRegex()
MemModel::findVocabulary()
MemModel::getIndexType()
MemModel::getParsedNamespaces()
MemModel::getStatementIterator()
MemModel::index()
MemModel::intersect()
MemModel::isEmpty()
MemModel::isIndexed()
MemModel::iterFind()
MemModel::matchStatement()
MemModel::rdqlQuery()
MemModel::rdqlQueryAsIterator()
MemModel::reify()
MemModel::remove()
MemModel::removeNamespace()
MemModel::replace()
MemModel::saveAs()
MemModel::setBaseURI()
MemModel::size()
MemModel::subtract()
MemModel::toString()
MemModel::toStringIncludingTriples()
MemModel::unite()
MemModel::writeAsHtml()
MemModel::writeAsHtmlTable()
MemModel::writeRdfToString()
MemModel::_containsIndex()
MemModel::_findInIndex()
MemModel::_findMatchIndex()
MemModel::_indexOpr()
Inherited From Model
Model::Model()
Model::findForward()
Model::getBaseURI()
Model::getMemModelByRDQL()
Model::getOntModel()
Model::getResModel()
Model::getUniqueResourceURI()
Model::load()
Model::sparqlQuery()
Model::visualize()
Model::_addStatementFromAnotherModel()
Inherited From Object
Object::toString()
Documentation generated on Mon, 26 Jun 2006 14:25:31 +0200 by phpDocumentor 1.3.0RC6