Comments (13)
Do you want add enums under a mapping descriptor? e.g.:
slots:
evidence code:
mappings:
enum:
IEA:
id: ECO:nnnn
description: ...
ISS:
id: ECO:nnn
description: ...
A complication may be cases in which to say something about the all values in a field (e.g., a field hold glucoses results) , but certain values mean unknown or inconclusive (e.g., the value 9999 means unknown).
from linkml.
this violates the current range constraint for mappings, but I think the same thing could be accommodated with a new field, e.g. value_mappings
or this could be embedded inside each enum element
slots:
evidence code:
enum:
IEA:
exact_mappings:
- ECO:nnnn
ISS:
exact_mappings:
- ECO:nnn
from linkml.
Referencing:
We've got three components that we need to represent:
- What values (strings) that are allowable in a slot (e.g. "IEA", "ISS", ...). WRT to the above diagram, these would constitute
Permissible_Value
's with the container being an instance of anEnumerated_valueDomain
. - The
permissible_value_meaning (pvm)
links into a collection of possibleValue_Meanings
- The
Enumerated_Conceptual_Domain (ECD)
that contains all of the possible Value_Meanings -- note that an ECD can be a superset of the pvm links.
My understanding of the current values_from
attribute is intended to represent the value_domain_meaning
link. Correct?
I'm inclined separate the EVD
from the slot, as it would allow separate maintenance and reuse, so here is a first cut at a proposal:
Add a fifth item to the SchemaDefinition:
id: http://example.org/something
...
subsets:
...
types:
...
slots:
...
range: evidence
classes:
...
enums:
evidence:
description: Permissible values for CLUE evidence fragments
... : (Same set of metadata as classes, etc)
values_from: VD:evidence_codes
permissible_values:
IEA: Colonel Mustard was in the Ballroom
ISS:
description: Mrs. Peacock with the Dagger
meaning: CLUE:nnnn
The tccm could focus on fleshing out the definition and resolution of the values_from link and we could add a validator component that verifies that all meaning
links are members of the ECD
(target of values_from
)
from linkml.
We may want to add another element that identifies how the permissible value could algorithmically be generated from the values_from (value domain) codes (e.g. code, URI, CURIE, ...)
from linkml.
@hsolbrig Perhaps I'm not following, but your proposal seems to require a value domain before we can relate a value to its meaning. E.g.:
"s" -> ont:marriage_status_domain -> marriage_ont:single
Are you not allowing more direct relations? E.g.:
"s" -> marriage_ont:single
The ontology "marriage_ont" would hold information about with the term (marriage_ont:single) was a member of some kind value domain/set within the ontology. Do you think requiring the value domain/set adds meaning about the meaning "s" not captured by the reference to the class marriage_ont:single? The information that marriage_ont:single is a member of some specific value domain/set seems like a different fact to capture. Do you have a use case you are wanting to model?
Also, I am wondering about separating out the permissible values from the permissible meanings. It is not wrong, it is just verbose, so I am wondering about the use case here. Suppose, I have my permissible values for the marriage status field:
enums:
marriage status:
permissible_values:
s:
description: single
uriorcuri: marriage_ont:nnnnn
m:
description: married
uriorcuri: marriage_ont:nnnnn
Do I also need to have a set of permissible meanings?
from linkml.
I went over this this morning w/ Dazhi and will have a more complete proposal. As a quick summary:
- If you don't supply a
values_from
link, you are free to assemble things as you see fit:
enums:
marital status:
description: possible marriage value codes w/ optional value meanings
notes:
- note that s: single and s: \n description: single are the same
permissible_values:
s: single
m:
description: married
meaning: marriage_ont:117338
d:
description: divorced
comments:
- here so show that permissible values are `elements`, so can have all accompanying metadata
- If you do supply a
values_from
link, you are referencing a code set, tagged or explicit version
enums:
marital status:
description: codes drawn from the HL7 marital status code system
values_from: HL7:v2_marital_status
permissible_values:
1:
description: "1" means single
meaning: V2MS:s
2:
meaning: V2MS:m
3:
description: Married on even numbered days
comments: You can still add PV's that don't map
- Referencing code sets
We propose the following:- Establish a namespace of prefixes -- "CS" or similar
- Agree on a community wide set of prefix maps pulling from prefixcommons, prefix.cc and other places
- For
values_from
, assert thatCS:HPO
stands for all codes in the ontology - Drawing from CTS2, establish a version control tagging system, with ONE predefined tag: "current", that represents
whatever the service provider believes to be the default version (not "latest" because one often does NOT want to
use the latest greatest in production settings)- no tag and no version -- use the "current" tag of the target code set / ontology
- tag -- use an explicit tag (e.g.
"tag": "devel"
) (Tags assigned to a version by community / service). - version -- use a named version (e.g. "version": "1.7.0")
- note: We could also consider a relative version type thing similar to that used by pip ("~=1.7")
- Assume that Code system version identifiers are, at bare minimum, lexically ordered -- alphabetically later version identifiers are temporally later as well -- and, ideally, follow semver.
- One can either explicate permissible values or define a map
- CODE -- permissible value is the code
- CURIE -- permissible value is the curie
- URI -- permissible value is the URI
We can then define our own maps if needed:
enums:
phenotype:
description: disease code
values_from: CS:HPO
tag: "devel" <---- if you need to stay with an externally tagged resource --or--
version: "~1.7" <---- The current version as long as it has a minor of "7"
permissible_values:
1:
description: aplasia/hypoplasia of extremeties
meaning: HP:0009815
2:
meaning: HP:0001218
Or define an auto mapping:
enums:
relationship_code:
description: Any code in the relations ontology
values_from: CS:RO
use: CODE
disease:
description: the CURIE of any code in the scary diseases code set
values_from: NS1:scary_diseases
use: CURIE
Will have a more complete proposal w/ partially running code available in a few days
from linkml.
The proposal sounds great
from linkml.
can we close this?
from linkml.
Perhaps a little late in the game to be commenting on this, but should we use the slot name permissible_values
? This seems (to me at least) that only the values listed are permitted. But, "in the wild" you encounter all sorts of values that aren't given the data dictionary. Would it be better to name this slot defined values
?
from linkml.
Interesting -- at the moment, the behavior is "permissible". If you list "A", "B, "C" as the three permissible values, "D" will be treated as an error. How do you envision this component working in tandem with "in the wild" data?
from linkml.
Suppose, I have a slot foo
defined as:
foo:
- range: string
with permissible values A
, B
, C
. If I encounter value D
, in one sense, you are right. I will want to throw an error. However, what about if I am aware that I may not have mappings (i.e, "meanings") for all the values of foo
? I don't think I would necessarily want to thrown an error. I may still want to have the data transformed (e.g., foo: D
), although I haven't specified D
as being "permissible". Adding D
as an enum may happen later in time as the schema develops and more information is gathered.
Make sense?
from linkml.
I think we can close this now? We have separate tickets for specific aspects, e.g. markdowngen, jsonschemagen
from linkml.
I think it can be closed.
from linkml.
Related Issues (20)
- ISO dates with trailing Z throw error when using Python < 3.11 HOT 1
- Add package to conda-forge HOT 1
- Add a method to SchemaView that returns the induced disjunctive range of a slot HOT 2
- The `exact_cardinality` metamodel slot doesn't seem to have any effect when used in a `SlotDefinition` HOT 1
- pythongen may inject additional unknown_ attributes into __post_init__ when type designators are used
- Cardinality slots are not reflected in pydantic models for `multivalued` fields, but they work in arrays
- Generators should escape correctly `@`. HOT 5
- `gen-excel` should be able to handle slots which have Enum ranges and are also multivalued
- Add methods to simplify working with annotations to SchemaView
- Create a DBML exporter
- LinkML validator.validate should be sensitive to differences in pydantic and linkml class names
- LinkML validator should provide a way to verify that entity references are correct HOT 4
- How should LinkML validate consider slot: None values the same as absent slots values? HOT 2
- sqlmodel generator HOT 5
- JSON-LD Context Generator Enums ("@vocab": "@null") HOT 3
- Add an option to preserve class/property names in JSON schema generator
- TSV loader auto-converts to integers even when the range is a string HOT 4
- gen-doc (1.7.10) fails with obscure message HOT 8
- Mapping slots with multiple enumerations as a range
- Update documentation about the LinkML ecosystem
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from linkml.