From 686a12651c4de11b13fab752f59cf000fb709df2 Mon Sep 17 00:00:00 2001 From: Taylor MacMillan Date: Thu, 16 Aug 2018 14:01:18 -0400 Subject: [PATCH] Add NIDM Schemas --- .../nidm/nidmexperiment/v0.1.0.json | 146 +++++++ .../nidm/nidmexperiment/v0.2.0.json | 374 ++++++++++++++++++ .../nidmexperiment/v0.1.0/all-fields.json | 113 ++++++ .../v0.1.0/missing-wasGeneratedBy.json | 108 +++++ 4 files changed, 741 insertions(+) create mode 100644 modules/nidm/src/main/resources/schemas/neurosciencegraph/nidm/nidmexperiment/v0.1.0.json create mode 100644 modules/nidm/src/main/resources/schemas/neurosciencegraph/nidm/nidmexperiment/v0.2.0.json create mode 100644 modules/nidm/src/test/resources/data/neurosciencegraph/nidm/nidmexperiment/v0.1.0/all-fields.json create mode 100644 modules/nidm/src/test/resources/invalid/neurosciencegraph/nidm/nidmexperiment/v0.1.0/missing-wasGeneratedBy.json diff --git a/modules/nidm/src/main/resources/schemas/neurosciencegraph/nidm/nidmexperiment/v0.1.0.json b/modules/nidm/src/main/resources/schemas/neurosciencegraph/nidm/nidmexperiment/v0.1.0.json new file mode 100644 index 00000000..504b4841 --- /dev/null +++ b/modules/nidm/src/main/resources/schemas/neurosciencegraph/nidm/nidmexperiment/v0.1.0.json @@ -0,0 +1,146 @@ +{ + "@context": [ + "{{base}}/contexts/nexus/core/standards/v0.1.0", + "{{base}}/contexts/nexus/core/schema/v0.2.0", + { + "nidm": "http://purl.org/nidash/nidm#", + "dicom": "http://neurolex.org/wiki/Category:DICOM_term/", + "this": "{{base}}}/schemas/neurosciencegraph/neuroimaging/nidm/v0.1.0/shapes" + } + ], + "@type": "owl:Ontology", + "authors": ["Taylor MacMillan", "David Rotenberg"], + "shapes": [ + { + "@id": "this:NIDMShape", + "@type": "sh:NodeShape", + "targetClass": "prov:Entity", + "and": [ + { + "node": "this:AnatomicalScanShape" + }, + { + "node": "this:DiffusionTensorScanShape" + }, + { + "node": "this:FunctionalScanShape" + }, + { + "property": [ + { + "path": "prov:wasGeneratedBy", + "name": "WasGeneratedBy", + "description": "Reference to the activity that generated the scan entity", + "minCount": 1, + "class": "prov:Activity", + "node": "{{base}}/schemas/nexus/provsh/activity/v1.0.0" + } + ] + } + ] + }, + { + "@id": "this:AnatomicalScanShape", + "label": "AnatomicalScan", + "comment": "IF A then B is equivalent to NOT A OR B", + "@type": "sh:nodeShape", + "or": [ + { + "not": [ + { + "property": [ + { + "path": "nidm:hasImageUsageType", + "name": "ImageUsageType", + "hasValue": { + "@id": "nidm:Anatomical" + } + } + ] + } + ] + }, + { + "property": [ + { + "path": "nidm:hasImageContrastType", + "name": "ImageContrastType", + "in": [ + {"@id": "nidm:T1Weighted"}, + {"@id": "nidm:T2Weighted"} + ] + } + ] + } + ] + }, + { + "@id": "this:DiffusionTensorScanShape", + "label": "DiffusionTensorScan", + "comment": "IF A then B is equivalent to NOT A OR B", + "@type": "sh:nodeShape", + "or": [ + { + "not": [ + { + "property": [ + { + "path": "nidm:hasImageUsageType", + "name": "ImageUsageType", + "hasValue": { + "@id": "nidm:DiffusionTensor" + } + } + ] + } + ] + }, + { + "property": [ + { + "path": "nidm:hasImageContrastType", + "name": "ImageContrastType", + "hasValue": { + "@id": "nidm:DiffusionWeighted" + } + } + ] + } + ] + }, + { + "@id": "this:FunctionalScanShape", + "label": "FunctionalScan", + "comment": "IF A then B is equivalent to NOT A OR B", + "@type": "sh:nodeShape", + "or": [ + { + "not": [ + { + "property": [ + { + "path": "nidm:hasImageUsageType", + "name": "ImageUsageType", + "hasValue": { + "@id": "nidm:Functional" + } + } + ] + } + ] + }, + { + "property": [ + { + "path": "nidm:hasImageContrastType", + "name": "ImageContrastType", + "hasValue": { + "@id": "nidm:FlowWeighted" + } + } + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/modules/nidm/src/main/resources/schemas/neurosciencegraph/nidm/nidmexperiment/v0.2.0.json b/modules/nidm/src/main/resources/schemas/neurosciencegraph/nidm/nidmexperiment/v0.2.0.json new file mode 100644 index 00000000..5da74753 --- /dev/null +++ b/modules/nidm/src/main/resources/schemas/neurosciencegraph/nidm/nidmexperiment/v0.2.0.json @@ -0,0 +1,374 @@ +{ + "@context": [ + "{{base}}/contexts/nexus/core/standards/v0.1.0", + "{{base}}/contexts/nexus/core/schema/v0.2.0", + { + "nidm": "http://purl.org/nidash/nidm#", + "dicom": "http://neurolex.org/wiki/Category:DICOM_term/", + "this": "{{base}}/schemas/neurosciencegraph/neuroimaging/nidm/v0.2.0/shapes" + } + ], + "@type": "owl:Ontology", + "authors": ["Taylor MacMillan", "David Rotenberg"], + "shapes": [ + { + "@id": "this:NIDMShape", + "@type": "sh:NodeShape", + "targetClass": "prov:Entity", + "and": [ + { + "node": "this:T1WeightedScanShape" + }, + { + "node": "this:T2WeightedScanShape" + }, + { + "node": "this:DiffusionWeightedScanShape" + }, + { + "node": "this:FlowWeightedScanShape" + }, + { + "property": [ + { + "path": "prov:wasGeneratedBy", + "name": "WasGeneratedBy", + "description": "Reference to the activity that generated the scan entity", + "minCount": 1, + "class": "prov:Activity", + "node": "{{base}}/schemas/nexus/provsh/activity/v1.0.0" + } + ] + } + ] + }, + { + "@id": "this:T1WeightedScanShape", + "label": "T1WeightedScan", + "comment": "IF A then B is equivalent to NOT A OR B", + "@type": "sh:nodeShape", + "or": [ + { + "not": [ + { + "property": [ + { + "path": "nidm:hasImageContrastType", + "name": "ImageContrastType", + "hasValue": { + "@id": "nidm:T1Weighted" + } + } + ] + } + ] + }, + { + "property": [ + { + "path": "nidm:hasImageUsageType", + "name": "ImageUsageType", + "hasValue": { + "@id": "nidm:Anatomical" + } + }, + { + "path": "dicom:EchoTime", + "name": "EchoTime", + "minInclusive": { + "@value": 0.001 + }, + "maxInclusive": { + "@value": 0.005 + } + }, + { + "path": "dicom:FlipAngle", + "name": "FlipAngle", + "minInclusive": { + "datatype": "xsd:int", + "@value": "1" + }, + "maxInclusive": { + "datatype": "xsd:int", + "@value": "45" + } + }, + { + "path": "dicom:InversionTime", + "name": "InversionTime", + "minInclusive": { + "@value": 0.1 + }, + "maxInclusive": { + "@value": 1.0 + } + }, + { + "path": "dicom:RepetitionTime", + "name": "RepetitionTime", + "minInclusive": { + "@value": 0.001 + }, + "maxInclusive": { + "@value": 0.1 + } + }, + { + "path": "dicom:MagneticFieldStrength", + "name": "MagneticFieldStrength", + "hasValue": { + "datatype": "xsd:int", + "@value": "3" + } + } + ] + } + ] + }, + { + "@id": "this:T2WeightedScanShape", + "label": "T2WeightedScan", + "comment": "IF A then B is equivalent to NOT A OR B", + "@type": "sh:nodeShape", + "or": [ + { + "not": [ + { + "property": [ + { + "path": "nidm:hasImageContrastType", + "name": "ImageContrastType", + "hasValue": { + "@id": "nidm:T2Weighted" + } + } + ] + } + ] + }, + { + "property": [ + { + "path": "nidm:hasImageUsageType", + "name": "ImageUsageType", + "hasValue": { + "@id": "nidm:Anatomical" + } + }, + { + "path": "dicom:EchoTime", + "name": "EchoTime", + "minInclusive": { + "@value": 0.01 + }, + "maxInclusive": { + "@value": 0.2 + } + }, + { + "path": "dicom:EchoTrainLength", + "name": "EchoTrainLength", + "minInclusive": { + "datatype": "xsd:int", + "@value": "1" + }, + "maxInclusive": { + "datatype": "xsd:int", + "@value": "32" + } + }, + { + "path": "dicom:FlipAngle", + "name": "FlipAngle", + "minInclusive": { + "datatype": "xsd:int", + "@value": "90" + }, + "maxInclusive": { + "datatype": "xsd:int", + "@value": "135" + } + }, + { + "path": "dicom:InversionTime", + "name": "InversionTime", + "minInclusive": { + "@value": 1.0 + }, + "maxInclusive": { + "@value": 5.0 + } + }, + { + "path": "dicom:RepetitionTime", + "name": "RepetitionTime", + "minInclusive": { + "@value": 1.0 + }, + "maxInclusive": { + "@value": 10.0 + } + }, + { + "path": "dicom:MagneticFieldStrength", + "name": "MagneticFieldStrength", + "hasValue": { + "datatype": "xsd:int", + "@value": "3" + } + } + ] + } + ] + }, + { + "@id": "this:DiffusionWeightedScanShape", + "label": "DiffusionWeightedScan", + "comment": "IF A then B is equivalent to NOT A OR B", + "@type": "sh:nodeShape", + "or": [ + { + "not": [ + { + "property": [ + { + "path": "nidm:hasImageContrastType", + "name": "ImageContrastType", + "hasValue": { + "@id": "nidm:DiffusionWeighted" + } + } + ] + } + ] + }, + { + "property": [ + { + "path": "nidm:hasImageUsageType", + "name": "ImageUsageType", + "hasValue": { + "@id": "nidm:DiffusionTensor" + } + }, + { + "path": "dicom:EchoTime", + "name": "EchoTime", + "minInclusive": { + "@value": 0.05 + }, + "maxInclusive": { + "@value": 0.1 + } + }, + { + "path": "dicom:FlipAngle", + "name": "FlipAngle", + "minInclusive": { + "datatype": "xsd:int", + "@value": "90" + }, + "maxInclusive": { + "datatype": "xsd:int", + "@value": "135" + } + }, + { + "path": "dicom:RepetitionTime", + "name": "RepetitionTime", + "minInclusive": { + "@value": 5.0 + }, + "maxInclusive": { + "@value": 10.0 + } + }, + { + "path": "dicom:MagneticFieldStrength", + "name": "MagneticFieldStrength", + "hasValue": { + "datatype": "xsd:int", + "@value": "3" + } + } + ] + } + ] + }, + { + "@id": "this:FlowWeightedScanShape", + "label": "FlowWeightedScan", + "comment": "IF A then B is equivalent to NOT A OR B", + "@type": "sh:nodeShape", + "or": [ + { + "not": [ + { + "property": [ + { + "path": "nidm:hasImageContrastType", + "name": "ImageContrastType", + "hasValue": { + "@id": "nidm:FlowWeighted" + } + } + ] + } + ] + }, + { + "property": [ + { + "path": "nidm:hasImageUsageType", + "name": "ImageUsageType", + "hasValue": { + "@id": "nidm:Functional" + } + }, + { + "path": "dicom:EchoTime", + "name": "EchoTime", + "minInclusive": { + "@value": 0.01 + }, + "maxInclusive": { + "@value": 0.1 + } + }, + { + "path": "dicom:FlipAngle", + "name": "FlipAngle", + "minInclusive": { + "datatype": "xsd:int", + "@value": "45" + }, + "maxInclusive": { + "datatype": "xsd:int", + "@value": "90" + } + }, + { + "path": "dicom:RepetitionTime", + "name": "RepetitionTime", + "minInclusive": { + "@value": 1.0 + }, + "maxInclusive": { + "@value": 5.0 + } + }, + { + "path": "dicom:MagneticFieldStrength", + "name": "MagneticFieldStrength", + "hasValue": { + "datatype": "xsd:int", + "@value": "3" + } + } + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/modules/nidm/src/test/resources/data/neurosciencegraph/nidm/nidmexperiment/v0.1.0/all-fields.json b/modules/nidm/src/test/resources/data/neurosciencegraph/nidm/nidmexperiment/v0.1.0/all-fields.json new file mode 100644 index 00000000..c808b05f --- /dev/null +++ b/modules/nidm/src/test/resources/data/neurosciencegraph/nidm/nidmexperiment/v0.1.0/all-fields.json @@ -0,0 +1,113 @@ +{ + "@context": [ + "{{base}}/contexts/nexus/core/standards/v0.1.0", + { + "nidm": "http://purl.org/nidash/nidm#", + "dicom": "http://neurolex.org/wiki/Category:DICOM_term/", + "sio": "http://semanticscience.org/ontology/sio.owl#", + "ndar": "https://ndar.nih.gov/api/datadictionary/v2/dataelement/" + } + ], + "@type": "owl:Ontology", + "dcterms:hasPart": [ + { + "@id": "nidm:_7b5d7734-96s5-14w7-a248-90516c123057", + "@type": [ + "prov:Agent", + "prov:Person" + ], + "ndar:src_subject_id": [ + { + "@value": "sub-00xx" + } + ] + }, + { + "@id": "nidm:_7bg9pr12-96s5-14w7-a248-90516c123057", + "@type": [ + "prov:Activity", + "nidm:Acquisition" + ], + "prov:qualifiedAssociation": [ + { + "@id": "_:ua2fY3673D42" + } + ], + "prov:wasAssociatedWith": [ + { + "@id": "nidm:_7b5d7734-96s5-14w7-a248-90516c123057" + } + ] + }, + { + "@id": "_:ua2fY3673D42", + "@type": [ + "prov:Association" + ], + "prov:agent": [ + { + "@id": "nidm:_7b5d7734-96s5-14w7-a248-90516c123057" + } + ], + "prov:hadRole": [ + { + "@id": "sio:Subject" + } + ] + }, + { + "@id": "nidm:_7b2c51a7-96s5-14w7-a248-90516c123057", + "@type": [ + "prov:Entity", + "nidm:AcquisitionObject" + ], + "dicom:EchoTime": [ + { + "@value": 0.003 + } + ], + "dicom:FlipAngle": [ + { + "@type": "xsd:int", + "@value": "15" + } + ], + "dicom:InversionTime": [ + { + "@value": 0.45 + } + ], + "dicom:MagneticFieldStrength": [ + { + "@type": "xsd:int", + "@value": "3" + } + ], + "dicom:RepetitionTime": [ + { + "@value": 0.0055 + } + ], + "nidm:AcquisitionModality": [ + { + "@id": "nidm:MagneticResonanceImaging" + } + ], + "nidm:hasImageContrastType": [ + { + "@id": "nidm:T1Weighted" + } + ], + "nidm:hasImageUsageType": [ + { + "@id": "nidm:Anatomical" + } + ], + "prov:wasGeneratedBy": [ + { + "@id": "nidm:_7bg9pr12-96s5-14w7-a248-90516c123057" + } + ] + } + ] +} \ No newline at end of file diff --git a/modules/nidm/src/test/resources/invalid/neurosciencegraph/nidm/nidmexperiment/v0.1.0/missing-wasGeneratedBy.json b/modules/nidm/src/test/resources/invalid/neurosciencegraph/nidm/nidmexperiment/v0.1.0/missing-wasGeneratedBy.json new file mode 100644 index 00000000..4fd2aedb --- /dev/null +++ b/modules/nidm/src/test/resources/invalid/neurosciencegraph/nidm/nidmexperiment/v0.1.0/missing-wasGeneratedBy.json @@ -0,0 +1,108 @@ +{ + "@context": [ + "{{base}}/contexts/nexus/core/standards/v0.1.0", + { + "nidm": "http://purl.org/nidash/nidm#", + "dicom": "http://neurolex.org/wiki/Category:DICOM_term/", + "sio": "http://semanticscience.org/ontology/sio.owl#", + "ndar": "https://ndar.nih.gov/api/datadictionary/v2/dataelement/" + } + ], + "@type": "owl:Ontology", + "dcterms:hasPart": [ + { + "@id": "nidm:_7b5d7734-96s5-14w7-a248-90516c123057", + "@type": [ + "prov:Agent", + "prov:Person" + ], + "ndar:src_subject_id": [ + { + "@value": "sub-00xx" + } + ] + }, + { + "@id": "nidm:_7bg9pr12-96s5-14w7-a248-90516c123057", + "@type": [ + "prov:Activity", + "nidm:Acquisition" + ], + "prov:qualifiedAssociation": [ + { + "@id": "_:ua2fY3673D42" + } + ], + "prov:wasAssociatedWith": [ + { + "@id": "nidm:_7b5d7734-96s5-14w7-a248-90516c123057" + } + ] + }, + { + "@id": "_:ua2fY3673D42", + "@type": [ + "prov:Association" + ], + "prov:agent": [ + { + "@id": "nidm:_7b5d7734-96s5-14w7-a248-90516c123057" + } + ], + "prov:hadRole": [ + { + "@id": "sio:Subject" + } + ] + }, + { + "@id": "nidm:_7b2c51a7-96s5-14w7-a248-90516c123057", + "@type": [ + "prov:Entity", + "nidm:AcquisitionObject" + ], + "dicom:EchoTime": [ + { + "@value": 0.003 + } + ], + "dicom:FlipAngle": [ + { + "@type": "xsd:int", + "@value": "15" + } + ], + "dicom:InversionTime": [ + { + "@value": 0.45 + } + ], + "dicom:MagneticFieldStrength": [ + { + "@type": "xsd:int", + "@value": "3" + } + ], + "dicom:RepetitionTime": [ + { + "@value": 0.0055 + } + ], + "nidm:AcquisitionModality": [ + { + "@id": "nidm:MagneticResonanceImaging" + } + ], + "nidm:hasImageContrastType": [ + { + "@id": "nidm:T1Weighted" + } + ], + "nidm:hasImageUsageType": [ + { + "@id": "nidm:Anatomical" + } + ] + } + ] +} \ No newline at end of file