Skip to content

Instantly share code, notes, and snippets.

View ColinMaudry's full-sized avatar

Colin Maudry ColinMaudry

View GitHub Profile
@ColinMaudry
ColinMaudry / 0-source.csv
Last active October 3, 2017 23:47
Étapes de transformation du CSV des marchés publics bretons vers le format JSON réglementaire (XSLT 3.0)
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
Nmarché;SIRETMandataire;LibelleEntiteMandataire;SIRETAcheteur;LibelleAcheteur;Nature;Objet;CodeCPV;Type ;Procedure;CodePostalCommuneExecution;NomCommuneExecution;CodeINSEEExecution;GranulariteINSEEExecution;MillesimeMandatement;DateNotification;Montant mandate TTC;Montant mandate HT;Montant attribue TTC;Montant attribue HT;Date de cloture;Duree;SIRETContractant;DenominationSociale;Role;CodePostal;Dpt ID ;Département;Commune;Taille;Taille des entreprises par categorie officielle;Code NAF;Libelle NAF;Libelle SBA;Libelle CCI;geolocalisation
2013-90006;;Région Bretagne;;;;PBF Formation qualifiante 2013 Monteur en construction bois lot 4;;Services;MAPA - art 30 - au dessus des seuils;;;;;2013;2013-10-01;245526;;245526;;;;300599123;AFPA DIRECTION REGIONALE BRETAGNE;Titulaire;35208;35;Ille-et-Vilaine;RENNES;10 000 et plus;Grande entreprise;8559;ENSEIGNEMENT;Administration publique/enseignement;Tertiaire non marchand;
2013-90144;;Région Bretagne;;;;Dispositif de formations : Compétences clés 2013 - Lot 1;;Services;MA

Keybase proof

I hereby claim:

  • I am colinmaudry on github.
  • I am colinmaudry (https://keybase.io/colinmaudry) on keybase.
  • I have a public key whose fingerprint is 7F25 373D 576C B436 449D 843C 90C8 0CB7 D462 C5C3

To claim this, I am signing this object:

@ColinMaudry
ColinMaudry / query.rq
Created October 30, 2016 19:01
Cats on Wikidata
#Cats on Wikidata
#From https://blog.wikimedia.de/2016/10/30/10-cool-queries-for-wikidata-that-will-blow-your-mind-number-7-will-shock-you/
SELECT ?item ?itemLabel
WHERE
{
?item wdt:P31 wd:Q146 .
SERVICE wikibase:label { bd:serviceParam wikibase:language "en" }
}
{
"@context": {
"@vocab": "http://www.w3.org/ns/dcat#",
"dp": "http://dataportals.net/ns/dp#",
"schema": "http://schema.org/",
"rdfs": "http://www.w3.org/2000/01/rdf-schema#",
"xsd": "http://www.w3.org/2001/XMLSchema#",
"url": "@id",
"linked_portals": {
@ColinMaudry
ColinMaudry / sparql.ttl
Created April 7, 2016 20:17
Martly en Turtle
@prefix dbpedia-owl: <http://dbpedia.org/ontology/> .
@prefix dbpedia-fr: <http://fr.dbpedia.org/resource/> .
dbpedia-fr:District_de_Vervins dbpedia-owl:wikiPageWikiLink dbpedia-fr:Canton_de_Marly .
<http://fr.dbpedia.org/resource/Administration_de_l\u0027Aisne> dbpedia-owl:wikiPageWikiLink dbpedia-fr:Canton_de_Marly .
dbpedia-fr:Marly dbpedia-owl:wikiPageDisambiguates dbpedia-fr:Canton_de_Marly ;
dbpedia-owl:wikiPageWikiLink dbpedia-fr:Canton_de_Marly .
dbpedia-fr:Autreppes dbpedia-owl:wikiPageWikiLink dbpedia-fr:Canton_de_Marly .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
dbpedia-fr:Canton_de_Marly rdf:type dbpedia-owl:Territory .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@ColinMaudry
ColinMaudry / ReplaceTabs.xslt
Last active March 2, 2016 19:39
Replacing tabs characters in DITA codeblocks with spaces for PDF (FOP support)
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fo="http://www.w3.org/1999/XSL/Format"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
version="2.0"
exclude-result-prefixes="xs">
<xsl:template match="*[contains(@class,' pr-d/codeblock ')]">
<xsl:call-template name="generateAttrLabel"/>
<fo:block xsl:use-attribute-sets="codeblock">
<xsl:call-template name="commonattributes"/>
@ColinMaudry
ColinMaudry / tomcat.conf
Last active July 11, 2016 21:05
Upstart service configuration for Tomcat
description "Tomcat 7 service"
#So that you remember what the services does
start on runlevel [2345]
# When the service should start. 2, 3, 4 and 5 are
# runlevels that are various flavours of system startup.
stop on runlevel [06]
# 0 is for system halt and 6 is for system reboot
@ColinMaudry
ColinMaudry / named-graphs.rq
Last active August 29, 2015 14:27
Examples of SPARQL queries on data.gov.uk metadata
#List of all the named graphs in the repository. <http://www.data.maudry.com/uk> is the named
#graph where most of the data is stored.
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX dcat: <http://www.w3.org/ns/dcat#>
PREFIX dgfr: <http://colin.maudry.com/ontologies/dgfr#>
select distinct ?graph where {
graph ?graph {
@ColinMaudry
ColinMaudry / availability-reponse-time.rq
Last active August 29, 2015 14:25
Examples of queries on data.gouv.fr and data.gov.uk metadata.
#Stats on resources (dcat:Distribution): availability, format, response time
#Statistiques sur les ressources (dcat:Distribution): disponibilité, format, temps de réponse
PREFIX dct: <http://purl.org/dc/terms/>
PREFIX dcat: <http://www.w3.org/ns/dcat#>
PREFIX dgfr: <http://colin.maudry.com/ontologies/dgfr#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
select ?organizationLabel ?datasetLabel ?datasetUrl ?resourceTitle ?url
@ColinMaudry
ColinMaudry / liste
Created June 3, 2015 22:11
Disponibilié des 10 plus vieux CSV data.gouv.fr
http://opendata.paris.fr/opendata/document?id=150&id_attribute=64 HTTP/1.1 404 NOT FOUND
http://opendata.paris.fr/opendata/document?id=148&id_attribute=64 HTTP/1.1 404 NOT FOUND
http://www.nosdonnees.fr/fr/storage/f/2013-03-15T102507/fondsstrat_2012_section1.csv HTTP/1.1 404 Not Found
http://www.nosdonnees.fr/fr/storage/f/2013-03-15T102836/fondsstrat_2012_section2.csv HTTP/1.1 404 Not Found
http://www.nosdonnees.fr/fr/storage/f/2013-03-15T103218/fondsstrat_2012_section3.csv HTTP/1.1 404 Not Found
http://www.nosdonnees.fr/wiki/images/7/74/500_signatures_de_1995_%C3%A0_2007.csv.gz HTTP/1.1 200 OK
http://data.paysdelaloire.fr/api/publication/23440003400026_J060/Abris_Velos_table/content/?format=csv HTTP/1.1 200 OK
http://parisdata.opendatasoft.com/api/records/1.0/download?dataset=accessibilite_des_equipements_de_la_ville_de_paris&csv_separator=%2C&format=csv HTTP/1.1 200 OK
http://opendata.paris.fr/explore/dataset/accessibilite_des_equipements_de_la_ville_de_paris/download?format=csv HTTP/1.1 200 OK
http://opend