Provides a view of the model as a resource, e.g. to retrieve or set owl:OntologyProperties.
PHP | object _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
PHP | array _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
PHP | statement _createStatement(rdfsresource $subj, rdfsresource $pred, rdfsnode $obj, string $objLang, string $objDType) |
---|
Creates a new Statement with the given parameters
Arguments
Subject of the Statement
Predicate of the Statement
Object of the Statement
Optional a language
Optional a datatype
PHP | array _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
Array of PropertyURI=>Value pairs.
Comparision method to be used - default is exact match.
Return results starting with this row number.
Maximum number of records to return.
Variable passed by reference which will be set to the overall number of records.
Return
of RDFSInstance objects.
PHP | _listResourcesCol(unknown $col, string $search, integer $start, integer $count, integer $erg) |
---|
RDFSModel::_listResourcesCol()
Arguments
PHP | add(rdfsresource $subj, rdfsresource $pred, rdfsnode $obj) |
---|
Adds a statement to the model
Arguments
Subject of the Statement
Predicate of the Statement
Object of the Statement
PHP | rdfsclass addAnonymousClass() |
---|
Returns a resource that represents a anonymous class description node in this model.
Return
The class created.
PHP | rdfsclass addClass(string $uri) |
---|
Returns a resource that represents a class description node in this model.
Arguments
Return
The class created.
PHP | rdfsinstance addInstance(string $uri, string $class) |
---|
Creates a new RDFSInstance
Arguments
Return
The instance created.
PHP | addList(unknown $symbols, boolean $literals) |
---|
Adds an RDF list to the model
Arguments
PHP | rdfsproperty addProperty(string $uri) |
---|
Creates a new RDFSProperty
Arguments
Return
The property created.
PHP | integer countClasses(boolean $includeImports) |
---|
Returns the number of classes in this model.
Arguments
Count classes in imported models as well.
Return
Number of classes in this model.
PHP | integer countInstances(boolean $includeImports) |
---|
Returns the number of instances in this model.
Arguments
Count instances in imported models as well.
Return
Number of instances in this model.
PHP | integer countProperties(boolean $includeImports) |
---|
Returns the number of properties in this model.
Arguments
Count properties in imported models as well.
Return
Number of properties in this model.
PHP | integer countTriples(boolean $includeImports) |
---|
Returns the number of triples/statements in this model.
Arguments
Count triples in imported models as well.
Return
Number of triples in this model.
PHP | rdfsmodel DefaultRDFSModel(rdfsstore $store, string $modelURI) |
---|
Constructor
Arguments
PHP | object fetchStatementFromRecordSet(unknown $recordSet) |
---|
Return a statement from a ADORecordSet resulting from a query to the statement table.
Arguments
Return
Statement
PHP | memmodel 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 results starting with this row number.
Maximum number of records to return.
Variable passed by reference which will be set to the overall number of records.
Return
.
PHP | findInstances(array $properties, string $compare, integer $start, integer $count, integer $erg) |
---|
Arguments
PHP | nodel 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
PHPClass which the returned nodes should be instances of.
PHP | array 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
PHPClass which the returned nodes should be instances of.
Return results starting with this row number.
Maximum number of records to return.
Variable passed by reference which will be set to the overall number of records.
Return
Array of nodes (RDFSResources or Literals).
PHP | findPredicates(unknown $subject, unknown $object) |
---|
Arguments
PHP | array findStatement(unknown $s, unknown $p, unknown $o) |
---|
Returns the first statements of this model matching the parameters.
Arguments
Return
of RDFSInstance objects.
PHP | array findStatements(unknown $s, unknown $p, unknown $o, integer $start, integer $count, integer $erg) |
---|
Returns the statements of this model matching the parameters.
Arguments
Return results starting with this row number.
Maximum number of records to return.
Variable passed by reference which will be set to the overall number of records.
Return
Array of RDFSInstance objects.
PHP | rdfsclass 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.
PHP | array getList(resource $rest, unknown $class) |
---|
Returns RDF list members as an array
Arguments
The resource or resource URI representing the list.
Return
Array of list members.
PHP | string getLiteralId(literal $literal) |
---|
Returns a string representation of the literal.
Arguments
PHP | string getNodeId(node $node) |
---|
Returns a uniq string for a node, which can be used for indexing arrays of nodes.
Arguments
PHP | rdfsproperty 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.
PHP | rdfsinstance 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.
PHP | string 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
PHP | array listAnnotationProperties(boolean $includePredefined) |
---|
Returns array of all annotation properties in this model.
Arguments
Shall the predefined annotation properties be included?
Return
Array of all annotation properties in this model.
PHP | array listClassAnnotationProperties() |
---|
Returns an array of all distinct label languages for all classes in the model.
Return
All distinct label languages.
PHP | array listClasses() |
---|
Returns array of all named classes in this model.
Return
Array of RDFSCLass Objects
PHP | array listClassLabelLanguages() |
---|
Returns an array of all distinct label languages for all classes in the model.
Return
Array of all distinct label languages.
PHP | array listDatatypes() |
---|
Returns an array of all XML datatypes used in the model.
Return
Array of XML datatypes.
PHP | array listInstances(integer $start, integer $erg, integer $end) |
---|
Lists all instances of classes in the model.
Arguments
Return
Array of RDFSInstance instances of the model.
PHP | array listLanguages() |
---|
Returns an array of all languages used in conjunction with literals in the model.
Return
Array of language strings.
PHP | array listNamespaces() |
---|
Returns an array of all XML namespaces used in the model.
Return
Array of XML namespaces.
PHP | array listProperties() |
---|
Returns all properties (OWL_ObjectProperties and OWL_DatatypeProperties) of the model
Return
Array of RDFSProperty objects.
PHP | array listResources() |
---|
Returns an array of all resource URIs in the model.
Return
Array of resource URIs.
PHP | array 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.
PHP | array 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.
PHP | array 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.
PHP | array listTopClasses() |
---|
Returns array of all named classes not being sub-class of any other class in this model.
Return
Array of RDFSCLass Objects
PHP | array listTopProperties() |
---|
Returns array of all properties not being sub-properties of any other property in this model.
Return
Array of RDFSProperty objects.
PHP | listTypes(rdfsresource $type, rdfsclass $class, integer $start, integer $count, integer $erg) |
---|
Find helper function.
Arguments
PHP | log(unknown $statement, unknown $ar) |
---|
Helper function for logging statement add or removes.
Arguments
PHP | logAdd(unknown $statement) |
---|
Writes the adding of the given statement to the log.
Arguments
The statement whichs removel should be logged.
PHP | boolean 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.
PHP | logRemove(unknown $statement) |
---|
Writes the removal of the given statement to the log.
Arguments
The statement whichs removel should be logged.
PHP | logStart(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
PHP | object 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
PHP | rdqlQuery(unknown $queryString, boolean $returnNodes) |
---|
Arguments
PHP | remove(rdfsresource $subj, rdfsresource $pred, string $obj) |
---|
Removes a statement from the model
Arguments
Subject of the Statement
Predicate of the Statement
PHP | removeClass(string $uri) |
---|
Removes a class (including all references to this class) from the model.
Arguments
The URI of the class to remove.
PHP | removeInstance(string $uri) |
---|
Removes an instance (including all references to the instance) from the model.
Arguments
The URI of the instance to remove.
PHP | removeProperty(string $uri) |
---|
Removes a property (including all references to this property) from the model.
Arguments
The URI of the property to remove.
PHP | removeResource(string $resource) |
---|
Removes all references to a resource from the model.
Arguments
The URI of the resource to remove.
PHP | object search(string $search, array $where, string $compare, integer $start, integer $count) |
---|
Method to search for triples in the DbModel which match the search string $search according to a certain comparision. Example: $rs=$m->search('Animal',array('Subject','Object'),'contains'); Finds all triples where 'Animal' is contained in the subject or object.
Arguments
values
stating how matching should be performed (maybe on of 'exact', 'contains', 'starts', 'regex').
return triples starting from $start.
return $count triples.
Return
ADORecordSet
PHP | searchFullText(unknown $search, unknown $type, integer $start, unknown $count, integer $erg) |
---|
Arguments