-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Correct EDTF data type in JSON-LD #998 #18
Conversation
Bringing up to date
- update normalized array hook to update data type for edtf fields - update default configurations to use edtf field
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.
Tested this. Works as described.
{"@graph":[{"@id":"http:\/\/localhost:8000\/taxonomy\/term\/26?_format=jsonld","@type":["http:\/\/schema.org\/Person"],"http:\/\/schema.org\/name":[{"@value":"John Adam 2","@language":"en"}],"http:\/\/schema.org\/birthDate":[{"@value":"193u","@type":"http:\/\/www.w3.org\/2001\/XMLSchema#string"},{"@value":"1930","@type":"http:\/\/www.w3.org\/2001\/XMLSchema#gYear"}]}]}
{"@graph":[{"@id":"http:\/\/localhost:8000\/taxonomy\/term\/26?_format=jsonld","@type":["http:\/\/schema.org\/Person"],"http:\/\/schema.org\/name":[{"@value":"John Adam 2","@language":"en"}],"http:\/\/schema.org\/birthDate":[{"@value":"2004-06?","@type":"http:\/\/www.w3.org\/2001\/XMLSchema#string"},{"@value":"2004-06","@type":"http:\/\/www.w3.org\/2001\/XMLSchema#gYearMonth"}]}]}
@seth-shaw-unlv
Looks like the current support is for Level 1. Would be good to document/clarify that: http://www.loc.gov/standards/datetime/pre-submission.html.
Additional Notes:
This PR uses this controlled_access_terms_jsonld_alter_normalized_array hook to modify the jsonld to add a normalized date triple. It implements EDTFConverter::dateIso8601Value function to get the normalized value.
@DiegoPino, Please do a final review and merge. Thanks. |
Will do as soon i’m in front of a computer( today). Best
El El vie, 18 de ene. de 2019 a las 11:45, Natkeeran <
notifications@github.com> escribió:
@DiegoPino <https://github.com/DiegoPino>, Please do a final review and
merge. Thanks.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#18 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AGn85zoMmVpJZO_f7V1z0bXft10cVgKkks5vEfoSgaJpZM4ZtxtO>
.
--
Diego Pino Navarro
Digital Repositories Developer
Metropolitan New York Library Council (METRO)
|
also remove unused storage config
@Natkeeran, as per Islandora/documentation#1011 (comment) I added an update hook that supports in-place updates to existing String fields that use the EDTF widget. I will update the testing instructions. |
@seth-shaw-unlv I can give this a whirl today |
@seth-shaw-unlv I pulled down the PR and ran
Did I need to import the feature first, maybe? |
I think you are right, @dannylamb. Please try that and let me know. |
No, wait, @dannylamb . I missed some use statements.... when did I lose them? And why was Travis okay? |
controlled_access_terms.module should also include:
You can add them yourself, but it will take me a minute to retest before I commit the change. |
@seth-shaw-unlv Ok, I'll try again 👍 |
@seth-shaw-unlv I can confirm it's working now. Looks good to me! I now have strings and gYears in my jsonld |
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.
GitHub Issue: /Islandora/documentation/issues/998
See also the thread on /Islandora/documentation/issues/916
What does this Pull Request do?
Enables us to dynamically set the JSON-LD date value type based on the field's value. E.g. the EDTF string "2019?" would become "2019" with the data type gYear while the string value "~2019-01" would become "2019-01" with the data type gYearMonth, etc.
Note, this adds the value with the appropriate date type along-side the existing string value. This allows us to store the actual EDTF value in our triple-store or repository (as strings) AND have a date type we can run queries against.
What's new?
controlled_access_terms_jsonld_alter_normalized_array
to such that fields of the typeedtf
get a date value, correctly typed, in addition to the string value.controlled_access_terms_default_configurations
that use the text-based EDTF to the new field with corresponding widget and formatter.How should this be tested?
drush updb -y
)Additional Notes:
This leaves in place the existing text_edtf widget and formatters; however, any field that uses the EDTF widget will be changed to the new EDTF Field Type. Once this is merged we can do separate PRs to update islandora_demo.
Interested parties
@Islandora-CLAW/committers (esp @DiegoPino )