Package com.complexible.stardog
Class Contexts
java.lang.Object
com.complexible.stardog.Contexts
Defines constants that represent special URIs for contexts (named graphs).
- Since:
- 0.9
- Version:
- 6.0
- Author:
- Evren Sirin, Michael Grove
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final IRISpecial URI representing all local and virtual graphsstatic final IRISpecial URI representing the default (no) context in Stardog.static final IRISpecial URI representing all contexts in Stardog, including the default (no) context graph.static final IRISpecial URI representing all local named graphs in Stardog, excluding the default graph.static final IRISpecial URI representing all virtual graphs -
Method Summary
Modifier and TypeMethodDescriptionstatic ResourcedefaultToNull(Resource theResource) Takes a Resource identifying a named graph, and if it is the constant for theDEFAULTgraph, it will return null, otherwise it returns the parameter as-is.static booleanReturn whether or not the resource represents the meta-contextALLstatic booleanisAllOrLocal(Resource theContext) static booleanisAllOrLocal(Collection<? extends Resource> theContexts) static booleanisDefaultGraphOrWildcard(Resource theContext) static booleanReturn whether or not the resource represents the meta-contextLOCALstatic booleanReturn whether or not the resource represents the meta-contextNAMEDstatic booleanisSingleton(Set<Resource> theContexts) Returns true if the set of contexts is a singletonstatic booleanTests whether the supplied graph name is either the virtual wildcard (VIRTUAL) or any particular virtual graph IRI (one beginning with thevirtual://prefix).static booleanisVirtualWildcard(Resource theContext) Return whether or not the resource represents the meta-contextVIRTUAL.static booleanisWildcard(Resource theContext) static ResourcenullToDefault(Resource theResource) Takes a Resource identifying a named graph, and if it is null, returns the constant for theDEFAULTgraph.
-
Field Details
-
DEFAULT
Special URI representing the default (no) context in Stardog. -
LOCAL
Special URI representing all contexts in Stardog, including the default (no) context graph. -
NAMED
Special URI representing all local named graphs in Stardog, excluding the default graph. -
VIRTUAL
Special URI representing all virtual graphs -
ALL
Special URI representing all local and virtual graphs
-
-
Method Details
-
isAllOrLocal
-
isAllOrLocal
-
isAll
Return whether or not the resource represents the meta-contextALL -
isLocal
Return whether or not the resource represents the meta-contextLOCAL -
isNamed
Return whether or not the resource represents the meta-contextNAMED- Parameters:
theContext- the context- Returns:
- true if its
NAMED, false otherwise
-
isVirtualWildcard
Return whether or not the resource represents the meta-contextVIRTUAL. So named to distinguish from thetest for virtual prefix. -
nullToDefault
Takes a Resource identifying a named graph, and if it is null, returns the constant for theDEFAULTgraph. Otherwise, returns the parameter as-is.- Parameters:
theResource- the named graph- Returns:
- the named graph,
DEFAULTif the parameter is null.
-
defaultToNull
Takes a Resource identifying a named graph, and if it is the constant for theDEFAULTgraph, it will return null, otherwise it returns the parameter as-is.- Parameters:
theResource- the named graph- Returns:
- the named graph; null if it was the default graph
-
isDefaultGraph
-
isWildcard
-
isDefaultGraphOrWildcard
-
isSingleton
Returns true if the set of contexts is a singleton- Parameters:
theContexts-- Returns:
-
isVirtualOrVirtualWildcard
Tests whether the supplied graph name is either the virtual wildcard (VIRTUAL) or any particular virtual graph IRI (one beginning with thevirtual://prefix).
-