public final class ICV extends Object
Set of utility functions for dealing with Stardog ICV support.
Modifier and Type | Field and Description |
---|---|
static IRI |
ID |
protected static org.slf4j.Logger |
LOGGER |
static String |
PERMISSION_ICV |
Modifier and Type | Method and Description |
---|---|
static Iterator<Resource> |
asIndividuals(CloseableIterator<BindingSet> theViolations)
The individual violating the constraint will pulled from the BindingSet and returned.
|
static SelectQueryResult |
asTupleQueryResult(CloseableIterator<BindingSet> theViolations)
The individual violating the constraint will pulled from the BindingSet and returned.
|
static Set<Constraint> |
constraintsFromGraph(Iterable<Statement> theGraph) |
static StatementSource |
constraintsToSource(Iterable<Constraint> theConstraints) |
static StatementSource |
constraintsToSource(Iterable<Constraint> theConstraints,
Resource theContext) |
static Pair<Set<Statement>,Set<Statement>> |
getExplanation(ICValidator theValidator,
Constraint theConstraint,
BindingSet theBinding)
Returns the explanation for a specific constraint violation as two sets of statements.
|
static List<Proof> |
getProofs(Constraint[] theConstraints,
ICValidator theValidator,
Options theOptions,
Optional<BiFunction<Axiom,Options,Iterable<Proof>>> theInferenceExplainer) |
static Collection<Statement> |
toStatements(Constraint theConstraint)
Convert the Stardog IC into a collection of statements
|
protected static final org.slf4j.Logger LOGGER
public static final String PERMISSION_ICV
public static final IRI ID
public static SelectQueryResult asTupleQueryResult(CloseableIterator<BindingSet> theViolations) throws StardogException
theViolations
- the violation bindingsStardogException
- if there was an error converting a BindingSetpublic static Iterator<Resource> asIndividuals(CloseableIterator<BindingSet> theViolations) throws StardogException
theViolations
- the violation bindingsStardogException
- if there was an error converting a BindingSetpublic static Collection<Statement> toStatements(Constraint theConstraint)
theConstraint
- the constraintpublic static Pair<Set<Statement>,Set<Statement>> getExplanation(ICValidator theValidator, 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
theConstraint
- the constraint that is violatedtheBinding
- the binding returned by the ConstraintViolation
for this constraintpublic static Set<Constraint> constraintsFromGraph(Iterable<Statement> theGraph) throws StardogException
StardogException
public static StatementSource constraintsToSource(Iterable<Constraint> theConstraints)
public static StatementSource constraintsToSource(Iterable<Constraint> theConstraints, Resource theContext)
public static List<Proof> getProofs(Constraint[] theConstraints, ICValidator theValidator, Options theOptions, Optional<BiFunction<Axiom,Options,Iterable<Proof>>> theInferenceExplainer) throws StardogException
StardogException
Copyright © 2010-2016 Stardog Union. All Rights Reserved.