Class ShaclValidator.Builder

java.lang.Object
org.eclipse.rdf4j.sail.shacl.ShaclValidator.Builder
All Implemented Interfaces:
Cloneable
Enclosing class:
ShaclValidator

public static class ShaclValidator.Builder extends Object implements Cloneable
  • Method Details

    • settingsFrom

      public static ShaclValidator.Builder settingsFrom(ShaclSail shaclSail)
      Create a builder with settings copied from an existing ShaclSail.
      Parameters:
      shaclSail - the configured SHACL sail
      Returns:
      a builder initialized from the supplied sail
    • withShapes

      public ShaclValidator.BuilderWithShapes withShapes(Sail shapes)
      Use the supplied SHACL shapes sail for validation.
      Parameters:
      shapes - the shapes sail
      Returns:
      a builder that validates with the supplied shapes
    • withShapes

      public ShaclValidator.BuilderWithShapes withShapes(File shapesFile, String baseURI)
      Load SHACL shapes from a file using an auto-detected RDF format.
    • withShapes

      public ShaclValidator.BuilderWithShapes withShapes(File shapesFile)
      Load SHACL shapes from a file using an auto-detected RDF format.
    • withShapes

      public ShaclValidator.BuilderWithShapes withShapes(Path shapesPath, String baseURI)
      Load SHACL shapes from a path using an auto-detected RDF format.
    • withShapes

      public ShaclValidator.BuilderWithShapes withShapes(Path shapesPath)
      Load SHACL shapes from a path using an auto-detected RDF format.
    • withShapes

      public ShaclValidator.BuilderWithShapes withShapes(URL shapesUrl, String baseURI)
      Load SHACL shapes from a URL using an auto-detected RDF format.
    • withShapes

      public ShaclValidator.BuilderWithShapes withShapes(URL shapesUrl)
      Load SHACL shapes from a URL using an auto-detected RDF format.
    • withShapes

      public ShaclValidator.BuilderWithShapes withShapes(InputStream shapesInputStream, String baseURI)
      Load SHACL shapes from an input stream using an auto-detected RDF format. The input stream is not closed by this method.
    • withShapes

      public ShaclValidator.BuilderWithShapes withShapes(String shapes, String baseURI)
      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

      public ShaclValidator.BuilderWithShapes withShapes(File shapesFile, RDFFormat format)
      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

      public ShaclValidator.BuilderWithShapes withShapes(Path shapesPath, RDFFormat format)
      Load SHACL shapes from a path using the supplied RDF format.
    • withShapes

      public ShaclValidator.BuilderWithShapes withShapes(URL shapesUrl, String baseURI, RDFFormat format)
      Load SHACL shapes from a URL using the supplied base URI and RDF format.
    • withShapes

      public ShaclValidator.BuilderWithShapes withShapes(URL shapesUrl, RDFFormat format)
      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

      public ShaclValidator.BuilderWithShapes withShapes(InputStream shapesInputStream, RDFFormat format)
      Load SHACL shapes from an input stream using the supplied RDF format. The input stream is not closed by this method.
    • withShapes

      public ShaclValidator.BuilderWithShapes 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

      public ShaclValidator.BuilderWithShapes withShapes(String shapes, RDFFormat format)
      Load SHACL shapes from RDF content in a string using the supplied RDF format.
    • build

      public ShaclValidator.Validator build()
      Build a validator that expects shapes to be supplied at validation time.
      Returns:
      a validator configured with the current settings
    • clone

      public ShaclValidator.Builder clone()
    • shapeContexts

      public ShaclValidator.Builder shapeContexts(Resource... shapeContexts)
      Set the contexts to use when discovering SHACL shapes.
      Parameters:
      shapeContexts - contexts to scan, or null to scan all contexts
      Returns:
      this builder instance
    • setGlobalLogValidationExecution

      public ShaclValidator.Builder setGlobalLogValidationExecution(boolean loggingEnabled)
      Enable or disable global logging of validation execution.
      Parameters:
      loggingEnabled - whether to enable logging
      Returns:
      this builder instance
    • setLogValidationViolations

      public ShaclValidator.Builder setLogValidationViolations(boolean logValidationViolations)
      Enable or disable logging of validation violations.
      Parameters:
      logValidationViolations - whether to log violations
      Returns:
      this builder instance
    • setParallelValidation

      public ShaclValidator.Builder setParallelValidation(boolean parallelValidation)
      Enable or disable parallel validation.
      Parameters:
      parallelValidation - whether to run validation in parallel
      Returns:
      this builder instance
    • setCacheSelectNodes

      public ShaclValidator.Builder setCacheSelectNodes(boolean cacheSelectNodes)
      Enable or disable caching of select nodes during validation.
      Parameters:
      cacheSelectNodes - whether to cache select nodes
      Returns:
      this builder instance
    • setRdfsSubClassReasoning

      public ShaclValidator.Builder setRdfsSubClassReasoning(boolean rdfsSubClassReasoning)
      Enable or disable RDFS subclass reasoning during validation.
      Parameters:
      rdfsSubClassReasoning - whether to enable subclass reasoning
      Returns:
      this builder instance
    • setIncludeInferredStatements

      public ShaclValidator.Builder setIncludeInferredStatements(boolean includeInferredStatements)
      Enable or disable inclusion of inferred statements during validation.
      Parameters:
      includeInferredStatements - whether to include inferred statements
      Returns:
      this builder instance
    • disableValidation

      public ShaclValidator.Builder disableValidation()
      Disable SHACL validation entirely.
      Returns:
      this builder instance
    • enableValidation

      public ShaclValidator.Builder enableValidation()
      Enable SHACL validation.
      Returns:
      this builder instance
    • setLogValidationPlans

      public ShaclValidator.Builder setLogValidationPlans(boolean logValidationPlans)
      Enable or disable logging of validation plans.
      Parameters:
      logValidationPlans - whether to log validation plans
      Returns:
      this builder instance
    • setPerformanceLogging

      public ShaclValidator.Builder setPerformanceLogging(boolean performanceLogging)
      Enable or disable performance logging during validation.
      Parameters:
      performanceLogging - whether to log performance details
      Returns:
      this builder instance
    • setSerializableValidation

      public ShaclValidator.Builder setSerializableValidation(boolean serializableValidation)
      Enable or disable serializable validation mode.
      Parameters:
      serializableValidation - whether to enable serializable validation
      Returns:
      this builder instance
    • setEclipseRdf4jShaclExtensions

      public ShaclValidator.Builder setEclipseRdf4jShaclExtensions(boolean eclipseRdf4jShaclExtensions)
      Enable or disable RDF4J SHACL extensions.
      Parameters:
      eclipseRdf4jShaclExtensions - whether to enable the extensions
      Returns:
      this builder instance
    • setDashDataShapes

      public ShaclValidator.Builder setDashDataShapes(boolean dashDataShapes)
      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

      public ShaclValidator.Builder setValidationResultsLimitTotal(long validationResultsLimitTotal)
      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

      public ShaclValidator.Builder setTransactionalValidationLimit(long transactionalValidationLimit)
      Set the transactional validation limit.
      Parameters:
      transactionalValidationLimit - the transactional validation limit
      Returns:
      this builder instance
    • setValidationTimeoutMillis

      public ShaclValidator.Builder setValidationTimeoutMillis(long validationTimeoutMillis)
      Set the validation timeout in milliseconds.
      Parameters:
      validationTimeoutMillis - timeout in milliseconds, or a negative value to disable the timeout
      Returns:
      this builder instance
    • setShapesGraphs

      public ShaclValidator.Builder setShapesGraphs(Set<IRI> shapesGraphs)
      Set the SHACL shapes graphs to use when discovering shapes.

      Use RDF4J.NIL or SESAME.NIL to indicate the default graph.

      Parameters:
      shapesGraphs - the shapes graphs, or null to scan all graphs
      Returns:
      this builder instance