-
Notifications
You must be signed in to change notification settings - Fork 3
Add FileCollection class for improved RO-Crate mapping #138
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
Merged
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
793dacb
Phase 1: Add FileCollection class to D4D schema
realmarcin 2a63b52
Phase 2: Add migration support for legacy file properties
realmarcin c873947
Phase 3: Add RO-Crate integration for FileCollection
realmarcin 6bf4611
Phase 4: Add comprehensive tests for FileCollection
realmarcin 359ffcd
Address Copilot review issues on PR #138
realmarcin c3dcdc4
Fix NameError when FAIRSCAPE models unavailable
realmarcin cce60ec
Update field mapping: vulnerable_populations → at_risk_populations
realmarcin 36cd8ad
Fix test skip detection for FAIRSCAPE availability
realmarcin 02594fc
Add File class and update FileCollection.resources to accept both Fil…
realmarcin 2da3d69
Make FileCollection.collection_type multivalued
realmarcin 7bbdabc
Remove redundant/ambiguous slots from FileCollection
realmarcin 28e0d70
Address Copilot review feedback: Fix FileCollection schema compliance
realmarcin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
1,002 changes: 803 additions & 199 deletions
1,002
project/jsonschema/data_sheets_schema.schema.json
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
793 changes: 570 additions & 223 deletions
793
src/data_sheets_schema/datamodel/data_sheets_schema.py
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or 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 hidden or 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,188 @@ | ||
| --- | ||
realmarcin marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| id: "https://w3id.org/bridge2ai/data-sheets-schema/file-collection" | ||
| name: "data-sheets-schema-file-collection" | ||
| title: "Datasheets for Datasets – File Collection Module" | ||
| description: > | ||
| Module defining FileCollection class for representing collections of | ||
| files with shared characteristics within datasets. | ||
| license: MIT | ||
| see_also: | ||
| - "https://bridge2ai.github.io/data-sheets-schema" | ||
|
|
||
| prefixes: | ||
| d4d: https://w3id.org/bridge2ai/data-sheets-schema/ | ||
| dcat: http://www.w3.org/ns/dcat# | ||
| schema: http://schema.org/ | ||
| dcterms: http://purl.org/dc/terms/ | ||
|
|
||
| default_prefix: data_sheets_schema | ||
| default_range: string | ||
|
|
||
| imports: | ||
| - linkml:types | ||
| - D4D_Base_import | ||
|
|
||
| classes: | ||
|
|
||
| File: | ||
| aliases: | ||
| - data file | ||
| - file | ||
| - file object | ||
| description: >- | ||
| A single file within a dataset or file collection. | ||
| Represents an individual data file, code file, documentation file, etc. | ||
| Maps to RO-Crate File entities. | ||
| is_a: Information | ||
| class_uri: schema:MediaObject | ||
| exact_mappings: | ||
| - schema:DigitalDocument | ||
| slots: | ||
| - bytes | ||
| - path | ||
| - format | ||
| - encoding | ||
| - compression | ||
| - media_type | ||
| - hash | ||
| - md5 | ||
| - sha256 | ||
| - dialect | ||
| attributes: | ||
| file_type: | ||
| description: >- | ||
| Semantic type or purpose of this file (e.g., data_file, code_file, | ||
| documentation_file, metadata_file). | ||
| range: FileTypeEnum | ||
| slot_uri: d4d:fileType | ||
|
|
||
| FileCollection: | ||
| aliases: | ||
| - file collection | ||
| - data files | ||
| - file group | ||
| description: >- | ||
| A collection of files with shared characteristics (format, purpose, structure). | ||
| Represents a logical grouping of related files within a dataset, such as | ||
| all training data files, all image files, or all raw data files. | ||
| Maps to RO-Crate Dataset entities via schema:hasPart relationships. | ||
| is_a: Information | ||
| class_uri: dcat:Dataset | ||
| exact_mappings: | ||
| - schema:Dataset | ||
| close_mappings: | ||
| - dcat:Distribution | ||
| slots: | ||
| - path | ||
| - compression | ||
| - external_resources | ||
| - resources | ||
| slot_usage: | ||
| path: | ||
| description: >- | ||
| Path or URL to the FileCollection. May be a directory path, archive file path, | ||
| or download URL depending on how the collection is distributed. | ||
| compression: | ||
| description: >- | ||
| Compression format if the collection is packaged as a compressed archive | ||
| (e.g., gzip, zip, bzip2). Omit this field for uncompressed collections or | ||
| purely logical groupings. | ||
| external_resources: | ||
| description: >- | ||
| External files or URLs referenced by this file collection. | ||
| range: ExternalResource | ||
| multivalued: true | ||
| inlined_as_list: true | ||
| resources: | ||
| description: >- | ||
| Individual files or nested file collections within this collection. | ||
| Allows hierarchical file organization with both File objects and | ||
| nested FileCollection objects. | ||
| any_of: | ||
realmarcin marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| - range: File | ||
| - range: FileCollection | ||
| multivalued: true | ||
| inlined_as_list: true | ||
| attributes: | ||
| collection_type: | ||
realmarcin marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| description: >- | ||
| Type(s) of content in this file collection. A collection may have | ||
| multiple types, for example a collection containing both raw_data | ||
| and documentation files would have both types listed. | ||
| range: FileCollectionTypeEnum | ||
| slot_uri: d4d:collectionType | ||
| multivalued: true | ||
| file_count: | ||
| description: Number of files in this collection. | ||
| range: integer | ||
| slot_uri: d4d:fileCount | ||
| total_bytes: | ||
| description: Total size of all files in bytes. | ||
| range: integer | ||
| slot_uri: dcat:byteSize | ||
|
|
||
| enums: | ||
| FileTypeEnum: | ||
| description: Types of individual files within datasets. | ||
| permissible_values: | ||
| data_file: | ||
| description: A data file containing dataset content | ||
| meaning: schema:DataDownload | ||
| code_file: | ||
| description: A source code or script file | ||
| meaning: schema:SoftwareSourceCode | ||
| documentation_file: | ||
| description: A documentation file (README, guide, etc.) | ||
| meaning: schema:Documentation | ||
| metadata_file: | ||
| description: A metadata or annotation file | ||
| meaning: dcat:CatalogRecord | ||
| configuration_file: | ||
| description: A configuration or settings file | ||
| meaning: d4d:ConfigurationFile | ||
| notebook_file: | ||
| description: A computational notebook file (Jupyter, R Markdown, etc.) | ||
| meaning: d4d:NotebookFile | ||
| image_file: | ||
| description: An image or visualization file | ||
| meaning: schema:ImageObject | ||
| archive_file: | ||
| description: An archive or compressed file | ||
| meaning: d4d:ArchiveFile | ||
| other: | ||
| description: Other file type | ||
| meaning: d4d:OtherFile | ||
|
|
||
| FileCollectionTypeEnum: | ||
| description: Types of file collections within datasets. | ||
| permissible_values: | ||
| raw_data: | ||
| description: Raw, unprocessed data files | ||
| meaning: d4d:RawData | ||
| processed_data: | ||
| description: Cleaned, processed, or transformed data files | ||
| meaning: d4d:ProcessedData | ||
| training_split: | ||
| description: Files designated for model training | ||
| meaning: d4d:TrainingSplit | ||
| test_split: | ||
| description: Files designated for model testing | ||
| meaning: d4d:TestSplit | ||
| validation_split: | ||
| description: Files designated for model validation | ||
| meaning: d4d:ValidationSplit | ||
| documentation: | ||
| description: Documentation files (README, codebook, etc.) | ||
| meaning: schema:Documentation | ||
| metadata: | ||
| description: Metadata or annotation files | ||
| meaning: dcat:CatalogRecord | ||
| code: | ||
| description: Code or script files | ||
| meaning: schema:SoftwareSourceCode | ||
| supplementary: | ||
| description: Supplementary materials | ||
| meaning: schema:SupplementalMaterial | ||
| other: | ||
| description: Other file collection type | ||
| meaning: d4d:OtherFileCollection | ||
This file contains hidden or 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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.