com.clarkparsia.stardog.icv
Class ICV

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

public final class ICV
extends Object

Set of utility functions for dealing with Stardog ICV support.

Since:
0.7
Version:
0.8
Author:
Michael Grove

Field Summary
static boolean ENFORCE_MEMBERSHIP
           
static URI ID
           
static String PERMISSION_ICV
           
static String PERMISSION_ICV_GUARD
           
 
Method Summary
static Iteration<Resource,StardogException> asIndividuals(Iteration<BindingSet,StardogException> theViolations)
          The individual violating the constraint will pulled from the BindingSet and returned.
static Set<Constraint> constraintsFromGraph(Graph theGraph)
           
static com.clarkparsia.stardog.rdf.StatementSource<Exception> constraintsToSource(Iterable<Constraint> theConstraints)
           
static Set<Constraint> convertToExpressions(Graph theStatements)
          Deprecated. Use ConstraintFactory.constraints(Graph) instead
static Pair<Set<Statement>,Set<Statement>> getExplanation(Constraint theConstraint, BindingSet theBinding)
           Returns the explanation for a specific constraint violation as two sets of statements.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PERMISSION_ICV

public static final String PERMISSION_ICV
See Also:
Constant Field Values

PERMISSION_ICV_GUARD

public static final String PERMISSION_ICV_GUARD
See Also:
Constant Field Values

ENFORCE_MEMBERSHIP

public static final boolean ENFORCE_MEMBERSHIP
See Also:
Constant Field Values

ID

public static final URI ID
Method Detail

convertToExpressions

@Deprecated
public static Set<Constraint> convertToExpressions(Graph theStatements)
Deprecated. Use ConstraintFactory.constraints(Graph) instead


asIndividuals

public static Iteration<Resource,StardogException> asIndividuals(Iteration<BindingSet,StardogException> theViolations)
                                                          throws StardogException
The individual violating the constraint will pulled from the BindingSet and returned. If the constraint is a user-defined SPARQL query which has multiple variables in the projection of the query, the first value of the first value in the projection will be returned.

Parameters:
theViolations - the violation bindings
Returns:
An Iteration over the the individuals described in the BindingSets
Throws:
StardogException - if there was an error converting a BindingSet

getExplanation

public static Pair<Set<Statement>,Set<Statement>> getExplanation(Constraint theConstraint,
                                                                 BindingSet theBinding)

Returns the explanation for a specific constraint violation as two sets of statements. The first set in the pair is the existing statements in the database that caused the violation. The second set is the statements that were missing in the database that caused the violation. Since the statements in the second set do not exist they may contain auto-generated URIs to indicate unknown values. Depending on the type of constraint the first or the second set may be empty.

All the statements in the first set are guaranteed to be inferrable by the contents of the database. This mean they are either in the explicitly in the database or they are inferred by other statements in the database. On the other hand, some of the statements in the second set MAY BE in the database but there is at least one statement in this set that is not in the database.

The explanation for a violation can be used as a guide to fix a violation. Either removing one or more statements of the first set from the database or adding all the statements from the second set would fix this violation

Parameters:
theConstraint - the constraint that is violated
theBinding - the binding returned by the ConstraintViolation for this constraint
Returns:
two sets of statements where first set is statements that exist in the database and the second set is missing statements that caused the violation

constraintsFromGraph

public static Set<Constraint> constraintsFromGraph(Graph theGraph)
                                            throws StardogException
Throws:
StardogException

constraintsToSource

public static com.clarkparsia.stardog.rdf.StatementSource<Exception> constraintsToSource(Iterable<Constraint> theConstraints)


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