Class DatasetMem

Description

In-memory implementation of a RDF dataset.

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

  • author: Daniel Westphal (http://www.d-westphal.de)
  • author: Chris Bizer <chris@bizer.de>
  • version: $Id: DatasetMem.html 443 2007-06-01 16:25:38Z cax $
  • access: public

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

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, [ $returnAsTriples = false])
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 56)

Constructor.

You can supply a Dataset name.

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

Adds 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 274)

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 188)

Deletes all NamedGraphs from the set.

void clear ()
containsNamedGraph (line 143)

Tells wether the Dataset contains a NamedGraph.

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

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

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

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

int countGraphs ()
countQuads (line 342)

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

int countQuads ()
createGraph (line 179)

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 389)

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 362)

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

Iterator &findInNamedGraphs (Resource $graph, Resourceor $subject, Resource $predicate, Resource $object, [ $returnAsTriples = false])
  • Resource $graph: or Null
  • Resourceor $subject: Null
  • Resource $predicate: or Null
  • Resource $object: or Null
  • $returnAsTriples
getDatasetName (line 81)

Returns the Datasets name.

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

Returns a reference to the defaultGraph

Model &getDefaultGraph ()
getNamedGraph (line 155)

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 121)

Returns true, if an defaultGraph exists. False otherwise .

boolean hasDefaultGraph ()
isEmpty (line 241)

Tells wether the set contains any NamedGraphs.

boolean isEmpty ()
listGraphNames (line 166)

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

Array listGraphNames ()
listNamedGraphs (line 229)

Returns an iterator over all NamedGraphs in the set.

IteratorAllGraphsMem &listNamedGraphs ()
removeNamedGraph (line 132)

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 318)

Deletes a Quad from the RDF dataset.

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

Sets the Datasets 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()
Dataset::sparqlQuery()

Documentation generated on Fri, 1 Jun 2007 16:48:42 +0200 by phpDocumentor 1.3.2