Presentation is loading. Please wait.

Presentation is loading. Please wait.

Chapter 1 The Semantic Web Vision

Similar presentations


Presentation on theme: "Chapter 1 The Semantic Web Vision"— Presentation transcript:

1 Chapter 1 The Semantic Web Vision
Grigoris Antoniou Frank van Harmelen Chapter 1 A Semantic Web Primer

2 Lecture Outline Today’s Web The Semantic Web Impact
Semantic Web Technologies A Layered Approach Chapter 1 A Semantic Web Primer

3 Today’s Web Most of today’s Web content is suitable for human consumption Even Web content that is generated automatically from databases is usually presented without the original structural information found in databases Typical Web uses today people’s seeking and making use of information, searching for and getting in touch with other people, reviewing catalogs of online stores and ordering products by filling out forms Chapter 1 A Semantic Web Primer

4 Keyword-Based Search Engines
Current Web activities are not particularly well supported by software tools Except for keyword-based search engines (e.g. Google, AltaVista, Yahoo) The Web would not have been the huge success it was, were it not for search engines Chapter 1 A Semantic Web Primer

5 Problems of Keyword-Based Search Engines
High recall, low precision. Low or no recall Results are highly sensitive to vocabulary Results are single Web pages Human involvement is necessary to interpret and combine results Results of Web searches are not readily accessible by other software tools Chapter 1 A Semantic Web Primer

6 The Key Problem of Today’s Web
The meaning of Web content is not machine-accessible: lack of semantics It is simply difficult to distinguish the meaning between these two sentences: I am a professor of computer science. I am a professor of computer science, you may think. Well, . . . Chapter 1 A Semantic Web Primer

7 The Semantic Web Approach
Represent Web content in a form that is more easily machine-processable. Use intelligent techniques to take advantage of these representations. The Semantic Web will gradually evolve out of the existing Web, it is not a competition to the current WWW Chapter 1 A Semantic Web Primer

8 Lecture Outline Today’s Web The Semantic Web Impact
Semantic Web Technologies A Layered Approach Chapter 1 A Semantic Web Primer

9 The Semantic Web Impact – Knowledge Management
Knowledge management concerns itself with acquiring, accessing, and maintaining knowledge within an organization Key activity of large businesses: internal knowledge as an intellectual asset It is particularly important for international, geographically dispersed organizations Most information is currently available in a weakly structured form (e.g. text, audio, video) Chapter 1 A Semantic Web Primer

10 Limitations of Current Knowledge Management Technologies
Searching information Keyword-based search engines Extracting information human involvement necessary for browsing, retrieving, interpreting, combining Maintaining information inconsistencies in terminology, outdated information. Viewing information Impossible to define views on Web knowledge Chapter 1 A Semantic Web Primer

11 Semantic Web Enabled Knowledge Management
Knowledge will be organized in conceptual spaces according to its meaning. Automated tools for maintenance and knowledge discovery Semantic query answering Query answering over several documents Defining who may view certain parts of information (even parts of documents) will be possible. Chapter 1 A Semantic Web Primer

12 The Semantic Web Impact – B2C Electronic Commmerce
A typical scenario: user visits one or several online shops, browses their offers, selects and orders products. Ideally humans would visit all, or all major online stores; but too time consuming Shopbots are a useful tool Chapter 1 A Semantic Web Primer

13 Limitations of Shopbots
They rely on wrappers: extensive programming required Wrappers need to be reprogrammed when an online store changes its outfit Wrappers extract information based on textual analysis Error-prone Limited information extracted Chapter 1 A Semantic Web Primer

14 Semantic Web Enabled B2C Electronic Commerce
Software agents that can interpret the product information and the terms of service. Pricing and product information, delivery and privacy policies will be interpreted and compared to the user requirements. Information about the reputation of shops Sophisticated shopping agents will be able to conduct automated negotiations Chapter 1 A Semantic Web Primer

15 The Semantic Web Impact – B2B Electronic Commerce
Greatest economic promise Currently relies mostly on EDI Isolated technology, understood only by experts Difficult to program and maintain, error-prone Each B2B communication requires separate programming Web appears to be perfect infrastructure But B2B not well supported by Web standards Chapter 1 A Semantic Web Primer

16 Semantic Web Enabled B2B Electronic Commerce
Businesses enter partnerships without much overhead Differences in terminology will be resolved using standard abstract domain models Data will be interchanged using translation services. Auctioning, negotiations, and drafting contracts will be carried out automatically (or semi-automatically) by software agents Chapter 1 A Semantic Web Primer

17 Wikis Collections of web pages that allow users to add content via a browser interface Wiki systems allow for collaborative knowledge Users are free to add and change information without ownership of content, access restrictions, or rigid workflows Chapter 1 A Semantic Web Primer

18 Some Uses of Wikis Development of bodies of knowledge in a community effort, with contributions from a wide range of users (e.g. Wikipedia) Knowledge management of an activity or a project (e.g. brainstorming and exchanging ideas, coordinating activities, exchanging records of meetings) Chapter 1 A Semantic Web Primer

19 Semantic Web Enabled Wikis
The inherent structure of a wiki, given by the linking between pages, gets accessible to machines beyond mere navigation Structured text and untyped hyperlinks are enriched by semantic annotations referring to an underlying model of the knowledge captured by the wiki e.g. a hyperlink from Knossos to Heraklion could be annotated with information is located in. This information could then be used for context-specific presentations of pages, advanced querying, and consistency verification Chapter 1 A Semantic Web Primer

20 Lecture Outline Today’s Web The Semantic Web Impact
Semantic Web Technologies A Layered Approach Chapter 1 A Semantic Web Primer

21 Semantic Web Technologies
Explicit Metadata Ontologies Logic and Inference Agents Chapter 1 A Semantic Web Primer

22 On HTML Web content is currently formatted for human readers rather than programs HTML is the predominant language in which Web pages are written (directly or using tools) Vocabulary describes presentation Chapter 1 A Semantic Web Primer

23 An HTML Example <h1>Agilitas Physiotherapy Centre</h1>
Welcome to the home page of the Agilitas Physiotherapy Centre. Do you feel pain? Have you had an injury? Let our staff Lisa Davenport, Kelly Townsend (our lovely secretary) and Steve Matthews take care of your body and soul. <h2>Consultation hours</h2> Mon 11am - 7pm<br> Tue 11am - 7pm<br> Wed 3pm - 7pm<br> Thu 11am - 7pm<br> Fri 11am - 3pm<p> But note that we do not offer consultation during the weeks of the <a href=". . .">State Of Origin</a> games. Chapter 1 A Semantic Web Primer

24 Problems with HTML Humans have no problem with this
Machines (software agents) do: How distinguish therapists from the secretary, How determine exact consultation hours They would have to follow the link to the State Of Origin games to find when they take place. Chapter 1 A Semantic Web Primer

25 A Better Representation
<company> <treatmentOffered>Physiotherapy</treatmentOffered> <companyName>Agilitas Physiotherapy Centre</companyName> <staff> <therapist>Lisa Davenport</therapist> <therapist>Steve Matthews</therapist> <secretary>Kelly Townsend</secretary> </staff> </company> Chapter 1 A Semantic Web Primer

26 Explicit Metadata This representation is far more easily processable by machines Metadata: data about data Metadata capture part of the meaning of data Semantic Web does not rely on text-based manipulation, but rather on machine-processable metadata Chapter 1 A Semantic Web Primer

27 Ontologies The term ontology originates from philosophy
The study of the nature of existence Different meaning from computer science An ontology is an explicit and formal specification of a conceptualization Chapter 1 A Semantic Web Primer

28 Typical Components of Ontologies
Terms denote important concepts (classes of objects) of the domain e.g. professors, staff, students, courses, departments Relationships between these terms: typically class hierarchies a class C to be a subclass of another class C' if every object in C is also included in C' e.g. all professors are staff members Chapter 1 A Semantic Web Primer

29 Further Components of Ontologies
Properties: e.g. X teaches Y Value restrictions e.g. only faculty members can teach courses Disjointness statements e.g. faculty and general staff are disjoint Logical relationships between objects e.g. every department must include at least 10 faculty Chapter 1 A Semantic Web Primer

30 Example of a Class Hierarchy
Chapter 1 A Semantic Web Primer

31 The Role of Ontologies on the Web
Ontologies provide a shared understanding of a domain: semantic interoperability overcome differences in terminology mappings between ontologies Ontologies are useful for the organization and navigation of Web sites Chapter 1 A Semantic Web Primer

32 The Role of Ontologies in Web Search
Ontologies are useful for improving the accuracy of Web searches search engines can look for pages that refer to a precise concept in an ontology Web searches can exploit generalization/ specialization information If a query fails to find any relevant documents, the search engine may suggest to the user a more general query. If too many answers are retrieved, the search engine may suggest to the user some specializations. Chapter 1 A Semantic Web Primer

33 Web Ontology Languages
RDF Schema RDF is a data model for objects and relations between them RDF Schema is a vocabulary description language Describes properties and classes of RDF resources Provides semantics for generalization hierarchies of properties and classes Chapter 1 A Semantic Web Primer

34 Web Ontology Languages (2)
OWL A richer ontology language relations between classes e.g., disjointness cardinality e.g. “exactly one” richer typing of properties characteristics of properties (e.g., symmetry) Chapter 1 A Semantic Web Primer

35 Logic and Inference Logic is the discipline that studies the principles of reasoning Formal languages for expressing knowledge Well-understood formal semantics Declarative knowledge: we describe what holds without caring about how it can be deduced Automated reasoners can deduce (infer) conclusions from the given knowledge Chapter 1 A Semantic Web Primer

36 An Inference Example prof(X)  faculty(X) faculty(X)  staff(X)
prof(michael) We can deduce the following conclusions: faculty(michael) staff(michael) prof(X)  staff(X) Chapter 1 A Semantic Web Primer

37 Logic versus Ontologies
The previous example involves knowledge typically found in ontologies Logic can be used to uncover ontological knowledge that is implicitly given It can also help uncover unexpected relationships and inconsistencies Logic is more general than ontologies It can also be used by intelligent agents for making decisions and selecting courses of action Chapter 1 A Semantic Web Primer

38 Tradeoff between Expressive Power and Computational Complexity
The more expressive a logic is, the more computationally expensive it becomes to draw conclusions Drawing certain conclusions may become impossible if non-computability barriers are encountered. Our previous examples involved rules “If conditions, then conclusion,” and only finitely many objects This subset of logic is tractable and is supported by efficient reasoning tools Chapter 1 A Semantic Web Primer

39 Inference and Explanations
Explanations: the series of inference steps can be retraced They increase users’ confidence in Semantic Web agents: “Oh yeah?” button Activities between agents: create or validate proofs Chapter 1 A Semantic Web Primer

40 Typical Explanation Procedure
Facts will typically be traced to some Web addresses The trust of the Web address will be verifiable by agents Rules may be a part of a shared commerce ontology or the policy of the online shop Chapter 1 A Semantic Web Primer

41 Software Agents Software agents work autonomously and proactively
They evolved out of object oriented and compontent-based programming A personal agent on the Semantic Web will: receive some tasks and preferences from the person seek information from Web sources, communicate with other agents compare information about user requirements and preferences, make certain choices give answers to the user Chapter 1 A Semantic Web Primer

42 Intelligent Personal Agents
Chapter 1 A Semantic Web Primer

43 Semantic Web Agent Technologies
Metadata Identify and extract information from Web sources Ontologies Web searches, interpret retrieved information Communicate with other agents Logic Process retrieved information, draw conclusions Chapter 1 A Semantic Web Primer

44 Semantic Web Agent Technologies (2)
Further technologies (orthogonal to the Semantic Web technologies) Agent communication languages Formal representation of beliefs, desires, and intentions of agents Creation and maintenance of user models. Chapter 1 A Semantic Web Primer

45 Lecture Outline Today’s Web The Semantic Web Impact
Semantic Web Technologies A Layered Approach Chapter 1 A Semantic Web Primer

46 A Layered Approach The development of the Semantic Web proceeds in steps Each step building a layer on top of another Principles: Downward compatibility Upward partial understanding Chapter 1 A Semantic Web Primer

47 The Semantic Web Layer Tower
Chapter 1 A Semantic Web Primer

48 An Alternative Layer Stack
Takes recent developments into account The main differences are: The ontology layer is instantiated with two alternatives: the current standard Web ontology language, OWL, and a rule-based language DLP is the intersection of OWL and Horn logic, and serves as a common foundation The Semantic Web Architecture is currently being debated and may be subject to refinements and modifications in the future. Chapter 1 A Semantic Web Primer

49 Alternative Semantic Web Stack
Chapter 1 A Semantic Web Primer

50 Semantic Web Layers XML layer RDF layer Ontology layer Syntactic basis
RDF basic data model for facts RDF Schema simple ontology language Ontology layer More expressive languages than RDF Schema Current Web standard: OWL Chapter 1 A Semantic Web Primer

51 Semantic Web Layers (2) Logic layer Proof layer Trust layer
enhance ontology languages further application-specific declarative knowledge Proof layer Proof generation, exchange, validation Trust layer Digital signatures recommendations, rating agencies …. Chapter 1 A Semantic Web Primer

52 Book Outline Structured Web Documents in XML
Describing Web Resources in RDF Web Ontology Language: OWL Logic and Inference: Rules Applications Ontology Engineering Conclusion and Outlook Chapter 1 A Semantic Web Primer

53 Chapter 2 Structured Web Documents in XML
Grigoris Antoniou Frank van Harmelen Chapter 2 A Semantic Web Primer

54 An HTML Example <h2>Nonmonotonic Reasoning: Context-
Dependent Reasoning</h2> <i>by <b>V. Marek</b> and <b>M. Truszczynski</b></i><br> Springer 1993<br> ISBN Chapter 2 A Semantic Web Primer

55 The Same Example in XML <book>
<title>Nonmonotonic Reasoning: Context- Dependent Reasoning</title> <author>V. Marek</author> <author>M. Truszczynski</author> <publisher>Springer</publisher> <year>1993</year> <ISBN> </ISBN> </book> Chapter 2 A Semantic Web Primer

56 HTML versus XML: Similarities
Both use tags (e.g. <h2> and </year>) Tags may be nested (tags within tags) Human users can read and interpret both HTML and XML representations quite easily … But how about machines? Chapter 2 A Semantic Web Primer

57 Problems with Automated Interpretation of HTML Documents
An intelligent agent trying to retrieve the names of the authors of the book Authors’ names could appear immediately after the title or immediately after the word by Are there two authors? Or just one, called “V. Marek and M. Truszczynski”? Chapter 2 A Semantic Web Primer

58 HTML vs XML: Structural Information
HTML documents do not contain structural information: pieces of the document and their relationships. XML more easily accessible to machines because Every piece of information is described. Relations are also defined through the nesting structure. E.g., the <author> tags appear within the <book> tags, so they describe properties of the particular book. Chapter 2 A Semantic Web Primer

59 HTML vs XML: Structural Information (2)
A machine processing the XML document would be able to deduce that the author element refers to the enclosing book element rather than by proximity considerations XML allows the definition of constraints on values E.g. a year must be a number of four digits Chapter 2 A Semantic Web Primer

60 HTML vs XML: Formatting
The HTML representation provides more than the XML representation: The formatting of the document is also described Τhe main use of an HTML document is to display information: it must define formatting XML: separation of content from display same information can be displayed in different ways Chapter 2 A Semantic Web Primer

61 HTML vs XML: Another Example
In HTML <h2>Relationship force-mass</h2> <i> F = M × a </i> In XML <equation> <meaning>Relationship force-mass</meaning> <leftside> F </leftside> <rightside> M × a </rightside> </equation> Chapter 2 A Semantic Web Primer

62 HTML vs XML: Different Use of Tags
In both HTML docs same tags In XML completely different HTML tags define display: color, lists … XML tags not fixed: user definable tags XML meta markup language: language for defining markup languages Chapter 2 A Semantic Web Primer

63 XML Vocabularies Web applications must agree on common vocabularies to communicate and collaborate Communities and business sectors are defining their specialized vocabularies mathematics (MathML) bioinformatics (BSML) human resources (HRML) Chapter 2 A Semantic Web Primer

64 Lecture Outline Introduction Detailed Description of XML Structuring
DTDs XML Schema Namespaces Accessing, querying XML documents: XPath Transformations: XSLT Chapter 2 A Semantic Web Primer

65 The XML Language An XML document consists of a prolog
a number of elements an optional epilog (not discussed) Chapter 2 A Semantic Web Primer

66 Prolog of an XML Document
The prolog consists of an XML declaration and an optional reference to external structuring documents <?xml version="1.0" encoding="UTF-16"?> <!DOCTYPE book SYSTEM "book.dtd"> Chapter 2 A Semantic Web Primer

67 XML Elements The “things” the XML document talks about
E.g. books, authors, publishers An element consists of: an opening tag the content a closing tag <lecturer>David Billington</lecturer> Chapter 2 A Semantic Web Primer

68 XML Elements (2) Tag names can be chosen almost freely.
The first character must be a letter, an underscore, or a colon No name may begin with the string “xml” in any combination of cases E.g. “Xml”, “xML” Chapter 2 A Semantic Web Primer

69 Content of XML Elements
Content may be text, or other elements, or nothing <lecturer> <name>David Billington</name> <phone> +61 − 7 − </phone> </lecturer> If there is no content, then the element is called empty; it is abbreviated as follows: <lecturer/> for <lecturer></lecturer> Chapter 2 A Semantic Web Primer

70 XML Attributes An empty element is not necessarily meaningless
It may have some properties in terms of attributes An attribute is a name-value pair inside the opening tag of an element <lecturer name="David Billington" phone="+61 − 7 − "/> Chapter 2 A Semantic Web Primer

71 XML Attributes: An Example
<order orderNo="23456" customer="John Smith" date="October 15, 2002"> <item itemNo="a528" quantity="1"/> <item itemNo="c817" quantity="3"/> </order> Chapter 2 A Semantic Web Primer

72 The Same Example without Attributes
<order> <orderNo>23456</orderNo> <customer>John Smith</customer> <date>October 15, 2002</date> <item> <itemNo>a528</itemNo> <quantity>1</quantity> </item> <itemNo>c817</itemNo> <quantity>3</quantity> </order> Chapter 2 A Semantic Web Primer

73 XML Elements vs Attributes
Attributes can be replaced by elements When to use elements and when attributes is a matter of taste But attributes cannot be nested Chapter 2 A Semantic Web Primer

74 Further Components of XML Docs
Comments A piece of text that is to be ignored by parser <!-- This is a comment --> Processing Instructions (PIs) Define procedural attachments <?stylesheet type="text/css" href="mystyle.css"?> Chapter 2 A Semantic Web Primer

75 Well-Formed XML Documents
Syntactically correct documents Some syntactic rules: Only one outermost element (called root element) Each element contains an opening and a corresponding closing tag Tags may not overlap <author><name>Lee Hong</author></name> Attributes within an element have unique names Element and tag names must be permissible Chapter 2 A Semantic Web Primer

76 The Tree Model of XML Documents: An Example
< > <head> <from name="Michael Maher" <to name="Grigoris Antoniou" <subject>Where is your draft?</subject> </head> <body> Grigoris, where is the draft of the paper you promised me last week? </body> </ > Chapter 2 A Semantic Web Primer

77 The Tree Model of XML Documents: An Example (2)
Chapter 2 A Semantic Web Primer

78 The Tree Model of XML Docs
The tree representation of an XML document is an ordered labeled tree: There is exactly one root There are no cycles Each non-root node has exactly one parent Each node has a label. The order of elements is important … but the order of attributes is not important Chapter 2 A Semantic Web Primer

79 Lecture Outline Introduction Detailed Description of XML Structuring
DTDs XML Schema Namespaces Accessing, querying XML documents: XPath Transformations: XSLT Chapter 2 A Semantic Web Primer

80 Structuring XML Documents
Define all the element and attribute names that may be used Define the structure what values an attribute may take which elements may or must occur within other elements, etc. If such structuring information exists, the document can be validated Chapter 2 A Semantic Web Primer

81 Structuring XML Dcuments (2)
An XML document is valid if it is well-formed respects the structuring information it uses There are two ways of defining the structure of XML documents: DTDs (the older and more restricted way) XML Schema (offers extended possibilities) Chapter 2 A Semantic Web Primer

