Package com.complexible.stardog
Class Contexts
- java.lang.Object
-
- com.complexible.stardog.Contexts
-
public final class Contexts extends java.lang.ObjectDefines constants that represent special URIs for contexts (named graphs).- Since:
- 0.9
- Version:
- 6.0
- Author:
- Evren Sirin, Michael Grove
-
-
Field Summary
Fields Modifier and Type Field Description static IRIALLSpecial URI representing all local and virtual graphsstatic IRIDEFAULTSpecial URI representing the default (no) context in Stardog.static IRILOCALSpecial URI representing all contexts in Stardog, including the default (no) context graph.static IRINAMEDSpecial URI representing all local named graphs in Stardog, excluding the default graph.static IRIVIRTUALSpecial URI representing all virtual graphs
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static 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 booleanisAll(Resource theContext)Return whether or not the resource represents the meta-contextALLstatic booleanisAllOrLocal(Resource theContext)static booleanisAllOrLocal(java.util.Collection<? extends Resource> theContexts)static <T extends Value>
java.util.function.Predicate<T>isDefaultGraph()static booleanisDefaultGraphOrWildcard(Resource theContext)static booleanisLocal(Resource theContext)Return whether or not the resource represents the meta-contextLOCALstatic booleanisNamed(Resource theContext)Return whether or not the resource represents the meta-contextNAMEDstatic booleanisSingleton(java.util.Set<Resource> theContexts)Returns true if the set of contexts is a singletonstatic booleanisVirtualOrVirtualWildcard(Resource g)Tests 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 Detail
-
DEFAULT
public static final IRI DEFAULT
Special URI representing the default (no) context in Stardog.
-
LOCAL
public static final IRI LOCAL
Special URI representing all contexts in Stardog, including the default (no) context graph.
-
NAMED
public static final IRI NAMED
Special URI representing all local named graphs in Stardog, excluding the default graph.
-
VIRTUAL
public static final IRI VIRTUAL
Special URI representing all virtual graphs
-
ALL
public static final IRI ALL
Special URI representing all local and virtual graphs
-
-
Method Detail
-
isAllOrLocal
public static boolean isAllOrLocal(Resource theContext)
-
isAllOrLocal
public static boolean isAllOrLocal(java.util.Collection<? extends Resource> theContexts)
-
isAll
public static boolean isAll(Resource theContext)
Return whether or not the resource represents the meta-contextALL
-
isLocal
public static boolean isLocal(Resource theContext)
Return whether or not the resource represents the meta-contextLOCAL
-
isNamed
public static boolean isNamed(Resource theContext)
Return whether or not the resource represents the meta-contextNAMED- Parameters:
theContext- the context- Returns:
- true if its
NAMED, false otherwise
-
isVirtualWildcard
public static boolean isVirtualWildcard(Resource theContext)
Return whether or not the resource represents the meta-contextVIRTUAL. So named to distinguish from thetest for virtual prefix.
-
nullToDefault
public static Resource nullToDefault(Resource theResource)
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
public static Resource defaultToNull(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.- Parameters:
theResource- the named graph- Returns:
- the named graph; null if it was the default graph
-
isDefaultGraph
public static <T extends Value> java.util.function.Predicate<T> isDefaultGraph()
-
isWildcard
public static boolean isWildcard(Resource theContext)
-
isDefaultGraphOrWildcard
public static boolean isDefaultGraphOrWildcard(Resource theContext)
-
isSingleton
public static boolean isSingleton(java.util.Set<Resource> theContexts)
Returns true if the set of contexts is a singleton- Parameters:
theContexts-- Returns:
-
isVirtualOrVirtualWildcard
public static boolean isVirtualOrVirtualWildcard(Resource g)
Tests whether the supplied graph name is either the virtual wildcard (VIRTUAL) or any particular virtual graph IRI (one beginning with thevirtual://prefix).
-
-