Class DatasetMem

Description

In-memory implementation of a RDF dataset.

A RDF dataset set is a collection of named RDF graphs.



History:

  • access: public
  • author: Daniel Westphal (http://www.d-westphal.de)
  • author: Chris Bizer <chris@bizer.de>
  • version: V0.9

Located in /dataset/DatasetMem.php (line 22)

Dataset
   |
   --DatasetMem
Method Summary
DatasetMem DatasetMem ([string $datasetName = null])
void addAll (Dataset $otherDataset)
void addNamedGraph (NamedGraphMem &$graph)
void addQuad (Quad &$quad)
void clear ()
boolean containsNamedGraph (string $graphName)
boolean containsQuad (Resource $graphName, Resource $subject, Resource $predicate, Resource $object)
int countGraphs ()
int countQuads ()
NamedGraphMem &createGraph (string $graphName, [string $baseURI = null])
Iterator &findInDefaultGraph (Resource $subject, Resource $predicate, Resource $object)
Iterator &findInNamedGraphs (Resource $graph, Resourceor $subject, Resource $predicate, Resource $object)
string getDatasetName ()
NamedGraphMem &getNamedGraph (string $graphName)
boolean hasDefaultGraph ()
boolean isEmpty ()
Array listGraphNames ()
void removeNamedGraph (string $graphName)
void removeQuad (Quad $quad)
void setDatasetName (string $datasetName)
void setDefaultGraph (MemModel &$graph)
Methods
Constructor DatasetMem (line 57)

Constructor You can supply a Dataset name.

  • access: public
DatasetMem DatasetMem ([string $datasetName = null])
  • string $datasetName
addAll (line 237)

Add all named graphs of the other dataset to this dataset

void addAll (Dataset $otherDataset)
addNamedGraph (line 91)

Adds a NamedGraph to the set. Will replace a NamedGraph with the same name that is already in the set.

void addNamedGraph (NamedGraphMem &$graph)
addQuad (line 259)

Adds a quad to the Dataset. The argument must not contain any wildcards. If the quad is already present, nothing happens. A new named graph will automatically be created if necessary.

void addQuad (Quad &$quad)
clear (line 182)

Deletes all NamedGraphs from the set.

void clear ()
containsNamedGraph (line 140)

Tells wether the Dataset contains a NamedGraph.

boolean containsNamedGraph (string $graphName)
  • string $graphName
containsQuad (line 279)

Tells wether the Dataset contains a quad or quads matching a pattern.

boolean containsQuad (Resource $graphName, Resource $subject, Resource $predicate, Resource $object)
countGraphs (line 192)

Returns the number of NamedGraphs in the set. Empty graphs are counted.

int countGraphs ()
countQuads (line 325)

Counts the Quads in the RDF dataset. Identical Triples in different NamedGraphs are counted individually.

int countQuads ()
createGraph (line 173)

Creates a new NamedGraph and adds it to the set. An existing

graph with the same name will be replaced.The name of the NamedGraph to be created ; must be an URI

NamedGraphMem &createGraph (string $graphName, [string $baseURI = null])
  • string $graphName
  • string $baseURI
findInDefaultGraph (line 366)

Finds Statements that match a pattern in the default Graph. The argument may contain wildcards.

Iterator &findInDefaultGraph (Resource $subject, Resource $predicate, Resource $object)
findInNamedGraphs (line 344)

Finds Statements that match a quad pattern. The argument may contain wildcards.

Iterator &findInNamedGraphs (Resource $graph, Resourceor $subject, Resource $predicate, Resource $object)
getDatasetName (line 82)

Return the Dataset name.

  • access: public
string getDatasetName ()
getDefaultGraph (line 111)

Returns a reference to the defaultGraph

Model &getDefaultGraph ()
getNamedGraph (line 151)

Returns the NamedGraph with a specific name from the Dataset.

Changes to the graph will be reflected in the set.

  • return: or NULL
NamedGraphMem &getNamedGraph (string $graphName)
  • string $graphName
hasDefaultGraph (line 120)

Returns true, if an defaultGraph exists. False otherwise

boolean hasDefaultGraph ()
isEmpty (line 228)

Tells wether the set contains any NamedGraphs.

boolean isEmpty ()
listGraphNames (line 161)

Returns the names of the namedGraphs in this set as strings in an array.

Array listGraphNames ()
listNamedGraphs (line 219)

Returns an iterator over all NamedGraphs in the set.

IteratorAllGraphsMem &listNamedGraphs ()
removeNamedGraph (line 130)

Removes a NamedGraph from the set. Nothing happens if no graph with that name is contained in the set.

void removeNamedGraph (string $graphName)
  • string $graphName
removeQuad (line 302)

Deletes a Quad from the RDF dataset.

void removeQuad (Quad $quad)
setDatasetName (line 71)

Sets the Dataset name.

  • access: public
void setDatasetName (string $datasetName)
  • string $datasetName
setDefaultGraph (line 102)

Overwrites the existting default graph.

void setDefaultGraph (MemModel &$graph)

Inherited Methods

Inherited From Dataset

Dataset::loadFromFile()
Dataset::loadFromString()
Dataset::serializeToFile()
Dataset::serializeToString()

Documentation generated on Thu, 7 Jul 2005 13:41:14 +0200 by phpDocumentor 1.3.0RC3