Skip to content
This repository has been archived by the owner on Dec 3, 2021. It is now read-only.

Support embedded transformation rules #5

Open
fsteeg opened this issue Mar 11, 2013 · 0 comments
Open

Support embedded transformation rules #5

fsteeg opened this issue Mar 11, 2013 · 0 comments

Comments

@fsteeg
Copy link
Contributor

fsteeg commented Mar 11, 2013

To have complete transformation definitions in one file, it might make sense to support (rudimentary) embedded transformation rules in Flux files within the Metafacture IDE, e.g.:

files + "input.xml" | open-file | decode-xml | read-marcxml | 
morph { 
  /* simple rule: just transform the key: */ 
  "8564 .u" -> "http://lobid.org/vocab/lobid#fulltextOnline"; 
  /* transform key and value, using the regexp function: */ 
  "260 .c" -> "http://purl.org/dc/terms/medium/issued" { 
     regexp.match("(1\d{3}|200\d)").format("${1}");
     // e.g. "07.04.1873[nach dem 07.04.1873]" -> "1873"
  } 
} | encode-ntriples | write(output + "output.nt");

Based on the morph block representation parsed by Xtext, we could generate the corresponding morph.xml file with Xtend, replace the morph block with a reference to the morph.xml, and pass the result to Flux.

We might also be able to generate some test.xml for the transformation (verify the simple key transformation, or even make comments like // e.g. "07.04.1873[nach dem 07.04.1873]" -> "1873"; part of the grammar and convert them into test cases).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

1 participant