Project:SPARQL/examples: Difference between revisions

From Beyond Notability
Line 2,633: Line 2,633:
</sparql>
</sparql>


==== And which are owned/operated by English Heritage/National Trust ====
==== And which are owned/operated by English Heritage/National Trust or belong to Historic Houses Association ====


<sparql tryit="1">
<sparql tryit="1">
Line 2,667: Line 2,667:
       optional { ?wikidata wdt:P127 ?wd_owner .}
       optional { ?wikidata wdt:P127 ?wd_owner .}
       optional { ?wikidata wdt:P137 ?wd_operator . }
       optional { ?wikidata wdt:P137 ?wd_operator . }
        
       optional { ?wikidata wdt:P463 ?wd_member . }
        # filter: owner or operator = EH/NT
        filter ( ?wd_owner in (wd:Q936287, wd:Q333515) || ?wd_operator in (wd:Q936287, wd:Q333515)  ) .


      # member of P463 is the property for HHA  
      # filter: owner or operator = EH/NT / member of HHA
      optional { ?wikidata wdt:P463 ?wd_member . }
        filter ( ?wd_owner in (wd:Q936287, wd:Q333515) ||
                ?wd_operator in (wd:Q936287, wd:Q333515) ||
                ?wd_member = wd:Q5773523 ) .


       ## owned by P127 / operator P137   
       ## owned by P127 / operator P137   
       ## ENglish Heritage Q936287  National Trust (Q333515)  
       ## ENglish Heritage Q936287  National Trust (Q333515)  
       ## member of P463  Historic Houses Association (Q5773523)  
       ## member of P463  Historic Houses Association (Q5773523)  
              
              
3,427

edits