input data.json:
[
{
"foo": "bar"
} ,
{
# zip two arrays (from https://github.com/stedolan/jq/issues/609#issuecomment-61155381) | |
def input:{"id":["cc-by","cc-zero"], "labels":["Creative Commons Attribution", "Creative Commons Zero"]}; | |
def output: | |
.id as $ids | .labels as $labels | |
| reduce range(0; $labels|length) as $i | |
([]; . + [{ "id": $ids[$i], "label": $labels[$i] }]); | |
input| output | |
-> [{"id":"cc-by", "label":"Creative Commons Attribution"}, {"id":"cc-zero", "label":"Creative Commons Zero"}] |
# 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' |
@prefix places: <http://purl.org/ontology/places#> . | |
@prefix geonames: <http://www.geonames.org/ontology#> . | |
@prefix geo: <http://www.w3.org/2003/01/geo/wgs84_pos#> . | |
@prefix foaf: <http://xmlns.com/foaf/0.1/> . | |
@prefix owl: <http://www.w3.org/2002/07/owl#> . | |
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . | |
<http://data.kasabi.com/dataset/world-geography/cities/berlin-2950159> | |
# this entity is a city: | |
a places:City ; |
@prefix places: <http://purl.org/ontology/places#> . | |
@prefix geonames: <http://www.geonames.org/ontology#> . | |
@prefix geo: <http://www.w3.org/2003/01/geo/wgs84_pos#> . | |
@prefix foaf: <http://xmlns.com/foaf/0.1/> . | |
@prefix owl: <http://www.w3.org/2002/07/owl#> . | |
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . | |
<http://data.kasabi.com/dataset/world-geography/cities/kreuzberg-2884163> | |
# this entity is a city district: | |
a places:District ; |