org.openrdf.query.parser.sparql
Class GraphPattern

java.lang.Object
  extended by org.openrdf.query.parser.sparql.GraphPattern

public class GraphPattern
extends Object

A graph pattern consisting of (required and optional) tuple expressions, binding assignments and boolean constraints.

Author:
Arjohn Kampman

Constructor Summary
GraphPattern()
          Creates a new graph pattern.
GraphPattern(GraphPattern parent)
          Creates a new graph pattern that inherits the context and scope from a parent graph pattern.
 
Method Summary
 void addConstraint(ValueExpr constraint)
           
 void addConstraints(Collection<ValueExpr> constraints)
           
 void addOptionalTE(TupleExpr te)
           
 void addRequiredSP(Var subjVar, Var predVar, Var objVar)
           
 void addRequiredTE(TupleExpr te)
           
 TupleExpr buildTupleExpr()
          Builds a combined tuple expression from the tuple expressions and constraints in this graph pattern.
 void clear()
          Removes all tuple expressions and constraints.
 List<ValueExpr> getConstraints()
           
 Var getContextVar()
           
 List<TupleExpr> getOptionalTEs()
           
 List<TupleExpr> getRequiredTEs()
           
 StatementPattern.Scope getStatementPatternScope()
           
 List<ValueExpr> removeAllConstraints()
           
 void setContextVar(Var contextVar)
           
 void setStatementPatternScope(StatementPattern.Scope spScope)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GraphPattern

public GraphPattern()
Creates a new graph pattern.


GraphPattern

public GraphPattern(GraphPattern parent)
Creates a new graph pattern that inherits the context and scope from a parent graph pattern.

Method Detail

setContextVar

public void setContextVar(Var contextVar)

getContextVar

public Var getContextVar()

setStatementPatternScope

public void setStatementPatternScope(StatementPattern.Scope spScope)

getStatementPatternScope

public StatementPattern.Scope getStatementPatternScope()

addRequiredTE

public void addRequiredTE(TupleExpr te)

addRequiredSP

public void addRequiredSP(Var subjVar,
                          Var predVar,
                          Var objVar)

getRequiredTEs

public List<TupleExpr> getRequiredTEs()

addOptionalTE

public void addOptionalTE(TupleExpr te)

getOptionalTEs

public List<TupleExpr> getOptionalTEs()

addConstraint

public void addConstraint(ValueExpr constraint)

addConstraints

public void addConstraints(Collection<ValueExpr> constraints)

getConstraints

public List<ValueExpr> getConstraints()

removeAllConstraints

public List<ValueExpr> removeAllConstraints()

clear

public void clear()
Removes all tuple expressions and constraints.


buildTupleExpr

public TupleExpr buildTupleExpr()
Builds a combined tuple expression from the tuple expressions and constraints in this graph pattern.

Returns:
A tuple expression for this graph pattern.


Copyright © 2001-2012 Aduna. All Rights Reserved.