The Dublin Core calls itself a "metadata initiative," and it provides an RDF content model that is in wide use to describe Web resources. The Dublin Core has attracted the attention of museums, libraries, government agencies, and commercial groups as a way of standardizing RDF for Web resources. You can find out all about the Dublin Core at its home page, http://www.purl.org/dc.
In the previous example, I used a <Creator> property, without specifying a namespace for that property. However, when you create your own properties, you should use a namespace to avoid conflicts. The Dublin Core's namespace is "http://purl.org/DC/". In fact, the <Creator> property I've been using is modeled after the Dublin Core's <Creator> property. I can declare the Dublin Core's namespace—which is usually given the prefix dc—in the example document, and indicate that <Creator> is part of that namespace, like this:
<?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.starpowder.com/planets.html"> <dc:Creator>Nicolas Copernicus</dc:Creator> </rdf:Description> </rdf:RDF>
The <Creator> property is just one Dublin Core property; you can find all the defined Dublin Core properties in Table 18.1.
Each Dublin Core element also 10 ten attributes, which are taken from the ISO/IEC 11179 standard:
Attribute | Description |
---|---|
Comment | Is a comment about the use of the data in the element |
Datatype | Specifies the type of data in the element |
Definition | Defines the concept behind the data in the element |
Identifier | Is a unique identifier assigned to the element that identifies it |
Language | Specifies the language of the data in the element |
Maximum Occurrence | Puts a limit on how many times the element may occur |
Name | is the name you've assigned to the data element |
Obligation | Specifies whether the element is required |
Registration Authority | Refers to the agency or group authorized to register the element |
Version | Gives the version of the element |
In fact, 6 of these 10 attributes are common to all the Dublin Core elements, and they have fixed values. Here they are, along with their values:
Attribute | Value |
---|---|
Version | 1.1 |
Registration Authority | Dublin Core Metadata Initiative |
Language | en (that is, English) |
Obligation | Optional |
Datatype | Character String |
Maximum Occurrence | Unlimited |
The Dublin Core also lists a set of default resource types that you can use with the <Type> element:
collection
dataset
event
image
interactive resource
model
party
physical object
place
service
software
sound
text
You can find these types defined in detail at http://purl.org/DC/documents/wd-typelist.htm.
The example RDF document that we've seen so far has defined only one property for the "http://www.starpowder.com/planets.html" resource—the <Creator> property. In fact, you can assign multiple properties to resources, and now that we've seen all the available Dublin Core elements, I'll put more of them to work. For example, here's how I describe that resource's creator, title, and type:
<?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.starpowder.com/planets.html"> <dc:Creator>Nicolas Copernicus</dc:Creator> <dc:Title>Mercury</dc:Title> <dc:Type>text</dc:Type> </rdf:Description> </rdf:RDF>
An RDF document can also describe multiple resources—all you have to do is use multiple <rdf:Description> elements. For example, here's an RDF document that describes three resources, mercury.html, venus.html, and earth.html:
<?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.starpowder.com/mercury.html"> <dc:Creator>Nicolas Copernicus</dc:Creator> <dc:Title>Mercury</dc:Title> <dc:Type>text</dc:Type> </rdf:Description> <rdf:Description about="http://www.starpowder.com/venus.html"> <dc:Creator>Nicolas Copernicus</dc:Creator> <dc:Title>Venus</dc:Title> <dc:Type>text</dc:Type> </rdf:Description> <rdf:Description about="http://www.starpowder.com/earth.html"> <dc:Creator>Nicolas Copernicus</dc:Creator> <dc:Title>Earth</dc:Title> <dc:Type>text</dc:Type> </rdf:Description>> </rdf:RDF>
What if a property itself needs more description? For example, what if the creator of the resource is described by a Web page, and you want to refer the reader to that page? In that case, you can nest <rdf:Resource> elements. For example, if you want to describe Nicolas Copernicus, the creator of planets.html, with another Web page, NickC.html, that might look like this:
<?xml version="1.0" ? <rdf:RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dc="http://www.purl.org/DC/"> <rdf:Description about="http://www.starpowder.com/planets.html"> <dc:Title>Mercury</dc:Title> <dc:Creator> <rdf:Description about="http://www.starpowder.com/NickC.html"> <dc:Title>Nicolas Copernicus</dc:Title> <dc:Language>en</dc:Language> </rdf:Description> </dc:Creator> </rdf:Description> </rdf:RDF>
There's another way to refer to a resource that describes a property—you can give the resource's URI using the rdf:resource attribute. You use this attribute in the property element. Here's an example; in this case, I'm referring to the resource NickC.html to describe the creator of various documents:
<?xml version="1.0" ?> <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dc="http://www.purl.org/DC/"> <rdf:Description about="http://www.starpowder.com/mercury.html"> <dc:Title>Mercury</dc:Title> <dc:Creator rdf:resource="http://www.starpowder.com/NickC.html"/> </rdf:Description> <rdf:Description about="http://www.starpowder.com/venus.html"> <dc:Title>Venus</dc:Title> <dc:Creator rdf:resource="http://www.starpowder.com/NickC.html"/> </rdf:Description> <rdf:Description about="http://www.starpowder.com/earth.html"> <dc:Title>Earth</dc:Title> <dc:Creator rdf:resource="http://www.starpowder.com/NickC.html"/> </rdf:Description> </rdf:RDF>
As you can see, using the rdf:resource attribute makes it easy to connect the same property to a number of resources; in this case, I'm giving the mercury.html, venus.html, and earth.html all the same creator properties.
18.221.198.233