diff options
author | Nicholas Car <nicholas.car@surroundaustralia.com> | 2021-07-20 23:13:06 +1000 |
---|---|---|
committer | Nicholas Car <nicholas.car@surroundaustralia.com> | 2021-07-20 23:13:06 +1000 |
commit | 17969dccdc6b182ef19c1a9e0b86a6585026aeab (patch) | |
tree | e9d421e78624f0e9cd11f8217c2d92c129963012 /examples/datasets.py | |
parent | 7ebfd306543d8cc0a8b48700870e6fba3d7d256d (diff) | |
download | rdflib-17969dccdc6b182ef19c1a9e0b86a6585026aeab.tar.gz |
blacked everything6.0.0
Diffstat (limited to 'examples/datasets.py')
-rw-r--r-- | examples/datasets.py | 42 |
1 files changed, 24 insertions, 18 deletions
diff --git a/examples/datasets.py b/examples/datasets.py index 76f8ae73..e5d14aa1 100644 --- a/examples/datasets.py +++ b/examples/datasets.py @@ -25,27 +25,33 @@ graph_1 = URIRef("http://example.com/graph-1") d.graph(identifier=graph_1) # Add two quads to Graph graph_1 in the Dataset -d.add(( - URIRef("http://example.com/subject-x"), - URIRef("http://example.com/predicate-x"), - Literal("Triple X"), - graph_1 -)) -d.add(( - URIRef("http://example.com/subject-z"), - URIRef("http://example.com/predicate-z"), - Literal("Triple Z"), - graph_1 -)) +d.add( + ( + URIRef("http://example.com/subject-x"), + URIRef("http://example.com/predicate-x"), + Literal("Triple X"), + graph_1, + ) +) +d.add( + ( + URIRef("http://example.com/subject-z"), + URIRef("http://example.com/predicate-z"), + Literal("Triple Z"), + graph_1, + ) +) # Add another quad to the Dataset to a non-existent Graph: # the Graph is created automatically -d.add(( - URIRef("http://example.com/subject-y"), - URIRef("http://example.com/predicate-y"), - Literal("Triple Y"), - URIRef("http://example.com/graph-2") -)) +d.add( + ( + URIRef("http://example.com/subject-y"), + URIRef("http://example.com/predicate-y"), + Literal("Triple Y"), + URIRef("http://example.com/graph-2"), + ) +) # printing the Dataset like this: print(d.serialize(format="trig")) # produces a result like this: |