행위

"RCCTD(2025)WikiDataQueries"의 두 판 사이의 차이

CNUDH

(② 당나라 인물들의 출생지별 좌표맵 찾기)
(CulturalHeritage)
148번째 줄: 148번째 줄:
 
</font>
 
</font>
  
 +
<big>
 +
==='''<span style="color:#3CB371">① 유네스코 세계유산에 등재된 중국의 문화재 찾기</span>'''===
 +
<div style="float:center; background:#3CB371; width:100%; height:1px; text-align:right; padding:2px 2px 2px;"></div><br/>
 +
<i><span style="color:grey">#defaultView:ImageGrid</span></i><br/>
 +
<span style="color:red"><b>SELECT</b></span> <span style="color:green">?heritage ?heritageLabel</span> (<span style="color:red">SAMPLE</span> (<span style="color:green">?location</span>) <span style="color:red">AS</span> <span style="color:green">?Location</span>) (<span style="color:red">SAMPLE</span> (<span style="color:green">?image</span>) <span style="color:red">AS</span> <span style="color:green">?Image</span>)<br/>
 +
<span style="color:red"><b>WHERE</b></span> {<br/>
 +
: <span style="color:green">?heritage</span> <span style="color:blue">wdt:P1435 wd:Q9259</span>.<br/>
 +
: <span style="color:red"><b>VALUES</b></span> <span style="color:green">?china</span> { <span style="color:blue">wd:Q148 wd:Q29520</span> }<br/>
 +
: <span style="color:green">?heritage</span> <span style="color:blue">wdt:P17</span> <span style="color:green">?china</span>;<br/>
 +
: <span style="color:blue">wdt:P625</span> <span style="color:green">?location</span>.<br/>
 +
: <span style="color:red"><b>OPTIONAL</b></span> { <span style="color:green">?heritage</span> <span style="color:blue">wdt:P18</span> <span style="color:green">?image</span>. }<br/>
 +
: <span style="color:red"><b>SERVICE</b></span> <span style="color:blue">wikibase:label</span> { <span style="color:blue">bd:serviceParam wikibase:language</span> <span style="color:orange">"ko, en"</span>. }<br/>
 +
}<br/>
 +
<span style="color:red"><b>GROUP BY</b></span> <span style="color:green">?heritage ?heritageLabel</span>
 +
</big>
 +
<br/><br/><br/>
 +
 +
<big>
 +
==='''<span style="color:#3CB371">② 당나라 황제의 무덤과 능묘의 이미지, 좌표 찾기</span>'''===
 +
<div style="float:center; background:#3CB371; width:100%; height:1px; text-align:right; padding:2px 2px 2px;"></div><br/>
 +
<span style="color:red"><b>SELECT</b></span> <span style="color:green">?tomb ?tombLabel ?coordinates ?emperorLabel</span><br/>
 +
<span style="color:red"><b>WHERE</b></span> {<br/>
 +
: <span style="color:green">?emperor</span> <span style="color:blue">p:P39</span> <span style="color:green">?position</span>.<br/> &nbsp;&nbsp;&nbsp; <i><span style="color:grey">#?emperor가 ?position을 가진다</span></i>
 +
: <span style="color:green">?position</span> <span style="color:blue">ps:P39 wd:Q268218</span>.<br/> &nbsp;&nbsp;&nbsp; <i><span style="color:grey">#?position은 중국의 황제다</span></i>
 +
: <span style="color:green">?position</span> <span style="color:blue">pq:P1001 wd:Q9683</span>.<br/> &nbsp;&nbsp;&nbsp; <i><span style="color:grey">#?position의 관할권은 당나라다</span></i>
 +
: <span style="color:green">?emperor</span> <span style="color:blue">wdt:P119</span> <span style="color:green">?tomb</span>.<br/>
 +
: <span style="color:green">?tomb</span> <span style="color:blue">wdt:P625</span> <span style="color:green">?coordinates</span>.<br/>
 +
<span style="color:red"><b>SERVICE</b></span> <span style="color:blue">wikibase:label</span> { <span style="color:blue">bd:serviceParam wikibase:language</span> <span style="color:orange">"ko,en,zh"</span>. } <br/>
 +
}<br/>
 +
</big>
 
<br/><br/><br/>
 
<br/><br/><br/>
  

2025년 11월 10일 (월) 17:22 판

데이터로 읽는 중국문화(강의) 페이지로 가기



WikiData Query 샘플

: 중국 문화를 중심으로





목차

Contents


인물 관련 질의어 사건 관련 질의어 장소 관련 질의어 문화유산 관련 질의어 조합



Person


① 한글 명칭으로 특정 인물(예:마오쩌둥) 찾기


SELECT ?person ?personLabel
WHERE {
?person rdfs:label "마오쩌둥"@ko.
SERVICE wikibase:label { bd:serviceParam wikibase:language
"[AUTO_LANGUAGE],ko,en". }
}



② 기본 정보(생몰년, 출생지)를 포함한 당나라 시대 사람들 찾기


SELECT ?person ?personLabel ?birth ?death ?birthplaceLabel ?occupationLabel
WHERE {
?person wdt:P27 wd:Q9683.      # 국적: 당나라

OPTIONAL { ?person wdt:P569 ?birth. }
OPTIONAL { ?person wdt:P570 ?death. }
OPTIONAL { ?person wdt:P19 ?birthplace. }
OPTIONAL { ?person wdt:P106 ?occupation. }

SERVICE wikibase:label { bd:serviceParam wikibase:language "zh, en". }
}
LIMIT 100



③ 1950년 이후의 드라마와 영화에 가장 많이 출연한 인물 찾기


#defaultView:BubbleChart
SELECT ?person (COUNT(?work) AS ?count) ?personLabel
WHERE {

VALUES ?type { wd:Q11424 wd:Q5398426 }
?work wdt:P31 ?type.
?work wdt:P577 ?date.
FILTER (YEAR(?date) >= 1950)
?work wdt:P161 ?person.
?person wdt:P27 wd:Q148.
SERVICE wikibase:label { bd:serviceParam wikibase:language "zh, ko, en". }
}

GROUP BY ?person ?personLabel
ORDER BY DESC(?count)
LIMIT 50




Event


① 중국에서 발생한 운동(Campaign) 찾기


SELECT  ?campaign ?campaignLabel ?start ?end
WHERE {

?campaign wdt:P31/wdt:P279* wd:Q6056746;
wdt:P17 wd:Q148.
OPTIONAL { ?campaign wdt:P580 ?start. }
OPTIONAL { ?campaign wdt:P582 ?end. }
SERVICE wikibase:label { bd:serviceParam wikibase:language "ko, zh, en" . }
}




② 당나라의 주요 사건을 타임라인으로 보기


#defaultView:Timeline
SELECT ?event ?eventLabel ?date ?image
WHERE {

?event wdt:P585 ?date.   #특정 시점
?event wdt:P17|wdt:P276/wdt:P17 wd:Q148.    #중국 관련
FILTER(YEAR(?date) >= 618 && YEAR(?date) <= 907)    # 당나라 시기
OPTIONAL { ?event wdt:P18 ?image. }
SERVICE wikibase:label { bd:serviceParam wikibase:language "ko, zh, en" . }
}

ORDER BY ?date



Place





① 중국의 2000m 이상의 산과 봉우리 찾기


# defaultView:Map
SELECT ?mountaintap ?mountaintapLabel ?tapPoint ?altitude
WHERE {

VALUES ?type { wdt:Q8502 wd:Q207326 }
?mountaintap wdt:P31 ?type;
p:P2044/psn:P2044/wikibase:quantityAmount ?altitude;
wdt:P17 wd:Q148;
wdt:P625 ?tapPoint.
FILTER (?altitude >= 2000)
SERVICE wikibase:label {bd:serviceParam wikibase:language "ko, zh, en".}
}




② 당나라 인물들의 출생지별 좌표맵 찾기


#defaultView:Map
SELECT ?personLabel ?birthplace ?birthplaceLabel (COUNT(?person) AS ?count) (SAMPLE (?lacation) AS ?Location)
WHERE {

?person wdt:P27 wd:Q9683;    #당나라 사람
wdt:P19 ?birthplace.    #출생지
OPTIONAL { ?birthplace wdt:P625 ?lacation. }
SERVICE wikibase:label { bd:serviceParam wikibase:language "zh, en". }

}
GROUP BY ?birthplace ?birthplaceLabel ?personLabel
ORDER BY DESC(?count)



CulturalHeritage


① 유네스코 세계유산에 등재된 중국의 문화재 찾기


#defaultView:ImageGrid
SELECT ?heritage ?heritageLabel (SAMPLE (?location) AS ?Location) (SAMPLE (?image) AS ?Image)
WHERE {

?heritage wdt:P1435 wd:Q9259.
VALUES ?china { wd:Q148 wd:Q29520 }
?heritage wdt:P17 ?china;
wdt:P625 ?location.
OPTIONAL { ?heritage wdt:P18 ?image. }
SERVICE wikibase:label { bd:serviceParam wikibase:language "ko, en". }

}
GROUP BY ?heritage ?heritageLabel



② 당나라 황제의 무덤과 능묘의 이미지, 좌표 찾기


SELECT ?tomb ?tombLabel ?coordinates ?emperorLabel
WHERE {

?emperor p:P39 ?position.
    #?emperor가 ?position을 가진다
?position ps:P39 wd:Q268218.
    #?position은 중국의 황제다
?position pq:P1001 wd:Q9683.
    #?position의 관할권은 당나라다
?emperor wdt:P119 ?tomb.
?tomb wdt:P625 ?coordinates.

SERVICE wikibase:label { bd:serviceParam wikibase:language "ko,en,zh". }
}



Combination