As we saw in the previous section, the RDFa attributes rely on a set of datatypes, the most important being the CURIE.
CURIE
Although this may change, for now a CURIE is defined as follows:
<xs:simpleType name="Curie">
<xs:restriction base="xs:string">
<xs:pattern value="[\i-[:]][\c-[:]]*:.+" />
</xs:restriction>
</xs:simpleType>
It's pretty straightforward, but to give a quick overview:
\iis the set of characters that can start an XML name, which is any letter, an '_' or a ':';[\i-[:]]means any character that is in the set\ibut is not a colon...for obvious reasons;
So the first character of our CURIE must be a letter or an underscore, i.e., not a number, colon, equals sign, etc. After that we can have any XML name character, which can now include numbers:
\cis the set of XML name characters that can appear after the first character;[\c-[:]]is the same set but without a colon;[\c-[:]]*means match as many as we can (zero or more);
The prefix part has been made quite strict because it must match the namespace prefix rules. But after the colon we can be looser, hence:
.+means one or more of any character.
Note that we could say that the part after the colon can be any valid URI, and this does actually work fine. But since pretty much anything matches successfully, there didn't seem a lot of point. However, so that we have a record of it, making the part after the colon a valid URI can be done with the following expresson (line-breaks only added for layout):
[\i-[:]][\c-[:]]* : (([^:/\?#]+):)?(//([^/\?#]*))?([^\?#]*)(\?([^#]*))?(#(.*))?
Escaped CURIEs
An escaped CURIE is used in places where direct use can be ambiguous, and is currently achieved by placing square brackets around the CURIE. The definition is as follows:
<xs:simpleType name="CurieEsc">
<xs:restriction base="xs:string">
<xs:pattern value="\[[\i-[:]][\c-[:]]*:.+\]" />
</xs:restriction>
</xs:simpleType>
Note that there is no way with XML Schemas for this regular expression to reference our first expression, hence the repitition of the pattern for a CURIE.
Escaped CURIE or URI
Once we have our escaped CURIE we can use it to create a type that can contain both a URI and an escaped CURIE:
<xs:simpleType name="CurieOrURI">
<xs:union memberTypes="xs:anyURI CurieEsc" />
</xs:simpleType>
This type is used for about and href.
CURIE or Link Type List
The rel and rev attributes are a little tricky since they can contain CURIEs as well as tokens that come from a standard list...which is made slightly more complicated by the fact that it is acceptible to have multiple values.
The first step is to create a 'CURIE or link type' definition, which allows either a CURIE or one of a restricted range of values:
<xs:simpleType name="CurieOrLinkType">
<xs:union memberTypes="Curie">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="alternate"/>
<xs:enumeration value="forward"/>
<xs:enumeration value="start"/>
<xs:enumeration value="next" />
.
.
.
<xs:enumeration value="profile" />
<xs:enumeration value="role" />
<xs:enumeration value="cite" />
</xs:restriction>
</xs:simpleType>
</xs:union>
</xs:simpleType>
Once we have this it's a simple matter to create a list of 'CURIE or link types':
<xs:simpleType name="CurieOrLinkTypeList">
<xs:list itemType="CurieOrLinkType" />
</xs:simpleType>
This definition would make the following valid:
<link rel="subsection ab:foreward prev" href="[cd:ef]" />
and the following invalid:
<link rel="blah ab:foreward" href="[cd:ef]" />


Recent comments
19 weeks 5 days ago
19 weeks 5 days ago
23 weeks 3 days ago
24 weeks 5 days ago
24 weeks 6 days ago
24 weeks 6 days ago
25 weeks 1 day ago
25 weeks 1 day ago
25 weeks 2 days ago
25 weeks 2 days ago