Question: Using datatypes other than string?
matentzn opened this issue · 7 comments
annotations:
- annotationProperty: is_obsolete
text: "true"
Generates a nice assertion such as
AnnotationAssertion(owl:deprecated <http://purl.obolibrary.org/obo/XPO_0103585> "true"^^xsd:string)
How can I get this to be xsd:boolean? I tried a few varieties (just true without quotes results in parse error, for example.)
Should be possible from a variable - using data_var (with range xsd:boolean) + a list_annotation. Don't know whether DOSDPtools can take a literal in place of a var in this case or cast to xsd if it does. but you could try:
annotations:
-
annotationProperty: is_obsolete
value: [true]
(true without quotes is legal YAML for boolean btw)
this exact syntax gives me a parse error.. :P any other idea?
Not too surprising. The value of value
is specified as a string corresponding to a variable name.
Simple solution: Extend the system to allow definition of internal variables, or default values for variables. I think I like default best. Extending syntax of var specification to allow is likely to be hard to achieve without breaking backwards compatibility and complicated for implementing tools. Instead we could add a new base keyword default value
allowing:
data_vars:
obs_stat: 'xsd:boolean'
default_value:
obs_stat: true
annotations:
-
annotationProperty: is_obsolete
value: obs_stat
Comments?
Another thing that would do the trick and would not require much extension at all would be to allow this:
annotations:
- annotationProperty: is_obsolete
text: "true"^^xsd:boolean
or
annotations:
- annotationProperty: is_obsolete
text: "true"
type: xsd:boolean
That would also preserve backwards compatibility as far as I can see and only require minimal changes to dosdp-tools and the spec.
From discussion:
annotations:
- annotationProperty: is_obsolete
text: "true"
type: xsd:boolean
OR
data_vars:
obs_stat: 'xsd:boolean'
default_value:
obs_stat: true
annotations:
-
annotationProperty: is_obsolete
value: obs_stat
Decision - second option. Requires DOS to extend the schema and implementation in DOSDP-tools.
Hmmm - now slightly confused about all of this. Why do we need a default rather than specifying a value true in the TSV input? If this is read as a string when the var is specified as range boolean, & if so isn't this a DOSDP_tools bug?