Project:SPARQL/examples: Difference between revisions

Line 1,551: Line 1,551:
<sparql tryit="1">
<sparql tryit="1">


# Exploratory query to get all info on an item page including qualifiers (but not references) for each organisation in the wikibase
# Exploratory query to get all info on an item page including qualifiers (but not references) for each organisation (Q2316) in the wikibase
 
# As it stands, this *only* fetches organisations that specifically have the instance of Q2316: I didn't realise initially how many organisations' don't directly reference Q2316.
PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/>
PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/>
PREFIX bnwds: <https://beyond-notability.wikibase.cloud/entity/statement/>
PREFIX bnwds: <https://beyond-notability.wikibase.cloud/entity/statement/>
Line 1,570: Line 1,570:


?item bnwdt:P12 bnwd:Q2316  . # instance of organisation
?item bnwdt:P12 bnwd:Q2316  . # instance of organisation
 
# ?item ( bnwdt:P12/bnwdt:P12 | bnwdt:P12 ) bnwd:Q2316 . # this line instead would also get organisations whose instance of (eg learned society Q2317) is an instance of Q2316. But not sure if this is the best way to do it.
 
   # get all the things about ?item   
   # get all the things about ?item   
     ?item ?p ?statement .   
     ?item ?p ?statement .   
579

edits