Presentation is loading. Please wait.

Presentation is loading. Please wait.

Chapter 2 Describing Web Resources: RDF

Similar presentations


Presentation on theme: "Chapter 2 Describing Web Resources: RDF"— Presentation transcript:

1 Chapter 2 Describing Web Resources: RDF
Grigoris Antoniou Paul Groth Frank van Harmelen Rinke Hoekstra A Semantic Web Primer

2 Lecture Outline 2 Introduction RDF: Data Model RDF Syntaxes
RDFS: Adding Semantics RDF Schema: The Language RDF and RDF Schema in RDF Schema A Direct Inference System for RDF and RDFS Summary 2 Chapter 2 A Semantic Web Primer

3 Introduction The success of the Web has shown the power of having standard mechanisms to exchange and communicate information HTML is the standard language for writing Web pages It allows anyone to publish a document 3 Chapter 2 A Semantic Web Primer

4 Introduction HTML and any exchange language should have three components: a syntax, a data model, and a semantics The syntax tells us how to write data down The data model tells us the structure/organization of the data The semantics tells us how to interpret that data 4 Chapter 2 A Semantic Web Primer

5 A Snippet(片断)of HTML 5 <html> <head>
<title>Apartments for Rent</title> </head> <body> <ol> <li>Studio apartment on Florida Ave <li>3 bedroom Apartment on Baron Way </ol> </html> 5 Chapter 2 A Semantic Web Primer

6 Syntax, Data Model, and Semantics of HTML
The syntax of HTML is text with tags written using angle brackets(尖括号) The data model of HTML is known as the Document Object Model (DOM,文档对象模型), and defines the organization of these elements defined by tags into a hierarchical tree structure The semantics of HTML tell us how the browser should interpret the Web page All are defined within HTML standards 6 Chapter 2 A Semantic Web Primer

7 What does the Semantic Web need?
HTML was designed to communicate information about the structure of documents for human readers The Semantic Web needs a data model that can be used by multiple applications needs to be domain-independent(与特定领域无关的) The Semantic Web needs a mechanism to assign semantics to the information represented in this data model The Semantic Web needs a syntax 7 Chapter 2 A Semantic Web Primer

8 Resource Description Framework (RDF)
The basic building block of RDF is an entity-property-value triple(三元组), called a statement Examples include “The Baron Way Apartment is an Apartment”, and “The Baron Way Apartment is part of the Baron Way Building” RDF is domain independent so it is necessary for users to define the terminology they use in these statement This is where the RDF Schema (RDFS) comes in—it allows users to precisely define how their vocabulary should be interpreted 8 Chapter 2 A Semantic Web Primer

9 A Standard Language for Exchanging Data
Together, these technologies define the components of a standard language for exchanging arbitrary data between machines: Turtle/RDFa/RDF-XML – the syntax RDF – the data model RDFS – the semantics Note that RDF is primarily the data model within this language, it is often used as the name for the whole of it 9 Chapter 2 A Semantic Web Primer

10 Lecture Outline 10 Introduction RDF: Data Model RDF Syntaxes
RDFS: Adding Semantics RDF Schema: The Language RDF and RDF Schema in RDF Schema A Direct Inference System for RDF and RDFS Summary 10 Chapter 2 A Semantic Web Primer

11 Resources The fundamental(重要的)concepts of RDF are resources(资源), properties(属性), statements (陈述), and graphs(图) We can think of a resource as an object, a “thing” we want to talk about E.g. authors, books, publishers, places, people, hotels, etc. 11 Chapter 2 A Semantic Web Primer

12 Resources Every resource has a URI, a Uniform Resource Identifier(统一资源标识符)and a URI can be a URL (Uniform Resource Locator, or Web address) or another kind of unique(唯一的)identifier URI schemes(方案)have been defined not only for Web locations, but also for other unique identifiers e.g. ISBN numbers, telephone numbers, and geographical locations 12 Chapter 2 A Semantic Web Primer

13 URI Schemes The URI scheme provides a mechanism to unambiguously(清楚地)identify the “thing” we want to talk about, solving the homonym(同音异义 字)problem,例如light(光或轻的)、vain(徒劳 的)和vein(静脉) Using dereferenceable URIs for resource identifiers is considered good practice, enabling the retrieval of a resource itself or a further description of that resource 13 Chapter 2 A Semantic Web Primer

