public Model validateModel(Dataset dataset,URI shapesGraphURI,Resource minSeverity,boolean validateShapes,Function<RDFNode,String> labelFunction,ProgressMonitor monitor) throws InterruptedException {
  if (dataset.getDefaultModel() == null) {
    throw new IllegalArgumentException("Dataset requires a default model");
  }
  Model shapesModel=dataset.getNamedModel(shapesGraphURI.toString());
  if (monitor != null) {
    monitor.subTask("Preparing execution plan");
  }
  List<Property> constraintProperties=SHACLUtil.getAllConstraintProperties(validateShapes);
  Map<Resource,List<SHConstraint>> map=buildShape2ConstraintsMap(shapesModel,dataset.getDefaultModel(),constraintProperties,validateShapes);
  if (monitor != null) {
    monitor.subTask("");
  }
  if (monitor != null) {
    monitor.beginTask("Validating constraints for " + map.size() + " shapes...",map.size());
  }
  Model results=JenaUtil.createMemoryModel();
  results.setNsPrefixes(dataset.getDefaultModel());
  for (  Resource shape : map.keySet()) {
    for (    SHConstraint constraint : map.get(shape)) {
      validateConstraintForShape(dataset,shapesGraphURI,minSeverity,constraint,shape,results,labelFunction,monitor);
      if (monitor != null) {
        monitor.worked(1);
        if (monitor.isCanceled()) {
          throw new InterruptedException();
        }
      }
    }
  }
  return results;
}

public Model validateModel ( Dataset dataset , URI shapesGraphURI , Resource minSeverity , boolean validateShapes , Function < RDFNode , String > labelFunction , ProgressMonitor monitor ) throws InterruptedException { if ( dataset . getDefaultModel ( ) == null ) { throw new IllegalArgumentException ( "Dataset requires a default model" ) ; } Model shapesModel = dataset . getNamedModel ( shapesGraphURI . toString ( ) ) ; if ( monitor != null ) { monitor . subTask ( "Preparing execution plan" ) ; } List < Property > constraintProperties = SHACLUtil . getAllConstraintProperties ( validateShapes ) ; Map < Resource , List < SHConstraint > > map = buildShape2ConstraintsMap ( shapesModel , dataset . getDefaultModel ( ) , constraintProperties , validateShapes ) ; if ( monitor != null ) { monitor . subTask ( "" ) ; } if ( monitor != null ) { monitor . beginTask ( "Validating constraints for " + map . size ( ) + " shapes..." , map . size ( ) ) ; } Model results = JenaUtil . createMemoryModel ( ) ; results . setNsPrefixes ( dataset . getDefaultModel ( ) ) ; for ( Resource shape : map . keySet ( ) ) { for ( SHConstraint constraint : map . get ( shape ) ) { validateConstraintForShape ( dataset , shapesGraphURI , minSeverity , constraint , shape , results , labelFunction , monitor ) ; if ( monitor != null ) { monitor . worked ( 1 ) ; if ( monitor . isCanceled ( ) ) { throw new InterruptedException ( ) ; } } } } return results ; }
validates all resources in a given model , which is expected to be the default graph of a given dataset .
