Skip to content

Commit

Permalink
Replace HCAO to OLS4 api since this is now used for this schema
Browse files Browse the repository at this point in the history
  • Loading branch information
arschat committed Dec 12, 2024
1 parent acf0934 commit 076de7c
Showing 1 changed file with 2 additions and 24 deletions.
26 changes: 2 additions & 24 deletions src/schema_linter.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import re
import json
import sys
import argparse
from urllib.request import urlopen
from urllib.error import HTTPError

Expand Down Expand Up @@ -38,24 +37,6 @@

graph_restriction_attributes = ['ontologies', 'classes', 'relations', 'direct', 'include_self']

# Accepted environments and conversion for OLS API url

ENVIRONMENTS = ['develop', 'integration', 'staging', 'master']

OLS_ENVIRONMENT = {
"develop": "dev",
"integration": "integration",
"staging": "staging",
"master": "staging"
}

def argument_parser():
# Create the parser, define arguments and return it
parser = argparse.ArgumentParser()
parser.add_argument('--environment', '-e', type=str, dest='environment', help='environment the OLS API feeds on',
default='staging', action='store', choices=ENVIRONMENTS)
return parser


class SchemaLinter:
def __init__(self):
Expand Down Expand Up @@ -333,11 +314,8 @@ def get_json_from_file(self, filename, warn = False):


if __name__ == "__main__":
# Define the environment, transforming 'develop' and 'master' to their respective OLS valid environment to
# define the proper OLS API URL.
arguments = argument_parser().parse_args(sys.argv[1:])
environment = OLS_ENVIRONMENT[arguments.environment]
ols_api = 'https://ontology.{}.archive.data.humancellatlas.org/api'.format(environment)
# As of November 2024, we are now using the OLS4 for ontology checkup
ols_api = 'https://www.ebi.ac.uk/ols/api'

schema_path = '../json_schema' if cwd == 'src' else 'json_schema'
jsons = [os.path.join(dirpath, f)
Expand Down

0 comments on commit 076de7c

Please sign in to comment.