Comments (2)
This should work:
Fix mods.fix
:
# use a temporary variable
do list(path:_metadata.mods.identifier,var:a)
if all_match(a._body,"^https://duepublico2.uni-due.de/receive/.*")
copy_field(a._body,id)
end
end
# copy all image URLs to a temporary array
copy_field(_metadata.mods.location.*.url.*._body,tmp.$append)
# iterate through the temporary array
do list(path:tmp,var:b)
if all_match(b,"^https://duepublico2.uni-due.de/rsc/thumbnail/.*")
copy_field(b,image)
end
end
# remove the temporary array
remove_field(tmp)
# keep just the two new fields
retain(id,image)
Run command:
$ catmandu convert OAI --url https://duepublico2.uni-due.de/oer/oai --metadataPrefix mods --handler mods to YAML --fix mods.fix
from catmandu.
Thanks it does.
from catmandu.
Related Issues (20)
- create fix "strict" to introduce stricter syntax in fixes HOT 1
- Catmandu::Paged : "illegal division by zero" when limit is 0 HOT 5
- Catmandu::CQLSearchable pod example sru_sortkeys is wrong? HOT 1
- add Iterable peek method
- Installation fails for Perl <5.14 HOT 1
- Support fixing Catmandu::Iterable
- add documentation for Catmandu::Fix::Bind::each HOT 6
- Replace Travis with GitHub Actions HOT 8
- Wildcards-Documentation $start, $end, $first, $last HOT 2
- "Flattening" records into unique rows HOT 3
- Can't locate object method "isa" via package "Parser::MGC::Failure" HOT 4
- Catmandu installation failed since last update HOT 3
- `retain_field` still in documentation and tutorials HOT 1
- `paste` processes when not all or none of the path are provided HOT 1
- is_string conditional and number strings HOT 1
- documentation links are broken HOT 5
- Character encoding broken in MARC-in-JSON export HOT 1
- cpanratings.perl.org no longer exists
- Empty paths are ill-defined in Catmandu and are buggy in some cases.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from catmandu.