com.tinkerpop.blueprints.oupls.sail
Class Matcher

java.lang.Object
  extended by com.tinkerpop.blueprints.oupls.sail.Matcher
Direct Known Subclasses:
GraphBasedMatcher, IndexingMatcher, TrivialMatcher

public abstract class Matcher
extends Object

An object which retrieves statements from the triple store based on a given triple pattern. For example, an "soc" matcher expects the subject, object, and context components to be specified; it will then retrieve all matching statements (where the unspecified component of the pattern -- the predicate -- may vary). In an "o" matcher, only the object is specified, and subject, predicate and context may vary, etc.

Author:
Joshua Shinavier (http://fortytwo.net)

Field Summary
protected  boolean c
           
protected  boolean o
           
protected  boolean p
           
protected  boolean s
           
 
Constructor Summary
Matcher(boolean s, boolean p, boolean o, boolean c)
          Create a new matcher based on the given triple pattern.
 
Method Summary
abstract  Iterable<Edge> match(org.openrdf.model.Resource subject, org.openrdf.model.URI predicate, org.openrdf.model.Value object, org.openrdf.model.Resource context)
          Retrieve matching statements based on this matcher's triple pattern as well as the provided values.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

s

protected final boolean s

p

protected final boolean p

o

protected final boolean o

c

protected final boolean c
Constructor Detail

Matcher

public Matcher(boolean s,
               boolean p,
               boolean o,
               boolean c)
Create a new matcher based on the given triple pattern.

Parameters:
s - whether the subject is specified
p - whether the predicate is specified
o - whether the object is specified
c - whether the context is specified
Method Detail

match

public abstract Iterable<Edge> match(org.openrdf.model.Resource subject,
                                     org.openrdf.model.URI predicate,
                                     org.openrdf.model.Value object,
                                     org.openrdf.model.Resource context)
Retrieve matching statements based on this matcher's triple pattern as well as the provided values. If a component such as subject or object is specified in the pattern, a non-null value must be provided to this method. Non-null values for unspecified components may be provided, but they will not be used.

Parameters:
subject - the subject value of matching statements
predicate - the predicate value of matching statements
object - the object of matching statements
context - the context of matching statements
Returns:
an iterator over all matching statements

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2010-2012 David Wu. All Rights Reserved.