Class ValidationUtilities
java.lang.Object
it.uniroma2.art.semanticturkey.validation.ValidationUtilities
Utility class about validation.
- Author:
- Manuel Fiorelli
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
ValidationUtilities.ThrowingConsumer<X,
Y extends Exception> static interface
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic <Y extends Exception>
voidexecuteWithoutValidation
(boolean validationEnabled, org.eclipse.rdf4j.repository.RepositoryConnection conn, ValidationUtilities.ThrowingConsumer<org.eclipse.rdf4j.repository.RepositoryConnection, Y> consumer) Disables validation (if enabled) on the given connection to the core repository of the provided project.static org.eclipse.rdf4j.model.IRI
getAddGraphIfValidatonEnabled
(boolean validationEnabled, org.eclipse.rdf4j.model.IRI graph) Returns the add graph if validation is enabledstatic 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 graphstatic org.eclipse.rdf4j.model.Resource
getRemoveGraphIfValidatonEnabled
(boolean validationEnabled, org.eclipse.rdf4j.model.IRI graph) Returns the remove graph if validation is enabledstatic boolean
isValidationEnabled
(STServiceContext stServiceContext) Determines whether validation is enabled on the provided service context.static boolean
isValidationEnabled
(org.eclipse.rdf4j.repository.RepositoryConnection conn) Determines whether validation is enabled on the provided connection
-
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 YDisables 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
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:
-