Skip to content

Instantly share code, notes, and snippets.

@aculich
Last active November 1, 2017 21:54
Show Gist options
  • Select an option

  • Save aculich/12f0955faae7c26290a903fac4036744 to your computer and use it in GitHub Desktop.

Select an option

Save aculich/12f0955faae7c26290a903fac4036744 to your computer and use it in GitHub Desktop.
example of using jq to extract journals from the AMiner Open Academic Graph: https://aminer.org/open-academic-graph
#!/bin/bash
## example of using jq to extract journals from
## the AMiner Open Academic Graph:
## https://aminer.org/open-academic-graph
wget https://academicgraphv1wu.blob.core.windows.net/aminer/aminer_papers_0.zip
unzip -p aminer_papers_0.zip aminer_papers_0.txt > aminer_papers_0.txt
jq . aminer_papers_0.txt -C | less -r
jq .venue aminer_papers_0.txt -C | wc -l
time jq .venue aminer_papers_0.txt > aminer_papers_0_venue.txt
time cat aminer_papers_0_venue.txt | sort -u | tee aminer_papers_0_venue_sort_uniq.txt
wc -l aminer_papers_0_venue_sort_uniq.txt
time jq '. | select(.venue=="Child Development")' aminer_papers_0.txt > aminer_papers_0_venue_child_development.txt
jq . aminer_papers_0_venue_child_development.txt -C | less -r
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment