Скачать презентацию Resource Description Framework Model Syntax and Schema Specifications Скачать презентацию Resource Description Framework Model Syntax and Schema Specifications

8b66fea7e2e4a2644741a258425e4c33.ppt

  • Количество слайдов: 50

Resource Description Framework Model, Syntax, and Schema Specifications Rohit Khare Adam Rifkin CSCW'98 Introduction Resource Description Framework Model, Syntax, and Schema Specifications Rohit Khare Adam Rifkin CSCW'98 Introduction to Resource Description Framework 4 K Associates

Metadataabout the RDF Spec z <rdf: Description about= Metadataabout the RDF Spec z CSCW'98 Introduction to Resource Description Framework 2

Dissecting the label 1/3 z A set of statements about this object (the spec): Dissecting the label 1/3 z A set of statements about this object (the spec): y

Dissecting the label 2/3 z Using Dublin Core, as attributes of Description y dc: Dissecting the label 2/3 z Using Dublin Core, as attributes of Description y dc: Title="Resource Description Framework. . . " y dc: Description="(RDF) is a foundation for. . . " y dc: Publisher="World Wide Web Consortium" y dc: Date="1998 -08 -19" y dc: Format="text/html" y dc: Type="technical specification" y dc: Language="eng"> z. . . and as an element, using an RDF bag: y

Dissecting the label 3/3 z. . . and as a repeated Dublin Core element, Dissecting the label 3/3 z. . . and as a repeated Dublin Core element, with Dewey Decimal Code attribtes: y y y z Finally, returning to the original HTML head: CSCW'98 Introduction to Resource Description Framework 5

Introduction to RDF z The label we just dissected is critical to the Web's Introduction to RDF z The label we just dissected is critical to the Web's future y Beyond machine-readable to machine-understandable z The RDF effort unites a wide array of players y Digital librarians, content-raters, privacy advocates, . . . y Significant industrial momentum, led by W 3 C z 1. The Data Model y Resources, properties, and statements z 2. The Syntax y Rendering into XML with Namespaces z 3. The RDF Schema y Using RDF to describe new vocabularies z Implications & Applications CSCW'98 Introduction to Resource Description Framework 6

Why metadatamatters. . . z Automated processing of Web resources: y y y Resource Why metadatamatters. . . z Automated processing of Web resources: y y y Resource discovery, cataloging Content rating PICS Collections of pages Sitemaps Security & Privacy P 3 P, DSIG Intelligent software agents z Sharing data between multiple applications and organizations requires explicit definitions z XML enables processing; RDF enables understanding CSCW'98 Introduction to Resource Description Framework 7

The RDF Working Group y Co-chaired by Ora Lassila & Ralph Swick y Chartered The RDF Working Group y Co-chaired by Ora Lassila & Ralph Swick y Chartered in the Technology & Society Domain y First draft was published in August 1997 z Represents many communities: y y Web Standardization HTML Meta, PICS Library Dublin Core, Warwick Framework Structured Documents SGML, XML Knowledge Representation KIF z Significant Industrial Momentum y Ex: “What’s Related” button in Netscape Navigator. . . CSCW'98 Introduction to Resource Description Framework 8

1. The Data Model z Resources y Any URI reference, from a fragment to 1. The Data Model z Resources y Any URI reference, from a fragment to a site. z Property Types y Named type defines meaning, permitted values, and relationship to other types. y (Types are also resources) z Statements (a. k. a. Properties) y “Resource has Property with Value” y (Values can be resources or atomic XML data) CSCW'98 Introduction to Resource Description Framework 9

A Trivial Example z Sentence y “Ora Lassila is the creator of the resource A Trivial Example z Sentence y “Ora Lassila is the creator of the resource http: //www. w 3. org/Home/Lassila” z Structure y Resource http: //www. w 3. org/Home/Lassila y Property type. Creator y Value "Ora Lassila" z Directedacyclicgraph CSCW'98 Introduction to Resource Description Framework 10

