Class ShapeTreeManager
java.lang.Object
com.janeirodigital.shapetrees.core.validation.ShapeTreeManager
ShapeTreeManager
Shape Trees, ยง3: A shape tree manager associates a managed resource with one or more shape trees. No more
than one shape tree manager may be associated with a managed resource. A shape tree manager includes
one or more shape tree assignments via st:hasAssignment.
https://shapetrees.org/TR/specification/#manager
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addAssignment
(ShapeTreeAssignment assignment) Add aShapeTreeAssignment
to the ShapeTreeManager.getAssignmentForRoot
(ShapeTreeAssignment rootAssignment) getAssignmentForShapeTree
(URL shapeTreeUrl) static ShapeTreeManager
getFromGraph
(URL id, org.apache.jena.graph.Graph managerGraph) org.apache.jena.graph.Graph
getGraph()
Get the ShapeTreeManager as an RDF GraphgetId()
protected URL
getUrl()
Get the URL (identifier) of the ShapeTreeManagerboolean
Generates or "mints" a URL for a new ShapeTreeAssignmentmintAssignmentUrl
(URL proposedAssignmentUrl) Ensure a proposed URL for a new ShapeTreeAssigment doesn't conflict with other assignment URLs already allocated for the ShapeTreeManagervoid
removeAssignment
(ShapeTreeAssignment assignment) void
removeAssignmentForShapeTree
(URL shapeTreeUrl)
-
Constructor Details
-
ShapeTreeManager
Constructor for a new ShapeTreeManager- Parameters:
id
- URL of the ShapeTreeManager resource
-
-
Method Details
-
getUrl
Get the URL (identifier) of the ShapeTreeManager- Returns:
- URL identifier of the ShapeTreeManager
-
getGraph
Get the ShapeTreeManager as an RDF Graph- Returns:
- Graph of the ShapeTreeManager
- Throws:
ShapeTreeException
-
addAssignment
Add aShapeTreeAssignment
to the ShapeTreeManager.- Parameters:
assignment
- Shape tree assignment to add- Throws:
ShapeTreeException
-
mintAssignmentUrl
Generates or "mints" a URL for a new ShapeTreeAssignment- Returns:
- URL minted for a new shape tree assignment
-
mintAssignmentUrl
Ensure a proposed URL for a new ShapeTreeAssigment doesn't conflict with other assignment URLs already allocated for the ShapeTreeManager- Parameters:
proposedAssignmentUrl
- URL of the proposed shape tree assignment- Returns:
- Minted URL for a new shape tree assignment
-
getContainingAssignments
- Throws:
ShapeTreeException
-
hasContainingAssignments
- Throws:
ShapeTreeException
-
getFromGraph
public static ShapeTreeManager getFromGraph(URL id, org.apache.jena.graph.Graph managerGraph) throws ShapeTreeException - Throws:
ShapeTreeException
-
getAssignmentForShapeTree
-
getAssignmentForRoot
-
removeAssignment
-
removeAssignmentForShapeTree
-
getId
-
getAssignments
-