SPARQL examples: Difference between revisions
Jump to navigation
Jump to search
m Poprawa błędnego URLa |
No edit summary |
||
Line 56: | Line 56: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
[https://prunus-208.man.poznan.pl/wdqs/#%23Elementy%20%28nie%20tylko%20osoby%29%20z%20Bogumi%C5%82owic%0ASELECT%20%3Fitem%20%3FitemLabel%20WHERE%20%7B%0A%20%20%3Fitem%20wdt%3AP30%20wd%3AQ24.%20%23%20element%20posiada%20w%C5%82a%C5%9Bciwo%C5%9B%C4%87%20miejsca%20i%20ta%20w%C5%82a%C5%9Bciwo%C5%9B%C4%87%20ma%20warto%C5%9B%C4%87%20Bogumi%C5%82owice%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://prunus-208.man.poznan.pl/wdqs/#%23Elementy%20%28nie%20tylko%20osoby%29%20z%20Bogumi%C5%82owic%0ASELECT%20%3Fitem%20%3FitemLabel%20WHERE%20%7B%0A%20%20%3Fitem%20wdt%3AP30%20wd%3AQ24.%20%23%20element%20posiada%20w%C5%82a%C5%9Bciwo%C5%9B%C4%87%20miejsca%20i%20ta%20w%C5%82a%C5%9Bciwo%C5%9B%C4%87%20ma%20warto%C5%9B%C4%87%20Bogumi%C5%82owice%0A%20%20SERVICE%20wikibase%3Alabel%20%7B%20bd%3AserviceParam%20wikibase%3Alanguage%20%22%5BAUTO_LANGUAGE%5D%2Cen%22.%20%7D%0A%7D Try it!] | ||
=== Osoby urodzone między rokiem 1501 a 1525 === | |||
<syntaxhighlight lang="SPARQL" class="mw-highlight-lang-sparql"> | |||
SELECT DISTINCT ?item ?itemLabel WHERE { | |||
?item wdt:P47 wd:Q32. | |||
?item wdt:P7 ?birthdate. | |||
FILTER((?birthdate >= "1501-01-01T00:00:00Z"^^xsd:dateTime) && (?birthdate <= "1525-12-31T00:00:00Z"^^xsd:dateTime)) | |||
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } | |||
} | |||
</syntaxhighlight> | |||
[https://prunus-208.man.poznan.pl/wdqs/index.html#%23title%3A%20Osoby%20urodzone%20mi%C4%99dzy%20rokiem%201501%20a%201525%0ASELECT%20DISTINCT%20%3Fitem%20%3FitemLabel%20WHERE%20%7B%0A%20%20%3Fitem%20wdt%3AP47%20wd%3AQ32.%0A%20%20%3Fitem%20wdt%3AP7%20%3Fbirthdate.%0A%20%20FILTER%28%28%3Fbirthdate%20%3E%3D%20%221501-01-01T00%3A00%3A00Z%22%5E%5Exsd%3AdateTime%29%20%26%26%20%28%3Fbirthdate%20%3C%3D%20%221525-12-31T00%3A00%3A00Z%22%5E%5Exsd%3AdateTime%29%29%0A%20%20SERVICE%20wikibase%3Alabel%20%7B%20bd%3AserviceParam%20wikibase%3Alanguage%20%22%5BAUTO_LANGUAGE%5D%2Cen%22.%20%7D%0A%7D Try it!] |
Revision as of 14:58, 16 May 2022
This page is parsed by the web interface of the query service to fill the query example dialog.
Institutions
SELECT ?institution ?institutionLabel
WHERE
{
?institution wdt:P47 wd:Q467. # instance of Institution
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
Humans
#Lists all humans with values of selected fields
SELECT ?human ?humanLabel ?fatherLabel ?motherLabel ?date_of_birth WHERE {
?human wdt:P47 wd:Q32.
OPTIONAL { ?human wdt:P66 ?father. }
OPTIONAL { ?human wdt:P68 ?mother. }
OPTIONAL { ?human wdt:P7 ?date_of_birth. }
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
Humans without parents
#Lists all humans without parents
SELECT ?human ?humanLabel WHERE {
?human wdt:P47 wd:Q32. #find humans
MINUS {
?human wdt:P68 [] . # without father
?human wdt:P66 [] . # without mother
?human wdt:P65 [] . # without any unspecified parent
}
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
Elements from Bogumiłowice
SELECT ?item ?itemLabel WHERE {
?item wdt:P30 wd:Q24. # element posiada właściwość miejsca i ta właściwość ma wartość Bogumiłowice
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
Osoby urodzone między rokiem 1501 a 1525
SELECT DISTINCT ?item ?itemLabel WHERE {
?item wdt:P47 wd:Q32.
?item wdt:P7 ?birthdate.
FILTER((?birthdate >= "1501-01-01T00:00:00Z"^^xsd:dateTime) && (?birthdate <= "1525-12-31T00:00:00Z"^^xsd:dateTime))
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}