-
Notifications
You must be signed in to change notification settings - Fork 71
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
Comments
I don't believe the RDF mapping supports concatenation of fields.
What you could do is have three fields, title , main title, and subtitle,
and use the auto_entitylabel module to concatenate the main title and
subtitle into the title field. You could hide the title field from the form
view so data entry staff only see main title and subtitle with the title
field being automatically updated on save. Then the RDF mapping would only
need to map the title field to have the combined title.
|
I should also note that I am using this same strategy in another project for my "Person" content type. |
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.? |
The RDF module implements quite a few hooks, but only invokes one of their own (hook_rdf_namespaces). |
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. |
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? |
There has been some discussion of MODS->CLAW in #819 |
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.
The text was updated successfully, but these errors were encountered: