Skip to content

Commit

Permalink
vocabs.py: fix importlib.resources usage
Browse files Browse the repository at this point in the history
Co-authored-by: Eli Chadwick <eli.chadwick@manchester.ac.uk>
  • Loading branch information
simleo and elichad authored Mar 12, 2024
1 parent 069f28b commit 3c9b9d4
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions rocrate/vocabs.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,12 @@
import importlib.resources

# FIXME: Avoid eager loading?
RO_CRATE = json.loads(importlib.resources.read_text(__name__, "data/ro-crate.jsonld"))
SCHEMA = json.loads(importlib.resources.read_text(__name__, "data/schema.jsonld"))
RO_CRATE = json.loads(
importlib.resources.files(__package__).joinpath("data/ro-crate.jsonld").read_text()
)
SCHEMA = json.loads(
importlib.resources.files(__package__).joinpath("data/schema.jsonld").read_text()
)
SCHEMA_MAP = dict((e["@id"], e) for e in SCHEMA["@graph"])


Expand Down

0 comments on commit 3c9b9d4

Please sign in to comment.