Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

NIDM-Results 1.1.0 release #334

Merged
merged 9 commits into from Jun 2, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2,039 changes: 2,039 additions & 0 deletions doc/content/specs/nidm-results_110.html

Large diffs are not rendered by default.

26 changes: 18 additions & 8 deletions nidm/nidm-results/scripts/create_results_specification.py
Expand Up @@ -186,21 +186,31 @@ def main(nidm_original_version):
owlspec._header_footer(component="nidm-results", version=nidm_version)

if not nidm_version == "dev":
if nidm_version == "020":
if nidm_version == "110":
# Previous version
owlspec.text = owlspec.text.replace(
"nidm-results_020.html", "nidm-results_100.html")
elif nidm_version == "020":
# Previous version
owlspec.text = owlspec.text.replace(
"nidm-results_020.html", "nidm-results_010.html")
owlspec.text = owlspec.text.replace(
"(under development)", nidm_original_version)
owlspec.text = owlspec.text.replace(
"nidm-results_dev.html",
"nidm-results_" + nidm_version + ".html", 1)
owlspec.text = owlspec.text.replace(
"img/", "img/nidm-results_" + nidm_version + "/")
owlspec.text = dev_to_release(owlspec.text, nidm_original_version)

owlspec.write_specification(component="nidm-results", version=nidm_version)


def dev_to_release(text, full_version):
version = full_version.replace(".", "")
text = text.replace(
"(under development)", full_version)
text = text.replace(
"nidm-results_dev.html",
"nidm-results_" + version + ".html", 1)
text = text.replace(
"img/", "img/nidm-results_" + version + "/")
return text


def _replace_term_by(renaming, components, used_by, generated_by,
derived_from):
for original_term, renamed_term in renaming:
Expand Down
34 changes: 25 additions & 9 deletions nidm/nidm-results/scripts/release_nidm_results.py
Expand Up @@ -16,10 +16,12 @@
import sys
import shutil
import urllib2
from create_results_specification import main as create_spec

RELPATH = os.path.dirname(os.path.abspath(__file__))
NIDMRESULTSPATH = os.path.dirname(RELPATH)
NIDMPATH = os.path.join(NIDMRESULTSPATH, os.pardir)
SPECSPATH = os.path.join(NIDMPATH, os.pardir, "doc", "content", "specs")

# Append parent script directory to path
sys.path.append(os.path.join(NIDMRESULTSPATH, os.pardir, os.pardir, "scripts"))
Expand Down Expand Up @@ -99,15 +101,8 @@ def create_release(self):
owl_txt = owl_txt + "\n\n##### Imports from %s #####" % (name)
owl_txt = owl_txt + im_txt

# Replace address of examples
owl_txt = owl_txt.replace(
"https://raw.githubusercontent.com/incf-nidash/nidm/\
master/",
"https://raw.githubusercontent.com/incf-nidash/nidm/\
NIDM-Results_"+self.nidm_original_version+"/")

# Remove AFNI-related terms (not ready for release yet)
if int(self.nidm_version) <= 100:
if int(self.nidm_version) <= 110:
owl_txt = owl_txt.replace(
"@prefix afni: <http://purl.org/nidash/afni#> .\n", "")
# Remove terms: nidm:'Legendre Polynomial Order', afni:'BLOCK',
Expand All @@ -121,7 +116,28 @@ def create_release(self):
owl_txt = owl_txt.replace(m.group(), "")

with open(release_owl_file, 'w') as fp:
owl_txt = fp.write(owl_txt)
fp.write(owl_txt)

# Create specification (before the address of examples are updated to
# avoid issue with examples pointing to tag not pushed yet)
create_spec(self.nidm_original_version)
if self.nidm_version == "100":
image_dir_prev = os.path.join(
SPECSPATH, "img", "nidm-results_100")
image_dir = os.path.join(
SPECSPATH, "img", "nidm-results_"+self.nidm_version)
if not os.path.isdir(image_dir):
shutil.copytree(image_dir_prev, image_dir)

# Replace address of examples
owl_txt = owl_txt.replace(
"https://raw.githubusercontent.com/incf-nidash/nidm/\
master/",
"https://raw.githubusercontent.com/incf-nidash/nidm/\
NIDM-Results_"+self.nidm_original_version+"/")

with open(release_owl_file, 'w') as fp:
fp.write(owl_txt)

if __name__ == '__main__':
if len(sys.argv) > 1:
Expand Down
8 changes: 4 additions & 4 deletions nidm/nidm-results/spm/example004/README.md
@@ -1,9 +1,9 @@

Prov store: https://provenance.ecs.soton.ac.uk/store/documents/77761/
Prov store: https://provenance.ecs.soton.ac.uk/store/documents/82084/

Alternative serialisations: [json](https://provenance.ecs.soton.ac.uk/store/documents/77761.json), [turtle](https://provenance.ecs.soton.ac.uk/store/documents/77761.ttl),
Graph: [svg](https://provenance.ecs.soton.ac.uk/store/documents/77761.svg), [PDF](https://provenance.ecs.soton.ac.uk/store/documents/77761.pdf), [png](https://provenance.ecs.soton.ac.uk/store/documents/77761.png)
Alternative serialisations: [json](https://provenance.ecs.soton.ac.uk/store/documents/82084.json), [turtle](https://provenance.ecs.soton.ac.uk/store/documents/82084.ttl),
Graph: [svg](https://provenance.ecs.soton.ac.uk/store/documents/82084.svg), [PDF](https://provenance.ecs.soton.ac.uk/store/documents/82084.pdf), [png](https://provenance.ecs.soton.ac.uk/store/documents/82084.png)

![Prov Graph](https://provenance.ecs.soton.ac.uk/store/documents/77761.png)
![Prov Graph](https://provenance.ecs.soton.ac.uk/store/documents/82084.png)


Expand Up @@ -11,7 +11,6 @@ prefix nidm_ConjunctionInference <http://purl.org/nidash/nidm#NIDM_0000011>
prefix xsd <http://www.w3.org/2001/XMLSchema>
prefix obo <http://purl.obolibrary.org/obo/>
prefix spm <http://purl.org/nidash/spm#>
prefix nidm_partialConjunctionDegree <http://purl.org/nidash/nidm#NIDM_0000095>
prefix dctype <http://purl.org/dc/dcmitype/>
prefix crypto <http://id.loc.gov/vocabulary/preservation/cryptographicHashFunctions#>
prefix dct <http://purl.org/dc/terms/>
Expand All @@ -20,9 +19,10 @@ prefix nidm_OneTailedTest <http://purl.org/nidash/nidm#NIDM_0000060>
prefix neurolex <http://neurolex.org/wiki/>
prefix nidm_Inference <http://purl.org/nidash/nidm#NIDM_0000049>
prefix nidm_hasAlternativeHypothesis <http://purl.org/nidash/nidm#NIDM_0000097>
prefix spm_partialConjunctionDegree <http://purl.org/nidash/spm#SPM_0000015>
prefix dc <http://purl.org/dc/elements/1.1/>
activity(niiri:inference_id_1,-,-,[prov:type = 'nidm:NIDM_0000049', prov:label = "Inference", nidm:NIDM_0000097 = 'nidm:NIDM_0000060'])
activity(niiri:conjunction_id_2,-,-,[prov:type = 'spm:SPM_0000005', prov:label = "k-Conjunction Inference", nidm:NIDM_0000097 = 'nidm:NIDM_0000060', nidm:NIDM_0000095 = "1" %% xsd:int])
activity(niiri:conjunction_id_2,-,-,[prov:type = 'spm:SPM_0000005', prov:label = "k-Conjunction Inference", nidm:NIDM_0000097 = 'nidm:NIDM_0000060', spm:SPM_0000015 = "1" %% xsd:int])
activity(niiri:conjunction_id_1,-,-,[prov:type = 'nidm:NIDM_0000011', prov:label = "Conjunction Inference", nidm:NIDM_0000097 = 'nidm:NIDM_0000060'])
used(niiri:inference_id_1,niiri:statistic_map_id,-)
used(niiri:inference_id_1,niiri:height_threshold_id,-)
Expand Down
4 changes: 2 additions & 2 deletions nidm/nidm-results/spm/example004/spm_inference_activities.ttl
Expand Up @@ -19,8 +19,8 @@
@prefix nidm_hasAlternativeHypothesis: <http://purl.org/nidash/nidm#NIDM_0000097> .
@prefix nidm_OneTailedTest: <http://purl.org/nidash/nidm#NIDM_0000060> .
@prefix nidm_Inference: <http://purl.org/nidash/nidm#NIDM_0000049> .
@prefix nidm_partialConjunctionDegree: <http://purl.org/nidash/nidm#NIDM_0000095> .
@prefix spm_PartialConjunctionInference: <http://purl.org/nidash/spm#SPM_0000005> .
@prefix spm_partialConjunctionDegree: <http://purl.org/nidash/spm#SPM_0000015> .


niiri:conjunction_id_1 a prov:Activity , nidm_ConjunctionInference: ;
Expand All @@ -38,7 +38,7 @@ niiri:inference_id_1 a prov:Activity , nidm_Inference: ;
niiri:conjunction_id_2 a prov:Activity , spm_PartialConjunctionInference: ;
rdfs:label "k-Conjunction Inference" ;
nidm_hasAlternativeHypothesis: nidm_OneTailedTest: ;
nidm_partialConjunctionDegree: "1"^^xsd:int ;
spm_partialConjunctionDegree: "1"^^xsd:int ;
prov:used niiri:statistic_map_id_1, niiri:statistic_map_id_2, niiri:height_threshold_id, niiri:extent_threshold_id, niiri:display_map_id, niiri:peak_definition_criteria_id, niiri:cluster_definition_criteria_id, niiri:mask_id_1 ;
prov:wasAssociatedWith niiri:software_id .