-
Notifications
You must be signed in to change notification settings - Fork 0
First draft of FAIR Mappings schema #6
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
Open
matentzn
wants to merge
11
commits into
main
Choose a base branch
from
first-draft-fair-schema
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
69bfd20
Add valid and invalid MappingSpecification YAML test data
matentzn 8db1a3a
Add Agent, Source, and MappingSpecification classes to schema
matentzn fb758c0
Generated schema (from gen-doc)
matentzn 06ca205
Add enums and slot usages for agent, source, and mapping types
matentzn b45695f
Updated downstream schema files
matentzn 483974e
Update test files to be schema conformant
matentzn 3267100
Fix test files
matentzn 7e15efe
Update downstream schema files
matentzn 7a8a88b
Refactor agent classes and extend mapping enums
matentzn f2ccaa2
Regenerate schema files
matentzn 20bf0f5
Refactor content fields to content_url and add metadata fields
matentzn 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
418 changes: 337 additions & 81 deletions
418
src/fair_mappings_schema/datamodel/fair_mappings_schema.py
Large diffs are not rendered by default.
Oops, something went wrong.
215 changes: 162 additions & 53 deletions
215
src/fair_mappings_schema/datamodel/fair_mappings_schema_pydantic.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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,7 @@ | ||
| --- | ||
| id: https://w3id.org/mapping-commons/fair-mappings-schema | ||
| name: fair-mappings-schema | ||
| title: fair-mappings-schema | ||
| title: FAIR Mappings Schema | ||
| description: |- | ||
| A minimal metadata schema for FAIR mapping specifications | ||
| license: Apache-2.0 | ||
|
|
@@ -21,3 +21,195 @@ default_range: string | |
| imports: | ||
| - linkml:types | ||
|
|
||
| enums: | ||
| SourceTypeEnum: | ||
| description: Types of data sources | ||
| permissible_values: | ||
| owl_ontology: | ||
| description: An ontology in OWL format | ||
| database: | ||
| description: A relational or other database | ||
| skos_vocabulary: | ||
| description: A SKOS vocabulary or terminology | ||
| rdf_vocabulary: | ||
| description: An RDF vocabulary or schema | ||
| schema: | ||
| description: A data schema or model | ||
| api: | ||
| description: An API or web service | ||
| other: | ||
| description: Other type of source | ||
|
|
||
| MappingSpecificationTypeEnum: | ||
| description: Types of mapping specifications | ||
| permissible_values: | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should add "shacl-rules" to the enum. |
||
| sssom: | ||
| description: Simple Standard for Sharing Ontological Mappings | ||
| r2rml: | ||
| description: RDB to RDF Mapping Language | ||
| rml: | ||
| description: RDF Mapping Language | ||
| sparql: | ||
| description: SPARQL-based mapping | ||
| yarrrml: | ||
| description: YARRRML mapping file | ||
| xslt: | ||
| description: XSLT-based mapping | ||
| other: | ||
| description: Other type of mapping specification | ||
|
|
||
| classes: | ||
|
|
||
| Agent: | ||
| description: An entity that can create or contribute to a digital object, such as an author or creator. | ||
| abstract: true | ||
| slots: | ||
| - id | ||
| - name | ||
| - type | ||
| slot_usage: | ||
| type: | ||
| designates_type: true | ||
| range: string | ||
|
|
||
| Person: | ||
| description: An individual person who contributes to a mapping specification | ||
| is_a: Agent | ||
| slots: | ||
| - orcid | ||
| - affiliation | ||
|
|
||
| Organization: | ||
| description: An organization or institution that contributes to a mapping specification | ||
| is_a: Agent | ||
| slots: | ||
| - ror_id | ||
| - url | ||
|
|
||
| Software: | ||
| description: A software tool or system used in creating mappings | ||
| is_a: Agent | ||
| slots: | ||
| - version | ||
| - repository_url | ||
|
|
||
| Source: | ||
| description: >- | ||
| A data source from which entities are drawn, such as a database, ontology, or vocabulary. | ||
| slots: | ||
| - id | ||
| - name | ||
| - version | ||
| - type | ||
| - documentation | ||
| - content_url | ||
| - content_type | ||
| - metadata_url | ||
| - metadata_type | ||
| slot_usage: | ||
| type: | ||
| range: SourceTypeEnum | ||
|
|
||
| MappingSpecification: | ||
| description: >- | ||
| A formal description of correspondences between entities in a source and a target, expressed as rules, functions, or mapping statements. | ||
| tree_root: true | ||
| slots: | ||
| - id | ||
| - name | ||
| - description | ||
| - author | ||
| - creator | ||
| - reviewer | ||
| - publication_date | ||
| - license | ||
| - version | ||
| - type | ||
| - mapping_method | ||
| - documentation | ||
| - content_url | ||
| - subject_source | ||
| - object_source | ||
| slot_usage: | ||
| type: | ||
| range: MappingSpecificationTypeEnum | ||
|
|
||
| slots: | ||
| id: | ||
| description: Identifier for the information entity | ||
| range: string | ||
| name: | ||
| description: Name of the information entity | ||
| range: string | ||
| creator: | ||
| description: Creator of the mapping specification | ||
| range: Agent | ||
| inlined: true | ||
| author: | ||
| description: Author of the mapping specification | ||
| range: Agent | ||
| inlined: true | ||
| reviewer: | ||
| description: Reviewer of the mapping specification | ||
| range: Agent | ||
| inlined: true | ||
| mapping_tool: | ||
| description: The tool used to create the mapping specification | ||
| range: Agent | ||
| inlined: true | ||
| publication_date: | ||
| description: Date of publication of the mapping specification | ||
| range: string | ||
| license: | ||
| description: License under which the mapping specification is released | ||
| range: string | ||
| version: | ||
| description: Version of the digital object | ||
| range: string | ||
| description: | ||
| description: A brief description of the mapping specification | ||
| range: string | ||
| type: | ||
| description: Type of the information entity | ||
| range: string | ||
| mapping_method: | ||
| description: Method used to create the mapping specification | ||
| range: string | ||
| documentation: | ||
| description: URL or reference to documentation for the mapping specification | ||
| range: string | ||
| content_url: | ||
| description: Reference to the actual content of the digital object | ||
| range: string | ||
| content_type: | ||
| description: The type of the content of the digital object | ||
| range: string | ||
| metadata_url: | ||
| description: Reference to metadata about the digital object | ||
| range: string | ||
| metadata_type: | ||
| description: The type of the metadata about the digital object | ||
| range: string | ||
| subject_source: | ||
| description: The source from which the subject entities are drawn | ||
| range: Source | ||
| inlined: true | ||
| object_source: | ||
| description: The source from which the object entities are drawn | ||
| range: Source | ||
| inlined: true | ||
| orcid: | ||
| description: ORCID identifier for a person | ||
| range: string | ||
| affiliation: | ||
| description: Institutional affiliation of a person | ||
| range: string | ||
| ror_id: | ||
| description: ROR (Research Organization Registry) identifier | ||
| range: string | ||
| url: | ||
| description: URL or web address | ||
| range: string | ||
| repository_url: | ||
| description: URL to a code repository | ||
| range: string | ||
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,12 @@ | ||
| # Invalid MappingSpecification - author is a string instead of Agent object | ||
| --- | ||
| author: "Jane Smith" | ||
| content: https://example.org/mappings/invalid.sssom.tsv | ||
| subject_source: | ||
| name: Source X | ||
| content: https://example.org/source-x | ||
| content_type: text/plain | ||
| object_source: | ||
| name: Source Y | ||
| content: https://example.org/source-y | ||
| content_type: text/plain |
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,11 @@ | ||
| # Invalid MappingSpecification - subject_source is a string instead of Source object | ||
| --- | ||
| author: | ||
| id: example:author456 | ||
| name: Test Author | ||
| content: https://example.org/mapping.txt | ||
| subject_source: "Source A" | ||
| object_source: | ||
| name: Source B | ||
| content: https://example.org/source-b | ||
| content_type: text/plain |
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,17 @@ | ||
| # Invalid MappingSpecification - creator is a list instead of Agent object | ||
| --- | ||
| author: | ||
| id: example:author789 | ||
| name: Another Author | ||
| creator: | ||
| - John Doe | ||
| - Jane Smith | ||
| content: https://example.org/mapping.txt | ||
| subject_source: | ||
| name: Valid Source | ||
| content: https://example.org/source-valid | ||
| content_type: text/plain | ||
| object_source: | ||
| name: Another Source | ||
| content: https://example.org/source-invalid | ||
| content_type: text/plain |
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,24 @@ | ||
| # Valid MappingSpecification example - SSSOM mapping between two ontologies | ||
| --- | ||
| publication_date: "2024-01-15" | ||
| license: CC-BY-4.0 | ||
| version: "1.0.0" | ||
| description: Mappings between disease ontologies DO and MONDO | ||
| type: sssom | ||
| mapping_method: manual curation | ||
| documentation: https://example.org/do-mondo-mappings/docs | ||
| content_url: https://example.org/mappings/do-mondo.sssom.tsv | ||
| subject_source: | ||
| name: Disease Ontology | ||
| version: "2024-01-01" | ||
| type: owl_ontology | ||
| documentation: https://disease-ontology.org/ | ||
| content_url: http://purl.obolibrary.org/obo/doid.owl | ||
| content_type: application/rdf+xml | ||
| object_source: | ||
| name: Mondo Disease Ontology | ||
| version: "2024-01-10" | ||
| type: owl_ontology | ||
| documentation: https://mondo.monarchinitiative.org/ | ||
| content_url: http://purl.obolibrary.org/obo/mondo.owl | ||
| content_type: application/rdf+xml |
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,25 @@ | ||
| # Valid MappingSpecification example - R2RML mapping between database and RDF | ||
| --- | ||
|
|
||
| publication_date: "2023-11-20" | ||
| license: Apache-2.0 | ||
| version: "2.1.0" | ||
| description: R2RML mapping from legacy patient database to FHIR RDF | ||
| type: r2rml | ||
| mapping_method: automated generation with manual review | ||
| documentation: https://example.org/patient-fhir-mapping | ||
| content_url: https://example.org/mappings/patient-db-to-fhir.r2rml.ttl | ||
| subject_source: | ||
| name: Patient Database | ||
| version: "v5.2" | ||
| type: database | ||
| documentation: https://example.org/db-schema | ||
| content_url: postgresql://example.org:5432/patients | ||
| content_type: application/sql | ||
| object_source: | ||
| name: FHIR RDF Ontology | ||
| version: "4.0.1" | ||
| type: rdf_vocabulary | ||
| documentation: http://hl7.org/fhir/ | ||
| content_url: http://hl7.org/fhir/fhir.ttl | ||
| content_type: text/turtle |
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,11 @@ | ||
| # Valid MappingSpecification example - minimal required fields only | ||
| --- | ||
| content_url: https://example.org/minimal-mapping.txt | ||
| subject_source: | ||
| name: Source A | ||
| content_url: https://example.org/source-a | ||
| content_type: text/plain | ||
| object_source: | ||
| name: Source B | ||
| content_url: https://example.org/source-b | ||
| content_type: text/plain |
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should either have specific definition languages (e.g. owl, skos etc) in all of the values or none of them. I would prefer this be a high level type i.e. ontology, database, vocabulary etc. We should another field for the specific definition language (or representation technique as ADMS puts it)