query-93b13467b08ec86b8d526b1bbe998c1f
(60) Map: narrative locations in Water Margin chapters layered by part or chapter number or protagonist or title characterNo.60 (2021.02.13T1452 created)
Use at
- https://query.wikidata.org/sparql
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
# map of narrative locations in Water Margin chapters (also viewable as table and image grid)
# layered by ?part (replaceable by ?chapter_number or ?protagonistLabel or ?title_characterLabel)
#defaultView:Map{"layer":"?part"}
SELECT DISTINCT ?chapter ?chapter_number ?part ?location ?locationLabel ?image ?coord ?protagonist ?protagonistLabel ?title_character ?title_characterLabel
WHERE {
# ?chapter is instance of (P31) chapter (Q1980247)
?chapter wdt:P31 wd:Q1980247;
# and is part of (P361) [OneOrMorePath (+)] Water Margin's 120-chapter edition (Q70761009)
wdt:P361+ wd:Q70761009
# optional: ?chapter's chapter (P792) is ?number
OPTIONAL {?chapter wdt:P792 ?number}
# use IF to bind ?number's 3-character form as ?chapter_number:
# if ?number has 1 character, concatenate "00" and it;
BIND(IF(STRLEN(?number)=1, CONCAT("00", ?number),
# if ?number has 2 characters, concatenate "0" and it;
IF(STRLEN(?number)=2, CONCAT("0", ?number),
# otherwise (?number has 3 characters), don't change it
?number)) AS ?chapter_number)
# optional: use VALUES to divide chapters (?chapter_number) into groups (?part)
# by defining "?chapter_number, ?part" as
OPTIONAL {VALUES (?chapter_number ?part)
# 001, 00引子
{("001" "00引子")
# 002-003, 01王进史进
("002" "01王进史进")
("003" "01王进史进")
# 003-007, 02鲁智深
("003" "02鲁智深")
("004" "02鲁智深")
("005" "02鲁智深")
("006" "02鲁智深")
("007" "02鲁智深")
# 007-012, 03林冲
("007" "03林冲")
("008" "03林冲")
("009" "03林冲")
("010" "03林冲")
("011" "03林冲")
("012" "03林冲")
# 013-022, 04生辰纲
("013" "04生辰纲")
("014" "04生辰纲")
("015" "04生辰纲")
("016" "04生辰纲")
("016" "04生辰纲")
("017" "04生辰纲")
("017" "04生辰纲")
("018" "04生辰纲")
("018" "04生辰纲")
("019" "04生辰纲")
("020" "04生辰纲")
("020" "04生辰纲")
("021" "04生辰纲")
("022" "04生辰纲")
# 023-032, 05武松
("023" "05武松")
("024" "05武松")
("025" "05武松")
("026" "05武松")
("027" "05武松")
("028" "05武松")
("029" "05武松")
("030" "05武松")
("031" "05武松")
("032" "05武松")
# 032-042, 06宋江落草
("032" "06宋江落草")
("033" "06宋江落草")
("034" "06宋江落草")
("035" "06宋江落草")
("036" "06宋江落草")
("037" "06宋江落草")
("038" "06宋江落草")
("039" "06宋江落草")
("040" "06宋江落草")
("041" "06宋江落草")
("042" "06宋江落草")
# 043, 07李逵下山
("043" "07李逵下山")
# 044-046, 08杨雄石秀
("044" "08杨雄石秀")
("045" "08杨雄石秀")
("046" "08杨雄石秀")
# 047-050, 09祝家庄
("047" "09祝家庄")
("048" "09祝家庄")
("049" "09祝家庄")
("050" "09祝家庄")
# 051-054, 10朱仝柴进
("051" "10朱仝柴进")
("052" "10朱仝柴进")
("053" "10朱仝柴进")
("054" "10朱仝柴进")
# 055-058, 11呼延灼
("055" "11呼延灼")
("056" "11呼延灼")
("057" "11呼延灼")
("058" "11呼延灼")
# 058-059, 12救史进
("058" "12救史进")
("059" "12救史进")
# 059-060, 13芒砀山曾头市
("059" "13芒砀山曾头市")
("060" "13芒砀山曾头市")
# 061-066, 14卢俊义
("061" "14卢俊义")
("062" "14卢俊义")
("063" "14卢俊义")
("064" "14卢俊义")
("065" "14卢俊义")
("066" "14卢俊义")
# 067, 15水火将
("067" "15水火将")
# 068, 16史文恭
("068" "16史文恭")
# 069-070, 17董平张清
("069" "17董平张清")
("070" "17董平张清")
# 071, 18排座次
("071" "18排座次")
# 072-074, 19好汉下山
("072" "19好汉下山")
("073" "19好汉下山")
("074" "19好汉下山")
# 075-082, 20招安
("075" "20招安")
("076" "20招安")
("077" "20招安")
("078" "20招安")
("079" "20招安")
("080" "20招安")
("081" "20招安")
("082" "20招安")
# 083-090, 21征辽
("083" "21征辽")
("084" "21征辽")
("085" "21征辽")
("086" "21征辽")
("087" "21征辽")
("088" "21征辽")
("089" "21征辽")
("090" "21征辽")
# 091-100, 22征田虎
("091" "22征田虎")
("092" "22征田虎")
("093" "22征田虎")
("094" "22征田虎")
("095" "22征田虎")
("096" "22征田虎")
("097" "22征田虎")
("098" "22征田虎")
("099" "22征田虎")
("100" "22征田虎")
# 101-110, 23征王庆
("101" "23征王庆")
("102" "23征王庆")
("103" "23征王庆")
("104" "23征王庆")
("105" "23征王庆")
("106" "23征王庆")
("107" "23征王庆")
("108" "23征王庆")
("109" "23征王庆")
("110" "23征王庆")
# 111-119, 24征方腊
("111" "24征方腊")
("112" "24征方腊")
("113" "24征方腊")
("114" "24征方腊")
("115" "24征方腊")
("116" "24征方腊")
("117" "24征方腊")
("118" "24征方腊")
("119" "24征方腊")
# 120, 25大结局
("120" "25大结局")} }
# optional: show ?chapter's narrative location (P840) as ?location
OPTIONAL {?chapter wdt:P840 ?location
# optional: show ?location's coordinate location (P625) as ?coord
OPTIONAL {?location wdt:P625 ?coord}
# optional: show ?location's image (P625) as ?image
OPTIONAL {?location wdt:P18 ?image}
}
# optional: ?chapter's "characters" (P674) statement is ?x1
OPTIONAL {?chapter p:P674 ?x1.
# ?x1's value is ?protagonist
?x1 ps:P674 ?protagonist;
# ?x1's qualifier "narrative role" (P5800) is protagonist (Q215972)
pq:P5800 wd:Q215972}
# optional: ?chapter's "characters" (P674) statement is ?x2
OPTIONAL {?chapter p:P674 ?x2.
# ?x2's value is ?title_character
?x2 ps:P674 ?title_character;
# x2's qualifier "narrative role" (P5800) is title character (Q3246821)
pq:P5800 wd:Q3246821}
# show label in auto language as default, and English when no default label exists
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
# order layer by ?chapter_number (replaceable by ?protagonistLabel or ?title_characterLabel)
### Note: When layered by ?part, ORDER BY can only use ?chapter_number,
### otherwise ?part for ?chapter_number 001-099 will disappear for unknown reason.
ORDER BY ?chapter_number
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v2("?chapter"):::projected
v4("?chapter_number"):::projected
v6("?coord"):::projected
v7("?image"):::projected
v5("?location"):::projected
v3("?number")
v4("?part"):::projected
v9("?protagonist"):::projected
v11("?title_character"):::projected
v8("?x1")
v10("?x2")
c13(["wd:Q3246821"]):::iri
c15(["bd:serviceParam"]):::iri
c12(["wd:Q215972"]):::iri
c17(["#91;AUTO_LANGUAGE#93;,en"]):::literal
c2(["wd:Q1980247"]):::iri
c4(["wd:Q70761009"]):::iri
v2 --"p:direct/P31"--> c2
v2 --"p:direct/P361"--> c4
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v2 -."p:direct/P792".-> v3
end
bind0[/"if(string-length(?number) = '1^^xsd:integer',concat('00',?number),if(string-length(?number) = '2^^xsd:integer',concat('0',?number),?number))"/]
v3 --o bind0
bind0 --as--o v4
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
bind1[/VALUES ?chapter_number ?part/]
bind1-->v4
bind1-->v4
bind10(["001"])
bind10 --> bind1
bind11(["00引子"])
bind11 --> bind1
bind12(["002"])
bind12 --> bind1
bind13(["01王进史进"])
bind13 --> bind1
bind14(["003"])
bind14 --> bind1
bind15(["01王进史进"])
bind15 --> bind1
bind16(["003"])
bind16 --> bind1
bind17(["02鲁智深"])
bind17 --> bind1
bind18(["004"])
bind18 --> bind1
bind19(["02鲁智深"])
bind19 --> bind1
bind110(["005"])
bind110 --> bind1
bind111(["02鲁智深"])
bind111 --> bind1
bind112(["006"])
bind112 --> bind1
bind113(["02鲁智深"])
bind113 --> bind1
bind114(["007"])
bind114 --> bind1
bind115(["02鲁智深"])
bind115 --> bind1
bind116(["007"])
bind116 --> bind1
bind117(["03林冲"])
bind117 --> bind1
bind118(["008"])
bind118 --> bind1
bind119(["03林冲"])
bind119 --> bind1
bind120(["009"])
bind120 --> bind1
bind121(["03林冲"])
bind121 --> bind1
bind122(["010"])
bind122 --> bind1
bind123(["03林冲"])
bind123 --> bind1
bind124(["011"])
bind124 --> bind1
bind125(["03林冲"])
bind125 --> bind1
bind126(["012"])
bind126 --> bind1
bind127(["03林冲"])
bind127 --> bind1
bind128(["013"])
bind128 --> bind1
bind129(["04生辰纲"])
bind129 --> bind1
bind130(["014"])
bind130 --> bind1
bind131(["04生辰纲"])
bind131 --> bind1
bind132(["015"])
bind132 --> bind1
bind133(["04生辰纲"])
bind133 --> bind1
bind134(["016"])
bind134 --> bind1
bind135(["04生辰纲"])
bind135 --> bind1
bind136(["016"])
bind136 --> bind1
bind137(["04生辰纲"])
bind137 --> bind1
bind138(["017"])
bind138 --> bind1
bind139(["04生辰纲"])
bind139 --> bind1
bind140(["017"])
bind140 --> bind1
bind141(["04生辰纲"])
bind141 --> bind1
bind142(["018"])
bind142 --> bind1
bind143(["04生辰纲"])
bind143 --> bind1
bind144(["018"])
bind144 --> bind1
bind145(["04生辰纲"])
bind145 --> bind1
bind146(["019"])
bind146 --> bind1
bind147(["04生辰纲"])
bind147 --> bind1
bind148(["020"])
bind148 --> bind1
bind149(["04生辰纲"])
bind149 --> bind1
bind150(["020"])
bind150 --> bind1
bind151(["04生辰纲"])
bind151 --> bind1
bind152(["021"])
bind152 --> bind1
bind153(["04生辰纲"])
bind153 --> bind1
bind154(["022"])
bind154 --> bind1
bind155(["04生辰纲"])
bind155 --> bind1
bind156(["023"])
bind156 --> bind1
bind157(["05武松"])
bind157 --> bind1
bind158(["024"])
bind158 --> bind1
bind159(["05武松"])
bind159 --> bind1
bind160(["025"])
bind160 --> bind1
bind161(["05武松"])
bind161 --> bind1
bind162(["026"])
bind162 --> bind1
bind163(["05武松"])
bind163 --> bind1
bind164(["027"])
bind164 --> bind1
bind165(["05武松"])
bind165 --> bind1
bind166(["028"])
bind166 --> bind1
bind167(["05武松"])
bind167 --> bind1
bind168(["029"])
bind168 --> bind1
bind169(["05武松"])
bind169 --> bind1
bind170(["030"])
bind170 --> bind1
bind171(["05武松"])
bind171 --> bind1
bind172(["031"])
bind172 --> bind1
bind173(["05武松"])
bind173 --> bind1
bind174(["032"])
bind174 --> bind1
bind175(["05武松"])
bind175 --> bind1
bind176(["032"])
bind176 --> bind1
bind177(["06宋江落草"])
bind177 --> bind1
bind178(["033"])
bind178 --> bind1
bind179(["06宋江落草"])
bind179 --> bind1
bind180(["034"])
bind180 --> bind1
bind181(["06宋江落草"])
bind181 --> bind1
bind182(["035"])
bind182 --> bind1
bind183(["06宋江落草"])
bind183 --> bind1
bind184(["036"])
bind184 --> bind1
bind185(["06宋江落草"])
bind185 --> bind1
bind186(["037"])
bind186 --> bind1
bind187(["06宋江落草"])
bind187 --> bind1
bind188(["038"])
bind188 --> bind1
bind189(["06宋江落草"])
bind189 --> bind1
bind190(["039"])
bind190 --> bind1
bind191(["06宋江落草"])
bind191 --> bind1
bind192(["040"])
bind192 --> bind1
bind193(["06宋江落草"])
bind193 --> bind1
bind194(["041"])
bind194 --> bind1
bind195(["06宋江落草"])
bind195 --> bind1
bind196(["042"])
bind196 --> bind1
bind197(["06宋江落草"])
bind197 --> bind1
bind198(["043"])
bind198 --> bind1
bind199(["07李逵下山"])
bind199 --> bind1
bind1100(["044"])
bind1100 --> bind1
bind1101(["08杨雄石秀"])
bind1101 --> bind1
bind1102(["045"])
bind1102 --> bind1
bind1103(["08杨雄石秀"])
bind1103 --> bind1
bind1104(["046"])
bind1104 --> bind1
bind1105(["08杨雄石秀"])
bind1105 --> bind1
bind1106(["047"])
bind1106 --> bind1
bind1107(["09祝家庄"])
bind1107 --> bind1
bind1108(["048"])
bind1108 --> bind1
bind1109(["09祝家庄"])
bind1109 --> bind1
bind1110(["049"])
bind1110 --> bind1
bind1111(["09祝家庄"])
bind1111 --> bind1
bind1112(["050"])
bind1112 --> bind1
bind1113(["09祝家庄"])
bind1113 --> bind1
bind1114(["051"])
bind1114 --> bind1
bind1115(["10朱仝柴进"])
bind1115 --> bind1
bind1116(["052"])
bind1116 --> bind1
bind1117(["10朱仝柴进"])
bind1117 --> bind1
bind1118(["053"])
bind1118 --> bind1
bind1119(["10朱仝柴进"])
bind1119 --> bind1
bind1120(["054"])
bind1120 --> bind1
bind1121(["10朱仝柴进"])
bind1121 --> bind1
bind1122(["055"])
bind1122 --> bind1
bind1123(["11呼延灼"])
bind1123 --> bind1
bind1124(["056"])
bind1124 --> bind1
bind1125(["11呼延灼"])
bind1125 --> bind1
bind1126(["057"])
bind1126 --> bind1
bind1127(["11呼延灼"])
bind1127 --> bind1
bind1128(["058"])
bind1128 --> bind1
bind1129(["11呼延灼"])
bind1129 --> bind1
bind1130(["058"])
bind1130 --> bind1
bind1131(["12救史进"])
bind1131 --> bind1
bind1132(["059"])
bind1132 --> bind1
bind1133(["12救史进"])
bind1133 --> bind1
bind1134(["059"])
bind1134 --> bind1
bind1135(["13芒砀山曾头市"])
bind1135 --> bind1
bind1136(["060"])
bind1136 --> bind1
bind1137(["13芒砀山曾头市"])
bind1137 --> bind1
bind1138(["061"])
bind1138 --> bind1
bind1139(["14卢俊义"])
bind1139 --> bind1
bind1140(["062"])
bind1140 --> bind1
bind1141(["14卢俊义"])
bind1141 --> bind1
bind1142(["063"])
bind1142 --> bind1
bind1143(["14卢俊义"])
bind1143 --> bind1
bind1144(["064"])
bind1144 --> bind1
bind1145(["14卢俊义"])
bind1145 --> bind1
bind1146(["065"])
bind1146 --> bind1
bind1147(["14卢俊义"])
bind1147 --> bind1
bind1148(["066"])
bind1148 --> bind1
bind1149(["14卢俊义"])
bind1149 --> bind1
bind1150(["067"])
bind1150 --> bind1
bind1151(["15水火将"])
bind1151 --> bind1
bind1152(["068"])
bind1152 --> bind1
bind1153(["16史文恭"])
bind1153 --> bind1
bind1154(["069"])
bind1154 --> bind1
bind1155(["17董平张清"])
bind1155 --> bind1
bind1156(["070"])
bind1156 --> bind1
bind1157(["17董平张清"])
bind1157 --> bind1
bind1158(["071"])
bind1158 --> bind1
bind1159(["18排座次"])
bind1159 --> bind1
bind1160(["072"])
bind1160 --> bind1
bind1161(["19好汉下山"])
bind1161 --> bind1
bind1162(["073"])
bind1162 --> bind1
bind1163(["19好汉下山"])
bind1163 --> bind1
bind1164(["074"])
bind1164 --> bind1
bind1165(["19好汉下山"])
bind1165 --> bind1
bind1166(["075"])
bind1166 --> bind1
bind1167(["20招安"])
bind1167 --> bind1
bind1168(["076"])
bind1168 --> bind1
bind1169(["20招安"])
bind1169 --> bind1
bind1170(["077"])
bind1170 --> bind1
bind1171(["20招安"])
bind1171 --> bind1
bind1172(["078"])
bind1172 --> bind1
bind1173(["20招安"])
bind1173 --> bind1
bind1174(["079"])
bind1174 --> bind1
bind1175(["20招安"])
bind1175 --> bind1
bind1176(["080"])
bind1176 --> bind1
bind1177(["20招安"])
bind1177 --> bind1
bind1178(["081"])
bind1178 --> bind1
bind1179(["20招安"])
bind1179 --> bind1
bind1180(["082"])
bind1180 --> bind1
bind1181(["20招安"])
bind1181 --> bind1
bind1182(["083"])
bind1182 --> bind1
bind1183(["21征辽"])
bind1183 --> bind1
bind1184(["084"])
bind1184 --> bind1
bind1185(["21征辽"])
bind1185 --> bind1
bind1186(["085"])
bind1186 --> bind1
bind1187(["21征辽"])
bind1187 --> bind1
bind1188(["086"])
bind1188 --> bind1
bind1189(["21征辽"])
bind1189 --> bind1
bind1190(["087"])
bind1190 --> bind1
bind1191(["21征辽"])
bind1191 --> bind1
bind1192(["088"])
bind1192 --> bind1
bind1193(["21征辽"])
bind1193 --> bind1
bind1194(["089"])
bind1194 --> bind1
bind1195(["21征辽"])
bind1195 --> bind1
bind1196(["090"])
bind1196 --> bind1
bind1197(["21征辽"])
bind1197 --> bind1
bind1198(["091"])
bind1198 --> bind1
bind1199(["22征田虎"])
bind1199 --> bind1
bind1200(["092"])
bind1200 --> bind1
bind1201(["22征田虎"])
bind1201 --> bind1
bind1202(["093"])
bind1202 --> bind1
bind1203(["22征田虎"])
bind1203 --> bind1
bind1204(["094"])
bind1204 --> bind1
bind1205(["22征田虎"])
bind1205 --> bind1
bind1206(["095"])
bind1206 --> bind1
bind1207(["22征田虎"])
bind1207 --> bind1
bind1208(["096"])
bind1208 --> bind1
bind1209(["22征田虎"])
bind1209 --> bind1
bind1210(["097"])
bind1210 --> bind1
bind1211(["22征田虎"])
bind1211 --> bind1
bind1212(["098"])
bind1212 --> bind1
bind1213(["22征田虎"])
bind1213 --> bind1
bind1214(["099"])
bind1214 --> bind1
bind1215(["22征田虎"])
bind1215 --> bind1
bind1216(["100"])
bind1216 --> bind1
bind1217(["22征田虎"])
bind1217 --> bind1
bind1218(["101"])
bind1218 --> bind1
bind1219(["23征王庆"])
bind1219 --> bind1
bind1220(["102"])
bind1220 --> bind1
bind1221(["23征王庆"])
bind1221 --> bind1
bind1222(["103"])
bind1222 --> bind1
bind1223(["23征王庆"])
bind1223 --> bind1
bind1224(["104"])
bind1224 --> bind1
bind1225(["23征王庆"])
bind1225 --> bind1
bind1226(["105"])
bind1226 --> bind1
bind1227(["23征王庆"])
bind1227 --> bind1
bind1228(["106"])
bind1228 --> bind1
bind1229(["23征王庆"])
bind1229 --> bind1
bind1230(["107"])
bind1230 --> bind1
bind1231(["23征王庆"])
bind1231 --> bind1
bind1232(["108"])
bind1232 --> bind1
bind1233(["23征王庆"])
bind1233 --> bind1
bind1234(["109"])
bind1234 --> bind1
bind1235(["23征王庆"])
bind1235 --> bind1
bind1236(["110"])
bind1236 --> bind1
bind1237(["23征王庆"])
bind1237 --> bind1
bind1238(["111"])
bind1238 --> bind1
bind1239(["24征方腊"])
bind1239 --> bind1
bind1240(["112"])
bind1240 --> bind1
bind1241(["24征方腊"])
bind1241 --> bind1
bind1242(["113"])
bind1242 --> bind1
bind1243(["24征方腊"])
bind1243 --> bind1
bind1244(["114"])
bind1244 --> bind1
bind1245(["24征方腊"])
bind1245 --> bind1
bind1246(["115"])
bind1246 --> bind1
bind1247(["24征方腊"])
bind1247 --> bind1
bind1248(["116"])
bind1248 --> bind1
bind1249(["24征方腊"])
bind1249 --> bind1
bind1250(["117"])
bind1250 --> bind1
bind1251(["24征方腊"])
bind1251 --> bind1
bind1252(["118"])
bind1252 --> bind1
bind1253(["24征方腊"])
bind1253 --> bind1
bind1254(["119"])
bind1254 --> bind1
bind1255(["24征方腊"])
bind1255 --> bind1
bind1256(["120"])
bind1256 --> bind1
bind1257(["25大结局"])
bind1257 --> bind1
end
subgraph optional2["(optional)"]
style optional2 fill:#bbf,stroke-dasharray: 5 5;
v2 -."p:direct/P840".-> v5
subgraph optional3["(optional)"]
style optional3 fill:#bbf,stroke-dasharray: 5 5;
v5 -."p:direct/P625".-> v6
end
subgraph optional4["(optional)"]
style optional4 fill:#bbf,stroke-dasharray: 5 5;
v5 -."p:direct/P18".-> v7
end
end
subgraph optional5["(optional)"]
style optional5 fill:#bbf,stroke-dasharray: 5 5;
v2 -."p:P674".-> v8
v8 --"p:statement/P674"--> v9
v8 --"p:qualifier/P5800"--> c12
end
subgraph optional6["(optional)"]
style optional6 fill:#bbf,stroke-dasharray: 5 5;
v2 -."p:P674".-> v10
v10 --"p:statement/P674"--> v11
v10 --"p:qualifier/P5800"--> c13
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c15 --"wikibase:language"--> c17
end