use of org.apache.jena.shacl.ValidationReport in project jena by apache.
the class Shacl01_validateGraph method main.
public static void main(String... args) {
String SHAPES = "shapes.ttl";
String DATA = "data1.ttl";
Graph shapesGraph = RDFDataMgr.loadGraph(SHAPES);
Graph dataGraph = RDFDataMgr.loadGraph(DATA);
Shapes shapes = Shapes.parse(shapesGraph);
ValidationReport report = ShaclValidator.get().validate(shapes, dataGraph);
ShLib.printReport(report);
System.out.println();
RDFDataMgr.write(System.out, report.getModel(), Lang.TTL);
}
use of org.apache.jena.shacl.ValidationReport in project jena by apache.
the class TestFusekiShaclValidation method shacl_targetNode_2.
@Test
public void shacl_targetNode_2() {
try (RDFConnection conn = RDFConnection.connect(serverURL + "/ds")) {
conn.put("urn:abc:graph", DIR + "data1.ttl");
ValidationReport report = validateReport(serverURL + "/ds/shacl?graph=urn:abc:graph&target=:s3", DIR + "shapes1.ttl");
assertNotNull(report);
assertEquals(0, report.getEntries().size());
conn.update("CLEAR ALL");
}
}
use of org.apache.jena.shacl.ValidationReport in project jena by apache.
the class TestFusekiShaclValidation method shacl_targetNode_3.
@Test
public void shacl_targetNode_3() {
try (RDFConnection conn = RDFConnection.connect(serverURL + "/ds")) {
conn.put("urn:abc:graph", DIR + "data1.ttl");
ValidationReport report = validateReport(serverURL + "/ds/shacl?graph=urn:abc:graph&target=http://nosuch/node/", DIR + "shapes1.ttl");
assertNotNull(report);
assertEquals(0, report.getEntries().size());
conn.update("CLEAR ALL");
}
}
use of org.apache.jena.shacl.ValidationReport in project jena by apache.
the class TestFusekiShaclValidation method shacl_default_graph.
@Test
public void shacl_default_graph() {
try (RDFConnection conn = RDFConnection.connect(serverURL + "/ds")) {
conn.put(DIR + "data1.ttl");
ValidationReport report = validateReport(serverURL + "/ds/shacl?graph=default", DIR + "shapes1.ttl");
assertNotNull(report);
assertEquals(3, report.getEntries().size());
conn.update("CLEAR ALL");
}
}
use of org.apache.jena.shacl.ValidationReport in project jena by apache.
the class TestFusekiShaclValidation method shacl_targetNode_1.
@Test
public void shacl_targetNode_1() {
try (RDFConnection conn = RDFConnection.connect(serverURL + "/ds")) {
conn.put("urn:abc:graph", DIR + "data1.ttl");
ValidationReport report = validateReport(serverURL + "/ds/shacl?graph=urn:abc:graph&target=:s1", DIR + "shapes1.ttl");
assertNotNull(report);
assertEquals(2, report.getEntries().size());
conn.update("CLEAR ALL");
}
}
Aggregations