diff --git a/Makefile b/Makefile index a420905..9af0101 100644 --- a/Makefile +++ b/Makefile @@ -1,17 +1,17 @@ data/corpus-simple-pascal.json: data/corpus-simple-teeft-en.json - npx ezs -e enrich-pascal.ini + npx ezs enrich-pascal.ini < data/corpus-simple-teeft-en.json > data/corpus-simple-pascal.json data/corpus-simple-teeft-en.json: data/corpus-simple-instituts.json - npx ezs -e enrich-teeft-en.ini + npx ezs enrich-teeft-en.ini < data/corpus-simple-instituts.json > data/corpus-simple-teeft-en.json data/corpus-simple-instituts.json: data/corpus-simple-etab.json - npx ezs -e enrich-institutes.ini + npx ezs enrich-institutes.ini < data/corpus-simple-etab.json > data/corpus-simple-instituts.json data/corpus-simple-etab.json: data/corpus-simple-rnsr.json - npx ezs -e enrich-etab.ini + npx ezs enrich-etab.ini < data/corpus-simple-rnsr.json > data/corpus-simple-etab.json data/corpus-simple-rnsr.json: data/corpus-simple.json - npx ezs -e enrich-rnsr.ini + npx ezs enrich-rnsr.ini < data/corpus-simple.json > data/corpus-simple-rnsr.json data/corpus-simple.json: corpus_WoS_vol1.json - npx ezs -e extract-fields.ini + npx ezs extract-fields.ini < corpus_WoS_vol1.json > data/corpus-simple.json diff --git a/enrich-etab.ini b/enrich-etab.ini index f8f61f8..a99295e 100644 --- a/enrich-etab.ini +++ b/enrich-etab.ini @@ -1,22 +1,13 @@ -# Usage: npx ezs -e enrich-etab.ini +# Usage: npx ezs enrich-etab.ini < data/corpus-simple-rnsr.json > data/corpus-simple-etab.json # To see the enriched notices: # $ fx < data/corpus-simple-etab.json '.filter(o => o.ws.rnsr[0]?.length)' [use] -# JSONParse FILELoad FILESave +# JSONParse plugin = basics -# read data -[exchange] -value = [ "corpus-simple-rnsr.json" ] - -[JSONParse] - -[FILELoad] -location = data - [JSONParse] # Concaténation des sigles et libellés des établissements associés @@ -24,13 +15,5 @@ path = ws.etab value = get('ws.rnsr', []).map(structs => Array.isArray(structs) ? structs.map(struct => `${struct.sigle}: ${struct.intitule}`) : []).flatten() -# Save data -[dump] -indent = true - -[FILESave] -location = data -identifier = corpus-simple-etab.json - [dump] indent = true diff --git a/enrich-institutes.ini b/enrich-institutes.ini index bc463f8..e5307be 100644 --- a/enrich-institutes.ini +++ b/enrich-institutes.ini @@ -1,26 +1,18 @@ -# Usage: npx ezs -e enrich-institutes.ini +# Usage: npx ezs enrich-institutes.ini < data/corpus-simple-etab.json > data/corpus-simple-instituts.json # To see the enriched notices: # $ fx < data/corpus-simple-instituts.json '.filter(o => o.ws.rnsr[0]?.length)' [use] -# JSONParse URLConnect FILELoad FILESave +# JSONParse URLConnect plugin = basics -# expand +# expand aggregate exploding plugin = analytics -[exchange] -value = [ "corpus-simple-etab.json" ] - [JSONParse] -[FILELoad] -location = data - -[JSONParse] - -#2 - Instituts du CNRS +# - Instituts du CNRS [assign] path = ws.rnsr_id @@ -54,10 +46,3 @@ [dump] indent = true - -[FILESave] -location = data -identifier = corpus-simple-instituts.json - -[dump] -indent = true diff --git a/enrich-pascal.ini b/enrich-pascal.ini index 63ed0e2..1fa07ff 100644 --- a/enrich-pascal.ini +++ b/enrich-pascal.ini @@ -1,23 +1,16 @@ -# Usage: npx ezs -e enrich-pascal.ini +# Usage: npx ezs enrich-pascal.ini < data/corpus-simple-teeft-en.json > data/corpus-simple-pascal.json + # To see the enriched notices: # $ fx < data/corpus-simple-pascal.json '.filter(o => o.ws.rnsr[0]?.length)' [use] -# JSONParse URLConnect FILELoad FILESave +# JSONParse URLConnect plugin = basics # expand plugin = analytics -[exchange] -value = [ "corpus-simple-teeft-en.json" ] - -[JSONParse] - -[FILELoad] -location = data - [JSONParse] # - Pascal @@ -29,7 +22,6 @@ [expand] path = ws.pascal -# WARNING: using the line below sometimes leads to unexpected results size = 100 [expand/URLConnect] @@ -40,10 +32,3 @@ [dump] indent = true - -[FILESave] -location = data -identifier = corpus-simple-pascal.json - -[dump] -indent = true diff --git a/enrich-rnsr.ini b/enrich-rnsr.ini index 177e8f2..2491f9e 100644 --- a/enrich-rnsr.ini +++ b/enrich-rnsr.ini @@ -1,25 +1,17 @@ -# Usage: npx ezs -e enrich-rnsr.ini +# Usage: npx ezs enrich-rnsr.ini < data/corpus-simple.json > data/corpus-simple-rnsr.json # To see the enriched notices: # $ fx < data/corpus-simple-rnsr.json '.filter(o => o.ws.rnsr[0]?.length)' [use] -# JSONParse URLConnect FILELoad FILESave +# JSONParse URLConnect plugin = basics -# expand +# expand aggregate exploding plugin = analytics -[exchange] -value = [ "corpus-simple.json" ] - [JSONParse] -[FILELoad] -location = data - -[JSONParse] - -#1 - Informations RNSR +# - Informations RNSR [assign] path = ws.rnsr @@ -45,10 +37,3 @@ [dump] indent = true - -[FILESave] -location = data -identifier = corpus-simple-rnsr.json - -[dump] -indent = true diff --git a/enrich-teeft-en.ini b/enrich-teeft-en.ini index 8118e71..4e88690 100644 --- a/enrich-teeft-en.ini +++ b/enrich-teeft-en.ini @@ -1,26 +1,18 @@ -# Usage: npx ezs -e enrich-teeft-en.ini +# Usage: npx ezs enrich-teeft-en.ini < data/corpus-simple-instituts.json > data/corpus-simple-teeft-en.json # To see the enriched notices: # $ fx < data/corpus-simple-teeft-en.json '.filter(o => o.ws.rnsr[0]?.length)' [use] -# JSONParse URLConnect FILELoad FILESave +# JSONParse URLConnect plugin = basics # expand plugin = analytics -[exchange] -value = [ "corpus-simple-instituts.json" ] - [JSONParse] -[FILELoad] -location = data - -[JSONParse] - -#2 - Teeft +# - Teeft [assign] @@ -29,7 +21,6 @@ [expand] path = ws.teeft -# WARNING: using the line below sometimes leads to unexpected results size = 100 [expand/URLConnect] @@ -40,10 +31,3 @@ [dump] indent = true - -[FILESave] -location = data -identifier = corpus-simple-teeft-en.json - -[dump] -indent = true diff --git a/extract-fields.ini b/extract-fields.ini index 730220e..90c9569 100644 --- a/extract-fields.ini +++ b/extract-fields.ini @@ -1,18 +1,10 @@ -# Take a WoS file in the data directory and extract few fields. +# Extract few fields from a WoS file. # Usage: -# npx ezs -e extract-fields.ini | jq +# npx ezs extract-fields.ini < corpus_WoS_vol1.json | jq [use] plugin = basics -[exchange] -value = [ "corpus_WoS_vol1.json" ] - -[JSONParse] - -[FILELoad] -location = . - [JSONParse] [assign] @@ -58,10 +50,3 @@ [dump] indent = true - -[FILESave] -location = data -identifier = corpus-simple.json - -[dump] -indent = true \ No newline at end of file