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

Creating and updating metadata schemas: #390

Open
PderyckeSciensano opened this issue Feb 19, 2023 · 3 comments
Open

Creating and updating metadata schemas: #390

PderyckeSciensano opened this issue Feb 19, 2023 · 3 comments

Comments

@PderyckeSciensano
Copy link

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.

@kburger
Copy link
Contributor

kburger commented Feb 20, 2023

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?

@PderyckeSciensano
Copy link
Author

PderyckeSciensano commented Feb 20, 2023

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?

@markwilkinson
Copy link
Contributor

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!

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