query: SELECT DISTINCT ?item ?itemLabel ?siteLabel (group_concat(DISTINCT ?elseLabel;separator=", ") as ?council) ?terrainLabel ?coord ?incept ?area ?inv ?NSID ?WDPA_ID (count(DISTINCT ?other) as ?inlinks) WHERE 
  {
    VALUES ?site {  
      wd:Q2463705 # Special Protection Area
      wd:Q1191622 # Special Area of Conservation
      wd:Q350723 # Country Park
      wd:Q109254256 # country park (Scotland)
      wd:Q46169 # national park - generic
      wd:Q109267960 # National Park (Scotland)
      wd:Q422211 # Site of Special Scientific Interest
      wd:Q1367500 # Nature Conservation MPA
      wd:Q6974560 # National Nature Reserve
      wd:Q19683138 # Ramsar Site
      wd:Q3457526 # Local Nature Reserve
      wd:Q6978246 # National Scenic Area
    }
    ?item wdt:P131 ?else . #wd:Q47134  .
    ?else wdt:P31 wd:Q15060255  .    # Scottish Council Area
    { ?item p:P1435 ?stat .          # indicated by a heritage designation
      ?stat ps:P1435 ?site .
        OPTIONAL {?stat pq:P217 ?inv . } 
    }
    UNION
    { ?item wdt:P31 ?site .               # indicated by P31
      OPTIONAL { ?item p:P1435 ?stat2 .   # and might have a heritage designation
                 ?stat2 ps:P1435 ?site .
                   OPTIONAL {?stat2 pq:P217 ?inv . } }
  }
    OPTIONAL {?item wdt:P706 ?terrain . }
    OPTIONAL {?item wdt:P625 ?coord . }
    OPTIONAL {?item wdt:P571 ?incept . }
    OPTIONAL {?item wdt:P2046 ?area . }
    OPTIONAL {?item wdt:P10015 ?NSID . }
    OPTIONAL {?item wdt:P809 ?WDPA_ID . }
    OPTIONAL {?other ?predicate ?item . 
              ?property wikibase:directClaim ?predicate . } # incoming links, drives ?inlinks count
    SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en".
                           ?item rdfs:label ?itemLabel .
                           ?site rdfs:label ?siteLabel .
                           ?terrain rdfs:label ?terrainLabel. 
                           ?else rdfs:label ?elseLabel . } 
  } group by ?item ?itemLabel ?siteLabel ?terrainLabel ?coord ?incept ?area ?inv ?NSID ?WDPA_ID order by ?itemLabel