RDF_Model_MDB (Constructor) [line 55]
RDF_Model_MDB RDF_Model_MDB(
object MDB
&$dbConnection, string
$modelURI, string
$modelID, [string
$baseURI = null])
|
|
Do not call this directly.
Use the method getModel,getNewModel or putModel of the Class Store_MDB instead.
Parameters:
add [line 115]
void add(
object Statement
&$statement)
|
|
Add a new triple to this Model_MDB.
Parameters:
addModel [line 721]
void addModel(
&$model, object Model
$model)
|
|
Add the given model to this Model_MDB.
This function monitors for SQL errors, and will commit if no errors have occured, otherwise it will rollback. If any statement of the model to be added to this model contains a blankNode with an identifier already existing in this model, a new blankNode is generated.
Parameters:
close [line 799]
contains [line 270]
boolean contains(
object Statement
&$statement)
|
|
Check if the Model_MDB contains the given statement
Parameters:
containsAll [line 292]
boolean containsAll(
object Model
&$model)
|
|
Determine if all of the statements in the given model are also contained in this Model_MDB.
Parameters:
containsAny [line 325]
boolean containsAny(
object Model
&$model)
|
|
Determine if any of the statements in the given model are also contained in this Model_MDB.
Parameters:
delete [line 776]
Remove this Model_MDB from database and clean up.
This function monitors for SQL errors, and will commit if no errors have occured, otherwise it will rollback.
equals [line 593]
boolean equals(
object model
&$that)
|
|
Check if two models are equal.
Two models are equal if and only if the two RDF graphs they represent are isomorphic.
Warning: This method doesn't work correct with models where the same blank node has different identifiers in the two models. We will correct this in a future version.
Parameters:
find [line 365]
object Model_Memory find(
object Resource
$subject, object Resource
$predicate, object Node
$object)
|
|
General method to search for triples in the Model_MDB.
null input for any parameter will match anything. Example: $result = $m->find( null, null, $node ); Finds all triples with $node as object.
Parameters:
findCount [line 499]
integer findCount(
object Resource
$subject, object Resource
$predicate, object Node
$object)
|
|
Search for triples and return the number of matches.
null input for any parameter will match anything.
Parameters:
findFirstMatchingStatement [line 458]
object Statement findFirstMatchingStatement(
object Resource
$subject, object Resource
$predicate, object Node
$object)
|
|
Search for triples and return the first matching statement.
null input for any parameter will match anything. Return an null if nothing is found.
Parameters:
findRegex [line 410]
object Model_Memory findRegex(
string
$subject_regex, string
$predicate_regex, string
$object_regex)
|
|
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. Return an empty Model_Memory if nothing is found. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! WARNING: Mhis method loads a Model_MDB into memory and performs the search on a Model_Memory, which can be slow with large models. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Parameters:
findVocabulary [line 429]
object Model_Memory findVocabulary(
string
$vocabulary)
|
|
Return 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# Return an empty model if nothing is found.
Parameters:
getMemModel [line 204]
object Model_Memory &getMemModel(
)
|
|
Create a Model_Memory containing all the triples of the current Model_MDB
getUniqueResourceURI [line 814]
string getUniqueResourceURI(
string
$prefix)
|
|
Internal method, that returns a resource URI that is unique for the Model_MDB.
URIs are generated using the base_uri of the Model_MDB, the prefix and a unique number.
Parameters:
intersect [line 694]
object Model_Memory &intersect(
&$model, object Model
$model)
|
|
Return a new Model_Memory containing all the statements which are in both this model and the given model.
Parameters:
isEmpty [line 101]
Check if this Model_MDB is empty
reify [line 762]
object Model_Memory &reify(
)
|
|
Reify the Model_MDB.
Return a new Model_Memory that contains the reifications of all statements of this Model_MDB.
remove [line 159]
void remove(
object Statement
&$statement)
|
|
Remove the given triple from this Model_MDB.
Parameters:
replace [line 534]
void replace(
object Resource
$subject, object Resource
$predicate, object Node
$object, object Node
$replacement)
|
|
General method to replace nodes of a Model_MDB.
null input for any parameter will match nothing. Example: $m->replace($resource, null, $node, $replacement); Replaces all $node objects beeing subject or object in any triple of the model with the $replacement node. Throw an error in case of a paramter mismatch.
Parameters:
saveAs [line 257]
boolean saveAs(
string
$filename, [string
$type = 'rdf'])
|
|
Saves the RDF,N3 or N-Triple serialization of the Model_MDB 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 Model_MDB couldn't be saved to the file.
Parameters:
setBaseURI [line 71]
void setBaseURI(
string
$uri)
|
|
Set a base URI for the Model_MDB.
Affects creating of new resources and serialization syntax.
Parameters:
size [line 87]
Return the number of statements in this Model_MDB
subtract [line 667]
object Model_Memory &subtract(
&$model, object Model
$model)
|
|
Return a new Model_Memory that is the subtraction of another model from this Model_MDB.
Parameters:
toString [line 180]
toStringIncludingTriples [line 192]
string toStringIncludingTriples(
)
|
|
Dump of the Model_MDB including all triples.
unite [line 640]
object Model_Memory &unite(
&$model, object Model
$model)
|
|
Return a new Model_Memory that is the set-union the model with another model.
The result of taking the set-union of two or more RDF graphs (i.e. sets of triples) is another graph, which we will call the merge of the graphs. Each of the original graphs is a subgraph of the merged graph. Notice that when forming a merged graph, two occurrences of a given uriref or literal as nodes in two different graphs become a single node in the union graph (since by definition they are the same uriref or literal) but blank nodes are not 'merged' in this way; and arcs are of course never merged. In particular, this means that every blank node in a merged graph can be identified as coming from one particular graph in the original set of graphs.
Notice that one does not, in general, obtain the merge of a set of graphs by concatenating their corresponding N-triples documents and constructing the graph described by the merged document, since if some of the documents use the same node identifiers, the merged document will describe a graph in which some of the blank nodes have been 'accidentally' merged. To merge Ntriples documents it is necessary to check if the same nodeID is used in two or more documents, and to replace it with a distinct nodeID in each of them, before merging the documents. (Not implemented yet !!!!!!!!!!!)
Parameters:
writeAsHtml [line 215]
Write the RDF serialization of the _Model_MDB as HTML.
writeAsHtmlTable [line 226]
Write the RDF serialization of the Model_MDB as HTML table.
writeRDFToString [line 238]
string writeRDFToString(
)
|
|
Write the RDF serialization of the Model_MDB to string
_checkBaseURI [line 846]
string _checkBaseURI(
string
$uri)
|
|
If the URI doesn't end with # : or /, then a # is added to the URI.
Used at setting the baseURI of this Model_MDB.
Parameters:
_containsRow [line 1008]
boolean _containsRow(
array
$row)
|
|
Check if this Model_MDB contains the given row from the row array fields[] of an MDB result
The array index corresponds to following table columns: [0] - subject, [1] - predicate, [2] - object, [3] - l_language, [4] - l_datatype, [5] - subject_is, [6] - object_is
Parameters:
_convertRecordSetToMemModel [line 887]
object Model_Memory _convertRecordSetToMemModel(
ressource
$result)
|
|
Convert an MDB result to a memory Model.
Every successful database query returns an MDB result !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!! This method can only be applied to a result with row arrays !!! 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 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Parameters:
_createDynSqlPart_SPO [line 950]
string _createDynSqlPart_SPO(
object Resource
$subject, object Resource
$predicate, object Node
$object)
|
|
Create the dynamic part of an sql statement selecting triples with the given parameters ($subject, $predicate, $object).
Parameters:
_getNodeFlag [line 866]
string _getNodeFlag(
object Node
$object)
|
|
*' Return the flag of the Node object.
r - Resource, b - BlankNode, l - Literal
Parameters:
_getRecordSet [line 989]
resource _getRecordSet(
&$model, object Model_MDB
$Model_MDB)
|
|
Get an MDB result with row arrays containing a representation of
the given Model_MDB stored in the 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 (This method operates on data from a Model_MDB without loading it into a memory model in order to save resources and improve speed).
Parameters:
_insertRow [line 1038]
void _insertRow(
array
$row)
|
|
Add the given row from the row array of an MDB result to this Model_MDB
The array index corresponds to following table columns: [0] - subject, [1] - predicate, [2] - object, [3] - l_language, [4] - l_datatype, [5] - subject_is, [6] - object_is
Parameters: