1 / 44

Semantic Modeling With OWL

Semantic Modeling With OWL. A Gentle Introduction. Gerald McCollam. OpenMine, LLC. My background. Charles Sanders Peirce. Current Project: The Design Library, NY. Founder of Pragmatism, a theorist of logic, language, communication, and the general theory of signs (semiotics).

Télécharger la présentation

Semantic Modeling With OWL

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Semantic Modeling With OWL A Gentle Introduction Gerald McCollam OpenMine, LLC

  2. My background Charles Sanders Peirce Current Project: The Design Library, NY Founder of Pragmatism, a theorist of logic, language, communication, and the general theory of signs (semiotics). Image {has repeating} element Element {has attribute of} medium density Element {has attribute of} diagonal orientation Element {is} figurative Image {has a} background Background {is} solid Background {is} black Image {has a} foreground Foreground {has repeating} element Foreground {is} white Element {is} foreground Element {is a} bird Principal Consultant, OpenMine, LLC 10 years as a web developer and systems integrator. Reuters Health, Razorfish, Opsware, EDS, Bladelogic OpenMine, LLC

  3. What will we cover? • Data modeling for the Semantic Web • RDF (W3C recommendation since 2003.) • RDF Schema (RDFS) (W3C recommendation since 2003.) • RDF Plus (also known as OWL-Fast, considered a subset of WOL, not currently a recommendation.) • OWL (W3C recommendation since 2003.) Semantic Web for the Working Ontologist: Effective Modeling in RDFS and OWL - Dean Allemang and Jim Hendler (2007) Morgan Kaufman. OpenMine, LLC

  4. What we won’t cover • Full details of OWL. • Tools available for building SW apps. • Pitfalls and gotchas of this technology. • Arguments for or against, flame wars, or anything controversial. OpenMine, LLC

  5. Why A Semantic Web? water molecule ‘triple’ Foundational RDF: Rdf:Resource Anything that can be defined in terms of a triple. Rdf:Property Resources that are used as predicates. Rdf:Statement A resource that reifies a triple. Part of the original design idea for the WWW (as proposed by Sir Tim Berners-Lee). Very Basic Idea is to use metadata to add (and extract) meaning to (and from) documents. An Even Better Idea is to utilize Semantic Web methodologies to create a web of data in addition to the current web of documents. Misconception: Semantic Web is just AI for the Web. Misconception: One must learn formal logic to use Semantic Web technology. Misconception: Everything must be converted! . OpenMine, LLC OpenMine, LLC

  6. Where is Semantic Web being applied today? 66% Vodafone, a leading mobile phone company, has used RDF to describe and search ring tones, games and pictures in their Web site. As a result, the page viewed per download has decreased by 50% and revenues have risen by 20%. Jorge Cardoso, “The Semantic Web Vision: Where are We?” IEEE Intelligent Systems, September/October 2007, pp.22-26, 2007. OpenMine, LLC OpenMine, LLC

  7. Where are ontologies being applied? The basic challenge for ontology: identifying the subject, the object and any relationships between the two. Jorge Cardoso, “The Semantic Web Vision: Where are We?” IEEE Intelligent Systems, September/October 2007, pp.22-26, 2007. OpenMine, LLC OpenMine, LLC

  8. Simple ontologies: Guitars and Cars OpenMine, LLC OpenMine, LLC

  9. Making sense of RDF, RDF Schema, etc. Resource Description Framework (RDF). RDF Schema. RDF Plus. OWL. OpenMine, LLC OpenMine, LLC

  10. RDF – The Resource Description Framework Definition: The base element of the RDF model is the triple: a resource (the subject) is linked to another resource (the object) through an arc labeled with a third resource (the predicate). Historical note The triplet form of RDF adheres to the triadic form found in Peircean semiotics. Peirce refers to the subject as the ‘representamen’, the form the sign takes, the object as what the sign refers to, and the predicate or ‘interpretant’ as the sense the sign makes. A W3C specification for representing information so that it can be shared between applications without ambiguity. A standard way to make statements about resources on the Web (and elsewhere). Examples: Subject Predicate Object Led Zeppelin wrote Stairway To Heaven Jimmy Page is a guitarist Jimmy Page is part of Led Zeppelin OpenMine, LLC OpenMine, LLC

  11. RDF – Managing conflicting interpretations. Given the following triples: Subject Predicate Object Jimmy Page is part of Led Zeppelin Jimmy Page’s index finger is part of Jimmy Page Jimmy Page’s Index Finger Jimmy Page’s Index Finger Led Zeppelin Jimmy Page Led Zeppelin Jimmy Page Interpretation #1 Interpretation #2 Is Jimmy Page’s index finger really part of Led Zeppelin? We will see how two interpretations can exist side by side. OpenMine, LLC OpenMine, LLC

  12. RDF – Managing a more ‘dramatic’ merge. married lived in part of part of wrote Subject Predicate Object Wm. Shakespeare wrote King Lear Wm. Shakespeare wrote Hamlet Anne Hathaway married Wm. Shakespeare Wm. Shakespeare lived in Stratford Stratford is part of England England is part of U.K. author of Anne Hathaway As You Like It Shakespeare Shakespeare The Tempest King Lear England Stratford King Lear Hamlet Othello U.K. Subject Predicate Object Wm. Shakespeare author of The Tempest Wm. Shakespeare author of As You Like It Wm. Shakespeare author of Othello Wm. Shakespeare author of King Lear OpenMine, LLC OpenMine, LLC

  13. RDF – Identity issues when merging triple stores ns1:married ns1:lived in ns1:part of ns1:part of ns1:wrote ns2:author of When is a node in one graph the same as a node in another graph?” Anne Hathaway As You Like It Shakespeare The Tempest King Lear Stratford King Lear England Hamlet Othello U.K. Subject Predicate Object Wm. Shakespeare ns1:wrote King Lear Wm. Shakespeare ns1:wrote Hamlet Wm. Shakespeare ns1:author of Hamlet Wm. Shakespeare ns2:author of The Tempest Wm. Shakespeare ns2:author of As You Like It Wm. Shakespeare ns2:author of Othello Anne Hathaway ns1:married Wm. Shakespeare Wm. Shakespeare ns1:lived in Stratford Stratford ns1:is part of England England ns1:is part of U.K. OpenMine, LLC OpenMine, LLC

  14. RDF – Namespaces, the URI and Equivalence Wm. Shakespeare ns1:wrote King Lear Wm. Shakespeare ns2:author of King Lear "http://someplace.org/ns1/relations/#wrote” "http://otherplace.org/ns2/relations/#authorOf" Comment: RDF and the Semantic Web are primarily about describing resources. Resources are always named by URIs, and anything can have a URI. While designed to handle resources on a network, RDF may be used to describe potentially anything. RDF applies the notion of the URI to resolve the identity problem in graph merging. A node from one graph is merged with a node from another graph, only if they have the same URI. Using the URI as a standard for global identifiers allows for a world-wide reference for any symbol. OpenMine, LLC OpenMine, LLC

  15. RDF – Summary RDF is a base specification for representing data (things and the relationships between things) on the Semantic Web. The elemental form is the triple consisting of a subject, an object, and a predicate. RDF is intended to provide a simple way to make statements about resources and to build up ontologies based on collections of statements. Next: RDF Schema OpenMine, LLC OpenMine, LLC

  16. RDFS – Adding inference capability to data. http://blah.org/stuff/passengerVehicle http://blah.org/stuff/Vehicle http://blah.org/stuff/Truck http://blah.org/stuff/Minivan http://blah.org/stuff/Van http://www.w3c.org/2000/01/rdf-schema#subClassOf http://www.w3c.org/2000/01/rdf-schema#subClassOf http://www.w3c.org/2000/01/rdf-schema#subClassOf Note: We’re using the full URI expression above. An equivalent expression is the corresponding ‘qname’, for example rdfs:subClassOf. RDFS is a specification for representing relationships between data. Examples: rdfs:subClassOf, rdfs:subPropertyOf, rdfs:domain, rdfs:range. RDFS is based on inference. If we say that ‘X is a subclass of Y’ we’re saying that every member of class X is also a member of class Y. If x is a member of X, then x is also a member of Y. In this way we can derive new information. OpenMine, LLC OpenMine, LLC

  17. RDFS – Inference via Type Propagation http://blah.org/stuff/passengerVehicle http://blah.org/stuff/Vehicle http://blah.org/stuff/Truck http://blah.org/stuff/Minivan http://blah.org/stuff/Van By the rules defined for rdfs:subClassOf we know that a van is a type of vehicle and a minivan is a type of van. These are explicitly defined as part of our ontology. Through the same inference rule we know implicitly that a minivan is also a type of vehicle. We infer this information from what is already defined. This very simple example indicates the potential cumulative effect of deriving new information from what is previously defined. OpenMine, LLC OpenMine, LLC

  18. RDFS – Inference via Relationship Propagation http://blah.org/stuff/#subContractsTo http://blah.org/stuff/#isEmployedBy http://blah.org/stuff/#freelancesTo http://blah.org/stuff/#contractsTo http://blah.org/stuff/#worksFor http://www.w3c.org/2000/01/rdf-schema#subPropertyOf http://www.w3c.org/2000/01/rdf-schema#subPropertyOf http://www.w3c.org/2000/01/rdf-schema#subPropertyOf http://www.w3c.org/2000/01/rdf-schema#subPropertyOf Note: We’re using the full URI expression above. An equivalent expression is the corresponding ‘qname’, for example rdfs:subPropertyOf. Just as the case for classes of things, the properties that relate classes together may also propagate. For example, by the rules defined for rdfs:subPropertyOf we know that an individual ‘A’ who freelances to company ‘B’ also works for company ‘B’. OpenMine, LLC OpenMine, LLC

  19. RDFS – Distinctions vs. Object Modeling (OOP) The construct rdfs:subPropertyOf has no analog in object-oriented programming, where properties are not first-class entities. In OO modeling properties or attributes are never related to one another independent of the class in which they are defined. This sort of relationship can and does occur in SW applications. Further, the SW definition for rdfs:subClassOf is only partially consistent with the definition of subclass or extension in OOP. In either case, an instance of a class may respond in the same way as instances of its super-class. However In SW classes there is no notion of an over-ride. So how does multiple inheritance work in Semantic Web modeling? We just apply the subClassOf rule twice! OpenMine, LLC OpenMine, LLC

  20. RDFS – rdfs:range and rdfs:domain P rdfs:domain D . P rdfs:range R . Any property P can have an rdfs:domain and/or an rdfs:range. Each is defined as: We interpret this to mean that the relation P relates values from class D to values from class R. The domain refers to the subject of any triple that uses P as its predicate. The range refers to the object of any such triple. If property P has domain D (or range R) we may infer that the subject (or object, if range) of the triple is in class D (or R, if range). Unlike the case of XML Schema, RDF Schema will never flag an input as invalid. It will infer the correct type information. OpenMine, LLC OpenMine, LLC

  21. RDFS – RDF Schema vs. XML Schema XML is intended as a markup language for arbitrary document structure. RDF is intended as a semantic representation language for arbitrary data. The RDF Schema mechanism provides a basic type system for use in RDF data models. The XML Schema mechanism provides a basic type system for use in XML documents. XML addresses doc typing and doc structure while RDF provides a data model that can be extended to address ontology representation. Each are standards for improving machine readability. Flame wars between the two seem misguided. OpenMine, LLC OpenMine, LLC

  22. RDFS – Interaction of rdfs:subClassOf and rdfs:domain rdfs:subClassOf hasMaidenName rdfs:domain :Alice rdf:type :MarriedWoman . :Alice rdf:type :Woman . MarriedWoman Woman Given the above graph, if we state that some person Alice has the maiden name Jones, we can infer the following: Further, we can infer up the rdfs:subClassOf relation and state: We needn’t know anything more about Alice (beyond the fact that she has a maiden name) in order to make these inferences. If we have domain or range information with regard to a predicate, we can infer additional information regarding the type of any element based solely on its use in the triple. OpenMine, LLC OpenMine, LLC

  23. RDFS – Summary RDFS is the RDF schema language. It describes types of objects (classes), relates types to one another (via rdfs:subClassOf), organizes properties and the relations between them that describe other objects. (via rdfs:subPropertyOf). Two key RDF Schema constructs are rdfs:subClassOfand rdfs:subPropertyOf. RDF objects may be instances of one or more classes. The rdfs:subClassOf property permits the specification of an hierarchical structure for such classes. rdfs:subPropertyOf does the same for properties. Constraints on properties can be further specified using rdfs:domain and rdfs:range constructs. RDFS is expressed itself in RDF. Next: OWL Full, briefly OpenMine, LLC OpenMine, LLC

  24. OWL Full – The Web Ontology Language Provides a fuller and more systematic treatment of information description Used to explicitly represent the meaning of terms in vocabularies and the relationships between those terms. Facilitates greater machine interpretability of Web content than that supported by XML, RDF, and RDF Schema (RDFS). OWL provides additional vocabulary along with a formal semantics. OpenMine, LLC OpenMine, LLC

  25. OWL Full – OWL examples not covered owl:Restriction - a fundamental building block in OWL that describes classes by restricting the values allowed for certain properties. owl:hasValue - a type of restriction that refers to a single value for a property. owl:someValuesFrom - a type of restriction that refers to a set from which some value for a property must come. owl:allValuesFrom - used to produce a restriction class of the form, “the individuals for which all values of the property P come from class C. owl:onProperty - link from a restriction to the property it restricts. OpenMine, LLC OpenMine, LLC

  26. OWL Full – Using a subset at the start A complete language for making ontological statements, developed as a follow-on from RDF and RDFS. All of OWL’s elements (classes, properties and individuals) are defined as RDF resources, and identified by URIs. OWL provides support for representing union and intersection, enumeration of sets, differentiating individuals and groups, and cardinality. Let’s see OWL in action using RDF-Plus Next: RDF-Plus OpenMine, LLC OpenMine, LLC

  27. RDF-Plus – A Subset of OWL As a gentle step toward OWL we consider only a subset of OWL known as RDF-Plus. RDFS provides an important set of inference capabilities but it is limited. RDF-Plus builds upon what is already familiar in RDFS. The following set of constructs might be implemented using any number of a variety of inference technologies, thus lessening dependency on any specific technology or platform. As is the case for RDFS, RDF-Plus (aka as OWL-Fast) is expressed entirely in RDF. OWL includes a number of additional resource constructs in the owl: namespace. OpenMine, LLC OpenMine, LLC

  28. RDF-Plus – What part of OWL we’ll consider Equality Property Characteristics • owl:inverseOf – Allows for the exchange of subject and object. • owl:transitiveProperty – Collapses a chain of relations into one. • owl:symmetricProperty – A property that is its own inverse. owl:equivalentClass – Members of each class are also members of the other. owl:equivalentProperty – Relations that hold for each property also hold for the other. owl:sameAs – All statements about one instance hold as well for the other. OpenMine, LLC OpenMine, LLC

  29. RDF-Plus – owl:equivalentClass Members of each class are members of the other. <owl:Class rdf:about="#US_President"> <equivalentClass rdf:resource="#PrincipalResidentOfWhiteHouse"/> </owl:Class> :Analyst rdfs:subClassOf :Researcher . :Researcher rdfs:subClassOf :Analyst . :Analyst owl:equivalentClass :Researcher . Note: The use of owl:equivalentClass does not imply class equality. It only says that two classes have the same members. The concept of "President of the US" is related to, but not equal to the concept of the principal resident of 1600 Pennsylvania Avenue. This OWL property has rdf:Class as both its domain and range. OpenMine, LLC OpenMine, LLC

  30. RDF-Plus – owl:equivalentProperty Relations that hold for each property also hold for the other. <owl:Class rdf:about=”#MarriedWomen"> <equivalentClass rdf:resource=”#hasMaidenName"/> </owl:Class> :borrows rdfs:subPropertyOf :checkedOut . :checkedOut rdfs:subPropertyOf :borrows . :borrows owl:equivalentProperty :checkedOut . Note: The use of owl:equivalentProperty does not imply property equality. The property of being a married woman is related with but not equal to the property of having a maiden name. This OWL property has rdf:Property as both its domain and range. OpenMine, LLC OpenMine, LLC

  31. RDF-Plus – owl:symmetricProperty Specifies that an Attribute relation is valid in two directions. <owl:ObjectProperty rdf:ID="adjacentRegion"> <rdf:type rdf:resource="&owl;SymmetricProperty" /> <rdfs:domain rdf:resource="#Region" /> <rdfs:range rdf:resource="#Region" /> </owl:ObjectProperty> <Region rdf:ID=”TerrebonneParishRegion"> <locatedIn rdf:resource=”#LouisianaRegion" /> <adjacentRegion rdf:resource=”#LafourcheParishRegion" /> </Region> Note: The TerrebonneParish region is adjacent to the LafourcheParish region and vice-versa. The TerrebonneParish region is located in the LouisianaRegion but not vice versa. OpenMine, LLC OpenMine, LLC

  32. RDF-Plus – owl:inverseOf Allows for the exchange of subject and object. <owl:ObjectProperty rdf:ID=”#possessedBy"> <owl:inverseOf rdf:resource="#hasPossession"/> </owl:ObjectProperty> Possessed by hasPossession Possessed by hasPossession owl:inverseOf owl:inverseOf owl:inverseOf owl:inverseOf . owl:inverseOf rdf:type :owl:symmetricProperty . owl:inverseOf Note: Properties generally have direction from domain to range. If we state that a person is married to another person, the inverse relation may not be necessarily implied. For a relation like ‘marriage’ it is useful to define the relation in both directions. As another example, people own cars, and cars are owned by people. OpenMine, LLC OpenMine, LLC

  33. RDF-Plus – owl:sameAs All statements about one instance hold equally for the other. <rdf:Description rdf:about="#WilliamClinton"> <owl:sameAs rdf:resource="#BillClinton"/> </rdf:Description> owl:sameAs rdf:type owl:SymmetricProperty . :WilliamClintonowl:sameAs :BillClinton . Note: The owl:sameAs statement is often used to define mappings between ontologies. This is useful when merging data stores. In this example we are using OWL to extend OWL. OpenMine, LLC OpenMine, LLC

  34. RDF-Plus – owl:transitiveProperty Collapses a chain of relations into one. <owl:ObjectProperty rdf:ID="subRegionOf"> <rdf:type rdf:resource="&owl;TransitiveProperty"/> <rdfs:domain rdf:resource="#Region"/> <rdfs:range rdf:resource="#Region"/> </owl:ObjectProperty> :LafayetteRegion owl:subRegionOf :AcadianaRegion . :AcadianaRegion owl:subRegionOf :LouisianaRegion . :LafayetteRegion owl:subRegionOf :LouisianaRegion . Note: A transitive property can link from a Object from a special Type to another Object of the same Type – or a sublcass of this type. We can use this relation to express containment. OpenMine, LLC OpenMine, LLC

  35. RDF-Plus – Bringing it all back home. - In large pot place medium size chicken and cook under low heat for 1 hour. Debone chicken meat and put aside. - Chop up one bell pepper, one large onion, one bunch celery. Cook over low fire until brown. Put aside. - In a large flat skillet heat and slowly stir bacon fat with flour until dark brown. - Add roux in with vegetables, garlic, thyme, seasoning. Simmer under low heat. - Add in meat shortly before serving. :dependsOn owl:inverseOf :enables . Let’s make some Gumbo! Very Simple Recipe for making gumbo: OpenMine, LLC OpenMine, LLC

  36. RDF-Plus – Gumbo workflow triples: :boilWater wf:enables :cookChicken . :cookChicken wf:enables :deboneChicken . :cutVegetables wf:enables :cookVegetables . :heatBaconFat wf:enables :addFlour . :addFlour wf:enables :makeRoux . :makeRoux wf:enables :mixinVegetables . :addDeboneChicken wf:enables : serveGumbo . :serveGumbo wf:dependsOn :addDeboneChicken . :makeRoux wf:dependsOn :heatBaconFat . :makeRoux wf:dependsOn :addFlour . :cookVegetables wf:dependsOn :cutVegetables . :deboneChicken wf:dependsOn :cookChicken . :cookChicken wf:dependsOn :boilWater . Question: For any step in the process, we want to know all the steps it depends on, or all the steps that depend on it. How can we accomplish this, using the constructs we’ve already seen? OpenMine, LLC OpenMine, LLC

  37. RDF-Plus – Jimmy Page’s Index Finger Revisited Subject Predicate Object Jimmy Page is part of Led Zeppelin Jimmy Page’s index finger is part of Jimmy Page Index Finger Jimmy Page Is Jimmy Page’s index finger part of Led Zeppelin? Led Zeppelin We can resolve this by defining two versions of the ‘part of’ property in separate namespaces. One will be a subPropertyOf the other, with the super property declared as transitive. ns1:partOf rdfs:subPropertyOf ns2:partOf . ns2:partOf rdf:type owl:transitiveProperty . The application can query the appropriate property depending on which interpretation of part of is required. OpenMine, LLC OpenMine, LLC

  38. RDF-Plus – Gumbo dependency tree wf:dependsOn addDeboneChick deboneChicken simmerGumbo serveGumbo cookVeggies mixinVeggies cookChicken stirBaconFat cutVeggies makeRoux addFlour boilWater wf:dependsOn wf:dependsOn We’re going to use the rdfs:subPropertyOf and owl:transitiveProperty pattern for each wf:dependsOn and wf:enables property. We define wf:hasPrerequisite and wf:preRequisiteFor in terms of dependsOn and enables and make each super property transitive. wf:enables wf:enables wf:enables wf:dependsOn rdfs:subPropertyOf wf:hasPrerequisite . wf:hasPrerequisite rdf:type owl:transitiveProperty . wf:enables rdfs:subPropertyOf wf:preRequisiteFor . wf:preRequisiteFor rdf:type owl:transitiveProperty . OpenMine, LLC OpenMine, LLC

  39. RDF-Plus – Mixing up RDF, RDFS and OWL owl: transitiveProperty wf:hasPrerequisite wf:prerequisiteFor wf:dependsOn wf:enables rdf:type rdf:type rdfs:subPropertyOf rdfs:subPropertyOf owl:inverseOf Transitive Properties wf:hasPrerequisite and wf:prerequisiteFor defined in terms of wf:dependsOn and wf:enables. OpenMine, LLC OpenMine, LLC

  40. RDF-Plus – Grouping gumbo dependencies deboneChicken cookChicken cookVeggies cutVeggies boilWater :addDeboneChicken wf:hasPrequisite :deboneChicken ; wf:hasPrequisite :cookChicken; wf:hasPrequisite :boilWater . wf:dependsOn wf:enables addDeboneChicken :mixinVegetables wf:hasPrequisite :cookVegetables ; wf:hasPrequisite :cutVegetables; mixinVegetables wf:dependsOn wf:enables OpenMine, LLC OpenMine, LLC

  41. RDF-Plus – Summary The constructs we’ve seen in RDF-Plus represent a subset of OWL. We’ve been considering OWL all along. RDF-Plus is recommended as a primer for OWL. A lot can be accomplished with just this subset. owl:functionalProperty, owl:inverseFunctionalProperty owl:objectProperty, owl:datatypeProperty Example application of a subset of OWL: FOAF Last: Concluding remarks OpenMine, LLC OpenMine, LLC

  42. SW - Data Modeling Workflow Figure out what you want to model! Test your ontology using test cases. Find and study related ontologies. Create an ‘instance’ of your ontology. Create an ontology by borrowing. OpenMine, LLC OpenMine, LLC

  43. Conclusion Classes, subclasses, properties and instances have been the bread and butter of knowledge modeling for years. SW continues in this tradition. What’s different about SW’s use of these terms and approaches? The distributed nature of the Web and other networks. The idea that information should be available. Having the right knowledge at the right time is clearly an advantage in any endeavor. The Web can brings significant knowledge to the user’s attention. But if that information is not represented in one place, the onus of integration rests with the user. SW isn’t on the web; it is the web! OpenMine, LLC OpenMine, LLC

  44. RDF-based apps now! In 1999, Sir Tim Berners-Lee made the following pronouncement: "I have a dream in which computers become capable of analyzing all the data on the web - all the content, links, and transactions. A 'Semantic Web', which should make this possible, has yet to emerge..." In February 2008, Berners-Lee added: "I think … we’ve got all the pieces to be able to go ahead and do pretty much everything … to implement a huge amount of the dream, we should be able to get benefits from interoperability using what we’ve got … people are realizing it’s time to just go do it." OpenMine, LLC OpenMine, LLC

More Related