Class DefaultRDFSModel

(line 10)

Description

DbModel
   |
   --DefaultRDFSModel

Located in File: /rdfsapi/model.php

DefaultRDFSModel


Classes extended from DefaultRDFSModel:
DbRDFSModel
RDFSmodel
RDFSmodel

Class Variables

Summary:
mixed $asResource
mixed $importsIds
mixed $importsSQL
mixed $logActions
mixed $resource

$asResource (line 15)

Data type : mixed

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

$importsIds = array() (line 18)

Data type : mixed

$importsSQL (line 17)

Data type : mixed

$logActions = array() (line 16)

Data type : mixed

$resource = 'RDFSResource' (line 19)

Data type : mixed

Class Constants

Summary:

Method Detail

Summary:
RDFSmodel DefaultRDFSModel (RDFSStore $store, string $modelURI, [ $type = NULL])
void add (RDFSResource $subj, [RDFSResource $pred = ''], [RDFSNode $obj = ''], int $actionId)
RDFSClass addClass (string $uri)
RDFSInstance addInstance (string $uri, string $class)
void addList ( $symbols, [ $literals = true], array $members)
RDFSProperty addProperty (string $uri)
RDFSClass classF (string $uri, [ $expandNS = true])
int countClasses ([boolean $includeImports = true])
int countInstances ([boolean $includeImports = true])
int countProperties ([boolean $includeImports = true])
int countTriples ([boolean $includeImports = true])
MemModel. find (RDFSResource_or_NULL $s, RDFSResource_or_NULL $p, RDFSResource_or_NULL $o, [int $start = 0], [int $count = 0], [int $erg = 0])
void findInstances ([ $properties = array()], [ $compare = 'exact'], [ $start = 0], [ $count = 0], [ $erg = 0])
Nodel findNode (RDFSResource_or_NULL $subject, RDFSResource_or_NULL $predicate, RDFSResource_or_NULL $object, [string $class = NULL])
array findNodes (RDFSResource_or_NULL $subject, RDFSResource_or_NULL $predicate, RDFSResource_or_NULL $object, [string $class = NULL], [int $start = 0], [int $count = 0], [int $erg = 0])
void findObjects ( $predicate, [ $class = 'Resource'], [ $start = 0], [ $count = 0], [ $erg = 0])
void findPredicates ([ $subject = NULL], [ $object = NULL])
Array findStatement (RDFSResource_or_NULL $s, RDFSResource_or_NULL $p, RDFSResource_or_NULL $o)
array findStatements (RDFSResource_or_NULL $s, RDFSResource_or_NULL $p, RDFSResource_or_NULL $o, [int $start = 0], [int $count = 0], [int $erg = 0])
void findSubjects ( $predicate, [ $class = 'Resource'], [ $start = 0], [ $count = 0], [ $erg = 0])
RDFSClass_or_false getClass (string $uri)
void getInstance ( $uri)
array getList (Resource $rest, [ $class = NULL])
string getLiteralId (Literal $literal)
void getModelIds ()
string getNodeId (node $node)
array getOneOf (RDFResource $oneOf)
RDFSProperty_or_false getProperty (string $uri)
RDFSInstance_or_false getResource ($uri $uri)
string getType ()
RDFSInstance instanceF (string $uri, [ $expandNS = true])
array listAnnotationProperties ([boolean $includePredefined = false])
array listClasses ()
array listDatatypes ()
array listImports ()
array listInstances ([ $start = 0], [ $erg = 0], [ $end = 0])
array listLanguages ()
void listLists ()
void listModelIds ()
array listNamespaces ()
array listProperties ()
array listResources ()
array listResourcesObject ([ $search = ''], [ $start = 0], [ $count = 0], [ $erg = 0])
array listResourcesPredicate ([ $search = ''], [ $start = 0], [ $count = 0], [ $erg = 0])
array listResourcesSubject ([ $search = ''], [ $start = 0], [ $count = 0], [ $erg = 0])
array listTopClasses ()
void listTypes ([RDFSResource $type = NULL], [RDFSClass $class = NULL], [int $start = 0], [int $count = 0], [int $erg = 0])
void logAdd ($statement $statement)
boolean logEnabled ()
void logEnd ()
void logRemove ($statement $statement)
void logStart ($action $action, [string $subject = ''], [string $details = ''])
RDFSProperty propertyF (string $uri, [ $expandNS = true])
object ADORecordSet query (object Resource $subject, object Resource $predicate, object Node $object, [ $start = 0], [ $count = ''])
void rdqlQuery ( $queryString, [ $returnNodes = TRUE])
void remove (RDFSResource $subj, [RDFSResource $pred = ''], [RDFSResource_or_Literal $obj = ''])
void removeClass (string $uri)
void removeInstance (string $uri)
void removeProperty (string $uri)
void removeResource (string $resource)
void renameNamespace ( $fromNS,  $toNS)
RDFSResource resourceF (string $uri, [ $expandNS = true])
object ADORecordSet search (string $search, array $where, string $compare, [int $start = 0], [int $count = 0])
void searchFullText (mixed $search, [string $type = NULL], [integer $start = 0], [integer $count = 10000], [integer $erg = 0])
void setType ( $type)
void _convertRowToStatement ( $row)
void _dbIds ( $resources)
Array _findInstances ( $types, [array $properties = array()], [string $compare = 'exact'], [int $start = 0], [int $count = 0], [int $erg = 0])

Constructor DefaultRDFSModel (line 28)

RDFSmodel DefaultRDFSModel( RDFSStore $store, string $modelURI, [ $type = NULL])

Class constructor.

Parameters

  • RDFSStore $store:
  • string $modelURI:
  • $type:

Info

Method add (line 192)

void add( RDFSResource $subj, [RDFSResource $pred = ''], [RDFSNode $obj = ''], int $actionId)

Adds a statement to the model

Parameters

  • RDFSResource $subj: Subject of the Statement
  • RDFSResource $pred: Predicate of the Statement
  • RDFSNode $obj: Object of the Statement
  • int $actionId: Id of log entry this statement belongs to

Info

Method addAnonymousClass (line 449)

RDFSClass addAnonymousClass( )

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

Info

  • return - The class created.

Method addClass (line 439)

RDFSClass addClass( string $uri)

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

Parameters

  • string $uri:

Info

  • return - The class created.

Method addInstance (line 504)

RDFSInstance addInstance( string $uri, string $class)

Creates a new RDFSInstance

Parameters

  • string $uri:
  • string $class:

Info

  • return - The instance created.

Method addList (line 819)

void addList( $symbols, [ $literals = true], array $members)

Adds an RDF list to the model

Parameters

  • array $members: Array of list members to be added.
  • $symbols:
  • $literals:

Info

Method addProperty (line 476)

RDFSProperty addProperty( string $uri)

Creates a new RDFSProperty

Parameters

  • string $uri:

Info

  • return - The property created.

Method classF (line 59)

RDFSClass classF( string $uri, [ $expandNS = true])

Class factory.

Parameters

  • string $uri: URI or localname of the class to generate
  • $expandNS:

Info

Method countClasses (line 908)

int countClasses( [boolean $includeImports = true])

Overridden in child classes as:

Returns the number of classes in this model.

Parameters

  • boolean $includeImports: Count classes in imported models as well.

Info

  • return - Number of classes in this model.

Method countInstances (line 917)

int countInstances( [boolean $includeImports = true])

Returns the number of instances in this model.

Parameters

  • boolean $includeImports: Count instances in imported models as well.

Info

  • return - Number of instances in this model.

Method countProperties (line 938)

int countProperties( [boolean $includeImports = true])

Overridden in child classes as:

Returns the number of properties in this model.

Parameters

  • boolean $includeImports: Count properties in imported models as well.

Info

  • return - Number of properties in this model.

Method countTriples (line 947)

int countTriples( [boolean $includeImports = true])

Returns the number of triples/statements in this model.

Parameters

  • boolean $includeImports: Count triples in imported models as well.

Info

  • return - Number of triples in this model.

Method find (line 630)

MemModel. find( RDFSResource_or_NULL $s, RDFSResource_or_NULL $p, RDFSResource_or_NULL $o, [int $start = 0], [int $count = 0], [int $erg = 0])

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.

Parameters

  • RDFSResource_or_NULL $s: Subject
  • RDFSResource_or_NULL $p: Predicate
  • RDFSResource_or_NULL $o: Object
  • int $start: Return results starting with this row number.
  • int $count: Maximum number of records to return.
  • int $erg: Variable passed by reference which will be set to the overall number of records.

