org.nsdl.mptstore.query.component
Class GraphPattern

java.lang.Object
  extended by org.nsdl.mptstore.query.component.GraphPattern
All Implemented Interfaces:
QueryElement

public class GraphPattern
extends java.lang.Object
implements QueryElement

A set of concrete triple patterns and value constraints defining an RDF subgraph.

Triple patterns and filters (NodeFilter constraints on triple value ranges) are as necessary to build a graph pattern

Author:
birkland

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.nsdl.mptstore.query.component.QueryElement
QueryElement.Type
 
Constructor Summary
GraphPattern()
           
 
Method Summary
 void addFilter(NodeFilter<Node> filter)
          Add the given node filter to the list of filters.
 void addTriplePattern(TriplePattern s)
          Add a triple pattern to the list of patterns.
 java.util.List<NodeFilter<Node>> getFilters()
          Get the list of filters.
 java.util.List<TriplePattern> getTriplePatterns()
          Get the list of patterns.
 QueryElement.Type getType()
          Get the type of this element.
 void remove(TriplePattern s)
          Remove the given triple pattern from the list of patterns.
 void removeFilter(java.lang.String filter)
          Remove the given node filter from the list of filters.
 java.lang.String toString()
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

GraphPattern

public GraphPattern()
Method Detail

getType

public QueryElement.Type getType()
Get the type of this element.

Specified by:
getType in interface QueryElement
Returns:
the type.

getTriplePatterns

public java.util.List<TriplePattern> getTriplePatterns()
Get the list of patterns.

Returns:
the triple patterns.

getFilters

public java.util.List<NodeFilter<Node>> getFilters()
Get the list of filters.

Returns:
the node filters.

addTriplePattern

public void addTriplePattern(TriplePattern s)
Add a triple pattern to the list of patterns.

Parameters:
s - the triple pattern to add.

remove

public void remove(TriplePattern s)
Remove the given triple pattern from the list of patterns.

Parameters:
s - the triple pattern to remove.

addFilter

public void addFilter(NodeFilter<Node> filter)
Add the given node filter to the list of filters.

Parameters:
filter - the node filter to add.

removeFilter

public void removeFilter(java.lang.String filter)
Remove the given node filter from the list of filters.

Parameters:
filter - the node filter to remove.

toString

public java.lang.String toString()

Overrides:
toString in class java.lang.Object