Class Shapes

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

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

    • parse

      public static Shapes parse(org.apache.jena.rdf.model.Model model)
      Parse the model and return the shapes.
    • parse

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

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

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

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

      public boolean isEmpty()
    • getTargetShapes

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

      public Collection<org.apache.jena.graph.Node> getImports()
    • getBase

      public org.apache.jena.graph.Node getBase()
    • getBaseURI

      public String getBaseURI()
    • getPrefixMap

      public org.apache.jena.riot.system.PrefixMap getPrefixMap()
    • getGraph

      public org.apache.jena.graph.Graph getGraph()
    • getShape

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

      public Map<org.apache.jena.graph.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 Iterator<org.apache.jena.shacl.parser.Shape> iterator()
      Iterator over the shapes with targets
      Specified by:
      iterator in interface Iterable<org.apache.jena.shacl.parser.Shape>
    • iteratorAll

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