Skip to content

Instantly share code, notes, and snippets.

@gpirrotta
gpirrotta / protezione-civile-sicilia-bollettino-meteo.py
Last active July 16, 2021 13:56
Script per la generazione di un file JSON contenente il livello di allerta estratto dai bollettini meteo PDF pubblicati giornalmente dalla Protezione Civile della Regione Sicilia
# Script per la generazione di un file JSON contenente il livello di allerta
# estratto dai bollettini meteo PDF pubblicati giornalmente dalla Protezione Civile della Regione Sicilia
# http://www.regione.sicilia.it/presidenza/protezionecivile/pp/archivio_idro.asp
# Giovanni Pirrotta - giovanni.pirrotta@gmail.com
# 2017
import os
import requests
import datetime
from bs4 import BeautifulSoup
@gpirrotta
gpirrotta / gist:7e0429be97d041291cb472aa5555f9a1
Created December 2, 2018 15:34 — forked from CristinaSolana/gist:1885435
Keeping a fork up to date

1. Clone your fork:

git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
@gpirrotta
gpirrotta / sopravvissuti.sparql
Last active November 16, 2019 16:49
Shoah SPARQL queries
PREFIX bio-ext: <http://dati.cdec.it/lod/bio-ext/>
SELECT (count(distinct ?uri) as ?survived)
FROM <http://dati.cdec.it/lod/shoah/>
{
?uri a foaf:Person;
bio-ext:shoahSurvivor "true".
}
PREFIX bio-ext: <http://dati.cdec.it/lod/bio-ext/>
PREFIX bio: <http://purl.org/vocab/bio/0.1/>
SELECT ?name ?survived
FROM <http://dati.cdec.it/lod/shoah/>
{
?uri a foaf:Person;
rdfs:label ?name.
OPTIONAL { ?uri bio-ext:shoahSurvivor ?survived }
?uri owl:sameAs ?uri_same.
PREFIX shoah: <http://dati.cdec.it/lod/shoah/>
SELECT distinct ?descr (count(?descr) as ?tipo)
FROM <http://dati.cdec.it/lod/shoah/>
WHERE{
?uri a foaf:Person;
shoah:persecution ?persecution.
?persecution shoah:deathDescription ?descr.
}
ORDER BY DESC(?tipo)
PREFIX bio-ext: <http://dati.cdec.it/lod/bio-ext/>
PREFIX shoah: <http://dati.cdec.it/lod/shoah/>
SELECT DISTINCT ?country count(?country) as ?count
FROM <http://dati.cdec.it/lod/shoah/>
WHERE {
?IRI a foaf:Person;
bio-ext:birthPlace ?birth.
?birth foaf:country ?country.
FILTER(?country != 'Italia').
PREFIX shoah: <http://dati.cdec.it/lod/shoah/>
PREFIX bio-ext: <http://dati.cdec.it/lod/bio-ext/>
SELECT DISTINCT ?name ?birthPlace ?arrestPlace ?raccolta
FROM <http://dati.cdec.it/lod/shoah/>
WHERE
{ ?uri a foaf:Person;
rdfs:label ?name;
bio-ext:birthPlace ?birth.
?birth rdfs:label ?birthPlace.
PREFIX bio-ext: <http://dati.cdec.it/lod/bio-ext/>
PREFIX bio: <http://purl.org/vocab/bio/0.1/>
PREFIX shoah: <http://dati.cdec.it/lod/shoah/>
SELECT DISTINCT ?labelConvoy ?deparDate ?labelCamp
FROM <http://dati.cdec.it/lod/shoah/>
WHERE {
?convoy a shoah:Convoy;
rdfs:label ?labelConvoy;
shoah:departureDate ?deparDate;
PREFIX bio-ext: <http://dati.cdec.it/lod/bio-ext/>
PREFIX bio: <http://purl.org/vocab/bio/0.1/>
PREFIX shoah: <http://dati.cdec.it/lod/shoah/>
SELECT DISTINCT ?labelConvoy ?deparDate ?labelCamp ?gender (count(?gender) as ?count)
FROM <http://dati.cdec.it/lod/shoah/>
WHERE
{?convoy a shoah:Convoy;
rdfs:label ?labelConvoy;
shoah:departureDate ?deparDate;
PREFIX shoah: <http://dati.cdec.it/lod/shoah/>
PREFIX bio-ext: <http://dati.cdec.it/lod/bio-ext/>
SELECT DISTINCT ?labelConvoy ?birth ?deparDate ?labelCamp ?gender (count(?gender) as ?count)
FROM <http://dati.cdec.it/lod/shoah/>
WHERE
{?convoy a <http://dati.cdec.it/lod/shoah/Convoy>;
rdfs:label ?labelConvoy;
shoah:departureDate ?deparDate;
shoah:toNaziCamp ?naziCamp.