[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: proof-of-concept in RELAX NG
My time is about to get really limited, so am just going to post this so people can look at it at their leisure. I realize we do need to start with requirements, but it's also helpful to know what technical constraints we do (or don't) have. I'd argue this could cover most or all of the use cases, though there'd need to be separate work on the linking of content to these descriptions. This simply shows how we would say in RELAX NG "we allow arbitrary metadata content based on a particular profile of the RDF model, according to these constaints." Note that the schema is a generic schema, but includes an example at the end of an extension module (in this case, DC). It's documented, such that a spec can be extracted from it (if and when it's done, which it is not now certainly). Anyway, this document validates against it: <?xml version="1.0" encoding="UTF-8"?> <?oxygen RNGSchema="meta-proposal.rnc" type="compact"?> <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:x="http://ex.net/x"> <rdf:Description rdf:about="http://x.com"> <dc:date>2005-03-23</dc:date> <x:test>arbitrary content test</x:test> <dc:title>X</dc:title> </rdf:Description> <x:Foo rdf:about="tag:arbitrary-resource"> <dc:title>Bar</dc:title> </x:Foo> </rdf:RDF> ===== namespace a = "http://relaxng.org/ns/compatibility/annotations/1.0" namespace dc = "http://purl.org/dc/elements/1.1/" namespace dcterms = "http://purl.org/dc/terms/" namespace local = "" namespace meta = "urn:oasis:names:tc:opendocument:xmlns:meta:1.0" namespace rdf = "http://www.w3.org/1999/02/22-rdf-syntax-ns#" dc:creator [ "Bruce D’Arcus" ] dc:description [ "This schema illustrates one possible way to support flexible but integrated metadata in OpenDocument." ] ## OpenDocument metadata support is designed to be flexible and extensible, but ## also to provide a simple and consistent common model based on RDF. ## Metadata thus consists of a handful of generic concepts: properties, resources, ## collections, and modules. Groups of domain-specific properties can be defined ## as "modules." As in RSS 1.0, modules are properties that share a single ## namespace. ODF includes default modules to describe documents and contacts: ## Dublin Core, Extended Dublin Core, and vCard. Extension modules can be defined ## independent of the ODF TC process, but can be submitted to the TC for formal ## inclusion in the specification where appropriate. start |= meta-collection ## Metadata "collections" are lists of descriptions. In XML, they are wrapped in ## an rdf:RDF element, without any attributes. Collections should be single files ## that are focused on a particular functionality (document descriptions, bibliographies, ## captions, and so forth), registered with the ODF manifest.xml file, using a mime-type ## of "text/xml+rdf". meta-collection = element rdf:RDF { meta-resource+ } ## Metadata descriptions are "resources", represented in XML as namespaced child ## elements of a collection root, with an "rdf:about" attribute whose value is a URI. div { ## Resources may be typed either with a specific namespaced URI, or by using a ## generic "rdf:Description" element with a "rdf:type" child element. meta-resource = element * - (local:* | dc:*) { meta-about, meta-properties } ## "Blank" nodes are unidentified resources that provide rich descriptions for properties. meta-resource.blank = element * - (local:* | dc:*) { meta-properties } } div { ## Resources are described by lists of "properties", elements which can be of two kinds: meta-properties = meta-property.simple | meta-property.rich ## "simple" properties have content, but no child elements; may have an xml:lang attribute meta-property.simple = element * - (local:* | dc:*) { attribute xml:lang { xsd:language }?, text }* ## "rich" properties have either child resource descriptions, or a link to other ## descriptions using an rdf:resource attribute meta-property.rich = element * - (local:* | dc:*) { meta-resource.blank | meta-link }* } ## The content model is assumed to be unordered. However, one may indicate order in one of two ways: ## 1. use an rdf:Seq element as a child of a property ## 2. use a meta:position element as a property of a resource meta-sequence = element rdf:Seq { element rdf:li { meta-resource.blank | meta-link } } meta-position = element meta:position { xsd:integer } ## generic metadata attributes div { meta-link = attribute rdf:resource { xsd:anyURI } meta-about = attribute rdf:about { xsd:anyURI } } ## a demonstration of module inclusion using RELAX NG div { meta-properties &= meta-module.dc? meta-module.dc = element dc:title { text }? & element dc:date { xsd:date }? } ====
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]