-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #114 from VH-Lab/id_changes
change "reference"/"identifier" to "id"; add "depends_on"
- Loading branch information
Showing
19 changed files
with
155 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,7 @@ | |
] | ||
}, | ||
"subject": { | ||
"identifier": "", | ||
"reference": "", | ||
"species": "", | ||
"strain": "", | ||
"variant": "" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 0 additions & 18 deletions
18
ndi_common/database_documents/stimulus/ndi_document_control_stimulus_ids.json
This file was deleted.
Oops, something went wrong.
22 changes: 22 additions & 0 deletions
22
ndi_common/database_documents/stimulus/ndi_document_control_stimulusids.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ | ||
"document_class": { | ||
"definition": "$NDIDOCUMENTPATH\/stimulus\/.json", | ||
"validation": "$NDISCHEMAPATH\/stimulus\/.json", | ||
"class_name": "ndi_document_control_stim_ids", | ||
"class_version": 1, | ||
"superclasses": [ | ||
{ "definition": "$NDIDOCUMENTPATH\/ndi_document.json"} | ||
] | ||
}, | ||
"depends_on": [ | ||
{ "name": "stimulus_presentation_id", | ||
"value": [] | ||
} | ||
], | ||
"control_stimids": { | ||
"control_stimids": [] | ||
}, | ||
"control_stimid_method": { | ||
} | ||
} | ||
|
28 changes: 19 additions & 9 deletions
28
ndi_common/database_documents/stimulus/ndi_document_stimulus_response.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,30 @@ | ||
{ | ||
"document_class": { | ||
"definition": "$NDIDOCUMENTPATH\/stimulus\/ndi_document_stimulus_response.json", | ||
"validation": "$NDISCHEMAPATH\/stimulus\/ndi_document_stimulus_response_schema.json", | ||
"class_name": "stimulus-ndi_document_stimulus_response", | ||
"definition": "$NDIDOCUMENTPATH\/stimulus\/.json", | ||
"validation": "$NDISCHEMAPATH\/stimulus\/_schema.json", | ||
"class_name": "stimulus-", | ||
"class_version": 1, | ||
"superclasses": [ | ||
{ "definition": "$NDIDOCUMENTPATH\/ndi_document.json"}, | ||
{ "definition": "$NDIDOCUMENTPATH\/ndi_document_thingreference.json"} | ||
{ "definition": "$NDIDOCUMENTPATH\/ndi_document.json"} | ||
] | ||
}, | ||
"depends_on": [ | ||
{ "name": "thing_id", | ||
"value": [] | ||
}, | ||
{ "name": "stimulator_id", | ||
"value": [] | ||
}, | ||
{ "name": "stimulus_presentation_document_id", | ||
"value": [] | ||
}, | ||
{ "name": "stimulus_control_document_id", | ||
"value": [] | ||
} | ||
], | ||
"stimulus_response": { | ||
"stimulator_unique_reference": [], | ||
"stimulator_epochid": [], | ||
"thing_epochid": [], | ||
"stimulus_presentation_document_identifier": [], | ||
"stimulus_control_document_identifier": [] | ||
"thing_epochid": [] | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
function [b, successes, failures] = test_ndi_document_jsons(generate_error) | ||
% TEST_NDI_DOCUMNET_JSONS - test validity of all NDI_DOCUMENT json definitions | ||
% | ||
% [B, SUCCESSES, FAILURES] = TEST_NDI_DOCUMENT_JSONS(GENERATE_ERROR) | ||
% | ||
% Tries to make a blank NDI_DOCUMENT from all NDI_DOCUMENT JSON definitions. | ||
% Returns a cell array of all JSON file names that were successfully created in | ||
% SUCCESSES, and a cell array of JSON file names there unsuccessfully created in | ||
% FAILURES. B is 1 if all ndi documents were created successfully. | ||
% | ||
% If GENERATE_ERROR is present and is 1, then an error is generated if B is 0. | ||
% | ||
|
||
if nargin<1, | ||
generate_error = 0; | ||
end; | ||
|
||
b = 0; | ||
successes = {}; | ||
failures = {}; | ||
|
||
ndi_globals; | ||
|
||
json_docs = findfilegroups(ndidocumentpath,{'.*\.json\>'}); | ||
|
||
for i=1:numel(json_docs), | ||
[parentdir,filename,ext] = fileparts(json_docs{i}{1}); | ||
ndidoc = [filename ext]; | ||
|
||
if filename(1)=='.', % ignore swap files and hidden files | ||
continue; | ||
end; | ||
try, | ||
mydoc = ndi_document(ndidoc); | ||
successes{end+1} = ndidoc; | ||
catch, | ||
failures{end+1} = ndidoc; | ||
end; | ||
end; | ||
|
||
b = isempty(failures); | ||
|
||
if generate_error & ~b, | ||
disp(['NDI_DOCUMENT definitions failed']); | ||
failures' | ||
error(['At least one ndi_document failed to be built from its definition.']); | ||
end; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters