(one of the InLOC Bindings)

The InLOC XML Binding

Introduction

For an introduction to XML and XML schema, there are several well-known sources, including:

The outputs of the InLOC project include:

  • an XML schema to enable validation and conformance of XML data;
  • samples of XML for each of the main InLOC classes;
  • more complete XML examples based on existing frameworks.

In this document, XML element names are given in bold, and XML attribute names are given in italic.

InLOC XML schema

The XML schema corresponds to the current UML diagram within the Information Model.


Figure 1: the original InLOC information model interpreted for XML

The diagram of the XML Schema as output by the Oxygen XML editor ("design view") is given in the XML Schema design view page. This diagram includes the cardinality of each element.

The URI of the schema is: http://purl.org/net/inloc/inloc_schema.xsd.

An appropriate XSI schema location line is:

xsi:schemaLocation="http://purl.org/net/inloc/ http://purl.org/net/inloc/inloc_schema.xsd"

InLOC Examples

These examples have been validated against the current InLOC XML schema. They are all tests, and have no authority of any kind.

XML declaration, root element and namespace

The XML binding of InLOC is based on XML v1.0. The root element for InLOC XML is a LOCstructure, corresponding exactly to the LOCstructure in the Information Model.

The namespace "http://purl.org/net/inloc/" uses OCLC's PURL redirection service, so that when the namespace is concatenated with an element or attribute name, the resulting URI can be redirected to the appropriate place in the InLOC documentation. (The Dublin Core Metadata Initiative has used this approach for many years.)

Here is an example of the XML declaration and root element tag using the InLOC namespace and referring to the InLOC XML schema:

LOCstructure main element declaration
<?xml version="1.0" encoding="UTF-8"?>
<LOCstructure xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns="http://purl.org/net/inloc/"
    xmlns:xml="http://www.w3.org/XML/1998/namespace"
    xsi:schemaLocation="http://purl.org/net/inloc/ http://purl.org/net/inloc/inloc_schema.xsd"
    id="http://example.eu/ids/ecf" xml:lang="en">
</LOCstructure>

The attributes include:

  • xml:lang – the main language used after to describe the InLOC document ("en" means english);
  • id – a URI for the structure itself, which is based here on the e-CF example.

LOC structures and LOC definitions

The LOC abstract type

The LOCstructure and LOCdefinition elements have common direct properties as sub-elements. The allowed sub-elements are defined in the LOCstructure information model. The snippet below show the XML schema representation of that direct property information. Note that the elements must appear in the order given for them to validate against this schema.

The Information Model's LOC class corresponds to this type in the XSD.

Representation of common element for LOCstructure and LOCdefinition in the XSD schema
<xs:complexType name="LOCtypeLOC" abstract="true">
  <xs:sequence>
    <xs:element name="extraID" type="xs:anyURI" minOccurs="0" maxOccurs="unbounded"/>
    <xs:element name="title" type="inloc:LOCtypeMultilingualToken" minOccurs="0" maxOccurs="unbounded"/>
    <xs:element name="abbr" type="inloc:LOCtypeMultilingualToken" minOccurs="0" maxOccurs="unbounded"/>
    <xs:element name="description" type="inloc:LOCtypeMultilingualString" minOccurs="0" maxOccurs="unbounded"/>
    <xs:element name="furtherInformation" type="inloc:LOCtypeMultilingualStringAnyAttribute" minOccurs="0" maxOccurs="unbounded"/>
    <xs:element name="rights" type="inloc:LOCtypeMultilingualString" minOccurs="0" maxOccurs="unbounded"/>
    <xs:element name="created" type="xs:dateTime" minOccurs="0"/>
    <xs:element name="modified" type="xs:dateTime" minOccurs="0" maxOccurs="unbounded"/>
    <xs:element name="issued" type="xs:dateTime" minOccurs="0"/>
    <xs:element name="validityStart" type="xs:dateTime" minOccurs="0"/>
    <xs:element name="validityEnd" type="xs:dateTime" minOccurs="0"/>
    <xs:element name="version" type="xs:token" minOccurs="0"/>
  </xs:sequence>
  <xs:attribute name="id"  type="xs:anyURI" use="required"/>
  <xs:attribute ref="xml:lang"/>
</xs:complexType>

LOC structure

The main root element is a LOCstructure and, as well as the direct properties listed above, allows the following child elements:

  • other LOCstructures, if needed for a complex framework;
  • LOCdefinitions detailing each separate LOC concept;
  • LOCassociations, which serve for both
    • explicitly defining the relations between LOCstructures and LOCdefinitions, and
    • relating both of them to their responsible agents, credit schemes, educational level schemes, topics and other categories.
