org.openanzo.glitter.syntax.abstrakt
Class BGP

java.lang.Object
  extended by org.openanzo.glitter.syntax.abstrakt.TreeNode
      extended by org.openanzo.glitter.syntax.abstrakt.GraphPattern
          extended by org.openanzo.glitter.syntax.abstrakt.BGP

public class BGP
extends GraphPattern

A SPARQL basic graph pattern. Logically, a BGP is an ordered list of triple patterns and possibly a FunctionalPredicate.

Author:
lee

Constructor Summary
BGP()
          Default constructor.
BGP(java.util.ArrayList<TriplePatternNode> triples)
          Construct a BGP from a list of triple patterns.
BGP(TriplePatternNode[] triples)
          Construct a BGP from an array of triple patterns.
 
Method Summary
 void addChild(TreeNode child)
          Adds the given child at the end of this node's children.
 void addTriplePattern(TriplePatternNode tp)
          Add a new triple pattern to this BGP.
 java.util.Iterator<TriplePatternNode> getChildren()
           
 FunctionalPredicate getFunctionalPredicate()
           
 java.lang.Iterable<TriplePatternNode> getTriplePatterns()
           
 boolean removeChild(TreeNode child)
          Removes the given child from the collection of children
 boolean replaceChild(TreeNode oldChild, TreeNode newChild)
          Changes the tree below this node by replacing oldChild with newChild
 void setFunctionalPredicate(FunctionalPredicate fp)
           
 java.lang.String toString()
           
 
Methods inherited from class org.openanzo.glitter.syntax.abstrakt.TreeNode
containsVariable, getBindableVariableCount, getBindableVariableSet, getFilters, getInScopeFilterSet, getParent, getRoot, getVariableCount, getVariableSet, invalidateCache, invalidateCache, mightBindVariable, prettyPrint, prettyPrint
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BGP

public BGP()
Default constructor.


BGP

public BGP(TriplePatternNode[] triples)
Construct a BGP from an array of triple patterns.

Parameters:
triples -

BGP

public BGP(java.util.ArrayList<TriplePatternNode> triples)
Construct a BGP from a list of triple patterns.

Parameters:
triples -
Method Detail

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

addTriplePattern

public void addTriplePattern(TriplePatternNode tp)
Add a new triple pattern to this BGP.

Parameters:
tp -

getTriplePatterns

public java.lang.Iterable<TriplePatternNode> getTriplePatterns()
Returns:
An iterable collection of the triple patterns that comprise this BGP.

getFunctionalPredicate

public FunctionalPredicate getFunctionalPredicate()
Returns:
A FunctionalPredicate captured by this basic graph pattern.

setFunctionalPredicate

public void setFunctionalPredicate(FunctionalPredicate fp)
Parameters:
fp - Sets a functional predicate for this BGP.

getChildren

public java.util.Iterator<TriplePatternNode> getChildren()
Specified by:
getChildren in class TreeNode
Returns:
An Iterator over the children of this node.

replaceChild

public boolean replaceChild(TreeNode oldChild,
                            TreeNode newChild)
Description copied from class: TreeNode
Changes the tree below this node by replacing oldChild with newChild

Specified by:
replaceChild in class TreeNode
Returns:
true if the oldChild was found and replaced; false otherwise.

removeChild

public boolean removeChild(TreeNode child)
Description copied from class: TreeNode
Removes the given child from the collection of children

Specified by:
removeChild in class TreeNode
Returns:
true if the child was found and removed; false otherwise.

addChild

public void addChild(TreeNode child)
Description copied from class: TreeNode
Adds the given child at the end of this node's children.

Specified by:
addChild in class TreeNode


Copyright © 2007 Cambridge Semantics Inc.. All Rights Reserved.