query-2a2208c9aa56c3f58069a9d667e68b1b
Fetch items from Zika Corpus. I formulated the query below with help from participants of the Wikimania Hackathon. Unfortunately, however, it still contains duplicates, most likely stemming from the GROUP_CONCAT statements. In addition, i could not get the main_subjectLabel to show up in the results. Can you help? Zika CorpusI am trying to fetch items from the
Use at
- https://query.wikidata.org/sparql
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT DISTINCT ?item ?_PubMed_ID ?PMCID ?publication_date ?published_in ?DOI ?itemLabel
?published_inLabel (GROUP_CONCAT(DISTINCT ?author_name_string; SEPARATOR = "; ") AS ?authors) (GROUP_CONCAT(DISTINCT ?main_subject; SEPARATOR = "; ") AS ?subject) WHERE {
{
SELECT * WHERE {
?item wdt:P31 wd:Q13442814.
?item rdfs:label ?itemLabel.
FILTER(CONTAINS(LCASE(?itemLabel), "zika"))
FILTER((LANG(?itemLabel)) = "en")
}
LIMIT 1000
}
OPTIONAL { ?item wdt:P698 ?_PubMed_ID. }
OPTIONAL {
?item wdt:P1433 ?published_in.
?published_in rdfs:label ?published_inLabel.
}
OPTIONAL { ?item wdt:P921 ?main_subject. }
OPTIONAL { ?item wdt:P932 ?PMCID. }
OPTIONAL { ?item wdt:P577 ?publication_date. }
OPTIONAL { ?item wdt:P921 ?published_in. }
OPTIONAL { ?item wdt:P2093 ?author_name_string. }
OPTIONAL { ?item wdt:P356 ?DOI }
}
GROUP BY ?item ?itemLabel ?_PubMed_ID ?PMCID ?publication_date ?published_in ?published_inLabel ?DOI
LIMIT 100
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v10("?DOI"):::projected
v7("?PMCID"):::projected
v3("?_PubMed_ID"):::projected
v9("?author_name_string"):::projected
v11("?authors")
v2("?item"):::projected
v1("?itemLabel"):::projected
v6("?main_subject"):::projected
v8("?publication_date"):::projected
v4("?published_in"):::projected
v5("?published_inLabel"):::projected
v12("?subject")
c4(["wd:Q13442814"]):::iri
f0[["?itemLabel = 'en'"]]
f0 --> v1
f1[["contains(lower-case(?itemLabel),'zika')"]]
f1 --> v1
v2 --"wdt:P31"--> c4
v2 --"rdfs:label"--> v1
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v2 -."wdt:P698".-> v3
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v2 -."wdt:P1433".-> v4
v4 --"rdfs:label"--> v5
end
subgraph optional2["(optional)"]
style optional2 fill:#bbf,stroke-dasharray: 5 5;
v2 -."wdt:P921".-> v6
end
subgraph optional3["(optional)"]
style optional3 fill:#bbf,stroke-dasharray: 5 5;
v2 -."wdt:P932".-> v7
end
subgraph optional4["(optional)"]
style optional4 fill:#bbf,stroke-dasharray: 5 5;
v2 -."wdt:P577".-> v8
end
subgraph optional5["(optional)"]
style optional5 fill:#bbf,stroke-dasharray: 5 5;
v2 -."wdt:P921".-> v4
end
subgraph optional6["(optional)"]
style optional6 fill:#bbf,stroke-dasharray: 5 5;
v2 -."wdt:P2093".-> v9
end
subgraph optional7["(optional)"]
style optional7 fill:#bbf,stroke-dasharray: 5 5;
v2 -."wdt:P356".-> v10
end
bind4[/"?author_name_string"/]
v9 --o bind4
bind4 --as--o v11
bind5[/"?main_subject"/]
v6 --o bind5
bind5 --as--o v12