[sc34wg3] XTM 1.1 schema

Lars Marius Garshol sc34wg3@isotopicmaps.org
Mon, 05 Dec 2005 21:26:42 +0100


I forgot to attach this to the previous email. We put together a rough
draft of a possible XTM 1.1 RELAX-NG schema in order to show what the
result would look like. We thought of doing up an example to show how
much simpler the result is, but the fact is that most actual XTM 1.0
would still be valid; it's only all the bizarre things you could do in
XTM 1.0 that are no longer allowed, and doing examples of those is a
bit harder.

Anyway, here is the schema. It's considerably simpler than the
previous draft.


# ===========================================================================
#
# XML Topic Maps 1.1
#
# Proposal based on initial editors' meeting.
#
# ===========================================================================

# --- Common declarations

default namespace = "http://www.topicmaps.org/xtm/"
namespace xtm = "http://www.topicmaps.org/xtm/"

datatypes xsd = "http://www.w3.org/2001/XMLSchema-datatypes"

start = topicMap

id = attribute id { xsd:ID }

href = attribute href { xsd:anyURI }

any-markup = (text | element * - xtm:* { attribute * { text }*, any-markup* })*


# --- The schema

topicMap = element topicMap { id?, version,
                              (topic | association | mergeMap)* }

version = attribute version { "1.1" }

topic = element topic { id, instanceOf*, subjectIdentity?, 
                        (topicName | occurrence)* }

subjectIdentity = element subjectIdentity { id?, 
  (reifies | subjectLocator | subjectIdentifier | itemIdentity)* }

topicName = element topicName { id?, instanceOf?, scope?, value, variant* }

value = element value { text }

variant = element variant { id?, scope, (resourceRef | resourceData) }

scope = element scope { topicRef+ }

instanceOf = element instanceOf { topicRef }

occurrence = element occurrence { id?,
  instanceOf?, scope?, ( resourceRef | resourceData ) }

datatype = attribute datatype { xsd:anyURI }

# tighten so only any-markup when datatype is XML
resourceData = element resourceData { datatype?, any-markup }

association = element association { id?, instanceOf?, scope?, role+ }

role = element role { id?, instanceOf?, topicRef }

topicRef = element topicRef { href }
resourceRef = element resourceRef { href }
subjectLocator = element subjectLocator { href }
subjectIdentifier = element subjectIdentifier { href }
reifies = element reifies { href } # really href???
itemIdentity = element itemIdentity { href }

mergeMap = element mergeMap { href }

# --- End of schema

-- 
Lars Marius Garshol, Ontopian         <URL: http://www.ontopia.net >
GSM: +47 98 21 55 50                  <URL: http://www.garshol.priv.no >