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

Add array class example #190

Draft
wants to merge 11 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 3 commits
Commits
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
4 changes: 2 additions & 2 deletions tests/input/examples/schema_definition-native-array-1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ classes:
annotations:
array_data_mapping:
data: temperatures_in_K
dims: [x, y, t]
dims: [x, "y", t]
coords:
latitude_in_deg: x
longitude_in_deg: y
longitude_in_deg: "y"
time_in_d: t
attributes:
name:
Expand Down
127 changes: 127 additions & 0 deletions tests/input/examples/schema_definition-native-array-2.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
id: https://example.org/arrays
name: arrays-temperature-example-2
title: Array Temperature Example Using NDArray Classes
description: |-
Example LinkML schema to demonstrate a 3D DataArray of temperature values with labeled axes
using LinkML NDArray classes
license: MIT

prefixes:
linkml: https://w3id.org/linkml/
wgs84: http://www.w3.org/2003/01/geo/wgs84_pos#
example: https://example.org/

default_prefix: example

imports:
- linkml:types

classes:

TemperatureDataset:
tree_root: true
implements:
- linkml:DataArray
annotations:
array_data_mapping:
data: temperatures_in_K
dims: [x, "y", t]
coords:
latitude_in_deg: x
longitude_in_deg: "y"
time_in_d: t
attributes:
name:
identifier: true
range: string
latitude_in_deg:
implements:
- linkml:axis
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this necessary anymore given the above array_data_mapping?

range: LatitudeSeries
rly marked this conversation as resolved.
Show resolved Hide resolved
required: true
annotations:
axis_index: 0
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this necessary anymore given the above array_data_mapping?

longitude_in_deg:
implements:
- linkml:axis
range: LongitudeSeries
required: true
annotations:
axis_index: 1
time_in_d:
implements:
- linkml:axis
range: DaySeries
required: true
annotations:
axis_index: 2
temperatures_in_K:
implements:
- linkml:array
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we rename this in the metamodel? Is this scoped to linkml:DataArray or unique across LinkML?

range: TemperatureMatrix
required: true

TemperatureMatrix:
description: A 3D array of temperatures
implements:
- linkml:NDArray
- linkml:RowOrderedArray
attributes:
values:
range: float
multivalued: true
implements:
- linkml:elements
required: true
unit:
ucum_code: K
array:
exact_number_dimensions: 3

LatitudeSeries:
description: A series whose values represent latitude
implements:
- linkml:NDArray
attributes:
values:
range: float
multivalued: true
implements:
- linkml:elements
required: true
unit:
ucum_code: deg
array:
exact_number_dimensions: 1

LongitudeSeries:
description: A series whose values represent longitude
implements:
- linkml:NDArray
attributes:
values:
range: float
multivalued: true
implements:
- linkml:elements
required: true
unit:
ucum_code: deg
array:
exact_number_dimensions: 1

DaySeries:
description: A series whose values represent the days since the start of the measurement period
implements:
- linkml:NDArray
attributes:
values:
range: float
multivalued: true
implements:
- linkml:elements
required: true
unit:
ucum_code: d
array:
exact_number_dimensions: 1
Loading