query-da3c4fc78b62140003f2f41dcedc3455

rq turtle/ttl

table of contents of the Twenty-Six Histories

viewed as table (also viewable as image grid)

SELECT DISTINCT ?bookLabel ?volume ?partLabel ?part ?genreLabel ?main_subjectLabel ?main_subjectDescription ?image ?main_subject WHERE { # define ?book specifically as: ### Note: VALUES is used to give a specific list of the Twenty-Six Histories (cf. the general definition of the Twenty-Six Histories used in ### previous queries "Timeline of periods: Twenty-Six Histories civilizations" and "Timeline of points in time: publication dates of the Twenty-Six Histories") ### so that we can remove certain books from the list to have a table of contents for one or some specific books. # Records of the Grand Historian (Q272530), Book of Han (Q846905), Book of the Later Han (Q430428), Records of the Three Kingdoms (Q247318), Book of Jin (Q1154753) # Book of Song (Q1143142), Book of Southern Qi (Q1192857), Book of Liang (Q1285767), Book of Chen (Q1275744), Book of Wei (Q1269357) VALUES ?book {wd:Q272530 wd:Q846905 wd:Q430428 wd:Q247318 wd:Q1154753 wd:Q1143142 wd:Q1192857 wd:Q1285767 wd:Q1275744 wd:Q1269357 # Book of Northern Qi (Q1247505), Book of Zhou (Q1285731), Book of Sui (Q1156924), History of Southern Dynasties (Q1137686), History of Northern Dynasties (Q1188548) # Old Book of Tang (Q1146980), New Book of Tang (Q386073), Old History of the Five Dynasties (Q1333316), New History of the Five Dynasties (Q919488), History of Song (Q1147260) wd:Q1247505 wd:Q1285731 wd:Q1156924 wd:Q1137686 wd:Q1188548 wd:Q1146980 wd:Q386073 wd:Q1333316 wd:Q919488 wd:Q1147260 # History of Liao (Q1188539), History of Jin (Q637035), History of Yuan (Q1345223), History of Ming (Q28763) # New History of Yuan (Q1053256), Draft History of Qing (Q1374339) wd:Q1188539 wd:Q637035 wd:Q1345223 wd:Q28763 wd:Q1053256 wd:Q1374339} # optional: show ?part, which is part of (P361) or published in (P1433) [ZeroOrMorePath ()] ?book OPTIONAL {?part (wdt:P361|wdt:P1433) ?book # optional: show ?part's volume (P478) as ?volume OPTIONAL {?part wdt:P478 ?volume} # optional: show ?part's genre (P136) as ?genre OPTIONAL {?part wdt:P136 ?genre} # optional: show ?part's main subject (P921) as ?main_subject OPTIONAL {?part wdt:P921 ?main_subject # optional: show ?main_subject's image (P18) as ?image OPTIONAL {?main_subject wdt:P18 ?image} } } # show label in auto language as default, and English when no default label exists SERVICE wikibase:label {bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en".} }

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX bd: <http://www.bigdata.com/rdf#>
# table of contents of the Twenty-Six Histories
# viewed as table (also viewable as image grid)
SELECT DISTINCT ?bookLabel ?volume ?partLabel ?part ?genreLabel ?main_subjectLabel ?main_subjectDescription ?image ?main_subject
WHERE {
  # define ?book specifically as:
  ### Note: VALUES is used to give a specific list of the Twenty-Six Histories (cf. the general definition of the Twenty-Six Histories used in
  ### previous queries "Timeline of periods: Twenty-Six Histories civilizations" and "Timeline of points in time: publication dates of the Twenty-Six Histories")
  ### so that we can remove certain books from the list to have a table of contents for one or some specific books.
  # Records of the Grand Historian (Q272530), Book of Han (Q846905), Book of the Later Han (Q430428), Records of the Three Kingdoms (Q247318), Book of Jin (Q1154753)
  # Book of Song (Q1143142), Book of Southern Qi (Q1192857), Book of Liang (Q1285767), Book of Chen (Q1275744), Book of Wei (Q1269357)
  VALUES ?book {wd:Q272530 wd:Q846905 wd:Q430428 wd:Q247318 wd:Q1154753 wd:Q1143142 wd:Q1192857 wd:Q1285767 wd:Q1275744 wd:Q1269357
                # Book of Northern Qi (Q1247505), Book of Zhou (Q1285731), Book of Sui (Q1156924), History of Southern Dynasties (Q1137686), History of Northern Dynasties (Q1188548)
                # Old Book of Tang (Q1146980), New Book of Tang (Q386073), Old History of the Five Dynasties (Q1333316), New History of the Five Dynasties (Q919488), History of Song (Q1147260)
                wd:Q1247505 wd:Q1285731 wd:Q1156924 wd:Q1137686 wd:Q1188548 wd:Q1146980 wd:Q386073 wd:Q1333316 wd:Q919488 wd:Q1147260
                # History of Liao (Q1188539), History of Jin (Q637035), History of Yuan (Q1345223), History of Ming (Q28763)
                # New History of Yuan (Q1053256), Draft History of Qing (Q1374339)
                wd:Q1188539 wd:Q637035 wd:Q1345223 wd:Q28763 wd:Q1053256 wd:Q1374339}
  # optional: show ?part, which is part of (P361) or published in (P1433) [ZeroOrMorePath (*)] ?book
  OPTIONAL {?part (wdt:P361|wdt:P1433)* ?book
            # optional: show ?part's volume (P478) as ?volume
            OPTIONAL {?part wdt:P478 ?volume}
            # optional: show ?part's genre (P136) as ?genre
            OPTIONAL {?part wdt:P136 ?genre}
            # optional: show ?part's main subject (P921) as ?main_subject
            OPTIONAL {?part wdt:P921 ?main_subject
                     # optional: show ?main_subject's image (P18) as ?image
                      OPTIONAL {?main_subject wdt:P18 ?image} } }
  # show label in auto language as default, and English when no default label exists
  SERVICE wikibase:label {bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en".}
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v1("?book") v4("?genre") v6("?image"):::projected v5("?main_subject"):::projected v2("?part"):::projected v3("?volume"):::projected c8(["bd:serviceParam"]):::iri c10(["#91;AUTO_LANGUAGE#93;,en"]):::literal bind0[/VALUES ?book/] bind0-->v1 bind00(["wd:Q272530"]) bind00 --> bind0 bind01(["wd:Q846905"]) bind01 --> bind0 bind02(["wd:Q430428"]) bind02 --> bind0 bind03(["wd:Q247318"]) bind03 --> bind0 bind04(["wd:Q1154753"]) bind04 --> bind0 bind05(["wd:Q1143142"]) bind05 --> bind0 bind06(["wd:Q1192857"]) bind06 --> bind0 bind07(["wd:Q1285767"]) bind07 --> bind0 bind08(["wd:Q1275744"]) bind08 --> bind0 bind09(["wd:Q1269357"]) bind09 --> bind0 bind010(["wd:Q1247505"]) bind010 --> bind0 bind011(["wd:Q1285731"]) bind011 --> bind0 bind012(["wd:Q1156924"]) bind012 --> bind0 bind013(["wd:Q1137686"]) bind013 --> bind0 bind014(["wd:Q1188548"]) bind014 --> bind0 bind015(["wd:Q1146980"]) bind015 --> bind0 bind016(["wd:Q386073"]) bind016 --> bind0 bind017(["wd:Q1333316"]) bind017 --> bind0 bind018(["wd:Q919488"]) bind018 --> bind0 bind019(["wd:Q1147260"]) bind019 --> bind0 bind020(["wd:Q1188539"]) bind020 --> bind0 bind021(["wd:Q637035"]) bind021 --> bind0 bind022(["wd:Q1345223"]) bind022 --> bind0 bind023(["wd:Q28763"]) bind023 --> bind0 bind024(["wd:Q1053256"]) bind024 --> bind0 bind025(["wd:Q1374339"]) bind025 --> bind0 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; subgraph union0[" Union "] subgraph union0l[" "] style union0l fill:#abf,stroke-dasharray: 3 3; v2 -."wdt:P1433".-> v1 end subgraph union0r[" "] style union0r fill:#abf,stroke-dasharray: 3 3; v2 --"wdt:P361"--> v1 end union0r <== or ==> union0l end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v2 -."wdt:P478".-> v3 end subgraph optional2["(optional)"] style optional2 fill:#bbf,stroke-dasharray: 5 5; v2 -."wdt:P136".-> v4 end subgraph optional3["(optional)"] style optional3 fill:#bbf,stroke-dasharray: 5 5; v2 -."wdt:P921".-> v5 subgraph optional4["(optional)"] style optional4 fill:#bbf,stroke-dasharray: 5 5; v5 -."wdt:P18".-> v6 end end end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c8 --"wikibase:language"--> c10 end