Class InfModel

Description

A InfModel Model extends a MemModel , by adding the ability to infer statements from known statements and RDFS/OWL-Schematas.

It uses the same interface as MemModel, thus making the infererence process hidden.

Located in /infModel/InfModel.php (line 19)

Object
   |
   --Model
      |
      --MemModel
         |
         --InfModel
Direct descendents
Class Description
InfModelB A InfModelB extends the InfModel Class, with a backward chaining algorithm.
InfModelF A InfModelF extends the InfModel Class, with a forward chaining algorithm.
Variable Summary
Method Summary
InfModel InfModel ([string $baseURI = NULL])
void add (object Statement $statement)
object MemModel findRegex (string $subject_regex, string $predicate_regex, string $object_regex)
object MemModel findVocabulary (string $vocabulary)
object Model getSchema ()
void replace (object Node $subject, object Node $predicate, object Node $object, object Node $replacement)
void _addInfRule (object Infrule $infRule, integer $statementPosition)
void _addInfruleToIndex ( &$infRule,  &$infRulePosition, object infrule $infRule, integer $infRulePosition)
void _addToInference (object Statement $statement)
array _findRuleEntailmentInIndex (mixed $subject, mixed $predicate, mixed $object)
array _findRuleTriggerInIndex ( $statement, object infrule $infRule)
integer _removeFromInference (object Statement $statement)
Variables
array $infRules (line 28)

Array that holds the objects of the class Infrule, which were assigned by the _addToInference() function

  • access: private
array $infRulesEntailIndex (line 67)

Array of the infRule entailments and the matching infrules.

$this->infRulesEntailIndex['s'] for subject index, ['p'] for predicates, and ['o'] for objects.

  • access: private
array $infRulesTriggerIndex (line 57)

Array of the infRule triggers and the matching infrules.

$this->infRulesTriggerIndex['s'] for subject index, ['p'] for predicates, and ['o'] for objects.

  • access: private
array $statementRuleIndex (line 47)

Array of the connection between the infrules and the statement that assigned those rules.

array[2][3]=true;array[2][5]=true means, that statement 2 assigned rule 3 & 5 to the model.

  • access: private
array $supportedInference (line 36)

Array of URI-Strings that produces Infrules.

  • access: private

Inherited Variables

Inherited from MemModel

MemModel::$indexArr
MemModel::$indexed
MemModel::$parsedNamespaces
MemModel::$triples

Inherited from Model

Model::$baseURI
Model::$bNodeCount
Methods
Constructor InfModel (line 78)

Constructor You can supply a base_uri

  • access: public
InfModel InfModel ([string $baseURI = NULL])
  • string $baseURI
add (line 172)

Adds a new triple to the Model without checking if the statement is already in the Model.

So if you want a duplicate free MemModel use the addWithoutDuplicates() function (which is slower then add()) If the statement's predicate label is supported by the inference, the matching rules are added.

  • throws: PhpError
  • access: public
void add (object Statement $statement)
  • object Statement $statement

Redefinition of:
MemModel::add()
Adds a new triple to the MemModel without checking if the statement is already in the MemModel.

Redefined in descendants as:
  • InfModelB::add() : 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())
  • InfModelF::add() : Adds a new triple to the MemModel without checking if the statement is already in the MemModel.
findRegex (line 446)

Method to search for triples using Perl-style regular expressions.

NULL input for any parameter will match anything. Example: $result = $m->find_regex( NULL, NULL, $regex ); Finds all triples where the label of the object node matches the regular expression. Returns an empty MemModel if nothing is found.

This function is disabled in the Inference Model

  • access: public
object MemModel findRegex (string $subject_regex, string $predicate_regex, string $object_regex)
  • string $subject_regex
  • string $predicate_regex
  • string $object_regex

Redefinition of:
MemModel::findRegex()
Method to search for triples using Perl-style regular expressions.
findVocabulary (line 468)

Returns all tripels of a certain vocabulary.

$vocabulary is the namespace of the vocabulary inluding a # : / char at the end. e.g. http://www.w3.org/2000/01/rdf-schema# Returns an empty MemModel if nothing is found.

This function is disabled in the Inference Model.

  • access: public
object MemModel findVocabulary (string $vocabulary)
  • string $vocabulary

Redefinition of:
MemModel::findVocabulary()
Returns all tripels of a certain vocabulary.
getSchema (line 400)

Returns a model, containing all Statements, having a Predicate, that is supported by the inference.

  • access: public
object Model getSchema ()
replace (line 423)

General method to replace nodes of a MemModel.

This function is disabled in the Inference Model.

  • throws: PhpError
  • access: public
void replace (object Node $subject, object Node $predicate, object Node $object, object Node $replacement)
  • object Node $subject
  • object Node $predicate
  • object Node $object
  • object Node $replacement

Redefinition of:
MemModel::replace()
General method to replace nodes of a MemModel.
_addInfRule (line 664)

Adds an InfRule to the InfModel.

$statementPosition states the positiion of the statement, that created this rule, in the model->triples array.

  • access: private
void _addInfRule (object Infrule $infRule, integer $statementPosition)
  • object Infrule $infRule
  • integer $statementPosition
_addInfruleToIndex (line 486)

Adds the URI or NULL to the Infrule trigger or entailment index.

  • access: private
void _addInfruleToIndex ( &$infRule,  &$infRulePosition, object infrule $infRule, integer $infRulePosition)
  • object infrule $infRule
  • integer $infRulePosition
  • &$infRule
  • &$infRulePosition
_addToInference (line 189)

This function analyses the statement's predicate and adds the matching infrule to the model.

  • access: private
void _addToInference (object Statement $statement)
  • object Statement $statement
_findRuleEntailmentInIndex (line 606)

Searches the Entailment-index for a matching Entailment and returns an array of infRule positions.

  • return: integer
  • access: private
array _findRuleEntailmentInIndex (mixed $subject, mixed $predicate, mixed $object)
_findRuleTriggerInIndex (line 558)

Searches the trigger-index for a matching trigger and returns an array of infRule positions.

  • return: integer
  • access: private
array _findRuleTriggerInIndex ( $statement, object infrule $infRule)
  • object infrule $infRule
  • $statement
_removeFromInference (line 295)

This function checks, which infrules were added by the statement and removes those.

  • access: private
integer _removeFromInference (object Statement $statement)
  • object Statement $statement

Inherited Methods

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:29 +0200 by phpDocumentor 1.3.0RC6