Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#1699 Document Graph behavior regarding context in constructor docstring #1707

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion rdflib/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,10 @@ class Graph(Node):
context, such as true merging/demerging of sub-graphs and
provenance.

Even if used with a context-aware store, Graph will only expose the quads which
belong to the default graph. To access the rest of the data, `ConjunctiveGraph` or
`Dataset` classes can be used instead.

The Graph constructor can take an identifier which identifies the Graph
by name. If none is given, the graph is assigned a BNode for its
identifier.
Expand Down Expand Up @@ -1624,7 +1628,12 @@ def __contains__(self, triple_or_quad):
return True
return False

def add(self, triple_or_quad: Union[Tuple[Node, Node, Node, Optional[Any]], Tuple[Node, Node, Node]]) -> "ConjunctiveGraph":
def add(
self,
triple_or_quad: Union[
Tuple[Node, Node, Node, Optional[Any]], Tuple[Node, Node, Node]
],
) -> "ConjunctiveGraph":
"""
Add a triple or quad to the store.

Expand Down