use of org.apache.jena.shacl.validation.ReportItem in project jena by apache.
the class ShAnd method validate.
@Override
public ReportItem validate(ValidationContext vCxt, Graph data, Node node) {
for (Shape sh : others) {
ValidationContext vCxt2 = ValidationContext.create(vCxt);
ValidationProc.execValidateShape(vCxt2, data, sh, node);
boolean innerConforms = vCxt2.generateReport().conforms();
if (!innerConforms) {
String msg = toString() + " at focusNode " + displayStr(node);
return new ReportItem(msg, node);
}
}
return null;
}
use of org.apache.jena.shacl.validation.ReportItem in project jena by apache.
the class ShNot method validate.
@Override
public ReportItem validate(ValidationContext vCxt, Graph data, Node node) {
ValidationContext vCxt2 = ValidationContext.create(vCxt);
ValidationProc.execValidateShape(vCxt2, data, other, node);
boolean innerConforms = vCxt2.generateReport().conforms();
if (!innerConforms)
return null;
String msg = "Not[" + other + "] at focusNode " + displayStr(node);
return new ReportItem(msg, node);
}
use of org.apache.jena.shacl.validation.ReportItem in project jena by apache.
the class ShXone method validate.
@Override
public ReportItem validate(ValidationContext vCxt, Graph data, Node node) {
int c = 0;
for (Shape sh : others) {
ValidationContext vCxt2 = ValidationContext.create(vCxt);
ValidationProc.execValidateShape(vCxt2, data, sh, node);
boolean innerConforms = vCxt2.generateReport().conforms();
if (innerConforms) {
c++;
// Choice: count all vs break as soon as error detected
// if ( c > 1 )
// break;
}
}
if (c == 1)
return null;
String msg = toString() + " has " + c + " conforming shapes at focusNode " + displayStr(node);
return new ReportItem(msg, node);
}
use of org.apache.jena.shacl.validation.ReportItem in project jena by apache.
the class ConstraintDataTerm method applyConstraintDataTerm.
private void applyConstraintDataTerm(ValidationContext vCxt, Shape shape, Graph data, Node focusNode, Path path, Node term) {
ReportItem item = validate(vCxt, data, term);
if (item == null)
return;
vCxt.reportEntry(item.getMessage(), shape, focusNode, path, item.getValue(), this);
}
use of org.apache.jena.shacl.validation.ReportItem in project jena by apache.
the class ConstraintTerm method applyConstraintTerm.
private void applyConstraintTerm(ValidationContext vCxt, Shape shape, Node focusNode, Path path, Node term) {
ReportItem item = validate(vCxt, term);
if (item == null)
return;
vCxt.reportEntry(item, shape, focusNode, path, this);
}
Aggregations