Skip to content

Aurora-Network-Global/booque

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

booque

Library to parse scopus-like boolean queries and translate them into elasticsearch ones.

Installation

git clone https://github.com/martijnvanbeers/booque

create/activate a conda/virtualenv environment

pip install .

or when you plan to make changes:

pip install -e .

Example

cat '"foo" W/3 ("bar" OR "baz")' | booque_parse |curl -s -XPOST 'http://localhost:9200/my_index/_search' -H 'Content-Type: application/json' -d '@-' |jq '.hits.hits[]' |less

or if you want to see the resulting json:

`cat '"foo" W/3 ("bar" OR "baz")' | booque_parse

Translating the aurora and elsevier queries with the provided scripts

Aurora

  • clone the auroa repository: git clone https://github.com/Aurora-Network-Global/sdg-queries

  • run booque_aurora_parse --indir /path/to/sdg-queries --outdir /path/to/output_directory

    This loops over the xml files from the sdg-queries repository and writes json files containing a elasticsearch query for each target per SDG and also a combined query for each SDG

Elsevier

  • Download the Elsevier data

  • run booque_elsevier_parse /path/to/SDG_queries_collated_20191010.xlsx --putdir /path/to/output_directory

Common option

  • each script accepts a --help option that has summary information about how to call it

  • the --outdir option defaults to ./es/, so if that's an acceptable location, there is no need to specify it

  • they all read $HOME/.config/booque/config.json. Currently this can only contain a fields object/dict that maps the scopus field names to the elasticsearch field names. If this file doesn't exist, it will be filled with the default mapping

About

No description, website, or topics provided.

Resources

License

LGPL-3.0, GPL-3.0 licenses found

Licenses found

LGPL-3.0
COPYING.LESSER
GPL-3.0
COPYING

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%