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

LIBHYDRA-572. Updated ControlledURIRef to handle unsetting value #396

Merged
merged 2 commits into from
Apr 8, 2024

Conversation

dsteelma-umd
Copy link
Contributor

  1. Modified the ControlledURIRef React component to disable the hidden
    "insert" field when the user selects the "empty" option in drop-down
    list.

This is done so that when the "empty" option is chosen, the
generated SPAQRL only contains a "DELETE" statement.

Prior to this change the SPARQL query should generate both a "DELETE"
statement, and an "INSERT" statement of the form:

INSERT { <subjectURI> <predicateURI> <> . }

which resulted in the being used for the node field.

This change fixes the validation issue seen in Plastron, because no
value is being inserted, so validator that checks whether the new value
is in the vocabulary is not triggered.

  1. Modified the ControlledURIRef component to remove a duplicate "empty"
    option that occurs when the initial value of field is the empty value.

This was occurring because the "empty" value is not in the vocabulary,
and so gets added to the vocabulary in the constructor, while the
React component template also contains an "empty" option field.

Modified the ControlledURIRef component so that the initial field value
does not get added to the vocabulary if it is an empty string.

https://umd-dit.atlassian.net/browse/LIBHYDRA-572

Modified the ControlledURIRef React component to disable the hidden
"insert" field when the user selects the "empty" option in drop-down
list.

This is done so that when the "empty" option is chosen, the
generated SPAQRL only contains a "DELETE" statement.

Prior to this change the SPARQL query should generate both a "DELETE"
statement, and an "INSERT" statement of the form:

```
INSERT { <subjectURI> <predicateURI> <> . }
```

which resulted in the <subjectURI> being used for the node field.

This change fixes the validation issue seen in Plastron, because no
value is being inserted, so validator that checks whether the new value
is in the vocabulary is not triggered.

https://umd-dit.atlassian.net/browse/LIBHYDRA-572
Modified the ControlledURIRef component to remove a duplicate "empty"
option that occurs when the initial value of field is the empty value.

This was occurring because the "empty" value is not in the vocabulary,
and so gets added to the vocabulary in the constructor, while the
React component template also contains an "empty" option field.

Modified the ControlledURIRef component so that the initial field value
does not get added to the vocabulary if it is an empty string.

https://umd-dit.atlassian.net/browse/LIBHYDRA-572
@peichman-umd peichman-umd merged commit 852e460 into umd-lib:develop Apr 8, 2024
1 check passed
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

Successfully merging this pull request may close these issues.

None yet

2 participants