Package org.apache.jena.shacl
Class Shapes
- java.lang.Object
-
- org.apache.jena.shacl.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 Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Node
getBase()
Graph
getGraph()
java.util.Collection<Node>
getImports()
org.apache.jena.shacl.parser.Shape
getShape(Node node)
java.util.Map<Node,org.apache.jena.shacl.parser.Shape>
getShapeMap()
org.apache.jena.shacl.engine.Targets
getTargets()
java.util.Collection<org.apache.jena.shacl.parser.Shape>
getTargetShapes()
Return the shapes with targets.boolean
isEmpty()
java.util.Iterator<org.apache.jena.shacl.parser.Shape>
iterator()
Iterator over the shapes with targetsjava.util.Iterator<org.apache.jena.shacl.parser.Shape>
iteratorAll()
Iterator over the shapes with targets and with explicit type NodeShape or PropertyShape.int
numRootShapes()
int
numShapes()
static Shapes
parse(java.lang.String fileOrURL)
Load the file, parse the graph and return the shapes.static Shapes
parse(java.lang.String fileOrURL, boolean withImports)
Load the file, parse the graph and return the shapes.static Shapes
parse(Graph graph)
Parse the graph and return the shapes connected to the targets.static Shapes
parse(Model model)
Parse the model and return the shapes.static Shapes
parseTargets(Graph graph)
Parse the graph and return the shapes connected to the targets.
-
-
-
Method Detail
-
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
public static Shapes parseTargets(Graph graph)
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()
-
getShape
public org.apache.jena.shacl.parser.Shape getShape(Node node)
-
getShapeMap
public java.util.Map<Node,org.apache.jena.shacl.parser.Shape> getShapeMap()
-
getGraph
public Graph getGraph()
-
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 interfacejava.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.
-
-