-
Notifications
You must be signed in to change notification settings - Fork 18
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
feat(api-v2): Make values citable #1322
Conversation
# Conflicts: # webapi/src/main/scala/org/knora/webapi/responders/v2/ResourcesResponderV2.scala # webapi/src/main/scala/org/knora/webapi/responders/v2/SearchResponderV2.scala # webapi/src/main/scala/org/knora/webapi/responders/v2/StandoffResponderV2.scala # webapi/src/main/scala/org/knora/webapi/util/ConstructResponseUtilV2.scala # webapi/src/test/resources/test-data/ontologyR2RV2/knoraApiOntologyWithValueObjects.rdf
A question: Do you plan to use the text value's uuid in the standoff route too? If so, how would Knora guarantee that the client gets all the standoff belonging to one specific version of a text value? |
I was thinking that we shouldn't use the UUID in the standoff route, exactly for this reason. |
This pull request has been mentioned on Discuss DaSCH. There might be relevant details there: |
# Conflicts: # webapi/src/test/resources/test-data/ontologyR2RV2/knoraApiOntologyWithValueObjects.rdf
This pull request has been mentioned on Discuss DaSCH. There might be relevant details there: |
https://discuss.dasch.swiss/t/fine-grained-citations/24/4?u=benjamingeer |
@@ -170,6 +170,45 @@ class ValuesRouteV2E2ESpec extends E2ESpec { | |||
} | |||
|
|||
"The values v2 endpoint" should { | |||
"get the latest version of a value, given its UUID" in { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are these the same tests as for ResourcesResponderV2Spec
, just for the values route this time?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand the question. The resources route doesn't accept value UUIDs, and this PR doesn't add anything to ResourcesResponderV2Spec
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's just that the resources responder is used internally to get specific values so the tests were added to ResourcesResponderV2Spec
. But the values route v2 is called in the API so the tests go into ValuesRouteV2E2ESpec
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I got confused. Yes, that's right.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no problem, I first had to understand that v1 and v2 handling of values is different :-)
In that case we need their feedback on this PR. |
I don't see what I could possibly change to make this easier for them. Adding more features to Knora usually means adding more information to API responses. We can't stop development on Knora. |
@@ -83,6 +83,9 @@ DELETE { | |||
|
|||
*@ | |||
?resource <@{linkUpdate.linkPropertyIri}Value> ?linkValue@linkValueIndex . | |||
|
|||
@* Delete the UUID from the current version of the link value, because the new version will store it. *@ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if this creates a new value, why would there already be a UUID?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we're creating a new text value, we may have to update existing link values for standoff links. If there are existing link values, they will have UUIDs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I remember! There is only one link but the ref count could be more than one
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Exactly. So much fun. :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
posttraumatic standoff disorder -> PTSD
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😜
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was not meant as a joke. I am actually suffering from it ;-)
|
||
*@ | ||
@if(linkUpdate.linkValueExists) { | ||
<@linkUpdate.newLinkValueIri> knora-base:previousValue ?linkValue@linkValueIndex . | ||
<@linkUpdate.newLinkValueIri> knora-base:previousValue ?linkValue@linkValueIndex ; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't you have to remove the UUID from the previous version?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that happens here:
I want to add another test to make sure these SPARQL updates insert and delete the UUIDs correctly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I want to add another test to make sure these SPARQL updates insert and delete the UUIDs correctly.
On this PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I'll do it today.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great. In the meantime, I will test the update script.
I get an error when running the update script:
still using graphdb 8.5 |
Ok, I know what happened: I loaded the data with this branch and applied the conversion. Instead, the data has to be loaded on develop and converted on this branch. Does this mean that the script breaks if the data is already converted? |
Yes. The solution to that is #1336. |
Did you manage to preserve the prefixes? They used to be renamed to ns0 or something. |
@benjamingeer Can this branched be updated, @SepidehAlassi as just merged a PR? |
@benjamingeer The upgrade script works! |
Cool. Horrible test almost done. |
@tobiasschweizer OK, I added a test to |
@tobiasschweizer Is this OK to merge? |
I want to get the feedback from @kilchenmann and @flavens. I think this should be possible today. |
@benjamingeer @tobiasschweizer You can merge this PR today. For you to know: We actually work only with the Knora official releases (now 7.0.0). But it is really good to know when there are breaking changes in the next release, this way, it is easier for us to fix bugs and adapt. |
@flavens Thank you! |
@tobiasschweizer In that case could you please approve this? |
@tobiasschweizer Thank you! |
This pull request has been mentioned on Discuss DaSCH. There might be relevant details there: |
This PR aims to make it possible to cite Knora values, as per this comment. See the discussion in Fine-grained citations.
knora-base:valueHasUUID
toknora-base:Value
. This is stored only in the current version of each value.KnoraIdUtil
intoStringFormatter
..ttl
files.knora-base:valueHasUUID
to existing repositories.Existing repositories must be updated; see
upgrade/1322-cite-values/README.md
.Resolves #941.