ontodev / robot

ROBOT is an OBO Tool
http://robot.obolibrary.org
BSD 3-Clause "New" or "Revised" License
260 stars 74 forks source link

template: How to load instance data property values that have datatypes? #969

Open ddooley opened 2 years ago

ddooley commented 2 years ago

I have tabular instance data with linkml related info, such as linkml:required, a true / false boolean shown below.

image

Is there a way of just controlling the datatype of the data property field in the column header, as with AT ? I mocked it up here:

image

Note some spreadsheets immediately convert "true" lowercase to TRUE after typing into a cell so ignoring caps would be handy too for a typed field.

As an aside, it would be great if robot -vvv would report a line number of template file on which error occurred. Sometimes it reports an error but there's only indirect info about which row / column was the culprit.

d.

sRam1404 commented 7 months ago

Just checking in here, this is relevant to me as well. I would like to import controlled values into a data property as well. @ddooley , could you solve this yourself?

EDIT: I pretty much found the solution immediately after some more trials. In case somebody else is facing the same issue:

Unique ID,Name,Class Type,Value
ID,LABEL,TYPE,I has_Value
xyz,Entity1,ClassA,0.023^^xsd:float
jamesaoverton commented 7 months ago

Sorry, somehow I didn't see this issue.

I don't have a ton of experience with LinkML, but isn't linkml:required an annotation property? So AT is appropriate. It doesn't make sense to me that 'required' would be part of the logical definition of a term.

You only use I when the column is for an object property or data property. When I is a data property, I guess it would make sense to provide a type in the ROBOT template string, and we don't support that. I would accept a PR for that feature, but unfortunately I can't commit to implementing it myself.