<grammar xmlns="http://relaxng.org/ns/structure/1.0" xmlns:z="http://www.daisy.org/ns/z3998/annotations/#" xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0" xmlns:sch="http://purl.oclc.org/dsdl/schematron" xmlns:db="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes"> <info xmlns="http://docbook.org/ns/docbook" xml:lang="en"> <title>The role module </title> <annotation annotates="/"> <para>This module defines the role attribute for annotating elements with machine-extractable semantic information about their nature and purpose. </para> <para>The value of the role attribute is one or several CURIEs, each bound to an RDF property using the mechanism defined in CURIE . </para> <para>The role attribute is optional on all applicable elements in a profile's core markup model by default. When this module is activated, however, it is possible to make the attribute locally or globally required. </para> <para>The attribute is not required on elements in a profile's core markup model if the given element does not require semantic inflections or if it already provides other means of expressing metadata annotations. </para> <para>When the role attribute is specified on an element, RDF triples are generated such that the current document constitutes the subject, the CURIE (role attribute value) the predicate, and the current element node the object. </para> <para>This module itself does not define a mechanism to declare prefixes of the used CURIEs; the mechanisms to do this are defined by RDFa . </para> </annotation> <author> <personname>Markus Gylling</personname> <email>mgylling@daisy.org</email> </author> <copyright> <year>2009</year> <year>2010</year> <year>2011</year> <year>2012</year> <holder>DAISY Consortium</holder> </copyright> <legalnotice> <para>This module is licensed under a Creative Commons Attribution 3.0 license, a copy of which is available at <link xlink:href="http://creativecommons.org/licenses/by/3.0/">http://creativecommons.org/licenses/by/3.0/</link> </para> <para>For complete licensing information, please refer to the LICENSE file that came with this distribution, a copy of which is also available from the DAISY web site at <link xlink:href="http://www.daisy.org">www.daisy.org</link> </para> </legalnotice> <revhistory> <revision> <date>2012-12-19</date> <authorinitials>MGy</authorinitials> <revdescription> <para>Initial version</para> </revdescription> </revision> </revhistory> </info> <div> <define name="z3998.role.attrib"> <attribute name="role"> <a:documentation>The role attribute expresses a semantic inflection on the nature or purpose of its parent element. The attribute takes as its value one or more whitespace separated CURIEs refRDFa11 , that must be bound to one or more RDF vocabularies either defined in the RDFa initial context document or by the rdfa.prefix attribute. The role attribute is intended to be functionally compatible with the WAI-PF role attribute ( refROLE ) in its expression of document metadata to improve the accessibility of documents marked up to Z39.98-AI profiles. </a:documentation> <ref name="z3998.role.attrib.content"/> <sch:rule context="*[@role]"> <sch:assert test="every $curie in tokenize(@role, '\s+') satisfies ( (every $prefix in substring-before($curie, ':') satisfies (key('rdfprefix', $prefix) or key('rdfprofile', $prefix) or $prefix='')))">The role attribute contains an undeclared CURIE prefix. </sch:assert> </sch:rule> </attribute> </define> <define name="z3998.role.attrib.content" combine="choice"> <ref name="CURIEs.datatype"/> </define> </div> </grammar>