17
1 OWL Application The following slides are from Roger L. Costello and David B. Jacobs, The MITRE Corporation

1 OWL Application The following slides are from Roger L. Costello and David B. Jacobs, The MITRE Corporation

Embed Size (px)

Citation preview

Page 1: 1 OWL Application The following slides are from Roger L. Costello and David B. Jacobs, The MITRE Corporation

1

OWL Application

The following slides are from Roger L. Costello and David B. Jacobs, The MITRE Corporation

Page 2: 1 OWL Application The following slides are from Roger L. Costello and David B. Jacobs, The MITRE Corporation

2

Scenario

• I am interested in purchasing a camera with a 75-300mm zoom lens size, that has an aperture of 4.5-5.6, and a shutter speed that ranges from 1/500 sec. to 1.0 sec.

• I launch my personal "Web Bot" which crawls the Web looking for Web sites that can fulfill my request.

• Assume that there exists an OWL Camera Ontology, which the Web Bot can "consult" upon its travels across the Web.

Page 3: 1 OWL Application The following slides are from Roger L. Costello and David B. Jacobs, The MITRE Corporation

3

Is this document relevant?<PhotographyStore rdf:ID="Hunts" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> <store-location>Malden, MA</store-location> <phone>617-555-1234</phone> <catalog rdf:parseType="Collection"> <SLR rdf:ID="Olympus-OM-10" xmlns="http://www.camera.org#"> <lens> <Lens> <focal-length>75-300mm zoom</focal-length> <f-stop>4.5-5.6</f-stop> </Lens> </lens> <body> <Body> <shutter-speed rdf:parseType="Resource"> <min>0.002</min> <max>1.0</max> <units>seconds</units> </shutter-speed> </Body> </body> <cost rdf:parseType="Resource"> <rdf:value>325</rdf:value> <currency>USD</currency> </cost> </SLR> </catalog></PhotographyStore>

The Web Bot finds this document at a Web site:

Is it relevant? (Note: SLR = Single Lens Reflex)

Page 4: 1 OWL Application The following slides are from Roger L. Costello and David B. Jacobs, The MITRE Corporation

4

A match?

Match?

To determine if there is a match, these questions must be answered: 1. What's the relationship between "SLR" and "Camera"? 2. What's the relationship between "focal-length" and "size"? 3. What's the relationship between "f-stop" and "aperture"?

<PhotographyStore rdf:ID="Hunts" xmlns:rdf="&rdf;#"> <store-location>Malden, MA</store-location> <phone>617-555-1234</phone> <catalog rdf:parseType="Collection"> <SLR rdf:ID="Olympus-OM-10" xmlns="http://www.camera.org#"> <lens> <Lens> <focal-length>75-300mm zoom</focal-length> <f-stop>4.5-5.6</f-stop> </Lens> </lens> <body> <Body> <shutter-speed rdf:parseType="Resource"> <min>0.002</min> <max>1.0</max> <units>seconds</units> </shutter-speed> </Body> </body> <cost rdf:parseType="Resource"> <rdf:value>325</rdf:value> <currency>USD</currency> </cost> </SLR> </catalog></PhotographyStore>

I am interested in purchasing a camera with a 75-300mm zoom lens size, that has an aperture of 4.5-5.6, and a shutter speed that ranges from 1/500 sec. to 1.0 sec.

Page 5: 1 OWL Application The following slides are from Roger L. Costello and David B. Jacobs, The MITRE Corporation

5

Relationship between SLR and Camera?

The Web Bot "consults" the OWL Camera Ontology. This OWL statement tells the Web Bot that a SLR is a type of Camera:

<owl:Class rdf:ID="SLR"> <rdfs:subClassOf rdf:resource="#Camera"/></owl:Class>

<PhotographyStore rdf:ID="Hunts" <SLR> … </SLR></PhotographyStore>

Hunts.xml

Web Bot

<owl:Class rdf:ID="SLR"> <rdfs:subClassOf rdf:resource="#Camera"/></owl:Class>

Camera.owl

"Relationship betweenCamera and SLR?"

"SLR is a type ofCamera."

Page 6: 1 OWL Application The following slides are from Roger L. Costello and David B. Jacobs, The MITRE Corporation

