logics for data and knowledge representation

18
Logics for Data and Knowledge Representation Resource Description Framework (RDF) -- Exercises Feroz Farazi

Upload: camden-hart

Post on 01-Jan-2016

29 views

Category:

Documents


0 download

DESCRIPTION

Logics for Data and Knowledge Representation. Resource Description Framework (RDF) -- Exercises. Feroz Farazi. Exercise 1. Table: Product. Produce an RDF triple representation of the product, manufacturer and stock information provided in the following table. Solution. Exercise 2. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Logics for Data and  Knowledge Representation

Logics for Data and Knowledge Representation

Resource Description Framework (RDF) -- Exercises

Feroz Farazi

Page 2: Logics for Data and  Knowledge Representation

Exercise 1

Produce an RDF triple representation of the product,

manufacturer and stock information provided in the following

table.

Table: Product

ID Model Number

Division Product Line

Manufacturing Location

SKU Available

1 RT-11 Safety Safety valve

Trento LM5647 70

2 RTX-56 Safety Safety valve

Trento DK3852 30

3 MBB-32 Accessories Monitor Hong Kong CM7823 50

4 DR-43 Control Engineering

Sensor Malaysia SN2643 30

Page 3: Logics for Data and  Knowledge Representation

Solution

Subject Predicate Object

product:Product1 product:id 1

product:Product1 product:modelNumber RT-11

product:Product1 product:division Safety

product:Product1 product:productLine Safety Valve

product:Product1 product:manufacturingLocation

Trento

product:Product1 product:sku LM5647

product:Product1 product:available 70

product:Product2 product:id 2

product:Product2 product:modelNumber RTX-56

Page 4: Logics for Data and  Knowledge Representation

Exercise 2 applications that use RDF data from multiple sources need

to overcome the issue of managing terminology. For

example, one source uses the term analyst and another uses

the term researcher. A set of relations can hold between

these two terms depending on the types of usages. It might

be the case that a researcher is treated as a special case of

an analyst. How can we represent that?

Page 5: Logics for Data and  Knowledge Representation

Solution We examine the inferences we want to draw with the

provided information. If a researcher is a special case of

analyst, then all researchers are also analysts. This kind of

“if/then” relationship can be represented with a single

rdfs:subClassOf relation.

:Researcher rdfs:subClassOf :Analyst

Page 6: Logics for Data and  Knowledge Representation

Exercise 3

Given that there is considerable overlap between the two

concepts researcher and analyst. Also consider that there

could be some analysts who are not researchers, and vice

versa. How can we treat the entities of this two concepts as

the same?

Page 7: Logics for Data and  Knowledge Representation

Solution

In this case we can take the union of this two classes as

they overlap (partially). We define a new class suppose

Investigator as both the Researcher and Analyst can be

treated so. Finally, we assert that the class Investigator is the

union of the overlapping classes.:Researcher rdfs:subClassOf :Investigator

:Analyst rdfs:subClassOf :Investigator

Page 8: Logics for Data and  Knowledge Representation

Exercise 4

Given that the concepts researcher and analyst are identical

in every way the fact that they are two terms for the same

thing. How can it be inferred that any member of one class is

a member of the other, and vice versa?

Page 9: Logics for Data and  Knowledge Representation

Solution In this case, the classes are equivalent. RDFS does not

provide a primitive construct for expressing class equivalence.

However, the same task can be done using rdfs:subClassOf.

:Analyst rdfs:subClassOf :Researcher

:Researcher rdfs:subClassOf :Analyst

Suppose we have following axioms:

:John rdf:type :Researcher

:Enrico rdf:type :Analyst

We can infer that:

:John rdf:type :Analyst

:Enrico rdf:type :Researcher

Page 10: Logics for Data and  Knowledge Representation

Exercise 5

Given that a military mission planner wants to determine

where weapons can be targeted. There are many sources of

information contributing to the decision.

One source provides a list of targets and their types, some of which

such as civilian facilities including churches, schools and hospitals

must never be targeted.

Another source provides descriptions of airspaces including off-limits

such as politically defined no-fly zones.

A target is determined to be off-limits if it is excluded on the grounds of

either of these data sources.

Page 11: Logics for Data and  Knowledge Representation

Solution A class that will include all the entities of the civilian facility

and no-fly zone can be defined. We can define OffLimit,

CivilianFacility and NoFlyZone as classes and make the first

as the union of the other two.

cf:CivilianFacility rdfs:subClassOf mmp:OffLimits

cf:NoFlyZone rdfs:subClassOf mmp:OffLimits

Page 12: Logics for Data and  Knowledge Representation

Exercise 6 Suppose an application imported RDF data from an excel file.

There are two classes of entities, Person and Movie, defined by the import.

For Person a property called personName is defined that gives the name

by which that person is known.

For Movie, the property called movieTitle gives the title under which the

movie was released.

How to use the standard property rdfs:label to develop a generic

display mechanism for showing both the names of the persons

and titles of the movies?

Page 13: Logics for Data and  Knowledge Representation

Solution

We can define each of the properties as the as a

subproperty of rdfs:label

personName rdfs:subPropertyOf rdfs:label

movieTitle rdfs:subPropertyOf rdfs:label

Page 14: Logics for Data and  Knowledge Representation

Exercise 7 Consider that a shipping company has a fleet of vessels

including new ones that are under construction old ones that are being repaired the ones that are currently in service the ones that have been retired from service

Name Maiden Voyage

Next Departure

Decommission Date

Destruction Date

Titanic April 10, 1912

April 14, 1912

MV 16 May 23, 2001

November 29, 2013

MV 22 June 8, 1970

February 10, 1998

Table: Ships

Page 15: Logics for Data and  Knowledge Representation

Exercise 7

Following axioms represent partial information of the ships:

ship:MV16 ship:nextDeparture “November 29, 2013”

ship:MV22 ship:maidenVoyage “June 8, 1970”

ship:Titanic ship:destructionDate “April 14, 1912”

following axioms hold between classes:

ship:DeployedVessel rdfs:subClassOf ship:Vessel

ship:InServiceVessel rdfs:subClassOf ship:Vessel

ship:OutOfServiceVessel rdfs:subClassOf ship:Vessel

Does RDFS support automatic classification of each of the

ships provided in the corresponding table?

Page 16: Logics for Data and  Knowledge Representation

Solution

We need to infer that:

if a vessel has a maiden voyage, then it is a ship:DeployedVessel

if next departure date is set, then it is a ship:InserviceVessel

if it has decommission date or destruction date, then it is a ship:OutOfService

ship:maidenVoyage rdfs:domain ship:DeployedVessel

ship:nextDeparture rdfs:domain ship:InServiceVessel

ship:decommisionDate rdfs:domain ship:OutOfServiceVessel

ship:destructionDate rdfs:domain ship:OutOfServiceVessel

Using rdfs:domain we can achieve the automatic classification

Page 17: Logics for Data and  Knowledge Representation

Exercise 8 In the table below we can see that the ships have

commanders. How can we assert that the commander of a

ship is a Captain?

Name Maiden Voyage

Next Departure

Commander

MV 16 May 23, 2001

November 29, 2013

John

MV 22 June 8, 1970

Alessandro

Table: Ships

Page 18: Logics for Data and  Knowledge Representation

Solution Ranks of the officers can be classified as follows:

ship:Captain rdfs:subClassOf ship:Officer

ship:Lieutenant rdfs:subClassOf ship:Officer

ship:Ensign rdfs:subClassOf ship:Officer

It can be expressed that the commander of a ship has rank

Captain with rdfs:range:

ship:hasCommander rdfs:range ship:Captain