14 Dereferenceable URI – definition from Wikipedia
A dereferenceable(可解引用的)URI is a resource retrieval mechanism that uses any of the internet protocols (e.g. HTTP) to obtain a copy or representation of the resource it identifies. In the context of traditional HTML web pages, a URI refers to the page, and when requested the web server returns a copy of it,e.g. 14 Chapter 2 A Semantic Web Primer

15 Dereferenceable URI – definition from Wikipedia
In other non-dereferenceable contexts, such as XML Schema, the namespace identifier is still a URI, but this is simply an identifier (i.e. a namespace name). There is no intention that this can or should be dereferenced, e.g. <h:table> 15 Chapter 2 A Semantic Web Primer

16 Dereferenceable URI – definition from Wikipedia
In the case of Linked Data, the representation takes the form of a document (typically HTML or XML) that describes the resource that the URI identifies. In either case, the mechanism makes it possible for a user (or software agent) to "follow your nose" to find out more information related to the identified resource. 16 Chapter 2 A Semantic Web Primer

17 Properties 17 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 We can dereference property URIs to find their descriptions 17 Chapter 2 A Semantic Web Primer

18 Statements 18 Statements assert(断言)the properties of resources
A statement is an entity-attribute-value triple (实体-属性-值三元组,we often use the word subject to refer to the entity and object to refer to its value) It consists of a resource, a property, and a value Values can be resources or literals(文字类型) Literals are atomic values (strings, numbers, or dates) 18 Chapter 2 A Semantic Web Primer

19 An Example RDF Statement
“Baron Way Building is located in Amsterdam.” We can write this as: < < < 19 Chapter 2 A Semantic Web Primer

20 Graphs 20 We can write this same statement down graphically Baron Way
Building Amsterdam Location We can write this same statement down graphically Labeled nodes are connected by labeled arcs Arcs are directed from subject to object of the statement Labels on the nodes are identifiers of subject and object and labels on the arcs are identifiers of property 20 Chapter 2 A Semantic Web Primer

21 Graphs The graphical representation highlights the notion that RDF is graph-centric(以图形为中心的) The graph can be expanded with more information and can be created in a distributed fashion by multiple different participants, allowing knowledge to be reused Chapter 2 A Semantic Web Primer

22 Linked Data Principles
A set of best practices encourage us to reuse and make available information to help create a global graph Use URIs as names for things Use HTTP URIs so that people can look up those names When someone looks up a URI, provide useful information using the standards (RDF) Include links to other URIs so that they can discover more things Chapter 2 A Semantic Web Primer

23 Pointing to Statements and Graphs
Sometimes it is useful to be able to point to particular statements and parts of graphs e.g. we may want to say that the statement about the location of the Baron Way Building was created by a person, Frank. One mechanism for doing so is reification(具体化) The key idea is to introduce an auxiliary(辅助的)object and relates it to the three components of the original statement through the properties subject, predicate, and object Chapter 2 A Semantic Web Primer

24 An Example of Reification
Frank Location Statement Creator location Amsterdam Baron Way Building subject predicate object Chapter 2 A Semantic Web Primer

25 Reification Only triples are allowed in RDF, so this rather cumbersome(繁杂的、不方便的)approach is necessary The notion of named graphs(命名图)was introduced in newer versions of RDF An explicit identifier can be given to a statement or a set of statements This identifier can then be referred to in normal triples Chapter 2 A Semantic Web Primer

26 Dealing with Richer Predicates
We can think of a triple (x, P, y) as a logical formula(逻辑公式) P(x, y) where P is a binary predicate(二元谓词) RDF offers only binary predicates For certain cases in which we may need more than two arguments, we can use binary predicates to simulate such predicates Chapter 2 A Semantic Web Primer

27 Binary Predicates to Simulate Predicates with Three Arguments
The intuitive meaning of broker(X,Y,Z) is X is the broker in a home sale between seller Y and buyer Z We introduce a new auxiliary resource home-sale and binary predicates broker, seller, and buyer broker(X,Y,Z) can be represented as follows: Broker(home-sale, X) Seller(home-sale, Y) Buyer(home-sale, Z) Chapter 2 A Semantic Web Primer

28 Lecture Outline 28 Introduction RDF: Data Model RDF Syntaxes
RDFS: Adding Semantics RDF Schema: The Language RDF and RDF Schema in RDF Schema A Direct Inference System for RDF and RDFS Summary 28 Chapter 2 A Semantic Web Primer

29 RDF Syntaxes 29 We have already introduced a graphical syntax
neither machine interpretable nor standardized Terse RDF Triple Language (Turtle) is a standard machine interpretable syntax Text-based syntax for RDF File extension used for Turtle text file is “.ttl” 29 Chapter 2 A Semantic Web Primer

30 An Example Statement in Turtle
< < < URLs are enclosed in angle brackets The subject, predicate, and object appear in order, followed by a period We can write a whole RDF graph using this approach 30 Chapter 2 A Semantic Web Primer

31 Literals In Turtle, we can write literals down by simply enclosing the values in quotes and appending it with the data type of the value The data type tells us how to interpret a value Data types are expressed as URLs It is recommended to use the data type defined by XML Schema 31 Chapter 2 A Semantic Web Primer

32 Common Data Types Expressed using Turtle
string — “Baron Way” integers — “1”^^< decimals — “1.23”^^< dates — “ ”^^< time — “11:24:00” ^^< date with a time — “ T11:24:00” ^^< 32 Chapter 2 A Semantic Web Primer

33 Using Data Types in Statement
Suppose we want to add to our graph that the Baron Way Apartment has three bedrooms < < “3”^^< 33 Chapter 2 A Semantic Web Primer

34 Abbreviations In our example, we define resources Baron Way Apartment and Baron Way Building at the same URL This URL is the namespace of those resources Turtle takes advantage of this convention to allow URLs to be abbreviated syntax to define short stand-ins (qualified names) for particular namespaces 34 Chapter 2 A Semantic Web Primer

35 Abbreviations @prefix swp: < @prefix dbpedia: < @prefix dbpedia-owl: < @prefix xsd: < swp:BaronWayApartment swp:hasNumberOfBedrooms “3”^^<xsd:integer>. swp:BaronWayApartment swp:isPartOf swp:BaronWayBuilding. swp:BaronWayBuilding dbpedia-owl:location dbpedia:Amsterdam. 35 Chapter 2 A Semantic Web Primer

36 Abbreviations Turtle allows us not to repeat particular subjects when they are used repeatedly @prefix swp: < @prefix dbpedia: < @prefix dbpedia-owl: < @prefix xsd: < swp:BaronWayApartment swp:hasNumberOfBedrooms “3”^^<xsd:integer>; swp:isPartOf swp:BaronWayBuilding. swp:BaronWayBuilding dbpedia-owl:location dbpedia:Amsterdam. 36 Chapter 2 A Semantic Web Primer

37 Abbreviations 37 If both a subject and predicate are used repeatedly,
@prefix swp: < @prefix dbpedia: < @prefix dbpedia-owl: < @prefix xsd: < swp:BaronWayApartment swp:hasNumberOfBedrooms “3”^^<xsd:integer>; swp:isPartOf swp:BaronWayBuilding. swp:BaronWayBuilding dbpedia-owl:location dbpedia:Amsterdam, dbpedia:Netherlands. 37 Chapter 2 A Semantic Web Primer

38 Abbreviations 38 Turtle allows us to abbreviate common data types
@prefix swp: < @prefix dbpedia: < @prefix dbpedia-owl: < @prefix xsd: < swp:BaronWayApartment swp:hasNumberOfBedrooms 3; swp:isPartOf swp:BaronWayBuilding. swp:BaronWayBuilding dbpedia-owl:location dbpedia:Amsterdam, dbpedia:Netherlands. 38 Chapter 2 A Semantic Web Primer

39 Named Graphs For example, we might want to say that our statements about the Baron Way Apartments were created by a person, Frank,identified by the URL We can put brackets around the set of statements we want and assign a URL to that set of statements 39 Chapter 2 A Semantic Web Primer

40 An Example of Named Graphs
@prefix swp: < @prefix dbpedia: < @prefix dbpedia-owl: < @dc: < { < dc: creator < } default graph 40 Chapter 2 A Semantic Web Primer

41 An Example of Named Graphs
< { swp:BaronWayApartment swp:hasNumberOfBedrooms 3; swp:isPartOf swp:BaronWayBuilding. swp:BaronWayBuilding dbpedia-owl:location dbpedia:Amsterdam, dbpedia:Netherlands. } 41 Chapter 2 A Semantic Web Primer

42 RDF/XML 42 RDF/XML is an encoding of RDF in XML language
allows RDF to be used with existing XML processing tools Subjects are denoted by the rdf:about within an rdf:Description element <rdf:Description rdf:about=“ Predicates and objects related to that subject are enclosed in the rdf:Description element 42 Chapter 2 A Semantic Web Primer

