cse 428 semantic web topics owl jeff heflin lehigh university

15
CSE 428 Semantic Web Topics OWL Jeff Heflin Lehigh University

Upload: angelina-green

Post on 17-Dec-2015

219 views

Category:

Documents


4 download

TRANSCRIPT

Page 1: CSE 428 Semantic Web Topics OWL Jeff Heflin Lehigh University

CSE 428Semantic Web TopicsOWL

Jeff Heflin

Lehigh University

Page 2: CSE 428 Semantic Web Topics OWL Jeff Heflin Lehigh University

Ontology Header

<!DOCTYPE rdf:RDF [<!ENTITY owl "http://www.w3.org/2002/07/owl#">]>

<rdf:RDF xmlns:owl ="http://www.w3.org/2002/07/owl#"xmlns:rdf ="http://www.w3.org/1999/02/22-rdf-

syntax-ns#"xmlns:rdfs="http://www.w3.org/2000/01/rdf-

schema#">

<owl:Ontology rdf:about=""><rdfs:label>My Ontology</rdfs:label><rdfs:comment>An example ontology</rdfs:comment><owl:imports

rdf:resource=“http://www.ont.org/generic” /></owl:Ontology>

...

</rdf:RDF>

Page 3: CSE 428 Semantic Web Topics OWL Jeff Heflin Lehigh University

<p:Person rdf:about=”http://www.cse.lehigh.edu/~heflin/”> <owl:sameAs rdf:resource=”http://www.cs.umd.edu/~heflin/” /></p:Person>

Equality/Inequality

Two URIs refer to distinct individuals

<p:Person rdf:about=”http://www.cse.lehigh.edu/~heflin/”> <owl:differentFrom rdf:resource=”mailto:[email protected]” /></p:Person>

Two URIs refer to the same individual.

Page 4: CSE 428 Semantic Web Topics OWL Jeff Heflin Lehigh University

<owl:AllDifferent> <owl:distinctMembers rdf:parseType=”Collection”> <p:Person rdf:about=”#Bob” /> <p:Person rdf:about=”#Sue” /> <p:Person rdf:about=”#Mary” /> … </owl:distinctMembers></owl:AllDifferent>

Sets of Distinct Individuals

The URIs #Bob, #Sue and #Mary all refer to distinct individuals.

Page 5: CSE 428 Semantic Web Topics OWL Jeff Heflin Lehigh University

<owl:Class rdf:ID=”Band”><rdfs:subClassOf><owl:Restriction><owl:onProperty rdf:resource=”#hasMember”/><owl:allValuesFrom rdf:resource=”#Musician”/>

</owl:Restriction></rdfs:subClassOf>

</owl:Class>

All Values From

A Band is a subclass of the set of entities which only have members that are Musicians

Page 6: CSE 428 Semantic Web Topics OWL Jeff Heflin Lehigh University

<owl:Class rdf:ID=”Band”><rdfs:subClassOf><owl:Restriction><owl:onProperty rdf:resource=”#hasMember”/><owl:someValuesFrom rdf:resource=”#Singer”/>

</owl:Restriction></rdfs:subClassOf>

</owl:Class>

Some Values From

Every Band has at least one member who is a Singer

Page 7: CSE 428 Semantic Web Topics OWL Jeff Heflin Lehigh University

<owl:Class rdf:ID=”Guitarist”><rdfs:subClassOf><owl:Restriction><owl:onProperty rdf:resource=”#playsInstrument”/><owl:hasValue rdf:resource=”#Guitar”/>

</owl:Restriction></rdfs:subClassOf>

</owl:Class>

Has Value

A Guitarist is a subclass of the set of entities which play at least one instrument that is a Guitar.

Page 8: CSE 428 Semantic Web Topics OWL Jeff Heflin Lehigh University

