EARL 0.95 Primer

EARL, rather than being a particular syntax, is a model based on the W3C's
Resource Description Framework. This
allows greater flexibility in the way it is implemented. It also ensures that
EARL may be compatable with developments from the Semantic Web Activity.

EARL Model

The model for EARL is very simple, consisting as it does of a set of
"evaluations". These evaluations, like all things in RDF, are made up of three
parts called a "triple". In the case of an EARL evaluation, these three parts
make up the statement "an Assertor asserts an Assertion". What does this mean?
In RDF, all parts of a triple are made from URIs. This basically means that
they are globally unique, and that anyone can refer to them.

In the case of EARL 0.95, all of our URIs start with
http://www.w3.org/2001/03/earl/0.95# This is called the "EARL
0.95 namespace", because it is a space in which we put all of our names (URIs).
For example, as mentioned before, an evaluation is made up of the triple "an
Assertor asserts an Assertion". Already we have made up four names to put in
our namespace: Evaluation, Assertor, asserts, and Assertion. The URIs for these
are:-

Evaluation - http://www.w3.org/2001/03/earl/0.95#Evaluation

Assertor - http://www.w3.org/2001/03/earl/0.95#Assertor

asserts - http://www.w3.org/2001/03/earl/0.95#asserts

Assertion - http://www.w3.org/2001/03/earl/0.95#Assertion

These URIs are very long, so we usually abbreviate them by giving an alias to
our namespace. This is declared in XML RDF as:-

<earl:Evaluation xmlns:earl="http://www.w3.org/2001/03/earl/0.95#"/>

And in Notation3 as:-

@prefix earl: <http://www.w3.org/2001/03/earl/0.95#> .

This means that instead of typing out
http://www.w3.org/2001/03/earl/0.95# every time, you can just
use earl: each time. You don't have to use earl: for a
namespace alias, for example you could use e: instead, but it is a good
convention to follow.

So, EARL at the moment consists of earl:Evaluation, earl:Assertor,
earl:asserts and earl:Assertion. In Notation3:-

This means that "something which is a type/instance of Assertor asserts
something which is a type/instance of Assertion. This whole statement is an
Evaluation".

RDF Schema

In the RDF model, each triple consists of a "subject", a "predicate", and
an "object". In common terms, this is like saying a noun verb and a noun. e.g.
Seth eats Chocolate. In our example above, if "Seth" was an Assertor, and
"I like chocolate" was an Assertion, you could see that this might make
sense:-

But EARL is really a language for making technical evluations of Web content
and tools, so this would probably be out of scope! At any rate, an "assertion"
is much more complicated than it might look, because it itself is made up of a
further "triple".

Before we go onto that, let's look closer at what the RDF Schema mechanism
is. We have already been using it briefly by saying that an "Assertor" and
an "Assertion" are "things", i.e. nouns, and that "asserts" is a property,
i.e. verb. In fact, RDF has special names for these: we call the nouns
"Classes", and the verbs "Properties". In namespace terms, these are rdfs:Class
and rdf:Property respectively.

If we want to say that a certain thing is an instance of a sort of Class,
we can do that using the rdf:type property. For example, if I wanted to say that
Seth is a sort of person, I could say that:-

:Person rdf:type rdfs:Class .
:Seth rdf:type :Person .

Or in shorthand:-

:Seth a :Person .

Indeed, we do not need to state explicitly that "Person is a Class", because
if something is a type of Person, then Person is a Class. We'll go into this in
more detail a bit later on. For now, all you need to know is that you have
nouns which are all types of classes, and other nouns which can be types of
things which are types of classes, and properties, which are all of rdf:type
rdf:Property.

The bit in the curly brackets "{}" is called a context, and it's a bit
like quoting something. For example:-

:Seth earl:asserts { :MyTestSubject :myResultProp :MyTestCase } .

Would be spoken in English as "Seth asserts 'MyTestSubject has myResultProp
of MyTestCase'". Note that anything that is a earl:TestCase must be
an rdf:Property. You may also have noticed the convention (although it is not
a rule) that Classes always start with capital letters, and properties always
start in lower case characters.

Because we want to make sure that anything of type earl:TestCase is also
an rdf:Property, we say that:-

earl:TestCase rdfs:subClassOf rdf:Property .

In other words, an earl:TestCase is a specialized instance of an
rdf:Property, but it is still an rdf:Property.