Lifecycle Metadata for Digital Objects

24
Lifecycle Metadata for Digital Objects September 27, 2004 Implementing Metadata in XML

description

Lifecycle Metadata for Digital Objects. September 27, 2004 Implementing Metadata in XML. What constitutes the XML environment?. XML editor (note that it can’t do anything automatic until you load a DTD or schema or have entered a number of elements) XML parser/validator - PowerPoint PPT Presentation

Transcript of Lifecycle Metadata for Digital Objects

Page 1: Lifecycle Metadata for Digital Objects

Lifecycle Metadata for Digital Objects

September 27, 2004

Implementing Metadata in XML

Page 2: Lifecycle Metadata for Digital Objects

What constitutes the XML environment?

• XML editor (note that it can’t do anything automatic until you load a DTD or schema or have entered a number of elements)

• XML parser/validator• Display program (e.g. browser)• DTD or schema to define elements• Style sheet for display of elements• XSLT engine to convert to other formats (e.g.

database)

Page 3: Lifecycle Metadata for Digital Objects

Tools for home use

• In class we will be using XMetaL Author, but it’s not free (there is a trial download if you are a registered Corel user).

• One free XML authoring environment is Amaya from the W3C: http://www.w3.org/Amaya/

• Another is XML Cooktop: http://www.xmlcooktop.com/

• You can also validate individual XML files using online web services pointed to at: http://www.cogsci.ed.ac.uk/~richard/xml-check.html

Page 4: Lifecycle Metadata for Digital Objects

Review of “orders” of data• First-order: language (segmentation)• Second-order: encoding• Third-order: meaning• Fourth order: function• Fifth order: groups of 3 and/or 4• Note that each order is “meta” with respect to the

one below and “data” with respect to the one above (cf. Goedel)

• Hence you mark up the order you wish to objectivize and access (examples: TEI, EAD)

Page 5: Lifecycle Metadata for Digital Objects

XML does nothing

• XML structures information

• XML stores information

• XML sends information

• XML is not procedural

Page 6: Lifecycle Metadata for Digital Objects

Two fancy wrappers (what orders are involved?)

• The XML document as metadata repository– XML document contains all the metadata– Objects themselves are in separate files pointed

to by the document (XLinks)

• The XML document as the whole enchilada– Object is marked up in XML too– Metadata is added as additional elements to the

original object

Page 7: Lifecycle Metadata for Digital Objects

Why not mark up the object (I.e., place markup within the object)?

• If the object is not a text!

• If the object is a text, but the text is too complex to mark up in XML (hierarchical model doesn’t suit everything; “overlap” problem)

Page 8: Lifecycle Metadata for Digital Objects

Why mark up the object itself?

• If the object is a text

• If the text is well-formed as a hierarchical structure (problem of overlaps not solved in XML)

• Advantage is that the object carries its own metadata

Page 9: Lifecycle Metadata for Digital Objects

Best of both worlds

• XML metadata tags

• (Text) object marked up in XML

• Original (text) object pointed to in separate file for preservation

Page 10: Lifecycle Metadata for Digital Objects

XML Syntax rules for well-formed XML

• An element containing text or elements must have start and end tags

• An empty element’s tag must have a slash (/) before the end bracket

• All attribute values must be in quotes• Elements may not overlap• Isolated markup characters may not appear in parsed

content• Element names may not use all characters, and case is

significant

Page 11: Lifecycle Metadata for Digital Objects

*Structure of the XML Document*

• Document prologue– XML declaration– Document type declaration

• Points to root element• Points to external standards (DTDs, namespaces)• Lists special internally-defined elements

• Document itself– Bracketed by root element– Contains elements, attributes, entities– Nested structure

Page 12: Lifecycle Metadata for Digital Objects

XML Declaration

• Gives version of XML– <?xml version=“1.0”?>

• Defines character encoding– <?xml version=“1.0” encoding=“UTF-8”?>

• Indicates presence of other needed files– <?xml version=“1.0” encoding=“UTF-8”

standalone=“no”?>

Page 13: Lifecycle Metadata for Digital Objects

Document type declaration

• Points first to root element– <!DOCTYPE example>

• Then points to any external source for definition of document structure– <!DOCTYPE example SYSTEM “c:\My

Documents\classes\metadata\example.dtd”…>

• Then adds any overriding local elements (internal subset)

Page 14: Lifecycle Metadata for Digital Objects

Function of the DTD

• Document Type Definition; not expressed in XML• Defines the language in which you will be talking

about objects and against which the XML markup may be validated: it is the grammar of the XML document that refers to it

• Equivalent to declaration of data types in a programming language; allows you to define your own types (a private, or SYSTEM DTD)

• Or you can use a preexisting DTD (a PUBLIC DTD, example: EAD)

Page 15: Lifecycle Metadata for Digital Objects

Element declarations in the DTD

• Occur within the DTD or to give local definition overriding the DTD– <!ELEMENT name content-model>

• Content-models:– (#PCDATA) for character data– (element, element, element…) modified by

, | ? + *

Page 16: Lifecycle Metadata for Digital Objects

Attribute declarations in the DTD

• All attributes for one element declared in an attribute list

• Gives attribute name, attribute’s data type, attribute’s behavior– <!ATTLIST elementname

attname1 atttype1 attdesc1

attname2 atttype2 attdesc2

>

Page 17: Lifecycle Metadata for Digital Objects

Entity declarations in the DTD

• General entities are like variables. They assign a name and define a type. Examples:

• quoted text <!ENTITY title “Temporary crazy title”>

• text from an external source• other data from an external source

<!ENTITY logo SYSTEM “images/logo.gif” NDATA gif>

Page 18: Lifecycle Metadata for Digital Objects

Elements in the XML document

• Container elements (element tags bracket data)– <name attribute=value>chardata</name>

• Empty elements (no data is contained, begin and end element tags are collapsed to one)– <name attribute=value />

Page 19: Lifecycle Metadata for Digital Objects

Attributes in the XML document

• Used to provide more details about an element

• <elementname attname=“value”>

Page 20: Lifecycle Metadata for Digital Objects

Entities in the XML document

• The “entity” behaves like a “variable”

• Within the document, the entity name is used preceded by an ampersand:– <greeting> Dear &name, </greeting>

• When the document is displayed or used, the entity value at the time will be substituted for the name

Page 21: Lifecycle Metadata for Digital Objects

Tools for working with XML

• Authoring, display– Amaya (free W3C browser/authoring software)– XML Cooktop (free XML authoring software)

• Display– Internet Explorer– Netscape 6– Mozilla

• Database– Apache Xindice

Page 22: Lifecycle Metadata for Digital Objects

XML Cooktop editor screenshot

Page 23: Lifecycle Metadata for Digital Objects

Amaya screenshot

Page 24: Lifecycle Metadata for Digital Objects

How does all this relate to databases?

• By defining a “language” for markup in XML, you create categories

• Even freely-occurring objects can thus be found and grouped (e.g., TEI grammatical markup)

• Compare to accepted method of placing text in a relational table in order to process it

• Especially useful for regularly-occurring metadata• This is why the structure of a markup scheme is so

important: you get what you pay for