diff --git a/.github/workflows/gen-project-linkml.yaml b/.github/workflows/gen-project-linkml.yaml
index dfbdc7a..1cd89b6 100644
--- a/.github/workflows/gen-project-linkml.yaml
+++ b/.github/workflows/gen-project-linkml.yaml
@@ -22,10 +22,10 @@ jobs:
- name: Check out repository
uses: actions/checkout@v2
- - name: Set up Python ${{ "{{" }} matrix.python-version {{ "}}" }}
+ - name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
- python-version: ${{ "{{" }} matrix.python-version {{ "}}" }}
+ python-version: ${{ matrix.python-version }}
#----------------------------------------------
# install & configure poetry
diff --git a/.vscode/launch.json b/.vscode/launch.json
new file mode 100644
index 0000000..7e7c6f7
--- /dev/null
+++ b/.vscode/launch.json
@@ -0,0 +1,16 @@
+{
+ // Use IntelliSense to learn about possible attributes.
+ // Hover to view descriptions of existing attributes.
+ // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
+ "version": "0.2.0",
+ "configurations": [
+ {
+ "name": "Python: Current File",
+ "type": "python",
+ "request": "launch",
+ "program": "${file}",
+ "console": "integratedTerminal",
+ "justMyCode": true
+ }
+ ]
+}
\ No newline at end of file
diff --git a/README.md b/README.md
index 39878ac..c50af18 100644
--- a/README.md
+++ b/README.md
@@ -4,7 +4,6 @@
Using RDF Shapes to define the schema of Gene Ontology Causal Activity Models
-
# Schema
See [shapes/go-cam-shapes.shex](shapes/go-cam-shapes.shex)
diff --git a/python/.gitignore b/python/.gitignore
new file mode 100644
index 0000000..9168c40
--- /dev/null
+++ b/python/.gitignore
@@ -0,0 +1,138 @@
+# Byte-compiled / optimized / DLL files
+__pycache__/
+*.py[cod]
+*$py.class
+
+# C extensions
+*.so
+
+# Distribution / packaging
+.Python
+build/
+develop-eggs/
+dist/
+downloads/
+eggs/
+.eggs/
+lib/
+lib64/
+parts/
+sdist/
+var/
+wheels/
+share/python-wheels/
+*.egg-info/
+.installed.cfg
+*.egg
+MANIFEST
+
+# PyInstaller
+# Usually these files are written by a python script from a template
+# before PyInstaller builds the exe, so as to inject date/other infos into it.
+*.manifest
+*.spec
+
+# Installer logs
+pip-log.txt
+pip-delete-this-directory.txt
+
+# Unit test / coverage reports
+htmlcov/
+.tox/
+.nox/
+.coverage
+.coverage.*
+.cache
+nosetests.xml
+coverage.xml
+*.cover
+*.py,cover
+.hypothesis/
+.pytest_cache/
+cover/
+
+# Translations
+*.mo
+*.pot
+
+# Django stuff:
+*.log
+local_settings.py
+db.sqlite3
+db.sqlite3-journal
+
+# Flask stuff:
+instance/
+.webassets-cache
+
+# Scrapy stuff:
+.scrapy
+
+# Sphinx documentation
+docs/_build/
+
+# PyBuilder
+.pybuilder/
+target/
+
+# Jupyter Notebook
+.ipynb_checkpoints
+
+# IPython
+profile_default/
+ipython_config.py
+
+# pyenv
+# For a library or package, you might want to ignore these files since the code is
+# intended to run in multiple environments; otherwise, check them in:
+# .python-version
+
+# pipenv
+# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
+# However, in case of collaboration, if having platform-specific dependencies or dependencies
+# having no cross-platform support, pipenv may install dependencies that don't work, or not
+# install all needed dependencies.
+#Pipfile.lock
+
+# PEP 582; used by e.g. github.com/David-OConnor/pyflow
+__pypackages__/
+
+# Celery stuff
+celerybeat-schedule
+celerybeat.pid
+
+# SageMath parsed files
+*.sage.py
+
+# Environments
+.env
+.venv
+env/
+venv/
+ENV/
+env.bak/
+venv.bak/
+
+# Spyder project settings
+.spyderproject
+.spyproject
+
+# Rope project settings
+.ropeproject
+
+# mkdocs documentation
+/site
+
+# mypy
+.mypy_cache/
+.dmypy.json
+dmypy.json
+
+# Pyre type checker
+.pyre/
+
+# pytype static type analyzer
+.pytype/
+
+# Cython debug symbols
+cython_debug/
\ No newline at end of file
diff --git a/python/Makefile b/python/Makefile
index 24b2fea..d7c1e8d 100644
--- a/python/Makefile
+++ b/python/Makefile
@@ -42,16 +42,16 @@ f-%: tests/data/f-%.ttl
python ./gocam_validator.py $< && exit -1 || echo FAILED AS EXPECTED
gen-python:
- rm -f shex_json_linkml.py && gen-python schema/shex_json_linkml.yaml > shex_json_linkml.py
+ rm -f shex_json_linkml.py && gen-python schema/shex_term_metadata_json_linkml.yaml > shex_term_metadata_json_linkml.py
#gen-pydantic:
# rm -f shex_json_linkml.py && gen-pydantic schema/shex_json_linkml.yaml > shex_json_linkml.py
gen-jsonschema:
- rm -f target/jsonschema/shex_json_linkml.json && gen-json-schema schema/shex_json_linkml.yaml > target/jsonschema/shex_json_linkml.json
+ rm -f target/jsonschema/shex_terms_metadata_json_linkml.json && gen-json-schema schema/shex_terms_metadata_json_linkml.yaml > target/jsonschema/shex_terms_metadata_json_linkml.json
gen-typescript:
- rm -f target/typescript/shex_json_linkml.ts && gen-typescript schema/shex_json_linkml.yaml > target/typescript/shex_json_linkml.ts
+ rm -f target/typescript/shex_terms_metadata_json_linkml.ts && gen-typescript schema/shex_terms_metadata_json_linkml.yaml > target/typescript/shex_terms_metadata_json_linkml.ts
linkml: gen-python gen-jsonschema gen-typescript
diff --git a/python/go_context.json b/python/go_context.json
new file mode 100644
index 0000000..57a27fb
--- /dev/null
+++ b/python/go_context.json
@@ -0,0 +1,224 @@
+{
+ "@context": {
+ "dc": "http://purl.org/dc/terms/",
+ "dcat": "http://www.w3.org/ns/dcat#",
+ "faldo": "http://biohackathon.org/resource/faldo#",
+ "foaf": "http://xmlns.com/foaf/0.1/",
+ "idot": "http://identifiers.org/",
+ "oa": "http://www.w3.org/ns/oa#",
+ "owl": "http://www.w3.org/2002/07/owl#",
+ "prov": "http://www.w3.org/ns/prov#",
+ "rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
+ "rdfs": "http://www.w3.org/2000/01/rdf-schema#",
+ "void": "http://rdfs.org/ns/void#",
+ "xsd": "http://www.w3.org/2001/XMLSchema#",
+ "oboInOwl": "http://www.geneontology.org/formats/oboInOwl#",
+ "gomodel": "http://model.geneontology.org/",
+ "CARO": "http://purl.obolibrary.org/obo/CARO_",
+ "BIOMD": "http://www.ebi.ac.uk/compneur-srv/biomodels-main/publ-model.do?mid=",
+ "COG_Function": "http://www.ncbi.nlm.nih.gov/COG/grace/shokog.cgi?fun=",
+ "WB": "http://identifiers.org/wormbase/",
+ "FBbt": "http://purl.obolibrary.org/obo/FBbt_",
+ "KEGG_LIGAND": "http://www.genome.jp/dbget-bin/www_bget?cpd:",
+ "PSO_GIT": "https://github.com/Planteome/plant-stress-ontology/issues/",
+ "MaizeGDB_stock": "http://maizegdb.org/data_center/stock?id=",
+ "EMAPA": "http://purl.obolibrary.org/obo/EMAPA_",
+ "GO": "http://purl.obolibrary.org/obo/GO_",
+ "NCBI_GP": "http://www.ncbi.nlm.nih.gov/entrez/viewer.fcgi?db=protein&val=",
+ "NMPDR": "http://www.nmpdr.org/linkin.cgi?id=",
+ "CASSPC": "http://research.calacademy.org/research/ichthyology/catalog/getname.asp?rank=Species&id=",
+ "TGD_REF": "http://db.ciliate.org/cgi-bin/reference/reference.pl?dbid=",
+ "NCBIGene": "http://identifiers.org/ncbigene/",
+ "KEGG_REACTION": "http://www.genome.jp/dbget-bin/www_bget?rn:",
+ "PseudoCAP": "http://v2.pseudomonas.com/getAnnotation.do?locusID=",
+ "UniPathway": "http://www.grenoble.prabi.fr/obiwarehouse/unipathway/upa?upid=",
+ "MEROPS_fam": "http://merops.sanger.ac.uk/cgi-bin/famsum?family=",
+ "GO_REF": "http://purl.obolibrary.org/obo/go/references/",
+ "VEGA": "http://vega.sanger.ac.uk/id/",
+ "ZFIN": "http://identifiers.org/zfin/",
+ "AspGD_REF": "http://www.aspergillusgenome.org/cgi-bin/reference/reference.pl?dbid=",
+ "RO": "http://purl.obolibrary.org/obo/RO_",
+ "Pfam": "http://pfam.xfam.org/family/",
+ "UBERON": "http://purl.obolibrary.org/obo/UBERON_",
+ "GR": "http://www.gramene.org/db/searches/browser?search_type=All&RGN=on&query=",
+ "PDB": "http://www.rcsb.org/pdb/cgi/explore.cgi?pdbId=",
+ "CORIELL": "http://ccr.coriell.org/Sections/Search/Sample_Detail.aspx?Ref=",
+ "JCVI_GenProp": "http://cmr.jcvi.org/cgi-bin/CMR/shared/GenomePropDefinition.cgi?prop_acc=",
+ "SGN": "http://identifiers.org/sgn/",
+ "BFO": "http://purl.obolibrary.org/obo/BFO_",
+ "Genesys-pgr": "https://www.genesys-pgr.org/acn/search?q=",
+ "UniMod": "http://www.unimod.org/modifications_view.php?editid1=",
+ "UM-BBD_reactionID": "http://eawag-bbd.ethz.ch/servlets/pageservlet?ptype=r&reacID=",
+ "PubChem_Substance": "http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?CMD=search&DB=pcsubstance&term=",
+ "EcoCyc": "http://biocyc.org/ECOLI/NEW-IMAGE?type=PATHWAY&object=",
+ "Reactome": "http://identifiers.org/reactome/",
+ "InterPro": "http://identifiers.org/interpro/",
+ "UniRule": "http://www.uniprot.org/unirule/",
+ "MGCSC_GENETIC_STOCKS": "http://www.maizegdb.org/cgi-bin/displaystockrecord.cgi?id=",
+ "dictyBase": "http://identifiers.org/dictybase/",
+ "PO_GIT": "https://github.com/Planteome/plant-ontology/issues/",
+ "AspGD_LOCUS": "http://identifiers.org/aspgd.locus/",
+ "SGD": "http://identifiers.org/sgd/",
+ "COG_Pathway": "http://www.ncbi.nlm.nih.gov/COG/new/release/coglist.cgi?pathw=",
+ "ENZYME": "http://www.expasy.ch/cgi-bin/nicezyme.pl?",
+ "PAMGO_MGG": "http://scotland.fgl.ncsu.edu/cgi-bin/adHocQuery.cgi?adHocQuery_dbName=smeng_goannotation&Action=Data&QueryName=Functional+Categorization+of+MGG+GO+Annotation&P_KeyWord=",
+ "AgBase": "http://www.agbase.msstate.edu/cgi-bin/getEntry.pl?db_pick=[ChickGO/MaizeGO]&uid=",
+ "AraCyc": "http://www.arabidopsis.org:1555/ARA/NEW-IMAGE?type=NIL&object=",
+ "EcoCyc_REF": "http://biocyc.org/ECOLI/reference.html?type=CITATION-FRAME&object=",
+ "CHEBI": "http://purl.obolibrary.org/obo/CHEBI_",
+ "HGNC": "http://identifiers.org/hgnc/",
+ "dictyBase_gene_name": "http://dictybase.org/gene/",
+ "TAIR": "http://identifiers.org/tair.locus/",
+ "EnsemblFungi": "http://www.ensemblgenomes.org/id/",
+ "Wikipedia": "http://en.wikipedia.org/wiki/",
+ "SUPERFAMILY": "http://supfam.cs.bris.ac.uk/SUPERFAMILY/cgi-bin/scop.cgi?ipid=SSF",
+ "SWALL": "http://ca.expasy.org/cgi-bin/sprot-search-de?S=1&T=1&SEARCH=",
+ "PSI-MOD": "http://www.ebi.ac.uk/ontology-lookup/?termId=MOD:",
+ "FYPO": "http://purl.obolibrary.org/obo/FYPO_",
+ "RGD": "http://identifiers.org/rgd/",
+ "UM-BBD_enzymeID": "http://eawag-bbd.ethz.ch/servlets/pageservlet?ptype=ep&enzymeID=",
+ "Broad_MGG": "http://www.broad.mit.edu/annotation/genome/magnaporthe_grisea/GeneLocus.html?sp=S",
+ "Swiss-Prot": "http://www.ebi.uniprot.org/uniprot-srv/uniProtView.do?proteinac=",
+ "PMID": "http://www.ncbi.nlm.nih.gov/pubmed/",
+ "Xenbase": "http://identifiers.org/xenbase/",
+ "PR": "http://purl.obolibrary.org/obo/PR_",
+ "MIPS_funcat": "http://mips.gsf.de/cgi-bin/proj/funcatDB/search_advanced.pl?action=2&wert=",
+ "GR_REF": "http://www.gramene.org/db/literature/pub_search?ref_id=",
+ "MaizeGDB": "http://maizegdb.org/gene_center/gene/",
+ "HAMAP": "http://hamap.expasy.org/unirule/",
+ "SGN_ref": "http://www.sgn.cornell.edu/chado/publication.pl?pub_id=",
+ "TO_GIT": "https://github.com/Planteome/plant-trait-ontology/issues/",
+ "MeSH": "http://n2t.net/MESH:",
+ "GR_PROTEIN": "http://identifiers.org/gramene.protein/",
+ "MaizeGDB_REF": "http://maizegdb.org/data_center/reference?id=",
+ "GEO": "http://www.ncbi.nlm.nih.gov/sites/GDSbrowser?acc=",
+ "PO": "http://purl.obolibrary.org/obo/PO_",
+ "PomBase": "http://identifiers.org/pombase/",
+ "ENA": "http://www.ebi.ac.uk/ena/data/view/",
+ "PIRSF": "http://pir.georgetown.edu/cgi-bin/ipcSF?id=",
+ "EMBL": "http://www.ebi.ac.uk/cgi-bin/emblfetch?style=html&Submit=Go&id=",
+ "Prosite": "http://www.expasy.ch/cgi-bin/prosite-search-ac?",
+ "H-invDB_cDNA": "http://www.h-invitational.jp/hinv/spsoup/transcript_view?acc_id=",
+ "EC": "http://www.expasy.org/enzyme/",
+ "MACSC_REF": "http://www.maizegdb.org/cgi-bin/displaytraitrecord.cgi?id=",
+ "PAMGO_VMD": "http://vmd.vbi.vt.edu/cgi-bin/browse/go_detail.cgi?gene_id=",
+ "IRGC": "https://www.genesys-pgr.org/acn/search?q=IRGC+",
+ "NASC_code": "http://seeds.nottingham.ac.uk/NASC/stockatidb.lasso?code=",
+ "COG_Cluster": "http://www.ncbi.nlm.nih.gov/COG/new/release/cow.cgi?cog=",
+ "TreeGenes": "http://dendrome.ucdavis.edu/treegenes/protein/view_protein.php?id=",
+ "WB_REF": "http://www.wormbase.org/db/misc/paper?name=",
+ "TGD_LOCUS": "http://db.ciliate.org/cgi-bin/locus.pl?locus=",
+ "MA": "http://purl.obolibrary.org/obo/MA_",
+ "UniProtKB": "http://identifiers.org/uniprot/",
+ "MGI": "http://identifiers.org/mgi/",
+ "GRINDesc": "https://npgsweb.ars-grin.gov/gringlobal/descriptordetail.aspx?id=",
+ "DDANAT": "http://purl.obolibrary.org/obo/DDANAT_",
+ "RAP-DB": "http://rapdb.dna.affrc.go.jp/tools/search/run?id=on&attr=desc&attr=cgs&attr=cgn&attr=cgss&attr=cgns&attr=rgss&attr=rgns&keyword=",
+ "KEGG_PATHWAY": "http://identifiers.org/kegg.pathway/",
+ "JCVI_CMR": "http://cmr.jcvi.org/cgi-bin/CMR/shared/GenePage.cgi?locus=",
+ "dictyBase_REF": "http://dictybase.org/db/cgi-bin/dictyBase/reference/reference.pl?refNo=",
+ "DOI": "http://dx.doi.org/",
+ "LIFEdb": "http://www.dkfz.de/LIFEdb/LIFEdb.aspx?ID=",
+ "PANTHER": "http://identifiers.org/panther.family/",
+ "Gene3D": "http://gene3d.biochem.ucl.ac.uk/search?mode=family&sterm=",
+ "PATRIC": "http://patric.vbi.vt.edu/gene/overview.php?fid=",
+ "FB": "http://identifiers.org/flybase/",
+ "PAINT_REF": "http://www.pantherdb.org/panther/lookupId.jsp?id=PTHR",
+ "CASREF": "http://research.calacademy.org/research/ichthyology/catalog/getref.asp?id=",
+ "ENSEMBL": "http://identifiers.org/ensembl/",
+ "SMART": "http://smart.embl-heidelberg.de/smart/do_annotation.pl?BLAST=DUMMY&DOMAIN=",
+ "RefSeq": "http://www.ncbi.nlm.nih.gov/entrez/viewer.fcgi?val=",
+ "WBls": "http://purl.obolibrary.org/obo/WBls_",
+ "MaizeGDB_QTL": "http://www.maizegdb.org/data_center/trait?id=",
+ "SOY_ref": "http://www.soybase.org/sbt/search/search_results.php?category=Soybase_ID&search_term=",
+ "ECO": "http://purl.obolibrary.org/obo/ECO_",
+ "CGD_REF": "http://www.candidagenome.org/cgi-bin/reference/reference.pl?dbid=",
+ "ECK": "http://www.ecogene.org/geneInfo.php?eck_id=",
+ "CGD": "http://identifiers.org/cgd/",
+ "GR_GENE": "http://identifiers.org/gramene.gene/",
+ "RNAmods": "http://s59.cas.albany.edu/RNAmods/cgi-bin/rnashow.cgi?",
+ "KEGG_ENZYME": "http://identifiers.org/kegg.enzyme/",
+ "CACAO": "http://gowiki.tamu.edu/wiki/index.php/",
+ "IUPHAR_GPCR": "http://www.iuphar-db.org/DATABASE/FamilyMenuForward?familyId=",
+ "JCVI_TIGRFAMS": "http://search.jcvi.org/search?p&q=",
+ "SOY_QTL": "http://soybase.org/sbt/search/search_results.php?category=QTLName&search_term=",
+ "DDBJ": "http://arsa.ddbj.nig.ac.jp/arsa/ddbjSplSearch?KeyWord=",
+ "PRINTS": "http://www.bioinf.manchester.ac.uk/cgi-bin/dbbrowser/sprint/searchprintss.cgi?display_opts=Prints&category=None&queryform=false®expr=off&prints_accn=",
+ "PO_REF": "http://planteome.org/po_ref/",
+ "IMG": "http://img.jgi.doe.gov/cgi-bin/pub/main.cgi?section=GeneDetail&page=geneDetail&gene_oid=",
+ "CL": "http://purl.obolibrary.org/obo/CL_",
+ "UniProtKB-SubCell": "http://www.uniprot.org/locations/",
+ "NIF_Subcellular": "http://www.neurolex.org/wiki/",
+ "GeneDB": "http://identifiers.org/genedb/",
+ "ApiDB_PlasmoDB": "http://www.plasmodb.org/gene/",
+ "RNAcentral": "http://rnacentral.org/rna/",
+ "CGD_LOCUS": "http://www.candidagenome.org/cgi-bin/locus.pl?locus=",
+ "Rfam": "http://rfam.sanger.ac.uk/family/",
+ "Broad_NEUROSPORA": "http://www.broadinstitute.org/annotation/genome/neurospora/GeneDetails.html?sp=S",
+ "AGI_LocusCode": "http://arabidopsis.org/servlets/TairObject?type=locus&name=",
+ "OBO_SF2_PO": "http://sourceforge.net/p/obo/plant-ontology-po-term-requests/",
+ "FMA": "http://purl.obolibrary.org/obo/FMA_",
+ "CDD": "http://www.ncbi.nlm.nih.gov/Structure/cdd/cddsrv.cgi?uid=",
+ "PubChem_Compound": "http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?CMD=search&DB=pccompound&term=",
+ "HGNC_gene": "http://identifiers.org/hgnc.gene/",
+ "PharmGKB": "http://www.pharmgkb.org/do/serve?objId=",
+ "VMD": "http://vmd.vbi.vt.edu/cgi-bin/browse/browserDetail_new.cgi?gene_id=",
+ "UniParc": "http://www.uniprot.org/uniparc/",
+ "MEROPS": "http://merops.sanger.ac.uk/cgi-bin/pepsum?mid=",
+ "GDB": "http://www.gdb.org/gdb-bin/genera/accno?accessionNum=GDB:",
+ "SEED": "http://www.theseed.org/linkin.cgi?id=",
+ "SO": "http://purl.obolibrary.org/obo/SO_",
+ "Soy_gene": "http://www.soybase.org/sbt/search/search_results.php?category=FeatureName&search_term=",
+ "CORUM": "http://mips.gsf.de/genre/proj/corum/complexdetails.html?id=",
+ "RHEA": "http://www.rhea-db.org/reaction.xhtml?id=",
+ "dbSNP": "http://identifiers.org/dbsnp/",
+ "MaizeGDB_Locus": "http://identifiers.org/maizegdb.locus/",
+ "MO": "http://mged.sourceforge.net/ontologies/MGEDontology.php#",
+ "PLANA_REF": "http://purl.obolibrary.org/obo/plana/references/",
+ "BRENDA": "http://www.brenda-enzymes.info/php/result_flat.php4?ecno=",
+ "ASAP": "https://asap.ahabs.wisc.edu/annotation/php/feature_info.php?FeatureID=",
+ "CAS": "http://identifiers.org/cas/",
+ "H-invDB_locus": "http://www.h-invitational.jp/hinv/spsoup/locus_view?hix_id=",
+ "UM-BBD_ruleID": "http://eawag-bbd.ethz.ch/servlets/rule.jsp?rule=",
+ "NCBITaxon": "http://purl.obolibrary.org/obo/NCBITaxon_",
+ "ComplexPortal": "https://www.ebi.ac.uk/complexportal/complex/",
+ "JSTOR": "http://www.jstor.org/stable/",
+ "GRIMS": "https://www.genesys-pgr.org/acn/search2?q=IRGC+",
+ "PATO": "http://purl.obolibrary.org/obo/PATO_",
+ "GR_QTL": "http://identifiers.org/gramene.qtl/",
+ "ECOGENE": "http://www.ecogene.org/geneInfo.php?eg_id=",
+ "HPA_antibody": "http://www.proteinatlas.org/antibody_info.php?antibody_id=",
+ "VBRC": "http://vbrc.org/query.asp?web_id=VBRC:",
+ "EO_GIT": "https://github.com/Planteome/plant-environment-ontology/issues/",
+ "EchoBASE": "http://www.biolws1.york.ac.uk/echobase/Gene.cfm?recordID=",
+ "CASGEN": "http://research.calacademy.org/research/ichthyology/catalog/getname.asp?rank=Genus&id=",
+ "IUPHAR_RECEPTOR": "http://www.iuphar-db.org/DATABASE/ObjectDisplayForward?objectId=",
+ "IRIC": "http://oryzasnp.org/_variety.zul?irisid=",
+ "GenBank": "http://www.ncbi.nlm.nih.gov/entrez/viewer.fcgi?db=nucleotide&val=",
+ "TGD": "http://identifiers.org/tgd/",
+ "JCVI_EGAD": "http://cmr.jcvi.org/cgi-bin/CMR/EgadSearch.cgi?search_string=",
+ "PubChem_BioAssay": "http://pubchem.ncbi.nlm.nih.gov/assay/assay.cgi?aid=",
+ "TC": "http://www.tcdb.org/tcdb/index.php?tc=",
+ "SABIO-RK": "http://sabio.villa-bosch.de/reacdetails.jsp?reactid=",
+ "OBO_SF2_PECO": "https://sourceforge.net/p/obo/plant-environment-ontology-eo/",
+ "MetaCyc": "http://identifiers.org/metacyc/",
+ "PAMGO_GAT": "http://agro.vbi.vt.edu/public/servlet/GeneEdit?&Search=Search&level=2&genename=",
+ "ModBase": "http://salilab.org/modbase/searchbyid?databaseID=",
+ "OMIM": "http://omim.org/entry/",
+ "GR_MUT": "http://www.gramene.org/db/genes/search_gene?acc=",
+ "HPA": "http://www.proteinatlas.org/tissue_profile.php?antibody_id=",
+ "IntAct": "http://identifiers.org/intact/",
+ "ProDom": "http://prodom.prabi.fr/prodom/current/cgi-bin/request.pl?question=DBEN&query=",
+ "GRIN": "https://npgsweb.ars-grin.gov/gringlobal/accessiondetail.aspx?id=",
+ "WBPhenotype": "http://purl.obolibrary.org/obo/WBPhenotype_",
+ "BioCyc": "http://biocyc.org/META/NEW-IMAGE?type=PATHWAY&object=",
+ "ENSEMBL_GeneID": "http://www.ensembl.org/id/",
+ "PIR": "http://pir.georgetown.edu/cgi-bin/pirwww/nbrfget?uid=",
+ "UniProtKB-KW": "http://www.uniprot.org/keywords/",
+ "Planteome_gene": "https://www.google.com/search?q=",
+ "AspGD": "http://www.aspergillusgenome.org/cgi-bin/locus.pl?dbid=",
+ "JCVI_Medtr": "http://medicago.jcvi.org/cgi-bin/medicago/search/shared/ORF_infopage.cgi?orf=",
+ "EuPathDB": "http://eupathdb.org/gene/",
+ "PMCID": "http://www.ncbi.nlm.nih.gov/sites/entrez?db=pmc&cmd=search&term="
+ }
+}
\ No newline at end of file
diff --git a/python/json_export.py b/python/json_export.py
index c725562..7317878 100644
--- a/python/json_export.py
+++ b/python/json_export.py
@@ -1,7 +1,9 @@
from os import path
import json
-from ontobio.rdfgen.assoc_rdfgen import prefix_context
-from prefixcommons.curie_util import contract_uri
+from pathlib import Path
+import os
+
+from curies import Converter, Record
from pyshexc.parser_impl import generate_shexj
from typing import Optional, List, Union
from ShExJSG.ShExJ import Shape, ShapeAnd, ShapeOr, ShapeNot, TripleConstraint, shapeExpr, \
@@ -11,18 +13,31 @@
from shex_json_linkml import Association, AssociationCollection
from linkml_runtime.dumpers import JSONDumper
from linkml_runtime.loaders import JSONLoader
-from pathlib import Path
-import os
+
OUT_JSON = os.path.join('../shapes/json/shex_dump.json')
+ROOT_ENTITY = "http://purl.obolibrary.org/obo/go/shapes/GoCamEntity"
-def get_suffix(uri):
- suffix = contract_uri(uri, cmaps=[prefix_context])
- if len(suffix) > 0:
- return suffix[0]
- return path.basename(uri)
+def get_converter():
+ with open('go_context.json') as file:
+ go_context = json.load(file)
+ prefix_context = go_context['@context']
+
+ converter = Converter.from_prefix_map(prefix_context)
+
+ return converter
+
+converter = get_converter()
+
+def get_suffix(uri):
+
+ suffix = converter.compress(uri)
+
+ print(suffix if suffix else uri)
+
+ return suffix if suffix else uri
class NoctuaFormShex:
@@ -45,7 +60,7 @@ def get_shape_name(self, uri, clean=False):
name = 'GO' + name
return self.pref_dict.get(name, None if clean else uri)
- def gen_lookup_table(self):
+ def gen_terms_metadata(self):
goApi = 'http://api.geneontology.org/api/ontology/term/'
table = list()
for k, v in self.pref_dict.items():
@@ -59,8 +74,18 @@ def gen_lookup_table(self):
'synonyms': term.get('synonyms', "")
})
return table
-
- def _load_expr(self, subject: str, expr: Optional[Union[shapeExprLabel, shapeExpr]], preds=None) -> List:
+
+ def _load_root_subject_expr(self, expr: Optional[Union[shapeExprLabel, shapeExpr]]) -> str:
+
+ if expr is not None and len(expr)>0 and isinstance(expr[0], str):
+ if ROOT_ENTITY == expr[0]:
+ return ''
+ return self.get_shape_name(expr[0])
+
+ return None
+
+
+ def _load_expr(self, root_subject: str, subject: str, expr: Optional[Union[shapeExprLabel, shapeExpr]], preds=None) -> List:
if preds is None:
preds = {}
@@ -68,20 +93,20 @@ def _load_expr(self, subject: str, expr: Optional[Union[shapeExprLabel, shapeExp
preds.append(self.get_shape_name(expr))
if isinstance(expr, (ShapeOr, ShapeAnd)):
for expr2 in expr.shapeExprs:
- self._load_expr(subject, expr2, preds)
+ self._load_expr(root_subject, subject, expr2, preds)
elif isinstance(expr, ShapeNot):
- self._load_expr(subject, expr.shapeExpr, preds)
+ self._load_expr(root_subject, subject, expr.shapeExpr, preds)
elif isinstance(expr, Shape) and expr.expression is not None:
- self._load_triple_expr(subject, expr.expression, preds)
+ self._load_triple_expr(root_subject, subject, expr.expression, preds)
# throw an error here if pred list is empty
return preds
- def _load_triple_expr(self, subject: str, expr: Union[tripleExpr, tripleExprLabel], preds=None) -> None:
+ def _load_triple_expr(self, root_subject: str, subject: str, expr: Union[tripleExpr, tripleExprLabel], preds=None) -> None:
if isinstance(expr, (OneOf, EachOf)):
for expr2 in expr.expressions:
- self._load_triple_expr(subject, expr2, preds)
+ self._load_triple_expr(root_subject, subject, expr2, preds)
elif isinstance(expr, TripleConstraint) and expr.valueExpr is not None:
predicate = get_suffix(expr.predicate)
@@ -89,9 +114,9 @@ def _load_triple_expr(self, subject: str, expr: Union[tripleExpr, tripleExprLabe
return preds
objects = []
- self._load_expr(subject, expr.valueExpr, objects)
+ self._load_expr(root_subject, subject, expr.valueExpr, objects)
- exclude_from_extensions = ""
+ exclude_from_extensions = False
if isinstance(expr.annotations, list):
exclude_from_extensions = self._load_annotation(
expr, self.exclude_ext_pred)
@@ -101,15 +126,16 @@ def _load_triple_expr(self, subject: str, expr: Union[tripleExpr, tripleExprLabe
is_multivalued = True
goshape = Association(
+ root_subject=root_subject,
subject=subject,
object=objects,
predicate=predicate,
is_multivalued=is_multivalued,
+ exclude_from_extensions=exclude_from_extensions,
is_required=False,
context=""
)
- if exclude_from_extensions != "":
- goshape.exclude_from_extensions = exclude_from_extensions,
+
self.json_shapes.append(goshape)
return preds
@@ -129,16 +155,17 @@ def parse(self):
for shape in shapes:
shape_name = self.get_shape_name(shape['id'], True)
-
+ root_subject = self._load_root_subject_expr(shape.shapeExprs)
+
if shape_name is None:
continue
- print('Parsing Shape: ' + shape['id'])
+ #print('Parsing Shape: ' + shape['id'])
shexps = shape.shapeExprs or []
for expr in shexps:
- self._load_expr(shape_name, expr)
+ self._load_expr(root_subject, shape_name, expr)
if __name__ == "__main__":
@@ -146,7 +173,8 @@ def parse(self):
base_path = Path(__file__).parent
shex_fp = (base_path / "../shapes/go-cam-shapes.shex").resolve()
json_shapes_fp = (base_path / "../shapes/json/shex_dump.json").resolve()
- look_table_fp = (base_path / "../shapes/json/look_table.json").resolve()
+ terms_metadata_fp = (base_path / "../shapes/json/terms_metadata.json").resolve()
+ terms_shorthand_fp = (base_path / "../shapes/json/terms_shorthand.json").resolve()
shex_full_fp = (base_path / "../shapes/json/shex_full.json").resolve()
with open(shex_fp) as f:
@@ -160,8 +188,8 @@ def parse(self):
coll = AssociationCollection(goshapes=nfShex.json_shapes)
jd.dump(coll, to_file=OUT_JSON)
- """ with open(look_table_fp, "w") as sf:
- json.dump(nfShex.gen_lookup_table(), sf, indent=2) """
-
+ """ with open(terms_metadata_fp, "w") as sf:
+ json.dump(nfShex.gen_terms_metadata(), sf, indent=2) """
+
with open(shex_full_fp, "w") as sf:
json.dump(nfShex.parse_raw(), sf, indent=2)
diff --git a/python/requirements.txt b/python/requirements.txt
index 15ef926..643c882 100644
--- a/python/requirements.txt
+++ b/python/requirements.txt
@@ -6,3 +6,4 @@ click>=0.0
cachier==1.1.8
linkml
linkml-runtime
+ontobio
\ No newline at end of file
diff --git a/python/schema/shex_json_linkml.yaml b/python/schema/shex_json_linkml.yaml
index 0858375..a22b906 100644
--- a/python/schema/shex_json_linkml.yaml
+++ b/python/schema/shex_json_linkml.yaml
@@ -19,6 +19,7 @@ default_curi_maps:
prefixes:
biolink: https://w3id.org/biolink/vocab/
linkml: https://w3id.org/linkml/
+ schema: http://schema.org/
classes:
Association:
@@ -27,6 +28,7 @@ classes:
expression rule
slots:
- subject
+ - root_subject
- predicate
- object
- is_multivalued
@@ -72,6 +74,13 @@ slots:
description: >-
The domain of the GO shape expression rule, this is the subject of the relationship.
+ root_subject:
+ range: uriorcurie
+ required: true
+ description: >-
+ The domain of the GO shape expression rule, this is the root subject of the relationship.
+
+
is_multivalued:
range: boolean
required: true
@@ -84,7 +93,7 @@ slots:
inlined: true
inlined_as_list: true
description: >-
- A collectionm of GO domain/range constraint shapes where a GO domain/range constraint shape
+ A collection of GO domain/range constraint shapes where a GO domain/range constraint shape
is defined as the domain, relationship, and range of a GO shape expression rule.
is_required:
@@ -95,7 +104,7 @@ slots:
range: string
description: >-
used to determine if this shape is used in the the visual pathway editor or the graphical editor. Those shapes
- annotated with like this https://github.com/geneontology/go-shapes/pull/285/files will be exlcuded from the
+ annotated with like this https://github.com/geneontology/go-shapes/pull/285/files will be excluded from the
visual pathway editor but still included in the file so this file can be used in the graphical editor as well.
required: true
diff --git a/python/schema/shex_terms_metadata_json_linkml.yaml b/python/schema/shex_terms_metadata_json_linkml.yaml
new file mode 100644
index 0000000..ace96c2
--- /dev/null
+++ b/python/schema/shex_terms_metadata_json_linkml.yaml
@@ -0,0 +1,76 @@
+id: shex-term-metadata
+name: ShexTermMetadataModel
+description: a schema for metadata of the terms used in the shex schema
+license: https://creativecommons.org/publicdomain/zero/1.0/
+version: 0.1.0
+
+default_prefix: GO
+default_range: string
+
+imports:
+ - linkml:types
+ - shex_json_linkml
+
+default_curi_maps:
+ - obo_context
+ - idot_context
+ - monarch_context
+ - semweb_context
+
+prefixes:
+ biolink: https://w3id.org/biolink/vocab/
+ linkml: https://w3id.org/linkml/
+ schema: http://schema.org/
+
+classes:
+ Term:
+ description: >-
+ A term metadata
+ slots:
+ - id
+ - label
+ - definition
+ - comment
+ - synonyms
+ close_mappings:
+ - schema:Thing
+
+ TermCollection:
+ tree_root: true
+ slots:
+ - terms
+ description: >-
+ A collection of terms
+
+slots:
+
+ label:
+ range: string
+ description: >-
+ The term label
+ required: true
+
+ definition:
+ range: string
+ description: >-
+ The term definition
+
+ comment:
+ range: string
+ description: >-
+ The term comment
+
+ synonyms:
+ range: string
+ description: >-
+ The term synonyms
+
+ terms:
+ multivalued: true
+ range: TermCollection
+ inlined: true
+ inlined_as_list: true
+ description: >-
+ A collection of terms
+
+
\ No newline at end of file
diff --git a/python/shex_json_linkml.py b/python/shex_json_linkml.py
index e740c57..4fa37cc 100644
--- a/python/shex_json_linkml.py
+++ b/python/shex_json_linkml.py
@@ -1,5 +1,5 @@
# Auto generated from shex_json_linkml.yaml by pythongen.py version: 0.9.0
-# Generation date: 2022-11-18T12:44:53
+# Generation date: 2022-12-07T23:52:38
# Schema: GODomainRangeConstraintsModel
#
# id: go-shex-domain-range-constraints
@@ -35,7 +35,7 @@
GO = CurieNamespace('GO', 'http://purl.obolibrary.org/obo/GO_')
BIOLINK = CurieNamespace('biolink', 'https://w3id.org/biolink/vocab/')
LINKML = CurieNamespace('linkml', 'https://w3id.org/linkml/')
-SCHEMA = CurieNamespace('schema', 'http://example.org/UNKNOWN/schema/')
+SCHEMA = CurieNamespace('schema', 'http://schema.org/')
DEFAULT_ = GO
@@ -58,6 +58,7 @@ class Association(YAMLRoot):
class_model_uri: ClassVar[URIRef] = GO.Association
subject: Union[str, URIorCURIE] = None
+ root_subject: Union[str, URIorCURIE] = None
object: Union[Union[str, URIorCURIE], List[Union[str, URIorCURIE]]] = None
is_multivalued: Union[bool, Bool] = None
is_required: Union[bool, Bool] = None
@@ -71,6 +72,9 @@ def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]):
if not isinstance(self.subject, URIorCURIE):
self.subject = URIorCURIE(self.subject)
+ if not isinstance(self.root_subject, URIorCURIE):
+ self.root_subject = URIorCURIE(self.root_subject)
+
if self._is_empty(self.object):
self.MissingRequiredField("object")
if not isinstance(self.object, list):
@@ -143,6 +147,9 @@ class slots:
slots.subject = Slot(uri=GO.subject, name="subject", curie=GO.curie('subject'),
model_uri=GO.subject, domain=None, range=Union[str, URIorCURIE])
+slots.root_subject = Slot(uri=GO.root_subject, name="root_subject", curie=GO.curie('root_subject'),
+ model_uri=GO.root_subject, domain=None, range=Union[str, URIorCURIE])
+
slots.is_multivalued = Slot(uri=GO.is_multivalued, name="is_multivalued", curie=GO.curie('is_multivalued'),
model_uri=GO.is_multivalued, domain=None, range=Union[bool, Bool])
diff --git a/python/shex_terms_metadata_linkml.py b/python/shex_terms_metadata_linkml.py
new file mode 100644
index 0000000..eee690f
--- /dev/null
+++ b/python/shex_terms_metadata_linkml.py
@@ -0,0 +1,134 @@
+# Auto generated from shex_terms_metadata_json_linkml.yaml by pythongen.py version: 0.9.0
+# Generation date: 2022-11-30T19:57:14
+# Schema: ShexTermMetadataModel
+#
+# id: shex-term-metadata
+# description: a schema for metadata of the terms used in the shex schema
+# license: https://creativecommons.org/publicdomain/zero/1.0/
+
+import dataclasses
+import sys
+import re
+from jsonasobj2 import JsonObj, as_dict
+from typing import Optional, List, Union, Dict, ClassVar, Any
+from dataclasses import dataclass
+from linkml_runtime.linkml_model.meta import EnumDefinition, PermissibleValue, PvFormulaOptions
+
+from linkml_runtime.utils.slot import Slot
+from linkml_runtime.utils.metamodelcore import empty_list, empty_dict, bnode
+from linkml_runtime.utils.yamlutils import YAMLRoot, extended_str, extended_float, extended_int
+from linkml_runtime.utils.dataclass_extensions_376 import dataclasses_init_fn_with_kwargs
+from linkml_runtime.utils.formatutils import camelcase, underscore, sfx
+from linkml_runtime.utils.enumerations import EnumDefinitionImpl
+from rdflib import Namespace, URIRef
+from linkml_runtime.utils.curienamespace import CurieNamespace
+from linkml_runtime.linkml_model.types import String, Uriorcurie
+from linkml_runtime.utils.metamodelcore import URIorCURIE
+
+metamodel_version = "1.7.0"
+version = "0.1.0"
+
+# Overwrite dataclasses _init_fn to add **kwargs in __init__
+dataclasses._init_fn = dataclasses_init_fn_with_kwargs
+
+# Namespaces
+GO = CurieNamespace('GO', 'http://purl.obolibrary.org/obo/GO_')
+BIOLINK = CurieNamespace('biolink', 'https://w3id.org/biolink/vocab/')
+LINKML = CurieNamespace('linkml', 'https://w3id.org/linkml/')
+SCHEMA = CurieNamespace('schema', 'http://example.org/UNKNOWN/schema/')
+DEFAULT_ = GO
+
+
+# Types
+
+# Class references
+
+
+
+@dataclass
+class Term(YAMLRoot):
+ """
+ A term metadata
+ """
+ _inherited_slots: ClassVar[List[str]] = []
+
+ class_class_uri: ClassVar[URIRef] = GO.Term
+ class_class_curie: ClassVar[str] = "GO:Term"
+ class_name: ClassVar[str] = "Term"
+ class_model_uri: ClassVar[URIRef] = GO.Term
+
+ id: Union[str, URIorCURIE] = None
+ label: str = None
+ definition: Optional[str] = None
+ comment: Optional[str] = None
+ synonyms: Optional[str] = None
+
+ def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]):
+ if self._is_empty(self.id):
+ self.MissingRequiredField("id")
+ if not isinstance(self.id, URIorCURIE):
+ self.id = URIorCURIE(self.id)
+
+ if self._is_empty(self.label):
+ self.MissingRequiredField("label")
+ if not isinstance(self.label, str):
+ self.label = str(self.label)
+
+ if self.definition is not None and not isinstance(self.definition, str):
+ self.definition = str(self.definition)
+
+ if self.comment is not None and not isinstance(self.comment, str):
+ self.comment = str(self.comment)
+
+ if self.synonyms is not None and not isinstance(self.synonyms, str):
+ self.synonyms = str(self.synonyms)
+
+ super().__post_init__(**kwargs)
+
+
+@dataclass
+class TermCollection(YAMLRoot):
+ """
+ A collection of terms
+ """
+ _inherited_slots: ClassVar[List[str]] = []
+
+ class_class_uri: ClassVar[URIRef] = GO.TermCollection
+ class_class_curie: ClassVar[str] = "GO:TermCollection"
+ class_name: ClassVar[str] = "TermCollection"
+ class_model_uri: ClassVar[URIRef] = GO.TermCollection
+
+ terms: Optional[Union[Union[dict, "TermCollection"], List[Union[dict, "TermCollection"]]]] = empty_list()
+
+ def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]):
+ if not isinstance(self.terms, list):
+ self.terms = [self.terms] if self.terms is not None else []
+ self.terms = [v if isinstance(v, TermCollection) else TermCollection(**as_dict(v)) for v in self.terms]
+
+ super().__post_init__(**kwargs)
+
+
+# Enumerations
+
+
+# Slots
+class slots:
+ pass
+
+slots.id = Slot(uri=GO.id, name="id", curie=GO.curie('id'),
+ model_uri=GO.id, domain=None, range=Union[str, URIorCURIE])
+
+slots.label = Slot(uri=GO.label, name="label", curie=GO.curie('label'),
+ model_uri=GO.label, domain=None, range=str)
+
+slots.definition = Slot(uri=GO.definition, name="definition", curie=GO.curie('definition'),
+ model_uri=GO.definition, domain=None, range=Optional[str])
+
+slots.comment = Slot(uri=GO.comment, name="comment", curie=GO.curie('comment'),
+ model_uri=GO.comment, domain=None, range=Optional[str])
+
+slots.synonyms = Slot(uri=GO.synonyms, name="synonyms", curie=GO.curie('synonyms'),
+ model_uri=GO.synonyms, domain=None, range=Optional[str])
+
+slots.terms = Slot(uri=GO.terms, name="terms", curie=GO.curie('terms'),
+ model_uri=GO.terms, domain=None, range=Optional[Union[Union[dict, TermCollection], List[Union[dict, TermCollection]]]])
diff --git a/python/shex_to_json_playground.ipynb b/python/shex_to_json_playground.ipynb
index 9c52124..f89418d 100644
--- a/python/shex_to_json_playground.ipynb
+++ b/python/shex_to_json_playground.ipynb
@@ -191,7 +191,7 @@
],
"metadata": {
"kernelspec": {
- "display_name": "Python 3 (ipykernel)",
+ "display_name": "Python 3.8.10 ('venv': venv)",
"language": "python",
"name": "python3"
},
@@ -205,11 +205,11 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
- "version": "3.7.9"
+ "version": "3.8.10"
},
"vscode": {
"interpreter": {
- "hash": "88953039a69fbc3cee158df0a3647530aed876ec4de7d6bab7db32384164d671"
+ "hash": "fd3b897b1e7df8fe01541c1cc54eb2b15faa6ce950f05eeae4aaf5e5940a405f"
}
}
},
diff --git a/python/target/jsonschema/shex_json_linkml.json b/python/target/jsonschema/shex_json_linkml.json
deleted file mode 100644
index 1d02317..0000000
--- a/python/target/jsonschema/shex_json_linkml.json
+++ /dev/null
@@ -1,83 +0,0 @@
-{
- "$defs": {
- "Association": {
- "additionalProperties": false,
- "description": "GO domain/range constraint shape is defined as the domain, relationship, and range of a GO shape expression rule",
- "properties": {
- "context": {
- "description": "used to determine if this shape is used in the the visual pathway editor or the graphical editor. Those shapes annotated with like this https://github.com/geneontology/go-shapes/pull/285/files will be exlcuded from the visual pathway editor but still included in the file so this file can be used in the graphical editor as well.",
- "type": "string"
- },
- "exclude_from_extensions": {
- "description": "used to determine if this shape is used in the the visual pathway editor or the graphical editor. Those shapes annotated with like this",
- "type": "boolean"
- },
- "is_multivalued": {
- "description": "for this shape, the relationship in question supports multiple values in the object of the association.",
- "type": "boolean"
- },
- "is_required": {
- "type": "boolean"
- },
- "object": {
- "description": "The range of the relationship identified by the Relationship.id parameter (This contains the values can be provided in the object of a statement)",
- "items": {
- "type": "string"
- },
- "type": "array"
- },
- "predicate": {
- "description": "The predicate is the relationship between the domain and range of the GO shape expression rule.",
- "type": "string"
- },
- "subject": {
- "description": "The domain of the GO shape expression rule, this is the subject of the relationship.",
- "type": "string"
- }
- },
- "required": [
- "subject",
- "object",
- "is_multivalued",
- "is_required",
- "context"
- ],
- "title": "Association",
- "type": "object"
- },
- "Collection": {
- "additionalProperties": false,
- "description": "A collection of GO domain/range constraint shapes. This is primarily used in this schema to allow several test data objects to be submitted in a single file.",
- "properties": {
- "goshapes": {
- "description": "A collectionm of GO domain/range constraint shapes where a GO domain/range constraint shape is defined as the domain, relationship, and range of a GO shape expression rule.",
- "items": {
- "$ref": "#/$defs/Association"
- },
- "type": "array"
- }
- },
- "required": [],
- "title": "Collection",
- "type": "object"
- }
- },
- "$id": "go-shex-domain-range-constraints",
- "$schema": "http://json-schema.org/draft-07/schema#",
- "additionalProperties": true,
- "metamodel_version": "1.7.0",
- "properties": {
- "goshapes": {
- "description": "A collectionm of GO domain/range constraint shapes where a GO domain/range constraint shape is defined as the domain, relationship, and range of a GO shape expression rule.",
- "items": {
- "$ref": "#/$defs/Association"
- },
- "type": "array"
- }
- },
- "required": [],
- "title": "GODomainRangeConstraintsModel",
- "type": "object",
- "version": "0.1.0"
-}
-
diff --git a/python/target/typescript/shex_json_linkml.ts b/python/target/typescript/shex_json_linkml.ts
index 2860b65..f9b779d 100644
--- a/python/target/typescript/shex_json_linkml.ts
+++ b/python/target/typescript/shex_json_linkml.ts
@@ -1,70 +1,33 @@
-
-
-
-
-
/**
* GO domain/range constraint shape is defined as the domain, relationship, and range of a GO shape expression rule
*/
-
export interface Association {
-
-
/**
* The domain of the GO shape expression rule, this is the subject of the relationship.
- */
- subject?: string,
-
-
+ */subject?: string,
/**
* The predicate is the relationship between the domain and range of the GO shape expression rule.
- */
- predicate?: string,
-
-
+ */predicate?: string,
/**
* The range of the relationship identified by the Relationship.id parameter (This contains the values can be provided in the object of a statement)
- */
- object?: string,
-
-
+ */object?: string,
/**
* for this shape, the relationship in question supports multiple values in the object of the association.
- */
- is_multivalued?: boolean,
-
-
- /**
- * None
- */
+ */is_multivalued?: boolean,
is_required?: boolean,
-
-
/**
- * used to determine if this shape is used in the the visual pathway editor or the graphical editor. Those shapes annotated with like this https://github.com/geneontology/go-shapes/pull/285/files will be exlcuded from the visual pathway editor but still included in the file so this file can be used in the graphical editor as well.
- */
- context?: string,
-
-
+ * used to determine if this shape is used in the the visual pathway editor or the graphical editor. Those shapes annotated with like this https://github.com/geneontology/go-shapes/pull/285/files will be excluded from the visual pathway editor but still included in the file so this file can be used in the graphical editor as well.
+ */context?: string,
/**
* used to determine if this shape is used in the the visual pathway editor or the graphical editor. Those shapes annotated with like this
- */
- exclude_from_extensions?: boolean,
-
+ */exclude_from_extensions?: boolean,
}
-
-
/**
* A collection of GO domain/range constraint shapes. This is primarily used in this schema to allow several test data objects to be submitted in a single file.
*/
-
-export interface Collection {
-
-
+export interface AssociationCollection {
/**
- * A collectionm of GO domain/range constraint shapes where a GO domain/range constraint shape is defined as the domain, relationship, and range of a GO shape expression rule.
- */
- goshapes?: Association[],
-
+ * A collection of GO domain/range constraint shapes where a GO domain/range constraint shape is defined as the domain, relationship, and range of a GO shape expression rule.
+ */goshapes?: Association[],
}
diff --git a/shapes/WIP_standard_annot_ShEx b/shapes/WIP_standard_annot_ShEx
new file mode 100644
index 0000000..1ec1503
--- /dev/null
+++ b/shapes/WIP_standard_annot_ShEx
@@ -0,0 +1,543 @@
+BASE
+PREFIX obo:
+PREFIX rdf:
+PREFIX rdfs:
+PREFIX owl:
+PREFIX xsd:
+PREFIX skos:
+PREFIX prov:
+#metadata
+PREFIX bl:
+PREFIX contributor:
+PREFIX provided_by:
+PREFIX modification_date:
+PREFIX creation_date:
+PREFIX import_date:
+PREFIX xref:
+PREFIX exact_match:
+PREFIX source:
+PREFIX evidence:
+PREFIX with:
+PREFIX x:
+PREFIX y:
+#model level annotations
+PREFIX ontology:
+PREFIX taxon:
+PREFIX modelstate:
+PREFIX templatestate:
+PREFIX oboinowlid:
+###contributor, date, providedBy reused
+PREFIX title:
+PREFIX imports:
+# always limit imports to? ;
+PREFIX in_taxon:
+#semantic: classes
+PREFIX GoInformationBiomacromolecule:
+PREFIX GoProtein:
+PREFIX GoProteinContainingComplex:
+PREFIX GoCellularComponent:
+PREFIX GoBiologicalProcess:
+PREFIX GoAnatomicalStructureDevelopment:
+PREFIX GoAnatomicalStructureFormationInvolvedInMorphogenesis:
+PREFIX GoAnatomicalStructureMorphogenesis:
+PREFIX GoCellDifferentiation:
+PREFIX GoCellDivision:
+PREFIX GoCellFateCommitment:
+PREFIX GoCellFateDetermination:
+PREFIX GoCellFateSpecification:
+PREFIX GoCellularComponentAssembly:
+PREFIX GoCellularComponentDisassembly:
+PREFIX GoCellularComponentOrganization:
+PREFIX GoDevelopmentalMaturation:
+PREFIX GoGrowth:
+PREFIX GoLocalization:
+PREFIX GoLocomotion:
+PREFIX GoProteinContainingComplexRemodeling:
+PREFIX GoPatternSpecificationProcess:
+PREFIX GoMetabolicProcess:
+PREFIX GoTransport:
+PREFIX GoMolecularFunction:
+PREFIX GoTransporterActivity:
+PREFIX GoChemicalEntity:
+PREFIX GoEvidence:
+PREFIX GoAnatomicalEntity:
+PREFIX GoCell:
+PREFIX GoOrganism:
+PREFIX GoBiologicalPhase:
+PREFIX GoLifeCycleStage:
+PREFIX GoPlantStructureDevelopmentStage:
+#semantic: relations
+PREFIX acts_upstream_of:
+PREFIX acts_upstream_of_negative_effect:
+PREFIX acts_upstream_of_positive_effect:
+PREFIX acts_upstream_of_or_within:
+PREFIX acts_upstream_of_or_within_negative_effect:
+PREFIX acts_upstream_of_or_within_positive_effect:
+PREFIX involved_in:
+PREFIX part_of:
+PREFIX has_part:
+PREFIX occurs_in:
+PREFIX adjacent_to:
+PREFIX overlaps:
+PREFIX existence_overlaps:
+PREFIX existence_starts_and_ends_during:
+PREFIX enabled_by:
+PREFIX contributes_to:
+PREFIX has_input:
+PREFIX has_output:
+PREFIX has_primary_input:
+PREFIX has_primary_output:
+PREFIX has_target_end_location:
+PREFIX has_target_start_location:
+PREFIX located_in:
+PREFIX is_active_in:
+PREFIX happens_during:
+PREFIX acts_on_population_of:
+PREFIX results_in_development_of:
+PREFIX results_in_formation_of:
+PREFIX results_in_morphogenesis_of:
+PREFIX results_in_acquisition_of_features_of:
+PREFIX results_in_commitment_to:
+PREFIX results_in_determination_of:
+PREFIX results_in_specification_of:
+PREFIX results_in_assembly_of:
+PREFIX results_in_disassembly_of:
+PREFIX results_in_organization_of:
+PREFIX results_in_maturation_of:
+PREFIX results_in_growth_of:
+PREFIX results_in_movement_of:
+PREFIX results_in_remodeling_of:
+
+ {
+ a [owl:Ontology] + ;
+ contributor: xsd:string +; #TODO would be better as an IRI
+ modification_date: xsd:string {1}; #Use ISO 8601 as a standard.
+ creation_date: xsd:string {0,1}; #Use ISO 8601 as a standard.
+ import_date: xsd:string {0,1}; #Use ISO 8601 as a standard.
+ provided_by: xsd:string +; #TODO would be better as an IRI
+ rdfs:comment xsd:string *;
+ modelstate: xsd:string {1}; #TODO would be better as an IRI
+ templatestate: xsd:string {0,1}; #TODO should be modeled as xsd:boolean but currently a string. No value means false.
+ in_taxon: . *;
+ title: xsd:string {1};
+ imports: . *;
+ oboinowlid: . *; #TODO not sure if we really want this?
+ owl:versionIRI . *;
+ prov:wasDerivedFrom IRI {0,1}; # for model copy
+}
+
+ {
+ contributor: xsd:string +; #TODO would be better as an IRI
+ modification_date: xsd:string {1}; #Use ISO 8601 as a standard.
+ creation_date: xsd:string {0,1}; #Use ISO 8601 as a standard.
+ import_date: xsd:string {0,1}; #Use ISO 8601 as a standard.
+ provided_by: xsd:string *; #TODO would be better as an IRI
+ rdfs:comment xsd:string *;
+ skos:note xsd:string *;
+}
+
+ IRI @ AND EXTRA a {
+ a [owl:NamedIndividual] * // rdfs:comment "Every entity we care about is a named individual";
+ xref: . * // rdfs:comment "mappings for the entity. Value is typically a CURIE string. Currently this is only used for Reactome-derived models." ;
+ rdfs:label . {0,1} // rdfs:comment "the name of the entity. Currently this is only used for Reactome-derived models." ;
+ exact_match: . *;
+ x: . {0,1} // rdfs:comment "X coordinate for node. This is used for caching layouts in the Noctua Graph Editor.";
+ y: . {0,1} // rdfs:comment "Y coordinate for node. This is used for caching layouts in the Noctua Graph Editor.";
+ skos:narrower . * // rdfs:comment "This entity (e.g. a node representing a pathway) represents a narrower (in any sense) concept then the target node. ";
+ skos:broader . * // rdfs:comment "This entity (e.g. a node representing a pathway) represents a broader (in any sense) concept then the target node. ";
+} // rdfs:comment "Default allowable metadata for GO-CAM entities"
+
+ {
+ rdf:type [ owl:Class ] {1};
+}
+
+ IRI @ AND EXTRA rdfs:subClassOf {
+ rdfs:subClassOf [ GoBiologicalProcess: ] ;
+}
+
+ BNode @ AND {
+ owl:complementOf @
+}
+
+ IRI @ AND EXTRA rdfs:subClassOf {
+ rdfs:subClassOf [ GoOrganism: ] ;
+}
+
+ @ AND EXTRA a {
+ a @ ;
+} // rdfs:comment "A member of a class of organisms defined in the NCBI taxonomy"
+
+ @ AND EXTRA a {
+ a ( @ OR @ ) {1};
+ part_of: @ *;
+ has_input: ( @ OR @ OR @ OR @ ) *;
+ has_output: ( @ OR @ OR @ ) *;
+ has_primary_input: ( @ OR @ OR @ OR @ ) *;
+ has_primary_output: ( @ OR @ OR @ ) *;
+ occurs_in: @ {0,1};
+ has_target_end_location: @ {0,1};
+ has_target_start_location: @ {0,1};
+ acts_on_population_of: ( @ OR @ ) *;
+ happens_during: ( @ OR @ OR @ ) *;
+} // rdfs:comment "A biological process"
+
+ IRI @ AND EXTRA rdfs:subClassOf {
+ rdfs:subClassOf [ GoAnatomicalStructureDevelopment: ] ;
+}
+
+ @ AND EXTRA a {
+ a @ {1};
+ results_in_development_of: @ {0,1};
+} // rdfs:comment "an anatomical structure development class GO biological process or child"
+
+ IRI @ AND EXTRA rdfs:subClassOf {
+ rdfs:subClassOf [ GoAnatomicalStructureFormationInvolvedInMorphogenesis: ] ;
+}
+
+ @ AND EXTRA a {
+ a @ {1};
+ results_in_formation_of: @ {0,1};
+} // rdfs:comment "an anatomical structure formation involved in morphogenesis class GO biological process or child"
+
+ IRI @ AND EXTRA rdfs:subClassOf {
+ rdfs:subClassOf [ GoAnatomicalStructureMorphogenesis: ] ;
+}
+
+ @ AND EXTRA a {
+ a @ {1};
+ results_in_morphogenesis_of: @ {0,1};
+} // rdfs:comment "an anatomical structure morphogenesis class GO biological process or child"
+
+ IRI @ AND EXTRA rdfs:subClassOf {
+ rdfs:subClassOf [ GoCellDifferentiation: ] ;
+}
+
+ @ AND EXTRA a {
+ a @ {1};
+ results_in_acquisition_of_features_of: @ {0,1};
+} // rdfs:comment "a cell differentiation GO biological process or child"
+
+ IRI @ AND EXTRA rdfs:subClassOf {
+ rdfs:subClassOf [ GoCellDivision: ] ;
+}
+
+ @ AND EXTRA a {
+ a @ {1};
+ occurs_in: @ {0,1};
+} // rdfs:comment "a cell division GO biological process or child"
+
+ IRI @ AND EXTRA rdfs:subClassOf {
+ rdfs:subClassOf [ GoCellFateCommitment: ] ;
+}
+
+ @ AND EXTRA a {
+ a @ {1};
+ results_in_commitment_to: @ {0,1};
+} // rdfs:comment "a cell fate commitment GO biological process or child"
+
+ IRI @ AND EXTRA rdfs:subClassOf {
+ rdfs:subClassOf [ GoCellFateDetermination: ] ;
+}
+
+ @ AND EXTRA a {
+ a @ {1};
+ results_in_determination_of: @ {0,1};
+} // rdfs:comment "a cell fate determination GO biological process or child"
+
+ IRI @ AND EXTRA rdfs:subClassOf {
+ rdfs:subClassOf [ GoCellFateSpecification: ] ;
+}
+
+ @ AND EXTRA a {
+ a @ {1};
+ results_in_specification_of: @ {0,1};
+} // rdfs:comment "a cell fate specification GO biological process or child"
+
+ IRI @ AND EXTRA rdfs:subClassOf {
+ rdfs:subClassOf [ GoCellularComponentAssembly: ] ;
+}
+
+ @ AND EXTRA a {
+ a @ {1};
+ results_in_assembly_of: @ {0,1};
+} // rdfs:comment "a cellular component assembly GO biological process or child"
+
+ IRI @ AND EXTRA rdfs:subClassOf {
+ rdfs:subClassOf [ GoCellularComponentDisassembly: ] ;
+}
+
+ @ AND EXTRA a {
+ a @ {1};
+ results_in_disassembly_of: @ {0,1};
+} // rdfs:comment "a cellular component disassembly GO biological process or child"
+
+ IRI @ AND EXTRA rdfs:subClassOf {
+ rdfs:subClassOf [ GoCellularComponentOrganization: ] ;
+}
+
+ @ AND EXTRA a {
+ a @ {1};
+ results_in_organization_of: @ {0,1};
+} // rdfs:comment "a cellular component organization GO biological process or child"
+
+ IRI @ AND EXTRA rdfs:subClassOf {
+ rdfs:subClassOf [ GoDevelopmentalMaturation: ] ;
+}
+
+ @ AND EXTRA a {
+ a @ {1};
+ results_in_maturation_of: @ {0,1};
+} // rdfs:comment "a developmental maturation GO biological process or child"
+
+ IRI @ AND EXTRA rdfs:subClassOf {
+ rdfs:subClassOf [ GoGrowth: ] ;
+}
+
+ @ AND EXTRA a {
+ a @ {1};
+ results_in_growth_of: @ {0,1};
+} // rdfs:comment "a growth GO biological process or child"
+
+ IRI @ AND EXTRA rdfs:subClassOf {
+ rdfs:subClassOf [ GoLocalization: ] ;
+}
+
+ @ AND EXTRA a {
+ a @ {1};
+ has_primary_input: ( @ OR @ OR @ OR @ ) *;
+ has_target_end_location: @ {0,1};
+ has_target_start_location: @ {0,1};
+} // rdfs:comment "a localization GO biological process or child"
+
+ IRI @ AND EXTRA rdfs:subClassOf {
+ rdfs:subClassOf [ GoLocomotion: ] ;
+}
+
+ @ AND EXTRA a {
+ a @ {1};
+ results_in_movement_of: @ {0,1};
+} // rdfs:comment "a locomotion GO biological process or child"
+
+ IRI @ AND EXTRA rdfs:subClassOf {
+ rdfs:subClassOf [ GoMetabolicProcess: ] ;
+}
+
+ @ AND EXTRA a {
+ a @ {1};
+ has_primary_input: @ *;
+ has_primary_output: @ *;
+} // rdfs:comment "a metabolic process GO biological process or child"
+
+ IRI @ AND EXTRA rdfs:subClassOf {
+ rdfs:subClassOf [ GoProteinContainingComplexRemodeling: ] ;
+}
+
+ @ AND EXTRA a {
+ a @ {1};
+ results_in_remodeling_of: @ {0,1};
+} // rdfs:comment "a protein containing complex remodeling GO biological process or child"
+
+ IRI @ AND EXTRA rdfs:subClassOf {
+ rdfs:subClassOf [ GoPatternSpecificationProcess: ] ;
+}
+
+ @ | | | | |