43 An Example of RDF/XML 43 <?xml version=“1.0” encoding=“utf-8”?>
<rdf:RDF xmlns:dbpedia-owl=“ xmlns:dbpedia=“ xmlns:rdf=“ xmlns:swp=“ <rdf:Description rdf:about=“ 43 Chapter 2 A Semantic Web Primer

44 An Example of RDF/XML <swp:hasNumberOfBedrooms rdf:datatype=“ </swp:hasNumberOfBedrooms> </rdf:Description> <rdf:Description rdf:about=“ <swp:isPartOf rdf:resource=“ </rdf:RDF> 44 Chapter 2 A Semantic Web Primer

45 RDFa One use case of RDF is to describe or mark up the content of HTML Web pages RDFa syntax was introduced to make it easier embeds RDF within the attributes of HTML tags We will use an example of advertisement for the Baron Way Apartment 45 Chapter 2 A Semantic Web Primer

46 Web page without any machine readable description
<html> <body> <H1> Baron Way Apartment for Sale </H1> The Baron Way Apartment has three bedrooms and is located in the family friendly Baron Way Building. The Building is located in the north of Amsterdam. </body> </html> 46 Chapter 2 A Semantic Web Primer

47 Mark up Web page with RDFa
<html xmlns:dbpedia-owl=“ xmlns:dbpedia=“ xmlns:swp=“ xmlns:geo=“ > <body> <H1> Baron Way Apartment for Sale </H1> 47 Chapter 2 A Semantic Web Primer

48 Mark up Web page with RDFa
<div about=“[swp:BaronWayApartment]”> The Baron Way Apartment has <span property=“swp:hasNumberOfBedrooms”>3</span> three bedrooms and is located in the family friendly <span rel=“swp:isPartOf” resource=“[swp:BaronWayBuilding]”>Baron Way Building</span>. 48 Chapter 2 A Semantic Web Primer

49 Mark up Web page with RDFa
<div about=“[swp:BaronWayBuilding]”> The Building is located in the north of Amsterdam. <span rel=“dbpediaowl:location” resource=“[dbpedia:Amsterdam]”></span> <span rel=“dbpediaowl:location” resource=“[dbpedia:Netherlands]”></span> </div> </body> </html> 49 Chapter 2 A Semantic Web Primer

50 RDFa 50 RDFa will produce the same RDF as expressed previously
RDF is encoded in tags so will not be rendered by browsers In some cases, we use brackets to inform the parser prefixes are being used How to identify the subject, predicate, and object? 50 Chapter 2 A Semantic Web Primer

51 Lecture Outline 51 Introduction RDF: Data Model RDF Syntaxes
RDFS: Adding Semantics RDF Schema: The Language RDF and RDF Schema in RDF Schema A Direct Inference System for RDF and RDFS Summary 51 Chapter 2 A Semantic Web Primer

52 RDF Schema: Adding Semantics
RDF is a universal language that lets users describe resources in their own vocabularies RDF does not make assumption about any particular domain, nor does it define semantics of any domain The user can do so in RDF Schema using: classes and properties class hierarchies(层次)and inheritance(继承) property hierarchies 52 Chapter 2 A Semantic Web Primer

53 Classes and their Instances
When describing a particular domain, we must distinguish between Concrete “things” (individual objects) in the domain: Discrete Maths, David Billington etc. Classes that define the type of objects: 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 defined through rdf:type 53 Chapter 2 A Semantic Web Primer

54 Why Classes are Useful An important use of classes is to impose restrictions on what can be stated in an RDF document using the schema As in programming languages, typing is used to disallow nonsense from being stated e.g. A + 1, where A is an array The same is needed in RDF 54 Chapter 2 A Semantic Web Primer

55 Nonsensical Statements disallowed through the Use of Classes
Baron Way Apartment rents Jeff Meyer Buildings do not rent people Restriction on values of the property “rents” (range restriction,值域限制) Amsterdam has the number of bedrooms 3 Cities do not have bedrooms This imposes a restriction on the objects to which the property can be applied (domain restriction, 定义域限制) 55 Chapter 2 A Semantic Web Primer

56 Class Hierarchies 56 Classes can be organized 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, e.g. class A is a subclass of both B1 and B2 56 Chapter 2 A Semantic Web Primer

