XML technologies / XML / XML in a Nutshell / XML on the web / Prospects for better web searching

(Excerpt from “XML in a Nutshell” by Elliotte Rusty Harold & W. Scott Means)

Part of XML’s excitement was that search engines might finally understand documents from markup. You could search for the film Sneakers and find that film without wading through “Internet Wide Area ‘Tiger Teamers’ mailing list”, “Children’s Side Zip Sneakers Recalled by Reebok”, “Infant’s ‘Little Air Jordan’ Sneakers Recalled by Nike”, “Sneakers.com – Athletic Shoes from Nike, Reebok, Adidas, Fila, New” and 32,395 other unrelated Google results. To be fair, four of Google’s first ten results did concern the film.

Little of this is visible yet: few web pages are XML, even as XML grows behind the scenes. Search engines see only output HTML. As that changes and engines improve, results should improve too. Meanwhile XML hints can be added to HTML for suitably equipped engines. Options include Resource Description Framework (RDF), Dublin Core and a processing instruction robots.

RDF

Resource Description Framework (RDF) can be viewed as XML encoding of a very simple data model. RDF describes resources using triples. Each triple states that a resource has a property with a value. Resources use URIs; properties use URIs or element-qualified names. Values can be plain strings, XML fragments or other URI-identified resources.

An RDF document’s root is the element RDF. Each resource described by RDF is represented by a Description element whose about attribute holds its URI. Each child of the Description element represents one property; its content is the value. All RDF elements, including RDF and Description, are in the namespace "http://www.w3.org/1999/02/22-rdf-syntax-ns#". Property values normally use other namespaces.

Suppose you want to state that the book XML in a Nutshell has authors W. Scott Means and Elliotte Rusty Harold. The resource identified by URI urn:isbn:3897213370 therefore has a property author with value W. Scott Means and another property author with value Elliotte Rusty Harold. The example shows this.

<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
   <rdf:Description about="urn:isbn:3897213370">
      <author>Elliotte Rusty Harold</author>
      <author>W. Scott Means</author>
   </rdf:Description>
</rdf:RDF>

Example: RDF identifying the authors of XML in a Nutshell

Here the values of the author property are plain text, but could equally be XML, including further RDF elements.

RDF also includes containers, schemas and nested properties. This example nevertheless suffices to describe web metadata.

For more RDF information see RDF basics and subsequent pages.

Dublin Core

The Dublin Core is a standard set of 15 information items with defined semantics, reflecting data found in catalogs or annotated bibliographies:

  • Title

    The name by which the resource is known. This book’s title is XML in a Nutshell.

  • Creator

    The creating person or organization: painter, author, illustrator, composer and so on. This book’s creators are W. Scott Means and Elliotte Rusty Harold.

  • Subject

    Keywords, probably from another vocabulary such as Dewey Decimal or Yahoo categories, identifying the resource’s topics. In Library of Congress vocabulary, this book’s subject is “XML (Document markup language)”.

  • Description

    Usually a few sentences describing the content, but possibly a picture, contents list or another description. This book could be described as “A tutorial and quick reference for XML and related technologies and specifications.”

  • Publisher

    The person, company or organization making the resource available; here O’Reilly Media, Inc.

  • Contributor

    A contributing person or organization other than the main creator: this book’s translators and editors, cover artist or layout designer, for example.

  • Date

    Creation or publication date, normally in the form JJJJ-MM-TT. This book’s date could be 2004-09-23.

  • Type

    Abstract resource type, such as image, text, sound or software. This book would have type Text.

  • Format

    For physical objects such as books, format describes dimensions. The printed XML in a Nutshell measures 6" × 9" (17.2 cm × 23 cm). For digital resources, format may be the MIME type. An online version would have format text/html.

  • Identifier

    A formal identifier such as ISBN, URI or social security number. This book’s identifier is “3897213397”.

  • Source

    The resource from which this one derives. A French translation could identify the original English edition as its source.

  • Language

    The resource’s language, normally an ISO-639 code, optionally followed by a hyphen and ISO-3166 country code. This book uses de-DE; the original edition uses en-US.

  • Relation

    A link to a related resource, generally using a formal identifier such as URI or ISBN—for example this book’s website.

  • Coverage

    Place, time or jurisdiction covered. This book might cover Germany, Austria and Switzerland; the American edition might cover the USA, Canada, Australia, Great Britain and Ireland. Coverage normally uses formal syntax such as country codes.

  • Rights

    Copyright, patent, trademark and other content restrictions. A statement might read “Copyright 2004 O'Reilly Media, Inc.”

Dublin Core can be encoded in many forms, including HTML meta tags and RDF. Here we focus on RDF. Each resource is normally described by an rdf:Description element, with children for as many known Dublin Core items as possible. Their names match the fifteen properties and belong to the "http://www.purl.org/dc/" namespace. The next example describes the American edition of this book in RDF Dublin Core.

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dc="http://www.purl.org/dc/elements/1.1">
  <rdf:Description about="urn:isbn:0596007647">
    <dc:Title>XML in a Nutshell</dc:Title>
    <dc:Creator>W. Scott Means</dc:Creator>
    <dc:Creator>Elliotte Rusty Harold</dc:Creator>
    <dc:Subject>XML (Document markup language)</dc:Subject>.
    <dc:Description>A brief tutorial on and quick reference to XML and related technologies and specifications</dc:Description>
    <dc:Publisher>O'Reilly Media, Inc.</dc:Publisher>
    <dc:Contributor>Laurie Petrycki</dc:Contributor>
    <dc:Contributor>Simon St. Laurent</dc:Contributor>
    <dc:Contributor>Jeni Tennison</dc:Contributor>
    <dc:Contributor>Susan Hart</dc:Contributor>
    <dc:Date>2004-08-23</dc:Date>
    <dc:Type>text</dc:Type>
    <dc:Format>6" × 9"</dc:Format>
    <dc:Identifier>0596007647</dc:Identifier>
    <dc:Language>en-US</dc:Language>
    <dc:Relation>http://www.oreilly.com/catalog/xmlnut3/</dc:Relation>
    <dc:Coverage>US UK ZA CA AU NZ</dc:Coverage>
    <dc:Rights>Copyright 2002 O'Reilly Media, Inc.</dc:Rights>
  </rdf:Description>
</rdf:RDF>

Example: An RDF Dublin Core description of XML in a Nutshell, American edition

There is not yet a standard linking RDF to its described XML. One option embeds the rdf:RDF element in the document, for example as a child of the BookInfo element in this book’s DocBook source. Alternatively, servers could supply metadata through another channel. A standard protocol could let engines request it for all site pages. A convention could assign each site URL xyz a corresponding URL xyz/meta.rdf holding its RDF Dublin Core metadata.

Robots

In HTML the META tag robots tells engines and agents whether indexing is permitted. Walter Underwood proposed this processing instruction as the XML equivalent:

 <?robots index="yes" follow="no"?> 

Agents look for it in each XML document’s prolog. Its syntax has two pseudo-attributes, index and follow, with values either yes or no. If the attribute index has value yes, the search agent indexes the page. If the setting is index no, it does not. If follow has value yes, links from the document are followed. If follow equals no, they are not followed.

  

 

 

 

back to top