3' RDF and XML - PowerPoint PPT Presentation

1 / 21
About This Presentation
Title:

3' RDF and XML

Description:

1. Basic of RDF. 2. Example of RDF. 3. How XML Namespaces Work. 4. The Abbreviated RDF Syntax ... rdf:li xml:lang='en' The Coolest Web Page /rdf:li ... – PowerPoint PPT presentation

Number of Views:29
Avg rating:3.0/5.0
Slides: 22
Provided by: klplReP
Category:
Tags: rdf | xml | coolest | namespaces

less

Transcript and Presenter's Notes

Title: 3' RDF and XML


1
3. RDF and XML
  • ???? ???
  • ???

2
??
  • 1. Basic of RDF
  • 2. Example of RDF
  • 3. How XML Namespaces Work
  • 4. The Abbreviated RDF Syntax
  • 5. RDF Resource Collections
  • 6. Reified Statements

3
Basic of RDF
  • The Triples of RDF
  • resource, property, and property value.
  • Literals
  • Constants (String values)
  • A relationship between a resource and a literal
    is expressed by a statement, which connects a
    subject with an object via a predicate

4
Basic of RDF
  • Ex
  • The author of this book is Johan Hjelm

5
Basic of RDF
  • The difference from traditional predicate logic
  • The syntax of RDF is declared in the RDF Schema
  • The RDF Schema
  • define the set of resource and literal values
  • creates the structure which you later fill with
    your description.

6
Example of RDF
  • Simple RDF graph
  • http//www.wireless-information.net -gt Creator -gt
    Johan Hjelm
  • Creator of http//www.wireless-information.net is
    Johan Hjelm

7
Example of RDF
  • We might also want to make clear that we meant
    creator in some special, well-defined sense, by
    using a special element, dcCreator (as opposed
    to biblicalCreator, for instance).
  • Of course, then we would have to declare where
    the definition of that special element came from.

8
Example of RDF
  • lt?xml version1.0?gt
  • ltrdfRDF xmlnsrdfhttp//www.w3.org/1999/02/2
    -rdf-syntax-ns xmlnsdchttp//purl.org/dc/elem
    ent/1.1/gt
  • ltrdfDescription abouthttp//www.wireless-i
    nformation.net/gt
  • ltdccreator rdfresourcehttp//johanhjel
    m.com/whois/ /gt
  • lt/rdfDescriptiongt
  • lt/rdfRDFgt

9
Example of RDF
  • lt?xml version1.0gt
  • The XML declaration shows that this is XML, and
    declares which version it is.
  • ltrdfRDF xmlnsrdfhttp//www.w3.org..
  • The rdf element begins here It encapsulates the
    actual statement and is followed by the namespace
    declaration. It also the RDF namespace (i.e.,
    where to find out what all tags prefixed with
    rdf mean)

10
Example of RDF
  • Xmlnsdc http//purl.org/dc/elements...
  • The second namespace declaration declares the
    Dublin Core namespace, here prefixed with dc .
    Both namespace declarations are attributes on the
    rdf element.
  • ltrdfDescription about http//www.wireless...
    gt
  • The rdfDescription elements declares which
    resource the statement is about.

11
Example of RDF
  • ltdccreator rdfresource http//johanhjelm.com/.
    . /gt
  • The dcCreator element contains the value of the
    dcCreator property.
  • There can be more properties for the same
    resource.

12
How XML Namespaces Work
  • XML namespaces
  • identify a set of element names by using prefixes
    in the RDF code
  • declaring the namespace in the head of the
    document.
  • Namespaces
  • declared using a family of reserved attributes
  • Such an attributes name must either be xmlns or
    have xmlns as a prefix (these two are reserved,
    but you can use any other prefix for your
    namespaces).

13
The Abbreviated RDF Syntax
  • ltrdfdescriptiongt about http//www.wireless-..
    gt ltdccreatorgtjohanhjelm.comlt/dccreatorgtlt/rdf
    descriptiongt
  • And the abbreviated syntax looks like this
  • ltdescription about http//www.wireless-..
    dccreator johanhjelm.com /gt

14
RDF Resource Collections
  • Bag
  • Unordered list of resource (URIs) or atomic
    values (literals, i.e., strings).
  • Used to declare that a property has multiple
    values
  • The order of the values does not matter
  • There can be duplicates of resources and
    duplicate values in literals.

15
RDF Resource Collections
  • Sequence
  • Ordered list of resources or atomic values
    (literals)
  • The order is significant
  • Possible to have duplicates of the same value
  • Used to declare that a property has multiple
    values.

16
RDF Resource Collections
  • Alternative
  • List of resources or values that represent
    possible alternatives for the (single) value of a
    property
  • Choose any one of the items in the list

17
Reified Statements
  • There is a mechanism in RDF to make statements
    about statements (he said that she said). In
    philosophy, this is called a reified statement.

18
Reified Statements
  • ltRDFgt xmlns http//www.w3.org/1999/...
    xmlnsrdf http//www.w3.org/1999/...
    xmlnsdc http//purl.org/metadata/dc..
    xmlnsl http//mycorp.com/schemas..
    ltDescription about http//www.Webnuts.net/Jan97.
    htmlgt ltdcsubject rdfvalue020Library
    Science lClassificationDewey Decimal
    Code/gt lt/Descriptiongtlt/RDFgt
  • The page Jan97.html in the site www.Webnut.net
    has a Dublin Core Subject that is Library
    Science, 020 according to the Dewey Decimal Code

19
Reified Statements
  • The different namespaces make the elements
    unique, using the namespace mechanism.
  • Each set of elements (the vocabulary) has to be
    described by a schema, which contains more
    information than what is available in the DTD.
  • The RDF Schema language describes the parameters
    of the elements

20
Reified Statements
  • To further illustrate how to use aggregates,
    consider an example of a document with two
    authors specified alphabetically, a title
    specified in two different languages, and having
    two equivalent locations on the Web
  • ltrdfRDF xmlnsrdf http//www.w3.org..
    xmlnsdc http//purl.org../dc..
    ltrdfDescription about http//www.foo.com/cool.h
    tmlgt ltdcCreatorgt ltrdfSeq ID
    CreatorsAhphabeticalBySurnamegt ltrdfligtMary
    Andrewlt/rdfligt ltrdfligtJacky
    Crystallt/rdfligt lt/rdfSeqgt lt/dcCreatorgt

21
Reified Statements
  • ltdcIdentifiergt ltrdfBag IDMirroredSitesgt
    ltrdfli rdfresource http//www.foo.com.au
    /cool.html/gt ltrdfli rdfresource
    http//www.foo.com.it/cool.html/gt
    lt/rdfbaggt lt/dcIdentifiergt ltdcTitlegt
    ltrdfAltgt ltrdfli xmllangengtThe Coolest
    Web Pagelt/rdfligt ltrdfli xmllangitgtI1
    Pagio di Web Fubalt/rdfligt lt/rdfAltgt
    lt/dcTitlegt lt/rdfDescriptiongtlt/rdfRDFgt
Write a Comment
User Comments (0)
About PowerShow.com