6

Relationship between focal-length and lens size?

This OWL statement tells the Web Bot that focal-length is equivalent to lens size:

<owl:DatatypeProperty rdf:ID="focal-length"> <owl:equivalentProperty rdf:resource="#size"/> <rdfs:domain rdf:resource="#Lens"/> <rdfs:range rdf:resource="&xsd;#string"/></owl:DatatypeProperty>

"focal-length is synonymous with (lens) size. focal-length is to be used within a Lens. focal-length has a value that is a string."

Page 7: 1 OWL Application The following slides are from Roger L. Costello and David B. Jacobs, The MITRE Corporation

7

Relationship between f-stop and aperture?

This OWL statement tells the Web Bot that f-stop is equivalent to aperture:

<owl:DatatypeProperty rdf:ID="f-stop"> <owl:equivalentProperty rdf:resource="#aperture"/> <rdfs:domain rdf:resource="#Lens"/> <rdfs:range rdf:resource="&xsd;#string"/></owl:DatatypeProperty>

The Web Bot now recognizes that the XML document it found at the Web site - is talking about Cameras, and it - does show the lens size, and it - does show the aperture for the camera, and - the values for lens size, aperture, and shutter speed are met.

Thus, the Web Bot recognizes that the XML document is a match!

Page 8: 1 OWL Application The following slides are from Roger L. Costello and David B. Jacobs, The MITRE Corporation

8

Semantic Definitions Separate from Application!

<SLR rdf:ID="Olympus-OM-10" xmlns="http://www.camera.org#"> <lens> <Lens> <focal-length>75-300mm zoom </focal-length> <f-stop>4.5-5.6</f-stop> </Lens> </lens> <body> <Body> <shutter-speed rdf:parseType="Resource"> <min>0.002</min> <max>1.0</max> <units>seconds</units> </shutter-speed> </Body> </body> <cost rdf:parseType="Resource"> <rdf:value>325</rdf:value> <currency>USD</currency> </cost></SLR>

Hunts.xml

Web Bot

<owl:Class rdf:ID="SLR"> <rdfs:subClassOf rdf:resource="#Camera"/></owl:Class>

<owl:DatatypeProperty rdf:ID="focal-length"> <owl:equivalentProperty rdf:resource="#size"/> <rdfs:domain rdf:resource="#Lens"/> <rdfs:range rdf:resource="&xsd;#string"/></owl:DatatypeProperty>

<owl:DatatypeProperty rdf:ID="f-stop"> <owl:equivalentProperty rdf:resource="#aperture"/> <rdfs:domain rdf:resource="#Lens"/> <rdfs:range rdf:resource="&xsd;#string"/></owl:DatatypeProperty>

"Relationship betweenCamera and SLR?"

"SLR is a type ofCamera."

"Relationship betweenaperture and f-stop?"

"f-stop is synonymouswith aperture."

"Relationship betweensize and focal-length?"

"focal-length is synonymous with size."

Camera.owlSee the article "Why use OWL?" for a discussion of why it is good practice to separate the semantic definitionsfrom the application.

Semantic Definitions

Page 9: 1 OWL Application The following slides are from Roger L. Costello and David B. Jacobs, The MITRE Corporation

9

Robber and speeder example

Page 10: 1 OWL Application The following slides are from Roger L. Costello and David B. Jacobs, The MITRE Corporation

10

Robber drops gun while fleeing!

First of all a robbery takes place. The robber drops his gun whilefleeing. This report is filed by the investigating officers:

<RobberyEvent> <date>...</date> <description>...</description> <evidence> <Gun> <serial>ABCD</serial> </Gun> </evidence> <robber> <Person /> <!-- an unknown person --> </robber></RobberyEvent>

Page 11: 1 OWL Application The following slides are from Roger L. Costello and David B. Jacobs, The MITRE Corporation

11

Speeder stopped

Subsequently a car is pulled over for speeding. The traffic officerfiles this report electronically while issuing a ticket:

<SpeedingOffence> <date>...</date> <description>...</description> <speeder> <Person> <name>Fred Blogs</name> <driversLicenseNumber>ZXYZXY</driversLicenseNumber> </Person> </speeder></SpeedingOffence>

