[ Expand All ] [ Collapse All ] - [ Properties (5) ] [ Methods (78) ] - [ Legend ]

DefaultRDFSModel Class

Object
Model
DbModel
DefaultRDFSModel

Properties implemented by DefaultRDFSModel
public method asResource

Provides a view of the model as a resource, e.g. to retrieve or set owl:OntologyProperties.

public method importsIds

public method importsSQL

public method logActions

public method resource

Methods implemented by DefaultRDFSModel
private method _convertRecordSetToMemModel

PHPobject _convertRecordSetToMemModel(unknown $recordSet)

Convert an ADORecordSet to a memory Model.

Every successful database query returns an ADORecordSet object which is actually a cursor that holds the current row in the array fields[]. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!! This method can only be applied to a RecordSet with array fields[] !!! containing a representation of the database table: statements, !!! with an index corresponding to following table columns: !!! [0] - subject, [1] - predicate, [2] - object, [3] - l_language, !!! [4] - l_datatype, [5] - subject_is, [6] - object_is !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Arguments

Return

MemModel

private method _convertRecordSetToNodeList

PHParray _convertRecordSetToNodeList(unknown $recordSet, string $class)

Convert an ADORecordSet to an array of RDFS Resources or Literals.

Every successful database query returns an ADORecordSet object which is actually a cursor that holds the current row in the array fields[]. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!! This method can only be applied to a RecordSet with array fields[] !!! containing at least two elements: !!! [0] - resource !!! [1] - resource type, i.e. 'r' for resource, 'b' for blank node, 'l' for literals !!! [2] - l_language !!! [3] - l_datatype !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Arguments

Return

Array of RDFSResources

public method _convertRowToStatement

PHP_convertRowToStatement(unknown $row)

Arguments

private method _createStatement

PHPstatement _createStatement(rdfsresource $subj, rdfsresource $pred, rdfsnode $obj, string $objLang, string $objDType)

Creates a new Statement with the given parameters

Arguments

private method _dbId

PHP_dbId(unknown $resource)

RDFSModel::_dbId()

Arguments

public method _dbIds

PHP_dbIds(unknown $resources)

Arguments

public method _findInstances

PHParray _findInstances(unknown $types, array $properties, string $compare, integer $start, integer $count, integer $erg)

Return an array of individuals in the model. If an array properties of PropertyURI=>Value mappings is given, only individuals with the specified property values will be returned.

Arguments

Return

of RDFSInstance objects.

private method _getNodeFlag

PHP_getNodeFlag(unknown $object)

RDFSModel::_getNodeFlag()

Arguments

private method _listResourcesCol

PHP_listResourcesCol(unknown $col, string $search, integer $start, integer $count, integer $erg)

RDFSModel::_listResourcesCol()

Arguments

public method add

PHPadd(rdfsresource $subj, rdfsresource $pred, rdfsnode $obj)

Adds a statement to the model

Arguments

public method addAnonymousClass

PHPrdfsclass addAnonymousClass()

Returns a resource that represents a anonymous class description node in this model.

Return

The class created.

public method addClass

PHPrdfsclass addClass(string $uri)

Returns a resource that represents a class description node in this model.

Arguments

Return

The class created.

public method addInstance

PHPrdfsinstance addInstance(string $uri, string $class)

Creates a new RDFSInstance

Arguments

Return

The instance created.

public method addList

PHPaddList(unknown $symbols, boolean $literals)

Adds an RDF list to the model

Arguments

public method addProperty

PHPrdfsproperty addProperty(string $uri)

Creates a new RDFSProperty

Arguments

Return

The property created.

public method classF

PHPclassF(unknown $uri)

Arguments

public method countClasses

PHPinteger countClasses(boolean $includeImports)

Returns the number of classes in this model.

Arguments

Return

Number of classes in this model.

public method countInstances

PHPinteger countInstances(boolean $includeImports)

Returns the number of instances in this model.

Arguments

Return

Number of instances in this model.

public method countProperties

PHPinteger countProperties(boolean $includeImports)

Returns the number of properties in this model.

Arguments

Return

Number of properties in this model.

public method countTriples

PHPinteger countTriples(boolean $includeImports)

Returns the number of triples/statements in this model.

Arguments

Return

Number of triples in this model.

constructor DefaultRDFSModel

PHPrdfsmodel DefaultRDFSModel(rdfsstore $store, string $modelURI)

Constructor

Arguments

private method fetchStatementFromRecordSet

PHPobject fetchStatementFromRecordSet(unknown $recordSet)

Return a statement from a ADORecordSet resulting from a query to the statement table.

Arguments

Return

Statement

public method find

PHPmemmodel find(unknown $s, unknown $p, unknown $o, integer $start, integer $count, integer $erg)

