3,427
edits
Line 2,708: | Line 2,708: | ||
<sparql tryit="1"> | <sparql tryit="1"> | ||
#title:fishing for dates for FSAs | #title:fishing for dates for FSAs | ||
# union query to get [hopefully] every date associated with women FSAs including main dates and qualifier dates | # union query to get [hopefully] every date associated with women FSAs including main dates and qualifier dates | ||
PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/> | PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/> | ||
Line 2,721: | Line 2,720: | ||
PREFIX bnpqv: <https://beyond-notability.wikibase.cloud/prop/qualifier/value/> | PREFIX bnpqv: <https://beyond-notability.wikibase.cloud/prop/qualifier/value/> | ||
SELECT distinct ?person ?personLabel ?prop_label ?qualLabel ?qual_dateLabel ?date_value ?s | |||
SELECT distinct ?person ?personLabel ?prop_label ? | #?prop ?qual | ||
#?prop ? | |||
WHERE { | WHERE { | ||
?person bnwdt:P3 bnwd:Q3 . #select women | ?person bnwdt:P3 bnwd:Q3 . #select women | ||
?person bnwdt:P75 bnwd:Q8. # find only BN subjects having a FSA | ?person bnwdt:P75 bnwd:Q8. # find only BN subjects having a FSA | ||
Line 2,736: | Line 2,731: | ||
?person ?p ?s . | ?person ?p ?s . | ||
# get stuff about ?p . | |||
?prop wikibase:claim ?p; | ?prop wikibase:claim ?p; | ||
wikibase:statementProperty ?ps ; | wikibase:statementProperty ?ps ; | ||
Line 2,742: | Line 2,737: | ||
?prop wikibase:propertyType ?date_prop_type . | ?prop wikibase:propertyType ?date_prop_type . | ||
?prop rdfs:label ?prop_label. filter(lang(?prop_label)="en-gb") . | ?prop rdfs:label ?prop_label. filter(lang(?prop_label)="en-gb") . | ||
{ # main dates | |||
# get dates detail via ?s and psv | # get dates detail via ?s and psv | ||
# gets edtf dates in simplified std wiki date format | # gets edtf dates in simplified std wiki date format? | ||
# https://github.com/ProfessionalWiki/WikibaseEdtf | # https://github.com/ProfessionalWiki/WikibaseEdtf | ||
?s ?psv ?wdv . | ?s ?psv ?wdv . | ||
?wdv wikibase:timeValue ?date_value | ?wdv wikibase:timeValue ?date_value . | ||
} # /main dates | } # /main dates | ||
Line 2,755: | Line 2,752: | ||
{ # qualifier dates | { # qualifier dates | ||
# direct value (usually item) for the property | # direct value (usually item) for the property | ||
?s ?ps ? | ?s ?ps ?qual. | ||
# | # date qualifiers. [assumes no edtf in quals. ] | ||
?s ?pq ?date_value . | ?s ?pq ?date_value . | ||
?qual_date wikibase:qualifier ?pq . | ?qual_date wikibase:qualifier ?pq . | ||
?qual_date wikibase:propertyType wikibase:Time. | ?qual_date wikibase:propertyType wikibase:Time. | ||
?qual_date rdfs:label ?date_qual_label . filter(lang(?date_qual_label)="en") . | ?qual_date rdfs:label ?date_qual_label . filter(lang(?date_qual_label)="en") . | ||
} # /qual dates | } # /qual dates | ||
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en-gb". } | SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en,en-gb". } | ||
} # /where | } # /where | ||
ORDER BY ?person ?date_value | ORDER BY ?person ?prop_label ?date_value | ||
</sparql> | </sparql> |
edits