Download presentation
Presentation is loading. Please wait.
Published byAugustine Fleming Modified over 9 years ago
1
Semantic Web for the Working Ontologist Dean Allemang Jim Hendler SNU IDB laboratory
2
Semantic Web for the Working OntologistDean Allemang, Jim Hendler Working Ontology Contents 2 ■ Chapter 1 What is the Semantic Web? ■ Chapter 2 Semantic Modeling ■ Chapter 3 RDF-The Basis of the semantic Web ■ Chapter 4 Semantic Web Application Architecture ■ Chapter 5 RDF and Inferencing ■ Chapter 6 RDF Schema ■ Chapter 7 RDFS-Plus ■ Chapter 8 Using RDFS-Plus in the Wild ■ Chapter 9 Basic OWL ■ Chapter 10 Counting and Sets in OWL ■ Chapter 11 Using OWL in the Wild ■ Chapter 12 Good and Bad Modeling Practices ■ Chapter 13 OWL Levels and Logic
3
Semantic Web for the Working OntologistDean Allemang, Jim Hendler Chapter 3 RDF – The Basis of the Semantic Web ■ 1. Distributing Data Across the Web ■ 2. Merging Data from Multiple Sources ■ 3. Namespaces, URIs, and Identity 3.1. Expressing URIs in Print 3.2. Standard Namespaces ■ 4. Identifiers in the RDF Namespace ■ 5. Challenge: RDF and Tabular Data ■ 6. Higher-Order Relationships ■ 7. Alternatives for Serialization 7.1. N-Triples 7.2. Notation 3 RDF (N3) 7.3. RDF/XML ■ 8. Blank Nodes 8.1. Ordered Information in RDF 3
4
Semantic Web for the Working OntologistDean Allemang, Jim Hendler Introduction: Semantics ■ The most primitive part of this notion of semantics is a representation of the linkage of a term in a statement to the entity in the world that the term refers to 4 apple Real World Web
5
Semantic Web for the Working OntologistDean Allemang, Jim Hendler Introduction: Semantics ■ In the Semantic Web we refer to the things in the world as resources ■ Resource ≈ Entity, Thing Can be anything that someone might want to talk about ■ RDF = Resource Description Framework 5 resource RDF
6
Semantic Web for the Working OntologistDean Allemang, Jim Hendler 1. Distributing Data across the Web IDTitleAuthorMediumYear 1As You Like ItShakespearePlay1599 2HamletShakespearePlay1604 3OthelloShakespearePlay1603 4“Sonnet 78”ShakespearePoem1609 5Astrophil and StellaSir Phillip SidneyPoem1590 6Edward llChristopher MarlowePlay1592 7Hero and LeanderChristopher MarlowePoem1593 8GreensleevesHenry Vlll RexSong1525 Tabular Data about Elizabethan Literature and Music Let’s consider a few different strategies for how this data could be distributed over the Web! 6
7
Semantic Web for the Working OntologistDean Allemang, Jim Hendler 1. Distributing Data across the Web: row by row 1As You Like ItShakespearePlay1599 5Astrophil and StellaSir Phillip SidneyPoem1590 6Edward llChristopher MarlowePlay1592 7Hero and LeanderChristopher MarlowePoem1593 8GreensleevesHenry Vlll RexSong1525 7
8
Semantic Web for the Working OntologistDean Allemang, Jim Hendler 1. Distributing Data across the Web: row by row ■ “row by row” distribution solution provides considerable flexibility Since the machines can share the load of representing information about several individuals But because it is a distributed representation of data, it requires some coordination between the servers ■ In particular, each server must share information about the columns 8
9
Semantic Web for the Working OntologistDean Allemang, Jim Hendler 9 1. Distributing Data across the Web: column by column Title As You Like It Hamlet Othello “Sonnet 78” Astrophil and Stella Edward ll Hero and Leander Greensleeves Author Shakespeare Sir Phillip Sidney Christopher Marlowe Henry Vlll Rex MediumYear Play1599 Play1604 Play1603 Poem1609 Poem1590 Play1592 Poem1593 Song1525
10
Semantic Web for the Working OntologistDean Allemang, Jim Hendler 1. Distributing Data across the Web: column by column ■ “row by row” distribution solution (also flexible in a different way) Each server is responsible for one or more complete from original table If we are not interested in the dates of publication, we needn’t consider information from that server ■ It requires some coordination between the servers The coordination has to do with the identities of the entities to be described It requires a global identifier for the entities being described 10
11
Semantic Web for the Working OntologistDean Allemang, Jim Hendler 1. Distributing Data across the Web: cell by cell Medium Row 7Poem Medium Row 6Play Title Row 2Hamlet Author Row 4Shakespeare 11
12
Semantic Web for the Working OntologistDean Allemang, Jim Hendler 1. Distributing Data across the Web: cell by cell ■ “cell by cell” distribution solution (this strategy is taken by RDF) Each machine is responsible for some number of cells in the table This system combines the flexibility of both of the previous strategies (row by row + column by column) Share the description of a single entity (row by row) + Share the use of a particular property (column by column) ■ But this solution also combines the costs of the other two strategies Need a global reference for the column headings Need a global reference for the rows 12
13
Semantic Web for the Working OntologistDean Allemang, Jim Hendler 1. Distributing Data across the Web: cell by cell ■ Each cell has to be presented with three values Triple A global reference for the row A global reference for the column Value in the cell it self ■ Basic building block for RDF is triple Identifier for the row is subject of the triple Identifier for the column is predicate of the triple Value is object of the triple 13 SubjectPredicateObject Row 2TitleHamlet Row 7MediumPoem Row 4AuthorShakespeare Row 6MediumPlay
14
Semantic Web for the Working OntologistDean Allemang, Jim Hendler 1. Distributing Data across the Web: cell by cell SubjectPredicateObject ShakespeareWroteKing Lear ShakespeareWroteMacbeth Anne HathawayMarriedShakespeare Lived inStratford Is inEngland MacbethSet inScotland EnglandPart ofThe UK ScotlandPart ofThe UK Shakespeare Macbeth Stratford England King Lear Anne Hathaway Sample Triples Scotland UK married wrote lived in set in is in part of 14
15
Semantic Web for the Working OntologistDean Allemang, Jim Hendler 2. Merging Data from Multiple Sources ■ Section 1: a way to distribute data over several sources ■ Section 2: merge those sources back together again Triples representation is easy to merge Taken together all of the triples from each individual RDF graph 15 UK England Northern Ireland Wales Scotland Shakespeare Winter Tale Henry V The Tempest Macbeth King Lear part of wrote
16
Semantic Web for the Working OntologistDean Allemang, Jim Hendler 2. Merging Data from Multiple Sources 16 UK England Northern Ireland Wales Scotland Shakespeare Winter Tale Henry V The Tempest Macbeth King Lear part of wrote Stratford LivedIn IsIn setIn
17
Semantic Web for the Working OntologistDean Allemang, Jim Hendler 3. Namespaces, URIs, and Identity “When is a node in one graph the same node as a node in another graph?” ■ In RDF, Uniform Resource Identifiers (URIs) A URI provides a global identification for a resource URL is just a special case of the URI 17 ShakespeareKing Lear wrote Http://www.sample.com/shakespeare.owl#Shakespeare Http://www.sample.com/shakespeare.owl#wrote Http://www.sample.com/shakespeare.owl#KingLear Shakespeare wrote KingLear
18
Semantic Web for the Working OntologistDean Allemang, Jim Hendler 3.1. Expressing URIs in Print ■ URI work very well for expressing identity on the WWW But it is too detail, long.. ■ So we use a simplified version of a URI abbreviation scheme called qnames A namespace and an identifier written with a colon Qnames are not global identifiers 18 Http://www.sample.com/geography.owl#England geo:England
19
Semantic Web for the Working OntologistDean Allemang, Jim Hendler 3.1. Expressing URIs in Print SubjectPredicateObject lit:Shakespeare lit:wrote lit:KingLear lit:Shakespeare lit:wrote lit:Macbeth bio:AnneHathaway bio:married lit:Shakespeare bio:AnneHathaway bio:livedWith lit:Shakespeare bio:livedIn geo:Stratford geo:isIn geo:England geo:part of geo:UK geo:Scotland geo:partOf geo:UK Triples Referring to URIs with a Variety of Namespaces lit stands for http://www.WorkingOntologist.org/Examples/Chapter3/Shakepeare.owl# geo stands for http://www.WorkingOntologist.org/Examples/Chapter3/geography.owl# bio stands for http://www.WorkingOntologist.org/Examples/Chapter3/biography.owl# 19
20
Semantic Web for the Working OntologistDean Allemang, Jim Hendler 3.2. Standard Namespaces ■ Using the URI as a standard for global identifiers allows for a worldwide reference for any symbol ■ W3C standards provide definitions for terms ex) type, subClassOf, Class, inverseOf, … ■ W3C defined standard namespaces ex) xsd: XML schema definition xmlns: XML namespace.. 20
21
Semantic Web for the Working OntologistDean Allemang, Jim Hendler 3.2. Standard Namespaces ■ rdf: Indicates identifiers used in RDF Set of identifiers is used to define types and properties in RDF Http://www.w3.org/1999/02/22-rdf-syntax.ns# ■ rdfs: Indicates identifiers used for the RDF Schema Language Http://www.w3.org/2000/01/rdf-schema# ■ owl: Indicates identifiers used for the Web Ontology Language Http://www.w3.org/2002/07/owl# 21
22
Semantic Web for the Working OntologistDean Allemang, Jim Hendler 4. Identifiers in the RDF Namespace ■ rdf:type Provides an elementary typing system in RDF ■ Types can have types SubjectPredicateObject lit:Shakespeare rdf:type lit:Playwrite lit:Ibsen rdf:type lit:Playwrite lit:Simon rdf:type lit:Playwrite lit:Miller rdf:type lit:Playwrite SubjectPredicateObject lit:Playwrite rdf:type lit:Profession rdf:type lit:Compensation 22
23
Semantic Web for the Working OntologistDean Allemang, Jim Hendler 4. Identifiers in the RDF Namespace ■ rdf:Property Identifier is used as a predicate rather than as a subject or an object SubjectPredicateObject lit:wrote rdf:type rdf:Property geo:part of rdf:type rdf:Property bio:married rdf:type rdf:Property bio:livedIn rdf:type rdf:Property bio:livedWith rdf:type rdf:Property geo:Isin rdf:type rdf:Property rdf:Property Assertions 23
24
Semantic Web for the Working OntologistDean Allemang, Jim Hendler 5. Challenge: RDF and Tabular Data ■ ID is a locally unique identifier ■ We need a globally unique identifier ■ Let us call that namespace mfg: ■ Identifiers ex) mfg:Product1, mfg:Product2, … ■ Properties ex) mfg:Product_ModelNo, mfg:Proudct_Division, … 24
25
Semantic Web for the Working OntologistDean Allemang, Jim Hendler 5. Challenge: RDF and Tabular Data SubjectPredicateObject mfg:Product1 mfg:Product_ID 1 mfg:Product1 mfg:Product_ModelNo ZX-3 mfg:Product1 mfg:Product_Division Manufacturing Support mfg:Product1 mfg:Product_Product_Line Paper Machine mfg:Product1 mfg:Product_Manufacture_Location Scramento mfg:Product1 mfg:Product_SKU FB3524 mfg:Product1 mfg:Product_Available 23 mfg:Product2 mfg:Product_ID 2 ……… Triples Representing Some of the Data 25
26
Semantic Web for the Working OntologistDean Allemang, Jim Hendler 5. Challenge: RDF and Tabular Data SubjectPredicateObject mfg:Product1rdf:typemfg:Product mfg:Product2rdf:typemfg:Product mfg:Product3rdf:typemfg:Product mfg:Product4rdf:typemfg:Product ……… mfg:Product8rdf:typemfg:Product mfg:Product9rdf:typemfg:Product Triples Representing Type of Information 26
27
Semantic Web for the Working OntologistDean Allemang, Jim Hendler 6. Higher-Order Relationships ■ Reification In general, there are cases in which it is desirable to make a statement about another statement This process called reification 27 Shakespeare wrote Hamlet Shakespeare wrote Hamlet in 1604 Wikipedia states Shakespeare wrote Hamlet in 1604
28
Semantic Web for the Working OntologistDean Allemang, Jim Hendler ■ “Shakespeare wrote Hamlet in 1601” can be expressed with three triples bio:n1 bio:author lit:Shakespeare; bio:title “Hamlet”; bio:publicationDate 1601. ■ This approach works well in this case ■ But, it doesn’t work to express information about the statement itself “Wikipedia says Shakespeare wrote Hamlet” ■ Explicit reification In such cases, it is useful to explicitly make a statement about a statement 6. Higher-Order Relationships 28
29
Semantic Web for the Working OntologistDean Allemang, Jim Hendler 6. Higher-Order Relationships ■ “Wikipedia says Shakespeare wrote Hamlet” q:n1 rdf:subject lit:Shakespeare; rdf:predicate lit:wrote; rdf:object lit:Hamlet. web:Wikipedia m:says q:n1. ■ Explicit reification is supported by the W3C RDF standard with rdf:subject, rdf:predicate, and rdf:object 29
30
Semantic Web for the Working OntologistDean Allemang, Jim Hendler 7. Alternatives for Serialization ■ So far, we have expressed RDF triples in subject/predicate/object tabular form or as graphs of boxes and arrows ■ But they are not always the most compact forms ■ So, there are multiple ways of expressing RDF in textual form N-Triples Notation 3 RDF (N3) RDF/XML 30 ShakespeareKing Lear wrote SubjectPredicateObject lit:Shakespearelit:wrotelit:KingLear
31
Semantic Web for the Working OntologistDean Allemang, Jim Hendler 7.1. N-Triples ■ N-triples Corresponds most directly to the raw RDF triples Using fully unabbreviated URIs Three resources are expressed in subject/predicate/object order N-triples Product1Product type 31
32
Semantic Web for the Working OntologistDean Allemang, Jim Hendler 7.2. Notation 3 RDF (N3) ■ Notation 3 RDF (N3) More compact serialization of RDF Binding between the local qnames an the global URIs N3 provides a compact representation @prefix mfg: @prefix rdf: mfg:Product1 rdf:type mfg:Product. N3 32
33
Semantic Web for the Working OntologistDean Allemang, Jim Hendler 7.2. Notation 3 RDF (N3) ■ N3 begins with the first triple in subject/predicate/ object order ■ A semicolon (;) indicates that another triple with the same subject follows ■ Terminating with a period (.) mfg:Product1 rdf:type mfg:Product; mfg:Product_Division “Manufacturing support”; mfg:Product_Available “23”. mfg:Product1 rdf:type mfg:Product. mfg:Product1 mfg:Product_Division “Manufacturing support”. mfg:Product1 mfg:Product_Available “23”. 33
34
Semantic Web for the Working OntologistDean Allemang, Jim Hendler 7.2. Notation 3 RDF (N3) ■ Several triples share both subject and predicate N3 uses a comma (,) to separate the objects lit:Shakespeare b:hasChild b:Susanna, b:Judith, b:Hamlet. lit:Shakespeare b:hasChild b:Susanna. lit:Shakespeare b:hasChild b:Judith. lit:Shakespeare b:hasChild b:Hamlet. 34
35
Semantic Web for the Working OntologistDean Allemang, Jim Hendler 7.2. Notation 3 RDF (N3) ■ Abbreviation a means rdf:type mfg:Product1 rdf:type mfg:Product. mfg:Product1 a mfg:Product. 35
36
Semantic Web for the Working OntologistDean Allemang, Jim Hendler 7.3. RDF/XML ■ W3C has recommended the use of an XML serialization of RDF called RDF/XML (Many web infrastructures are accustomed to representing information in XML) <rdf:RDF xmlns:mfg=“http://www.WorkingOntologist.org/Examples/Chapter3/Manufacturing.rdf#” xmlns:rdf=“http://www.w3.org/1999/02/22-rdf-syntax-ns#> <mfg:Product rdf:about=“http://www.WorkingOntologist.org/Examples/Chapter3/Manufacturing.rdf# Product1”> 23 Manufactuingsupport Paper machine FB3524 ZX-3 Sacramento … 36
37
Semantic Web for the Working OntologistDean Allemang, Jim Hendler 8. Blank Nodes ■ RDF allows for resource that do not have any Web identity at all ■ Example: “Shakespeare had a mistress” ■ Her identity remains unknown But we know a few things about her ▶ She was a woman ▶ She lived in England ▶ She was the inspiration for “Sonnet 78” lit:Mistress1 rdf:type bio:Woman; bio:LivedIn geo:England. lit:Sonnet78 lit:hasInspiration lit:Mistress1. ∵ Her identity remains unknown ? rdf:type bio:Woman; bio:LivedIn geo:England. lit:Sonnet78 lit:hasInspiration ?. 37
38
Semantic Web for the Working OntologistDean Allemang, Jim Hendler 8. Blank Nodes ■ RDF allows blank node (bnode for short) ■ But this notation can not express more than one blank node ■ In N3, a bnode is indicated by putting all the triples between square brackets A blank node is referred by including the entire bracketed sequence in place of the blank node ? rdf:type bio:Woman; bio:LivedIn geo:England. lit:Sonnet78 lit:hasInspiration ?. lit:Sonnet78 lit:hasInspiration [ a bio:Woman; bio:livedIn England; … ]. 38
39
Semantic Web for the Working OntologistDean Allemang, Jim Hendler 8.1. Ordered Information in RDF ■ An ordered list can be expressed in N3 as follows lit:Shakespeare b:hasChild ( b:Susanna b:Judith b:Hamlet). 39
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.