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

Implement support for library schemas #75

Merged
merged 120 commits into from
Aug 29, 2022
Merged
Changes from 1 commit
Commits
Show all changes
120 commits
Select commit Hold shift + click to select a range
d729871
Implement remote library schema loading
happy5214 Jun 7, 2022
bb906d0
Initial implementation of library schema nickname parsing
happy5214 Jun 10, 2022
7e2a8cc
Make double quote an invalid character
happy5214 Jun 10, 2022
b3f5ba0
Revamp and simplify string parsing
happy5214 Jun 15, 2022
43f8bc2
Refactor ParsedHedTag conditional as array
happy5214 Jun 16, 2022
5471f18
Linter improvements
happy5214 Jun 16, 2022
0780295
Change BidsHedIssue file object for fallback schema failure to null
happy5214 Jun 16, 2022
f352dc6
Refactor value validation
happy5214 Jun 16, 2022
7864dcb
More linting improvements
happy5214 Jun 16, 2022
726dfa4
Use Set for invalidCharacters in splitHedString
happy5214 Jun 20, 2022
e3c7b08
Miscellaneous small fixes
happy5214 Jun 20, 2022
af9a4b0
Fix parsing issues and tests
happy5214 Jun 27, 2022
795f0c6
Rewrite string parser from scratch
happy5214 Jun 27, 2022
b021681
Add test for loading local library schemas
happy5214 Jul 1, 2022
0f96721
Improve buildSchema type documentation
happy5214 Jul 1, 2022
5233ddd
Improve code quality in schema tests
happy5214 Jul 1, 2022
92e181c
Move HED 2-specific implementation of takesValueFormattedTag getter t…
happy5214 Jul 1, 2022
cfde7ab
Fix remaining immediate issues with new parser implementation
happy5214 Jul 8, 2022
d41e88f
Add utility class
happy5214 Jul 8, 2022
596c237
End string splitting early on errors
happy5214 Jul 8, 2022
11c45bb
Add bounds and original tag back to ParsedHedGroup
happy5214 Jul 15, 2022
b827fc1
Skip failing tests
happy5214 Jul 15, 2022
34c4f56
Merge pull request #76 from hed-standard/rewrite-string-parser
happy5214 Jul 15, 2022
a0b1958
Replace custom flattenDeep implementation with lodash version
happy5214 Jul 22, 2022
d3816be
Promote tag group specs to local class
happy5214 Jul 22, 2022
e9b4f17
Refactor constant
happy5214 Jul 22, 2022
e461f5d
Refactor individual tag invalid character check into module-level fun…
happy5214 Jul 22, 2022
03f4ade
Flatten Schemas schema map and create schema spec type
happy5214 Jul 22, 2022
d825645
Offload check into property
happy5214 Jul 22, 2022
528b142
Merge pull request #77 from hed-standard/flat-schemas
happy5214 Jul 28, 2022
9fe2d0d
Add utility method to get the Schema object with a given nickname
happy5214 Jul 28, 2022
5ab2254
Update tests
happy5214 Jul 28, 2022
4b9ab16
Remove unused code and fix return type issue
happy5214 Jul 28, 2022
8f0131b
Use flat schema Map for HED 3 tag parsing and validation
happy5214 Jul 28, 2022
7d99c65
Add fluent SchemasSpec class for creating schema specs
happy5214 Jul 28, 2022
0f39eb7
Implement initial internal BIDS version parsing and other new fields
happy5214 Jul 28, 2022
81c0324
Add to the API
happy5214 Jul 28, 2022
0408e41
Add getter for sidecarData using old name
happy5214 Jul 28, 2022
c815380
Add missing slashFound reset
happy5214 Jul 28, 2022
4ac444c
Reordering issue data
happy5214 Aug 8, 2022
0d6f847
Replace JavaScript Error objects in schema parsing with regular HED I…
happy5214 Aug 8, 2022
b08ceb6
Merge Promise handlers
happy5214 Aug 9, 2022
a806896
Simplify anonymous functions
happy5214 Aug 9, 2022
e900eb6
Updated the bids.spec test case for libraries
VisLab Aug 9, 2022
eb938a0
Updated the bids-spec tests with objects for dataset descriptions
VisLab Aug 9, 2022
b3374c7
Updated the tests with libraries for bids-spec
VisLab Aug 9, 2022
f31256e
Updated version spec on one test case
VisLab Aug 9, 2022
e794a8e
Merge describe blocks
happy5214 Aug 9, 2022
63772bc
Normalize issue returns from schema load Promises in BIDS code
happy5214 Aug 9, 2022
35f9cfc
Corrected the split of nickname and schema version
VisLab Aug 9, 2022
0dac6c2
Added unit tests to bids.spec.js
VisLab Aug 9, 2022
fa98420
Updated the bids specs tests and up error in for missing event issue
VisLab Aug 11, 2022
54c9bc6
Merge pull request #78 from VisLab/library-schemas
VisLab Aug 11, 2022
d1c5fae
Refactor BIDS tests
happy5214 Aug 11, 2022
620572b
Added tests for bad schema formats
VisLab Aug 12, 2022
f53d5ab
Moved SchemaSpec and SchemasSpec
VisLab Aug 19, 2022
ef6b534
Reworked the schema representation by direct reading without fallbacks
VisLab Aug 21, 2022
dd4beb8
Fixed the generation computation for the Schemas
VisLab Aug 21, 2022
1a86148
Worked on dataset and event validation tests
VisLab Aug 22, 2022
65a299e
Tests for BIDS run except for 2G tests
VisLab Aug 22, 2022
938db2b
Updated the hed.js utility tests
VisLab Aug 22, 2022
ad56142
Fixed the convert tests
VisLab Aug 22, 2022
4a262b8
Updated the events tests for HED 2G - not all working
VisLab Aug 22, 2022
040ccca
Streamline export tables
happy5214 Aug 22, 2022
2f99372
Fix BIDS schema spec validation bug and move internal error BidsIssue…
happy5214 Aug 22, 2022
6448743
Simplify SchemaSpec and SchemasSpec
happy5214 Aug 22, 2022
440faa3
Split off and restructure BIDS schema spec parsing
happy5214 Aug 22, 2022
3a9c46f
Rename parsedString.js
happy5214 Aug 22, 2022
20d8716
Reimplement schema XML loading
happy5214 Aug 23, 2022
6ad820d
Add score library to test set
happy5214 Aug 23, 2022
ded1bcc
Schema type fixes
happy5214 Aug 23, 2022
abec195
Update tests
happy5214 Aug 23, 2022
7b825fd
Marking last converter function as deprecated
happy5214 Aug 23, 2022
c112bb0
Restoring commented-out tests that were skipped for testing purposes
happy5214 Aug 23, 2022
735c00c
Updated the schema-checking tests
VisLab Aug 23, 2022
54a2162
Merged the tests for library schema
VisLab Aug 23, 2022
df11eaf
Updated the tests for schema loading
VisLab Aug 24, 2022
01d254d
Added tests for bad schema formats
VisLab Aug 12, 2022
bdaf4bd
Add SchemaSpec tests
happy5214 Aug 24, 2022
bffc5c5
Updated the tests for bad schema specifications
VisLab Aug 24, 2022
e3d95e2
Updated the tests
VisLab Aug 24, 2022
4c66b87
Updated the tests
VisLab Aug 24, 2022
816480b
Delete v7.2.0 schema
happy5214 Aug 24, 2022
b4b79e8
Fix issue messages
happy5214 Aug 24, 2022
3a1f207
Improve BIDS schema spec validation and tests
happy5214 Aug 24, 2022
5eec875
Improve schema tests
happy5214 Aug 24, 2022
be83a94
Docstring fix
happy5214 Aug 24, 2022
4eb07ef
Updated the tests
VisLab Aug 24, 2022
d10055c
Merge branch 'library-schemas-vislab' into library-schemas
happy5214 Aug 24, 2022
450b05c
Fixed some of the tests in bids spec
VisLab Aug 24, 2022
b406247
Updated the external schemas spec tests
VisLab Aug 24, 2022
a3d9975
Merge pull request #81 from VisLab/library-schemas
happy5214 Aug 25, 2022
c2ec4b7
Merge branch 'library-schemas' of github.com:hed-standard/hed-javascr…
happy5214 Aug 25, 2022
40eb303
Merge commented-out code with live code
happy5214 Aug 25, 2022
ec39a05
Docstring and assertion search/replace fixes
happy5214 Aug 25, 2022
4191144
Add docstrings and assertions to test functions
happy5214 Aug 25, 2022
3ec65cc
Standardize tests
happy5214 Aug 25, 2022
3f6caf7
Standardize tests (again)
happy5214 Aug 25, 2022
a5326f1
Added additional test data to bids.spec
VisLab Aug 25, 2022
62aedb6
Merge branch 'library-schemas' of https://github.com/hed-standard/hed…
VisLab Aug 25, 2022
6a4d37c
Fix issues validating definitions without a base schema
happy5214 Aug 25, 2022
ddccd93
Clean up tests
happy5214 Aug 25, 2022
dc4ac90
Updated the tests for def and libraries
VisLab Aug 25, 2022
78d73b0
Merging the tests for def with libraries
VisLab Aug 25, 2022
b59fd13
Updated the tests for BIDS datasets with libraries including definitions
VisLab Aug 25, 2022
d709168
Merge pull request #82 from VisLab/library-schemas
happy5214 Aug 25, 2022
1addc3b
Restructure ParsedHedSubstring family and fix definition issues
happy5214 Aug 25, 2022
15b805c
Revert erroneous edit to readme
happy5214 Aug 25, 2022
3539133
Fix array-related issues
happy5214 Aug 25, 2022
499f8ce
Fix BIDS schema issue bugs
happy5214 Aug 25, 2022
f4491a0
Configuration path resolution started
VisLab Aug 25, 2022
871eab0
Initial attempt at esbuild config
happy5214 Aug 26, 2022
8c97806
Fix build config and replace local schema list with require map
happy5214 Aug 26, 2022
7531eb4
Fix remaining esbuild issues
happy5214 Aug 26, 2022
e259165
Configure esbuild-runner and downgrade jest due to incompatibility
happy5214 Aug 27, 2022
fb8285d
Allow XML to be used in Jest tests
happy5214 Aug 27, 2022
af47e72
Use older String.replace function for backwards compatibility
happy5214 Aug 27, 2022
56a7d10
Replace newlines with escape sequence to allow for normal double quotes
happy5214 Aug 27, 2022
88d6f73
Tags are only equivalent if they are in the same schema
happy5214 Aug 28, 2022
6343e6d
Add v8.1.0 schema copy
happy5214 Aug 29, 2022
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
Prev Previous commit
Next Next commit
Refactor ParsedHedTag conditional as array
  • Loading branch information
happy5214 committed Jun 16, 2022
commit 43f8bc2ced5ba3fedc2f6c496512c757c2fb46f8
16 changes: 8 additions & 8 deletions validator/parser/splitHedString.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ const openingGroupCharacter = '('
const closingGroupCharacter = ')'
const delimiters = new Set([','])

const generationToClass = [
ParsedHedTag,
ParsedHedTag, // Generation 1 is not supported by this validator.
ParsedHed2Tag,
ParsedHed3Tag,
]

/**
* Split a HED string into tags.
*
Expand All @@ -28,14 +35,7 @@ const splitHedString = function (hedString, hedSchemas, groupStartingIndex = 0)
let resetStartingIndex = false
let extraColons = { before: [], after: [] }

let ParsedHedTagClass
if (hedSchemas.isHed2) {
ParsedHedTagClass = ParsedHed2Tag
} else if (hedSchemas.isHed3) {
ParsedHedTagClass = ParsedHed3Tag
} else {
ParsedHedTagClass = ParsedHedTag
}
const ParsedHedTagClass = generationToClass[hedSchemas.generation]

const pushTag = function (i) {
if (!utils.string.stringIsEmpty(currentTag)) {
Expand Down