correct RDF Re: Locating In EARL Example

Hi Chris,

I have looked at your example and run it through the validator. I forked  
the thread so we can sperate out validating this RDF from the more general  
problem of location information...

On Wed, 06 Apr 2005 22:29:51 +1000, Chris Ridpath  
<> wrote:

> I've adopted all your recommendations except for:
>> - Left out encoding since XML is utf-8 by default
> My tool puts in the encoding by default so I've left it in. I don't  
> think there's a problem either way.

Yeah, no problem.

>>   + Provided some (pretty arbitrary) DC stuff to describe the tool.  
>> Note that I didn't provide an identifier, because I don't actually know  
>> about what version it is, etc.
> I've put in a dc:version which identifies the version of the tool. Is  
> there anything else that should go there?

It depends what you know about the tool :-)

>>   + Added a datatype to the date.
> I added the datatype to both dates in the file. One of the dates in your  
> file didn't have the datatype which I assumed was just an oversight.


> The element: <earl:Subject rdf:resource="#subject"/> does not contain  
> any of the elements that describe the subject. Is that correct?

Yep. If you get the Validator to show the graph as well as the triples it  
shold clarify things a bit.

What happens is that the subject is the thing called #subject - which is a  
thing of type earl:WebContentwith various properties. You could also look  
at the triples to see how they go together, although most people find them  
less easy to read.

the assertdBy works in the same way...

>>   + Removed the confidence, since I don't think it's a good idea.
> I've left it in for now. The confidence is used to express how confident  
> the test result is. Here are 3 examples to show how it's useful:
> 1) image missing alt attribute - confidence high. This is a problem for  
> sure.
> 2) image missing longdesc - confidence low. This is likely not a problem.
> 3) image alt text is same as file name - confidence medium. This is  
> likely a problem but it could be OK.
> I think we should keep the confidence rating.

Well, this is obviously a question for discussion :-) I'll leave the issue  
aside for now and concentrate on how to make the coding work...

> My EARL example code validates except for the 'confidence' rating.

You either need to make the confidence a property of the Assertion itself  
(this further limits the ability to collapse multiple statements into a  
single assertion. I don't think that's a bad thing although Johannes seems  
to prefer that we don't do that) or you need to make the result a node  
with a type, and then make the confidence a property of that. In syntax  
that means either you put an extra child in which is the child of the  
result (as in my example below) or you make the confidence a direct child  
of the Assertion.

Have a look at the graphs for the two cases... (It's a good enough  
exercise just to play around and get the two cases to validate, although  
the Validator isn't the most infomrative tutorial tool...)

>> ...although I am not sure what the src property is meant to do.
> It's used to identify the image if the document is modified and the  
> xpath expression is invalid. We'll have to make up other "testing"  
> elements to hold information for other test cases too.

OK. In this case an xpath would look like /html/body/p/img[src='rex.jpg]  
or even just //img[src='rex.jpg'] which can probably tell you what you are  
after. Although we should look at this for some reasonably complex  
real-world examples. Anyone got some real-world snapshots we can use for  
testing? (I can offer Sidar's example pages of what not to do, if you  

Anyway, this bit is the key, once we sort out the EARL/RDF coding  

Here is the code I used that validates (as well as the confidence thing,  
there was a bit of a line missing on the mode declaration, you dropped the  
namespace from the XML message in the version that you put into the web  
page, and I am pretty sure that the datatype for gDateTime requires the  
leading zeros and a 4-digit offset time from GMT)

<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF xmlns:dc=""
<earl:WebContent rdf:about="#subject">
<earl:Tool rdf:about="#assertor">
   <dc:title>ATRC Accessibility Checker</dc:title>
   <earl:Subject rdf:resource="#subject"/>
   <earl:message rdf:parseType="Literal">
     <error xmlns="">
       <code>img</code> element missing <code>alt</code> attribute.</error>
   <earl:Assertor rdf:resource="#assertor"/>



Charles McCathieNevile                      Fundacion Sidar   +61 409 134 136

Received on Wednesday, 6 April 2005 14:06:07 UTC