Class: Model ---------------------------------------------------------------------------------- Abstract superclass of MemModel and DbModel. A model is a programming interface to an RDF graph. An RDF graph is a directed labeled graph, as described in http://www.w3.org/TR/rdf-mt/. It can be defined as a set of <S, P, O> triples, where P is a uriref, S is either a uriref or a blank node, and O is either a uriref, a blank node, or a literal. <BR><BR>History:<UL> <LI>12-06-2004 : Functions findForward() and getMemModelByRDQL() added. ( anton1@koestlbacher.de ) </LI> <LI>10-30-2004 : GRDDL-Support (see http://www.w3.org/TR/grddl/ ) added. ( tobias.gauss@web.de ) </LI> <LI>09-22-2004 : Function getUniqueResourceURI(): default bNode prefix is used, if no other is defined. Returns unique URIs, without checking the model first. <LI>09-07-2004 : Function load improved. ( auer@informatik.uni-leipzig.de )</LI> <LI>03-26-2004 : _addStatementFromAnotherModel() added : saveAs() moved to the child classes</LI> <LI>11-13-2003 : Function saveAs added <LI>07-27-2003 : This is an abstract parent class for MemModel and DbModel. The previous class Model has been renamed to MemModel
|
PHP | _addStatementFromAnotherModel(unknown $statement, unknown $blankNodes_tmp) |
---|
Adds a statement from another model to this model. If the statement to be added contains a blankNode with an identifier already existing in this model, a new blankNode is generated.
Arguments
PHP | object findForward(unknown $subject, unknown $predicate, unknown $object, unknown $newModel) |
---|
Searches for triples using find() and tracks forward blank nodes until the final objects in the retrieved subgraphs are all named resources. The method calls itself recursivly until the result is complete. NULL input for subject, predicate or object will match anything. Inputparameters are ignored for recursivly found statements. Returns a new MemModel or adds (without checking for duplicates) the found statements to a given MemModel. Returns an empty MemModel, if nothing is found. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! WARNING: This method can be slow with large models. NOTE: Blank nodes are not renamed, they keep the same nodeIDs as in the queried model! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Author | Anton Köstlbacher |
---|
Arguments
Return
MemModel
PHP | object getMemModelByRDQL(string $queryString, boolean $closure) |
---|
Perform an RDQL query on this Model. Should work with all types of models. This method returns a MemModel containing the result statements. If $closure is set to TRUE, the result will additionally contain statements found by the findForward-method for blank nodes. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! WARNING: If called with $closure = TRUE this method can be slow with large models. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Authors | Anton Köstlbacher, code snippets taken from the RAP Netapi by Phil Dawes and Chris Bizer |
---|
Arguments
Return
MemModel
PHP | object getOntModel(constant $vocabulary) |
---|
Returns an OntModel with this model as baseModel. $vocabulary has to be one of the following constants (currently only one is supported): RDFS_VOCABULARY to select a RDFS Vocabulary. You can supply a base URI
Arguments
Return
OntModel
PHP | string getUniqueResourceURI(string $prefix) |
---|
Internal method, that returns a resource URI that is unique for the Model. URIs are generated using the base_uri of the DbModel, the prefix and a unique number. If no prefix is defined, the bNode prefix, defined in constants.php, is used.
Arguments
PHP | load(string $filename, string $type, boolean $stream) |
---|
Load a model from a file containing RDF, N3, N-Triples or a xhtml document containing RDF. 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.
Arguments