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

TypedRelation override JSON-LD relationship predicates #16

Merged
merged 10 commits into from
Jan 4, 2019
Merged

Conversation

seth-shaw-unlv
Copy link
Contributor

GitHub Issue: Issue 889

What does this Pull Request do?

This PR implements the JSON-LD hook_jsonld_alter_normalized_array() to allow 'typed_relation' fields to add relationships based on the field's selected predicate. It also adds the field to some of the default configuration taxonomy terms with some schema.org default predicates and removes the generic relationship entity reference fields.

What's new?

  • Changes default taxonomy terms feature to such that they use typed_relation instead of a generic entity reference field and, if used, populates the JSON-LD for the term based on the selected predicate.
  • Added controlled_access_terms_jsonld_alter_normalized_array() to update the JSON-LD normalized array with the field's predicate and value.
  • Does this change require documentation to be updated? No (because we didn't have any to begin with; we should change that...)
  • Does this change add any new dependencies? A soft dependency on jsonld (the module still works without it, this code is only called if jsonld is enabled).
  • Does this change require any other modifications to be made to the repository (ie. Regeneration activity, etc.)? No
  • Could this change impact execution of existing code? No.

How should this be tested?

  • Apply the PR
  • Import the Feature changes
  • Create some terms with relationships to other terms using one of the typed relation fields
  • View the term's jsonld (?_format=jsonld) to see the predicate/value you added.

Additional Notes:

This can be tested on a vanilla Drupal with controlled_access_terms enabled, but you will also need to enable the jsonld module, which is not listed as a dependency, to verify it works.

Interested parties

@Islandora-CLAW/committers

Copy link
Contributor

@dannylamb dannylamb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great! I made two people and associated them and could configure the relationship through the UI! With nice defaults, to boot 👍

I noticed when making a repository item I was getting duplicates, but that's because it's got a conflicting entry in the rdf mapping. I've issued https://github.com/Islandora-CLAW/islandora_demo/pull/12 to address it.

@dannylamb dannylamb merged commit 547549e into 8.x-1.x Jan 4, 2019
@seth-shaw-unlv seth-shaw-unlv deleted the issue-889 branch January 31, 2019 16:38
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.

2 participants