<grammar xmlns="http://relaxng.org/ns/structure/1.0" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" 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 RDFa Attributes Module </title> <annotation annotates="/"> <para>This module defines the W3C RDFa attribute collection. </para> <para>The semantics of the attributes in this module are defined by refRDFa11 . Refer to RDFa Primer for further information. </para> </annotation> <author> <personname>Markus Gylling</personname> <email>mgylling@daisy.org</email> </author> <copyright> <year>2009</year> <year>2010</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="rdfa.prefix.attrib"> <attribute name="prefix"> <a:documentation>The prefix attribute associates RDFa vocabulary namespace prefixes and URIs, as defined in RDFa Core 1.1 . The prefix attribute may optionally be attached to the root document element. Z39.98-AI profiles must not allow the attribute to be attached to any other element. The prefix attribute must not be used to redefine prefixes or URIs declared in the default context document for the profile. </a:documentation> <ref name="rdfa.prefix.attrib.content"/> </attribute> </define> <define name="rdfa.prefix.attrib.content"> <data type="normalizedString"> <param name="pattern">\s*([\i-[:]][\c-[:]]*: +[^ ]+)(\s+[\i-[:]][\c-[:]]*: +[^ ]+)*\s*</param> </data> </define> </div> <div> <define name="rdfa.about.attrib"> <attribute name="about"> <a:documentation>The about attribute specifies the subject of a relationship. If not given, then the subject is the current document. </a:documentation> <ref name="rdfa.about.attrib.content"/> <sch:rule context="*[@about and starts-with(@about,'#')]"> <sch:assert test="exists(//*[@xml:id eq substring-after(current()/@about,'#')])">The fragment URI in the about attribute must resolve to an ID in the document. </sch:assert> </sch:rule> </attribute> </define> <define name="rdfa.about.attrib.content"> <ref name="URI.datatype"/> </define> <define name="rdfa.content.attrib"> <attribute name="content"> <a:documentation>The content attribute specifies a string to use as an object for the rdfa.property attribute. </a:documentation> <ref name="rdfa.content.attrib.content"/> </attribute> </define> <define name="rdfa.content.attrib.content"> <ref name="Characters.datatype"/> </define> <define name="rdfa.datatype.attrib"> <attribute name="datatype"> <a:documentation>The datatype attribute specifies a datatype of the object of the rdfa.property attribute (either in the content attribute, or the content of the element that the datatype attribute is on.) By default, data in the content attribute is of type string, and data in the content of an element has type xml:Literal. If datatype="" is used, then for the RDF the element content is stripped of markup, and is of type string. </a:documentation> <ref name="rdfa.datatype.attrib.content"/> <sch:rule context="*[@datatype]"> <sch:assert test="every $prefix in substring-before(@datatype, ':') satisfies (key('rdfprefix', $prefix) or key('rdfprofile', $prefix) or $prefix='')">The datatype attribute contains an undeclared CURIE prefix. </sch:assert> </sch:rule> </attribute> </define> <define name="rdfa.datatype.attrib.content"> <ref name="CURIE.datatype"/> </define> <define name="rdfa.typeof.attrib"> <attribute name="typeof"> <a:documentation>The typeof attribute creates a blank node, which becomes the subject, and asserts that the current element contains relationships that match the given RDF type. </a:documentation> <ref name="rdfa.typeof.attrib.content"/> <sch:rule context="*[@typeof]"> <sch:assert test="every $curie in tokenize(@typeof, '\s+') satisfies ( (every $prefix in substring-before($curie, ':') satisfies (key('rdfprefix', $prefix) or key('rdfprofile', $prefix) or $prefix='')))">The typeof attribute contains an undeclared CURIE prefix. </sch:assert> </sch:rule> </attribute> </define> <define name="rdfa.typeof.attrib.content"> <ref name="CURIEs.datatype"/> </define> <define name="rdfa.property.attrib"> <attribute name="property"> <a:documentation>The property attribute defines a relationship between the subject and either a string (if the rdfa.content attribute is present) or the content of the element that the property attribute is on. </a:documentation> <ref name="rdfa.property.attrib.content"/> <sch:rule context="*[@property]"> <sch:assert test="every $curie in tokenize(@property, '\s+') satisfies ( (every $prefix in substring-before($curie, ':') satisfies (key('rdfprefix', $prefix) or key('rdfprofile', $prefix) or $prefix='')))">The property attribute contains an undeclared CURIE prefix. </sch:assert> </sch:rule> </attribute> </define> <define name="rdfa.property.attrib.content"> <ref name="CURIEs.datatype"/> </define> <define name="rdfa.rel.attrib"> <attribute name="rel"> <a:documentation>The rel attribute defines a relation between the subject and a URL given by the rdfa.resource attribute. The rdfa.rev attribute expresses the inverse relation. </a:documentation> <ref name="rdfa.rel.attrib.content"/> <sch:rule context="*[@rel]"> <sch:assert test="every $curie in tokenize(@rel, '\s+') satisfies ( (every $prefix in substring-before($curie, ':') satisfies (key('rdfprefix', $prefix) or key('rdfprofile', $prefix) or $prefix='')))">The rel attribute contains an undeclared CURIE prefix. </sch:assert> </sch:rule> </attribute> </define> <define name="rdfa.rel.attrib.content"> <ref name="CURIEs.datatype"/> </define> <define name="rdfa.resource.attrib"> <attribute name="resource"> <a:documentation>The resource attribute specifies an object URI for the rdfa.rev and rdfa.rel attributes, if the attribute href is not present. </a:documentation> <ref name="rdfa.resource.attrib.content"/> </attribute> </define> <define name="rdfa.resource.attrib.content"> <ref name="URI.datatype"/> </define> <define name="rdfa.rev.attrib"> <attribute name="rev"> <a:documentation>The rev attribute defines a relation between the subject and a URL given by the rdfa.resource attribute. The rdfa.rel attribute expresses the inverse relation. </a:documentation> <ref name="rdfa.rev.attrib.content"/> <sch:rule context="*[@rev]"> <sch:assert test="every $curie in tokenize(@rev, '\s+') satisfies ( (every $prefix in substring-before($curie, ':') satisfies (key('rdfprefix', $prefix) or key('rdfprofile', $prefix) or $prefix='')))">The rev attribute contains an undeclared CURIE prefix. </sch:assert> </sch:rule> </attribute> </define> <define name="rdfa.rev.attrib.content"> <ref name="CURIEs.datatype"/> </define> <define name="Rdfa.attrib" combine="interleave"> <a:documentation>Defines the RDFa attribute collection; all attributes with optional occurrence. </a:documentation> <optional> <ref name="rdfa.about.attrib"/> </optional> <optional> <ref name="rdfa.content.attrib"/> </optional> <optional> <ref name="rdfa.datatype.attrib"/> </optional> <optional> <ref name="rdfa.typeof.attrib"/> </optional> <optional> <ref name="rdfa.property.attrib"/> </optional> <optional> <ref name="rdfa.rel.attrib"/> </optional> <optional> <ref name="rdfa.resource.attrib"/> </optional> <optional> <ref name="rdfa.rev.attrib"/> </optional> </define> </div> </grammar>