1 Semantic Web & Ontology Reyhan Aydoğan 20/02/2007.

39
1 Semantic Web & Ontology Reyhan Aydoğan 20/02/2007
  • date post

    21-Dec-2015
  • Category

    Documents

  • view

    226
  • download

    1

Transcript of 1 Semantic Web & Ontology Reyhan Aydoğan 20/02/2007.

Page 1: 1 Semantic Web & Ontology Reyhan Aydoğan 20/02/2007.

1

Semantic Web & Ontology

Reyhan Aydoğan20/02/2007

Page 2: 1 Semantic Web & Ontology Reyhan Aydoğan 20/02/2007.

2

Semantic Web Information on the Web

Both human and machine understandable Deal with

Presentation of information Meaning of content and structure

Example Applications [1] Task-Centered Knowledge Support through

Semantic Markup Semantic Gadget in a museum Advance Search Engines

Page 3: 1 Semantic Web & Ontology Reyhan Aydoğan 20/02/2007.

3

Example 1 [2]

Search the web for performing particular task The system understands the task of users and

gives better service in order to achieve the goal.

E.g. when the user search the car keyword, if the system can understand the user’s task is to repair the car, it can perform search in accordance with the task instead of a general search.

Page 4: 1 Semantic Web & Ontology Reyhan Aydoğan 20/02/2007.

4

Example 1: Two dimensions

Anticipatability: measures the how easy or difficult to anticipate the question US History “Who was the 19th U.S. present” Easy “Is Pat Hayes related to Rutherford Hayes” Difficult

Frequency of occurrence: Who the current U.S. president is, is more frequent

than who the 19th U.S. president is. By limiting the domain, we can better

anticipate the kinds of tasks people working on.

Support in the frequently asked and moderately anticipatable questions.

Page 5: 1 Semantic Web & Ontology Reyhan Aydoğan 20/02/2007.

5

Example2 [3]

Apply Semantic Web onto Ubiquitous Computing Semantic gadget in a museum Guide and recommend in accordance

with environmental conditions with using semantics

If the temperature is too warm and we do not like to carry our coat, the gadget may suggest leaving it in the car

Page 6: 1 Semantic Web & Ontology Reyhan Aydoğan 20/02/2007.

6

Ontology “Specification of concepts and their

meanings” Shared and common understanding

of knowledge concerning domain of interests

Page 7: 1 Semantic Web & Ontology Reyhan Aydoğan 20/02/2007.

7

Gruber Ontology Definition

Page 8: 1 Semantic Web & Ontology Reyhan Aydoğan 20/02/2007.

8

Describing Semantics [4]

Individual

PropertyClass

Wine

ChateauMorgonBordeaux

hasColor

is an instance of

has value for

restrict

Page 9: 1 Semantic Web & Ontology Reyhan Aydoğan 20/02/2007.

9

Class Construct

The ontological class concept Related to Object class in OOP

Class Represents a group of individuals

with similar property Eg. Food, Wine, Person,

Restaurant

Class

Page 10: 1 Semantic Web & Ontology Reyhan Aydoğan 20/02/2007.

10

Property Construct Property construct associates

Attribute/ value pairs with instances Binary association relating an instance

to another instance or a simple data value

E.g. price, size, name, color Similar to accessor method in OOP

But, a property can be associated with multiple unrelated classes rather than a single class

Property

Page 11: 1 Semantic Web & Ontology Reyhan Aydoğan 20/02/2007.

11

Individuals Individuals represent

Class object instances in the domain Similar to objects in OOP

But individuals are only information representations and not have associated functionality

E.g. Mark, MyPieSlice, KnightRestaurant “It is difficult to differentiate between

individuals and classes” [4]

Individual

Page 12: 1 Semantic Web & Ontology Reyhan Aydoğan 20/02/2007.

12

Meanings

<Sentence><Subject>

Wine</Subject><Verb>

is made from</Verb><Object>

Grape </Object>

</Sentence>

DocumentOntology

Natural Language

Page 13: 1 Semantic Web & Ontology Reyhan Aydoğan 20/02/2007.

13

Ontology Main elements of an ontology:

Concepts Relationships

Hierarchical Logical

Properties Instances (individuals)

Page 14: 1 Semantic Web & Ontology Reyhan Aydoğan 20/02/2007.

14

Semantic Relationships [4]

Synonymy Relation (Equivalence) Two names for the same meaning Eg. “Restaurant and “Eating

