Project:SPARQL/starters: Difference between revisions
Guygreenberg (talk | contribs) |
Guygreenberg (talk | contribs) (→Time) |
||
Line 19: | Line 19: | ||
==Time== | ==Time== | ||
===When Timna excavations took place=== | ===When Timna excavations took place=== | ||
One way into the data is through | One way into the data is through the archeological periods tha were found. This query sites from the late bronze age as well as the iron age. | ||
PREFIX wd: <https://timna-database.wikibase.cloud/entity/> | |||
PREFIX wdt: <https://timna-database.wikibase.cloud/prop/direct/> | |||
PREFIX p: <https://timna-database.wikibase.cloud/prop/> | |||
PREFIX ps: <https://timna-database.wikibase.cloud/prop/statement/> | |||
PREFIX geo: <http://www.opengis.net/ont/geosparql#> | |||
Try it! | SELECT DISTINCT ?entity ?entityLabel ?coordinate | ||
WHERE { | |||
?entity rdfs:label ?entityLabel . | |||
FILTER (lang(?entityLabel) = "en") | |||
FILTER (STRSTARTS(?entityLabel, "Site")) | |||
FILTER (STRSTARTS(STR(?entity), "https://timna-database.wikibase.cloud/entity/Q")) | |||
?entity p:P93 ?statement1 . | |||
?statement1 ps:P93 wd:Q115 . | |||
?entity p:P93 ?statement2 . | |||
?statement2 ps:P93 wd:Q114 . | |||
?entity p:P93 ?statement3 . | |||
?statement3 ps:P93 wd:Q120 . | |||
?entity wdt:P28 ?coordinate . | |||
} | |||
LIMIT 100 | |||
[https://timna-database.wikibase.cloud/query/#PREFIX%20wd%3A%20%3Chttps%3A%2F%2Ftimna-database.wikibase.cloud%2Fentity%2F%3E%0APREFIX%20wdt%3A%20%3Chttps%3A%2F%2Ftimna-database.wikibase.cloud%2Fprop%2Fdirect%2F%3E%0APREFIX%20p%3A%20%3Chttps%3A%2F%2Ftimna-database.wikibase.cloud%2Fprop%2F%3E%0APREFIX%20ps%3A%20%3Chttps%3A%2F%2Ftimna-database.wikibase.cloud%2Fprop%2Fstatement%2F%3E%0APREFIX%20geo%3A%20%3Chttp%3A%2F%2Fwww.opengis.net%2Font%2Fgeosparql%23%3E%0A%0ASELECT%20DISTINCT%20%3Fentity%20%3FentityLabel%20%3Fcoordinate%0AWHERE%20%7B%0A%20%20%3Fentity%20rdfs%3Alabel%20%3FentityLabel%20.%0A%20%20FILTER%20%28lang%28%3FentityLabel%29%20%3D%20%22en%22%29%0A%20%20FILTER%20%28STRSTARTS%28%3FentityLabel%2C%20%22Site%22%29%29%0A%20%20FILTER%20%28STRSTARTS%28STR%28%3Fentity%29%2C%20%22https%3A%2F%2Ftimna-database.wikibase.cloud%2Fentity%2FQ%22%29%29%0A%0A%20%20%3Fentity%20p%3AP93%20%3Fstatement1%20.%0A%20%20%3Fstatement1%20ps%3AP93%20wd%3AQ115%20.%0A%0A%20%20%3Fentity%20p%3AP93%20%3Fstatement2%20.%0A%20%20%3Fstatement2%20ps%3AP93%20wd%3AQ114%20.%0A%20%20%0A%20%20%3Fentity%20p%3AP93%20%3Fstatement3%20.%0A%20%20%3Fstatement3%20ps%3AP93%20wd%3AQ120%20.%0A%20%20%0A%20%20%3Fentity%20wdt%3AP28%20%3Fcoordinate%20.%0A%7D%0ALIMIT%20100%0A%0A Try it!] | |||
==People== | ==People== |
Revision as of 12:31, 17 July 2024
Place
Where Timna sites are located
One way into the data is through the locations of archeological sites This query does that for all the sites but could be adapted (on lines *xx* and *xx* TBD) to look for other places or regions. PREFIX wd: <https://timna-database.wikibase.cloud/entity/> PREFIX wdt: <https://timna-database.wikibase.cloud/prop/direct/> PREFIX p: <https://timna-database.wikibase.cloud/prop/> PREFIX ps: <https://timna-database.wikibase.cloud/prop/statement/> PREFIX geo: <http://www.opengis.net/ont/geosparql#>
SELECT DISTINCT ?entity ?entityLabel ?coordinate WHERE {
?entity rdfs:label ?entityLabel . FILTER (lang(?entityLabel) = "en") FILTER (STRSTARTS(?entityLabel, "Site")) FILTER (STRSTARTS(STR(?entity), "https://timna-database.wikibase.cloud/entity/Q")) ?entity wdt:P28 ?coordinate . } LIMIT 300 ##defaultView:Map
Time
When Timna excavations took place
One way into the data is through the archeological periods tha were found. This query sites from the late bronze age as well as the iron age. PREFIX wd: <https://timna-database.wikibase.cloud/entity/> PREFIX wdt: <https://timna-database.wikibase.cloud/prop/direct/> PREFIX p: <https://timna-database.wikibase.cloud/prop/> PREFIX ps: <https://timna-database.wikibase.cloud/prop/statement/> PREFIX geo: <http://www.opengis.net/ont/geosparql#>
SELECT DISTINCT ?entity ?entityLabel ?coordinate WHERE {
?entity rdfs:label ?entityLabel . FILTER (lang(?entityLabel) = "en") FILTER (STRSTARTS(?entityLabel, "Site")) FILTER (STRSTARTS(STR(?entity), "https://timna-database.wikibase.cloud/entity/Q"))
?entity p:P93 ?statement1 . ?statement1 ps:P93 wd:Q115 .
?entity p:P93 ?statement2 . ?statement2 ps:P93 wd:Q114 . ?entity p:P93 ?statement3 . ?statement3 ps:P93 wd:Q120 . ?entity wdt:P28 ?coordinate .
} LIMIT 100
People
This query returns members of the CTV excavations. As such it is a relatively straightforward query.
Try it!