introduction to rdf and rdfs editor: mr 3 susumu tamagawa osm 2011, lecture and exercise, web...

32
Introduction to RDF and RDFS Editor: MR 3 Susumu Tamagawa M 2011, Lecture and Exercise, Web Intelligence

Upload: selena-berks

Post on 14-Dec-2015

222 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: Introduction to RDF and RDFS Editor: MR 3 Susumu Tamagawa OSM 2011, Lecture and Exercise, Web Intelligence

Introduction to RDF and RDFS Editor: MR3

Susumu Tamagawa

OSM 2011, Lecture and Exercise, Web Intelligence

Page 2: Introduction to RDF and RDFS Editor: MR 3 Susumu Tamagawa OSM 2011, Lecture and Exercise, Web Intelligence

Contents

• Overview of MR3

• Fundamental Concepts of RDF and RDFS• Issues• Detail of MR3

• Tutorial of MR3

• Exercises

Page 3: Introduction to RDF and RDFS Editor: MR 3 Susumu Tamagawa OSM 2011, Lecture and Exercise, Web Intelligence

Overview of MR3

• Graphical RDF and RDFS editor• MR3: Meta-Model Management based on

RDFs Revision Reflection• Main feature

– Managing some relationships between RDF and RDFS contents

• Place to obtain– http://mr3.sourceforge.net/

Page 4: Introduction to RDF and RDFS Editor: MR 3 Susumu Tamagawa OSM 2011, Lecture and Exercise, Web Intelligence

Fundamental Concepts ofRDF (Resource Description Framework)

• Resource– an object, a “thing” we want to talk about

• Property– a special kind of resources– relations between resources

• Statement– an object-attribute-value triple

• Literal– an atomic value– the object of an RDF statement (not the subject or the

predicate)

values (resource or literal)

Page 5: Introduction to RDF and RDFS Editor: MR 3 Susumu Tamagawa OSM 2011, Lecture and Exercise, Web Intelligence

An example of RDF statements

subject (Resource) predicate (Property) object (Literal)

hasFather

Statement

Model Personrdf:type

William object (Resource)

Charles

Syntax (XML)<rdf:Description about=“William”>  <hasFather>Charles</hasFather> <rdf:type resource=“Person”/></rdf:Description>

Resource

Property

Literal

Page 6: Introduction to RDF and RDFS Editor: MR 3 Susumu Tamagawa OSM 2011, Lecture and Exercise, Web Intelligence

Fundamental Concepts ofRDFS (RDF Vocabulary Description Language,

RDF Schema )

• Providing modeling primitives for expressing the RDF model

• Class– Defining groups of related resources– Hierarchical relationships between classes

• rdfs:subClassOf property

• Property– Defining the relationships between resources– Hierarchical relationships between properties

• rdfs:subPropertyOf property

– Domain and range of a property• rdfs:domain and rdfs:range property

Page 7: Introduction to RDF and RDFS Editor: MR 3 Susumu Tamagawa OSM 2011, Lecture and Exercise, Web Intelligence

An example of RDFS statements

<rdf:Class rdf:about=“Person”> <rdfs:subClassOf resource=“&rdfs;Resource”/> </rdf:Class><rdf:Property rdf:about=“hasFather”></rdf:Property>

Syntax (XML)

Model

hasFather rdf:Propertyrdf:type

Person

rdfs:Classrdf:type

rdfs:Resourcerdfs:subClassOf

Class

Property Meta-Model

RDFS

=

rdfs:domain

RDFS model and syntax are same as RDF

Note

Page 8: Introduction to RDF and RDFS Editor: MR 3 Susumu Tamagawa OSM 2011, Lecture and Exercise, Web Intelligence

Issues

• High cost of building up RDF and RDFS contents manually

• Conventional Tools– Displaying XML based contents with RDF model

RDFS model +

RDF model

Page 9: Introduction to RDF and RDFS Editor: MR 3 Susumu Tamagawa OSM 2011, Lecture and Exercise, Web Intelligence

An example of RDF and RDFS contents of academic domain

<?xml version="1.0"?><rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:mr3="http://mmm.semanticweb.org/mr3#" xmlns:owl="http://www.w3.org/2002/07/owl#" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" xml:base="http://mmm.semanticweb.org/mr3#"> <rdfs:Class rdf:about="#Academic Staff Member"> <rdfs:subClassOf> <rdfs:Class rdf:about="#Staff Member"/> </rdfs:subClassOf> </rdfs:Class> <rdfs:Class rdf:ID="Course"/> <rdfs:Class rdf:ID="Professor"> <rdfs:subClassOf rdf:resource="#Academic Staff Member"/> </rdfs:Class> <rdfs:Class rdf:about="#Assistant Professor"> <rdfs:subClassOf rdf:resource="#Academic Staff Member"/> </rdfs:Class> <rdfs:Class rdf:about="#Associate Professor"> <rdfs:subClassOf rdf:resource="#Academic Staff Member"/> </rdfs:Class> <rdf:Property rdf:ID="isTaughtBy"> <rdfs:domain rdf:resource="#Course"/> <rdfs:range rdf:resource="#Academic Staff Member"/> </rdf:Property> <mr3:Professor rdf:about="#Takahira Yamaguchi"/> <mr3:Course rdf:about="#Web Intelligence"> <mr3:isTaughtBy rdf:resource="#Takahira Yamaguchi"/> </mr3:Course></rdf:RDF>

