diff --git a/data/legacy/api-types.jq b/data/legacy/api-types.jq new file mode 100644 index 0000000..d88f3ac --- /dev/null +++ b/data/legacy/api-types.jq @@ -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