A set of SPARQL examples that are used in LOTUS
NPs triples labels.
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX wd: <http://www.wikidata.org/entity/>
SELECT ?compoundLabel ?taxonLabel ?referenceLabel WHERE {
VALUES ?compound_qid {wd:Q2079986}
VALUES ?taxon_qid {wd:Q135389}
VALUES ?reference_qid {wd:Q104388277}
OPTIONAL { ?compound_qid rdfs:label ?compoundLabel . FILTER(LANG(?compoundLabel) = "en") }
OPTIONAL { ?taxon_qid rdfs:label ?taxonLabel . FILTER(LANG(?taxonLabel) = "en") }
SERVICE <https://query-scholarly.wikidata.org/sparql> {
OPTIONAL { ?reference_qid rdfs:label ?referenceLabel . FILTER(LANG(?referenceLabel) = "en") }
}
}
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v2("?compoundLabel"):::projected
v3("?compound_qid")
v6("?referenceLabel"):::projected
v5("?reference_qid")
v1("?taxonLabel"):::projected
v4("?taxon_qid")
bind0[/VALUES ?compound_qid/]
bind0-->v3
bind00(["wd:Q2079986"])
bind00 --> bind0
bind1[/VALUES ?taxon_qid/]
bind1-->v4
bind10(["wd:Q135389"])
bind10 --> bind1
bind2[/VALUES ?reference_qid/]
bind2-->v5
bind20(["wd:Q104388277"])
bind20 --> bind2
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v3 -."rdfs:label".-> v2
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v4 -."rdfs:label".-> v1
end
subgraph s1["https://query-scholarly.wikidata.org/sparql"]
style s1 stroke-width:4px;
subgraph optional2["(optional)"]
style optional2 fill:#bbf,stroke-dasharray: 5 5;
v5 -."rdfs:label".-> v6
end
end