•Web Intelligence is taught by Takahira Yamaguchi.•Professor, Associate Professor, Assistant Professor, Academic Staff Member, Staff Member, and Course are classes•All Professors, Associate Professors, and Assistant Professors are Academic Staff Members•All Academic Staff Members are Staff Members•Courses must be taught by academic staff members only

convert into machine readable

English Statements

RDF/XML

Page 10: Introduction to RDF and RDFS Editor: MR 3 Susumu Tamagawa OSM 2011, Lecture and Exercise, Web Intelligence

An example of RDF and RDFS contents of academic domain

Web Intelligence Takahira YamaguchiisTaughtBy

Course ProfessorAssociateProfessor

AssistantProfessor

AcademicStaff Member

StaffMember

rdfs:Class

isTaughtByrdfs:domain

rdfs:range

rdfs:subClassOfrdfs:subClassOf

rdfs:subClassOf

rdfs:subClassOf

rdf:Property

rdf:type

Page 11: Introduction to RDF and RDFS Editor: MR 3 Susumu Tamagawa OSM 2011, Lecture and Exercise, Web Intelligence

MR3

<rdf:RDF xmlns:rdfs=“…rdf-syntax-ns”> <image rdf:about="http://..."> <title>…</title></image>…</rdf:RDF>

<rdf:RDF xmlns:rdfs=“…rdf-schema#"> <rdfs:Class rdf:about="http://purl.org/rss/1.0..."<rdf:Property rdf:about="http://purl.org/rss/1.0..."</rdf:RDF>

Class Property

Property

RDFS Document

RDF Document RDF Data Graph

RDFS Data Graph

(2)

(2) Graphical editing functions of RDFS contents

(1) Graphical editing functions of RDF contents

(1)

(3) RDF and RDFS model management facilities

(3)

LiteralResource

Page 12: Introduction to RDF and RDFS Editor: MR 3 Susumu Tamagawa OSM 2011, Lecture and Exercise, Web Intelligence

RDFS modelrdfs:Resource

Course Professor

is-a

is-aClass

RDF model

isTaughtBy

Property

Web Intelligence Takahira Yamaguchi

Course ProfessorisTaughtBy

type of resources

RDF and RDFS model management facilities(Overview)

AcademicStaff Member

Page 13: Introduction to RDF and RDFS Editor: MR 3 Susumu Tamagawa OSM 2011, Lecture and Exercise, Web Intelligence

RDF and RDFS model management facilities(Detail)

• Manipulation of an RDFS Class– Replace RDFS Class– Removal of RDFS Class

• Manipulation of an RDFS Property– Replace RDFS Property– Removal of RDFS Property

• Replacing the Type of an RDF Resource– Replace the RDFS class name with that referred to

before the use replaced the type of the RDF resource– Create a new RDFS class that has yet to be defined

• Replacing the RDF Property– Replace the RDFS property name with that referred to

before the user replaced the RDF property– Create a new RDFS property that has yet to be defined

O->M facilities

M->Ofacilities

Page 14: Introduction to RDF and RDFS Editor: MR 3 Susumu Tamagawa OSM 2011, Lecture and Exercise, Web Intelligence

RDF and RDFS model management facilities(Example: Replace RDFS Class)

RDFS modelrdfs:Resource

Professor

is-a

is-aClass

isTaughtBy

Property

Takahira Yamaguchi

ProfessorisTaughtBy

AcademicStaff Member

Akito Sakurai

ProfessorisTaughtBy

ClassCourse

Class

Class

RDF modelCourse

CourseWeb Intelligence

Machine Learning

Page 15: Introduction to RDF and RDFS Editor: MR 3 Susumu Tamagawa OSM 2011, Lecture and Exercise, Web Intelligence

Tutorial of MR3

• How to install MR3

• Importing RDF and RDFS documents• Mapping namespace and prefix• Class Editor

– Inserting, Editing, Deleting, and Connecting is-a relationships between classes

• Property Editor– Inserting RDFS property and Defining domain and range of

RDFS property

• RDF Editor– Inserting RDF literal and resource

• Exporting RDF and RDFS model

Page 16: Introduction to RDF and RDFS Editor: MR 3 Susumu Tamagawa OSM 2011, Lecture and Exercise, Web Intelligence

How to install MR3

1. Install JRE (Java Runtime Environment)– http://www.oracle.com/technet

work/java/javase/downloads/index.html

2. Download MR3_1_0RC5.zip– http://sourceforge.net/projects

/mr3/files/MR_3/MR_3%201.0%20RC5/

3. Unzip the download file and execute run.bat

Page 17: Introduction to RDF and RDFS Editor: MR 3 Susumu Tamagawa OSM 2011, Lecture and Exercise, Web Intelligence

Screenshot of MR3

Class Editor Property Editor

RDF EditorAttribute Dialog

Namespace Table

Page 18: Introduction to RDF and RDFS Editor: MR 3 Susumu Tamagawa OSM 2011, Lecture and Exercise, Web Intelligence

Importing RDF and RDFS documents

OR

12

3

4

Other Serialization (N3, N-Triple, Turtle)

Page 19: Introduction to RDF and RDFS Editor: MR 3 Susumu Tamagawa OSM 2011, Lecture and Exercise, Web Intelligence

After importing example_academic_domain.rdf

Staff Member -> Staff_MemberAcademic Staff Member -> Academic_Staff_MemberAssociate Professor -> Associate_ProfessorWeb Intelligence -> Web_IntelligenceTakahira Yamaguchi -> Takahira_Yamaguchi

Space character is not supported in MR3.Please replace space characters by underbars.

Page 20: Introduction to RDF and RDFS Editor: MR 3 Susumu Tamagawa OSM 2011, Lecture and Exercise, Web Intelligence

Mapping namespace and prefix

Page 21: Introduction to RDF and RDFS Editor: MR 3 Susumu Tamagawa OSM 2011, Lecture and Exercise, Web Intelligence

Class EditorInserting class

Page 22: Introduction to RDF and RDFS Editor: MR 3 Susumu Tamagawa OSM 2011, Lecture and Exercise, Web Intelligence

Class EditorEditing class

spell miss

Page 23: Introduction to RDF and RDFS Editor: MR 3 Susumu Tamagawa OSM 2011, Lecture and Exercise, Web Intelligence

Class EditorRemoving class

Page 24: Introduction to RDF and RDFS Editor: MR 3 Susumu Tamagawa OSM 2011, Lecture and Exercise, Web Intelligence

Class EditorConnecting is-a relationships between classes

connect mode

drag & drop

move mode

Let’s insert exp:Assistant Professor class and connect is-a relationships between Assistant Professor class and Academic Staff Member class.

Excercise

Page 25: Introduction to RDF and RDFS Editor: MR 3 Susumu Tamagawa OSM 2011, Lecture and Exercise, Web Intelligence

Property EditorInserting RDFS property

Page 26: Introduction to RDF and RDFS Editor: MR 3 Susumu Tamagawa OSM 2011, Lecture and Exercise, Web Intelligence

Property EditorDefining domain and range of RDFS property

Page 27: Introduction to RDF and RDFS Editor: MR 3 Susumu Tamagawa OSM 2011, Lecture and Exercise, Web Intelligence

RDF EditorInserting RDF literal

Professor Takahira Yamaguchi's phone number is 045-566-1614.

Page 28: Introduction to RDF and RDFS Editor: MR 3 Susumu Tamagawa OSM 2011, Lecture and Exercise, Web Intelligence

RDF EditorInserting RDF resource (1)Machine Learning Course is taught by Professor Akito Sakurai.

Page 29: Introduction to RDF and RDFS Editor: MR 3 Susumu Tamagawa OSM 2011, Lecture and Exercise, Web Intelligence

RDF EditorInserting RDF resource (2)Machine Learning Course is taught by Professor Akito Sakurai.

Page 30: Introduction to RDF and RDFS Editor: MR 3 Susumu Tamagawa OSM 2011, Lecture and Exercise, Web Intelligence

Exporting RDF and RDFS model

Page 31: Introduction to RDF and RDFS Editor: MR 3 Susumu Tamagawa OSM 2011, Lecture and Exercise, Web Intelligence

Exercises1. Convert the following English statements to an RDF and RDFS model.

– All trucks, vans, passenger vehicles are motor vehicles.– All mini vans are passenger vehicles and vans.– All Toyota Corollas are passenger vehiecles.– Taro owns a toyota corolla.– Taro is a person.– Toyota motor corporation makes Toyota Corollas.– Toyota motor corporation is a automobile company.– Taro's vehicle registration number is xxxx-xxxx.– Persons only have motor vehicles.– Motor vehicles must be owned by persons only.– Vehicle registration numbers must be owned by motor vehicles only.– Motor vehicles must be made by automobile companies only.

2. Construct an RDFS ontology including a set of instances about your interest (music, computer, sports, etc).

– Create at least 10 classes and at least 5 properties with domain and range classes– Use at least 5 subClassOf statements.

Page 32: Introduction to RDF and RDFS Editor: MR 3 Susumu Tamagawa OSM 2011, Lecture and Exercise, Web Intelligence

References

• http://people.csail.mit.edu/pcm/Hendler.pdf• http://people.csail.mit.edu/pcm/Hawke.pdf• A Semantic Web Primer, 2nd Edition

– ISBN-13: 978-0262012423• http://mr3.sourceforge.net/