Representation of LOCstructure in the XSD schema
<xs:complexType name="LOCtypeLOCstructure">
   <xs:complexContent>
      <xs:extension base="inloc:LOCtypeLOC">
         <xs:sequence>
            <xs:element name="combinationRules" type="inloc:LOCtypeMultilingualString" minOccurs="0" maxOccurs="unbounded"/>
            <xs:choice minOccurs="0" maxOccurs="unbounded">
                <xs:element name="LOCstructure" type="inloc:LOCtypeLOCstructure"/>
                <xs:element name="LOCdefinition" type="inloc:LOCtypeLOCdefinition"/>
                <xs:element name="LOCassociation" type="inloc:LOCtypeLOCassociation"/>
            </xs:choice>
         </xs:sequence>
      </xs:extension>
   </xs:complexContent>
</xs:complexType>

<!-- root ELEMENT -->
<xs:element name="LOCstructure" type="inloc:LOCtypeLOCstructure"></xs:element>

LOC structure example XML

XML Sample of a basic LOCstructure content with only some optional child elements
<LOCstructure id="http://example.eu/ids/ecf">
    <title>e-Competence Framework</title>
    <abbr>e-CF</abbr>
    <rights></rights>
    <created>2010-09-01T00:00:00</created>
    <version>2.0</version>
</LOCstructure>

LOC definition

Representation of LOCdefinition in the XSD schema
<xs:complexType name="LOCtypeLOCdefinition">
    <xs:complexContent>
        <xs:extension base="inloc:LOCtypeLOC">
            <xs:sequence>
            <xs:element name="primaryStructure" type="xs:anyURI" minOccurs="0" maxOccurs="1"/>
            </xs:sequence>
        </xs:extension>
    </xs:complexContent>
</xs:complexType>
Simple LOCdefinition content
<LOCdefinition id="http://example.eu/ids/A.2">
    <title>Service Level Management</title>
    <description>
Defines, validates and makes applicable service level agreements
(SLA) and underpinning contracts for services offered.
Negotiates service performance levels taking into account
the needs and capacity of customers and business.
    </description>
</LOCdefinition>

Example XML for LOC structure with definitions

The relevant parts of the XML would be as follows, with the Framework as a whole represented by the containing LOCstructure, and with sample LOCdefinitions, which may be placed inside or outside the LOCstructure.

Example LOCstructure with several LOCdefinitions
<?xml version="1.0" encoding="UTF-8"?>
<LOCstructure
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:xml="http://www.w3.org/XML/1998/namespace"
    xmlns="http://purl.org/net/inloc/"
    xsi:schemaLocation="http://purl.org/net/inloc/ http://purl.org/net/inloc/inloc_schema.xsd"
    id="http://www.vitae.ac.uk/researchers/uri/vitaerdf"
    xml:lang="en">
    <title>Vitae Researcher Development Framework</title>
    <abbr>Vitae RDF</abbr>
    <description>...</description>
    <furtherInformation>http://www.vitae.ac.uk/researchers/430901-291181/Researcher-Development-Framework-RDF.html</furtherInformation>
    <rights>http://www.vitae.ac.uk/researchers/274251/RDF-conditions-of-use.html</rights>
    <issued>2010</issued>
    <validityStart>2010</validityStart>
    <validityEnd>2015</validityEnd>
    <version>2 April 2011</version>

<LOCdefinition id="http://www.vitae.ac.uk/researchers/uri/B">
    <title>Personal effectiveness</title>
    <description>
This domain contains the personal qualities, career and self-management skills
required to take ownership for and control of professional development.
    </description>
</LOCdefinition>

<LOCdefinition id="http://www.vitae.ac.uk/researchers/uri/B2">
    <title>Self-management</title>
</LOCdefinition>

<LOCdefinition id="http://www.vitae.ac.uk/researchers/uri/B2-2">
    <title>Commitment to research</title>
</LOCdefinition>

<LOCdefinition id="http://www.vitae.ac.uk/researchers/uri/B2-2_Ph2">
    <description>
Evaluates and manages potential distractions.
Dedicated: has purposeful and determined focus on developing own research and research credentials.
    </description>
</LOCdefinition>

</LOCstructure>

LOC association

Directly following the Information Model, the LOCassociation element has three mandatory sub-elements and one optional sub-element:

  1. subject
  2. scheme
  3. object
  4. number (optional)

The id and type from the Information Model are represented as corresponding attributes.

The id attribute of LOCassociation is not expected to be much used, but is present in case a particular LOCassociation needs to be identified.

The type of association is given by a type attribute, which has as value one of:

The sub-elements subject, scheme and object

The id of the subject, scheme, and object elements is given by an attribute holding a URI ("anyURI").

The values for the scheme id are specified by InLOC in two cases:

  • for LOCassociation type "LOCrel";
  • for LOCassociation type "by".

Though these are specified by InLOC, they are not checked by the XSD. Any LOCassociation of these types with a scheme id value that is not listed here may be ignored or discarded by a receiving system, or may be interpreted as one of these, if information is available indicating that it is a specialisation of one of these.

Within LOCassociations of type "LOCrel", the scheme id value should be one of:

Within LOCassociations of type "by", the scheme id value should be one of:

Within the subject, scheme and object elements there are any number of label sub-elements, each with an optional xml:lang attribute.

The number sub-element

This contains simply a text node, specified to hold a decimal number.

There are no attributes of the number element.

XSD for LOC association and sub-elements

Representation of LOCassociation in the XSD schema
<xs:simpleType name="LOCtypeAssociationType">
    <xs:restriction base="xs:anyURI">
        <xs:enumeration value="http://purl.org/net/inloc/LOCrel"/>
        <xs:enumeration value="http://purl.org/net/inloc/by"/>
        <xs:enumeration value="http://purl.org/net/inloc/category"/>
        <xs:enumeration value="http://purl.org/net/inloc/credit"/>
        <xs:enumeration value="http://purl.org/net/inloc/level"/>
        <xs:enumeration value="http://purl.org/net/inloc/topic"/>
    </xs:restriction>
</xs:simpleType>

<xs:complexType name="LOCtypeSubject">
    <xs:sequence>
        <xs:element name="label" type="inloc:LOCtypeMultilingualToken" maxOccurs="unbounded" minOccurs="0"/>
    </xs:sequence>
    <xs:attribute name="id"  type="xs:anyURI" use="required"/>
</xs:complexType>

<xs:complexType name="LOCtypeSchemeObject">
    <xs:sequence>
        <xs:element name="label" type="inloc:LOCtypeMultilingualToken" maxOccurs="unbounded" minOccurs="0"/>
    </xs:sequence>
    <xs:attribute name="id"  type="xs:anyURI"/>
</xs:complexType>

<xs:complexType name="LOCtypeLOCassociation">
    <xs:sequence>
        <xs:element name="subject" type="inloc:LOCtypeSubject" maxOccurs="1" minOccurs="1"/>
        <xs:element name="scheme" type="inloc:LOCtypeSchemeObject" maxOccurs="1" minOccurs="1"/>
        <xs:element name="object" type="inloc:LOCtypeSchemeObject" maxOccurs="1" minOccurs="1"/>
        <xs:element name="number" type="xs:decimal" maxOccurs="1" minOccurs="0"/>
    </xs:sequence>
    <xs:attribute name="id"  type="xs:anyURI"/>
    <xs:attribute name="type"  type="inloc:LOCtypeAssociationType" use="required"/>
</xs:complexType>

LOC association examples

LOCassociation "by" example
<LOCassociation id="http://example.eu/4t8dh9fa8bp34" type="http://purl.org/net/inloc/by">
    <subject id="http://example.eu/ids/ecf"></subject>
    <scheme id="http://purl.org/net/inloc/publisher">
        <label>Issuer</label>
    </scheme>
    <object id="">
        <label>CEN</label>
    </object>
</LOCassociation>
LOCassociation hasLOCpart example
<LOCassociation type="http://purl.org/net/inloc/LOCrel">
    <subject id="http://www.vitae.ac.uk/researchers/uri/vitaerdf"></subject>
    <scheme id="http://purl.org/net/inloc/hasLOCpart"></scheme>
    <object id="http://www.vitae.ac.uk/researchers/uri/B"></object>
</LOCassociation>
LOCassociation hasDefinedLevel example
<LOCassociation type="http://purl.org/net/inloc/LOCrel">
    <subject id="http://www.vitae.ac.uk/researchers/uri/B2-2"></subject>
    <scheme id="http://purl.org/net/inloc/hasDefinedLevel"></scheme>
    <object id="http://www.vitae.ac.uk/researchers/uri/B2-2_Ph2"></object>
    <number>2</number>
</LOCassociation>
LOCassociation category example
<LOCassociation type="http://purl.org/net/inloc/category">
    <subject id="http://www.vitae.ac.uk/researchers/uri/B"></subject>
    <scheme id="http://www.simongrant.org/InLOC/Vitae_categories#">
        <label>Vitae object category</label>
    </scheme>
    <object id="http://www.simongrant.org/InLOC/Vitae_categories#domain">
        <label>Domain</label>
    </object>
