Skip to content

Instantly share code, notes, and snippets.

View RinkeHoekstra's full-sized avatar

Rinke Hoekstra RinkeHoekstra

  • Elsevier
  • Amsterdam
View GitHub Profile
@RinkeHoekstra
RinkeHoekstra / convert.py
Last active August 29, 2015 14:21
Frankwatching Wordpress export to RDF
# Copyright (c) 2015, Rinke Hoekstra, VU University Amsterdam
# Licensed under the MIT License
from bs4 import BeautifulSoup
from rdflib import Graph, Namespace, RDF, RDFS, XSD, Literal, URIRef
# Prepare the RDF graph
g = Graph()
DCT = Namespace('http://purl.org/dc/terms/')
@RinkeHoekstra
RinkeHoekstra / provomatic-matplotlib-fill
Created April 15, 2014 08:24
PROV-O-Matic demo using the matplotlib ['simple demo of the fill function'](http://matplotlib.org/examples/lines_bars_and_markers/fill_demo.html),.
{
"metadata": {
"name": "",
"signature": "sha256:570e83e113f52fe82864da1a63257d4f9eaa26f9a15ccd6e36727534f4abc725"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
@RinkeHoekstra
RinkeHoekstra / evaluation.py
Created January 23, 2014 15:20
Small script to evaluate whether the output of SampLD based on the triple-guessing approach makes any sense compared to firing queries against the samples. Prerequisites: * `pip install beautifulsoup4` * `pip install SPARQLWrapper`
# -*- coding: utf-8 -*-
# <nbformat>3.0</nbformat>
# <codecell>
from bs4 import BeautifulSoup
html_doc = open('results.html','r').read()
soup = BeautifulSoup(html_doc)
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no"/>
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=true"></script>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.js?1.29.1"></script>
<style type="text/css">
html, body, #map {
width: 100%;