org.nsdl.mptstore.query.component
Class MappableTriplePattern

java.lang.Object
  extended by org.nsdl.mptstore.query.component.MappableTriplePattern
All Implemented Interfaces:
TriplePattern

public class MappableTriplePattern
extends java.lang.Object
implements TriplePattern

Represents a pattern that defines matching triples.

A triple pattern contains three MappableNodePatterns representing the subject, predicate, and object of a triple.

In addition to representing a particular triple pattern, a TriplePattern may be bound to a apecific table (logically, the one that maps to its predicate). When bound to a table, the TriplePattern may be used for selecting triples from its table or for joining triple selection results with other TriplePatterns.

Author:
birkland

Constructor Summary
MappableTriplePattern(MappableNodePattern<SubjectNode> s, MappableNodePattern<PredicateNode> p, MappableNodePattern<ObjectNode> o)
          Construct a mappable triple pattern with the given component patterns.
MappableTriplePattern(TriplePattern pattern)
          Construct a mappable triple pattern using the existing triple pattern.
 
Method Summary
 void bindTo(MPTable t)
          Bind this triple pattern to the given table.
 java.util.Set<MappableNodePattern<? extends Node>> getNodes()
          Get the subject and object node patterns in a set.
 MappableNodePattern<ObjectNode> getObject()
          Get the object pattern.
 MappableNodePattern<PredicateNode> getPredicate()
          Get the predicate pattern.
 MappableNodePattern<SubjectNode> getSubject()
          Get the subject pattern.
 java.lang.String toString()
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MappableTriplePattern

public MappableTriplePattern(MappableNodePattern<SubjectNode> s,
                             MappableNodePattern<PredicateNode> p,
                             MappableNodePattern<ObjectNode> o)
Construct a mappable triple pattern with the given component patterns.

Parameters:
s - the subject pattern.
p - the predicate pattern.
o - the object pattern.

MappableTriplePattern

public MappableTriplePattern(TriplePattern pattern)
Construct a mappable triple pattern using the existing triple pattern.

Parameters:
pattern - the existing triple pattern.
Method Detail

getSubject

public MappableNodePattern<SubjectNode> getSubject()
Get the subject pattern.

Specified by:
getSubject in interface TriplePattern
Returns:
the subject pattern.

getPredicate

public MappableNodePattern<PredicateNode> getPredicate()
Get the predicate pattern.

Specified by:
getPredicate in interface TriplePattern
Returns:
the predicate pattern.

getObject

public MappableNodePattern<ObjectNode> getObject()
Get the object pattern.

Specified by:
getObject in interface TriplePattern
Returns:
the object pattern.

bindTo

public void bindTo(MPTable t)
Bind this triple pattern to the given table.

Parameters:
t - the table to bind to.

getNodes

public java.util.Set<MappableNodePattern<? extends Node>> getNodes()
Get the subject and object node patterns in a set.

Returns:
a set containing the subject and object node patterns.

toString

public java.lang.String toString()

Overrides:
toString in class java.lang.Object