Skip to content
Open
Show file tree
Hide file tree
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
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -118,4 +118,7 @@ output_files/

pylode/_version.py

.pickle
*.pickle

actual.html
expected.html
5 changes: 5 additions & 0 deletions pylode/profiles/supermodel/query/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,11 @@ def __init__(self, graph: Graph) -> None:
self.root_profile_iri = get_root_profile_iri(graph)
self.db = load_profiles(self.root_profile_iri, graph.serialize())
self.graph = self.db.root_graph

# We need this to see the prefixes in the loaded file
for prefix, namespace in graph.namespace_manager.namespaces():
self.graph.namespace_manager.bind(prefix, namespace, override=True)

self.debug = True if (None, LODE.debug, None) in self.db.config_graph else False

# An IRI index of classes that 'exist' within this documentation.
Expand Down
5 changes: 5 additions & 0 deletions pylode/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,11 @@ def sort_ontology(ont_orig: Graph) -> Graph:
trpls = ont_orig.triples((None, None, None))
trpls_srt = sorted(trpls)
ont_sorted = Graph(bind_namespaces="core")

# Recover the namespaces from the original file
for prefix, namespace in ont_orig.namespace_manager.namespaces():
ont_sorted.namespace_manager.bind(prefix, namespace, override=True)

for trpl in trpls_srt:
ont_sorted.add(trpl)
return ont_sorted
Expand Down