com.hp.hpl.mesa.rdf.jena.rdb
Class ConstraintsGeneric

java.lang.Object
  |
  +--com.hp.hpl.mesa.rdf.jena.rdb.ConstraintsGeneric
All Implemented Interfaces:
IConstraints

public class ConstraintsGeneric
extends java.lang.Object
implements IConstraints

Implemention of the IConstraints interface used to specify search constraints on Jena statements. This implementation is suitable for any of the generic table layouts (whether hash or generator based) and should work for any reasonable database.

Version:
$Revision: 1.2 $ on $Date: 2001/11/26 18:20:08 $
Author:
Dave Reynolds

Constructor Summary
ConstraintsGeneric(ModelRDB model)
          Constructor.
 
Method Summary
 IConstraints addIntConstraint(java.lang.String op, int constraint)
          Add a constraint that the object field should match the given integer literal using the sql comparison operator op - examples include "≥" and "≤=".
 IConstraints addObjectConstraint(Literal l)
          Add a constraint that the object field should match the given literal exactly
 IConstraints addObjectConstraint(Resource r)
          Add a constraint that the object field should match the given resource
 IConstraints addPropertyConstraint(Resource r)
          Add a constraint that the property field should match the given resource
 IConstraints addStringConstraint(java.lang.String op, java.lang.String constraint)
          Add a constraint that the object field should match the given string literal using the sql comparison operator op - such as "LIKE" or "NOT LIKE"
 IConstraints addSubjectConstraint(Resource r)
          Add a constraint that the subject field should match the given resource
 IConstraints reset()
          Clear all constraints
 ResultSetIterator runQuery(IRDBDriver driver, ModelRDB m)
          Execute the query implied by this set of constraints against the statements in the given model.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConstraintsGeneric

public ConstraintsGeneric(ModelRDB model)
Constructor.
Method Detail

runQuery

public ResultSetIterator runQuery(IRDBDriver driver,
                                  ModelRDB m)
                           throws RDFException
Execute the query implied by this set of constraints against the statements in the given model.
Specified by:
runQuery in interface IConstraints

addSubjectConstraint

public IConstraints addSubjectConstraint(Resource r)
                                  throws RDFException
Add a constraint that the subject field should match the given resource
Specified by:
addSubjectConstraint in interface IConstraints

addPropertyConstraint

public IConstraints addPropertyConstraint(Resource r)
                                   throws RDFException
Add a constraint that the property field should match the given resource
Specified by:
addPropertyConstraint in interface IConstraints

addObjectConstraint

public IConstraints addObjectConstraint(Resource r)
                                 throws RDFException
Add a constraint that the object field should match the given resource
Specified by:
addObjectConstraint in interface IConstraints

addObjectConstraint

public IConstraints addObjectConstraint(Literal l)
                                 throws RDFException
Add a constraint that the object field should match the given literal exactly
Specified by:
addObjectConstraint in interface IConstraints

reset

public IConstraints reset()
Clear all constraints
Specified by:
reset in interface IConstraints

addStringConstraint

public IConstraints addStringConstraint(java.lang.String op,
                                        java.lang.String constraint)
Add a constraint that the object field should match the given string literal using the sql comparison operator op - such as "LIKE" or "NOT LIKE"
Specified by:
addStringConstraint in interface IConstraints

addIntConstraint

public IConstraints addIntConstraint(java.lang.String op,
                                     int constraint)
Add a constraint that the object field should match the given integer literal using the sql comparison operator op - examples include "≥" and "≤=".
Specified by:
addIntConstraint in interface IConstraints


Copyright 2001 Hewlett-Packard. All Rights Reserved.