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  
<chris.ridpath@utoronto.ca> 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.

Yep.

> 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  
like...)

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

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="http://purl.org/dc/elements/1.1/"
          xmlns:earl="http://www.w3.org/WAI/ER/EARL/nmg-strawman#"
          xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
          xmlns:testing="http://www.w3.org/WAI/ER/EARL/nmg-strawman#">
<earl:WebContent rdf:about="#subject">
   <earl:reprOf  
rdf:resource="http://tile-cridpath.atrc.utoronto.ca/acheck/checks/testfiles/1-1.html"/>
   <dc:date  
rdf:datatype="http://www.w3.org/2001/XMLSchema#gDateTime">2005-04-06T07:52:36-0500</dc:date>
</earl:WebContent>
<earl:Tool rdf:about="#assertor">
   <dc:title>ATRC Accessibility Checker</dc:title>
   <dc:source>http://tile-cridpath.atrc.utoronto.ca/acheck/servlet/ShowCheck</dc:source>
   <dc:version>0.6.4</dc:version>
</earl:Tool>
<earl:Assertion>
   <dc:date  
rdf:datatype="http://www.w3.org/2001/XMLSchema#gDateTime">2005-04-06T07:52:36-0500</dc:date>
   <earl:Subject rdf:resource="#subject"/>
   <testing:xpath>/html/body/p/img</testing:xpath>
   <testing:line  
rdf:datatype="http://www.w3.org/2001/XMLSchema#Integer">9</testing:line>
   <testing:src>rex.jpg</testing:src>
   <earl:testCase  
rdf:resource="http://www.w3.org/WAI/GL/WCAG20/tests/test1.html"/>
   <earl:message rdf:parseType="Literal">
     <error xmlns="http://www.example.com">
       <code>img</code> element missing <code>alt</code> attribute.</error>
   </earl:message>
   <earl:result>
     <earl:Fail>
       <earl:confidence  
rdf:resource="http://www.w3.org/WAI/ER/EARL/nmg-strawman#high"/>
     </earl:Fail>
   </earl:result>
   <earl:Assertor rdf:resource="#assertor"/>
   <earl:mode  
rdf:resource="http://www.w3.org/WAI/ER/EARL/nmg-strawman#automatic"/>
</earl:Assertion>
</rdf:RDF>


cheers

Chaals


-- 
Charles McCathieNevile                      Fundacion Sidar
charles@sidar.org   +61 409 134 136    http://www.sidar.org

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