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

Make rdf namespaces configurable (Issue 1520) #831

Closed
wants to merge 3 commits into from
Closed

Make rdf namespaces configurable (Issue 1520) #831

wants to merge 3 commits into from

Conversation

seth-shaw-unlv
Copy link

GitHub Issue: Islandora/documentation#1520

Supersedes Islandora/documentation#78

What does this Pull Request do?

Takes the hard-coded namespaces in islandora.module and instead loads them from configuration.

What's new?

  • Moved namespaces from islandora.module into islandora.settings.yml
  • Updated islandora.module to pull namespaces from config instead of being hardcoded
  • Updated schema to add rdf_namespaces
  • Updated islandora core settings form to update rdf_namespaces config

How should this be tested?

  • Create some records and make sure the JSON-LD looks fine
  • Apply the PR
  • Run drupal updates (drush updb -y)
  • Clear cache
  • Make sure the JSON-LD looks the same
  • Go to the core settings form ('/admin/config/islandora/core') and change one of the namespaces used in the JSON-LD you tested.
  • Clear cache again
  • View the JSON-LD and see the modified namespace in use.

Additional Notes:

Namespaces hardcoded by other modules in their namespace hooks may or may not be overridden by your values in this config. It depends on the processing order of your modules, which can be changed. The Drupal 7 docs on this topic still apply.

Interested parties

@Islandora/8-x-committers

@elizoller
Copy link
Member

elizoller commented Apr 21, 2021

i'm getting a whitescreen of death with apache error in my local install and i'm realizing its because i have the rdf_namespaces hook that specifies rdua. so that might answer your question about what happens on a collision

[Wed Apr 21 17:52:50.404120 2021] [php7:notice] [pid 24171] [client 10.0.2.2:58998] Uncaught PHP Exception Exception: "Tried to map 'rdau' to 'http://rdaregistry.info/Elements/u/', but 'rdau' is already mapped to 'http://www.rdaregistry.info/Elements/u#'." at /var/www/html/drupal/web/core/modules/rdf/rdf.module line 120

@mjordan
Copy link

mjordan commented Apr 21, 2021

Since #827 provides a report of current namespaces, it would be useful to provide a link from that report to the admin form this PR introduces.

@seth-shaw-unlv
Copy link
Author

@mjordan, with the new PRs, #827 should link the JSON-LD form instead: Url::fromRoute('system.jsonld_settings').

@seth-shaw-unlv
Copy link
Author

Superseded by #832

@seth-shaw-unlv seth-shaw-unlv deleted the issue-1520 branch April 27, 2021 19:58
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.

3 participants