Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Converter example - add prefixmaps (and curies), remove ontobio. #317

Open
wants to merge 5 commits into
base: json-export
Choose a base branch
from
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
10 changes: 6 additions & 4 deletions python/json_export.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
import json
from pathlib import Path
import os
from ontobio.rdfgen.assoc_rdfgen import prefix_context
#from prefixcommons.curie_util import contract_uri
from prefixmaps import load_converter

from curies import Converter, Record
from pyshexc.parser_impl import generate_shexj
Expand All @@ -18,12 +17,15 @@


OUT_JSON = os.path.join('../shapes/json/shex_dump.json')
converter = Converter.from_prefix_map(prefix_context)

converter = load_converter("merged")
# if you need to add a prefix specific to this codebase, not in merged.csv above, then you
# can do things like this:
# converter.add_prefix("Orphanet", "https://www.orpha.net/en/disease/detail/", merge=True)


def get_suffix(uri):
suffix = converter.compress(uri)

return suffix if suffix else uri


Expand Down
Loading
Loading