input data.json:
[
{
"foo": "bar"
} ,
{
@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 ; |
@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 ; |
# 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' |
# 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"}] |
input data.json
[
{
"id": 0 ,
"foo": "bar"
} ,
{
"id": 1 ,
tar -cvzf $ARCHIVE_NAME.tgz $CONTENT_1 $CONTENT_2 ... |
# coding: utf-8 | |
require 'json' | |
require 'uri' | |
require 'net/https' | |
require 'optparse' | |
require 'logger' | |
# Send an HTTP request, interprete response as JSON | |
# and return as Ruby object. |
SELECT ?ediblething ?ediblethingLabel WHERE { | |
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } | |
wd:Q158657 wdt:P171+ ?parent_taxon . # Q158657 is "Malus pumila", the tree we want to find fruit for | |
?ediblething | |
wdt:P1582 ?parent_taxon ; | |
wdt:P279 ?superthing . | |
?superthing wdt:P361 wd:Q21925565 . | |
} | |
LIMIT 100 |