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

[electrophysiology_browser] HED Tag Support #9033

Merged
merged 37 commits into from
Mar 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
6146f72
Remove Annotations in favor of Events
jeffersoncasimir Jan 30, 2024
e64d2ef
Removed annotation inserts
jeffersoncasimir Jan 30, 2024
8932371
Satisfy linter
jeffersoncasimir Jan 31, 2024
ff95e62
Satisfy linter
jeffersoncasimir Jan 31, 2024
94c3b3e
Satisfy phan
jeffersoncasimir Jan 31, 2024
415a009
Satisfy linter
jeffersoncasimir Jan 31, 2024
9897a4d
Satisfy js linter
jeffersoncasimir Jan 31, 2024
2d6ce08
Remove RB tables
jeffersoncasimir Jan 31, 2024
ff13fe7
HED Tag Support + HED Tag Manager (Rebased with #9032 CI fixes)
jeffersoncasimir Jan 30, 2024
fbcdd62
Satisfy linters
jeffersoncasimir Jan 31, 2024
575082f
Added confirm page leave dialog
jeffersoncasimir Feb 1, 2024
f767c22
Fix DB constraint
jeffersoncasimir Feb 1, 2024
43708df
Satisfy linter
jeffersoncasimir Feb 1, 2024
5a6470b
Fix DB constraint
jeffersoncasimir Feb 1, 2024
e495e50
Removed 'AssembledHED' column from RB inserts
jeffersoncasimir Feb 1, 2024
9e1975a
Added Raisinbread inserts
jeffersoncasimir Feb 2, 2024
9c73255
Add additional performance index
jeffersoncasimir Feb 2, 2024
5dcea57
Add additional performance index
jeffersoncasimir Feb 2, 2024
ba0809a
Moved patch to previous PR
jeffersoncasimir Feb 13, 2024
4d1bd11
Merge branch 'main' into 2024_01_30_hed_tag_support
jeffersoncasimir Feb 27, 2024
02b4ae2
Removed duplicate declaration
jeffersoncasimir Feb 27, 2024
bc349c7
Remove `console.log`s
jeffersoncasimir Feb 27, 2024
c3ab2d8
Merge branch 'main' into 2024_01_30_hed_tag_support
jeffersoncasimir Feb 29, 2024
c7247e5
Add forgotten reference
jeffersoncasimir Feb 29, 2024
682fdfc
Satisfy linter
jeffersoncasimir Feb 29, 2024
3ed8e6e
Satisfy linter
jeffersoncasimir Feb 29, 2024
c442f0e
Replaced redundant components in favor for LorisElements
jeffersoncasimir Mar 11, 2024
b3e91d9
Removed most references to NDB_Factory
jeffersoncasimir Mar 12, 2024
093b3f2
Removed 'WHERE 1' from query
jeffersoncasimir Mar 12, 2024
8cca6b4
Changed pselectOne int cast to pselectOneInt
jeffersoncasimir Mar 12, 2024
91a08a0
Removed error_log in favor for logger->log
jeffersoncasimir Mar 12, 2024
5229dcb
Replace base64 png logo with 15kB image
jeffersoncasimir Mar 12, 2024
fcb9fe5
Using Utility::pathJoin for file paths
jeffersoncasimir Mar 13, 2024
4299ceb
Replace local image reference to images.loris.ca
jeffersoncasimir Mar 14, 2024
4e2977d
Restore webpack.config.js
jeffersoncasimir Mar 14, 2024
6b772de
Restore package.lock
jeffersoncasimir Mar 14, 2024
993a1c5
Added FK constraint to SQL table
jeffersoncasimir Mar 14, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
98 changes: 93 additions & 5 deletions SQL/0000-00-05-ElectrophysiologyTables.sql
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ CREATE TABLE `physiological_split_file` (
-- information that accompanies the BIDS physiological dataset
CREATE TABLE `physiological_parameter_file` (
`PhysiologicalParameterFileID` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`PhysiologicalFileID` INT(10) UNSIGNED NOT NULL,
`PhysiologicalFileID` INT(10) UNSIGNED DEFAULT NULL,
`ProjectID` INT(10) UNSIGNED DEFAULT NULL,
`ParameterTypeID` INT(10) UNSIGNED NOT NULL,
`InsertTime` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
`Value` TEXT,
Expand All @@ -85,7 +86,10 @@ CREATE TABLE `physiological_parameter_file` (
ON DELETE CASCADE,
CONSTRAINT `FK_param_type_ParamTypeID`
FOREIGN KEY (`ParameterTypeID`)
REFERENCES `parameter_type` (`ParameterTypeID`)
REFERENCES `parameter_type` (`ParameterTypeID`),
CONSTRAINT `FK_ppf_project_ID`
FOREIGN KEY (`ProjectID`)
REFERENCES `Project` (`ProjectID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


Expand Down Expand Up @@ -271,7 +275,8 @@ CREATE TABLE IF NOT EXISTS `physiological_coord_system_electrode_rel` (
-- Create `physiological_event_file` table
CREATE TABLE `physiological_event_file` (
`EventFileID` int(10) unsigned NOT NULL AUTO_INCREMENT,
`PhysiologicalFileID` int(10) unsigned NOT NULL,
`PhysiologicalFileID` int(10) unsigned DEFAULT NULL,
`ProjectID` int(10) unsigned DEFAULT NULL,
`FileType` varchar(20) NOT NULL,
`FilePath` varchar(255) DEFAULT NULL,
`LastUpdate` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
Expand All @@ -280,7 +285,8 @@ CREATE TABLE `physiological_event_file` (
KEY `FK_physio_file_ID` (`PhysiologicalFileID`),
KEY `FK_event_file_type` (`FileType`),
CONSTRAINT `FK_event_file_type` FOREIGN KEY (`FileType`) REFERENCES `ImagingFileTypes` (`type`),
CONSTRAINT `FK_physio_file_ID` FOREIGN KEY (`PhysiologicalFileID`) REFERENCES `physiological_file` (`PhysiologicalFileID`)
CONSTRAINT `FK_physio_file_ID` FOREIGN KEY (`PhysiologicalFileID`) REFERENCES `physiological_file` (`PhysiologicalFileID`),
CONSTRAINT `FK_pef_project_ID` FOREIGN KEY (`ProjectID`) REFERENCES `Project` (`ProjectID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8
;

Expand All @@ -299,9 +305,10 @@ CREATE TABLE `physiological_task_event` (
`EventType` VARCHAR(50) DEFAULT NULL,
`TrialType` VARCHAR(255) DEFAULT NULL,
`ResponseTime` TIME DEFAULT NULL,
`AssembledHED` TEXT DEFAULT NULL,
PRIMARY KEY (`PhysiologicalTaskEventID`),
KEY `FK_event_file` (`EventFileID`),
INDEX idx_pte_EventValue (`EventValue`),
INDEX idx_pte_TrialType (`TrialType`),
CONSTRAINT `FK_phys_file_FileID_4`
FOREIGN KEY (`PhysiologicalFileID`)
REFERENCES `physiological_file` (`PhysiologicalFileID`)
Expand Down Expand Up @@ -535,3 +542,84 @@ INSERT INTO ImagingFileTypes
('edf', 'European data format (EEG)'),
('cnt', 'Neuroscan CNT data format (EEG)'),
('archive', 'Archive file');

-- Create `hed_schema` table
CREATE TABLE `hed_schema` (
`ID` int(10) unsigned NOT NULL AUTO_INCREMENT,
`Name` varchar(255) NOT NULL,
`Version` varchar(255) NOT NULL,
`Description` text NULL,
`URL` varchar(255) NOT NULL UNIQUE,
PRIMARY KEY (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- Create `hed_schema_nodes` table
CREATE TABLE `hed_schema_nodes` (
`ID` int(10) unsigned NOT NULL AUTO_INCREMENT,
`ParentID` int(10) unsigned NULL,
`SchemaID` int(10) unsigned NOT NULL,
`Name` varchar(255) NOT NULL,
`LongName` varchar(255) NOT NULL,
`Description` text NOT NULL,
PRIMARY KEY (`ID`),
CONSTRAINT `FK_hed_parent_node`
FOREIGN KEY (`ParentID`)
REFERENCES `hed_schema_nodes` (`ID`),
CONSTRAINT `FK_hed_schema` FOREIGN KEY (`SchemaID`) REFERENCES `hed_schema` (`ID`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- Create `physiological_task_event_hed_rel` table
CREATE TABLE `physiological_task_event_hed_rel` (
`ID` int(10) unsigned NOT NULL AUTO_INCREMENT,
`PhysiologicalTaskEventID` int(10) unsigned NOT NULL,
`HEDTagID` int(10) unsigned NULL, -- Reference to hed_schema_nodes.ID. Can be null to only add parentheses
`TagValue` text NULL, -- For value tags
`HasPairing` boolean DEFAULT FALSE, -- Is grouped with #AdditionalMembers# members
`PairRelID` int(10) unsigned NULL, -- The `ID` of right side of the pair
`AdditionalMembers` int(10) unsigned DEFAULT 0, -- Number of additional members to encapsulate
PRIMARY KEY (`ID`),
CONSTRAINT `FK_physiological_task_event_hed_rel_pair` FOREIGN KEY (`PairRelID`)
REFERENCES `physiological_task_event_hed_rel` (`ID`) ON DELETE CASCADE ON UPDATE CASCADE,
KEY `FK_physiological_task_event_hed_rel_2` (`HEDTagID`),
CONSTRAINT `FK_physiological_task_event_hed_rel_2` FOREIGN KEY (`HEDTagID`)
REFERENCES `hed_schema_nodes` (`ID`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_physiological_task_event_hed_rel_1` FOREIGN KEY (`PhysiologicalTaskEventID`)
REFERENCES `physiological_task_event` (`PhysiologicalTaskEventID`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- Create `bids_event_dataset_mapping` table
CREATE TABLE `bids_event_dataset_mapping` (
`ID` int(10) unsigned NOT NULL AUTO_INCREMENT,
`ProjectID` int(10) unsigned NOT NULL,
`PropertyName` varchar(50) NOT NULL,
`PropertyValue` varchar(255) NOT NULL,
`HEDTagID` int(10) unsigned NULL, -- Reference to hed_schema_nodes.ID. Can be null to only add parentheses
`TagValue` text NULL, -- For value tags
`Description` TEXT NULL, -- Level Description
`HasPairing` BOOLEAN DEFAULT FALSE, -- Is grouped with #AdditionalMembers# members
`PairRelID` int(10) unsigned NULL, -- The `ID` of right side of the pair
`AdditionalMembers` int(10) unsigned DEFAULT 0, -- Number of additional members to encapsulate
PRIMARY KEY (`ID`),
INDEX idx_event_dataset_PropertyName_PropertyValue (`PropertyName`, `PropertyValue`),
CONSTRAINT `FK_project_id` FOREIGN KEY (`ProjectID`) REFERENCES `Project` (`ProjectID`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_dataset_hed_tag_id` FOREIGN KEY (`HEDTagID`) REFERENCES `hed_schema_nodes` (`ID`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


-- Create `bids_event_file_mapping` table
CREATE TABLE `bids_event_file_mapping` (
`ID` int(10) unsigned NOT NULL AUTO_INCREMENT,
`EventFileID` int(10) unsigned NOT NULL,
`PropertyName` varchar(50) NOT NULL,
`PropertyValue` varchar(255) NOT NULL,
`HEDTagID` int(10) unsigned NULL, -- Reference to hed_schema_nodes.ID. Can be null to only add parentheses
`TagValue` text NULL, -- For value tags
`Description` TEXT NULL, -- Level Description
`HasPairing` BOOLEAN DEFAULT FALSE, -- Is grouped with #AdditionalMembers# members
`PairRelID` int(10) unsigned NULL, -- The `ID` of right side of the pair
`AdditionalMembers` int(10) unsigned DEFAULT 0, -- Number of additional members to encapsulate
PRIMARY KEY (`ID`),
INDEX idx_event_file_PropertyName_PropertyValue (`PropertyName`, `PropertyValue`),
CONSTRAINT `FK_event_mapping_file_id` FOREIGN KEY (`EventFileID`) REFERENCES `physiological_event_file` (`EventFileID`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_file_hed_tag_id` FOREIGN KEY (`HEDTagID`) REFERENCES `hed_schema_nodes` (`ID`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
105 changes: 105 additions & 0 deletions SQL/New_patches/2024-01-30-HED-Tag-Support.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
-- Remove unused column
ALTER TABLE `physiological_task_event` DROP COLUMN `AssembledHED`;

-- Add indices for performance improvement
ALTER TABLE `physiological_task_event` ADD INDEX idx_pte_EventValue (`EventValue`);
ALTER TABLE `physiological_task_event` ADD INDEX idx_pte_TrialType (`TrialType`);

-- Add ProjectID and make PhysiologicalFileID DEFAULT NULL
ALTER TABLE `physiological_parameter_file`
CHANGE `PhysiologicalFileID` `PhysiologicalFileID` int(10) unsigned DEFAULT NULL,
ADD COLUMN `ProjectID` int(10) unsigned DEFAULT NULL AFTER `PhysiologicalFileID`,
ADD KEY `FK_physiological_parameter_file_project_id` (`ProjectID`),
ADD CONSTRAINT `FK_physiological_parameter_file_project_id`
FOREIGN KEY (`ProjectID`) REFERENCES `Project` (`ProjectID`);

-- Create `hed_schema` table
CREATE TABLE `hed_schema` (
`ID` int(10) unsigned NOT NULL AUTO_INCREMENT,
`Name` varchar(255) NOT NULL,
`Version` varchar(255) NOT NULL,
`Description` text NULL,
`URL` varchar(255) NOT NULL UNIQUE,
PRIMARY KEY (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- Create `hed_schema_nodes` table
CREATE TABLE `hed_schema_nodes` (
`ID` int(10) unsigned NOT NULL AUTO_INCREMENT,
`ParentID` int(10) unsigned NULL,
`SchemaID` int(10) unsigned NOT NULL,
`Name` varchar(255) NOT NULL,
`LongName` varchar(255) NOT NULL,
`Description` text NOT NULL,
PRIMARY KEY (`ID`),
CONSTRAINT `FK_hed_parent_node`
FOREIGN KEY (`ParentID`)
REFERENCES `hed_schema_nodes` (`ID`),
CONSTRAINT `FK_hed_schema` FOREIGN KEY (`SchemaID`) REFERENCES `hed_schema` (`ID`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- Create `physiological_task_event_hed_rel` table
CREATE TABLE `physiological_task_event_hed_rel` (
`ID` int(10) unsigned NOT NULL AUTO_INCREMENT,
`PhysiologicalTaskEventID` int(10) unsigned NOT NULL,
`HEDTagID` int(10) unsigned NULL, -- Reference to hed_schema_nodes.ID. Can be null to only add parentheses
`TagValue` text NULL, -- For value tags
`HasPairing` boolean DEFAULT FALSE, -- Is grouped with #AdditionalMembers# members
`PairRelID` int(10) unsigned NULL, -- The `ID` of right side of the pair
`AdditionalMembers` int(10) unsigned DEFAULT 0, -- Number of additional members to encapsulate
PRIMARY KEY (`ID`),
CONSTRAINT `FK_physiological_task_event_hed_rel_pair` FOREIGN KEY (`PairRelID`)
REFERENCES `physiological_task_event_hed_rel` (`ID`) ON DELETE CASCADE ON UPDATE CASCADE,
KEY `FK_physiological_task_event_hed_rel_2` (`HEDTagID`),
CONSTRAINT `FK_physiological_task_event_hed_rel_2` FOREIGN KEY (`HEDTagID`)
REFERENCES `hed_schema_nodes` (`ID`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_physiological_task_event_hed_rel_1` FOREIGN KEY (`PhysiologicalTaskEventID`)
REFERENCES `physiological_task_event` (`PhysiologicalTaskEventID`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- Create `bids_event_dataset_mapping` table
CREATE TABLE `bids_event_dataset_mapping` (
`ID` int(10) unsigned NOT NULL AUTO_INCREMENT,
`ProjectID` int(10) unsigned NOT NULL,
`PropertyName` varchar(50) NOT NULL,
`PropertyValue` varchar(255) NOT NULL,
`HEDTagID` int(10) unsigned NULL, -- Reference to hed_schema_nodes.ID. Can be null to only add parentheses
`TagValue` text NULL, -- For value tags
`Description` TEXT NULL, -- Level Description
`HasPairing` BOOLEAN DEFAULT FALSE, -- Is grouped with #AdditionalMembers# members
`PairRelID` int(10) unsigned NULL, -- The `ID` of right side of the pair
`AdditionalMembers` int(10) unsigned DEFAULT 0, -- Number of additional members to encapsulate
PRIMARY KEY (`ID`),
CONSTRAINT `FK_bids_event_dataset_mapping_pair` FOREIGN KEY (`PairRelID`)
REFERENCES `bids_event_dataset_mapping` (`ID`) ON DELETE CASCADE ON UPDATE CASCADE,
INDEX idx_event_dataset_PropertyName_PropertyValue (`PropertyName`, `PropertyValue`),
CONSTRAINT `FK_project_id` FOREIGN KEY (`ProjectID`) REFERENCES `Project` (`ProjectID`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_dataset_hed_tag_id` FOREIGN KEY (`HEDTagID`) REFERENCES `hed_schema_nodes` (`ID`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


-- Create `bids_event_file_mapping` table
CREATE TABLE `bids_event_file_mapping` (
`ID` int(10) unsigned NOT NULL AUTO_INCREMENT,
`EventFileID` int(10) unsigned NOT NULL,
`PropertyName` varchar(50) NOT NULL,
`PropertyValue` varchar(255) NOT NULL,
`HEDTagID` int(10) unsigned NULL, -- Reference to hed_schema_nodes.ID. Can be null to only add parentheses
`TagValue` text NULL, -- For value tags
`Description` TEXT NULL, -- Level Description
`HasPairing` BOOLEAN DEFAULT FALSE, -- Is grouped with #AdditionalMembers# members
`PairRelID` int(10) unsigned NULL, -- The `ID` of right side of the pair
`AdditionalMembers` int(10) unsigned DEFAULT 0, -- Number of additional members to encapsulate
PRIMARY KEY (`ID`),
CONSTRAINT `FK_bids_event_file_mapping_pair` FOREIGN KEY (`PairRelID`)
REFERENCES `bids_event_file_mapping` (`ID`) ON DELETE CASCADE ON UPDATE CASCADE,
INDEX idx_event_file_PropertyName_PropertyValue (`PropertyName`, `PropertyValue`),
CONSTRAINT `FK_event_mapping_file_id` FOREIGN KEY (`EventFileID`) REFERENCES `physiological_event_file` (`EventFileID`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_file_hed_tag_id` FOREIGN KEY (`HEDTagID`) REFERENCES `hed_schema_nodes` (`ID`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;






6 changes: 3 additions & 3 deletions jsx/MultiSelectDropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import PropTypes from 'prop-types';
* Note this is only used in DQT
* For generic SelectDropdown, see Select in Form.js
*/
class SelectField extends Component {
export class SelectField extends Component {
/**
* @constructor
* @param {object} props - React Component properties
Expand Down Expand Up @@ -64,7 +64,7 @@ SelectField.propTypes = {
/**
* Search Field React component
*/
class SearchField extends Component {
export class SearchField extends Component {
/**
* @constructor
* @param {object} props - React Component properties
Expand Down Expand Up @@ -127,7 +127,7 @@ SearchField.propTypes = {
/**
* Select Dropdown React component
*/
class SelectDropdown extends Component {
export class SelectDropdown extends Component {
/**
* @constructor
* @param {object} props - React Component properties
Expand Down
Loading
Loading