Package org.trellisldp.api
Class TrellisUtils
- java.lang.Object
-
- org.trellisldp.api.TrellisUtils
-
public final class TrellisUtils extends Object
The TrellisUtils class provides a set of convenience methods related to generating and processing RDF objects.
-
-
Field Summary
Fields Modifier and Type Field Description static String
TRELLIS_ADMIN_ROLE
The name of the trellis admin role.static String
TRELLIS_BNODE_PREFIX
The default internal blank node prefix.static String
TRELLIS_DATA_PREFIX
The default internal IRI for the root container.static String
TRELLIS_SCHEME
The internal trellis scheme.static String
TRELLIS_SESSION_PREFIX
The default internal session prefix.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static IRI
buildTrellisIdentifier(String path)
Build a Trellis identifier from a path string.static Optional<IRI>
getContainer(IRI identifier)
Get the structural-logical container for this resource.static IRI
normalizeIdentifier(IRI identifier)
For any identifier, normalize its form to remove any hashURIs or trailing slashes.static String
normalizePath(String path)
Normalize a path component for a Trellis identifier.static org.trellisldp.api.TrellisUtils.DatasetCollector
toDataset()
Collect a stream of Quads into a Dataset.static Collector<Triple,?,Graph>
toGraph()
Collect a stream of Triples into a Graph.
-
-
-
Field Detail
-
TRELLIS_SCHEME
public static final String TRELLIS_SCHEME
The internal trellis scheme.- See Also:
- Constant Field Values
-
TRELLIS_DATA_PREFIX
public static final String TRELLIS_DATA_PREFIX
The default internal IRI for the root container.- See Also:
- Constant Field Values
-
TRELLIS_BNODE_PREFIX
public static final String TRELLIS_BNODE_PREFIX
The default internal blank node prefix.- See Also:
- Constant Field Values
-
TRELLIS_SESSION_PREFIX
public static final String TRELLIS_SESSION_PREFIX
The default internal session prefix.- See Also:
- Constant Field Values
-
TRELLIS_ADMIN_ROLE
public static final String TRELLIS_ADMIN_ROLE
The name of the trellis admin role.- See Also:
- Constant Field Values
-
-
Method Detail
-
getContainer
public static Optional<IRI> getContainer(IRI identifier)
Get the structural-logical container for this resource.- Parameters:
identifier
- the resource identifier- Returns:
- a container, if one exists. Only the root resource would return empty here.
-
normalizeIdentifier
public static IRI normalizeIdentifier(IRI identifier)
For any identifier, normalize its form to remove any hashURIs or trailing slashes.- Parameters:
identifier
- the identifier- Returns:
- a normalized identifier
-
buildTrellisIdentifier
public static IRI buildTrellisIdentifier(String path)
Build a Trellis identifier from a path string.- Parameters:
path
- the resource path- Returns:
- the trellis identifier
-
normalizePath
public static String normalizePath(String path)
Normalize a path component for a Trellis identifier.- Parameters:
path
- the path- Returns:
- the normalized path
-
toGraph
public static Collector<Triple,?,Graph> toGraph()
Collect a stream of Triples into a Graph.- Returns:
- a graph
-
-