com.clarkparsia.stardog.icv
Class ConstraintFactory

java.lang.Object
  extended by com.clarkparsia.stardog.icv.ConstraintFactory

public final class ConstraintFactory
extends Object

Factory to simplify creating constraint objects.

Since:
0.7
Version:
0.7
Author:
Michael Grove

Method Summary
static Constraint constraint(Collection<Statement> theStatements)
          Create an integrity constraint from a collection of statements.
static Constraint constraint(Expression theExpression)
          Create an integrity constraint from an OWL Axiom.
static Constraint constraint(Graph theGraph)
          Create an integrity constraint from a Graph.
static Constraint constraint(String theQuery)
          integrity constraint from the SPARQL query.
static Set<Constraint> constraints(Collection<Statement> theStatements)
          Create a set of integrity constraints from a collection of statements.
static Set<Constraint> constraints(Graph theGraph)
          Create a set of integrity constraints from a Graph.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

constraint

public static Constraint constraint(Expression theExpression)
Create an integrity constraint from an OWL Axiom.

Parameters:
theExpression - the constraint axiom
Returns:
the new IC

constraint

public static Constraint constraint(Graph theGraph)
Create an integrity constraint from a Graph. The contents of the graph must be a single OWL axiom.

Parameters:
theGraph - the axiom graph.
Returns:
the new IC
Throws:
IllegalArgumentException - if the graph does not contain a single owl axiom, or contains more than one.

constraint

public static Constraint constraint(Collection<Statement> theStatements)
Create an integrity constraint from a collection of statements. The statements must be equal to a single OWL axiom.

Parameters:
theStatements - the axiom as statements
Returns:
the new IC
Throws:
IllegalArgumentException - if the graph of the statements does not contain a single owl axiom, or contains more than one.

constraints

public static Set<Constraint> constraints(Graph theGraph)
Create a set of integrity constraints from a Graph.


constraints

public static Set<Constraint> constraints(Collection<Statement> theStatements)
Create a set of integrity constraints from a collection of statements.


constraint

public static Constraint constraint(String theQuery)
                             throws StardogException
integrity constraint from the SPARQL query. The query should return a result when there is a violation and can only be a select query.

Parameters:
theQuery - the IC query
Returns:
the constraint
Throws:
StardogException - if the query was malformed or is not a select query


Copyright © 2010-2013 Clark & Parsia. All Rights Reserved.