Project:SPARQL/examples: Difference between revisions

no edit summary
No edit summary
Line 103: Line 103:
ORDER BY ?person
ORDER BY ?person
# per https://twitter.com/Tagishsimon/status/1445127301306490891, I (James) and aware that this is a hack of the datamodel that isn't using the datamodel to full effect.
# per https://twitter.com/Tagishsimon/status/1445127301306490891, I (James) and aware that this is a hack of the datamodel that isn't using the datamodel to full effect.
</sparql>
===People whose residence was at one time in the east and south east of England, excluding London===
<sparql tryit="1">
PREFIX bn: <http://beyond-notability.wiki.opencura.com/entity/>
PREFIX bnwdt: <http://beyond-notability.wiki.opencura.com/prop/direct/>
PREFIX bnps: <http://beyond-notability.wiki.opencura.com/prop/statement/>
PREFIX bnpq: <http://beyond-notability.wiki.opencura.com/prop/qualifier/>
SELECT ?residentLabel ?residenceLabel ?districtLabel ?countyLabel ?regionLabel
WHERE { 
  ?resident bnwdt:P29 ?residence .
  ?residence bnwdt:P33 ?district .
  ?district bnwdt:P33 ?county .
  ?county bnwdt:P33 ?region .
    {?county bnwdt:P33 bn:Q67 .}
    UNION
    {?county bnwdt:P33 bn:Q85 .}
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en-gb". }
}
</sparql>
</sparql>
6,317

edits