An Indirect Example z To add properties to Creator, point through a (possibly anonymous) An Indirect Example z To add properties to Creator, point through a (possibly anonymous) intermediate Resource. CSCW'98 Introduction to Resource Description Framework 11

Collection Containers z Multiple occurrences of the same Property. Type doesn ’t establish a Collection Containers z Multiple occurrences of the same Property. Type doesn ’t establish a relation between the values y The Millers own a boat, a bike, and a TV set y The Millers need (a car or a truck) y (Sarah and Bob) bought a new car z RDF defines three special Resources: y Bag unordered values rdf: Bag y Sequence ordered values rdf: Seq y Alternative single value rdf: Alt CSCW'98 x Core RDF does not enforce ‘set’ semantics amongst values Introduction to Resource Description Framework 12

Example: Bag z The students in course 6. 001 are Amy, Tim, John, Mary, Example: Bag z The students in course 6. 001 are Amy, Tim, John, Mary, and Sue CSCW'98 Introduction to Resource Description Framework 13

Example: Alternative z The source code for X 11 may be found at ftp. Example: Alternative z The source code for X 11 may be found at ftp. x. org, ftp. cs. purdue. edu, or ftp. eu. net CSCW'98 Introduction to Resource Description Framework 14

Reification z Making statements about statements requires a process for transforming them into Resources Reification z Making statements about statements requires a process for transforming them into Resources y y prop. Obj the original referent prop. Name the original property type value the original value instance. Of the type of this resource x Reified statements are themselves RDF: Property x Collections are also built-in RDF types z Distributive Referents y Referring to a resource vs. its members (about. Each) CSCW'98 Introduction to Resource Description Framework 15

Example: Reification z Ralph Swick says that y Ora Lassila is the creator of Example: Reification z Ralph Swick says that y Ora Lassila is the creator of the resource http: //www. w 3. org/Home/Lassila CSCW'98 Introduction to Resource Description Framework 16

Recap: A Formal Model of RDF z RDF itself is mathematically straightforward: y Definitions Recap: A Formal Model of RDF z RDF itself is mathematically straightforward: y Definitions y Typing y Reification y Collections z. . . though the mapping onto XML syntax (and XML’s formal model) is less so. . . CSCW'98 Introduction to Resource Description Framework 17

Formal Model: Definitions z 1. There is a set called Nodes y 2. There Formal Model: Definitions z 1. There is a set called Nodes y 2. There is a subset of Nodes called Property. Types z 3. There is a set of 3 -tuples called Triples y {p, r, v} where p is a member of Property. Types, r is a member of Nodes, and v (called value) is either a member of Nodes or an atomic value x “v is the value of p for r ” x “r has a property p with a value v” x “the p of r is v” CSCW'98 Introduction to Resource Description Framework 18

Formal Model: Typing z 4. There is an element of Property. Types known as Formal Model: Typing z 4. There is an element of Property. Types known as RDF: instance. Of. z 5. Members of Triples of the form {RDF: instance. Of, r, v} imply r and v are members of Nodes. y [RDFSchema] places additional restrictions on the use of instance. Of. CSCW'98 Introduction to Resource Description Framework 19

Formal Model: Reification y 6. There is an element of Nodes, not contained in Formal Model: Reification y 6. There is an element of Nodes, not contained in Property. Types, known as RDF: Property. y 7. There are three elements in Property. Types known as RDF: prop. Name, RDF: prop. Obj and RDF: value. z 8. Reification of a triple {p, r, v} of Triples is: an element n of Nodes representing the reified triple; and four new elements of Triples: y y y CSCW'98 y {RDF: prop. Name, n, p} {RDF: prop. Obj, n, r} {RDF: value, n, v} Introduction to Resource Description Framework {RDF: instance. Of, n, [RDF: Property]} 20

