Tuesday 17 March 2009

Trying to work out how to write an XMP Schema

This morning I started checking my email, and then went to help Trevor with his computer as his printer wasn't working.

After that I finished checking my email and read a bit about RDF and writing RDF schemas. I'm still a bit confused though, as the way to write an RDF Schema described by W3Schools and by the W3C is different to how the Dublin Core and IPTC Core schemas are structured.

The W3 examples have xml:base= "http://thisNameSpaceURL#" as an attribute of the root <rdf:RDF> element. However the IPTC and Dublin Core Schemas don't include this.

The other difference is that the W3 examples use rdf:ID="myProperty" as an attribute of the <rdf:Description> element, whilst the Dublin and IPTC Core schemas use rdf:about="http://thisNameSpaceURL/myProperty" as an attribute of the <rdf:Description> element.

I noticed that many namespace URLs don't seem to actually exist, and it seems this quite normal: Old Ghosts: XML Namespaces, so I don't really understand what the point of writing a schema is if you don't need one.

This is also backed up by the XMP Specification:

An XMP Schema is a set of top level property names in a common XML namespace, along with data type and descriptive information. Typically, an XMP schema contains properties that are relevant for particular types of documents or for certain stages of a workflow. Chapter 4, “XMP Schemas”, defines a set of standard metadata schemas and explains how to define new schemas.

NOTE: The term “XMP Schema” used here to clearly distinguish this concept from other uses of the term “schema”, and notably from the W3C XML Schema language. An XMP Schema is typically less formal, defined by documentation instead of a machine readable schema file.

An XMP Schema is identified by its XML namespace URI. The use of namespaces avoids conflict between properties in different schemas that have the same name but different meanings. For example, two independently designed schemas might have a Creator property: in one, it might mean the person who created a resource; in another, the application used to create the resource.

The namespace URI for an XMP Schema must obey the rules for XML 1.1 namespaces. In addition, to operate well with RDF it must end with a ‘/’ or ‘#’ character. (See “Namespace URI termination” on page 29) The URI might or might not actually locate a resource such as a web page. XMP places no significance on the scheme or components of the namespace URI.

An XMP Schema will also have a preferred namespace prefix. Property names are often written in documentation with the prefix in the manner of XML qualified names, such as dc:creator. Following the rules of XML namespaces, use of this prefix is only a suggestion not a requirement. The actual prefix used when saving XMP might differ, and is local to the xmlns attribute that declares it.

Use of standard URI schemes is encouraged when creating namespace URIs. In order to avoid collisions, the URI should contain a component owned by the namespace creator such as an Internet domain name. Do not create namespaces in domains owned by others.


In the evening I watched the latest Futurama film, Flight Of The Conchords episode and Office episode. I thought both FOTC & The Office were better than usual this week. FOTC had a hilarious scene in it where Bret is in a pet shop wearing a kilt and a walkie talkie on loudspeaker, trying to impress the woman who works there while Dave and Jermaine shout stupid instructions through the walkie talkie (they're hiding in a car outside).

After that I checked my email again and the canon lens forum on dpreview.

The weather was overcast all day today except for a few minutes in the afternoon. It was quite cold in the morning as well.

Food
Breakfast: Grapefruit marmalade toast sandwich; cup o' tea.
Lunch: 2x Cheese on toasts; clementine; One of Ben's big chocolate truffles; cup o' tea.
Dinner: Beef pie; potatoes; carrots; peas; gravy. Pudding was microwave fruit sponge with custard and a bit of Golden syrup. Coffee; Quality Street.

2 comments:

TheGuyWhoMakesEveryoneFeelGreatAboutTheirLives said...

did you ever figure out XMP schemas?

Rusty said...

No, I didn't. A schema isn't actually needed for writing custom XMP. You just need a namespace URI, which doesn't even need to resolve to a real web address.