82 DTD: Element Type Definition
<lecturer> <name>David Billington</name> <phone> +61 − 7 − </phone> </lecturer> DTD for above element (and all lecturer elements): <!ELEMENT lecturer (name,phone)> <!ELEMENT name (#PCDATA)> <!ELEMENT phone (#PCDATA)> Chapter 2 A Semantic Web Primer

83 The Meaning of the DTD The element types lecturer, name, and phone may be used in the document A lecturer element contains a name element and a phone element, in that order (sequence) A name element and a phone element may have any content In DTDs, #PCDATA is the only atomic type for elements Chapter 2 A Semantic Web Primer

84 DTD: Disjunction in Element Type Definitions
We express that a lecturer element contains either a name element or a phone element as follows: <!ELEMENT lecturer (name|phone)> A lecturer element contains a name element and a phone element in any order. <!ELEMENT lecturer((name,phone)|(phone,name))> Chapter 2 A Semantic Web Primer

85 Example of an XML Element
<order orderNo="23456" customer="John Smith" date="October 15, 2002"> <item itemNo="a528" quantity="1"/> <item itemNo="c817" quantity="3"/> </order> Chapter 2 A Semantic Web Primer

86 The Corresponding DTD <!ELEMENT order (item+)>
<!ATTLIST order orderNo ID #REQUIRED customer CDATA #REQUIRED date CDATA #REQUIRED> <!ELEMENT item EMPTY> <!ATTLIST item itemNo ID #REQUIRED quantity CDATA #REQUIRED comments CDATA #IMPLIED> Chapter 2 A Semantic Web Primer

87 Comments on the DTD The item element type is defined to be empty
+ (after item) is a cardinality operator: ?: appears zero times or once *: appears zero or more times +: appears one or more times No cardinality operator means exactly once Chapter 2 A Semantic Web Primer

88 Comments on the DTD (2) In addition to defining elements, we define attributes This is done in an attribute list containing: Name of the element type to which the list applies A list of triplets of attribute name, attribute type, and value type Attribute name: A name that may be used in an XML document using a DTD Chapter 2 A Semantic Web Primer

89 DTD: Attribute Types Similar to predefined data types, but limited selection The most important types are CDATA, a string (sequence of characters) ID, a name that is unique across the entire XML document IDREF, a reference to another element with an ID attribute carrying the same value as the IDREF attribute IDREFS, a series of IDREFs (v1| |vn), an enumeration of all possible values Limitations: no dates, number ranges etc. Chapter 2 A Semantic Web Primer

90 DTD: Attribute Value Types
#REQUIRED Attribute must appear in every occurrence of the element type in the XML document #IMPLIED The appearance of the attribute is optional #FIXED "value" Every element must have this attribute "value" This specifies the default value for the attribute Chapter 2 A Semantic Web Primer

91 Referencing with IDREF and IDREFS
<!ELEMENT family (person*)> <!ELEMENT person (name)> <!ELEMENT name (#PCDATA)> <!ATTLIST person id ID #REQUIRED mother IDREF #IMPLIED father IDREF #IMPLIED children IDREFS #IMPLIED> Chapter 2 A Semantic Web Primer

92 An XML Document Respecting the DTD
<family> <person id="bob" mother="mary" father="peter"> <name>Bob Marley</name> </person> <person id="bridget" mother="mary"> <name>Bridget Jones</name> <person id="mary" children="bob bridget"> <name>Mary Poppins</name> <person id="peter" children="bob"> <name>Peter Marley</name> </family> Chapter 2 A Semantic Web Primer

93 XML Entities An XML entity can play the role of
a placeholder for repeatable characters a section of external data a part of a declaration for elements We can use the entity reference &thisyear instead of the value " 2007 " <!ENTITY thisyear " 2007 " > Chapter 2 A Semantic Web Primer

94 A DTD for an Email Element
<!ELEMENT (head,body)> <!ELEMENT head (from,to+,cc*,subject)> <!ELEMENT from EMPTY> <!ATTLIST from name CDATA #IMPLIED address CDATA #REQUIRED> <!ELEMENT to EMPTY> <!ATTLIST to name CDATA #IMPLIED Chapter 2 A Semantic Web Primer

95 A DTD for an Email Element (2)
<!ELEMENT cc EMPTY> <!ATTLIST cc name CDATA #IMPLIED address CDATA #REQUIRED> <!ELEMENT subject (#PCDATA)> <!ELEMENT body (text,attachment*)> <!ELEMENT text (#PCDATA)> <!ELEMENT attachment EMPTY> <!ATTLIST attachment encoding (mime|binhex) "mime" file CDATA #REQUIRED> Chapter 2 A Semantic Web Primer

96 Interesting Parts of the DTD
A head element contains (in that order): a from element at least one to element zero or more cc elements a subject element In from, to, and cc elements the name attribute is not required the address attribute is always required Chapter 2 A Semantic Web Primer

97 Interesting Parts of the DTD (2)
A body element contains a text element possibly followed by a number of attachment elements The encoding attribute of an attachment element must have either the value “mime” or “binhex” “mime” is the default value Chapter 2 A Semantic Web Primer

98 Remarks on DTDs A DTD can be interpreted as an Extended Backus-Naur Form (EBNF) <!ELEMENT (head,body)> is equivalent to := head body Recursive definitions possible in DTDs <!ELEMENT bintree ((bintree root bintree)|emptytree)> Chapter 2 A Semantic Web Primer

99 Lecture Outline Introduction Detailed Description of XML Structuring
DTDs XML Schema Namespaces Accessing, querying XML documents: XPath Transformations: XSLT Chapter 2 A Semantic Web Primer

100 XML Schema Significantly richer language for defining the structure of XML documents Tts syntax is based on XML itself not necessary to write separate tools Reuse and refinement of schemas Expand or delete already existent schemas Sophisticated set of data types, compared to DTDs (which only supports strings) Chapter 2 A Semantic Web Primer

101 XML Schema (2) An XML schema is an element with an opening tag like
version="1.0"> Structure of schema elements Element and attribute types using data types Chapter 2 A Semantic Web Primer

102 Element Types <element name="email"/>
<element name="head" minOccurs="1" maxOccurs="1"/> <element name="to" minOccurs="1"/> Cardinality constraints: minOccurs="x" (default value 1) maxOccurs="x" (default value 1) Generalizations of *,?,+ offered by DTDs Chapter 2 A Semantic Web Primer

103 Attribute Types <attribute name="id" type="ID“ use="required"/>
< attribute name="speaks" type="Language" use="default" value="en"/> Existence: use="x", where x may be optional or required Default value: use="x" value="...", where x may be default or fixed Chapter 2 A Semantic Web Primer

104 Data Types There is a variety of built-in data types
Numerical data types: integer, Short etc. String types: string, ID, IDREF, CDATA etc. Date and time data types: time, Month etc. There are also user-defined data types simple data types, which cannot use elements or attributes complex data types, which can use these Chapter 2 A Semantic Web Primer

105 Data Types (2) Complex data types are defined from already existing data types by defining some attributes (if any) and using: sequence, a sequence of existing data type elements (order is important) all, a collection of elements that must appear (order is not important) choice, a collection of elements, of which one will be chosen Chapter 2 A Semantic Web Primer

106 A Data Type Example <complexType name="lecturerType">
<sequence> <element name="firstname" type="string" minOccurs="0“ maxOccurs="unbounded"/> <element name="lastname" type="string"/> </sequence> <attribute name="title" type="string" use="optional"/> </complexType> Chapter 2 A Semantic Web Primer

107 Data Type Extension Already existing data types can be extended by new elements or attributes. Example: <complexType name="extendedLecturerType"> <extension base="lecturerType"> <sequence> <element name=" " type="string" minOccurs="0" maxOccurs="1"/> </sequence> <attribute name="rank" type="string" use="required"/> </extension> </complexType> Chapter 2 A Semantic Web Primer

108 Resulting Data Type <complexType name="extendedLecturerType">
<sequence> <element name="firstname" type="string" minOccurs="0" maxOccurs="unbounded"/> <element name="lastname" type="string"/> <element name=" " type="string" minOccurs="0" maxOccurs="1"/> </sequence> <attribute name="title" type="string" use="optional"/> <attribute name="rank" type="string" use="required"/> </complexType> Chapter 2 A Semantic Web Primer

109 Data Type Extension (2) A hierarchical relationship exists between the original and the extended type Instances of the extended type are also instances of the original type They may contain additional information, but neither less information, nor information of the wrong type Chapter 2 A Semantic Web Primer

110 Data Type Restriction An existing data type may be restricted by adding constraints on certain values Restriction is not the opposite from extension Restriction is not achieved by deleting elements or attributes The following hierarchical relationship still holds: Instances of the restricted type are also instances of the original type They satisfy at least the constraints of the original type Chapter 2 A Semantic Web Primer

111 Example of Data Type Restriction
<complexType name="restrictedLecturerType"> <restriction base="lecturerType"> <sequence> <element name="firstname" type="string" minOccurs="1" maxOccurs="2"/> </sequence> <attribute name="title" type="string" use="required"/> </restriction> </complexType> Chapter 2 A Semantic Web Primer

112 Restriction of Simple Data Types
<simpleType name="dayOfMonth"> <restriction base="integer"> <minInclusive value="1"/> <maxInclusive value="31"/> </restriction> </simpleType> Chapter 2 A Semantic Web Primer

113 Data Type Restriction: Enumeration
<simpleType name="dayOfWeek"> <restriction base="string"> <enumeration value="Mon"/> <enumeration value="Tue"/> <enumeration value="Wed"/> <enumeration value="Thu"/> <enumeration value="Fri"/> <enumeration value="Sat"/> <enumeration value="Sun"/> </restriction> </simpleType> Chapter 2 A Semantic Web Primer

114 XML Schema: The Email Example
<element name=" " type=" Type"/> <complexType name=" Type"> <sequence> <element name="head" type="headType"/> <element name="body" type="bodyType"/> </sequence> </complexType> Chapter 2 A Semantic Web Primer

115 XML Schema: The Email Example (2)
<complexType name="headType"> <sequence> <element name="from" type="nameAddress"/> <element name="to" type="nameAddress" minOccurs="1" maxOccurs="unbounded"/> <element name="cc" type="nameAddress" minOccurs="0" maxOccurs="unbounded"/> <element name="subject" type="string"/> </sequence> </complexType> Chapter 2 A Semantic Web Primer

116 XML Schema: The Email Example (3)
<complexType name="nameAddress"> <attribute name="name" type="string" use="optional"/> <attribute name="address" type="string" use="required"/> </complexType> Similar for bodyType Chapter 2 A Semantic Web Primer

117 Lecture Outline Introduction Detailed Description of XML Structuring
DTDs XML Schema Namespaces Accessing, querying XML documents: XPath Transformations: XSLT Chapter 2 A Semantic Web Primer

118 Namespaces An XML document may use more than one DTD or schema
Since each structuring document was developed independently, name clashes may appear The solution is to use a different prefix for each DTD or schema prefix:name Chapter 2 A Semantic Web Primer

119 An Example <vu:instructors xmlns:vu="http://www.vu.com/empDTD"
xmlns:gu=" xmlns:uky=" <uky:faculty uky:title="assistant professor" uky:name="John Smith" uky:department="Computer Science"/> <gu:academicStaff gu:title="lecturer" gu:name="Mate Jones" gu:school="Information Technology"/> </vu:instructors> Chapter 2 A Semantic Web Primer

120 Namespace Declarations
Namespaces are declared within an element and can be used in that element and any of its children (elements and attributes) A namespace declaration has the form: xmlns:prefix="location" location is the address of the DTD or schema If a prefix is not specified: xmlns="location" then the location is used by default Chapter 2 A Semantic Web Primer

121 Lecture Outline Introduction Detailed Description of XML Structuring
DTDs XML Schema Namespaces Accessing, querying XML documents: XPath Transformations: XSLT Chapter 2 A Semantic Web Primer

122 Addressing and Querying XML Documents
In relational databases, parts of a database can be selected and retrieved using SQL Same necessary for XML documents Query languages: XQuery, XQL, XML-QL The central concept of XML query languages is a path expression Specifies how a node or a set of nodes, in the tree representation of the XML document can be reached Chapter 2 A Semantic Web Primer

123 XPath XPath is core for XML query languages
Language for addressing parts of an XML document. It operates on the tree data model of XML It has a non-XML syntax Chapter 2 A Semantic Web Primer

124 Types of Path Expressions
Absolute (starting at the root of the tree) Syntactically they begin with the symbol / It refers to the root of the document (situated one level above the root element of the document) Relative to a context node Chapter 2 A Semantic Web Primer

125 An XML Example <library location="Bremen">
<author name="Henry Wise"> <book title="Artificial Intelligence"/> <book title="Modern Web Services"/> <book title="Theory of Computation"/> </author> <author name="William Smart"> <author name="Cynthia Singleton"> <book title="The Semantic Web"/> <book title="Browser Technology Revised"/> </library> Chapter 2 A Semantic Web Primer

126 Tree Representation Chapter 2 A Semantic Web Primer

127 Examples of Path Expressions in XPath
Address all author elements /library/author Addresses all author elements that are children of the library element node, which resides immediately below the root /t1/.../tn, where each ti+1 is a child node of ti, is a path through the tree representation Chapter 2 A Semantic Web Primer

128 Examples of Path Expressions in XPath (2)
Address all author elements //author Here // says that we should consider all elements in the document and check whether they are of type author This path expression addresses all author elements anywhere in the document Chapter 2 A Semantic Web Primer

129 Examples of Path Expressions in XPath (3)
Address the location attribute nodes within library element nodes The is used to denote attribute nodes Chapter 2 A Semantic Web Primer

130 Examples of Path Expressions in XPath (4)
Address all title attribute nodes within book elements anywhere in the document, which have the value “Artificial Intelligence” Intelligence" Chapter 2 A Semantic Web Primer

131 Examples of Path Expressions in XPath (5)
Address all books with title “Artificial Intelligence” Intelligence"] Test within square brackets: a filter expression It restricts the set of addressed nodes. Difference with query 4. Query 5 addresses book elements, the title of which satisfies a certain condition. Query 4 collects title attribute nodes of book elements Chapter 2 A Semantic Web Primer

132 Tree Representation of Query 4
Chapter 2 A Semantic Web Primer

133 Tree Representation of Query 5
Chapter 2 A Semantic Web Primer

134 Examples of Path Expressions in XPath (6)
Address the first author element node in the XML document //author[1] Address the last book element within the first author element node in the document //author[1]/book[last()] Address all book element nodes without a title attribute Chapter 2 A Semantic Web Primer

135 General Form of Path Expressions
A path expression consists of a series of steps, separated by slashes A step consists of An axis specifier, A node test, and An optional predicate Chapter 2 A Semantic Web Primer

136 General Form of Path Expressions (2)
An axis specifier determines the tree relationship between the nodes to be addressed and the context node E.g. parent, ancestor, child (the default), sibling, attribute node // is such an axis specifier: descendant or self Chapter 2 A Semantic Web Primer

137 General Form of Path Expressions (3)
A node test specifies which nodes to address The most common node tests are element names E.g., * addresses all element nodes comment() addresses all comment nodes Chapter 2 A Semantic Web Primer

138 General Form of Path Expressions (4)
Predicates (or filter expressions) are optional and are used to refine the set of addressed nodes E.g., the expression [1] selects the first node [position()=last()] selects the last node [position() mod 2 =0] selects the even nodes XPath has a more complicated full syntax. We have only presented the abbreviated syntax Chapter 2 A Semantic Web Primer

139 Lecture Outline Introduction Detailed Description of XML Structuring
DTDs XML Schema Namespaces Accessing, querying XML documents: XPath Transformations: XSLT Chapter 2 A Semantic Web Primer

140 Displaying XML Documents
<author> <name>Grigoris Antoniou</name> <affiliation>University of Bremen</affiliation> </author> may be displayed in different ways: Grigoris Antoniou Grigoris Antoniou University of Bremen University of Bremen Chapter 2 A Semantic Web Primer

141 Style Sheets Style sheets can be written in various languages
E.g. CSS2 (cascading style sheets level 2) XSL (extensible stylesheet language) XSL includes a transformation language (XSLT) a formatting language Both are XML applications Chapter 2 A Semantic Web Primer

142 XSL Transformations (XSLT)
XSLT specifies rules with which an input XML document is transformed to another XML document an HTML document plain text The output document may use the same DTD or schema, or a completely different vocabulary XSLT can be used independently of the formatting language Chapter 2 A Semantic Web Primer

143 XSLT (2) Move data and metadata from one XML representation to another
XSLT is chosen when applications that use different DTDs or schemas need to communicate XSLT can be used for machine processing of content without any regard to displaying the information for people to read. In the following we use XSLT only to display XML documents Chapter 2 A Semantic Web Primer

144 XSLT Transformation into HTML
<xsl:template match="/author"> <html> <head><title>An author</title></head> <body bgcolor="white"> <b><xsl:value-of select="name"/></b><br /> <xsl:value-of select="affiliation"/><br /> <i><xsl:value-of select=" "/></i> </body> </html> </xsl:template> Chapter 2 A Semantic Web Primer

145 Style Sheet Output <html>
<head><title>An author</title></head> <body bgcolor="white"> <b>Grigoris Antoniou</b><br> University of Bremen<br> </body> </html> Chapter 2 A Semantic Web Primer

146 Observations About XSLT
XSLT documents are XML documents XSLT resides on top of XML The XSLT document defines a template In this case an HTML document, with some placeholders for content to be inserted xsl:value-of retrieves the value of an element and copies it into the output document It places some content into the template Chapter 2 A Semantic Web Primer

147 A Template <html>
<head><title>An author</title></head> <body bgcolor="white"> <b>...</b><br> ...<br> <i>...</i> </body> </html> Chapter 2 A Semantic Web Primer

148 Auxiliary Templates We have an XML document with details of several authors It is a waste of effort to treat each author element separately In such cases, a special template is defined for author elements, which is used by the main template Chapter 2 A Semantic Web Primer

149 Example of an Auxiliary Template
<authors> <author> <name>Grigoris Antoniou</name> <affiliation>University of Bremen</affiliation> </author> <name>David Billington</name> <affiliation>Griffith University</affiliation> </authors> Chapter 2 A Semantic Web Primer

150 Example of an Auxiliary Template (2)
<xsl:template match="/"> <html> <head><title>Authors</title></head> <body bgcolor="white"> <xsl:apply-templates select="authors"/> <!-- Apply templates for AUTHORS children --> </body> </html> </xsl:template> Chapter 2 A Semantic Web Primer

151 Example of an Auxiliary Template (3)
<xsl:template match="authors"> <xsl:apply-templates select="author"/> </xsl:template> <xsl:template match="author"> <h2><xsl:value-of select="name"/></h2> Affiliation:<xsl:value-of select="affiliation"/><br> <xsl:value-of select=" "/> <p> Chapter 2 A Semantic Web Primer

152 Multiple Authors Output
<html> <head><title>Authors</title></head> <body bgcolor="white"> <h2>Grigoris Antoniou</h2> Affiliation: University of Bremen<br> <p> <h2>David Billington</h2> Affiliation: Griffith University<br> </body> </html> Chapter 2 A Semantic Web Primer

153 Explanation of the Example
xsl:apply-templates element causes all children of the context node to be matched against the selected path expression E.g., if the current template applies to /, then the element xsl:apply-templates applies to the root element I.e. the authors element (/ is located above the root element) If the current context node is the authors element, then the element xsl:apply-templates select="author" causes the template for the author elements to be applied to all author children of the authors element Chapter 2 A Semantic Web Primer

154 Explanation of the Example (2)
It is good practice to define a template for each element type in the document Even if no specific processing is applied to certain elements, the xsl:apply-templates element should be used E.g. authors In this way, we work from the root to the leaves of the tree, and all templates are applied Chapter 2 A Semantic Web Primer

155 Processing XML Attributes
Suppose we wish to transform to itself the element: <person firstname="John" lastname="Woo"/> Wrong solution: <xsl:template match="person"> <person firstname="<xsl:value-of lastname="<xsl:value-of </xsl:template> Chapter 2 A Semantic Web Primer

156 Processing XML Attributes (2)
Not well-formed because tags are not allowed within the values of attributes We wish to add attribute values into template <xsl:template match="person"> <person </xsl:template> Chapter 2 A Semantic Web Primer

157 Transforming an XML Document to Another
Chapter 2 A Semantic Web Primer

158 Transforming an XML Document to Another (2)
<xsl:template match="/"> <?xml version="1.0" encoding="UTF-16"?> <authors> <xsl:apply-templates select="authors"/> </authors> </xsl:template> <xsl:template match="authors"> <author> <xsl:apply-templates select="author"/> </author> Chapter 2 A Semantic Web Primer

159 Transforming an XML Document to Another (3)
<xsl:template match="author"> <name><xsl:value-of select="name"/></name> <contact> <institution> <xsl:value-of select="affiliation"/> </institution> < ><xsl:value-of select=" "/></ > </contact> </xsl:template> Chapter 2 A Semantic Web Primer

160 Summary XML is a metalanguage that allows users to define markup
XML separates content and structure from formatting XML is the de facto standard for the representation and exchange of structured information on the Web XML is supported by query languages Chapter 2 A Semantic Web Primer

161 Points for Discussion in Subsequent Chapters
The nesting of tags does not have standard meaning The semantics of XML documents is not accessible to machines, only to people Collaboration and exchange are supported if there is underlying shared understanding of the vocabulary XML is well-suited for close collaboration, where domain- or community-based vocabularies are used It is not so well-suited for global communication. Chapter 2 A Semantic Web Primer

162 Chapter 3 Describing Web Resources in RDF
Grigoris Antoniou Frank van Harmelen Chapter 3 A Semantic Web Primer

163 Lecture Outline Basic Ideas of RDF XML-based Syntax of RDF
Basic Concepts of RDF Schema Τhe Language of RDF Schema The Namespaces of RDF and RDF Schema Axiomatic Semantics for RDF and RDFS Direct Semantics based on Inference Rules Querying of RDF/RDFS Documents using SPARQL Chapter 3 A Semantic Web Primer

164 Drawbacks of XML XML is a universal metalanguage for defining markup
It provides a uniform framework for interchange of data and metadata between applications However, XML does not provide any means of talking about the semantics (meaning) of data E.g., there is no intended meaning associated with the nesting of tags It is up to each application to interpret the nesting. Chapter 3 A Semantic Web Primer

165 Nesting of Tags in XML David Billington is a lecturer of Discrete Maths <course name="Discrete Maths"> <lecturer>David Billington</lecturer> </course> <lecturer name="David Billington"> <teaches>Discrete Maths</teaches> </lecturer> Opposite nesting, same information! Chapter 3 A Semantic Web Primer

166 Basic Ideas of RDF Basic building block: object-attribute-value triple
It is called a statement Sentence about Billington is such a statement RDF has been given a syntax in XML This syntax inherits the benefits of XML Other syntactic representations of RDF possible Chapter 3 A Semantic Web Primer

167 Basic Ideas of RDF (2) The fundamental concepts of RDF are: resources
properties statements Chapter 3 A Semantic Web Primer

168 Resources We can think of a resource as an object, a “thing” we want to talk about E.g. authors, books, publishers, places, people, hotels Every resource has a URI, a Universal Resource Identifier A URI can be a URL (Web address) or some other kind of unique identifier Chapter 3 A Semantic Web Primer

169 Properties Properties are a special kind of resources
They describe relations between resources E.g. “written by”, “age”, “title”, etc. Properties are also identified by URIs Advantages of using URIs: Α global, worldwide, unique naming scheme Reduces the homonym problem of distributed data representation Chapter 3 A Semantic Web Primer

170 Statements Statements assert the properties of resources
A statement is an object-attribute-value triple It consists of a resource, a property, and a value Values can be resources or literals Literals are atomic values (strings) Chapter 3 A Semantic Web Primer

171 Three Views of a Statement
A triple A piece of a graph A piece of XML code Thus an RDF document can be viewed as: A set of triples A graph (semantic net) An XML document Chapter 3 A Semantic Web Primer

172 Statements as Triples (http://www.cit.gu.edu.au/~db,
#David Billington) The triple (x,P,y) can be considered as a logical formula P(x,y) Binary predicate P relates object x to object y RDF offers only binary predicates (properties) Chapter 3 A Semantic Web Primer

173 XML Vocabularies A directed graph with labeled nodes and arcs
from the resource (the subject of the statement) to the value (the object of the statement) Known in AI as a semantic net The value of a statement may be a resource Ιt may be linked to other resources Chapter 3 A Semantic Web Primer

174 A Set of Triples as a Semantic Net
Chapter 3 A Semantic Web Primer

175 Statements in XML Syntax
Graphs are a powerful tool for human understanding but The Semantic Web vision requires machine-accessible and machine-processable representations There is a 3rd representation based on XML But XML is not a part of the RDF data model E.g. serialisation of XML is irrelevant for RDF Chapter 3 A Semantic Web Primer

176 Statements in XML (2) <rdf:RDF
xmlns:rdf=" xmlns:mydomain=" <rdf:Description rdf:about=" <mydomain:site-owner rdf:resource=“#David Billington“/> </rdf:Description> </rdf:RDF> Chapter 3 A Semantic Web Primer

177 Statements in XML (3) An RDF document is represented by an XML element with the tag rdf:RDF The content of this element is a number of descriptions, which use rdf:Description tags. Every description makes a statement about a resource, identified in 3 ways: an about attribute, referencing an existing resource an ID attribute, creating a new resource without a name, creating an anonymous resource Chapter 3 A Semantic Web Primer

178 Statements in XML (4) The rdf:Description element makes a statement about the resource Within the description the property is used as a tag the content is the value of the property Chapter 3 A Semantic Web Primer

179 Reification In RDF it is possible to make statements about statements
Grigoris believes that David Billington is the creator of Such statements can be used to describe belief or trust in other statements The solution is to assign a unique identifier to each statement It can be used to refer to the statement Chapter 3 A Semantic Web Primer

180 Reification (2) Introduce an auxiliary object (e.g. belief1)
relate it to each of the 3 parts of the original statement through the properties subject, predicate and object In the preceding example subject of belief1 is David Billington predicate of belief1 is creator object of belief1 is Chapter 3 A Semantic Web Primer

181 Data Types Data types are used in programming languages to allow interpretation In RDF, typed literals are used, if necessary (#David Billington, “27”^ Chapter 3 A Semantic Web Primer

182 Data Types (2) ^^-notation indicates the type of a literal
In practice, the most widely used data typing scheme will be the one by XML Schema But the use of any externally defined data typing scheme is allowed in RDF documents XML Schema predefines a large range of data types E.g. Booleans, integers, floating-point numbers, times, dates, etc. Chapter 3 A Semantic Web Primer

183 A Critical View of RDF: Binary Predicates
RDF uses only binary properties This is a restriction because often we use predicates with more than 2 arguments But binary predicates can simulate these Example: referee(X,Y,Z) X is the referee in a chess game between players Y and Z Chapter 3 A Semantic Web Primer

184 A Critical View of RDF: Binary Predicates (2)
We introduce: a new auxiliary resource chessGame the binary predicates ref, player1, and player2 We can represent referee(X,Y,Z) as: Chapter 3 A Semantic Web Primer

185 A Critical View of RDF: Properties
Properties are special kinds of resources Properties can be used as the object in an object-attribute-value triple (statement) They are defined independent of resources This possibility offers flexibility But it is unusual for modelling languages and OO programming languages It can be confusing for modellers Chapter 3 A Semantic Web Primer

186 A Critical View of RDF: Reification
The reification mechanism is quite powerful It appears misplaced in a simple language like RDF Making statements about statements introduces a level of complexity that is not necessary for a basic layer of the Semantic Web Instead, it would have appeared more natural to include it in more powerful layers, which provide richer representational capabilities Chapter 3 A Semantic Web Primer

187 A Critical View of RDF: Summary
RDF has its idiosyncrasies and is not an optimal modeling language but It is already a de facto standard It has sufficient expressive power At least as for more layers to build on top Using RDF offers the benefit that information maps unambiguously to a model Chapter 3 A Semantic Web Primer

188 Lecture Outline Basic Ideas of RDF XML-based Syntax of RDF
Basic Concepts of RDF Schema Τhe Language of RDF Schema The Namespaces of RDF and RDF Schema Axiomatic Semantics for RDF and RDFS Direct Semantics based on Inference Rules Querying of RDF/RDFS Documents using SPARQL Chapter 3 A Semantic Web Primer

189 XML-Based Syntax of RDF
An RDF document consists of an rdf:RDF element The content of that element is a number of descriptions A namespace mechanism is used Disambiguation Namespaces are expected to be RDF documents defining resources that can be reused Large, distributed collections of knowledge Chapter 3 A Semantic Web Primer

190 Example of University Courses
<rdf:RDF xmlns:rdf=" xmlns:xsd=" xmlns:uni=" <rdf:Description rdf:about="949318"> <uni:name>David Billington</uni:name> <uni:title>Associate Professor</uni:title> <uni:age rdf:datatype="&xsd:integer">27<uni:age> </rdf:Description> Chapter 3 A Semantic Web Primer

191 Example of University Courses (2)
<rdf:Description rdf:about="CIT1111"> <uni:courseName>Discrete Maths</uni:courseName> <uni:isTaughtBy>David Billington</uni:isTaughtBy> </rdf:Description> <rdf:Description rdf:about="CIT2112"> <uni:courseName>Programming III</uni:courseName> <uni:isTaughtBy>Michael Maher</uni:isTaughtBy> </rdf:RDF> Chapter 3 A Semantic Web Primer

192 rdf:about versus rdf:ID
An element rdf:Description has an rdf:about attribute indicating that the resource has been “defined” elsewhere An rdf:ID attribute indicating that the resource is defined Formally, there is no such thing as “defining” an object in one place and referring to it elsewhere Sometimes is useful (for human readability) to have a defining location, while other locations state “additional” properties Chapter 3 A Semantic Web Primer

193 Property Elements Content of rdf:Description elements
<rdf:Description rdf:about="CIT3116"> <uni:courseName>Knowledge Representation</uni:courseName> <uni:isTaughtBy>Grigoris Antoniou</uni:isTaughtBy> </rdf:Description> uni:courseName and uni:isTaughtBy define two property-value pairs for CIT3116 (two RDF statements) read conjunctively Chapter 3 A Semantic Web Primer

194 Data Types The attribute rdf:datatype="&xsd:integer" is used to indicate the data type of the value of the age property <rdf:Description rdf:about="949318"> <uni:name>David Billington</uni:name> <uni:title>Associate Professor</uni:title> <uni:age rdf:datatype="&xsd:integer">27<uni:age> </rdf:Description> Chapter 3 A Semantic Web Primer

195 Data Types (2) The age property has been defined to have "&xsd:integer" as its range It is still required to indicate the type of the value of this property each time it is used This is to ensure that an RDF processor can assign the correct type of the property value even if it has not "seen" the corresponding RDF Schema definition before This scenario is quite likely to occur in the unrestricted WWW Chapter 3 A Semantic Web Primer

196 The rdf:resource Attribute
The relationships between courses and lecturers (in the example) were not formally defined but existed implicitly through the use of the same name The use of the same name may just be a coincidence for a machine We can denote that two entities are the same using the rdf:resource attribute Chapter 3 A Semantic Web Primer

197 The rdf:resource Attribute (2)
<rdf:Description rdf:about="CIT1111"> <uni:courseName>Discrete Mathematics</uni:courseName> <uni:isTaughtBy rdf:resource="949318"/> </rdf:Description> <rdf:Description rdf:about="949318"> <uni:name>David Billington</uni:name> <uni:title>Associate Professor</uni:title> Chapter 3 A Semantic Web Primer

198 Referencing Externally Defined Resources
E.g., to refer the externally defined resource CIT1111: as the value of rdf:about is the URI where the definition of CIT1111 is found A description with an ID defines a fragment URI, which can be used to reference the defined description Chapter 3 A Semantic Web Primer

199 Nested Descriptions: Example
<rdf:Description rdf:about="CIT1111"> <uni:courseName>Discrete Maths</uni:courseName> <uni:isTaughtBy> <rdf:Description rdf:ID="949318"> <uni:name>David Billington</uni:name> <uni:title>Associate Professor</uni:title> </rdf:Description> </uni:isTaughtBy> Chapter 3 A Semantic Web Primer

200 Nested Descriptions Descriptions may be defined within other descriptions Other courses, such as CIT3112, can still refer to the new resource with ID Although a description may be defined within another description, its scope is global Chapter 3 A Semantic Web Primer

201 Introducing some Structure to RDF Documents using the rdf:type Element
<rdf:Description rdf:ID="CIT1111"> <rdf:type rdf:resource=" ns#course"/> <uni:courseName>Discrete Maths</uni:courseName> <uni:isTaughtBy rdf:resource="#949318"/> </rdf:Description> <rdf:Description rdf:ID="949318"> <rdf:type rdf:resource=" ns#lecturer"/> <uni:name>David Billington</uni:name> <uni:title>Associate Professor</uni:title> Chapter 3 A Semantic Web Primer

202 Abbreviated Syntax Simplification rules:
Childless property elements within description elements may be replaced by XML attributes For description elements with a typing element we can use the name specified in the rdf:type element instead of rdf:Description These rules create syntactic variations of the same RDF statement They are equivalent according to the RDF data model, although they have different XML syntax Chapter 3 A Semantic Web Primer

203 Abbreviated Syntax: Example
<rdf:Description rdf:ID="CIT1111"> <rdf:type rdf:resource=" ns#course"/> <uni:courseName>Discrete Maths</uni:courseName> <uni:isTaughtBy rdf:resource="#949318"/> </rdf:Description> Chapter 3 A Semantic Web Primer

204 Application of First Simplification Rule
<rdf:Description rdf:ID="CIT1111" uni:courseName="Discrete Maths"> <rdf:type rdf:resource=" ns#course"/> <uni:isTaughtBy rdf:resource="#949318"/> </rdf:Description> Chapter 3 A Semantic Web Primer

205 Application of 2nd Simplification Rule
<uni:course rdf:ID="CIT1111" uni:courseName="Discrete Maths"> <uni:isTaughtBy rdf:resource="#949318"/> </uni:course> Chapter 3 A Semantic Web Primer

206 Container Elements Collect a number of resources or attributes about which we want to make statements as a whole E.g., we may wish to talk about the courses given by a particular lecturer The content of container elements are named rdf:_1, rdf:_2, etc. Alternatively rdf:li Chapter 3 A Semantic Web Primer

207 Three Types of Container Elements
rdf:Bag an unordered container, allowing multiple occurrences E.g. members of the faculty board, documents in a folder rdf:Seq an ordered container, which may contain multiple occurrences E.g. modules of a course, items on an agenda, an alphabetized list of staff members (order is imposed) rdf:Alt a set of alternatives E.g. the document home and mirrors, translations of a document in various languages Chapter 3 A Semantic Web Primer

208 Example for a Bag <uni:lecturer rdf:ID="949352" uni:name="Grigoris Antoniou" uni:title="Professor"> <uni:coursesTaught> <rdf:Bag> <rdf:_1 rdf:resource="#CIT1112"/> <rdf:_2 rdf:resource="#CIT3116"/> </rdf:Bag> </uni:coursesTaught> </uni:lecturer> Chapter 3 A Semantic Web Primer

209 Example for Alternative
<uni:course rdf:ID="CIT1111" uni:courseName="Discrete Mathematics"> <uni:lecturer> <rdf:Alt> <rdf:li rdf:resource="#949352"/> <rdf:li rdf:resource="#949318"/> </rdf:Alt> </uni:lecturer> </uni:course> Chapter 3 A Semantic Web Primer

210 Rdf:ID Attribute for Container Elements
<uni:lecturer rdf:ID="949318"  uni:name="David Billington"> <uni:coursesTaught> <rdf:Bag rdf:ID="DBcourses"> <rdf:_1 rdf:resource="#CIT1111"/> <rdf:_2 rdf:resource="#CIT3112"/> </rdf:Bag> </uni:coursesTaught> </uni:lecturer> Chapter 3 A Semantic Web Primer

211 RDF Collections A limitation of these containers is that there is no way to close them “these are all the members of the container” RDF provides support for describing groups containing only the specified members, in the form of RDF collections list structure in the RDF graph constructed using a predefined collection vocabulary: rdf:List, rdf:first, rdf:rest and rdf:nil Chapter 3 A Semantic Web Primer

212 RDF Collections (2) Shorthand syntax:
"Collection" value for the rdf:parseType attribute: <rdf:Description rdf:about="#CIT2112"> <uni:isTaughtBy rdf:parseType="Collection"> <rdf:Description rdf:about="#949111"/> <rdf:Description rdf:about="#949352"/> <rdf:Description rdf:about="#949318"/> </uni:isTaughtBy> </rdf:Description> Chapter 3 A Semantic Web Primer

213 Reification Sometimes we wish to make statements about other statements We must be able to refer to a statement using an identifier RDF allows such reference through a reification mechanism which turns a statement into a resource Chapter 3 A Semantic Web Primer

214 Reification Example <rdf:Description rdf:about="#949352">
<uni:name>Grigoris Antoniou</uni:name> </rdf:Description> reifies as <rdf:Statement rdf:ID="StatementAbout949352"> <rdf:subject rdf:resource="#949352"/> <rdf:predicate rdf:resource=" uni-ns#name"/> <rdf:object>Grigoris Antoniou</rdf:object> </rdf:Statement> Chapter 3 A Semantic Web Primer

215 Reification (2) rdf:subject, rdf:predicate and rdf:object allow us to access the parts of a statement The ID of the statement can be used to refer to it, as can be done for any description We write an rdf:Description if we don’t want to talk about a statement further We write an rdf:Statement if we wish to refer to a statement Chapter 3 A Semantic Web Primer

216 Lecture Outline Basic Ideas of RDF XML-based Syntax of RDF
Basic Concepts of RDF Schema Τhe Language of RDF Schema The Namespaces of RDF and RDF Schema Axiomatic Semantics for RDF and RDFS Direct Semantics based on Inference Rules Querying of RDF/RDFS Documents using SPARQL Chapter 3 A Semantic Web Primer

217 Basic Ideas of RDF Schema
RDF is a universal language that lets users describe resources in their own vocabularies RDF does not assume, nor does it define semantics of any particular application domain The user can do so in RDF Schema using: Classes and Properties Class Hierarchies and Inheritance Property Hierarchies Chapter 3 A Semantic Web Primer

218 Classes and their Instances
We must distinguish between Concrete “things” (individual objects) in the domain: Discrete Maths, David Billington etc. Sets of individuals sharing properties called classes: lecturers, students, courses etc. Individual objects that belong to a class are referred to as instances of that class The relationship between instances and classes in RDF is through rdf:type Chapter 3 A Semantic Web Primer

219 Why Classes are Useful Impose restrictions on what can be stated in an RDF document using the schema As in programming languages E.g. A+1, where A is an array Disallow nonsense from being stated Chapter 3 A Semantic Web Primer

220 Nonsensical Statements disallowed through the Use of Classes
Discrete Maths is taught by Concrete Maths We want courses to be taught by lecturers only Restriction on values of the property “is taught by” (range restriction) Room MZH5760 is taught by David Billington Only courses can be taught This imposes a restriction on the objects to which the property can be applied (domain restriction) Chapter 3 A Semantic Web Primer

221 Class Hierarchies Classes can be organised in hierarchies
A is a subclass of B if every instance of A is also an instance of B Then B is a superclass of A A subclass graph need not be a tree A class may have multiple superclasses Chapter 3 A Semantic Web Primer

222 Class Hierarchy Example
Chapter 3 A Semantic Web Primer

223 Inheritance in Class Hierarchies
Range restriction: Courses must be taught by academic staff members only Michael Maher is a professor He inherits the ability to teach from the class of academic staff members This is done in RDF Schema by fixing the semantics of “is a subclass of” It is not up to an application (RDF processing software) to interpret “is a subclass of Chapter 3 A Semantic Web Primer

224 Property Hierarchies Hierarchical relationships for properties
E.g., “is taught by” is a subproperty of “involves” If a course C is taught by an academic staff member A, then C also involves Α The converse is not necessarily true E.g., A may be the teacher of the course C, or a tutor who marks student homework but does not teach C P is a subproperty of Q, if Q(x,y) is true whenever P(x,y) is true Chapter 3 A Semantic Web Primer

225 RDF Layer vs RDF Schema Layer
Discrete Mathematics is taught by David Billington The schema is itself written in a formal language, RDF Schema, that can express its ingredients: subClassOf, Class, Property, subPropertyOf, Resource, etc. Chapter 3 A Semantic Web Primer

226 RDF Layer vs RDF Schema Layer (2)
Chapter 3 A Semantic Web Primer

227 Lecture Outline Basic Ideas of RDF XML-based Syntax of RDF
Basic Concepts of RDF Schema Τhe Language of RDF Schema The Namespaces of RDF and RDF Schema Axiomatic Semantics for RDF and RDFS Direct Semantics based on Inference Rules Querying of RDF/RDFS Documents using SPARQL Chapter 3 A Semantic Web Primer

228 Lecture Outline Introduction Detailed Description of XML Structuring
DTDs XML Schema Namespaces Accessing, querying XML documents: XPath Transformations: XSLT Chapter 3 A Semantic Web Primer

229 RDF Schema in RDF The modeling primitives of RDF Schema are defined using resources and properties (RDF itself is used!) To declare that “lecturer” is a subclass of “academic staff member” Define resources lecturer, academicStaffMember, and subClassOf define property subClassOf Write triple (lecturer,subClassOf,academicStaffMember) We use the XML-based syntax of RDF Chapter 3 A Semantic Web Primer

230 Core Classes rdfs:Resource, the class of all resources
rdfs:Class, the class of all classes rdfs:Literal, the class of all literals (strings) rdf:Property, the class of all properties. rdf:Statement, the class of all reified statements Chapter 3 A Semantic Web Primer

231 Core Properties rdf:type, which relates a resource to its class
The resource is declared to be an instance of that class rdfs:subClassOf, which relates a class to one of its superclasses All instances of a class are instances of its superclass rdfs:subPropertyOf, relates a property to one of its superproperties Chapter 3 A Semantic Web Primer

232 Core Properties (2) rdfs:domain, which specifies the domain of a property P The class of those resources that may appear as subjects in a triple with predicate P If the domain is not specified, then any resource can be the subject rdfs:range, which specifies the range of a property P The class of those resources that may appear as values in a triple with predicate P Chapter 3 A Semantic Web Primer

233 Examples <rdfs:Class rdf:about="#lecturer">
<rdfs:subClassOf rdf:resource="#staffMember"/> </rdfs:Class> <rdf:Property rdf:ID="phone"> <rdfs:domain rdf:resource="#staffMember"/> <rdfs:range rdf:resource=" 2000/01/rdf-schema#Literal"/> </rdf:Property> Chapter 3 A Semantic Web Primer

234 Relationships Between Core Classes and Properties
rdfs:subClassOf and rdfs:subPropertyOf are transitive, by definition rdfs:Class is a subclass of rdfs:Resource Because every class is a resource rdfs:Resource is an instance of rdfs:Class rdfs:Resource is the class of all resources, so it is a class Every class is an instance of rdfs:Class For the same reason Chapter 3 A Semantic Web Primer

235 Reification and Containers
rdf:subject, relates a reified statement to its subject rdf:predicate, relates a reified statement to its predicate rdf:object, relates a reified statement to its object rdf:Bag, the class of bags rdf:Seq, the class of sequences rdf:Alt, the class of alternatives rdfs:Container, which is a superclass of all container classes, including the three above Chapter 3 A Semantic Web Primer

236 Utility Properties rdfs:seeAlso relates a resource to another resource that explains it rdfs:isDefinedBy is a subproperty of rdfs:seeAlso and relates a resource to the place where its definition, typically an RDF schema, is found rdfs:comment. Comments, typically longer text, can be associated with a resource rdfs:label. A human-friendly label (name) is associated with a resource Chapter 3 A Semantic Web Primer

237 Example: A University <rdfs:Class rdf:ID="lecturer">
<rdfs:comment> The class of lecturers. All lecturers are academic staff members. </rdfs:comment> <rdfs:subClassOf rdf:resource="#academicStaffMember"/> </rdfs:Class> Chapter 3 A Semantic Web Primer

238 Example: A University (2)
<rdfs:Class rdf:ID="course"> <rdfs:comment>The class of courses</rdfs:comment> </rdfs:Class> <rdf:Property rdf:ID="isTaughtBy"> <rdfs:comment> Inherits its domain ("course") and range ("lecturer") from its superproperty "involves" </rdfs:comment> <rdfs:subPropertyOf rdf:resource="#involves"/> </rdf:Property> Chapter 3 A Semantic Web Primer

239 Example: A University (3)
<rdf:Property rdf:ID="phone"> <rdfs:comment> It is a property of staff members and takes literals as values. </rdfs:comment> <rdfs:domain rdf:resource="#staffMember"/> <rdfs:range rdf:resource=" schema#Literal"/> </rdf:Property> Chapter 3 A Semantic Web Primer

240 Class Hierarchy for the Motor Vehicles Example
Chapter 3 A Semantic Web Primer

241 Lecture Outline Basic Ideas of RDF XML-based Syntax of RDF
Basic Concepts of RDF Schema Τhe Language of RDF Schema The Namespaces of RDF and RDF Schema Axiomatic Semantics for RDF and RDFS Direct Semantics based on Inference Rules Querying of RDF/RDFS Documents using SPARQL Chapter 3 A Semantic Web Primer

242 The Namespace of RDF <rdfs:Class rdf:ID="Statement"
rdfs:comment="The class of triples consisting of a predicate, a subject and an object (that is, a reified statement)"/> <rdfs:Class rdf:ID="Property" rdfs:comment="The class of properties"/> <rdfs:Class rdf:ID="Bag" rdfs:comment="The class of unordered collections"/> Chapter 3 A Semantic Web Primer

243 The Namespace of RDF (2) <rdf:Property rdf:ID="predicate"
rdfs:comment="Identifies the property of a statementin reified form"/> <rdfs:domain rdf:resource="#Statement"/> <rdfs:range rdf:resource="#Property"/> </rdf:Property> Chapter 3 A Semantic Web Primer

244 The Namespace of RDF Schema
<rdfs:Class rdf:ID="Resource" rdfs:comment="The most general class"/> <rdfs:Class rdf:ID="Class" rdfs:comment="The concept of classes. All classes are resources"/> <rdfs:subClassOf rdf:resource="#Resource"/> </rdfs:Class> Chapter 3 A Semantic Web Primer

245 The Namespace of RDF Schema (2)
<rdf:Property rdf:ID="subPropertyOf"> <rdfs:domain rdf:resource=" 1999/02/22-rdf-syntax-ns#Property"/> <rdfs:range rdf:resource=" </rdf:Property> <rdf:Property rdf:ID="subClassOf"> <rdfs:domain rdf:resource="#Class"/> <rdfs:range rdf:resource="#Class"/> Chapter 3 A Semantic Web Primer

246 Namespace versus Semantics
Consider rdfs:subClassOf The namespace specifies only that it applies to classes and has a class as a value The meaning of being a subclass not expressed The meaning cannot be expressed in RDF If it could RDF Schema would be unnecessary External definition of semantics required Respected by RDF/RDFS processing software Chapter 3 A Semantic Web Primer

247 Lecture Outline Basic Ideas of RDF XML-based Syntax of RDF
Basic Concepts of RDF Schema Τhe Language of RDF Schema The Namespaces of RDF and RDF Schema Axiomatic Semantics for RDF and RDFS Direct Semantics based on Inference Rules Querying of RDF/RDFS Documents using SPARQL Chapter 3 A Semantic Web Primer

248 Axiomatic Semantics We formalize the meaning of the modeling primitives of RDF and RDF Schema By translating into first-order logic We make the semantics unambiguous and machine accessible We provide a basis for reasoning support by automated reasoners manipulating logical formulas Chapter 3 A Semantic Web Primer

249 The Approach All language primitives in RDF and RDF Schema are represented by constants: Resource, Class, Property, subClassOf, etc. A few predefined predicates are used as a foundation for expressing relationships between the constants We use predicate logic with equality Variable names begin with ? All axioms are implicitly universally quantified Chapter 3 A Semantic Web Primer

250 An Auxiliary Axiomatisation of Lists
Function symbols: nil (empty list) cons(x,l) (adds an element to the front of the list) first(l) (returns the first element) rest(l) (returns the rest of the list) Predicate symbols: item(x,l) (tests if an element occurs in the list) list(l) (tests whether l is a list) Lists are used to represent containers in RDF Chapter 3 A Semantic Web Primer

251 Basic Predicates PropVal(P,R,V) Type(R,T)
A predicate with 3 arguments, which is used to represent an RDF statement with resource R, property P and value V An RDF statement (triple) (P,R,V) is represented as PropVal(P,R,V). Type(R,T) Short for PropVal(type,R,T) Specifies that the resource R has the type T Type(?r,?t)  PropVal(type,?r,?t) Chapter 3 A Semantic Web Primer

252 RDF Classes Constants: Class, Resource, Property, Literal
All classes are instances of Class Type(Class,Class) Type(Resource,Class) Type(Property,Class) Type(Literal,Class) Chapter 3 A Semantic Web Primer

253 RDF Classes (2) Resource is the most general class: every class and every property is a resource Type(?p,Property)  Type(?p,Resource) Type(?c,Class)  Type(?c,Resource) The predicate in an RDF statement must be a property PropVal(?p,?r,?v)  Type(?p,Property) Chapter 3 A Semantic Web Primer

254 The type Property type is a property PropVal(type,type,Property)
type can be applied to resources (domain) and has a class as its value (range) Type(?r,?c)  (Type(?r,Resource)  Type(?c,Class)) Chapter 3 A Semantic Web Primer

255 The Auxiliary FuncProp Property
P is a functional property if, and only if, it is a property, and there are no x, y1 and y2 with P(x,y1), P(x,y2 ) and y1y2 Type(?p, FuncProp)  (Type(?p, Property)  ?r ?v1 ?v2 (PropVal(?p,?r,?v1)  PropVal(?p,?r,?v2)  ?v1 = ?v2)) Chapter 3 A Semantic Web Primer

256 Containers Containers are lists: Type(?c,Container)  list(?c)
Containers are bags or sequences or alternatives: Type(?c,Container)  (Type(?c,Bag)  Type(?c,Seq)  Type(?c,Alt)) Bags and sequences are disjoint: ¬(Type(?x,Bag)  Type(?x,Seq)) Chapter 3 A Semantic Web Primer

257 Containers (2) For every natural number n > 0, there is the selector _n, which selects the nth element of a container It is a functional property: Type(_n,FuncProp) It applies to containers only: PropVal(_n,?c,?o)  Type(?c,Container) Chapter 3 A Semantic Web Primer

258 Subclass subClassOf is a property: Type(subClassOf,Property)
If a class C is a subclass of a class C', then all instances of C are also instances of C': PropVal(subClassOf,?c,?c')  (Type(?c,Class)  Type(?c',Class)  ?x (Type(?x,?c)  Type(?x,?c'))) Chapter 3 A Semantic Web Primer

259 Subproperty P is a subproperty of P', if P'(x,y) is true whenever P(x,y) is true: Type(subPropertyOf,Property) PropVal(subPropertyOf,?p,?p')  (Type(?p,Property)  Type(?p',Property)  ?r ?v (PropVal(?p,?r,?v)  PropVal(?p',?r,?v))) Chapter 3 A Semantic Web Primer

260 Domain and Range If the domain of P is D, then for every P(x,y), xD
PropVal(domain,?p,?d)  ?x ?y (PropVal(?p,?x,?y)  Type(?x,?d)) If the range of P is R, then for every P(x,y), yR PropVal(range,?p,?r)  ?x ?y (PropVal(?p,?x,?y)  Type(?y,?r)) Chapter 3 A Semantic Web Primer

261 Lecture Outline Basic Ideas of RDF XML-based Syntax of RDF
Basic Concepts of RDF Schema Τhe Language of RDF Schema The Namespaces of RDF and RDF Schema Axiomatic Semantics for RDF and RDFS Direct Semantics based on Inference Rules Querying of RDF/RDFS Documents using SPARQL Chapter 3 A Semantic Web Primer

262 Semantics based on Inference Rules
Semantics in terms of RDF triples instead of restating RDF in terms of first-order logic … and sound and complete inference systems This inference system consists of inference rules of the form: IF E contains certain triples THEN add to E certain additional triples where E is an arbitrary set of RDF triples Chapter 3 A Semantic Web Primer

263 Examples of Inference Rules
IF E contains the triple (?x,?p,?y) THEN E also contains (?p,rdf:type,rdf:property) IF E contains the triples (?u,rdfs:subClassOf,?v) and (?v,rdfs:subclassOf,?w) THEN E also contains the triple (?u,rdfs:subClassOf,?w) IF E contains the triples (?x,rdf:type,?u) and (?u,rdfs:subClassOf,?v) THEN E also contains the triple (?x,rdf:type,?v) Chapter 3 A Semantic Web Primer

264 Examples of Inference Rules (2)
Any resource ?y which appears as the value of a property ?p can be inferred to be a member of the range of ?p This shows that range definitions in RDF Schema are not used to restrict the range of a property, but rather to infer the membership of the range IF E contains the triples (?x,?p,?y) and (?p,rdfs:range,?u) THEN E also contains the triple (?y,rdf:type,?u) Chapter 3 A Semantic Web Primer

265 Lecture Outline Basic Ideas of RDF XML-based Syntax of RDF
Basic Concepts of RDF Schema Τhe Language of RDF Schema The Namespaces of RDF and RDF Schema Axiomatic Semantics for RDF and RDFS Direct Semantics based on Inference Rules Querying of RDF/RDFS Documents using SPARQL Chapter 3 A Semantic Web Primer

266 Why an RDF Query Language? Different XML Representations
XML at a lower level of abstraction than RDF There are various ways of syntactically representing an RDF statement in XML Thus we would require several XPath queries, e.g. //uni:lecturer/uni:title if uni:title element if uni:title attribute Both XML representations equivalent! Chapter 3 A Semantic Web Primer

267 SPARQL Basic Queries SPARQL is based on matching graph patterns
The simplest graph pattern is the triple pattern : like an RDF triple, but with the possibility of a variable instead of an RDF term in the subject, predicate, or object positions Combining triple patterns gives a basic graph pattern, where an exact match to a graph is needed to fulfill a pattern

268 Examples PREFIX rdf: < PREFIX rdfs: < SELECT ?c WHERE { ?c rdf:type rdfs:Class . } Retrieves all triple patterns, where: -the property is rdf:type -the object is rdfs:Class Which means that it retrieves all classes

269 Examples (2) Get all instances of a particular class (e.g. course) :
(declaration of rdf, rdfs prefixes omitted for brevity) PREFIX uni: < SELECT ?i WHERE { ?i rdf:type uni:course . }

270 Using select-from-where
As in SQL, SPARQL queries have a SELECT-FROM-WHERE structure: SELECT specifies the projection: the number and order of retrieved data FROM is used to specify the source being queried (optional) WHERE imposes constraints on possible solutions in the form of graph pattern templates and boolean constraints Retrieve all phone numbers of staff members: SELECT ?x ?y WHERE { ?x uni:phone ?y .} Here ?x and ?y are variables, and ?x uni:phone ?y represents a resource-property-value triple pattern Chapter 3 A Semantic Web Primer

271 Implicit Join Retrieve all lecturers and their phone numbers:
SELECT ?x ?y WHERE { ?x rdf:type uni:Lecturer ; uni:phone ?y . } Implicit join: We restrict the second pattern only to those triples, the resource of which is in the variable ?x Here we use a syntax shorcut as well: a semicolon indicates that the following triple shares its subject with the previous one Chapter 3 A Semantic Web Primer

272 Implicit join (2) The previous query is equivalent to writing:
SELECT ?x ?y WHERE { ?x rdf:type uni:Lecturer . ?x uni:phone ?y . }

273 Explicit Join Retrieve the name of all courses taught by the lecturer with ID SELECT ?n WHERE { ?x rdf:type uni:Course ; uni:isTaughtBy : ?c uni:name ?n . FILTER (?c = ?x) . } Chapter 3 A Semantic Web Primer

274 Optional Patterns <uni:lecturer rdf:about=“949352”>
<uni:name>Grigoris Antoniou</uni:name> </uni:lecturer> <uni:professor rdf:about=“94318”> <uni:name>David Billington</uni:name> </uni:professor> For one lecturer it only lists the name For the other it also lists the address Chapter 3 A Semantic Web Primer

275 Optional Patterns (2) All lecturers and their email addresses:
SELECT ?name ? WHERE { ?x rdf:type uni:Lecturer ; uni:name ?name ; uni: ? . } Chapter 3 A Semantic Web Primer

276 Optional Patterns (3) The result of the previous query would be:
Grigoris Antoniou is listed as a lecturer, but he has no address ?name ? David Billington Chapter 3 A Semantic Web Primer

277 Optional Patterns (4) As a solution we can adapt the query to use an optional pattern: SELECT ?name ? WHERE { ?x rdf:type uni:Lecturer ; uni:name ?name . OPTIONAL { x? uni: ? } } Chapter 3 A Semantic Web Primer

278 Optional Patterns (5) The meaning is roughly “give us the names of lecturers, and if known also their address” The result looks like this: ?name ? Grigoris Antoniou David Billington Chapter 3 A Semantic Web Primer

279 Summary RDF provides a foundation for representing and processing metadata RDF has a graph-based data model RDF has an XML-based syntax to support syntactic interoperability XML and RDF complement each other because RDF supports semantic interoperability RDF has a decentralized philosophy and allows incremental building of knowledge, and its sharing and reuse Chapter 3 A Semantic Web Primer

280 Summary (2) RDF is domain-independent
- RDF Schema provides a mechanism for describing specific domains RDF Schema is a primitive ontology language It offers certain modelling primitives with fixed meaning Key concepts of RDF Schema are class, subclass relations, property, subproperty relations, and domain and range restrictions There exist query languages for RDF and RDFS, including SPARQL Chapter 3 A Semantic Web Primer

281 Points for Discussion in Subsequent Chapters
RDF Schema is quite primitive as a modelling language for the Web Many desirable modelling primitives are missing Therefore we need an ontology layer on top of RDF and RDF Schema Chapter 3 A Semantic Web Primer

282 Chapter 4 Web Ontology Language: OWL
Grigoris Antoniou Frank van Harmelen Chapter 4 A Semantic Web Primer

283 Lecture Outline Basic Ideas of OWL The OWL Language Examples
The OWL Namespace Future Extensions Chapter 4 A Semantic Web Primer

284 Requirements for Ontology Languages
Ontology languages allow users to write explicit, formal conceptualizations of domain models The main requirements are: a well-defined syntax efficient reasoning support a formal semantics sufficient expressive power convenience of expression Chapter 4 A Semantic Web Primer

285 Tradeoff between Expressive Power and Efficient Reasoning Support
The richer the language is, the more inefficient the reasoning support becomes Sometimes it crosses the border of noncomputability We need a compromise: A language supported by reasonably efficient reasoners A language that can express large classes of ontologies and knowledge. Chapter 4 A Semantic Web Primer

286 Reasoning About Knowledge in Ontology Languages
Class membership If x is an instance of a class C, and C is a subclass of D, then we can infer that x is an instance of D Equivalence of classes If class A is equivalent to class B, and class B is equivalent to class C, then A is equivalent to C, too Chapter 4 A Semantic Web Primer

287 Reasoning About Knowledge in Ontology Languages (2)
Consistency X instance of classes A and B, but A and B are disjoint This is an indication of an error in the ontology Classification Certain property-value pairs are a sufficient condition for membership in a class A; if an individual x satisfies such conditions, we can conclude that x must be an instance of A Chapter 4 A Semantic Web Primer

288 Uses for Reasoning Reasoning support is important for
checking the consistency of the ontology and the knowledge checking for unintended relationships between classes automatically classifying instances in classes Checks like the preceding ones are valuable for designing large ontologies, where multiple authors are involved integrating and sharing ontologies from various sources Chapter 4 A Semantic Web Primer

289 Reasoning Support for OWL
Semantics is a prerequisite for reasoning support Formal semantics and reasoning support are usually provided by mapping an ontology language to a known logical formalism using automated reasoners that already exist for those formalisms OWL is (partially) mapped on a description logic, and makes use of reasoners such as FaCT and RACER Description logics are a subset of predicate logic for which efficient reasoning support is possible Chapter 4 A Semantic Web Primer

290 Limitations of the Expressive Power of RDF Schema
Local scope of properties rdfs:range defines the range of a property (e.g. eats) for all classes In RDF Schema we cannot declare range restrictions that apply to some classes only E.g. we cannot say that cows eat only plants, while other animals may eat meat, too Chapter 4 A Semantic Web Primer

291 Limitations of the Expressive Power of RDF Schema (2)
Disjointness of classes Sometimes we wish to say that classes are disjoint (e.g. male and female) Boolean combinations of classes Sometimes we wish to build new classes by combining other classes using union, intersection, and complement E.g. person is the disjoint union of the classes male and female Chapter 4 A Semantic Web Primer

292 Limitations of the Expressive Power of RDF Schema (3)
Cardinality restrictions E.g. a person has exactly two parents, a course is taught by at least one lecturer Special characteristics of properties Transitive property (like “greater than”) Unique property (like “is mother of”) A property is the inverse of another property (like “eats” and “is eaten by”) Chapter 4 A Semantic Web Primer

293 Combining OWL with RDF Schema
Ideally, OWL would extend RDF Schema Consistent with the layered architecture of the Semantic Web But simply extending RDF Schema would work against obtaining expressive power and efficient reasoning Combining RDF Schema with logic leads to uncontrollable computational properties Chapter 4 A Semantic Web Primer

294 Three Species of OWL W3C’sWeb Ontology Working Group defined OWL as three different sublanguages: OWL Full OWL DL OWL Lite Each sublanguage geared toward fulfilling different aspects of requirements Chapter 4 A Semantic Web Primer

295 OWL Full It uses all the OWL languages primitives
It allows the combination of these primitives in arbitrary ways with RDF and RDF Schema OWL Full is fully upward-compatible with RDF, both syntactically and semantically OWL Full is so powerful that it is undecidable No complete (or efficient) reasoning support Chapter 4 A Semantic Web Primer

296 OWL DL OWL DL (Description Logic) is a sublanguage of OWL Full that restricts application of the constructors from OWL and RDF Application of OWL’s constructors’ to each other is disallowed Therefore it corresponds to a well studied description logic OWL DL permits efficient reasoning support But we lose full compatibility with RDF: Not every RDF document is a legal OWL DL document. Every legal OWL DL document is a legal RDF document. Chapter 4 A Semantic Web Primer

297 OWL Lite An even further restriction limits OWL DL to a subset of the language constructors E.g., OWL Lite excludes enumerated classes, disjointness statements, and arbitrary cardinality. The advantage of this is a language that is easier to grasp, for users implement, for tool builders The disadvantage is restricted expressivity Chapter 4 A Semantic Web Primer

298 Upward Compatibility between OWL Species
Every legal OWL Lite ontology is a legal OWL DL ontology Every legal OWL DL ontology is a legal OWL Full ontology Every valid OWL Lite conclusion is a valid OWL DL conclusion Every valid OWL DL conclusion is a valid OWL Full conclusion Chapter 4 A Semantic Web Primer

299 OWL Compatibility with RDF Schema
All varieties of OWL use RDF for their syntax Instances are declared as in RDF, using RDF descriptions and typing information OWL constructors are specialisations of their RDF counterparts Chapter 4 A Semantic Web Primer

300 OWL Compatibility with RDF Schema (2)
Semantic Web design aims at downward compatibility with corresponding reuse of software across the various layers The advantage of full downward compatibility for OWL is only achieved for OWL Full, at the cost of computational intractability Chapter 4 A Semantic Web Primer

301 Lecture Outline Basic Ideas of OWL The OWL Language Examples
The OWL Namespace Future Extensions Chapter 4 A Semantic Web Primer

302 OWL Syntactic Varieties
OWL builds on RDF and uses RDF’s XML-based syntax Other syntactic forms for OWL have also been defined: An alternative, more readable XML-based syntax An abstract syntax, that is much more compact and readable than the XML languages A graphic syntax based on the conventions of UML Chapter 4 A Semantic Web Primer

303 OWL XML/RDF Syntax: Header
<rdf:RDF xmlns:owl =" xmlns:rdf =" syntax-ns#" xmlns:rdfs=" schema#" xmlns:xsd =" XLMSchema#"> An OWL ontology may start with a collection of assertions for housekeeping purposes using owl:Ontology element Chapter 4 A Semantic Web Primer

304 owl:Ontology <owl:Ontology rdf:about="">
<rdfs:comment>An example OWL ontology </rdfs:comment> <owl:priorVersion rdf:resource=" <owl:imports rdf:resource=" <rdfs:label>University Ontology</rdfs:label> </owl:Ontology> owl:imports is a transitive property Chapter 4 A Semantic Web Primer

305 Classes Classes are defined using owl:Class
owl:Class is a subclass of rdfs:Class Disjointness is defined using owl:disjointWith <owl:Class rdf:about="#associateProfessor"> <owl:disjointWith rdf:resource="#professor"/> <owl:disjointWith rdf:resource="#assistantProfessor"/> </owl:Class> Chapter 4 A Semantic Web Primer

306 Classes (2) owl:equivalentClass defines equivalence of classes
<owl:Class rdf:ID="faculty"> <owl:equivalentClass rdf:resource= "#academicStaffMember"/> </owl:Class> owl:Thing is the most general class, which contains everything owl:Nothing is the empty class Chapter 4 A Semantic Web Primer

307 Properties In OWL there are two kinds of properties
Object properties, which relate objects to other objects E.g. is-TaughtBy, supervises Data type properties, which relate objects to datatype values E.g. phone, title, age, etc. Chapter 4 A Semantic Web Primer

308 Datatype Properties OWL makes use of XML Schema data types, using the layered architecture of the SW <owl:DatatypeProperty rdf:ID="age"> <rdfs:range rdf:resource= " #nonNegativeInteger"/> </owl:DatatypeProperty> Chapter 4 A Semantic Web Primer

309 Object Properties User-defined data types
<owl:ObjectProperty rdf:ID="isTaughtBy"> <owl:domain rdf:resource="#course"/> <owl:range rdf:resource= "#academicStaffMember"/> <rdfs:subPropertyOf rdf:resource="#involves"/> </owl:ObjectProperty> Chapter 4 A Semantic Web Primer

310 Inverse Properties <owl:ObjectProperty rdf:ID="teaches">
<rdfs:range rdf:resource="#course"/> <rdfs:domain rdf:resource= "#academicStaffMember"/> <owl:inverseOf rdf:resource="#isTaughtBy"/> </owl:ObjectProperty> Chapter 4 A Semantic Web Primer

311 Equivalent Properties
owl:equivalentProperty <owl:ObjectProperty rdf:ID="lecturesIn"> <owl:equivalentProperty rdf:resource="#teaches"/> </owl:ObjectProperty> Chapter 4 A Semantic Web Primer

312 Property Restrictions
In OWL we can declare that the class C satisfies certain conditions All instances of C satisfy the conditions This is equivalent to saying that C is subclass of a class C', where C' collects all objects that satisfy the conditions C' can remain anonymous Chapter 4 A Semantic Web Primer

313 Property Restrictions (2)
A (restriction) class is achieved through an owl:Restriction element This element contains an owl:onProperty element and one or more restriction declarations One type defines cardinality restrictions (at least one, at most 3,…) Chapter 4 A Semantic Web Primer

314 Property Restrictions (3)
The other type defines restrictions on the kinds of values the property may take owl:allValuesFrom specifies universal quantification owl:hasValue specifies a specific value owl:someValuesFrom specifies existential quantification Chapter 4 A Semantic Web Primer

315 owl:allValuesFrom <owl:Class rdf:about="#firstYearCourse">
<rdfs:subClassOf> <owl:Restriction> <owl:onProperty rdf:resource="#isTaughtBy"/> <owl:allValuesFrom rdf:resource="#Professor"/> </owl:Restriction> </rdfs:subClassOf> </owl:Class> Chapter 4 A Semantic Web Primer

316 owl:hasValue <owl:Class rdf:about="#mathCourse">
<rdfs:subClassOf> <owl:Restriction> <owl:onProperty rdf:resource= "#isTaughtBy"/> <owl:hasValue rdf:resource= "#949352"/> </owl:Restriction> </rdfs:subClassOf> </owl:Class> Chapter 4 A Semantic Web Primer

317 owl:someValuesFrom <owl:Class rdf:about="#academicStaffMember">
<rdfs:subClassOf> <owl:Restriction> <owl:onProperty rdf:resource="#teaches"/> <owl:someValuesFrom rdf:resource= "#undergraduateCourse"/> </owl:Restriction> </rdfs:subClassOf> </owl:Class> Chapter 4 A Semantic Web Primer

318 Cardinality Restrictions
We can specify minimum and maximum number using owl:minCardinality and owl:maxCardinality It is possible to specify a precise number by using the same minimum and maximum number For convenience, OWL offers also owl:cardinality Chapter 4 A Semantic Web Primer

319 Cardinality Restrictions (2)
<owl:Class rdf:about="#course"> <rdfs:subClassOf> <owl:Restriction> <owl:onProperty rdf:resource="#isTaughtBy"/> <owl:minCardinality rdf:datatype= "&xsd;nonNegativeInteger"> 1 </owl:minCardinality> </owl:Restriction> </rdfs:subClassOf> </owl:Class> Chapter 4 A Semantic Web Primer

320 Special Properties owl:TransitiveProperty (transitive property)
E.g. “has better grade than”, “is ancestor of” owl:SymmetricProperty (symmetry) E.g. “has same grade as”, “is sibling of” owl:FunctionalProperty defines a property that has at most one value for each object E.g. “age”, “height”, “directSupervisor” owl:InverseFunctionalProperty defines a property for which two different objects cannot have the same value Chapter 4 A Semantic Web Primer

321 Special Properties (2) <owl:ObjectProperty rdf:ID="hasSameGradeAs"> <rdf:type rdf:resource="&owl;TransitiveProperty"/> <rdf:type rdf:resource="&owl;SymmetricProperty"/> <rdfs:domain rdf:resource="#student"/> <rdfs:range rdf:resource="#student"/> </owl:ObjectProperty> Chapter 4 A Semantic Web Primer

322 Boolean Combinations We can combine classes using Boolean operations (union, intersection, complement) <owl:Class rdf:about="#course"> <rdfs:subClassOf> <owl:Restriction> <owl:complementOf rdf:resource= "#staffMember"/> </owl:Restriction> </rdfs:subClassOf> </owl:Class> Chapter 4 A Semantic Web Primer

323 Boolean Combinations (2)
<owl:Class rdf:ID="peopleAtUni"> <owl:unionOf rdf:parseType="Collection"> <owl:Class rdf:about="#staffMember"/> <owl:Class rdf:about="#student"/> </owl:unionOf> </owl:Class> The new class is not a subclass of the union, but rather equal to the union We have stated an equivalence of classes Chapter 4 A Semantic Web Primer

324 Boolean Combinations (3)
<owl:Class rdf:ID="facultyInCS"> <owl:intersectionOf rdf:parseType="Collection"> <owl:Class rdf:about="#faculty"/> <owl:Restriction> <owl:onProperty rdf:resource="#belongsTo"/> <owl:hasValue rdf:resource= "#CSDepartment"/> </owl:Restriction> </owl:intersectionOf> </owl:Class> Chapter 4 A Semantic Web Primer

325 Nesting of Boolean Operators
<owl:Class rdf:ID="adminStaff"> <owl:intersectionOf rdf:parseType="Collection"> <owl:Class rdf:about="#staffMember"/> <owl: Class> <owl:complementOf> <owl:unionOf rdf:parseType="Collection"> <owl:Class rdf:about="#faculty"/> <owl:Class rdf:about=#techSupportStaff"/> </owl:unionOf> </owl: Class> </owl:complementOf> </owl:intersectionOf> </owl:Class> Chapter 4 A Semantic Web Primer

326 Enumerations with owl:oneOf
<owl:Class rdf:ID="weekdays"> <owl:oneOf rdf:parseType="Collection"> <owl:Thing rdf:about="#Monday"/> <owl:Thing rdf:about="#Tuesday"/> <owl:Thing rdf:about="#Wednesday"/> <owl:Thing rdf:about="#Thursday"/> <owl:Thing rdf:about="#Friday"/> <owl:Thing rdf:about="#Saturday"/> <owl:Thing rdf:about="#Sunday"/> </owl:oneOf> </owl:Class> Chapter 4 A Semantic Web Primer

327 Declaring Instances Instances of classes are declared as in RDF:
<rdf:Description rdf:ID="949352"> <rdf:type rdf:resource= "#academicStaffMember"/> </rdf:Description> <academicStaffMember rdf:ID="949352"> <uni:age rdf:datatype="&xsd;integer"> 39<uni:age> </academicStaffMember> Chapter 4 A Semantic Web Primer

328 No Unique-Names Assumption
OWL does not adopt the unique-names assumption of database systems If two instances have a different name or ID does not imply that they are different individuals Suppose we state that each course is taught by at most one staff member, and that a given course is taught by two staff members An OWL reasoner does not flag an error Instead it infers that the two resources are equal Chapter 4 A Semantic Web Primer

329 Distinct Objects To ensure that different individuals are indeed recognized as such, we must explicitly assert their inequality: <lecturer rdf:about="949318"> <owl:differentFrom rdf:resource="949352"/> </lecturer> Chapter 4 A Semantic Web Primer

330 Distinct Objects (2) OWL provides a shorthand notation to assert the pairwise inequality of all individuals in a given list <owl:allDifferent> <owl:distinctMembers rdf:parseType="Collection"> <lecturer rdf:about="949318"/> <lecturer rdf:about="949352"/> <lecturer rdf:about="949111"/> </owl:distinctMembers> </owl:allDifferent> Chapter 4 A Semantic Web Primer

331 Data Types in OWL XML Schema provides a mechanism to construct user-defined data types E.g., the data type of adultAge includes all integers greater than 18 Such derived data types cannot be used in OWL The OWL reference document lists all the XML Schema data types that can be used These include the most frequently used types such as string, integer, Boolean, time, and date. Chapter 4 A Semantic Web Primer

332 Versioning Information
owl:priorVersion indicates earlier versions of the current ontology No formal meaning, can be exploited for ontology management owl:versionInfo generally contains a string giving information about the current version, e.g. keywords Chapter 4 A Semantic Web Primer

333 Versioning Information (2)
owl:backwardCompatibleWith contains a reference to another ontology All identifiers from the previous version have the same intended interpretations in the new version Thus documents can be safely changed to commit to the new version owl:incompatibleWith indicates that the containing ontology is a later version of the referenced ontology but is not backward compatible with it Chapter 4 A Semantic Web Primer

334 Combination of Features
In different OWL languages there are different sets of restrictions regarding the application of features In OWL Full, all the language constructors may be used in any combination as long as the result is legal RDF Chapter 4 A Semantic Web Primer

335 Restriction of Features in OWL DL
Vocabulary partitioning Any resource is allowed to be only a class, a data type, a data type property, an object property, an individual, a data value, or part of the built-in vocabulary, and not more than one of these Explicit typing The partitioning of all resources must be stated explicitly (e.g. a class must be declared if used in conjunction with rdfs:subClassOf) Chapter 4 A Semantic Web Primer

336 Restriction of Features in OWL DL (2)
Property Separation The set of object properties and data type properties are disjoint Therefore the following can never be specified for data type properties: owl:inverseOf owl:FunctionalProperty owl:InverseFunctionalProperty owl:SymmetricProperty Chapter 4 A Semantic Web Primer

337 Restriction of Features in OWL DL (3)
No transitive cardinality restrictions No cardinality restrictions may be placed on transitive properties Restricted anonymous classes: Anonymous classes are only allowed to occur as: the domain and range of either owl:equivalentClass or owl:disjointWith the range (but not the domain) of rdfs:subClassOf Chapter 4 A Semantic Web Primer

338 Restriction of Features in OWL Lite
Restrictions of OWL DL and more owl:oneOf, owl:disjointWith, owl:unionOf, owl:complementOf and owl:hasValue are not allowed Cardinality statements (minimal, maximal, and exact cardinality) can only be made on the values 0 or 1 owl:equivalentClass statements can no longer be made between anonymous classes but only between class identifiers Chapter 4 A Semantic Web Primer

339 Inheritance in Class Hierarchies
Range restriction: Courses must be taught by academic staff members only Michael Maher is a professor He inherits the ability to teach from the class of academic staff members This is done in RDF Schema by fixing the semantics of “is a subclass of” It is not up to an application (RDF processing software) to interpret “is a subclass of Chapter 4 A Semantic Web Primer

340 OWL DLP OWL is based on Description Logic
Description Logic is a fragment of first-order logic OWL inherits from Description Logic The open-world assumption The non-unique-name assumption Chapter 4 A Semantic Web Primer

341 Open-world assumption
We cannot conclude some statement x to be false simply because we cannot show x to be true Our axioms may be simply noncommittal on the status of x We may not deduce falsity from the absence of truth Chapter 4 A Semantic Web Primer

342 Open-world assumption example
Question: "Did it rain in Tokyo yesterday?" Answer: "I don’t know that it rained , but that’s not enough reason to conclude that it didn’t rain" Chapter 4 A Semantic Web Primer

343 Closed-world assumption (CWA)
Closed-world assumption allow deriving falsity from the inability to derive truth Example: Question: " Was there a big earthquake disaster in Tokyo yesterday? " Answer: " I don’t know that there was, but if there had been such a disaster, I’d have heard about it. Therefore I conclude that there wasn’t such a disaster" Chapter 4 A Semantic Web Primer

344 Unique-name assumption (UNA)
When two individuals are known by different names, they are in fact different individuals This is an assumption that sometimes works (ex. Product codes) and sometimes doesn’t (ex. Social environment) OWL does not make the unique-name assumption Chapter 4 A Semantic Web Primer

345 OWL DLP use Systems such as databases and logic-programming systems have tended to support closed worlds and unique names Knowledge representation systems and theorem plovers support open worlds and non-unique names Chapter 4 A Semantic Web Primer

346 OWL DLP use (2) Ontologies are sometimes in need of one sometimes in need of the other use Discussions can be found in the literature and on the WWW about whither OWL should be more like a knowledge representation system or more like a database system This debate was nicely resolved by Volz and Horrocks, who identified a fragment of OWL called DLP This fragment in the largest fragment on which the choice for CWA and UNA does not matter, see following figure Chapter 4 A Semantic Web Primer

347 Relation of OWL DLP to other languages
Chapter 4 A Semantic Web Primer

348 OWL DLP use (3) OWL DLP is weak enough so that the differences between the choices don’t show up The advantage of this is that people or applications that wish to make different choices on these assumptions can still exchange ontologies in OWL DLP without harm As soon as they go outside OWL DLP, they will notice that they draw different conclusions from the same statements Chapter 4 A Semantic Web Primer

349 OWL DLP DLP is still large enough to enable useful representation and reasoning tasks It allows the use of such OWL constructors as: Class and property equivalence Equality and inequality between individuals Inverse, transitive, symmetric and functional properties The intersection of classes It excludes constructors such as : Intersection and arbitrary cardinality constraints Chapter 4 A Semantic Web Primer

350 OWL DLP These constructors not only allow useful expressivity for many practical cases, while guaranteeing correct interchange between OWL reasoners independent of CWA and UNA, but also allow for translation into efficiently implementable reasoning techniques based on databases and logic programs Chapter 4 A Semantic Web Primer

351 Lecture Outline Basic Ideas of OWL The OWL Language Examples
The OWL Namespace Future Extensions Chapter 4 A Semantic Web Primer

352 An African Wildlife Ontology – Class Hierarchy
Chapter 4 A Semantic Web Primer

353 An African Wildlife Ontology – Schematic Representation
Βranches are parts of trees Chapter 4 A Semantic Web Primer

354 An African Wildlife Ontology – Properties
<owl:TransitiveProperty rdf:ID="is-part-of"/> <owl:ObjectProperty rdf:ID="eats"> <rdfs:domain rdf:resource="#animal"/> </owl:ObjectProperty> <owl:ObjectProperty rdf:ID="eaten-by"> <owl:inverseOf rdf:resource="#eats"/> Chapter 4 A Semantic Web Primer

355 An African Wildlife Ontology – Plants and Trees
<owl:Class rdf:ID="plant"> <rdfs:comment>Plants form a class disjoint from animals. </rdfs:comment> <owl:disjointWith rdf:resource="#animal"/> </owl:Class> <owl:Class rdf:ID="tree"> <rdfs:comment>Trees are a type of plant. </rdfs:comment> <rdfs:subClassOf rdf:resource="#plant"/> Chapter 4 A Semantic Web Primer

356 An African Wildlife Ontology – Branches
<owl:Class rdf:ID="branch"> <rdfs:comment>Branches are parts of trees. </rdfs:comment> <rdfs:subClassOf> <owl:Restriction> <owl:onProperty rdf:resource="#is-part-of"/> <owl:allValuesFrom rdf:resource="#tree"/> </owl:Restriction> </rdfs:subClassOf> </owl:Class> Chapter 4 A Semantic Web Primer

357 An African Wildlife Ontology – Leaves
<owl:Class rdf:ID="leaf"> <rdfs:comment>Leaves are parts of branches. </rdfs:comment> <rdfs:subClassOf> <owl:Restriction> <owl:onProperty rdf:resource="#is-part-of"/> <owl:allValuesFrom rdf:resource="#branch"/> </owl:Restriction> </rdfs:subClassOf> </owl:Class> Chapter 4 A Semantic Web Primer

358 An African Wildlife Ontology – Carnivores
<owl:Class rdf:ID="carnivore"> <rdfs:comment>Carnivores are exactly those animals that eat animals.</rdfs:comment> <owl:intersectionOf rdf:parsetype="Collection"> <owl:Class rdf:about="#animal"/> <owl:Restriction> <owl:onProperty rdf:resource="#eats"/> <owl:someValuesFrom rdf:resource="#animal"/> </owl:Restriction> </owl:intersectionOf> </owl:Class> Chapter 4 A Semantic Web Primer

359 An African Wildlife Ontology – Herbivores
<owl:Class rdf:ID="herbivore"> <rdfs:comment> Herbivores are exactly those animals that eat only plants or parts of plants. </rdfs:comment> Try it out! See book for code. </owl:Class> Chapter 4 A Semantic Web Primer

360 An African Wildlife Ontology – Giraffes
<owl:Class rdf:ID="giraffe"> <rdfs:comment>Giraffes are herbivores, and they eat only leaves.</rdfs:comment> <rdfs:subClassOf rdf:type="#herbivore"/> <rdfs:subClassOf> <owl:Restriction> <owl:onProperty rdf:resource="#eats"/> <owl:allValuesFrom rdf:resource="#leaf"/> </owl:Restriction> </rdfs:subClassOf> </owl:Class> Chapter 4 A Semantic Web Primer

361 An African Wildlife Ontology – Lions
<owl:Class rdf:ID="lion"> <rdfs:comment>Lions are animals that eat only herbivores.</rdfs:comment> <rdfs:subClassOf rdf:type="#carnivore"/> <rdfs:subClassOf> <owl:Restriction> <owl:onProperty rdf:resource="#eats"/> <owl:allValuesFrom rdf:resource="#herbivore"/> </owl:Restriction> </rdfs:subClassOf> </owl:Class> Chapter 4 A Semantic Web Primer

362 An African Wildlife Ontology – Tasty Plants
owl:Class rdf:ID="tasty-plant"> <rdfs:comment>Tasty plants are plants that are eaten both by herbivores and carnivores </rdfs:comment> <rdfs:comment> Try it out! See book for code. </owl:Class> Chapter 4 A Semantic Web Primer

363 A Printer Ontology – Class Hierarchy
Chapter 4 A Semantic Web Primer

364 A Printer Ontology – Products and Devices
<owl:Class rdf:ID="product"> <rdfs:comment>Products form a class. </rdfs:comment> </owl:Class> <owl:Class rdf:ID="padid"> <rdfs:comment>Printing and digital imaging devices form a subclass of products.</rdfs:comment> <rdfs:label>Device</rdfs:label> <rdfs:subClassOf rdf:resource="#product"/> Chapter 4 A Semantic Web Primer

365 A Printer Ontology – HP Products
<owl:Class rdf:ID="hpProduct"> <owl:intersectionOf rdf:parseType=“Collection"> <owl:Class rdf:about="#product"/> <owl:Restriction> <owl:onProperty rdf:resource="#manufactured_by"/> <owl:hasValue rdf:datatype=“&xsd;string"> Hewlett Packard </owl:hasValue> </owl:Restriction> </owl:intersectionOf> </owl:Class> Chapter 4 A Semantic Web Primer

366 A Printer Ontology – Printers and Personal Printers
<owl:Class rdf:ID="printer"> <rdfs:comment>Printers are printing and digital imaging devices.</rdfs:comment> <rdfs:subClassOf rdf:resource="#padid"/> </owl:Class> <owl:Class rdf:ID="personalPrinter"> <rdfs:comment>Printers for personal use form a subclass of printers.</rdfs:comment> <rdfs:subClassOf rdf:resource="#printer"/> Chapter 4 A Semantic Web Primer

367 A Printer Ontology – HP LaserJet 1100se Printers
<owl:Class rdf:ID="1100se"> <rdfs:comment>1100se printers belong to the 1100 series and cost $450.</rdfs:comment> <rdfs:subClassOf rdf:resource="#1100series"/> <rdfs:subClassOf> <owl:Restriction> <owl:onProperty rdf:resource="#price"/> <owl:hasValue rdf:datatype="&xsd;integer"> 450 </owl:hasValue> </owl:Restriction> </rdfs:subClassOf> </owl:Class> Chapter 4 A Semantic Web Primer

368 A Printer Ontology – Properties
<owl:DatatypeProperty rdf:ID="manufactured_by"> <rdfs:domain rdf:resource="#product"/> <rdfs:range rdf:resource="&xsd;string"/> </owl:DatatypeProperty> <owl:DatatypeProperty rdf:ID="printingTechnology"> <rdfs:domain rdf:resource="#printer"/> Chapter 4 A Semantic Web Primer

369 Lecture Outline Basic Ideas of OWL The OWL Language Examples
The OWL Namespace Future Extensions Chapter 4 A Semantic Web Primer

370 OWL in OWL We present a part of the definition of OWL in terms of itself The following captures some of OWL’s meaning in OWL It does not capture the entire semantics A separate semantic specification is necessary The URI of the OWL definition is defined as the default namespace Chapter 4 A Semantic Web Primer

371 Classes of Classes (Metaclasses)
The class of all OWL classes is itself a subclass of the class of all RDF Schema classes: <rdfs:Class rdf:ID="Class"> <rdfs:label>Class</rdfs:label> <rdfs:subClassOf rdf:resource="&rdfs;Class"/> </rdfs:Class> Chapter 4 A Semantic Web Primer

372 Classes of Classes (Metaclasses) – Thing and Nothing
Thing is most general object class in OWL Nothing is most specific class: the empty object class The following relationships hold: Chapter 4 A Semantic Web Primer

373 Classes of Classes (Metaclasses) – Thing and Nothing (2)
<Class rdf:ID="Thing"> <rdfs:label>Thing</rdfs:label> <unionOf rdf:parseType="Collection"> <Class rdf:about="#Nothing"/> <Class> <complementOf rdf:resource="#Nothing"/> </Class> </unionOf> <Class rdf:ID="Nothing"> <rdfs:label>Nothing</rdfs:label> <complementOf rdf:resource="#Thing"/> Chapter 4 A Semantic Web Primer

374 Class and Property Equivalences
<rdf:Property rdf:ID="EquivalentClass"> <rdfs:label>EquivalentClass</rdfs:label> <rdfs:subPropertyOf rdf:resource="&rdfs;subClassOf"/> <rdfs:domain rdf:resource="#Class"/> <rdfs:range rdf:resource="#Class"/> </rdf:Property> <rdf:Property rdf:ID="EquivalentProperty"> <rdfs:label>EquivalentProperty</rdfs:label> <rdfs:subPropertyOf rdf:resource="&rdfs;subPropertyOf"/> Chapter 4 A Semantic Web Primer

375 Class Disjointness <rdf:Property rdf:ID="disjointWith">
<rdfs:label>disjointWith</rdfs:label> <rdfs:domain rdf:resource="#Class"/> <rdfs:range rdf:resource="#Class"/> </rdf:Property> Chapter 4 A Semantic Web Primer

376 Equality and Inequality
Equality and inequality can be stated between arbitrary things In OWL Full this statement can also be applied to classes Properties sameIndividualAs, sameAs and differentFrom Chapter 4 A Semantic Web Primer

377 Equality and Inequality (2)
<rdf:Property rdf:ID="sameIndividualAs"> <rdfs:domain rdf:resource="#Thing"/> <rdfs:range rdf:resource="#Thing"/> </rdf:Property> <rdf:Property rdf:ID="sameAs"> <EquivalentProperty rdf:resource= "#sameIndividualAs"/> Chapter 4 A Semantic Web Primer

378 Union and Intersection of Classes
Build a class from a list, assumed to be a list of other class expressions <rdf:Property rdf:ID="unionOf"> <rdfs:domain rdf:resource="#Class"/> <rdfs:range rdf:resource="&rdf;List"/> </rdf:Property> Chapter 4 A Semantic Web Primer

379 Restriction Classes Restrictions in OWL define the class of those objects that satisfy some attached conditions <rdfs:Class rdf:ID="Restriction"> <rdfs:label>Restriction</rdfs:label> <rdfs:subClassOf rdf:resource="#Class"/> </rdfs:Class> Chapter 4 A Semantic Web Primer

380 Restriction Properties
All the following properties (onProperty, allValuesFrom, minCardinality, etc.) are only allowed to occur within a restriction definition Their domain is owl:Restriction, but they differ with respect to their range Chapter 4 A Semantic Web Primer

381 Restriction Properties (2)
<rdf:Property rdf:ID="onProperty"> <rdfs:label>onProperty</rdfs:label> <rdfs:domain rdf:resource="#Restriction"/> <rdfs:range rdf:resource="&rdf;Property"/> </rdf:Property> <rdf:Property rdf:ID="allValuesFrom"> <rdfs:label>allValuesFrom</rdfs:label> <rdfs:range rdf:resource="&rdfs;Class"/> Chapter 4 A Semantic Web Primer

382 Restriction Properties (3)
<rdf:Property rdf:ID="hasValue"> <rdfs:label>hasValue</rdfs:label> <rdfs:domain rdf:resource="#Restriction"/> </rdf:Property> <rdf:Property rdf:ID="minCardinality"> <rdfs:label>minCardinality</rdfs:label> <rdfs:range rdf:resource= "&xsd;nonNegativeInteger"/> Chapter 4 A Semantic Web Primer

383 Properties owl:ObjectProperty and owl:DatatypeProperty are special cases of rdf:Property <rdfs:Class rdf:ID="ObjectProperty"> <rdfs:label>ObjectProperty</rdfs:label> <rdfs:subClassOf rdf:resource="&rdf;Property"/> </rdfs:Class> Chapter 4 A Semantic Web Primer

384 Properties (2) Symmetric, functional and inverse functional properties can only be applied to object properties <rdfs:Class rdf:ID="TransitiveProperty"> <rdfs:label>TransitiveProperty</rdfs:label> <rdfs:subClassOf rdf:resource= "#ObjectProperty"/> </rdfs:Class> Chapter 4 A Semantic Web Primer

385 Properties (3) owl:inverseOf relates two object properties:
<rdf:Property rdf:ID="inverseOf"> <rdfs:label>inverseOf</rdfs:label> <rdfs:domain rdf:resource="#ObjectProperty"/> <rdfs:range rdf:resource="#ObjectProperty"/> </rdf:Property> Chapter 4 A Semantic Web Primer

386 Lecture Outline Basic Ideas of OWL The OWL Language Examples
The OWL Namespace Future Extensions Chapter 4 A Semantic Web Primer

387 Future Extensions of OWL
Modules and Imports Defaults Closed World Assumption Unique Names Assumption Procedural Attachments Rules for Property Chaining Chapter 4 A Semantic Web Primer

388 Modules and Imports The importing facility of OWL is very trivial:
It only allows importing of an entire ontology, not parts of it Modules in programming languages based on information hiding: state functionality, hide implementation details Open question how to define appropriate module mechanism for Web ontology languages Chapter 4 A Semantic Web Primer

389 Defaults Many practical knowledge representation systems allow inherited values to be overridden by more specific classes in the hierarchy treat inherited values as defaults No consensus has been reached on the right formalization for the nonmonotonic behaviour of default values Chapter 4 A Semantic Web Primer

390 Closed World Assumption
OWL currently adopts the open-world assumption: A statement cannot be assumed true on the basis of a failure to prove it On the huge and only partially knowable WWW, this is a correct assumption Closed-world assumption: a statement is true when its negation cannot be proved tied to the notion of defaults, leads to nonmonotonic behaviour Chapter 4 A Semantic Web Primer

391 Unique Names Assumption
Typical database applications assume that individuals with different names are indeed different individuals OWL follows the usual logical paradigm where this is not the case Plausible on the WWW One may want to indicate portions of the ontology for which the assumption does or does not hold Chapter 4 A Semantic Web Primer

392 Procedural Attachments
A common concept in knowledge representation is to define the meaning of a term by attaching a piece of code to be executed for computing the meaning of the term Not through explicit definitions in the language Although widely used, this concept does not lend itself very well to integration in a system with a formal semantics, and it has not been included in OWL Chapter 4 A Semantic Web Primer

393 Rules for Property Chaining
OWL does not allow the composition of properties for reasons of decidability In many applications this is a useful operation One may want to define properties as general rules (Horn or otherwise) over other properties Integration of rule-based knowledge representation and DL-style knowledge representation is currently an active area of research Chapter 4 A Semantic Web Primer

394 Summary OWL is the proposed standard for Web ontologies
OWL builds upon RDF and RDF Schema: (XML-based) RDF syntax is used Instances are defined using RDF descriptions Most RDFS modeling primitives are used Chapter 4 A Semantic Web Primer

395 Summary (2) Formal semantics and reasoning support is provided through the mapping of OWL on logics Predicate logic and description logics have been used for this purpose While OWL is sufficiently rich to be used in practice, extensions are in the making They will provide further logical features, including rules Chapter 4 A Semantic Web Primer

396 Chapter 5 Logic and Inference: Rules
Grigoris Antoniou Frank van Harmelen Chapter 5 A Semantic Web Primer

397 Lecture Outline Introduction Monotonic Rules: Example
Monotonic Rules: Syntax & Semantics Description Logic Programs (DLP) Semantic Web Rules Language (SWRL) Nonmonotonic Rules: Syntax Nonmonotonic Rules: Example Rule Markup Language (RuleML) Chapter 5 A Semantic Web Primer

398 Knowledge Representation
The subjects presented so far were related to the representation of knowledge Knowledge Representation was studied long before the emergence of WWW in AI Logic is still the foundation of KR, particularly in the form of predicate logic (first-order logic) Chapter 5 A Semantic Web Primer

399 The Importance of Logic
High-level language for expressing knowledge High expressive power Well-understood formal semantics Precise notion of logical consequence Proof systems that can automatically derive statements syntactically from a set of premises Chapter 5 A Semantic Web Primer

400 The Importance of Logic (2)
There exist proof systems for which semantic logical consequence coincides with syntactic derivation within the proof system Soundness & completeness Predicate logic is unique in the sense that sound and complete proof systems do exist. Not for more expressive logics (higher-order logics) trace the proof that leads to a logical consequence. Logic can provide explanations for answers By tracing a proof Chapter 5 A Semantic Web Primer

401 Specializations of Predicate Logic: RDF and OWL
RDF/S and OWL (Lite and DL) are specializations of predicate logic correspond roughly to a description logic They define reasonable subsets of logic Trade-off between the expressive power and the computational complexity: The more expressive the language, the less efficient the corresponding proof systems Chapter 5 A Semantic Web Primer

402 Specializations of Predicate Logic: Horn Logic
A rule has the form: A1, . . ., An  B Ai and B are atomic formulas There are 2 ways of reading such a rule: Deductive rules: If A1,..., An are known to be true, then B is also true Reactive rules: If the conditions A1,..., An are true, then carry out the action B Chapter 5 A Semantic Web Primer

403 Description Logics vs. Horn Logic
Neither of them is a subset of the other It is impossible to assert that a person X who is brother of Y is uncle of Z (where Z is child of Y) in OWL This can be done easily using rules: brother(X,Y), childOf(Z,Y)  uncle(X,Z) Rules cannot assert the information that a person is either a man or a woman This information is easily expressed in OWL using disjoint union Chapter 5 A Semantic Web Primer

404 Monotonic vs. Non-monotonic Rules
Example: An online vendor wants to give a special discount if it is a customer’s birthday Solution 1 R1: If birthday, then special discount R2: If not birthday, then not special discount But what happens if a customer refuses to provide his birthday due to privacy concerns? Chapter 5 A Semantic Web Primer

405 Monotonic vs. Non-monotonic Rules (2)
Solution 2 R1: If birthday, then special discount R2’: If birthday is not known, then not special discount Solves the problem but: The premise of rule R2' is not within the expressive power of predicate logic We need a new kind of rule system Chapter 5 A Semantic Web Primer

406 Monotonic vs. Non-monotonic Rules (3)
The solution with rules R1 and R2 works in case we have complete information about the situation The new kind of rule system will find application in cases where the available information is incomplete R2’ is a nonmonotonic rule Chapter 5 A Semantic Web Primer

407 Exchange of Rules Exchange of rules across different applications
E.g., an online store advertises its pricing, refund, and privacy policies, expressed using rules The Semantic Web approach is to express the knowledge in a machine-accessible way using one of the Web languages we have already discussed We show how rules can be expressed in XML-like languages (“rule markup languages”) Chapter 5 A Semantic Web Primer

408 Lecture Outline Introduction Monotonic Rules: Example
Monotonic Rules: Syntax & Semantics Description Logic Programs (DLP) Semantic Web Rules Language (SWRL) Nonmonotonic Rules: Syntax Nonmonotonic Rules: Example Rule Markup Language (RuleML) Chapter 5 A Semantic Web Primer

409 Family Relations Facts in a database about relations:
mother(X,Y), X is the mother of Y father(X,Y), X is the father of Y male(X), X is male female(X), X is female Inferred relation parent: A parent is either a father or a mother mother(X,Y)  parent(X,Y) father(X,Y)  parent(X,Y) Chapter 5 A Semantic Web Primer

410 Inferred Relations male(X), parent(P,X), parent(P,Y), notSame(X,Y)  brother(X,Y) female(X), parent(P,X), parent(P,Y), notSame(X,Y)  sister(X,Y) brother(X,P), parent(P,Y)  uncle(X,Y) mother(X,P), parent(P,Y)  grandmother(X,Y) parent(X,Y)  ancestor(X,Y) ancestor(X,P), parent(P,Y)  ancestor(X,Y) Chapter 5 A Semantic Web Primer

411 Lecture Outline Introduction Monotonic Rules: Example
Monotonic Rules: Syntax & Semantics Description Logic Programs (DLP) Semantic Web Rules Language (SWRL) Nonmonotonic Rules: Syntax Nonmonotonic Rules: Example Rule Markup Language (RuleML) Chapter 5 A Semantic Web Primer

412 Monotonic Rules – Syntax
loyalCustomer(X), age(X) > 60  discount(X) We distinguish some ingredients of rules: variables which are placeholders for values: X constants denote fixed values: 60 Predicates relate objects: loyalCustomer, > Function symbols which return a value for certain arguments: age Chapter 5 A Semantic Web Primer

413 Rules B1, . . . , Bn  A A, B1, ... , Bn are atomic formulas
A is the head of the rule B1, ... , Bn are the premises (body of the rule) The commas in the rule body are read conjunctively Variables may occur in A, B1, ... , Bn loyalCustomer(X), age(X) > 60  discount(X) Implicitly universally quantified Chapter 5 A Semantic Web Primer

414 Facts and Logic Programs
A fact is an atomic formula E.g. loyalCustomer(a345678) The variables of a fact are implicitly universally quantified. A logic program P is a finite set of facts and rules. Its predicate logic translation pl(P) is the set of all predicate logic interpretations of rules and facts in P Chapter 5 A Semantic Web Primer

415 Goals A goal denotes a query G asked to a logic program
The form: B1, , Bn  If n = 0 we have the empty goal  Chapter 5 A Semantic Web Primer

416 First-Order Interpretation of Goals
X Xk (¬B1   ¬Bn) Where X1, ... , Xk are all variables occurring in B1, ..., Bn Same as pl(r), with the rule head omitted Equivalently: ¬X Xk (B1   Bn) Suppose we know p(a) and we have the goal p(X)  We want to know if there is a value for which p is true We expect a positive answer because of the fact p(a) Thus p(X) is existentially quantified Chapter 5 A Semantic Web Primer

417 Why Negate the Formula? We use a proof technique from mathematics called proof by contradiction: Prove that A follows from B by assuming that A is false and deriving a contradiction, when combined with B In logic programming we prove that a goal can be answered positively by negating the goal and proving that we get a contradiction using the logic program E.g., given the following logic program we get a logical contradiction Chapter 5 A Semantic Web Primer

418 An Example p(a) ¬X p(X)
The 2nd formula says that no element has the property p The 1st formula says that the value of a does have the property p Thus X p(X) follows from p(a) Chapter 5 A Semantic Web Primer

419 Monotonic Rules – Predicate Logic Semantics
Given a logic program P and a query B1, , Bn  with the variables X1, ... , Xk we answer positively if, and only if, pl(P) |= X Xk(B1  ...  Bn) (1) or equivalently, if pl(P)  {¬X Xk (B1  ...  Bn)} is unsatisfiable (2) Chapter 5 A Semantic Web Primer

420 The Semantics of Predicate Logic
The components of the logical language (signature) may have any meaning we like A predicate logic model A assigns a certain meaning A predicate logic model consists of: a domain dom(A), a nonempty set of objects about which the formulas make statements an element from the domain for each constant a concrete function on dom(A) for every function symbol a concrete relation on dom(A) for every predicate Chapter 5 A Semantic Web Primer

421 The Semantics of Predicate Logic (2)
The meanings of the logical connectives ¬,,,,, are defined according to their intuitive meaning: not, or, and, implies, for all, there is We define when a formula is true in a model A, denoted as A |= φ A formula φ follows from a set M of formulas if φ is true in all models A in which M is true Chapter 5 A Semantic Web Primer

422 Motivation of First-Order Interpretation of Goals
p(a) p(X)  q(X) q(X)  q(a) follows from pl(P) X q(X) follows from pl(P), Thus, pl(P){¬ Xq(X)} is unsatisfiable, and we give a positive answer Chapter 5 A Semantic Web Primer

423 Motivation of First-Order Interpretation of Goals (2)
p(a) p(X)  q(X) q(b)  We must give a negative answer because q(b) does not follow from pl(P) Chapter 5 A Semantic Web Primer

424 Ground Witnesses So far we have focused on yes/no answers to queries
Suppose that we have the fact p(a) and the query p(X)  The answer yes is correct but not satisfactory The appropriate answer is a substitution {X/a} which gives an instantiation for X The constant a is called a ground witness Chapter 5 A Semantic Web Primer

425 Parameterized Witnesses
add(X,0,X) add(X,Y,Z)  add(X,s(Y ),s(Z)) add(X, s8(0),Z)  Possible ground witnesses: {X/0,Z/s8(0)}, {X/s(0),Z/s9(0)} . . . The parameterized witness Z = s8(X) is the most general answer to the query: X Z add(X,s8(0),Z) The computation of most general witnesses is the primary aim of SLD resolution Chapter 5 A Semantic Web Primer

426 Lecture Outline Introduction Monotonic Rules: Example
Monotonic Rules: Syntax & Semantics Description Logic Programs (DLP) Semantic Web Rules Language (SWRL) Nonmonotonic Rules: Syntax Nonmonotonic Rules: Example Rule Markup Language (RuleML) Chapter 5 A Semantic Web Primer

427 Description Logic Programs
Description Logic Programs (DLP) can be considered as the intersection of Horn logic and description logic DLP allows to combine advantages of both approaches. For example: A modeler may take a DL view, but the implementation may be based on rule technology Chapter 5 A Semantic Web Primer

428 RDF and RDF Schema A triple of the form (a,P,b) in RDF can be expressed as a fact P(a,b) An instance declaration of the form type(a,C) (stating a is instance of class C) can be expressed as C(a) The fact that C is a subclass (or subproperty) of D can ve expressed as C(X)  D(X) Chapter 5 A Semantic Web Primer

429 OWL sameClassAs(C,D) (or samePropertyAs) can be expressed by the pair of rules C(X)  D(X) D(X)  C(X) Transitivity of a property P can be expressed as P(X,Y),P(Y,Z)  P(X,Z) Chapter 5 A Semantic Web Primer

430 OWL (2) The intersection of C1 and C2 is a subclass of D can be expressed as C1 ,C2  D(X) C is subclass of the intersection of D1 and D2 can be expressed as C(X)  D1(X) C(X)  D2(X) Chapter 5 A Semantic Web Primer

431 OWL (3) The union of C1 and C2 is a subclass of D can be expressed by the pair of rules C1(X)  D (X) C2(X)  D (X) The opposite direction cannot be expressed in Horn logic Chapter 5 A Semantic Web Primer

432 Restrictions in OWL C subClassOf allValuesFrom(P,D) can be expressed as C(X),P(X,Y)  D(Y) Where P is a property, D is a class and allValuesFrom(P,D) denote the anonymous class of all x such that y must be an instance of D whether P(x,y) The opposite direction cannot in general be expressed Chapter 5 A Semantic Web Primer

433 Restrictions in OWL (2) someValuesFrom(P,D) subClassOf C can be expressed as P(X,Y), D(Y)  C(X) Where P is a property, D is a class and someValuesFrom(P,D) denote the anonymous class of all x for which there exists at least one y instance of D, such that P(x,y) The opposite direction cannot in general be expressed Chapter 5 A Semantic Web Primer

434 Restrictions in OWL (3) Cardinality constraints and complement of classes cannot be expressed in Horn logic in the general case Chapter 5 A Semantic Web Primer

435 Lecture Outline Introduction Monotonic Rules: Example
Monotonic Rules: Syntax & Semantics Description Logic Programs (DLP) Semantic Web Rules Language (SWRL) Nonmonotonic Rules: Syntax Nonmonotonic Rules: Example Rule Markup Language (RuleML) Chapter 5 A Semantic Web Primer

436 Semantic Web Rules Language
A rule in SWRL has the form B1, … , Bn  A1, … , Am Commas denote conjunction on both sides A1, … , Am, B1, … , Bn can be of the form C(x), P(x,y), sameAs(x,y), or differentFrom(x,y) where C is an OWL description, P is an OWL property, and x, y are Datalog variables, OWL individuals, or OWL data values Chapter 5 A Semantic Web Primer

437 SWRL Properties If the head of a rule has more than one atom, the rule can be transformed to an equivalent set of rules with one atom in the head Expressions, such as restrictions, can appear in the head or body of a rule This feature adds significant expressive power to OWL, but at the high price of undecidability Chapter 5 A Semantic Web Primer

438 DLP vs. SWRL DLP tries to combine the advantages of both languages (description logic and function-free rules) in their common sublanguage SWRL takes a more maximalist approach and unites their respective expressivities The challenge is to identify sublanguages of SWRL that find the right balance between expressive power and computational tractability DL-safe rules Chapter 5 A Semantic Web Primer

439 Lecture Outline Introduction Monotonic Rules: Example
Monotonic Rules: Syntax & Semantics Description Logic Programs (DLP) Semantic Web Rules Language (SWRL) Nonmonotonic Rules: Syntax Nonmonotonic Rules: Example Rule Markup Language (RuleML) Chapter 5 A Semantic Web Primer

440 Motivation – Negation in Rule Head
In nonmonotonic rule systems, a rule may not be applied even if all premises are known because we have to consider contrary reasoning chains Now we consider defeasible rules that can be defeated by other rules Negated atoms may occur in the head and the body of rules, to allow for conflicts p(X)  q(X) r(X)  ¬q(X) Chapter 5 A Semantic Web Primer

441 Defeasible Rules p(X)  q(X) r(X)  ¬q(X)
Given also the facts p(a) and r(a) we conclude neither q(a) nor ¬q(a) This is a typical example of 2 rules blocking each other Conflict may be resolved using priorities among rules Suppose we knew somehow that the 1st rule is stronger than the 2nd Then we could derive q(a) Chapter 5 A Semantic Web Primer

442 Origin of Rule Priorities
Higher authority E.g. in law, federal law preempts state law E.g., in business administration, higher management has more authority than middle management Recency Specificity A typical example is a general rule with some exceptions We abstract from the specific prioritization principle We assume the existence of an external priority relation on the set of rules Chapter 5 A Semantic Web Primer

443 Rule Priorities r1: p(X)  q(X) r2: r(X)  ¬q(X) r1 > r2
Rules have a unique label The priority relation to be acyclic Chapter 5 A Semantic Web Primer

444 Competing Rules In simple cases two rules are competing only if one head is the negation of the other But in many cases once a predicate p is derived, some other predicates are excluded from holding E.g., an investment consultant may base his recommendations on three levels of risk investors are willing to take: low, moderate, and high Only one risk level per investor is allowed to hold Chapter 5 A Semantic Web Primer

445 Competing Rules (2) These situations are modelled by maintaining a conflict set C(L) for each literal L C(L) always contains the negation of L but may contain more literals Chapter 5 A Semantic Web Primer

446 Defeasible Rules: Syntax
r : L1, ..., Ln  L r is the label {L1, ..., Ln} the body (or premises) L the head of the rule L, L1, ..., Ln are positive or negative literals A literal is an atomic formula p(t1,...,tm) or its negation ¬p(t1,...,tm) No function symbols may occur in the rule Chapter 5 A Semantic Web Primer

447 Defeasible Logic Programs
A defeasible logic program is a triple (F,R,>) consisting of a set F of facts a finite set R of defeasible rules an acyclic binary relation > on R A set of pairs r > r' where r and r' are labels of rules in R Chapter 5 A Semantic Web Primer

448 Lecture Outline Introduction Monotonic Rules: Example
Monotonic Rules: Syntax & Semantics Description Logic Programs (DLP) Semantic Web Rules Language (SWRL) Nonmonotonic Rules: Syntax Nonmonotonic Rules: Example Rule Markup Language (RuleML) Chapter 5 A Semantic Web Primer

449 Brokered Trade Brokered trades take place via an independent third party, the broker The broker matches the buyer’s requirements and the sellers’ capabilities, and proposes a transaction when both parties can be satisfied by the trade The application is apartment renting an activity that is common and often tedious and time-consuming Chapter 5 A Semantic Web Primer

450 The Potential Buyer’s Requirements
At least 45 sq m with at least 2 bedrooms Elevator if on 3rd floor or higher Pet animals must be allowed Carlos is willing to pay: $ 300 for a centrally located 45 sq m apartment $ 250 for a similar flat in the suburbs An extra $ 5 per square meter for a larger apartment An extra $ 2 per square meter for a garden He is unable to pay more than $ 400 in total If given the choice, he would go for the cheapest option His second priority is the presence of a garden His lowest priority is additional space Chapter 5 A Semantic Web Primer

451 Formalization of Carlos’s Requirements – Predicates Used
size(x,y), y is the size of apartment x (in sq m) bedrooms(x,y), x has y bedrooms price(x,y), y is the price for x floor(x,y), x is on the y-th floor gardenSize(x,y), x has a garden of size y lift(x), there is an elevator in the house of x pets(x), pets are allowed in x central(x), x is centrally located acceptable(x), flat x satisfies Carlos’s requirements offer(x,y), Carlos is willing to pay $ y for flat x Chapter 5 A Semantic Web Primer

452 Formalization of Carlos’s Requirements – Rules
r1:  acceptable(X) r2: bedrooms(X,Y), Y < 2  ¬acceptable(X) r3: size(X,Y), Y < 45  ¬acceptable(X) r4: ¬pets(X)  ¬acceptable(X) r5: floor(X,Y), Y > 2,¬lift(X)  ¬acceptable(X) r6: price(X,Y), Y > 400  ¬acceptable(X) r2 > r1, r3 > r1, r4 > r1, r5 > r1, r6 > r1 Chapter 5 A Semantic Web Primer

453 Formalization of Carlos’s Requirements – Rules (2)
r7: size(X,Y), Y ≥ 45, garden(X,Z), central(X)  offer(X, *Z + 5*(Y − 45)) r8: size(X,Y), Y ≥ 45, garden(X,Z), ¬central(X)  offer(X, *Z + 5(Y − 45)) r9: offer(X,Y), price(X,Z), Y < Z  ¬acceptable(X) r9 > r1 Chapter 5 A Semantic Web Primer

454 Representation of Available Apartments
bedrooms(a1,1) size(a1,50) central(a1) floor(a1,1) ¬lift(a1) pets(a1) garden(a1,0) price(a1,300) Chapter 5 A Semantic Web Primer

455 Representation of Available Apartments (2)
Flat Bedrooms Size Central Floor Lift Pets Garden Price a1 1 50 yes no 300 a2 2 45 335 a3 65 350 a4 55 15 330 a5 3 a6 60 370 a7 12 375 Chapter 5 A Semantic Web Primer

456 Determining Acceptable Apartments
If we match Carlos’s requirements and the available apartments, we see that flat a1 is not acceptable because it has one bedroom only (rule r2) flats a4 and a6 are unacceptable because pets are not allowed (rule r4) for a2, Carlos is willing to pay $ 300, but the price is higher (rules r7 and r9) flats a3, a5, and a7 are acceptable (rule r1) Chapter 5 A Semantic Web Primer

457 Selecting an Apartment
r10: acceptable(X)  cheapest(X) r11: acceptable(X), price(X,Z), acceptable(Y), price(Y,W), W < Z  ¬cheapest(X) r12: cheapest(X)  largestGarden(X) r13: cheapest(X), gardenSize(X,Z), cheapest(Y), gardenSize(Y,W), W > Z  ¬largestGarden(X) Chapter 5 A Semantic Web Primer

458 Selecting an Apartment (2)
r14: largestGarden(X)  rent(X) r15: largestGarden(X), size(X,Z), largestGarden(Y), size(Y,W), W > Z ¬ rent(X) r11 > r10, r13 > r12, r15 > r14 Chapter 5 A Semantic Web Primer

459 Lecture Outline Introduction Monotonic Rules: Example
Monotonic Rules: Syntax & Semantics Description Logic Programs (DLP) Semantic Web Rules Language (SWRL) Nonmonotonic Rules: Syntax Nonmonotonic Rules: Example Rule Markup Language (RuleML) Chapter 5 A Semantic Web Primer

460 Example: Customer Discount
The discount for a customer buying a product is 7.5 percent if the customer is premium and the product is luxury <Implies> <head> <Atom> <Rel>discount</Rel> <Var>customer</Var> Chapter 5 A Semantic Web Primer

461 Example: Customer Discount (2)
<Var>product</Var> <Ind>7.5 percent</Ind> </Atom> </head> <body> <And> <Atom> <Rel>premioum</Rel> <Var>customer</Var> Chapter 5 A Semantic Web Primer

462 Example: Customer Discount (3)
<Atom> <Rel>luxury</Rel> <Var>product</Var> </Atom> </And> </body> </Implies> Chapter 5 A Semantic Web Primer

463 Example: Uncle of brother(X,Y), childOf(Z,Y)  uncle(X,Z)
<ruleml : Implies> <ruleml : head> <swrlx : individualPropertyAtom swrlx : property=“uncle”> <ruleml : Var>X</ruleml : Var> <ruleml : Var>Z</ruleml : Var> </swrlx : individualPropertyAtom> </ruleml : head> Chapter 5 A Semantic Web Primer

464 Example: Uncle of (2) <ruleml : body> <ruleml : And> <swrlx : individualPropertyAtom swrlx : property=“brother”> <ruleml : Var>X</ruleml : Var> <ruleml : Var>Y</ruleml : Var> </swrlx : individualPropertyAtom> swrlx : property=“childOf”> Chapter 5 A Semantic Web Primer

465 Example: Uncle of (3) <ruleml : Var>Z</ruleml : Var> <ruleml : Var>Y</ruleml : Var> </swrlx : individualPropertyAtom> </ruleml : And> </ruleml : body> </ruleml : Implies> Chapter 5 A Semantic Web Primer

466 Summary Horn logic is a subset of predicate logic that allows efficient reasoning, orthogonal to description logics Horn logic is the basis of monotonic rules DLP and SWRL are two important ways of combining OWL with Horn rules DLP is essentially the intersection of OWL and Horn logic, whereas SWRL is a much richer language Chapter 5 A Semantic Web Primer

467 Summary (2) Nonmonotonic rules are useful in situations where the available information is incomplete They are rules that may be overridden by contrary evidence Priorities are used to resolve some conflicts between rules Representation XML-like languages is straightforward Chapter 5 A Semantic Web Primer

468 Grigoris Antoniou Frank van Harmelen
Chapter 6 Applications Grigoris Antoniou Frank van Harmelen Chapter 6 A Semantic Web Primer

469 Lecture Outline Horizontal Information Products at Elsevier
Openacademia: Distributed Publication Management Bibster: Data Exchange in a P2P System Data Integration at Audi Skill Finding at Swiss Life Think Tank Portal at EnerSearch E-Learning Web Services Other Scenarios Chapter 6 A Semantic Web Primer

470 Elsevier – The Setting Elsevier is a leading scientific publisher.
Its products are organized mainly along traditional lines: Subscriptions to journals Online availability of these journals has until now not really changed the organisation of the productline Customers of Elsevier can take subscriptions to online content Chapter 6 A Semantic Web Primer

471 Elsevier – The Problem Traditional journals are vertical products
Division into separate sciences covered by distinct journals is no longer satisfactory Customers of Elsevier are interested in covering certain topic areas that spread across the traditional disciplines/journals The demand is rather for horizontal products Chapter 6 A Semantic Web Primer

472 Elsevier – The Problem (2)
Currently, it is difficult for large publishers to offer such horizontal products Barriers of physical and syntactic heterogeneity can be solved (with XML) The semantic problem remains unsolved We need a way to search the journals on a coherent set of concepts against which all of these journals are indexed Chapter 6 A Semantic Web Primer

473 Elsevier – The Contribution of Semantic Web Technology
Ontologies and thesauri (very lightweight ontologies) have proved to be a key technology for effective information access They help to overcome some of the problems of free-text search They relate and group relevant terms in a specific domain They provide a controlled vocabulary for indexing information Chapter 6 A Semantic Web Primer

474 Elsevier – The Contribution of Semantic Web Technology (2)
A number of thesauri have been developed in different domains of expertise Medical information: MeSH and Elsevier’s life science thesaurus EMTREE RDF is used as an interoperability format between heterogeneous data sources EMTREE is itself represented in RDF Chapter 6 A Semantic Web Primer

475 Elsevier – The Contribution of Semantic Web Technology (3)
Each of the separate data sources is mapped onto this unifying ontology The ontology is then used as the single point of entry for all of these data sources Chapter 6 A Semantic Web Primer

476 Elsevier – The Results Elsevier has sponsored the DOPE project (Drug Ontology Project for Elsevier) The EMTREE thesaurus was used to index millions of medical abstracts and full text articles In the interface used, the EMTREE ontology was used to: disambiguate the original free-text user query categorize the results produce a visual clustering of the search results narrow or widen the search query in a meaningful way Chapter 6 A Semantic Web Primer

477 DOPE Search and Browse Interface
Chapter 6 A Semantic Web Primer

478 Lecture Outline Horizontal Information Products at Elsevier
Openacademia: Distributed Publication Management Bibster: Data Exchange in a P2P System Data Integration at Audi Skill Finding at Swiss Life Think Tank Portal at EnerSearch E-Learning Web Services Other Scenarios Chapter 6 A Semantic Web Primer

479 Openacademia – The Setting
Information about scientific publications is often maintained by individual researchers Reference management software such as EndNote and BibTeX helps researchers to maintain personal collections of bibliographic references Most researchers have to maintain a Web page about publications for interested peers from other institutes Often personal reference management and the maintenance of Web pages are isolated efforts The author of a new publication adds the reference to his own collection and updates his Web page Chapter 6 A Semantic Web Primer

480 Openacademia – The Problem
Maintaining personal references and Web pages about publications should not require redundant efforts One can achieve this by directly using individual bibliographical records generate personal Web pages and joined publication lists for Web pages at the group or institutional level Chapter 6 A Semantic Web Primer

481 Openacademia – The Problem (2)
Several problems need to be solved: Information from different files and possibly in different formats has to be collected and integrated Duplicate information should be detected and merged It should be possible to query for specific selections of the bibliographic entries and represent them in customized layouts Chapter 6 A Semantic Web Primer

482 Openacademia – The Contribution of Semantic Web Technology
All tasks in openacademia are performed on RDF representations of the data, and only standard ontologies are used to describe the meaning of the data Moreover, W3C standards are used for the transformation and presentation of the information Chapter 6 A Semantic Web Primer

483 Functionality The most immediate service of openacademia is to enable generating an HTML representation of a personal collection of publications and publishing it on the Web This requires filling out a single form on the Web site, which generates the code (one line of javaScript!) that needs to be inserted into the body of the home page Chapter 6 A Semantic Web Primer

484 Functionality (2) The code inserts the publication list in the page dynamically, and thus there is no need to update the page separately if the underlying collection changes The appearance of the publication list can be customized by a variety of style sheets One can also generate an RSS feed from the collection Chapter 6 A Semantic Web Primer

485 Functionality (3) The RSS feeds of openacademia are RDF-based and can also be consumed by any RDF-aware software Research groups can install their own openacademia server Groups can have their RSS feeds as well Chapter 6 A Semantic Web Primer

486 Functionality (4) There is also an AJAX-based interface for browsing and searching the publication collection which builds queries and displays the results This interface offers a number of visualizations (e.g. see publications along a time line that can be scrolled using a mouse) Chapter 6 A Semantic Web Primer

487 AJAX-based Query interface
Chapter 6 A Semantic Web Primer

488 The Timeline Widget Chapter 6 A Semantic Web Primer

489 Information Sources Openacademia uses the RDF-based FOAF (Friend of a Friend) format as a schema for information about persons and groups To have their information included in openacademia researchers need to have a FOAF profile that contains at least their name and a link to a file with their publications Anyone can generate a FOAF profile Chapter 6 A Semantic Web Primer

490 Information Sources (2)
To be able to make selections on groups, information about group membership is required This can also be specified in a FOAF file Alternatively, it can be generated from a database Chapter 6 A Semantic Web Primer

491 Information Sources (3)
For data about publications, openacademia uses the Semantic Web Research Community (SWRC) ontology as a basic schema It also accepts BibTeX The BibTeX files are translated to RDF using the BibTex-2-RDF service, which creates instance data for the SWRC ontology Chapter 6 A Semantic Web Primer

492 Information Sources (4)
A simple extension of the SWRC ontology was necessary to preserve the sequence of authors of publications To this end the properties swrc-ext:authorList and swrc-ext:editorList are defined, which have rdf:Seq as range, comprising an ordered list of authors The crawler in openacademia collects the FOAF profiles and publication files All data are subsequently stored in an RDF database Chapter 6 A Semantic Web Primer

493 Integration The system has to deal with the increasing semantic heterogeneity of information sources Heterogeneity affects both the schema and the instance levels The schemas used are stable, lightweight Web ontologies, so their mapping causes no problem Chapter 6 A Semantic Web Primer

494 Integration (2) Openacademia uses a bridging ontology that specifies the relations between important classes in both ontologies (e.g. swrc:Author should be considered a sub-class of foaf:Person) Heterogeneity on the instance level arises from using different identifiers in the sources for denoting the same real-world objects This certainly affects FOAF data collected from the Web, as well as publication information Chapter 6 A Semantic Web Primer

495 Integration (3) A so-called smusher is used to match foaf:Person instances based on name and inverse functional properties e.g if two persons have the same value for their addresses (or checksums), we can conclude that the two persons are the same Publications are matched on a combination of properties The instance matches that are found are stored in the RDF store using the owl:sameAs property Chapter 6 A Semantic Web Primer

496 Integration (4) These rules express the reflexive, symmetric and transitive nature of the property as well as the intended meaning, namely, the equality of property values Chapter 6 A Semantic Web Primer

497 Presentation After all information has been merged, the triple store can be queried to produce publications lists according to a variety of criteria, including personal, group, or publication facets The online interface helps users to build such queries against the publication repository Chapter 6 A Semantic Web Primer

498 Presentation (2) The following query, formulated in the SeRQL query language, returns all publications authored by the members of the AI department (uniquely identified by its home page) in 2004 Note that the successful resolution of this query relies on the schema and instance matching described in the previous section Researchers can change their personal profiles and update their publication lists without the need to consult or notify anyone Chapter 6 A Semantic Web Primer

499 Presentation (2) Chapter 6 A Semantic Web Primer

500 Lecture Outline Horizontal Information Products at Elsevier
Openacademia: Distributed Publication Management Bibster: Data Exchange in a P2P System Data Integration at Audi Skill Finding at Swiss Life Think Tank Portal at EnerSearch E-Learning Web Services Other Scenarios Chapter 6 A Semantic Web Primer

501 Bibster – The Setting The openacademia system uses a semicentralized solution for collecting, storing and sharing bibliographic information Centralized, because it harvests data into a single centralized repository Semi-centralized because it harvests the bibliographic data from the files of individual researchers In this section we describe a fully distributed approach to the same problem Chapter 6 A Semantic Web Primer

502 Bibster – The Problem Any centralized solution relies on the performance of the centralized node in the system How often does the crawler refresh the collected data-items, how reliable is the central server, will the central server become a performance bottleneck? Many researchers share their data only as long as they are able to maintain local control over the information, instead of handing it over to a central server outside their control Chapter 6 A Semantic Web Primer

503 Bibster – The Problem (2)
With Bibster, researchers may want to: Query a singe specific peer, a specific set of peers, or the entire network of peers Search for bibliographic entries using simple keyword searches, but also more advanced, semantic searches Integrate results of a query into a local repository for future use. Such data may in turn be used to answer queries by other peers. They may also be interested in in updating items that are already locally stored Chapter 6 A Semantic Web Primer

504 Bibster – The Contribution of the Semantic Web Technology
Ontologies are used by Bibster for a number of purposes: importing data, formulating queries, routing queries, and processing answers Chapter 6 A Semantic Web Primer

505 Importing Data The system enables users to import their own bibliographic metadata into a local repository Bibliographic entries made available to Bibster by users are automatically aligned to two ontologies The first ontology (SWRC) describes different generic aspects of bibliographic metadata The second ontology (ACM Topic Ontology) describes specific categories of literature for the computer science domain Chapter 6 A Semantic Web Primer

506 Formulating queries Queries are formulated in terms of the two ontologies Queries may concern fields like author or publication type, or specific computer science terms Chapter 6 A Semantic Web Primer

507 Routing queries Queries are routed through the network depending on the expertise models of the peers describing which concepts from the ACM ontology a peer can answer queries on A matching function determines how closely the semantic content of a query matches the expertise model of a peer Routing is then done on the basis of this semantic ranking Chapter 6 A Semantic Web Primer

508 Processing Answers Because of the distributed nature and potentially large size of the p2p network, an answer set might be very large and contain many duplicate answers Because of the semistructured nature of bibliographic metadata, such duplicates are often not exactly identical copies Ontologies help to measure the semantic similarity between the different answers and remove apparent duplicates as identified by the similarity function Chapter 6 A Semantic Web Primer

509 Bibster – The Results The following screenshot indicates how the use cases are realized in Bibster The scope widget allows for defining the targeted peers The Search and Search Details widgets allow for keyword and semantic search The Results Table and BibTeXView widgets allow for browsing and reusing query results The query results are visualized in a list grouped by duplicates They may be integrated into the local repository, or exported into formats, such as BibTeX and HTML Chapter 6 A Semantic Web Primer

510 Bibster P2P Bibliography finder
Chapter 6 A Semantic Web Primer

511 Lecture Outline Horizontal Information Products at Elsevier
Openacademia: Distributed Publication Management Bibster: Data Exchange in a P2P System Data Integration at Audi Skill Finding at Swiss Life Think Tank Portal at EnerSearch E-Learning Web Services Other Scenarios Chapter 6 A Semantic Web Primer

512 Audi – The Problem Data integration is also a huge problem internal to companies It is the highest cost factor in the information technology budget of large companies Audi operates thousands of databases Traditional middleware improves and simplifies the integration process But it misses the sharing of information based on the semantics of the data Chapter 6 A Semantic Web Primer

513 Audi – The Contribution of Semantic Web Technology
Ontologies can rationalize disparate data sources into one body of information Without disturbing existing applications, by: creating ontologies for data and content sources adding generic domain information The ontology is mapped to the data sources giving applications direct access to the data through the ontology Chapter 6 A Semantic Web Primer

514 Audi – Camera Example <SLR rdf:ID="Olympus-OM-10">
<viewFinder>twin mirror</viewFinder> <optics> <Lens> <focal-length>75-300mm zoom</focal-length> <f-stop> </f-stop> </Lens> </optics> <shutter-speed>1/2000 sec. to 10 sec.</shutter-speed> </SLR> Chapter 6 A Semantic Web Primer

515 Audi – Camera Example (2)
<Camera rdf:ID="Olympus-OM-10"> <viewFinder>twin mirror</viewFinder> <optics> <Lens> <size>300mm zoom</size> <aperture>4.5</aperture> </Lens> </optics> <shutter-speed>1/2000 sec. to 10 sec.</shutter-speed> </Camera> Chapter 6 A Semantic Web Primer

516 Audi – Camera Example (3)
Human readers can see that these two different formats talk about the same object We know that SLR is a kind of camera, and that fstop is a synonym for aperture Ad hoc integration of these data sources by translator is possible Would only solve this specific integration problem We would have to do the same again when we encountered the next data format for cameras Chapter 6 A Semantic Web Primer

517 Audi – Camera Ontology in OWL
<owl:Class rdf:ID="SLR"> <rdfs:subClassOf rdf:resource="#Camera"/> </owl:Class> <owl:DatatypeProperty rdf:ID="f-stop"> <rdfs:domain rdf:resource="#Lens"/> </owl:DatatypeProperty> <owl:DatatypeProperty rdf:ID="aperture"> <owl:equivalentProperty rdf:resource="#f-stop"/> <owl:DatatypeProperty rdf:ID="focal-length"> <owl:DatatypeProperty rdf:ID="size"> <owl:equivalentProperty rdf:resource="#focal-length"/> Chapter 6 A Semantic Web Primer

518 Audi – Using the Ontology
Suppose that an application A is using the second encoding is receiving data from an application B using the first encoding Suppose it encounters SLR Ontology returns “SLR is a type of Camera” A relation between something it doesn’t know (SLR) to something it does know (Camera) Chapter 6 A Semantic Web Primer

519 Audi – Using the Ontology (2)
Suppose A encounters f-stop The Ontology returns: “f-stop is synonymous with aperture” Bridges the terminology gap between something A doesn’t know to something A does know Syntactic divergence is no longer a hindrance Chapter 6 A Semantic Web Primer

520 Lecture Outline Horizontal Information Products at Elsevier
Openacademia: Distributed Publication Management Bibster: Data Exchange in a P2P System Data Integration at Audi Skill Finding at Swiss Life Think Tank Portal at EnerSearch E-Learning Web Services Other Scenarios Chapter 6 A Semantic Web Primer

521 Swiss Life – The Setting
Swiss Life is one of Europe’s leading life insurers 11,000 employees, $14 billion of written premiums Active in about 50 different countries The most important resources of any company for solving knowledge intensive tasks are: The tacit knowledge, personal competencies, and skills of its employees Chapter 6 A Semantic Web Primer

522 Swiss Life – The Problem
One of the major building blocks of enterprise knowledge management is: An electronically accessible repository of people’s capabilities, experiences, and key knowledge areas A skills repository can be used to: enable a search for people with specific skills expose skill gaps and competency levels direct training as part of career planning document the company’s intellectual capital Chapter 6 A Semantic Web Primer

523 Swiss Life – The Problem (2)
Problems How to list the large number of different skills? How to organise them so that they can be retrieved across geographical and cultural boundaries? How to ensure that the repository is updated frequently? Chapter 6 A Semantic Web Primer

524 Swiss Life – The Contribution of Semantic Web Technology
Hand-built ontology to cover skills in three organizational units Information Technology, Private Insurance and Human Resources Individual employees within Swiss Life were asked to create “home pages” based on form filling driven by the skills-ontology The corresponding collection could be queried using a form-based interface that generated RQL queries Chapter 6 A Semantic Web Primer

525 Swiss Life – Skills Ontology
<owl:Class rdf:ID="Skills"> <rdfs:subClassOf> <owl:Restriction> <owl:onProperty rdf:resource="#HasSkillsLevel"/> <owl:cardinality rdf:datatype="&xsd;nonNegativeInteger"> 1</owl:cardinality> </owl:Restriction> </rdfs:subClassOf> </owl:Class> <owl:ObjectProperty rdf:ID="HasSkills"> <rdfs:domain rdf:resource="#Employee"/> <rdfs:range rdf:resource="#Skills"/> </owl:ObjectProperty> Chapter 6 A Semantic Web Primer

526 Swiss Life – Skills Ontology (2)
<owl:ObjectProperty rdf:ID="WorksInProject"> <rdfs:domain rdf:resource="#Employee"/> <rdfs:range rdf:resource="#Project"/> <owl:inverseOf rdf:resource="#ProjectMembers"/> </owl:ObjectProperty> <owl:Class rdf:ID="Publishing"> <rdfs:subClassOf rdf:resource="#Skills"/> </owl:Class> <owl:Class rdf:ID="DocumentProcessing"> Chapter 6 A Semantic Web Primer

527 Swiss Life – Skills Ontology (3)
<owl:ObjectProperty rdf:ID="ManagementLevel"> <rdfs:domain rdf:resource="#Employee"/> <rdfs:range> <owl:oneOf rdf:parseType="Collection"> <owl:Thing rdf:about="#member"/> <owl:Thing rdf:about="#HeadOfGroup"/> <owl:Thing rdf:about="#HeadOfDept"/> <owl:Thing rdf:about="#CEO"/> </owl:oneOf> </rdfs:range> </owl:ObjectProperty> Chapter 6 A Semantic Web Primer

528 Lecture Outline Horizontal Information Products at Elsevier
Openacademia: Distributed Publication Management Bibster: Data Exchange in a P2P System Data Integration at Audi Skill Finding at Swiss Life Think Tank Portal at EnerSearch E-Learning Web Services Other Scenarios Chapter 6 A Semantic Web Primer

529 EnerSearch – The Setting
An industrial research consortium focused on information technology in energy EnerSearch has a structure very different from a traditional research company Research projects are carried out by a varied and changing group of researchers spread over different countries Many of them are not employees of EnerSearch Chapter 6 A Semantic Web Primer

530 EnerSearch – The Setting (2)
EnerSearch is organized as a virtual organization Owned by a number of firms in the industry sector that have an express interest in the research being carried out Because of this wide geographical spread, EnerSearch also has the character of a virtual organisation from a knowledge distribution point of view Chapter 6 A Semantic Web Primer

531 EnerSearch – The Problem
Dissemination of knowledge key function The information structure of the web site leaves much to be desired It does not satisfy the needs of info seekers, e.g. Does load management lead to cost-saving? If so, what are the required upfront investments? Can powerline communication be technically competitive to ADSL or cable modems? Chapter 6 A Semantic Web Primer

532 EnerSearch – The Contribution of Semantic Web Technology
It is possible to form a clear picture of what kind of topics and questions would be relevant for these target groups It is possible to define a domain ontology that is sufficiently stable and of good quality This lightweight ontology consisted only of a taxonomical hierarchy Needed only RDF Schema expressivity Chapter 6 A Semantic Web Primer

533 EnerSearch – Lunchtime Ontology
... IT Hardware Software Applications Communication Powerline Agent Electronic Commerce Agents Multi-agent systems Intelligent agents Market/auction Resource allocation Algorithms Chapter 6 A Semantic Web Primer

534 EnerSearch – Use of Ontology
Used in a number of different ways to drive navigation tools on the EnerSearch web site Semantic map of the EnerSearch web site Semantic distance between EnerSearch authors in terms of their fields of research and publication Chapter 6 A Semantic Web Primer

535 Semantic Map of Part of the EnerSearch Web Site
Chapter 6 A Semantic Web Primer

536 Semantic Distance between EnerSearch Authors
Chapter 6 A Semantic Web Primer

537 EnerSearch – QuizRDF QuizRDF aims to combine
an entirely ontology based display a traditional keyword based search without any semantic grounding The user can type in general keywords It also displays those concepts in the hierarchy which describe these papers All these disclosure mechanisms (textual and graphic, searching or browsing) based on a single underlying lightweight ontology Chapter 6 A Semantic Web Primer

538 Lecture Outline Horizontal Information Products at Elsevier
Openacademia: Distributed Publication Management Bibster: Data Exchange in a P2P System Data Integration at Audi Skill Finding at Swiss Life Think Tank Portal at EnerSearch E-Learning Web Services Other Scenarios Chapter 6 A Semantic Web Primer

539 E-Learning – The Setting
Traditionally learning has been characterized by the following properties: Educator-driven Linear access Time- and locality-dependent Learning has not been personalized but rather aimed at mass participation Chapter 6 A Semantic Web Primer

540 E-Learning – The Setting (2)
The changes are already visible in higher education Virtual universities Flexibility and new educational means Students can increasingly make choices about pace of learning, content, evaluation methods Chapter 6 A Semantic Web Primer

541 E-Learning – The Setting (3)
Even greater promise: life long learning activities Improvement of the skills of its employees ic critical to companies Organizations require learning processes that are just-in-time, tailored to their specific needs These requirements are not compatible with traditional learning, but e-learning shows great promise for addressing these concerns Chapter 6 A Semantic Web Primer

542 E-Learning – The Problem
E-learning is not driven by the instructor Learners can: Access material in an order that is not predefined Compose individual courses by selecting educational material Learning material must be equipped with additional information (metadata) to support effective indexing and retrieval Chapter 6 A Semantic Web Primer

543 E-Learning – The Problem (2)
Standards (IEEE LOM) have emerged E.g. educational and pedagogical properties, access rights and conditions of use, and relations to other educational resources Standards suffer from lack of semantics This is common to all solutions based solely on metadata (XML-like approaches) Combining of materials by different authors may be difficult Retrieval may not be optimally supported Retrieval and organization of learning resources must be made manually Could be done by a personalized automated agent instead! Chapter 6 A Semantic Web Primer

544 E-Learning – The Contribution of Semantic Web Technology
Establish a promising approach for satisfying the e-learning requirements E.g. ontology and machine-processable metadata Learner-centric Learning materials, possibly by different authors, can be linked to commonly agreed ontologies Personalized courses can be designed through semantic querying Learning materials can be retrieved in the context of actual problems, as decided by the learner Chapter 6 A Semantic Web Primer

545 E-Learning – The Contribution of Semantic Web Technology (2)
Flexible access Knowledge can be accessed in any order the learner wishes Appropriate semantic annotation will still define prerequisites Nonlinear access will be supported Integration A uniform platform for the business processes of organizations Learning activities can be integrated in these processes Chapter 6 A Semantic Web Primer

546 Ontologies for E-Learning
Some mechanism for establishing a shared understanding is needed: ontologies In e-learning we distinguish between three types of knowledge (ontologies): Content Pedagogy Structure Chapter 6 A Semantic Web Primer

547 Content Ontologies Basic concepts of the domain in which learning takes place Include the relations between concepts, and basic properties E.g., the study of Classical Athens is part of the history of Ancient Greece, which in turn is part of Ancient History The ontology should include the relation “is part of” and the fact that it is transitive (e.g., expressed in OWL) COs use relations to capture synonyms, abbreviations, etc. Chapter 6 A Semantic Web Primer

548 Pedagogy Ontologies Pedagogical issues can be addressed in a pedagogy ontology (PO) E.g. material can be classified as lecture, tutorial, example, walk-through, exercise, solution, etc. Chapter 6 A Semantic Web Primer

549 Structure Ontologies Define the logical structure of the learning materials Typical knowledge of this kind includes hierarchical and navigational relations like previous, next, hasPart, isPartOf, requires, and isBasedOn Relationships between these relations can also be defined E.g., hasPart and isPartOf are inverse relations Inferences drawn from learning ontologies cannot be very deep Chapter 6 A Semantic Web Primer

550 Lecture Outline Horizontal Information Products at Elsevier
Openacademia: Distributed Publication Management Bibster: Data Exchange in a P2P System Data Integration at Audi Skill Finding at Swiss Life Think Tank Portal at EnerSearch E-Learning Web Services Other Scenarios Chapter 6 A Semantic Web Primer

551 Web Services Web sites that do not merely provide static information, but involve interaction with users and often allow users to effect some action Simple Web services involve a single Web-accessible program, sensor, device Complex Web services are composed of simpler services Often they require ongoing interaction with the user The user can make choices or provide information conditionally Chapter 6 A Semantic Web Primer

552 A Complex Web Service User interaction with an online music store involves searching for CDs and titles by various criteria reading reviews and listening to samples adding CDs to a shopping cart providing credit card details, shipping details, and delivery address Chapter 6 A Semantic Web Primer

553 The Problem SOAP, WSDL, UDDI and BPEL4WS are the standard technology combination to build a Web service application They fail to achieve the goals of automation and interoperability because the require humans in the loop WSDL specifies the functionality of a service only at a syntactic level but does not describe the meaning of the Web service functionality Chapter 6 A Semantic Web Primer

554 The Contribution of Semantic Web Technology
The Semantic Web community addressed the limitations of current Web service technology by augmenting the service descriptions with a semantic layer in order to achieve Automatic discovery, composition, monitoring, and execution The automation of these tasks is highly desirable Chapter 6 A Semantic Web Primer

555 The Contribution of Semantic Web Technology Example Scenario
The example task is specializing the more generic task of finding the closest medical provides A strategy for performing this task is Retrieve the details of all medical providers Select the closest by computing the distance between the location of the provider and a reference location Chapter 6 A Semantic Web Primer

556 OWL-S service ontology
Chapter 6 A Semantic Web Primer

557 The Contribution of Semantic Web Technology Example Scenario (2)
Semantic Web service technology aims to automate performing such tasks based on the semantic description of Web services A common characteristic of all emerging frameworks for semantic Web service descriptions is the they combine two kinds of ontologies to obtain a service description A generic Web service ontology A domain ontology Chapter 6 A Semantic Web Primer

558 Generic Web Service Ontologies OWL-S
OWL-S ontology is conceptually divided into four subontologies for specifying What the service does (Profile) How the service works (Process) How the service is implemented (Grounding) A fourth ontology (Service) contains the Service concept, which links together the ServiceProfile, ServiceModel and ServiceGrounding Chapter 6 A Semantic Web Primer

559 The Profile Ontology Profile specifies :
The functionality offered by the service The semantic type of the inputs and outputs The details of the service provider Several service parameters, such as quality rating or geographic radius Profile is a subclass of ServiceProfile Chapter 6 A Semantic Web Primer

560 The Profile Ontology (2)
For each Profile instance we associate the process it describes its functional characteristics together with their type Chapter 6 A Semantic Web Primer

561 The Profile Ontology example
Service MedicareSupplier: *Profile : FindMedicareSupplierByZip (hasProc P1) (I (ZipCode), O (SupplierDetails)) *Profile : FindMedicareSupplierByCity (hasProc P2) (I (City), O (SupplierDetails)) *Profile : FindMedicareSupplierBySupply (hasProc P3) (I (SupplyType), O (SupplierDetails)) *ProcessModel : … *WSDLGrounding : … Chapter 6 A Semantic Web Primer

562 The Process Ontology Many complex services consist of smaller executed in a certain order For example, buying a book at Amazon.com involves using a browsing service and a paying service OWL-S allows describing such internal process models These are useful for several purposes One can check that the business process of the offering service is appropriate One can monitor the execution stage of a service These process models van be used to automatically compose Web services Chapter 6 A Semantic Web Primer

563 The Process Ontology Example
Service MedicareSupplier : *Profile : … *ProcessModel : … CompositeProcess : MedicareProcess : Choice AtomicProcess : P1 (I (ZipCode), O (SupplierDetails)) AtomicProcess : P2 (I (City), O (SupplierDetails)) AtomicProcess : P3 (I (SupplyType), O (SupplierDetails)) *WSDLGrounding : … Chapter 6 A Semantic Web Primer

564 Profile to Process Bridge
A profile contains several links to a Process Next figure shows these links Profile states the Process it describes through the unique property has_process IOPEs of the Profiles correspond to the IOPEs of the Process Chapter 6 A Semantic Web Primer

565 Profile to Process Bridge (2)
Chapter 6 A Semantic Web Primer

566 Profile to Process Bridge (3)
IOPEs play different roles for the Profile and for the Process In the Profile ontology they are treated equally as parameters of the Profile In the Process ontology only inputs and outputs are regarded as subproperties of the process:parameter property Chapter 6 A Semantic Web Primer

567 Profile to Process Bridge (4)
The precondition and effects are just simple properties of the Process IOPEs are properties both for Profile and Process The fact that they are treated differently at a conceptual level is misleading The link between the IOPEs in the Profile and Process part of the OWL-S descriptions is created by the refersTo property which has As domain ParameterDescription Ranges over the process:parameter Chapter 6 A Semantic Web Primer

568 The Grounding ontology
The grounding to a WSDL description is performed according to three rules: Each AtomicProcess corresponds to one WSDL operation Each input of an AtomicProcess is mapped to a corresponding messagepart in the input message of the WSDL operation. Similarly for outputs The type of each WSDL message part can bi specified in terms of a OWL-S parameter Chapter 6 A Semantic Web Primer

569 The Grounding ontology Example
Service MedicareSupplier : *Profile : … *ProcessModel : … *WSDLGrounding: WsdlAtomicProcessGrounding : Gr1 (P1>op:GetSupplierByZipCode) WsdlAtomicProcessGrounding : Gr2 (P1->op:GetSupplierByCity) WsdlAtomicProcessGrounding : Gr3 (P1->op:GetSupplierBySupplyType) Chapter 6 A Semantic Web Primer

570 Design Principles of OWL-S
Semantic versus Syntactic descriptions OWL-S distinguishes between the semantic and syntactic aspects of the described entity The Profile and Process ontologies allow for a semantic description of the Web service, and the WSDL description encodes its syntactic aspects The Grounding ontology provides a mapping between the semantic and the syntactic parts of a description facilitating flexible association between them Chapter 6 A Semantic Web Primer

571 Design Principles of OWL-S (2)
Generic versus domain knowledge OWL-S offers a core set of primitives to specify the type of Web service These descriptions can be enriched with domain knowledge specified in a separate domain ontology This modeling choice allows using the core set of primitives across several domains Chapter 6 A Semantic Web Primer

572 Design Principles of OWL-S (3)
Modularity Another feature of OWL-S is the partitioning of the description over several concepts There are several advantages of this modular modeling It is easy to reuse certain parts Service specification becomes flexible because if is possible to specify only the part that is relevant for the service Any OWL-S description is easy to extend by specializing the OWL-S concepts Chapter 6 A Semantic Web Primer

573 Web Service Domain Ontology
Externally defined knowledge plays a major role in each OWL-S description OWL-S offers a generic framework to describe a service, but to make it truly useful, domain knowledge is required Chapter 6 A Semantic Web Primer

574 Web Service Domain Ontology (2)
Chapter 6 A Semantic Web Primer

575 Web Service Domain Ontology (3)
Previous figure specifies a DataStructure hierarchy and a Functionality ability The Functionality hierarch contains a classification of service capabilities Two generic classes of service capabilities are shown here One for finding a medical supplier One for calculating distances between two locations Each of these generic categories has more specialized capabilities either by restricting the type of the output parameters or the input parameters Chapter 6 A Semantic Web Primer

576 Web Service Domain Ontology (4)
The complexity of the reasoning tasks that can be performed with semantic Web service descriptions is conditioned by several factors All Web services in a domain should use concepts from the same domain ontology in their descriptions The richness of the available knowledge is crucial for performing complex reasoning Chapter 6 A Semantic Web Primer

577 Web Service Domain Ontology Example Scenario
The right services for the task can be selected automatically from a collection of services Semantic metadata allow a flexible selection that can retrieve services that partially match a request but are still potentially interesting Chapter 6 A Semantic Web Primer

578 Web Service Domain Ontology Example Scenario (2)
A service that finds details of medical suppliers will be considered a match for a request for services that retrieve details of Medicare suppliers, if the Web service domain ontology specifies that a MedicareSupplier is a type of MedicalSupplier This matchmaking is superior to the keyword-based search offered by UDDI Chapter 6 A Semantic Web Primer

579 Web Service Domain Ontology Example Scenario (3)
The composition of several services into a more complex service can also be automated After being discovered and composed based on their semantic descriptions, the services can be invoked to solve the task at hand Chapter 6 A Semantic Web Primer

580 Lecture Outline Horizontal Information Products at Elsevier
Openacademia: Distributed Publication Management Bibster: Data Exchange in a P2P System Data Integration at Audi Skill Finding at Swiss Life Think Tank Portal at EnerSearch E-Learning Web Services Other Scenarios Chapter 6 A Semantic Web Primer

581 Multimedia Collection Indexing at Scotland Yard
Theft of art and antique objects International databases of stolen art objects exist It is difficult to locate specific objects in these databases Different parties are likely to offer different descriptions Human experts are needed to match objects to database entries Chapter 6 A Semantic Web Primer

582 Multimedia Collection Indexing at Scotland Yard – The Solution
Develop controlled vocabularies such as the Art and Architecture Thesaurus (AAT) from the Getty Trust, or Iconclass thesaurus Extend them into full-blown ontologies Develop automatic classifiers using ontological background knowledge Deal with the ontology-mapping problem Chapter 6 A Semantic Web Primer

583 Online Procurement at Daimler-Chrysler – The Problem
Static, long-term agreements with a fixed set of suppliers can be replaced by dynamic, short-term agreements in a competitive open marketplace Whenever a supplier is offering a better deal, Daimler-Chrysler wants to be able to switch Major drivers behind B2B e-commerce Chapter 6 A Semantic Web Primer

584 Online Procurement at Daimler-Chrysler – The Solution
Rosetta Net is an organization dedicated to such standardization efforts XML-based, no semantics Use RDF Schema and OWL instead Product descriptions would “carry their semantics on their sleeve” Much more liberal online B2B procurement processes would exist than currently possible Chapter 6 A Semantic Web Primer

585 Device Interoperability at Nokia
Explosive proliferation of digital devices: PDAs, mobiles, digital cameras, laptops, wireless access in public places, GPS-enabled cars Interoperability among these devices? The pervasiveness and the wireless nature of these devices require network architectures to support automatic, ad hoc configuration A key technology of true ad hoc networks is service discovery Chapter 6 A Semantic Web Primer

586 Device Interoperability at Nokia (2)
Current service discovery and capability description require a priori identification of what to communicate or discuss A more attractive approach would be “serendipitous interoperability” Interoperability under “unchoreographed” conditions Devices necessarily designed to work together Chapter 6 A Semantic Web Primer

587 Device Interoperability at Nokia (3)
These devices should be able to: Discover each others’ functionality Take advantage of it Devices must be able to “understand” other devices and reason about their functionality Ontologies are required to make such “unchoreographed” understanding of functionalities possible Chapter 6 A Semantic Web Primer

588 Chapter 7 Ontology Engineering
Grigoris Antoniou Frank van Harmelen Chapter 7 A Semantic Web Primer

589 Lecture Outline Introduction Constructing Ontologies Manually
Reusing Existing Ontologies Semiautomatic Ontology Acquisition Ontology Mapping On-To-Knowledge SW Architecture Chapter 7 A Semantic Web Primer

590 Methodological Questions
How can tools and techniques best be applied? Which languages and tools should be used in which circumstances, and in which order? What about issues of quality control and resource management? Many of these questions for the Semantic Web have been studied in other contexts E.g. software engineering, object-oriented design, and knowledge engineering Chapter 7 A Semantic Web Primer

591 Lecture Outline Introduction Constructing Ontologies Manually
Reusing Existing Ontologies Semiautomatic Ontology Acquisition Ontology Mapping On-To-Knowledge SW Architecture Chapter 7 A Semantic Web Primer

592 Main Stages in Ontology Development
Determine scope Consider reuse Enumerate terms Define taxonomy Define properties Define facets Define instances Check for anomalies Not a linear process! Chapter 7 A Semantic Web Primer

593 Determine Scope There is no correct ontology of a specific domain
An ontology is an abstraction of a particular domain, and there are always viable alternatives What is included in this abstraction should be determined by the use to which the ontology will be put by future extensions that are already anticipated Chapter 7 A Semantic Web Primer

594 Determine Scope (2) Basic questions to be answered at this stage are:
What is the domain that the ontology will cover? For what we are going to use the ontology? For what types of questions should the ontology provide answers? Who will use and maintain the ontology? Chapter 7 A Semantic Web Primer

595 Consider Reuse With the spreading deployment of the Semantic Web, ontologies will become more widely available We rarely have to start from scratch when defining an ontology There is almost always an ontology available from a third party that provides at least a useful starting point for our own ontology Chapter 7 A Semantic Web Primer

596 Enumerate Terms Write down in an unstructured list all the relevant terms that are expected to appear in the ontology Nouns form the basis for class names Verbs (or verb phrases) form the basis for property names Traditional knowledge engineering tools (e.g. laddering and grid analysis) can be used to obtain the set of terms an initial structure for these terms Chapter 7 A Semantic Web Primer

597 Define Taxonomy Relevant terms must be organized in a taxonomic hierarchy Opinions differ on whether it is more efficient/reliable to do this in a top-down or a bottom-up fashion Ensure that hierarchy is indeed a taxonomy: If A is a subclass of B, then every instance of A must also be an instance of B (compatible with semantics of rdfs:subClassOf Chapter 7 A Semantic Web Primer

598 Define Properties Often interleaved with the previous step
The semantics of subClassOf demands that whenever A is a subclass of B, every property statement that holds for instances of B must also apply to instances of A It makes sense to attach properties to the highest class in the hierarchy to which they apply Chapter 7 A Semantic Web Primer

599 Define Properties (2) While attaching properties to classes, it makes sense to immediately provide statements about the domain and range of these properties There is a methodological tension here between generality and specificity: Flexibility (inheritance to subclasses) Detection of inconsistencies and misconceptions Chapter 7 A Semantic Web Primer

600 Define Facets: From RDFS to OWL
Cardinality restrictions Required values owl:hasValue owl:allValuesFrom owl:someValuesFrom Relational characteristics symmetry, transitivity, inverse properties, functional values Chapter 7 A Semantic Web Primer

601 Define Instances Filling the ontologies with such instances is a separate step Number of instances >> number of classes Thus populating an ontology with instances is not done manually Retrieved from legacy data sources (DBs) Extracted automatically from a text corpus Chapter 7 A Semantic Web Primer

602 Check for Anomalies An important advantage of the use of OWL over RDF Schema is the possibility to detect inconsistencies In ontology or ontology+instances Examples of common inconsistencies incompatible domain and range definitions for transitive, symmetric, or inverse properties cardinality properties requirements on property values can conflict with domain and range restrictions Chapter 7 A Semantic Web Primer

603 Lecture Outline Introduction Constructing Ontologies Manually
Reusing Existing Ontologies Semiautomatic Ontology Acquisition Ontology Mapping On-To-Knowledge SW Architecture Chapter 7 A Semantic Web Primer

604 Existing Domain-Specific Ontologies
Medical domain: Cancer ontology from the National Cancer Institute in the United States Cultural domain: Art and Architecture Thesaurus (AAT) with 125,000 terms in the cultural domain Union List of Artist Names (ULAN), with 220,000 entries on artists Iconclass vocabulary of 28,000 terms for describing cultural images Geographical domain: Getty Thesaurus of Geographic Names (TGN), containing over 1 million entries Chapter 7 A Semantic Web Primer

605 Integrated Vocabularies
Merge independently developed vocabularies into a single large resource E.g. Unified Medical Language System integrating100 biomedical vocabularies The UMLS metathesaurus contains 750,000 concepts, with over 10 million links between them The semantics of a resource that integrates many independently developed vocabularies is rather low But very useful in many applications as starting point Chapter 7 A Semantic Web Primer

606 Upper-Level Ontologies
Some attempts have been made to define very generally applicable ontologies Mot domain-specific Cyc, with 60,000 assertions on 6,000 concepts Standard Upperlevel Ontology (SUO) Chapter 7 A Semantic Web Primer

607 Topic Hierarchies Some “ontologies” do not deserve this name:
simply sets of terms, loosely organized in a hierarchy This hierarchy is typically not a strict taxonomy but rather mixes different specialization relations (e.g. is-a, part-of, contained-in) Such resources often very useful as starting point Example: Open Directory hierarchy, containing more then 400,000 hierarchically organized categories and available in RDF format Chapter 7 A Semantic Web Primer

608 Linguistic Resources Some resources were originally built not as abstractions of a particular domain, but rather as linguistic resources These have been shown to be useful as starting places for ontology development E.g. WordNet, with over 90,000 word senses Chapter 7 A Semantic Web Primer

609 Ontology Libraries Attempts are currently underway to construct online libraries of online ontologies Rarely existing ontologies can be reused without changes Existing concepts and properties must be refined using rdfs:subClassOf and rdfs:subPropertyOf Alternative names must be introduced which are better suited to the particular domain using owl:equivalentClass and owl:equivalentProperty We can exploit the fact that RDF and OWL allow private refinements of classes defined in other ontologies Chapter 7 A Semantic Web Primer

610 Lecture Outline Introduction Constructing Ontologies Manually
Reusing Existing Ontologies Semiautomatic Ontology Acquisition Ontology Mapping On-To-Knowledge SW Architecture Chapter 7 A Semantic Web Primer

611 The Knowledge Acquisition Bottleneck
Manual ontology acquisition remains a time-consuming, expensive, highly skilled, and sometimes cumbersome task Machine Learning techniques may be used to alleviate knowledge acquisition or extraction knowledge revision or maintenance Chapter 7 A Semantic Web Primer

612 Tasks Supported by Machine Learning
Extraction of ontologies from existing data on the Web Extraction of relational data and metadata from existing data on the Web Merging and mapping ontologies by analyzing extensions of concepts Maintaining ontologies by analyzing instance data Improving SW applications by observing users Chapter 7 A Semantic Web Primer

613 Useful Machine Learning Techniques for Ontology Engineering
Clustering Incremental ontology updates Support for the knowledge engineer Improving large natural language ontologies Pure (domain) ontology learning Chapter 7 A Semantic Web Primer

614 Machine Learning Techniques for Natural Language Ontologies
Natural language ontologies (NLOs) contain lexical relations between language concepts They are large in size and do not require frequent updates The state of the art in NLO learning looks quite optimistic: A stable general-purpose NLO exist Techniques for automatically or semi-automatically constructing and enriching domain-specific NLOs exist Chapter 7 A Semantic Web Primer

615 Machine Learning Techniques for Domain Ontologies
They provide detailed descriptions Usually they are constructed manually The acquisition of the domain ontologies is still guided by a human knowledge engineer Automated learning techniques play a minor role in knowledge acquisition They have to find statistically valid dependencies in the domain texts and suggest them to the knowledge engineer Chapter 7 A Semantic Web Primer

616 Machine Learning Techniques for Ontology Instances
Ontology instances can be generated automatically and frequently updated while the ontology remains unchanged Fits nicely into a machine learning framework Successful ML applications Are strictly dependent on the domain ontology, or Populate the markup without relating to any domain theory General-purpose techniques not yet available Chapter 7 A Semantic Web Primer

617 Different Uses of Ontology Learning
Ontology acquisition tasks in knowledge engineering Ontology creation from scratch by the knowledge engineer Ontology schema extraction from Web documents Extraction of ontology instances from Web documents Ontology maintenance tasks Ontology integration and navigation Updating some parts of an ontology Ontology enrichment or tuning Chapter 7 A Semantic Web Primer

618 Ontology Acquisition Tasks
Ontology creation from scratch by the knowledge engineer ML assists the knowledge engineer by suggesting the most important relations in the field or checking and verifying the constructed knowledge bases Ontology schema extraction from Web documents ML takes the data and meta-knowledge (like a meta-ontology) as input and generate the ready-to-use ontology as output with the possible help of the knowledge engineer Chapter 7 A Semantic Web Primer

619 Ontology Acquisition Tasks(2)
Extraction of ontology instances from Web documents This task extracts the instances of the ontology presented in the Web documents and populates given ontology schemas This task is similar to information extraction and page annotation, and can apply the techniques developed in these areas Chapter 7 A Semantic Web Primer

620 Ontology Maintenance Tasks
Ontology integration and navigation Deals with reconstructing and navigating in large and possibly machine-learned knowledge bases Updating some parts of an ontology that are designed to be updated Ontology enrichment or tuning This does not change major concepts and structures but makes an ontology more precise Chapter 7 A Semantic Web Primer

621 Potentially Applicable Machine Learning Algorithms
Propositional rule learning algorithms Bayesian learning generates probabilistic attribute-value rules First-order logic rules learning Clustering algorithms They group the instances together based on the similarity or distance measures between a pair of instances defined in terms of their attribute values Chapter 7 A Semantic Web Primer

622 Lecture Outline Introduction Constructing Ontologies Manually
Reusing Existing Ontologies Semiautomatic Ontology Acquisition Ontology Mapping On-To-Knowledge SW Architecture Chapter 7 A Semantic Web Primer

623 Ontology Mapping A single ontology will rarely fulfill the needs of a particular application; multiple ontologies will have to be combined This raises the problem of ontology integration (also called ontology alignment or ontology mapping) Current approaches deploy a whole host of different methods; we distinguish linguistic, statistical, structural and logical methods Chapter 7 A Semantic Web Primer

624 Linguistic methods The most basic methods try to exploit the linguistic labels attached to the concepts in source and target ontology in order to discover potential matches This can be as simple as basic stemming techniques or calculating Hamming distances, or it can use specialized domain knowledge (e.g. the difference between Diabetes Melitus type I and Diabetes Melitus type II is not a negligible difference to be removed by a small Hamming distance) Chapter 7 A Semantic Web Primer

625 Statistical Methods Some methods use instance data, to determine correspondences between concepts A significant statistical correlation between the instances of a source concept and a target concept, gives us reason to believe that these concepts are strongly related These approaches rely on the availability of a sufficiently large corpus of instances that are classified in both the source and the target ontologies Chapter 7 A Semantic Web Primer

626 Structural Methods Since ontologies have internal structure, it makes sense to exploit the graph structure of the source and the target ontologies and try to determine similarities, often in coordination with other methods If a source target and a target concept have similar linguistic labels, then the dissimilarity of their graph neighborhoods could be used to detect homonym problems where purely linguistic methods would falsely declare a potential mapping Chapter 7 A Semantic Web Primer

627 Logical Methods The most specific to mapping ontologies
A serious limitation of this approach is that many practical ontologies are semantically rather lightweight and thus don’t carry much logical formalism with them Chapter 7 A Semantic Web Primer

628 Ontology-Mapping Techniques Conclusion
Although there is much potential, and indeed need, for these techniques to be deployed for Semantic Web engineering, this is far from a well-understood area No off-the-shelf techniques are currently available, and it is not clear that this is likely to change in the near future Chapter 7 A Semantic Web Primer

629 Lecture Outline Introduction Constructing Ontologies Manually
Reusing Existing Ontologies Semiautomatic Ontology Acquisition Ontology Mapping On-To-Knowledge SW Architecture Chapter 7 A Semantic Web Primer

630 On-To-Knowledge Architecture
Building the Semantic Web involves using the new languages described in this course a rather different style of engineering a rather different approach to application integration We describe how a number of Semantic Web-related tools can be integrated in a single lightweight architecture using Semantic Web standards to achieve interoperability between tools Chapter 7 A Semantic Web Primer

631 Knowledge Acquisition
Initially, tools must exist that use surface analysis techniques to obtain content from documents Unstructured natural language documents: statistical techniques and shallow natural language technology Structured and semi-structured documents: wrappers induction, pattern recognition Chapter 7 A Semantic Web Primer

632 Knowledge Storage The output of the analysis tools is sets of concepts, organized in a shallow concept hierarchy with at best very few cross-taxonomical relationships RDF/RDF Schema are sufficiently expressive to represent the extracted info Store the knowledge produced by the extraction tools Retrieve this knowledge, preferably using a structured query language (e.g. RQL) Chapter 7 A Semantic Web Primer

633 Knowledge Maintenance and Use
A practical Semantic Web repository must provide functionality for managing and maintaining the ontology: change management access and ownership rights transaction management There must be support for both Lightweight ontologies that are automatically generated from unstructured and semi-structured data Human engineering of much more knowledge-intensive ontologies Chapter 7 A Semantic Web Primer

634 Knowledge Maintenance and Use (2)
Sophisticated editing environments must be able to Retrieve ontologies from the repository Allow a knowledge engineer to manipulate it Place it back in the repository The ontologies and data in the repository are to be used by applications that serve an end-user We have already described a number of such applications Chapter 7 A Semantic Web Primer

635 Technical Interoperability
Syntactic interoperability was achieved because all components communicated in RDF Semantic interoperability was achieved because all semantics was expressed using RDF Schema Physical interoperability was achieved because All communications between components were established using simple HTTP connections Chapter 7 A Semantic Web Primer

636 On-To-Knowledge System Architecture
Chapter 7 A Semantic Web Primer

637 Chapter 8 Conclusion and Outlook
Grigoris Antoniou Frank van Harmelen Chapter 8 A Semantic Web Primer

638 Lecture Outline Which Semantic Web? Four Popular Fallacies
Current Status Selected Key Research Challenges Chapter 8 A Semantic Web Primer

639 Interpretation 1: The Semantic Web as the Web of Data
The main aim of the Semantic Web is to enable the integration of structured and semistructured data sources over the Web The main recipe is to expose datasets on the Web in RDF format and to use RDF Schema to express the intended semantics of these datasets A typical use is the combination of geodata with a set of consumer ratings for restaurants in order to provide an enriched information source Chapter 8 A Semantic Web Primer

640 Interpretation 2: The Semantic Web as Enrichment of the Current Web
The aim of the Semantic Web is to improve the current World Wide Web Typical uses are : Improved search engines Dynamic personalization of Web sites Semantic enrichment of existing Web pages Chapter 8 A Semantic Web Primer

641 Interpretation 2: The Semantic Web as Enrichment of the Current Web (2)
The sources of the required semantic metadata are mostly claimed to be automated sources Concept extraction Named-entity recognition Automatic classification More recently the insight is gaining ground that the required semantic markup can also be produced by social mechanisms in communities that provide large-scale human-produced markup Chapter 8 A Semantic Web Primer

642 Lecture Outline Which Semantic Web? Four Popular Fallacies
Current Status Selected Key Research Challenges Chapter 8 A Semantic Web Primer

643 1. The semantic Web tries to enforce meaning from the top
This fallacy claims that the Semantic Web enforces meaning on users through its standards OWL and RDFS The only meaning that OWL and RDFS enforce is the meaning of the connectives in a language in which users can express their own meanings Users are free to choose their own vocabularies and to describe whatever domains the choose Chapter 8 A Semantic Web Primer

644 1. The semantic Web tries to enforce meaning from the top (2)
The situation is comparable to HTML: HTML does not enforce the lay-out of web-pages “from the top” All HTML enforces is the language that people can use to describe their own lay-out HTML has shown that such an agreement on the use of a standardized language is a necessary ingredient for world-wide interoperability Chapter 8 A Semantic Web Primer

645 2. Everybody must subscribe to a single predefined meaning for the terms they use
The meaning of terms cannot be predefined for global use in addition meaning is fluid and contextual The motto of the Semantic Web is not the enforcement of a single ontology but rather “let a thousand ontologies blossom” That is the reason that the construction of mappings between ontologies is such a core topic in the Semantic Web community Such mappings are expected to be partial, imperfect and context-dependent Chapter 8 A Semantic Web Primer

646 3. Users must understand the complicated details of formalized knowledge representation
Some of the core technology of the Semantic Web relies on intricate details of formalized knowledge representation The semantics of RDF Schema and OWL and the layering of the subspecies of OWL are difficult formal matters The design of good ontologies is a specialized area of Knowledge Engineering Chapter 8 A Semantic Web Primer

647 3. Users must understand the complicated details of formalized knowledge representation (2)
For most users of Semantic Web applications, such details will remain entirely behind the scene Navigation or personalization engines can be powered by underlying ontologies, expressed in RDF Schema or OWL, without users ever being confronted with the ontologies, let alone their representation languages Chapter 8 A Semantic Web Primer

648 4. The semantic Web requires the manual markup of all existing Web pages
It is hard enough for most Web site owners to maintain the human-readable content of their sites They will certainly not maintain parallel machine-accessible versions of the same information in RDF or OWL If that were necessary, it would indeed spell bad news for the Semantic Web Instead, Semantic Web application rely on large-scale automation for the extraction of such semantic markup from the sources themselves Chapter 8 A Semantic Web Primer

649 Lecture Outline Which Semantic Web? Four Popular Fallacies
Current Status Selected Key Research Challenges Chapter 8 A Semantic Web Primer

650 Four Main Questions Where do the metadata come from?
Where do the ontologies come from? What should be done with the many ontologies? Where’s the "Web " in Semantic Web? Chapter 8 A Semantic Web Primer

651 Question 1: Where do the metadata come from?
Much of the semantic metadata come from Natural Language Processing and Machine Learning technology It is now possible with off-the-shelf technology to produce semantic markup for very large corpuses of Web pages by annotating them with terms from very large ontologies with sufficient precision and recall to drive semantic navigation interfaces Chapter 8 A Semantic Web Primer

652 Question 1: Where do the metadata come from? (2)
More recent is the capability of social communities to provide large amounts of human-generated markup Millions of images with hundreds of million of manually provided metadata tags are found on some of the most popular Web 2.0 sites Chapter 8 A Semantic Web Primer

653 Question 2: Where do the ontologies come from?
The term ontology as used by the Semantic Web community now covers a wide array of semantic structures, from lightweight hierarchies such as MeSH to heavily axiomatized ontologies such as GALEN The world is full of such “ontologies”: Companies have product catalogs Organizations have internal glossaries Scientific communities have their public metadata schemata Chapter 8 A Semantic Web Primer

654 Question 2: Where do the ontologies come from? (2)
These have been constructed for other purposes, most often predating Semantic Web There are also significant advances in the area of ontology learning, although results there remain mixed Obtaining the concepts of an ontology is feasible given the appropriate circumstances, but placing them in the appropriate hierarchy with the right mutual relationships remains a topic of active research Chapter 8 A Semantic Web Primer

655 Question 3: What should be done with the many ontologies?
The Semantic Web crucially relies on the possibility of integrating multiple ontologies This is known as the problem of ontology alignment, ontology mapping, or ontology integration Chapter 8 A Semantic Web Primer

656 Question 3: What should be done with the many ontologies? (2)
A wide array of techniques is deployed for solving this problem Ontology-mapping techniques based on natural language technology Machine learning Theorem proving Graph theory Statistics Chapter 8 A Semantic Web Primer

657 Question 3: What should be done with the many ontologies? (3)
Although there are encouraging results, this problem is by no means solved Automatically obtained results are not yet good enough in terms of recall and precision to drive many of the intended Semantic Web use cases Ontology mapping is seen by many as the Achilles’ heel of the Semantic Web Chapter 8 A Semantic Web Primer

658 Question 4: Where’s the "Web " in Semantic Web?
Semantic Web has sometimes been criticized as being too much about “semantic” and not enough about “Web” This was perhaps true in the early days of Semantic Web development, when there was a focus on applications in rather circumscribed domains like intranets The main advantage of company intranets is that the ontology-mapping problem can be avoided Chapter 8 A Semantic Web Primer

659 Question 4: Where’s the "Web " in Semantic Web? (2)
Recent years have seen a resurgence in the Web aspects of Semantic Web applications A prime example is the deployment of FOAF technology, and of semantically organized P2P systems The Web is more than just a collection of textual documents Chapter 8 A Semantic Web Primer

660 Question 4: Where’s the "Web " in Semantic Web? (3)
Nontextual media such as images and videos are an integral part of the Web For the application of Semantic Web technology to such nontextual media we currently rely on human-generated semantic markup Deriving annotations through intelligent content analysis in images and videos is under way Chapter 8 A Semantic Web Primer

661 Main Application Areas
Looking at industrial events, either dedicated events or co-organized with the major international scientific Semantic Web conferences, we observe that a healthy uptake of Semantic Web technologies is beginning to take shape in the following areas : Knowledge management, mostly in intranets of large corporations Data integration (Boeing, Verizon, and other) E-science, in particular the life sciences Convergence with Semantic Grid Chapter 8 A Semantic Web Primer

662 Main Application Areas (2)
If we look at the profiles of companies active in this area, we see a transition from small start-up companies such as Aduna Ontoprise Network Inference Top Quadrant To large vendors such as IBM (Snobase ontology Management System) HP (Jena RDF platform) Adobe (RDF-based XMP metadata framework) Oracle (support for RDF storage and querying in their datavase product) Chapter 8 A Semantic Web Primer

663 Main Application Areas (3)
However, there is a noticeable lack of uptake in some other areas. In particular, the promise of the Semantic Web for Pesonalization Large-scale semantic search (on the scale of the World Wide Web) Mobility and context-awareness is largely unfulfilled Chapter 8 A Semantic Web Primer

664 Main Application Areas (4)
A difference that seems to emerge between the successful and unsuccessful application areas is that the successful are all aimed at closed communities, whereas the applications aimed at the general public are still in the laboratory phase at best The underlying reason for this could well be the difficulty of the ontology mapping Chapter 8 A Semantic Web Primer

665 Lecture Outline Which Semantic Web? Four Popular Fallacies
Current Status Selected Key Research Challenges Chapter 8 A Semantic Web Primer

666 Selected Key Research Challenges (1)
Several challenges that were outlined in 2002 article by van Harmelen have become active areas of research: Scale inference and storage technology, now scaling to the order of billions of RDF triples Ontology evolution and change Ontology mapping Chapter 8 A Semantic Web Primer

667 Selected Key Research Challenges (2)
A number of items on the research agenda, though hardly developed, have had a crucial impact on the feasibility of the Semantic Web vision: Interaction between machine-processable representations and the dynamics of social networks of human users Mechanisms to deal with trust, reputation, integrity and provenance in a semiautomated way Inference and query facilities that are sufficiently robust to work in the face of limited resources (computational time, network latency, memory, or storage space) and that can make intelligent trade-off decisions between resource use and output quality Chapter 8 A Semantic Web Primer


Download ppt "Chapter 1 The Semantic Web Vision"

Similar presentations


Ads by Google