A set of SPARQL examples that are used in different SIB resources
Use ALLIE a service for Abbreviation / Long Form in Japanese and English to search in UniProt using Japanese.
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX up: <http://purl.uniprot.org/core/>
SELECT ?protein ?englishLabelStr
WHERE {
SERVICE <https://data.allie.dbcls.jp/sparql>{
?x rdfs:label "アミロイド前駆体タンパク質"@ja ;
rdfs:label ?englishLabel .
FILTER(lang(?englishLabel) = "en")
}
BIND (STR(?englishLabel) AS ?englishLabelStr)
?protein a up:Protein .
{
?protein (up:recommendedName|up:alternativeName) ?structuredName .
}
UNION
{
VALUES(?partType){(up:domain) (up:component)}
?protein ?partType ?part .
?part (up:recommendedName|up:alternativeName) ?structuredName .
}
?structuredName ?anyKindOfName ?englishLabelStr .
?anyKindOfName rdfs:subPropertyOf up:structuredNameType .
}
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v8("?anyKindOfName")
v1("?englishLabel")
v3("?englishLabelStr"):::projected
v7("?part")
v6("?partType")
v4("?protein"):::projected
v5("?structuredName")
v2("?x")
c10(["up:structuredNameType"]):::iri
c4([sアミロイド前駆体タンパク質^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#langString>"]):::literal
c6(["up:Protein"]):::iri
subgraph s1["https://data.allie.dbcls.jp/sparql"]
style s1 stroke-width:4px;
f0[["?englishLabel = 'en'"]]
f0 --> v1
v2 --"rdfs:label"--> c4
v2 --"rdfs:label"--> v1
end
bind1[/"str(?englishLabel)"/]
v1 --o bind1
bind1 --as--o v3
v4 --"a"--> c6
subgraph union0[" Union "]
subgraph union0l[" "]
style union0l fill:#abf,stroke-dasharray: 3 3;
bind2[/VALUES ?partType/]
bind2-->v6
bind20(["up:domain"])
bind20 --> bind2
bind21(["up:component"])
bind21 --> bind2
v4 -->v6--> v7
subgraph union1[" Union "]
subgraph union1l[" "]
style union1l fill:#abf,stroke-dasharray: 3 3;
v7 --"up:alternativeName"--> v5
end
subgraph union1r[" "]
style union1r fill:#abf,stroke-dasharray: 3 3;
v7 --"up:recommendedName"--> v5
end
union1r <== or ==> union1l
end
end
subgraph union0r[" "]
style union0r fill:#abf,stroke-dasharray: 3 3;
subgraph union2[" Union "]
subgraph union2l[" "]
style union2l fill:#abf,stroke-dasharray: 3 3;
v4 --"up:alternativeName"--> v5
end
subgraph union2r[" "]
style union2r fill:#abf,stroke-dasharray: 3 3;
v4 --"up:recommendedName"--> v5
end
union2r <== or ==> union2l
end
end
union0r <== or ==> union0l
end
v5 -->v8--> v3
v8 --"rdfs:subPropertyOf"--> c10