java.lang.Object
org.apache.jena.sparql.service.enhancer.impl.util.DynamicDatasetUtils

public class DynamicDatasetUtils extends Object
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    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.
    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 which isUnwrappable(DynamicDatasetGraph) is true.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 which isUnwrappable(DynamicDatasetGraph) is true. In that case DynamicDatasets.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.