Method to search for triples in the DbModel. NULL input for any parameter will match anything. Example: $result = $m->find( NULL, NULL, $node ); Finds all triples with $node as object.

Arguments

Return

.

public method findInstances

PHPfindInstances(array $properties, string $compare, integer $start, integer $count, integer $erg)

Arguments

public method findNode

PHPnodel findNode(unknown $subject, unknown $predicate, unknown $object, string $class)

Exactly one of the parameters $subject, $predicate or $object must be NULL. This method then returns the node at this position of the first matching statement.

Arguments

public method findNodes

PHParray findNodes(unknown $subject, unknown $predicate, unknown $object, string $class, integer $start, integer $count, integer $erg)

Exactly one of the parameters $subject, $predicate or $object must be NULL. This method then returns an array of all nodes at this position of matching statements.

Arguments

Return

Array of nodes (RDFSResources or Literals).

public method findPredicates

PHPfindPredicates(unknown $subject, unknown $object)

Arguments

public method findStatement

PHParray findStatement(unknown $s, unknown $p, unknown $o)

Returns the first statements of this model matching the parameters.

Arguments

Return

of RDFSInstance objects.

public method findStatements

PHParray findStatements(unknown $s, unknown $p, unknown $o, integer $start, integer $count, integer $erg)

Returns the statements of this model matching the parameters.

Arguments

Return

Array of RDFSInstance objects.

public method getClass

PHPrdfsclass getClass(string $uri)

Return a RDFSClass object corresponding to the URI or false if such one does not exist.

Arguments

Return

_or_false The class or false if the class does not exist.

public method getInstance

PHPgetInstance(unknown $uri)

Arguments

public method getList

PHParray getList(resource $rest, unknown $class)

Returns RDF list members as an array

Arguments

Return

Array of list members.

public method getLiteralId

PHPstring getLiteralId(literal $literal)

Returns a string representation of the literal.

Arguments

public method getModelIds

PHPgetModelIds()

public method getNodeId

PHPstring getNodeId(node $node)

Returns a uniq string for a node, which can be used for indexing arrays of nodes.

Arguments

public method getOneOf

PHParray getOneOf(rdfresource $oneOf)

TODO: Beschreibung und return

Arguments

public method getParsedNamespaces

PHPgetParsedNamespaces()

public method getProperty

PHPrdfsproperty getProperty(string $uri)

Returns a RDFSProperty object corresponding to the URI or false if such one does not exist.

Arguments

Return

_or_false The property or false if the class does not exist.

public method getResource

PHPrdfsinstance getResource(unknown $uri)

Return a RDFSInstance object corresponding to the URI or false if such one doesn't exist.

Arguments

Return

_or_false The instance or false if the class does not exist.

public method getType

PHPstring getType()

Returns the model type

Return

RDF/RDFS/OWL

private method getUniqueResourceURI

PHPstring getUniqueResourceURI(string $prefix)

Internal method, that returns a resource URI that is unique for the DbModel. URIs are generated using the base_uri of the DbModel, the prefix and a unique number.

Arguments

public method instanceF

PHPinstanceF(unknown $uri)

Arguments

public method listAnnotationProperties

PHParray listAnnotationProperties(boolean $includePredefined)

Returns array of all annotation properties in this model.

Arguments

Return

Array of all annotation properties in this model.

public method listClassAnnotationProperties

PHParray listClassAnnotationProperties()

Returns an array of all distinct label languages for all classes in the model.

Return

All distinct label languages.

public method listClasses

PHParray listClasses()

Returns array of all named classes in this model.

Return

Array of RDFSCLass Objects

public method listClassLabelLanguages

PHParray listClassLabelLanguages()

Returns an array of all distinct label languages for all classes in the model.

Return

Array of all distinct label languages.

public method listDatatypes

PHParray listDatatypes()

Returns an array of all XML datatypes used in the model.

Return

Array of XML datatypes.

public method listImports

PHParray listImports()

TODO: beschreibung

Return

Array of RDFResources

public method listInstances

PHParray listInstances(integer $start, integer $erg, integer $end)

Lists all instances of classes in the model.

Arguments

Return

Array of RDFSInstance instances of the model.

public method listLanguages

PHParray listLanguages()

Returns an array of all languages used in conjunction with literals in the model.

Return

Array of language strings.

public method listModelIds

PHPlistModelIds()

public method listNamespaces

PHParray listNamespaces()

Returns an array of all XML namespaces used in the model.

Return

Array of XML namespaces.

public method listProperties

PHParray listProperties()

Returns all properties (OWL_ObjectProperties and OWL_DatatypeProperties) of the model

Return

Array of RDFSProperty objects.

public method listResources

PHParray listResources()

Returns an array of all resource URIs in the model.

Return

Array of resource URIs.

public method listResourcesObject

PHParray listResourcesObject(string $search, integer $start, integer $count, integer $erg)

