Project:SPARQL/examples: Difference between revisions

Line 1,552: Line 1,552:


# Exploratory query to get all info on an item page including qualifiers (but not references) for each organisation (Q2316) 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.  
# 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.
# ?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. Not sure if this is the best way to do it, but bnwdt:P12* seems to fetche some extras/duplicates, I think because a small number of items are both children of and grandchildren of Q2316.


   # get all the things about ?item   
   # get all the things about ?item   
579

edits