query: SELECT ?item ?itemLabel ?level ?rgb ?prop ?propLabel WHERE {
  {SELECT DISTINCT ?item ?level ?rgb ?class ?prop ?value WHERE {
    { {SELECT ?item ?level ?class ?rgb ?prop ?value WHERE { ?item wdt:P9622 []. ?item wdt:P31 ?class . 
                                              VALUES ?p { p:P4969 p:P747 p:P5059 p:P6524 p:P2550 p:P9745 p:P144 p:P629 p:P1433}
                                              hint:Query hint:optimizer "None" .
                                              ?item ?p ?stmt . ?prop wikibase:claim ?p .
                                              ?stmt ?v ?value. ?prop wikibase:statementProperty ?v. 
                                             } } BIND("work" AS ?level) BIND("ff0000" AS ?rgb) } UNION
  #  { {SELECT ?item ?level ?class ?rgb WHERE { ?publisher wdt:P9624 []. ?item wdt:P123 ?publisher ; p:P527 [ps:P527 ?p_series ; pq:P1545 ?series]. ?item wdt:P31 ?class .} } BIND("work" AS ?level) BIND("ff0000" AS ?rgb) } UNION
    { {SELECT ?item ?level ?class ?rgb ?prop ?value WHERE { ?work wdt:P9622 []. {?work wdt:P4969 ?item} UNION {?item wdt:P144 ?work} UNION {?item wdt:P6524 ?work}. 
                                              ?item wdt:P31 ?class .
                                              VALUES ?p { p:P4969 p:P144 p:P6524 }
                                              hint:Query hint:optimizer "None" .
                                              ?item ?p ?stmt . ?prop wikibase:claim ?p .
                                              ?stmt ?v ?value. ?prop wikibase:statementProperty ?v.                                           
                                             } } BIND("expression" AS ?level) BIND("008000" AS ?rgb) } UNION 
  #  { {SELECT ?item ?level ?class ?rgb WHERE { ?publisher wdt:P9624 []. ?periodical wdt:P123 ?publisher ; p:P527 [ps:P527 ?item ; pq:P1545 ?series]. ?item wdt:P31 ?class .
  #                                            VALUES ?p { ps:P527 }
  #                                            hint:Query hint:optimizer "None" .
  #                                            ?item ?p ?stmt . ?prop wikibase:claim ?p .
  #                                            ?stmt ?v ?value. ?prop wikibase:statementValue ?v.                                                                                      
  #                                           } } BIND("expression" AS ?level) BIND("008000" AS ?rgb) } UNION
    { {SELECT ?item ?level ?class ?rgb ?prop ?value WHERE { ?work wdt:P9622 []. {?work wdt:P4969 ?expression} UNION {?expression wdt:P144 ?work} UNION {?expression wdt:P6524 ?work}. 
                                              ?item ( wdt:P5059 | wdt:P9745 ) ?expression . ?item wdt:P31 ?class . 
                                              VALUES ?p { p:P5059 p:P9745 }
                                              hint:Query hint:optimizer "None" .
                                              ?item ?p ?stmt . ?prop wikibase:claim ?p .
                                              ?stmt ?v ?value. ?prop wikibase:statementProperty ?v.                                                                                      
                                             } } BIND("adaptation" AS ?level) BIND("ffffcc" AS ?rgb) } UNION
    { {SELECT ?item ?level ?class ?rgb ?prop ?value WHERE { ?work wdt:P9622 []. {?work wdt:P747 ?item . } UNION { ?item wdt:P629 ?work . } UNION {?item wdt:P2550 ?work} 
                                              ?item wdt:P31 ?class . 
                                              VALUES ?p { p:P747 p:P629 p:P2550 }
                                              hint:Query hint:optimizer "None" .
                                              ?item ?p ?stmt . ?prop wikibase:claim ?p .
                                              ?stmt ?v ?value. ?prop wikibase:statementProperty ?v.                                                                                      
                                             } } BIND("manifestation" AS ?level) BIND("0000ff" AS ?rgb) } UNION 
    { {SELECT ?item ?level ?class ?rgb ?prop ?value WHERE {?work wdt:P9622 []. {?work wdt:P4969 ?expression} UNION {?expression wdt:P144 ?work} UNION {?expression wdt:P6524 ?work} . 
                                              ?adaptation ( wdt:P5059 | wdt:P9745 ) ?expression .{?adaptation wdt:P747 ?item} UNION {?item wdt:P629 ?adaptation} UNION {?item wdt:P2550 ?adaptation} .
                                              ?item wdt:P31 ?class . 
                                              VALUES ?p { p:P747 p:P629 p:P2550 }
                                              hint:Query hint:optimizer "None" .
                                              ?item ?p ?stmt . ?prop wikibase:claim ?p .
                                              ?stmt ?v ?value. ?prop wikibase:statementProperty ?v.                                           
                                             } } BIND("manifestation" AS ?level) BIND("0000ff" AS ?rgb) } UNION 
    { {SELECT ?item ?level ?class ?rgb ?prop ?value WHERE { ?work wdt:P9622 []. {?work wdt:P4969 ?expression} UNION {?expression wdt:P144 ?work} UNION {?expression wdt:P6524 ?work}. 
                                              {?expression wdt:P747 ?item} UNION {?item wdt:P629 ?expression} UNION {?item wdt:P2550 ?expression} . 
                                              ?item wdt:P31 ?class . 
                                              VALUES ?p { p:P747 p:P629 p:P2550 }
                                              hint:Query hint:optimizer "None" .
                                              ?item ?p ?stmt . ?prop wikibase:claim ?p .
                                              ?stmt ?v ?value. ?prop wikibase:statementProperty ?v.
                                             } } BIND("manifestation" AS ?level) BIND("0000ff" AS ?rgb) }      
    } }
    SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
    }