public class GraphValidation extends Object
Shapes shapes = ...
try {
GraphValidation.updateEx(shapes, graph, ()->{
... application code ...
});
} catch (ShaclValidationException ex) {
ShLib.printReport(ex.getReport());
}
If validation fails, the transaction is aborted.
Example: update with report:
Shapes shapes = ...
ValidationReport report = GraphValidation.updateEx(shapes, graph, ()->{
... application code ...
});
if ( ! report.conforms() ) {
// Update aborted.
ShLib.printReport(report);
}
Example: update regardless and then report:
Shapes shapes = ...
... graph changes ...
ValidationReport report = ShaclValidation.validate(shapes, graph);
if ( ! report.conforms() ) {
// Changes happened.
ShLib.printReport(report);
}
| Constructor and Description |
|---|
GraphValidation() |
| Modifier and Type | Method and Description |
|---|---|
static ValidationReport |
update(Shapes shapes,
Graph data,
Runnable update)
Update the graph.
|
static ValidationReport |
updateAndReport(Shapes shapes,
Graph data,
Runnable update)
Update the graph.
|
public static ValidationReport updateAndReport(Shapes shapes, Graph data, Runnable update)
ShaclValidationException if there are any validation results from
shapes (of any severity). If the update results in a valid graph, return
without exception (with a ValidationReport with
ValidationReport.conforms returning true).public static ValidationReport update(Shapes shapes, Graph data, Runnable update) throws ShaclValidationException
ShaclValidationException if there are any validation results from
shapes (of any severity). If the update results in a valid graph, return
without exception (with a ValidationReport with
ValidationReport.conforms returning true).ShaclValidationExceptionLicenced under the Apache License, Version 2.0