query-45546cce716f1b136f747662aeefa49d
TODO
Use at
- https://query.wikidata.org/sparql
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX schema: <http://schema.org/>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX prov: <http://www.w3.org/ns/prov#>
PREFIX pr: <http://www.wikidata.org/prop/reference/>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT
?item ?itemLabel ?synOf ?synOfLabel ?syn_sl ?refHasRole ?refHasRoleLabel ?Pages
(IRI(CONCAT("https://biodiversitylibrary.org/page/",?BHLpageID)) as ?BHL_URL)
(IRI(CONCAT("http://treatment.plazi.org/id/",?PlaziID)) as ?PlaziID_URL)
WHERE {
?reference pr:P248 ?publication. FILTER (?publication IN (wd:Q56025286))
?reference ^prov:wasDerivedFrom ?st .
?st ^p:P225 ?item .
OPTIONAL {
?item p:P2868 ?syn_st .
?syn_st a wikibase:BestRank .
?syn_st ps:P2868 wd:Q1040689 .
?syn_st pq:P642 ?synOf .
OPTIONAL {
?syn_sl schema:about ?synOf .
?syn_sl schema:isPartOf <https://species.wikimedia.org/> .
}
}
OPTIONAL { ?reference pr:P6184 ?refHasRole . }
OPTIONAL { ?reference pr:P304 ?Pages . }
OPTIONAL { ?reference pr:P1992 ?PlaziID . }
OPTIONAL { ?reference pr:P687 ?BHLpageID . }
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v12("?BHL_URL")
v11("?BHLpageID"):::projected
v9("?Pages"):::projected
v10("?PlaziID"):::projected
v13("?PlaziID_URL")
v4("?item"):::projected
v1("?publication")
v8("?refHasRole"):::projected
v2("?reference")
v3("?st")
v6("?synOf"):::projected
v7("?syn_sl"):::projected
v5("?syn_st")
c7(["wikibase:BestRank"]):::iri
c13([https://species.wikimedia.org/]):::iri
c9(["wd:Q1040689"]):::iri
c19(["bd:serviceParam"]):::iri
c21(["#91;AUTO_LANGUAGE#93;,en"]):::literal
f0[["?publication = 'wd:Q56025286'"]]
f0 --> v1
v2 --"p:reference/P248"--> v1
v3 --"prov:wasDerivedFrom"--> v2
v4 --"p:P225"--> v3
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v4 -."p:P2868".-> v5
v5 --"a"--> c7
v5 --"p:statement/P2868"--> c9
v5 --"p:qualifier/P642"--> v6
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v7 -."schema:about".-> v6
v7 --"schema:isPartOf"--> c13
end
end
subgraph optional2["(optional)"]
style optional2 fill:#bbf,stroke-dasharray: 5 5;
v2 -."p:reference/P6184".-> v8
end
subgraph optional3["(optional)"]
style optional3 fill:#bbf,stroke-dasharray: 5 5;
v2 -."p:reference/P304".-> v9
end
subgraph optional4["(optional)"]
style optional4 fill:#bbf,stroke-dasharray: 5 5;
v2 -."p:reference/P1992".-> v10
end
subgraph optional5["(optional)"]
style optional5 fill:#bbf,stroke-dasharray: 5 5;
v2 -."p:reference/P687".-> v11
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c19 --"wikibase:language"--> c21
end
bind1[/"concat('https://biodiversitylibrary.org/page/',?BHLpageID)"/]
v11 --o bind1
bind1 --as--o v12
bind2[/"concat('http://treatment.plazi.org/id/',?PlaziID)"/]
v10 --o bind2
bind2 --as--o v13