de.fuberlin.wiwiss.d2rq.algebra
Class TripleRelation
java.lang.Object
de.fuberlin.wiwiss.d2rq.algebra.NodeRelation
de.fuberlin.wiwiss.d2rq.algebra.TripleRelation
public class TripleRelation
- extends NodeRelation
A collection of virtual triples obtained by applying a Relation
to a
database, and applying NodeMaker
s for subject, predicate and object
to each result row. This is implemented as a stateless wrapper around a
NodeRelation
.
- Author:
- Chris Bizer chris@bizer.de, Richard Cyganiak (richard@cyganiak.de)
SUBJECT
public static final Var SUBJECT
PREDICATE
public static final Var PREDICATE
OBJECT
public static final Var OBJECT
TripleRelation
public TripleRelation(Relation baseRelation,
NodeMaker subjectMaker,
NodeMaker predicateMaker,
NodeMaker objectMaker)
orderBy
public TripleRelation orderBy(Var variable,
boolean ascending)
- Overrides:
orderBy
in class NodeRelation
limit
public TripleRelation limit(int limit)
- Overrides:
limit
in class NodeRelation
selectTriple
public TripleRelation selectTriple(Triple t)
selectWithVariables
public TripleRelation selectWithVariables(Triple t)
- Creates a
NodeRelation
by applying a triple pattern
to the TripleRelation. If the triple contains variables, then
the variables will be bound to the corresponding values
in the resulting NodeRelation. Node.ANY
will be
converted to a variable "subject", "predicate", "object"
depending on its position in the triple pattern.
For example, selecting (?x :name ?name) would produce a
NodeRelation with ?x bound to the subjects and ?name bound to the
objects of this TripleRelation.
TODO This is never called at the moment. Why!?
- Parameters:
t
- A triple pattern involving variables
- Returns:
- A NodeRelation over the variables occurring in the triple pattern