Class ValidationUtilities

java.lang.Object
it.uniroma2.art.semanticturkey.validation.ValidationUtilities

public class ValidationUtilities extends Object
Utility class about validation.
Author:
Manuel Fiorelli
  • Constructor Details

    • ValidationUtilities

      public ValidationUtilities()
  • Method Details

    • executeWithoutValidation

      public static <Y extends Exception> void executeWithoutValidation(boolean validationEnabled, org.eclipse.rdf4j.repository.RepositoryConnection conn, ValidationUtilities.ThrowingConsumer<org.eclipse.rdf4j.repository.RepositoryConnection,Y> consumer) throws Y
      Disables validation (if enabled) on the given connection to the core repository of the provided project.
      Parameters:
      validationEnabled -
      conn -
      consumer -
      Throws:
      Y
    • isValidationEnabled

      public static boolean isValidationEnabled(org.eclipse.rdf4j.repository.RepositoryConnection conn)
      Determines whether validation is enabled on the provided connection
      Parameters:
      conn -
      Returns:
    • isValidationEnabled

      public static boolean isValidationEnabled(STServiceContext stServiceContext)
      Determines whether validation is enabled on the provided service context. It assumes that validation is never enabled on a repository other than the core one.
      Parameters:
      stServiceContext -
      Returns:
    • getAddGraphIfValidatonEnabled

      public static org.eclipse.rdf4j.model.IRI getAddGraphIfValidatonEnabled(boolean validationEnabled, org.eclipse.rdf4j.model.IRI graph)
      Returns the add graph if validation is enabled
      Parameters:
      validationEnabled -
      graph -
      Returns:
    • getClearThroughGraphIfValidationEnabled

      public static org.eclipse.rdf4j.model.Resource getClearThroughGraphIfValidationEnabled(boolean validationEnabled, org.eclipse.rdf4j.model.IRI graph)
      Returns a graph that indicates to clear staged additions if validation is enabled, or to clear the already asserted graph
      Parameters:
      validationEnabled -
      ont -
      Returns:
    • getRemoveGraphIfValidatonEnabled

      public static org.eclipse.rdf4j.model.Resource getRemoveGraphIfValidatonEnabled(boolean validationEnabled, org.eclipse.rdf4j.model.IRI graph)
      Returns the remove graph if validation is enabled
      Parameters:
      validationEnabled -
      graph -
      Returns: