Skip to content

Instantly share code, notes, and snippets.

View egonw's full-sized avatar
💭
I want peace and climate action

Egon Willighagen egonw

💭
I want peace and climate action
View GitHub Profile
all: sql2rdf.jar
curl -s "http://ebi.edu.au/ftp/databases/chembl/ChEMBLdb/releases/chembl_20/chembl_20_mysql.tar.gz" |\
tar xOvzf - chembl_20_mysql/chembl_20.mysqldump.sql |\
java -cp sql2rdf.jar SQLToRDF
sql2rdf.jar : SQL2RDF.jj
javacc SQL2RDF.jj ## tested with javacc 5.0
javac SQLToRDF.java
jar cvf $@ *.class
select distinct ?Concept1 ?p ?Concept2 where {
?res1 a ?Concept1 .
?res2 a ?Concept2 .
?res1 ?p ?res2 .
FILTER(?Concept1 != ?Concept2)
}
@lindenb
lindenb / fact.html
Created August 1, 2011 20:31
freebase + bioportal
<html>
<head>
<link type="text/css" rel="stylesheet" href="http://freebaselibs.com/static/suggest/1.3/suggest.min.css" />
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="text/javascript" src="http://freebaselibs.com/static/suggest/1.3/suggest.min.js"></script>
<script type="text/javascript" src="http://bioportal.bioontology.org/javascripts/widgets/form_complete.js"></script>
<script type="text/javascript">
var freebase_topics= {
type:[ '/biology/protein','/biology/gene','/medicine/disease']
};
@egonw
egonw / authors.sh
Last active September 26, 2015 18:18
Git commands I use to get the data for my "CDK 1.x.y" blog posts
git shortlog -s -n $v1..$v2
@egonw
egonw / papers.txt
Last active October 6, 2015 22:48
DOIs of my scientific output
10.1186/1758-2946-5-23
10.1186/1758-2946-5-14
10.1093/bioinformatics/bts681
10.2174/156802612804910287
10.2174/156802612804910278
10.1007/978-1-62703-050-2_10
10.1002/minf.201200114
10.1145/2366316.2366334
10.1016/j.drudis.2012.05.016
10.1186/1751-0473-7-2
@jebyrnes
jebyrnes / ma_senate_2012.R
Created November 6, 2012 20:41
MA Senate Projection
#load the excellent methods to query polls
#linked to at http://alandgraf.blogspot.com/2012/11/quick-post-about-getting-and-plotting.html
source("https://raw.github.com/dlinzer/pollstR/master/pollsterAPI.R")
#get the MA Senate Race
datMass <- pollstR(chart="2012-massachusetts-senate-brown-vs-warren",pages="all")
#reshape the data for plotting
library(reshape2)
dm <- melt.data.frame(datMass, id.vars=c("start.date", "N"), measure.vars=c("Warren", "Brown"))
@andrawaag
andrawaag / gpml
Created September 26, 2013 12:24
gpml language definition LaTeX listings package
% Language Definition for GPML
\usepackage{color}
\definecolor{gray}{rgb}{0.4,0.4,0.4}
\definecolor{darkblue}{rgb}{0.0,0.0,0.6}
\definecolor{cyan}{rgb}{0.0,0.6,0.6}
\lstset{
basicstyle=\ttfamily,
columns=fullflexible,
showstringspaces=false,
SELECT ?entity ?desc ?author ?wd_author WHERE {
?entity wdt:P31 wd:Q13442814. #filter by scientific articles
?entity wdt:P2093 ?wd_author.
FILTER(regex(?wd_author, "B.*Feringa"))
?entity rdfs:label ?desc.
FILTER((LANG(?desc)) = "en").
}
@egonw
egonw / 2009
Last active February 13, 2017 11:01
JChemInf DOIs
10.1186/1758-2946-1-1
10.1186/1758-2946-1-2
10.1186/1758-2946-1-3
10.1186/1758-2946-1-4
10.1186/1758-2946-1-5
10.1186/1758-2946-1-6
10.1186/1758-2946-1-7
10.1186/1758-2946-1-8
10.1186/1758-2946-1-9
10.1186/1758-2946-1-10
#!/usr/bin/env python
from sys import stdin, stdout
import csv
rdr = csv.reader(stdin, delimiter='\t')
wrt = csv.writer(stdout, delimiter='\t')
vals = []
rows = []
for row in rdr: