Class DynamicDatasetUtils
java.lang.Object
org.apache.jena.sparql.service.enhancer.impl.util.DynamicDatasetUtils
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic org.apache.jena.sparql.core.DynamicDatasets.DynamicDatasetGraph
asUnwrappableDynamicDatasetOrNull
(org.apache.jena.sparql.core.DatasetGraph dg) Convenience method to cast the argument as a DynamicDatasetGraph if it is an unwrappable one.static boolean
isUnwrappable
(org.apache.jena.sparql.core.DynamicDatasets.DynamicDatasetGraph ddg) Returns true iff the argument's original default and named graphs are non-null.static org.apache.jena.atlas.lib.Pair<org.apache.jena.query.Query,
org.apache.jena.sparql.core.DatasetGraph> unwrap
(org.apache.jena.query.Query query, org.apache.jena.sparql.core.DatasetGraph dataset) Returns the given arguments as a pair unless the dataset is an unwrappable DynamicDataset.static org.apache.jena.sparql.core.DatasetGraph
unwrapOriginal
(org.apache.jena.sparql.core.DatasetGraph dg) Returns the argument unless it is a DynamicDataset for whichisUnwrappable(DynamicDatasetGraph)
is true.
-
Constructor Details
-
DynamicDatasetUtils
public DynamicDatasetUtils()
-
-
Method Details
-
isUnwrappable
public static boolean isUnwrappable(org.apache.jena.sparql.core.DynamicDatasets.DynamicDatasetGraph ddg) Returns true iff the argument's original default and named graphs are non-null. Typically, this shouldn't happen. This method mainly exists for robustness as to avoid null pointer exceptions. -
asUnwrappableDynamicDatasetOrNull
public static org.apache.jena.sparql.core.DynamicDatasets.DynamicDatasetGraph asUnwrappableDynamicDatasetOrNull(org.apache.jena.sparql.core.DatasetGraph dg) Convenience method to cast the argument as a DynamicDatasetGraph if it is an unwrappable one. -
unwrapOriginal
public static org.apache.jena.sparql.core.DatasetGraph unwrapOriginal(org.apache.jena.sparql.core.DatasetGraph dg) Returns the argument unless it is a DynamicDataset for whichisUnwrappable(DynamicDatasetGraph)
is true. In that caseDynamicDatasets.DynamicDatasetGraph.getOriginal()
is returned. -
unwrap
public static org.apache.jena.atlas.lib.Pair<org.apache.jena.query.Query,org.apache.jena.sparql.core.DatasetGraph> unwrap(org.apache.jena.query.Query query, org.apache.jena.sparql.core.DatasetGraph dataset) Returns the given arguments as a pair unless the dataset is an unwrappable DynamicDataset. In that case, query's default/named graphs are modified in-place to match those of the dataset. The returned pair holds the modified query and the original (unwrapped) dataset.
-