</LOCassociation>
LOCassociation credit example
<LOCassociation type="http://purl.org/net/inloc/credit">
    <subject id="http://www.vitae.ac.uk/researchers/uri/B2-2_Ph2"></subject>
    <scheme id="http://purl.org/net/cm/terms/ECTS">
        <label xml:lang="en">European Credit Transfer and Accumulation System</label>
    </scheme>
    <object id="http://purl.org/net/cm/terms/ECTS#3">
        <label xml:lang="en">Third cycle</label>
    </object>
    <number>10</number>
</LOCassociation>
LOCassociation level example
<LOCassociation type="http://purl.org/net/inloc/level">
    <subject id="http://www.vitae.ac.uk/researchers/uri/B2-2_Ph2"></subject>
    <scheme id="">
        <label>EQF</label>
    </scheme>
    <object id="eqf#5">
        <label>EQF Competence Level 5</label>
    </object>
    <number>5</number>
</LOCassociation>

Using multilingual content

In order to support multilingual content it is possible to use the optional xml:lang attribute in any element with textual content. These text elements may be repeated once for each different language, and once without an explicit language.

Example of multilingual label
<scheme id="http://purl.org/net/inloc/creator">
    <label xml:lang="en">Author</label>
    <label xml:lang="fr">Auteur</label>
</scheme>
Example of LOCdefinition with multilingual title and description
<LOCdefinition id="http://www.purl.org/net/inloc/cigref.1">
    <title xml:lang="fr">ORGANISATION ET GESTION DES EVOLUTIONS DU SYSTEME D’INFORMATION</title>
    <title xml:lang="en">STEERING, ORGANISATION AND MANAGEMENT OF CHANGES TO THE INFORMATION SYSTEM</title>
    <description xml:lang="fr">
Cette famille regroupe tous les métiers qui touchent de manière globale à la mise en cohérence
organisationnelle et fonctionnelle du ou des SI. La plupart de ces métiers travaille avec
le business dans le respect des orientations stratégiques et ambitions de l'entreprise
    </description>
    <description xml:lang="en">
This family groups together all the roles which are generally concerned with ensuring
the organisational and functional consistency of the Information System(s). Most of these roles
work with the business in compliance with the strategic orientations and ambitions of the company.
    </description>
</LOCdefinition>

Using a CDATA section for complex or HTML structured description

While CDATA may be use in other text fields, it is recommended primarily within the furtherInformation element, for example as follows.

Example of CDATA section
<furtherInformation><![CDATA[
Example of piece of HTML data:<br/>
<a href="http://www.cigref.fr">Link to the Cigref webpage</a>
]]>
</furtherInformation>
Example of CDATA section
<furtherInformation><![CDATA[
DELIVERABLES:
<ul>
<li>Organization plan of managed project(s)<li/>
<li>Management Reporting on the alignment of the projects<li/>
</ul>
]]>
</furtherInformation>

Beyond the furtherInformation element, InLOC allows CDATA sections in these elements, which can be text, links, or a mixture:

  • description
  • rights
  • combinationRules

A CDATA section cannot contain the string "]]>". Nested CDATA sections are not allowed.
The "]]>" that marks the end of the CDATA section cannot contain spaces or line breaks.

Other information on CDATA can be found at:

Restrictions on the use of CDATA

The following text elements may be used in many different kinds of display contexts, and are specified using the type xs:token.
Though xs:token does not specifically exclude CDATA content, CDATA should not be used within these for InLOC.

  • title
  • abbr
  • version
  • label

If CDATA sections exist within these elements, receiving systems may strip and discard any contained markup.

XML extension and application profiling

There are several ways to extend or build application profiles of the InLOC model.

  • The predefined vocabularies listed in the XML Schema, for the LOCassociation type attribute or the scheme id attribute, can be changed. However, it is not recommended to extend these vocabularies, because examples that are valid under the changed schema may not be under the original one.
  • New elements may be added. It is not recommended to add new elements modifying the XML schema, as this breaks conformance. Instead, it is recommended to use the furtherInformation element with a structured CDATA section.
  • The furtherInformation element can be used as an extension point: as described above, it is possible to use this element with a CDATA section that contains new structured elements/metadata and even to add any attribute to it.
Extension example using CDATA section and two new attributes in furtherInformation
<LOCdefinition id="http://example.eu/ids/A.2">
    <title>Service Level Management</title>
    <description>
Defines, validates and makes applicable service level agreements (SLA) and underpinning contracts for services offered.
Negotiates service performance levels taking into account the needs and capacity of customers and business
    </description>
    <furtherInformation myAPattr1="45" myAPattr2="Could be a string as well"><![CDATA[
<thisisanewelement>
you could add any kind of XML elements and types, complex or simple
</thisisanewelement>
    ]]></furtherInformation>
</LOCdefinition>

Further reading

XML in general:

CDATA:

PURL redirection service