Project:SPARQL/examples: Difference between revisions

Line 4,393: Line 4,393:
}
}
order by ?personLabel ?positionLabel
order by ?personLabel ?positionLabel
</sparql>
=== Questions ===
<sparql tryit="1">
#title:asking questions
PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/>
PREFIX bnwds: <https://beyond-notability.wikibase.cloud/entity/statement/>
PREFIX bnwdv: <https://beyond-notability.wikibase.cloud/value/>
PREFIX bnwdt: <https://beyond-notability.wikibase.cloud/prop/direct/>
PREFIX bnp: <https://beyond-notability.wikibase.cloud/prop/>
PREFIX bnps: <https://beyond-notability.wikibase.cloud/prop/statement/>
PREFIX bnpq: <https://beyond-notability.wikibase.cloud/prop/qualifier/>
PREFIX bnpsv: <https://beyond-notability.wikibase.cloud/prop/statement/value/>
PREFIX bnpqv: <https://beyond-notability.wikibase.cloud/prop/qualifier/value/>
SELECT ?personLabel ?propLabel ?link ?question
WHERE { 
  ?person bnwdt:P3 bnwd:Q3 .
 
  ?person ?p ?s .
      ?prop wikibase:claim ?p;     
        wikibase:statementProperty ?ps.     
         
  # direct link to relevant part of page
        BIND (REPLACE(STR(?prop), "^.*/([^/]*)$", "$1") as ?pid).
        bind(iri(concat(str(?person), "#", ?pid)) as ?link ) .
 
  # the question
    ?s bnpq:P157 ?question . 
       
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en,en-gb". }
}
order by ?personLabel
</sparql>
</sparql>


579

edits