Wikidata:Topics/Wikidata/Libraries

SELECT DISTINCT ?project ?projectLabel ?compatibleWith ?compatibleWithLabel ?inception (GROUP_CONCAT(?use) as ?uses) (GROUP_CONCAT(?useLabel; SEPARATOR = '\n') as ?useLabels)
WHERE 
{
  ?project wdt:P31/wdt:P279* wd:Q188860.

  # Note that we intentionally don't have an ambiguous "Wikidata library" entity
  # and instead accurately model the use cases of libraries via P8956 and P366.
  ?project wdt:P8956 ?compatibleWith.
  {?compatibleWith wdt:P1269 wd:Q16354758}
  UNION {?compatibleWith wdt:P1269 wd:Q2013}
  
  OPTIONAL {?project wdt:P571 ?inception}
  OPTIONAL {?project wdt:P366 ?use}

  SERVICE wikibase:label {
    bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en".
    ?project rdfs:label ?projectLabel.
    ?use rdfs:label ?useLabel.
    ?compatibleWith rdfs:label ?compatibleWithLabel.
  }
} GROUP BY ?project ?projectLabel ?compatibleWith ?compatibleWithLabel ?inception ORDER BY ?projectLabel
Try it!