Difference between revisions of "Policies/URI & XML Namespaces Policy"

Jump to: navigation, search
m (oops, references were alreay there.)
(This page was moved to the Community wiki)
 
Line 1: Line 1:
Maintainer of this document: [mailto:frans.englich@telia.com Frans Englich]
+
{{Moved To Community}}
 
+
In order to ensure that URI schemes and XML namespaces within the KDE project are consistent and avoids collisions, this document exists to settle best practices, and document the currently used namespaces and URI schemes.
+
 
+
== URIs ==
+
Some applications needs custom URIs schemes in their implementation. Regardless of if the URI scheme is used internally or publically, it is always an unfortunate design choice to simply make up a scheme name (such as <tt>my-scheme://my-data</tt>) for the simple reason that anyone can do that, and thus potentially cause interoperability issues and confusion.
+
The approach for creating a custom URI scheme without also getting into trouble<ref>However, due to the usability requirements KDE in some cases have, there can be circumstances where a ''rogue'' scheme(such as <tt>media://</tt>) makes sense. Carefully consider(discuss, seek peer review) before going for an invalid URI scheme, and if so, ensure technical measures are done to lower the risks of complication.</ref>
+
is to either ensure the scheme is generic to the extent it can be specified in an RFC (similar to [http://www.ietf.org/rfc/rfc2141.txt urn] or [http://www.ietf.org/rfc/rfc2616.txt http]), or to use an existing scheme which was designed for this purpose: the [http://www.taguri.org/ tag] scheme.
+
 
+
The tag scheme combines a host name with a date to create a unique URI scheme (the date makes the URI immune to change in ownership of the domain name). KDE applications can use the tag scheme with the ''kde.org'' domain by following a slightly constrained syntax of the tag scheme:
+
tag:kde.org,2004:[application name]:[application specific string]<ref>Formally speaking, the ABNF product specific in RFC 4151 is augmented into <tt>applicationName ":" applicationSpecific</tt>, where both <classname>applicationName</classname> and applicationSpecific is <tt>*( pchar / "/" / "?" )</tt>.</ref>
+
 
+
Example:
+
tag:kde.org,2004:KMyApplication:MyKApplicationString
+
The application name ensures that a URI does not clash with a KDE application.
+
 
+
Before using the tag scheme with the KDE domain, the usage should first be suggested on the [https://mail.kde.org/mailman/listinfo/kde-core-devel kde-core-devel@kde.org] mailinglist. If agreed to be a sensible URI scheme, the table below should be updated to list the application name.
+
 
+
{| border="1"
+
|+ Applications Using the tag Scheme
+
! Application Name !! Contact !! Description
+
|-
+
! KMyMoney
+
| kmymoney2-developer@lists.sourceforge.net || Not available
+
|-
+
! KXQTS
+
| frans.englich@telia.com || An XML Namespace used in KXQTS' custom test suite format (KDOM).
+
|}
+
 
+
Thus, as example, any URI starting with <tt>tag:kde.org,2004:KMyMoney:</tt> is reserved for KMyMoney.
+
 
+
; Tip
+
: A URI's design typically stays for a long time -- it can be thought as to be a type of API. Tim Berners-Lee's [http://www.w3.org/Provider/Style/URI Cool URIs don't change] can perhaps be an inspiration for designing a URI scheme which not only suits the application right now but also years into the future.
+
: One only wants to invent a URI scheme when it is strictly necessary. A reason to that one thinks a new URI scheme needs to be invented, could be that one is unaware of the many [http://esw.w3.org/topic/UriSchemes existing URI schemes]. The article [http://infomesh.net/2001/09/urischemes New URI Schemes: 99% Harmful] might be worth the reading.
+
: Also, an article by Elliotte Rusty Harold entitled [http://www-128.ibm.com/developerworks/xml/library/x-mxd6.html Managing XML data: Tag URIs] may turn out useful.
+
 
+
== Using http://www.kde.org/ ==
+
 
+
For KDE's public library technologies it might be of interest to use the <tt>kde.org</tt> domain. In particular, for XML namespaces. In
+
those cases, the following practices should be followed:
+
 
+
* Be valid URIs, as per [http://www.ietf.org/rfc/rfc3986.txt RFC 3986].
+
* Start with <nowiki>http://www.kde.org/standards/</nowiki>, followed by a name which distinguishes the namespace. After that the resulting string may be extended in anyway (while staying within the constraints of the URI syntax). For example, the namespace <nowiki>http://www.kde.org/standards/kcfg/2.0</nowiki> as well as <nowiki>http://www.kde.org/standards/KTechnology/</nowiki> are valid.
+
 
+
URI        : <nowiki>http://www.kde.org/standards/kcfg/1.0</nowiki>
+
Description: KConfigXT's *.kcfg files.
+
Schema    : <nowiki>http://www.kde.org/standards/kcfg/1.0/kcfg.xsd</nowiki>
+
Contact    : Frans Englich <frans.englich@telia.com>
+
 
+
Addition of a new namespace should be suggested on [https://mail.kde.org/mailman/listinfo/kde-core-devel kde-core-devel@kde.org] mailinglist. If the namespace is decided to be included, this document should be updated to list the new namespace.
+
 
+
; Tip
+
: Ensure that the XML format the namespace represents is well defined. As with an API, an XML format is an interface which different parties communicates through. Specify the format in W3C XML Schema or [http://www.relaxng.org/ RELAX NG] (preferrably not DTD since it is less exact), such that it is consciously designed, and not by how a certain application currently happens to read/write files.
+
 
+
== Footnotes ==
+
<references/>
+
 
+
[[Category:Policies]]
+

Latest revision as of 18:30, 10 March 2016

This page is now on the community wiki.


This page was last modified on 10 March 2016, at 18:30. Content is available under Creative Commons License SA 4.0 unless otherwise noted.