Class Shapes

  • All Implemented Interfaces:
    java.lang.Iterable<org.apache.jena.shacl.parser.Shape>

    public class Shapes
    extends java.lang.Object
    implements java.lang.Iterable<org.apache.jena.shacl.parser.Shape>
    A collection of shapes as output by the SHACL parser. Usage:
     Shapes myShapes = Shapes.parse(graph);
     
    • Method Detail

      • parse

        public static Shapes parse​(Model model)
        Parse the model and return the shapes.
      • parse

        public static Shapes parse​(java.lang.String fileOrURL)
        Load the file, parse the graph and return the shapes.
      • parse

        public static Shapes parse​(java.lang.String fileOrURL,
                                   boolean withImports)
        Load the file, parse the graph and return the shapes.
      • parse

        public static Shapes parse​(Graph graph)
        Parse the graph and return the shapes connected to the targets.
      • parseTargets

        @Deprecated
        public static Shapes parseTargets​(Graph graph)
        Deprecated.
        Parse the graph and return the shapes connected to the targets.
      • isEmpty

        public boolean isEmpty()
      • getTargetShapes

        public java.util.Collection<org.apache.jena.shacl.parser.Shape> getTargetShapes()
        Return the shapes with targets.
      • getImports

        public java.util.Collection<Node> getImports()
      • getBase

        public Node getBase()
      • getBaseURI

        public java.lang.String getBaseURI()
      • getPrefixMap

        public PrefixMap getPrefixMap()
      • getGraph

        public Graph getGraph()
      • getShape

        public org.apache.jena.shacl.parser.Shape getShape​(Node node)
      • getShapeMap

        public java.util.Map<Node,​org.apache.jena.shacl.parser.Shape> getShapeMap()
      • getTargets

        public org.apache.jena.shacl.engine.Targets getTargets()
      • numShapes

        public int numShapes()
      • numRootShapes

        public int numRootShapes()
      • iterator

        public java.util.Iterator<org.apache.jena.shacl.parser.Shape> iterator()
        Iterator over the shapes with targets
        Specified by:
        iterator in interface java.lang.Iterable<org.apache.jena.shacl.parser.Shape>
      • iteratorAll

        public java.util.Iterator<org.apache.jena.shacl.parser.Shape> iteratorAll()
        Iterator over the shapes with targets and with explicit type NodeShape or PropertyShape.