Skip to content

Instantly share code, notes, and snippets.

@lokal-profil
lokal-profil / fixSubCollections.py
Last active November 9, 2015 19:20
NatMus: Script for replacing P195 statements with P518 qualifiers by the value of that qualifier
#!/usr/bin/python
# -*- coding: utf-8 -*-
import pywikibot
import pywikibot.data.wikidataquery as wdquery
COLLECTION_P = '195'
PART_P = '518'
INSTITUTION_Q = '842858'
PREFIX_MAP = {
u'NM': {u'subcol': None, u'place': u'Q%s' % INSTITUTION_Q},
u'NMB': {u'subcol': None, u'place': u'Q%s' % INSTITUTION_Q},
@lokal-profil
lokal-profil / test_redux.py
Last active November 9, 2015 19:21
LSH: Script for comparing the results before and after the implementation https://github.com/lokal-profil/LSH/issues/3
#!/usr/bin/python
# -*- coding: UTF-8 -*-
#
# Test for redux equivalency
# run from main directory
#
import codecs
import random
files = ('ausstellung_trim.csv', 'ereignis_trim.csv', 'objMass_trim.csv',
'photo_multimedia_etc.csv', 'kuenstler_trim.csv', 'objDaten_etc.csv',
@lokal-profil
lokal-profil / fixBrokenLinks.py
Last active September 23, 2015 07:16
Script for replacing a list of broken links in both statements and references on Wikidata
@lokal-profil
lokal-profil / index.html
Last active August 29, 2015 14:14
Running odyssey.js with the md as an external file
<!doctype><html><head>
<meta charset="utf-8">
<title>Import slides from external md file</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="http://cartodb-libs.global.ssl.fastly.net/cartodb.js/v3/themes/css/cartodb.css">
<link rel="stylesheet" href="http://cartodb.github.io/odyssey.js/editor/css/slides.css">
<script type="text/javascript" src="//cdn.leafletjs.com/leaflet-0.7.3/leaflet.js"></script>