[tei-council] TEI Conformance

Conal Tuohy Conal.Tuohy at vuw.ac.nz
Tue Nov 28 18:20:09 EST 2006


Syd Bauman wrote:

> So we need to think about how an ODD-creating user says "My new <foo>
> element has a blort= attribute that is just like the TEI blort=
> attribute; my new <bar> element has a blort= attribute that is
> completely different".

I think (hope!) this has a straightforward solution. In both cases,
since the elements are new, their names should be in a new namespace
(let's call it the "foobar" namespace). 

In the first case (foobar:foo), the new "blort" attribute would be in no
namespace (i.e. the same as the existing TEI blort attribute), and it
should be defined in the ODD by reference to the TEI-defined "blort"
attribute (i.e. using an attRef). 

In the second case (foobar:bar), the custom "blort" attribute would be
defined using an attDef rather than an attRef. It also need not use a
namespace because it is defined on a element which is in its own
namespace already.


To use a different and more concrete example, consider a customisation
which defines a new element for encoding the names of biological
organisms, genes, proteins, etc. 

This new element should be a member of the TEI class "naming", along
with "rs", "name", "persName", "geogName", etc, and will thereby inherit
the TEI-defined attribute "key", which might be used to encode a "Life
Science ID" (a kind of URN for biological entities). 

Assume also that it has a new attribute called "authority", which is
some kind of pointer to an external authority (such as the website of
the World Wide Protein Data Bank).

I'd envisage the element used like so in a TEI document:

<bio:name 
	xmlns:bio="http://bio.some-domain.edu/ns/tei-bio" 
	key="urn:lsid:pdb.org:1AFT:1"
	authority="http://www.wwpdb.org/">first version of the 1AFT
protein</bio:name>

The element itself is new, so it must use its own new namespace.
The "key" attribute is an existing TEI-defined attribute (which has no
namespace).
The "authority" attribute is new, but since it is defined to apply only
to bio:name elements, it does not need to use a namespace either. 

It could be defined in ODD like so:

<elementSpec
	module="bio"
	xml:id="bio"
	ident="name"
	ns="http://bio.some-domain.edu/ns/tei-bio">
	<classes>
		<!-- here we inherit the "key" attribute -->
		<memberOf key="att.naming"/>
	</classes>
	<attList>
		<!-- here the "authority" attribute is explicitly
defined -->
		<attDef ident="authority" 
			usage="rec" 
			ns="http://bio.some-domain.edu/ns/tei-bio">
			<dataType>
				<ref
xmlns="http://relaxng.org/ns/structure/1.0" 
					name="data.pointer"/>
			</dataType>
			<desc>Pointer to a name authority</desc>
		</attDef>
	</attList>
	<content>
		<ref xmlns="http://relaxng.org/ns/structure/1.0" 
			name="macro.phraseSeq"/>
	</content>
</elementSpec>

I haven't tested that, but I think it's right.

On the other hand, if the customisation added the "authority" attribute
to all TEI naming elements, then the attribute's name would have to be
in a namespace. (Why? Because otherwise a different customisation could
also define an "authority" attribute for those elements, with different
semantics, and there'd be a possibility of the 2 names "colliding".)

<!-- here the "authority" attribute is added to the "att.naming" class
-->
<classSpec
	ident="att.naming"
	type="atts"
	mode="add">
	<attList>
		<!-- here the "authority" attribute is explicitly
defined -->
		<attDef ident="authority" 
			usage="rec" 
			ns="http://ns.foobar.com/tei-authority"
			<dataType>
				<ref
xmlns="http://relaxng.org/ns/structure/1.0" 
					name="data.pointer"/>
			</dataType>
			<desc>Pointer to a name authority</desc>
		</attDef>
	</attList>
</classSpec>

<elementSpec
	ident="name"
	ns="http://bio.some-domain.edu/ns/tei-bio">
	<classes>
		<!-- here we inherit both the "key" and "authority"
attributes -->
		<memberOf key="att.naming"/>
	</classes>
	<content>
		<ref xmlns="http://relaxng.org/ns/structure/1.0" 
			name="macro.phraseSeq"/>
	</content>
</elementSpec>

The corresponding usage would be:

<bio:name 
	xmlns:bio="http://bio.some-domain.edu/ns/tei-bio" 
	xmlns:auth="http://ns.foobar.com/tei-authority"
	key="urn:lsid:pdb.org:1AFT:1"
	auth:authority="http://www.wwpdb.org/">first version of the 1AFT
protein</bio:name>

> We also need to think through what should be done when a user adds a
> "normal" TEI attribute to a "normal" TEI element that does not
> "normally" have that attribute, either directly in the ODD or by
> class membership.

I don't think this kind of customisation has any implications in terms
of namespaces, though, does it?

> I'm sure there are other issues to be tackled, just giving a flavor
> of the kinds of worms we're going to have to eat if we open this can. 

I'm sure there are other issues, yes. But I think we have already opened
the "XML namespaces" can just by using namespaces in TEI P5 (not just
the TEI namespace, but also the "xml" namespace and the RelaxNG
namespace). 

Having introduced namespaces we really must follow through on it and
provide guidelines for users so that their customisations use namespaces
properly, otherwise we'll have all kind of problems when we come to use
those customisations (especially when combining 2 customisations
together). Namespace guidelines are particularly important given that
many TEI users will have been using TEI since long before XML namespaces
were even thought of, and may have had no experience with them until
now.



More information about the tei-council mailing list