330 likes | 518 Views
Resource Description Framework ( RDF ). Xinxia An. Resource Description Framework ( RDF ). Introduction RDF Syntax Dublin Core. Introduction. What is RDF ?. RDF: Resource Description Framework Is a language designed to describe resources which has its own formal grammar
E N D
Resource Description Framework( RDF ) Xinxia An
Resource Description Framework( RDF ) • Introduction • RDF Syntax • Dublin Core
Introduction What is RDF ? • RDF: Resource Description Framework • Is a language designed to describe resources which has its own formal grammar • Is a framework: • tells us how to organize metadata • does not say what metadata we should have • Is an XML application • Is a W3C recommendation
Introduction What is Dublin Core ? • Is a metadata standard • Tells us what aspects of a resource we should describe and what names to use
Introduction Why need RDF and Dublin Core ? • Provides a foundation for metadata processing • Supports metadata interchanging • better precision in resource discovery
RDF Syntax (Root Element) • A RDF document must start with <?xml?> declaration • It also must have a root element with a fixed name which is <RDF> • It must use the RDF namespace, which is http://www.w3.org/1999/02/22-rdf-syntax-ns# • The prefix for this namespace is usually rdf
RDF Syntax Root Element <?xml version=“1.0”?> <rdf:RDF xmlns:rdf=“http://www.w3.org/ 1999/02/22-rdf-syntax-ns#”> . . ( Description Elements ) . . </rdf:RDF>
RDF Syntax Description Element • Each resource you want to describe in RDF document gets its own <rdf:Description> element • We use about attribute to specify the resource to be described
RDF Syntax Description Element <?xml version=“1.0”?> <rdf:RDF xmlns:rdf=“http://www.w3.org/ 1999/02/22-rdf-syntax-ns#”> <rdf:Description about=“http://www.nmsu.edu/jobs.html”> …… ( Property Elements ) …… </rdf:Description> </rdf:RDF>
RDF Syntax Description Element • attributes of <rdf:Description> element • about • aboutEach • aboutEachPrefix • bagID • ID • type
RDF Syntax Property Element • Each property element describes one property or one aspect of the resource • It is up to you to decide how to name the properties • But it is strongly suggested to use agreed-upon sets of terms • The most widely used standard is Dublin Core whose namespace is usually given a prefix dc http://www.purl.org/DC/
RDF Syntax Property Element • Some forms of property elements 1. <PropertyName> Value </PropertyName> Value = string | Description | Container e.g.1<dc:Creator> John Smith </dc:Creator> e.g.2 <dc:Creator> <rdf:Description about=“Jsmith.html”> <dc:Language> en </dc:Language> <dc:Date> Feb.18,2002 </dc:Date> </rdf:Description> </dc:Creator>
RDF Syntax Property Element • Some forms of property elements 2. <PropertyName parseType=“Literal”> any well-formed XML (not interpreted by RDF-aware browers) </PropertyName> e.g. <dc:Creator parseType=“Literal”> <js:Name> John Smith </js:Name> <js:Birth> Jan 01,1900</js:Birth> </dc:Creator>
RDF Syntax Property Element • Some forms of property elements 3. <PropertyName parseType=“Resource”> property elements </PropertyName> e.g. <dc:Creator parseType=“Resource”> <js:Name> John Smith</js:Name> <js:Birth> Jan 01,1900</js:Birth> </dc:Creator>
RDF Syntax Property Element • Some forms of property elements 4. <PropertyName rdf:resource=URI /> URI = Uniform Resource Identifier e.g. <rdf:Description about=“http://nmsu.edu/jobs.html”> <dc:Creator rdf:Resource=“smith.html”/> </rdf:Description>
RDF Syntax RDF Document - Example <?xml version=“1.0”?> <rdf:RDF xmlns:rdf=“http://www.w3.org/ 1999/02/22-rdf-syntax-ns#” xmlns:dc=“http://purl.org/DC/”> <rdf:Description about=“http://www.nmsu.edu/jobs.html”> <dc:Creator> John Smith </dc:Creator> <dc:Date> Feb.18,2002 </dc:Date> </rdf:Description> </rdf:RDF>
RDF Syntax Abbreviated RDF Syntax • Up to now, we place all the property elements inside the description elements • W3C also provides another way to organize the property elements, which is called abbreviated RDF syntax • Abbreviated RDF syntax allows us convert property elements into attributes of the <rdf:Description> element
RDF Syntax Abbreviated RDF Syntax <rdf:/Description about=“jobs.html”> <dc:Creator> John Smith </dc:Creator> <dc:Date> Feb 18, 2002 </dc:Date> <rdf:/Description> is converted into <rdf:/Description about=“jobs.html” dc:Creator=“ John Smith “ dc:Date=“ Feb 18, 2002 ”> <rdf:/Description>
RDF Syntax Abbreviated RDF Syntax • Abbreviate RDF syntax results in empty description elements • The biggest advantage of this is that browsers that do not understand RDF, will not mishandle the content of the property elements, if we embed some RDF descriptions in an HTML document
RDF Syntax RDF Containers • A RDF container is a group of properties of a resource • With RDF containers, we could describe a resource more conveniently and efficiently
RDF Syntax RDF Containers • Without RDF container, we have to repeat the property tags like <rdf:Description about=“planets.html”> <dc:Subject> Mercury </dc:Subject> <dc:Subject> Venus </dc:Subject> <dc:Subject> Earth </dc:Subject> <dc:Subject> Mars </dc:Subject> </rdf:Description> if Mercury, Venus, Earth and Mars are all subjects of the resource planets.html
RDF Syntax RDF Containers There are three types of RDF containers • <rdf:Bag> a group of multiple,unordered properties • <rdf:Seq> a group of multiple,ordered properties • <rdf:Alt> a list of properties giving alternative choices, only one of all these choices is actually chosen
RDF Syntax RDF Containers - Bag <rdf:Description about=“planets.html”> <dc:Creator> John Smith </dc:Creator> <dc:Subject> <rdf:Bag> <rdf:li> Mercury </rdf:li> <rdf:li> Venus </rdf:li> <rdf:li> Earth </rdf:li> <rdf:li> Mars </rdf:li> </rdf:Bag> </dc:Subject> </rdf:Description>
RDF Syntax RDF Containers - Seq <rdf:Description about=“planets.html”> <dc:Creator> John Smith </dc:Creator> <dc:Subject> <rdf:Seq> <rdf:li> Mercury </rdf:li> <rdf:li> Venus </rdf:li> <rdf:li> Earth </rdf:li> <rdf:li> Mars </rdf:li> </rdf:Seq> </dc:Subject> </rdf:Description>
Dublin Core Why Dublin Core ? • RDF is just a framework under which we organize our metadata about resources • It does not say anything about what properties or aspects of a resource we should describe • We need some standard property names or agreed-upon terms to describe resources, otherwise, the metadata is not easy to share or exchange • Dublin Core comes for this reason
Dublin Core What is Dublin Core ? • Is a metadata standard • Is a set of named properties • Is a description model • Tells us what aspects of a resource should be described • Is the most popular and supported by most search engines
Dublin Core Dublin Core Properties The Dublin Core standard has 15 properties of 3 categories • Content • Intellectual Property • Instantiation
Dublin Core Content Properties • Coverage • Description • Type • Relation • Source • Subject • Title
Dublin Core Type Property • text • image • sound • software • . . .
Dublin Core Intellectual Properties • Contributor • Creator • Publisher • Rights
Dublin Core Instantiation Properties • Date • Format • Identifier • Language
Summary • RDF is a language about how to write RDF documents • RDF does not specify what properties or aspects of a resource we should describe • Dublin Core provides a standard way to describe resources by giving a set of agreed-upon terms