Created
January 12, 2016 10:10
-
-
Save gromgull/08bf58ceceef89d464ed 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
from rdflib import Graph, Literal, URIRef | |
from rdflib.collection import Collection | |
g = Graph() | |
g.parse(data = '''<urn:thing> <urn:prop> ( 1 2 3 ) . ''', format="turtle") | |
collection_resource = g.value(URIRef('urn:thing'), URIRef('urn:prop')) | |
collection = Collection(g, collection_resource) | |
print list(collection) | |
collection.append(Literal(4)) | |
print g.serialize(format='turtle') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment