Our Next Story

jq demo

Creating our initial list of journal titles

jq makes it very easy to filter the complex output from the ORCID api into a simple list of journal titles. This is done by a dot notation path.

    jq '.["orcid-profile"]["orcid-activities"]["orcid-works"]["orcid-work"][]["journal-title"].value' example.json

Initial output

    null
    "Science & Technology Libraries"
    "Abstracts of Papers of the American Chemical Society"
    "Chemical Information for Chemists"
    null
    "Abstracts of Papers of the American Chemical Society"
    "Abstracts of Papers of the American Chemical Society"
    "Abstracts of Papers of the American Chemical Society"
    "Abstracts of Papers of the American Chemical Society"
    "Abstracts of Papers of the American Chemical Society"
    "Abstracts of Papers of the American Chemical Society"
    "Abstracts of Papers of the American Chemical Society"
    null

Piping the output through grep -v null | sort -u cleans up the list easily

    jq '.["orcid-profile"]["orcid-activities"]["orcid-works"]["orcid-work"][]["journal-title"].value' example.json | grep -v "null" | sort -u