13.2 Retrieving Graphs by Name
You can retrieve a graph by name by the following two ways:
getGraph(Namespace, String)
: with explicitly mentioning the namespacegetGraph(String)
: without explicitly mentioning the namespace
With getGraph(Namespace, String)
, you need to provide the namespace (either session private or public). In this case, the graph will be looked up in the given namespace only.
With getGraph(String)
, the provided name will be first looked up in the private namespace. If no graph with the given name is found there, then the graph name will be looked up in the public namespace. In other words, if a graph with the same name is defined in both the public and the private namespaces, getGraph(String)
will return the private graph and you need to use getGraph(Namespace, String)
to get hold of the public graph with that name.
Parent topic: Namespaces and Sharing