"RCCTD WikiDataCuration02"의 두 판 사이의 차이
CNUDH
(→쿼리작성) |
(→④ SF 작가들의 전공과 전문분야에 대해 알아보자) |
||
| 50번째 줄: | 50번째 줄: | ||
</font> | </font> | ||
<br/><br/><br/> | <br/><br/><br/> | ||
| + | |||
| + | 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". | ||
| + | } | ||
| + | } | ||
| + | |||
| + | '''<span style="color:#3CB371">3.중국 SF 작가들의 출생지, 출신 학교, 대표작, 수상 이력을 인물별로 한 줄에 모아서 보자!</span>''' | ||
| + | |||
| + | 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. | ||
| + | } | ||
| + | } | ||
| + | '# 4. 사람을 기준으로 | ||
| + | GROUP BY ?person ?personLabel | ||
| + | |||
| + | =='''<span style="color:#3CB371">쿼리작성</span>'''== | ||
| + | <div style="float:center; background:#3CB371; width:100%; height:10px; text-align:right; padding:2px 2px 2px;"></div> | ||
| + | <font face="나눔바른고딕 UltraLight"> | ||
| + | <div align="right">{{button|[[RCCTD_WikiDataCuration02#목차|상단으로 이동]]}}</div><br/> | ||
| + | <big> | ||
| + | |||
| + | '''1. 자연어: 중국 SF 작가 류츠신에 작품에 대해 알아보자! '''<br/> | ||
| + | |||
| + | SELECT ?work ?workLabel | ||
| + | WHERE { | ||
| + | |||
| + | wd:Q607588 wdt:P800 ?work. | ||
| + | |||
| + | SERVICE wikibase:label { bd:serviceParam wikibase:language "ko,en". } | ||
| + | |||
| + | } | ||
| + | |||
| + | '''1-1. 자연어: 중국 SF 작가 켄리우에 작품에 대해 알아보자! '''<br/> | ||
| + | SELECT ?work ?workLabel | ||
| + | WHERE { | ||
| + | |||
| + | wd:Q151720 wdt:P800 ?work. | ||
| + | |||
| + | SERVICE wikibase:label { bd:serviceParam wikibase:language "ko,en". } | ||
| + | |||
| + | } | ||
| + | |||
| + | '''2 자연어 : 중국 SF 작가 류츠신의 대표작 장편소설 〈삼체〉를 원작으로 한 모든 2차 콘텐츠(영화, TV 드라마, 애니메이션 등)를 형식(장르)과 제작 국가, 공개 연도에 대해 알아보자 '''<br/> | ||
| + | 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 작가들에 출생지, 대표작, 수상경력에 대해 알아보자'''<br/> | ||
SELECT ?person ?personLabel | SELECT ?person ?personLabel | ||
| 120번째 줄: | 235번째 줄: | ||
(GROUP_CONCAT(DISTINCT ?majorLabel; separator=", ") AS ?majors) | (GROUP_CONCAT(DISTINCT ?majorLabel; separator=", ") AS ?majors) | ||
WHERE { | WHERE { | ||
| + | |||
| + | # 1. 중국(Q148) 국적의 SF 작가(Q18844224) 찾기 | ||
| + | |||
| + | ?person wdt:P27 wd:Q148; | ||
| + | wdt:P106 wd:Q18844224. | ||
| + | |||
| + | # 2. 전공(P812) 정보 찾기 (정보가 없어도 작가 이름은 나오게 OPTIONAL 처리) | ||
| + | |||
| + | OPTIONAL { ?person wdt:P812 ?major. } | ||
| + | |||
| + | # 3. 라벨링 서비스 (직접 명시해야 GROUP_CONCAT 오류가 안 남) | ||
| + | |||
| + | SERVICE wikibase:label { | ||
| + | bd:serviceParam wikibase:language "ko,en,zh". | ||
| + | ?person rdfs:label ?personLabel. | ||
| + | ?major rdfs:label ?majorLabel. | ||
| + | } | ||
| + | } | ||
| + | GROUP BY ?person ?personLabel | ||
| + | ==='''<span style="color:#3CB371">⑤중국계 SF 작가들의 작품 배경에 대해 알아보자</span>'''=== | ||
| + | |||
| + | SELECT ?work ?workLabel ?location ?locationLabel ?coord ?typeLabel | ||
| + | WHERE { | ||
| + | |||
| + | # 1. 중국 국적의 SF 작가 찾기 | ||
| + | |||
| + | ?author wdt:P27 wd:Q148; | ||
| + | wdt:P106 wd:Q18844224. | ||
| + | |||
| + | # 2. 그 작가가 쓴 작품 찾기 | ||
| + | |||
| + | ?work wdt:P50 ?author. | ||
| + | |||
| + | # 3. 그 작품의 '이야기 배경(P840)' 찾기 | ||
| + | |||
| + | ?work wdt:P840 ?location. | ||
| + | |||
| + | # 4. 배경 장소의 좌표(P625)가 있다면 가져와줘 | ||
| + | |||
| + | OPTIONAL { ?location wdt:P625 ?coord. } | ||
| + | |||
| + | # 5. 배경 장소 맵으로 확인 | ||
| + | |||
| + | OPTIONAL { ?location wdt:P31 ?type. } | ||
| + | |||
| + | SERVICE wikibase:label { bd:serviceParam wikibase:language "ko,en,zh". } | ||
| + | } | ||
| + | ORDER BY ?workLabel | ||
| + | |||
| + | ==='''<span style="color:#3CB371">⑤-① 중국계 SF 작가들과 미국 SF작가들의 작품 배경에 대해 알아보자</span>'''=== | ||
| + | |||
| + | #defaultView:Map | ||
| + | SELECT ?countryLabel ?authorLabel ?workLabel ?locationLabel ?coord | ||
| + | WHERE { | ||
| + | |||
| + | # 1. 비교 대상: 미국(Q30)과 중국(Q148) | ||
| + | |||
| + | VALUES ?country { wd:Q30 wd:Q148 } | ||
| + | |||
| + | # 2. SF 작가 찾기 | ||
| + | |||
| + | ?author wdt:P27 ?country; | ||
| + | wdt:P106 wd:Q18844224. | ||
| + | |||
| + | # 3. 작품과 배경 장소 연결 | ||
| + | |||
| + | ?work wdt:P50 ?author; | ||
| + | wdt:P840 ?location. | ||
| + | |||
| + | # 4. 배경 장소의 '좌표(P625)' 가져오기 | ||
| + | |||
| + | ?location wdt:P625 ?coord. | ||
| + | |||
| + | SERVICE wikibase:label { bd:serviceParam wikibase:language "ko,en". } | ||
| + | } | ||
| + | |||
| + | ==='''<span style="color:#3CB371">⑥ 10년 단위로 본 미국과 중국의 SF 소설 창작 흐름에 대해 출력해보자</span>'''=== | ||
| + | |||
| + | #defaultView:BarChart | ||
| + | SELECT ?decadeLabel ?countryLabel (COUNT(?work) AS ?count) | ||
| + | WHERE { | ||
| + | |||
| + | # 1. 비교 대상: 미국(Q30) vs 중국(Q148) | ||
| + | |||
| + | VALUES ?country { wd:Q30 wd:Q148 } | ||
| + | |||
| + | # 2. SF 작가 찾기 | ||
| + | |||
| + | ?author wdt:P27 ?country; | ||
| + | wdt:P106 wd:Q18844224. | ||
| + | |||
| + | # 3. 작품과 출판일(P577) 찾기 | ||
| + | |||
| + | ?work wdt:P50 ?author; | ||
| + | wdt:P577 ?date. | ||
| + | |||
| + | # 4. 연도를 10년 단위로 묶기 | ||
| + | |||
| + | BIND(FLOOR(YEAR(?date)/10)*10 AS ?decade) | ||
| + | BIND(CONCAT(STR(?decade), "년대") AS ?decadeLabel) # 그래프 X축 이름 만들기 | ||
| + | |||
| + | # 5. 국가 이름 라벨링 (범례용) | ||
| + | |||
| + | ?country rdfs:label ?countryLabel. | ||
| + | FILTER(LANG(?countryLabel) = "ko") | ||
| + | } | ||
| + | GROUP BY ?decadeLabel ?countryLabel | ||
| + | ORDER BY ?decadeLabe | ||
| + | |||
| + | ==='''<span style="color:#3CB371">⑦ 미국과 중국 SF 작가의 연대별 수상 실적 비교 분석 (1950s-2020s)을 Scatterchart로 출력해보자</span>'''=== | ||
| + | #defaultView:ScatterChart | ||
| + | SELECT ?year ?count ?countryLabel | ||
| + | WHERE { | ||
| + | { | ||
| + | SELECT ?year ?countryLabel (COUNT(?award) AS ?count) | ||
| + | WHERE { | ||
| + | # 1. 비교 대상: 미국(Q30) vs 중국(Q148) | ||
| + | VALUES ?country { wd:Q30 wd:Q148 } | ||
| + | |||
| + | ``` | ||
| + | # 2. SF 작가 찾기 | ||
| + | ?author wdt:P27 ?country; | ||
| + | wdt:P106 wd:Q18844224. | ||
| + | |||
| + | # 3. 수상 정보와 시점(P585) 찾기 | ||
| + | ?author p:P166 ?awardStatement. | ||
| + | ?awardStatement ps:P166 ?award; | ||
| + | pq:P585 ?time. | ||
| + | |||
| + | # 4. 연도 추출 (X축으로 사용하기 위해 정수로 변환) | ||
| + | BIND(YEAR(?time) AS ?year) | ||
| + | |||
| + | # 5. 국가 이름 (색깔 구분용) | ||
| + | ?country rdfs:label ?countryLabel. | ||
| + | FILTER(LANG(?countryLabel) = "ko") | ||
| + | } | ||
| + | GROUP BY ?year ?countryLabel | ||
| + | |||
| + | ``` | ||
| + | |||
| + | } | ||
| + | } | ||
| + | ORDER BY ?year | ||
| + | ==='''<span style="color:#3CB371">⑦-① 일본과 중국 SF 작가의 연대별 수상 실적 비교 분석 (1950s-2020s)을 Scatterchart로 출력해보자</span>'''=== | ||
| + | #defaultView:ScatterChart | ||
| + | SELECT ?year ?count ?countryLabel | ||
| + | WHERE { | ||
| + | { | ||
| + | SELECT ?year ?countryLabel (COUNT(?award) AS ?count) | ||
| + | WHERE { | ||
| + | # 1. 비교 대상 변경: 일본(Q17)과 중국(Q148) | ||
| + | VALUES ?country { wd:Q17 wd:Q148 } | ||
| + | |||
| + | ``` | ||
| + | # 2. SF 작가(Q18844224) 찾기 | ||
| + | ?author wdt:P27 ?country; | ||
| + | wdt:P106 wd:Q18844224. | ||
| + | |||
| + | # 3. 수상 내역(P166)과 수상 시점(P585) 연결 | ||
| + | ?author p:P166 ?awardStatement. | ||
| + | ?awardStatement ps:P166 ?award; | ||
| + | pq:P585 ?time. | ||
| + | |||
| + | # 4. 연도(Year) 추출 (X축 좌표용) | ||
| + | BIND(YEAR(?time) AS ?year) | ||
| + | |||
| + | # 5. 국가 이름 라벨링 (색깔 구분용) | ||
| + | ?country rdfs:label ?countryLabel. | ||
| + | FILTER(LANG(?countryLabel) = "ko") | ||
| + | } | ||
| + | # 연도별, 국가별로 그룹화해서 숫자 세기 | ||
| + | GROUP BY ?year ?countryLabel | ||
| + | |||
| + | ``` | ||
| + | |||
| + | } | ||
| + | } | ||
| + | ORDER BY ?year | ||
| + | ==='''<span style="color:#3CB371">⑦-② 한국과 중국 SF 작가의 연대별 수상 실적 비교 분석 (1950s-2020s)을 Scatterchart로 출력해보자</span>'''=== | ||
| + | #defaultView:ScatterChart | ||
| + | SELECT ?year ?count ?countryLabel | ||
| + | WHERE { | ||
| + | { | ||
| + | SELECT ?year ?countryLabel (COUNT(?award) AS ?count) | ||
| + | WHERE { | ||
| + | # 1. 비교 대상 변경: 대한민국(Q884)과 중국(Q148) | ||
| + | VALUES ?country { wd:Q884 wd:Q148 } | ||
| + | |||
| + | ``` | ||
| + | # 2. SF 작가(Q18844224) 찾기 | ||
| + | ?author wdt:P27 ?country; | ||
| + | wdt:P106 wd:Q18844224. | ||
| + | |||
| + | # 3. 수상 내역(P166)과 수상 시점(P585) 연결 | ||
| + | ?author p:P166 ?awardStatement. | ||
| + | ?awardStatement ps:P166 ?award; | ||
| + | pq:P585 ?time. | ||
| + | |||
| + | # 4. 연도(Year) 추출 | ||
| + | BIND(YEAR(?time) AS ?year) | ||
| + | |||
| + | # 5. 국가 이름 라벨링 | ||
| + | ?country rdfs:label ?countryLabel. | ||
| + | FILTER(LANG(?countryLabel) = "ko") | ||
| + | } | ||
| + | GROUP BY ?year ?countryLabel | ||
| + | |||
| + | ``` | ||
| + | |||
| + | } | ||
| + | } | ||
| + | ORDER BY ?year | ||
| + | |||
| + | ==='''<span style="color:#3CB371">⑦-③ 한국의 SF 작가들에 수상이력에 대해 알아보자</span>'''=== | ||
| + | |||
| + | SELECT DISTINCT ?author ?authorLabel ?awardLabel ?year | ||
| + | WHERE { | ||
| + | |||
| + | # 1. 국적: 대한민국(Q884) | ||
| + | |||
| + | ?author wdt:P27 wd:Q884. | ||
| + | |||
| + | # 2. SF 관련 작가 필터링 (UNION으로 조건 확장) | ||
| + | |||
| + | { | ||
| + | # 조건 A: 직업이 'SF 작가'(Q18844224)인 경우 | ||
| + | ?author wdt:P106 wd:Q18844224. | ||
| + | } | ||
| + | UNION | ||
| + | { | ||
| + | # 조건 B: 작가가 쓴 작품(?work) 중에 장르가 'SF'(Q24925)인 것이 있는 경우 | ||
| + | ?work wdt:P50 ?author. # 작품의 저자 = ?author | ||
| + | ?work wdt:P136 wd:Q24925. # 작품의 장르 = SF (Q24925) ★수정됨 | ||
| + | } | ||
| + | UNION | ||
| + | { | ||
| + | # 조건 C: 작가의 주 장르가 'SF'(Q24925)로 등록된 경우 | ||
| + | ?author wdt:P136 wd:Q24925. # 작가의 장르 = SF (Q24925) ★수정됨 | ||
| + | } | ||
| + | |||
| + | # 3. 수상 내역(P166) 찾기 | ||
| + | |||
| + | ?author p:P166 ?stmt. | ||
| + | ?stmt ps:P166 ?award. | ||
| + | |||
| + | # 4. 수상 연도 확인 (없으면 연도는 빈칸) | ||
| + | |||
| + | OPTIONAL { | ||
| + | ?stmt pq:P585 ?time. | ||
| + | BIND(YEAR(?time) AS ?year) | ||
| + | } | ||
| + | |||
| + | SERVICE wikibase:label { bd:serviceParam wikibase:language "ko,en". } | ||
| + | } | ||
| + | ORDER BY DESC(?year) | ||
| + | |||
| + | ==='''<span style="color:#3CB371">⑦-④ 미국. 중국, 일본에 세대별 작가 수를 barchart로 출려해보자</span>'''=== | ||
| + | |||
| + | #defaultView:BarChart | ||
| + | SELECT ?decadeLabel ?countryLabel (COUNT(?author) AS ?count) | ||
| + | WHERE { | ||
| + | |||
| + | # 1. 비교 대상: 미국(Q30), 일본(Q17), 중국(Q148) | ||
| + | |||
| + | VALUES ?country { wd:Q30 wd:Q17 wd:Q148 } | ||
| + | |||
| + | # 2. SF 작가 찾기 | ||
| + | |||
| + | ?author wdt:P27 ?country; | ||
| + | wdt:P106 wd:Q18844224; | ||
| + | wdt:P569 ?birthDate. # 출생일(P569) 필수 | ||
| + | |||
| + | # 3. 출생 연대 계산 (1985 -> 1980년대) | ||
| + | |||
| + | BIND(FLOOR(YEAR(?birthDate)/10)*10 AS ?decade) | ||
| + | BIND(CONCAT(STR(?decade), "년대생") AS ?decadeLabel) | ||
| + | |||
| + | # 4. 국가 라벨링 | ||
| + | |||
| + | ?country rdfs:label ?countryLabel. | ||
| + | FILTER(LANG(?countryLabel) = "ko") | ||
| + | } | ||
| + | GROUP BY ?decadeLabel ?countryLabel | ||
| + | ORDER BY ?decadeLabel | ||
| + | |||
| + | ==='''<span style="color:#3CB371">⑦-④ 미국. 중국, 일본에 작가 별 평균 작품을 알아보자</span>'''=== | ||
| + | |||
| + | SELECT ?countryLabel | ||
| + | (COUNT(DISTINCT ?author) as ?AuthorCount) | ||
| + | (COUNT(DISTINCT ?work) as ?WorkCount) | ||
| + | (COUNT(DISTINCT ?work) / COUNT(DISTINCT ?author) as ?AverageWorksPerAuthor) | ||
| + | WHERE { | ||
| + | |||
| + | # 1. 비교 대상: 미국(Q30), 일본(Q17), 중국(Q148) | ||
| + | |||
| + | VALUES ?country { wd:Q30 wd:Q17 wd:Q148 } | ||
| + | |||
| + | # 2. SF 작가 찾기 | ||
| + | |||
| + | ?author wdt:P27 ?country; | ||
| + | wdt:P106 wd:Q18844224. | ||
| + | |||
| + | # 3. 작품 연결 (OPTIONAL: 작품 없는 작가도 작가 수에는 포함시키기 위해) | ||
| + | |||
| + | OPTIONAL { ?work wdt:P50 ?author. } | ||
| + | |||
| + | # 4. 국가 이름 라벨링 | ||
| + | |||
| + | ?country rdfs:label ?countryLabel. | ||
| + | FILTER(LANG(?countryLabel) = "ko") | ||
| + | } | ||
| + | GROUP BY ?countryLabel | ||
| + | |||
| + | ==='''<span style="color:#3CB371">⑦-⑤ 미국. 중국, 일본에 가장 많은 작품(다작)을 낸 작가들을 알아보자</span>'''=== | ||
| + | |||
| + | SELECT ?countryLabel ?authorLabel (COUNT(?work) AS ?workCount) | ||
| + | WHERE { | ||
| + | VALUES ?country { wd:Q30 wd:Q17 wd:Q148 } | ||
| + | |||
| + | ?author wdt:P27 ?country; | ||
| + | wdt:P106 wd:Q18844224. | ||
| + | |||
| + | ?work wdt:P50 ?author. # 작품이 있는 경우만 | ||
| + | |||
| + | ?country rdfs:label ?countryLabel. | ||
| + | FILTER(LANG(?countryLabel) = "ko") | ||
| + | ?author rdfs:label ?authorLabel. | ||
| + | FILTER(LANG(?authorLabel) = "ko") | ||
| + | } | ||
| + | GROUP BY ?countryLabel ?authorLabel | ||
| + | ORDER BY DESC(?workCount) | ||
| + | LIMIT 30 | ||
| + | |||
| + | ==='''<span style="color:#3CB371">④기본정보(SF 작가와 SF영화감독)에 작품수를 세보자</span>'''=== | ||
| + | |||
| + | 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) | ||
| + | |||
| + | ==='''<span style="color:#3CB371">⑤SF 작가들이 어디에서 많이 태어났는지 알아보자</span>'''=== | ||
| + | |||
| + | 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) | ||
| + | |||
| + | ==='''<span style="color:#3CB371">⑥ 베이징에 태어난 SF 작가들별 작품 수를 세보자</span>'''=== | ||
| + | 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) | ||
| + | |||
| + | ==='''<span style="color:#3CB371">2-1 중국 국적을 가진 SF 작가에 대한 출생지에 대해 알아보자</span>'''=== | ||
| + | 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". | ||
| + | } | ||
| + | } | ||
| + | |||
| + | ==='''<span style="color:#3CB371">2-2 중국 sf 작가 켄 리우에 작품에 대해 알아보자</span>'''=== | ||
| + | SELECT ?work ?workLabel | ||
| + | WHERE { | ||
| + | ?work wdt:P50 wd:Q6387864. # ?work의 저자(P50)가 켄 리우(Q6387864)인 것을 찾는다. | ||
| + | |||
| + | SERVICE wikibase:label { | ||
| + | bd:serviceParam wikibase:language "ko,en". | ||
| + | } | ||
| + | } | ||
| + | ORDER BY ?workLabel | ||
| + | |||
| + | ==='''<span style="color:#3CB371"> 중국인sf 작가들 출생지를 맵으로 알아보자 </span>'''=== | ||
| + | |||
| + | #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 | ||
| + | |||
| + | ==='''<span style="color:#3CB371"> 중국계 sf 작가들 출생지를 맵으로 알아보자 </span>'''=== | ||
| + | |||
| + | 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 | ||
| + | |||
| + | ==='''<span style="color:#3CB371"> 켄리우에 작품들의 출판날짜를 타임라인 형식으로 출력해보자 </span>'''=== | ||
| + | |||
| + | #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 | ||
| + | |||
| + | ==='''<span style="color:#3CB371"> 류츠신에 작품들의 출판날짜를 타임라인 형식으로 출력해보자 </span>'''=== | ||
| + | |||
| + | #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 | ||
| + | |||
| + | #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 | ||
| + | |||
| + | ==='''<span style="color:#3CB371"> SF작가별 작품 수와 수상경력을 스캐터 차트로 출력해보자. </span>'''=== | ||
| + | |||
| + | #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 | ||
| + | |||
| + | ==='''<span style="color:#3CB371"> 켄리우 작품별 수상횟수를 버블 차트로 출력해보자. </span>'''=== | ||
| + | |||
| + | #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 | ||
| + | |||
| + | ==='''<span style="color:#3CB371"> 중국 작가들의 작품 장르를 트리차트로 출력해보자. </span>'''=== | ||
| + | |||
| + | #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 | ||
| + | ==='''<span style="color:#3CB371"> 중국 현대사(1900~2000년)의 격변이 작가라는 특정 지식인 집단의 탄생, 활동, 그리고 생존 패턴을 어떻게 형성했는지 알아보자. </span>'''=== | ||
| + | #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 | ||
| + | |||
| + | ==='''<span style="color:#3CB371"> 중국 근현대사(1940~50년대)의 중국 단일 국적을 가진 작가와 이중국적을 가진 작가의 작품 수를 알아보자 </span>'''=== | ||
| + | |||
| + | #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 | ||
| + | |||
| + | ==='''<span style="color:#3CB371"> 중국 SF 작가들의 작품이 언제, 그리고 어떤 출판사를 통해 세상에 나왔는지에 대한 구체적인 관계(Relation)와 패턴을 알아보 </span>'''=== | ||
| + | #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 | ||
=='''<span style="color:#3CB371">결과해석</span>'''== | =='''<span style="color:#3CB371">결과해석</span>'''== | ||
2025년 12월 11일 (목) 11:13 판
목차
Contents
연구배경
(내용 서술)
연구목적
(내용 서술)
대상주제
(내용 서술)
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. } } '# 4. 사람을 기준으로 GROUP BY ?person ?personLabel
쿼리작성
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 작가들에 출생지, 대표작, 수상경력에 대해 알아보자
- 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. } } '# 4. 사람을 기준으로 GROUP BY ?person ?personLabel
④ SF 작가들의 전공과 전문분야에 대해 알아보자
SELECT ?person ?personLabel (GROUP_CONCAT(DISTINCT ?majorLabel; separator=", ") AS ?majors) WHERE {
- 1. 중국(Q148) 국적의 SF 작가(Q18844224) 찾기
?person wdt:P27 wd:Q148; wdt:P106 wd:Q18844224.
- 2. 전공(P812) 정보 찾기 (정보가 없어도 작가 이름은 나오게 OPTIONAL 처리)
OPTIONAL { ?person wdt:P812 ?major. }
- 3. 라벨링 서비스 (직접 명시해야 GROUP_CONCAT 오류가 안 남)
SERVICE wikibase:label { bd:serviceParam wikibase:language "ko,en,zh". ?person rdfs:label ?personLabel. ?major rdfs:label ?majorLabel. } } GROUP BY ?person ?personLabel
⑤중국계 SF 작가들의 작품 배경에 대해 알아보자
SELECT ?work ?workLabel ?location ?locationLabel ?coord ?typeLabel WHERE {
- 1. 중국 국적의 SF 작가 찾기
?author wdt:P27 wd:Q148; wdt:P106 wd:Q18844224.
- 2. 그 작가가 쓴 작품 찾기
?work wdt:P50 ?author.
- 3. 그 작품의 '이야기 배경(P840)' 찾기
?work wdt:P840 ?location.
- 4. 배경 장소의 좌표(P625)가 있다면 가져와줘
OPTIONAL { ?location wdt:P625 ?coord. }
- 5. 배경 장소 맵으로 확인
OPTIONAL { ?location wdt:P31 ?type. }
SERVICE wikibase:label { bd:serviceParam wikibase:language "ko,en,zh". } } ORDER BY ?workLabel
⑤-① 중국계 SF 작가들과 미국 SF작가들의 작품 배경에 대해 알아보자
- defaultView:Map
SELECT ?countryLabel ?authorLabel ?workLabel ?locationLabel ?coord WHERE {
- 1. 비교 대상: 미국(Q30)과 중국(Q148)
VALUES ?country { wd:Q30 wd:Q148 }
- 2. SF 작가 찾기
?author wdt:P27 ?country; wdt:P106 wd:Q18844224.
- 3. 작품과 배경 장소 연결
?work wdt:P50 ?author; wdt:P840 ?location.
- 4. 배경 장소의 '좌표(P625)' 가져오기
?location wdt:P625 ?coord.
SERVICE wikibase:label { bd:serviceParam wikibase:language "ko,en". } }
⑥ 10년 단위로 본 미국과 중국의 SF 소설 창작 흐름에 대해 출력해보자
- defaultView:BarChart
SELECT ?decadeLabel ?countryLabel (COUNT(?work) AS ?count) WHERE {
- 1. 비교 대상: 미국(Q30) vs 중국(Q148)
VALUES ?country { wd:Q30 wd:Q148 }
- 2. SF 작가 찾기
?author wdt:P27 ?country; wdt:P106 wd:Q18844224.
- 3. 작품과 출판일(P577) 찾기
?work wdt:P50 ?author; wdt:P577 ?date.
- 4. 연도를 10년 단위로 묶기
BIND(FLOOR(YEAR(?date)/10)*10 AS ?decade) BIND(CONCAT(STR(?decade), "년대") AS ?decadeLabel) # 그래프 X축 이름 만들기
- 5. 국가 이름 라벨링 (범례용)
?country rdfs:label ?countryLabel. FILTER(LANG(?countryLabel) = "ko") } GROUP BY ?decadeLabel ?countryLabel ORDER BY ?decadeLabe
⑦ 미국과 중국 SF 작가의 연대별 수상 실적 비교 분석 (1950s-2020s)을 Scatterchart로 출력해보자
- defaultView:ScatterChart
SELECT ?year ?count ?countryLabel WHERE { { SELECT ?year ?countryLabel (COUNT(?award) AS ?count) WHERE {
- 1. 비교 대상: 미국(Q30) vs 중국(Q148)
VALUES ?country { wd:Q30 wd:Q148 }
```
# 2. SF 작가 찾기
?author wdt:P27 ?country;
wdt:P106 wd:Q18844224.
# 3. 수상 정보와 시점(P585) 찾기
?author p:P166 ?awardStatement.
?awardStatement ps:P166 ?award;
pq:P585 ?time.
# 4. 연도 추출 (X축으로 사용하기 위해 정수로 변환) BIND(YEAR(?time) AS ?year)
# 5. 국가 이름 (색깔 구분용) ?country rdfs:label ?countryLabel. FILTER(LANG(?countryLabel) = "ko")
} GROUP BY ?year ?countryLabel
```
} } ORDER BY ?year
⑦-① 일본과 중국 SF 작가의 연대별 수상 실적 비교 분석 (1950s-2020s)을 Scatterchart로 출력해보자
- defaultView:ScatterChart
SELECT ?year ?count ?countryLabel WHERE { { SELECT ?year ?countryLabel (COUNT(?award) AS ?count) WHERE {
- 1. 비교 대상 변경: 일본(Q17)과 중국(Q148)
VALUES ?country { wd:Q17 wd:Q148 }
```
# 2. SF 작가(Q18844224) 찾기
?author wdt:P27 ?country;
wdt:P106 wd:Q18844224.
# 3. 수상 내역(P166)과 수상 시점(P585) 연결
?author p:P166 ?awardStatement.
?awardStatement ps:P166 ?award;
pq:P585 ?time.
# 4. 연도(Year) 추출 (X축 좌표용) BIND(YEAR(?time) AS ?year)
# 5. 국가 이름 라벨링 (색깔 구분용) ?country rdfs:label ?countryLabel. FILTER(LANG(?countryLabel) = "ko")
}
- 연도별, 국가별로 그룹화해서 숫자 세기
GROUP BY ?year ?countryLabel
```
} } ORDER BY ?year
⑦-② 한국과 중국 SF 작가의 연대별 수상 실적 비교 분석 (1950s-2020s)을 Scatterchart로 출력해보자
- defaultView:ScatterChart
SELECT ?year ?count ?countryLabel WHERE { { SELECT ?year ?countryLabel (COUNT(?award) AS ?count) WHERE {
- 1. 비교 대상 변경: 대한민국(Q884)과 중국(Q148)
VALUES ?country { wd:Q884 wd:Q148 }
```
# 2. SF 작가(Q18844224) 찾기
?author wdt:P27 ?country;
wdt:P106 wd:Q18844224.
# 3. 수상 내역(P166)과 수상 시점(P585) 연결
?author p:P166 ?awardStatement.
?awardStatement ps:P166 ?award;
pq:P585 ?time.
# 4. 연도(Year) 추출 BIND(YEAR(?time) AS ?year)
# 5. 국가 이름 라벨링 ?country rdfs:label ?countryLabel. FILTER(LANG(?countryLabel) = "ko")
} GROUP BY ?year ?countryLabel
```
} } ORDER BY ?year
⑦-③ 한국의 SF 작가들에 수상이력에 대해 알아보자
SELECT DISTINCT ?author ?authorLabel ?awardLabel ?year WHERE {
- 1. 국적: 대한민국(Q884)
?author wdt:P27 wd:Q884.
- 2. SF 관련 작가 필터링 (UNION으로 조건 확장)
{
- 조건 A: 직업이 'SF 작가'(Q18844224)인 경우
?author wdt:P106 wd:Q18844224. } UNION {
- 조건 B: 작가가 쓴 작품(?work) 중에 장르가 'SF'(Q24925)인 것이 있는 경우
?work wdt:P50 ?author. # 작품의 저자 = ?author ?work wdt:P136 wd:Q24925. # 작품의 장르 = SF (Q24925) ★수정됨 } UNION {
- 조건 C: 작가의 주 장르가 'SF'(Q24925)로 등록된 경우
?author wdt:P136 wd:Q24925. # 작가의 장르 = SF (Q24925) ★수정됨 }
- 3. 수상 내역(P166) 찾기
?author p:P166 ?stmt. ?stmt ps:P166 ?award.
- 4. 수상 연도 확인 (없으면 연도는 빈칸)
OPTIONAL { ?stmt pq:P585 ?time. BIND(YEAR(?time) AS ?year) }
SERVICE wikibase:label { bd:serviceParam wikibase:language "ko,en". } } ORDER BY DESC(?year)
⑦-④ 미국. 중국, 일본에 세대별 작가 수를 barchart로 출려해보자
- defaultView:BarChart
SELECT ?decadeLabel ?countryLabel (COUNT(?author) AS ?count) WHERE {
- 1. 비교 대상: 미국(Q30), 일본(Q17), 중국(Q148)
VALUES ?country { wd:Q30 wd:Q17 wd:Q148 }
- 2. SF 작가 찾기
?author wdt:P27 ?country; wdt:P106 wd:Q18844224; wdt:P569 ?birthDate. # 출생일(P569) 필수
- 3. 출생 연대 계산 (1985 -> 1980년대)
BIND(FLOOR(YEAR(?birthDate)/10)*10 AS ?decade) BIND(CONCAT(STR(?decade), "년대생") AS ?decadeLabel)
- 4. 국가 라벨링
?country rdfs:label ?countryLabel. FILTER(LANG(?countryLabel) = "ko") } GROUP BY ?decadeLabel ?countryLabel ORDER BY ?decadeLabel
⑦-④ 미국. 중국, 일본에 작가 별 평균 작품을 알아보자
SELECT ?countryLabel (COUNT(DISTINCT ?author) as ?AuthorCount) (COUNT(DISTINCT ?work) as ?WorkCount) (COUNT(DISTINCT ?work) / COUNT(DISTINCT ?author) as ?AverageWorksPerAuthor) WHERE {
- 1. 비교 대상: 미국(Q30), 일본(Q17), 중국(Q148)
VALUES ?country { wd:Q30 wd:Q17 wd:Q148 }
- 2. SF 작가 찾기
?author wdt:P27 ?country; wdt:P106 wd:Q18844224.
- 3. 작품 연결 (OPTIONAL: 작품 없는 작가도 작가 수에는 포함시키기 위해)
OPTIONAL { ?work wdt:P50 ?author. }
- 4. 국가 이름 라벨링
?country rdfs:label ?countryLabel. FILTER(LANG(?countryLabel) = "ko") } GROUP BY ?countryLabel
⑦-⑤ 미국. 중국, 일본에 가장 많은 작품(다작)을 낸 작가들을 알아보자
SELECT ?countryLabel ?authorLabel (COUNT(?work) AS ?workCount) WHERE { VALUES ?country { wd:Q30 wd:Q17 wd:Q148 }
?author wdt:P27 ?country; wdt:P106 wd:Q18844224.
?work wdt:P50 ?author. # 작품이 있는 경우만
?country rdfs:label ?countryLabel. FILTER(LANG(?countryLabel) = "ko") ?author rdfs:label ?authorLabel. FILTER(LANG(?authorLabel) = "ko") } GROUP BY ?countryLabel ?authorLabel ORDER BY DESC(?workCount) LIMIT 30
④기본정보(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
켄리우에 작품들의 출판날짜를 타임라인 형식으로 출력해보자
- 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
류츠신에 작품들의 출판날짜를 타임라인 형식으로 출력해보자
- 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
- 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작가별 작품 수와 수상경력을 스캐터 차트로 출력해보자.
- 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
켄리우 작품별 수상횟수를 버블 차트로 출력해보자.
- 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
중국 작가들의 작품 장르를 트리차트로 출력해보자.
- 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년대)의 중국 단일 국적을 가진 작가와 이중국적을 가진 작가의 작품 수를 알아보자
- 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)와 패턴을 알아보
- 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
결과해석
(내용 서술)
참고자원
(내용 서술)
주석