query-8e305d9b26bcd032219387d307aa2c2b
TODO
Use at
- https://query.wikidata.org/sparql
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX schema: <http://schema.org/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
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 ?pt_given ?series2 ?pt_family ?series ?dob ?dod
WHERE
{
?article schema:about ?item ;
schema:isPartOf <https://pt.wikisource.org/> .
OPTIONAL {?item p:P734 ?stat .
?stat ps:P734 ?familyname .
OPTIONAL {?stat pq:P1545 ?series . }
?familyname rdfs:label ?pt_family .
filter(lang(?pt_family)="pt") }
OPTIONAL {?item p:P735 ?stat2 .
?stat2 ps:P735 ?givenname .
OPTIONAL {?stat2 pq:P1545 ?series2 .}
?givenname rdfs:label ?pt_given .
filter(lang(?pt_given)="pt") }
filter(strstarts(?pt_family,"M"))
OPTIONAL {?item wdt:P569 ?dob_ . bind(year(?dob_) as ?dob) }
OPTIONAL {?item wdt:P570 ?dod_ . bind(year(?dod_) as ?dod) }
?item wdt:P31 wd:Q5 .
SERVICE wikibase:label { bd:serviceParam wikibase:language "pt,en". }
} order by ?pt_family ?pt_given
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v3("?article")
v12("?dob"):::projected
v11("?dob_")
v14("?dod"):::projected
v13("?dod_")
v6("?familyname")
v9("?givenname")
v4("?item"):::projected
v1("?pt_family"):::projected
v2("?pt_given"):::projected
v7("?series"):::projected
v10("?series2"):::projected
v5("?stat")
v8("?stat2")
c19(["pt,en"]):::literal
c17(["bd:serviceParam"]):::iri
c5([https://pt.wikisource.org/]):::iri
c15(["wd:Q5"]):::iri
f0[["starts-with(?pt_family,'M')"]]
f0 --> v1
v3 --"schema:about"--> v4
v3 --"schema:isPartOf"--> c5
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v4 -."p:P734".-> v5
v5 --"p:statement/P734"--> v6
v6 --"rdfs:label"--> v1
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v5 -."p:qualifier/P1545".-> v7
end
end
subgraph optional2["(optional)"]
style optional2 fill:#bbf,stroke-dasharray: 5 5;
v4 -."p:P735".-> v8
v8 --"p:statement/P735"--> v9
v9 --"rdfs:label"--> v2
subgraph optional3["(optional)"]
style optional3 fill:#bbf,stroke-dasharray: 5 5;
v8 -."p:qualifier/P1545".-> v10
end
end
subgraph optional4["(optional)"]
style optional4 fill:#bbf,stroke-dasharray: 5 5;
v4 -."p:direct/P569".-> v11
bind1[/"year-from-dateTime(?dob_)"/]
v11 --o bind1
bind1 --as--o v12
end
subgraph optional5["(optional)"]
style optional5 fill:#bbf,stroke-dasharray: 5 5;
v4 -."p:direct/P570".-> v13
bind2[/"year-from-dateTime(?dod_)"/]
v13 --o bind2
bind2 --as--o v14
end
v4 --"p:direct/P31"--> c15
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c17 --"wikibase:language"--> c19
end