feup-infolab / dendro

"Open-source Dropbox" with added description features. It is a data storage and description platform designed to help researchers and other users to describe their data files, built on Linked Open Data and ontologies. Users can use Dendro to publish data to CKAN, Zenodo, DSpace or EUDAT's B2Share and others.
http://dendro.fe.up.pt
Other
28 stars 3 forks source link

[BUG] Dendro does not save the descriptor "bdv:coupledResource" when the value is "test data" (a string with spaces) #278

Closed NelsonPereira1991 closed 7 years ago

NelsonPereira1991 commented 7 years ago

Dendro Version if known (or site URL)

https://github.com/feup-infolab/dendro/tree/machine-plus-human-identifiers

In the commit

https://github.com/feup-infolab/dendro/commit/af992a5bff4328d49a0637bf20bcea71979efd45

Please describe the expected behaviour

Should report an error, identifying that the type of the value filed in for the descriptor "bdv:coupledResource" is not valid (should be a resource in this case)

Please describe the actual behaviour

Dendro halts for a bit, but then responds with a status of "ok", althought the descriptor is not saved.

What steps can be taken to reproduce the issue?

Create a folder/file in Dendro then fill the descriptor "Coupled Resource" from the "Biodiversity evolution studies" ontology with the value "test Data". Then try to save it.

Possible ways to fix the problem (programmers)

Add validations in the backend testing the value types when updating metadata for a resource.

silvae86 commented 7 years ago

This is really a bug. It is a question of validating the values of the resource properties when they are of the "resource" type. All values of this type must be valid URIs (use URI.js) (to validate at the resource.js level), while the metadata editing should enforce that all values should be URLs (using validator.js). The point is that not every URI is an URL but every URL is an URI. Validations in resource.js should therefore be less restrictive than those in the records.js controller.

NelsonPereira1991 commented 7 years ago

Fixed in https://github.com/feup-infolab/dendro/pull/280