Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion pylode/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,11 @@ def sort_ontology(ont_orig: Graph) -> Graph:
"""Creates a copy of the supplied ontology, sorted by subjects"""
trpls = ont_orig.triples((None, None, None))
trpls_srt = sorted(trpls)
ont_sorted = Graph(bind_namespaces="core")
ont_sorted = Graph(bind_namespaces="none")
# preserve prefix bindings from the original graph's namespace manager
for prefix, ns in ont_orig.namespaces():
p = prefix if prefix is not None else ""
ont_sorted.bind(p, ns)
for trpl in trpls_srt:
ont_sorted.add(trpl)
return ont_sorted
Expand Down