├── .github └── workflows │ ├── docs.yml │ └── qc.yml ├── .gitignore ├── LICENSE.txt ├── README.md ├── apollo_sv-base.json ├── apollo_sv-base.obo ├── apollo_sv-base.owl ├── apollo_sv-full.json ├── apollo_sv-full.obo ├── apollo_sv-full.owl ├── apollo_sv.json ├── apollo_sv.obo ├── apollo_sv.owl ├── catalog-v001.xml ├── docs ├── cite.md ├── contributing.md ├── index.md └── odk-workflows │ ├── ContinuousIntegration.md │ ├── EditorsWorkflow.md │ ├── ManageDocumentation.md │ ├── ReleaseWorkflow.md │ ├── RepoManagement.md │ ├── RepositoryFileStructure.md │ ├── SettingUpDockerForODK.md │ ├── UpdateImports.md │ ├── components.md │ └── index.md ├── find-highest-obo-id.sh ├── mkdocs.yaml └── src ├── ontology ├── Makefile ├── README-editors.md ├── apollo-sv.owl ├── apollo_sv-edit.owl ├── apollo_sv-idranges.owl ├── apollo_sv-odk.yaml ├── apollo_sv.Makefile ├── catalog-v001.xml ├── imports │ ├── external_import.owl │ ├── geo_import.owl │ ├── geo_terms.txt │ ├── go_import.owl │ ├── go_terms.txt │ ├── iao_import.owl │ ├── iao_terms.txt │ ├── ido_import.owl │ ├── ido_terms.txt │ ├── mf_import.owl │ ├── mf_terms.txt │ ├── omrse_import.owl │ ├── omrse_terms.txt │ ├── ro_import.owl │ └── ro_terms.txt ├── run.bat └── run.sh ├── scripts ├── run-command.sh ├── update_repo.sh └── validate_id_ranges.sc ├── sparql ├── README.md ├── apollo_sv_terms.sparql ├── basic-report.sparql ├── class-count-by-prefix.sparql ├── edges.sparql ├── inject-subset-declaration.ru ├── inject-synonymtype-declaration.ru ├── iri-range-violation.sparql ├── label-with-iri-violation.sparql ├── labels.sparql ├── multiple-replaced_by-violation.sparql ├── obsoletes.sparql ├── owldef-self-reference-violation.sparql ├── postprocess-module.ru ├── preprocess-module.ru ├── simple-seed.sparql ├── subsets-labeled.sparql ├── synonyms.sparql ├── terms.sparql └── xrefs.sparql └── templates └── external_import.tsv /.github/workflows/docs.yml: -------------------------------------------------------------------------------- 1 | # Basic ODK workflow 2 | name: Docs 3 | 4 | # Controls when the action will run. 5 | on: 6 | # Allows you to run this workflow manually from the Actions tab 7 | workflow_dispatch: 8 | push: 9 | branches: 10 | - main 11 | 12 | # A workflow run is made up of one or more jobs that can run sequentially or in parallel 13 | jobs: 14 | build: 15 | name: Deploy docs 16 | runs-on: ubuntu-latest 17 | steps: 18 | - name: Checkout main 19 | uses: actions/checkout@v3 20 | 21 | - name: Deploy docs 22 | uses: mhausenblas/mkdocs-deploy-gh-pages@master 23 | # Or use mhausenblas/mkdocs-deploy-gh-pages@nomaterial to build without the mkdocs-material theme 24 | env: 25 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 26 | CONFIG_FILE: mkdocs.yaml 27 | 28 | -------------------------------------------------------------------------------- /.github/workflows/qc.yml: -------------------------------------------------------------------------------- 1 | # Basic ODK workflow 2 | 3 | name: CI 4 | 5 | # Controls when the action will run. 6 | on: 7 | # Triggers the workflow on push or pull request events but only for the main branch 8 | push: 9 | branches: [ main ] 10 | pull_request: 11 | branches: [ main ] 12 | 13 | # Allows you to run this workflow manually from the Actions tab 14 | workflow_dispatch: 15 | 16 | # A workflow run is made up of one or more jobs that can run sequentially or in parallel 17 | jobs: 18 | # This workflow contains a single job called "ontology_qc" 19 | ontology_qc: 20 | # The type of runner that the job will run on 21 | runs-on: ubuntu-latest 22 | container: obolibrary/odkfull:v1.5.2 23 | 24 | # Steps represent a sequence of tasks that will be executed as part of the job 25 | steps: 26 | # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it 27 | - uses: actions/checkout@v3 28 | 29 | - name: Run ontology QC checks 30 | env: 31 | DEFAULT_BRANCH: main 32 | run: cd src/ontology && make ROBOT_ENV='ROBOT_JAVA_ARGS=-Xmx6G' test IMP=false PAT=false MIR=false 33 | 34 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | !src/ontology/tmp/README.md 3 | *.tmp 4 | *.tmp.json 5 | *.tmp.obo 6 | *.tmp.owl 7 | .DS_Store 8 | .github/token.txt 9 | bin/ 10 | semantic.cache 11 | src/.DS_Store 12 | src/ontology/*~ 13 | src/ontology/.DS_Store 14 | src/ontology/apollo_sv-base.* 15 | src/ontology/apollo_sv-basic.* 16 | src/ontology/apollo_sv-full.* 17 | src/ontology/apollo_sv-simple-non-classified.* 18 | src/ontology/apollo_sv-simple.* 19 | src/ontology/apollo_sv.json 20 | src/ontology/apollo_sv.obo 21 | src/ontology/apollo_sv.owl 22 | src/ontology/catalog*.xml 23 | src/ontology/dosdp-tools.log 24 | src/ontology/ed_definitions_merged.owl 25 | src/ontology/imports/*_terms_combined.txt 26 | src/ontology/merged-apollo_sv-edit.owl 27 | src/ontology/mirror 28 | src/ontology/mirror/* 29 | src/ontology/ontologyterms.txt 30 | src/ontology/patterns 31 | src/ontology/reports/* 32 | src/ontology/run.sh.conf 33 | src/ontology/run.sh.env 34 | src/ontology/seed.txt 35 | src/ontology/simple_seed.txt 36 | src/ontology/target/ 37 | src/ontology/tmp/* 38 | src/patterns/all_pattern_terms.txt 39 | src/patterns/data/**/*.ofn 40 | src/patterns/data/**/*.txt 41 | src/patterns/pattern_owl_seed.txt -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | Attribution 4.0 International 2 | 3 | ======================================================================= 4 | 5 | Creative Commons Corporation ("Creative Commons") is not a law firm and 6 | does not provide legal services or legal advice. Distribution of 7 | Creative Commons public licenses does not create a lawyer-client or 8 | other relationship. Creative Commons makes its licenses and related 9 | information available on an "as-is" basis. Creative Commons gives no 10 | warranties regarding its licenses, any material licensed under their 11 | terms and conditions, or any related information. Creative Commons 12 | disclaims all liability for damages resulting from their use to the 13 | fullest extent possible. 14 | 15 | Using Creative Commons Public Licenses 16 | 17 | Creative Commons public licenses provide a standard set of terms and 18 | conditions that creators and other rights holders may use to share 19 | original works of authorship and other material subject to copyright 20 | and certain other rights specified in the public license below. The 21 | following considerations are for informational purposes only, are not 22 | exhaustive, and do not form part of our licenses. 23 | 24 | Considerations for licensors: Our public licenses are 25 | intended for use by those authorized to give the public 26 | permission to use material in ways otherwise restricted by 27 | copyright and certain other rights. Our licenses are 28 | irrevocable. Licensors should read and understand the terms 29 | and conditions of the license they choose before applying it. 30 | Licensors should also secure all rights necessary before 31 | applying our licenses so that the public can reuse the 32 | material as expected. Licensors should clearly mark any 33 | material not subject to the license. This includes other CC- 34 | licensed material, or material used under an exception or 35 | limitation to copyright. More considerations for licensors: 36 | wiki.creativecommons.org/Considerations_for_licensors 37 | 38 | Considerations for the public: By using one of our public 39 | licenses, a licensor grants the public permission to use the 40 | licensed material under specified terms and conditions. If 41 | the licensor's permission is not necessary for any reason--for 42 | example, because of any applicable exception or limitation to 43 | copyright--then that use is not regulated by the license. Our 44 | licenses grant only permissions under copyright and certain 45 | other rights that a licensor has authority to grant. Use of 46 | the licensed material may still be restricted for other 47 | reasons, including because others have copyright or other 48 | rights in the material. A licensor may make special requests, 49 | such as asking that all changes be marked or described. 50 | Although not required by our licenses, you are encouraged to 51 | respect those requests where reasonable. More_considerations 52 | for the public: 53 | wiki.creativecommons.org/Considerations_for_licensees 54 | 55 | ======================================================================= 56 | 57 | Creative Commons Attribution 4.0 International Public License 58 | 59 | By exercising the Licensed Rights (defined below), You accept and agree 60 | to be bound by the terms and conditions of this Creative Commons 61 | Attribution 4.0 International Public License ("Public License"). To the 62 | extent this Public License may be interpreted as a contract, You are 63 | granted the Licensed Rights in consideration of Your acceptance of 64 | these terms and conditions, and the Licensor grants You such rights in 65 | consideration of benefits the Licensor receives from making the 66 | Licensed Material available under these terms and conditions. 67 | 68 | 69 | Section 1 -- Definitions. 70 | 71 | a. Adapted Material means material subject to Copyright and Similar 72 | Rights that is derived from or based upon the Licensed Material 73 | and in which the Licensed Material is translated, altered, 74 | arranged, transformed, or otherwise modified in a manner requiring 75 | permission under the Copyright and Similar Rights held by the 76 | Licensor. For purposes of this Public License, where the Licensed 77 | Material is a musical work, performance, or sound recording, 78 | Adapted Material is always produced where the Licensed Material is 79 | synched in timed relation with a moving image. 80 | 81 | b. Adapter's License means the license You apply to Your Copyright 82 | and Similar Rights in Your contributions to Adapted Material in 83 | accordance with the terms and conditions of this Public License. 84 | 85 | c. Copyright and Similar Rights means copyright and/or similar rights 86 | closely related to copyright including, without limitation, 87 | performance, broadcast, sound recording, and Sui Generis Database 88 | Rights, without regard to how the rights are labeled or 89 | categorized. For purposes of this Public License, the rights 90 | specified in Section 2(b)(1)-(2) are not Copyright and Similar 91 | Rights. 92 | 93 | d. Effective Technological Measures means those measures that, in the 94 | absence of proper authority, may not be circumvented under laws 95 | fulfilling obligations under Article 11 of the WIPO Copyright 96 | Treaty adopted on December 20, 1996, and/or similar international 97 | agreements. 98 | 99 | e. Exceptions and Limitations means fair use, fair dealing, and/or 100 | any other exception or limitation to Copyright and Similar Rights 101 | that applies to Your use of the Licensed Material. 102 | 103 | f. Licensed Material means the artistic or literary work, database, 104 | or other material to which the Licensor applied this Public 105 | License. 106 | 107 | g. Licensed Rights means the rights granted to You subject to the 108 | terms and conditions of this Public License, which are limited to 109 | all Copyright and Similar Rights that apply to Your use of the 110 | Licensed Material and that the Licensor has authority to license. 111 | 112 | h. Licensor means the individual(s) or entity(ies) granting rights 113 | under this Public License. 114 | 115 | i. Share means to provide material to the public by any means or 116 | process that requires permission under the Licensed Rights, such 117 | as reproduction, public display, public performance, distribution, 118 | dissemination, communication, or importation, and to make material 119 | available to the public including in ways that members of the 120 | public may access the material from a place and at a time 121 | individually chosen by them. 122 | 123 | j. Sui Generis Database Rights means rights other than copyright 124 | resulting from Directive 96/9/EC of the European Parliament and of 125 | the Council of 11 March 1996 on the legal protection of databases, 126 | as amended and/or succeeded, as well as other essentially 127 | equivalent rights anywhere in the world. 128 | 129 | k. You means the individual or entity exercising the Licensed Rights 130 | under this Public License. Your has a corresponding meaning. 131 | 132 | 133 | Section 2 -- Scope. 134 | 135 | a. License grant. 136 | 137 | 1. Subject to the terms and conditions of this Public License, 138 | the Licensor hereby grants You a worldwide, royalty-free, 139 | non-sublicensable, non-exclusive, irrevocable license to 140 | exercise the Licensed Rights in the Licensed Material to: 141 | 142 | a. reproduce and Share the Licensed Material, in whole or 143 | in part; and 144 | 145 | b. produce, reproduce, and Share Adapted Material. 146 | 147 | 2. Exceptions and Limitations. For the avoidance of doubt, where 148 | Exceptions and Limitations apply to Your use, this Public 149 | License does not apply, and You do not need to comply with 150 | its terms and conditions. 151 | 152 | 3. Term. The term of this Public License is specified in Section 153 | 6(a). 154 | 155 | 4. Media and formats; technical modifications allowed. The 156 | Licensor authorizes You to exercise the Licensed Rights in 157 | all media and formats whether now known or hereafter created, 158 | and to make technical modifications necessary to do so. The 159 | Licensor waives and/or agrees not to assert any right or 160 | authority to forbid You from making technical modifications 161 | necessary to exercise the Licensed Rights, including 162 | technical modifications necessary to circumvent Effective 163 | Technological Measures. For purposes of this Public License, 164 | simply making modifications authorized by this Section 2(a) 165 | (4) never produces Adapted Material. 166 | 167 | 5. Downstream recipients. 168 | 169 | a. Offer from the Licensor -- Licensed Material. Every 170 | recipient of the Licensed Material automatically 171 | receives an offer from the Licensor to exercise the 172 | Licensed Rights under the terms and conditions of this 173 | Public License. 174 | 175 | b. No downstream restrictions. You may not offer or impose 176 | any additional or different terms or conditions on, or 177 | apply any Effective Technological Measures to, the 178 | Licensed Material if doing so restricts exercise of the 179 | Licensed Rights by any recipient of the Licensed 180 | Material. 181 | 182 | 6. No endorsement. Nothing in this Public License constitutes or 183 | may be construed as permission to assert or imply that You 184 | are, or that Your use of the Licensed Material is, connected 185 | with, or sponsored, endorsed, or granted official status by, 186 | the Licensor or others designated to receive attribution as 187 | provided in Section 3(a)(1)(A)(i). 188 | 189 | b. Other rights. 190 | 191 | 1. Moral rights, such as the right of integrity, are not 192 | licensed under this Public License, nor are publicity, 193 | privacy, and/or other similar personality rights; however, to 194 | the extent possible, the Licensor waives and/or agrees not to 195 | assert any such rights held by the Licensor to the limited 196 | extent necessary to allow You to exercise the Licensed 197 | Rights, but not otherwise. 198 | 199 | 2. Patent and trademark rights are not licensed under this 200 | Public License. 201 | 202 | 3. To the extent possible, the Licensor waives any right to 203 | collect royalties from You for the exercise of the Licensed 204 | Rights, whether directly or through a collecting society 205 | under any voluntary or waivable statutory or compulsory 206 | licensing scheme. In all other cases the Licensor expressly 207 | reserves any right to collect such royalties. 208 | 209 | 210 | Section 3 -- License Conditions. 211 | 212 | Your exercise of the Licensed Rights is expressly made subject to the 213 | following conditions. 214 | 215 | a. Attribution. 216 | 217 | 1. If You Share the Licensed Material (including in modified 218 | form), You must: 219 | 220 | a. retain the following if it is supplied by the Licensor 221 | with the Licensed Material: 222 | 223 | i. identification of the creator(s) of the Licensed 224 | Material and any others designated to receive 225 | attribution, in any reasonable manner requested by 226 | the Licensor (including by pseudonym if 227 | designated); 228 | 229 | ii. a copyright notice; 230 | 231 | iii. a notice that refers to this Public License; 232 | 233 | iv. a notice that refers to the disclaimer of 234 | warranties; 235 | 236 | v. a URI or hyperlink to the Licensed Material to the 237 | extent reasonably practicable; 238 | 239 | b. indicate if You modified the Licensed Material and 240 | retain an indication of any previous modifications; and 241 | 242 | c. indicate the Licensed Material is licensed under this 243 | Public License, and include the text of, or the URI or 244 | hyperlink to, this Public License. 245 | 246 | 2. You may satisfy the conditions in Section 3(a)(1) in any 247 | reasonable manner based on the medium, means, and context in 248 | which You Share the Licensed Material. For example, it may be 249 | reasonable to satisfy the conditions by providing a URI or 250 | hyperlink to a resource that includes the required 251 | information. 252 | 253 | 3. If requested by the Licensor, You must remove any of the 254 | information required by Section 3(a)(1)(A) to the extent 255 | reasonably practicable. 256 | 257 | 4. If You Share Adapted Material You produce, the Adapter's 258 | License You apply must not prevent recipients of the Adapted 259 | Material from complying with this Public License. 260 | 261 | 262 | Section 4 -- Sui Generis Database Rights. 263 | 264 | Where the Licensed Rights include Sui Generis Database Rights that 265 | apply to Your use of the Licensed Material: 266 | 267 | a. for the avoidance of doubt, Section 2(a)(1) grants You the right 268 | to extract, reuse, reproduce, and Share all or a substantial 269 | portion of the contents of the database; 270 | 271 | b. if You include all or a substantial portion of the database 272 | contents in a database in which You have Sui Generis Database 273 | Rights, then the database in which You have Sui Generis Database 274 | Rights (but not its individual contents) is Adapted Material; and 275 | 276 | c. You must comply with the conditions in Section 3(a) if You Share 277 | all or a substantial portion of the contents of the database. 278 | 279 | For the avoidance of doubt, this Section 4 supplements and does not 280 | replace Your obligations under this Public License where the Licensed 281 | Rights include other Copyright and Similar Rights. 282 | 283 | 284 | Section 5 -- Disclaimer of Warranties and Limitation of Liability. 285 | 286 | a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE 287 | EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS 288 | AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF 289 | ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS, 290 | IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION, 291 | WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR 292 | PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS, 293 | ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT 294 | KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT 295 | ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU. 296 | 297 | b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE 298 | TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION, 299 | NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT, 300 | INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES, 301 | COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR 302 | USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN 303 | ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR 304 | DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR 305 | IN PART, THIS LIMITATION MAY NOT APPLY TO YOU. 306 | 307 | c. The disclaimer of warranties and limitation of liability provided 308 | above shall be interpreted in a manner that, to the extent 309 | possible, most closely approximates an absolute disclaimer and 310 | waiver of all liability. 311 | 312 | 313 | Section 6 -- Term and Termination. 314 | 315 | a. This Public License applies for the term of the Copyright and 316 | Similar Rights licensed here. However, if You fail to comply with 317 | this Public License, then Your rights under this Public License 318 | terminate automatically. 319 | 320 | b. Where Your right to use the Licensed Material has terminated under 321 | Section 6(a), it reinstates: 322 | 323 | 1. automatically as of the date the violation is cured, provided 324 | it is cured within 30 days of Your discovery of the 325 | violation; or 326 | 327 | 2. upon express reinstatement by the Licensor. 328 | 329 | For the avoidance of doubt, this Section 6(b) does not affect any 330 | right the Licensor may have to seek remedies for Your violations 331 | of this Public License. 332 | 333 | c. For the avoidance of doubt, the Licensor may also offer the 334 | Licensed Material under separate terms or conditions or stop 335 | distributing the Licensed Material at any time; however, doing so 336 | will not terminate this Public License. 337 | 338 | d. Sections 1, 5, 6, 7, and 8 survive termination of this Public 339 | License. 340 | 341 | 342 | Section 7 -- Other Terms and Conditions. 343 | 344 | a. The Licensor shall not be bound by any additional or different 345 | terms or conditions communicated by You unless expressly agreed. 346 | 347 | b. Any arrangements, understandings, or agreements regarding the 348 | Licensed Material not stated herein are separate from and 349 | independent of the terms and conditions of this Public License. 350 | 351 | 352 | Section 8 -- Interpretation. 353 | 354 | a. For the avoidance of doubt, this Public License does not, and 355 | shall not be interpreted to, reduce, limit, restrict, or impose 356 | conditions on any use of the Licensed Material that could lawfully 357 | be made without permission under this Public License. 358 | 359 | b. To the extent possible, if any provision of this Public License is 360 | deemed unenforceable, it shall be automatically reformed to the 361 | minimum extent necessary to make it enforceable. If the provision 362 | cannot be reformed, it shall be severed from this Public License 363 | without affecting the enforceability of the remaining terms and 364 | conditions. 365 | 366 | c. No term or condition of this Public License will be waived and no 367 | failure to comply consented to unless expressly agreed to by the 368 | Licensor. 369 | 370 | d. Nothing in this Public License constitutes or may be interpreted 371 | as a limitation upon, or waiver of, any privileges and immunities 372 | that apply to the Licensor or You, including from the legal 373 | processes of any jurisdiction or authority. 374 | 375 | 376 | ======================================================================= 377 | 378 | Creative Commons is not a party to its public 379 | licenses. Notwithstanding, Creative Commons may elect to apply one of 380 | its public licenses to material it publishes and in those instances 381 | will be considered the “Licensor.” The text of the Creative Commons 382 | public licenses is dedicated to the public domain under the CC0 Public 383 | Domain Dedication. Except for the limited purpose of indicating that 384 | material is shared under a Creative Commons public license or as 385 | otherwise permitted by the Creative Commons policies published at 386 | creativecommons.org/policies, Creative Commons does not authorize the 387 | use of the trademark "Creative Commons" or any other trademark or logo 388 | of Creative Commons without its prior written consent including, 389 | without limitation, in connection with any unauthorized modifications 390 | to any of its public licenses or any other arrangements, 391 | understandings, or agreements concerning use of licensed material. For 392 | the avoidance of doubt, this paragraph does not form part of the 393 | public licenses. 394 | 395 | Creative Commons may be contacted at creativecommons.org. 396 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # apollo-sv 2 | 3 | ## About the Apollo-SV ontology: 4 | Apollo-SV, developed as an OWL specification, defines the terms and relations necessary for interoperation between epidemic simulators and public health application software that interface with these simulators. 5 | 6 | ## Requirements: 7 | 8 | Apollo-SV imports the GEO ontology, which is located at: https://github.com/ufbmi/geographical-entity-ontology 9 | 10 | Currently, the development branch of the GEO project is intended for use with Apollo-SV. 11 | 12 | ## Viewing the Apollo-SV ontology in Protege 13 | 14 | ### Introduction 15 | To view Apollo-SV, you need to download and configure the Protege Ontology editor, and then open the ontology in Protege. 16 | 17 | ### Download and Installation 18 | Download and Install Protege 19 | First, go to this web site and download the appropriate version of Protege for your operating system: 20 | 21 | http://protege.stanford.edu/download/registered.html 22 | 23 | #### To install Protege on a Windows-based system, run the installer and follow the on-screen instructions. 24 | 25 | #### To install Protege on a Mac: 26 | 27 | 1. Open the downloaded file 28 | 2. If you do not see anything, you might need to click the Finder icon on the Dock (the smiley face icon on the left) 29 | 3. In the Finder window, the file Protege.app should be highlighted. 30 | 4. Drag and Drop Protege.app onto the LaunchPad? icon on the Dock (the icon with the Rocket) 31 | 32 | ### Configure Protege 33 | Many ontologies assign meaningless identifiers to classes and properties, and use annotations such as labels to assign terms to classes. However, Protege sometimes by default shows the meaningless identifiers. Apollo-SV is one of the ontologies that follows best practices of using meaningless identifiers. To view Apollo-SV, you should therefore configure Protege to display labels. 34 | 35 | #### To set up Protege to show labels on a PC: 36 | 1. Go to the File menu, choose Preferences... 37 | 2. Click on the Renderer tab. 38 | 3. Select "Render by annotation property..." option under "Entity rendering" 39 | 4. Click the Configure... button 40 | 5. Paste the following into the Set Language box: en, en-us, !, "" 41 | 6. Click OK. (Returns to Renderer Tab) 42 | 7. Click OK. (Returns to Protege main screen) 43 | 44 | #### To set up Protege to show labels on a Mac: 45 | 46 | 1. Click the Protege menu next to the apple icon, choose Preferences... 47 | 2. Click on the Renderer tab. 48 | 3. Select "Render by annotation property..." option under "Entity rendering" 49 | 4. Click the Configure... button 50 | 5. Paste the following into the Set Language box: en, en-us, !, "" 51 | 6. Click OK. (Returns to Renderer Tab) 52 | 7. Click OK. (Returns to Protege main screen) 53 | 54 | 55 | ### Opening Apollo-SV in Protege 56 | After you launch Protege, depending on the version, you will either be presented with a set of options for opening an ontology, or you will get a blank ontology. 57 | 58 | #### For the menu options: 59 | 60 | 1. Choose Open OWL Ontology from URI 61 | 2. Paste the following URL into the URI text box: http://purl.obolibrary.org/obo/apollo_sv.owl 62 | 3. Click OK or Next 63 | 64 | #### For the blank ontology scenario: 65 | 66 | 1. Choose File->Open from URL... 67 | 2. Paste the following URL into the URI text box: http://purl.obolibrary.org/obo/apollo_sv.owl 68 | 3. Click OK. 69 | -------------------------------------------------------------------------------- /catalog-v001.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /docs/cite.md: -------------------------------------------------------------------------------- 1 | # How to cite APOLLO_SV 2 | -------------------------------------------------------------------------------- /docs/contributing.md: -------------------------------------------------------------------------------- 1 | # How to contribute to APOLLO_SV 2 | -------------------------------------------------------------------------------- /docs/index.md: -------------------------------------------------------------------------------- 1 | # APOLLO_SV Ontology Documentation 2 | 3 | [//]: # "This file is meant to be edited by the ontology maintainer." 4 | 5 | Welcome to the APOLLO_SV documentation! 6 | 7 | You can find descriptions of the standard ontology engineering workflows [here](odk-workflows/index.md). 8 | -------------------------------------------------------------------------------- /docs/odk-workflows/ContinuousIntegration.md: -------------------------------------------------------------------------------- 1 | # Introduction to Continuous Integration Workflows with ODK 2 | 3 | Historically, most repos have been using Travis CI for continuous integration testing and building, but due to 4 | runtime restrictions, we recently switched a lot of our repos to GitHub actions. You can set up your repo with CI by adding 5 | this to your configuration file (src/ontology/apollo_sv-odk.yaml): 6 | 7 | ``` 8 | ci: 9 | - github_actions 10 | ``` 11 | 12 | When [updateing your repo](RepoManagement.md), you will notice a new file being added: `.github/workflows/qc.yml`. 13 | 14 | This file contains your CI logic, so if you need to change, or add anything, this is the place! 15 | 16 | Alternatively, if your repo is in GitLab instead of GitHub, you can set up your repo with GitLab CI by adding 17 | this to your configuration file (src/ontology/apollo_sv-odk.yaml): 18 | 19 | ``` 20 | ci: 21 | - gitlab-ci 22 | ``` 23 | 24 | This will add a file called `.gitlab-ci.yml` in the root of your repo. 25 | 26 | -------------------------------------------------------------------------------- /docs/odk-workflows/EditorsWorkflow.md: -------------------------------------------------------------------------------- 1 | # Editors Workflow 2 | 3 | The editors workflow is one of the formal [workflows](index.md) to ensure that the ontology is developed correctly according to ontology engineering principles. There are a few different editors workflows: 4 | 5 | 1. Local editing workflow: Editing the ontology in your local environment by hand, using tools such as Protégé, ROBOT templates or DOSDP patterns. 6 | 2. Completely automated data pipeline (GitHub Actions) 7 | 3. DROID workflow 8 | 9 | This document only covers the first editing workflow, but more will be added in the future 10 | 11 | ### Local editing workflow 12 | 13 | Workflow requirements: 14 | 15 | - git 16 | - github 17 | - docker 18 | - editing tool of choice, e.g. Protégé, your favourite text editor, etc 19 | 20 | #### 1. _Create issue_ 21 | Ensure that there is a ticket on your issue tracker that describes the change you are about to make. While this seems optional, this is a very important part of the social contract of building an ontology - no change to the ontology should be performed without a good ticket, describing the motivation and nature of the intended change. 22 | 23 | #### 2. _Update main branch_ 24 | In your local environment (e.g. your laptop), make sure you are on the `main` (prev. `master`) branch and ensure that you have all the upstream changes, for example: 25 | 26 | ``` 27 | git checkout main 28 | git pull 29 | ``` 30 | 31 | #### 3. _Create feature branch_ 32 | Create a new branch. Per convention, we try to use meaningful branch names such as: 33 | - issue23removeprocess (where issue 23 is the related issue on GitHub) 34 | - issue26addcontributor 35 | - release20210101 (for releases) 36 | 37 | On your command line, this looks like this: 38 | 39 | ``` 40 | git checkout -b issue23removeprocess 41 | ``` 42 | 43 | #### 4. _Perform edit_ 44 | Using your editor of choice, perform the intended edit. For example: 45 | 46 | _Protégé_ 47 | 48 | 1. Open `src/ontology/apollo_sv-edit.owl` in Protégé 49 | 2. Make the change 50 | 3. Save the file 51 | 52 | _TextEdit_ 53 | 54 | 1. Open `src/ontology/apollo_sv-edit.owl` in TextEdit (or Sublime, Atom, Vim, Nano) 55 | 2. Make the change 56 | 3. Save the file 57 | 58 | Consider the following when making the edit. 59 | 60 | 1. According to our development philosophy, the only places that should be manually edited are: 61 | - `src/ontology/apollo_sv-edit.owl` 62 | - Any ROBOT templates you chose to use (the TSV files only) 63 | - Any DOSDP data tables you chose to use (the TSV files, and potentially the associated patterns) 64 | - components (anything in `src/ontology/components`), see [here](RepositoryFileStructure.md). 65 | 2. Imports should not be edited (any edits will be flushed out with the next update). However, refreshing imports is a potentially breaking change - and is discussed [elsewhere](UpdateImports.md). 66 | 3. Changes should usually be small. Adding or changing 1 term is great. Adding or changing 10 related terms is ok. Adding or changing 100 or more terms at once should be considered very carefully. 67 | 68 | #### 4. _Check the Git diff_ 69 | This step is very important. Rather than simply trusting your change had the intended effect, we should always use a git diff as a first pass for sanity checking. 70 | 71 | In our experience, having a visual git client like [GitHub Desktop](https://desktop.github.com/) or [sourcetree](https://www.sourcetreeapp.com/) is really helpful for this part. In case you prefer the command line: 72 | 73 | ``` 74 | git status 75 | git diff 76 | ``` 77 | #### 5. Quality control 78 | Now it's time to run your quality control checks. This can either happen locally ([5a](#5a-local-testing)) or through your continuous integration system ([7/5b](#75b-continuous-integration-testing)). 79 | 80 | #### 5a. Local testing 81 | If you chose to run your test locally: 82 | 83 | ``` 84 | sh run.sh make IMP=false test 85 | ``` 86 | This will run the whole set of configured ODK tests on including your change. If you have a complex DOSDP pattern pipeline you may want to add `PAT=false` to skip the potentially lengthy process of rebuilding the patterns. 87 | 88 | ``` 89 | sh run.sh make IMP=false PAT=false test 90 | ``` 91 | 92 | #### 6. Pull request 93 | 94 | When you are happy with the changes, you commit your changes to your feature branch, push them upstream (to GitHub) and create a pull request. For example: 95 | 96 | ``` 97 | git add NAMEOFCHANGEDFILES 98 | git commit -m "Added biological process term #12" 99 | git push -u origin issue23removeprocess 100 | ``` 101 | 102 | Then you go to your project on GitHub, and create a new pull request from the branch, for example: https://github.com/INCATools/ontology-development-kit/pulls 103 | 104 | There is a lot of great advise on how to write pull requests, but at the very least you should: 105 | - mention the tickets affected: `see #23` to link to a related ticket, or `fixes #23` if, by merging this pull request, the ticket is fixed. Tickets in the latter case will be closed automatically by GitHub when the pull request is merged. 106 | - summarise the changes in a few sentences. Consider the reviewer: what would they want to know right away. 107 | - If the diff is large, provide instructions on how to review the pull request best (sometimes, there are many changed files, but only one important change). 108 | 109 | #### 7/5b. Continuous Integration Testing 110 | If you didn't run and local quality control checks (see [5a](#5a-local-testing)), you should have Continuous Integration (CI) set up, for example: 111 | - Travis 112 | - GitHub Actions 113 | 114 | More on how to set this up [here](ContinuousIntegration.md). Once the pull request is created, the CI will automatically trigger. If all is fine, it will show up green, otherwise red. 115 | 116 | #### 8. Community review 117 | Once all the automatic tests have passed, it is important to put a second set of eyes on the pull request. Ontologies are inherently social - as in that they represent some kind of community consensus on how a domain is organised conceptually. This seems high brow talk, but it is very important that as an ontology editor, you have your work validated by the community you are trying to serve (e.g. your colleagues, other contributors etc.). In our experience, it is hard to get more than one review on a pull request - two is great. You can set up GitHub branch protection to actually require a review before a pull request can be merged! We recommend this. 118 | 119 | This step seems daunting to some hopefully under-resourced ontologies, but we recommend to put this high up on your list of priorities - train a colleague, reach out! 120 | 121 | #### 9. Merge and cleanup 122 | When the QC is green and the reviews are in (approvals), it is time to merge the pull request. After the pull request is merged, remember to delete the branch as well (this option will show up as a big button right after you have merged the pull request). If you have not done so, close all the associated tickets fixed by the pull request. 123 | 124 | #### 10. Changelog (Optional) 125 | It is sometimes difficult to keep track of changes made to an ontology. Some ontology teams opt to document changes in a changelog (simply a text file in your repository) so that when release day comes, you know everything you have changed. This is advisable at least for major changes (such as a new release system, a new pattern or template etc.). 126 | -------------------------------------------------------------------------------- /docs/odk-workflows/ManageDocumentation.md: -------------------------------------------------------------------------------- 1 | # Updating the Documentation 2 | 3 | The documentation for APOLLO_SV is managed in two places (relative to the repository root): 4 | 5 | 1. The `docs` directory contains all the files that pertain to the content of the documentation (more below) 6 | 2. the `mkdocs.yaml` file contains the documentation config, in particular its navigation bar and theme. 7 | 8 | The documentation is hosted using GitHub pages, on a special branch of the repository (called `gh-pages`). It is important that this branch is never deleted - it contains all the files GitHub pages needs to render and deploy the site. It is also important to note that _the gh-pages branch should never be edited manually_. All changes to the docs happen inside the `docs` directory on the `main` branch. 9 | 10 | ## Editing the docs 11 | 12 | ### Changing content 13 | All the documentation is contained in the `docs` directory, and is managed in _Markdown_. Markdown is a very simple and convenient way to produce text documents with formatting instructions, and is very easy to learn - it is also used, for example, in GitHub issues. This is a normal editing workflow: 14 | 15 | 1. Open the `.md` file you want to change in an editor of choice (a simple text editor is often best). _IMPORTANT_: Do not edit any files in the `docs/odk-workflows/` directory. These files are managed by the ODK system and will be overwritten when the repository is upgraded! If you wish to change these files, make an issue on the [ODK issue tracker](https://github.com/INCATools/ontology-development-kit/issues). 16 | 2. Perform the edit and save the file 17 | 3. Commit the file to a branch, and create a pull request as usual. 18 | 4. If your development team likes your changes, merge the docs into main branch. 19 | 5. Deploy the documentation (see below) 20 | 21 | ## Deploy the documentation 22 | 23 | The documentation is _not_ automatically updated from the Markdown, and needs to be deployed deliberately. To do this, perform the following steps: 24 | 25 | 1. In your terminal, navigate to the edit directory of your ontology, e.g.: 26 | ``` 27 | cd apollo_sv/src/ontology 28 | ``` 29 | 2. Now you are ready to build the docs as follows: 30 | ``` 31 | sh run.sh make update_docs 32 | ``` 33 | [Mkdocs](https://www.mkdocs.org/) now sets off to build the site from the markdown pages. You will be asked to 34 | - Enter your username 35 | - Enter your password (see [here](https://docs.github.com/en/github/authenticating-to-github/creating-a-personal-access-token) for using GitHub access tokens instead) 36 | _IMPORTANT_: Using password based authentication will be deprecated this year (2021). Make sure you read up on [personal access tokens](https://docs.github.com/en/github/authenticating-to-github/creating-a-personal-access-token) if that happens! 37 | 38 | If everything was successful, you will see a message similar to this one: 39 | 40 | ``` 41 | INFO - Your documentation should shortly be available at: https://ApolloDev.github.io/apollo-sv/ 42 | ``` 43 | 3. Just to double check, you can now navigate to your documentation pages (usually https://ApolloDev.github.io/apollo-sv/). 44 | Just make sure you give GitHub 2-5 minutes to build the pages! 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /docs/odk-workflows/ReleaseWorkflow.md: -------------------------------------------------------------------------------- 1 | # The release workflow 2 | The release workflow recommended by the ODK is based on GitHub releases and works as follows: 3 | 4 | 1. Run a release with the ODK 5 | 2. Review the release 6 | 3. Merge to main branch 7 | 4. Create a GitHub release 8 | 9 | These steps are outlined in detail in the following. 10 | 11 | ## Run a release with the ODK 12 | 13 | Preparation: 14 | 15 | 1. Ensure that all your pull requests are merged into your main (master) branch 16 | 2. Make sure that all changes to main are committed to GitHub (`git status` should say that there are no modified files) 17 | 3. Locally make sure you have the latest changes from main (`git pull`) 18 | 4. Checkout a new branch (e.g. `git checkout -b release-2021-01-01`) 19 | 5. You may or may not want to refresh your imports as part of your release strategy (see [here](UpdateImports.md)) 20 | 6. Make sure you have the latest ODK installed by running `docker pull obolibrary/odkfull` 21 | 22 | To actually run the release, you: 23 | 24 | 1. Open a command line terminal window and navigate to the src/ontology directory (`cd apollo_sv/src/ontology`) 25 | 2. Run release pipeline:`sh run.sh make prepare_release -B`. Note that for some ontologies, this process can take up to 90 minutes - especially if there are large ontologies you depend on, like PRO or CHEBI. 26 | 3. If everything went well, you should see the following output on your machine: `Release files are now in ../.. - now you should commit, push and make a release on your git hosting site such as GitHub or GitLab`. 27 | 28 | This will create all the specified release targets (OBO, OWL, JSON, and the variants, ont-full and ont-base) and copy them into your release directory (the top level of your repo). 29 | 30 | ## Review the release 31 | 32 | 1. (Optional) Rough check. This step is frequently skipped, but for the more paranoid among us (like the author of this doc), this is a 3 minute additional effort for some peace of mind. Open the main release (apollo_sv.owl) in you favourite development environment (i.e. Protégé) and eyeball the hierarchy. We recommend two simple checks: 33 | 1. Does the very top level of the hierarchy look ok? This means that all new terms have been imported/updated correctly. 34 | 2. Does at least one change that you know should be in this release appear? For example, a new class. This means that the release was actually based on the recent edit file. 35 | 2. Commit your changes to the branch and make a pull request 36 | 3. In your GitHub pull request, review the following three files in detail (based on our experience): 37 | 1. `apollo_sv.obo` - this reflects a useful subset of the whole ontology (everything that can be covered by OBO format). OBO format has that speaking for it: it is very easy to review! 38 | 2. `apollo_sv-base.owl` - this reflects the asserted axioms in your ontology that you have actually edited. 39 | 3. Ideally also take a look at `apollo_sv-full.owl`, which may reveal interesting new inferences you did not know about. Note that the diff of this file is sometimes quite large. 40 | 4. Like with every pull request, we recommend to always employ a second set of eyes when reviewing a PR! 41 | 42 | ## Merge the main branch 43 | Once your [CI checks](ContinuousIntegration.md) have passed, and your reviews are completed, you can now merge the branch into your main branch (don't forget to delete the branch afterwards - a big button will appear after the merge is finished). 44 | 45 | ## Create a GitHub release 46 | 47 | 1. Go to your releases page on GitHub by navigating to your repository, and then clicking on releases (usually on the right, for example: https://github.com/ApolloDev/apollo-sv/releases). Then click "Draft new release" 48 | 1. As the tag version you **need to choose the date on which your ontologies were build.** You can find this, for example, by looking at the `apollo_sv.obo` file and check the `data-version:` property. The date needs to be prefixed with a `v`, so, for example `v2020-02-06`. 49 | 1. You can write whatever you want in the release title, but we typically write the date again. The description underneath should contain a concise list of changes or term additions. 50 | 1. Click "Publish release". Done. 51 | 52 | ## Debugging typical ontology release problems 53 | 54 | ### Problems with memory 55 | 56 | When you are dealing with large ontologies, you need a lot of memory. When you see error messages relating to large ontologies such as CHEBI, PRO, NCBITAXON, or Uberon, you should think of memory first, see [here](https://github.com/INCATools/ontology-development-kit/blob/master/docs/DealWithLargeOntologies.md). 57 | 58 | ### Problems when using OBO format based tools 59 | 60 | Sometimes you will get cryptic error messages when using legacy tools using OBO format, such as the ontology release tool (OORT), which is also available as part of the ODK docker container. In these cases, you need to track down what axiom or annotation actually caused the breakdown. In our experience (in about 60% of the cases) the problem lies with duplicate annotations (`def`, `comment`) which are illegal in OBO. Here is an example recipe of how to deal with such a problem: 61 | 62 | 1. If you get a message like `make: *** [cl.Makefile:84: oort] Error 255` you might have a OORT error. 63 | 2. To debug this, in your terminal enter `sh run.sh make IMP=false PAT=false oort -B` (assuming you are already in the ontology folder in your directory) 64 | 3. This should show you where the error is in the log (eg multiple different definitions) 65 | WARNING: THE FIX BELOW IS NOT IDEAL, YOU SHOULD ALWAYS TRY TO FIX UPSTREAM IF POSSIBLE 66 | 4. Open `apollo_sv-edit.owl` in Protégé and find the offending term and delete all offending issue (e.g. delete ALL definition, if the problem was "multiple def tags not allowed") and save. 67 | *While this is not idea, as it will remove all definitions from that term, it will be added back again when the term is fixed in the ontology it was imported from and added back in. 68 | 5. Rerun `sh run.sh make IMP=false PAT=false oort -B` and if it all passes, commit your changes to a branch and make a pull request as usual. 69 | 70 | -------------------------------------------------------------------------------- /docs/odk-workflows/RepoManagement.md: -------------------------------------------------------------------------------- 1 | # Managing your ODK repository 2 | 3 | ## Updating your ODK repository 4 | 5 | Your ODK repositories configuration is managed in `src/ontology/apollo_sv-odk.yaml`. The [ODK Project Configuration Schema](https://github.com/INCATools/ontology-development-kit/blob/master/docs/project-schema.md) defines all possible parameters that can be used in this config YAML. Once you have made your changes, you can run the following to apply your changes to the repository: 6 | 7 | 8 | ``` 9 | sh run.sh make update_repo 10 | ``` 11 | 12 | There are a large number of options that can be set to configure your ODK, but we will only discuss a few of them here. 13 | 14 | NOTE for Windows users: 15 | 16 | You may get a cryptic failure such as `Set Illegal Option -` if the update script located in `src/scripts/update_repo.sh` 17 | was saved using Windows Line endings. These need to change to unix line endings. In Notepad++, for example, you can 18 | click on Edit->EOL Conversion->Unix LF to change this. 19 | 20 | ## Managing imports 21 | 22 | You can use the update repository workflow described on this page to perform the following operations to your imports: 23 | 24 | 1. Add a new import 25 | 2. Modify an existing import 26 | 3. Remove an import you no longer want 27 | 4. Customise an import 28 | 29 | We will discuss all these workflows in the following. 30 | 31 | 32 | ### Add new import 33 | 34 | To add a new import, you first edit your odk config as described [above](#updating-your-odk-repository), adding an `id` to the `product` list in the `import_group` section (for the sake of this example, we assume you already import RO, and your goal is to also import GO): 35 | 36 | ``` 37 | import_group: 38 | products: 39 | - id: ro 40 | - id: go 41 | ``` 42 | 43 | Note: our ODK file should only have one `import_group` which can contain multiple imports (in the `products` section). Next, you run the [update repo workflow](#updating-your-odk-repository) to apply these changes. Note that by default, this module is going to be a SLME Bottom module, see [here](http://robot.obolibrary.org/extract). To change that or customise your module, see section "Customise an import". To finalise the addition of your import, perform the following steps: 44 | 45 | 1. Add an import statement to your `src/ontology/apollo_sv-edit.owl` file. We suggest to do this using a text editor, by simply copying an existing import declaration and renaming it to the new ontology import, for example as follows: 46 | ``` 47 | ... 48 | Ontology( 49 | Import() 50 | Import() 51 | ... 52 | ``` 53 | 2. Add your imports redirect to your catalog file `src/ontology/catalog-v001.xml`, for example: 54 | ``` 55 | 56 | ``` 57 | 3. Test whether everything is in order: 58 | 1. [Refresh your import](UpdateImports.md) 59 | 2. Open in your Ontology Editor of choice (Protege) and ensure that the expected terms are imported. 60 | 61 | Note: The catalog file `src/ontology/catalog-v001.xml` has one purpose: redirecting 62 | imports from URLs to local files. For example, if you have 63 | 64 | ``` 65 | Import() 66 | ``` 67 | 68 | in your editors file (the ontology) and 69 | 70 | ``` 71 | 72 | ``` 73 | 74 | in your catalog, tools like `robot` or Protégé will recognize the statement 75 | in the catalog file to redirect the URL `http://purl.obolibrary.org/obo/apollo_sv/imports/go_import.owl` 76 | to the local file `imports/go_import.owl` (which is in your `src/ontology` directory). 77 | 78 | ### Modify an existing import 79 | 80 | If you simply wish to refresh your import in light of new terms, see [here](UpdateImports.md). If you wish to change the type of your module see section "Customise an import". 81 | 82 | ### Remove an existing import 83 | 84 | To remove an existing import, perform the following steps: 85 | 86 | 1. remove the import declaration from your `src/ontology/apollo_sv-edit.owl`. 87 | 2. remove the id from your `src/ontology/apollo_sv-odk.yaml`, eg. `- id: go` from the list of `products` in the `import_group`. 88 | 3. run [update repo workflow](#updating-your-odk-repository) 89 | 4. delete the associated files manually: 90 | - `src/imports/go_import.owl` 91 | - `src/imports/go_terms.txt` 92 | 5. Remove the respective entry from the `src/ontology/catalog-v001.xml` file. 93 | 94 | ### Customise an import 95 | 96 | By default, an import module extracted from a source ontology will be a SLME module, see [here](http://robot.obolibrary.org/extract). There are various options to change the default. 97 | 98 | The following change to your repo config (`src/ontology/apollo_sv-odk.yaml`) will switch the go import from an SLME module to a simple ROBOT filter module: 99 | 100 | ``` 101 | import_group: 102 | products: 103 | - id: ro 104 | - id: go 105 | module_type: filter 106 | ``` 107 | 108 | A ROBOT filter module is, essentially, importing all external terms declared by your ontology (see [here](UpdateImports.md) on how to declare external terms to be imported). Note that the `filter` module does 109 | not consider terms/annotations from namespaces other than the base-namespace of the ontology itself. For example, in the 110 | example of GO above, only annotations / axioms related to the GO base IRI (http://purl.obolibrary.org/obo/GO_) would be considered. This 111 | behaviour can be changed by adding additional base IRIs as follows: 112 | 113 | 114 | ``` 115 | import_group: 116 | products: 117 | - id: go 118 | module_type: filter 119 | base_iris: 120 | - http://purl.obolibrary.org/obo/GO_ 121 | - http://purl.obolibrary.org/obo/CL_ 122 | - http://purl.obolibrary.org/obo/BFO 123 | ``` 124 | 125 | If you wish to customise your import entirely, you can specify your own ROBOT command to do so. To do that, add the following to your repo config (`src/ontology/apollo_sv-odk.yaml`): 126 | 127 | ``` 128 | import_group: 129 | products: 130 | - id: ro 131 | - id: go 132 | module_type: custom 133 | ``` 134 | 135 | Now add a new goal in your custom Makefile (`src/ontology/apollo_sv.Makefile`, _not_ `src/ontology/Makefile`). 136 | 137 | ``` 138 | imports/go_import.owl: mirror/ro.owl imports/ro_terms_combined.txt 139 | if [ $(IMP) = true ]; then $(ROBOT) query -i $< --update ../sparql/preprocess-module.ru \ 140 | extract -T imports/ro_terms_combined.txt --force true --individuals exclude --method BOT \ 141 | query --update ../sparql/inject-subset-declaration.ru --update ../sparql/postprocess-module.ru \ 142 | annotate --ontology-iri $(ONTBASE)/$@ $(ANNOTATE_ONTOLOGY_VERSION) --output $@.tmp.owl && mv $@.tmp.owl $@; fi 143 | ``` 144 | 145 | Now feel free to change this goal to do whatever you wish it to do! It probably makes some sense (albeit not being a strict necessity), to leave most of the goal instead and replace only: 146 | 147 | ``` 148 | extract -T imports/ro_terms_combined.txt --force true --individuals exclude --method BOT \ 149 | ``` 150 | 151 | to another ROBOT pipeline. 152 | 153 | ## Add a component 154 | 155 | A component is an import which _belongs_ to your ontology, e.g. is managed by 156 | you and your team. 157 | 158 | 1. Open `src/ontology/apollo_sv-odk.yaml` 159 | 1. If you dont have it yet, add a new top level section `components` 160 | 1. Under the `components` section, add a new section called `products`. 161 | This is where all your components are specified 162 | 1. Under the `products` section, add a new component, e.g. `- filename: mycomp.owl` 163 | 164 | _Example_ 165 | 166 | ``` 167 | components: 168 | products: 169 | - filename: mycomp.owl 170 | ``` 171 | 172 | When running `sh run.sh make update_repo`, a new file `src/ontology/components/mycomp.owl` will 173 | be created which you can edit as you see fit. Typical ways to edit: 174 | 175 | 1. Using a ROBOT template to generate the component (see below) 176 | 1. Manually curating the component separately with Protégé or any other editor 177 | 1. Providing a `components/mycomp.owl:` make target in `src/ontology/apollo_sv.Makefile` 178 | and provide a custom command to generate the component 179 | - `WARNING`: Note that the custom rule to generate the component _MUST NOT_ depend on any other ODK-generated file such as seed files and the like (see [issue](https://github.com/INCATools/ontology-development-kit/issues/637)). 180 | 1. Providing an additional attribute for the component in `src/ontology/apollo_sv-odk.yaml`, `source`, 181 | to specify that this component should simply be downloaded from somewhere on the web. 182 | 183 | ### Adding a new component based on a ROBOT template 184 | 185 | Since ODK 1.3.2, it is possible to simply link a ROBOT template to a component without having to specify any of the import logic. In order to add a new component that is connected to one or more template files, follow these steps: 186 | 187 | 1. Open `src/ontology/apollo_sv-odk.yaml`. 188 | 1. Make sure that `use_templates: TRUE` is set in the global project options. You should also make sure that `use_context: TRUE` is set in case you are using prefixes in your templates that are not known to `robot`, such as `OMOP:`, `CPONT:` and more. All non-standard prefixes you are using should be added to `config/context.json`. 189 | 1. Add another component to the `products` section. 190 | 1. To activate this component to be template-driven, simply say: `use_template: TRUE`. This will create an empty template for you in the templates directory, which will automatically be processed when recreating the component (e.g. `run.bat make recreate-mycomp`). 191 | 1. If you want to use more than one component, use the `templates` field to add as many template names as you wish. ODK will look for them in the `src/templates` directory. 192 | 1. Advanced: If you want to provide additional processing options, you can use the `template_options` field. This should be a string with option from [robot template](http://robot.obolibrary.org/template). One typical example for additional options you may want to provide is `--add-prefixes config/context.json` to ensure the prefix map of your context is provided to `robot`, see above. 193 | 194 | _Example_: 195 | 196 | ``` 197 | components: 198 | products: 199 | - filename: mycomp.owl 200 | use_template: TRUE 201 | template_options: --add-prefixes config/context.json 202 | templates: 203 | - template1.tsv 204 | - template2.tsv 205 | ``` 206 | 207 | _Note_: if your mirror is particularly large and complex, read [this ODK recommendation](https://github.com/INCATools/ontology-development-kit/blob/master/docs/DealWithLargeOntologies.md). 208 | -------------------------------------------------------------------------------- /docs/odk-workflows/RepositoryFileStructure.md: -------------------------------------------------------------------------------- 1 | # Repository structure 2 | 3 | The main kinds of files in the repository: 4 | 5 | 1. Release files 6 | 2. Imports 7 | 3. [Components](#components) 8 | 9 | ## Release files 10 | Release file are the file that are considered part of the official ontology release and to be used by the community. A detailed description of the release artefacts can be found [here](https://github.com/INCATools/ontology-development-kit/blob/master/docs/ReleaseArtefacts.md). 11 | 12 | ## Imports 13 | Imports are subsets of external ontologies that contain terms and axioms you would like to re-use in your ontology. These are considered "external", like dependencies in software development, and are not included in your "base" product, which is the [release artefact](https://github.com/INCATools/ontology-development-kit/blob/master/docs/ReleaseArtefacts.md) which contains only those axioms that you personally maintain. 14 | 15 | These are the current imports in APOLLO_SV 16 | 17 | | Import | URL | Type | 18 | | ------ | --- | ---- | 19 | | ro | http://purl.obolibrary.org/obo/ro.owl | slme | 20 | | geo | http://purl.obolibrary.org/obo/geo/dev/geo.owl | mirror | 21 | | ido | http://purl.obolibrary.org/obo/ido.owl | slme | 22 | | mf | http://purl.obolibrary.org/obo/mf.owl | slme | 23 | | go | http://purl.obolibrary.org/obo/go.owl | slme | 24 | | iao | http://purl.obolibrary.org/obo/iao.owl | mirror | 25 | | omrse | http://purl.obolibrary.org/obo/omrse.owl | slme | 26 | 27 | ## Components 28 | Components, in contrast to imports, are considered full members of the ontology. This means that any axiom in a component is also included in the ontology base - which means it is considered _native_ to the ontology. While this sounds complicated, consider this: conceptually, no component should be part of more than one ontology. If that seems to be the case, we are most likely talking about an import. Components are often not needed for ontologies, but there are some use cases: 29 | 30 | 1. There is an automated process that generates and re-generates a part of the ontology 31 | 2. A part of the ontology is managed in ROBOT templates 32 | 3. The expressivity of the component is higher than the format of the edit file. For example, people still choose to manage their ontology in OBO format (they should not) missing out on a lot of owl features. They may choose to manage logic that is beyond OBO in a specific OWL component. 33 | 34 | 35 | -------------------------------------------------------------------------------- /docs/odk-workflows/SettingUpDockerForODK.md: -------------------------------------------------------------------------------- 1 | # Setting up your Docker environment for ODK use 2 | 3 | One of the most frequent problems with running the ODK for the first time is failure because of lack of memory. This can look like a Java OutOfMemory exception, 4 | but more often than not it will appear as something like an `Error 137`. There are two places you need to consider to set your memory: 5 | 6 | 1. Your src/ontology/run.sh (or run.bat) file. You can set the memory in there by adding 7 | `robot_java_args: '-Xmx8G'` to your src/ontology/apollo_sv-odk.yaml file, see for example [here](https://github.com/INCATools/ontology-development-kit/blob/0e0aef2b26b8db05f5e78b7c38f807d04312d06a/configs/uberon-odk.yaml#L36). 8 | 2. Set your docker memory. By default, it should be about 10-20% more than your `robot_java_args` variable. You can manage your memory settings 9 | by right-clicking on the docker whale in your system bar-->Preferences-->Resources-->Advanced, see picture below. 10 | 11 | ![dockermemory](https://github.com/INCATools/ontology-development-kit/raw/master/docs/img/docker_memory.png) 12 | 13 | 14 | -------------------------------------------------------------------------------- /docs/odk-workflows/UpdateImports.md: -------------------------------------------------------------------------------- 1 | # Update Imports Workflow 2 | 3 | This page discusses how to update the contents of your imports, like adding or removing terms. If you are looking to customise imports, like changing the module type, see [here](RepoManagement.md). 4 | 5 | ## Importing a new term 6 | 7 | Note: some ontologies now use a merged-import system to manage dynamic imports, for these please follow instructions in the section title "Using the Base Module approach". 8 | 9 | Importing a new term is split into two sub-phases: 10 | 11 | 1. Declaring the terms to be imported 12 | 2. Refreshing imports dynamically 13 | 14 | ### Declaring terms to be imported 15 | There are three ways to declare terms that are to be imported from an external ontology. Choose the appropriate one for your particular scenario (all three can be used in parallel if need be): 16 | 17 | 1. Protégé-based declaration 18 | 2. Using term files 19 | 3. Using the custom import template 20 | 21 | #### Protégé-based declaration 22 | 23 | This workflow is to be avoided, but may be appropriate if the editor _does not have access to the ODK docker container_. 24 | This approach also applies to ontologies that use base module import approach. 25 | 26 | 1. Open your ontology (edit file) in Protégé (5.5+). 27 | 1. Select 'owl:Thing' 28 | 1. Add a new class as usual. 29 | 1. Paste the _full iri_ in the 'Name:' field, for example, http://purl.obolibrary.org/obo/CHEBI_50906. 30 | 1. Click 'OK' 31 | 32 | Adding Classes 33 | 34 | Now you can use this term for example to construct logical definitions. The next time the imports are refreshed (see how to refresh [here](#refresh-imports)), the metadata (labels, definitions, etc.) for this term are imported from the respective external source ontology and becomes visible in your ontology. 35 | 36 | 37 | #### Using term files 38 | 39 | Every import has, by default a term file associated with it, which can be found in the imports directory. For example, if you have a GO import in `src/ontology/go_import.owl`, you will also have an associated term file `src/ontology/go_terms.txt`. You can add terms in there simply as a list: 40 | 41 | ``` 42 | GO:0008150 43 | GO:0008151 44 | ``` 45 | 46 | Now you can run the [refresh imports workflow](#refresh-imports)) and the two terms will be imported. 47 | 48 | #### Using the custom import template 49 | 50 | This workflow is appropriate if: 51 | 52 | 1. You prefer to manage all your imported terms in a single file (rather than multiple files like in the "Using term files" workflow above). 53 | 2. You wish to augment your imported ontologies with additional information. This requires a cautionary discussion. 54 | 55 | To enable this workflow, you add the following to your ODK config file (`src/ontology/apollo_sv-odk.yaml`), and [update the repository](RepoManagement.md): 56 | 57 | ``` 58 | use_custom_import_module: TRUE 59 | ``` 60 | 61 | Now you can manage your imported terms directly in the custom external terms template, which is located at `src/templates/external_import.owl`. Note that this file is a [ROBOT template](http://robot.obolibrary.org/template), and can, in principle, be extended to include any axioms you like. Before extending the template, however, read the following carefully. 62 | 63 | The main purpose of the custom import template is to enable the management off all terms to be imported in a centralised place. To enable that, you do not have to do anything other than maintaining the template. So if you, say currently import `APOLLO_SV:00000480`, and you wish to import `APOLLO_SV:00000532`, you simply add a row like this: 64 | 65 | ``` 66 | ID Entity Type 67 | ID TYPE 68 | APOLLO_SV:00000480 owl:Class 69 | APOLLO_SV:00000532 owl:Class 70 | ``` 71 | 72 | When the imports are refreshed [see imports refresh workflow](#refresh-imports), the term(s) will simply be imported from the configured ontologies. 73 | 74 | Now, if you wish to extend the Makefile (which is beyond these instructions) and add, say, synonyms to the imported terms, you can do that, but you need to (a) preserve the `ID` and `ENTITY` columns and (b) ensure that the ROBOT template is valid otherwise, [see here](http://robot.obolibrary.org/template). 75 | 76 | _WARNING_. Note that doing this is a _widespread antipattern_ (see related [issue](https://github.com/OBOFoundry/OBOFoundry.github.io/issues/1443)). You should not change the axioms of terms that do not belong into your ontology unless necessary - such changes should always be pushed into the ontology where they belong. However, since people are doing it, whether the OBO Foundry likes it or not, at least using the _custom imports module_ as described here localises the changes to a single simple template and ensures that none of the annotations added this way are merged into the [base file](https://github.com/INCATools/ontology-development-kit/blob/master/docs/ReleaseArtefacts.md#release-artefact-1-base-required). 77 | 78 | ### Refresh imports 79 | 80 | If you want to refresh the import yourself (this may be necessary to pass the travis tests), and you have the ODK installed, you can do the following (using go as an example): 81 | 82 | First, you navigate in your terminal to the ontology directory (underneath src in your hpo root directory). 83 | ``` 84 | cd src/ontology 85 | ``` 86 | 87 | Then, you regenerate the import that will now include any new terms you have added. Note: You must have [docker installed](SettingUpDockerForODK.md). 88 | 89 | ``` 90 | sh run.sh make PAT=false imports/go_import.owl -B 91 | ``` 92 | 93 | Since ODK 1.2.27, it is also possible to simply run the following, which is the same as the above: 94 | 95 | ``` 96 | sh run.sh make refresh-go 97 | ``` 98 | 99 | Note that in case you changed the defaults, you need to add `IMP=true` and/or `MIR=true` to the command below: 100 | 101 | ``` 102 | sh run.sh make IMP=true MIR=true PAT=false imports/go_import.owl -B 103 | ``` 104 | 105 | If you wish to skip refreshing the mirror, i.e. skip downloading the latest version of the source ontology for your import (e.g. `go.owl` for your go import) you can set `MIR=false` instead, which will do the exact same thing as the above, but is easier to remember: 106 | 107 | ``` 108 | sh run.sh make IMP=true MIR=false PAT=false imports/go_import.owl -B 109 | ``` 110 | 111 | ## Using the Base Module approach 112 | 113 | Since ODK 1.2.31, we support an entirely new approach to generate modules: Using base files. 114 | The idea is to only import axioms from ontologies that _actually belong to it_. 115 | A base file is a subset of the ontology that only contains those axioms that nominally 116 | belong there. In other words, the base file does not contain any axioms that belong 117 | to another ontology. An example would be this: 118 | 119 | Imagine this being the full Uberon ontology: 120 | 121 | ``` 122 | Axiom 1: BFO:123 SubClassOf BFO:124 123 | Axiom 1: UBERON:123 SubClassOf BFO:123 124 | Axiom 1: UBERON:124 SubClassOf UBERON 123 125 | ``` 126 | 127 | The base file is the set of all axioms that are about UBERON terms: 128 | 129 | ``` 130 | Axiom 1: UBERON:123 SubClassOf BFO:123 131 | Axiom 1: UBERON:124 SubClassOf UBERON 123 132 | ``` 133 | 134 | I.e. 135 | 136 | ``` 137 | Axiom 1: BFO:123 SubClassOf BFO:124 138 | ``` 139 | 140 | Gets removed. 141 | 142 | The base file pipeline is a bit more complex than the normal pipelines, because 143 | of the logical interactions between the imported ontologies. This is solved by _first 144 | merging all mirrors into one huge file and then extracting one mega module from it. 145 | 146 | Example: Let's say we are importing terms from Uberon, GO and RO in our ontologies. 147 | When we use the base pipelines, we 148 | 149 | 1) First obtain the base (usually by simply downloading it, but there is also an option now to create it with ROBOT) 150 | 2) We merge all base files into one big pile 151 | 3) Then we extract a single module `imports/merged_import.owl` 152 | 153 | The first implementation of this pipeline is PATO, see https://github.com/pato-ontology/pato/blob/master/src/ontology/pato-odk.yaml. 154 | 155 | To check if your ontology uses this method, check src/ontology/apollo_sv-odk.yaml to see if `use_base_merging: TRUE` is declared under `import_group` 156 | 157 | If your ontology uses Base Module approach, please use the following steps: 158 | 159 | First, add the term to be imported to the term file associated with it (see above "Using term files" section if this is not clear to you) 160 | 161 | Next, you navigate in your terminal to the ontology directory (underneath src in your hpo root directory). 162 | ``` 163 | cd src/ontology 164 | ``` 165 | 166 | Then refresh imports by running 167 | 168 | ``` 169 | sh run.sh make imports/merged_import.owl 170 | ``` 171 | Note: if your mirrors are updated, you can run `sh run.sh make no-mirror-refresh-merged` 172 | 173 | This requires quite a bit of memory on your local machine, so if you encounter an error, it might be a lack of memory on your computer. A solution would be to create a ticket in an issue tracker requesting for the term to be imported, and one of the local devs should pick this up and run the import for you. 174 | 175 | Lastly, restart Protégé, and the term should be imported in ready to be used. 176 | 177 | -------------------------------------------------------------------------------- /docs/odk-workflows/components.md: -------------------------------------------------------------------------------- 1 | 2 | # Adding components to an ODK repo 3 | 4 | For details on what components are, please see component section of [repository file structure document](../odk-workflows/RepositoryFileStructure.md). 5 | 6 | To add custom components to an ODK repo, please follow the following steps: 7 | 8 | 1) Locate your odk yaml file and open it with your favourite text editor (src/ontology/apollo_sv-odk.yaml) 9 | 2) Search if there is already a component section to the yaml file, if not add it accordingly, adding the name of your component: 10 | 11 | ``` 12 | components: 13 | products: 14 | - filename: your-component-name.owl 15 | ``` 16 | 17 | 3) Add the component to your catalog file (src/ontology/catalog-v001.xml) 18 | 19 | ``` 20 | 21 | ``` 22 | 23 | 4) Add the component to the edit file (src/ontology/apollo_sv-edit.obo) 24 | for .obo formats: 25 | 26 | ``` 27 | import: http://purl.obolibrary.org/obo/apollo_sv/components/your-component-name.owl 28 | ``` 29 | 30 | for .owl formats: 31 | 32 | ``` 33 | Import() 34 | ``` 35 | 36 | 5) Refresh your repo by running `sh run.sh make update_repo` - this should create a new file in src/ontology/components. 37 | 6) In your custom makefile (src/ontology/apollo_sv.Makefile) add a goal for your custom make file. In this example, the goal is a ROBOT template. 38 | 39 | ``` 40 | $(COMPONENTSDIR)/your-component-name.owl: $(SRC) ../templates/your-component-template.tsv 41 | $(ROBOT) template --template ../templates/your-component-template.tsv \ 42 | annotate --ontology-iri $(ONTBASE)/$@ --output $(COMPONENTSDIR)/your-component-name.owl 43 | ``` 44 | 45 | (If using a ROBOT template, do not forget to add your template tsv in src/templates/) 46 | 47 | 7) Make the file by running `sh run.sh make components/your-component-name.owl` 48 | 49 | -------------------------------------------------------------------------------- /docs/odk-workflows/index.md: -------------------------------------------------------------------------------- 1 | # Default ODK Workflows 2 | 3 | - [Daily Editors Workflow](EditorsWorkflow.md) 4 | - [Release Workflow](ReleaseWorkflow.md) 5 | - [Manage your ODK Repository](RepoManagement.md) 6 | - [Setting up Docker for ODK](SettingUpDockerForODK.md) 7 | - [Imports management](UpdateImports.md) 8 | - [Managing the documentation](ManageDocumentation.md) 9 | - [Managing your Automated Testing](ManageAutomatedTest.md) 10 | 11 | -------------------------------------------------------------------------------- /find-highest-obo-id.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | grep -o -r --include="*.owl" "APOLLO_SV_[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]" ./ | cut -d":" -f2 | sort -u | tail -10 -------------------------------------------------------------------------------- /mkdocs.yaml: -------------------------------------------------------------------------------- 1 | site_name: Apollo Structured Vocabulary 2 | theme: 3 | name: material 4 | features: 5 | - content.tabs.link 6 | plugins: 7 | - search 8 | markdown_extensions: 9 | - pymdownx.highlight: 10 | - pymdownx.inlinehilite 11 | - pymdownx.snippets 12 | - pymdownx.superfences 13 | - pymdownx.tabbed: 14 | - pymdownx.critic 15 | - pymdownx.caret 16 | - pymdownx.keys 17 | - pymdownx.mark 18 | - pymdownx.tilde 19 | 20 | site_url: https://ApolloDev.github.io/apollo-sv/ 21 | repo_url: https://github.com/ApolloDev/apollo-sv/ 22 | 23 | nav: 24 | - Getting started: index.md 25 | - Cite: cite.md 26 | - How-to guides: 27 | - Standard ODK workflows: 28 | - Overview: odk-workflows/index.md 29 | - Editors Workflow: odk-workflows/EditorsWorkflow.md 30 | - Release Workflow: odk-workflows/ReleaseWorkflow.md 31 | - Manage your ODK Repository: odk-workflows/RepoManagement.md 32 | - Setting up Docker for ODK: odk-workflows/SettingUpDockerForODK.md 33 | - Imports management: odk-workflows/UpdateImports.md 34 | - Components management: odk-workflows/components.md 35 | - Managing the documentation: odk-workflows/ManageDocumentation.md 36 | - Managing your automated testing: odk-workflows/ManageAutomatedTest.md 37 | - Continuous Integration: odk-workflows/ContinuousIntegration.md 38 | - Your ODK Repository Overview: odk-workflows/RepositoryFileStructure.md 39 | - Contributing: contributing.md 40 | 41 | -------------------------------------------------------------------------------- /src/ontology/Makefile: -------------------------------------------------------------------------------- 1 | # ---------------------------------------- 2 | # Makefile for apollo_sv 3 | # Generated using ontology-development-kit 4 | # ODK Version: v1.5.2 5 | # ---------------------------------------- 6 | # IMPORTANT: DO NOT EDIT THIS FILE. To override default make goals, use apollo_sv.Makefile instead 7 | 8 | ### Workflow 9 | # 10 | # Tasks to edit and release OMRSE. 11 | # 12 | # #### Edit 13 | # 14 | # 1. [Prepare release](prepare_release) 15 | # 2. [Refresh imports](all_imports) 16 | # 3. [Update repo to latest ODK](update_repo) 17 | 18 | # Fingerprint of the configuration file when this Makefile was last generated 19 | CONFIG_HASH= 4c4d6cc789d818fbe915ac259c1dd0e97c415ffd56c74ba1d7866e6691c26c0b 20 | 21 | 22 | # ---------------------------------------- 23 | # Standard Constants 24 | # ---------------------------------------- 25 | # these can be overwritten on the command line 26 | 27 | OBOBASE= http://purl.obolibrary.org/obo 28 | URIBASE= http://purl.obolibrary.org/obo 29 | ONT= apollo_sv 30 | ONTBASE= http://purl.obolibrary.org/obo/apollo_sv 31 | EDIT_FORMAT= owl 32 | SRC = $(ONT)-edit.$(EDIT_FORMAT) 33 | MAKE_FAST= $(MAKE) IMP=false PAT=false COMP=false MIR=false 34 | CATALOG= catalog-v001.xml 35 | ROBOT= robot --catalog $(CATALOG) 36 | 37 | OWLTOOLS= owltools --use-catalog 38 | RELEASEDIR= ../.. 39 | REPORTDIR= reports 40 | TEMPLATEDIR= ../templates 41 | TMPDIR= tmp 42 | MIRRORDIR= mirror 43 | IMPORTDIR= imports 44 | SUBSETDIR= subsets 45 | SCRIPTSDIR= ../scripts 46 | UPDATEREPODIR= target 47 | SPARQLDIR = ../sparql 48 | COMPONENTSDIR = components 49 | REPORT_FAIL_ON = ERROR 50 | REPORT_LABEL = 51 | REPORT_PROFILE_OPTS = 52 | OBO_FORMAT_OPTIONS = 53 | SPARQL_VALIDATION_CHECKS = owldef-self-reference iri-range 54 | SPARQL_EXPORTS = basic-report 55 | ODK_VERSION_MAKEFILE = v1.5.2 56 | 57 | TODAY ?= $(shell date +%Y-%m-%d) 58 | OBODATE ?= $(shell date +'%d:%m:%Y %H:%M') 59 | VERSION= $(TODAY) 60 | ANNOTATE_ONTOLOGY_VERSION = annotate -V $(ONTBASE)/releases/$(VERSION)/$@ --annotation owl:versionInfo $(VERSION) 61 | ANNOTATE_CONVERT_FILE = annotate --ontology-iri $(ONTBASE)/$@ $(ANNOTATE_ONTOLOGY_VERSION) convert -f ofn --output $@.tmp.owl && mv $@.tmp.owl $@ 62 | OTHER_SRC = 63 | ONTOLOGYTERMS = $(TMPDIR)/ontologyterms.txt 64 | EDIT_PREPROCESSED = $(TMPDIR)/$(ONT)-preprocess.owl 65 | 66 | FORMATS = $(sort owl obo json owl) 67 | FORMATS_INCL_TSV = $(sort $(FORMATS) tsv) 68 | RELEASE_ARTEFACTS = $(sort $(ONT)-base $(ONT)-full ) 69 | 70 | ifeq ($(ODK_DEBUG),yes) 71 | ODK_DEBUG_FILE = debug.log 72 | SHELL = $(SCRIPTSDIR)/run-command.sh 73 | endif 74 | 75 | # ---------------------------------------- 76 | # Top-level targets 77 | # ---------------------------------------- 78 | 79 | .PHONY: .FORCE 80 | 81 | .PHONY: all 82 | all: all_odk 83 | 84 | .PHONY: all_odk 85 | all_odk: odkversion config_check test custom_reports all_assets 86 | 87 | .PHONY: test 88 | test: odkversion reason_test sparql_test robot_reports $(REPORTDIR)/validate_profile_owl2dl_$(ONT).owl.txt 89 | echo "Finished running all tests successfully." 90 | 91 | .PHONY: test 92 | test_fast: 93 | $(MAKE_FAST) test 94 | 95 | .PHONY: release_diff 96 | release_diff: $(REPORTDIR)/release-diff.md 97 | 98 | .PHONY: reason_test 99 | reason_test: $(EDIT_PREPROCESSED) 100 | $(ROBOT) reason --input $< --reasoner ELK --equivalent-classes-allowed asserted-only \ 101 | --exclude-tautologies structural --output test.owl && rm test.owl 102 | 103 | .PHONY: odkversion 104 | odkversion: 105 | @echo "ODK Makefile $(ODK_VERSION_MAKEFILE)" 106 | @odk-info --tools 107 | .PHONY: config_check 108 | config_check: 109 | @if [ "$$(sha256sum $(ONT)-odk.yaml | cut -c1-64)" = "$(CONFIG_HASH)" ]; then \ 110 | echo "Repository is up-to-date." ; else \ 111 | echo "Your ODK configuration has changed since this Makefile was generated. You may need to run 'make update_repo'." ; fi 112 | 113 | 114 | $(TMPDIR) $(REPORTDIR) $(MIRRORDIR) $(IMPORTDIR) $(COMPONENTSDIR) $(SUBSETDIR): 115 | mkdir -p $@ 116 | 117 | # ---------------------------------------- 118 | # ODK-managed ROBOT plugins 119 | # ---------------------------------------- 120 | 121 | # Make sure ROBOT knows where to find plugins 122 | export ROBOT_PLUGINS_DIRECTORY=$(TMPDIR)/plugins 123 | 124 | # Override this rule in apollo_sv.Makefile to install custom plugins 125 | .PHONY: custom_robot_plugins 126 | custom_robot_plugins: 127 | 128 | 129 | .PHONY: extra_robot_plugins 130 | extra_robot_plugins: 131 | 132 | 133 | # Install all ROBOT plugins to the runtime plugins directory 134 | .PHONY: all_robot_plugins 135 | all_robot_plugins: $(foreach plugin,$(notdir $(wildcard /tools/robot-plugins/*.jar)),$(ROBOT_PLUGINS_DIRECTORY)/$(plugin)) \ 136 | $(foreach plugin,$(notdir $(wildcard ../../plugins/*.jar)),$(ROBOT_PLUGINS_DIRECTORY)/$(plugin)) \ 137 | custom_robot_plugins extra_robot_plugins \ 138 | 139 | # Default rule to install plugins 140 | $(ROBOT_PLUGINS_DIRECTORY)/%.jar: 141 | @mkdir -p $(ROBOT_PLUGINS_DIRECTORY) 142 | @if [ -f ../../plugins/$*.jar ]; then \ 143 | ln ../../plugins/$*.jar $@ ; \ 144 | elif [ -f /tools/robot-plugins/$*.jar ]; then \ 145 | cp /tools/robot-plugins/$*.jar $@ ; \ 146 | fi 147 | 148 | # Specific rules for supplementary plugins defined in configuration 149 | 150 | 151 | # ---------------------------------------- 152 | # Release assets 153 | # ---------------------------------------- 154 | 155 | MAIN_PRODUCTS = $(sort $(foreach r,$(RELEASE_ARTEFACTS), $(r)) $(ONT)) 156 | MAIN_GZIPPED = 157 | MAIN_FILES = $(foreach n,$(MAIN_PRODUCTS), $(foreach f,$(FORMATS), $(n).$(f))) $(MAIN_GZIPPED) 158 | SRCMERGED = $(TMPDIR)/merged-$(SRC) 159 | 160 | .PHONY: all_main 161 | all_main: $(MAIN_FILES) 162 | 163 | # ---------------------------------------- 164 | # Import assets 165 | # ---------------------------------------- 166 | 167 | 168 | IMPORTS = ro geo ido mf go iao omrse 169 | 170 | IMPORT_ROOTS = $(patsubst %, $(IMPORTDIR)/%_import, $(IMPORTS)) 171 | IMPORT_OWL_FILES = $(foreach n,$(IMPORT_ROOTS), $(n).owl) 172 | IMPORT_FILES = $(IMPORT_OWL_FILES) 173 | 174 | 175 | .PHONY: all_imports 176 | all_imports: $(IMPORT_FILES) 177 | 178 | # ---------------------------------------- 179 | # Subset assets 180 | # ---------------------------------------- 181 | 182 | 183 | SUBSETS = 184 | 185 | SUBSET_ROOTS = $(patsubst %, $(SUBSETDIR)/%, $(SUBSETS)) 186 | SUBSET_FILES = $(foreach n,$(SUBSET_ROOTS), $(foreach f,$(FORMATS_INCL_TSV), $(n).$(f))) 187 | 188 | .PHONY: all_subsets 189 | all_subsets: $(SUBSET_FILES) 190 | 191 | # ---------------------------------------- 192 | # Mapping assets 193 | # ---------------------------------------- 194 | 195 | 196 | MAPPINGS = 197 | 198 | MAPPING_FILES = $(patsubst %, $(MAPPINGDIR)/%.sssom.tsv, $(MAPPINGS)) 199 | 200 | .PHONY: all_mappings 201 | all_mappings: $(MAPPING_FILES) 202 | 203 | 204 | # ---------------------------------------- 205 | # QC Reports & Utilities 206 | # ---------------------------------------- 207 | 208 | OBO_REPORT = $(SRC)-obo-report apollo_sv-base.owl-obo-report 209 | REPORTS = $(OBO_REPORT) 210 | REPORT_FILES = $(patsubst %, $(REPORTDIR)/%.tsv, $(REPORTS)) 211 | 212 | .PHONY: robot_reports 213 | robot_reports: $(REPORT_FILES) 214 | 215 | .PHONY: all_reports 216 | all_reports: custom_reports robot_reports 217 | 218 | # ---------------------------------------- 219 | # ROBOT OWL Profile checking 220 | # ---------------------------------------- 221 | 222 | # The merge step is necessary to avoid undeclared entity violations. 223 | $(REPORTDIR)/validate_profile_owl2dl_%.txt: % | $(REPORTDIR) $(TMPDIR) 224 | $(ROBOT) merge -i $< convert -f ofn -o $(TMPDIR)/validate.ofn 225 | $(ROBOT) validate-profile --profile DL -i $(TMPDIR)/validate.ofn -o $@ || { cat $@ && exit 1; } 226 | .PRECIOUS: $(REPORTDIR)/validate_profile_owl2dl_%.txt 227 | 228 | validate_profile_%: $(REPORTDIR)/validate_profile_owl2dl_%.txt 229 | echo "$* profile validation completed." 230 | 231 | # ---------------------------------------- 232 | # Sparql queries: Q/C 233 | # ---------------------------------------- 234 | 235 | # these live in the ../sparql directory, and have suffix -violation.sparql 236 | # adding the name here will make the violation check live. 237 | 238 | SPARQL_VALIDATION_QUERIES = $(foreach V,$(SPARQL_VALIDATION_CHECKS),$(SPARQLDIR)/$(V)-violation.sparql) 239 | 240 | sparql_test: $(EDIT_PREPROCESSED) apollo_sv-base.owl | $(REPORTDIR) 241 | ifneq ($(SPARQL_VALIDATION_QUERIES),) 242 | 243 | $(ROBOT) verify -i $(EDIT_PREPROCESSED) --queries $(SPARQL_VALIDATION_QUERIES) -O $(REPORTDIR) 244 | 245 | $(ROBOT) verify -i apollo_sv-base.owl --queries $(SPARQL_VALIDATION_QUERIES) -O $(REPORTDIR) 246 | endif 247 | 248 | # ---------------------------------------- 249 | # ROBOT report 250 | # ---------------------------------------- 251 | 252 | $(REPORTDIR)/$(SRC)-obo-report.tsv: $(SRCMERGED) | $(REPORTDIR) 253 | $(ROBOT) report -i $< $(REPORT_LABEL) $(REPORT_PROFILE_OPTS) --fail-on $(REPORT_FAIL_ON) --base-iri $(URIBASE)/APOLLO_SV_ --base-iri $(URIBASE)/apollo_sv --print 5 -o $@ 254 | 255 | $(REPORTDIR)/%-obo-report.tsv: % | $(REPORTDIR) 256 | $(ROBOT) report -i $< $(REPORT_LABEL) $(REPORT_PROFILE_OPTS) --fail-on $(REPORT_FAIL_ON) --base-iri $(URIBASE)/APOLLO_SV_ --base-iri $(URIBASE)/apollo_sv --print 5 -o $@ 257 | 258 | check_for_robot_updates: 259 | echo "You are not using a custom profile, so you are getting the joy of the latest ROBOT report!" 260 | 261 | 262 | # ---------------------------------------- 263 | # Release assets 264 | # ---------------------------------------- 265 | 266 | ASSETS = \ 267 | $(IMPORT_FILES) \ 268 | $(MAIN_FILES) \ 269 | $(REPORT_FILES) \ 270 | $(SUBSET_FILES) \ 271 | $(MAPPING_FILES) 272 | 273 | RELEASE_ASSETS = \ 274 | $(MAIN_FILES) \ 275 | $(SUBSET_FILES) 276 | 277 | .PHONY: all_assets 278 | all_assets: $(ASSETS) check_rdfxml_assets 279 | 280 | .PHONY: show_assets 281 | show_assets: 282 | echo $(ASSETS) 283 | du -sh $(ASSETS) 284 | 285 | check_rdfxml_%: % 286 | @check-rdfxml $< 287 | 288 | .PHONY: check_rdfxml_assets 289 | check_rdfxml_assets: $(foreach product,$(MAIN_PRODUCTS),check_rdfxml_$(product).owl) 290 | 291 | # ---------------------------------------- 292 | # Release Management 293 | # ---------------------------------------- 294 | 295 | CLEANFILES=$(MAIN_FILES) $(SRCMERGED) $(EDIT_PREPROCESSED) 296 | # This should be executed by the release manager whenever time comes to make a release. 297 | # It will ensure that all assets/files are fresh, and will copy to release folder 298 | 299 | .PHONY: prepare_release 300 | prepare_release: all_odk 301 | rsync -R $(RELEASE_ASSETS) $(RELEASEDIR) &&\ 302 | rm -f $(CLEANFILES) &&\ 303 | echo "Release files are now in $(RELEASEDIR) - now you should commit, push and make a release \ 304 | on your git hosting site such as GitHub or GitLab" 305 | 306 | .PHONY: prepare_initial_release 307 | prepare_initial_release: all_assets 308 | rsync -R $(RELEASE_ASSETS) $(RELEASEDIR) &&\ 309 | rm -f $(patsubst %, ./%, $(CLEANFILES)) &&\ 310 | cd $(RELEASEDIR) && git add $(RELEASE_ASSETS) 311 | 312 | .PHONY: prepare_release_fast 313 | prepare_release_fast: 314 | $(MAKE) prepare_release IMP=false PAT=false MIR=false COMP=false 315 | 316 | CURRENT_RELEASE=$(ONTBASE).owl 317 | 318 | $(TMPDIR)/current-release.owl: 319 | wget $(CURRENT_RELEASE) -O $@ 320 | 321 | $(REPORTDIR)/release-diff.md: $(ONT).owl $(TMPDIR)/current-release.owl 322 | $(ROBOT) diff --labels true --left $(TMPDIR)/current-release.owl --right $(ONT).owl -f markdown -o $@ 323 | 324 | # ------------------------ 325 | # Imports: Seeding system 326 | # ------------------------ 327 | 328 | # seed.txt contains all referenced entities 329 | IMPORTSEED=$(TMPDIR)/seed.txt 330 | PRESEED=$(TMPDIR)/pre_seed.txt 331 | 332 | $(SRCMERGED): $(EDIT_PREPROCESSED) $(OTHER_SRC) 333 | $(ROBOT) remove --input $< --select imports --trim false \ 334 | merge $(patsubst %, -i %, $(OTHER_SRC)) -o $@ 335 | 336 | $(EDIT_PREPROCESSED): $(SRC) 337 | $(ROBOT) convert --input $< --format ofn --output $@ 338 | 339 | $(PRESEED): $(SRCMERGED) 340 | $(ROBOT) query -f csv -i $< --query ../sparql/terms.sparql $@.tmp &&\ 341 | cat $@.tmp | sort | uniq > $@ 342 | 343 | 344 | IMPORT_MODULE_TEMPLATE=$(TEMPLATEDIR)/external_import.tsv 345 | IMPORT_MODULE_SIGNATURE=$(TMPDIR)/external_import_terms.txt 346 | IMPORT_MODULE=$(IMPORTDIR)/external_import.owl 347 | $(IMPORT_MODULE): $(IMPORT_MODULE_TEMPLATE) | $(TMPDIR) 348 | $(ROBOT) template --template $< \ 349 | --ontology-iri "$(ONTBASE)/external_import.owl" \ 350 | convert -f ofn \ 351 | --output $@ 352 | 353 | $(IMPORT_MODULE_SIGNATURE): $(IMPORT_MODULE) | $(TMPDIR) 354 | $(ROBOT) query -f csv -i $< --query ../sparql/terms.sparql $@.tmp &&\ 355 | cat $@.tmp | sort | uniq > $@ 356 | 357 | 358 | ALLSEED = $(PRESEED) \ 359 | $(IMPORT_MODULE_SIGNATURE) 360 | 361 | $(IMPORTSEED): $(ALLSEED) | $(TMPDIR) 362 | if [ $(IMP) = true ]; then cat $(ALLSEED) | sort | uniq > $@; fi 363 | 364 | ANNOTATION_PROPERTIES=rdfs:label IAO:0000115 IAO:0000116 IAO:0000111 oboInOwl:hasDbXref rdfs:comment 365 | 366 | # ---------------------------------------- 367 | # Import modules 368 | # ---------------------------------------- 369 | # Most ontologies are modularly constructed using portions of other ontologies 370 | # These live in the imports/ folder 371 | # This pattern uses ROBOT to generate an import module 372 | 373 | # Should be able to drop this if robot can just take a big messy list of terms as input. 374 | $(IMPORTDIR)/%_terms_combined.txt: $(IMPORTSEED) $(IMPORTDIR)/%_terms.txt 375 | if [ $(IMP) = true ]; then cat $^ | grep -v ^# | sort | uniq > $@; fi 376 | 377 | 378 | 379 | 380 | $(IMPORTDIR)/%_import.owl: $(MIRRORDIR)/%.owl $(IMPORTDIR)/%_terms_combined.txt 381 | if [ $(IMP) = true ]; then $(ROBOT) merge -i $< \ 382 | query --update ../sparql/preprocess-module.ru \ 383 | remove --base-iri $(OBOBASE)"/$(shell echo $* | tr a-z A-Z)_" --axioms external --preserve-structure false --trim false \ 384 | remove $(patsubst %, --term %, $(ANNOTATION_PROPERTIES)) -T $(IMPORTDIR)/$*_terms_combined.txt --select complement \ 385 | query --update ../sparql/inject-subset-declaration.ru --update ../sparql/inject-synonymtype-declaration.ru --update ../sparql/postprocess-module.ru \ 386 | $(ANNOTATE_CONVERT_FILE); fi 387 | 388 | .PRECIOUS: $(IMPORTDIR)/%_import.owl 389 | 390 | ## Module for ontology: ro 391 | 392 | $(IMPORTDIR)/ro_import.owl: $(MIRRORDIR)/ro.owl $(IMPORTDIR)/ro_terms_combined.txt 393 | if [ $(IMP) = true ]; then $(ROBOT) query -i $< --update ../sparql/preprocess-module.ru \ 394 | extract -T $(IMPORTDIR)/ro_terms_combined.txt --copy-ontology-annotations true --force true --individuals exclude --method BOT \ 395 | query --update ../sparql/inject-subset-declaration.ru --update ../sparql/inject-synonymtype-declaration.ru --update ../sparql/postprocess-module.ru \ 396 | $(ANNOTATE_CONVERT_FILE); fi 397 | 398 | ## Module for ontology: geo 399 | 400 | $(IMPORTDIR)/geo_import.owl: $(MIRRORDIR)/geo.owl $(IMPORTDIR)/geo_terms_combined.txt 401 | if [ $(IMP) = true ]; then $(ROBOT) merge -i $< query --update ../sparql/preprocess-module.ru --update ../sparql/inject-subset-declaration.ru --update ../sparql/inject-synonymtype-declaration.ru --update ../sparql/postprocess-module.ru \ 402 | $(ANNOTATE_CONVERT_FILE); fi 403 | 404 | ## Module for ontology: ido 405 | 406 | $(IMPORTDIR)/ido_import.owl: $(MIRRORDIR)/ido.owl $(IMPORTDIR)/ido_terms_combined.txt 407 | if [ $(IMP) = true ]; then $(ROBOT) query -i $< --update ../sparql/preprocess-module.ru \ 408 | extract -T $(IMPORTDIR)/ido_terms_combined.txt --copy-ontology-annotations true --force true --individuals exclude --method BOT \ 409 | query --update ../sparql/inject-subset-declaration.ru --update ../sparql/inject-synonymtype-declaration.ru --update ../sparql/postprocess-module.ru \ 410 | $(ANNOTATE_CONVERT_FILE); fi 411 | 412 | ## Module for ontology: mf 413 | 414 | $(IMPORTDIR)/mf_import.owl: $(MIRRORDIR)/mf.owl $(IMPORTDIR)/mf_terms_combined.txt 415 | if [ $(IMP) = true ]; then $(ROBOT) query -i $< --update ../sparql/preprocess-module.ru \ 416 | extract -T $(IMPORTDIR)/mf_terms_combined.txt --copy-ontology-annotations true --force true --individuals exclude --method BOT \ 417 | query --update ../sparql/inject-subset-declaration.ru --update ../sparql/inject-synonymtype-declaration.ru --update ../sparql/postprocess-module.ru \ 418 | $(ANNOTATE_CONVERT_FILE); fi 419 | 420 | ## Module for ontology: go 421 | 422 | $(IMPORTDIR)/go_import.owl: $(MIRRORDIR)/go.owl $(IMPORTDIR)/go_terms_combined.txt 423 | if [ $(IMP) = true ]; then $(ROBOT) query -i $< --update ../sparql/preprocess-module.ru \ 424 | extract -T $(IMPORTDIR)/go_terms_combined.txt --copy-ontology-annotations true --force true --individuals exclude --method BOT \ 425 | query --update ../sparql/inject-subset-declaration.ru --update ../sparql/inject-synonymtype-declaration.ru --update ../sparql/postprocess-module.ru \ 426 | $(ANNOTATE_CONVERT_FILE); fi 427 | 428 | ## Module for ontology: iao 429 | 430 | $(IMPORTDIR)/iao_import.owl: $(MIRRORDIR)/iao.owl $(IMPORTDIR)/iao_terms_combined.txt 431 | if [ $(IMP) = true ]; then $(ROBOT) merge -i $< query --update ../sparql/preprocess-module.ru --update ../sparql/inject-subset-declaration.ru --update ../sparql/inject-synonymtype-declaration.ru --update ../sparql/postprocess-module.ru \ 432 | $(ANNOTATE_CONVERT_FILE); fi 433 | 434 | ## Module for ontology: omrse 435 | 436 | $(IMPORTDIR)/omrse_import.owl: $(MIRRORDIR)/omrse.owl $(IMPORTDIR)/omrse_terms_combined.txt 437 | if [ $(IMP) = true ]; then $(ROBOT) query -i $< --update ../sparql/preprocess-module.ru \ 438 | extract -T $(IMPORTDIR)/omrse_terms_combined.txt --copy-ontology-annotations true --force true --individuals exclude --method BOT \ 439 | query --update ../sparql/inject-subset-declaration.ru --update ../sparql/inject-synonymtype-declaration.ru --update ../sparql/postprocess-module.ru \ 440 | $(ANNOTATE_CONVERT_FILE); fi 441 | 442 | 443 | .PHONY: refresh-imports 444 | refresh-imports: 445 | $(MAKE) IMP=true MIR=true PAT=false IMP_LARGE=true all_imports -B 446 | 447 | .PHONY: no-mirror-refresh-imports 448 | no-mirror-refresh-imports: 449 | $(MAKE) IMP=true MIR=false PAT=false IMP_LARGE=true all_imports -B 450 | 451 | .PHONY: refresh-imports-excluding-large 452 | refresh-imports-excluding-large: 453 | $(MAKE) IMP=true MIR=true PAT=false IMP_LARGE=false all_imports -B 454 | 455 | .PHONY: refresh-% 456 | refresh-%: 457 | $(MAKE) IMP=true IMP_LARGE=true MIR=true PAT=false $(IMPORTDIR)/$*_import.owl -B 458 | 459 | .PHONY: no-mirror-refresh-% 460 | no-mirror-refresh-%: 461 | $(MAKE) IMP=true IMP_LARGE=true MIR=false PAT=false $(IMPORTDIR)/$*_import.owl -B 462 | 463 | # ---------------------------------------- 464 | # Mirroring upstream ontologies 465 | # ---------------------------------------- 466 | 467 | IMP=true # Global parameter to bypass import generation 468 | MIR=true # Global parameter to bypass mirror generation 469 | IMP_LARGE=true # Global parameter to bypass handling of large imports 470 | 471 | ifeq ($(strip $(MIR)),true) 472 | 473 | 474 | ## ONTOLOGY: ro 475 | .PHONY: mirror-ro 476 | .PRECIOUS: $(MIRRORDIR)/ro.owl 477 | mirror-ro: | $(TMPDIR) 478 | curl -L $(OBOBASE)/ro.owl --create-dirs -o $(TMPDIR)/ro-download.owl --retry 4 --max-time 200 && \ 479 | $(ROBOT) convert -i $(TMPDIR)/ro-download.owl -o $(TMPDIR)/$@.owl 480 | 481 | 482 | ## ONTOLOGY: geo 483 | .PHONY: mirror-geo 484 | .PRECIOUS: $(MIRRORDIR)/geo.owl 485 | mirror-geo: | $(TMPDIR) 486 | $(ROBOT) convert -I http://purl.obolibrary.org/obo/geo/dev/geo.owl -o $(TMPDIR)/$@.owl 487 | 488 | 489 | ## ONTOLOGY: ido 490 | .PHONY: mirror-ido 491 | .PRECIOUS: $(MIRRORDIR)/ido.owl 492 | mirror-ido: | $(TMPDIR) 493 | curl -L $(OBOBASE)/ido.owl --create-dirs -o $(TMPDIR)/ido-download.owl --retry 4 --max-time 200 && \ 494 | $(ROBOT) convert -i $(TMPDIR)/ido-download.owl -o $(TMPDIR)/$@.owl 495 | 496 | 497 | ## ONTOLOGY: mf 498 | .PHONY: mirror-mf 499 | .PRECIOUS: $(MIRRORDIR)/mf.owl 500 | mirror-mf: | $(TMPDIR) 501 | curl -L $(OBOBASE)/mf.owl --create-dirs -o $(TMPDIR)/mf-download.owl --retry 4 --max-time 200 && \ 502 | $(ROBOT) convert -i $(TMPDIR)/mf-download.owl -o $(TMPDIR)/$@.owl 503 | 504 | 505 | ## ONTOLOGY: go 506 | .PHONY: mirror-go 507 | .PRECIOUS: $(MIRRORDIR)/go.owl 508 | mirror-go: | $(TMPDIR) 509 | curl -L $(OBOBASE)/go.owl --create-dirs -o $(TMPDIR)/go-download.owl --retry 4 --max-time 200 && \ 510 | $(ROBOT) convert -i $(TMPDIR)/go-download.owl -o $(TMPDIR)/$@.owl 511 | 512 | 513 | ## ONTOLOGY: iao 514 | .PHONY: mirror-iao 515 | .PRECIOUS: $(MIRRORDIR)/iao.owl 516 | mirror-iao: | $(TMPDIR) 517 | curl -L $(OBOBASE)/iao.owl --create-dirs -o $(TMPDIR)/iao-download.owl --retry 4 --max-time 200 && \ 518 | $(ROBOT) convert -i $(TMPDIR)/iao-download.owl -o $(TMPDIR)/$@.owl 519 | 520 | 521 | ## ONTOLOGY: omrse 522 | .PHONY: mirror-omrse 523 | .PRECIOUS: $(MIRRORDIR)/omrse.owl 524 | mirror-omrse: | $(TMPDIR) 525 | curl -L $(OBOBASE)/omrse.owl --create-dirs -o $(TMPDIR)/omrse-download.owl --retry 4 --max-time 200 && \ 526 | $(ROBOT) convert -i $(TMPDIR)/omrse-download.owl -o $(TMPDIR)/$@.owl 527 | 528 | 529 | $(MIRRORDIR)/%.owl: mirror-% | $(MIRRORDIR) 530 | if [ -f $(TMPDIR)/mirror-$*.owl ]; then if cmp -s $(TMPDIR)/mirror-$*.owl $@ ; then echo "Mirror identical, ignoring."; else echo "Mirrors different, updating." &&\ 531 | cp $(TMPDIR)/mirror-$*.owl $@; fi; fi 532 | 533 | else # MIR=false 534 | $(MIRRORDIR)/%.owl: 535 | @echo "Not refreshing $@ because the mirrorring pipeline is disabled (MIR=$(MIR))." 536 | endif 537 | 538 | 539 | 540 | # ---------------------------------------- 541 | # Subsets 542 | # ---------------------------------------- 543 | $(SUBSETDIR)/%.tsv: $(SUBSETDIR)/%.owl 544 | $(ROBOT) query -f tsv -i $< -s ../sparql/labels.sparql $@ 545 | .PRECIOUS: $(SUBSETDIR)/%.tsv 546 | 547 | $(SUBSETDIR)/%.owl: $(ONT).owl | $(SUBSETDIR) 548 | $(OWLTOOLS) $< --extract-ontology-subset --fill-gaps --subset $* -o $@.tmp.owl && mv $@.tmp.owl $@ &&\ 549 | $(ROBOT) annotate --input $@ --ontology-iri $(ONTBASE)/$@ $(ANNOTATE_ONTOLOGY_VERSION) -o $@.tmp.owl && mv $@.tmp.owl $@ 550 | .PRECIOUS: $(SUBSETDIR)/%.owl 551 | 552 | 553 | $(SUBSETDIR)/%.obo: $(SUBSETDIR)/%.owl 554 | $(ROBOT) convert --input $< --check false -f obo $(OBO_FORMAT_OPTIONS) -o $@.tmp.obo && grep -v ^owl-axioms $@.tmp.obo > $@ && rm $@.tmp.obo 555 | 556 | $(SUBSETDIR)/%.json: $(SUBSETDIR)/%.owl 557 | $(ROBOT) convert --input $< --check false -f json -o $@.tmp.json &&\ 558 | mv $@.tmp.json $@ 559 | 560 | 561 | # --------------------------------------------- 562 | # Sparql queries: Table exports / Query Reports 563 | # --------------------------------------------- 564 | 565 | SPARQL_EXPORTS_ARGS = $(foreach V,$(SPARQL_EXPORTS),-s $(SPARQLDIR)/$(V).sparql $(REPORTDIR)/$(V).tsv) 566 | # This combines all into one single command 567 | 568 | .PHONY: custom_reports 569 | custom_reports: $(EDIT_PREPROCESSED) | $(REPORTDIR) 570 | ifneq ($(SPARQL_EXPORTS_ARGS),) 571 | $(ROBOT) query -f tsv --use-graphs true -i $< $(SPARQL_EXPORTS_ARGS) 572 | endif 573 | 574 | # ---------------------------------------- 575 | # Release artefacts: export formats 576 | # ---------------------------------------- 577 | 578 | 579 | $(ONT)-base.obo: $(ONT)-base.owl 580 | $(ROBOT) convert --input $< --check false -f obo $(OBO_FORMAT_OPTIONS) -o $@.tmp.obo && grep -v ^owl-axioms $@.tmp.obo > $@ && rm $@.tmp.obo 581 | $(ONT)-base.json: $(ONT)-base.owl 582 | $(ROBOT) annotate --input $< --ontology-iri $(ONTBASE)/$@ $(ANNOTATE_ONTOLOGY_VERSION) \ 583 | convert --check false -f json -o $@.tmp.json &&\ 584 | mv $@.tmp.json $@ 585 | $(ONT)-full.obo: $(ONT)-full.owl 586 | $(ROBOT) convert --input $< --check false -f obo $(OBO_FORMAT_OPTIONS) -o $@.tmp.obo && grep -v ^owl-axioms $@.tmp.obo > $@ && rm $@.tmp.obo 587 | $(ONT)-full.json: $(ONT)-full.owl 588 | $(ROBOT) annotate --input $< --ontology-iri $(ONTBASE)/$@ $(ANNOTATE_ONTOLOGY_VERSION) \ 589 | convert --check false -f json -o $@.tmp.json &&\ 590 | mv $@.tmp.json $@ 591 | # ---------------------------------------- 592 | # Release artefacts: main release artefacts 593 | # ---------------------------------------- 594 | 595 | $(ONT).owl: $(ONT)-full.owl 596 | $(ROBOT) annotate --input $< --ontology-iri $(URIBASE)/$@ $(ANNOTATE_ONTOLOGY_VERSION) \ 597 | convert -o $@.tmp.owl && mv $@.tmp.owl $@ 598 | 599 | $(ONT).obo: $(ONT).owl 600 | $(ROBOT) convert --input $< --check false -f obo $(OBO_FORMAT_OPTIONS) -o $@.tmp.obo && grep -v ^owl-axioms $@.tmp.obo > $@ && rm $@.tmp.obo 601 | $(ONT).json: $(ONT).owl 602 | $(ROBOT) annotate --input $< --ontology-iri $(URIBASE)/$@ $(ANNOTATE_ONTOLOGY_VERSION) \ 603 | convert --check false -f json -o $@.tmp.json &&\ 604 | mv $@.tmp.json $@ 605 | # ----------------------------------------------------- 606 | # Release artefacts: variants (base, full, simple, etc) 607 | # ----------------------------------------------------- 608 | SHARED_ROBOT_COMMANDS = 609 | 610 | $(ONTOLOGYTERMS): $(SRCMERGED) 611 | $(ROBOT) query -f csv -i $< --query ../sparql/apollo_sv_terms.sparql $@ 612 | 613 | # ROBOT pipeline that merges imports, including components. 614 | ROBOT_RELEASE_IMPORT_MODE=$(ROBOT) merge --input $< 615 | 616 | # ROBOT pipeline that removes imports, then merges components. This is for release artefacts that start from "base" 617 | ROBOT_RELEASE_IMPORT_MODE_BASE=$(ROBOT) remove --input $< --select imports --trim false merge $(patsubst %, -i %, $(OTHER_SRC)) 618 | 619 | # base: A version of the ontology that does not include any externally imported axioms. 620 | $(ONT)-base.owl: $(EDIT_PREPROCESSED) $(OTHER_SRC) $(IMPORT_FILES) 621 | $(ROBOT_RELEASE_IMPORT_MODE) \ 622 | reason --reasoner ELK --equivalent-classes-allowed asserted-only --exclude-tautologies structural --annotate-inferred-axioms False \ 623 | relax \ 624 | reduce -r ELK \ 625 | remove --base-iri $(URIBASE)/APOLLO_SV --axioms external --preserve-structure false --trim false \ 626 | $(SHARED_ROBOT_COMMANDS) \ 627 | annotate --link-annotation http://purl.org/dc/elements/1.1/type http://purl.obolibrary.org/obo/IAO_8000001 \ 628 | --ontology-iri $(ONTBASE)/$@ $(ANNOTATE_ONTOLOGY_VERSION) \ 629 | --output $@.tmp.owl && mv $@.tmp.owl $@ 630 | # Full: The full artefacts with imports merged, reasoned. 631 | $(ONT)-full.owl: $(EDIT_PREPROCESSED) $(OTHER_SRC) $(IMPORT_FILES) 632 | $(ROBOT_RELEASE_IMPORT_MODE) \ 633 | reason --reasoner ELK --equivalent-classes-allowed asserted-only --exclude-tautologies structural \ 634 | relax \ 635 | reduce -r ELK \ 636 | $(SHARED_ROBOT_COMMANDS) annotate --ontology-iri $(ONTBASE)/$@ $(ANNOTATE_ONTOLOGY_VERSION) --output $@.tmp.owl && mv $@.tmp.owl $@ 637 | # ---------------------------------------- 638 | # Debugging Tools 639 | # ---------------------------------------- 640 | 641 | explain_unsat: $(EDIT_PREPROCESSED) 642 | $(ROBOT) explain -i $< -M unsatisfiability --unsatisfiable random:10 --explanation $(TMPDIR)/$@.md 643 | 644 | 645 | 646 | RELEASE_ASSETS_AFTER_RELEASE=$(foreach n,$(RELEASE_ASSETS), ../../$(n)) 647 | GHVERSION=v$(VERSION) 648 | 649 | .PHONY: public_release 650 | public_release: 651 | @test $(GHVERSION) 652 | ls -alt $(RELEASE_ASSETS_AFTER_RELEASE) 653 | gh release create $(GHVERSION) --title "$(VERSION) Release" --draft $(RELEASE_ASSETS_AFTER_RELEASE) --generate-notes 654 | 655 | # ---------------------------------------- 656 | # General Validation 657 | # ---------------------------------------- 658 | TSV= 659 | ALL_TSV_FILES= 660 | 661 | validate-tsv: $(TSV) | $(TMPDIR) 662 | for FILE in $< ; do \ 663 | tsvalid $$FILE > $(TMPDIR)/validate.txt; \ 664 | if [ -s $(TMPDIR)/validate.txt ]; then cat $(TMPDIR)/validate.txt && exit 1; fi ; \ 665 | done 666 | 667 | validate-all-tsv: $(ALL_TSV_FILES) 668 | $(MAKE) validate-tsv TSV="$^" 669 | 670 | # ---------------------------------------- 671 | # Editors Utilities 672 | # ---------------------------------------- 673 | 674 | 675 | 676 | .PHONY: normalize_src 677 | normalize_src: $(SRC) 678 | $(ROBOT) convert -i $< -f ofn -o $(TMPDIR)/normalise && mv $(TMPDIR)/normalise $< 679 | 680 | .PHONY: validate_idranges 681 | validate_idranges: 682 | amm $(SCRIPTSDIR)/validate_id_ranges.sc apollo_sv-idranges.owl 683 | 684 | .PHONY: update_repo 685 | update_repo: 686 | sh $(SCRIPTSDIR)/update_repo.sh 687 | 688 | 689 | update_docs: 690 | mkdocs gh-deploy --config-file ../../mkdocs.yaml 691 | 692 | # Note to future generations: computing the real path relative to the 693 | # current directory is a way to ensure we only clean up directories that 694 | # are located below the current directory, regardless of the contents of 695 | # the *DIR variables. 696 | .PHONY: clean 697 | clean: 698 | for dir in $(MIRRORDIR) $(TMPDIR) $(UPDATEREPODIR) ; do \ 699 | reldir=$$(realpath --relative-to=$$(pwd) $$dir) ; \ 700 | case $$reldir in .*|"") ;; *) rm -rf $$reldir/* ;; esac \ 701 | done 702 | rm -f $(CLEANFILES) 703 | 704 | .PHONY: help 705 | help: 706 | @echo "$$data" 707 | 708 | define data 709 | Usage: [IMAGE=(odklite|odkfull)] [ODK_DEBUG=yes] sh run.sh make [(IMP|MIR|IMP_LARGE|PAT)=(false|true)] command 710 | 711 | ---------------------------------------- 712 | Command reference 713 | ---------------------------------------- 714 | 715 | Core commands: 716 | * prepare_release: Run the entire release pipeline. Use make IMP=false prepare_release to avoid rerunning the imports 717 | * prepare_release_fast: Run the entire release pipeline without refreshing imports, recreating components or recompiling patterns. 718 | * update_repo: Update the ODK repository setup using the config file apollo_sv-odk.yaml 719 | * test: Running all validation tests 720 | * test_fast: Runs the test suite, but without updating imports or components 721 | * odkversion: Show the current version of the ODK Makefile and ROBOT. 722 | * clean: Delete all temporary files 723 | * help: Print ODK Usage information 724 | * public_release: Uploads the release file to a release management system, such as GitHub releases. Must be configured. 725 | 726 | 727 | Imports management: 728 | * refresh-imports: Refresh all imports and mirrors. 729 | * recreate-components: Recreate all components. 730 | * no-mirror-refresh-imports: Refresh all imports without downloading mirrors. 731 | * refresh-imports-excluding-large: Refresh all imports and mirrors, but skipping the ones labelled as 'is_large'. 732 | * refresh-%: Refresh a single import, i.e. refresh-go will refresh 'imports/go_import.owl'. 733 | * no-mirror-refresh-%: Refresh a single import without updating the mirror, i.e. refresh-go will refresh 'imports/go_import.owl'. 734 | * mirror-%: Refresh a single mirror. 735 | 736 | Editor utilities: 737 | * validate_idranges: Make sure your ID ranges file is formatted correctly 738 | * normalize_src: Load and save your apollo_sv-edit file after you to make sure its serialised correctly 739 | * explain_unsat: If you have unsatisfiable classes, this command will create a markdown file (tmp/explain_unsat.md) which will explain all your unsatisfiable classes 740 | * validate-all-tsv: Check all your tsv files for possible problems in syntax. Use ALL_TSV_FILES variable to list files 741 | * validate-tsv: Check a tsv file for syntactic problems with tsvalid. Use TSV variable to pass filepath, e.g. make TSV=../my.tsv validate-tsv. 742 | * release_diff: Create a diff between the current release and the new release 743 | 744 | Additional build commands (advanced users) 745 | * all: Run the entire pipeline (like prepare_release), but without copying the release files to the release directory. 746 | * all_subsets: Build all subsets 747 | * custom_reports: Generate all custom sparql reports you have configured in your apollo_sv-odk.yaml file. 748 | * all_assets: Build all assets 749 | * show_assets: Print a list of all assets that would be build by the release pipeline 750 | * all_mappings: Update all SSSOM mapping sets 751 | 752 | Additional QC commands (advanced users) 753 | * robot_reports: Run all configured ROBOT reports 754 | * validate_profile_%: Run an OWL2 DL profile validation check, for example validate_profile_apollo_sv-edit.owl. 755 | * reason_test: Run a basic reasoning test 756 | 757 | Examples: 758 | * sh run.sh make IMP=false prepare_release 759 | * sh run.sh make update_repo 760 | * sh run.sh make test 761 | 762 | Tricks: 763 | * Add -B to the end of your command to force re-running it even if nothing has changed 764 | * Use the IMAGE parameter to the run.sh script to use a different image like odklite 765 | * Use ODK_DEBUG=yes sh run.sh make ... to print information about timing and debugging 766 | 767 | endef 768 | export data 769 | 770 | include apollo_sv.Makefile -------------------------------------------------------------------------------- /src/ontology/README-editors.md: -------------------------------------------------------------------------------- 1 | These notes are for the EDITORS of apollo_sv 2 | 3 | This project was created using the [ontology development kit](https://github.com/INCATools/ontology-development-kit). See the site for details. 4 | 5 | For more details on ontology management, please see the 6 | [OBO Academy Tutorials](https://oboacademy.github.io/obook/), the 7 | [OBO tutorial](https://github.com/jamesaoverton/obo-tutorial) or the [Gene Ontology Editors Tutorial](https://go-protege-tutorial.readthedocs.io/en/latest/) 8 | 9 | This documentation has been superceded by the ODK automatic documentation, which you can 10 | activate by adding: 11 | 12 | ``` 13 | documentation: 14 | documentation_system: mkdocs 15 | ``` 16 | 17 | to your Makefile and running: 18 | 19 | ``` 20 | sh run.sh make update_repo 21 | ``` 22 | (Unix) 23 | 24 | ``` 25 | run.bat make update_repo 26 | ``` 27 | (Windows) -------------------------------------------------------------------------------- /src/ontology/apollo_sv-idranges.owl: -------------------------------------------------------------------------------- 1 | ## ID Ranges File 2 | Prefix: rdf: 3 | Prefix: idsfor: 4 | Prefix: dce: 5 | Prefix: xsd: 6 | Prefix: allocatedto: 7 | Prefix: xml: 8 | Prefix: idprefix: 9 | Prefix: iddigits: 10 | Prefix: rdfs: 11 | Prefix: idrange: 12 | Prefix: owl: 13 | 14 | Ontology: 15 | 16 | 17 | Annotations: 18 | idsfor: "APOLLO_SV", 19 | idprefix: "http://purl.obolibrary.org/obo/APOLLO_SV_", 20 | iddigits: 7 21 | 22 | AnnotationProperty: idprefix: 23 | 24 | 25 | AnnotationProperty: iddigits: 26 | 27 | 28 | AnnotationProperty: idsfor: 29 | 30 | 31 | AnnotationProperty: allocatedto: 32 | 33 | Datatype: idrange:1 34 | 35 | Annotations: 36 | allocatedto: "ONTOLOGY-CREATOR" 37 | 38 | EquivalentTo: 39 | xsd:integer[>= 0 , <= 999999] 40 | 41 | 42 | Datatype: idrange:2 43 | 44 | Annotations: 45 | allocatedto: "ADDITIONAL EDITOR" 46 | 47 | EquivalentTo: 48 | xsd:integer[>= 1000000 , <= 1999999] 49 | 50 | 51 | Datatype: xsd:integer 52 | Datatype: rdf:PlainLiteral 53 | 54 | -------------------------------------------------------------------------------- /src/ontology/apollo_sv-odk.yaml: -------------------------------------------------------------------------------- 1 | id: apollo_sv 2 | title: "Apollo Structured Vocabulary" 3 | github_org: ApolloDev 4 | repo: apollo-sv 5 | report_fail_on: ERROR 6 | export_formats: 7 | - owl 8 | - obo 9 | - json 10 | release_artefacts: 11 | - base 12 | - full 13 | import_group: 14 | module_type: filter 15 | annotation_properties: 16 | - rdfs:label 17 | - IAO:0000115 18 | - IAO:0000116 19 | - IAO:0000111 20 | - oboInOwl:hasDbXref 21 | - rdfs:comment 22 | products: 23 | - id: ro 24 | module_type: slme 25 | slme_individuals: exclude 26 | - id: geo 27 | mirror_from: http://purl.obolibrary.org/obo/geo/dev/geo.owl 28 | module_type: mirror 29 | - id: ido 30 | module_type: slme 31 | slme_individuals: exclude 32 | - id: mf 33 | module_type: slme 34 | slme_individuals: exclude 35 | - id: go 36 | module_type: slme 37 | slme_individuals: exclude 38 | - id: iao 39 | module_type: mirror 40 | - id: omrse 41 | module_type: slme 42 | slme_individuals: exclude 43 | use_custom_import_module: TRUE 44 | robot_java_args: '-Xmx8G' 45 | custom_makefile_header: | 46 | ### Workflow 47 | # 48 | # Tasks to edit and release OMRSE. 49 | # 50 | # #### Edit 51 | # 52 | # 1. [Prepare release](prepare_release) 53 | # 2. [Refresh imports](all_imports) 54 | # 3. [Update repo to latest ODK](update_repo) 55 | create_obo_metadata: FALSE 56 | documentation: 57 | documentation_system: mkdocs 58 | robot_report: 59 | use_base_iris: True 60 | release_reports: False 61 | fail_on : ERROR 62 | use_labels : False 63 | report_on : 64 | - edit 65 | - apollo_sv-base.owl 66 | sparql_test_on: 67 | - edit 68 | - apollo_sv-base.owl 69 | custom_sparql_checks : 70 | - owldef-self-reference 71 | - iri-range 72 | custom_sparql_exports : 73 | - basic-report 74 | -------------------------------------------------------------------------------- /src/ontology/apollo_sv.Makefile: -------------------------------------------------------------------------------- 1 | ## Customize Makefile settings for apollo_sv 2 | ## 3 | ## If you need to customize your Makefile, make 4 | ## changes here rather than in the main Makefile 5 | 6 | 7 | -------------------------------------------------------------------------------- /src/ontology/catalog-v001.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /src/ontology/imports/external_import.owl: -------------------------------------------------------------------------------- 1 | Prefix(:=) 2 | Prefix(owl:=) 3 | Prefix(rdf:=) 4 | Prefix(xml:=) 5 | Prefix(xsd:=) 6 | Prefix(rdfs:=) 7 | 8 | 9 | Ontology( 10 | 11 | Declaration(Class(owl:Thing)) 12 | 13 | ) -------------------------------------------------------------------------------- /src/ontology/imports/geo_terms.txt: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /src/ontology/imports/go_import.owl: -------------------------------------------------------------------------------- 1 | Prefix(:=) 2 | Prefix(owl:=) 3 | Prefix(rdf:=) 4 | Prefix(xml:=) 5 | Prefix(xsd:=) 6 | Prefix(rdfs:=) 7 | 8 | 9 | Ontology( 10 | 11 | Annotation( ) 12 | Annotation(owl:versionInfo "2024-12-24") 13 | 14 | Declaration(Class()) 15 | Declaration(Class()) 16 | Declaration(Class()) 17 | Declaration(Class()) 18 | Declaration(Class()) 19 | Declaration(Class()) 20 | Declaration(Class()) 21 | Declaration(Class()) 22 | Declaration(Class()) 23 | Declaration(Class()) 24 | Declaration(Class()) 25 | Declaration(Class()) 26 | Declaration(Class()) 27 | Declaration(Class()) 28 | Declaration(Class()) 29 | Declaration(ObjectProperty()) 30 | Declaration(ObjectProperty()) 31 | Declaration(ObjectProperty()) 32 | Declaration(ObjectProperty()) 33 | Declaration(ObjectProperty()) 34 | Declaration(ObjectProperty()) 35 | Declaration(ObjectProperty()) 36 | Declaration(AnnotationProperty()) 37 | Declaration(AnnotationProperty()) 38 | Declaration(AnnotationProperty()) 39 | Declaration(AnnotationProperty()) 40 | Declaration(AnnotationProperty()) 41 | Declaration(AnnotationProperty()) 42 | Declaration(AnnotationProperty()) 43 | Declaration(AnnotationProperty()) 44 | Declaration(AnnotationProperty()) 45 | Declaration(AnnotationProperty()) 46 | Declaration(AnnotationProperty()) 47 | Declaration(AnnotationProperty()) 48 | Declaration(AnnotationProperty()) 49 | Declaration(AnnotationProperty()) 50 | Declaration(AnnotationProperty()) 51 | Declaration(AnnotationProperty()) 52 | Declaration(AnnotationProperty()) 53 | Declaration(AnnotationProperty()) 54 | Declaration(AnnotationProperty()) 55 | Declaration(AnnotationProperty()) 56 | Declaration(AnnotationProperty()) 57 | Declaration(AnnotationProperty()) 58 | Declaration(AnnotationProperty()) 59 | Declaration(AnnotationProperty()) 60 | Declaration(AnnotationProperty()) 61 | Declaration(AnnotationProperty()) 62 | Declaration(AnnotationProperty()) 63 | Declaration(AnnotationProperty()) 64 | Declaration(AnnotationProperty()) 65 | Declaration(AnnotationProperty()) 66 | Declaration(AnnotationProperty()) 67 | Declaration(AnnotationProperty()) 68 | Declaration(AnnotationProperty()) 69 | Declaration(AnnotationProperty()) 70 | Declaration(AnnotationProperty()) 71 | Declaration(AnnotationProperty()) 72 | Declaration(AnnotationProperty()) 73 | Declaration(AnnotationProperty()) 74 | Declaration(AnnotationProperty()) 75 | Declaration(AnnotationProperty()) 76 | Declaration(AnnotationProperty()) 77 | Declaration(AnnotationProperty(rdfs:comment)) 78 | Declaration(AnnotationProperty(rdfs:label)) 79 | ############################ 80 | # Annotation Properties 81 | ############################ 82 | 83 | # Annotation Property: (definition) 84 | 85 | AnnotationAssertion(rdfs:label "definition") 86 | 87 | # Annotation Property: (term replaced by) 88 | 89 | AnnotationAssertion(rdfs:label "term replaced by") 90 | 91 | # Annotation Property: () 92 | 93 | SubAnnotationPropertyOf( ) 94 | 95 | # Annotation Property: () 96 | 97 | SubAnnotationPropertyOf( ) 98 | 99 | # Annotation Property: () 100 | 101 | SubAnnotationPropertyOf( ) 102 | 103 | # Annotation Property: () 104 | 105 | SubAnnotationPropertyOf( ) 106 | 107 | # Annotation Property: () 108 | 109 | SubAnnotationPropertyOf( ) 110 | 111 | # Annotation Property: () 112 | 113 | SubAnnotationPropertyOf( ) 114 | 115 | # Annotation Property: () 116 | 117 | SubAnnotationPropertyOf( ) 118 | 119 | # Annotation Property: () 120 | 121 | SubAnnotationPropertyOf( ) 122 | 123 | # Annotation Property: () 124 | 125 | SubAnnotationPropertyOf( ) 126 | 127 | # Annotation Property: () 128 | 129 | SubAnnotationPropertyOf( ) 130 | 131 | # Annotation Property: () 132 | 133 | SubAnnotationPropertyOf( ) 134 | 135 | # Annotation Property: () 136 | 137 | SubAnnotationPropertyOf( ) 138 | 139 | # Annotation Property: () 140 | 141 | SubAnnotationPropertyOf( ) 142 | 143 | # Annotation Property: () 144 | 145 | SubAnnotationPropertyOf( ) 146 | 147 | # Annotation Property: (has_alternative_id) 148 | 149 | AnnotationAssertion(rdfs:label "has_alternative_id") 150 | 151 | # Annotation Property: (has_broad_synonym) 152 | 153 | AnnotationAssertion(rdfs:label "has_broad_synonym") 154 | 155 | # Annotation Property: (database_cross_reference) 156 | 157 | AnnotationAssertion(rdfs:label "database_cross_reference") 158 | 159 | # Annotation Property: (has_exact_synonym) 160 | 161 | AnnotationAssertion(rdfs:label "has_exact_synonym") 162 | 163 | # Annotation Property: (has_narrow_synonym) 164 | 165 | AnnotationAssertion(rdfs:label "has_narrow_synonym") 166 | 167 | # Annotation Property: (has_obo_namespace) 168 | 169 | AnnotationAssertion(rdfs:label "has_obo_namespace") 170 | 171 | # Annotation Property: (has_related_synonym) 172 | 173 | AnnotationAssertion(rdfs:label "has_related_synonym") 174 | 175 | # Annotation Property: (has_synonym_type) 176 | 177 | AnnotationAssertion(rdfs:label "has_synonym_type") 178 | 179 | # Annotation Property: (in_subset) 180 | 181 | AnnotationAssertion(rdfs:label "in_subset") 182 | 183 | # Annotation Property: (shorthand) 184 | 185 | AnnotationAssertion(rdfs:label "shorthand") 186 | 187 | 188 | ############################ 189 | # Object Properties 190 | ############################ 191 | 192 | # Object Property: (part of) 193 | 194 | AnnotationAssertion( "BFO:0000050") 195 | AnnotationAssertion( "external") 196 | AnnotationAssertion( "part_of") 197 | AnnotationAssertion( "part_of") 198 | AnnotationAssertion(rdfs:label "part of") 199 | InverseObjectProperties( ) 200 | TransitiveObjectProperty() 201 | 202 | # Object Property: (has part) 203 | 204 | AnnotationAssertion( "BFO:0000051") 205 | AnnotationAssertion( "external") 206 | AnnotationAssertion( "has_part") 207 | AnnotationAssertion( "has_part") 208 | AnnotationAssertion(rdfs:label "has part") 209 | TransitiveObjectProperty() 210 | 211 | # Object Property: (occurs in) 212 | 213 | AnnotationAssertion( "BFO:0000066") 214 | AnnotationAssertion( "external") 215 | AnnotationAssertion( "occurs_in") 216 | AnnotationAssertion( "occurs_in") 217 | AnnotationAssertion(rdfs:label "occurs in") 218 | 219 | # Object Property: (ends during) 220 | 221 | AnnotationAssertion( "RO:0002093") 222 | AnnotationAssertion( "external") 223 | AnnotationAssertion( "ends_during") 224 | AnnotationAssertion( "ends_during") 225 | AnnotationAssertion(rdfs:label "ends during") 226 | 227 | # Object Property: (regulates) 228 | 229 | AnnotationAssertion( "RO:0002211") 230 | AnnotationAssertion( "external") 231 | AnnotationAssertion( "regulates") 232 | AnnotationAssertion( "regulates") 233 | AnnotationAssertion(rdfs:label "regulates") 234 | TransitiveObjectProperty() 235 | 236 | # Object Property: (negatively regulates) 237 | 238 | AnnotationAssertion( "RO:0002212") 239 | AnnotationAssertion( "external") 240 | AnnotationAssertion( "negatively_regulates") 241 | AnnotationAssertion( "negatively_regulates") 242 | AnnotationAssertion(rdfs:label "negatively regulates") 243 | SubObjectPropertyOf( ) 244 | 245 | # Object Property: (positively regulates) 246 | 247 | AnnotationAssertion( "RO:0002213") 248 | AnnotationAssertion( "external") 249 | AnnotationAssertion( "positively_regulates") 250 | AnnotationAssertion( "positively_regulates") 251 | AnnotationAssertion(rdfs:label "positively regulates") 252 | SubObjectPropertyOf( ) 253 | 254 | 255 | 256 | ############################ 257 | # Classes 258 | ############################ 259 | 260 | # Class: (behavior) 261 | 262 | AnnotationAssertion(Annotation( "GOC:ems") Annotation( "GOC:jl") Annotation( "ISBN:0395448956") Annotation( "PMID:20160973") "The internally coordinated responses (actions or inactions) of animals (individuals or groups) to internal or external stimuli, via a mechanism that involves nervous system activity.") 263 | AnnotationAssertion( "jl") 264 | AnnotationAssertion( "2012-09-20T14:06:08Z") 265 | AnnotationAssertion( "GO:0023032") 266 | AnnotationAssertion( "GO:0044708") 267 | AnnotationAssertion( "GO:0044709") 268 | AnnotationAssertion( "Wikipedia:Behavior") 269 | AnnotationAssertion( "behavioral response to stimulus") 270 | AnnotationAssertion( "behaviour") 271 | AnnotationAssertion( "behavioural response to stimulus") 272 | AnnotationAssertion( "biological_process") 273 | AnnotationAssertion( "single-organism behavior") 274 | AnnotationAssertion( "GO:0007610") 275 | AnnotationAssertion( ) 276 | AnnotationAssertion( ) 277 | AnnotationAssertion( ) 278 | AnnotationAssertion(rdfs:comment "1. Note that this term is in the subset of terms that should not be used for direct gene product annotation. Instead, select a child term or, if no appropriate child term exists, please request a new term. Direct annotations to this term may be amended during annotation reviews. 279 | 2. While a broader definition of behavior encompassing plants and single cell organisms would be justified on the basis of some usage (see PMID:20160973 for discussion), GO uses a tight definition that limits behavior to animals and to responses involving the nervous system, excluding plant responses that GO classifies under development, and responses of unicellular organisms that has general classifications for covering the responses of cells in multicellular organisms (e.g. cell chemotaxis).") 280 | AnnotationAssertion(rdfs:label "behavior") 281 | SubClassOf( ) 282 | 283 | # Class: (biological_process) 284 | 285 | AnnotationAssertion(Annotation( "GOC:pdt") "A biological process is the execution of a genetically-encoded biological module or program. It consists of all the steps required to achieve the specific biological objective of the module. A biological process is accomplished by a particular set of molecular functions carried out by specific gene products (or macromolecular complexes), often in a highly regulated manner and in a particular temporal sequence.") 286 | AnnotationAssertion( "https://github.com/geneontology/go-ontology/issues/24968"^^xsd:anyURI) 287 | AnnotationAssertion( "jl") 288 | AnnotationAssertion( "2012-09-19T15:05:24Z") 289 | AnnotationAssertion( "GO:0000004") 290 | AnnotationAssertion( "GO:0007582") 291 | AnnotationAssertion( "GO:0044699") 292 | AnnotationAssertion( "Wikipedia:Biological_process") 293 | AnnotationAssertion( "biological process") 294 | AnnotationAssertion( "physiological process") 295 | AnnotationAssertion( "biological_process") 296 | AnnotationAssertion( "single organism process") 297 | AnnotationAssertion( "single-organism process") 298 | AnnotationAssertion( "GO:0008150") 299 | AnnotationAssertion( ) 300 | AnnotationAssertion( ) 301 | AnnotationAssertion( ) 302 | AnnotationAssertion( ) 303 | AnnotationAssertion( ) 304 | AnnotationAssertion( ) 305 | AnnotationAssertion( ) 306 | AnnotationAssertion(rdfs:comment "Note that, in addition to forming the root of the biological process ontology, this term is recommended for the annotation of gene products whose biological process is unknown. When this term is used for annotation, it indicates that no information was available about the biological process of the gene product annotated as of the date the annotation was made; the evidence code 'no data' (ND), is used to indicate this.") 307 | AnnotationAssertion(rdfs:label "biological_process") 308 | 309 | # Class: (viral process) 310 | 311 | AnnotationAssertion(Annotation( "GOC:bf") Annotation( "GOC:jl") Annotation( "GOC:mah") "A multi-organism process in which a virus is a participant. The other participant is the host. Includes infection of a host cell, replication of the viral genome, and assembly of progeny virus particles. In some cases the viral genetic material may integrate into the host genome and only subsequently, under particular circumstances, 'complete' its life cycle.") 312 | AnnotationAssertion( "GO:0022415") 313 | AnnotationAssertion( "Wikipedia:Viral_life_cycle") 314 | AnnotationAssertion(Annotation( "GOC:bf") Annotation( "GOC:jl") "virus process") 315 | AnnotationAssertion( "biological_process") 316 | AnnotationAssertion( "viral infection") 317 | AnnotationAssertion( "virulence") 318 | AnnotationAssertion( "GO:0016032") 319 | AnnotationAssertion( ) 320 | AnnotationAssertion( ) 321 | AnnotationAssertion( ) 322 | AnnotationAssertion(rdfs:comment "See also the biological process terms 'viral infectious cycle ; GO:0019058' and 'lysogeny ; GO:0030069'.") 323 | AnnotationAssertion(rdfs:label "viral process") 324 | SubClassOf( ) 325 | 326 | # Class: (viral life cycle) 327 | 328 | AnnotationAssertion(Annotation( "ISBN:1555811272") "A set of processes which all viruses follow to ensure survival; includes attachment and entry of the virus particle, decoding of genome information, translation of viral mRNA by host ribosomes, genome replication, and assembly and release of viral particles containing the genome.") 329 | AnnotationAssertion( "GO:0019067") 330 | AnnotationAssertion(Annotation( "GOC:bf") Annotation( "GOC:jl") "viral assembly, maturation, egress, and release") 331 | AnnotationAssertion( "biological_process") 332 | AnnotationAssertion( "lytic viral life cycle") 333 | AnnotationAssertion(Annotation( "GOC:bf") Annotation( "GOC:jl") "viral infectious cycle") 334 | AnnotationAssertion(Annotation( "GOC:bf") Annotation( "GOC:jl") "viral replication") 335 | AnnotationAssertion( "GO:0019058") 336 | AnnotationAssertion( ) 337 | AnnotationAssertion(rdfs:label "viral life cycle") 338 | SubClassOf( ) 339 | 340 | # Class: (reproductive behavior) 341 | 342 | AnnotationAssertion(Annotation( "GOC:jl") Annotation( "GOC:pr") "The specific behavior of an organism that is associated with reproduction.") 343 | AnnotationAssertion( "https://github.com/geneontology/go-ontology/issues/23491"^^xsd:anyURI) 344 | AnnotationAssertion( "jl") 345 | AnnotationAssertion( "2012-09-19T16:01:37Z") 346 | AnnotationAssertion( "GO:0033057") 347 | AnnotationAssertion( "GO:0044704") 348 | AnnotationAssertion( "GO:0044705") 349 | AnnotationAssertion( "reproductive behavior in a multicellular organism") 350 | AnnotationAssertion( "reproductive behaviour") 351 | AnnotationAssertion( "multi-organism reproductive behavior") 352 | AnnotationAssertion( "multicellular organism reproductive behavior") 353 | AnnotationAssertion( "biological_process") 354 | AnnotationAssertion( "single-organism reproductive behavior") 355 | AnnotationAssertion( "GO:0019098") 356 | AnnotationAssertion(rdfs:label "reproductive behavior") 357 | EquivalentClasses( ObjectIntersectionOf( )) 358 | SubClassOf( ) 359 | SubClassOf( ) 360 | 361 | # Class: (sexual reproduction) 362 | 363 | AnnotationAssertion(Annotation( "Wikipedia:Sexual_reproduction") "A type of reproduction that combines the genetic material of two gametes (such as a sperm or egg cell or fungal spores). The gametes have an haploid genome (with a single set of chromosomes, the product of a meiotic division) and combines with one another to produce a zygote (diploid).") 364 | AnnotationAssertion( "https://github.com/geneontology/go-ontology/issues/22929"^^xsd:anyURI) 365 | AnnotationAssertion( "Wikipedia:Sexual_reproduction") 366 | AnnotationAssertion( "biological_process") 367 | AnnotationAssertion( "GO:0019953") 368 | AnnotationAssertion(rdfs:comment "Note that gametes may come from two organisms or from a single organism in the case of self-fertilizing hermaphrodites, e.g. C. elegans, or self-fertilization in plants. Note also that sexual reproduction may be seen as the regular alternation, in the life cycle of haplontic, diplontic and diplohaplontic organisms, of meiosis and fertilization which provides for the production offspring. In diplontic organisms there is a life cycle in which the products of meiosis behave directly as gametes, fusing to form a zygote from which the diploid, or sexually reproductive polyploid, adult organism will develop. In diplohaplontic organisms a haploid phase (gametophyte) exists in the life cycle between meiosis and fertilization (e.g. higher plants, many algae and Fungi); the products of meiosis are spores that develop as haploid individuals from which haploid gametes develop to form a diploid zygote; diplohaplontic organisms show an alternation of haploid and diploid generations. In haplontic organisms meiosis occurs in the zygote, giving rise to four haploid cells (e.g. many algae and protozoa), only the zygote is diploid and this may form a resistant spore, tiding organisms over hard times.") 369 | AnnotationAssertion(rdfs:label "sexual reproduction") 370 | SubClassOf( ) 371 | 372 | # Class: (asexual reproduction) 373 | 374 | AnnotationAssertion(Annotation( "ISBN:0387520546") Annotation( "PMID:22977071") Annotation( "PMID:28779329") Annotation( "PMID:29559496") "A type of reproduction in which new individuals are produced from a single organism, either from an unfertilized egg or from a single cell or group of cells.") 375 | AnnotationAssertion( "https://github.com/geneontology/go-ontology/issues/22929"^^xsd:anyURI) 376 | AnnotationAssertion( "Wikipedia:Asexual_reproduction") 377 | AnnotationAssertion( "biological_process") 378 | AnnotationAssertion(Annotation( "Wikipedia:Parthenogenesis") "parthenogenesis") 379 | AnnotationAssertion( "GO:0019954") 380 | AnnotationAssertion(rdfs:label "asexual reproduction") 381 | SubClassOf( ) 382 | 383 | # Class: (reproductive process) 384 | 385 | AnnotationAssertion(Annotation( "GOC:dph") Annotation( "GOC:isa_complete") "A biological process that directly contributes to the process of producing new individuals by one or two organisms. The new individuals inherit some proportion of their genetic material from the parent or parents.") 386 | AnnotationAssertion( "https://github.com/geneontology/go-ontology/issues/27054"^^xsd:anyURI) 387 | AnnotationAssertion( "jl") 388 | AnnotationAssertion( "2012-09-19T15:56:06Z") 389 | AnnotationAssertion( "GO:0044702") 390 | AnnotationAssertion( "Wikipedia:Reproduction") 391 | AnnotationAssertion( "biological_process") 392 | AnnotationAssertion( "single organism reproductive process") 393 | AnnotationAssertion( "GO:0022414") 394 | AnnotationAssertion( ) 395 | AnnotationAssertion( ) 396 | AnnotationAssertion( ) 397 | AnnotationAssertion( ) 398 | AnnotationAssertion( ) 399 | AnnotationAssertion( ) 400 | AnnotationAssertion( ) 401 | AnnotationAssertion( ) 402 | AnnotationAssertion(rdfs:label "reproductive process") 403 | SubClassOf( ) 404 | 405 | # Class: (multicellular organismal process) 406 | 407 | AnnotationAssertion(Annotation( "GOC:curators") Annotation( "GOC:dph") Annotation( "GOC:isa_complete") Annotation( "GOC:tb") "Any biological process, occurring at the level of a multicellular organism, pertinent to its function.") 408 | AnnotationAssertion( "https://github.com/geneontology/go-ontology/issues/27189"^^xsd:anyURI) 409 | AnnotationAssertion( "jl") 410 | AnnotationAssertion( "2012-09-19T16:07:47Z") 411 | AnnotationAssertion( "GO:0044707") 412 | AnnotationAssertion( "GO:0050874") 413 | AnnotationAssertion( "organismal physiological process") 414 | AnnotationAssertion( "biological_process") 415 | AnnotationAssertion( "single-multicellular organism process") 416 | AnnotationAssertion( "GO:0032501") 417 | AnnotationAssertion( ) 418 | AnnotationAssertion( ) 419 | AnnotationAssertion(rdfs:comment "Note that this term is in the subset of terms that should not be used for direct gene product annotation. Instead, select a child term or, if no appropriate child term exists, please request a new term. Direct annotations to this term may be amended during annotation QC.") 420 | AnnotationAssertion(rdfs:label "multicellular organismal process") 421 | SubClassOf( ) 422 | 423 | # Class: (obsolete multicellular organism reproduction) 424 | 425 | AnnotationAssertion(Annotation( "GOC:isa_complete") Annotation( "GOC:jid") "OBSOLETE. The biological process in which new individuals are produced by one or two multicellular organisms. The new individuals inherit some proportion of their genetic material from the parent or parents.") 426 | AnnotationAssertion( "https://github.com/geneontology/go-ontology/issues/27054"^^xsd:anyURI) 427 | AnnotationAssertion( "GO:0048609") 428 | AnnotationAssertion( "biological_process") 429 | AnnotationAssertion( "GO:0032504") 430 | AnnotationAssertion(rdfs:comment "The reason for obsoletion is that this term is equivalent to multicellular organismal reproductive process.") 431 | AnnotationAssertion(rdfs:label "obsolete multicellular organism reproduction") 432 | AnnotationAssertion(owl:deprecated "true"^^xsd:boolean) 433 | 434 | # Class: (biological process involved in symbiotic interaction) 435 | 436 | AnnotationAssertion(Annotation( "GOC:cc") Annotation( "PMID:31257129") "A process carried out by gene products in an organism that enable the organism to engage in a symbiotic relationship, a more or less intimate association, with another organism. The various forms of symbiosis include parasitism, in which the association is disadvantageous or destructive to one of the organisms; mutualism, in which the association is advantageous, or often necessary to one or both and not harmful to either; and commensalism, in which one member of the association benefits while the other is not affected. However, mutualism, parasitism, and commensalism are often not discrete categories of interactions and should rather be perceived as a continuum of interaction ranging from parasitism to mutualism. In fact, the direction of a symbiotic interaction can change during the lifetime of the symbionts due to developmental changes as well as changes in the biotic/abiotic environment in which the interaction occurs. Microscopic symbionts are often referred to as endosymbionts.") 437 | AnnotationAssertion( "https://github.com/geneontology/go-ontology/issues/14807"^^xsd:anyURI) 438 | AnnotationAssertion( "https://github.com/geneontology/go-ontology/issues/20191"^^xsd:anyURI) 439 | AnnotationAssertion( "GO:0043298") 440 | AnnotationAssertion( "GO:0044404") 441 | AnnotationAssertion( "GO:0072519") 442 | AnnotationAssertion( "GO:0085031") 443 | AnnotationAssertion( "commensalism") 444 | AnnotationAssertion( "host-pathogen interaction") 445 | AnnotationAssertion( "parasitism") 446 | AnnotationAssertion( "biological_process") 447 | AnnotationAssertion( "symbiosis") 448 | AnnotationAssertion( "symbiosis, encompassing mutualism through parasitism") 449 | AnnotationAssertion( "symbiotic interaction") 450 | AnnotationAssertion( "symbiotic interaction between host and organism") 451 | AnnotationAssertion( "symbiotic interaction between organisms") 452 | AnnotationAssertion( "symbiotic interaction between species") 453 | AnnotationAssertion( "symbiotic process") 454 | AnnotationAssertion( "GO:0044403") 455 | AnnotationAssertion( ) 456 | AnnotationAssertion(rdfs:label "biological process involved in symbiotic interaction") 457 | SubClassOf( ) 458 | 459 | # Class: (symbiont entry into host) 460 | 461 | AnnotationAssertion(Annotation( "GOC:vw") "Entry of a symbiont into the body, tissues, or cells of a host organism as part of the symbiont life cycle. The host is defined as the larger of the organisms involved in a symbiotic interaction.") 462 | AnnotationAssertion( "https://github.com/geneontology/go-ontology/issues/18563"^^xsd:anyURI) 463 | AnnotationAssertion( "GO:0030260") 464 | AnnotationAssertion( "GO:0044411") 465 | AnnotationAssertion( "GO:0051806") 466 | AnnotationAssertion( "GO:0051828") 467 | AnnotationAssertion( "GO:0051830") 468 | AnnotationAssertion( "GO:0075052") 469 | AnnotationAssertion( "GO:0085027") 470 | AnnotationAssertion( "GO:0085028") 471 | AnnotationAssertion( "entry into host") 472 | AnnotationAssertion( "host invasion") 473 | AnnotationAssertion(Annotation( "GOC:vw") "host penetration") 474 | AnnotationAssertion( "invasion into host") 475 | AnnotationAssertion( "invasion of host") 476 | AnnotationAssertion(Annotation( "GOC:vw") "penetration into host") 477 | AnnotationAssertion(Annotation( "GOC:tb") "entry into cell of other organism during symbiotic interaction") 478 | AnnotationAssertion( "entry into host cell via penetration peg") 479 | AnnotationAssertion( "entry into host via a specialized structure during symbiotic interaction") 480 | AnnotationAssertion( "entry into host via enzymatic degradation of host anatomical structure") 481 | AnnotationAssertion( "entry into host via enzymatic degradation of host cuticle") 482 | AnnotationAssertion(Annotation( "GOC:vw") "penetration into host via a specialized structure") 483 | AnnotationAssertion(Annotation( "GOC:vw") "penetration into host via a specialized structure during symbiotic interaction") 484 | AnnotationAssertion( "biological_process") 485 | AnnotationAssertion( "entry into cell of other organism involved in symbiotic interaction") 486 | AnnotationAssertion( "entry into host through host barriers") 487 | AnnotationAssertion(Annotation( "GOC:tb") "entry into other organism during symbiotic interaction") 488 | AnnotationAssertion( "entry into other organism involved in symbiotic interaction") 489 | AnnotationAssertion( "invasion into other organism") 490 | AnnotationAssertion( "invasion of other organism") 491 | AnnotationAssertion( "invasive growth") 492 | AnnotationAssertion( "other organism invasion") 493 | AnnotationAssertion( "GO:0044409") 494 | AnnotationAssertion( ) 495 | AnnotationAssertion(rdfs:label "symbiont entry into host") 496 | SubClassOf( ) 497 | 498 | # Class: (biological process involved in interspecies interaction between organisms) 499 | 500 | AnnotationAssertion(Annotation( "GOC:cc") "Any process evolved to enable an interaction with an organism of a different species.") 501 | AnnotationAssertion( "https://github.com/geneontology/go-ontology/issues/20191"^^xsd:anyURI) 502 | AnnotationAssertion( "interaction with another species") 503 | AnnotationAssertion( "interspecies interaction") 504 | AnnotationAssertion( "interspecies interaction between organisms") 505 | AnnotationAssertion( "interspecies interaction with other organisms") 506 | AnnotationAssertion( "biological_process") 507 | AnnotationAssertion( "GO:0044419") 508 | AnnotationAssertion( ) 509 | AnnotationAssertion( ) 510 | AnnotationAssertion( ) 511 | AnnotationAssertion(rdfs:label "biological process involved in interspecies interaction between organisms") 512 | SubClassOf( ) 513 | 514 | # Class: (multicellular organismal reproductive process) 515 | 516 | AnnotationAssertion(Annotation( "GOC:dph") Annotation( "GOC:jid") Annotation( "GOC:tb") "The process, occurring above the cellular level, that is pertinent to the reproductive function of a multicellular organism. This includes the integrated processes at the level of tissues and organs.") 517 | AnnotationAssertion( "https://github.com/geneontology/go-ontology/issues/27054"^^xsd:anyURI) 518 | AnnotationAssertion( "organismal reproductive process") 519 | AnnotationAssertion( "reproductive process in a multicellular organism") 520 | AnnotationAssertion( "biological_process") 521 | AnnotationAssertion( "GO:0048609") 522 | AnnotationAssertion( ) 523 | AnnotationAssertion( ) 524 | AnnotationAssertion(rdfs:label "multicellular organismal reproductive process") 525 | SubClassOf( ) 526 | 527 | # Class: (biological process involved in interaction with host) 528 | 529 | AnnotationAssertion(Annotation( "GOC:cc") "An interaction between two organisms living together in more or less intimate association. The term host is used for the larger (macro) of the two members of a symbiosis; the various forms of symbiosis include parasitism, commensalism and mutualism.") 530 | AnnotationAssertion( "https://github.com/geneontology/go-ontology/issues/20191"^^xsd:anyURI) 531 | AnnotationAssertion( "GO:0044112") 532 | AnnotationAssertion( "GO:0044116") 533 | AnnotationAssertion( "GO:0044117") 534 | AnnotationAssertion( "GO:0044119") 535 | AnnotationAssertion( "GO:0044121") 536 | AnnotationAssertion( "GO:0044123") 537 | AnnotationAssertion( "GO:0044125") 538 | AnnotationAssertion( "interaction with host") 539 | AnnotationAssertion( "growth of symbiont in host") 540 | AnnotationAssertion( "growth of symbiont in host cell") 541 | AnnotationAssertion( "growth of symbiont in host organelle") 542 | AnnotationAssertion( "growth of symbiont in host vacuole") 543 | AnnotationAssertion( "biological_process") 544 | AnnotationAssertion( "GO:0051701") 545 | AnnotationAssertion(rdfs:label "biological process involved in interaction with host") 546 | SubClassOf( ) 547 | 548 | 549 | SubObjectPropertyOf(ObjectPropertyChain( ) ) 550 | SubObjectPropertyOf(ObjectPropertyChain( ) ) 551 | ) -------------------------------------------------------------------------------- /src/ontology/imports/go_terms.txt: -------------------------------------------------------------------------------- 1 | GO_0000003 2 | GO_0006950 3 | GO_0006952 4 | GO_0006954 5 | GO_0007562 6 | GO_0007565 7 | GO_0007567 8 | GO_0007568 9 | GO_0007610 10 | GO_0007617 11 | GO_0008150 12 | GO_0010259 13 | GO_0010941 14 | GO_0018991 15 | GO_0019048 16 | GO_0019051 17 | GO_0019054 18 | GO_0019098 19 | GO_0022414 20 | GO_0022414 21 | GO_0032502 22 | GO_0032504 23 | GO_0033057 24 | GO_0035176 25 | GO_0035821 26 | GO_0039651 27 | GO_0043067 28 | GO_0044003 29 | GO_0044409 30 | GO_0044419 31 | GO_0044531 32 | GO_0044703 33 | GO_0044705 34 | GO_0048609 35 | GO_0050789 36 | GO_0050794 37 | GO_0050896 38 | GO_0051234 39 | GO_0051701 40 | GO_0051704 41 | GO_0051705 42 | GO_0051817 43 | GO_0052040 44 | GO_0052042 45 | GO_0052151 46 | GO_0052248 47 | GO_0052501 48 | GO_0060139 49 | GO_0060153 50 | GO_0060403 51 | GO_0065007 52 | GO_0065008 53 | GO_0071684 54 | GO:0019058 55 | GO:0019954 56 | GO:0019953 57 | -------------------------------------------------------------------------------- /src/ontology/imports/iao_terms.txt: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /src/ontology/imports/ido_terms.txt: -------------------------------------------------------------------------------- 1 | http://purl.obolibrary.org/obo/IDO_0000488 2 | http://purl.obolibrary.org/obo/IDO_0000480 3 | http://purl.obolibrary.org/obo/IDO_0000482 4 | http://purl.obolibrary.org/obo/IDO_0000484 5 | http://purl.obolibrary.org/obo/IDO_0000486 6 | http://purl.obolibrary.org/obo/IDO_0000479 7 | http://purl.obolibrary.org/obo/IDO_0000481 8 | http://purl.obolibrary.org/obo/IDO_0000483 9 | http://purl.obolibrary.org/obo/IDO_0000487 10 | http://purl.obolibrary.org/obo/IDO_0000489 11 | http://purl.obolibrary.org/obo/IDO_0000485 12 | 13 | -------------------------------------------------------------------------------- /src/ontology/imports/mf_terms.txt: -------------------------------------------------------------------------------- 1 | http://purl.obolibrary.org/obo/MF_0000073 2 | http://purl.obolibrary.org/obo/MF_0000075 3 | http://purl.obolibrary.org/obo/MF_0000074 4 | -------------------------------------------------------------------------------- /src/ontology/imports/omrse_terms.txt: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /src/ontology/imports/ro_terms.txt: -------------------------------------------------------------------------------- 1 | http://purl.obolibrary.org/obo/RO_0002234 2 | -------------------------------------------------------------------------------- /src/ontology/run.bat: -------------------------------------------------------------------------------- 1 | docker run -v %cd%\..\..\:/work -w /work/src/ontology -e 'ROBOT_JAVA_ARGS=-Xmx8G' -e 'JAVA_OPTS=-Xmx8G' --rm -ti obolibrary/odkfull %* -------------------------------------------------------------------------------- /src/ontology/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Wrapper script for docker. 3 | # 4 | # This is used primarily for wrapping the GNU Make workflow. 5 | # Instead of typing "make TARGET", type "./run.sh make TARGET". 6 | # This will run the make workflow within a docker container. 7 | # 8 | # The assumption is that you are working in the src/ontology folder; 9 | # we therefore map the whole repo (../..) to a docker volume. 10 | # 11 | # To use singularity instead of docker, please issue 12 | # export USE_SINGULARITY= 13 | # before running this script. 14 | # 15 | # See README-editors.md for more details. 16 | 17 | set -e 18 | 19 | if [ -f run.sh.conf ]; then 20 | . ./run.sh.conf 21 | fi 22 | 23 | # Look for a GitHub token 24 | if [ -n "$GH_TOKEN" ]; then 25 | : 26 | elif [ -f ../../.github/token.txt ]; then 27 | GH_TOKEN=$(cat ../../.github/token.txt) 28 | elif [ -f $XDG_CONFIG_HOME/ontology-development-kit/github/token ]; then 29 | GH_TOKEN=$(cat $XDG_CONFIG_HOME/ontology-development-kit/github/token) 30 | elif [ -f "$HOME/Library/Application Support/ontology-development-kit/github/token" ]; then 31 | GH_TOKEN=$(cat "$HOME/Library/Application Support/ontology-development-kit/github/token") 32 | fi 33 | 34 | # SSH agent socket 35 | # On macOS, we cannot use $SSH_AUTH_SOCK directly, 36 | # we need to use a "magic" socket instead. 37 | case "$(uname)" in 38 | Darwin) 39 | ODK_SSH_AUTH_SOCKET=/run/host-services/ssh-auth.sock 40 | ;; 41 | *) 42 | ODK_SSH_AUTH_SOCKET=$SSH_AUTH_SOCK 43 | ;; 44 | esac 45 | ODK_SSH_BIND= 46 | if [ -n "$ODK_SSH_AUTH_SOCKET" ]; then 47 | ODK_SSH_BIND=",$ODK_SSH_AUTH_SOCKET:/run/host-services/ssh-auth.sock" 48 | fi 49 | 50 | ODK_IMAGE=${ODK_IMAGE:-odkfull} 51 | TAG_IN_IMAGE=$(echo $ODK_IMAGE | awk -F':' '{ print $2 }') 52 | if [ -n "$TAG_IN_IMAGE" ]; then 53 | # Override ODK_TAG env var if IMAGE already includes a tag 54 | ODK_TAG=$TAG_IN_IMAGE 55 | ODK_IMAGE=$(echo $ODK_IMAGE | awk -F':' '{ print $1 }') 56 | fi 57 | ODK_TAG=${ODK_TAG:-latest} 58 | ODK_JAVA_OPTS=${ODK_JAVA_OPTS:--Xmx8G} 59 | ODK_DEBUG=${ODK_DEBUG:-no} 60 | 61 | ODK_USER_ID=${ODK_USER_ID:-$(id -u)} 62 | ODK_GROUP_ID=${ODK_GROUP_ID:-$(id -g)} 63 | 64 | # Convert OWLAPI_* environment variables to the OWLAPI as Java options 65 | # See http://owlcs.github.io/owlapi/apidocs_4/org/semanticweb/owlapi/model/parameters/ConfigurationOptions.html 66 | # for a list of allowed options 67 | OWLAPI_OPTIONS_NAMESPACE=org.semanticweb.owlapi.model.parameters.ConfigurationOptions 68 | for owlapi_var in $(env | sed -n s/^OWLAPI_//p) ; do 69 | ODK_JAVA_OPTS="$ODK_JAVA_OPTS -D$OWLAPI_OPTIONS_NAMESPACE.${owlapi_var%=*}=${owlapi_var#*=}" 70 | done 71 | 72 | TIMECMD= 73 | if [ x$ODK_DEBUG = xyes ]; then 74 | # If you wish to change the format string, take care of using 75 | # non-breaking spaces (U+00A0) instead of normal spaces, to 76 | # prevent the shell from tokenizing the format string. 77 | echo "Running obolibrary/${ODK_IMAGE}:${ODK_TAG} with '${ODK_JAVA_OPTS}' as options for ROBOT and other Java-based pipeline steps." 78 | TIMECMD="/usr/bin/time -f ### DEBUG STATS ###\nElapsed time: %E\nPeak memory: %M kb" 79 | fi 80 | rm -f tmp/debug.log 81 | 82 | VOLUME_BIND=$PWD/../../:/work$ODK_SSH_BIND 83 | WORK_DIR=/work/src/ontology 84 | 85 | if [ -n "$ODK_BINDS" ]; then 86 | VOLUME_BIND="$VOLUME_BIND,$ODK_BINDS" 87 | fi 88 | 89 | if [ -n "$USE_SINGULARITY" ]; then 90 | 91 | singularity exec --cleanenv $ODK_SINGULARITY_OPTIONS \ 92 | --env "ROBOT_JAVA_ARGS=$ODK_JAVA_OPTS,JAVA_OPTS=$ODK_JAVA_OPTS,SSH_AUTH_SOCK=/run/host-services/ssh-auth.sock,ODK_USER_ID=$ODK_USER_ID,ODK_GROUP_ID=$ODK_GROUP_ID,ODK_DEBUG=$ODK_DEBUG" \ 93 | --bind $VOLUME_BIND \ 94 | -W $WORK_DIR \ 95 | docker://obolibrary/$ODK_IMAGE:$ODK_TAG $TIMECMD "$@" 96 | else 97 | BIND_OPTIONS="-v $(echo $VOLUME_BIND | sed 's/,/ -v /')" 98 | docker run $ODK_DOCKER_OPTIONS $BIND_OPTIONS -w $WORK_DIR \ 99 | -e ROBOT_JAVA_ARGS="$ODK_JAVA_OPTS" -e JAVA_OPTS="$ODK_JAVA_OPTS" -e SSH_AUTH_SOCK=/run/host-services/ssh-auth.sock -e ODK_USER_ID=$ODK_USER_ID -e ODK_GROUP_ID=$ODK_GROUP_ID -e ODK_DEBUG=$ODK_DEBUG \ 100 | --rm -ti obolibrary/$ODK_IMAGE:$ODK_TAG $TIMECMD "$@" 101 | fi 102 | 103 | case "$@" in 104 | *update_repo*|*release*) 105 | echo "Please remember to update your ODK image from time to time: https://oboacademy.github.io/obook/howto/odk-update/." 106 | ;; 107 | esac -------------------------------------------------------------------------------- /src/scripts/run-command.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | ODK_DEBUG_FILE=${ODK_DEBUG_FILE:-debug.log} 3 | echo "Command: sh $@" >> $ODK_DEBUG_FILE 4 | /usr/bin/time -a -o $ODK_DEBUG_FILE -f "Elapsed time: %E\nPeak memory: %M kb" /bin/sh "$@" 5 | -------------------------------------------------------------------------------- /src/scripts/update_repo.sh: -------------------------------------------------------------------------------- 1 | echo "This (experimental) update script will create a new repo according to your config file. It will:" 2 | echo "(1) overwrite your repositories Makefile, ODK sparql queries (your custom queries wont be touched) and docker wrapper (run.sh)." 3 | echo "(2) and add missing files, if any." 4 | 5 | set -e 6 | 7 | OID=apollo_sv 8 | ROOTDIR=../.. 9 | SRCDIR=.. 10 | CONFIG=$OID"-odk.yaml" 11 | 12 | rm -rf target 13 | mkdir target 14 | /tools/odk.py seed -c -g -C $CONFIG 15 | ls -l target/$OID/src 16 | ls -l $SRCDIR/ 17 | cp target/$OID/src/scripts/update_repo.sh $SRCDIR/scripts/ 18 | rsync -r -u --ignore-existing --exclude 'patterns/data/default/example.tsv' --exclude 'patterns/dosdp-patterns/example.yaml' target/$OID/src/ $SRCDIR/ 19 | 20 | rsync -r -u --ignore-existing target/$OID/docs/ $ROOTDIR/docs 21 | mkdir -p $ROOTDIR/docs/odk-workflows 22 | rm -rf $ROOTDIR/docs/odk-workflows/* 23 | cp -r target/$OID/docs/odk-workflows/* $ROOTDIR/docs/odk-workflows 24 | cp target/$OID/src/ontology/Makefile $SRCDIR/ontology/ 25 | cp target/$OID/src/ontology/run.sh $SRCDIR/ontology/ 26 | cp -r target/$OID/src/sparql/* $SRCDIR/sparql/ 27 | mkdir -p $ROOTDIR/.github 28 | mkdir -p $ROOTDIR/.github/workflows 29 | cp target/$OID/.github/workflows/qc.yml $ROOTDIR/.github/workflows/qc.yml 30 | 31 | 32 | 33 | cp target/$OID/.github/workflows/docs.yml $ROOTDIR/.github/workflows/docs.yml 34 | 35 | 36 | cp -n target/$OID/mkdocs.yaml $ROOTDIR/ 37 | 38 | echo "WARNING: These files should be manually migrated: mkdocs.yaml, .gitignore, src/ontology/catalog.xml (if you added a new import or component)" 39 | 40 | echo "Ontology repository update successfully completed." -------------------------------------------------------------------------------- /src/scripts/validate_id_ranges.sc: -------------------------------------------------------------------------------- 1 | import $ivy.`net.sourceforge.owlapi:owlapi-distribution:4.5.16` 2 | import $ivy.`com.outr::scribe-slf4j:2.7.12` 3 | import org.semanticweb.owlapi.apibinding.OWLManager 4 | import org.semanticweb.owlapi.model._ 5 | import org.semanticweb.owlapi.vocab.OWLFacet 6 | import java.io.File 7 | import scala.collection 8 | import scala.collection.mutable 9 | import scala.jdk.CollectionConverters._ 10 | @main 11 | def main(id_range_file: os.Path) = { 12 | val o = OWLManager.createOWLOntologyManager().loadOntology(IRI.create(id_range_file.toIO)) 13 | val allMyFacets = mutable.ListBuffer.empty[MyFacet] 14 | for (dt <- o.getDatatypesInSignature().asScala) { 15 | val defs = o.getAxioms(dt) 16 | for (ax <- defs.asScala) { 17 | val range = ax.getDataRange() 18 | val f = new MyFacet() 19 | f.id = dt.toString() 20 | range.accept(new OWLDataRangeVisitor() { 21 | override 22 | def visit(owlDatatype: OWLDatatype) = () 23 | override 24 | def visit(owlDataOneOf: OWLDataOneOf) = () 25 | override 26 | def visit(owlDataComplementOf: OWLDataComplementOf) = () 27 | override 28 | def visit(owlDataIntersectionOf: OWLDataIntersectionOf) = () 29 | override 30 | def visit(owlDataUnionOf: OWLDataUnionOf) = () 31 | override 32 | def visit(owlDatatypeRestriction: OWLDatatypeRestriction) = { 33 | for (fr <- owlDatatypeRestriction.getFacetRestrictions().asScala) { 34 | var i = fr.getFacetValue().parseInteger() 35 | if(fr.getFacet().equals(OWLFacet.MIN_INCLUSIVE)) { 36 | f.min = i 37 | } else if(fr.getFacet().equals(OWLFacet.MAX_INCLUSIVE)) { 38 | f.max = i 39 | } else if(fr.getFacet().equals(OWLFacet.MIN_EXCLUSIVE)) { 40 | i += 1 41 | f.min = i 42 | } else if(fr.getFacet().equals(OWLFacet.MAX_EXCLUSIVE)) { 43 | i -= 1 44 | f.max = i 45 | } else { 46 | log("Unknown range restriction: "+fr) 47 | } 48 | } 49 | } 50 | }) 51 | log("Testing range: "+f) 52 | testFacetViolation(f,allMyFacets) 53 | allMyFacets.append(f) 54 | } 55 | } 56 | } 57 | def testFacetViolation(f: MyFacet , allMyFacets: collection.Seq[MyFacet]) = { 58 | for (f_p <- allMyFacets) { 59 | if (((f.min <= f_p.max) && (f_p.min <= f.max))) { 60 | throw new IllegalStateException(f + " overlaps with " + f_p + "!") 61 | } 62 | } 63 | } 64 | def log(o: Object) = { 65 | println(o.toString()) 66 | } 67 | class MyFacet { 68 | var min: Int = _ 69 | var max: Int = _ 70 | var id: String = _ 71 | override 72 | def toString(): String = { 73 | return "Facet{" + id + "}[min:" + min + " max:" + max + "]" 74 | } 75 | } -------------------------------------------------------------------------------- /src/sparql/README.md: -------------------------------------------------------------------------------- 1 | # Sparql checks 2 | 3 | [SPARQL](https://www.w3.org/TR/rdf-sparql-query/) is a W3C standard 4 | query language for RDF. This directory contains useful SPARQL queries 5 | for perfoming over the ontology. 6 | 7 | SPARQL can be executed on a triplestore or directly on any OWL 8 | file. The queries here are all executed on either apollo_sv-edit.obo or 9 | downstream products in the [ontology](../ontology/) folder. We use 10 | `robot` as this allows easy execution over any Obo-format or OWL file. 11 | 12 | We break the queries into 3 categories: 13 | 14 | ## Constraint Violation checks 15 | 16 | These are all named `*violation.sparql`. A subset of these are 17 | configured to be executed via travis. If these return any results, 18 | then the build will fail. 19 | 20 | Consult the individual sparql files to see the intent of the check 21 | 22 | ## Construct queries 23 | 24 | These are named `construct*.sparql`, and always have the form `CONSTRUCT ...`. 25 | 26 | These are used to generate new OWL axioms that can be inserted back 27 | into the ontology. 28 | 29 | ## Reports 30 | 31 | The remaining SPARQL queries are for informative purposes. A subset 32 | may be executed with each release. -------------------------------------------------------------------------------- /src/sparql/apollo_sv_terms.sparql: -------------------------------------------------------------------------------- 1 | SELECT DISTINCT ?term 2 | WHERE { 3 | { ?s1 ?p1 ?term . } 4 | UNION 5 | { ?term ?p2 ?o2 . } 6 | FILTER(isIRI(?term) && (STRSTARTS(str(?term), "http://purl.obolibrary.org/obo/APOLLO_SV_"))) 7 | } 8 | -------------------------------------------------------------------------------- /src/sparql/basic-report.sparql: -------------------------------------------------------------------------------- 1 | prefix oio: 2 | prefix def: 3 | prefix owl: 4 | 5 | SELECT ?cls ?def (group_concat(?xref) as ?xrefs) WHERE 6 | { 7 | ?cls a owl:Class . 8 | OPTIONAL { ?cls oio:hasDbXref ?xref } . 9 | OPTIONAL { ?cls def: ?def } . 10 | FILTER (!isBlank(?cls)) 11 | } 12 | GROUP BY ?cls ?def 13 | -------------------------------------------------------------------------------- /src/sparql/class-count-by-prefix.sparql: -------------------------------------------------------------------------------- 1 | prefix owl: 2 | prefix obo: 3 | 4 | SELECT ?prefix (COUNT(DISTINCT ?cls) AS ?numberOfClasses) WHERE 5 | { 6 | ?cls a owl:Class . 7 | FILTER (!isBlank(?cls)) 8 | BIND( STRBEFORE(STRAFTER(str(?cls),"http://purl.obolibrary.org/obo/"), "_") AS ?prefix) 9 | } 10 | GROUP BY ?prefix -------------------------------------------------------------------------------- /src/sparql/edges.sparql: -------------------------------------------------------------------------------- 1 | prefix owl: 2 | prefix rdfs: 3 | prefix rdf: 4 | 5 | SELECT ?x ?p ?y 6 | WHERE { 7 | {?x rdfs:subClassOf [ 8 | a owl:Restriction ; 9 | owl:onProperty ?p ; 10 | owl:someValuesFrom ?y ] 11 | } 12 | UNION { 13 | ?x rdfs:subClassOf ?y . 14 | BIND(rdfs:subClassOf AS ?p) 15 | } 16 | ?x a owl:Class . 17 | ?y a owl:Class . 18 | } 19 | -------------------------------------------------------------------------------- /src/sparql/inject-subset-declaration.ru: -------------------------------------------------------------------------------- 1 | PREFIX : 2 | PREFIX rdf: 3 | PREFIX rdfs: 4 | 5 | INSERT { ?y rdfs:subPropertyOf . } 6 | 7 | WHERE { 8 | ?x ?y . 9 | FILTER(isIRI(?y)) 10 | FILTER(regex(str(?y),"^(http://purl.obolibrary.org/obo/)") || regex(str(?y),"^(http://www.ebi.ac.uk/efo/)") || regex(str(?y),"^(https://w3id.org/biolink/)") || regex(str(?y),"^(http://purl.obolibrary.org/obo)")) 11 | } -------------------------------------------------------------------------------- /src/sparql/inject-synonymtype-declaration.ru: -------------------------------------------------------------------------------- 1 | PREFIX : 2 | PREFIX rdf: 3 | PREFIX rdfs: 4 | 5 | INSERT { ?y rdfs:subPropertyOf . } 6 | 7 | WHERE { 8 | ?x ?y . 9 | FILTER(isIRI(?y)) 10 | FILTER(regex(str(?y),"^(http://purl.obolibrary.org/obo/)") || regex(str(?y),"^(http://www.ebi.ac.uk/efo/)") || regex(str(?y),"^(https://w3id.org/biolink/)") || regex(str(?y),"^(http://purl.obolibrary.org/obo)")) 11 | } -------------------------------------------------------------------------------- /src/sparql/iri-range-violation.sparql: -------------------------------------------------------------------------------- 1 | PREFIX never_in_taxon: 2 | PREFIX present_in_taxon: 3 | PREFIX oboInOwl: 4 | PREFIX dcterms: 5 | PREFIX foaf: 6 | 7 | SELECT ?term ?property ?value 8 | WHERE { 9 | VALUES ?property { 10 | never_in_taxon: 11 | present_in_taxon: 12 | foaf:depicted_by 13 | oboInOwl:inSubset 14 | dcterms:contributor } 15 | ?term ?property ?value . 16 | FILTER(isIRI(?term) && (STRSTARTS(str(?term), "http://purl.obolibrary.org/obo/APOLLO_SV_"))) 17 | FILTER (!isIRI(?value)) 18 | } 19 | 20 | -------------------------------------------------------------------------------- /src/sparql/label-with-iri-violation.sparql: -------------------------------------------------------------------------------- 1 | PREFIX rdfs: 2 | 3 | SELECT ?term ?value 4 | WHERE { 5 | ?term rdfs:label ?value . 6 | FILTER (REGEX(?value, "http[s]?[:]")) 7 | FILTER(isIRI(?term) && (STRSTARTS(str(?term), "http://purl.obolibrary.org/obo/APOLLO_SV_"))) 8 | } 9 | 10 | -------------------------------------------------------------------------------- /src/sparql/labels.sparql: -------------------------------------------------------------------------------- 1 | PREFIX owl: 2 | PREFIX rdf: 3 | PREFIX rdfs: 4 | 5 | SELECT ?x (STR(?lab) AS ?label) WHERE { 6 | ?x rdf:type owl:Class . 7 | OPTIONAL {?x rdfs:label ?lab} 8 | } 9 | ORDER BY ?x 10 | -------------------------------------------------------------------------------- /src/sparql/multiple-replaced_by-violation.sparql: -------------------------------------------------------------------------------- 1 | PREFIX replaced_by: 2 | 3 | SELECT DISTINCT ?entity ?property ?value WHERE { 4 | VALUES ?property { 5 | replaced_by: 6 | } 7 | ?entity ?property ?value1 . 8 | ?entity ?property ?value2 . 9 | FILTER(?value1!=?value2) 10 | BIND(CONCAT(str(?value1), CONCAT("|", str(?value2))) as ?value) 11 | } 12 | 13 | -------------------------------------------------------------------------------- /src/sparql/obsoletes.sparql: -------------------------------------------------------------------------------- 1 | prefix xsd: 2 | PREFIX owl: 3 | PREFIX rdf: 4 | PREFIX rdfs: 5 | PREFIX replaced_by: 6 | PREFIX consider: 7 | 8 | SELECT ?cls ?replCls ?consCls WHERE { 9 | ?cls a owl:Class ; 10 | owl:deprecated "true"^^xsd:boolean . 11 | OPTIONAL {?cls replaced_by: ?replCls} 12 | OPTIONAL {?cls consider: ?consCls} 13 | } 14 | ORDER BY ?cls 15 | -------------------------------------------------------------------------------- /src/sparql/owldef-self-reference-violation.sparql: -------------------------------------------------------------------------------- 1 | PREFIX rdf: 2 | PREFIX oio: 3 | PREFIX owl: 4 | PREFIX rdfs: 5 | 6 | SELECT ?term WHERE { 7 | { ?term owl:equivalentClass [ owl:intersectionOf [ rdf:rest*/rdf:first ?term ] ] } 8 | UNION 9 | { ?term owl:equivalentClass [ owl:intersectionOf [ rdf:rest*/rdf:first [ owl:someValuesFrom ?term ] ] ] } 10 | FILTER(isIRI(?term) && (STRSTARTS(str(?term), "http://purl.obolibrary.org/obo/APOLLO_SV_"))) 11 | } 12 | 13 | -------------------------------------------------------------------------------- /src/sparql/postprocess-module.ru: -------------------------------------------------------------------------------- 1 | PREFIX rdf: 2 | PREFIX rdfs: 3 | PREFIX dc: 4 | PREFIX owl: 5 | 6 | 7 | DELETE { 8 | ?ontology ?ontology_annotation_property ?ontology_annotation_value . 9 | } 10 | 11 | WHERE { 12 | ?ontology rdf:type owl:Ontology . 13 | ?ontology ?ontology_annotation_property ?ontology_annotation_value . 14 | FILTER(?ontology_annotation_property != dc:source && ?ontology_annotation_property != rdf:type) 15 | 16 | } -------------------------------------------------------------------------------- /src/sparql/preprocess-module.ru: -------------------------------------------------------------------------------- 1 | PREFIX rdf: 2 | PREFIX rdfs: 3 | PREFIX dc: 4 | PREFIX owl: 5 | 6 | 7 | #DELETE { 8 | # ?ontology ?ontology_annotation_property ?ontology_annotation_value . 9 | #} 10 | 11 | INSERT { 12 | ?ontology dc:source ?version_iri . 13 | } 14 | 15 | WHERE { 16 | ?ontology rdf:type owl:Ontology ; 17 | owl:versionIRI ?version_iri . 18 | #OPTIONAL { 19 | # ?ontology ?ontology_annotation_property ?ontology_annotation_value . 20 | #} 21 | 22 | } -------------------------------------------------------------------------------- /src/sparql/simple-seed.sparql: -------------------------------------------------------------------------------- 1 | prefix owl: 2 | 3 | SELECT DISTINCT ?cls WHERE 4 | { 5 | {?cls a owl:AnnotationProperty .} 6 | UNION 7 | {?cls a owl:ObjectProperty .} 8 | UNION 9 | {?x ?cls} 10 | UNION 11 | {?x ?cls} 12 | FILTER (!isBlank(?cls)) 13 | } 14 | -------------------------------------------------------------------------------- /src/sparql/subsets-labeled.sparql: -------------------------------------------------------------------------------- 1 | prefix oio: 2 | prefix owl: 3 | prefix inSubset: 4 | prefix rdfs: 5 | 6 | SELECT ?subset ?clsLabel 7 | WHERE 8 | { 9 | ?cls a owl:Class ; 10 | inSubset: ?subset ; 11 | rdfs:label ?clsLabel 12 | } 13 | ORDER BY ?subset ?cls 14 | -------------------------------------------------------------------------------- /src/sparql/synonyms.sparql: -------------------------------------------------------------------------------- 1 | prefix owl: 2 | prefix oboInOwl: 3 | prefix rdfs: 4 | 5 | SELECT ?cls ?pred ?val ?synType 6 | WHERE 7 | { ?cls ?pred ?val ; 8 | a owl:Class . 9 | FILTER ( 10 | ?pred = rdfs:label || 11 | ?pred = oboInOwl:hasRelatedSynonym || 12 | ?pred = oboInOwl:hasNarrowSynonym || 13 | ?pred = oboInOwl:hasBroadSynonym || 14 | ?pred = oboInOwl:hasExactSynonym 15 | ) 16 | 17 | OPTIONAL { 18 | [ 19 | a owl:Axiom ; 20 | owl:annotatedSource ?cls ; 21 | owl:annotatedProperty ?pred ; 22 | owl:annotatedTarget ?val ; 23 | oboInOwl:hasSynonymType ?synType 24 | ] 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/sparql/terms.sparql: -------------------------------------------------------------------------------- 1 | PREFIX rdf: 2 | prefix owl: 3 | SELECT DISTINCT ?term 4 | WHERE { 5 | { 6 | ?s1 ?p1 ?term . 7 | FILTER(?p1!=rdf:type) 8 | } 9 | UNION 10 | { 11 | ?term ?p2 ?o2 . 12 | FILTER(?o2!=owl:Ontology) 13 | } 14 | FILTER(isIRI(?term)) 15 | } -------------------------------------------------------------------------------- /src/sparql/xrefs.sparql: -------------------------------------------------------------------------------- 1 | prefix oio: 2 | prefix owl: 3 | 4 | SELECT ?cls ?xref WHERE 5 | { 6 | ?cls a owl:Class ; 7 | oio:hasDbXref ?xref 8 | } 9 | -------------------------------------------------------------------------------- /src/templates/external_import.tsv: -------------------------------------------------------------------------------- 1 | ID Entity Type 2 | ID TYPE 3 | owl:Thing owl:Class 4 | 5 | --------------------------------------------------------------------------------