Package com.complexible.stardog.icv
Interface ICValidator
-
- All Superinterfaces:
java.lang.AutoCloseable
- All Known Subinterfaces:
ICVConnection
- All Known Implementing Classes:
AbstractICVConnection
public interface ICValidator extends java.lang.AutoCloseable
End-user interface for Integrity Constraint Validation support on a Stardog database. This is for users who wish to check validations, view violations, etc. separately from the database management and use of IC's. Particularly, if the user is operating in lax mode in which invalid data is allowed into the database, this can be used to query and find the violations and to otherwise resolve them.
All operations which modify the constraints for a database are atomic.
- Since:
- 0.7
- Version:
- 6.0
- Author:
- Michael Grove
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description void
close()
java.util.Set<Constraint>
getConstraints()
Return all of the constraints in the databasedefault StatementIterator
getValidationReport(Constraint... theConstraints)
Returns the SHACL validation report for the given SHACL constraints validated over the whole database.default StatementIterator
getValidationReport(java.util.Collection<IRI> theActiveGraphs, Options theOptions, Constraint... theConstraints)
Returns the SHACL validation report for the given SHACL constraints in the specified set of named graphs.default StatementIterator
getValidationReport(java.util.Collection<IRI> theActiveGraphs, Constraint... theConstraints)
Returns the SHACL validation report for the given SHACL constraints in the specified set of named graphs.default CloseableIterator<BindingSet>
getViolationBindings(Constraint... theConstraints)
Returns the violations for the given integrity constraints in the whole database as binding sets.CloseableIterator<BindingSet>
getViolationBindings(java.util.Collection<IRI> theActiveGraphs, Constraint... theConstraints)
Returns the violations for the given integrity constraints in the specified set of named graphs as binding sets.default boolean
isValid(Constraint... theConstraints)
Returnstrue
if the given integrity constraints are violated in the database.default boolean
isValid(java.util.Collection<IRI> theActiveGraphs, Constraint... theConstraints)
Returnstrue
if the given integrity constraints are violated in the specified set of named graphs.ValidationReporter
reporter()
Returns a validation reporter that can be used to retrieve the SHACL validation reports.
-
-
-
Method Detail
-
isValid
default boolean isValid(Constraint... theConstraints) throws StardogException
Returnstrue
if the given integrity constraints are violated in the database. If no constraints are given then all thecurrent constraints
in the database are used. This function is equivalent to callingisValid(Collection, Constraint...)
withContextSets.LOCAL
as the active graphs.- Parameters:
theConstraints
- the constraints to check. If no constraints are given, the defined constraints will be used.- Returns:
- true if the constraints are violated, false otherwise
- Throws:
StardogException
- if there was an error while checking the validity of the data in the database
-
isValid
default boolean isValid(java.util.Collection<IRI> theActiveGraphs, Constraint... theConstraints) throws StardogException
Returnstrue
if the given integrity constraints are violated in the specified set of named graphs. If no constraints are given then all thecurrent constraints
in the database are used.- Parameters:
theActiveGraphs
- the contexts to use in the validation. If the default context is to be used thenContextSets.DEFAULT_ONLY
must be used. If all contexts are to be used, thenContextSets.LOCAL
must be usedtheConstraints
- the constraints to check. If no constraints are given, the defined constraints will be used.- Returns:
- true if the constraints are violated, false otherwise
- Throws:
StardogException
- if there was an error while checking the validity of the data in the database
-
getViolationBindings
default CloseableIterator<BindingSet> getViolationBindings(Constraint... theConstraints) throws StardogException
Returns the violations for the given integrity constraints in the whole database as binding sets. If no constraints are given then all thecurrent constraints
in the database are used.This function is equivalent to callinggetViolationBindings(Collection, Constraint...)
withContextSets.LOCAL
as the active graphs.- Parameters:
theConstraints
- the constraints to check. If no constraints are given, the defined constraints will be used.- Returns:
- an iteration over the violations. An empty iteration will be returned if the data is valid
- Throws:
StardogException
- if there was an error calculating the violations
-
getViolationBindings
CloseableIterator<BindingSet> getViolationBindings(java.util.Collection<IRI> theActiveGraphs, Constraint... theConstraints) throws StardogException
Returns the violations for the given integrity constraints in the specified set of named graphs as binding sets. If no constraints are given then all thecurrent constraints
in the database are used.- Parameters:
theActiveGraphs
- the contexts to use in the validation. If the default context is to be used thenContextSets.DEFAULT_ONLY
must be used. If all contexts are to be used, thenContextSets.LOCAL
must be usedtheConstraints
- the constraints to check. If no constraints are given, the current constraints will be used.- Returns:
- an iteration over the violations. An empty iteration will be returned if the data is valid
- Throws:
StardogException
- if there was an error calculating the violations
-
getValidationReport
default StatementIterator getValidationReport(Constraint... theConstraints) throws StardogException
Returns the SHACL validation report for the given SHACL constraints validated over the whole database. If no constraints are given then all the SHACL constraintsin the database
are used. Non-SHACL constraints are ignored by this function.- Parameters:
theConstraints
- the SHACL constraints to validate. If no constraints are given, the constraints in the database will be used.- Returns:
- a SHACL validation report as defined in the SHACL specification
- Throws:
StardogException
- if there was an error calculating the violations
-
getValidationReport
default StatementIterator getValidationReport(java.util.Collection<IRI> theActiveGraphs, Constraint... theConstraints) throws StardogException
Returns the SHACL validation report for the given SHACL constraints in the specified set of named graphs. If no constraints are given then all the SHACL constraintsin the database
are used. Non-SHACL constraints are ignored by this function.- Parameters:
theActiveGraphs
- the contexts to use in the validation. If the default context is to be used thenContextSets.DEFAULT_ONLY
must be used. If all contexts are to be used, thenContextSets.LOCAL
must be usedtheConstraints
- the SHACL constraints to validate. If no constraints are given, the constraints in the database will be used.- Returns:
- a SHACL validation report as defined in the SHACL specification
- Throws:
StardogException
- if there was an error calculating the violations
-
getValidationReport
default StatementIterator getValidationReport(java.util.Collection<IRI> theActiveGraphs, Options theOptions, Constraint... theConstraints) throws StardogException
Returns the SHACL validation report for the given SHACL constraints in the specified set of named graphs. If no constraints are given then all the SHACL constraintsin the database
are used. Non-SHACL constraints are ignored by this function.- Parameters:
theActiveGraphs
- the contexts to use in the validation. If the default context is to be used thenContextSets.DEFAULT_ONLY
must be used. If all contexts are to be used, thenContextSets.LOCAL
must be usedtheOptions
- the options used to tune the validation process.theConstraints
- the SHACL constraints to validate. If no constraints are given, the constraints in the database will be used.- Returns:
- a SHACL validation report as defined in the SHACL specification
- Throws:
StardogException
- if there was an error calculating the violations
-
reporter
ValidationReporter reporter()
Returns a validation reporter that can be used to retrieve the SHACL validation reports.- Returns:
- validation reporter
-
getConstraints
java.util.Set<Constraint> getConstraints() throws StardogException
Return all of the constraints in the database- Returns:
- the constraints
- Throws:
StardogException
- if there was an error obtaining the constraints
-
close
void close()
- Specified by:
close
in interfacejava.lang.AutoCloseable
-
-