Info

Method findInstances (line 809)

void findInstances( [ $properties = array()], [ $compare = 'exact'], [ $start = 0], [ $count = 0], [ $erg = 0])

Parameters

  • $properties:
  • $compare:
  • $start:
  • $count:
  • $erg:

Info

Method findNode (line 699)

Nodel findNode( RDFSResource_or_NULL $subject, RDFSResource_or_NULL $predicate, RDFSResource_or_NULL $object, [string $class = NULL])

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.

Parameters

  • RDFSResource_or_NULL $subject: Subject
  • RDFSResource_or_NULL $predicate: Predicate
  • RDFSResource_or_NULL $object: Object
  • string $class: PHPClass which the returned nodes should be instances of.

Info

Method findNodes (line 716)

array findNodes( RDFSResource_or_NULL $subject, RDFSResource_or_NULL $predicate, RDFSResource_or_NULL $object, [string $class = NULL], [int $start = 0], [int $count = 0], [int $erg = 0])

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.

Parameters

  • RDFSResource_or_NULL $subject: Subject
  • RDFSResource_or_NULL $predicate: Predicate
  • RDFSResource_or_NULL $object: Object
  • string $class: PHPClass which the returned nodes should be instances of.
  • int $start: Return results starting with this row number.
  • int $count: Maximum number of records to return.
  • int $erg: Variable passed by reference which will be set to the overall number of records.

Info

  • return - Array of nodes (RDFSResources or Literals).

Method findObjects (line 677)

void findObjects( $predicate, [ $class = 'Resource'], [ $start = 0], [ $count = 0], [ $erg = 0])

Parameters

  • $predicate:
  • $class:
  • $start:
  • $count:
  • $erg:

Info

Method findPredicates (line 683)

void findPredicates( [ $subject = NULL], [ $object = NULL])

Parameters

  • $subject:
  • $object:

Info

Method findStatement (line 651)

Array findStatement( RDFSResource_or_NULL $s, RDFSResource_or_NULL $p, RDFSResource_or_NULL $o)

Returns the first statements of this model matching the parameters.

Parameters

  • RDFSResource_or_NULL $s: Subject
  • RDFSResource_or_NULL $p: Predicate
  • RDFSResource_or_NULL $o: Object

Info

  • return - of RDFSInstance objects.

Method findStatements (line 667)

array findStatements( RDFSResource_or_NULL $s, RDFSResource_or_NULL $p, RDFSResource_or_NULL $o, [int $start = 0], [int $count = 0], [int $erg = 0])

Returns the statements of this model matching the parameters.

Parameters

  • RDFSResource_or_NULL $s: Subject
  • RDFSResource_or_NULL $p: Predicate
  • RDFSResource_or_NULL $o: Object
  • int $start: Return results starting with this row number.
  • int $count: Maximum number of records to return.
  • int $erg: Variable passed by reference which will be set to the overall number of records.

Info

  • return - Array of RDFSInstance objects.

Method findSubjects (line 671)

void findSubjects( $predicate, [ $class = 'Resource'], [ $start = 0], [ $count = 0], [ $erg = 0])

Parameters

  • $predicate:
  • $class:
  • $start:
  • $count:
  • $erg:

Info

Method getClass (line 460)

RDFSClass_or_false getClass( string $uri)

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

Parameters

  • string $uri:

Info

  • return - The class or false if the class does not exist.

Method getInstance (line 520)

void getInstance( $uri)

Overridden in child classes as:

Parameters

  • $uri:

Info

Method getList (line 854)

array getList( Resource $rest, [ $class = NULL])

Returns RDF list members as an array

Parameters

  • Resource $rest: The resource or resource URI representing the list.
  • $class:

Info

  • return - Array of list members.

Method getLiteralId (line 141)

string getLiteralId( Literal $literal)

Returns a string representation of the literal.

Parameters

  • Literal $literal:

Info

Method getModelIds (line 107)

void getModelIds( )

Info

Method getNodeId (line 150)

string getNodeId( node $node)

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

Parameters

  • node $node:

Info

Method getOneOf (line 844)

array getOneOf( RDFResource $oneOf)

TODO: Beschreibung und return

Parameters

  • RDFResource $oneOf:

Info

Method getParsedNamespaces (line 80)

void getParsedNamespaces( )

Info

Method getProperty (line 487)

