SPARQL examples: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 63: | Line 63: | ||
FILTER(YEAR(?pointInTime2022) = 2022) | FILTER(YEAR(?pointInTime2022) = 2022) | ||
# | # geographical coordinates from the 16th century | ||
?settlement p:P63 ?coordStatement. | ?settlement p:P63 ?coordStatement. | ||
?coordStatement ps:P63 ?coordinate16thCentury; | ?coordStatement ps:P63 ?coordinate16thCentury; | ||
Line 74: | Line 74: | ||
[https://wikihum.lab.dariah.pl/wdqs/#%23title%3ATowns%20that%20were%20towns%20in%20the%2016th%20century%20and%20are%20now%20villages%0A%23defaultView%3AMap%0ASELECT%20%3Fsettlement%20%3FsettlementLabel%20%3Fcoordinate16thCentury%20WHERE%20%7B%0A%20%20%23%20Warunek%20dla%20miejscowo%C5%9Bci%0A%20%20%3Fsettlement%20wdt%3AP27%20wd%3AQ175698.%0A%0A%20%20%23%20It%20was%20a%20town%20in%20the%2016th%20century%0A%20%20%3Fsettlement%20p%3AP62%20%3FcityStatement.%0A%20%20%3FcityStatement%20ps%3AP62%20wd%3AQ622%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20pq%3AP40%20%3FpointInTime16thCentury.%0A%20%20FILTER%28YEAR%28%3FpointInTime16thCentury%29%20%3E%201500%20%26%26%20YEAR%28%3FpointInTime16thCentury%29%20%3C%3D%201600%29%0A%0A%20%20%23%20it%20is%20a%20village%20in%20the%20year%202022%0A%20%20%3Fsettlement%20p%3AP62%20%3FvillageStatement.%0A%20%20%3FvillageStatement%20ps%3AP62%20wd%3AQ653%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20pq%3AP40%20%3FpointInTime2022.%0A%20%20FILTER%28YEAR%28%3FpointInTime2022%29%20%3D%202022%29%0A%0A%20%20%23%20Reading%20in%20geographical%20coordinates%20from%20the%2016th%20century%0A%20%20%3Fsettlement%20p%3AP63%20%3FcoordStatement.%0A%20%20%3FcoordStatement%20ps%3AP63%20%3Fcoordinate16thCentury%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20pq%3AP40%20%3FcoordTime.%0A%20%20FILTER%28YEAR%28%3FcoordTime%29%20%3E%201500%20%26%26%20YEAR%28%3FcoordTime%29%20%3C%3D%201600%29%0A%0A%20%20SERVICE%20wikibase%3Alabel%20%7B%20bd%3AserviceParam%20wikibase%3Alanguage%20%22%5BAUTO_LANGUAGE%5D%2Cen%22.%20%7D%0A%7D Try It!] | [https://wikihum.lab.dariah.pl/wdqs/#%23title%3ATowns%20that%20were%20towns%20in%20the%2016th%20century%20and%20are%20now%20villages%0A%23defaultView%3AMap%0ASELECT%20%3Fsettlement%20%3FsettlementLabel%20%3Fcoordinate16thCentury%20WHERE%20%7B%0A%20%20%23%20Warunek%20dla%20miejscowo%C5%9Bci%0A%20%20%3Fsettlement%20wdt%3AP27%20wd%3AQ175698.%0A%0A%20%20%23%20It%20was%20a%20town%20in%20the%2016th%20century%0A%20%20%3Fsettlement%20p%3AP62%20%3FcityStatement.%0A%20%20%3FcityStatement%20ps%3AP62%20wd%3AQ622%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20pq%3AP40%20%3FpointInTime16thCentury.%0A%20%20FILTER%28YEAR%28%3FpointInTime16thCentury%29%20%3E%201500%20%26%26%20YEAR%28%3FpointInTime16thCentury%29%20%3C%3D%201600%29%0A%0A%20%20%23%20it%20is%20a%20village%20in%20the%20year%202022%0A%20%20%3Fsettlement%20p%3AP62%20%3FvillageStatement.%0A%20%20%3FvillageStatement%20ps%3AP62%20wd%3AQ653%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20pq%3AP40%20%3FpointInTime2022.%0A%20%20FILTER%28YEAR%28%3FpointInTime2022%29%20%3D%202022%29%0A%0A%20%20%23%20Reading%20in%20geographical%20coordinates%20from%20the%2016th%20century%0A%20%20%3Fsettlement%20p%3AP63%20%3FcoordStatement.%0A%20%20%3FcoordStatement%20ps%3AP63%20%3Fcoordinate16thCentury%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20pq%3AP40%20%3FcoordTime.%0A%20%20FILTER%28YEAR%28%3FcoordTime%29%20%3E%201500%20%26%26%20YEAR%28%3FcoordTime%29%20%3C%3D%201600%29%0A%0A%20%20SERVICE%20wikibase%3Alabel%20%7B%20bd%3AserviceParam%20wikibase%3Alanguage%20%22%5BAUTO_LANGUAGE%5D%2Cen%22.%20%7D%0A%7D Try It!] | ||
=== | === Localities that existed in the 16th century but do not exist today === | ||
<syntaxhighlight lang="SPARQL" class="mw-highlight-lang-sparql"> | <syntaxhighlight lang="SPARQL" class="mw-highlight-lang-sparql"> | ||
#title: | #title:Localities that existed in the 16th century but do not exist today | ||
#defaultView:Map | #defaultView:Map | ||
SELECT ?settlement ?settlementLabel ?settlementDescription ?coordinate16thCentury WHERE { | SELECT ?settlement ?settlementLabel ?settlementDescription ?coordinate16thCentury WHERE { | ||
# | # Condition for elements that are human settlements | ||
?settlement wdt:P27 wd:Q175698. | ?settlement wdt:P27 wd:Q175698. | ||
# | # Filter for a description containing the text ‘historic settlement’ | ||
?settlement schema:description ?settlementDescription. | ?settlement schema:description ?settlementDescription. | ||
FILTER(CONTAINS(LCASE(?settlementDescription), "osada historyczna")) | FILTER(CONTAINS(LCASE(?settlementDescription), "osada historyczna")) | ||
# | # geographical coordinates from the 16th century | ||
?settlement p:P63 ?coordStatement. | ?settlement p:P63 ?coordStatement. | ||
?coordStatement ps:P63 ?coordinate16thCentury; | ?coordStatement ps:P63 ?coordinate16thCentury; | ||
Line 92: | Line 92: | ||
FILTER(YEAR(?coordTime) > 1500 && YEAR(?coordTime) <= 1600) | FILTER(YEAR(?coordTime) > 1500 && YEAR(?coordTime) <= 1600) | ||
# | # Service for labels and descriptions in the indicated language | ||
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],pl". } | SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],pl". } | ||
} | } | ||
</syntaxhighlight> | </syntaxhighlight> | ||
[https://wikihum.lab.dariah.pl/wdqs/ | [https://wikihum.lab.dariah.pl/wdqs/#%23title%3ALocalities%20that%20existed%20in%20the%2016th%20century%20but%20do%20not%20exist%20today%0A%23defaultView%3AMap%0ASELECT%20%3Fsettlement%20%3FsettlementLabel%20%3FsettlementDescription%20%3Fcoordinate16thCentury%20WHERE%20%7B%0A%20%20%23%20Condition%20for%20elements%20that%20are%20human%20settlements%0A%20%20%3Fsettlement%20wdt%3AP27%20wd%3AQ175698.%0A%0A%20%20%23%20Filter%20for%20a%20description%20containing%20the%20text%20%E2%80%98historic%20settlement%E2%80%99%0A%20%20%3Fsettlement%20schema%3Adescription%20%3FsettlementDescription.%0A%20%20FILTER%28CONTAINS%28LCASE%28%3FsettlementDescription%29%2C%20%22osada%20historyczna%22%29%29%0A%20%20%0A%20%20%23%20geographical%20coordinates%20from%20the%2016th%20century%0A%20%20%3Fsettlement%20p%3AP63%20%3FcoordStatement.%0A%20%20%3FcoordStatement%20ps%3AP63%20%3Fcoordinate16thCentury%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20pq%3AP40%20%3FcoordTime.%0A%20%20FILTER%28YEAR%28%3FcoordTime%29%20%3E%201500%20%26%26%20YEAR%28%3FcoordTime%29%20%3C%3D%201600%29%0A%0A%20%20%23%20Service%20for%20labels%20and%20descriptions%20in%20the%20indicated%20language%0A%20%20SERVICE%20wikibase%3Alabel%20%7B%20bd%3AserviceParam%20wikibase%3Alanguage%20%22%5BAUTO_LANGUAGE%5D%2Cpl%22.%20%7D%0A%7D Try It!] | ||
=== Osoby urodzone w XVI wieku === | === Osoby urodzone w XVI wieku === |
Revision as of 17:01, 28 August 2024
This page is parsed by the web interface of the query service to fill the query example dialog.
Towns that served as county capital in the 16th century
#title:Towns that served as county capital in the 16th century
#defaultView:Map
SELECT ?item ?itemLabel ?ahp_id ?coordinate
WHERE
{
?item wdt:P81 ?ahp_id .
?item p:P63 ?statement .
?statement pq:P40 ?pointintime .
?statement ps:P63 ?coordinate .
?item p:P79 ?statement1.
?statement1 pq:P40 ?pointintime1 .
?statement1 (ps:P79/(wdt:P56*)) wd:Q99. # stolica powiatu
FILTER(YEAR(?pointintime) = 1600 && YEAR(?pointintime1) = 1600)
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
Localities that were places of the local assembly in the 16th century
#title:Localities that were places of the local assembly in the 16th century
#defaultView:Map
SELECT ?item ?itemLabel ?ahp_id ?coordinate
WHERE
{
?item wdt:P81 ?ahp_id .
?item p:P63 ?statement .
?statement pq:P40 ?pointintime .
?statement ps:P63 ?coordinate .
?item p:P79 ?statement1.
?statement1 pq:P40 ?pointintime1 .
?statement1 (ps:P79/(wdt:P56*)) wd:Q91. # miejsca odbywania sejmiku partykularnego
FILTER(YEAR(?pointintime) = 1600 && YEAR(?pointintime1) = 1600)
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
Towns that were towns in the 16th century and are now villages
#title:Towns that were towns in the 16th century and are now villages
#defaultView:Map
SELECT ?settlement ?settlementLabel ?coordinate16thCentury WHERE {
# Warunek dla miejscowości
?settlement wdt:P27 wd:Q175698.
# It was a town in the 16th century
?settlement p:P62 ?cityStatement.
?cityStatement ps:P62 wd:Q622;
pq:P40 ?pointInTime16thCentury.
FILTER(YEAR(?pointInTime16thCentury) > 1500 && YEAR(?pointInTime16thCentury) <= 1600)
# it is a village in the year 2022
?settlement p:P62 ?villageStatement.
?villageStatement ps:P62 wd:Q653;
pq:P40 ?pointInTime2022.
FILTER(YEAR(?pointInTime2022) = 2022)
# geographical coordinates from the 16th century
?settlement p:P63 ?coordStatement.
?coordStatement ps:P63 ?coordinate16thCentury;
pq:P40 ?coordTime.
FILTER(YEAR(?coordTime) > 1500 && YEAR(?coordTime) <= 1600)
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
Localities that existed in the 16th century but do not exist today
#title:Localities that existed in the 16th century but do not exist today
#defaultView:Map
SELECT ?settlement ?settlementLabel ?settlementDescription ?coordinate16thCentury WHERE {
# Condition for elements that are human settlements
?settlement wdt:P27 wd:Q175698.
# Filter for a description containing the text ‘historic settlement’
?settlement schema:description ?settlementDescription.
FILTER(CONTAINS(LCASE(?settlementDescription), "osada historyczna"))
# geographical coordinates from the 16th century
?settlement p:P63 ?coordStatement.
?coordStatement ps:P63 ?coordinate16thCentury;
pq:P40 ?coordTime.
FILTER(YEAR(?coordTime) > 1500 && YEAR(?coordTime) <= 1600)
# Service for labels and descriptions in the indicated language
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],pl". }
}
Osoby urodzone w XVI wieku
#title:Lista osób urodzonych w XVI wieku
SELECT DISTINCT ?human ?humanLabel (YEAR(?date_of_birth) AS ?year) WHERE {
?human wdt:P27 wd:Q5.
?human wdt:P11 ?date_of_birth.
FILTER (YEAR(?date_of_birth) > 1500 && YEAR(?date_of_birth) < 1601)
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
ORDER BY ?date_of_birth
Lista osób długowiecznych
#title:Osoby ze znaną datą urodzin i śmierci żyjące pow. 90 lat
SELECT ?item ?itemLabel ?age
WHERE {
?item wdt:P27 wd:Q5 .
?item p:P11/psv:P11 ?birth_date_node .
?item p:P12/psv:P12 ?death_date_node .
?birth_date_node wikibase:timeValue ?birth_date.
?death_date_node wikibase:timeValue ?death_date.
?birth_date_node wikibase:timePrecision ?birth_precision.
?death_date_node wikibase:timePrecision ?death_precision.
BIND( YEAR(?death_date) - YEAR(?birth_date) -
IF(MONTH(?death_date)<MONTH(?birth_date) ||
(MONTH(?death_date)=MONTH(?birth_date) && DAY(?death_date)<DAY(?birth_date)),1,0) AS ?age )
FILTER(?age > 90 && ?birth_precision >= 9 && ?death_precision >= 9).
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
ORDER BY DESC(?age)
Osoby żyjące w XVI wieku - urodzone, zmarłe lub aktywne w tym okresie
#title:Osoby żyjące w XVI wieku - urodzone, zmarłe lub aktywne w tym okresie
SELECT * WHERE
{
{
SELECT DISTINCT ?item ?itemLabel WHERE {
?item wdt:P27 wd:Q5.
?item wdt:P11 ?birthdate.
?item wdt:P12 ?deathdate.
FILTER(
((?birthdate >= "1501-01-01T00:00:00Z"^^xsd:dateTime) && (?birthdate <= "1600-12-31T00:00:00Z"^^xsd:dateTime))
||
((?deathdate >= "1501-01-01T00:00:00Z"^^xsd:dateTime) && (?deathdate <= "1600-12-31T00:00:00Z"^^xsd:dateTime))
)
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }}
}
UNION
{
SELECT DISTINCT ?item ?itemLabel WHERE {
?item wdt:P27 wd:Q5.
?item wdt:P87 ?fluorit.
FILTER ((?fluorit >= "+1501-01-01T00:00:00Z"^^xsd:dateTime) && (?fluorit <= "+1600-01-01T00:00:00Z"^^xsd:dateTime))
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }}
}
}
ORDER BY ?itemLabel
Miejscowości, które w XVI wieku były miastami
#title:Miejscowości które w XVI wieku były miastami
#defaultView:Map
SELECT ?item ?itemLabel ?ahp_id ?coordinate
WHERE
{
?item wdt:P81 ?ahp_id .
?item p:P63 ?statement .
?statement pq:P40 ?pointintime .
?item p:P62 ?statement1.
?statement1 pq:P40 ?pointintime1 .
?statement ps:P63 ?coordinate .
?statement1 (ps:P62/(wdt:P56*)) wd:Q622.
FILTER(YEAR(?pointintime) = 1600 && YEAR(?pointintime1) = 1600)
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
Miejscowości, które w XVI wieku były własnością monarszą
#title:Miejscowości, które w XVI wieku były własnością monarszą
#defaultView:Map
SELECT ?item ?itemLabel ?ahp_id ?coordinate
WHERE
{
?item wdt:P81 ?ahp_id .
?item p:P63 ?statement .
?item p:P134 ?statement1.
?statement pq:P40 ?pointintime .
?statement1 pq:P40 ?pointintime1 .
?statement ps:P63 ?coordinate .
?statement1 (ps:P134/(wdt:P56*)) wd:Q64. # Q64 - własność monarsza, Q63 - duchowna, Q65 - mieszczańska, Q66 - szlachecka
FILTER(YEAR(?pointintime) = 1600)
FILTER(YEAR(?pointintime1) = 1600)
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
Miejscowości według typu własności w XVI wieku
#title:Miejscowości według typu własności w XVI wieku
#defaultView:Map
SELECT ?item ?itemLabel ?ahp_id ?coordinate ?layer
WHERE
{
?item wdt:P81 ?ahp_id .
?item p:P63 ?statement .
?item p:P134 ?statement1.
?statement pq:P40 ?pointintime .
?statement1 pq:P40 ?pointintime1 .
?statement ps:P63 ?coordinate .
?statement1 (ps:P134/(wdt:P56*)) ?typ
# Q64 - własność monarsza, Q63 - duchowna, Q65 - mieszczańska, Q66 - szlachecka
BIND(
IF(?typ = wd:Q64, "monarsza",
IF(?typ = wd:Q63, "duchowna",
IF(?typ = wd:Q65, "mieszczańska",
IF(?typ = wd:Q66, "szlachecka",
"inna"))))
AS ?layer).
FILTER(YEAR(?pointintime) = 1600)
FILTER(YEAR(?pointintime1) = 1600)
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
GROUP BY ?item ?itemLabel ?ahp_id ?coordinate ?layer
Podsumowanie liczby osób urodzonych w poszczególnych stuleciach
#title:Liczba osób urodzonych w poszczególnych stuleciach
#defaultView:BarChart
SELECT ?centuryRoman (COUNT(*) AS ?count)
WHERE {
?person wdt:P27 wd:Q5;
wdt:P11 ?birthDate .
# Obliczenie stulecia na podstawie roku urodzenia
BIND(CEIL((YEAR(?birthDate) - 1) / 100) AS ?century)
BIND(
IF(?century = 10, "X",
IF(?century = 11, "XI",
IF(?century = 12, "XII",
IF(?century = 13, "XIII",
IF(?century = 14, "XIV",
IF(?century = 15, "XV",
IF(?century = 16, "XVI",
IF(?century = 17, "XVII",
IF(?century = 18, "XVIII",
IF(?century = 19, "XIX",
IF(?century = 20, "XX",
""))))))))))) AS ?centuryRoman).
# odfiltrowanie błędnych danych
FILTER(?century >= 10 && ?century < 21)
}
GROUP BY ?centuryRoman
ORDER BY ?count
Sobiescy urodzeni w XVI i XVII wieku
#title:Sobiescy urodzeni w XVI i XVII wieku
#defaultView:Timeline
SELECT DISTINCT ?person (MAX(?deathDate) as ?ddate) (MAX(?birthDate) as ?bdate) (MAX(?personLabel) as ?label) WHERE {
# Warunek dla osób
?person wdt:P27 wd:Q5.
?person rdfs:label ?personLabel.
# Pobieranie daty urodzenia
?person p:P11 ?birthStatement.
?birthStatement ps:P11 ?birthDate.
# Pobieranie daty śmierci
?person p:P12 ?deathStatement.
?deathStatement ps:P12 ?deathDate.
# filtrowanie daty urodzin: przedział 1501-1700 oraz nazwisko "sobieski" w etykiecie
FILTER(CONTAINS(LCASE(?personLabel), "sobieski") && ?birthDate >= "1501-01-01T00:00:00Z"^^xsd:dateTime && ?birthDate <= "1700-12-31T23:59:59Z"^^xsd:dateTime)
} GROUP BY ?person
ORDER BY ?personLabel
Zmiana nazwy miejscowości między XVI wiekiem a współczesnością (tylko własność monarsza)
#title:Zmiana nazwy miejscowości między XVI wiekiem a współczesnością (tylko dla własności monarszej)
#defaultView:Map
SELECT ?place ?currentName ?historicNames ?coordinate ?layer
WHERE {
BIND(
IF ( CONTAINS(LCASE(CONCAT(?historicNames,",")), LCASE(CONCAT(?currentName, ","))), "kontynuacja", "zmiana") AS ?layer ).
{
SELECT ?place ?currentName ?coordinate (GROUP_CONCAT(?historicName; separator=",") AS ?historicNames)
WHERE {
?place wdt:P27 wd:Q175698; # miejscowość jest instancją "Q175698" (miejscowość)
rdfs:label ?currentName.
?place wdt:P134 wd:Q64.
?place p:P63 ?statement .
?statement pq:P40 ?pointintime_coord .
?statement ps:P63 ?coordinate .
?place p:P54 ?historicNameStatement .
?historicNameStatement ps:P54 ?historicName;
pq:P40 ?pointInTime16thCentury.
# Filtr na opis zawierający tekst "osada historyczna"
?place schema:description ?settlementDescription.
FILTER(LANG(?settlementDescription) = "pl") # Opis w języku polskim
FILTER(!STRSTARTS(?settlementDescription, "osada historyczna"))
FILTER(LANG(?currentName) = "pl" && YEAR(?pointInTime16thCentury) = 1600 && YEAR(?pointintime_coord) = 1600)
}
GROUP BY ?place ?currentName ?coordinate
}
}
Odległości między położeniem miejscowości w XVI wieku i współcześnie (w km)
#title:Odległości między położeniem miejscowości w XVI wieku i współcześnie w km
SELECT DISTINCT ?place ?placeLabel ?distance
WHERE {
SELECT ?place ?placeLabel ?coord1 ?coord2 (geof:distance(?coord1, ?coord2) AS ?distance)
WHERE {
?place wdt:P27 wd:Q175698;
p:P63 ?statement1, ?statement2.
?statement1 ps:P63 ?coord1.
?statement2 ps:P63 ?coord2.
FILTER(?statement1 != ?statement2)
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
}
ORDER BY DESC (?distance)
Miejscowości Wólka lub Dąbrowa w XVI wieku
#title:Miejscowości z nazwami typu Wólka lub Dąbrowa w XVI wieku
#defaultView:Map
SELECT ?item ?itemLabel ?ahp_id ?coordinate ?historicNames ?layer
WHERE {
BIND(
IF(CONTAINS(?historicNames, "Wólka"), "Wólka",
IF(CONTAINS(?historicNames, "Dąbrowa"), "Dąbrowa",
"inna"))
AS ?layer).
{
SELECT ?item ?itemLabel ?ahp_id ?coordinate (GROUP_CONCAT(?historicName; separator=",") AS ?historicNames)
WHERE
{
?item wdt:P81 ?ahp_id .
?item p:P63 ?statement .
?statement ps:P63 ?coordinate .
?statement pq:P40 ?pointintime .
?item p:P54 ?historicNameStatement .
?historicNameStatement ps:P54 ?historicName;
pq:P40 ?pointInTime16thCentury.
FILTER( YEAR(?pointintime) = 1600 && YEAR(?pointInTime16thCentury) = 1600 && (CONTAINS(?historicName, "Wólka") || CONTAINS(?historicName, "Dąbrowa")))
}
GROUP BY ?item ?itemLabel ?ahp_id ?coordinate ?historicName
}
FILTER(?layer = "Wólka" || ?layer = "Dąbrowa")
}
Stara Wieś kontra Nowa Wieś w XVI wieku
#title:Stara Wieś kontra Nowa Wieś w XVI wieku
#defaultView:Map
SELECT ?item ?itemLabel ?ahp_id ?coordinate ?historicNames ?layer
WHERE {
BIND(
IF(CONTAINS(?historicNames, "Nowa Wieś"), "Nowa Wieś",
IF(CONTAINS(?historicNames, "Stara Wieś"), "Stara Wieś",
"inna"))
AS ?layer).
{
SELECT ?item ?itemLabel ?ahp_id ?coordinate (GROUP_CONCAT(?historicName; separator=",") AS ?historicNames)
WHERE
{
?item wdt:P81 ?ahp_id .
?item p:P63 ?statement .
?statement ps:P63 ?coordinate .
?statement pq:P40 ?pointintime .
?item p:P54 ?historicNameStatement .
?historicNameStatement ps:P54 ?historicName;
pq:P40 ?pointInTime16thCentury.
FILTER( YEAR(?pointintime) = 1600 && YEAR(?pointInTime16thCentury) = 1600 && (CONTAINS(?historicName, "Nowa Wieś") || CONTAINS(?historicName, "Stara Wieś")))
}
GROUP BY ?item ?itemLabel ?ahp_id ?coordinate ?historicName
}
FILTER(?layer = "Nowa Wieś" || ?layer = "Stara Wieś")
}