EARL 0.95 By Example

Because people don't read specifications, and nor should they be expected to.

Example 1: Simple Evaluation

<rdf:RDF xmlns="http://www.w3.org/2001/03/earl/0.95#" 
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" 
   xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" 
   xmlns:foaf="http://xmlns.com/foaf/0.1/" >
<Assertor>
 <rdf:type rdf:resource="http://www.w3.org/2001/03/earl/0.95#Person"/>
 <name>Bob B. Bobbington</name>
 <foaf:mbox rdf:resource="mailto:bob@example.org"/>
 <asserts>
   <Assertion>
     <rdf:subject rdf:resource="http://example.org/#someID02495012470"/>
     <rdf:predicate rdf:resource="http://www.w3.org/2001/03/earl/0.95#passes"/>
     <rdf:object rdf:resource="http://example.org/#MyTestCase"/>
   </Assertion>
 </asserts>
</Assertor>

<WebContent rdf:about="http://example.org/#someID02495012470">
   <testSubject rdf:resource="http://www.w3.org/"/>
   <date>2001-05-17T23:07:35Z</date>
</WebContent>

<rdf:Description rdf:about="http://example.org/#MyTestCase">
   <testId rdf:resource="http://exmaple.org/MyTestCaseThingy" />
</rdf:Description>
</rdf:RDF>

For "fails" use fails in place of passes in the example above.

Example 2: Multiple Evaluations, with possible non-tests etc.

To do multiple evaluations, simply repeat the asserts element.

<rdf:RDF xmlns="http://www.w3.org/2001/03/earl/0.95#" 
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" 
   xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" 
   xmlns:foaf="http://xmlns.com/foaf/0.1/" >
<Assertor>
 <rdf:type rdf:resource="http://www.w3.org/2001/03/earl/0.95#Person"/>
 <name>Bob B. Bobbington</name>
 <foaf:mbox rdf:resource="mailto:bob@example.org"/>
 <asserts>
   <Assertion>
     <rdf:subject rdf:resource="http://example.org/#someID02495012470"/>
     <rdf:predicate rdf:resource="http://www.w3.org/2001/03/earl/0.95#passes"/>
     <rdf:object rdf:resource="http://example.org/#MyTestCase"/>
   </Assertion>
 </asserts>
 <asserts>
   <Assertion>
     <rdf:subject rdf:resource="http://example.org/#someID02495012470"/>
     <rdf:predicate>
       <ValidityProperty>
       <validity rdf:resource="http://www.w3.org/2001/03/earl/0.95#NotTested"/>
       <confidence rdf:resource="http://www.w3.org/2001/03/earl/0.95#High"/>
       </ValidityProperty>
     </rdf:predicate>
     <rdf:object rdf:resource="http://example.org/#MyOtherTestCase"/>
   </Assertion>
 </asserts>
</Assertor>

<WebContent rdf:about="http://example.org/#someID02495012470">
   <testSubject rdf:resource="http://www.w3.org/"/>
   <date>2001-05-17T23:07:35Z</date>
</WebContent>

<rdf:Description rdf:about="http://example.org/#MyTestCase">
   <testId rdf:resource="http://exmaple.org/MyTestCaseThingy" />
</rdf:Description>

<rdf:Description rdf:about="http://example.org/#MyOtherTestCase">
   <testId rdf:resource="http://exmaple.org/MyOtherTestCaseThingy" />
</rdf:Description>
</rdf:RDF>

Note here that we're using "NotTested" as one of the predicate confidence values. You can choose from: Pass, Fail, ValidityState, NotTested, ValidityState, NotApplicable, CannotTell.

You can also choose confidences. Simply substitiute one of the following for "High" in the example above: High, Medium, Low.

Sean B. Palmer