<owl:Class rdf:ID=”Parent”><owl:equivalentClass><owl:Restriction><owl:onProperty rdf:resource="#hasChild" /> <owl:minCardinality rdf:datatype="&xsd;nonNegativeInteger">1</owl:minCardinality>

</owl:Restriction> </owl:equivalentClass>

</owl:Class>

Minimum Cardinality

Parent is exactly the set of entities which have at least one child.

Page 9: CSE 428 Semantic Web Topics OWL Jeff Heflin Lehigh University

<owl:Class rdf:ID=”Father”> <owl:intersectionOf rdf:parseType=”Collection”> <owl:Class rdf:about=”#Parent” /> <owl:Class rdf:about=”#Male” /> </owl:intersectionOf></owl:Class>

Intersection and Union

A Father is exactly a Parent who is also Male.

<owl:Class rdf:ID=”Person”> <owl:unionOf rdf:parseType=”Collection”> <owl:Class rdf:about=”#Woman” /> <owl:Class rdf:about=”#Man” /> </owl:unionOf></owl:Class>

Every Person is either Male or Female.

Page 10: CSE 428 Semantic Web Topics OWL Jeff Heflin Lehigh University

Containers

10

#Parent

#Male

rdf:nil

rdf:List

#Father

owl:intersectionOf

rdf:type

rdf:first

rdf:first

rdf:rest

rdf:rest

rdf:type

rdf:type

Page 11: CSE 428 Semantic Web Topics OWL Jeff Heflin Lehigh University

<owl:Class rdf:ID=”Man”><owl:intersectionOf rdf:parseType=”Collection”><owl:Class rdf:about=”#Person” /><owl:Class><owl:complementOf rdf:resource=”#Woman” />

</owl:Class></owl:intersectionOf>

</owl:Class>

Complement

Man is every Person who is not a Woman.

Page 12: CSE 428 Semantic Web Topics OWL Jeff Heflin Lehigh University

<owl:Class rdf:ID=”PrimaryColor”> <owl:oneOf rdf:parseType=”Collection”> <owl:Thing rdf:about=”#Red” /> <owl:Thing rdf:about=”#Blue” /> <owl:Thing rdf:about=”#Yellow” /> </owl:oneOf></owl:Class>

Enumerated Classes

PrimaryColor has exactly three instances: Red, Blue and Yellow.

Page 13: CSE 428 Semantic Web Topics OWL Jeff Heflin Lehigh University

<owl:Ontology rdf:about=””> <owl:priorVersion rdf:resource=”www.onts.org/myont1” /> <owl:backwardCompatibleWith

rdf:resource=”www.onts.org/myont2”/></owl:Ontology>

<owl:DeprecatedClass rdf:ID="Car"> <owl:equivalentClass rdf:resource="#Automobile"/></owl:DeprecatedClass>

<owl:DeprecatedProperty rdf:ID="hasDriver"> <owl:inverseOf rdf:resource="#drives" /></owl:DeprecatedProperty>

Ontology Versioning

Page 14: CSE 428 Semantic Web Topics OWL Jeff Heflin Lehigh University

OWL 2: Property Chains

<rdf:Description rdf:about="hasGrandparent"><owl:propertyChainAxiom

rdf:parseType="Collection"><owl:ObjectProperty

rdf:about="hasParent"/><owl:ObjectProperty

rdf:about="hasParent"/></owl:propertyChainAxiom>

</rdf:Description>

The hasGrandparent property is exactly the composition of the hasParent property with itself. In other words, someone’s grandparent is the parent of their parent.

Page 15: CSE 428 Semantic Web Topics OWL Jeff Heflin Lehigh University

OWL 2: Negative Assertions

<owl:NegativePropertyAssertion><owl:sourceIndividual rdf:resource=“#heflin” /><owl:assertionProperty rdf:resource=“&foaf;knows”

/><owl:targetIndividual

rdf:resource=“&whouse;obama” /></owl:NegativePropertyAssertion>

States the triple #heflin foaf:knows #obama is false