650 likes | 858 Vues
RDF, RSS and all that. THREADING THE RDF MAZE. Outline of Discussion. What is RDF? How is RDF different from XML? Some simple RDF Descriptions. Some simple RDF Schemas. Some simple RDF tools to combine data. What is RDF. Resource Description Format Tool of the Semantic Web
E N D
RDF, RSS and all that THREADING THE RDF MAZE Silterra, April 2004
Outline of Discussion • What is RDF? • How is RDF different from XML? • Some simple RDF Descriptions. • Some simple RDF Schemas. • Some simple RDF tools to combine data. Silterra, April 2004
What is RDF • Resource Description Format • Tool of the Semantic Web • History: First Recommended Model and Syntax – 1999. • RDF Schema Specification 2000 Silterra, April 2004
Recent Specifications • Feb 10, 2004 • RDF/XML Syntax Specification • RDF Vocabulary Description Language 1.0: RDF Schema • RDF Primer • Resource Description Framework (RDF): Concepts and Abstract Syntax Silterra, April 2004
Goals of RDF • Web metadata • Content Rating, like PICS • PICS, the Platform for Internet Content Selection [PICS96], [PICSSYS96] is a system for associating metadata (PICS "labels") with Internet content • Categorize and classify – step up from simple term searching to concept searching. • Descriptions of capabilities, like CC/PP Silterra, April 2004
RDF? XML? • Goals of RDF seem like those of XML • Share data between across the Web. • Reuse data between applications. • XML is a data format standard. • The structure of an xml document can get in the way of analyzing the information. • An xml document is a tree. Silterra, April 2004
RDF model • RDF consists of assertions about Web resources. • RDF models can be represented, and built on top of XML. • RDF and XML are complementary. Silterra, April 2004
Key Concepts of RDF • Expression of simple facts • Graph data model • URI-based vocabulary • Datatypes • Literals • Different syntaxes for representing the assertions, though RDF/XML is one. Silterra, April 2004
RDF Assertions, Examples • The Author of ISBN 0152038655 is Carl Sandburg. • The Title of ISBN 0152038655 is Arithmetic. • The Author of the web page is Ora • The Subject of www.library.cornell.edu/mayantislavery is “Slavery”. • <rdf:Description rdf:about="uri:isbn:0152038655" • mods:title="Arithmetic" • mods:creator="Sandburg,Carl" /> Silterra, April 2004
RDF Assertions, Cont'd • <rdf:Description rdf:about="http://example.com"> • <mods:creator> Ora</mods:creator> • </rdf:Description> Silterra, April 2004
Underlying model • Graph based so this is the representation that is always referred to. Silterra, April 2004
RDF representations • RDF assertions, and models can be represented in different ways. • 1 Way is N3. • This is a compact representation. • Simple to understand. • Easy to parse. • Not widely understood though. Silterra, April 2004
N3 Representation of RDF • <http://www.library.cornell.edu/mayantislavery> <http://purl.org/dc/elements/1.1/subject> "Slavery" . • <uri:isbn:0152038655> <http://mods.org/title> "Arithmetic" . <uri:isbn:0152038655> <http://mods.org/creator> "Sandburg,Carl" . • <http://example.com/> <http://mods.org/creator> "Ora" . Silterra, April 2004
Simple MODS Document • <mods xmlns:xlink="http://www.w3.org/TR/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.loc.gov/mods/" xsi:schemaLocation=" http://www.loc.gov/mods http://www.loc.gov/standards/mods/mods.xsd"> <identifier type=”isbn”>0152038655</identifier> <title>Arithmetic /</title> <creator>Sandburg,Carl</creator> </mods> Silterra, April 2004
RDF XML Representation • <?xml version="1.0"?> • <rdf:RDF> • <rdf:Description rdf:about="uri:isbn:0152038655"> • <mods:title>Arithmetic</mods:title> • <mods:creator>Sandburg,Carl</mods:creator> • </rdf:Description></rdf:RDF> Silterra, April 2004
XML RDF representation • The RDF Description Element. • Specifies the resource about which we are talking. • Can use the “about” attribute. • Could be unamed, in which case the subject will be assigned a dummy name. • XML that are immediate children elements are predicates, and their content is the object, or value of the predicate. Silterra, April 2004
XML RDF Representation • This is a shorthand notation. • Elements that are immediate children are predicates, like title, and creator in the example. • There are other ways to represent this. • If the value is only a simple string, you can use attributes on the Description Element. Silterra, April 2004
Alternate RDF XML Shorthand • <rdf:Description rdf:about="uri:isbn:0152038655" • mods:title="Arithmetic" • mods:creator="Sandburg,Carl" /> Silterra, April 2004
Types of Containers • RDF has data types for Containers, • Bag: a group of resources or literals, possibly including duplicate members, where there is no significance in the order of the members. • Seq : represents a group, possibly including duplicate members, where the order of the members is significant. • Alt: resources that are alternatives (typically for a single value of a property. Silterra, April 2004
RDF Bag Syntax • rdf:Description … • <dc:subject> • <rdf:Bag> • <rdf:li>library use studies</rdf:li> • <rdf:li>magazines and newspapers</rdf:li> • </rdf:Bag> • </dc:subject> Silterra, April 2004
RDF Bags Silterra, April 2004
RDF Sequence - Example • <rdf:Seq> • <rdf:li rdf:resource="00001.TIF"/> • <rdf:li rdf:resource="00002.TIF"/> • </rdf:Seq> • …. </rdf:Description> • <rdf:Description rdf:about="00001.TIF"><page seq="1" img="00001.TIF" ocr="00001.TXT" ftr="TPG" n="1"/></rdf:Description> • <rdf:Description rdf:about="00002.TIF"><page seq="2" img="00002.TIF" ocr="00002.TXT" ftr="PRF" n="2"/></rdf:Description> Silterra, April 2004
RDF Values – Not only literals • <rdf:Description rdf:about="uri:isbn:0152038655"> • <titleinfo> • <rdf:Description> • <dc:title>Arithmetic</dc:title> • </rdf:Description> • </titleinfo> • <dc:creator>Sandburg,Carl</dc:creator> • <dc:date>1993</dc:date> • </rdf:Description> Silterra, April 2004
RDF node values. Silterra, April 2004
Another way to achieve Nodehood. • <rdf:Description rdf:about="uri:isbn:0152038655"> <titleinfo rdf:parseType="Resource"> <dc:title>Arithmetic</dc:title> • </titleinfo> <dc:creator>Sandburg,Carl</dc:creator> <dc:date>1993</dc:date> </rdf:Description> Silterra, April 2004
Further Examples of Nodehood. <rdf:Description rdf:about="uri:isbn:0152038655"> <titleinfo rdf:parseType="Resource"> <rdf:Alt rdf:parseType="Resource"> <rdf:li rdf:parseType="Resource"> <dc:title>Arithmetic</dc:title></rdf:li> <rdf:li rdf:parseType="Resource"> <dc:title>l'Arithmetique</dc:title></rdf:li> </rdf:Alt> </titleinfo> <dc:creator>Sandburg,Carl</dc:creator> <dc:date>1993</dc:date> </rdf:Description> Silterra, April 2004
Further Examples of Nodehood,contd. Silterra, April 2004
RDF Sequence: Graph Silterra, April 2004
RDF Schema and XML Schemas • The RDF Syntax so far does not have any rules for what vocabulary is acceptable. • RDF schema is different from XML Schema. • XML Schema describe the structure of a document. • RDF Schema describe classes of resources and their properties, no matter how they may appear in a document. Silterra, April 2004
RDF Schemas • Define Classes. • Define Properties. • Define relationship between Classes • Define relationships between Properties. • Define possible what a property can be applied to and what values it can take on. Silterra, April 2004
RDF Schema – Example Elements • Rdfs:Class defines a kind of resource. • Rdf:Property defines that the resource being talked about is a “property” • Notice in the attached dublin core RDF Schema that only properties are defined, no classes. The only Rdf:Description only describes the dublin core vocabulary itself. • Attached schemas for RSS and Dublin Core Silterra, April 2004
An Example Schema: Dublin Core • The Dublin Core Vocabulary in RDF Schema. • Define for each Dublin property what RDF needs to know about it. • All the Dublin Core terms are properties that can be applied to any Resource. • <rdf:Property rdf:about="http://purl.org/dc/elements/1.1/title"> Silterra, April 2004
Dublin Core: - RDF Schema cont’d • Each property is given an rdfs label, for using to display the property. • Each property is given a comment, to describe it • Each property is given a rsfs:isDefinedby “to indicate an RDF vocabulary in which a resource is described.” Silterra, April 2004
Another Example Schema: RSS • What is RSS • Rich Site Summary • Encoded Description of web site using RDF • Used for News, blogging. • Here is an example file: • http://encompass-test.library.cornell.edu:20068/may.rss Silterra, April 2004
RSS sample • One Resource class is "channel" • Defined with rdfs:Class. • <rdfs:Class rdf:about="http://purl.org/rss/1.0/channel" rdfs:label="Channel" rdfs:comment="An RSS information channel."> • <rdfs:isDefinedBy rdf:resource="http://purl.org/rss/1.0/"/ • </rdfs:Class> Silterra, April 2004
RSS – RDF Schema Discussion • Another resource is item, which defines a nugget of information, also defined with rdfs:Class. • <rdfs:Class rdf:about="http://purl.org/rss/1.0/item" rdfs:label="Item" rdfs:comment="An RSS item."> <rdfs:isDefinedBy rdf:resource="http://purl.org/rss/1.0/"/> </rdfs:Class> Silterra, April 2004
RSS Validation • http://www.redland.opensource.ac.uk/rss/ will validate your RSS and display it. • UK sources of RSS “feeds” - http://rssxpress.ukoln.ac.uk/ • D-Lib Magazine – for instance. - http://dois.mimas.ac.uk/rss/dlib.xml Silterra, April 2004
RDF Query Languages RDFDB query language(?--??) RDF Inkling Squish RDQL Silterra, April 2004
Querying An RDF database using RDFdb • Each triple is a fact asserted into the database. • One such data base demo is: • http://www.redland.opensource.ac.uk/demo • Query the whole database like this: • ?--?-->? Silterra, April 2004
?--[http://purl.org/dc/elements/1.1/subject]-->"Abolitionism"?--[http://purl.org/dc/elements/1.1/subject]-->"Abolitionism" Silterra, April 2004
Query and Result Silterra, April 2004
Inking/Squish Queries • http://swordfish.rdfweb.org:8085/rdfquery/index.html Silterra, April 2004
Inkling/Squish – Sample Query • SELECT ?about, ?title FROM http://encompass-test.library.cornell.edu:20068/may.rdf WHERE (dc::title ?about ?title) USING dc for http://purl.org/dc/elements/1.1/ Silterra, April 2004
Inkling Squish Results Silterra, April 2004
Multi RDF database query. Silterra, April 2004
Squish Query with Qualifiers Silterra, April 2004
Using RDF with FRBR • Danish Library Center 2002 – Visual Cat FRBR • A module to handle FRBR as RDF has been implemented • The FRBR display formats are based on Library of Congress suggestions. • Interrelated FRBR RDF entities can be located, fetched and edited directly Silterra, April 2004
RDF Schema for FRBR Silterra, April 2004
RDQL – Query Language for RDF • Similar to the RDF/Squish language. • Similar to SQL – • Variables in the SELECT clause • WHERE describes a "path" in the graph. • USING allows abbreviation of name spaces. • FROM specifies a datasource(s) Silterra, April 2004
RDQL Inference • RDFS – data • <Teenager rdf:about="http://example.com/colin"> • <mum rdf:resource="http://example.com/rosy" /> • <age>13</age> • </Teenager> Silterra, April 2004