Establisment” [class-class] “Cost” and “price” [property-property] “John Smith” and

“Restaurant123Owner”[individual-individual]

Page 15: 1 Semantic Web & Ontology Reyhan Aydoğan 20/02/2007.

15

Semantic Relationships cont.

Antonymy Relation Identifies opposite concepts Disjointness: An item cannot be an

instance of both of the disjoint items E.g. “Regular Priced Menu Item” and

“Sale Priced Menu Item”

Page 16: 1 Semantic Web & Ontology Reyhan Aydoğan 20/02/2007.

16

Semantic Relationships cont.

Hyponymy Relation (is-a relationship) Specialization or generalization Taxonomical hierarchies

Dessert

Pie Cake

Specialization

Generalization

Page 17: 1 Semantic Web & Ontology Reyhan Aydoğan 20/02/2007.

17

Semantic Relationships cont.

Meronymy/Holonymy Relation Part-of relation Defines composition or part-of

relationsSpaghetti and Meatballs Dish

Spaghetti Meatballs

Holonymy Meronymy

Page 18: 1 Semantic Web & Ontology Reyhan Aydoğan 20/02/2007.

18

RDF (Resource Description Framework)

Simple language Captures statements

Triples of <subject, predicate, object> E.g. <Eric Miller, hasTitle, Dr. >

Express the content itself Resources uniquely identified to

prevent confusion

Page 19: 1 Semantic Web & Ontology Reyhan Aydoğan 20/02/2007.

19

Example= Resources (URI)

=Literals

Page 20: 1 Semantic Web & Ontology Reyhan Aydoğan 20/02/2007.

20

Xml-based syntax

Page 21: 1 Semantic Web & Ontology Reyhan Aydoğan 20/02/2007.

21

Example <?xml version="1.0"?><RDF> <Description about="http://www.w3schools.com/RDF"> <author>Jan Egil Refsnes</author><homepage>http://www.w3schools.com</homepage></Description> </RDF> Subject: "http://www.w3schools.com/RDF"> Predicate : author Object: Jan Egil Refsnes

Page 22: 1 Semantic Web & Ontology Reyhan Aydoğan 20/02/2007.

22

Attributes

The <rdf:Description> element contains the description of the resource identified by the rdf:about attribute.

<rdf:ID> is for identification of resource where <rdf:about> is for referring a resource.

Rdf:type specifies the type of subject

Page 23: 1 Semantic Web & Ontology Reyhan Aydoğan 20/02/2007.

23

RDF Schema Language for describing RDF vocabulary Extension of RDF RDF talks about the object where RDF

Schema defines classes for objects Be able to represent a hierarchy of

classes “subClassOf” property

Use some constraints on properties Domain and range

Page 24: 1 Semantic Web & Ontology Reyhan Aydoğan 20/02/2007.

24

Example <?xml version="1.0"?><rdf:RDF xmlns:rdf= "http://www.w3.org/1999/02/22-rdf-syntaxns#" xmlns:rdfs=http://www.w3.org/2000/01/rdf-schema#xml:base= "http://www.animals.fake/animals#"><rdf:Description rdf:ID="animal"><rdf:type

rdf:resource="http://www.w3.org/2000/01/rdfschema#Class"/>

</rdf:Description><rdf:Description rdf:ID="horse"> <rdf:type

rdf:resource="http://www.w3.org/2000/01/rdfschema#Class"/>

<rdfs:subClassOf rdf:resource="#animal"/> </rdf:Description></rdf:RDF>

Page 25: 1 Semantic Web & Ontology Reyhan Aydoğan 20/02/2007.

25

SubClassOF

Page 26: 1 Semantic Web & Ontology Reyhan Aydoğan 20/02/2007.

26

RDF Schema Example

Page 27: 1 Semantic Web & Ontology Reyhan Aydoğan 20/02/2007.

27

Discussion from 494 course slide [Pinar Yolum] JAVA: Class book has an attribute author of typeperson RDF: There is an author property between a bookand a person JAVA: If you are talking about a newspaper, youneed to define a new author attribute (Local scope) RDF: Define an author property once. (Globalscope) JAVA: You can’t talk about an author attributewithout a class RDF: You can if you don’t specify a domain

Page 28: 1 Semantic Web & Ontology Reyhan Aydoğan 20/02/2007.

28

Discussion from 494 course slide [Pinar Yolum] JAVA:

– Class sportsarcticle has an attribute author of type male– Class newsarticle has an attribute author of type female

RDF: Cannot match different domains with ranges JAVA is prescriptive

- Won’t allow a male as the author of a news article RDF is descriptive; usage is application-dependent

– Enforce constraints (like JAVA)– If the author of a news article is not known infer female– Accept the existence of a news article without an author– Accept a news article with an editor attribute instead

Page 29: 1 Semantic Web & Ontology Reyhan Aydoğan 20/02/2007.

29

OWL

Web Ontology Language Two types of property

Data property: string, int and so on Object property has characteristics:

Symmetric Transitive Functional inverseOf Inverse functional

Page 30: 1 Semantic Web & Ontology Reyhan Aydoğan 20/02/2007.

30

Symmetric Property P(x,y) iff P(y,x)

Page 31: 1 Semantic Web & Ontology Reyhan Aydoğan 20/02/2007.

31

Transitive Property P(x,y) and P(y,z) implies P(x, z)

Page 32: 1 Semantic Web & Ontology Reyhan Aydoğan 20/02/2007.

32

Functional Property P(x,y) and P(x,z) implies y = z

Page 33: 1 Semantic Web & Ontology Reyhan Aydoğan 20/02/2007.

33

InverseOf P1(x,y) iff P2(y,x)

<owl:ObjectProperty rdf:ID="hasMaker"><rdf:type

rdf:resource="&owl;FunctionalProperty" /></owl:ObjectProperty> <owl:ObjectProperty

rdf:ID="producesWine"> <owl:inverseOf rdf:resource="#hasMaker" />

</owl:ObjectProperty>

Page 34: 1 Semantic Web & Ontology Reyhan Aydoğan 20/02/2007.

34

Property Constraints

allValuesFrom, someValuesFrom <owl:onProperty rdf:resource="#hasMaker" />

<owl:allValuesFrom rdf:resource="#Winery" />

cardinality <owl:onProperty rdf:resource="#hasVintageYear"/>

<owl:cardinality rdf:datatype="&xsd;nonNegativeInteger">1

</owl:cardinality>

hasValue <owl:onProperty rdf:resource="#hasSugar" />

<owl:hasValue rdf:resource="#Dry" />

Page 35: 1 Semantic Web & Ontology Reyhan Aydoğan 20/02/2007.

35

Others Disjoint

Equivalence <owl:Class rdf:ID="TexasThings"> <owl:equivalentClass> <owl:Restriction> <owl:onProperty rdf:resource="#locatedIn" />

<owl:someValuesFrom rdf:resource="#TexasRegion" /> </owl:Restriction>

</owl:equivalentClass> </owl:Class>

Page 36: 1 Semantic Web & Ontology Reyhan Aydoğan 20/02/2007.

36

SPARQL: Query Language

Page 37: 1 Semantic Web & Ontology Reyhan Aydoğan 20/02/2007.

37

Conclusion

Ontology Tool Protégé

Ontology API KAON2 & JENA

Query Language: SPARQL

Page 38: 1 Semantic Web & Ontology Reyhan Aydoğan 20/02/2007.

38

References [1] Fensel, D., J. Hendler, H. Lieberman and W. Wahlster,

Spinning the Semantic Web, MIT Press, Cambridge, 2003. [2] Jasper, R. and M. Uschold, “Enabling Task-Centered

Knowledge Support though Semantic Markup”, In Spinning the Semantic Web, pp. 223-251, MIT Press, Cambridge,2003.

[3] Lassila, O. and M. Adler, “Ubiquitous Computing Meets the Semantic Web”, In Spinning the Semantic Web, pp. 363-376, MIT Press, Cambridge, 2003.

[4] Lee, W. L. , OWL: Representing Informaton Using the Web Ontology Language, Trafford Publishing, 2005.

[5] Munindar P. Singh and Michael N. Huhns, Service-Oriented Computing: Semantics, Processes, Agents, Wiley, 2004

Page 39: 1 Semantic Web & Ontology Reyhan Aydoğan 20/02/2007.

39

References For examples:

http://www.w3schools.com/ [5] Service-Oriented Computing: Semantics, Processes,

Agents

Discussion http://www.cmpe.boun.edu.tr/courses

/cmpe494/fall2005/slides/soc-slides-rdf.pdf

OWL http://www.w3.org/TR/owl-guide/