Using the power of ontologies to automate usability testing

In essence, OWL 2 Web Ontology Language is basically an extension of OWL 1 based on user feedback. However, there’s one new functionality that got my attention. Apparently, apart from using predefined datatypes, there’s now the ability to define your own datatypes. By creating instances of the class rdfs:Datatype and associating one or more facet restrictions[ref]A facet restriction is a way of describing a set of values for a specific datatype that makes up the range of valid values. For example, all integers greater than 5. Integer is the datatype of the range and the facet restriction is greater than 5.[/ref], you are able to define your own datatypes. The following table lists all the facets supported by OWL[ref]The overview can be attributed to the excellent book Semantic Web Programming.[/ref].

Facet Description
xsd:length N is the exact number of items (or characters) allowed.
xsd:minLength N is minimum number of items (or characters) allowed.
xsd:maxLength N is maximum number of items (or characters) allowed.
xsd:pattern A regular expression that defines allowed character strings.
xsd:minInclusive Values must be greater than or equal to N.
xsd:minExclusive Values must be strictly greater than or equal to N.
xsd:maxInclusive Values must be less than or equal to N.
xsd:maxExclusive Values must be strictly less than or equal to N.
xsd:totalDigits The number of digits must be equal to N.
xsd:fractionDigits N is the maximum number of decimal places allowed.

N refers to the value portion of the facet restriction.

Consider the example in Turtle syntax below. It defines a new datatype[ref]As you can see, we used an owl:equivalentClass property for the :personAge resource since OWL does not allow data ranges to be named. Another approach would be to create the data range as an anonymous resources. This is done by using bnodes and placing everything between square brackets [] in Turtle.[/ref] for a person’s age by constraining the datatype integer to values between (inclusively) 0 and 150.

@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
:personAge owl:equivalentClass
  [ rdf:type rdfs:Datatype;
    owl:onDatatype xsd:integer;
    owl:withRestrictions (
      [ xsd:minInclusive "0"^^xsd:integer ]
      [ xsd:maxInclusive "150"^^xsd:integer ]
    )
  ] .

The earlier outlined idea of facets is borrowed from XML Schema Datatypes. XML Schema allows the content of an element or attribute to be validated against a data type. For instance, an attribute might be constrained to be a valid date, or a decimal number. Facet restrictions reduce the set of permitted values for a datatype. Likewise, datatypes can be combined just like classes by complement, intersection and union.

Because OWL is now able to use the XML Schema extension by addressing the xsd namespace, as a consequence XSD can be used to express a set of rules to which an XML document must conform in order to be considered “valid” according to a facet restriction. When we think about this from a Semantic Web perspective, I would like to argue that this validations could be easily applied to RDF XML serializations. And since RDFa uses XML schema data types as well, that should be no problem either. For a date datatype, the xsd:date data type is simply embedded in the datatype attribute.

<span property="dc:date" content="2010-03-10" datatype="xsd:date">March 10th, 2010</span>

Imagine that we want to validate the Identification number of the National Register, which appears in most countries on your identity card. For Belgium, the format is xx.xx.xx-xxx.xx where x represents a numeric value. This could be demonstrated by a regular expression using the following RDF:


@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> . 
belgianIdentificationNumber: owl:equivalentClass
  [ rdf:type rdfs:Datatype;
  owl:onDatatype xsd:String;
  owl:withRestrictions (
    [ xsd:pattern "\d{2}\.\d{2}\.\d{2}\-\d{3}\.\d{2}" ]
  )
  ] .

In RDFa, we could incorporate the belgianIdentificationNumber as follows. Notice that I used an ex prefix that may refer to any namespace.

<span datatype="ex:belgianIdentificationNumber" content="2010-03-10" property="belgianidentificationnumber">85.12.15-123.45</span>

What would be a good use case for this matter? Well, think about it from a usability point of view. Often, certain best practices are prescribed to make a website more user-friendly. This is certainly valid in the context of content organization for web-based e-government applications. Indeed, often content should be formatted and information must be clearly organized to facilitate scanning, and to enable quick understanding. For example, the order of items in a list should be done to maximize user performance. If a numbered list is used, a requirement would be that the numbering starts at ‘one,’ not ‘zero.’ Another possible usability requirement with lists: generally only the first letter of the first word is capitalized, unless a word that is usually capitalized is shown. Also, designers should determine if there is an order for items that will facilitate use of the website. If there is, ensure that the site is formatted to support that order, and that all pages follow the same order. Where no obvious order applies, organize lists alphabetically or numerically. Keep in mind that it is the user’s logic that should prevail rather than the designer’s logic[ref]These examples were inspired by the US federal government usability book: Research-Based Web Design & Usability Guidelines.[/ref]. For optimal results, as always, all cases should be thoroughly tested.

Obviously, usability requirements are different for an e-government portal than for an e-commerce website, but think how different ontologies might emerge for all kinds of domains. Usability guidelines could then be incorporated in these OWL ontologies by defining datatype restrictions and leveraging the true power of XMLSchema, allowing you to measure user-friendliness in a somewhat automated manner. And of course they could be used in combination with other restrictions on properties (e.g., owl:hasValue) like what their value and cardinality ought to be. Finally, a “semantic” usability test suite could then be build that would enable you to remotely test websites, make conclusions and propose appropriate recommendations.

Finally, for other uses of formal semantics in the context of user interfaces I would like to list the folllowing publications: [ref]Paulheim, H. and Probst, F. (2010), “”Improving UI Integration with Formal Semantics””, In: Proceedings of the Workshop on Semantic Models for Adaptive Interactive Systems (SEMAIS)[/ref] and [ref]
Janeiro, J.; Barbosa, S. D. J.; Springer, T. and Schill, A. (2010), “”Semantically relating user interface design patterns””, In: ACM International Conference Proceeding Series archive
Proceedings of the 1st International Workshop on Pattern-Driven Engineering of Interactive Computing Systems
[/ref]

2 thoughts on “Using the power of ontologies to automate usability testing”

Leave a Reply

Your email address will not be published. Required fields are marked *