Skip to content

Commit

Permalink
Add api-types jq script
Browse files Browse the repository at this point in the history
  • Loading branch information
nichtich committed Feb 26, 2021
1 parent a0f3d09 commit 541b4d8
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions data/legacy/api-types.jq
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Migrate API values from plain URL strings to typed values (#87)
# Usage:
# jq -c -f latest.ndjson > latest-with-api-types.ndjson

def apitype:
if (.|test("bartoc|dante|bielefeld|coli-conc")) then
"http://bartoc.org/api-type/jskos"
elif (.|test("skosmos")) then
"http://bartoc.org/api-type/skosmos"
else
"http://bartoc.org/api-type/webservice"
end
;

if .API then
.API=(.API|map({ url: ., type: (.|apitype) }))
else . end

0 comments on commit 541b4d8

Please sign in to comment.