Skip to content

Instantly share code, notes, and snippets.

Created July 31, 2009 14:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/159255 to your computer and use it in GitHub Desktop.
Save anonymous/159255 to your computer and use it in GitHub Desktop.
<xsd:schema xmlns="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://example.org/ils-item-info/TODO"
xmlns:ilsitem="http://example.org/ils-item-info/TODO"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:dc="http://purl.org/dc/elements/1.1/"
elementFormDefault="qualified" attributeFormDefault="unqualified"
xsi:schemaLocation="http://example.org/ils-item-info/TODO TODO"
>
<xsd:import namespace="http://www.w3.org/XML/1998/namespace"
schemaLocation="http://www.w3.org/2001/03/xml.xsd" />
<xsd:import namespace="http://purl.org/dc/elements/1.1/"
schemaLocation="http://dublincore.org/schemas/xmls/qdc/2003/04/02/dc.xsd"/>
<xsd:annotation>
<xsd:description>
A simple schema to express some elements about an item in an ILS or other
library inventory system. This schema specifically includes items
that I could not find a good way to express in MFHD or
dlf:SimpleAvailability (or any other schema I looked at). This is intended
to be used as a supplement to MFHD, SimpleAvailability, or other more
standardized schemas/vocabularies. These elements can define an 'item'
or 'holding', as appropriate. Intended to be embedded in another schema
(such as dlf ils-di) that will maek clear by context what is being
described.
These items are largely internal ILS codes for certain types/classes
of data in an ILS. The schema supports simply providing the internal
ILS code without trying to map to a standard vocabulary. Alternately,
if a standard vocabularly exists (with URIs) and a mapping is possible,
you can provide those too.
There are a number of elements provided for certain kinds of data, including
location, collection, item type, item status.
For each of those qualities, an element is provided. These elements are
intentionally defined globally in the schema to allow re-use. A 'wrapper'
element descriptionSet is also provided that can contain any of these
elements.
Each of these elements is defined as an ilsitem:valueType, a type which
allows one or more ids (internal system ids or from a standard vocabularly)
in a child dc:identifier, one publically displayable label in a dc:title,
and a longer form description (and/or link to such) in an
ilsitem:description.
</xsd:description>
</xsd:annotation>
<xsd:element name="descriptionSet" type="ilsitem:descriptionSetType">
<xsd:annotation>
<xsd:documentation>
A collection element that can a set of any of the ilsitem elements, in
any order.
Also intentionally defined to allow you to include things from
external schemas in here too.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:complexType name="descriptionSetType">
<xsd:all>
<xsd:element ref="ilsitem:location" minOccurs="0"/>
<xsd:element ref="ilsitem:collection" minOccurs="0"/>
<xsd:element ref="ilsitem:itemType" minOccurs="0"/>
<xsd:element ref="ilsitem:itemStatus" minOccurs="0"/>
<xsd:element ref="ilsitem:shelfMarkType" minOccurs="0"/>
<xsd:any namespace="##other" processContents="strict" minOccurs="0"/>
</xsd:all>
</xsd:complexType>
<xsd:element name="location" type="ilsitem:valueType">
<xsd:annotation>
<xsd:documentation>
The location as defined by the ILS or inventory system. A location is
usually a library branch, building, or other physical location, but can
also be a part of a building, or something non-physical like "Online".
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="collection" type="ilsitem:valueType">
<xsd:annotation>
<xsd:documentation>
The collection as defined by the ILS or inventory system. A collection is
often a sub-part of a location, but can also be a grouping that crosses
locations. A Collection combined with Location is, in many
libraries/systems, necessary to identify where a physical object is to
be found.
</xsd:documentation>
</xsd:annotation>
<xsd:element name="itemType" type="ilsitem:valueType" />
<xsd:element name="itemStatus" type="ilsitem:valueType" />
<xsd:element name="shelfMarkType" type="ilsitem:valueType">
<xsd:annotation>
<xsd:description>
An ILS defined type for the call number or other shelf mark used on an
item. While this may contain identifiers with suitable URLs identifying
a standard type such as DDC or LCC, a shelf mark type is often purely
internal to the ILS/inventory control system.
Provision for specifying the actual call number/shelf mark is not
currently made in this schema. It is assumed the call number itself
will be provided in another schema, such as MFHD or ISO Holdings, but
those schemas lack facility to describe internal type/class of call
number, so we provide it here.
</xsd:description>
<xsd:annotation>
</xsd:element>
<xsd:complexType name="valueType">
<xsd:annotation>
<xsd:documentation>
Consists of zero or more identifiers (dc:identifier),
optionally one user-displayable label (dc:title), and optionally one
user-displayable longer description of the type (dc:description).
The identifier(s) can be either URIs or simple string literals. Only
one simple string literal should be included, and will be understood
to be an internal ID in the providing system. As many URIs as you like
can be included, identifying the object described according to some
external vocabularly or system.
The dc:description body can be plain text, HTML, or any other format.
If a format is not XML, the content should be XML-escaped! This
includes text/html (but not application/xhtml+xml).
The mime-type of the format is given in attribute contentType,
probably either text/plain or text/html.
If none given, assumed default is text/plain. text/plain can contain
newlines, which should be respected/translated by consuming app where
possible. eg &gt;dc:description ilsitem:contentType="text/html"&lt;
Instead, or in addition, a url to present to the user for more
description can be included with attribute xml:href
</xsd:documentation>
</xsd:annotation>
<xsd:element ref="dc:identifier" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element ref="dc:title" minOccurs="0" maxOccurs="1"/>
<xsd:element name="description" minOccurs="0" maxOccours="1"
type="ilsitem:descriptionWithExtraAttributes"/>
</xsd:complexType>
<xsd:complexType name="descriptionWithExtraAttributes">
<xsd:annotation>
<xsd:documentation>
Originally I hoped to use dc:description for this, but I really wanted
to add the contentType and href attributes, to deal with actual use
cases and problems I've experienced when not having these. Couldn't
figure out a way to legally add attributes to dc:description.
</xsd:documetnation>
</xsd:annotation>
<xsd:simpleContent>
<xsd:extension base="xsd:string">
<xsd:attribute name="contentType" use="optional" type="xsd:string">
<xsd:attribute ref="xml:href" use="optional">
</xsd:extension>
</xsd:simpleContent>
</xsd:complexType
</xml:schema>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment