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

Question: Using datatypes other than string? #136

Open
matentzn opened this issue Jun 16, 2019 · 7 comments
Open

Question: Using datatypes other than string? #136

matentzn opened this issue Jun 16, 2019 · 7 comments
Assignees

Comments

@matentzn
Copy link

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.)

@dosumis
Copy link

dosumis commented Jun 16, 2019

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)

@matentzn
Copy link
Author

this exact syntax gives me a parse error.. :P any other idea?

@dosumis
Copy link

dosumis commented Jun 17, 2019

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?

@matentzn
Copy link
Author

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.

@dosumis
Copy link

dosumis commented Jun 24, 2019

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

@dosumis
Copy link

dosumis commented Jun 24, 2019

Decision - second option. Requires DOS to extend the schema and implementation in DOSDP-tools.

@dosumis
Copy link

dosumis commented Jun 29, 2022

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants