-
Notifications
You must be signed in to change notification settings - Fork 2
Consistent handling of repeated fields / arrays #65
Comments
Copying previous discussion for better overview: I have to admit, I find this behaviour highly debatable. What's the rationale? I guess I want to have full control over the output I'm building, not have Metafix decide that it knows better what I wanted? Granted, I don't have an example at hand right now. Maybe I'm overreacting. Certainly feels iffy, though... Originally posted by @blackwinter in #60 (comment) Yeah, the whole topic of repeated values / arrays needs work. I've opened #65 for that. Originally posted by @fsteeg in #60 (comment) |
From discussion:
|
Functional review: @TobiasNx, code review: @blackwinter / @fsteeg |
There is one difficulty that pop in my head. If we have multiple records and a field is repeatable. But in a couple of records the field exist 1-time and in other n+1 times. record 1:
record2:
|
Indeed, that's what I'm concerned about too. But you can always iterate over the parent element, can't you? ( |
Also if you want to select the path for an array in an other field/array you need the index-number or wildcard https://github.com/LibreCat/Catmandu/wiki/Paths#wildcards:
|
It seems that catmandu is behaving the same way: It could be that the specific importer change tha behaviour if in a specific format like MODS a field is repeatable or not. That could be managed in an handler. |
I investigated this a little further: https://github.com/TobiasNx/Catmandu-Testing/tree/master/repeatable_fields_xml Catmandu converts general formats like XML as follow:
But specific importers like MODS or the OAI importer that converts Dublin Core create lists by default for fields that are defined as repeatable fields in the format/schema. Even if they only occure once. |
`./gradlew run --args 'data/experimental/duepub-metafacture.flux'` See metafacture/metafacture-fix#65
Co-authored-by: Jens Wille <[email protected]>
`./gradlew run --args 'data/experimental/duepub-metafacture.flux'` See metafacture/metafacture-fix#65
Pre-published current state as Assigning @TobiasNx for functional review; see also the discussion at #78 (comment) about a possible better process for providing and implementing specific use cases. |
I think it will be best if I will create small use cases/test cases that need to be handled in https://gitlab.com/oersi/oersi-etl/-/tree/FunctionalReview/data/experimental Perhaps we could have a separate metafacture instance only for testing where we could collect test scenarios besides the OERSI context? |
@blackwinter what should I do here? |
I don't know. This issue has status "Review" and you're the reviewer. If the status is no longer appropriate it should be updated, I guess. |
I think this is resolved in context of: #109 |
I close this ticket, we can reopen it, if we need. |
Explicit arrays (e.g. in JSON input) vs. explicit / repeated values (e.g. in XML input).
Field names like:
metadata.mods.identifier.value
vs.metadata.mods.identifier.*.value
vs.metadata.mods.identifier[].*.value
See:
The text was updated successfully, but these errors were encountered: