Package org.eclipse.rdf4j.sail.shacl
Class ShaclSailBaseConfiguration
java.lang.Object
org.eclipse.rdf4j.sail.helpers.SailWrapper
org.eclipse.rdf4j.sail.helpers.NotifyingSailWrapper
org.eclipse.rdf4j.sail.shacl.ShaclSailBaseConfiguration
- All Implemented Interfaces:
FederatedServiceResolverClient
,NotifyingSail
,Sail
,StackableSail
- Direct Known Subclasses:
ShaclSail
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate boolean
private boolean
private boolean
private static final org.slf4j.Logger
private boolean
private boolean
private boolean
private boolean
private boolean
private boolean
private boolean
(package private) final boolean
private long
private boolean
private long
private long
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Disable the SHACL validation on commit()void
Enabled the SHACL validation on commit()Retrieves the defaultIsolationLevel
level on which transactions in this Sail operate.long
long
long
ValidationReports contain validation results.long
ValidationReports contain validation results.boolean
Check if selected nodes caches is enabled.boolean
Support for DASH Data Shapes Vocabulary Unofficial Draft (http://datashapes.org/dash).boolean
Support for Eclipse RDF4J SHACL Extensions (http://rdf4j.org/shacl-extensions#).boolean
Check if logging of every execution steps is enabled.boolean
Check if logging of validation plans is enabled.boolean
Check if logging a list of violations and the triples that caused the violations is enabled.boolean
Check if SHACL validation is run in parellel.boolean
boolean
boolean
On transactions using SNAPSHOT isolation the ShaclSail can run the validation serializably.boolean
Check if SHACL validation on commit() is enabled.void
setCacheSelectNodes
(boolean cacheSelectNodes) The ShaclSail retries a lot of its relevant data through running SPARQL Select queries against the underlying sail and against the changes in the transaction.void
setDashDataShapes
(boolean dashDataShapes) Support for DASH Data Shapes Vocabulary Unofficial Draft (http://datashapes.org/dash).void
setEclipseRdf4jShaclExtensions
(boolean eclipseRdf4jShaclExtensions) Support for Eclipse RDF4J SHACL Extensions (http://rdf4j.org/shacl-extensions#).void
setGlobalLogValidationExecution
(boolean loggingEnabled) Log (INFO) every execution step of the SHACL validation.void
setLogValidationPlans
(boolean logValidationPlans) Log (INFO) the executed validation plans as GraphViz DOT Recommended to disable parallel validation with setParallelValidation(false)void
setLogValidationViolations
(boolean logValidationViolations) Log (INFO) a list of violations and the triples that caused the violations (BETA).void
setParallelValidation
(boolean parallelValidation) EXPERIMENTAL! Run SHACL validation in parallel.void
setPerformanceLogging
(boolean performanceLogging) Log (INFO) the execution time per shape.void
setRdfsSubClassReasoning
(boolean rdfsSubClassReasoning) void
setSerializableValidation
(boolean serializableValidation) Enable or disable serializable validation.On transactions using SNAPSHOT isolation the ShaclSail can run the validation serializably.void
setShapesGraphs
(Set<IRI> shapesGraphs) void
setTransactionalValidationLimit
(long transactionalValidationLimit) void
setValidationResultsLimitPerConstraint
(long validationResultsLimitPerConstraint) ValidationReports contain validation results.void
setValidationResultsLimitTotal
(long validationResultsLimitTotal) ValidationReports contain validation results.Methods inherited from class org.eclipse.rdf4j.sail.helpers.NotifyingSailWrapper
addSailChangedListener, getBaseSail, getConnection, removeSailChangedListener, setBaseSail
Methods inherited from class org.eclipse.rdf4j.sail.helpers.SailWrapper
getCollectionFactory, getDataDir, getFederatedServiceResolver, getSupportedIsolationLevels, getValueFactory, init, isWritable, setDataDir, setFederatedServiceResolver, shutDown, verifyBaseSailSet
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.eclipse.rdf4j.sail.Sail
getCollectionFactory, getDataDir, getSupportedIsolationLevels, getValueFactory, init, isWritable, setDataDir, shutDown
-
Field Details
-
logger
private static final org.slf4j.Logger logger -
sparqlValidation
final boolean sparqlValidation -
parallelValidation
private boolean parallelValidation -
logValidationPlans
private boolean logValidationPlans -
logValidationViolations
private boolean logValidationViolations -
validationEnabled
private boolean validationEnabled -
cacheSelectNodes
private boolean cacheSelectNodes -
rdfsSubClassReasoning
private boolean rdfsSubClassReasoning -
serializableValidation
private boolean serializableValidation -
performanceLogging
private boolean performanceLogging -
eclipseRdf4jShaclExtensions
private boolean eclipseRdf4jShaclExtensions -
dashDataShapes
private boolean dashDataShapes -
validationResultsLimitTotal
private long validationResultsLimitTotal -
validationResultsLimitPerConstraint
private long validationResultsLimitPerConstraint -
transactionalValidationLimit
private long transactionalValidationLimit -
logValidationExecution
private boolean logValidationExecution -
shapesGraphs
-
-
Constructor Details
-
ShaclSailBaseConfiguration
-
ShaclSailBaseConfiguration
public ShaclSailBaseConfiguration()
-
-
Method Details
-
isGlobalLogValidationExecution
public boolean isGlobalLogValidationExecution()Check if logging of every execution steps is enabled.- Returns:
true
if enabled,false
otherwise.- See Also:
-
setGlobalLogValidationExecution
public void setGlobalLogValidationExecution(boolean loggingEnabled) Log (INFO) every execution step of the SHACL validation. This is fairly costly and should not be used in production. Recommended to disable parallel validation with setParallelValidation(false)- Parameters:
loggingEnabled
-
-
isLogValidationViolations
public boolean isLogValidationViolations()Check if logging a list of violations and the triples that caused the violations is enabled. It is recommended to disable parallel validation withsetParallelValidation(boolean)
- See Also:
-
setLogValidationViolations
public void setLogValidationViolations(boolean logValidationViolations) Log (INFO) a list of violations and the triples that caused the violations (BETA). Recommended to disable parallel validation with setParallelValidation(false)- Parameters:
logValidationViolations
-
-
isParallelValidation
public boolean isParallelValidation()Check if SHACL validation is run in parellel.- Returns:
true
if enabled,false
otherwise.
-
setParallelValidation
public void setParallelValidation(boolean parallelValidation) EXPERIMENTAL! Run SHACL validation in parallel. Default: falseMay cause deadlock, especially when using NativeStore.
- Parameters:
parallelValidation
- default true
-
isCacheSelectNodes
public boolean isCacheSelectNodes()Check if selected nodes caches is enabled.- Returns:
true
if enabled,false
otherwise.- See Also:
-
setCacheSelectNodes
public void setCacheSelectNodes(boolean cacheSelectNodes) The ShaclSail retries a lot of its relevant data through running SPARQL Select queries against the underlying sail and against the changes in the transaction. This is usually good for performance, but while validating large amounts of data disabling this cache will use less memory. Default: true- Parameters:
cacheSelectNodes
- default true
-
isRdfsSubClassReasoning
public boolean isRdfsSubClassReasoning() -
setRdfsSubClassReasoning
public void setRdfsSubClassReasoning(boolean rdfsSubClassReasoning) -
disableValidation
public void disableValidation()Disable the SHACL validation on commit() -
enableValidation
public void enableValidation()Enabled the SHACL validation on commit() -
isValidationEnabled
public boolean isValidationEnabled()Check if SHACL validation on commit() is enabled.- Returns:
true
if validation is enabled,false
otherwise.
-
isLogValidationPlans
public boolean isLogValidationPlans()Check if logging of validation plans is enabled.- Returns:
true
if validation plan logging is enabled,false
otherwise.
-
setLogValidationPlans
public void setLogValidationPlans(boolean logValidationPlans) Log (INFO) the executed validation plans as GraphViz DOT Recommended to disable parallel validation with setParallelValidation(false)- Parameters:
logValidationPlans
-
-
isPerformanceLogging
public boolean isPerformanceLogging() -
setPerformanceLogging
public void setPerformanceLogging(boolean performanceLogging) Log (INFO) the execution time per shape. Recommended to disable the following:- setParallelValidation(false)
- setCacheSelectNodes(false)
- Parameters:
performanceLogging
- default false
-
isSerializableValidation
public boolean isSerializableValidation()On transactions using SNAPSHOT isolation the ShaclSail can run the validation serializably. This stops the sail from becoming inconsistent due to race conditions between two transactions. Serializable validation limits TPS (transactions per second), it is however considerably faster than actually using SERIALIZABLE isolation.- Returns:
true
if serializable validation is enabled,false
otherwise.
-
setSerializableValidation
public void setSerializableValidation(boolean serializableValidation) Enable or disable serializable validation.On transactions using SNAPSHOT isolation the ShaclSail can run the validation serializably. This stops the sail from becoming inconsistent due to race conditions between two transactions. Serializable validation limits TPS (transactions per second), it is however considerably faster than actually using SERIALIZABLE isolation.To increase TPS, serializable validation can be disabled. Validation will then be limited to the semantics of the SNAPSHOT isolation level (or whichever is specified). If you use any other isolation level than SNAPSHOT, disabling serializable validation will make no difference on performance.
- Parameters:
serializableValidation
- default true
-
isEclipseRdf4jShaclExtensions
Support for Eclipse RDF4J SHACL Extensions (http://rdf4j.org/shacl-extensions#). Enabling this currently enables support for rsx:targetShape.EXPERIMENTAL!
- Returns:
- true if enabled
-
setEclipseRdf4jShaclExtensions
Support for Eclipse RDF4J SHACL Extensions (http://rdf4j.org/shacl-extensions#). Enabling this currently enables support for rsx:targetShape.EXPERIMENTAL!
- Parameters:
eclipseRdf4jShaclExtensions
- true to enable (default: false)
-
isDashDataShapes
Support for DASH Data Shapes Vocabulary Unofficial Draft (http://datashapes.org/dash). Currently this enables support for dash:hasValueIn, dash:AllObjectsTarget and dash:AllSubjectsTarget.EXPERIMENTAL!
- Returns:
- true if enabled
-
setDashDataShapes
Support for DASH Data Shapes Vocabulary Unofficial Draft (http://datashapes.org/dash). Currently this enables support for dash:hasValueIn, dash:AllObjectsTarget and and dash:AllSubjectsTarget.EXPERIMENTAL!
- Parameters:
dashDataShapes
- true to enable (default: false)
-
getValidationResultsLimitPerConstraint
public long getValidationResultsLimitPerConstraint()ValidationReports contain validation results. The number of validation results can be limited by the user. This can be useful to reduce the size of reports when there are a lot of failures, which increases validation speed and reduces memory usage.- Returns:
- the limit for validation results per validation report per constraint, -1 for no limit
-
setValidationResultsLimitPerConstraint
public void setValidationResultsLimitPerConstraint(long validationResultsLimitPerConstraint) ValidationReports contain validation results. The number of validation results can be limited by the user. This can be useful to reduce the size of reports when there are a lot of failures, which increases validation speed and reduces memory usage.- Parameters:
validationResultsLimitPerConstraint
- the limit for the number of validation results per report per constraint, -1 for no limit
-
getEffectiveValidationResultsLimitPerConstraint
public long getEffectiveValidationResultsLimitPerConstraint()- Returns:
- the effective limit per constraint with an upper bound of the total limit
-
getValidationResultsLimitTotal
public long getValidationResultsLimitTotal()ValidationReports contain validation results. The number of validation results can be limited by the user. This can be useful to reduce the size of reports when there are a lot of failures, which increases validation speed and reduces memory usage.- Returns:
- the limit for validation results per validation report in total, -1 for no limit
-
setValidationResultsLimitTotal
public void setValidationResultsLimitTotal(long validationResultsLimitTotal) ValidationReports contain validation results. The number of validation results can be limited by the user. This can be useful to reduce the size of reports when there are a lot of failures, which increases validation speed and reduces memory usage.- Parameters:
validationResultsLimitTotal
- the limit for the number of validation results per report in total, -1 for no limit
-
getDefaultIsolationLevel
Description copied from interface:Sail
Retrieves the defaultIsolationLevel
level on which transactions in this Sail operate.- Specified by:
getDefaultIsolationLevel
in interfaceSail
- Overrides:
getDefaultIsolationLevel
in classSailWrapper
- Returns:
- the
IsolationLevel
that will be used withSailConnection.begin()
, for SAIL connections returned bySail.getConnection()
.
-
getTransactionalValidationLimit
public long getTransactionalValidationLimit() -
setTransactionalValidationLimit
public void setTransactionalValidationLimit(long transactionalValidationLimit) -
getShapesGraphs
-
setShapesGraphs
-