Skip to content
Merged
Changes from 1 commit
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
10 changes: 5 additions & 5 deletions src/shacl2code/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ def __get_vocab_contexts(self):
contexts = []

for v in self.__vocabs:
for name, value in foreach_context(self.contexts):
for _, value in foreach_context(self.contexts):
if (
isinstance(value, dict)
and value["@type"] == "@vocab"
and v == self.expand_iri(value["@id"])
and value.get("@type", "") == "@vocab"
and v == self.expand_iri(value.get("@id", ""))
):
if "@context" in value:
contexts.insert(0, value["@context"])
Expand Down Expand Up @@ -93,7 +93,7 @@ def helper(term):
continue

if isinstance(value, dict):
value = value["@id"]
value = value.get("@id", "")

if term == self.expand_iri(value):
if exact and name not in possible:
Expand Down Expand Up @@ -248,7 +248,7 @@ def helper(term):
continue

if isinstance(value, dict):
value = value["@id"]
value = value.get("@id", "")

if term == name:
if exact:
Expand Down
Loading