Package org.apache.jena.sparql.graph
Class GraphOps
- java.lang.Object
-
- org.apache.jena.sparql.graph.GraphOps
-
public class GraphOps extends java.lang.ObjectSome operations on graphs
-
-
Constructor Summary
Constructors Constructor Description GraphOps()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidaddAll(Graph g, java.lang.Iterable<Triple> iter)static voidaddAll(Graph g, java.util.Iterator<Triple> iter)static booleancontainsGraph(DatasetGraph dsg, Node gn)Check whether a dataset contains a named graph of the given name.static voiddeleteAll(Graph g, java.lang.Iterable<Triple> iter)static voiddeleteAll(Graph g, java.util.Iterator<Triple> iter)static GraphgetGraph(DatasetGraph dsg, Node gn)Get a graph from the dataset - the graph name may be special - the union graph (which is immutable) or a special name for the default graph.static booleanisWrapped(Graph graph)Remove one layer of graph wrapping.static GraphunionGraph(DatasetGraph dsg)Create an immutable union graph of all the named graphs in the dataset.static GraphunionGraph(DatasetGraph dsg, java.util.Set<Node> graphNames)Create an immutable union graph comprised of a set of named graphs.static GraphunwrapAll(Graph graph)Remove all layers of graph wrapping.static GraphunwrapOne(Graph graph)Remove one layer of graph wrapping.
-
-
-
Method Detail
-
containsGraph
public static boolean containsGraph(DatasetGraph dsg, Node gn)
Check whether a dataset contains a named graph of the given name. Graph with special names (union and default) return true.
-
getGraph
public static Graph getGraph(DatasetGraph dsg, Node gn)
Get a graph from the dataset - the graph name may be special - the union graph (which is immutable) or a special name for the default graph.A graph name of "null" is interpreted as the default graph.
-
unionGraph
public static Graph unionGraph(DatasetGraph dsg, java.util.Set<Node> graphNames)
Create an immutable union graph comprised of a set of named graphs.
-
unionGraph
public static Graph unionGraph(DatasetGraph dsg)
Create an immutable union graph of all the named graphs in the dataset. Future changes to the set of graphs in the dataset will be seen.
-
unwrapAll
public static Graph unwrapAll(Graph graph)
Remove all layers of graph wrapping. Returns the original graph if not wrapped at all.
-
isWrapped
public static boolean isWrapped(Graph graph)
Remove one layer of graph wrapping.
-
-