de.fuberlin.wiwiss.ng4j.impl
Class NamedGraphSetBase

java.lang.Object
  extended by de.fuberlin.wiwiss.ng4j.impl.NamedGraphSetIO
      extended by de.fuberlin.wiwiss.ng4j.impl.NamedGraphSetBase
All Implemented Interfaces:
NamedGraphSet
Direct Known Subclasses:
ARQNamedGraphSet

public abstract class NamedGraphSetBase
extends NamedGraphSetIO
implements NamedGraphSet

Author:
Richard Cyganiak (richard@cyganiak.de)

Constructor Summary
NamedGraphSetBase()
           
 
Method Summary
 void addQuad(Quad quad)
          Adds a quad to the NamedGraphSet.
 boolean containsQuad(Quad pattern)
          Tells wether the NamedGraphSet contains a quad or quads matching a pattern.
 int countQuads()
          Counts the Quads in the NamedGraphSet.
 Iterator findQuads(Node graphName, Node subject, Node predicate, Node object)
          Finds Quads that match a pattern.
 Iterator findQuads(Quad pattern)
          Finds Quads that match a quad pattern.
 void removeQuad(Quad pattern)
          Deletes Quads from the NamedGraphSet.
 
Methods inherited from class de.fuberlin.wiwiss.ng4j.impl.NamedGraphSetIO
read, read, read, write, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface de.fuberlin.wiwiss.ng4j.NamedGraphSet
addGraph, asJenaGraph, asJenaModel, clear, close, containsGraph, containsGraph, countGraphs, createGraph, createGraph, getGraph, getGraph, isEmpty, listGraphs, read, read, read, removeGraph, removeGraph, write, write
 

Constructor Detail

NamedGraphSetBase

public NamedGraphSetBase()
Method Detail

addQuad

public void addQuad(Quad quad)
Description copied from interface: NamedGraphSet
Adds a quad to the NamedGraphSet. 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.

Specified by:
addQuad in interface NamedGraphSet
Parameters:
quad - A quad to be added to the NamedGraphSet

containsQuad

public boolean containsQuad(Quad pattern)
Description copied from interface: NamedGraphSet
Tells wether the NamedGraphSet contains a quad or quads matching a pattern. Quad patterns are Quad instances with Node.ANY in one or more positions.

Specified by:
containsQuad in interface NamedGraphSet
Parameters:
pattern - A quad or quad pattern
Returns:
True if The NamedGraphSet contains matching quads, false otherwise

countQuads

public int countQuads()
Description copied from interface: NamedGraphSet
Counts the Quads in the NamedGraphSet. Identical Triples in different NamedGraphs are counted individually.

Specified by:
countQuads in interface NamedGraphSet
Returns:
The number of Quads in the set

findQuads

public Iterator findQuads(Node graphName,
                          Node subject,
                          Node predicate,
                          Node object)
Description copied from interface: NamedGraphSet
Finds Quads that match a pattern. All arguments may be Node.ANY to match everything in that position.

Specified by:
findQuads in interface NamedGraphSet
Parameters:
graphName - The graph to find triples from
subject - The subject to be matched
predicate - The predicate to be matched
object - The object to be matched
Returns:
An iterator over all Quads that match the pattern

findQuads

public Iterator findQuads(Quad pattern)
Description copied from interface: NamedGraphSet
Finds Quads that match a quad pattern. The argument may contain wildcards (Node.ANY).

Specified by:
findQuads in interface NamedGraphSet
Parameters:
pattern - A quad or quad pattern
Returns:
An iterator over all Quads that match the pattern

removeQuad

public void removeQuad(Quad pattern)
Description copied from interface: NamedGraphSet
Deletes Quads from the NamedGraphSet. The argument may contain wildcards (Node.ANY). All matching Quads will be deleted. If no Quads match, nothing happens. This operation will not delete any NamedGraphs from the set. Empty NamedGraphs will be retained.

Specified by:
removeQuad in interface NamedGraphSet
Parameters:
pattern - A quad or quad pattern to be deleted