Last active
January 21, 2023 14:14
Revisions
-
stefanprobst revised this gist
Jan 21, 2023 . 2 changed files with 1130 additions and 1128 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -9,6 +9,7 @@ g.parse(url, format="xml") context = { "frbroo": "http://iflastandards.info/ns/fr/frbr/frbroo/", "crm": "http://www.cidoc-crm.org/cidoc-crm/", "rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#", "rdfs": "http://www.w3.org/2000/01/rdf-schema#", -
stefanprobst created this gist
Jan 21, 2023 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,23 @@ from rdflib import Graph # url = "http://iflastandards.info/ns/fr/frbr/frbroo.xml" # url = "https://raw.githubusercontent.com/iflastandards/fr/master/xml/ns/fr/frbr/frbroo.xml" url = "https://www.cidoc-crm.org/frbroo/sites/default/files/FRBR2.4-draft.rdfs" g = Graph() g.parse(url, format="xml") context = { "crm": "http://www.cidoc-crm.org/cidoc-crm/", "rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#", "rdfs": "http://www.w3.org/2000/01/rdf-schema#", "owl": "http://www.w3.org/2002/07/owl#", "id": "@id", "type": "@type" } s = g.serialize(format="json-ld", context=context) with open("frbroo.json", "w") as f: f.write(s)