Last active
November 15, 2018 12:31
-
-
Save knudmoeller/deb250b089a734894b86fdfc2fc5fe7d to your computer and use it in GitHub Desktop.
Filtering stuff with grep, sed, etc.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# From an online DCAT catalog RDF/XML, get all dcat:accessURLs (likely the ressource URLs) | |
wget -q -O - https://datenregister.berlin.de/catalog.rdf | grep "dcat:accessURL" | grep -o '".*"' | sed 's/"//g' | |
# From an online JSON Schema, make HTML <option> elements for each member of the value enum of a given property | |
PROP_NAME="geographical_granularity" | |
curl -s https://datenregister.berlin.de/schema/berlin_od_schema.json | \ | |
jq -r ".properties.${PROP_NAME}.enum[]" | \ | |
sed 's/^\(.*\)$/<option value="\1">\1<\/option>/g' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment