Class GraphValidation


  • public class GraphValidation
    extends java.lang.Object
    Operations to work on graph with SHACL. Example: update with possible exception:
          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 Detail

      • GraphValidation

        public GraphValidation()