FAIRDataPoint icon indicating copy to clipboard operation
FAIRDataPoint copied to clipboard

Creating and updating metadata schemas:

Open PderyckeSciensano opened this issue 2 years ago • 3 comments

I would like to improve the form generation using SHACL and DASH (ref:https://datashapes.org/forms.html). In particular, I've tried to specify that the value must be of datatype "float" and not a literal. I have tried a couple of solutions based on the documentation. But every time I have an error when saving the record: My first try:

sh:path geo:lat ;
sh:nodeKind xsd:Float ;
sh:maxCount 1 ;
dash:editor dash:TextFieldEditor ;
dash:viewer dash:LiteralViewer ;

Any idea of a correct and working syntax? Thx P.

PderyckeSciensano avatar Feb 19 '23 11:02 PderyckeSciensano

Hi @PderyckeSciensano, for SHACL the correct syntax would be sh:datatype xsd:float (which could be combined with sh:nodeKind sh:Literal, but that's probably not required). This would at least solve the validation part. For the form itself, I'm not sure if there's a widget for floating point input; @janslifka can you confirm or deny this?

kburger avatar Feb 20 '23 08:02 kburger

Hi Kees, Thx for your answer. I tried the solution you suggested and have the following error: "Unable to update entity data.". image image Just to better understand the scope of my question. If I run a SPARQL query with " FILTER (?lat >= 40.75 && ?lat <= 40.85 && ?long >= -73.98 && ?long <= -73.88)" how do I query against floats and not strings?

PderyckeSciensano avatar Feb 20 '23 09:02 PderyckeSciensano

You can recast datatypes in SPARQL. For example: xsd:float(?variable))

You need to have xsd in your PREFIX

Also, be aware that the recasting is LOCAL! Unless you assign the recast value to a new variable, you will need to do the recasting in every clause of the query!

Hope that helps!

markwilkinson avatar Jul 24 '23 16:07 markwilkinson