Class ShaclValidator.Builder
java.lang.Object
org.eclipse.rdf4j.sail.shacl.ShaclValidator.Builder
- All Implemented Interfaces:
Cloneable
- Enclosing class:
ShaclValidator
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Build a validator that expects shapes to be supplied at validation time.clone()Disable SHACL validation entirely.Enable SHACL validation.setCacheSelectNodes(boolean cacheSelectNodes) Enable or disable caching of select nodes during validation.setDashDataShapes(boolean dashDataShapes) Enable or disable DASH data shapes support.setEclipseRdf4jShaclExtensions(boolean eclipseRdf4jShaclExtensions) Enable or disable RDF4J SHACL extensions.setGlobalLogValidationExecution(boolean loggingEnabled) Enable or disable global logging of validation execution.setIncludeInferredStatements(boolean includeInferredStatements) Enable or disable inclusion of inferred statements during validation.setLogValidationPlans(boolean logValidationPlans) Enable or disable logging of validation plans.setLogValidationViolations(boolean logValidationViolations) Enable or disable logging of validation violations.setParallelValidation(boolean parallelValidation) Enable or disable parallel validation.setPerformanceLogging(boolean performanceLogging) Enable or disable performance logging during validation.setRdfsSubClassReasoning(boolean rdfsSubClassReasoning) Enable or disable RDFS subclass reasoning during validation.setSerializableValidation(boolean serializableValidation) Enable or disable serializable validation mode.setShapesGraphs(Set<IRI> shapesGraphs) Set the SHACL shapes graphs to use when discovering shapes.static ShaclValidator.BuildersettingsFrom(ShaclSail shaclSail) Create a builder with settings copied from an existingShaclSail.setTransactionalValidationLimit(long transactionalValidationLimit) Set the transactional validation limit.setValidationResultsLimitPerConstraint(long validationResultsLimitPerConstraint) Set the maximum number of validation results per constraint.setValidationResultsLimitTotal(long validationResultsLimitTotal) Set the total maximum number of validation results in a report.setValidationTimeoutMillis(long validationTimeoutMillis) Set the validation timeout in milliseconds.shapeContexts(Resource... shapeContexts) Set the contexts to use when discovering SHACL shapes.withShapes(File shapesFile) Load SHACL shapes from a file using an auto-detected RDF format.withShapes(File shapesFile, String baseURI) Load SHACL shapes from a file using an auto-detected RDF format.withShapes(File shapesFile, String baseURI, RDFFormat format) Load SHACL shapes from a file using the supplied base URI and RDF format.withShapes(File shapesFile, RDFFormat format) Load SHACL shapes from a file using the supplied RDF format.withShapes(InputStream shapesInputStream, String baseURI) Load SHACL shapes from an input stream using an auto-detected RDF format.withShapes(InputStream shapesInputStream, String baseURI, RDFFormat format) Load SHACL shapes from an input stream using the supplied base URI and RDF format.withShapes(InputStream shapesInputStream, RDFFormat format) Load SHACL shapes from an input stream using the supplied RDF format.withShapes(String shapes, String baseURI) Load SHACL shapes from RDF content in a string using an auto-detected RDF format.withShapes(String shapes, String baseURI, RDFFormat format) Load SHACL shapes from RDF content in a string using the supplied base URI and RDF format.withShapes(String shapes, RDFFormat format) Load SHACL shapes from RDF content in a string using the supplied RDF format.withShapes(URL shapesUrl) Load SHACL shapes from a URL using an auto-detected RDF format.withShapes(URL shapesUrl, String baseURI) Load SHACL shapes from a URL using an auto-detected RDF format.withShapes(URL shapesUrl, String baseURI, RDFFormat format) Load SHACL shapes from a URL using the supplied base URI and RDF format.withShapes(URL shapesUrl, RDFFormat format) Load SHACL shapes from a URL using the supplied RDF format.withShapes(Path shapesPath) Load SHACL shapes from a path using an auto-detected RDF format.withShapes(Path shapesPath, String baseURI) Load SHACL shapes from a path using an auto-detected RDF format.withShapes(Path shapesPath, String baseURI, RDFFormat format) Load SHACL shapes from a path using the supplied base URI and RDF format.withShapes(Path shapesPath, RDFFormat format) Load SHACL shapes from a path using the supplied RDF format.withShapes(Sail shapes) Use the supplied SHACL shapes sail for validation.
-
Method Details
-
settingsFrom
Create a builder with settings copied from an existingShaclSail.- Parameters:
shaclSail- the configured SHACL sail- Returns:
- a builder initialized from the supplied sail
-
withShapes
Use the supplied SHACL shapes sail for validation.- Parameters:
shapes- the shapes sail- Returns:
- a builder that validates with the supplied shapes
-
withShapes
Load SHACL shapes from a file using an auto-detected RDF format. -
withShapes
Load SHACL shapes from a file using an auto-detected RDF format. -
withShapes
Load SHACL shapes from a path using an auto-detected RDF format. -
withShapes
Load SHACL shapes from a path using an auto-detected RDF format. -
withShapes
Load SHACL shapes from a URL using an auto-detected RDF format. -
withShapes
Load SHACL shapes from a URL using an auto-detected RDF format. -
withShapes
Load SHACL shapes from an input stream using an auto-detected RDF format. The input stream is not closed by this method. -
withShapes
Load SHACL shapes from RDF content in a string using an auto-detected RDF format. -
withShapes
public ShaclValidator.BuilderWithShapes withShapes(File shapesFile, String baseURI, RDFFormat format) Load SHACL shapes from a file using the supplied base URI and RDF format. -
withShapes
Load SHACL shapes from a file using the supplied RDF format. -
withShapes
public ShaclValidator.BuilderWithShapes withShapes(Path shapesPath, String baseURI, RDFFormat format) Load SHACL shapes from a path using the supplied base URI and RDF format. -
withShapes
Load SHACL shapes from a path using the supplied RDF format. -
withShapes
Load SHACL shapes from a URL using the supplied base URI and RDF format. -
withShapes
Load SHACL shapes from a URL using the supplied RDF format. -
withShapes
public ShaclValidator.BuilderWithShapes withShapes(InputStream shapesInputStream, String baseURI, RDFFormat format) Load SHACL shapes from an input stream using the supplied base URI and RDF format. The input stream is not closed by this method. -
withShapes
Load SHACL shapes from an input stream using the supplied RDF format. The input stream is not closed by this method. -
withShapes
Load SHACL shapes from RDF content in a string using the supplied base URI and RDF format. -
withShapes
Load SHACL shapes from RDF content in a string using the supplied RDF format. -
build
Build a validator that expects shapes to be supplied at validation time.- Returns:
- a validator configured with the current settings
-
clone
-
shapeContexts
Set the contexts to use when discovering SHACL shapes.- Parameters:
shapeContexts- contexts to scan, ornullto scan all contexts- Returns:
- this builder instance
-
setGlobalLogValidationExecution
Enable or disable global logging of validation execution.- Parameters:
loggingEnabled- whether to enable logging- Returns:
- this builder instance
-
setLogValidationViolations
Enable or disable logging of validation violations.- Parameters:
logValidationViolations- whether to log violations- Returns:
- this builder instance
-
setParallelValidation
Enable or disable parallel validation.- Parameters:
parallelValidation- whether to run validation in parallel- Returns:
- this builder instance
-
setCacheSelectNodes
Enable or disable caching of select nodes during validation.- Parameters:
cacheSelectNodes- whether to cache select nodes- Returns:
- this builder instance
-
setRdfsSubClassReasoning
Enable or disable RDFS subclass reasoning during validation.- Parameters:
rdfsSubClassReasoning- whether to enable subclass reasoning- Returns:
- this builder instance
-
setIncludeInferredStatements
Enable or disable inclusion of inferred statements during validation.- Parameters:
includeInferredStatements- whether to include inferred statements- Returns:
- this builder instance
-
disableValidation
Disable SHACL validation entirely.- Returns:
- this builder instance
-
enableValidation
Enable SHACL validation.- Returns:
- this builder instance
-
setLogValidationPlans
Enable or disable logging of validation plans.- Parameters:
logValidationPlans- whether to log validation plans- Returns:
- this builder instance
-
setPerformanceLogging
Enable or disable performance logging during validation.- Parameters:
performanceLogging- whether to log performance details- Returns:
- this builder instance
-
setSerializableValidation
Enable or disable serializable validation mode.- Parameters:
serializableValidation- whether to enable serializable validation- Returns:
- this builder instance
-
setEclipseRdf4jShaclExtensions
Enable or disable RDF4J SHACL extensions.- Parameters:
eclipseRdf4jShaclExtensions- whether to enable the extensions- Returns:
- this builder instance
-
setDashDataShapes
Enable or disable DASH data shapes support.- Parameters:
dashDataShapes- whether to enable DASH data shapes- Returns:
- this builder instance
-
setValidationResultsLimitPerConstraint
public ShaclValidator.Builder setValidationResultsLimitPerConstraint(long validationResultsLimitPerConstraint) Set the maximum number of validation results per constraint.- Parameters:
validationResultsLimitPerConstraint- limit per constraint, or a negative value to defer to the total limit- Returns:
- this builder instance
-
setValidationResultsLimitTotal
Set the total maximum number of validation results in a report.- Parameters:
validationResultsLimitTotal- total limit, or a negative value for no limit- Returns:
- this builder instance
-
setTransactionalValidationLimit
Set the transactional validation limit.- Parameters:
transactionalValidationLimit- the transactional validation limit- Returns:
- this builder instance
-
setValidationTimeoutMillis
Set the validation timeout in milliseconds.- Parameters:
validationTimeoutMillis- timeout in milliseconds, or a negative value to disable the timeout- Returns:
- this builder instance
-
setShapesGraphs
Set the SHACL shapes graphs to use when discovering shapes.Use
RDF4J.NILorSESAME.NILto indicate the default graph.- Parameters:
shapesGraphs- the shapes graphs, ornullto scan all graphs- Returns:
- this builder instance
-