Skip to content

Instantly share code, notes, and snippets.

View cgueret's full-sized avatar
🤓
I may be slow to respond.

Christophe Gueret cgueret

🤓
I may be slow to respond.
View GitHub Profile
@cgueret
cgueret / eu_shared_lang.rq
Last active December 14, 2015 14:09
Query to get a social network out of DBpedia
SELECT DISTINCT ?Source ?Target ?Label WHERE {
?country1 a <http://dbpedia.org/class/yago/EuropeanCountries>.
?country1 <http://dbpedia.org/ontology/officialLanguage> ?language.
?country2 a <http://dbpedia.org/class/yago/EuropeanCountries>.
?country2 <http://dbpedia.org/ontology/officialLanguage> ?language.
FILTER (?country1 != ?country2)
?country1 <http://www.w3.org/2000/01/rdf-schema#label> ?Source.
?country2 <http://www.w3.org/2000/01/rdf-schema#label> ?Target.
?language <http://www.w3.org/2000/01/rdf-schema#label> ?Label.
@cgueret
cgueret / instapaper2chrome.py
Created August 4, 2012 19:34 — forked from jasjukaitis/instapaper2chrome.py
Converts an Instapaper CSV export file to a Google Chrome bookmark import file.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# (c) 2011 Raphael Jasjukaitis <webmaster@raphaa.de>
import csv
import os
import sys
from optparse import OptionParser
@cgueret
cgueret / journal_record.html
Created November 2, 2011 10:30
Example of a Journal entry in the triple store
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Raptor Graph Serialisation</title>
</head>
<body>
<table id="triples" border="1">
<tr>
@cgueret
cgueret / fetch_and_run_perfscript.sh
Created November 2, 2011 10:03
Running the performances measuring script
wget https://github.com/downloads/cgueret/SemanticXO/performances.tar.gz
tar xzf performances.tar.gz
cd performances
python performances_test.py > /dev/null
@cgueret
cgueret / gist:844021
Created February 25, 2011 16:18
Redstore test put (Python2)
from rdflib import ConjunctiveGraph, RDF, URIRef
import httplib
if __name__ == '__main__':
graph = ConjunctiveGraph()
graph.add((URIRef("http://google.com"), RDF.type, URIRef("http://google.com")))
headers = { 'Accept' : '*/*', 'Content-Type': 'application/rdf+xml' }
conn = httplib.HTTPConnection("127.0.0.1:8080")
conn.request("PUT", "/data/http://google.com", body=graph.serialize(), headers=headers)
#response = conn.getresponse()