A ResModel provides an resource centric view on an underlying RDF model.
ResModels show information not as statements but as resources with properties, similar to Jena models. ResModels may create Resources [URI nodes and bnodes]. Creating a Resource does not make the Resource visible to the model; Resources are only "in" Models if Statements about them are added to the Model. Similarly the only way to "remove" a Resource from a Model is to remove all the Statements that mention it.
When a Resource or Literal is created by a Model, the Model is free to re-use an existing Resource or Literal object with the correct values, or it may create a fresh one.
Located in /resModel/ResModel.php (line 26)
Class | Description |
---|---|
OntModel | Enhanced view of the model that is known to contain ontology data, under a |
Constructor You have to supply a memmodel/dbmodel/infmodel to save the statements.
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()) Expects a statements with ResResources(ResLiterals)
Adds another model to this MemModel.
Duplicate statements are not removed. If you don't want duplicates, use unite(). 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.
Adds a namespace and prefix to the model.
Adds the namespaces to the model. This method is called by the parser. !!!! addParsedNamespaces() not overwrites manual added namespaces in the model !!!!
Checks if a new statement is already in the Model and adds the statement, if it is not in the Model.
addWithoutDuplicates() is significantly slower then add(). Retruns TRUE if the statement is added. FALSE otherwise. Expects a statements with ResResources(ResLiterals)
Tests if the Model contains the given statement.
TRUE if the statement belongs to the model; FALSE otherwise. Expects a statement of ResResources(ResLiterals)
Determine if all of the statements in a model are also contained in this model.
True if all of the statements in $model are also contained in this model and false otherwise.
Determine if any of the statements in a model are also contained in this model.
True if any of the statements in $model are also contained in this model and false otherwise.
Determine if the node (ResResource / ResLiteral) $node appears in any statement of this model.
Create a new RDF Container from type rdf:Alt This method may return an existing container with the correct URI and model, or it may construct a fresh one, as it sees fit.
Subsequent operations on the returned Container may modify this model.
Create a new RDF Container from type rdf:Bag This method may return an existing container with the correct URI and model, or it may construct a fresh one, as it sees fit.
Subsequent operations on the returned Container may modify this model.
Create a new RDF Collection from type rdf:List This method may return an existing container with the correct URI and model, or it may construct a fresh one, as it sees fit.
Subsequent operations on the returned Container may modify this model.
Create an untyped literal from a String value with a specified language.
If you want to type this literal, you have to set a datatype before adding it to the model.
Create a new Property associated with this model.
This method may return an existing property with the correct URI and model, or it may construct a fresh one, as it sees fit.
Subsequent operations on the returned property may modify this model.
Create a new resource associated with this model.
If the uri string isn't set, this creates a bnode. Otherwise it creates a URI node. A URI resource is .equals() to any other URI Resource with the same URI (even in a different model - be warned).
This method may return an existing Resource with the correct URI and model, or it may construct a fresh one, as it sees fit.
Operations on the result Resource may change this model.
Create a new RDF Container from type rdf:Seq This method may return an existing container with the correct URI and model, or it may construct a fresh one, as it sees fit.
Subsequent operations on the returned Container may modify this model.
Create a literal from a String value with the $dtype Datatype An existing literal of the right value may be returned, or a fresh one created.
Checks 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.
General method to search for triples.
NULL input for any parameter will match anything. Example: $result = $m->find( NULL, NULL, $node ); Finds all Statements with $node as object. Returns an array of statements with ResResources.
Searches for triples and returns the first matching statement.
NULL input for any parameter will match anything. Example: $result = $m->findFirstMatchingStatement( NULL, NULL, $node ); Returns the first statement with ResResources of the Model where the object equals $node. Returns an NULL if nothing is found. You can define an offset to search.
Returns a reference to the underlying model (Mem/DB/InfModel) that contains the statements
Answer a statement find(s, p, null) with ResResources(ResLiterals) from this model.
If none exist, return null; if several exist, pick one arbitrarily.
Returns a new model containing all the statements which are in both this model and another.
Returns a ResIterator with all objects in a model.
Returns a ResIterator with all objects with a given property and property value.
Returns a ResIterator with all subjects in a model.
Returns a ResIterator with all subjects with a given property and property value.
Load a model from a file containing RDF, N3 or N-Triples.
This function recognizes the suffix of the filename (.n3 or .rdf) and calls a suitable parser, if no $type is given as string ("rdf" "n3" "nt"); If the model is not empty, the contents of the file is added to this DbModel.
Perform an RDQL query on this MemModel.
This method returns an associative array of variable bindings. The values of the query variables can either be RAP's objects (instances of Node) if $returnNodes set to TRUE, or their string serialization.
Perform an RDQL query on this MemModel.
This method returns an RdqlResultIterator of variable bindings. The values of the query variables can either be RAP's objects (instances of Node) if $returnNodes set to TRUE, or their string serialization.
Removes the statement of ResResources(ResTriples) from the MemModel.
TRUE if the statement is removed. FALSE otherwise.
removes a single namespace from the model
Saves the RDF,N3 or N-Triple serialization of the MemModel 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 MemModel couldn't be saved to the file.
Set a base URI for the MemModel.
Affects creating of new resources and serialization syntax. If the URI doesn't end with # : or /, then a # is added to the URI.
Returns a new model that is the subtraction of another model from this model.
Returns a new Model that is the set-union of the model with another model.
Duplicate statements are removed. If you want to allow duplicates, use addModel() which is much faster.
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 !!!!!!!!!!!)
Writes the RDF serialization of the MemModel as HTML table.
Writes the RDF serialization of the MemModel as HTML table.
Documentation generated on Fri, 1 Jun 2007 16:51:35 +0200 by phpDocumentor 1.3.2