Page 12: 1 OWL Application The following slides are from Roger L. Costello and David B. Jacobs, The MITRE Corporation

12

The speeder owns a gun with the same serial number as the robbery gun!

At police headquarters (HQ), a computer analyzes each report as it is filed. The computer uses the driver's license information to look up any other records it has about Fred Blogs (the speeder)and discovers this gun license:

<GunLicense> <registeredGun> <Gun> <serial>ABCD</serial> </Gun> </registeredGun> <holder> <Person> <driversLicenseNumber>ZXYZXY</driversLicenseNumber> </Person> </holder></GunLicense>

Page 13: 1 OWL Application The following slides are from Roger L. Costello and David B. Jacobs, The MITRE Corporation

13

Case solved?

<GunLicense> <registeredGun> <Gun> <serial>ABCD</serial> </Gun> </registeredGun> <holder> <Person> <driversLicenseNumber>ZXYZXY</driversLicenseNumber> </Person> </holder></GunLicense>

How many guns can have this serial number?

How many people can havethis driver's license number?

Can this gunbe registeredin other gunlicenses?

How many guns/peopleare registeredin a gun license?

1

2

3

4

Page 14: 1 OWL Application The following slides are from Roger L. Costello and David B. Jacobs, The MITRE Corporation

14

Can multiple guns have the same serial number?

This OWL statement tells the computer at police HQ that each gunis uniquely identified by its serial number:

<owl:InverseFunctionalProperty rdf:ID="serial"> <rdfs:domain rdf:resource="Gun"/> <rdfs:range rdf:resource="http://www.w3.org/2000/01/rdf-schema#Literal"/></owl:InverseFunctionalProperty>

<Gun> <serial>ABCD</serial></Gun>

Only one gun can have this serial number.1

Page 15: 1 OWL Application The following slides are from Roger L. Costello and David B. Jacobs, The MITRE Corporation

15

Can multiple people have the same driver's license number?

The following OWL statement tells the computer that a driver's license number is unique to a Person:

<owl:InverseFunctionalProperty rdf:ID="driversLicenseNumber"> <rdfs:domain rdf:resource="Person"/> <rdfs:range rdf:resource="http://www.w3.org/2000/01/rdf-schema#Literal"/></owl:InverseFunctionalProperty>

Only one person can have this driver's license number.

2

<Person> <driversLicenseNumber>ZXYZXY</driversLicenseNumber></Person>

Page 16: 1 OWL Application The following slides are from Roger L. Costello and David B. Jacobs, The MITRE Corporation

16

Can a gun be registered in multiple gun licenses?

The next OWL statement tells the computer that the registeredGun property uniquely identifies a GunLicense, i.e., each gun is associated with only a single GunLicense:

<owl:InverseFunctionalProperty rdf:ID="registeredGun"> <rdfs:domain rdf:resource="GunLicense"/> <rdfs:range rdf:resource="Gun"/></owl:InverseFunctionalProperty>

<GunLicense> <registeredGun> <Gun> <serial>ABCD</serial> </Gun> </registeredGun> ...</GunLicense>

A gun can beregistered inonly one gunlicense.

3

Page 17: 1 OWL Application The following slides are from Roger L. Costello and David B. Jacobs, The MITRE Corporation

17

Can a gun license have multiple holders of a registered gun?

The police computer uses the following OWL statement to determine that the gun on thelicense is the same gun used in the robbery. This final statement seals the speeder's fate. It tells the computer that each GunLicense applies to only one gun and one person. So, there is no doubt that the speeder is the person who owns the gun:

<owl:Class rdf:ID="GunLicense"> <owl:intersectionOf rdf:parseType="Collection"> <owl:Restriction> <owl:onProperty rdf:resource="#registeredGun"/> <owl:cardinality>1</owl:cardinality> </owl:Restriction> <owl:Restriction> <owl:onProperty rdf:resource="#holder"/> <owl:cardinality>1</owl:cardinality> </owl:Restriction> </owl:intersectionOf></owl:Class>

<GunLicense> <registeredGun> ... <holder> ...</GunLicense>

A gun licenseregisters onegun to one person.

4