RDFSProperty_or_false getProperty( string $uri)

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

Parameters

  • string $uri:

Info

  • return - The property or false if the class does not exist.

Method getResource (line 514)

RDFSInstance_or_false getResource( $uri $uri)

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

Parameters

  • $uri $uri:

Info

  • return - The instance or false if the class does not exist.

Method getType (line 238)

string getType( )

Returns the model type

Info

  • return - RDF/RDFS/OWL

Method instanceF (line 77)

RDFSInstance instanceF( string $uri, [ $expandNS = true])

Instance factory.

Parameters

  • string $uri: URI or localname of the instance to generate
  • $expandNS:

Info

Method listAnnotationProperties (line 586)

array listAnnotationProperties( [boolean $includePredefined = false])

Returns array of all annotation properties in this model.

Parameters

  • boolean $includePredefined: Indicates whether predefined annotation properties should be included.

Info

  • return - Array of all annotation properties in this model.

Method listClassAnnotationProperties (line 600)

array listClassAnnotationProperties( )

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

Info

  • return - All distinct label languages.

Method listClasses (line 392)

array listClasses( )

Returns array of all named classes in this model.

Info

  • return - Array of RDFSCLass Objects

Method listClassLabelLanguages (line 420)

array listClassLabelLanguages( )

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

Info

  • return - Array of all distinct label languages.

Method listDatatypes (line 302)

array listDatatypes( )

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

Info

  • return - Array of XML datatypes.

Method listImports (line 101)

array listImports( )

Returns a list of models imported by owl:imports.

Info

  • return - Array of RDFResources

Method listInstances (line 532)

array listInstances( [ $start = 0], [ $erg = 0], [ $end = 0])

Lists all instances of classes in the model.

Parameters

  • $start:
  • $erg:
  • $end:

Info

  • return - Array of RDFSInstance instances of the model.

Method listLanguages (line 313)

array listLanguages( )

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

Info

  • return - Array of language strings.

Method listLists (line 1451)

void listLists( )

List all rdf:lists in the model

Info

Method listModelIds (line 104)

void listModelIds( )

Info

Method listNamespaces (line 285)

array listNamespaces( )

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

Info

  • return - Array of XML namespaces.

Method listProperties (line 551)

array listProperties( )

Returns all properties (OWL_ObjectProperties and OWL_DatatypeProperties) of the model

Info

  • return - Array of RDFSProperty objects.

Method listResources (line 324)

array listResources( )

Returns an array of all resource URIs in the model.

Info

  • return - Array of resource URIs.

Method listResourcesObject (line 371)

array listResourcesObject( [ $search = ''], [ $start = 0], [ $count = 0], [ $erg = 0])

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

Parameters

  • $search:
  • $start:
  • $count:
  • $erg:

Info

  • return - Array of resource URIs.

Method listResourcesPredicate (line 363)

array listResourcesPredicate( [ $search = ''], [ $start = 0], [ $count = 0], [ $erg = 0])

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

Parameters

  • $search:
  • $start:
  • $count:
  • $erg:

Info

  • return - Array of resource URIs.

Method listResourcesSubject (line 355)

array listResourcesSubject( [ $search = ''], [ $start = 0], [ $count = 0], [ $erg = 0])

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

Parameters

  • $search:
  • $start:
  • $count:
  • $erg:

Info

  • return - Array of resource URIs.

Method listTopClasses (line 403)

array listTopClasses( )

Overridden in child classes as:

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

Info

  • return - Array of RDFSCLass Objects

Method listTopProperties (line 567)

array listTopProperties( )

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

Info

  • return - Array of RDFSProperty objects.

Method listTypes (line 384)

void listTypes( [RDFSResource $type = NULL], [RDFSClass $class = NULL], [int $start = 0], [int $count = 0], [int $erg = 0])

Find helper function.

Parameters

Info

Method logAdd (line 1373)

void logAdd( $statement $statement)

Writes the adding of the given statement to the log.

Parameters

  • $statement $statement: The statement whichs removel should be logged.

Info

Method logEnabled (line 1423)

boolean logEnabled( )

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

Info

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

Method logEnd (line 1361)

void logEnd( )

Finishes the last logging action.

Info

Method logRemove (line 1382)

void logRemove( $statement $statement)

Writes the removal of the given statement to the log.

