-
Notifications
You must be signed in to change notification settings - Fork 34
Things that are different between Catmandu and Metafacture
TobiasNx edited this page Apr 8, 2025
·
4 revisions
Fix:
- Indexing of array/repeatable fields: Catmandu starts with 0, Metafacture starts with 1 due to JsonDecoder. (Not sure if this is broader Metafacture/Catmandu level).
-
set_
: MF alias for add_functions, Catmandu does not create an intermediate structure, MF does. - Lookup: Besides the lookup function MF has own mechanisms to set files csv, tsv, ttl or a internal list as lookup maps (
put_filemap
prput_map
) Catmandu has two based on specific lookups: (lookup -> file and lookup_in_store -> in store/database) - You can define Varibles in MF, in Catmandu it seems you cannot.
- MF supports Macros, Catmandu seems not to.
- Additional functions and binds:
- Metafacture:
-
add_hash
andadd_array
- put_filemap, put_map, put_rdfmap
- put_var, put_vars, to_var
- call_macro
- timestamp
- isbn
- to_base64
- do list_as
- do once
- do put_macro
- if all_contain
- none_ variations of conditionals
- str_ variations of conditionals
-
- Catmandu
- assoc / diassoc
- compact
- some binds
-
iterate
bind - lookup_in_store
- add_to_store
- add_to_exporter
- export_to_string
- import_from_string
- search_in_store
- import
- reject
- cmd
- perlcode
- error
- collapse
- expand
- clone
- do benchmark
- do hashmap
- do identity
- do importer
- do iterate
- do each
- do maybe
- do timeout
- do visitor
- do with
- all marc and pica fixes
- Metafacture:
-
do list(path:"...", "var":"...)
in MF Fix the var needs to be in " in catmandu not - substring-function does not define start and end index but start and number of signs.
- Array-Wildcards: Catmandu:
$last
/$first
write, MF they do not - MF does not support root
.
, Catmandu does -
move_field
: MF cannot move field with same name from string to object -
vacuum
: catmandu can catch" "
, MF does not -
copy_field
array of string with single value: MF copies them as simple field, Catmand keeps the array -
remove_field
: MF cannot delete field from array of objects
Metafacture/Catmandu-Level:
- embedded fix in catmandu commands can be separated by
;
- YAML encoding when transforming to yaml from marc catmandu shows the hidden _id by default too, metafacture does not
- Output Arrays: MF does not know what an array is, fix need to add Array marker for JSON Arrays, Catmandu outputs Arrays as arrays, Catmandu does not know repeatable fields in JSON?
- Marc handling in MF and Catmandu are completly different. MF: Leader-Element, XXX+Indicies = Toplevel elements, Subfilds=> Subfields, difficulties are created by repeated subfields, Catmandu: _id, array-in-array, unclear structure) (MF has an big advantage here. MF: uses generic fix, Catmandu: uses its special Marc-Fix
Find the user documentation for Metafacture here:
https://metafacture.org/metafacture-documentation/
- Code Quality and Style
- How to debug
- Things that are different between Catmandu and Metafacture
- Plugin and Tools
- Who uses Metafacture