Let's say I have the following shapes graph
camo:exampleShape
a sh:NodeShape;
sh:targetClass cm:Moving;
sh:property [
a sh:PropertyShape;
sh:path cm:dofNumber ;
sh:minInclusive 1;
] .
This shapes file is stored with appropriate prefixes (not shown) and I read it using the Jena API the following way.
import org.apache.jena.riot.RDFDataMgr;
import org.apache.jena.shacl.Shapes;
Graph shapesGraph = RDFDataMgr.loadGraph("path/to/shape.ttl");
Shapes shapes = Shape.parse(shapesGraph);
What I would like to know is how to programmatically read the following using the Jena API:
- What kind of shape is it? (i.e. Node Shape) ?
- What is the target class ? (i.e. cm:Moving) ?
- Does it have any property shapes and along what path (i.e. cm:dofNumber) ?
Thanks in advance!