Skip to content

Instantly share code, notes, and snippets.

andrawaag

Block or report user

Report or block andrawaag

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View Species_kept.sparql
SELECT ?taxon ?taxonLabel ?de ?en ?fr ?nl WHERE {
bind(if(bound(?english), "+", "-") as ?en )
bind(if(bound(?french), "+", "-") as ?fr )
bind(if(bound(?dutch), "+", "-") as ?nl )
bind(if(bound(?german), "+", "-") as ?de )
{SELECT ?taxon ?taxonLabel ?english ?french ?dutch ?german WHERE {
wd:Q3052500 wdt:P1990 ?taxon .
OPTIONAL {?english schema:about ?taxon .
FILTER (regex(str(?english), "https://en.wikipedia"))}
OPTIONAL {?dutch schema:about ?taxon .
View invasivespecies.sparql
SELECT ?taxon ?taxonLabel ?de ?en ?fr ?nl WHERE {
bind(if(bound(?english), "+", "-") as ?en )
bind(if(bound(?french), "+", "-") as ?fr )
bind(if(bound(?dutch), "+", "-") as ?nl )
bind(if(bound(?german), "+", "-") as ?de )
{SELECT ?taxon ?taxonLabel ?english ?french ?dutch ?german WHERE {
?taxon wdt:P5588 wd:Q458 .
OPTIONAL {?english schema:about ?taxon .
FILTER (regex(str(?english), "https://en.wikipedia"))}
OPTIONAL {?dutch schema:about ?taxon .
View gist:0cc9e74b0ef9da5b72f1ef461157cbc1
from wikidataintegrator import wdi_core, wdi_login, wdi_helpers
pmid = "22329630"
doi = "10.1016/j.anifeedsci.2007.03.013"
login = wdi_login.WDLogin(<username>, <passwd>)
write = True
print(wdi_helpers.PublicationHelper(doi, id_type="doi", source="crossref").get_or_create(login if write else None))
View gist:04a3c17dcf0dd8e37561e6f1c10a1474
{% extends "base.html" %}
{% block scripts %}
{{super()}}
<script type="text/javascript">
speciesSparql = `
`
View test.graphml
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<graphml xmlns="http://graphml.graphdrawing.org/xmlns" xmlns:java="http://www.yworks.com/xml/yfiles-common/1.0/java" xmlns:sys="http://www.yworks.com/xml/yfiles-common/markup/primitives/2.0" xmlns:x="http://www.yworks.com/xml/yfiles-common/markup/2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:y="http://www.yworks.com/xml/graphml" xmlns:yed="http://www.yworks.com/xml/yed/3" xsi:schemaLocation="http://graphml.graphdrawing.org/xmlns http://www.yworks.com/xml/schema/graphml/1.1/ygraphml.xsd">
<!--Created by yEd 3.17-->
<key attr.name="Description" attr.type="string" for="graph" id="d0"/>
<key for="port" id="d1" yfiles.type="portgraphics"/>
<key for="port" id="d2" yfiles.type="portgeometry"/>
<key for="port" id="d3" yfiles.type="portuserdata"/>
<key attr.name="url" attr.type="string" for="node" id="d4"/>
<key attr.name="description" attr.type="string" for="node" id="d5"/>
<key for="node" id="d6" yfiles.type="nodegraphics"/>
View wd_wp_federated_query.sparql
#defaultView:Dimensions
PREFIX wp: <http://vocabularies.wikipathways.org/wp#>
PREFIX dcterms: <http://purl.org/dc/terms/>
PREFIX dc: <http://purl.org/dc/elements/1.1/>
SELECT DISTINCT ?metabolite1Label ?metabolite2Label ?mass1 ?mass2 WITH {
SELECT ?metabolite1 ?metabolite2 WHERE {
?pathwayItem wdt:P2410 "WP706";
wdt:P2888 ?pwIri.
SERVICE <http://sparql.wikipathways.org/> {
?pathway dc:identifier ?pwIri.
View federated_sparql_template.sparql
SELECT * WHERE {
?localitem ?localproperty ?shareditem .
SERVICE <http://example.remote.sparql> {
?shareditem ?remoteproperty ?remoteitem .
}
}
View shex_1.ttl
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
<wikidata-human_gene> {
p:P31 { ps:P31 [wd:Q7187]; }; # must be instance of [P31] gene [wd:Q7187] (only one)
p:P31 { ps:P31 [wd:Q8054]; }{0} ; # NOT instance of protein [wd:Q8054]
p:P279 { ps:P279 [wd:Q7187 wd:Q20747295 ]; }+ ; # subclass of (one or more) gene = wd:Q7187, protein-coding gene = wd:Q20747295
p:P353 { ps:P353 LITERAL ; } ; # HGNC symbol [P353] (only one)
p:P688 { ps:P688 IRI ;}* ; # encodes [P688] (zero or more)
p:P352 { ps:P352 LITERAL;}{0} ; # NOT a uniprot ID
View concise.ttl
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX prov: <http://www.w3.org/ns/prov#>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX prv: <http://www.wikidata.org/prop/reference/value/>
PREFIX pr: <http://www.wikidata.org/prop/reference/>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
<wikidata-human_gene> {
View concise_shex.shex
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX prov: <http://www.w3.org/ns/prov#>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX prv: <http://www.wikidata.org/prop/reference/value/>
PREFIX pr: <http://www.wikidata.org/prop/reference/>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
<wikidata-human_gene> {
You can’t perform that action at this time.