Skip to content

Commit 98cf9fe

Browse files
WilcoFierscarlosapaduarteJym77
authored
Document how to use WCAG SC numbers in EARL (#1846)
* Document how to use WCAG SC numbers in EARL * Apply suggestions from code review Co-authored-by: Carlos Duarte <carlosapaduarte@gmail.com> * Apply suggestions from code review Co-authored-by: Jean-Yves Moyen <jym@siteimprove.com> Co-authored-by: Carlos Duarte <carlosapaduarte@gmail.com> Co-authored-by: Jean-Yves Moyen <jym@siteimprove.com>
1 parent 26b5463 commit 98cf9fe

1 file changed

Lines changed: 28 additions & 0 deletions

File tree

pages/implementations/earl-reports.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,4 +111,32 @@ For each result, we'll need to know which rule or procedure in the tool reported
111111

112112
**Note**: The IDs of WCAG success criteria can be found in [sc-urls.json](https://github.com/act-rules/act-tools/blob/main/src/data/sc-urls.json), on the `scId` property. These are the IDs introduced in WCAG 2.1, and continued in WCAG 2.2. Use these IDs, even when reporting for WCAG 2.0.
113113

114+
### isPartOf
115+
116+
Alternatively, it is possible to specify WCAG 2 success criteria by number instead of by ID. This can be done in the following format:
117+
118+
```json
119+
{
120+
"@context": "https://act-rules.github.io/earl-context.json",
121+
"@graph": [
122+
{
123+
"@type": "TestSubject",
124+
"source": "https://act-rules.github.io/testcases/a1b64e/6c3ac31577c3cb2d968fc26c4075dd533b5513fc.html",
125+
"assertions": [
126+
{
127+
"@type": "Assertion",
128+
"result": { "outcome": "earl:passed" },
129+
"test": {
130+
"title": "image-button-has-name",
131+
"isPartOf": [{ "title": "WCAG 2: 1.1.1" }, { "title": "WCAG 2: 4.1.2" }]
132+
}
133+
}
134+
]
135+
}
136+
]
137+
}
138+
```
139+
140+
The format of the `title` property in the `isPartOf` array is fairly permissive. To be recognized as a success criterion, the string `WCAG 2` or `WCAG2`, and the success criterion number (separated with dots) must be included. For example `WCAG 2.1 criterion 1.1.1 Non-text content` would be recognized. To explicitly add the success criterion ID the `@id` property can be used.
141+
114142
**Advanced**: All required properties map to [EARL](http://www.w3.org/ns/earl#), except for `isPartOf`, `title`, and `source` which are properties of [Dublin Core](http://purl.org/dc/terms/). Property names can be anything, as long as they can be expanded to the correct URL.

0 commit comments

Comments
 (0)