Created
March 6, 2023 22:01
-
-
Save ashepherd/62f926396d000c2d5409764c80d14e35 to your computer and use it in GitHub Desktop.
Use RDFLib to convert triples to quads
This file contains 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
import rdflib | |
cg = rdflib.ConjunctiveGraph() | |
g = rdflib.Graph(cg.store, 'urn:bcodmo:dataset:3300') | |
g.parse('https://www.bco-dmo.org/node/3300/rdf/xml', format='xml') | |
serialization = cg.serialize(format='nquads') | |
print(serialization) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment