diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 000000000..bbcbbe7d6 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,20 @@ +--- +name: Feature request +about: Suggest an idea for this project +title: '' +labels: '' +assignees: '' + +--- + +**Is your feature request related to a problem? Please describe.** +A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] + +**Describe the solution you'd like** +A clear and concise description of what you want to happen. + +**Describe alternatives you've considered** +A clear and concise description of any alternative solutions or features you've considered. + +**Additional context** +Add any other context or screenshots about the feature request here. diff --git a/.github/ISSUE_TEMPLATE/spec_update.md b/.github/ISSUE_TEMPLATE/spec_update.md new file mode 100644 index 000000000..99bf0f36b --- /dev/null +++ b/.github/ISSUE_TEMPLATE/spec_update.md @@ -0,0 +1,25 @@ +--- +name: Propose spec update +about: Update BIDS-prov specification +title: '' +labels: '' +assignees: '' + +--- + +## Update proposal for BIDS Prov (BEP028) + +### Problem Statement +*What type of enhancement ? Is it a `new feature or a modification` ? +What `limitation in the current spec` does this underline ?* + +### Rationale +*What `solution` do you propose ? How does that relate to the original problem ?* + +### Minimal example +*Provide a minimal example with the current spec. +How would this example turn if we `apply the proposed change` ?* + +### Checklist +- [ ] links to related existing [issues](https://github.com/bids-standard/BEP028_BIDSprov/issues) and/or [PR](https://github.com/bids-standard/BEP028_BIDSprov/pulls) + diff --git a/.github/workflows/integration_test.yml b/.github/workflows/integration_test.yml new file mode 100644 index 000000000..58286c675 --- /dev/null +++ b/.github/workflows/integration_test.yml @@ -0,0 +1,27 @@ +name: SPM +on: + pull_request: + paths: 'bids_prov/**' +jobs: + run: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@master + - name: Setup Python + uses: actions/setup-python@master + with: + python-version: 3.7 + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install pytest + pip install -r requirements.txt + - name: Test SPM parser on explicit_mask + run: | + curl -LJO https://raw.githubusercontent.com/incf-nidash/nidmresults-examples/master/spm_explicit_mask/batch.m + python -m bids_prov.spm_parser batch.m -o explicit_mask.json + + - name: Test SPM Parser on groups OLS + run: | + curl -LJO https://raw.githubusercontent.com/incf-nidash/nidmresults-examples/master/spm_group_ols/batch.m + python -m bids_prov.spm_parser batch.m -o ols.json diff --git a/.github/workflows/unit_test.yml b/.github/workflows/unit_test.yml new file mode 100644 index 000000000..fd176db95 --- /dev/null +++ b/.github/workflows/unit_test.yml @@ -0,0 +1,18 @@ +name: tests +on: [pull_request] +jobs: + run: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@master + - name: Setup Python + uses: actions/setup-python@master + with: + python-version: 3.7 + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install pytest + pip install -r requirements.txt + - name: Unit tests + run: pytest bids_prov diff --git a/.gitignore b/.gitignore index be5ebe09f..d45e56933 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,14 @@ **/*.hdr **/*.img +*.gv* +settings.json +**/*.gz +.datalad +**/*.tsv +*.png +*.json +**/*.pyc + +*.DS_Store +*.ipynb_checkpoints + diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 000000000..4186ac89b --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,6 @@ +repos: +- repo: https://github.com/python/black + rev: stable + hooks: + - id: black + language_version: python3.7 diff --git a/LICENSE b/LICENSE new file mode 100644 index 000000000..2fb94156c --- /dev/null +++ b/LICENSE @@ -0,0 +1,396 @@ +Attribution 4.0 International + +======================================================================= + +Creative Commons Corporation ("Creative Commons") is not a law firm and +does not provide legal services or legal advice. Distribution of +Creative Commons public licenses does not create a lawyer-client or +other relationship. Creative Commons makes its licenses and related +information available on an "as-is" basis. Creative Commons gives no +warranties regarding its licenses, any material licensed under their +terms and conditions, or any related information. Creative Commons +disclaims all liability for damages resulting from their use to the +fullest extent possible. + +Using Creative Commons Public Licenses + +Creative Commons public licenses provide a standard set of terms and +conditions that creators and other rights holders may use to share +original works of authorship and other material subject to copyright +and certain other rights specified in the public license below. The +following considerations are for informational purposes only, are not +exhaustive, and do not form part of our licenses. + + Considerations for licensors: Our public licenses are + intended for use by those authorized to give the public + permission to use material in ways otherwise restricted by + copyright and certain other rights. Our licenses are + irrevocable. Licensors should read and understand the terms + and conditions of the license they choose before applying it. + Licensors should also secure all rights necessary before + applying our licenses so that the public can reuse the + material as expected. Licensors should clearly mark any + material not subject to the license. This includes other CC- + licensed material, or material used under an exception or + limitation to copyright. More considerations for licensors: + wiki.creativecommons.org/Considerations_for_licensors + + Considerations for the public: By using one of our public + licenses, a licensor grants the public permission to use the + licensed material under specified terms and conditions. If + the licensor's permission is not necessary for any reason--for + example, because of any applicable exception or limitation to + copyright--then that use is not regulated by the license. Our + licenses grant only permissions under copyright and certain + other rights that a licensor has authority to grant. Use of + the licensed material may still be restricted for other + reasons, including because others have copyright or other + rights in the material. A licensor may make special requests, + such as asking that all changes be marked or described. + Although not required by our licenses, you are encouraged to + respect those requests where reasonable. More considerations + for the public: + wiki.creativecommons.org/Considerations_for_licensees + +======================================================================= + +Creative Commons Attribution 4.0 International Public License + +By exercising the Licensed Rights (defined below), You accept and agree +to be bound by the terms and conditions of this Creative Commons +Attribution 4.0 International Public License ("Public License"). To the +extent this Public License may be interpreted as a contract, You are +granted the Licensed Rights in consideration of Your acceptance of +these terms and conditions, and the Licensor grants You such rights in +consideration of benefits the Licensor receives from making the +Licensed Material available under these terms and conditions. + + +Section 1 -- Definitions. + + a. Adapted Material means material subject to Copyright and Similar + Rights that is derived from or based upon the Licensed Material + and in which the Licensed Material is translated, altered, + arranged, transformed, or otherwise modified in a manner requiring + permission under the Copyright and Similar Rights held by the + Licensor. For purposes of this Public License, where the Licensed + Material is a musical work, performance, or sound recording, + Adapted Material is always produced where the Licensed Material is + synched in timed relation with a moving image. + + b. Adapter's License means the license You apply to Your Copyright + and Similar Rights in Your contributions to Adapted Material in + accordance with the terms and conditions of this Public License. + + c. Copyright and Similar Rights means copyright and/or similar rights + closely related to copyright including, without limitation, + performance, broadcast, sound recording, and Sui Generis Database + Rights, without regard to how the rights are labeled or + categorized. For purposes of this Public License, the rights + specified in Section 2(b)(1)-(2) are not Copyright and Similar + Rights. + + d. Effective Technological Measures means those measures that, in the + absence of proper authority, may not be circumvented under laws + fulfilling obligations under Article 11 of the WIPO Copyright + Treaty adopted on December 20, 1996, and/or similar international + agreements. + + e. Exceptions and Limitations means fair use, fair dealing, and/or + any other exception or limitation to Copyright and Similar Rights + that applies to Your use of the Licensed Material. + + f. Licensed Material means the artistic or literary work, database, + or other material to which the Licensor applied this Public + License. + + g. Licensed Rights means the rights granted to You subject to the + terms and conditions of this Public License, which are limited to + all Copyright and Similar Rights that apply to Your use of the + Licensed Material and that the Licensor has authority to license. + + h. Licensor means the individual(s) or entity(ies) granting rights + under this Public License. + + i. Share means to provide material to the public by any means or + process that requires permission under the Licensed Rights, such + as reproduction, public display, public performance, distribution, + dissemination, communication, or importation, and to make material + available to the public including in ways that members of the + public may access the material from a place and at a time + individually chosen by them. + + j. Sui Generis Database Rights means rights other than copyright + resulting from Directive 96/9/EC of the European Parliament and of + the Council of 11 March 1996 on the legal protection of databases, + as amended and/or succeeded, as well as other essentially + equivalent rights anywhere in the world. + + k. You means the individual or entity exercising the Licensed Rights + under this Public License. Your has a corresponding meaning. + + +Section 2 -- Scope. + + a. License grant. + + 1. Subject to the terms and conditions of this Public License, + the Licensor hereby grants You a worldwide, royalty-free, + non-sublicensable, non-exclusive, irrevocable license to + exercise the Licensed Rights in the Licensed Material to: + + a. reproduce and Share the Licensed Material, in whole or + in part; and + + b. produce, reproduce, and Share Adapted Material. + + 2. Exceptions and Limitations. For the avoidance of doubt, where + Exceptions and Limitations apply to Your use, this Public + License does not apply, and You do not need to comply with + its terms and conditions. + + 3. Term. The term of this Public License is specified in Section + 6(a). + + 4. Media and formats; technical modifications allowed. The + Licensor authorizes You to exercise the Licensed Rights in + all media and formats whether now known or hereafter created, + and to make technical modifications necessary to do so. The + Licensor waives and/or agrees not to assert any right or + authority to forbid You from making technical modifications + necessary to exercise the Licensed Rights, including + technical modifications necessary to circumvent Effective + Technological Measures. For purposes of this Public License, + simply making modifications authorized by this Section 2(a) + (4) never produces Adapted Material. + + 5. Downstream recipients. + + a. Offer from the Licensor -- Licensed Material. Every + recipient of the Licensed Material automatically + receives an offer from the Licensor to exercise the + Licensed Rights under the terms and conditions of this + Public License. + + b. No downstream restrictions. You may not offer or impose + any additional or different terms or conditions on, or + apply any Effective Technological Measures to, the + Licensed Material if doing so restricts exercise of the + Licensed Rights by any recipient of the Licensed + Material. + + 6. No endorsement. Nothing in this Public License constitutes or + may be construed as permission to assert or imply that You + are, or that Your use of the Licensed Material is, connected + with, or sponsored, endorsed, or granted official status by, + the Licensor or others designated to receive attribution as + provided in Section 3(a)(1)(A)(i). + + b. Other rights. + + 1. Moral rights, such as the right of integrity, are not + licensed under this Public License, nor are publicity, + privacy, and/or other similar personality rights; however, to + the extent possible, the Licensor waives and/or agrees not to + assert any such rights held by the Licensor to the limited + extent necessary to allow You to exercise the Licensed + Rights, but not otherwise. + + 2. Patent and trademark rights are not licensed under this + Public License. + + 3. To the extent possible, the Licensor waives any right to + collect royalties from You for the exercise of the Licensed + Rights, whether directly or through a collecting society + under any voluntary or waivable statutory or compulsory + licensing scheme. In all other cases the Licensor expressly + reserves any right to collect such royalties. + + +Section 3 -- License Conditions. + +Your exercise of the Licensed Rights is expressly made subject to the +following conditions. + + a. Attribution. + + 1. If You Share the Licensed Material (including in modified + form), You must: + + a. retain the following if it is supplied by the Licensor + with the Licensed Material: + + i. identification of the creator(s) of the Licensed + Material and any others designated to receive + attribution, in any reasonable manner requested by + the Licensor (including by pseudonym if + designated); + + ii. a copyright notice; + + iii. a notice that refers to this Public License; + + iv. a notice that refers to the disclaimer of + warranties; + + v. a URI or hyperlink to the Licensed Material to the + extent reasonably practicable; + + b. indicate if You modified the Licensed Material and + retain an indication of any previous modifications; and + + c. indicate the Licensed Material is licensed under this + Public License, and include the text of, or the URI or + hyperlink to, this Public License. + + 2. You may satisfy the conditions in Section 3(a)(1) in any + reasonable manner based on the medium, means, and context in + which You Share the Licensed Material. For example, it may be + reasonable to satisfy the conditions by providing a URI or + hyperlink to a resource that includes the required + information. + + 3. If requested by the Licensor, You must remove any of the + information required by Section 3(a)(1)(A) to the extent + reasonably practicable. + + 4. If You Share Adapted Material You produce, the Adapter's + License You apply must not prevent recipients of the Adapted + Material from complying with this Public License. + + +Section 4 -- Sui Generis Database Rights. + +Where the Licensed Rights include Sui Generis Database Rights that +apply to Your use of the Licensed Material: + + a. for the avoidance of doubt, Section 2(a)(1) grants You the right + to extract, reuse, reproduce, and Share all or a substantial + portion of the contents of the database; + + b. if You include all or a substantial portion of the database + contents in a database in which You have Sui Generis Database + Rights, then the database in which You have Sui Generis Database + Rights (but not its individual contents) is Adapted Material; and + + c. You must comply with the conditions in Section 3(a) if You Share + all or a substantial portion of the contents of the database. + +For the avoidance of doubt, this Section 4 supplements and does not +replace Your obligations under this Public License where the Licensed +Rights include other Copyright and Similar Rights. + + +Section 5 -- Disclaimer of Warranties and Limitation of Liability. + + a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE + EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS + AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF + ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS, + IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION, + WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR + PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS, + ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT + KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT + ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU. + + b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE + TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION, + NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT, + INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES, + COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR + USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN + ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR + DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR + IN PART, THIS LIMITATION MAY NOT APPLY TO YOU. + + c. The disclaimer of warranties and limitation of liability provided + above shall be interpreted in a manner that, to the extent + possible, most closely approximates an absolute disclaimer and + waiver of all liability. + + +Section 6 -- Term and Termination. + + a. This Public License applies for the term of the Copyright and + Similar Rights licensed here. However, if You fail to comply with + this Public License, then Your rights under this Public License + terminate automatically. + + b. Where Your right to use the Licensed Material has terminated under + Section 6(a), it reinstates: + + 1. automatically as of the date the violation is cured, provided + it is cured within 30 days of Your discovery of the + violation; or + + 2. upon express reinstatement by the Licensor. + + For the avoidance of doubt, this Section 6(b) does not affect any + right the Licensor may have to seek remedies for Your violations + of this Public License. + + c. For the avoidance of doubt, the Licensor may also offer the + Licensed Material under separate terms or conditions or stop + distributing the Licensed Material at any time; however, doing so + will not terminate this Public License. + + d. Sections 1, 5, 6, 7, and 8 survive termination of this Public + License. + + +Section 7 -- Other Terms and Conditions. + + a. The Licensor shall not be bound by any additional or different + terms or conditions communicated by You unless expressly agreed. + + b. Any arrangements, understandings, or agreements regarding the + Licensed Material not stated herein are separate from and + independent of the terms and conditions of this Public License. + + +Section 8 -- Interpretation. + + a. For the avoidance of doubt, this Public License does not, and + shall not be interpreted to, reduce, limit, restrict, or impose + conditions on any use of the Licensed Material that could lawfully + be made without permission under this Public License. + + b. To the extent possible, if any provision of this Public License is + deemed unenforceable, it shall be automatically reformed to the + minimum extent necessary to make it enforceable. If the provision + cannot be reformed, it shall be severed from this Public License + without affecting the enforceability of the remaining terms and + conditions. + + c. No term or condition of this Public License will be waived and no + failure to comply consented to unless expressly agreed to by the + Licensor. + + d. Nothing in this Public License constitutes or may be interpreted + as a limitation upon, or waiver of, any privileges and immunities + that apply to the Licensor or You, including from the legal + processes of any jurisdiction or authority. + + +======================================================================= + +Creative Commons is not a party to its public +licenses. Notwithstanding, Creative Commons may elect to apply one of +its public licenses to material it publishes and in those instances +will be considered the “Licensor.” The text of the Creative Commons +public licenses is dedicated to the public domain under the CC0 Public +Domain Dedication. Except for the limited purpose of indicating that +material is shared under a Creative Commons public license or as +otherwise permitted by the Creative Commons policies published at +creativecommons.org/policies, Creative Commons does not authorize the +use of the trademark "Creative Commons" or any other trademark or logo +of Creative Commons without its prior written consent including, +without limitation, in connection with any unauthorized modifications +to any of its public licenses or any other arrangements, +understandings, or agreements concerning use of licensed material. For +the avoidance of doubt, this paragraph does not form part of the +public licenses. + +Creative Commons may be contacted at creativecommons.org. + diff --git a/README.md b/README.md index 2cd425669..ea1187346 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,68 @@ -# BIDS-prov +# BEP028 provenance framework for BIDS +This repository contains **BIDS Extension Proposal 028 : BIDS-prov, a provenance framework for BIDS** + +## Our goal +**Interpreting and comparing scientific results** and enabling reusable data and analysis output require understanding provenance, i.e. how the data were generated and processed. To be useful, the provenance must be understandable, easily communicated, and captured automatically in machine accessible form. Provenance records are thus used to encode transformations between digital objects + +### Who is building BEP 028 + +Camille Maumet ([@cmaumet](https://github.com/cmaumet)) and Satrajit Ghosh ([@satra](https://github.com/satra)) are the BEP co-moderators. + +List of all contributors + +- Camille Maumet ([@cmaumet](https://github.com/cmaumet)) +- Satrajit Ghosh ([@satra](https://github.com/satra)) +- Stefan Appelhoff ([@sappelhoff](https://github.com/sappelhoff)) +- Chris Markiewicz ([@effigies](https://github.com/effigies)) +- Yaroslav Halchenko ([@yarikoptic](https://github.com/yarikoptic)) +- Jean-Baptiste Poline ([@jbpoline](https://github.com/jbpoline)) +- Rémi Adon ([@remiadon](https://github.com/remiadon)) + +### BIDS-prov in the NIDM project + +The Neuroimaging Data Model (NIDM) is a collection of specification documents that define extensions the `W3C PROV` standard for the domain of human brain mapping + +

+ +

+ +BIDS-prov is a BIDS extension that is compatible with NIDM. + + + +## How to help +[Our goal](#our-goal) is to extends BIDS to be able to track provenance at every stage of an experiment. + +For this purpose we have to **propose changes to the BIDS specification** + +The BIDS specification is *rendered* as a webpage at https://bids-specification.readthedocs.io. + +The website is built from a GitHub repository that consists of mostly markdown files at https://github.com/bids-standard/bids-specification. +If you don't know much about markdown, here's a [good intro guide](https://guides.github.com/features/mastering-markdown/) + +The file that you are most likely to propose changes to is [src/03-modality-agnostic-files.md](https://github.com/bids-standard/bids-specification/blob/master/src/03-modality-agnostic-files.md), although there may be additional changes that have to happen in other pars of the repository + + +## Finding information and getting in touch + +### Google doc +The BEP028 is in a [google doc](https://docs.google.com/document/d/1vw3VNDof5cecv2PkFp7Lw_pNUTUo8-m8V4SIdtGJVKs/edit?usp=sharing) + +### NIDM weekly calls +We meet every two weeks by videoconference on Mondays at 7-8am PDT / 10am-11am EDT / 3-4pm BST. The group is always open to new contributors interested in neuroimaging data sharing. To join the call or to ask any question, please email us at incf-nidash-nidm@googlegroups.com. + +## Additional resources +Mature building blocks of NIDM: +* [NIDM-terms](https://github.com/incf-nidash/nidm-terms) +* [NIDM-results](http://nidm.nidash.org/specs/nidm-results_130.html) + + +[New features (to be included)](new_features.md) + + +## Code of conduct +We are committed to building a welcoming and harrasement free experience for all our contributors. As a contributor to the BIDS-Prov specification, we ask you to follow our [code of conduct](code_of_conduct.md) + + +_Credits: This README was build based on the [BEP001 README](https://github.com/bids-standard/bep001/blob/master/README.md)._ diff --git a/bids_prov/README.md b/bids_prov/README.md new file mode 100644 index 000000000..f05952070 --- /dev/null +++ b/bids_prov/README.md @@ -0,0 +1,27 @@ +## CLI scripts for BIDS PROV + +### Notes +All scripts provide a `--help` flag, to get an overview of possible parameters and default values +Here is an example +```bash +>> python -m bids_prov.visualize --help +Usage: visualize.py [OPTIONS] [FILENAMES]... + +Options: + -o, --output_file TEXT + --omit-details omit the following low level details : {'Activity': + ('startedAtTime', 'endedAtTime'), 'Entity': + ('atLocation', 'generatedAt')} + + --help Show this message and exit. +``` + +```bash +>> python -m bids_prov.spm_parser --help +Usage: spm_parser.py [OPTIONS] [FILENAMES]... + +Options: + -o, --output-file TEXT [required] + -c, --context-url TEXT + --help Show this message and exit. +``` \ No newline at end of file diff --git a/bids_prov/__init__.py b/bids_prov/__init__.py new file mode 100644 index 000000000..ae9134cfc --- /dev/null +++ b/bids_prov/__init__.py @@ -0,0 +1,4 @@ +import string +import random + +get_id = lambda: "".join(random.choice(string.ascii_letters) for i in range(10)) diff --git a/bids_prov/spm_config.yml b/bids_prov/spm_config.yml new file mode 100644 index 000000000..a53da8962 --- /dev/null +++ b/bids_prov/spm_config.yml @@ -0,0 +1,6 @@ +activities: + spatial.preproc: + name: segment + outputs: + - c1xxx.nii.gz + - c2xxx.nii.gz diff --git a/bids_prov/spm_load_config.py b/bids_prov/spm_load_config.py new file mode 100644 index 000000000..60a4584ae --- /dev/null +++ b/bids_prov/spm_load_config.py @@ -0,0 +1,49 @@ +import re +import yaml +import os + +import os + +this_path = os.path.dirname(os.path.abspath(__file__)) + +PATH_REGEX = r"([A-Za-z]:|[A-Za-z0-9_-]+(\.[A-Za-z0-9_-]+)*)((/[A-Za-z0-9_.-]+)+)" +PARAM_REGEX = r"[^\.]+\(\d+\)" +FILE_REGEX = r"(\.[a-z]{1,3}){1,2}" +DEPENDENCY_REGEX = r"""cfg_dep\(['"]([^'"]*)['"]\,.*""" # TODO : add ": " in match + +has_parameter = lambda line: next(re.finditer(PARAM_REGEX, line), None) is not None +# has_entity = lambda line: not has_parameter(line) and next(re.finditer(PATH_REGEX, line), None) is not None + +CONTEXT_URL = "https://raw.githubusercontent.com/cmaumet/BIDS-prov/context-type-indexing/context.json" + +with open(this_path + "/spm_config.yml", "r") as fd: + static = yaml.load(fd) + + +def get_empty_graph(context_url=CONTEXT_URL): + return { + "@context": context_url, + "@id": "http://example.org/ds00000X", + "generatedAt": "2020-03-10T10:00:00", + "wasGeneratedBy": { + "@id": "INRIA", + "@type": "Project", + "startedAt": "2016-09-01T10:00:00", + "wasAssociatedWith": { + "@id": "NIH", + "@type": "Organization", + "hadRole": "Funding", + }, + }, + "records": { + "prov:Agent": [ + { + "@id": "RRID:SCR_007037", # TODO query for version + "@type": "prov:SoftwareAgent", + "label": "SPM", + } + ], + "prov:Activity": [], + "prov:Entity": [], + }, + } diff --git a/bids_prov/spm_parser.py b/bids_prov/spm_parser.py new file mode 100644 index 000000000..84dfe284f --- /dev/null +++ b/bids_prov/spm_parser.py @@ -0,0 +1,234 @@ +import sys +import click +import json +import os +import re +from difflib import SequenceMatcher + +from collections import defaultdict + +from . import spm_load_config as conf +from . import get_id + + +def format_activity_name(s, l=30): + if s.startswith("spm."): + s = s[4:] + tmp = s.split(".") + while sum(map(len, tmp)) > l: + tmp = tmp[1:] + return ".".join(tmp) + + +def get_input_entity(left, right): + """get input Entity if possible else return None + + left: string + left side of ' = ' + right: string + right side of ' = ' + """ + if conf.has_parameter(left): + return None + if not next(re.finditer(conf.PATH_REGEX, right), None): + return None + + if next(re.finditer(conf.FILE_REGEX, right), None) is None: + return None + + entity_label = re.sub(r"[{};\'\"]", "", right).split("/")[-1] + entity = { + "@id": "niiri:" + entity_label + get_id(), + "label": entity_label, + "prov:atLocation": right[2:-3], + } + return entity + + +def preproc_param_value(val): + if val[0] == "[": + return val.replace(" ", ", ") + return val + + +def readlines(filename): + """Read lines from the original batch.m file + + A definition should be associated with a single line in the output + """ + with open(filename) as fd: + for line in fd: + if line.startswith("matlabbatch"): + _line = line[:-1] + while _line.count("{") != _line.count("}"): + _line += next(fd, "} ")[:-1].lstrip() + "," + yield _line # remove "\n" + + +def group_lines(lines): + """Group line by their activity id + + The activity id is between curly brackets, for every line + + Parameters + ---------- + lines: iterable[str] + lines to be grouped, where every element is a python string + + Returns + ------- + dict[int, str] + a mapping from activity id to lines belonging to this activity + + Example + ------- + >>> from bids_prov.spm_parser import group_lines + >>> lines = ["batch{1}.file_ops.file_move.call", "batch{1}.file_ops.file_move.different.call"] + >>> group_lines(lines) + {'file_ops.file_move._1': ['call', 'different.call']} + """ + res = defaultdict(list) + for line in lines: + a = re.search(r"\{\d+\}", line) + if a: + g = a.group()[1:-1] + res[g].append(line[a.end() + 1 :]) + + new_res = dict() + for k, v in res.items(): + common_prefix = os.path.commonprefix([_.split(" = ")[0] for _ in v]) + new_key = f"{common_prefix}_{k}" + new_res[new_key] = [_[len(common_prefix) :] for _ in v] + return new_res + + +def get_records(task_groups: dict, records=defaultdict(list)): + """Take the result of `group_lines` and output the corresponding + JSON-ld graph as a python dict + + See Also + -------- + bids_prov.spm_parser.group_lines + """ + entities_ids = set() + for activity_name, values in task_groups.items(): + activity_id = "niiri:" + activity_name + get_id() + activity = { + "@id": activity_id, + "label": format_activity_name(activity_name), + "used": list(), + "wasAssociatedWith": "RRID:SCR_007037", + } + input_entities, output_entities = list(), list() + params = [] + + conf_outputs = next( + (k for k in conf.static["activities"] if k in activity_name), None + ) + if conf_outputs is not None: + conf_outputs = conf.static["activities"][conf_outputs] + activity_name = conf_outputs["name"] # FIXME ? discuss + for output in conf_outputs["outputs"]: + output_entities.append( + { + "@id": output + get_id(), + "label": output, + "prov:atLocation": output, + "wasGeneratedBy": activity_id, + } + ) + + for line in values: + split = line.split(" = ") + if len(split) != 2: + print(f"could not parse {line}") + continue + left, right = split + + _in = get_input_entity(left, right) + if _in: + input_entities.append(_in) + elif conf.has_parameter(left) or conf.has_parameter(activity_name): + dependency = re.search(conf.DEPENDENCY_REGEX, right, re.IGNORECASE) + dep_number = re.search(r"{(\d+)}", right) + if dependency is not None: + parts = dependency.group(1).split(": ") + closest_activity = next( + filter( + lambda a: a["label"].endswith(dep_number.group(1)), + records["prov:Activity"], + ), + None, + ) + if closest_activity is None: + continue + output_id = ( + "niiri:" + parts[-1].replace(" ", "") + dep_number.group(1) + ) + activity["used"].append(output_id) + output_entities.append( + { + "@id": output_id, + "label": parts[-1], + # "prov:atLocation": TODO + "wasGeneratedBy": closest_activity["@id"], + # + } + ) + else: + Warning(f"Could not parse line {line}") + else: + param_name = ".".join(left.split(".")[-2:]) + param_value = preproc_param_value(right[:-1]) + + # HANDLE STRUCTS eg. struct('name', {}, 'onset', {}, 'duration', {}) + if param_value.startswith("struct"): + continue # TODO handle dictionary-like parameters + + try: + eval(param_value) + except: + Warning(f"could not set {param_name} to {param_value}") + continue + finally: + params.append([param_name, param_value]) + + if input_entities: + used_entities = [e["@id"] for e in input_entities] + activity["used"] = activity["used"] + used_entities + entities = input_entities + output_entities + if params: + activity["attributes"] = params + records["prov:Activity"].append(activity) + for e in entities: + if e["@id"] not in entities_ids: + records["prov:Entity"].append(e) + entities_ids.add(e["@id"]) + + return records + + +@click.command() +@click.argument("filenames", nargs=-1) +@click.option("--output-file", "-o", required=True) +@click.option( + "--context-url", + "-c", + default=conf.CONTEXT_URL, +) +def spm_to_bids_prov(filenames, output_file, context_url): + filename = filenames[0] # FIXME + + graph = conf.get_empty_graph(context_url=context_url) + + lines = readlines(filename) + tasks = group_lines(lines) + records = get_records(tasks) + graph["records"].update(records) + + with open(output_file, "w") as fd: + json.dump(graph, fd, indent=2) + + +if __name__ == "__main__": + sys.exit(spm_to_bids_prov()) diff --git a/bids_prov/tests/__init__.py b/bids_prov/tests/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/bids_prov/tests/test_spm_parser.py b/bids_prov/tests/test_spm_parser.py new file mode 100644 index 000000000..40c166782 --- /dev/null +++ b/bids_prov/tests/test_spm_parser.py @@ -0,0 +1,39 @@ +import pytest +import json + +from ..spm_load_config import DEPENDENCY_REGEX +from ..spm_parser import get_records +import re + + +def test_get_records_copy_attributes(): + task_groups = dict( + file_ops_1=[ + ".files = {'$PATH-TO-NII-FILES/tonecounting_bold.nii.gz'};", + ".action.copyto = {'$PATH-TO-PREPROCESSING/FUNCTIONAL'};", + ] + ) + recs = get_records(task_groups) + attrs = [_["attributes"] for _ in recs["prov:Activity"]] + assert "action.copyto" in json.dumps(attrs) + + +def test_get_records_attrs(): + task_groups = dict( + estwrite_5=[ + ".sep = 4;", + ".fwhm = 5;", + ] + ) + recs = get_records(task_groups) + attrs = [_["attributes"] for _ in recs["prov:Activity"]] + assert "4" in json.dumps(attrs) + + +def test_dep_regex(): + s = """ + cfg_dep('Normalise: Write: Normalised Images (Subj 1)', + substruct('.','val', '{}',{8}, '.','val', '{}',{1}, '.','val', '{}',{1}, '.','val', + '{}',{1}), substruct('()',{1}, '.','files')); + """ + assert re.search(DEPENDENCY_REGEX, s, re.IGNORECASE) is not None diff --git a/bids_prov/visualize.py b/bids_prov/visualize.py new file mode 100644 index 000000000..573bfa530 --- /dev/null +++ b/bids_prov/visualize.py @@ -0,0 +1,114 @@ +""" +A Command Line Interface to generate `graphviz` graphs from bids-prov JSON-ld files + +This facilitates debugging and design of the specifications +""" + +import click +from graphviz import Digraph +import json + +from prov.model import ProvDocument +from prov.dot import prov_to_dot +import requests +import os + +import rdflib as rl +import pyld as ld +import json + +from collections import defaultdict +import warnings + +OPTIONAL_FIELDS = dict( # fields to omit if `--high-level` flag activated + Activity=("startedAtTime", "endedAtTime"), + Entity=("atLocation", "generatedAt"), +) + +def viz_turtle(source=None, content=None, img_file=None, **kwargs): + prov_doc = ProvDocument.deserialize(source=source, content=content, format='rdf', rdf_format='turtle') + + # TODO : show attributes has optional arg + dot = prov_to_dot(prov_doc, use_labels=True, show_element_attributes=False, show_relation_attributes=False) + dot.write_png(img_file) + + +def viz_jsonld11(jsonld11, img_file): + """ + jsonld11: dict + a dictionary containing jsonld data, + usually obtained by calling `json.load` + img_file: str + output path + """ + req_context_11 = requests.get(url=jsonld11['@context']) + context_11 = req_context_11.json() + + context_10 = {k: v for k,v in context_11['@context'].items() if k not in {'@version', 'records'}} + + # Load graph from json-ld file as non 1.1 JSON-LD + aa=ld.jsonld.compact(jsonld11, context_10) + + g = rl.ConjunctiveGraph() + g.parse(data=json.dumps(aa, indent=2), format='json-ld') + + viz_turtle(content=g.serialize(format='turtle').decode(), img_file=img_file) + + +def join_jsonld(lds, graph_key="records", omit_details=True): + """ + lds: list of dict + jsonld graphs to be joined + + omit_details: bool, default: True + omit low level details like datetimes and paths + Notes: assumes graph is typed indexed + """ + ctx = set((_['@context'] for _ in lds)) + if not len(ctx) == 1: + raise ValueError(f"jsonlds should have a common context, found {ctx}") + payload = {"@context" : next(iter(ctx)), graph_key : defaultdict(list)} + for idx, ld in enumerate(lds, start=1): + graph = ld.get(graph_key, dict()) + if not graph: + warnings.warn(f"no graph found in jsonld file number {idx}") + for _type, values in graph.items(): + if omit_details and _type[5:] in OPTIONAL_FIELDS.keys(): + values = [ + {k: d[k] for k in d if k not in OPTIONAL_FIELDS.get(_type[5:], tuple())} + for d in values + ] + payload[graph_key][_type].extend(values) # FIXME check for duplicated defs + + if not payload[graph_key]: + warnings.warn( + f"could not found any {graph_key} section in the jsonlds" + ) + #payload[graph_key]] = dict(payload[graph_key]]) + return payload + + + +@click.command() +@click.argument('filenames', nargs=-1) +@click.option('--output_file', '-o', default='') +@click.option('--omit-details', is_flag=True, + help=f"""omit the following low level details : {OPTIONAL_FIELDS}""") +def main(filenames, output_file, omit_details): + jsonld11s = list() + for filename in filenames: + with open(filename) as fd: + ld = json.load(fd) + jsonld11s.append(ld) + + # join multiple definitions + jsonld11 = join_jsonld(jsonld11s, omit_details=omit_details) + + if not output_file: + output_file = os.path.splitext(filename)[0] + '.png' + + viz_jsonld11(jsonld11, output_file) + + +if __name__ == '__main__': + main() \ No newline at end of file diff --git a/code_of_conduct.md b/code_of_conduct.md new file mode 100644 index 000000000..7354b4b9a --- /dev/null +++ b/code_of_conduct.md @@ -0,0 +1,127 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +We as members, contributors, and leaders pledge to make participation in our +community a harassment-free experience for everyone, regardless of age, body +size, visible or invisible disability, ethnicity, sex characteristics, gender +identity and expression, level of experience, education, socio-economic status, +nationality, personal appearance, race, religion, or sexual identity +and orientation. + +We pledge to act and interact in ways that contribute to an open, welcoming, +diverse, inclusive, and healthy community. + +## Our Standards + +Examples of behavior that contributes to a positive environment for our +community include: + +- Demonstrating empathy and kindness toward other people +- Being respectful of differing opinions, viewpoints, and experiences +- Giving and gracefully accepting constructive feedback +- Accepting responsibility and apologizing to those affected by our mistakes, + and learning from the experience +- Focusing on what is best not just for us as individuals, but for the + overall community + +Examples of unacceptable behavior include: + +- The use of sexualized language or imagery, and sexual attention or + advances of any kind +- Trolling, insulting or derogatory comments, and personal or political attacks +- Public or private harassment +- Publishing others' private information, such as a physical or email + address, without their explicit permission +- Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Enforcement Responsibilities + +Community leaders are responsible for clarifying and enforcing our standards of +acceptable behavior and will take appropriate and fair corrective action in +response to any behavior that they deem inappropriate, threatening, offensive, +or harmful. + +Community leaders have the right and responsibility to remove, edit, or reject +comments, commits, code, wiki edits, issues, and other contributions that are +not aligned to this Code of Conduct, and will communicate reasons for moderation +decisions when appropriate. + +## Scope + +This Code of Conduct applies within all community spaces, and also applies when +an individual is officially representing the community in public spaces. +Examples of representing our community include using an official e-mail address, +posting via an official social media account, or acting as an appointed +representative at an online or offline event. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported to the community leaders responsible for enforcement at these email addresses. +All complaints will be reviewed and investigated promptly and fairly. + +All community leaders are obligated to respect the privacy and security of the +reporter of any incident. + +## Enforcement Guidelines + +Community leaders will follow these Community Impact Guidelines in determining +the consequences for any action they deem in violation of this Code of Conduct: + +### 1. Correction + +**Community Impact**: Use of inappropriate language or other behavior deemed +unprofessional or unwelcome in the community. + +**Consequence**: A private, written warning from community leaders, providing +clarity around the nature of the violation and an explanation of why the +behavior was inappropriate. A public apology may be requested. + +### 2. Warning + +**Community Impact**: A violation through a single incident or series +of actions. + +**Consequence**: A warning with consequences for continued behavior. No +interaction with the people involved, including unsolicited interaction with +those enforcing the Code of Conduct, for a specified period of time. This +includes avoiding interactions in community spaces as well as external channels +like social media. Violating these terms may lead to a temporary or +permanent ban. + +### 3. Temporary Ban + +**Community Impact**: A serious violation of community standards, including +sustained inappropriate behavior. + +**Consequence**: A temporary ban from any sort of interaction or public +communication with the community for a specified period of time. No public or +private interaction with the people involved, including unsolicited interaction +with those enforcing the Code of Conduct, is allowed during this period. +Violating these terms may lead to a permanent ban. + +### 4. Permanent Ban + +**Community Impact**: Demonstrating a pattern of violation of community +standards, including sustained inappropriate behavior, harassment of an +individual, or aggression toward or disparagement of classes of individuals. + +**Consequence**: A permanent ban from any sort of public interaction within +the community. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], +version 2.0, available at +https://www.contributor-covenant.org/version/2/0/code_of_conduct.html. + +Community Impact Guidelines were inspired by [Mozilla's code of conduct +enforcement ladder](https://github.com/mozilla/diversity). + +[homepage]: https://www.contributor-covenant.org + +For answers to common questions about this code of conduct, see the FAQ at +https://www.contributor-covenant.org/faq. Translations are available at +https://www.contributor-covenant.org/translations. diff --git a/context.json b/context.json new file mode 100644 index 000000000..4e8c5dd4d --- /dev/null +++ b/context.json @@ -0,0 +1,38 @@ +{ + "@context": { + "@version": 1.1, + "records": { + "@container": "@type", + "@id": "@graph" + }, + "prov" : "http://www.w3.org/ns/prov#", + "xsd": "http://www.w3.org/2001/XMLSchema#", + "label": "http://www.w3.org/2000/01/rdf-schema#label", + "startedAtTime" : { + "@id": "http://www.w3.org/ns/prov#startedAtTime", + "@type": "http://www.w3.org/2001/XMLSchema#dateTime" + }, + "endedAtTime" : { + "@id": "http://www.w3.org/ns/prov#endedAtTime", + "@type": "http://www.w3.org/2001/XMLSchema#dateTime" + }, + "wasGeneratedBy" : { + "@id": "http://www.w3.org/ns/prov#wasGeneratedBy", + "@type": "http://www.w3.org/2001/XMLSchema#Entity" + }, + "wasAssociatedWith" : { + "@id": "http://www.w3.org/ns/prov#wasAssociatedWith", + "@type": "http://www.w3.org/2001/XMLSchema#Agent" + }, + "wasInformedBy" : { + "@id": "http://www.w3.org/ns/prov#wasInformedBy", + "@type": "http://www.w3.org/2001/XMLSchema#Activity" + }, + "used" : { + "@id": "http://www.w3.org/ns/prov#used", + "@type": "http://www.w3.org/2001/XMLSchema#Entity" + } + } +} + + diff --git a/contributing.md b/contributing.md new file mode 100644 index 000000000..5fefa0ff7 --- /dev/null +++ b/contributing.md @@ -0,0 +1,26 @@ +## Contributing guidelines + + +### Structure of a proposal +Here is how a proposal should be structured for easier reviewing and discussions + +* **Proposal and rationale behind**, in the form of a *``proposal file``*. This file should explain what change it is proposing and provide a **justification for the change**. +* **An example** and its dedicated subfolder in the `examples/` folder + + +### Avoid big pull requests + +We could do all our work in a branch of the main [bids-specification](https://github.com/bids-standard/bids-specification) repository. +We would be able to see how our proposed changes affected the current version of the specification by opening a [pull request](https://help.github.com/articles/about-pull-requests/). + +However, there are quite a few changes to make, and quite a lot of conversation to have around each of them, so our proposed way of working is to **break up the individual changes into manageable chunks**. + + +### Create the pull request + +[BEP028](https://github.com/bids-standard/bids-specification/pull/487) has a [dedicated branch](https://github.com/bids-standard/bids-specification/tree/bep-028) on the [bids-specification repository](https://github.com/bids-standard/bids-specification). + +**Contributing to the BEP028 requires creating a pull request to be merged to this branch** + +There will then be some wrangling to make the one big pull request to the bids-specification. +We'll cross that bridge when we come to it! :sparkles: diff --git a/dev-requirements.txt b/dev-requirements.txt new file mode 100644 index 000000000..81fc38ce7 --- /dev/null +++ b/dev-requirements.txt @@ -0,0 +1,2 @@ +black +pre-commit diff --git a/examples/auditory_fmri/coregistration.json b/examples/auditory_fmri/coregistration.json deleted file mode 100644 index 1c4799b71..000000000 --- a/examples/auditory_fmri/coregistration.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "@context": "https://some/url/to/bids_context.jsonld", - "@id": "http://example.org/ds00000X", - "generatedAt": "2020-01-10T10:00:00", - "wasGeneratedBy": { - "@id": "INRIA", - "@type": "Project", - "startedAt": "2016-09-01T10:00:00", - "wasAssociatedWith": { "@id": "NIH", - "@type": "Organization", - "hadRole": "Funding" - } - }, - "@graph": [ - { - "@id": "$HOME/neuro_epx0/fM00223/meanfM0023_016.img", - "@type": "Entity", - "@subtype" : "Metadata??", - "value": "1222222222222...", - "derivedFrom": "$HOME/neuro_exp0/meanfM0023_016.img", - "attributedTo": "SPM", - "generatedBy" : "Realignement", - "generatedAt": "2019-01-10T10:00:00" - }, - { - "@id": "Realignement", - "@type": "Activity", - "used": "$HOME/neuro_exp0/fM00223/fM00223_0*.img", - "wasAssociatedWith": "SPM", - "startTime": "2019-01-10T10:00:00", - "endTime": "2019-01-10T11:00:00" - }, - { - "@id": "SPM", - "@type": "Agent", - "@subtype" : "SoftwareAgent", - "version": "12.0.0" - } - ] -} diff --git a/examples/auditory_fmri/realignement.json b/examples/auditory_fmri/realignement.json deleted file mode 100644 index ecedaff59..000000000 --- a/examples/auditory_fmri/realignement.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "@context": "https://some/url/to/bids_context.jsonld", - "@id": "http://example.org/ds00000X", - "generatedAt": "2020-01-10T10:00:00", - "wasGeneratedBy": { - "@id": "INRIA", - "@type": "Project", - "startedAt": "2016-09-01T10:00:00", - "wasAssociatedWith": { "@id": "NIH", - "@type": "Organization", - "hadRole": "Funding" - } - }, - "@graph": [ - { - "@id": "$HOME/neuro_epx0/fM00223/fM00223_0*.hdr", - "@type": "Entity", - "@subtype" : "ImageHeader", - "value": "1441231221ab4534...", - "derivedFrom": "$HOME/neuro_exp/fM00223/fM00223_0*.img", - "attributedTo": "SPM", - "generatedBy" : "Realignement", - "generatedAt": "2019-01-10T10:00:00" - }, - { - "@id": "$HOME/neuro_epx0/fM00223/rp_fm00223_016.txt", - "@type": "Entity", - "@subtype" : "Metadata??", - "value": "1222222222222...", - "derivedFrom": "$HOME/neuro_exp/fM00223/fM00223_0*.img", - "attributedTo": "SPM", - "generatedBy" : "Realignement", - "generatedAt": "2019-01-10T10:00:00" - }, - { - "prov@location" : "", - "@id": "$HOME/neuro_epx0/fM00223/meanfM0023_016.txt", - "@type": "Entity", - "@subtype" : "Image", - "sha": "1222333...", - "derivedFrom": "$HOME/neuro_exp/fM00223/fM00223_0*.img", - "attributedTo": "SPM", - "generatedBy" : "Realignement", - "generatedAt": "2019-01-10T10:00:00" - }, - { - "@id": "Realignement", - "@type": "Activity", - "used": "$HOME/neuro_exp/fM00223/fM00223_0*.img", - "associatedWith": "SPM", - "startTime": "2019-01-10T10:00:00", - "endTime": "2019-01-10T11:00:00" - }, - { - "@id": "SPM", - "@type": "Agent", - "@subtype" : "SoftwareAgent", - "version": "12.0.0" - }, - { - "@id": "realign.mat", - "@type": "Agent", - "@subtype" : "CommandLineInterface", - "version": "???", - "actedOnBehalfOf": "SPM" - } - ] -} diff --git a/examples/fmriprep/simple.json b/examples/fmriprep/simple.json new file mode 100644 index 000000000..e04b4d41a --- /dev/null +++ b/examples/fmriprep/simple.json @@ -0,0 +1,35 @@ +{ + "@context": "https://raw.githubusercontent.com/cmaumet/BIDS-prov/context-type-indexing/context.json", + "records": { + "prov:Agent": [ + { + "@id": "RRID:SCR_002823", + "@type": "prov:SoftwareAgent", + "label": "FSL mcflirt" + }, + { + "@id": "RRID:SCR_016216", + "@type": "prov:SoftwareAgent", + "label": "fMRIprep" + } + ], + "prov:Activity": [ + { + "@id": "niiri:1489292_call", + "label": "fMRIprep process", + "wasAssociatedWith": "RRID:SCR_016216", + "startedAtTime": "2019-10-10T10:00:00", + "endedAtTime": "2019-10-10T10:00:00" + } + ], + "prov:Entity": [ + { + "@id": "niiri:dsk100010", + "label": "preprocessed functional images", + "prov:atLocation": "niiri:bids-input-dir/T1/*.nii.gz", + + "wasGeneratedBy": "niiri:1489292_call" + } + ] + } +} \ No newline at end of file diff --git a/examples/fmriprep/simple.png b/examples/fmriprep/simple.png new file mode 100644 index 000000000..3d621fbd1 Binary files /dev/null and b/examples/fmriprep/simple.png differ diff --git a/examples/fmriprep/structural_MRI_doc.png b/examples/fmriprep/structural_MRI_doc.png new file mode 100644 index 000000000..495944611 Binary files /dev/null and b/examples/fmriprep/structural_MRI_doc.png differ diff --git a/examples/fsl_default/default.json b/examples/fsl_default/default.json new file mode 100644 index 000000000..8e1c5c70f --- /dev/null +++ b/examples/fsl_default/default.json @@ -0,0 +1,101 @@ +{ + "@context": "https://raw.githubusercontent.com/cmaumet/BIDS-prov/context-type-indexing/context.json", + "records": { + "prov:Agent": [ + { + "@id": "RRID:SCR_002823", + "@type": "prov:SoftwareAgent", + "label": "FSL" + } + ], + "prov:Activity": [ + { + "@id": "niiri:sqlspspsppsp20202", + "label": "mcflirt", + "wasAssociatedWith": "RRID:SCR_002823", + "startedAtTime": "2019-10-10T10:00:00", + "endedAtTime": "2019-10-10T10:00:00", + "used": "niiri:dskjn1902" + }, + { + "@id": "niiri:qndjnqndnfsdnfnsdf_registration", + "label": "registration", + "wasAssociatedWith": "RRID:SCR_002823", + "startedAtTime": "2019-10-10T10:00:00", + "endedAtTime": "2019-10-10T10:00:00", + "used": "niiri:ksdqndns100201", + "prov:wasInfluencedBy": "niiri:fsqjklnfqljnfnfnnf_unwarp" + }, + { + "@id": "niiri:fsqjklnfqljnfnfnnf_unwarp", + "label": "unwarp", + "wasAssociatedWith": "RRID:SCR_002823", + "startedAtTime": "2019-10-10T10:00:00", + "endedAtTime": "2019-10-10T10:00:00", + "used": "niiri:ksdqndns100201", + "prov:wasInfluencedBy": "niiri:qndjnqndnfsdnfnsdf_registration" + }, + { + "@id": "niiri:fsqjklnfqljnfnfnnf_prestats", + "label": "prestats", + "wasAssociatedWith": "RRID:SCR_002823", + "startedAtTime": "2019-10-10T10:00:00", + "endedAtTime": "2019-10-10T10:00:00", + "used": "niiri:vbvbbvbv_undistorted_func" + }, + { + "@id": "niiri:fsqjklnfqljnfnfnnf_stats", + "label": "stats", + "wasAssociatedWith": "RRID:SCR_002823", + "startedAtTime": "2019-10-10T10:00:00", + "endedAtTime": "2019-10-10T10:00:00", + "used": [ + "niiri:dfsjnsqkdfnjsn_prestats_output", + "niiri:dfsjnsqkdfnjsn_contrasts", + "niiri:dfsjnsqkdfnjsn_design_matrix" + ] + } + ], + "prov:Entity": [ + { + "@id": "niiri:dskjn1902", + "label": "functional", + "prov:atLocation": "niiri:TODO", + + }, + { + "@id": "niiri:ksdqndns100201", + "label": "Aligned functional", + "prov:atLocation": "niiri:TODO", + + "wasGeneratedBy": "niiri:sqlspspsppsp20202" + }, + { + "@id": "niiri:vbvbbvbv_undistorted_func", + "label": "un-distorted functional", + "prov:atLocation": "niiri:TODO", + + "wasGeneratedBy": "niiri:fsqjklnfqljnfnfnnf_unwarp" + }, + { + "@id": "niiri:dfsjnsqkdfnjsn_contrasts", + "label": "contrasts", + "prov:atLocation": "niiri:TODO", + + }, + { + "@id": "niiri:dfsjnsqkdfnjsn_design_matrix", + "label": "Design matrix", + "prov:atLocation": "niiri:TODO", + + }, + { + "@id": "niiri:dfsjnsqkdfnjsn_prestats_output", + "label": "Prestats output", + "prov:atLocation": "TODO", + + "wasGeneratedBy": "niiri:fsqjklnfqljnfnfnnf_prestats" + } + ] + } +} diff --git a/examples/fsl_default/fsl_default.png b/examples/fsl_default/fsl_default.png new file mode 100644 index 000000000..677f88287 Binary files /dev/null and b/examples/fsl_default/fsl_default.png differ diff --git a/examples/fsl_default/group_analysis.json b/examples/fsl_default/group_analysis.json new file mode 100644 index 000000000..6bfa689f3 --- /dev/null +++ b/examples/fsl_default/group_analysis.json @@ -0,0 +1,35 @@ +{ + "@context": "https://raw.githubusercontent.com/cmaumet/BIDS-prov/context-type-indexing/context.json", + "records": { + "prov:Agent": [ + { + "@id": "RRID:SCR_002823", + "@type": "prov:SoftwareAgent", + "label": "FSL" + } + ], + "prov:Entity": [ + { + "@id": "niiri:rezoiurozeiuriozuro", + "label": "Transformation files", + "prov:atLocation": "niiri:TODO", + + "wasGeneratedBy": "niiri:qndjnqndnfsdnfnsdf_registration" + }, + { + "@id": "niiri:dfsjnsqkdfnjsn_copes", + "label": "copes", + "prov:atLocation": "niiri:TODO", + + "wasGeneratedBy": "niiri:qndjnqndnfsdnfnsdf_registration" + }, + { + "@id": "niiri:dfsjnsqkdfnjsn_varcopes", + "label": "varcopes", + "prov:atLocation": "niiri:TODO", + + "wasGeneratedBy": "niiri:qndjnqndnfsdnfnsdf_registration" + } + ] + } +} diff --git a/examples/fsl_default/logs.md b/examples/fsl_default/logs.md new file mode 100644 index 000000000..d258edee1 --- /dev/null +++ b/examples/fsl_default/logs.md @@ -0,0 +1,311 @@ +# Progress Report / Log + +Started at Thu Apr 16 11:05:35 UTC 2020 + +#### Feat main script + + +/bin/cp /tmp/feat_oJmMLg.fsf design.fsf + +/usr/share/fsl/5.0/bin/feat_model design + +mkdir .files;cp /usr/share/fsl/5.0/doc/fsl.css .files;cp -r /usr/share/fsl/5.0/doc/images .files/images + +/usr/share/fsl/5.0/bin/fsl_sub -T 10 -l logs -N feat0_init /usr/share/fsl/5.0/bin/feat /data/fmri1/fluency_task/fmri.feat/design.fsf -D /data/fmri1/fluency_task/fmri.feat -I 1 -init +590 + +/usr/share/fsl/5.0/bin/fsl_sub -T 40 -l logs -N feat2_pre -j 590 /usr/share/fsl/5.0/bin/feat /data/fmri1/fluency_task/fmri.feat/design.fsf -D /data/fmri1/fluency_task/fmri.feat -I 1 -prestats +710 + +/usr/share/fsl/5.0/bin/fsl_sub -T 1 -l logs -N feat3_film -j 710 /usr/share/fsl/5.0/bin/feat /data/fmri1/fluency_task/fmri.feat/design.fsf -D /data/fmri1/fluency_task/fmri.feat -I 1 -stats +2114 + +/usr/share/fsl/5.0/bin/fsl_sub -T 119 -l logs -N feat4_post -j 2114 /usr/share/fsl/5.0/bin/feat /data/fmri1/fluency_task/fmri.feat/design.fsf -D /data/fmri1/fluency_task/fmri.feat -poststats 0 +2418 + +/usr/share/fsl/5.0/bin/fsl_sub -T 1 -l logs -N feat5_stop -j 710,2114,2418 /usr/share/fsl/5.0/bin/feat /data/fmri1/fluency_task/fmri.feat/design.fsf -D /data/fmri1/fluency_task/fmri.feat -stop + +--------------- +## Initialisation + +/usr/share/fsl/5.0/bin/fslmaths /data/fmri1/fluency_task/fmri prefiltered_func_data -odt float +Total original volumes = 106 + +/usr/share/fsl/5.0/bin/fslroi prefiltered_func_data example_func 53 1 + +--------------- +## Preprocessing:Stage 1 + +/usr/share/fsl/5.0/bin/mainfeatreg -F 6.00 -d /data/fmri1/fluency_task/fmri.feat -l /data/fmri1/fluency_task/fmri.feat/logs/feat2_pre -R /data/fmri1/fluency_task/fmri.feat/report_unwarp.html -r /data/fmri1/fluency_task/fmri.feat/report_reg.html -i /data/fmri1/fluency_task/fmri.feat/example_func.nii.gz -h /data/fmri1/fluency_task/structural_brain -w 7 -x 90 -s /usr/share/fsl/5.0/data/standard/MNI152_T1_2mm_brain -y 12 -z 90 +Option -F ( FEAT version parameter ) selected with argument "6.00" +Option -d ( output directory ) selected with argument "/data/fmri1/fluency_task/fmri.feat" +Option -l ( logfile )input with argument "/data/fmri1/fluency_task/fmri.feat/logs/feat2_pre" +Option -R ( html unwarping report ) selected with argument "/data/fmri1/fluency_task/fmri.feat/report_unwarp.html" +Option -r ( html registration report ) selected with argument "/data/fmri1/fluency_task/fmri.feat/report_reg.html" +Option -i ( main input ) input with argument "/data/fmri1/fluency_task/fmri.feat/example_func.nii.gz" +Option -h ( high-res structural image ) selected with argument "/data/fmri1/fluency_task/structural_brain" +Option -w ( highres dof ) selected with argument "7" +Option -x ( highres search ) selected with argument "90" +Option -s ( standard image ) selected with argument "/usr/share/fsl/5.0/data/standard/MNI152_T1_2mm_brain" +Option -y ( standard dof ) selected with argument "12" +Option -z ( standard search ) selected with argument "90" + +## Registration + +/bin/mkdir -p /data/fmri1/fluency_task/fmri.feat/reg + + +/usr/share/fsl/5.0/bin/fslmaths /data/fmri1/fluency_task/structural_brain highres + + +/usr/share/fsl/5.0/bin/fslmaths /usr/share/fsl/5.0/data/standard/MNI152_T1_2mm_brain standard + +did not find file: example_func2highres.mat. Generating transform. + +/usr/share/fsl/5.0/bin/flirt -in example_func -ref highres -out example_func2highres -omat example_func2highres.mat -cost corratio -dof 7 -searchrx -90 90 -searchry -90 90 -searchrz -90 90 -interp trilinear + + +/usr/share/fsl/5.0/bin/convert_xfm -inverse -omat highres2example_func.mat example_func2highres.mat + + +/usr/share/fsl/5.0/bin/slicer example_func2highres highres -s 2 -x 0.35 sla.png -x 0.45 slb.png -x 0.55 slc.png -x 0.65 sld.png -y 0.35 sle.png -y 0.45 slf.png -y 0.55 slg.png -y 0.65 slh.png -z 0.35 sli.png -z 0.45 slj.png -z 0.55 slk.png -z 0.65 sll.png ; /usr/share/fsl/5.0/bin/pngappend sla.png + slb.png + slc.png + sld.png + sle.png + slf.png + slg.png + slh.png + sli.png + slj.png + slk.png + sll.png example_func2highres1.png ; /usr/share/fsl/5.0/bin/slicer highres example_func2highres -s 2 -x 0.35 sla.png -x 0.45 slb.png -x 0.55 slc.png -x 0.65 sld.png -y 0.35 sle.png -y 0.45 slf.png -y 0.55 slg.png -y 0.65 slh.png -z 0.35 sli.png -z 0.45 slj.png -z 0.55 slk.png -z 0.65 sll.png ; /usr/share/fsl/5.0/bin/pngappend sla.png + slb.png + slc.png + sld.png + sle.png + slf.png + slg.png + slh.png + sli.png + slj.png + slk.png + sll.png example_func2highres2.png ; /usr/share/fsl/5.0/bin/pngappend example_func2highres1.png - example_func2highres2.png example_func2highres.png; /bin/rm -f sl?.png example_func2highres2.png + + +/bin/rm example_func2highres1.png + +did not find file: highres2standard.mat. + +Generating transform. + +/usr/share/fsl/5.0/bin/flirt -in highres -ref standard -out highres2standard -omat highres2standard.mat -cost corratio -dof 12 -searchrx -90 90 -searchry -90 90 -searchrz -90 90 -interp trilinear + + +/usr/share/fsl/5.0/bin/convert_xfm -inverse -omat standard2highres.mat highres2standard.mat + + +/usr/share/fsl/5.0/bin/slicer highres2standard standard -s 2 -x 0.35 sla.png -x 0.45 slb.png -x 0.55 slc.png -x 0.65 sld.png -y 0.35 sle.png -y 0.45 slf.png -y 0.55 slg.png -y 0.65 slh.png -z 0.35 sli.png -z 0.45 slj.png -z 0.55 slk.png -z 0.65 sll.png ; /usr/share/fsl/5.0/bin/pngappend sla.png + slb.png + slc.png + sld.png + sle.png + slf.png + slg.png + slh.png + sli.png + slj.png + slk.png + sll.png highres2standard1.png ; /usr/share/fsl/5.0/bin/slicer standard highres2standard -s 2 -x 0.35 sla.png -x 0.45 slb.png -x 0.55 slc.png -x 0.65 sld.png -y 0.35 sle.png -y 0.45 slf.png -y 0.55 slg.png -y 0.65 slh.png -z 0.35 sli.png -z 0.45 slj.png -z 0.55 slk.png -z 0.65 sll.png ; /usr/share/fsl/5.0/bin/pngappend sla.png + slb.png + slc.png + sld.png + sle.png + slf.png + slg.png + slh.png + sli.png + slj.png + slk.png + sll.png highres2standard2.png ; /usr/share/fsl/5.0/bin/pngappend highres2standard1.png - highres2standard2.png highres2standard.png; /bin/rm -f sl?.png highres2standard2.png + + +/bin/rm highres2standard1.png + + +/usr/share/fsl/5.0/bin/convert_xfm -omat example_func2standard.mat -concat highres2standard.mat example_func2highres.mat + + +/usr/share/fsl/5.0/bin/flirt -ref standard -in example_func -out example_func2standard -applyxfm -init example_func2standard.mat -interp trilinear + +Found file: example_func2standard.mat. + +/usr/share/fsl/5.0/bin/convert_xfm -inverse -omat standard2example_func.mat example_func2standard.mat + + +/usr/share/fsl/5.0/bin/slicer example_func2standard standard -s 2 -x 0.35 sla.png -x 0.45 slb.png -x 0.55 slc.png -x 0.65 sld.png -y 0.35 sle.png -y 0.45 slf.png -y 0.55 slg.png -y 0.65 slh.png -z 0.35 sli.png -z 0.45 slj.png -z 0.55 slk.png -z 0.65 sll.png ; /usr/share/fsl/5.0/bin/pngappend sla.png + slb.png + slc.png + sld.png + sle.png + slf.png + slg.png + slh.png + sli.png + slj.png + slk.png + sll.png example_func2standard1.png ; /usr/share/fsl/5.0/bin/slicer standard example_func2standard -s 2 -x 0.35 sla.png -x 0.45 slb.png -x 0.55 slc.png -x 0.65 sld.png -y 0.35 sle.png -y 0.45 slf.png -y 0.55 slg.png -y 0.65 slh.png -z 0.35 sli.png -z 0.45 slj.png -z 0.55 slk.png -z 0.65 sll.png ; /usr/share/fsl/5.0/bin/pngappend sla.png + slb.png + slc.png + sld.png + sle.png + slf.png + slg.png + slh.png + sli.png + slj.png + slk.png + sll.png example_func2standard2.png ; /usr/share/fsl/5.0/bin/pngappend example_func2standard1.png - example_func2standard2.png example_func2standard.png; /bin/rm -f sl?.png example_func2standard2.png + +## Preprocessing:Stage 2 + +/usr/share/fsl/5.0/bin/mcflirt -in prefiltered_func_data -out prefiltered_func_data_mcf -mats -plots -reffile example_func -rmsrel -rmsabs -spline_final + +/bin/mkdir -p mc ; /bin/mv -f prefiltered_func_data_mcf.mat prefiltered_func_data_mcf.par prefiltered_func_data_mcf_abs.rms prefiltered_func_data_mcf_abs_mean.rms prefiltered_func_data_mcf_rel.rms prefiltered_func_data_mcf_rel_mean.rms mc + +/usr/share/fsl/5.0/bin/fsl_tsplot -i prefiltered_func_data_mcf.par -t 'MCFLIRT estimated rotations (radians)' -u 1 --start=1 --finish=3 -a x,y,z -w 640 -h 144 -o rot.png + +/usr/share/fsl/5.0/bin/fsl_tsplot -i prefiltered_func_data_mcf.par -t 'MCFLIRT estimated translations (mm)' -u 1 --start=4 --finish=6 -a x,y,z -w 640 -h 144 -o trans.png + +/usr/share/fsl/5.0/bin/fsl_tsplot -i prefiltered_func_data_mcf_abs.rms,prefiltered_func_data_mcf_rel.rms -t 'MCFLIRT estimated mean displacement (mm)' -u 1 -w 640 -h 144 -a absolute,relative -o disp.png + +/usr/share/fsl/5.0/bin/fslmaths prefiltered_func_data_mcf -Tmean mean_func + +/usr/share/fsl/5.0/bin/bet2 mean_func mask -f 0.3 -n -m; /usr/share/fsl/5.0/bin/immv mask_mask mask + +/usr/share/fsl/5.0/bin/fslmaths prefiltered_func_data_mcf -mas mask prefiltered_func_data_bet + +/usr/share/fsl/5.0/bin/fslstats prefiltered_func_data_bet -p 2 -p 98 +0.000000 9827.754883 + +/usr/share/fsl/5.0/bin/fslmaths prefiltered_func_data_bet -thr 982.7754883 -Tmin -bin mask -odt char + +/usr/share/fsl/5.0/bin/fslstats prefiltered_func_data_mcf -k mask -p 50 +7535.813477 + +/usr/share/fsl/5.0/bin/fslmaths mask -dilF mask + +/usr/share/fsl/5.0/bin/fslmaths prefiltered_func_data_mcf -mas mask prefiltered_func_data_thresh + +/usr/share/fsl/5.0/bin/fslmaths prefiltered_func_data_thresh -Tmean mean_func + +/usr/share/fsl/5.0/bin/susan prefiltered_func_data_thresh 5651.86010775 2.9723991507431 3 1 1 mean_func 5651.86010775 prefiltered_func_data_smooth + +/usr/share/fsl/5.0/bin/fslmaths prefiltered_func_data_smooth -mas mask prefiltered_func_data_smooth + +/usr/share/fsl/5.0/bin/fslmaths prefiltered_func_data_smooth -mul 1.3269967509839415 prefiltered_func_data_intnorm + +/usr/share/fsl/5.0/bin/fslmaths prefiltered_func_data_intnorm -Tmean tempMean + +/usr/share/fsl/5.0/bin/fslmaths prefiltered_func_data_intnorm -bptf 10.714285714285714 -1 -add tempMean prefiltered_func_data_tempfilt + +/usr/share/fsl/5.0/bin/imrm tempMean + +/usr/share/fsl/5.0/bin/fslmaths prefiltered_func_data_tempfilt filtered_func_data + +/usr/share/fsl/5.0/bin/fslmaths filtered_func_data -Tmean mean_func + +/bin/rm -rf prefiltered_func_data* + +## Stats + +mkdir -p custom_timing_files ; /usr/share/fsl/5.0/bin/fslFixText /data/fmri1/fluency_task/word_generation.txt custom_timing_files/ev1.txt + +mkdir -p custom_timing_files ; /usr/share/fsl/5.0/bin/fslFixText /data/fmri1/fluency_task/word_shadowing.txt custom_timing_files/ev2.txt + +/usr/share/fsl/5.0/bin/film_gls --in=filtered_func_data --rn=stats --pd=design.mat --thr=1000.0 --sa --ms=5 --con=design.con --fcon=design.fts +Log directory is: stats +paradigm.getDesignMatrix().Nrows()=106 +paradigm.getDesignMatrix().Ncols()=4 +sizeTS=106 +numTS=45081 +Calculating residuals... +Completed +Estimating residual autocorrelation... +Calculating raw AutoCorrs... Completed +mode = 9605.38 +sig = 1451 +Spatially smoothing auto corr estimates +......... +Completed +Tukey M = 10 +Tukey estimates... Completed +Completed +Prewhitening and Computing PEs... +Percentage done: +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,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,Completed +Saving results... +Completed + +/usr/share/fsl/5.0/bin/smoothest -d 102 -m mask -r stats/res4d > stats/smoothness + +## Post-stats + +/usr/share/fsl/5.0/bin/fslmaths stats/zstat1 -mas mask thresh_zstat1 + +echo 45081 > thresh_zstat1.vol +zstat1: DLH=0.387734 VOLUME=45081 RESELS=11.9468 + +/usr/share/fsl/5.0/bin/fslmaths stats/zstat2 -mas mask thresh_zstat2 + +echo 45081 > thresh_zstat2.vol +zstat2: DLH=0.387734 VOLUME=45081 RESELS=11.9468 + +/usr/share/fsl/5.0/bin/fslmaths stats/zstat3 -mas mask thresh_zstat3 + +echo 45081 > thresh_zstat3.vol +zstat3: DLH=0.387734 VOLUME=45081 RESELS=11.9468 + +/usr/share/fsl/5.0/bin/fslmaths stats/zstat4 -mas mask thresh_zstat4 + +echo 45081 > thresh_zstat4.vol +zstat4: DLH=0.387734 VOLUME=45081 RESELS=11.9468 + +/usr/share/fsl/5.0/bin/fslmaths stats/zstat5 -mas mask thresh_zstat5 + +echo 45081 > thresh_zstat5.vol +zstat5: DLH=0.387734 VOLUME=45081 RESELS=11.9468 + +/usr/share/fsl/5.0/bin/fslmaths stats/zfstat1 -mas mask thresh_zfstat1 + +echo 45081 > thresh_zfstat1.vol +zfstat1: DLH=0.387734 VOLUME=45081 RESELS=11.9468 + +/usr/share/fsl/5.0/bin/cluster -i thresh_zstat1 -c stats/cope1 -t 2.3 -p 0.05 -d 0.387734 --volume=45081 --othresh=thresh_zstat1 -o cluster_mask_zstat1 --connectivity=26 --olmax=lmax_zstat1.txt --scalarname=Z > cluster_zstat1.txt + +/usr/share/fsl/5.0/bin/cluster2html . cluster_zstat1 + +/usr/share/fsl/5.0/bin/cluster -i thresh_zstat2 -c stats/cope2 -t 2.3 -p 0.05 -d 0.387734 --volume=45081 --othresh=thresh_zstat2 -o cluster_mask_zstat2 --connectivity=26 --olmax=lmax_zstat2.txt --scalarname=Z > cluster_zstat2.txt + +/usr/share/fsl/5.0/bin/cluster2html . cluster_zstat2 + +/usr/share/fsl/5.0/bin/cluster -i thresh_zstat3 -c stats/cope3 -t 2.3 -p 0.05 -d 0.387734 --volume=45081 --othresh=thresh_zstat3 -o cluster_mask_zstat3 --connectivity=26 --olmax=lmax_zstat3.txt --scalarname=Z > cluster_zstat3.txt + +/usr/share/fsl/5.0/bin/cluster2html . cluster_zstat3 + +/usr/share/fsl/5.0/bin/cluster -i thresh_zstat4 -c stats/cope4 -t 2.3 -p 0.05 -d 0.387734 --volume=45081 --othresh=thresh_zstat4 -o cluster_mask_zstat4 --connectivity=26 --olmax=lmax_zstat4.txt --scalarname=Z > cluster_zstat4.txt + +/usr/share/fsl/5.0/bin/cluster2html . cluster_zstat4 + +/usr/share/fsl/5.0/bin/cluster -i thresh_zstat5 -c stats/cope5 -t 2.3 -p 0.05 -d 0.387734 --volume=45081 --othresh=thresh_zstat5 -o cluster_mask_zstat5 --connectivity=26 --olmax=lmax_zstat5.txt --scalarname=Z > cluster_zstat5.txt + +/usr/share/fsl/5.0/bin/cluster2html . cluster_zstat5 + +/usr/share/fsl/5.0/bin/cluster -i thresh_zfstat1 -t 2.3 -p 0.05 -d 0.387734 --volume=45081 --othresh=thresh_zfstat1 -o cluster_mask_zfstat1 --connectivity=26 --olmax=lmax_zfstat1.txt --scalarname=Z > cluster_zfstat1.txt + +/usr/share/fsl/5.0/bin/cluster2html . cluster_zfstat1 + +/usr/share/fsl/5.0/bin/cluster -i thresh_zstat1 -c stats/cope1 -t 2.3 -p 0.05 -d 0.387734 --volume=45081 -x reg/example_func2standard.mat --stdvol=reg/standard --mm --connectivity=26 --olmax=lmax_zstat1_std.txt --scalarname=Z > cluster_zstat1_std.txt + +/usr/share/fsl/5.0/bin/cluster2html . cluster_zstat1 -std + +/usr/share/fsl/5.0/bin/cluster -i thresh_zstat2 -c stats/cope2 -t 2.3 -p 0.05 -d 0.387734 --volume=45081 -x reg/example_func2standard.mat --stdvol=reg/standard --mm --connectivity=26 --olmax=lmax_zstat2_std.txt --scalarname=Z > cluster_zstat2_std.txt + +/usr/share/fsl/5.0/bin/cluster2html . cluster_zstat2 -std + +/usr/share/fsl/5.0/bin/cluster -i thresh_zstat3 -c stats/cope3 -t 2.3 -p 0.05 -d 0.387734 --volume=45081 -x reg/example_func2standard.mat --stdvol=reg/standard --mm --connectivity=26 --olmax=lmax_zstat3_std.txt --scalarname=Z > cluster_zstat3_std.txt + +/usr/share/fsl/5.0/bin/cluster2html . cluster_zstat3 -std + +/usr/share/fsl/5.0/bin/cluster -i thresh_zstat4 -c stats/cope4 -t 2.3 -p 0.05 -d 0.387734 --volume=45081 -x reg/example_func2standard.mat --stdvol=reg/standard --mm --connectivity=26 --olmax=lmax_zstat4_std.txt --scalarname=Z > cluster_zstat4_std.txt + +/usr/share/fsl/5.0/bin/cluster2html . cluster_zstat4 -std + +/usr/share/fsl/5.0/bin/cluster -i thresh_zstat5 -c stats/cope5 -t 2.3 -p 0.05 -d 0.387734 --volume=45081 -x reg/example_func2standard.mat --stdvol=reg/standard --mm --connectivity=26 --olmax=lmax_zstat5_std.txt --scalarname=Z > cluster_zstat5_std.txt + +/usr/share/fsl/5.0/bin/cluster2html . cluster_zstat5 -std + +/usr/share/fsl/5.0/bin/cluster -i thresh_zfstat1 -t 2.3 -p 0.05 -d 0.387734 --volume=45081 -x reg/example_func2standard.mat --stdvol=reg/standard --mm --connectivity=26 --olmax=lmax_zfstat1_std.txt --scalarname=Z > cluster_zfstat1_std.txt + +/usr/share/fsl/5.0/bin/cluster2html . cluster_zfstat1 -std + +/usr/share/fsl/5.0/bin/fslstats thresh_zstat1 -l 0.0001 -R 2>/dev/null +2.300048 6.133199 + +/usr/share/fsl/5.0/bin/fslstats thresh_zstat2 -l 0.0001 -R 2>/dev/null +2.300061 6.440603 + +/usr/share/fsl/5.0/bin/fslstats thresh_zstat3 -l 0.0001 -R 2>/dev/null +2.300882 6.401662 + +/usr/share/fsl/5.0/bin/fslstats thresh_zstat4 -l 0.0001 -R 2>/dev/null +2.303167 3.934648 + +/usr/share/fsl/5.0/bin/fslstats thresh_zstat5 -l 0.0001 -R 2>/dev/null +2.301617 6.236727 + +/usr/share/fsl/5.0/bin/fslstats thresh_zfstat1 -l 0.0001 -R 2>/dev/null +2.300071 6.092561 +Rendering using zmin=2.300048 zmax=6.440603 + +/usr/share/fsl/5.0/bin/overlay 1 0 example_func -a thresh_zstat1 2.300048 6.440603 rendered_thresh_zstat1 + +/usr/share/fsl/5.0/bin/slicer rendered_thresh_zstat1 -A 750 rendered_thresh_zstat1.png + +/bin/cp /usr/share/fsl/5.0/etc/luts/ramp.gif .ramp.gif + +/usr/share/fsl/5.0/bin/overlay 1 0 example_func -a thresh_zstat2 2.300048 6.440603 rendered_thresh_zstat2 + +/usr/share/fsl/5.0/bin/slicer rendered_thresh_zstat2 -A 750 rendered_thresh_zstat2.png + +/usr/share/fsl/5.0/bin/overlay 1 0 example_func -a thresh_zstat3 2.300048 6.440603 rendered_thresh_zstat3 + +/usr/share/fsl/5.0/bin/slicer rendered_thresh_zstat3 -A 750 rendered_thresh_zstat3.png + +/usr/share/fsl/5.0/bin/overlay 1 0 example_func -a thresh_zstat4 2.300048 6.440603 rendered_thresh_zstat4 + +/usr/share/fsl/5.0/bin/slicer rendered_thresh_zstat4 -A 750 rendered_thresh_zstat4.png + +/usr/share/fsl/5.0/bin/overlay 1 0 example_func -a thresh_zstat5 2.300048 6.440603 rendered_thresh_zstat5 + +/usr/share/fsl/5.0/bin/slicer rendered_thresh_zstat5 -A 750 rendered_thresh_zstat5.png + +/usr/share/fsl/5.0/bin/overlay 1 0 example_func -a thresh_zfstat1 2.300048 6.440603 rendered_thresh_zfstat1 + +/usr/share/fsl/5.0/bin/slicer rendered_thresh_zfstat1 -A 750 rendered_thresh_zfstat1.png + +mkdir -p tsplot ; /usr/share/fsl/5.0/bin/tsplot . -f filtered_func_data -o tsplot \ No newline at end of file diff --git a/examples/fsl_default/readme.md b/examples/fsl_default/readme.md new file mode 100644 index 000000000..47287e67b --- /dev/null +++ b/examples/fsl_default/readme.md @@ -0,0 +1,31 @@ +## workflow for "Feat 1 Practical" example + +--- + +### Steps + +Tutorial available [here](https://fsl.fmrib.ox.ac.uk/fslcourse/lectures/practicals/feat1/index.html) + +--- + +### Workflow + +
+ +
+ +--- + +### Docker + +[This image](https://hub.docker.com/r/vistalab/fsl-v5.0) was used to reproduce experiments + +### Generate a graph + +from the root of this project + +```bash +python bids_prov/visualize.py examples/fsl_default/default.json examples/fsl_default/single_subject_inference.json -o fsl_default.png +``` + +generate the graph dedicated to single subject inference, and skips details regarding group analysis (contained in `examples/fsl_default/group_analysis.json`) diff --git a/examples/fsl_default/single_subject_inference.json b/examples/fsl_default/single_subject_inference.json new file mode 100644 index 000000000..b87acc124 --- /dev/null +++ b/examples/fsl_default/single_subject_inference.json @@ -0,0 +1,44 @@ +{ + "@context": "https://raw.githubusercontent.com/cmaumet/BIDS-prov/context-type-indexing/context.json", + "records": { + "prov:Agent": [ + { + "@id": "RRID:SCR_002823", + "@type": "prov:SoftwareAgent", + "label": "FSL" + } + ], + "prov:Activity": [ + { + "@id": "niiri:sqlspspsppsp_significance_testing", + "label": "significance testing", + "wasAssociatedWith": "RRID:SCR_002823", + "startedAtTime": "2019-10-10T10:00:00", + "endedAtTime": "2019-10-10T10:00:00", + "used": ["niiri:dskjn1904_zstats", "niiri:dskjn1904_thresh"] + } + ], + "prov:Entity": [ + { + "@id": "niiri:dskjn1904_zstats", + "label": "zstats.nii.gz", + "prov:atLocation": "niiri:TODO", + + "wasGeneratedBy": "niiri:fsqjklnfqljnfnfnnf_stats" + }, + { + "@id": "niiri:dskjn1904_thresh", + "label": "tresholds", + "prov:atLocation": "niiri:TODO", + + }, + { + "@id": "niiri:dskjn1904_results", + "label": "results", + "prov:atLocation": "niiri:TODO", + + "wasGeneratedBy": "niiri:sqlspspsppsp_significance_testing" + } + ] + } +} diff --git a/examples/spm_default/SPM default.svg b/examples/spm_default/SPM default.svg new file mode 100644 index 000000000..6487418e9 --- /dev/null +++ b/examples/spm_default/SPM default.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/examples/spm_default/batch.m b/examples/spm_default/batch.m new file mode 100644 index 000000000..2684d3050 --- /dev/null +++ b/examples/spm_default/batch.m @@ -0,0 +1,120 @@ +%----------------------------------------------------------------------- +% Job saved on 15-Mar-2016 14:20:25 by cfg_util (rev $Rev: 6460 $) +% spm SPM - SPM12 (12.1) +% cfg_basicio BasicIO - Unknown +%----------------------------------------------------------------------- +matlabbatch{1}.cfg_basicio.file_dir.file_ops.file_move.files = {'$HOME/nidmresults-examples/spm_default/ds011/sub-01/func/sub-01_task-tonecounting_bold.nii.gz'}; +matlabbatch{1}.cfg_basicio.file_dir.file_ops.file_move.action.copyto = {'$HOME/nidmresults-examples/spm_default/ds011/PREPROCESSING/FUNCTIONAL'}; +matlabbatch{2}.cfg_basicio.file_dir.file_ops.file_move.files = {'/home/remiadon/nidmresults-examples/spm_default/ds011/sub-01/anat/sub-01_T1w.nii.gz'}; +matlabbatch{2}.cfg_basicio.file_dir.file_ops.file_move.action.copyto = {'/home/remiadon/nidmresults-examples/spm_default/ds011/PREPROCESSING/ANATOMICAL'}; +matlabbatch{3}.cfg_basicio.file_dir.file_ops.cfg_gunzip_files.files(1) = cfg_dep('Move/Delete Files: Moved/Copied Files', substruct('.','val', '{}',{1}, '.','val', '{}',{1}, '.','val', '{}',{1}, '.','val', '{}',{1}), substruct('.','files')); +matlabbatch{4}.cfg_basicio.file_dir.file_ops.cfg_gunzip_files.files(1) = cfg_dep('Move/Delete Files: Moved/Copied Files', substruct('.','val', '{}',{2}, '.','val', '{}',{1}, '.','val', '{}',{1}, '.','val', '{}',{1}), substruct('.','files')); +matlabbatch{5}.spm.spatial.realign.estwrite.data{1}(1) = cfg_dep('GunZip Files: GunZipped Files', substruct('.','val', '{}',{3}, '.','val', '{}',{1}, '.','val', '{}',{1}, '.','val', '{}',{1}), substruct('()',{':'})); +matlabbatch{5}.spm.spatial.realign.estwrite.eoptions.quality = 0.9; +matlabbatch{5}.spm.spatial.realign.estwrite.eoptions.sep = 4; +matlabbatch{5}.spm.spatial.realign.estwrite.eoptions.fwhm = 5; +matlabbatch{5}.spm.spatial.realign.estwrite.eoptions.rtm = 1; +matlabbatch{5}.spm.spatial.realign.estwrite.eoptions.interp = 2; +matlabbatch{5}.spm.spatial.realign.estwrite.eoptions.wrap = [0 0 0]; +matlabbatch{5}.spm.spatial.realign.estwrite.eoptions.weight = ''; +matlabbatch{5}.spm.spatial.realign.estwrite.roptions.which = [0 1]; +matlabbatch{5}.spm.spatial.realign.estwrite.roptions.interp = 4; +matlabbatch{5}.spm.spatial.realign.estwrite.roptions.wrap = [0 0 0]; +matlabbatch{5}.spm.spatial.realign.estwrite.roptions.mask = 1; +matlabbatch{5}.spm.spatial.realign.estwrite.roptions.prefix = 'r'; +matlabbatch{6}.spm.spatial.coreg.estimate.ref(1) = cfg_dep('Realign: Estimate & Reslice: Mean Image', substruct('.','val', '{}',{5}, '.','val', '{}',{1}, '.','val', '{}',{1}, '.','val', '{}',{1}), substruct('.','rmean')); +matlabbatch{6}.spm.spatial.coreg.estimate.source(1) = cfg_dep('GunZip Files: GunZipped Files', substruct('.','val', '{}',{4}, '.','val', '{}',{1}, '.','val', '{}',{1}, '.','val', '{}',{1}), substruct('()',{':'})); +matlabbatch{6}.spm.spatial.coreg.estimate.other = {''}; +matlabbatch{6}.spm.spatial.coreg.estimate.eoptions.cost_fun = 'nmi'; +matlabbatch{6}.spm.spatial.coreg.estimate.eoptions.sep = [4 2]; +matlabbatch{6}.spm.spatial.coreg.estimate.eoptions.tol = [0.02 0.02 0.02 0.001 0.001 0.001 0.01 0.01 0.01 0.001 0.001 0.001]; +matlabbatch{6}.spm.spatial.coreg.estimate.eoptions.fwhm = [7 7]; +matlabbatch{7}.spm.spatial.preproc.channel.vols(1) = cfg_dep('GunZip Files: GunZipped Files', substruct('.','val', '{}',{4}, '.','val', '{}',{1}, '.','val', '{}',{1}, '.','val', '{}',{1}), substruct('()',{':'})); +matlabbatch{7}.spm.spatial.preproc.channel.biasreg = 0.001; +matlabbatch{7}.spm.spatial.preproc.channel.biasfwhm = 60; +matlabbatch{7}.spm.spatial.preproc.channel.write = [0 1]; +matlabbatch{7}.spm.spatial.preproc.tissue(1).tpm = {'/home/radon/spm12/tpm/TPM.nii,1'}; +matlabbatch{7}.spm.spatial.preproc.tissue(1).ngaus = 1; +matlabbatch{7}.spm.spatial.preproc.tissue(1).native = [1 0]; +matlabbatch{7}.spm.spatial.preproc.tissue(1).warped = [0 0]; +matlabbatch{7}.spm.spatial.preproc.tissue(2).tpm = {'/home/radon/spm12/tpm/TPM.nii,2'}; +matlabbatch{7}.spm.spatial.preproc.tissue(2).ngaus = 1; +matlabbatch{7}.spm.spatial.preproc.tissue(2).native = [1 0]; +matlabbatch{7}.spm.spatial.preproc.tissue(2).warped = [0 0]; +matlabbatch{7}.spm.spatial.preproc.tissue(3).tpm = {'/home/radon/spm12/tpm/TPM.nii,3'}; +matlabbatch{7}.spm.spatial.preproc.tissue(3).ngaus = 2; +matlabbatch{7}.spm.spatial.preproc.tissue(3).native = [1 0]; +matlabbatch{7}.spm.spatial.preproc.tissue(3).warped = [0 0]; +matlabbatch{7}.spm.spatial.preproc.tissue(4).tpm = {'/home/radon/spm12/tpm/TPM.nii,4'}; +matlabbatch{7}.spm.spatial.preproc.tissue(4).ngaus = 3; +matlabbatch{7}.spm.spatial.preproc.tissue(4).native = [1 0]; +matlabbatch{7}.spm.spatial.preproc.tissue(4).warped = [0 0]; +matlabbatch{7}.spm.spatial.preproc.tissue(5).tpm = {'/home/radon/spm12/tpm/TPM.nii,5'}; +matlabbatch{7}.spm.spatial.preproc.tissue(5).ngaus = 4; +matlabbatch{7}.spm.spatial.preproc.tissue(5).native = [1 0]; +matlabbatch{7}.spm.spatial.preproc.tissue(5).warped = [0 0]; +matlabbatch{7}.spm.spatial.preproc.tissue(6).tpm = {'/home/radon/spm12/tpm/TPM.nii,6'}; +matlabbatch{7}.spm.spatial.preproc.tissue(6).ngaus = 2; +matlabbatch{7}.spm.spatial.preproc.tissue(6).native = [0 0]; +matlabbatch{7}.spm.spatial.preproc.tissue(6).warped = [0 0]; +matlabbatch{7}.spm.spatial.preproc.warp.mrf = 1; +matlabbatch{7}.spm.spatial.preproc.warp.cleanup = 1; +matlabbatch{7}.spm.spatial.preproc.warp.reg = [0 0.001 0.5 0.05 0.2]; +matlabbatch{7}.spm.spatial.preproc.warp.affreg = 'mni'; +matlabbatch{7}.spm.spatial.preproc.warp.fwhm = 0; +matlabbatch{7}.spm.spatial.preproc.warp.samp = 3; +matlabbatch{7}.spm.spatial.preproc.warp.write = [0 1]; +matlabbatch{8}.spm.spatial.normalise.write.subj.def(1) = cfg_dep('Segment: Forward Deformations', substruct('.','val', '{}',{7}, '.','val', '{}',{1}, '.','val', '{}',{1}), substruct('.','fordef', '()',{':'})); +matlabbatch{8}.spm.spatial.normalise.write.subj.resample(1) = cfg_dep('Realign: Estimate & Reslice: Realigned Images (Sess 1)', substruct('.','val', '{}',{5}, '.','val', '{}',{1}, '.','val', '{}',{1}, '.','val', '{}',{1}), substruct('.','sess', '()',{1}, '.','cfiles')); +matlabbatch{8}.spm.spatial.normalise.write.woptions.bb = [-78 -112 -70 78 76 85]; +matlabbatch{8}.spm.spatial.normalise.write.woptions.vox = [2 2 2]; +matlabbatch{8}.spm.spatial.normalise.write.woptions.interp = 4; +matlabbatch{8}.spm.spatial.normalise.write.woptions.prefix = 'w'; +matlabbatch{9}.spm.spatial.normalise.write.subj.def(1) = cfg_dep('Segment: Forward Deformations', substruct('.','val', '{}',{7}, '.','val', '{}',{1}, '.','val', '{}',{1}), substruct('.','fordef', '()',{':'})); +matlabbatch{9}.spm.spatial.normalise.write.subj.resample(1) = cfg_dep('Segment: Bias Corrected (1)', substruct('.','val', '{}',{7}, '.','val', '{}',{1}, '.','val', '{}',{1}), substruct('.','channel', '()',{1}, '.','biascorr', '()',{':'})); +matlabbatch{9}.spm.spatial.normalise.write.woptions.bb = [-78 -112 -70 78 76 85]; +matlabbatch{9}.spm.spatial.normalise.write.woptions.vox = [2 2 2]; +matlabbatch{9}.spm.spatial.normalise.write.woptions.interp = 4; +matlabbatch{9}.spm.spatial.normalise.write.woptions.prefix = 'w'; +matlabbatch{10}.spm.spatial.smooth.data(1) = cfg_dep('Normalise: Write: Normalised Images (Subj 1)', substruct('.','val', '{}',{8}, '.','val', '{}',{1}, '.','val', '{}',{1}, '.','val', '{}',{1}), substruct('()',{1}, '.','files')); +matlabbatch{10}.spm.spatial.smooth.fwhm = [6 6 6]; +matlabbatch{10}.spm.spatial.smooth.dtype = 0; +matlabbatch{10}.spm.spatial.smooth.im = 0; +matlabbatch{10}.spm.spatial.smooth.prefix = 's'; +matlabbatch{11}.spm.stats.fmri_spec.dir = {'/storage/essicd/data/NIDM-Ex/BIDS_Data/RESULTS/TEST/nidmresults-examples/spm_voxelwise_p0001'}; +matlabbatch{11}.spm.stats.fmri_spec.timing.units = 'secs'; +matlabbatch{11}.spm.stats.fmri_spec.timing.RT = 2; +matlabbatch{11}.spm.stats.fmri_spec.timing.fmri_t = 16; +matlabbatch{11}.spm.stats.fmri_spec.timing.fmri_t0 = 8; +matlabbatch{11}.spm.stats.fmri_spec.sess.scans(1) = cfg_dep('Smooth: Smoothed Images', substruct('.','val', '{}',{10}, '.','val', '{}',{1}, '.','val', '{}',{1}), substruct('.','files')); +matlabbatch{11}.spm.stats.fmri_spec.sess.cond = struct('name', {}, 'onset', {}, 'duration', {}, 'tmod', {}, 'pmod', {}, 'orth', {}); +matlabbatch{11}.spm.stats.fmri_spec.sess.multi = {'/home/remiadon/nidmresults-examples/spm_default/ds011/SPM/PREPROCESSING/ONSETS/sub-01-MultiCond.mat'}; +matlabbatch{11}.spm.stats.fmri_spec.sess.regress = struct('name', {}, 'val', {}); +matlabbatch{11}.spm.stats.fmri_spec.sess.multi_reg = {''}; +matlabbatch{11}.spm.stats.fmri_spec.sess.hpf = 128; +matlabbatch{11}.spm.stats.fmri_spec.fact = struct('name', {}, 'levels', {}); +matlabbatch{11}.spm.stats.fmri_spec.bases.hrf.derivs = [0 0]; +matlabbatch{11}.spm.stats.fmri_spec.volt = 1; +matlabbatch{11}.spm.stats.fmri_spec.global = 'None'; +matlabbatch{11}.spm.stats.fmri_spec.mthresh = 0.8; +matlabbatch{11}.spm.stats.fmri_spec.mask = {''}; +matlabbatch{11}.spm.stats.fmri_spec.cvi = 'AR(1)'; +matlabbatch{12}.spm.stats.fmri_est.spmmat(1) = cfg_dep('fMRI model specification: SPM.mat File', substruct('.','val', '{}',{11}, '.','val', '{}',{1}, '.','val', '{}',{1}), substruct('.','spmmat')); +matlabbatch{12}.spm.stats.fmri_est.write_residuals = 0; +matlabbatch{12}.spm.stats.fmri_est.method.Classical = 1; +matlabbatch{13}.spm.stats.con.spmmat(1) = cfg_dep('Model estimation: SPM.mat File', substruct('.','val', '{}',{12}, '.','val', '{}',{1}, '.','val', '{}',{1}), substruct('.','spmmat')); +matlabbatch{13}.spm.stats.con.consess{1}.tcon.name = 'tone counting vs baseline'; +matlabbatch{13}.spm.stats.con.consess{1}.tcon.weights = [1 0]; +matlabbatch{13}.spm.stats.con.consess{1}.tcon.sessrep = 'none'; +matlabbatch{13}.spm.stats.con.delete = 0; +matlabbatch{14}.spm.stats.results.spmmat(1) = cfg_dep('Contrast Manager: SPM.mat File', substruct('.','val', '{}',{13}, '.','val', '{}',{1}, '.','val', '{}',{1}), substruct('.','spmmat')); +matlabbatch{14}.spm.stats.results.conspec.titlestr = ''; +matlabbatch{14}.spm.stats.results.conspec.contrasts = Inf; +matlabbatch{14}.spm.stats.results.conspec.threshdesc = 'none'; +matlabbatch{14}.spm.stats.results.conspec.thresh = 0.001; +matlabbatch{14}.spm.stats.results.conspec.extent = 0; +matlabbatch{14}.spm.stats.results.conspec.conjunction = 1; +matlabbatch{14}.spm.stats.results.conspec.mask.none = 1; +matlabbatch{14}.spm.stats.results.units = 1; +matlabbatch{14}.spm.stats.results.print = 'pdf'; +matlabbatch{14}.spm.stats.results.write.tspm.basename = 'thresh'; diff --git a/examples/spm_default/copies.json b/examples/spm_default/copies.json new file mode 100644 index 000000000..db43fdc41 --- /dev/null +++ b/examples/spm_default/copies.json @@ -0,0 +1,72 @@ +{ + "@context": "https://raw.githubusercontent.com/cmaumet/BIDS-prov/context-type-indexing/context.json", + "@id": "http://example.org/ds00000X", + "generatedAt": "2020-03-10T10:00:00", + "wasGeneratedBy": { + "@id": "INRIA", + "@type": "Project", + "startedAt": "2016-09-01T10:00:00", + "wasAssociatedWith": { + "@id": "NIH", + "@type": "Organization", + "hadRole": "Funding" + } + }, + "records": { + "prov:Agent": [ + { + "@id": "RRID:SCR_007037", + "@type": "prov:SoftwareAgent", + "label": "SPM" + } + ], + "prov:Activity": [ + { + "@id": "niiri:6534673543aaaaaaa", + "label": "copy and unzip anat", + "wasAssociatedWith": "RRID:SCR_007037", + "startedAtTime": "2019-10-10T10:00:00", + "endedAtTime": "2019-10-10T10:00:00", + "used": "niiri:sjhgdfhjsgd63q5aaafa" + }, + { + "@id": "niiri:653467354367537g345523efdghs", + "label": "copy and unzip func", + "wasAssociatedWith": "RRID:SCR_007037", + "startedAtTime": "2019-10-10T10:00:00", + "endedAtTime": "2019-10-10T10:00:00", + "used": "niiri:sjhgdf673gbdsjdfsqjnfd" + } + ], + "prov:Entity": [ + { + "@id": "niiri:sjhgdfhjsgd63q5aaafa", + "label": "anat raw", + "prov:atLocation": "$HOME/nidm-results-examples/spm_default/ds011/sub-01/anat/sub-01_T1w.nii.gz", + "generatedAt": "2019-10-10T10:00:00" + }, + { + "@id": "niiri:sjhgdf673gbdsjdfsqjnfd", + "label": "func raw", + "prov:atLocation": "$HOME/nidm-results-examples/spm_default/ds011/sub-01/func/sub-01_task-tonecounting_bold.nii.gz", + "generatedAt": "2019-10-10T10:00:00" + }, + { + "@id": "niiri:sjhgdfhfdsqldjkfnlqkjaaaaaaaaaa", + "label": "anat unzipped", + "prov:atLocation": "??????", + "derivedFrom": "niiri:sjhgdfhjsgd63q5aaafa", + + "wasGeneratedBy": "niiri:6534673543aaaaaaa" + }, + { + "@id": "niiri:sjhgdqd", + "label": "func unzipped", + "prov:atLocation": "$HOME/nidm-results-examples/spm_default/ds011/PREPROCESSING/FUNCTIONAL/*", + "derivedFrom": "niiri:sjhgdf673gbdsjdfsqjnfd", + + "wasGeneratedBy": "niiri:653467354367537g345523efdghs" + } + ] + } +} diff --git a/examples/spm_default/coreg_and_segment.json b/examples/spm_default/coreg_and_segment.json new file mode 100644 index 000000000..55ea13568 --- /dev/null +++ b/examples/spm_default/coreg_and_segment.json @@ -0,0 +1,162 @@ +{ + "@context": "https://raw.githubusercontent.com/cmaumet/BIDS-prov/context-type-indexing/context.json", + "@id": "http://example.org/ds00000X", + "generatedAt": "2020-03-10T10:00:00", + "wasGeneratedBy": { + "@id": "INRIA", + "@type": "Project", + "startedAt": "2016-09-01T10:00:00", + "wasAssociatedWith": { + "@id": "NIH", + "@type": "Organization", + "hadRole": "Funding" + } + }, + "records": { + "prov:Agent": [ + { + "@id": "RRID:SCR_007037", + "@type": "prov:SoftwareAgent", + "label": "SPM" + } + ], + "prov:Activity": [ + { + "@id": "niiri:fdsljfnqkljfdklqsjdfq", + "label": "coregister", + "wasAssociatedWith": "RRID:SCR_007037", + "startedAtTime": "10/10/2020 00:00:00", + "endedAtTime": "10/10/2020 01:0", + "used": [ + "niiri:fdsjnflqj12381U39fdskjnf", + "niiri:sjhgdfhfdsqldjkfnlqkjaaaaaaaaaa" + ], + "attributes": [ + ["eoptions.cost_fun", "nmi"], + ["eoptions.sep", [4, 2]], + [ + "eoptions.tol", + [ + 0.02, + 0.02, + 0.02, + 0.001, + 0.001, + 0.001, + 0.01, + 0.01, + 0.01, + 0.001, + 0.001, + 0.001 + ] + ], + ["eoptions.fhwm", [0, 1]] + ] + }, + { + "@id": "niiri:sdfsdofjiosdf", + "label": "segment", + "wasAssociatedWith": "RRID:SCR_007037", + "startedAtTime": "10/10/2020 00:00:00", + "endedAtTime": "10/10/2020 01:09", + "used": "niiri:fsiudfqsoi938409283409fdskj", + "attributes": [ + ["tissue1.tpm", "$HOME/spm12/tpm/TPM.nii,1"], + ["tissue1.ngaus", 1], + ["tissue1.native", [1, 0]], + ["tissue1.warped", [0, 1]], + ["tissue2.tpm", "$HOME/spm12/tpm/TPM.nii,2"], + ["tissue2.ngaus", 1], + ["tissue2.native", [1, 0]], + ["tissue2.warped", [0, 1]], + ["tissue3.tpm", "$HOME/spm12/tpm/TPM.nii,3"], + ["tissue3.ngaus", 2], + ["tissue3.native", [1, 0]], + ["tissue3.warped", [0, 1]], + ["tissue4.tpm", "$HOME/spm12/tpm/TPM.nii,4"], + ["tissue4.ngaus", 3], + ["tissue4.native", [1, 0]], + ["tissue4.warped", [0, 1]], + ["tissue5.tpm", "$HOME/spm12/tpm/TPM.nii,5"], + ["tissue5.ngaus", 4], + ["tissue5.native", [1, 0]], + ["tissue5.warped", [0, 1]], + ["tissue6.tpm", "$HOME/spm12/tpm/TPM.nii,6"], + ["tissue6.ngaus", 2], + ["tissue6.native", [0, 0]], + ["tissue6.warped", [0, 1]] + ] + } + ], + "prov:Entity": [ + { + "@id": "niiri:fsiudfqsoi938409283409fdskj", + "label": ".nii updated header", + + "wasGeneratedBy": "niiri:fdsljfnqkljfdklqsjdfq", + "derivedFrom": [ + "niiri:fdsjnflqj12381U39fdskjnf", + "niiri:sjhgdfhfdsqldjkfnlqkjaaaaaaaaaa" + ], + "prov:atLocation": "TODO" + }, + { + "@id": "niiri:102983fsdkjnfskjdfnks129", + "label": "anat bias corrected", + + "wasGeneratedBy": "niiri:sdfsdofjiosdf", + "derivedFrom": "niiri:fsiudfqsoi938409283409fdskj", + "prov:atLocation": "$HOME/spm12/tpm/" + }, + { + "@id": "niiri:fsiud1", + "label": "tissue1", + + "wasGeneratedBy": "niiri:sdfsdofjiosdf", + "derivedFrom": "niiri:fsiudfqsoi938409283409fdskj", + "prov:atLocation": "$HOME/spm12/tpm/TPM.nii,1" + }, + { + "@id": "niiri:fsiud2", + "label": "tissue2", + + "wasGeneratedBy": "niiri:sdfsdofjiosdf", + "derivedFrom": "niiri:fsiudfqsoi938409283409fdskj", + "prov:atLocation": "$HOME/spm12/tpm/TPM.nii,2" + }, + { + "@id": "niiri:fsiud3", + "label": "tissue3", + + "wasGeneratedBy": "niiri:sdfsdofjiosdf", + "derivedFrom": "niiri:fsiudfqsoi938409283409fdskj", + "prov:atLocation": "$HOME/spm12/tpm/TPM.nii,3" + }, + { + "@id": "niiri:fsiud4", + "label": "tissue4", + + "wasGeneratedBy": "niiri:sdfsdofjiosdf", + "derivedFrom": "niiri:fsiudfqsoi938409283409fdskj", + "prov:atLocation": "$HOME/spm12/tpm/TPM.nii,4" + }, + { + "@id": "niiri:fsiud5", + "label": "tisue5", + + "wasGeneratedBy": "niiri:sdfsdofjiosdf", + "derivedFrom": "niiri:fsiudfqsoi938409283409fdskj", + "prov:atLocation": "$HOME/spm12/tpm/TPM.nii,5" + }, + { + "@id": "niiri:fsiud6", + "label": "tissue6", + + "wasGeneratedBy": "niiri:sdfsdofjiosdf", + "derivedFrom": "niiri:fsiudfqsoi938409283409fdskj", + "prov:atLocation": "$HOME/spm12/tpm/TPM.nii,6" + } + ] + } +} diff --git a/examples/spm_default/model_and_contrast.json b/examples/spm_default/model_and_contrast.json new file mode 100644 index 000000000..3d7471041 --- /dev/null +++ b/examples/spm_default/model_and_contrast.json @@ -0,0 +1,73 @@ +{ + "@context": "https://raw.githubusercontent.com/cmaumet/BIDS-prov/context-type-indexing/context.json", + "@id": "http://example.org/ds00000X", + "generatedAt": "2020-03-10T10:00:00", + "wasGeneratedBy": { + "@id": "INRIA", + "@type": "Project", + "startedAt": "2016-09-01T10:00:00", + "wasAssociatedWith": { + "@id": "NIH", + "@type": "Organization", + "hadRole": "Funding" + } + }, + "records": { + "prov:Agent": [ + { + "@id": "RRID:SCR_007037", + "@type": "prov:SoftwareAgent", + "label": "SPM" + } + ], + "prov:Activity": [ + { + "@id": "niiri:fsdfksnf1290883", + "label": "model estimation", + "wasAssociatedWith": "RRID:SCR_007037", + "startedAtTime": "11/10/2020 00:02:00", + "endedAtTime": "11/10/2020 01:02:00", + "used": "niiri:fjsdnf290", + "attributes": [ + ["timing.units", "secs"], + ["timing.RT", 2], + ["timing.fmri_t", "16"], + ["timing.fmri_t0", "8"], + ["sess.multi_reg", ""], + ["sess.hpf", 128], + ["bases.hrf.derivs", [0, 0]], + ["volt", 1], + ["global", "None"], + ["mthresh", 0.8], + ["mask", ""], + ["cvi", "AR(1)"] + ] + }, + { + "@id": "niiri:fslkjnfsqlkn1203829830912803210", + "label": "contrast results", + "wasAssociatedWith": "RRID:SCR_007037", + "startedAtTime": "11/11/2020 00:02:00", + "endedAtTime": "11/11/2020 01:02:00", + "used": "niiri:dsjknl1029d", + "attributes": [ + ["write_residuals", 0], + ["method.Classical", 1], + ["tcon.weights", [1, 0]], + ["tcon.sessrep", "none"], + ["delete", 0] + ] + } + ], + "prov:Entity": [ + { + "@id": "niiri:dsjknl1029d", + "label": "SPM.mat", + "prov:atLocation": "TODO", + + "wasGeneratedBy": "niiri:fsdfksnf1290883", + "prov:wasInfluencedBy": "niiri:fsdfksnf1290883" + } + ] + } +} diff --git a/examples/spm_default/normalise.json b/examples/spm_default/normalise.json new file mode 100644 index 000000000..9c3da0973 --- /dev/null +++ b/examples/spm_default/normalise.json @@ -0,0 +1,60 @@ +{ + "@context": "https://raw.githubusercontent.com/cmaumet/BIDS-prov/context-type-indexing/context.json", + "@id": "http://example.org/ds00000X", + "generatedAt": "2020-03-10T10:00:00", + "wasGeneratedBy": { + "@id": "INRIA", + "@type": "Project", + "startedAt": "2016-09-01T10:00:00", + "wasAssociatedWith": { + "@id": "NIH", + "@type": "Organization", + "hadRole": "Funding" + } + }, + "records": { + "prov:Agent": [ + { + "@id": "RRID:SCR_007037", + "@type": "prov:SoftwareAgent", + "label": "SPM" + } + ], + "prov:Activity": [ + { + "@id": "niiri:fsdknfsqkldf12238123818288", + "label": "normalise func", + "wasAssociatedWith": "RRID:SCR_007037", + "startedAtTime": "10/10/2020 00:00:00", + "endedAtTime": "10/10/2020 01:00", + "used": "niiri:fdsjnflqj12381U39fdskjnf" + }, + { + "@id": "niiri:fsdknfsqkld123980932", + "label": "normalise anat", + "wasAssociatedWith": "RRID:SCR_007037", + "startedAtTime": "10/10/2020 00:00:00", + "endedAtTime": "10/10/2020 01:00", + "used": "niiri:102983fsdkjnfskjdfnks129" + } + ], + "prov:Entity": [ + { + "@id": "niiri:2378783298182821NDN", + "label": "normalised func", + "prov:atLocation": "func_normalised_location.nii", + + "wasGeneratedBy": "niiri:fsdknfsqkldf12238123818288", + "derivedFrom": "niiri:fdsjnflqj12381U39fdskjnf" + }, + { + "@id": "niiri:12837873NDN", + "label": "normalised anat", + "prov:atLocation": "anat_normalised_location.nii", + + "wasGeneratedBy": "niiri:fsdknfsqkld123980932", + "derivedFrom": "niiri:102983fsdkjnfskjdfnks129" + } + ] + } +} diff --git a/examples/spm_default/realign.json b/examples/spm_default/realign.json new file mode 100644 index 000000000..293266b3c --- /dev/null +++ b/examples/spm_default/realign.json @@ -0,0 +1,57 @@ +{ + "@context": "https://raw.githubusercontent.com/cmaumet/BIDS-prov/context-type-indexing/context.json", + "@id": "http://example.org/ds00000X", + "generatedAt": "2020-03-10T10:00:00", + "wasGeneratedBy": { + "@id": "INRIA", + "@type": "Project", + "startedAt": "2016-09-01T10:00:00", + "wasAssociatedWith": { + "@id": "NIH", + "@type": "Organization", + "hadRole": "Funding" + } + }, + "records": { + "prov:Agent": [ + { + "@id": "RRID:SCR_007037", + "@type": "prov:SoftwareAgent", + "label": "SPM" + } + ], + "prov:Activity": [ + { + "@id": "niiri:fdskjfnskjndflqkjndl", + "label": "realign", + "wasAssociatedWith": "RRID:SCR_007037", + "startedAtTime": "10/10/2020 00:00:00", + "endedAtTime": "10/10/2020 01:00:00", + "used": "niiri:sjhgdqd", + "attributes": [ + ["eoptions.quality", 0.9], + ["eoptions.sep", 4], + ["eoptions.fwhm", 5], + ["eoptions.rtm", 1], + ["eoptions.interp", 2], + ["eoptions.wrap", [0, 0, 0]], + ["eoptions.weight", ""], + ["roptions.which", [0, 1]], + ["roptions.wrap", [0, 0, 0]], + ["roptions.mask", 1], + ["roptions.prefix", "r"] + ] + } + ], + "prov:Entity": [ + { + "@id": "niiri:fdsjnflqj12381U39fdskjnf", + + "wasGeneratedBy": "niiri:fdskjfnskjndflqkjndl", + "derivedFrom": "niiri:sjhgdqd", + "label": "Realigned func", + "prov:atLocation": "TODO" + } + ] + } +} diff --git a/examples/spm_default/report.json b/examples/spm_default/report.json new file mode 100644 index 000000000..d99a7bd8c --- /dev/null +++ b/examples/spm_default/report.json @@ -0,0 +1,44 @@ +{ + "@context": "https://raw.githubusercontent.com/cmaumet/BIDS-prov/context-type-indexing/context.json", + "@id": "http://example.org/ds00000X", + "generatedAt": "2020-03-10T10:00:00", + "wasGeneratedBy": { + "@id": "INRIA", + "@type": "Project", + "startedAt": "2016-09-01T10:00:00", + "wasAssociatedWith": { + "@id": "NIH", + "@type": "Organization", + "hadRole": "Funding" + } + }, + "records": { + "prov:Agent": [ + { + "@id": "RRID:SCR_007037", + "@type": "prov:SoftwareAgent", + "label": "SPM" + } + ], + "prov:Activity": [ + { + "@id": "niiri:qkjsnd1283NDQSNKDQ", + "label": "export to PDF", + "wasAssociatedWith": "RRID:SCR_007037", + "startedAtTime": "2019-10-10T10:00:00", + "endedAtTime": "2019-10-10T10:00:00", + "used": "niiri:dsjknl1029d" + } + ], + "prov:Entity": [ + { + "@id": "niiri:djkfnslknlq1°", + "label": "PDF", + "generatedAt": "2019-10-10T10:00:00", + "derivedFrom": "niiri:dsjknl1029d", + "wasGeneratedBy": "niiri:qkjsnd1283NDQSNKDQ", + + } + ] + } +} diff --git a/examples/spm_default/smooth.json b/examples/spm_default/smooth.json new file mode 100644 index 000000000..94b4ce8fa --- /dev/null +++ b/examples/spm_default/smooth.json @@ -0,0 +1,50 @@ +{ + "@context": "https://raw.githubusercontent.com/cmaumet/BIDS-prov/context-type-indexing/context.json", + "@id": "http://example.org/ds00000X", + "generatedAt": "2020-03-10T10:00:00", + "wasGeneratedBy": { + "@id": "INRIA", + "@type": "Project", + "startedAt": "2016-09-01T10:00:00", + "wasAssociatedWith": { + "@id": "NIH", + "@type": "Organization", + "hadRole": "Funding" + } + }, + "records": { + "prov:Agent": [ + { + "@id": "RRID:SCR_007037", + "@type": "prov:SoftwareAgent", + "label": "SPM" + } + ], + "prov:Activity": [ + { + "@id": "niiri:smm343", + "label": "smooth", + "wasAssociatedWith": "RRID:SCR_007037", + "startedAtTime": "10/10/2020 00:02:00", + "endedAtTime": "10/10/2020 01:02:00", + "used": "niiri:2378783298182821NDN", + "attributes": [ + ["fwhm", [6, 6, 6]], + ["dtype", 0], + ["im", 0], + ["prefix", "s"] + ] + } + ], + "prov:Entity": [ + { + "@id": "niiri:fjsdnf290", + "label": "Smoothed functional images", + "prov:atLocation": "TODO", + + "wasGeneratedBy": "niiri:smm343", + "derivedFrom": "niiri:2378783298182821NDN" + } + ] + } +} diff --git a/examples/spm_default/spm_default.png b/examples/spm_default/spm_default.png new file mode 100644 index 000000000..e0cdd578c Binary files /dev/null and b/examples/spm_default/spm_default.png differ diff --git a/img/nidm-layer-cake.png b/img/nidm-layer-cake.png new file mode 100644 index 000000000..e040586e1 Binary files /dev/null and b/img/nidm-layer-cake.png differ diff --git a/img/w3c.svg b/img/w3c.svg new file mode 100644 index 000000000..8bbaa8366 --- /dev/null +++ b/img/w3c.svg @@ -0,0 +1,3 @@ + + +2012-11-25 17:39ZCanvas 1Layer 1usedendedAtTimewasAssociatedWithactedOnBehalfOfwasGeneratedBywasAttributedTowasDerivedFromwasInformedByActivityEntityAgentxsd:dateTimestartedAtTimexsd:dateTime diff --git a/new_features.md b/new_features.md new file mode 100644 index 000000000..e11306b83 --- /dev/null +++ b/new_features.md @@ -0,0 +1,9 @@ +### New features + +List of all features you can find in `examples/*.json` files, but are not mentionned in [the spec](https://docs.google.com/document/d/1vw3VNDof5cecv2PkFp7Lw_pNUTUo8-m8V4SIdtGJVKs/edit?usp=sharing) + +- [type indexing](https://w3c.github.io/json-ld-syntax/#node-type-indexing) +- Activity definitions, instead of just Agent and Entities +- Activities attributes defined via key/value list-like pairs, allowing to pass unstructured extra information +- Activities "used" field allow multiple entries : multiple entities as input +- [prov:wasInfluencedBy](https://www.w3.org/TR/prov-o/#wasInfluencedBy) to represent inplace edition of an entity, instead of outputting a new entity (a new "state" of the former entity) and a new Activity corresponding to the edition. This is to encourage human readable representations, as the number of nodes is reduced. diff --git a/proposed_concise_ontology/ConciseModel.jpg b/proposed_concise_ontology/ConciseModel.jpg new file mode 100644 index 000000000..6052c2b9c Binary files /dev/null and b/proposed_concise_ontology/ConciseModel.jpg differ diff --git a/proposed_concise_ontology/Provone Model.jpg b/proposed_concise_ontology/Provone Model.jpg new file mode 100644 index 000000000..5512e847e Binary files /dev/null and b/proposed_concise_ontology/Provone Model.jpg differ diff --git a/proposed_concise_ontology/TavernaWf4everModel.jpg b/proposed_concise_ontology/TavernaWf4everModel.jpg new file mode 100644 index 000000000..fb6a353cd Binary files /dev/null and b/proposed_concise_ontology/TavernaWf4everModel.jpg differ diff --git a/proposed_concise_ontology/collections.owl b/proposed_concise_ontology/collections.owl new file mode 100644 index 000000000..4e19e4892 --- /dev/null +++ b/proposed_concise_ontology/collections.owl @@ -0,0 +1,875 @@ + + + + + + + + + + + + +]> + + + + + 2.0 + March 19, 2012 + Marco Ocana + Paolo Ciccarese + Silvio Peroni + application/rdf+xml + en + The Collections Ontology +(CO) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + has element + The link to the members of a collection + + + + + + + + + + + + + is element of + The link to a collection in which the object is member. + + + + + + + + + + has first item + The link to the first item of the list. + + + + + + + + + 0 + + + + 1 + + + + + + + + + + + + is first item of + The link to a list in which the item is first item. + + + + + + + + + + + is followed by + Given the list (I[1], I[2], ... , I[i-1], I[i], I[i+1], ... , I[n-1], I[n]), the item I[i] is followed by I[i+1], ... , I[n-1] and I[n]. + The link to the following item in a list. + + + + + + + + + + has item + The link to every item of the bag + + + + + + + + + + + + + + + has item content + The link to the actual resource to which the item refers. + + + + + + + + + + + + + + is item content of + The link to the item that refers to the resource. + + + + + + + + + is item of + The link to a bag in which the item is member. + + + + + + + + + + has last item + The link to the last item of the list. + + + + + + + + + 0 + + + + + + + + + + + + is last item of + The link to a list in which the item is last item. + + + + + + + + + + + has next item + Given the list (I[1], I[2], ... , I[i-1], I[i], I[i+1], ... , I[n-1], I[n]), the next item of I[i] is I[i+1]. + The link to the next item in a list. + + + + + + + + + + is preceded by + Given the list (I[1], I[2], ... , I[i-1], I[i], I[i+1], ... , I[n-1], I[n]), the item I[i] is preceded by I[i-1], ... , I[2] and I[1]. + The link to the preceding item in a list. + + + + + + + + + + has previous item + Given the list (I[1], I[2], ... , I[i-1], I[i], I[i+1], ... , I[n-1], I[n]), the previous item of I[i] is I[i-1]. + The link to the previous item in a list. + + + + + + + + + + + + + + + + has index + A number identifying the position, starting from 1, of a particular list item within a list. + + + + + + + + + + has size + CO defines the size of a collection as the sum of the number of times entities that are part of the collection appear in it. This means that co:size considers how much each entity is involved by a particular collection, i.e.: +- the size of the set {a, b, c} is three +- the size of the bag [a, a, b, b, b, c] is five +- the size of the list (a, b, c, b, a, b, c, c) is seven + The number of item belonging to a collection. + + + + + + + + + + + + + + + bag + + + Collection that can have a number of copies of each object + + + + + + + + collection + + + + + + + + + + + 1 + + + + A group of objects that can be considered as a whole. + + + + + + + + item + + + + + + + + + + + + Element belonging to a bag + + + + + + + + list + + + + 1 + + + + + + 1 + + + + + + + + + + + + + + An ordered array of items, that can be present in multiple copies + + + + + + + + list item + + + + + 1 + + + element belonging to a list + + + + + + + + set + + A collection that cannot contain duplicate elements. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + A list item cannot be preceded by itself + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + A list item cannot be followed by itself + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/proposed_concise_ontology/concise_ver-0010.ttl b/proposed_concise_ontology/concise_ver-0010.ttl new file mode 100644 index 000000000..7a206f6d1 --- /dev/null +++ b/proposed_concise_ontology/concise_ver-0010.ttl @@ -0,0 +1,1516 @@ +@prefix : . +@prefix co: . +@prefix sd: . +@prefix owl: . +@prefix rdf: . +@prefix xml: . +@prefix xsd: . +@prefix prov: . +@prefix rdfs: . +@prefix provo: . +@prefix schema: . +@prefix provone: . +@base . + + rdf:type owl:Ontology ; + owl:imports ; + rdfs:comment "Include inferred axioms"@en ; + owl:versionInfo "0.0.10" . + +################################################################# +# Annotation properties +################################################################# + +### http://www.w3.org/ns/prov#definition +prov:definition rdf:type owl:AnnotationProperty ; + rdfs:comment "A definition quoted from PROV-DM or PROV-CONSTRAINTS that describes the concept expressed with this OWL term."@en ; + rdfs:isDefinedBy provo: . + + +### http://www.w3.org/ns/prov#inverse +prov:inverse rdf:type owl:AnnotationProperty ; + rdfs:comment "PROV-O does not define all property inverses. The directionalities defined in PROV-O should be given preference over those not defined. However, if users wish to name the inverse of a PROV-O property, the local name given by prov:inverse should be used."@en ; + rdfs:isDefinedBy provo: ; + rdfs:seeAlso . + + +################################################################# +# Object Properties +################################################################# + +### http://purl.dataone.org/provone/2015/01/15/ontology#hasSubProgram +provone:hasSubProgram rdf:type owl:ObjectProperty ; + rdfs:domain provone:Program ; + rdfs:range provone:Program ; + rdfs:comment "Specifies the recursive composition of Programs, where a parent Program includes a child Program as part of its specification." ; + rdfs:label "hasSubProgram" . + + +### http://purl.dataone.org/provone/2015/01/15/ontology#wasPartOf +provone:wasPartOf rdf:type owl:ObjectProperty ; + rdfs:domain provone:Execution ; + rdfs:range provone:Execution ; + rdfs:comment "Specifies the structure of Execution instances, where a parent Execution (associated with a Workflow) had child Executions (associated with Programs and subworkflows)." ; + rdfs:label "wasPartOf" . + + +### http://schema.org/author +schema:author rdf:type owl:ObjectProperty . + + +### http://schema.org/contributor +schema:contributor rdf:type owl:ObjectProperty . + + +### http://www.semanticweb.org/concise#hadExecutionCommand +:hadExecutionCommand rdf:type owl:ObjectProperty ; + rdfs:subPropertyOf owl:topObjectProperty ; + rdfs:domain provone:Execution ; + rdfs:range :ExecutionCommand . + + +### http://www.semanticweb.org/concise#hadInput +:hadInput rdf:type owl:ObjectProperty ; + rdfs:subPropertyOf prov:used , + [ owl:inverseOf prov:wasUsedBy + ] ; + owl:inverseOf :wasInputOf ; + rdfs:domain provone:Execution ; + rdfs:range prov:Entity . + + +### http://www.semanticweb.org/concise#hadOutput +:hadOutput rdf:type owl:ObjectProperty ; + rdfs:subPropertyOf prov:generated , + [ owl:inverseOf prov:wasGeneratedBy + ] ; + owl:inverseOf :wasOutputOf ; + rdfs:domain provone:Execution ; + rdfs:range prov:Entity . + + +### http://www.semanticweb.org/concise#hadPlan +:hadPlan rdf:type owl:ObjectProperty ; + rdfs:subPropertyOf prov:wasInfluencedBy , + [ owl:inverseOf prov:influenced + ] ; + rdfs:domain prov:Activity ; + rdfs:range prov:Plan . + + +### http://www.semanticweb.org/concise#hasArtefact +:hasArtefact rdf:type owl:ObjectProperty ; + rdfs:domain provone:ParameterData ; + rdfs:range :Artefact . + + +### http://www.semanticweb.org/concise#hasBaseCommand +:hasBaseCommand rdf:type owl:ObjectProperty ; + rdfs:domain provone:Program ; + rdfs:range :BaseCommand . + + +### http://www.semanticweb.org/concise#hasContent +:hasContent rdf:type owl:ObjectProperty ; + rdfs:domain prov:Entity . + + +### http://www.semanticweb.org/concise#hasFormat +:hasFormat rdf:type owl:ObjectProperty ; + rdfs:domain [ rdf:type owl:Class ; + owl:unionOf ( provone:ParameterData + :Artefact + ) + ] ; + rdfs:range :DataFormat . + + +### http://www.semanticweb.org/concise#hasInput +:hasInput rdf:type owl:ObjectProperty ; + owl:inverseOf :isInputOf ; + rdfs:domain provone:Program ; + rdfs:range provone:ParameterData ; + rdfs:comment "This is loosely related to provone:hasDefaultParam, except that the latter is related to a Program through an additional provone:hasInPort object property and provone:Port class."@en . + + +### http://www.semanticweb.org/concise#hasOutput +:hasOutput rdf:type owl:ObjectProperty ; + owl:inverseOf :isOutputOf ; + rdfs:domain provone:Program ; + rdfs:range provone:ParameterData ; + rdfs:comment "This is loosely related to provone:hasDefaultParam, except that the latter is related to a Program through an additional provone:hasOutPort object property and provone:Port class."@en . + + +### http://www.semanticweb.org/concise#hasPurpose +:hasPurpose rdf:type owl:ObjectProperty ; + rdfs:domain provone:Program , + sd:Software . + + +### http://www.semanticweb.org/concise#hasSource +:hasSource rdf:type owl:ObjectProperty ; + rdfs:domain prov:Entity ; + rdfs:range prov:Entity . + + +### http://www.semanticweb.org/concise#isInputOf +:isInputOf rdf:type owl:ObjectProperty . + + +### http://www.semanticweb.org/concise#isOutputOf +:isOutputOf rdf:type owl:ObjectProperty . + + +### http://www.semanticweb.org/concise#wasDescribedBy +:wasDescribedBy rdf:type owl:ObjectProperty ; + rdfs:subPropertyOf prov:wasInfluencedBy , + [ owl:inverseOf prov:influenced + ] ; + rdfs:domain prov:Entity ; + rdfs:range prov:Entity . + + +### http://www.semanticweb.org/concise#wasInputOf +:wasInputOf rdf:type owl:ObjectProperty ; + rdfs:subPropertyOf prov:wasUsedBy , + [ owl:inverseOf prov:used + ] . + + +### http://www.semanticweb.org/concise#wasOutputOf +:wasOutputOf rdf:type owl:ObjectProperty ; + rdfs:subPropertyOf prov:wasGeneratedBy , + [ owl:inverseOf prov:generated + ] . + + +### http://www.w3.org/2002/07/owl#topObjectProperty +owl:topObjectProperty rdf:type owl:ObjectProperty , + owl:SymmetricProperty , + owl:TransitiveProperty , + owl:ReflexiveProperty . + + +### http://www.w3.org/ns/prov#actedOnBehalfOf +prov:actedOnBehalfOf rdf:type owl:ObjectProperty ; + rdfs:subPropertyOf prov:wasInfluencedBy , + [ owl:inverseOf prov:influenced + ] ; + owl:inverseOf prov:hadDelegate ; + rdfs:domain prov:Agent ; + rdfs:range prov:Agent ; + rdfs:comment "An object property to express the accountability of an agent towards another agent. The subordinate agent acted on behalf of the responsible agent in an actual activity. "@en ; + rdfs:isDefinedBy provo: ; + rdfs:label "actedOnBehalfOf" ; + prov:inverse "hadDelegate" . + + +### http://www.w3.org/ns/prov#alternateOf +prov:alternateOf rdf:type owl:ObjectProperty ; + owl:inverseOf prov:alternateOf ; + rdf:type owl:SymmetricProperty ; + rdfs:domain prov:Entity ; + rdfs:range prov:Entity ; + rdfs:isDefinedBy prov: , + provo: , + ; + rdfs:label "alternateOf" ; + rdfs:seeAlso prov:specializationOf ; + prov:definition "Two alternate entities present aspects of the same thing. These aspects may be the same or different, and the alternate entities may or may not overlap in time."@en ; + prov:inverse "alternateOf" . + + +### http://www.w3.org/ns/prov#atLocation +prov:atLocation rdf:type owl:ObjectProperty ; + owl:inverseOf prov:locationOf ; + rdfs:range prov:Location ; + rdfs:comment "The Location of any resource."@en , + "This property has multiple RDFS domains to suit multiple OWL Profiles. See PROV-O OWL Profile." ; + rdfs:isDefinedBy provo: ; + rdfs:label "atLocation" ; + prov:inverse "locationOf" . + + +### http://www.w3.org/ns/prov#generalizationOf +prov:generalizationOf rdf:type owl:ObjectProperty ; + rdfs:subPropertyOf prov:alternateOf , + [ owl:inverseOf prov:alternateOf + ] ; + owl:inverseOf prov:specializationOf ; + rdfs:isDefinedBy prov: , + ; + rdfs:label "generalizationOf" . + + +### http://www.w3.org/ns/prov#generated +prov:generated rdf:type owl:ObjectProperty ; + rdfs:subPropertyOf prov:influenced , + [ owl:inverseOf prov:wasInfluencedBy + ] ; + owl:inverseOf prov:wasGeneratedBy ; + rdfs:domain prov:Activity ; + rdfs:range prov:Entity ; + rdfs:isDefinedBy prov: , + provo: , + ; + rdfs:label "generated" ; + prov:inverse "wasGeneratedBy" . + + +### http://www.w3.org/ns/prov#hadDelegate +prov:hadDelegate rdf:type owl:ObjectProperty ; + rdfs:subPropertyOf prov:influenced , + [ owl:inverseOf prov:wasInfluencedBy + ] . + + +### http://www.w3.org/ns/prov#hadDictionaryMember +prov:hadDictionaryMember rdf:type owl:ObjectProperty ; + rdfs:domain prov:Dictionary ; + rdfs:range prov:KeyEntityPair ; + rdfs:isDefinedBy prov: ; + rdfs:label "hadDictionaryMember" ; + prov:definition "Describes the key-entity pair that was member of a prov:Dictionary. A dictionary can have multiple members." . + + +### http://www.w3.org/ns/prov#hadMember +prov:hadMember rdf:type owl:ObjectProperty ; + rdfs:subPropertyOf prov:wasInfluencedBy , + [ owl:inverseOf prov:influenced + ] ; + owl:inverseOf prov:wasMemberOf ; + rdfs:domain prov:Collection ; + rdfs:isDefinedBy provo: ; + rdfs:label "hadMember" ; + prov:inverse "wasMemberOf" . + + +### http://www.w3.org/ns/prov#influenced +prov:influenced rdf:type owl:ObjectProperty ; + owl:inverseOf prov:wasInfluencedBy ; + rdfs:isDefinedBy prov: , + provo: , + ; + rdfs:label "influenced" ; + prov:inverse "wasInfluencedBy" . + + +### http://www.w3.org/ns/prov#informed +prov:informed rdf:type owl:ObjectProperty ; + rdfs:subPropertyOf prov:influenced , + [ owl:inverseOf prov:wasInfluencedBy + ] ; + owl:inverseOf prov:wasInformedBy ; + rdfs:isDefinedBy prov: , + ; + rdfs:label "informed" . + + +### http://www.w3.org/ns/prov#locationOf +prov:locationOf rdf:type owl:ObjectProperty ; + rdfs:isDefinedBy prov: , + ; + rdfs:label "locationOf" . + + +### http://www.w3.org/ns/prov#pairEntity +prov:pairEntity rdf:type owl:ObjectProperty , + owl:FunctionalProperty ; + rdfs:domain prov:KeyEntityPair ; + rdfs:range prov:Entity ; + rdfs:isDefinedBy prov: ; + rdfs:label "pairKey" ; + prov:definition "The entity of a prov:KeyEntityPair, which is an element of a prov:Dictionary." . + + +### http://www.w3.org/ns/prov#specializationOf +prov:specializationOf rdf:type owl:ObjectProperty ; + rdfs:subPropertyOf owl:topObjectProperty , + prov:alternateOf , + [ owl:inverseOf prov:alternateOf + ] ; + rdfs:domain prov:Entity ; + rdfs:isDefinedBy prov: , + provo: ; + rdfs:label "specializationOf" ; + rdfs:seeAlso prov:alternateOf ; + prov:definition "An entity that is a specialization of another shares all aspects of the latter, and additionally presents more specific aspects of the same thing as the latter. In particular, the lifetime of the entity being specialized contains that of any specialization. Examples of aspects include a time period, an abstraction, and a context associated with the entity."@en ; + prov:inverse "generalizationOf" . + + +### http://www.w3.org/ns/prov#used +prov:used rdf:type owl:ObjectProperty ; + rdfs:subPropertyOf prov:wasInfluencedBy , + [ owl:inverseOf prov:influenced + ] ; + owl:inverseOf prov:wasUsedBy ; + rdfs:domain provone:Execution , + prov:Activity ; + rdfs:range prov:Entity ; + rdfs:comment "A prov:Entity that was used by this prov:Activity. For example, :baking prov:used :spoon, :egg, :oven ."@en ; + rdfs:isDefinedBy provo: ; + rdfs:label "used" ; + prov:inverse "wasUsedBy" . + + +### http://www.w3.org/ns/prov#wasAssociateFor +prov:wasAssociateFor rdf:type owl:ObjectProperty ; + rdfs:subPropertyOf prov:influenced , + [ owl:inverseOf prov:wasInfluencedBy + ] ; + owl:inverseOf prov:wasAssociatedWith . + + +### http://www.w3.org/ns/prov#wasAssociatedWith +prov:wasAssociatedWith rdf:type owl:ObjectProperty ; + rdfs:subPropertyOf prov:wasInfluencedBy , + [ owl:inverseOf prov:influenced + ] ; + rdfs:domain provone:Execution , + prov:Activity ; + rdfs:range provone:User , + prov:Agent ; + rdfs:comment "An prov:Agent that had some (unspecified) responsibility for the occurrence of this prov:Activity."@en ; + rdfs:isDefinedBy provo: ; + rdfs:label "wasAssociatedWith" ; + prov:inverse "wasAssociateFor" . + + +### http://www.w3.org/ns/prov#wasGeneratedBy +prov:wasGeneratedBy rdf:type owl:ObjectProperty ; + rdfs:subPropertyOf prov:wasInfluencedBy , + [ owl:inverseOf prov:influenced + ] ; + rdfs:domain prov:Entity ; + rdfs:range provone:Execution , + prov:Activity ; + rdfs:isDefinedBy prov: , + provo: , + ; + rdfs:label "wasGeneratedBy" ; + prov:inverse "generated" . + + +### http://www.w3.org/ns/prov#wasInfluencedBy +prov:wasInfluencedBy rdf:type owl:ObjectProperty ; + rdfs:domain [ rdf:type owl:Class ; + owl:unionOf ( prov:Activity + prov:Agent + prov:Entity + ) + ] ; + rdfs:range [ rdf:type owl:Class ; + owl:unionOf ( prov:Activity + prov:Agent + prov:Entity + ) + ] ; + rdfs:comment "Because prov:wasInfluencedBy is a broad relation, its more specific subproperties (e.g. prov:wasInformedBy, prov:actedOnBehalfOf, prov:wasEndedBy, etc.) should be used when applicable."@en , + "This property has multiple RDFS domains to suit multiple OWL Profiles. See PROV-O OWL Profile." ; + rdfs:isDefinedBy prov: , + provo: , + ; + rdfs:label "wasInfluencedBy" ; + prov:inverse "influenced" . + + +### http://www.w3.org/ns/prov#wasInformedBy +prov:wasInformedBy rdf:type owl:ObjectProperty ; + rdfs:subPropertyOf prov:wasInfluencedBy , + [ owl:inverseOf prov:influenced + ] ; + rdfs:domain provone:Execution , + prov:Activity ; + rdfs:range provone:Execution , + prov:Activity ; + rdfs:comment "An activity a2 is dependent on or informed by another activity a1, by way of some unspecified entity that is generated by a1 and used by a2."@en ; + rdfs:isDefinedBy provo: ; + rdfs:label "wasInformedBy" ; + prov:inverse "informed" . + + +### http://www.w3.org/ns/prov#wasMemberOf +prov:wasMemberOf rdf:type owl:ObjectProperty ; + rdfs:subPropertyOf prov:influenced , + [ owl:inverseOf prov:wasInfluencedBy + ] ; + rdfs:isDefinedBy prov: , + ; + rdfs:label "wasMemberOf" . + + +### http://www.w3.org/ns/prov#wasUsedBy +prov:wasUsedBy rdf:type owl:ObjectProperty ; + rdfs:subPropertyOf prov:influenced , + [ owl:inverseOf prov:wasInfluencedBy + ] ; + rdfs:isDefinedBy prov: , + ; + rdfs:label "wasUsedBy" . + + +### https://w3id.org/okn/o/sd#author +sd:author rdf:type owl:ObjectProperty ; + rdfs:subPropertyOf schema:author ; + rdfs:domain sd:Software ; + rdfs:range [ rdf:type owl:Class ; + owl:unionOf ( sd:Organization + sd:Person + ) + ] ; + rdfs:comment "The creator of a software component"@en ; + rdfs:label "author"@en . + + +### https://w3id.org/okn/o/sd#contributor +sd:contributor rdf:type owl:ObjectProperty ; + rdfs:subPropertyOf schema:contributor ; + rdfs:domain sd:Software ; + rdfs:range sd:Person ; + rdfs:comment "Contributor to a software component"@en ; + rdfs:label "contributor"@en . + + +### https://w3id.org/okn/o/sd#hasConfiguration +sd:hasConfiguration rdf:type owl:ObjectProperty ; + rdfs:domain sd:SoftwareVersion ; + rdfs:range sd:SoftwareConfiguration ; + rdfs:comment "Property that links a model to one of its configurations. A model may have multiple configurations, each of which is unique in terms of the inputs and outputs it uses."@en ; + rdfs:label "hasConfiguration"@en . + + +### https://w3id.org/okn/o/sd#hasParameter +sd:hasParameter rdf:type owl:ObjectProperty ; + rdfs:domain sd:SoftwareConfiguration ; + rdfs:range :Literal ; + rdfs:comment "Property that indicates the parameters of a model configuration"@en ; + rdfs:label "hasParameter"@en . + + +### https://w3id.org/okn/o/sd#hasSoftwareImage +sd:hasSoftwareImage rdf:type owl:ObjectProperty , + owl:FunctionalProperty ; + rdfs:domain sd:SoftwareConfiguration ; + rdfs:range sd:SoftwareImage ; + rdfs:comment "Function to link a function with its corresponding container"@en ; + rdfs:label "hasSoftwareImage"@en . + + +### https://w3id.org/okn/o/sd#hasSourceCode +sd:hasSourceCode rdf:type owl:ObjectProperty , + owl:FunctionalProperty ; + rdfs:domain sd:Software ; + rdfs:range sd:SourceCode ; + rdfs:comment "Property designed to link a software with its software source code (which may reside in a code repository such as GitHub)"@en ; + rdfs:label "hasSourceCode"@en . + + +### https://w3id.org/okn/o/sd#hasVersion +sd:hasVersion rdf:type owl:ObjectProperty ; + rdfs:domain sd:Software ; + rdfs:range sd:SoftwareVersion ; + rdfs:comment "Property designed to link a software component with its corresponding versions"@en ; + rdfs:label "hasSoftwareVersion"@en . + + +################################################################# +# Data properties +################################################################# + +### http://schema.org/codeRepository +schema:codeRepository rdf:type owl:DatatypeProperty ; + rdfs:isDefinedBy schema: . + + +### http://schema.org/dateCreated +schema:dateCreated rdf:type owl:DatatypeProperty ; + rdfs:isDefinedBy schema: . + + +### http://schema.org/datePublished +schema:datePublished rdf:type owl:DatatypeProperty ; + rdfs:isDefinedBy schema: . + + +### http://schema.org/description +schema:description rdf:type owl:DatatypeProperty ; + rdfs:isDefinedBy schema: . + + +### http://schema.org/email +schema:email rdf:type owl:DatatypeProperty ; + rdfs:isDefinedBy schema: . + + +### http://schema.org/identifier +schema:identifier rdf:type owl:DatatypeProperty ; + rdfs:isDefinedBy schema: . + + +### http://schema.org/license +schema:license rdf:type owl:DatatypeProperty ; + rdfs:isDefinedBy schema: . + + +### http://schema.org/programmingLanguage +schema:programmingLanguage rdf:type owl:DatatypeProperty ; + rdfs:isDefinedBy schema: . + + +### http://www.semanticweb.org/concise#hasFlag +:hasFlag rdf:type owl:DatatypeProperty , + owl:FunctionalProperty ; + rdfs:domain provone:ParameterData ; + rdfs:range xsd:string . + + +### http://www.semanticweb.org/concise#hasFlagSeparator +:hasFlagSeparator rdf:type owl:DatatypeProperty , + owl:FunctionalProperty ; + rdfs:domain provone:ParameterData ; + rdfs:range xsd:string . + + +### http://www.semanticweb.org/concise#isOptional +:isOptional rdf:type owl:DatatypeProperty ; + rdfs:domain provone:ParameterData ; + rdfs:range xsd:boolean . + + +### http://www.semanticweb.org/concise#pairValue +:pairValue rdf:type owl:DatatypeProperty , + owl:FunctionalProperty ; + rdfs:domain :KeyValPair ; + rdfs:range rdfs:Literal . + + +### http://www.w3.org/ns/prov#endedAtTime +prov:endedAtTime rdf:type owl:DatatypeProperty , + owl:FunctionalProperty ; + rdfs:domain prov:Activity ; + rdfs:range xsd:dateTime ; + rdfs:comment "The time at which an activity ended. See also prov:startedAtTime."@en ; + rdfs:isDefinedBy provo: ; + rdfs:label "endedAtTime" . + + +### http://www.w3.org/ns/prov#pairKey +prov:pairKey rdf:type owl:DatatypeProperty , + owl:FunctionalProperty ; + rdfs:domain [ rdf:type owl:Class ; + owl:unionOf ( :KeyValPair + prov:KeyEntityPair + ) + ] ; + rdfs:range rdfs:Literal ; + rdfs:isDefinedBy prov: ; + rdfs:label "pairKey" ; + prov:definition "The key of a prov:KeyEntityPair, which is an element of a prov:Dictionary." . + + +### http://www.w3.org/ns/prov#startedAtTime +prov:startedAtTime rdf:type owl:DatatypeProperty , + owl:FunctionalProperty ; + rdfs:domain prov:Activity ; + rdfs:range xsd:dateTime ; + rdfs:comment "The time at which an activity started. See also prov:endedAtTime."@en ; + rdfs:isDefinedBy provo: ; + rdfs:label "startedAtTime" . + + +### http://www.w3.org/ns/prov#value +prov:value rdf:type owl:DatatypeProperty ; + rdfs:domain prov:Entity ; + rdfs:comment """The editor's definition comes from http://www.w3.org/TR/rdf-primer/#rdfvalue + +This property serves the same purpose as rdf:value, but has been reintroduced to avoid some of the definitional ambiguity in the RDF specification (specifically, 'may be used in describing structured values')."""@en ; + rdfs:isDefinedBy provo: ; + rdfs:label "value" ; + prov:definition "Provides a value that is a direct representation of an entity."@en . + + +### https://codemeta.github.io/terms/issueTracker + rdf:type owl:DatatypeProperty . + + +### https://codemeta.github.io/terms/referencePublication + rdf:type owl:DatatypeProperty ; + rdfs:isDefinedBy . + + +### https://w3id.org/okn/o/sd#availableInRegistry +sd:availableInRegistry rdf:type owl:DatatypeProperty , + owl:FunctionalProperty ; + rdfs:domain sd:SoftwareImage ; + rdfs:range xsd:anyURI ; + rdfs:comment "Property that indicates in which registry the software image being described can be found. For example, https://hub.docker.com"@en ; + rdfs:label "available in registry"@en . + + +### https://w3id.org/okn/o/sd#codeRepository +sd:codeRepository rdf:type owl:DatatypeProperty ; + rdfs:subPropertyOf schema:codeRepository ; + rdf:type owl:FunctionalProperty ; + rdfs:domain sd:SourceCode ; + rdfs:range xsd:anyURI ; + rdfs:comment "URL to the code repository of a software component"@en ; + rdfs:label "code repository"@en . + + +### https://w3id.org/okn/o/sd#dataCatalogIdentifier +sd:dataCatalogIdentifier rdf:type owl:DatatypeProperty ; + rdfs:subPropertyOf schema:identifier ; + rdf:type owl:FunctionalProperty ; + rdfs:domain sd:SampleResource ; + rdfs:range xsd:string ; + rdfs:comment "An identifier for resources with metadata entries in a data catalog"@en ; + rdfs:label "data catalog identifier"@en . + + +### https://w3id.org/okn/o/sd#dateCreated +sd:dateCreated rdf:type owl:DatatypeProperty ; + rdfs:subPropertyOf schema:dateCreated ; + rdf:type owl:FunctionalProperty ; + rdfs:domain sd:Software ; + rdfs:range xsd:dateTime ; + rdfs:comment "Date when a software component was created"@en ; + rdfs:label "date created"@en . + + +### https://w3id.org/okn/o/sd#datePublished +sd:datePublished rdf:type owl:DatatypeProperty ; + rdfs:subPropertyOf schema:datePublished ; + rdf:type owl:FunctionalProperty ; + rdfs:domain sd:Software ; + rdfs:range xsd:dateTime ; + rdfs:comment "Date when a software component was published"@en ; + rdfs:label "date published"@en . + + +### https://w3id.org/okn/o/sd#description +sd:description rdf:type owl:DatatypeProperty ; + rdfs:subPropertyOf schema:description ; + rdf:type owl:FunctionalProperty ; + rdfs:domain [ rdf:type owl:Class ; + owl:unionOf ( :Literal + owl:Thing + sd:NumericalIndex + sd:Organization + sd:Person + sd:SampleExecution + sd:SampleResource + sd:Software + sd:SourceCode + sd:Variable + sd:Visualization + ) + ] ; + rdfs:range xsd:string ; + rdfs:comment "A description of a resource"@en ; + rdfs:label "description"@en . + + +### https://w3id.org/okn/o/sd#doi +sd:doi rdf:type owl:DatatypeProperty ; + rdfs:subPropertyOf sd:identifier ; + rdf:type owl:FunctionalProperty ; + rdfs:domain sd:Software ; + rdfs:range xsd:string ; + rdfs:comment "Digital Object Identifier associated with a software component"@en ; + rdfs:label "doi"@en . + + +### https://w3id.org/okn/o/sd#email +sd:email rdf:type owl:DatatypeProperty ; + rdfs:subPropertyOf schema:email ; + rdf:type owl:FunctionalProperty ; + rdfs:domain sd:Person ; + rdfs:range xsd:string ; + rdfs:comment "Email of a person"@en ; + rdfs:label "email"@en . + + +### https://w3id.org/okn/o/sd#hasAcceptedValues +sd:hasAcceptedValues rdf:type owl:DatatypeProperty , + owl:FunctionalProperty ; + rdfs:domain :Literal ; + rdfs:range xsd:string ; + rdfs:comment "Property that constraints which values are accepted for a parameter. For example, the name of a crop can only be \"Maize\" or \"Sorghum\""@en ; + rdfs:label "has accepted values"@en . + + +### https://w3id.org/okn/o/sd#hasAssumption +sd:hasAssumption rdf:type owl:DatatypeProperty , + owl:FunctionalProperty ; + rdfs:domain sd:Software ; + rdfs:range xsd:string ; + rdfs:comment "Assumptions of a software, e.g. the solver being used for a particular model, the source of the data (e.g., all data must have a given resolution), etc."@en ; + rdfs:label "has assumption"@en . + + +### https://w3id.org/okn/o/sd#hasDataType +sd:hasDataType rdf:type owl:DatatypeProperty , + owl:FunctionalProperty ; + rdfs:domain :Literal ; + rdfs:range xsd:string ; + rdfs:comment "Property that indicates the data type of a parameter"@en ; + rdfs:label "has data type"@en . + + +### https://w3id.org/okn/o/sd#hasDefaultValue +sd:hasDefaultValue rdf:type owl:DatatypeProperty , + owl:FunctionalProperty ; + rdfs:domain [ rdf:type owl:Class ; + owl:unionOf ( :Literal + sd:VariablePresentation + ) + ] ; + rdfs:range [ rdf:type rdfs:Datatype ; + owl:unionOf ( xsd:anyURI + xsd:boolean + xsd:dateTime + xsd:float + xsd:integer + xsd:string + ) + ] ; + rdfs:comment "Default accepted value of a variable presentation (or a parameter)"@en ; + rdfs:label "has default value"@en . + + +### https://w3id.org/okn/o/sd#hasDimensionality +sd:hasDimensionality rdf:type owl:DatatypeProperty , + owl:FunctionalProperty ; + rdfs:domain sd:DatasetSpecification ; + rdfs:range xsd:integer ; + rdfs:comment "Property to indicate dimensionality of the input or output of a dataset specification"@en ; + rdfs:label "has dimensionality"@en . + + +### https://w3id.org/okn/o/sd#hasDocumentation +sd:hasDocumentation rdf:type owl:DatatypeProperty , + owl:FunctionalProperty ; + rdfs:domain sd:Software ; + rdfs:range xsd:anyURI ; + rdfs:comment "Pointer to the documentation of the model"@en ; + rdfs:label "has documentation"@en . + + +### https://w3id.org/okn/o/sd#hasDownloadURL +sd:hasDownloadURL rdf:type owl:DatatypeProperty , + owl:FunctionalProperty ; + rdfs:domain sd:Software ; + rdfs:range xsd:anyURI ; + rdfs:comment "Download URL where to obtain the source/executable of the software"@en ; + rdfs:label "has download URL"@en . + + +### https://w3id.org/okn/o/sd#hasExample +sd:hasExample rdf:type owl:DatatypeProperty , + owl:FunctionalProperty ; + rdfs:domain sd:Software ; + rdfs:range xsd:string ; + rdfs:comment "An example explaining a scenario where the software component was used in plain language."@en ; + rdfs:label "has example"@en . + + +### https://w3id.org/okn/o/sd#hasExecutableInstructions +sd:hasExecutableInstructions rdf:type owl:DatatypeProperty , + owl:FunctionalProperty ; + rdfs:domain sd:Software ; + rdfs:range xsd:string ; + rdfs:comment "Instructions that indicate how a software component should be executed. The difference with `hasExecutionCommand` is that the execution instructions aim to be human-readable, and have explanations between the different commands and instructions"@en ; + rdfs:label "has executable instructions"@en . + + +### https://w3id.org/okn/o/sd#hasExecutableNotebook +sd:hasExecutableNotebook rdf:type owl:DatatypeProperty , + owl:FunctionalProperty ; + rdfs:domain sd:Software ; + rdfs:range xsd:anyURI ; + rdfs:comment "Property that links a software component with an executable notebook (e.g., Jupyter notebook) that illustrates how to use it in an executable manner."@en ; + rdfs:label "has executable notebook"@en . + + +### https://w3id.org/okn/o/sd#hasExecutionCommand +sd:hasExecutionCommand rdf:type owl:DatatypeProperty , + owl:FunctionalProperty ; + rdfs:domain [ rdf:type owl:Class ; + owl:unionOf ( sd:SampleExecution + sd:SoftwareConfiguration + sd:SoftwareImage + ) + ] ; + rdfs:range xsd:string ; + rdfs:comment "Execution instructions on how to run the image"@en ; + rdfs:label "hasExecutionCommand"@en . + + +### https://w3id.org/okn/o/sd#hasFixedValue +sd:hasFixedValue rdf:type owl:DatatypeProperty , + owl:FunctionalProperty ; + rdfs:domain :Literal ; + rdfs:range [ rdf:type rdfs:Datatype ; + owl:unionOf ( xsd:anyURI + xsd:boolean + xsd:dateTime + xsd:float + xsd:integer + xsd:string + ) + ] ; + rdfs:comment "Value of a parameter in a software setup."@en ; + rdfs:label "has fixed value"@en . + + +### https://w3id.org/okn/o/sd#hasFormat +sd:hasFormat rdf:type owl:DatatypeProperty , + owl:FunctionalProperty ; + rdfs:domain [ rdf:type owl:Class ; + owl:unionOf ( sd:DatasetSpecification + sd:Visualization + ) + ] ; + rdfs:range xsd:string ; + rdfs:comment "Format followed by a file. For example, txt, nc, etc."@en ; + rdfs:label "has format"@en . + + +### https://w3id.org/okn/o/sd#hasImplementationScriptLocation +sd:hasImplementationScriptLocation rdf:type owl:DatatypeProperty , + owl:FunctionalProperty ; + rdfs:domain sd:SoftwareConfiguration ; + rdfs:range xsd:anyURI ; + rdfs:comment "Property that points to the main runnable script for the current function"@en ; + rdfs:label "has implementation script location"@en . + + +### https://w3id.org/okn/o/sd#hasInstallationInstructions +sd:hasInstallationInstructions rdf:type owl:DatatypeProperty , + owl:FunctionalProperty ; + rdfs:domain sd:Software ; + rdfs:range xsd:string ; + rdfs:comment "Instructions required to install this particular piece of software. Installation instructions usually are available in a human-readable manner."@en ; + rdfs:label "has installation instructions"@en . + + +### https://w3id.org/okn/o/sd#hasMaximumAcceptedValue +sd:hasMaximumAcceptedValue rdf:type owl:DatatypeProperty , + owl:FunctionalProperty ; + rdfs:domain [ rdf:type owl:Class ; + owl:unionOf ( :Literal + sd:VariablePresentation + ) + ] ; + rdfs:range [ rdf:type rdfs:Datatype ; + owl:unionOf ( xsd:dateTime + xsd:float + xsd:integer + ) + ] ; + rdfs:comment "Maximum accepted value of a variable presentation (or a parameter)"@en ; + rdfs:label "has maximum accepted value"@en . + + +### https://w3id.org/okn/o/sd#hasMinimumAcceptedValue +sd:hasMinimumAcceptedValue rdf:type owl:DatatypeProperty , + owl:FunctionalProperty ; + rdfs:domain [ rdf:type owl:Class ; + owl:unionOf ( :Literal + sd:VariablePresentation + ) + ] ; + rdfs:range [ rdf:type rdfs:Datatype ; + owl:unionOf ( xsd:dateTime + xsd:float + xsd:integer + ) + ] ; + rdfs:comment "Minimum accepted value of a variable presentation (or a parameter)"@en ; + rdfs:label "has minimum accepted value"@en . + + +### https://w3id.org/okn/o/sd#hasVersionId +sd:hasVersionId rdf:type owl:DatatypeProperty ; + rdfs:subPropertyOf schema:identifier ; + rdf:type owl:FunctionalProperty ; + rdfs:domain sd:SoftwareVersion ; + rdfs:range xsd:string ; + rdfs:comment "Identifier of the version of this software"@en ; + rdfs:label "has version id"@en . + + +### https://w3id.org/okn/o/sd#identifier +sd:identifier rdf:type owl:DatatypeProperty ; + rdfs:subPropertyOf schema:identifier ; + rdf:type owl:FunctionalProperty ; + rdfs:domain [ rdf:type owl:Class ; + owl:unionOf ( sd:Organization + sd:Person + sd:Software + ) + ] ; + rdfs:range xsd:string ; + rdfs:comment "Identifier of the resource being described"@en ; + rdfs:label "identifier"@en . + + +### https://w3id.org/okn/o/sd#issueTracker +sd:issueTracker rdf:type owl:DatatypeProperty ; + rdfs:subPropertyOf ; + rdf:type owl:FunctionalProperty ; + rdfs:domain sd:Software ; + rdfs:range xsd:anyURI ; + rdfs:comment "Pointer to the issue tracker of a software component"@en ; + rdfs:label "issue tracker"@en . + + +### https://w3id.org/okn/o/sd#license +sd:license rdf:type owl:DatatypeProperty ; + rdfs:subPropertyOf schema:license ; + rdf:type owl:FunctionalProperty ; + rdfs:domain [ rdf:type owl:Class ; + owl:unionOf ( sd:Software + sd:SourceCode + ) + ] ; + rdfs:range xsd:anyURI ; + rdfs:comment "License of a software component or its source code"@en ; + rdfs:label "license"@en . + + +### https://w3id.org/okn/o/sd#pathLocation +sd:pathLocation rdf:type owl:DatatypeProperty , + owl:FunctionalProperty ; + rdfs:domain sd:DatasetSpecification ; + rdfs:range xsd:string ; + rdfs:comment """Property that indicates the relative path of an input or output with respect to the folder structure of the executable. + +For example, let's assume we have an input that has to exist in the folder `/datasets` or the executable will not work. This property ensures that this knowledge is captured for a given software component execution. + +In this case the property would capture this as follows: + +``` +:input_prep a sd:DatasetSpecification . +:input_prep rdfs:label \"precipitation file\" . +:input_precip sd:pathLocation \"/datasets/\". +```"""@en ; + rdfs:label "path location"@en . + + +### https://w3id.org/okn/o/sd#position +sd:position rdf:type owl:DatatypeProperty , + owl:FunctionalProperty ; + rdfs:domain [ rdf:type owl:Class ; + owl:unionOf ( :Literal + sd:DatasetSpecification + ) + ] ; + rdfs:range xsd:integer ; + rdfs:comment "Position of the parameter or input/output in the model configuration. This property is needed to know how to organize the I/O of the component on execution"@en ; + rdfs:label "position"@en . + + +### https://w3id.org/okn/o/sd#programmingLanguage +sd:programmingLanguage rdf:type owl:DatatypeProperty ; + rdfs:subPropertyOf schema:programmingLanguage ; + rdf:type owl:FunctionalProperty ; + rdfs:domain sd:SourceCode ; + rdfs:range xsd:string ; + rdfs:comment "Language used to code a software component"@en ; + rdfs:label "programming language"@en . + + +### https://w3id.org/okn/o/sd#referencePublication +sd:referencePublication rdf:type owl:DatatypeProperty ; + rdfs:subPropertyOf ; + rdf:type owl:FunctionalProperty ; + rdfs:domain sd:Software ; + rdfs:range xsd:string ; + rdfs:comment "Main publication to cite for this software component"@en ; + rdfs:label "reference publication"@en . + + +### https://w3id.org/okn/o/sd#shortDescription +sd:shortDescription rdf:type owl:DatatypeProperty ; + rdfs:subPropertyOf sd:description ; + rdf:type owl:FunctionalProperty ; + rdfs:domain sd:Software ; + rdfs:range xsd:string ; + rdfs:comment "A summarized description of the resource"@en ; + rdfs:label "short description" . + + +### https://w3id.org/okn/o/sd#status +sd:status rdf:type owl:DatatypeProperty , + owl:FunctionalProperty ; + rdfs:domain sd:ConfigurationSetup ; + rdfs:range xsd:string ; + rdfs:comment "Data property to indicate the status of a configuration setups. For example, to indicate that a setup has been executed in a platform, that the setup should notbe shown to users (it's an auxiliary setup), etc."@en ; + rdfs:label "status"@en . + + +### https://w3id.org/okn/o/sd#value +sd:value rdf:type owl:DatatypeProperty ; + rdfs:subPropertyOf prov:value ; + rdf:type owl:FunctionalProperty ; + rdfs:domain [ rdf:type owl:Class ; + owl:unionOf ( sd:Image + sd:SampleResource + sd:Visualization + ) + ] ; + rdfs:range [ rdf:type rdfs:Datatype ; + owl:unionOf ( xsd:anyURI + xsd:boolean + xsd:dateTime + xsd:float + xsd:integer + xsd:string + ) + ] ; + rdfs:comment "Value associated to the described entity"@en ; + rdfs:label "value"@en . + + +################################################################# +# Classes +################################################################# + +### http://purl.dataone.org/provone/2015/01/15/ontology#Execution +provone:Execution rdf:type owl:Class ; + rdfs:subClassOf prov:Activity ; + owl:disjointWith provone:ParameterData , + provone:Program , + provone:Visualization , + provone:Workflow , + :Artefact , + :DataCollection , + :Float , + :Int , + :Literal , + :Number , + :String , + :StructuredData , + prov:Collection , + prov:EmptyCollection , + prov:EmptyDictionary , + prov:Entity , + prov:Plan , + sd:ConfigurationSetup , + sd:Software , + sd:SoftwareConfiguration , + sd:SoftwareImage , + sd:SoftwareVersion ; + rdfs:comment "An Execution represents the execution of a Program. If the Program in question is a Workflow, then the Execution represents a trace of its execution." ; + rdfs:label "Execution" . + + +### http://purl.dataone.org/provone/2015/01/15/ontology#ParameterData +provone:ParameterData rdf:type owl:Class ; + rdfs:subClassOf prov:Entity ; + owl:disjointWith :WorkflowExecution , + prov:Activity ; + rdfs:comment "A Data item represents the basic unit of information consumed and produced by a Program. Multiple Data items may be grouped into a Collection." ; + rdfs:label "Parameter" ; + rdfs:seeAlso provone:Data . + + +### http://purl.dataone.org/provone/2015/01/15/ontology#Program +provone:Program rdf:type owl:Class ; + owl:equivalentClass sd:Software ; + rdfs:subClassOf schema:SoftwareApplication , + prov:Entity , + prov:Plan ; + owl:disjointWith :WorkflowExecution , + prov:Activity ; + rdfs:label "Program" ; + prov:definition "A Program represents a computational task that consumes and produces data through its input and output ports, respectively. It can be atomic or composite, the latter case represented by a possibly nested Program. It is also subject to versioning by prov:wasDerivedFrom." . + + +### http://purl.dataone.org/provone/2015/01/15/ontology#User +provone:User rdf:type owl:Class ; + rdfs:subClassOf prov:Agent ; + rdfs:label "User" ; + prov:definition "A User is the person responsible for the execution of a Program, which in turn can be a Workflow. Its specification serves attribution and accountability purposes." . + + +### http://purl.dataone.org/provone/2015/01/15/ontology#Visualization +provone:Visualization rdf:type owl:Class ; + rdfs:subClassOf prov:Entity ; + owl:disjointWith :WorkflowExecution , + prov:Activity ; + rdfs:comment "A Visualization represents a visual product produced by a Program." ; + rdfs:label "Visualization" . + + +### http://purl.dataone.org/provone/2015/01/15/ontology#Workflow +provone:Workflow rdf:type owl:Class ; + rdfs:subClassOf provone:Program , + sd:Software ; + owl:disjointWith :WorkflowExecution , + prov:Activity ; + rdfs:label "Workflow" ; + prov:definition "A Workflow is a distinguished Program, which indicates that is meant to represent the computational experiment in its entirety. It is also subject to versioning by prov:wasDerivedFrom through its super-class provone:Program." . + + +### http://purl.org/co/List +co:List rdf:type owl:Class . + + +### http://schema.org/SoftwareApplication +schema:SoftwareApplication rdf:type owl:Class . + + +### http://schema.org/SoftwareSourceCode +schema:SoftwareSourceCode rdf:type owl:Class . + + +### http://www.semanticweb.org/concise#Artefact +:Artefact rdf:type owl:Class ; + rdfs:subClassOf prov:Entity ; + owl:disjointWith :WorkflowExecution , + prov:Activity . + + +### http://www.semanticweb.org/concise#BaseCommand +:BaseCommand rdf:type owl:Class ; + rdfs:subClassOf co:List . + + +### http://www.semanticweb.org/concise#DataCollection +:DataCollection rdf:type owl:Class ; + rdfs:subClassOf prov:Collection , + [ rdf:type owl:Restriction ; + owl:onProperty prov:hadMember ; + owl:allValuesFrom [ rdf:type owl:Class ; + owl:unionOf ( provone:ParameterData + :DataCollection + ) + ] + ] ; + owl:disjointWith :WorkflowExecution , + prov:Activity . + + +### http://www.semanticweb.org/concise#DataFormat +:DataFormat rdf:type owl:Class ; + rdfs:subClassOf owl:Thing . + + +### http://www.semanticweb.org/concise#ExecutionCommand +:ExecutionCommand rdf:type owl:Class ; + rdfs:subClassOf co:List . + + +### http://www.semanticweb.org/concise#FileFormat +:FileFormat rdf:type owl:Class ; + rdfs:subClassOf :DataFormat . + + +### http://www.semanticweb.org/concise#Float +:Float rdf:type owl:Class ; + rdfs:subClassOf :Number ; + owl:disjointWith :WorkflowExecution , + prov:Activity . + + +### http://www.semanticweb.org/concise#Int +:Int rdf:type owl:Class ; + rdfs:subClassOf :Number ; + owl:disjointWith :WorkflowExecution , + prov:Activity . + + +### http://www.semanticweb.org/concise#KeyValPair +:KeyValPair rdf:type owl:Class ; + rdfs:subClassOf [ rdf:type owl:Restriction ; + owl:onProperty :pairValue ; + owl:cardinality "1"^^xsd:nonNegativeInteger + ] , + [ rdf:type owl:Restriction ; + owl:onProperty prov:pairKey ; + owl:cardinality "1"^^xsd:nonNegativeInteger + ] . + + +### http://www.semanticweb.org/concise#Literal +:Literal rdf:type owl:Class ; + rdfs:subClassOf provone:ParameterData ; + owl:disjointWith :WorkflowExecution , + prov:Activity ; + rdfs:seeAlso sd:Parameter . + + +### http://www.semanticweb.org/concise#Number +:Number rdf:type owl:Class ; + rdfs:subClassOf :Literal ; + owl:disjointWith :WorkflowExecution , + prov:Activity . + + +### http://www.semanticweb.org/concise#Organization +:Organization rdf:type owl:Class ; + rdfs:subClassOf prov:Agent . + + +### http://www.semanticweb.org/concise#ParameterList +:ParameterList rdf:type owl:Class ; + rdfs:subClassOf co:List . + + +### http://www.semanticweb.org/concise#ProgramPurpose +:ProgramPurpose rdf:type owl:Class ; + rdfs:subClassOf provone:Program , + sd:Software . + + +### http://www.semanticweb.org/concise#StandardIO +:StandardIO rdf:type owl:Class ; + rdfs:subClassOf :DataFormat . + + +### http://www.semanticweb.org/concise#String +:String rdf:type owl:Class ; + rdfs:subClassOf :Literal ; + owl:disjointWith :WorkflowExecution , + prov:Activity . + + +### http://www.semanticweb.org/concise#StructuredData +:StructuredData rdf:type owl:Class ; + rdfs:subClassOf provone:ParameterData ; + owl:disjointWith :WorkflowExecution , + prov:Activity ; + rdfs:seeAlso . + + +### http://www.semanticweb.org/concise#WorkflowEngine +:WorkflowEngine rdf:type owl:Class ; + rdfs:subClassOf prov:Agent . + + +### http://www.semanticweb.org/concise#WorkflowEngineExecution +:WorkflowEngineExecution rdf:type owl:Class ; + rdfs:subClassOf provone:Execution . + + +### http://www.semanticweb.org/concise#WorkflowExecution +:WorkflowExecution rdf:type owl:Class ; + rdfs:subClassOf provone:Execution ; + owl:disjointWith prov:Collection , + prov:EmptyCollection , + prov:EmptyDictionary , + prov:Entity , + prov:Plan , + sd:ConfigurationSetup , + sd:Software , + sd:SoftwareConfiguration , + sd:SoftwareImage , + sd:SoftwareVersion . + + +### http://www.w3.org/ns/prov#Activity +prov:Activity rdf:type owl:Class ; + owl:disjointWith prov:Collection , + prov:EmptyCollection , + prov:EmptyDictionary , + prov:Entity , + prov:Plan , + sd:ConfigurationSetup , + sd:Software , + sd:SoftwareConfiguration , + sd:SoftwareImage , + sd:SoftwareVersion ; + rdfs:isDefinedBy provo: ; + rdfs:label "Activity" ; + prov:definition "An activity is something that occurs over a period of time and acts upon or with entities; it may include consuming, processing, transforming, modifying, relocating, using, or generating entities." . + + +### http://www.w3.org/ns/prov#Agent +prov:Agent rdf:type owl:Class ; + rdfs:isDefinedBy provo: ; + rdfs:label "Agent" ; + prov:definition "An agent is something that bears some form of responsibility for an activity taking place, for the existence of an entity, or for another agent's activity. "@en . + + +### http://www.w3.org/ns/prov#Collection +prov:Collection rdf:type owl:Class ; + rdfs:subClassOf prov:Entity ; + rdfs:isDefinedBy provo: ; + rdfs:label "Collection" ; + prov:definition "A collection is an entity that provides a structure to some constituents, which are themselves entities. These constituents are said to be member of the collections."@en . + + +### http://www.w3.org/ns/prov#Dictionary +prov:Dictionary rdf:type owl:Class ; + rdfs:comment "A given dictionary forms a given structure for its members. A different structure (obtained either by insertion or removal of members) constitutes a different dictionary." , + "This concept allows for the provenance of the dictionary, but also of its constituents to be expressed. Such a notion of dictionary corresponds to a wide variety of concrete data structures, such as a maps or associative arrays." ; + rdfs:isDefinedBy prov: ; + rdfs:label "Dictionary" ; + prov:definition "A dictionary is an entity that provides a structure to some constituents, which are themselves entities. These constituents are said to be member of the dictionary." . + + +### http://www.w3.org/ns/prov#EmptyCollection +prov:EmptyCollection rdf:type owl:Class ; + rdfs:subClassOf prov:Collection ; + rdfs:isDefinedBy provo: ; + rdfs:label "EmptyCollection"@en ; + prov:definition "An empty collection is a collection without members."@en . + + +### http://www.w3.org/ns/prov#EmptyDictionary +prov:EmptyDictionary rdf:type owl:Class ; + rdfs:subClassOf prov:Dictionary , + prov:EmptyCollection ; + rdfs:isDefinedBy prov: ; + rdfs:label "Empty Dictionary" ; + prov:definition "An empty dictionary (i.e. has no members)." . + + +### http://www.w3.org/ns/prov#Entity +prov:Entity rdf:type owl:Class ; + rdfs:isDefinedBy provo: ; + rdfs:label "Entity" ; + prov:definition "An entity is a physical, digital, conceptual, or other kind of thing with some fixed aspects; entities may be real or imaginary. "@en . + + +### http://www.w3.org/ns/prov#KeyEntityPair +prov:KeyEntityPair rdf:type owl:Class ; + rdfs:subClassOf [ rdf:type owl:Restriction ; + owl:onProperty prov:pairEntity ; + owl:cardinality "1"^^xsd:nonNegativeInteger + ] , + [ rdf:type owl:Restriction ; + owl:onProperty prov:pairKey ; + owl:cardinality "1"^^xsd:nonNegativeInteger + ] ; + rdfs:isDefinedBy prov: ; + rdfs:label "Key-Entity Pair" ; + prov:definition "A key-entity pair. Part of a prov:Dictionary through prov:hadDictionaryMember. The key is any RDF Literal, the value is a prov:Entity." . + + +### http://www.w3.org/ns/prov#Location +prov:Location rdf:type owl:Class ; + rdfs:isDefinedBy provo: ; + rdfs:label "Location" ; + rdfs:seeAlso prov:atLocation ; + prov:definition "A location can be an identifiable geographic place (ISO 19112), but it can also be a non-geographic place such as a directory, row, or column. As such, there are numerous ways in which location can be expressed, such as by a coordinate, address, landmark, and so forth."@en . + + +### http://www.w3.org/ns/prov#Person +prov:Person rdf:type owl:Class ; + rdfs:subClassOf prov:Agent ; + rdfs:isDefinedBy provo: ; + rdfs:label "Person" ; + prov:definition "Person agents are people."@en . + + +### http://www.w3.org/ns/prov#Plan +prov:Plan rdf:type owl:Class ; + rdfs:subClassOf prov:Entity ; + rdfs:comment "There exist no prescriptive requirement on the nature of plans, their representation, the actions or steps they consist of, or their intended goals. Since plans may evolve over time, it may become necessary to track their provenance, so plans themselves are entities. Representing the plan explicitly in the provenance can be useful for various tasks: for example, to validate the execution as represented in the provenance record, to manage expectation failures, or to provide explanations."@en ; + rdfs:isDefinedBy provo: ; + rdfs:label "Plan" ; + prov:definition "A plan is an entity that represents a set of actions or steps intended by one or more agents to achieve some goals." . + + +### http://www.w3.org/ns/prov#SoftwareAgent +prov:SoftwareAgent rdf:type owl:Class ; + rdfs:subClassOf owl:Thing , + prov:Agent ; + rdfs:isDefinedBy prov: , + provo: ; + rdfs:label "SoftwareAgent" ; + prov:definition "A software agent is running software."@en . + + +### https://w3id.org/okn/o/sd#ConfigurationSetup +sd:ConfigurationSetup rdf:type owl:Class ; + rdfs:subClassOf sd:SoftwareConfiguration ; + rdfs:comment "Special type of configuration in which some of the inputs or parameters are associated to files or values. A configuration may be associated to multiple setups to facilitate its execution."@en ; + rdfs:label "SetupConfiguration"@en . + + +### https://w3id.org/okn/o/sd#DatasetSpecification +sd:DatasetSpecification rdf:type owl:Class ; + rdfs:comment "Class designed to describe a type of input or output used or produced by a model. For example, Topoflow has several inputs. One of them is a text file with precipitation values. The representation of this input is an instance of a dataset specification."@en ; + rdfs:label "DatasetSpecification"@en . + + +### https://w3id.org/okn/o/sd#Image +sd:Image rdf:type owl:Class . + + +### https://w3id.org/okn/o/sd#NumericalIndex +sd:NumericalIndex rdf:type owl:Class . + + +### https://w3id.org/okn/o/sd#Organization +sd:Organization rdf:type owl:Class . + + +### https://w3id.org/okn/o/sd#Person +sd:Person rdf:type owl:Class . + + +### https://w3id.org/okn/o/sd#SampleExecution +sd:SampleExecution rdf:type owl:Class . + + +### https://w3id.org/okn/o/sd#SampleResource +sd:SampleResource rdf:type owl:Class . + + +### https://w3id.org/okn/o/sd#Software +sd:Software rdf:type owl:Class ; + rdfs:subClassOf schema:SoftwareApplication , + prov:Plan ; + rdfs:comment "The set of instructions that indicate a machine how to work. In this ontology software is a general concept which acts as a superclass for software versions, docker images, data transformations, etc."@en ; + rdfs:label "Software"@en . + + +### https://w3id.org/okn/o/sd#SoftwareConfiguration +sd:SoftwareConfiguration rdf:type owl:Class ; + rdfs:subClassOf provone:Program , + sd:Software ; + rdfs:comment "A software / program configuration represents a particular way of invoking a function of a software component. A software configuration exposes the precise inputs and outputs that are used for that function. Multiple software configurations may be associated to a software component. A software configuration facilitates the encapsulation of software, and it can be used to represent components of scientific workflows."@en ; + rdfs:label "ProgramConfiguration"@en . + + +### https://w3id.org/okn/o/sd#SoftwareImage +sd:SoftwareImage rdf:type owl:Class ; + rdfs:subClassOf provone:Program , + sd:Software ; + rdfs:comment "An image that virtualizes the functionality of a given software. For example, a Docker container."@en ; + rdfs:label "SoftwareImage"@en . + + +### https://w3id.org/okn/o/sd#SoftwareVersion +sd:SoftwareVersion rdf:type owl:Class ; + rdfs:subClassOf provone:Program , + sd:Software ; + rdfs:comment "A software / program version is a specificf type of software / program that represents a particular set of functionalities. New functionalities and error fixes may occur between software /program versions"@en ; + rdfs:label "ProgramVersion"@en . + + +### https://w3id.org/okn/o/sd#SourceCode +sd:SourceCode rdf:type owl:Class ; + rdfs:subClassOf schema:SoftwareSourceCode ; + rdfs:comment "Class representing the characteristics of the code associated with a software component"@en ; + rdfs:label "Source Code"@en . + + +### https://w3id.org/okn/o/sd#Variable +sd:Variable rdf:type owl:Class . + + +### https://w3id.org/okn/o/sd#VariablePresentation +sd:VariablePresentation rdf:type owl:Class . + + +### https://w3id.org/okn/o/sd#Visualization +sd:Visualization rdf:type owl:Class . + + +### Generated by the OWL API (version 4.5.9.2019-02-01T07:24:44Z) https://github.com/owlcs/owlapi \ No newline at end of file diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 000000000..eb4349df5 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,8 @@ +click +graphviz +prov +rdflib-jsonld +pyld +pydot +requests +pyyaml