Skip to content

Instantly share code, notes, and snippets.

View RubenVerborgh's full-sized avatar

Ruben Verborgh RubenVerborgh

View GitHub Profile
# curl -H "Accept: text/turtle" http://dbpedia.org/sparql
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix ns1: <http://dbpedia.org/> .
@prefix sd: <http://www.w3.org/ns/sparql-service-description#> .
ns1:sparql rdf:type sd:Service ;
sd:endpoint ns1:sparql ;
sd:feature sd:DereferencesURIs ,
sd:UnionDefaultGraph .
@prefix ns3: <http://www.w3.org/ns/formats/> .
ns1:sparql sd:resultFormat ns3:RDFa ,
PREFIX e: <http://eulersharp.sourceforge.net/2003/03swap/log-rules#>
PREFIX ex: <https://example.org/tmp#>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX list: <http://www.w3.org/2000/10/swap/list#>
PREFIX schema: <http://schema.org/>
# Profile document
<https://ruben.verborgh.org/profile/#me>
a foaf:Person;
foaf:nick "RV";
@RubenVerborgh
RubenVerborgh / prefixes.yml
Created June 1, 2022 20:08
Espanso config for RDF devs
matches:
- trigger: ":rdf "
replace: http://www.w3.org/1999/02/22-rdf-syntax-ns#
- trigger: ":rdfs"
replace: http://www.w3.org/2000/01/rdf-schema#
- trigger: ":owl"
replace: http://www.w3.org/2002/07/owl#
- trigger: ":xsd"
replace: http://www.w3.org/2001/XMLSchema#
@RubenVerborgh
RubenVerborgh / ttl-to-jsonld.js
Created October 21, 2016 07:08
Turtle to JSON-LD
const N3 = require('n3'),
fs = require('fs');
const stream = fs.createReadStream('file.ttl');
var first = true;
console.log('{');
const triples = new N3.Parser().parse(stream, (error, triple) => {
if (triple) {
if (first)
@RubenVerborgh
RubenVerborgh / gist:9372495
Created March 5, 2014 17:47
Requesting a representation through HTTP with GZIP compression
var request = require('request'),
zlib = require('zlib');
var headers = { 'Accept-Encoding': 'gzip' };
var response = request({ url:'http://perdu.com/', headers: headers });
response.on('response', function (response) {
// decode the stream if necessary
if (response.headers['content-encoding'] === 'gzip')
response = response.pipe(zlib.createGunzip());
@RubenVerborgh
RubenVerborgh / reply.txt
Created March 18, 2019 13:55
Reply to no-open review invitation
Dear editor,
Thanks for inviting me as a reviewer.
While the topic is relevant to my expertise,
I only review for journals with an open review process.
As such, I have to decline your invitation.
I believe that, as scientists working for the public,
we should make the output of our scientific processes
publicly and immediately accessible.
@RubenVerborgh
RubenVerborgh / reply.txt
Created February 15, 2019 18:01
Facebook scamming their way out of a GDPR Subject Access Request
Hi Ruben,
We refer to your request in accordance with Article 15 of the Data Protection Regulation 2016/679 ("GDPR") which we received on 1/14/2019.
1. How can I access my personal data on Facebook?
As a Facebook user, you can access your Facebook user information, including photos, posts, reactions and comments, using the Access Your Information tool which allows you to view your account data at any time and in a single place. We've categorised this information by type so you can find what you're looking for.
The Access Your Information tool is available in the “Your Facebook Information” section of the settings.
To view Your Facebook Information from a computer:
$ curl -s -H "Accept: text/html" https://www.w3.org/ns/activitystreams | grep "://www.w3.org/ns/activitystreams"
<!DOCTYPE html><html dir="ltr" typeof="bibo:Document " prefix="bibo: http://purl.org/ontology/bibo/ w3p: http://www.w3.org/2001/02pd/rec54# as: http://www.w3.org/ns/activitystreams#" lang="en"><head><meta charset="utf-8"><meta name="generator" content="ReSpec 20.7.1"><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"><meta property="dc:language" content="en" lang="">
<body prefix="as: http://www.w3.org/ns/activitystreams#" about="" typeof="as:Article" property="as:content" datatype="rdf:HTML" class="h-entry"><div class="head">
<dd><code>http://www.w3.org/ns/activitystreams#</code></dd>
$ curl -s -H "Accept: application/json" https://www.w3.org/ns/activitystreams | grep "://www.w3.org/ns/activitystreams"
"as": "https://www.w3.org/ns/activitystreams#",
<!doctype html>
<head>
<meta charset="UTF-8">
<link rel="stylesheet" href="data:text/css;base64,LyogVmVuZG9yZWQgZnJvbSBodHRwczovL2dpdGh1Yi5jb20vcm1taC93ZWJ0cmVlbWFwL2Jsb2IvOWZhMGMwNjZhMTBlYTQ0MDJkOTYwYjBjNmMxYTQzMjg0NmFjN2ZjNC93ZWJ0cmVlbWFwLmNzcyAqLwoKLndlYnRyZWVtYXAtbm9kZSB7CiAgLyogUmVxdWlyZWQgYXR0cmlidXRlcy4gKi8KICBwb3NpdGlvbjogYWJzb2x1dGU7CiAgb3ZlcmZsb3c6IGhpZGRlbjsgICAvKiBUbyBoaWRlIG92ZXJsb25nIGNhcHRpb25zLiAqLwogIGJhY2tncm91bmQ6IHdoaXRlOyAgLyogTm9kZXMgbXVzdCBiZSBvcGFxdWUgZm9yIHpJbmRleCBsYXllcmluZy4gKi8KICBib3JkZXI6IHNvbGlkIDFweCBibGFjazsgIC8qIENhbGN1bGF0aW9ucyBhc3N1bWUgMXB4IGJvcmRlci4gKi8KCiAgLyogT3B0aW9uYWw6IENTUyBhbmltYXRpb24uICovCiAgdHJhbnNpdGlvbjogdG9wICAgIDAuM3MsCiAgICAgICAgICAgICAgbGVmdCAgIDAuM3MsCiAgICAgICAgICAgICAgd2lkdGggIDAuM3MsCiAgICAgICAgICAgICAgaGVpZ2h0IDAuM3M7Cn0KCi8qIE9wdGlvbmFsOiBoaWdobGlnaHQgbm9kZXMgb24gbW91c2VvdmVyLiAqLwoud2VidHJlZW1hcC1ub2RlOmhvdmVyIHsKICBiYWNrZ3JvdW5kOiAjZWVlOwp9CgovKiBPcHRpb25hbDogRGlmZmVyZW50IGJhY2tncm91bmQgY29sb3JzIGRlcGVuZGluZyBvbiBzeW1ib2wuICovCi53ZWJ0cmVlbWFwLXN
@RubenVerborgh
RubenVerborgh / proposal.md
Last active May 19, 2017 19:28
Discussion proposal ESWC2017 workshop on Enabling Decentralised Scholarly Communication