행위

RCCTD WikiDataCuration02

CNUDH

KSS22CNU (토론 | 기여)님의 2025년 11월 27일 (목) 13:19 판 (쿼리작성)

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



중국 SF 소설 및 영화

: Wikidata를 통한 중국 SF 문화 네트워크 탐색

김성산





목차

Contents


연구배경 연구목적 대상주제 쿼리작성 결과해석 참고자원



연구배경


(내용 서술)


연구목적


(내용 서술)


대상주제


(내용 서술)


쿼리작성


① 중국 국적을 가진 SF 영화감독, SF 작가에 대해 알아보자


SELECT  ?person personLabel ?award ?awardLabel ?occupation ?occupationLabel
WHERE {
?person rdfs:label "SF 영화감독, SF 작가"@ko.
SERVICE wikibase:label { bd:serviceParam wikibase:language
"[AUTO_LANGUAGE],ko,en". }
}



SELECT ?person ?personLabel ?award ?awardLabel ?occupation ?occupationLabel WHERE {

 ?person wdt:P27 wd:Q148;             # 중국 국적
         wdt:P166 ?award;             # 수상 경력
         wdt:P106 ?occupation.        # 직업
 FILTER (?occupation IN (wd:Q2526255,   # 영화 감독 film director
                         wd:Q36180,     # 작가 writer
                         wd:Q18844224   # SF 작가 science fiction writer
                        )
 )
 SERVICE wikibase:label { 
   bd:serviceParam wikibase:language "ko,en,zh".
 }

} LIMIT 200


SELECT ?person ?personLabel

      ?birth ?death
      ?gender ?genderLabel
      ?nativeLang ?nativeLangLabel
      ?birthplace ?birthplaceLabel
      ?occupation ?occupationLabel
      ?award ?awardLabel
      ?notableWork ?notableWorkLabel

WHERE {

 ?person wdt:P27 wd:Q148;        # 중국 국적
         wdt:P106 ?occupation.   # 직업
 FILTER (?occupation IN (
     wd:Q2526255,   # 영화 감독 film director
     wd:Q36180,     # 작가 writer
     wd:Q18844224   # SF 작가 science fiction writer
   
 ))
 OPTIONAL { ?person wdt:P569 ?birth. }        # 출생일
 OPTIONAL { ?person wdt:P570 ?death. }        # 사망일
 OPTIONAL { ?person wdt:P21  ?gender. }       # 성별
 OPTIONAL { ?person wdt:P19  ?birthplace. }   # 출생지
OPTIONAL {?person wdt:P69 ?graduation} #졸업학교
 
 OPTIONAL { ?person wdt:P800 ?notableWork. }  # 대표작
 OPTIONAL { ?person wdt:P166 ?award. }        # 수상 경력


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

} LIMIT 200

②중국 국적을 가진 SF 영화감독, SF 작가에 대한 출생지에 대해 알아보자

SELECT ?person ?personLabel

      ?occupation ?occupationLabel
      ?award ?awardLabel
      ?birthplace ?birthplaceLabel

WHERE { ?person wdt:P27 wd:Q148; # 중국 국적

         wdt:P106 ?occupation.         # 직업
         
OPTIONAL { ?person wdt:P166 ?award. } # 수상 경력
 
 FILTER (?occupation IN (wd:Q2526255,     # 영화 감독 film director
                         wd:Q36180,       # 작가 writer
                         wd:Q18844224     # SF 작가 science fiction writer
                        )
 )
  
 OPTIONAL { ?person wdt:P19 ?birthplace. }  # 출생지
 SERVICE wikibase:label { 
   bd:serviceParam wikibase:language "ko,en,zh".
 }

} LIMIT 200

③기본정보(SF 작가와 SF영화감독)를 포함한 대표작 수상경력 알아보기

SELECT ?person ?personLabel

      ?birth ?death
      ?gender ?genderLabel
      ?nativeLang ?nativeLangLabel
      ?birthplace ?birthplaceLabel
      ?occupation ?occupationLabel
      ?award ?awardLabel
      ?notableWork ?notableWorkLabel

WHERE {

 ?person wdt:P27 wd:Q148;        # 중국 국적
         wdt:P106 ?occupation.   # 직업
 FILTER (?occupation IN (
     wd:Q2526255,   # 영화 감독 film director
     wd:Q36180,     # 작가 writer
     wd:Q18844224   # SF 작가 science fiction writer
   
 ))
 OPTIONAL { ?person wdt:P569 ?birth. }        # 출생일
 OPTIONAL { ?person wdt:P570 ?death. }        # 사망일
 OPTIONAL { ?person wdt:P21  ?gender. }       # 성별
 OPTIONAL { ?person wdt:P19  ?birthplace. }   # 출생지
OPTIONAL {?person wdt:P69 ?graduation} #졸업학교
 
 OPTIONAL { ?person wdt:P800 ?notableWork. }  # 대표작
 OPTIONAL { ?person wdt:P166 ?award. }        # 수상 경력


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

} LIMIT 200


④기본정보(SF 작가와 SF영화감독)에 작품수를 세보자

SELECT ?person ?personLabel (COUNT(?work) AS ?sfNovelCount) WHERE {

?person wdt:P27 wd:Q148;              # 중국 국적
        wdt:P106 wd:Q18844224.       # SF 작가
?work wdt:P50 ?person;
      wdt:P136 wd:Q24925.            # 장르 = SF

SERVICE wikibase:label { bd:serviceParam wikibase:language "ko,en,zh".}} GROUP BY ?person ?personLabel ORDER BY DESC(?sfNovelCount)

⑤SF 작가들이 어디에서 많이 태어났는지 알아보자

SELECT ?birthplace ?birthplaceLabel (COUNT(?work) AS ?sfCount) WHERE {

 ?person wdt:P27 wd:Q148;          # 중국 국적
         wdt:P106 wd:Q18844224;    # SF 작가
         wdt:P19 ?birthplace.      # 출생지
 ?work wdt:P50 ?person;            # 작품
       wdt:P136 wd:Q24925.         # SF}

SERVICE wikibase:label { bd:serviceParam wikibase:language "ko,en,zh".} } GROUP BY ?birthplace ?birthplaceLabel ORDER BY DESC(?sfCount)


⑥ 베이징에 태어난 SF 작가들별 작품 수를 세보자

SELECT ?person ?personLabel (COUNT(?work) AS ?sfWorkCount) WHERE {

 # 인물 조건: 중국 국적 + 작가/SF작가 + 베이징 출생
 ?person wdt:P27 wd:Q148;                # 중국 국적
         wdt:P106 ?occupation;           # 직업
         wdt:P19  wd:Q956.              # 출생지 = 베이징
 FILTER(?occupation IN (
   wd:Q36180,        # writer
   wd:Q18844224      # SF writer
 ))
 # 작품 조건: 이 사람이 저자인 작품 + SF 장르
 ?work wdt:P50 ?person;                  # author = person
       wdt:P136 wd:Q24925.              # genre = science fiction
 SERVICE wikibase:label {
   bd:serviceParam wikibase:language "ko,en,zh".
 }

} GROUP BY ?person ?personLabel ORDER BY DESC(?sfWorkCount)


2-1 중국 국적을 가진 SF 작가에 대한 출생지에 대해 알아보자

SELECT ?person ?personLabel

     ?occupation ?occupationLabel
     ?award ?awardLabel
     ?birthplace ?birthplaceLabel

WHERE { ?person wdt:P27 wd:Q148; # 중국 국적

        wdt:P106 ?occupation.         # 직업
        

OPTIONAL { ?person wdt:P166 ?award. } # 수상 경력

FILTER (?occupation IN ( wd:Q18844224     # SF 작가 science fiction writer
                       )
)
 
OPTIONAL { ?person wdt:P19 ?birthplace. }  # 출생지
SERVICE wikibase:label { 
  bd:serviceParam wikibase:language "ko,en,zh".
}

}

2-2 중국 sf 작가 켄 리우에 작품에 대해 알아보자

SELECT ?work ?workLabel WHERE {

 ?work wdt:P50 wd:Q6387864.  # ?work의 저자(P50)가 켄 리우(Q6387864)인 것을 찾는다.
 SERVICE wikibase:label {
   bd:serviceParam wikibase:language "ko,en".
 }

} ORDER BY ?workLabel

중국인sf 작가들 출생지를 맵으로 알아보자

SELECT ?birthplace ?birthplaceLabel

      (COUNT(DISTINCT ?person) AS ?count)
      (SAMPLE (?personLabel) AS ?representativeAuthor) # 이 출생지 출신 작가 중 한 명의 이름 (대표)
      (SAMPLE (?coordinates) AS ?location)

WHERE {

 ?person wdt:P27 wd:Q148;          # 국적은 중국 (wd:Q148)
         wdt:P106 wd:Q18844224;    # 직업은 SF 작가 (wd:Q18844224)
         wdt:P19 ?birthplace.      # 출생지 (?birthplace)를 찾습니다.
 
 ?birthplace wdt:P625 ?coordinates. # 출생지의 지리적 좌표 (P625)
 SERVICE wikibase:label {
   bd:serviceParam wikibase:language "[AUTO_LANGUAGE], ko, en".
 }

} GROUP BY ?birthplace ?birthplaceLabel ORDER BY DESC(?count) LIMIT 100


중국계 sf 작가들 출생지를 맵으로 알아보자

SELECT ?birthplace ?birthplaceLabel

    (COUNT(DISTINCT ?person) AS ?count)
    (GROUP_CONCAT(DISTINCT ?personLabel; separator=", ") AS ?authorNames) # [중요] 해당 지역 작가 이름 모두 나열
    (SAMPLE (?coordinates) AS ?location)

WHERE {

?person wdt:P106 wd:Q18844224; # 1. SF 작가
        wdt:P19 ?birthplace.
# 2. 중국계/중국 출신 조건 (4가지 중 하나라도 있으면 ok) 
{ ?person wdt:P27 wd:Q148. }        # A: 국적 중국
UNION
{ ?birthplace wdt:P17 wd:Q148. }    # B: 출생지가 중국
UNION
{ ?person wdt:P172 wd:Q42426. }     # C: 한족
UNION
{ ?person wdt:P172 wd:Q22695. }     # D: 중국인
# 3. 좌표
?birthplace wdt:P625 ?coordinates.

SERVICE wikibase:label {

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

} GROUP BY ?birthplace ?birthplaceLabel ORDER BY DESC(?count) LIMIT 100


켄리우에 작품들의 출판날짜를 타임라인 형식으로 출력해

  1. defaultView:Timeline

SELECT ?work ?workLabel ?start ?image WHERE {

 ?work wdt:P50 wd:Q151720.  # ?work은 저자(P50)가 켄 리우(Q151720)인 항목(작품)이다.
 ?work wdt:P577 ?start.    # ?start: 출판 날짜(P577)를 타임라인 시점으로 사용합니다.
 
 OPTIONAL { ?work wdt:P18 ?image. } # 이미지가 있으면 배경으로 가져옵니다.
 
 SERVICE wikibase:label { bd:serviceParam wikibase:language "ko,en". }

} ORDER BY ?start LIMIT 50

결과해석


(내용 서술)


참고자원


(내용 서술)


주석