44
김김김 ([email protected], eastkim@twitter) 김김김 김 김김김 김김 (http://groups.google.com/group/semanticwebstudy) 2009-10-31 RDF 김김 김 김김 김김 2009 김김김 김 김김김김 : RDF 김김김김

RDF 개념 및 구문 소개

Embed Size (px)

DESCRIPTION

2009년 10월 31일. 시맨틱웹 스터디 모임과 웹 사이언스 그룹에서 개최한 '시맨틱 웹 튜토리얼' 발표자료

Citation preview

Page 1: RDF 개념 및 구문 소개

김동범 ([email protected], eastkim@twitter)시맨틱 웹 스터디 그룹

(http://groups.google.com/group/semanticwebstudy)

2009-10-31

RDF 개념 및 구문 소개

2009 시맨틱 웹 튜토리얼 : RDF 집중분석

Page 2: RDF 개념 및 구문 소개

What is RDF?

2009 시맨틱 웹 튜토리얼 : RDF 집중분석

RDF stands for

Resource

Description

Framework

: URI 를 갖는 모든 것 ( 웹 페이지 , 이미지 , 동영상 등 )

: 자원 (Resource) 들의 속성 , 특성 , 관계 기술

: 위의 것들을 기술하기 위한 모델 , 언어 , 문법

Page 3: RDF 개념 및 구문 소개

Where is RDF on the Semantic Web Layer

2009 시맨틱 웹 튜토리얼 : RDF 집중분석

Image source : http://www.w3.org/2007/Talks/0130-sb-W3CTechSemWeb/

시맨틱 웹 표준의첫 번째 Layer

SemanticAspect

WebAspect

Page 4: RDF 개념 및 구문 소개

RDF Definition

W3C RDF 문서에서의 정의

Framework for representing information in the Web.

웹에 있는 Resource 에 대한 정보를 표현하기 위한 언어

특히 , 웹 Resource 에 대한 Metadata 를 표현하기 위함 .

2009 시맨틱 웹 튜토리얼 : RDF 집중분석

Page 5: RDF 개념 및 구문 소개

RDF 탄생 스토리

1990 년대 중반 Ramanathan V. Guha (Apple) MCF (Meta Content Framework) 라는 메타데이터 포맷

개발 RDF 의 모태가 됨

1997 년 Guha 의 Netscape 로 이직 Tim Bray 와 함께 MCF/XML 프로젝트 착수 MCF/XML: Microsoft 의 CDF (Channel Document

Format) 과 경쟁하기 위한 프로젝트 1998 년 RDF 제안 (W3C)

시맨틱 웹의 기본 구성요소가 됨

2009 시맨틱 웹 튜토리얼 : RDF 집중분석

Page 6: RDF 개념 및 구문 소개

Semantic Web 언어의 흐름

Ontology(information science)

RDF(W3C WD)

1997.08

XML(W3C WD)

RDF Scheme(W3C WD)

OWL(W3C WD)

SPARQL(WD)

DAML

OIL(Europe IST Project)

DAML+OIL

1970s

1996.11

1998.04 1999 2000

1999 2002

2004.10

Page 7: RDF 개념 및 구문 소개

왜 RDF 를 만들었을까 ?

웹은 글로벌하고 방대한 정보 공간

2009 시맨틱 웹 튜토리얼 : RDF 집중분석

그런데 지금의 웹은 사람은 보기 쉽지만 기계가 처리하기에는 너무 모호하고 힘들어 .

웹에 있는 정보를 데이터베이스처럼 표현할 수 없을까 ? (Linked Data, Web of Data)

그러면 웹 상의 정보를 기계가 좀 더 처리하기 쉬울텐데 ... (Machine processible, readable, understandable)

또 웹에 흩어진 정보를 가져와서 내 정보와 쉽게 결합할 수 있을 텐데 ...

(Interworking among the applications)

Page 8: RDF 개념 및 구문 소개

W3C RDF 문서들

Primer RDF 를 빠르게 사용하기 위한 기본 지식 제공

Concepts RDF Concept, Abstract Syntax (RDF Graph)

Syntax RDF 모델에 대한 XML Syntax (RDF/XML), N-triples

Semantics RDF, RDF Schema 가 담고 있는 의미론 , 추론 규칙에 대한 설명

Vocabularies RDF Schema 와 RDF Vocabulary 를 기술하는 방법

2009 시맨틱 웹 튜토리얼 : RDF 집중분석

http://www.w3.org/RDF/

Page 9: RDF 개념 및 구문 소개

2009 시맨틱 웹 튜토리얼 : RDF 집중분석

RDF Data Model

Page 10: RDF 개념 및 구문 소개

RDF Data Model

2009 시맨틱 웹 튜토리얼 : RDF 집중분석

subject

Object

predicate

RDF 는 Graph Model 을 갖고 있다 .

주어

(Resource)

술어

(Property, Relation)

목적어

(Resource, Literal)

URIBlank Node

URI URILiteral

Page 11: RDF 개념 및 구문 소개

RDF is A Graph !!

2009 시맨틱 웹 튜토리얼 : RDF 집중분석

The formal semantics of RDF is described using graphs.

Think in terms of graphs, not XML or documents.

By Ian Davis ([email protected])

Page 12: RDF 개념 및 구문 소개

Graph Model 예제

2009 시맨틱 웹 튜토리얼 : RDF 집중분석

By Ian Davis ([email protected])

http://dbpedia.org/resource/Billie_Jean has a singer whose value is Michael Jackson

Subject : http://dbpedia.org/resource/Billie_Jean (URI)

Predicate: http://www.example.com/terms/singer (URI)

Object: Michael_Jackson (Literal)

Page 13: RDF 개념 및 구문 소개

Basic Graph

2009 시맨틱 웹 튜토리얼 : RDF 집중분석

http://dbpedia.org/resource/Billie_Jean

http://www.example.com/terms/singer

Michael_Jackson1983-01-02

http://www.example.com/terms/released

Page 14: RDF 개념 및 구문 소개

Basic Graph 확장

2009 시맨틱 웹 튜토리얼 : RDF 집중분석

http://dbpedia.org/resource/Billie_Jean

http://www.example.com/terms/singer

Michael_Jackson

1983-01-02

http://www.example.com/terms/released

http://dbpedia.org/resource/Michael_Jackson

http://www.example.com/terms/name

44

http://www.example.com/terms/age

Page 15: RDF 개념 및 구문 소개

Typed Literal

2009 시맨틱 웹 튜토리얼 : RDF 집중분석

http://dbpedia.org/resource/Billie_Jean

http://www.example.com/terms/singer

Michael_Jackson

“1983-01-02”^^xsd:date

http://www.example.com/terms/released

http://dbpedia.org/resource/Michael_Jackson

http://www.example.com/terms/name

44^^xsd:integer

http://www.example.com/terms/age

Page 16: RDF 개념 및 구문 소개

Merge by linking

서로 다른 source 를 나타내는 그래프는 병합될 수 있다 .

같은 URI 를 가진 Node 는 같은 resource 를 취급한다 .

어떤 RDF 도 다른 RDF 와 병합될 수 있다 .

2009 시맨틱 웹 튜토리얼 : RDF 집중분석

Page 17: RDF 개념 및 구문 소개

Merging Example

2009 시맨틱 웹 튜토리얼 : RDF 집중분석

Source : http://research.talis.com

Page 18: RDF 개념 및 구문 소개

2009 시맨틱 웹 튜토리얼 : RDF 집중분석

RDF Schema

Page 19: RDF 개념 및 구문 소개

RDF Schema

RDF Schema 는 property 에 대한 추가 정보 제공함으로써 사용 방법을 보다 명확히 함 (Domain, Range)

Resource 의 타입을 기술 (type, Class) Book, Person, Publisher

Not Like XML Scheme

Resource 를 설명하는데 있어 의미 표현을 추가한 것

2009 시맨틱 웹 튜토리얼 : RDF 집중분석

Page 20: RDF 개념 및 구문 소개

RDFS example

2009 시맨틱 웹 튜토리얼 : RDF 집중분석

Source : http://research.talis.com

Resource <http://example.com/ISBN/xxxx> 의 타입 (type) 은 <http://ex.org/bib/Book> 이다 .

http://example.com/ISBN/xxxx

Page 21: RDF 개념 및 구문 소개

RDFS example

2009 시맨틱 웹 튜토리얼 : RDF 집중분석

<http://ex.org/bib/Book> 은 <http://ex.org/bib/ArtisticWork> 의 하위 클래스다 .

Page 22: RDF 개념 및 구문 소개

RDFS example

2009 시맨틱 웹 튜토리얼 : RDF 집중분석

<http://example.com/ISBN/xxxx> 의 타입이 <http://ex.org/bib/Book> 이면 ,또한 <http://ex.org/bib/ArtisticWork> 의 타입을 갖는다 .

http://example.com/ISBN/xxxx

Page 23: RDF 개념 및 구문 소개

Domain 과 Range

속성은 Domain( 정의역 ) 과 Range( 공역 ) 를 가질 수 있다 .

Domain 은 Property 의 Subject 의 클래스를 알려준다 .

Range 는 Property 의 Object(Value) 의 클래스를 알려준다 .

2009 시맨틱 웹 튜토리얼 : RDF 집중분석

Page 24: RDF 개념 및 구문 소개

2009 시맨틱 웹 튜토리얼 : RDF 집중분석

다음과 같은 Triple 있다 .

Page 25: RDF 개념 및 구문 소개

2009 시맨틱 웹 튜토리얼 : RDF 집중분석

Property <http://ex.org/bib/author> 는 아래와 같이 domain 과 range를 갖는다

Page 26: RDF 개념 및 구문 소개

2009 시맨틱 웹 튜토리얼 : RDF 집중분석

우리는 이와 같이 subject 와 object 의 type 을 추론할 수 있다 .

Page 27: RDF 개념 및 구문 소개

2009 시맨틱 웹 튜토리얼 : RDF 집중분석

RDF Syntax

Page 28: RDF 개념 및 구문 소개

Graph 를 언어로 표현하기

Turtle a text based format, easy to scribble, easy

to read

RDF/XML an XML based format, hard to read/write

2009 시맨틱 웹 튜토리얼 : RDF 집중분석

Page 29: RDF 개념 및 구문 소개

Turtle – Basic Syntax

Triple 은 마침표 (.) 로 끝을 맺는다 . URIs 는 <> 로 감싸서 표현한다 . Literal 은 “” 로 감싼다 . 약식 URI 를 위해 prefix 를 사용한다

2009 시맨틱 웹 튜토리얼 : RDF 집중분석

<http://example.com/Thing> <http://example.com/relation> “some text” .

@prefix ex: <http://example.com> .ex:Thing ex:relation “some text” .

ex:Thing ex:relation2 “some text2” .

Page 30: RDF 개념 및 구문 소개

Turtle – Basic Syntax

Blank Nodes

2009 시맨틱 웹 튜토리얼 : RDF 집중분석

Literal with language

Literals with datatype

@prefix ex: <http://example.com> ._:a ex:relation “some text” .

@prefix ex: <http://example.com> .ex:thing ex:relation “hello@en” .ex:thing ex:relation “Bonjour@fr” .

@prefix ex: <http://example.com> .ex:Thing ex:relation “24”^^http://www.w3.org/2001/XMLScheme#integer .

Page 31: RDF 개념 및 구문 소개

RDF/XML Syntax

2009 시맨틱 웹 튜토리얼 : RDF 집중분석

http://www.dbdb.kr/rdf_tutorial

RDF 개념 및 구문 소개title

DongBum Kimauthor

example

<RDF xmlns:rdf=“http://www.w3.org/1999/02/22-rdf-syntax-ns#” xmlns:ex=“http://www.dbdb.kr/”>

<Description about=“http://www.dbdb.kr/rdf_tutorial”> <ex:author>DongBum Kim</ex:author> <ex:title>RDF 개념 및 구문 소개 </ex:title> </Description></RDF>

Page 32: RDF 개념 및 구문 소개

Movie Database

2009 시맨틱 웹 튜토리얼 : RDF 집중분석

URI : http://movie.naver.com/

Page 33: RDF 개념 및 구문 소개

2009 시맨틱 웹 튜토리얼 : RDF 집중분석

title director country runtime genre reviewer

007 퀀텀 오브 솔러스 마크 포스터 미국 106 분 액션 genie

아내가 결혼했다 정윤수 한국 119 분 멜로 eastkim

… … … … … …

<?xml version=“1.0”>

<RDF xmlns:rdf=“http://www.w3.org/1999/02/22-rdf-syntax-ns#” xmlns:movie=“http://movie.naver.com/”>

<Description rdf:about=“http://movie.naver.com/007quantumofsolace”> <movie:title>007 퀀텀 오브 솔러스 </movie:title> <movie:director> 마크 포스터 </movie:director> <movie:country> 미국 </movie:country> <movie:runtime>106 분 </movie:runtime> <movie:reviewer>genie</movie:reviewer> </Description>

<Description rdf:about=“http://movie.naver.com/2husbands”> <movie:title> 아내가 결혼했다 </movie:title> … </Description></RDF>

Page 34: RDF 개념 및 구문 소개

RDF Main Elements

2009 시맨틱 웹 튜토리얼 : RDF 집중분석

<rdf:RDF> ElementRDF 문서의 root Element

<rdf:Description> Elementabout 속성을 가진 resource 를 식별 ( 기술 ) 하기 위해 사용Resource 를 기술하기 위한 여러 Element(title, director, etc) 를 포함

<?xml version=“1.0”>

<RDF xmlns:rdf=“http://www.w3.org/1999/02/22-rdf-syntax-ns#” xmlns:movie=“http://movie.naver.com/”>

.

. Description goes here

.

</RDF>

<Description rdf:about=“http://movie.naver.com/007quantumofsolace”> <movie:title>007 퀀텀 오브 솔러스 </movie:title> <movie:director> 마크 포스터 </movie:director> <movie:country> 미국 </movie:country> <movie:runtime>106 분 </movie:runtime> <movie:reviewer>genie</movie:reviewer> </Description>

<Description rdf:about=“http://movie.naver.com/2husbands”> <movie:title> 아내가 결혼했다 </movie:title> … </Description>

Page 35: RDF 개념 및 구문 소개

RDF Main Elements

2009 시맨틱 웹 튜토리얼 : RDF 집중분석

Properties as Attributes

<Description rdf:about=“http://movie.naver.com/007quantumofsolace” movie:title=“007 퀀텀 오브 솔러스” movie:director=“ 마크 포스터” movie:country=“ 미국” movie:runtime=“106 분” movie:reviewer=“genie”/>

Properties as Resources

<Description rdf:about=“http://movie.naver.com/007quantumofsolace”> <movie:title>007 퀀텀 오브 솔러스 </movie:title> <movie:director> 마크 포스터 </movie:director> <movie:country> 미국 </movie:country> <movie:runtime>106 분 </movie:runtime> <movie:reviewer>genie</movie:reviewer> </Description>

Page 36: RDF 개념 및 구문 소개

RDF Main Elements

2009 시맨틱 웹 튜토리얼 : RDF 집중분석

rdf:Alt, Bag, Description, ID, List, Property, Statement, Seq, XMLLiteral

about, first, nodeID, object, parseType, predicate, resource, rest, subject, type, value, nil

rdfs:Class, Container, ContainerMembershipProperty, Datatype, Literal, Resource

comment, domain, isDefinedBy, label, member, range, sellAlso, subClassOf, subPropertyOf

Page 37: RDF 개념 및 구문 소개

2009 시맨틱 웹 튜토리얼 : RDF 집중분석

XML 과 무엇이 다른가 ?

Page 38: RDF 개념 및 구문 소개

2009 시맨틱 웹 튜토리얼 : RDF 집중분석

<author> <uri>page</uri> <name>Ora</name></author>

<document href=“page”> <author>Ora</author></document>

<document> <details> <uri>href=“page”</uri> <author> <name>Ora</name> </author> </details></document>

<document> <author> <uri>href=“page”</uri> <details> <name>Ora</name> </details> </author></document>

<document href=“http://www.w3.org/test/page” author=“Ora” />

or may be

or may be

or may be

다음 XML 이 나타내고자 하는 것은 ?

Page 39: RDF 개념 및 구문 소개

What is the author of page?

2009 시맨틱 웹 튜토리얼 : RDF 집중분석

<v> <x> <y>a=“pppp”</y> <z> <w>qqqqq</w> </z> </x></v>

x zy

인가 ?

위 구문에서 설명하고자 하는 것은 무엇인가 ?

Page 40: RDF 개념 및 구문 소개

In RDF Graph

2009 시맨틱 웹 튜토리얼 : RDF 집중분석

<Description about="http://www.w3.org/test/page" Author ="Ora" />

page

Orahas author

<?xml version="1.0"?> <Description about="http://www.w3.org/test/page“>

<s:Author ="http://www.w3.org/staff/Ora" /> </Description>

Page 41: RDF 개념 및 구문 소개

The RDF Graph displays the same thing

2009 시맨틱 웹 튜토리얼 : RDF 집중분석

<Description about=“x" y=“z” />

<?xml version="1.0"?> <Description about=“x“>

<y =“z” /> </Description>

x zy

Page 42: RDF 개념 및 구문 소개

분산된 데이터의 웹에서

2009 시맨틱 웹 튜토리얼 : RDF 집중분석

page Orahas author

Ora 가 글을

작성했다

Ora 가영화

‘ xxx’ 에출연했다

xxx

plays in

Ora 는 ‘ page’ 의 저자이고 , 영화

‘ xxx’ 에 출연했다

통합문서

Page 43: RDF 개념 및 구문 소개

RDF 활용 (RDF Vocabularies)

RSS 1.0 FOAF FRBR Creative Commons SKOS Geo

2009 시맨틱 웹 튜토리얼 : RDF 집중분석

Page 44: RDF 개념 및 구문 소개

2009 시맨틱 웹 튜토리얼 : RDF 집중분석

감사합니다 .

Question?