Project:SPARQL/examples: Difference between revisions

(add some logic)
Line 81: Line 81:


<sparql tryit="1">
<sparql tryit="1">
PREFIX a: <http://beyond-notability.wiki.opencura.com/entity/>
PREFIX bn: <http://beyond-notability.wiki.opencura.com/entity/>
PREFIX b: <http://beyond-notability.wiki.opencura.com/prop/direct/>
PREFIX bnwdt: <http://beyond-notability.wiki.opencura.com/prop/direct/>
PREFIX bps: <http://beyond-notability.wiki.opencura.com/prop/statement/>
PREFIX bnps: <http://beyond-notability.wiki.opencura.com/prop/statement/>
PREFIX bpq: <http://beyond-notability.wiki.opencura.com/prop/qualifier/>
PREFIX bnpq: <http://beyond-notability.wiki.opencura.com/prop/qualifier/>




Line 90: Line 90:
{
{
   ?person ?y ?z .
   ?person ?y ?z .
   ?person b:P3 ?gender . #this line is a crude hack for 'is person'
   ?person bnwdt:P3 ?gender . #this line is a crude hack for 'is person'
   ?z bpq:P1 ?date .
   ?z bnpq:P1 ?date .
     {?person b:P7 ?RAIproposed .}
     {?person bnwdt:P7 ?RAIproposed .}
     UNION
     UNION
     {?person b:P8 ?RAIseconded .}
     {?person bnwdt:P8 ?RAIseconded .}
     UNION
     UNION
     {?person b:P16 ?SALproposed .}   
     {?person bnwdt:P16 ?SALproposed .}   
     SERVICE wikibase:label {
     SERVICE wikibase:label {
       bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en-gb".
       bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en-gb".
Line 102: Line 102:
}
}
ORDER BY ?person
ORDER BY ?person
# per https://twitter.com/Tagishsimon/status/1445127301306490891, I (James) and aawre that this is a hack of the datamodel that isn't using the datamodel to full effect.
</sparql>
</sparql>
6,317

edits