Class DatasetMem

Description

In-memory implementation of a RDF dataset.

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

  • access: public
  • author: Daniel Westphal (http://www.d-westphal.de)
  • author: Chris Bizer <chris@bizer.de>
  • version: $Id: DatasetMem.html,v 1.10 2006/06/26 12:34:19 tgauss Exp $

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

Dataset
   |
   --DatasetMem
Variable Summary
resource $defaultGraph
array $graphs
string $setName
Method Summary
DatasetMem DatasetMem ([mixed $datasetName = null])
void addAll (mixed $otherDataset)
void addNamedGraph (mixed &$graph)
void addQuad (mixed &$quad)
void clear ()
boolean containsNamedGraph (mixed $graphName)
boolean containsQuad (Resource $graphName, Resource $subject, Resource $predicate, Resource $object)
int countGraphs ()
int countQuads ()
NamedGraphMem &createGraph (mixed $graphName, [mixed $baseURI = null])
Iterator &findInDefaultGraph (mixed $subject, mixed $predicate, mixed $object)
Iterator &findInNamedGraphs (mixed $graph, mixed $subject, mixed $predicate, mixed $object, [ $returnAsTriples = false])
string getDatasetName ()
NamedGraphMem &getNamedGraph (mixed $graphName)
boolean hasDefaultGraph ()
boolean isEmpty ()
Array listGraphNames ()
void removeNamedGraph (mixed $graphName)
void removeQuad (mixed $quad)
void setDatasetName (mixed $datasetName)
void setDefaultGraph (mixed &$graph)
Variables
resource $defaultGraph (line 27)

Reference to a Memmodel that holds the default graph.

  • var: Memmodel
  • access: private
array $graphs = array() (line 44)

List of all NamedGraphs.

  • access: private
string $setName (line 36)

Name of the DatasetMem.

  • access: private
Methods
Constructor DatasetMem (line 53)

Constructor.

You can supply a Dataset name.

  • access: public
DatasetMem DatasetMem ([mixed $datasetName = null])
addAll (line 245)

Adds all named graphs of the other dataset to this dataset.

void addAll (mixed $otherDataset)
addNamedGraph (line 88)

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

void addNamedGraph (mixed &$graph)
addQuad (line 268)

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 (mixed &$quad)
clear (line 185)

Deletes all NamedGraphs from the set.

void clear ()
containsNamedGraph (line 140)

Tells wether the Dataset contains a NamedGraph.

boolean containsNamedGraph (mixed $graphName)
containsQuad (line 288)

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

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

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

int countGraphs ()
countQuads (line 336)

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

int countQuads ()
createGraph (line 176)

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 (mixed $graphName, [mixed $baseURI = null])
findInDefaultGraph (line 381)

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

Iterator &findInDefaultGraph (mixed $subject, mixed $predicate, mixed $object)
findInNamedGraphs (line 356)

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

Iterator &findInNamedGraphs (mixed $graph, mixed $subject, mixed $predicate, mixed $object, [ $returnAsTriples = false])
  • $returnAsTriples
getDatasetName (line 78)

Returns the Datasets name.

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

Returns a reference to the defaultGraph

Model &getDefaultGraph ()
getGraphWithOffset (line 209)

Returns the NamedGraph with a specific offset in the dataset.

Changes to the graph will be reflected in the set.

  • return: or null
  • access: private
NamedGraphMem &getGraphWithOffset (mixed $offset)
getNamedGraph (line 152)

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 (mixed $graphName)
hasDefaultGraph (line 118)

Returns true, if an defaultGraph exists. False otherwise .

boolean hasDefaultGraph ()
isEmpty (line 235)

Tells wether the set contains any NamedGraphs.

boolean isEmpty ()
listGraphNames (line 163)

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

Array listGraphNames ()
listNamedGraphs (line 225)

Returns an iterator over all NamedGraphs in the set.

IteratorAllGraphsMem &listNamedGraphs ()
removeNamedGraph (line 129)

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

void removeNamedGraph (mixed $graphName)
removeQuad (line 312)

Deletes a Quad from the RDF dataset.

void removeQuad (mixed $quad)
setDatasetName (line 67)

Sets the Datasets name.

  • access: public
void setDatasetName (mixed $datasetName)
setDefaultGraph (line 99)

Overwrites the existting default graph.

void setDefaultGraph (mixed &$graph)

Inherited Methods

Inherited From Dataset

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

Documentation generated on Mon, 26 Jun 2006 14:25:21 +0200 by phpDocumentor 1.3.0RC6