This page is a subpage of [[CMDI 1.2]] = Namespace per profile = [[PageOutline(1-4)]] == The issue == In [http://www.openarchives.org/OAI/openarchivesprotocol.html#MetadataNamespaces OAI-PMH Section 3.4 metadataPrefix and Metadata Schema] its made clear that to be compliant a metadata record should have an schema location that matches the URL of the schema registered for the metadataPrefix. Due to the flexible nature of CMDI there can currently be many schemata associated with the metadataPrefix, i.e., one per CMD profile. The solutions for this issue can either based on agreements within the CLARIN community on using OAI-PMH for CMDI (solutions 1 to 3), but it can also mean changes to CMDI with regards to namespaces (other solutions). == Proposed solutions == === First solution: be pragmatic === One can be pragmatic and conclude that we have been using OAI-PMH for harvesting CMDI for several years now, so this non-compliance can be ignored. ==== Pros ==== Everything stays as it is ==== Cons ==== Non-compliance does indicate a problem, and will puzzle implementers ==== Centre impact ==== None, as nothing changes ==== Implementation examples ==== None, as nothing changes ==== Discussion ==== [[oschonef|Oliver (IDS)]]: NACK: CLARIN is about standards, interfaces and sustainability; this solution utilizes OAI-PMH in non obvious means and therefore violates CLARIN's principles. We should not do this. === Second solution: profile specific metadataPrefixes === A metadataPrefix per profile, e.g., cmdi0554, cmdi0571, cmdi2312. Each of these metadataPrefixes is linked to a different schema. A first version of this has been implemented. The harvester can list multiple metadataPrefixes per provider endpoint. When a provider adds a new metadataPrefix this currently still requires an update of the harvester configuration to actually request the records offered for that prefix. There can be an agreed pattern in the CLARIN community, e.g., harvest every metadataPrefix starting with 'cmdi'. In that case the harvester doesn't need additional configuration but can infer the to be used metadataPrefixes itself. ==== Pros ==== Compliance, and partially implemented ==== Cons ==== Needs additional configuration per provider or CLARIN specific agreements on the use of OAI-PMH ==== Centre impact ==== The centers that currently use multiple CMD profiles but use only one cmdi metadataPrefix need to implement the metadataPrefix per profile approach ==== Implementation examples ==== None ==== Discussion ==== [[oschonef|Oliver (IDS)]]: NACK: This is rather a crude hack than a solution, because it (again) utilizes OAI-PMH in non obvious means. We should not do this. === Third solution: up to the centers === Leave it up to the centers to choose between the first or second solution. ==== Pros ==== If you don't care about compliance you can leave everything as it is ==== Cons ==== Mixed compliance within the CLARIN community. Still needs some additional configuration or CLARIN specific agreements on the use of OAI-PMH ==== Centre impact ==== Depends on the wanted compliance level ==== Implementation examples ==== None ==== Discussion ==== [[oschonef|Oliver (IDS)]]: NACK: Mixed compliance within CLARIN is a recipe for disaster in a (near|distant) future. We should definitely not do this. === Fourth solution: CMD envelop and payload specific schemas and namespaces === The envelope of a CMD record is fixed and described by the [http://infra.clarin.eu/cmd/xsd/minimal-cmdi.xsd minimal CMD schema] (TODO: needs to be synced with the latest version of the envelope generated by the [http://infra.clarin.eu/cmd/xslt/comp2schema-v2/comp2schema.xsl CMDI XSD XSLT]). We can bind this schema to the metadataPrefix and also use it in the instance. The profile specific schema would then only describe the profile specific part of the CMD record. However the namespace schema binding in xsi:schemaLocation only allows us to use a namespace once, which means we need two namespaces one for the envelope and one for the payload: * http://www.clarin.eu/cmd/envelope namespace URI associated with http://infra.clarin.eu/cmd/xsd/minimal-cmdi.xsd * http://www.clarin.eu/cmd/payload namespace URI associated with the profile specific XSD ==== Pros ==== Compliance with OAI-PMH ==== Cons ==== Namespace changes for all CMD records ==== Centre impact ==== * All tools that work with CMD records need to be changed * All CMD records need to be changed ==== Implementation examples ==== OAIHandler?verb=!ListMetadataFormats {{{ #!xml 2013-12-02T17:28:30Z http://oai.clarin-beta.dans.knaw.nl/oaicat/OAIHandler oai_dc http://www.openarchives.org/OAI/2.0/oai_dc.xsd http://www.openarchives.org/OAI/2.0/oai_dc/ cmdi http://infra.clarin.eu/cmd/xsd/minimal-cmdi.xsd http://www.clarin.eu/cmd/envelope }}} Minimal CMDI XSD {{{ #!xml ... }}} Profile schema {{{ #!xml ... ... ... }}} CMD record {{{ #!xml ... ... ... }}} ==== Discussion ==== [[oschonef|Oliver (IDS)]]: This is better than solution 1-3, but still has the issue of using XML namespaces in non obvious ways. The XML namespace specification section 3 [http://www.w3.org/TR/xml-names/#ns-decl Declaring Namespaces] states the following on uniqueness: > The namespace name, to serve its intended purpose, SHOULD have the characteristics of uniqueness and persistence. If we use the same namespace name (= URI) for different schemas, we are violating the XML namespace specification. We should not do this. === Fifth solution: profile specific payload namespaces === Same as the fourth solution but instead of a fixed namespace to be used by all profiles each profile payload gets its own namespace. ==== Pros ==== * Compliance with OAI-PMH. * Unique namespaces per profile payload, which enables better default XML handling: * schema based object mappings are often based on the assumption that a combo of namespace and element name is unique * validator may cache schemas based on namespaces, with reuse of a namespace for a different profile the cache might have to be explicitly flushed ==== Cons ==== * Namespace changes for all CMD records * Generic tools needs to be able to handle the diversity of namespaces, e.g., by ignoring or skipping them: * XPath 1.0: //*[local-name()='!ToolService'] * XPath 2.0: //*:!ToolService ==== Centre impact ==== * All tools that work with CMD records need to be changed * All CMD records need to be changed ==== Implementation examples ==== Profile schema {{{ #!xml ... ... ... }}} CMD record {{{ #!xml ... ... ... }}} ==== Discussion ==== [[oschonef|Oliver (IDS)]]: Even though this solution has the largest impact on centres, it is (IMHO) the best solution, because it is most standards compliant and (if the [[CMDI 1.2/Resource proxies/Single reference|refercences issue]] is solved properly) allows a very smooth integration with OAI-PMH and off-the-shelf XML tools. The longer, we postpone this solution, the larger the pain for the centers will become, so we better make that decision now and be done with it. == Tickets == {{{#!comment Below replace the word 'keyword' in both the the text and the ticket query }}} Tickets in the CMDI 1.2 milestone with the keyword ''keyword'': [[TicketQuery(keywords=~keyword,milestone=CMDI 1.2,format=table,col=summary|owner|component|priority|status)]] == Discussion == Discuss the topic in general below this point