Skip to content

Instantly share code, notes, and snippets.

<VirtualHost *:80>
ServerName rdf.wikipathways.org
RewriteEngine on
RewriteRule ^(.*)$ http://sparql.wikipathways.org/?default-graph-uri=&query=DESCRIBE+<http\:\/\/%{HTTP_HOST}$1> [P]
ProxyPassReverse / http://sparql.wikipathwys.org/
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
@andrawaag
andrawaag / gist:4642824
Created January 26, 2013 15:03
SPARQL query to find streaming media providers through dbpedia
SELECT DISTINCT * WHERE {
?resource <http://dbpedia.org/ontology/type> <http://dbpedia.org/resource/Streaming_media> .
?resource <http://xmlns.com/foaf/0.1/isPrimaryTopicOf> ?wikipediaPage .
?resource <http://dbpedia.org/property/url> ?website .
}
@andrawaag
andrawaag / GPML representation of a Directed Interaction
Created February 4, 2013 17:13
GPML file of a directed Interaction in WikiPathways
<?xml version="1.0" encoding="UTF-8"?>
<Pathway xmlns="http://genmapp.org/GPML/2010a" Name="untitled" Data-Source="COPIED">
<Graphics BoardWidth="582.0" BoardHeight="369.0" />
<DataNode TextLabel="GeneProduct" GraphId="eee89" Type="GeneProduct">
<Graphics CenterX="512.0" CenterY="329.0" Width="80.0" Height="20.0" ZOrder="32768" FontSize="10" Valign="Middle" />
<Xref Database="" ID="" />
</DataNode>
<DataNode TextLabel="GeneProduct" GraphId="da3fe" Type="GeneProduct">
<Graphics CenterX="352.0" CenterY="329.0" Width="80.0" Height="20.0" ZOrder="32768" FontSize="10" Valign="Middle" />
<Xref Database="" ID="" />
@andrawaag
andrawaag / GPMLsniplet
Created February 5, 2013 16:57
GPML sniplet from WP TCA cycle pathway
<?xml version="1.0" encoding="UTF-8"?>
<Pathway xmlns="http://genmapp.org/GPML/2010a" Name="untitled" Data-Source="COPIED">
<Graphics BoardWidth="177.2833366394043" BoardHeight="500.1666564941406" />
<DataNode TextLabel="MDH1" GraphId="bceb9" Type="GeneProduct">
<Attribute Key="org.pathvisio.model.BackpageHead" Value="MDH1" />
<Graphics CenterX="113.46667098999023" CenterY="415.6666564941406" Width="67.63333129882812" Height="20.0" ZOrder="32768" FontSize="10" Valign="Middle" />
<Xref Database="Entrez Gene" ID="459271" />
</DataNode>
<DataNode TextLabel="Malate" GraphId="b6f7a" Type="Metabolite">
<Attribute Key="org.pathvisio.model.BackpageHead" Value="Malate" />
@andrawaag
andrawaag / gist:4716000
Last active December 12, 2015 04:39
RDF with the WP vocabulary included
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix ns1: <http://rdf.wikipathways.org/Pathway/WP881_r41576/DataNode/> .
@prefix wp: <http://vocabularies.wikipathways.org/wp#> .
@prefix dc: <http://purl.org/dc/elements/1.1/> .
@prefix dcterms: <http://purl.org/dc/terms/> .
@prefix wprdf: <http://rdf.wikipathways.org/Pathway/> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
<http://rdf.wikipathways.org/Pathway/WP881_r41576/DataNode/bceb9> rdf:type wp:GeneProduct;
dc:identifier <http://identifiers.org/ncbigene/459271> .
@andrawaag
andrawaag / gist:4716028
Created February 5, 2013 17:22
RDF with only GPML vocabulary
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix ns1: <http://rdf.wikipathways.org/Pathway/WP881_r41576/DataNode/> .
@prefix wp: <http://vocabularies.wikipathways.org/wp#> .
@prefix dc: <http://purl.org/dc/elements/1.1/> .
@prefix dcterms: <http://purl.org/dc/terms/> .
@prefix wprdf: <http://rdf.wikipathways.org/Pathway/> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
<http://rdf.wikipathways.org/Pathway/WP881_r41576/DataNode/bceb9> dc:identifier <http://identifiers.org/ncbigene/459271> ;
dcterms:isPartOf wprdf:WP881_r41576 ;
@andrawaag
andrawaag / downloadOPSWpPw.sh
Created March 14, 2013 14:05
Shell script for the RDF serializer for the WikiPathways Pathways with the Analysis tag
rm -rf /tmp/GPML
mkdir /tmp/GPML
rm -rf /tmp/OPSWPRDF
mkdir /tmp/OPSWPRDF
rm -rf /tmp/OPSWIKIDUMP
mkdir /tmp/OPSWIKIDUMP
wget -O /tmp/OPSWIKIDUMP/Anopheles%20gambiae.zip "http://www.wikipathways.org//wpi/batchDownload.php?species=Anopheles%20gambiae&fileType=gpml&tag=Curation:AnalysisCollection"
wget -O /tmp/OPSWIKIDUMP/Arabidopsis%20thaliana.zip "http://www.wikipathways.org//wpi/batchDownload.php?species=Arabidopsis%20thaliana&fileType=gpml&tag=Curation:AnalysisCollection"
wget -O /tmp/OPSWIKIDUMP/Bos%20taurus.zip "http://www.wikipathways.org//wpi/batchDownload.php?species=Bos%20taurus&fileType=gpml&tag=Curation:AnalysisCollection"
wget -O /tmp/OPSWIKIDUMP/Bacillus%20subtilis.zip "http://www.wikipathways.org//wpi/batchDownload.php?species=Bacillus%20subtilis&fileType=gpml&tag=Curation:AnalysisCollection"
CONSTRUCT {?concept a skos:Concept .
?concept skos:prefLabel ?label .
?concept skos:notation ?identifier .
}
WHERE {
?concept a skos:Concept .
OPTIONAL { ?resource2 a gpml:requiresCurationAttention . FILTER(?resource2 = ?concept) }
FILTER(!bound(?resource2))
?concept rdfs:label ?label .
?concept dc:identifier ?identifier.
construct {?identifier skos:relatedMatch ?relatedId .
}
where {
?uniprotconcept dc:identifier ?identifier .
?uniprotconcept wp:bdbEnsembl ?relatedId .
}
CONSTRUCT {?concept a skos:Concept .
?concept skos:prefLabel ?label .
?concept skos:notation ?identifier .
}
WHERE {
?concept a skos:Concept .
OPTIONAL { ?resource2 a gpml:requiresCurationAttention . FILTER(?resource2 = ?concept) }
FILTER(!bound(?resource2))
?concept rdfs:label ?label .
?concept dc:identifier ?identifier.