Created
March 17, 2020 11:17
-
-
Save white-gecko/390a5ea41f2c500c120939bfe2bf68b5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ComparableGraph | |
-> Menge von AtomicGraph | |
ConjunctiveGraph | |
-> Menge von ComparableGraph | |
-> Menge von AtomicGraph | |
=> Blank Node Scope beschränkt auf einen Graph | |
ConjunctiveGraph | |
-> Menge von AtomicDatasets | |
=> Blank Node Scope auf gesamtes Dataset erweitert | |
V1 | |
graphA: | |
_:a a foaf:Person | |
graphB | |
_:a foaf:name "Sebastian" | |
V2 | |
graphA: | |
_:a a foaf:Person | |
graphB | |
_:a foaf:name "Natanael" | |
AtomicGraph added: {_:a a foaf:Person <graphA> . _:a foaf:name "Natanael" <graphB>} | |
AtomicGraph removed: {_:a a foaf:Person <graphA> . _:a foaf:name "Sebastian" <graphB>} | |
x = rdflib.BNode("_:a") | |
y = rdflib.BNode("_:a") | |
id(x) != id(y) | |
a = URIRef('http://example.org/') | |
b = URIRef('http://example.org/') | |
a == b : true | |
hash(a): -7511872548327883385 | |
hash(b): -7511872548327883385 | |
id(a): 140464059973424 | |
id(b): 140464060629680 | |
from rdflib import Graph | |
graph = Graph() | |
graph.update("insert data {_:a a <http://example.org/>}") | |
graph.update("insert data {_:a a <http://example.org/a>}") | |
results = graph.query("select * {?b a ?t}") | |
for result in results: | |
print(result.b) | |
hash(result.b) | |
id(result.b) | |
a | |
8493424577539222167 | |
140150469024064 | |
a | |
8493424577539222167 | |
140150469024064 | |
------------------------------- | |
PREFIX foaf: <http://xmlns.com/foaf/0.1/> | |
INSERT DATA { | |
GRAPH <http://example.org/persons> { | |
_:a a foaf:Person | |
} | |
GRAPH <http://example.org/names> { | |
_:a foaf:name "Sebastian" | |
} | |
} | |
PREFIX foaf: <http://xmlns.com/foaf/0.1/> | |
INSERT DATA { | |
GRAPH <http://example.org/persons> { | |
_:a a foaf:Person | |
} | |
GRAPH <http://example.org/names> { | |
_:a foaf:name "Natanael" | |
} | |
} | |
construct {?s ?p ?o} { | |
graph ?g {?s ?p ?o} | |
} | |
>>> @prefix ns1: <http://xmlns.com/foaf/0.1/> . | |
[] a ns1:Person ; | |
ns1:name "Natanael", # Wrong should be separated!! | |
"Sebastian" . | |
# restart quit | |
PREFIX foaf: <http://xmlns.com/foaf/0.1/> | |
INSERT DATA { | |
GRAPH <http://example.org/persons> { | |
_:a a foaf:Person | |
} | |
GRAPH <http://example.org/names> { | |
_:a foaf:name "Norman" | |
} | |
} | |
construct {?s ?p ?o} { | |
graph ?g {?s ?p ?o} | |
} | |
@prefix ns1: <http://xmlns.com/foaf/0.1/> . | |
[] a ns1:Person ; | |
ns1:name "Natanael", | |
"Sebastian" . | |
[] a ns1:Person ; | |
ns1:name "Norman" . # before reserialization | |
# restart quit again | |
construct {?s ?p ?o} { | |
graph ?g {?s ?p ?o} | |
} | |
@prefix ns1: <http://xmlns.com/foaf/0.1/> . | |
[] a ns1:Person ; | |
ns1:name "Natanael", | |
"Norman", # after reserialization | |
"Sebastian" . | |
---------------------------- | |
Use UUIDs or relate to colouring -> farbID | |
V1 A A | |
V2 . B A B | |
V3 A' . A' B | |
V4 A" B' A" B' | |
V5 A° B" A° B" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment