행위

RCCTD WikiDataCuration02

CNUDH

KSS22CNU (토론 | 기여)님의 2025년 12월 9일 (화) 13:15 판 (쿼리작성)

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



중국 SF 소설 및 영화

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

김성산





목차

Contents


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



연구배경


(내용 서술)


연구목적


(내용 서술)


대상주제


(내용 서술)


쿼리작성


 1. 자연어: 중국 SF 작가 류츠신에 작품에 대해 알아보자!

SELECT ?work ?workLabel WHERE {

wd:Q607588 wdt:P800 ?work.

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

}

 1-1. 자연어: 중국 SF 작가 켄리우에 작품에 대해 알아보자!
SELECT ?work ?workLabel WHERE {

wd:Q151720 wdt:P800 ?work.

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

}

 2 자연어 : 중국 SF 작가 류츠신의 대표작 장편소설 〈삼체〉를 원작으로 한 모든 2차 콘텐츠(영화, TV 드라마, 애니메이션 등)를 형식(장르)과 제작 국가, 공개 연도에 대해 알아보자
SELECT DISTINCT ?title ?titleLabel ?typeLabel ?countryLabel ?year WHERE {

 # 1. 삼체(Q604607)를 원작(P144)으로 하는 작품(?title) 찾기
 ?title wdt:P144 wd:Q607112.
 # 2. 추가 정보 수집: 형식(P31), 제작 국가(P495), 공개일(P577)
 OPTIONAL { ?title wdt:P31 ?type. }
 OPTIONAL { ?title wdt:P495 ?country. }
 OPTIONAL { ?title wdt:P577 ?date. }
 # 3. 날짜에서 '연도'만 추출
 BIND(YEAR(?date) AS ?year)
 SERVICE wikibase:label { bd:serviceParam wikibase:language "ko,en,zh". }

} ORDER BY ?year


2 자연어 : 중국 국적을 가진 SF 작가들에 출생지, 대표작, 수상경력에 대해 알아보자

SELECT ?person ?personLabel

     ?birthplace ?birthplaceLabel
     ?occupation ?occupationLabel
     ?award ?awardLabel
     ?notableWork ?notableWorkLabel

WHERE {

?person wdt:P27 wd:Q148;        # 중국 국적
        wdt:P106 ?occupation.   # 직업
FILTER (?occupation IN (
    wd:Q18844224   # SF 작가 science fiction writer
  
))
OPTIONAL { ?person wdt:P21  ?gender. }       # 성별
OPTIONAL { ?person wdt:P19  ?birthplace. }   # 출생지

OPTIONAL { ?person wdt:P800 ?notableWork. }  # 대표작
OPTIONAL { ?person wdt:P166 ?award. }        # 수상 경력


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

}

3.중국 SF 작가들의 출생지, 출신 학교, 대표작, 수상 이력을 인물별로 한 줄에 모아서 보여줘


SELECT ?person ?personLabel

      # 여러 개인 정보들을 쉼표로 묶어서(?변수명)으로 보여줘
      (GROUP_CONCAT(DISTINCT ?birthplaceLabel; separator=", ") AS ?birthplaces)
      (GROUP_CONCAT(DISTINCT ?occupationLabel; separator=", ") AS ?occupations)
      (GROUP_CONCAT(DISTINCT ?schoolLabel; separator=", ") AS ?schools)
      (GROUP_CONCAT(DISTINCT ?workLabel; separator=", ") AS ?works)
      (GROUP_CONCAT(DISTINCT ?awardLabel; separator=", ") AS ?awards)

WHERE {

 # 1. 중국 국적의 SF 작가 찾기
 ?person wdt:P27 wd:Q148;       # 국적: 중국
         wdt:P106 ?occupation.  # 직업
 
 FILTER (?occupation = wd:Q18844224) # SF 작가만 남김
 # 2. 추가 정보 수집 (없어도 괜찮음 OPTIONAL)
 OPTIONAL { ?person wdt:P19 ?birthplace. }   # 출생지
 OPTIONAL { ?person wdt:P69 ?school. }       # 졸업학교
 OPTIONAL { ?person wdt:P800 ?work. }        # 대표작
 OPTIONAL { ?person wdt:P166 ?award. }       # 수상
 # 3. 이름표 붙이기 (라벨 서비스)
 SERVICE wikibase:label {
   bd:serviceParam wikibase:language "ko,en,zh".
   ?person rdfs:label ?personLabel.
   ?birthplace rdfs:label ?birthplaceLabel.
   ?occupation rdfs:label ?occupationLabel.
   ?school rdfs:label ?schoolLabel.
   ?work rdfs:label ?workLabel.
   ?award rdfs:label ?awardLabel.
 }

}

  1. 4. 사람을 기준으로 묶어라! (가장 중요)

GROUP BY ?person ?personLabel



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: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 작가들 출생지를 맵으로 알아보자

#defaultView:Map

SELECT ?author ?authorLabel ?coord ?birthplaceLabel WHERE {

 # 1. SF 작가 찾기
 ?author wdt:P106 wd:Q18844224.
 
 # 2. 중국 국적 필터링
 ?author wdt:P27 wd:Q148. 
 
 # 3. 출생지 및 좌표 가져오기
 ?author wdt:P19 ?birthplace. 
 ?birthplace wdt:P625 ?coord. 
 
 SERVICE wikibase:label { 
   bd:serviceParam wikibase:language "ko,zh". 
 }

} 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

류츠신에 작품들의 출판날짜를 타임라인 형식으로 출력해보자

  1. defaultView:Timeline

SELECT ?work ?workLabel ?start ?image WHERE {

 ?work wdt:P50 wd:Q607588.  # 저자(P50)가 류츠신(Q464284)인 항목
 ?work wdt:P577 ?start.    # 출판 날짜(P577)를 타임라인 시점으로 사용
 
 OPTIONAL { ?work wdt:P18 ?image. } # 이미지가 있으면 가져옵니다.
 OPTIONAL { ?work wdt:P1476 ?title. } # 제목 속성이 있는 작품만 검색되도록 도와줍니다.
 
 SERVICE wikibase:label { 
   bd:serviceParam wikibase:language "ko,en,zh". 
 }

} ORDER BY ?start LIMIT 50



  1. defaultView:Map

SELECT ?author ?authorLabel ?coord ?birthplaceLabel WHERE {

 ?author wdt:P106 wd:Q18844224. # 직업: SF 작가
 
 # A. 중국 국적 작가 
 {
   ?author wdt:P27 wd:Q148. # 국적: 중국
 }
 UNION 
 # B. 미국 국적 작가 
 {
   ?author wdt:P27 wd:Q30. # 국적: 미국
 }
 
 # 출생지 및 좌표는 필수
 ?author wdt:P19 ?birthplace.
 ?birthplace wdt:P625 ?coord. 
 
 SERVICE wikibase:label { 
   bd:serviceParam wikibase:language "ko,zh,en". 
 }

} LIMIT 100


SF작가별 작품 수와 수상경력을 스캐터 차트로 출력해보자.

  1. defaultView:ScatterChart

SELECT ?authorLabel (COUNT(DISTINCT ?work) AS ?workCount) (COUNT(DISTINCT ?award) AS ?awardCount) WHERE {

 # 1. SF 작가 정의 (사용자 요청 QID: wd:Q18844224)
 ?author wdt:P106 wd:Q18844224.
 ?author wdt:P27 wd:Q148. # 국적: 중국
 
 # 2. 작품 (P50: 저자) 및 수상 (P166: 수상)
 OPTIONAL { ?work wdt:P50 ?author. } 
 OPTIONAL { ?author wdt:P166 ?award. } 
 SERVICE wikibase:label { bd:serviceParam wikibase:language "ko,zh,en". }

} GROUP BY ?author ?authorLabel LIMIT 50


켄리우 작품별 수상횟수를 버블 차트로 출력해보자.

  1. defaultView:BubbleChart

SELECT ?workLabel (COUNT(DISTINCT ?award) AS ?awardCount) WHERE {

 ?work wdt:P50 wd:Q151720.   # 저자: 켄 리우 (중국 SF 작가)
 
 OPTIONAL { ?work wdt:P166 ?award. } 
 
 SERVICE wikibase:label { bd:serviceParam wikibase:language "ko,en,zh". }

} GROUP BY ?work ?workLabel ORDER BY DESC(?awardCount) # 수상 횟수가 많은 순서대로 정렬 LIMIT 50


중국 작가들의 작품 장르를 트리차트로 출력해보자.

  1. defaultView:TreeMap

SELECT ?genreLabel ?authorLabel ?author WHERE {

 ?author wdt:P31 wd:Q5;        # 항목이 인간(human)에 해당한다
         wdt:P27 wd:Q148;       # 국적이 중국(China)이다
         wdt:P106 wd:Q36180;    # 직업(occupation)이 작가(writer)이다
         wdt:P136 ?genre.      # 장르(genre) 속성을 가진다 (트리맵의 분류 기준)
 
 SERVICE wikibase:label { 
   bd:serviceParam wikibase:language "ko,zh,en". # 결과 레이블을 한국어, 중국어, 영어 순으로 가져온다
   ?genre rdfs:label ?genreLabel.
   ?author rdfs:label ?authorLabel.
 }

} LIMIT 500

중국 현대사(1900~2000년)의 격변이 작가라는 특정 지식인 집단의 탄생, 활동, 그리고 생존 패턴을 어떻게 형성했는지 알아보자.

#defaultView:Dimensions

SELECT

 ?person ?personLabel 
 (YEAR(?dateOfBirth) AS ?birthYear) 
 (YEAR(?dateOfDeath) AS ?deathYear)
 ?genderLabel
 ?citizenshipLabel

WHERE {

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


 # 직업이 '작가'인 사람을 필터링합니다.
 ?person wdt:P106 wd:Q36180. # 직업(P106) -> 작가(Q36180)


 # 중국인 (중화인민공화국 또는 중화민국 국적)
 { ?person wdt:P27 wd:Q148. } # 국적(P27) -> 중화인민공화국(Q148)
 UNION
 { ?person wdt:P27 wd:Q929. } # 국적(P27) -> 중화민국(Q929)


 # 라벨 획득
 ?person wdt:P27 ?citizenship.


 # 출생 연도 (1900년 1월 1일 이후 2000년까지)
 ?person wdt:P569 ?dateOfBirth.
 FILTER (YEAR(?dateOfBirth) >= 1900 && YEAR(?dateOfBirth) <= 2000)


 # 사망 연도 (P570)는 선택적 (생존자도 포함)
 OPTIONAL { ?person wdt:P570 ?dateOfDeath. }


 # 성별 (P21)
 OPTIONAL { ?person wdt:P21 ?gender. }

}

LIMIT 100


중국 근현대사(1940~50년대)의 중국 단일 국적을 가진 작가와 이중국적을 가진 작가의 작품 수를 알아보자

  1. defaultView:Table

SELECT

 ?personLabel 
 ?groupStatus 
 (COUNT(DISTINCT ?work) AS ?worksCount)

WHERE {

 SERVICE wikibase:label { bd:serviceParam wikibase:language "ko,en". }
 # 1. 기본 조건: 작가, 중국 국적, 출생 연도 필터링
 ?person wdt:P106 wd:Q36180. # 직업: 작가
 { ?person wdt:P27 wd:Q148. } UNION { ?person wdt:P27 wd:Q929. } # 중화인민공화국(Q148) 또는 중화민국(Q929) 국적을 최소 하나 보유
 ?person wdt:P569 ?dateOfBirth.
 FILTER (YEAR(?dateOfBirth) >= 1940 && YEAR(?dateOfBirth) <= 1950) # 출생 연도 1940년 ~ 1950년
 # 2. 이중/다중 국적 여부 확인 (중국 국적 제외)
 # 다른 나라 국적을 가진 경우 ?otherCitizenship 변수에 값이 할당됨
 OPTIONAL {
   ?person wdt:P27 ?otherCitizenship.
   FILTER (?otherCitizenship != wd:Q148 && ?otherCitizenship != wd:Q929) # Q148, Q929가 아닌 다른 국적
 }
 
 # 3. 그룹 분류: ?otherCitizenship 변수의 값 유무에 따라 그룹 분류
 BIND (
   IF(BOUND(?otherCitizenship), "이중/다중 국적", "단일 중국 국적") AS ?groupStatus
 )
 # 4. 작품 수 계산: 해당 작가가 저자로 등록된 문학 작품(Q7725634)의 수를 셉니다.
 OPTIONAL {
   ?work wdt:P50 ?person. # 저자(P50)가 이 작가인 작품
   ?work wdt:P31 wd:Q7725634. # 인스턴스(P31): 문학 작품
 }

} GROUP BY ?person ?personLabel ?groupStatus ORDER BY DESC(?worksCount) LIMIT 100

중국 SF 작가들의 작품이 언제, 그리고 어떤 출판사를 통해 세상에 나왔는지에 대한 구체적인 관계(Relation)와 패턴을 알아보

  1. defaultView:Dimensions

2 SELECT 3

 ?personLabel 

4

 ?workLabel 

5

 (YEAR(?publicationDate) AS ?publicationYear) # 작품 출판 연도 (시기)

6

 ?publisherLabel # 작품 출판사 (PQ로 추출)

7 WHERE { 8

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

9

10

 # 1. SF 작가 필터링

11

 ?person wdt:P106 wd:Q18844224. # 직업: SF 작가

12

 { ?person wdt:P27 wd:Q148. }  # 중국 국적

13

14

 # 2. 해당 작가의 작품 찾기

15

 ?work wdt:P50 ?person. # 저자(P50)가 이 작가인 작품

16

17

 # 3. 출판일 추출 (p, ps, pq 구조 사용)

18

 ?work p:P577 ?statement.        # 작품과 출판일 진술(?statement)을 연결 (p)

19

 ?statement ps:P577 ?publicationDate. # 진술에서 핵심 값(출판 날짜) 추출 (ps)

20

21

 # 4. PQ 추가: 출판사 추출

22

 OPTIONAL {

23

   ?statement pq:P123 ?publisher. # 진술(?statement)에 수식어(pq)로 붙은 출판사(P123)를 추출

24

 }

25

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

26 } 27 LIMIT 500

결과해석


(내용 서술)


참고자원


(내용 서술)


주석