586
edits
Line 2,812: | Line 2,812: | ||
<sparql tryit="1"> | <sparql tryit="1"> | ||
# a union query to fetch stuff for multiple properties, in this case dates recorded in EDTF which need slightly different handling from PIT dates | # a union query to fetch stuff for multiple properties, in this case dates recorded in EDTF which need slightly different handling from PIT dates | ||
# | # main dates only; pretty sure there are no EDTF in qualifiers. | ||
# updated to get date property labels | |||
PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/> | PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/> | ||
Line 2,822: | Line 2,823: | ||
PREFIX bnpq: <https://beyond-notability.wikibase.cloud/prop/qualifier/> | PREFIX bnpq: <https://beyond-notability.wikibase.cloud/prop/qualifier/> | ||
SELECT ?person ?personLabel ?date_edtf ? | SELECT ?person ?personLabel ?date_edtf ?date_prop ?date_label ?s | ||
WHERE { ?person bnwdt:P3 bnwd:Q3 . | WHERE { ?person bnwdt:P3 bnwd:Q3 . | ||
FILTER NOT EXISTS { ?person bnwdt:P4 bnwd:Q12 . } | FILTER NOT EXISTS { ?person bnwdt:P4 bnwd:Q12 . } | ||
## can do this union first but makes no difference to results except possibly a bit slower. | |||
#?person ( bnp:P131 | bnp:P132 | bnp:P133 ) ?s . | |||
# ?s ( bnps:P131 | bnps:P132 | bnps:P133 ) ?date_edtf . | |||
?person ?p ?s . # so you can get the statement id and date prop label | |||
?claim wikibase:claim ?p; | |||
rdfs:label ?date_label. filter(lang(?date_label)="en") . | |||
?s ?date_prop ?date_edtf . | |||
## filter for edtf dates | ## filter for edtf dates | ||
## docs: https://github.com/ProfessionalWiki/WikibaseEdtf | ## docs: https://github.com/ProfessionalWiki/WikibaseEdtf |
edits