<?xml version="1.0" encoding="utf-8"?>
<rdf:RDF
   xmlns:bibo="http://purl.org/ontology/bibo/"
   xmlns:dc="http://purl.org/dc/elements/1.1/"
   xmlns:dcterms="http://purl.org/dc/terms/"
   xmlns:foaf="http://xmlns.com/foaf/0.1/"
   xmlns:owl="http://www.w3.org/2002/07/owl#"
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
   xmlns:schema="https://schema.org/"
   xmlns:skos="http://www.w3.org/2004/02/skos/core#"
   xmlns:vann="http://purl.org/vocab/vann/"
   xmlns:vs="http://www.w3.org/2003/06/sw-vocab-status/ns#"
>
  <rdf:Description rdf:about="http://purl.org/spar/error">
    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Ontology"/>
    <rdfs:label xml:lang="en">Error Ontology</rdfs:label>
    <dc:contributor rdf:datatype="http://www.w3.org/2001/XMLSchema#string">Sebastian Barzaghi (https://orcid.org/0000-0002-0799-1527)</dc:contributor>
    <dc:creator rdf:datatype="http://www.w3.org/2001/XMLSchema#string">Silvio Peroni (https://orcid.org/0000-0003-0530-4305)</dc:creator>
    <dc:date rdf:datatype="http://www.w3.org/2001/XMLSchema#date">2026-09-25</dc:date>
    <dc:description xml:lang="en">
The **_Error Ontology_** is an unit test that allow to produce an inconsistent model if a particular (and incorrect) situation happens.

![The main architecture of the Error Ontology.](error.png)

It works by means of a data property `error:hasError` that denies its usage for ant resource. 
In fact, by defining its domain as "all those resource that do not have any `hasErrorDescription` assertion", a resource that asserts having an error makes the ontology inconsistent.

## Examples of use

In the following subsections, we introduce some examples to showcase how to use the Error Ontology. 

The prefixes that are used in all the examples provided below are defined as follows:

    @prefix : &lt;http://www.sparontologies.net/example/&gt; .
    @prefix error: &lt;http://www.essepuntato.it/2009/10/error#&gt; .
    @prefix owl: &lt;http://www.w3.org/2002/07/owl#&gt; .
    @prefix rdfs: &lt;http://www.w3.org/2000/01/rdf-schema#&gt; .
    @prefix xsd: &lt;http://www.w3.org/2001/XMLSchema#&gt; .

### Flagging an erroneous resource

A resource can be directly marked as erroneous by asserting a description of its error. 
Since no resource can have any `error:hasError` assertion, a reasoner will classify it as a member of `owl:Nothing`, making the model inconsistent.

    :my-article a fabio:Article ;
        error:hasError "The article has two different publication dates."^^xsd:string .

### Defining a forbidden situation through a class axiom

An incorrect situation can be modelled as a class whose members are automatically associated with an error description. 
Any individual that falls in such a class makes the model inconsistent, and the error description explains why.

    :DraftAndPublishedDocument
        owl:equivalentClass [ a owl:Class ;
            owl:intersectionOf ( fabio:Manuscript fabio:JournalArticle ) ] ;
        rdfs:subClassOf [ a owl:Restriction ;
            owl:onProperty error:hasError ;
            owl:hasValue "A document cannot be a draft and published at the same time."^^xsd:string ] .

    :my-document a fabio:Manuscript , 
        fabio:JournalArticle .

## Competency Questions

The Error Ontology can be used to produce an inconsistent model if a particular (and incorrect) situation happens.
In the following subsections, some competency questions are introduced together with their respective SPARQL queries.

The prefixes that are used in all the SPARQL queries provided below are defined as follows:

    PREFIX error: &lt;http://www.essepuntato.it/2009/10/error#&gt;
    PREFIX owl: &lt;http://www.w3.org/2002/07/owl#&gt;
    PREFIX rdfs: &lt;http://www.w3.org/2000/01/rdf-schema#&gt;

### CQ1

Which resources are explicitly asserted to have an error, and what is the description of that error?

    SELECT ?resource ?description WHERE {
        ?resource error:hasError ?description .
    }

### CQ2

Which classes describe a forbidden situation, and what is the error description associated with their members?

    SELECT ?class ?description WHERE {
        ?class rdfs:subClassOf ?restriction .
        ?restriction a owl:Restriction ;
            owl:onProperty error:hasError ;
            owl:hasValue ?description .
    }

### CQ3

Does the dataset contain at least one resource with an error?

    ASK {
        ?resource error:hasError ?description .
    }

</dc:description>
    <dcterms:bibliographicCitation>Ciccarese, P., &amp; Peroni, S. (2014). The Collections Ontology: creating and handling collections in OWL 2 DL frameworks. Semantic Web, 5(6), 515-529. DOI: https://doi.org/10.3233/SW-130121.</dcterms:bibliographicCitation>
    <dc:title xml:lang="en">The Error Ontology</dc:title>
    <dcterms:created>2010-11-29</dcterms:created>
    <dcterms:issued>2010-11-29</dcterms:issued>
    <dcterms:license rdf:resource="http://creativecommons.org/licenses/by/4.0/"/>
    <dcterms:modified>2026-09-25</dcterms:modified>
    <dcterms:publisher rdf:resource="https://ror.org/00wb4mk85"/>
    <dcterms:source rdf:resource="https://github.com/SPAROntologies/error/blob/master/docs/cq.md"/>
    <bibo:doi>TBA</bibo:doi>
    <bibo:status rdf:resource="http://purl.org/ontology/bibo/status/published"/>
    <vann:preferredNamespacePrefix xml:lang="en">error</vann:preferredNamespacePrefix>
    <vann:preferredNamespaceUri xml:lang="en">http://purl.org/spar/error</vann:preferredNamespaceUri>
    <owl:backwardCompatibleWith rdf:resource="http://www.essepuntato.it/2009/10/error#2010-11-29"/>
    <owl:priorVersion rdf:resource="http://www.essepuntato.it/2009/10/error#2010-11-29"/>
    <owl:versionIRI rdf:resource="http://www.essepuntato.it/2009/10/error#2026-09-25"/>
    <foaf:logo rdf:resource="https://github.com/SPAROntologies/error/blob/master/spar.png"/>
    <schema:codeRepository rdf:resource="https://github.com/SPAROntologies/error"/>
    <schema:image rdf:resource="https://github.com/SPAROntologies/error/blob/master/docs/current/error.png"/>
    <schema:includedInDataCatalog rdf:resource="https://fairsharing.org/"/>
    <schema:keywords xml:lang="en">errors</schema:keywords>
    <schema:keywords xml:lang="en">error descriptions</schema:keywords>
    <schema:keywords xml:lang="en">semantic publishing</schema:keywords>
    <vann:changes xml:lang="en">
* **v1.0.1**: 
Added new documentation, including annotation properties (e.g., `bibo:doi`, `schema:codeRepository`, etc.), term properties (e.g., `vann:example`, `vs:term_status`, etc.), exemplary competency questions with their respective SPARQL queries, and a Grafoo diagram.
    </vann:changes>
    <owl:versionInfo rdf:datatype="http://www.w3.org/2001/XMLSchema#string">1.0.1</owl:versionInfo>
  </rdf:Description>
  <rdf:Description rdf:about="http://www.w3.org/2000/01/rdf-schema#comment">
    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#AnnotationProperty"/>
  </rdf:Description>
  <rdf:Description rdf:about="http://www.essepuntato.it/2009/10/error#hasError">
    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#DatatypeProperty"/>
    <rdfs:label xml:lang="en">has error</rdfs:label>
    <skos:note xml:lang="en">A data property linking a resource that contains a logical error (which results in it belonging to the class owl:Nothing, therefore making the model inconsistent) to a textual description of that error.</skos:note>
    <rdfs:comment xml:lang="en">A description, usually in natural language, of which kind of error results from a resource.</rdfs:comment>
    <rdfs:domain rdf:nodeID="n35f6366f7455428da85a75c459d5ca60b1"/>
    <rdfs:range rdf:resource="http://www.w3.org/2001/XMLSchema#string"/>
    <vann:example>
    :my-resource
        error:hasError "This resource violates a constraint of the model."^^xsd:string .
    </vann:example>
    <rdfs:isDefinedBy rdf:resource="http://purl.org/spar/error/"/>
    <vs:term_status rdf:resource="http://purl.org/linked-data/registry#statusStable"/>
  </rdf:Description>
  <rdf:Description rdf:about="http://www.w3.org/2000/01/rdf-schema#label">
    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#AnnotationProperty"/>
  </rdf:Description>
  <rdf:Description rdf:about="http://purl.org/dc/elements/1.1/description">
    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#AnnotationProperty"/>
  </rdf:Description>
  <rdf:Description rdf:about="http://purl.org/dc/elements/1.1/title">
    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#AnnotationProperty"/>
  </rdf:Description>
  <rdf:Description rdf:nodeID="n35f6366f7455428da85a75c459d5ca60b1">
    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Restriction"/>
    <owl:cardinality rdf:datatype="http://www.w3.org/2001/XMLSchema#nonNegativeInteger">0</owl:cardinality>
    <owl:onProperty rdf:resource="http://www.essepuntato.it/2009/10/error#hasError"/>
  </rdf:Description>
  <rdf:Description rdf:about="http://purl.org/dc/elements/1.1/rights">
    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#AnnotationProperty"/>
  </rdf:Description>
  <rdf:Description rdf:about="http://purl.org/dc/elements/1.1/creator">
    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#AnnotationProperty"/>
  </rdf:Description>
  <rdf:Description rdf:about="http://www.w3.org/2002/07/owl#versionInfo">
    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#AnnotationProperty"/>
  </rdf:Description>
  <rdf:Description rdf:about="http://purl.org/dc/elements/1.1/date">
    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#AnnotationProperty"/>
  </rdf:Description>
</rdf:RDF>
