Skip to content

Commit

Permalink
Removed orphan import statements from Brick+extensions.ttl (#538)
Browse files Browse the repository at this point in the history
  • Loading branch information
steveraysteveray committed Aug 14, 2023
1 parent f9e29b1 commit e48dc4a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion handle_extensions.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,13 @@
brick_graph.add((rule, rdflib.SH.prefixes, BRICK))

# remove ontology declarations
for ontology in brick_graph.subjects(predicate=rdflib.RDF.type, object=rdflib.OWL.Ontology):
for ontology in brick_graph.subjects(
predicate=rdflib.RDF.type, object=rdflib.OWL.Ontology
):
if ontology != BRICK:
brick_graph.remove((ontology, rdflib.RDF.type, rdflib.OWL.Ontology))
brick_graph.remove((ontology, rdflib.OWL.imports, None))
brick_graph.remove((ontology, rdflib.OWL.versionInfo, None))

# serialize Brick with all extensions added
with open("Brick+extensions.ttl", "w", encoding="utf-8") as fp:
Expand Down

0 comments on commit e48dc4a

Please sign in to comment.