query-258d8544f3059410c400d7793498fef8

rq turtle/ttl

Publishers, etc. SELECT ?publisher ?publisherLabel ?publisherDescription (COUNT(DISTINCT ?label) AS ?numLabel) ?sitelinks ?inception ?dissolved (COUNT(DISTINCT ?subsidiary) AS ?numSubsidiaries) WHERE { VALUES ?type { wd:Q2085381 # publisher wd:Q2608849 # imprint wd:Q18127 # record label } ?publisher wdt:P31/wdt:P279 ?type; wikibase:sitelinks ?sitelinks. OPTIONAL {?publisher rdfs:label|skos:altLabel ?label} OPTIONAL {?publisher wdt:P571 ?inception} OPTIONAL {?publisher wdt:P576 ?dissolved} OPTIONAL {?publisher wdt:P355 ?subsidiary} SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en,de,fr,ja,es,eo,ru,it". } } GROUP BY ?publisher ?publisherLabel ?publisherDescription ?inception ?dissolved ?sitelinks ORDER BY DESC(?sitelinks)

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX bd: <http://www.bigdata.com/rdf#>
#Publishers, etc.
SELECT ?publisher ?publisherLabel ?publisherDescription (COUNT(DISTINCT ?label) AS ?numLabel) ?sitelinks ?inception ?dissolved (COUNT(DISTINCT ?subsidiary) AS ?numSubsidiaries)
WHERE 
{
  VALUES ?type {
    wd:Q2085381  # publisher
    wd:Q2608849  # imprint
    wd:Q18127  # record label
    }
  ?publisher wdt:P31/wdt:P279 ?type;
             wikibase:sitelinks ?sitelinks.
  OPTIONAL {?publisher rdfs:label|skos:altLabel ?label}
  OPTIONAL {?publisher wdt:P571 ?inception}
  OPTIONAL {?publisher wdt:P576 ?dissolved}
  OPTIONAL {?publisher wdt:P355 ?subsidiary}
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en,de,fr,ja,es,eo,ru,it". }
}
GROUP BY ?publisher ?publisherLabel ?publisherDescription ?inception ?dissolved ?sitelinks
ORDER BY DESC(?sitelinks)

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v6("?dissolved"):::projected v5("?inception"):::projected v4("?label"):::projected v8("?numLabel") v9("?numSubsidiaries") v3("?publisher"):::projected v1("?sitelinks"):::projected v7("?subsidiary"):::projected v2("?type") a1((" ")) c12(["#91;AUTO_LANGUAGE#93;,en,de,fr,ja,es,eo,ru,it"]):::literal c10(["bd:serviceParam"]):::iri bind0[/VALUES ?type/] bind0-->v2 bind00(["wd:Q2085381"]) bind00 --> bind0 bind01(["wd:Q2608849"]) bind01 --> bind0 bind02(["wd:Q18127"]) bind02 --> bind0 v3 --"wdt:P31"--> a1 a1 --"wdt:P279"--> v2 v3 --"wikibase:sitelinks"--> v1 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; subgraph union0[" Union "] subgraph union0l[" "] style union0l fill:#abf,stroke-dasharray: 3 3; v3 -."skos:altLabel".-> v4 end subgraph union0r[" "] style union0r fill:#abf,stroke-dasharray: 3 3; v3 --"rdfs:label"--> v4 end union0r <== or ==> union0l end end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v3 -."wdt:P571".-> v5 end subgraph optional2["(optional)"] style optional2 fill:#bbf,stroke-dasharray: 5 5; v3 -."wdt:P576".-> v6 end subgraph optional3["(optional)"] style optional3 fill:#bbf,stroke-dasharray: 5 5; v3 -."wdt:P355".-> v7 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c10 --"wikibase:language"--> c12 end bind3[/"count(?label)"/] v4 --o bind3 bind3 --as--o v8 bind4[/"count(?subsidiary)"/] v7 --o bind4 bind4 --as--o v9