Formal Model: Collections z 9. There are three elements of Nodes, not contained in Formal Model: Collections z 9. There are three elements of Nodes, not contained in Property. Types, known as RDF: Seq, RDF: Bag, and RDF: Alt. z 10. There is a subset of Property. Types corresponding to the ordinals called Ord. y Refer to elements of Ord as RDF: _1, RDF: _2, . . . y There must always be one value for RDF: Alt x (RDF: _1 is the default) CSCW'98 Introduction to Resource Description Framework 21

2. The Syntax z z z Why XML alone does not suffice Basic RDF-in-XML 2. The Syntax z z z Why XML alone does not suffice Basic RDF-in-XML Syntax Abbreviated Forms Distributing RDF metadata Collected BNF Grammar Formal mapping to XML CSCW'98 Introduction to Resource Description Framework 22

Why XML alone does not suffice z XML can already handle new Property. Types: Why XML alone does not suffice z XML can already handle new Property. Types: y I liked Ora Lassila’s RDF introduction! x Just declare a new element or attribute! z. . . but “raw XML” fails in two ways: y Interchange: Namespaces only identify new tags; DTD semantics do not provide types or composition y Scalability: Processing generic XML requires parsing text (“the entity tax”); and the order of XML elements is considered significant, requiring the whole graph. 23 CSCW'98 Introduction to Resource Description Framework

Basic RDF-in-XML Syntax z A Description block about a Resource z z z [1] Basic RDF-in-XML Syntax z A Description block about a Resource z z z [1] RDF : : = [''] description* [''] [2] description : : = '' property* '' [3] id. About. Attr : : = id. Attr | about. Attr [4] about. Attr : : = 'about="' URI-reference '"' [5] id. Attr : : = 'ID="' IDsymbol '"' z contains Property. Name block or empty elements z [6] property : : = '<' prop. Name '>' value '' | '<' prop. Name resource. Attr '/>' z using fully-qualified XML Namespaces on each tag z [7] prop. Name : : = Qname z and allows values to be XML data, RDF, or external links z z [8] value : : = description | string [9] resource. Attr : : = 'resource="' URI-reference '"' CSCW'98 Introduction to Resource Description Framework 24

Example: Basic RDF-in-XML z “Ora Lassila is the Creator of the resource. . . Example: Basic RDF-in-XML z “Ora Lassila is the Creator of the resource. . . ” y Ora Lassila| y (where s: is a separately-declared namespace) x xmlns: s="http: //description. org/schema/" z So the complete, valid XML document would be: y CSCW'98 Ora Lassila Introduction to Resource Description Framework 25

Abbreviated Forms z XML Namespace defaulting can shorten that: y <? xml version= Abbreviated Forms z XML Namespace defaulting can shorten that: y Ora Lassila y (but such aggressive elision is officially discouraged) z RDF itself offers 3 abbreviations: y String values as XML attributes y Nested descriptions as XML attributes CSCW'98 Introduction to Resource Description Framework y instance. Of: property types as XML element 26

RDF Abbreviation Rules z Non-repeated, string-valued properties can fold into attributes; Description can be RDF Abbreviation Rules z Non-repeated, string-valued properties can fold into attributes; Description can be empty y z Simple Description-valued properties, too: y z Property. Types can be promoted to elements y CSCW'98 27

Example: Aggregates z z z a document with two authors specified alphabetically, a title Example: Aggregates z z z a document with two authors specified alphabetically, a title specified in two different languages, and with two equivalent locations CSCW'98 z z Mary Andrew Jacky Crystal z z The Coolest Web Page Il Pagio di Web Fuba z Introduction to Resource Description Framework 28

