org.openanzo.glitter.query.rewriter
Class FunctionalPredicateRewriter

java.lang.Object
  extended by org.openanzo.glitter.query.rewriter.FunctionalPredicateRewriter
All Implemented Interfaces:
TreeRewriter

public class FunctionalPredicateRewriter
extends java.lang.Object
implements TreeRewriter

A FunctionalPredicateRewriter takes a map from predicate URIs to FunctionalPredicate implementations and uses it to rewrite a query node that contains a functional predicate by removing all triple patterns involved in the functional predicate and attaching the functional predicate to the BGP.

Author:
lee

Constructor Summary
FunctionalPredicateRewriter(java.util.Map<java.net.URI,java.lang.Class<? extends FunctionalPredicate>> predicates)
          Constructor.
FunctionalPredicateRewriter(java.util.Map<java.net.URI,java.lang.Class<? extends FunctionalPredicate>> predicates, QueryInformation qi)
          Constructor
 
Method Summary
 TreeNode rewriteTreeNode(TreeNode node)
          Rewrites the given node from a SPARQL abstract syntax tree.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FunctionalPredicateRewriter

public FunctionalPredicateRewriter(java.util.Map<java.net.URI,java.lang.Class<? extends FunctionalPredicate>> predicates)
Constructor.

Parameters:
predicates - Map from functional predicate URIs to functional predicate implementations.

FunctionalPredicateRewriter

public FunctionalPredicateRewriter(java.util.Map<java.net.URI,java.lang.Class<? extends FunctionalPredicate>> predicates,
                                   QueryInformation qi)
Constructor

Parameters:
predicates - Map from functional predicate URIs to functional predicate implementations.
qi - The query information to pass on to the FunctionalPredicate
Method Detail

rewriteTreeNode

public TreeNode rewriteTreeNode(TreeNode node)
Description copied from interface: TreeRewriter
Rewrites the given node from a SPARQL abstract syntax tree.

Specified by:
rewriteTreeNode in interface TreeRewriter
Parameters:
node - the node in question
Returns:
A tree node to replace the passed in tree node. Returning node leaves this spot in the AST unchanged. Returning null removes this node from the tree. (Note that it is possible that removing the node will leave the tree in an invalid state. Behavior in this case is undefined.)


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