57 Class Hierarchy Example
Unit Commercial Residential Office Apartment House 57 Chapter 2 A Semantic Web Primer

58 Inheritance in Class Hierarchies
Range restriction: People can only rent residential units Baron Way Apartment is an apartment and does not qualify as a Residential unit --- no statement specifies that it is a residential unit Baron Way Apartment inherits the ability to be rented from the class of residential units This is done in RDF Schema by fixing the semantics of “is a subclass of” 58 Chapter 2 A Semantic Web Primer

59 Property Hierarchies 59 Hierarchical relationships for properties
e.g., “rents” is a subproperty of “resides at” If a person p rents a residential unit r, then p also resides at r The converse is not necessarily true e.g., p may be a child living with a family and not paying rent, or a visitor P is a subproperty of Q, if Q(x,y) is true whenever P(x,y) is true 59 Chapter 2 A Semantic Web Primer

60 RDF Layer vs RDF Schema Layer
Consider the RDF statement Jeff Meyer rents the Baron Way Apartment The schema for this statement contain classes such as person, apartments, houses, and units, properties such as rents, resides at, or address The schema is itself written in a formal language, RDF Schema, that can express its ingredients: subClassOf, Class, Property, subPropertyOf, Resource, etc. 60 Chapter 2 A Semantic Web Primer

61 61 Literal address residesAt Residential rents Unit Apartment House
Person domain subPropertyOf Residential Unit Apartment House subClassOf range address Literal Jeff Meyer Baron Way RDFS RDF 61

62 Lecture Outline 62 Introduction RDF: Data Model RDF Syntaxes
RDFS: Adding Semantics RDF Schema: The Language RDF and RDF Schema in RDF Schema A Direct Inference System for RDF and RDFS Summary 62 Chapter 2 A Semantic Web Primer

63 RDF Schema: The Language
The modeling primitives(建模原语)of RDF Schema are defined using resources and properties (RDF itself is used!) To declare that “apartment” is a subclass of “residential unit” Define resources apartment, residential unit, and subClassOf Define property subClassOf (属性是特殊的资源!) Write triple (apartment, subClassOf, residential unit) We use one of the standard syntaxes for RDF 63 Chapter 2 A Semantic Web Primer

64 Core Classes 64 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 64 Chapter 2 A Semantic Web Primer

65 Core Properties for Defining Relationships
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 65 Chapter 2 A Semantic Web Primer

66 Core Properties for Restricting Properties
rdfs:domain, which specifies the domain(定义域)of a property P and states that any resource that have a given property is an instance of the domain classes If the domain is not specified, then any resource can be the subject rdfs:range, which specifies the range(值域)of a property P and states that the value of a given property is an instance of the range classes 66 Chapter 2 A Semantic Web Primer

67 Examples 67 swp:address rdfs:domain swp:Unit.
swp:address rdfs:range rdf:Literal. 67 Chapter 2 A Semantic Web Primer

68 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 68 Chapter 2 A Semantic Web Primer

69 Useful Properties for Reification
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 69 Chapter 2 A Semantic Web Primer

70 Container(容器)Classes
rdf:Bag, the class of bags, an unordered container(无序容器), allowing multiple occurrences e.g. members of the faculty board, documents in a folder rdf:Seq, the class of sequences, 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) 70 Chapter 2 A Semantic Web Primer

71 Container Classes 71 rdf:Alt, the class of alternatives
e.g. the document home and mirrors, translations of a document in various languages rdfs:Container, which is a superclass of all container classes, including the three above 71 Chapter 2 A Semantic Web Primer

72 Example for a Bag 72 <rdf:Description rdf:ID="949352">
<rdf:type rdf:resource=" ns#Professor"/> <uni:name>Grigoris Antoniou</uni:name> <uni:coursesTaught> <rdf:Bag> <rdf:_1 rdf:resource="#CIT1112"/> <rdf:_2 rdf:resource="#CIT3116"/> </rdf:Bag> </uni:coursesTaught> </rdf:Description> 72 Chapter 2 A Semantic Web Primer

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

74 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 74 Chapter 2 A Semantic Web Primer

75 Example: Housing @prefix swp: < @prefix rdf: < @prefix rdfs: < swp:Person rdf:type rdfs:Class. swp:Person rdfs:comment “The class of people”. swp:Unit rdf:type rdfs:Class. swp:Unit rdfs:comment “A self-contained section of accommodations in a larger building or group of buildings.”. 75 Chapter 2 A Semantic Web Primer