Example: PICS Labels z PICS includes a schema, statements (about pages), and metastatements (about Example: PICS Labels z PICS includes a schema, statements (about pages), and metastatements (about labels) z z until "1995. 12. 31 T 23: 59 -0000" z "http: //w 3. org/Underview. html" z z CSCW'98 Introduction to Resource Description Framework 29 z

Distributing RDF Metadata z The PICS effort had three goals for labels: y Embedded Distributing RDF Metadata z The PICS effort had three goals for labels: y Embedded in documents (primarily HTML META) y Transmitted with documents (in HTTP headers) y Separately , from third parties (HTTP label queries) z Similarly, RDF has embedding mechanisms y Using in , though it’s invalid HTML 4. 0 x The abbreviated form prevents values from rendering y Using the RDF Namespace in any XML document z Remote access is unspecified as yet y. . but XLinks to metadata stores could work neatly CSCW'98 Introduction to Resource Description Framework 30

Collected BNF Grammar 1/2 z [6. 1] RDF : : = '< rdf: RDF>' Collected BNF Grammar 1/2 z [6. 1] RDF : : = '< rdf: RDF>' obj* '' z [6. 2] obj : : = description | container z [6. 3] description : : = '' | '< rdf: Description' id. About. Attr? bag. Id. Attr? prop. Attr* '>' property* '' | typed. Node z [6. 4] container : : = sequence | bag | alternative z [6. 5] id. About. Attr : : = id. Attr | about. Each. Attr z [6. 6] id. Attr : : = 'ID="' IDsymbol '"' z [6. 7] about. Attr : : = 'about="' URI-reference '"' z [6. 8] about. Each. Attr : : = 'about. Each="' URI-reference '"' z [6. 9] bag. Id. Attr : : = 'bag. ID="' IDsymbol '"' z [6. 10] prop. Attr : : = prop. Name '="' string '"' (with embedded quotes escaped) z [6. 11] property : : = '<' prop. Name id. Attr? '>' value '' | '<' prop. Name id. Ref. Attr? bag. Id. Attr? prop. Attr* '/>' z [6. 12] typed. Node : : = '<' type. Name id. About. Attr? bag. Id. Attr? prop. Attr* '/>' | '<' type. Name id. About. Attr? bag. Id. Attr? prop. Attr* '>' property* '' CSCW'98 Introduction to Resource Description Framework 31

Collected BNF Grammar z z z z z 2/2 [6. 13] prop. Name : Collected BNF Grammar z z z z z 2/2 [6. 13] prop. Name : : = Qname [6. 14] type. Name : : = Qname [6. 15] id. Ref. Attr : : = id. Attr | resource. Attr [6. 16] value : : = obj | string [6. 17] resource. Attr : : = 'resource="' URI-reference '"' [6. 18] Qname : : = [ NSname ': ' ] name [6. 19] URI-reference : : = (see RFC 1738, RFC 1808, [URI]) [6. 20] IDsymbol : : = (any legal XML name symbol) [6. 21] name : : = (any legal XML name symbol) [6. 22] NSname : : = (any legal XML namespace prefix) [6. 23] string : : = (any XML text, with "<", ">", and "&" escaped) [6. 24] sequence : : = '< rdf: Seq' id. Attr? '>' member* '' [6. 25] bag : : = '< rdf: Bag' id. Attr? '>' member* '' [6. 26] alternative : : = '' member+ '' [6. 27] member : : = referenced. Item | inline. Item [6. 28] referenced. Item : : = '' [6. 29] inline. Item : : = '' value ' CSCW'98 Introduction to Resource Description Framework 32

Formal mapping to XML 1/2 z Each element in a Description block E defines Formal mapping to XML 1/2 z Each element in a Description block E defines a {p, r, v} triple: y p is the element name, fully qualified as a URI y r is the about or ID attribute of the Description; or anonymous y v is the string or node contained by E, or the resource attribute of E z The Description block defines a Bag containing the reifications of each included property, named as Bag. ID or anonymous z The about. Each attributeexpands the process for each r in C z The LI elementworks as above, with p assigned in XML order Introduction to Resource Description Framework CSCW'98 33

Formal mapping to XML 2/2 z Each attribute on a Description tag A (other Formal mapping to XML 2/2 z Each attribute on a Description tag A (other than ID, about. Each or bag. ID) defines a {p, r, v} triple: y p is the attribute name, fully qualified as a URI y r is the about or ID attribute of the Description; or a member of the collection in the about. Each attribute. y v is the (string) value of A z Each attribute on a Property tag A (other than ID, resource, or bag. ID) defines triples: y Linking the node r 2 (ID or resource) to the enclosing element’s resource as {p, r 1, r 2} y On node r 2 for each attribute A, as above CSCW'98 Introduction to Resource Description Framework 34

3. The RDF Schema z Introducing new Property. Types in a machineunderstandable way calls 3. The RDF Schema z Introducing new Property. Types in a machineunderstandable way calls for a schema language y E. g. “a book must have at least one author” z RDFS is a loosely object-oriented solution with: y y y Core Classes Core Property. Types Core Constraints Documentation Hooks Model & Syntax Concepts z Deployment: Dublin Core, DCDs, & Other Issues CSCW'98 Introduction to Resource Description Framework 35

Core Classes z RDF: Resource y All resources (a. k. a. Nodes) are instances Core Classes z RDF: Resource y All resources (a. k. a. Nodes) are instances of this x Roughly corresponds to Object in OO systems z RDF: Property. Type y All elements of the set Property. Types are instances z RDFS: Class y Loosely corresponds to a type or category y No formal properties of Class itself CSCW'98 Introduction to Resource Description Framework 36

Core Property. Types z RDF: instance. Of y Indicates a resource is a member Core Property. Types z RDF: instance. Of y Indicates a resource is a member of a class; the value must be be an instance. Of: Class y A resource may be an instance of several classes z RDFS: sub. Class. Of y Indicates a (strict) subset/superset relationship y Its domain and range is Class y A class may not be a subclass of itself x But there isn't a way to express/enforce this in RDFS CSCW'98 Introduction to Resource Description Framework 37

Core Constraints z RDFS: Constraint. Property. Type y Superclass of Range and Domain z Core Constraints z RDFS: Constraint. Property. Type y Superclass of Range and Domain z RDFS: Range y Specify the (at most one) class of property values x Any value allowed if no range specified z RDFS: Domain y Class(es) on which a property. Type may be used x Allowed on any class if no domain specified CSCW'98 Introduction to Resource Description Framework 38

Documentation & Model z RDFS: comment y Natural-language description of a resource z RDFS: Documentation & Model z RDFS: comment y Natural-language description of a resource z RDFS: label y Human-readable version of a resource name z RDFS: Collection y The superclass of Bag, Seq, and Alt z RDFS: String y A resource corresponding to M&S definiton of string (production 15 in the BNF) CSCW'98 Introduction to Resource Description Framework 39

Recap: RDFS Class Hierarchy CSCW'98 Introduction to Resource Description Framework 40 Recap: RDFS Class Hierarchy CSCW'98 Introduction to Resource Description Framework 40

Recap: RDFS Constraints CSCW'98 Introduction to Resource Description Framework 41 Recap: RDFS Constraints CSCW'98 Introduction to Resource Description Framework 41

RDFS in RDF z z z <RDF xmlns= RDFS in RDF z z z CSCW'98 Introduction to Resource Description Framework 42

Dublin Core on a Slide z Content z Intellectual Property y Title y Subject Dublin Core on a Slide z Content z Intellectual Property y Title y Subject y Creator y Contributor x Includes keywords y Description y Source y Publisher y Rights x Metadata of predecessor y Language y Relation x e. g. is. Version. Of, is. Format. Of y Coverage x Spatial or temporal range CSCW'98 x e. g. editor, translator z Instance y Date y Type x e. g. novel, poem, TR y Format y Identifier Introduction to Resource Description Framework 43

Deployment Issues z RDF Schemas vs. “XML Schemas” y The problems of controlled vocabulary Deployment Issues z RDF Schemas vs. “XML Schemas” y The problems of controlled vocabulary metadata and selfdescribing DTDs are close enough to cause confusion x XML-Data, by Microsoft & Co conflates the two x DTDs-in-XML is a work item before the rechartered XML WG z URI versioning issues y As with DTDs, the permanence of the schema identifier is a popular red herring (as is “performance”) z Compatibilty with ‘push’ product formats y Channel Definition Format, Open Software Description, . . . z But products and services are shipping. . . CSCW'98 Introduction to Resource Description Framework 44

Document Content Description z Long-standing goal of XML DTDs expressed in XML y “A Document Content Description z Long-standing goal of XML DTDs expressed in XML y “A schema language for tagsets ” z Here, DCD models the DL element from HTML in RDF: y CSCW'98 A simple 'definition list' construct, which contain s paired 'DT' (DL Term) and 'DD' (DL Definition) elements DT DD The term being defined in a DL list item A term's definition in a DL list item Introduction to Resource Description Framework 45

DCD: Beyond Text Processing z DCD can describe data types and constraints, too: y DCD: Beyond Text Processing z DCD can describe data types and constraints, too: y Describes an airline reservation Last. Name First. Initial Seat. Row Seat. Letter Departure Class z Sample airline booking record: y CSCW'98 BrayT 33B 1997 -05 -24 T 07: 55: 00+1 Introduction to Resource Description Framework 46

DCD: Basic Concepts 1/2 z DCDs themselves have descriptive parameters y Description, (Canonical) Namespace DCD: Basic Concepts 1/2 z DCDs themselves have descriptive parameters y Description, (Canonical) Namespace URI y Open or Closed: whether documents must validate z Elements y Content Model x Empty, Any, Data, Elements, or Mixed ; Root flag y Attribute or Attribute. Def declarations y Default & Fixed element contents y Groups & Order (Seq or Alt); Occurs x Required, Optional, One. Or. More, or Zero. Or. More CSCW'98 Introduction to Resource Description Framework 47

DCD: Basic Concepts 2/2 z Attributes y Name, is Global, Required or Optional, has DCD: Basic Concepts 2/2 z Attributes y Name, is Global, Required or Optional, has ID-Role z Entities y Name & (Value, Public. ID, or System. ID) z Datatypes y XML DTD types, numbers (int, fixed, float, 1 -8 bytes), booleans, times (dates & intervals), & binary data y Min, Max & Min. Exclusive, Max. Exclusive y Picture constraints on string fields (per COBOL) x Characters, numbers, decimals, symbols CSCW'98 Introduction to Resource Description Framework 48

Implications & Applications z What happens when “one application's metadata is another application's data”? Implications & Applications z What happens when “one application's metadata is another application's data”? z Approaching Tim Berners-Lee ’s “next phase of the Web”: Reasoning Engines y RDF is a simple frame system -- not a reasoning system (but one can be built atop it) z Automating the Web of Trust y New generation of “Internet-scale” identification, rights management, authorization tools need signed RDF assertions for trust management CSCW'98 Introduction to Resource Description Framework 49

For more information. . . z The Specifications y http: //www. w 3. org/TR/WD-rdf-syntax For more information. . . z The Specifications y http: //www. w 3. org/TR/WD-rdf-syntax & WD-rdf-schema z W 3 C ’s RDF Metadata home pages & y http: //www. w 3. org/Metadata/ & /RDF/ z Eric Miller’s introduction y http: //www. dlib. org/dlib/may 98/miller/05 miller. html y http: //purl. oclc. org/~emiller/talks/www 7/tutorial z Dave Beckett’s RDF Resources y http: //www. cs. ukc. ac. uk/people/staff/djb 1/ research/metadata/rdf. shtml z This talk is at http: //www. ics. uci. edu/~rohit/cscw 98/rdf/ CSCW'98 Introduction to Resource Description Framework 50