org.apache.clerezza.rdf.core.sparql.query.impl
Class SimpleGroupGraphPattern

java.lang.Object
  extended by org.apache.clerezza.rdf.core.sparql.query.impl.SimpleGroupGraphPattern
All Implemented Interfaces:
GraphPattern, GroupGraphPattern

public class SimpleGroupGraphPattern
extends Object
implements GroupGraphPattern

This class implements GroupGraphPattern.

Author:
hasan

Constructor Summary
SimpleGroupGraphPattern()
           
 
Method Summary
 void addConstraint(Expression constraint)
          Adds a constraint to the GroupGraphPattern.
 void addGraphPattern(GraphPattern graphPattern)
          Adds a GraphPattern to the group.
 void addOptionalGraphPattern(GroupGraphPattern optional)
          Adds an OptionalGraphPattern to the group consisting of a main graph pattern and the specified GroupGraphPattern as the optional pattern.
 void addTriplePatterns(Set<TriplePattern> triplePatterns)
          If the last GraphPattern added to the group is not a SimpleBasicGraphPattern, then creates one containing the specified TriplePatterns and adds it to the group.
 List<Expression> getFilter()
           
 Set<GraphPattern> getGraphPatterns()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleGroupGraphPattern

public SimpleGroupGraphPattern()
Method Detail

getGraphPatterns

public Set<GraphPattern> getGraphPatterns()
Specified by:
getGraphPatterns in interface GroupGraphPattern
Returns:
a set of all patterns, ANDed together.

getFilter

public List<Expression> getFilter()
Specified by:
getFilter in interface GroupGraphPattern
Returns:
a list of filter expressions for all patterns in the group if any, otherwise an empty list is returned.

addGraphPattern

public void addGraphPattern(GraphPattern graphPattern)
Adds a GraphPattern to the group.

Parameters:
graphPattern - the GraphPattern to be added.

addConstraint

public void addConstraint(Expression constraint)
Adds a constraint to the GroupGraphPattern.

Parameters:
constraint - an Expression as the constraint to be added.

addTriplePatterns

public void addTriplePatterns(Set<TriplePattern> triplePatterns)
If the last GraphPattern added to the group is not a SimpleBasicGraphPattern, then creates one containing the specified TriplePatterns and adds it to the group. Otherwise, adds the specified TriplePatterns to the last added SimpleBasicGraphPattern in the group.

Parameters:
triplePatterns - a set of TriplePatterns to be added into a SimpleBasicGraphPattern of the group.

addOptionalGraphPattern

public void addOptionalGraphPattern(GroupGraphPattern optional)
Adds an OptionalGraphPattern to the group consisting of a main graph pattern and the specified GroupGraphPattern as the optional pattern. The main graph pattern is taken from the last added GraphPattern in the group, if it exists. Otherwise, the main graph pattern is null.

Parameters:
optional - a GroupGraphPattern as the optional pattern of an OptionalGraphPattern.


Copyright © 2012 The Apache Software Foundation. All Rights Reserved.