Parameters

  • $statement $statement: The statement whichs removel should be logged.

Info

Method logStart (line 1343)

void logStart( $action $action, [string $subject = ''], [string $details = ''])

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.

Parameters

  • string $subject:
  • string $details:
  • $action $action:

Info

Method propertyF (line 68)

RDFSProperty propertyF( string $uri, [ $expandNS = true])

Property factory.

Parameters

  • string $uri: URI or localname of the property to generate
  • $expandNS:

Info

Method query (line 965)

object ADORecordSet query( object Resource $subject, object Resource $predicate, object Node $object, [ $start = 0], [ $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.

Parameters

  • object Resource $subject:
  • object Resource $predicate:
  • object Node $object:
  • $start:
  • $count:

Info

  • access - public
  • throws - PhpError
  • throws - SqlError

Method rdqlQuery (line 993)

void rdqlQuery( $queryString, [ $returnNodes = TRUE])

Parameters

  • $queryString:
  • $returnNodes:

Info

Method remove (line 214)

void remove( RDFSResource $subj, [RDFSResource $pred = ''], [RDFSResource_or_Literal $obj = ''])

Removes a statement from the model

Parameters

  • RDFSResource $subj: Subject of the Statement
  • RDFSResource $pred: Predicate of the Statement
  • RDFSResource_or_Literal $obj: Object of the Statement

Info

Method removeClass (line 1038)

void removeClass( string $uri)

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

Parameters

  • string $uri: The URI of the class to remove.

Info

Method removeDuplicateStatements (line 1431)

void removeDuplicateStatements( )

Info

Method removeInstance (line 1066)

void removeInstance( string $uri)

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

Parameters

  • string $uri: The URI of the instance to remove.

Info

Method removeProperty (line 1052)

void removeProperty( string $uri)

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

Parameters

  • string $uri: The URI of the property to remove.

Info

Method removeResource (line 1027)

void removeResource( string $resource)

Removes all references to a resource from the model.

Parameters

  • string $resource: The URI of the resource to remove.

Info

Method renameNamespace (line 1426)

void renameNamespace( $fromNS, $toNS)

Parameters

  • $fromNS:
  • $toNS:

Info

Method resourceF (line 50)

RDFSResource resourceF( string $uri, [ $expandNS = true])

Resource factory.

Parameters

  • string $uri: URI or localname of the resource to generate
  • $expandNS:

Info

Method search (line 1091)

object ADORecordSet search( string $search, array $where, string $compare, [int $start = 0], [int $count = 0])

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.

Parameters

  • string $search:
  • array $where: values
  • string $compare: stating how matching should be performed (maybe on of 'exact', 'contains', 'starts', 'regex').
  • int $start: return triples starting from $start.
  • int $count: return $count triples.

Info

  • access - public
  • throws - PhpError
  • throws - SqlError

Method searchFullText (line 1255)

void searchFullText( mixed $search, [string $type = NULL], [integer $start = 0], [integer $count = 10000], [integer $erg = 0])

Full-text search on the model.

Parameters

  • mixed $search: Search string.
  • string $type: Objects to search for, i.e. Classes, Instances, Properties.
  • integer $start: Return resuls from $start.
  • integer $count: Return $count results.
  • integer $erg: Number of overall matching records will be written to $erg.

Info

Method setType (line 274)

void setType( $type)

Parameters

  • $type:

Info

Method _convertRowToStatement (line 1203)

void _convertRowToStatement( $row)

Parameters

  • $row:

Info

Method _dbIds (line 1239)

void _dbIds( $resources)

Parameters

  • $resources:

Info

Method _findInstances (line 752)

Array _findInstances( $types, [array $properties = array()], [string $compare = 'exact'], [int $start = 0], [int $count = 0], [int $erg = 0])

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.

Parameters

  • array $properties: Array of PropertyURI=>Value pairs.
  • string $compare: Comparision method to be used - default is exact match.
  • int $start: Return results starting with this row number.
  • int $count: Maximum number of records to return.
  • int $erg: Variable passed by reference which will be set to the overall number of records.
  • $types:

Info

  • return - of RDFSInstance objects.

Inherited Variables

Inherited Class Variable Summary

Inherited Methods

Inherited Method Summary


Documentation generated on Tue, 07 Nov 2006 13:07:04 +0100 by phpDocumentor 1.3.0