Returns an array of all resource URIs, which occur as objects of statements in the model.

Arguments

Return

Array of resource URIs.

public method listResourcesPredicate

PHParray listResourcesPredicate(string $search, integer $start, integer $count, integer $erg)

Returns an array of all resource URIs, which occur as predicates of statements in the model.

Arguments

Return

Array of resource URIs.

public method listResourcesSubject

PHParray listResourcesSubject(string $search, integer $start, integer $count, integer $erg)

Returns an array of all resource URIs, which occur as subjects of statements in the model.

Arguments

Return

Array of resource URIs.

public method listTopClasses

PHParray listTopClasses()

Returns array of all named classes not being sub-class of any other class in this model.

Return

Array of RDFSCLass Objects

public method listTopProperties

PHParray listTopProperties()

Returns array of all properties not being sub-properties of any other property in this model.

Return

Array of RDFSProperty objects.

public method listTypes

PHPlistTypes(rdfsresource $type, rdfsclass $class, integer $start, integer $count, integer $erg)

Find helper function.

Arguments

private method log

PHPlog(unknown $statement, unknown $ar)

Helper function for logging statement add or removes.

Arguments

public method logAdd

PHPlogAdd(unknown $statement)

Writes the adding of the given statement to the log.

Arguments

public method logEnabled

PHPboolean logEnabled()

Returns true if logging is enabled for the model/store false otherwise.

Return

True if logging is enabled for the model/store false otherwise.

public method logEnd

PHPlogEnd()

Finishes the last logging action.

public method logRemove

PHPlogRemove(unknown $statement)

Writes the removal of the given statement to the log.

Arguments

public method logStart

PHPlogStart(unknown $action, string $subject, string $details)

function load($filename,$type=NULL,$stream=false,$loadImports=false) { $this->dontCheckForDuplicatesOnAdd=true; $this->logStart('Model created',$this->modelURI); if($GLOBALS['_POWL']['SysOnt'] && $fp=fopen($filename,'r')) { $head=fread($fp,2000); fclose($fp); preg_match_all('/xmlns:([^=]+)=[\'"]([^"\']+)[\'"]/',$head,$matches); $i=array_search($this->modelURI,$matches[2]); $name=($i!==false)?$matches[1][$i]:$GLOBALS['_POWL']['SysOnt']->getUniqueResourceURI('Modelinstance'); $modelInst=$GLOBALS['_POWL']['SysOnt']->addInstance($name,'Model'); $modelInst->setPropertyValue('modelURI',$this->modelURI); foreach($matches[1] as $key=>$val) $modelInst->addPropertyValue('modelXMLNS',$val.':'.$matches[2][$key]); if($type) $modelInst->setPropertyValue('modelType',$type); } $this->logEnd(); $log=$this->logDisabled; $this->logDisabled=true; parent::load($filename,$type,$stream); if(!$type && $modelInst) { $type=$this->getType(); $modelInst->setPropertyValue('modelType',$type); } if($type=='OWL' && $loadImports) { foreach($this->listImports() as $import) { if(!$this->store->modelExists($import->getURI())) { $imp=$this->store->getNewModel($import->getURI()); $imp->load($import->getURI(),NULL,false,true); } } } $this->logDisabled=$log; }

Starts a new logging action, all subsequent adds and removes of statements to the model will be related to this action until the method "logEnd" is called.

Arguments

public method propertyF

PHPpropertyF(unknown $uri)

Arguments

public method query

PHPobject query(unknown $subject, unknown $predicate, unknown $object, integer $start, string $count)

General method to search for triples in the DbModel. NULL input for any parameter will match anything. Example: $result = $m->query( NULL, NULL, $node ); Finds all triples with $node as object.

Arguments

Return

ADORecordSet

public method rdqlQuery

PHPrdqlQuery(unknown $queryString, boolean $returnNodes)

Arguments

public method remove

PHPremove(rdfsresource $subj, rdfsresource $pred, string $obj)

Removes a statement from the model

Arguments

public method removeClass

PHPremoveClass(string $uri)

Removes a class (including all references to this class) from the model.

Arguments

public method removeInstance

PHPremoveInstance(string $uri)

Removes an instance (including all references to the instance) from the model.

Arguments

public method removeProperty

PHPremoveProperty(string $uri)

Removes a property (including all references to this property) from the model.

Arguments

public method removeResource

PHPremoveResource(string $resource)

Removes all references to a resource from the model.

Arguments

public method resourceF

PHPresourceF(unknown $uri)

Arguments

public method search
public method searchFullText

PHPsearchFullText(unknown $search, unknown $type, integer $start, unknown $count, integer $erg)

Arguments

public method setType

PHPsetType(unknown $type)

Arguments

Generated by PHPEdit - Copyright © 1999-2004 - Sébastien Hordeaux - WaterProof SARL