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

is it possible to map multiple drupal fields to one RDF statement? #844

Closed
ppound opened this issue Jun 18, 2018 · 7 comments
Closed

is it possible to map multiple drupal fields to one RDF statement? #844

ppound opened this issue Jun 18, 2018 · 7 comments

Comments

@ppound
Copy link
Member

ppound commented Jun 18, 2018

The Samvera metadata working group released an interesting MODs to RDF mapping document (https://docs.google.com/document/d/1FZI8KJiW4qSKYUUKe0mAwqlx0ppVRFyPtsfLDqQE5T8/edit#).

They suggest mapping a title and subtitle to one RDF statement so that
<mods:titleInfo usage="primary">
mods:nonSortThe</mods:nonSort>
mods:titlewintermind</mods:title>
mods:subTitleWilliam Bonk and American letters</mods:subTitle>
</mods:titleInfo>

becomes
https://example.org/objects/1 dcterms:title "The wintermind : William Bonk and American letters" .

Things like MODs name could be more complex.

For data entry and faceting and searching in Drupal etc. it may make sense to have multiple Drupal fields like title and subtitle that map to one RDF statement similar to the one above.

@seth-shaw-unlv
Copy link
Contributor

seth-shaw-unlv commented Jun 19, 2018 via email

@seth-shaw-unlv
Copy link
Contributor

I should also note that I am using this same strategy in another project for my "Person" content type.

@mjordan
Copy link
Contributor

mjordan commented Jun 19, 2018

You'd think there'd be a hook to override a mapping.... maybe that's a good issue for us to open on d.o.?

@seth-shaw-unlv
Copy link
Contributor

The RDF module implements quite a few hooks, but only invokes one of their own (hook_rdf_namespaces).

@DiegoPino
Copy link
Contributor

The use case (won't criticise Samvera's choice... but its another way of doing things, their mapping is or can be totally hardcoded into code and well, they don't need to map back and forth) and in our case doing this, is a very NOT drupal-ish way of doing it. Concatenating multiple field values inside a single RDF property is not the same as mapping multiple fields to the same RDF property. If you want to follow this idea you need to either do this as a post process (hard coded) outside drupal when sync happens or create a special complex drupal field that does that for you (single mapping but multiple input fields). I have been working around and inside rdf module and hooks there won't give you that control. Also tbh it is very non rdf-ish too.

@ppound
Copy link
Member Author

ppound commented Jun 19, 2018

Thanks for the responses. I'm not sure if we would ever pursue what the Samvera doc suggests but when reading the doc I was wondering if CLAW/Drupal supported what the Samvera group suggested. Based on Seth's answer It looks like it could be done without custom code but it could get messy.

We've played with node_presave (or maybe it was entity_presave) as well to build up a URI field from multiple fields and did a RDF mapping for the URI field, but that was custom code and probably not ideal.

So that leads to another question are there any CLAW MODS to RDF docs or recommendations? I'm wondering how others are planning on tackling this as I think it will be a big part of migrations?

@seth-shaw-unlv
Copy link
Contributor

There has been some discussion of MODS->CLAW in #819

@ppound ppound closed this as completed Jun 21, 2018
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

No branches or pull requests

4 participants