76 Example: Housing 76 swp:ResidentialUnit rdf:type rdfs:Class.
Swp:ResidentialUnit rdfs:subClassOf swp:Unit. swp:Unit rdfs:comment “The class of all units or places where people live.”. swp:residesAt rdf:type rdfs:Property. swp:resideAt rdfs:comment “Relates persons to their residence.”. swp:resideAt rdfs:domain swp:Person. swp:resideAt rdfs:range swp:ResidentialUnit. 76 Chapter 2 A Semantic Web Primer

77 Example: Housing 77 swp:rents rdf:type rdfs:Property.
swp:rents rdfs:comment “It inherits its domain (swp:Person) and range (swp:ResidentialUnit) from its superproperty (swp:resideAt).”. swp:rents rdfs:subPropertyOf swp:resideAt. 77 Chapter 2 A Semantic Web Primer

78 Class Hierarchy for the Motor Vehicles Example
78 Chapter 2 A Semantic Web Primer

79 A Simple Ontology of Motor Vehicles
@prefix rdf: < @prefix rdfs: < <#miniVan> rdf:type rdfs:Class; rdfs:subClassOf <#passengerVehicle>, <#van>. <#motorVehicle> rdf:type rdfs:Class. <#passengerVehicle> rdf:type rdfs:Class; rdfs:subClassOf <#motorVehicle>. 79 Chapter 2 A Semantic Web Primer

80 Lecture Outline 80 Introduction RDF: Data Model RDF Syntaxes
RDFS: Adding Semantics RDF Schema: The Language RDF and RDF Schema in RDF Schema A Direct Inference System for RDF and RDFS Summary 80 Chapter 2 A Semantic Web Primer

81 The Namespace of RDF 81 <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"/> 81 Chapter 2 A Semantic Web Primer

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

83 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> 83 Chapter 2 A Semantic Web Primer

84 The Namespace of RDF Schema
<rdf:Property rdf:ID="subPropertyOf"> <rdfs:domain rdf:resource="&rdf;Property"/> <rdfs:range rdf:resource="&rdf;Property"/> </rdf:Property> <rdf:Property rdf:ID="subClassOf"> <rdfs:domain rdf:resource="#Class"/> <rdfs:range rdf:resource="#Class"/> 84 Chapter 2 A Semantic Web Primer

85 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 document If it could RDF Schema would be unnecessary External definition of semantics required Respected by RDF/RDFS processing software 85 Chapter 2 A Semantic Web Primer

86 Lecture Outline 86 Introduction RDF: Data Model RDF Syntaxes
RDFS: Adding Semantics RDF Schema: The Language RDF and RDF Schema in RDF Schema A Direct Inference System for RDF and RDFS Summary 86 Chapter 2 A Semantic Web Primer

87 Semantics based on Inference Rules
RDF has been given a semantics in terms of RDF triples instead of restating RDF in terms of first-order logic … and a sound and complete inference system 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 87 Chapter 2 A Semantic Web Primer

88 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) 88 Chapter 2 A Semantic Web Primer

89 Examples of Inference Rules
IF E contains the triples (?x,?p,?y) and (?p,rdfs:range,?u) THEN E also contains the triple (?y,rdf:type,?u) 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 89 Chapter 2 A Semantic Web Primer

90 Lecture Outline 90 Introduction RDF: Data Model RDF Syntaxes
RDFS: Adding Semantics RDF Schema: The Language RDF and RDF Schema in RDF Schema A Direct Inference System for RDF and RDFS Summary 90 Chapter 2 A Semantic Web Primer

91 Summary RDF provides a foundation for representing and processing machine readable metadata RDF has a graph-based data model RDF has three standard syntaxes (Turtle, RDF/XML, and RDFa) to support syntactic interoperability RDF has a decentralized philosophy and allows incremental building of knowledge, and its sharing and reuse 91 Chapter 2 A Semantic Web Primer

92 Summary 92 RDF is domain-independent
- RDF Schema provides a mechanism for describing specific domains RDF Schema is a primitive ontology language It offers certain modeling primitives with fixed meaning Key concepts of RDF Schema are class, subclass relations, property, subproperty relations, and domain and range restrictions 92 Chapter 2 A Semantic Web Primer

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


Download ppt "Chapter 2 Describing Web Resources: RDF"

Similar presentations


Ads by Google