Practical Introduction to the Semantic Mediawiki

34
Semantic mediawiki AIFB Some slide taken from Danny Drandevic

Transcript of Practical Introduction to the Semantic Mediawiki

Page 1: Practical Introduction to the Semantic Mediawiki

Semantic mediawiki AIFB

Some slide takenfrom Danny Drandevic

Page 2: Practical Introduction to the Semantic Mediawiki

2

Semantic MediaWiki Extension of MediaWiki

Popular Wiki engine Powers Wikipedia

Extends MediaWiki by enabling… Typed links Property – Value Inline queries New ways to explore the content

Open source and well documented

Page 3: Practical Introduction to the Semantic Mediawiki

3

An example RDF Schema

Writer hasWritten Book

FamousWriter

/twain/mark ../ISBN00010475

Schema(RDFS)Data(RDF)

hasWrittentype

subClassOf

domain range

type

Annotation of WWW resources and semantic links

Page 4: Practical Introduction to the Semantic Mediawiki

4

Concepts

INSTANCE <=> PAGE CLASS <=> CATEGORY RELATION <=> PROPERTY

Page 5: Practical Introduction to the Semantic Mediawiki

5

Instance <-> Page

Page 6: Practical Introduction to the Semantic Mediawiki

6

Class <-> Category

Page 7: Practical Introduction to the Semantic Mediawiki

7

Relation <-> Property

Page 8: Practical Introduction to the Semantic Mediawiki

8

Instance <-> Page

Page 9: Practical Introduction to the Semantic Mediawiki

9

Instance

Blue linksmean there isa page aboutit

Red linkmeans thereis no pageabout it

Page 10: Practical Introduction to the Semantic Mediawiki

10

Class <-> Category

There are pages describingcategories

Page 11: Practical Introduction to the Semantic Mediawiki

11

Class <-> Category

Subclass (subcategory) of

Page 12: Practical Introduction to the Semantic Mediawiki

12

Class <-> Category

Extensional descriptionList of all instancesBut: only direct ones

Page 13: Practical Introduction to the Semantic Mediawiki

13

Categories

Informal description Can be discussed Can be edited

Page 14: Practical Introduction to the Semantic Mediawiki

14

Relation <-> Property

There are pages describingproperties

Page 15: Practical Introduction to the Semantic Mediawiki

15

Relation <-> Property

Datatype definition

Page 16: Practical Introduction to the Semantic Mediawiki

16

Data values and types Attributes like [[birthdate::February 27 1978]] or

[[population::3,635,389]] must know the type of the value This is done by adding [[has type::T]] on the page of the

attribute Available, predefined types:

o Annotation URIo Dateo Emailo Enumerationo Floato Geographic coordinate

IntegerPageStringTemperatureTextURL

Page 17: Practical Introduction to the Semantic Mediawiki

17

Special:Categories

Page 18: Practical Introduction to the Semantic Mediawiki

18

Special:Properties

Page 19: Practical Introduction to the Semantic Mediawiki

19

Special:Ask

Page 20: Practical Introduction to the Semantic Mediawiki

20

Query examples - CategoryFor example, the query:

[[Category:Teacher]]

is a query for all pages within the category Teacher,i.e. for all teachers. If you enter this in Special:Askand click "Find results", SMW executes the queryand displays results as a simple list of all requestedpages. If there are many results, they can bebrowsed via the navigations links at the top andbottom of the query results

Page 21: Practical Introduction to the Semantic Mediawiki

21

Query examples - SubcategoriesFor example, the query:

[[Category:Person]]

Will find all pages in the categories Teachers, Students andOrganizer if these categories are subcategories of Person

Page 22: Practical Introduction to the Semantic Mediawiki

22

Query examples - combining queries (AND)

For example, the query:

[[Category:Person]] [[has nationality::Italy]]

Will find all items in category Person that have the property ofbeing italian. (AND)

Page 23: Practical Introduction to the Semantic Mediawiki

23

Query examples - combining queries (OR)

For example, the query:

[[Category:Organizer || Teacher]]Will find all items that are category Organizer OR in category

Teacher (Set Union).

[[Category:Organizer]] || [[has nationality::Italy]]

Will find all items that are category Person PLUS (Union) allthose that have the property of being italian. (OR)

Page 24: Practical Introduction to the Semantic Mediawiki

24

Query examples - PropertiesFor example, the query:

[[has nationality::Italy]]

Will find all occurencies that have the specified property.

Page 25: Practical Introduction to the Semantic Mediawiki

25

Query examples - conditions on attributes

For example, the query:

[[Category:City]] [[Has population>1,000,000]]

Will find all pages in the category City, having more than onemillion inhabitants.

Page 26: Practical Introduction to the Semantic Mediawiki

26

All cities having a has population property

[[Category:City]] [[has population::+]]

Page 27: Practical Introduction to the Semantic Mediawiki

27

All cities having and their population

[[Category:City]] [[has population::*]]

Page 28: Practical Introduction to the Semantic Mediawiki

28

All cities with more than 1,000,000 peopleand their population

[[Category:City]] [[has population::>1,000,000]][[has population::*]]

Page 29: Practical Introduction to the Semantic Mediawiki

29

Embedding queries into pages

<ask>…</ask>

Page 30: Practical Introduction to the Semantic Mediawiki

30

Formatting and sorting

Seehttp://ontoworld.org/wiki/Help:Inline_queries

Page 31: Practical Introduction to the Semantic Mediawiki

31

Social aspects

You are free to define categories and properties, but…

How to decide which properties and categories areimportant?

How to define the properties or categories? How to ensure high quality data? What does it mean? How to control the wiki knowledge base and its growth?

Page 32: Practical Introduction to the Semantic Mediawiki

32

Querying and social aspects

Querying can only be done on aligned vocabularies If half of the people use “affiliation” and the other half “works

for” you cannot query the knowledge easily

Inside SMW, information integration usually happenswith social tools, not with technology

Gardening tools can help with aligning vocabularies,but not replace them Tools that allow you to rename a property throughout the wiki Or to join two different names

Page 33: Practical Introduction to the Semantic Mediawiki

33

Exporting the data Every page can export its knowledge as RDF

Page 34: Practical Introduction to the Semantic Mediawiki

34

Go to the wiki!

If you are e.g. Bjorn Hassler, and your user page is Bjorn: Copy the content of your User:Bjorn page into a new page

called Bjorn Hassler Add to it the right categories (e.g. Man, Teacher) Add to it the right properties and values (e.g. Has nationality, Has e-

mail) Replace the content of your old User: page User:Bjorn with a link

to your new page [[Bjorn Hassler]] Go to the Special:Ask page and play with queries

Discuss in group and propose new Categories and Properties