use of org.apache.jena.shacl.engine.TargetType in project jena by apache.
the class ShapesParser method accTarget.
private static void accTarget(Collection<Target> acc, Graph shapesGraph, Node shape, TargetType targetType) {
ExtendedIterator<Triple> iter = shapesGraph.find(shape, targetType.predicate, null);
Graph graph;
switch(targetType) {
// Java 14 has "->"
case targetExtension:
graph = shapesGraph;
break;
// These do not need access to the shapes graph so don't force holding on the the graph reference.
case implicitClass:
case targetClass:
case targetNode:
case targetObjectsOf:
case targetSubjectsOf:
default:
graph = null;
break;
}
try {
iter.mapWith(triple -> Target.create(triple.getSubject(), targetType, triple.getObject(), graph)).forEachRemaining(target -> acc.add(target));
} finally {
iter.close();
}
}
Aggregations