Skip to content

Instantly share code, notes, and snippets.

View netsensei's full-sized avatar
👾
retro-wave driven development

Matthias Vandermaesen netsensei

👾
retro-wave driven development
View GitHub Profile
@netsensei
netsensei / process.pl
Created October 16, 2017 21:49
Add raw XML data from an OAI endpoint to a JSON dump in two passes.
#!perl
use JSON;
use Catmandu;
use Try::Tiny::ByClass;
use Data::Dumper;
sub prepare {
my $store = Catmandu->store(
@netsensei
netsensei / arthub.md
Last active September 5, 2017 12:28
Installing the Datahub::Factory::Arthub modules

Installing the Datahub::Factory::Arthub modules

Introduction

The Datahub::Factory is a Catmandu based toolkit which allows easy and efficient setup and management of ETL pipelines. A pipeline transforms and transports data between two systems. The set of primary use cases for which this toolkit was conceived is situated within the GLAM (Galleries, Libraries, Archives & Museums) domain.

Out of the box, the Datahub::Factory is a generic, extensible toolkit. While you can use the

@netsensei
netsensei / rma_records.json
Created August 5, 2017 13:12
Rijkmuseum JSON data as records
[
{
"https://www.rijksmuseum.nl/en/collection/BK-AM-33-C": {
"a": "edm_ProvidedCHO",
"dc_coverage": [
"fourth quarter 15th century@en",
"vierde kwart 15e eeuw@nl"
],
"dc_creator": [
"<urn:rijksmuseum%3Apeople%3ARM0001.PEOPLE.107435>",
@netsensei
netsensei / rma.json
Created August 5, 2017 13:09
Rijksmuseum JSON sample
[
{
"https://www.rijksmuseum.nl/en/collection/BK-AM-33-C": {
"a": "edm_ProvidedCHO"
}
},
{
"https://www.rijksmuseum.nl/en/collection/BK-AM-33-C": {
"dc_coverage": "fourth quarter 15th century@en"
}
@netsensei
netsensei / rma.ttl
Created August 5, 2017 13:00
Rijksmuseum Turtle sample
collection:BK-AM-33-C
a edm:ProvidedCHO ;
dc:coverage "fourth quarter 15th century"@en ,
"vierde kwart 15e eeuw"@nl ;
dc:creator <urn:rijksmuseum%3Apeople%3ARM0001.PEOPLE.107435> ,
<urn:rijksmuseum%3Apeople%3ARM0001.PEOPLE.107436> ,
<urn:rijksmuseum%3Apeople%3ARM0001.PEOPLE.98030> ,
"toegeschreven aan Borman, Jan (II)"@nl ,
"toegeschreven aan Thienen, Renier van"@nl ,
"verworpen toeschrijving Delemer, Jean"@nl ;
@netsensei
netsensei / catmandu_module.md
Last active September 1, 2017 09:06
Bootstrap a Catmandu module

Catmandu development

Okay. So you want to build your own Catmandu module? This is a bit of documentation that should help you bootstrap your development environment.

Prerequisites

PERL

Catmandu depends on Perl. You can start out working with system Perl that came with your OS. But since you want to do active development, it's recommended to go with an alternate installation and leave the default alone. This is especially true if you work on OSX or Windows!

@netsensei
netsensei / french_aoc_wines.sparql
Last active February 1, 2016 16:47
French cheeses (wikidata)
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX v: <http://www.wikidata.org/prop/statement/>
PREFIX q: <http://www.wikidata.org/prop/qualifier/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT ?s ?sLabel ?lLabel ?geo {
?s wdt:P31 wd:Q1565828 .
@netsensei
netsensei / creators_dod.sparql
Created January 28, 2016 20:05
SPARQL query against wikidata example.
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX v: <http://www.wikidata.org/prop/statement/>
PREFIX q: <http://www.wikidata.org/prop/qualifier/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT DISTINCT ?c ?cLabel (substr(?dod, 0, 4) as ?t)
WHERE
@netsensei
netsensei / zeroMQ_homestead
Created December 1, 2015 21:14
Installing ZermoMQ on Homestead
First install ZeroMQ itself.
1. sudo apt-get update
2. sudo apt-get install pkg-config
3. sudo apt-get install libzmq3-dev
Now install the PHP language binding. We assume PHP is running as PHP-FPM.
1. sudo pecl install zmq-beta
@netsensei
netsensei / nasa.xsl
Created September 26, 2015 14:46
Converts XML output of the US GSA Social Media API to CSV - http://registry.usa.gov/accounts.xml?agency_id=nasa
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text" />
<xsl:variable name="delimiter" select="','" />
<!-- define an array containing the fields we are interested in -->
<xsl:variable name="fieldArray">
<field>service_id</field>
<field>account</field>