@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix dc: <http://purl.org/dc/terms/> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix qb: <http://purl.org/linked-data/cube#> .
@prefix prov: <http://www.w3.org/ns/prov#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .

<http://purl.org/eis/vocab/daq#>
  a owl:Ontology, <http://purl.org/vocommons/voaf#Vocabulary> ;
  rdfs:label "Dataset Quality Vocabulary (daQ)" ;
  rdfs:comment "The Dataset Quality Vocabulary (daQ) is a lightweight, extensible core vocabulary for attaching the result of quality benchmarking of a linked open dataset (usually an expensive process) to that dataset.  daQ is designed to be extended by custom quality metrics.  Use cases include filtering and ranking datasets by quality." ;
  dc:creator [
    foaf:name "Jeremy Debattista" ;
    foaf:homepage <http://www.jeremydebattista.info> ;
    foaf:mbox <mailto:debattis@cs.uni-bonn.de>
  ], [
    foaf:name "Christoph Lange" ;
    rdfs:seeAlso <http://purl.org/net/clange> ;
    foaf:homepage <http://langec.wordpress.com/about/>
  ] ;
  dc:modified "2015-04-01"^^xsd:date .

<http://purl.org/eis/vocab/daq#dsd>
  a qb:DataStructureDefinition ;
  qb:component [
    qb:dimension <http://purl.org/eis/vocab/daq#metric> ;
    qb:order 1
  ], [
    qb:dimension <http://purl.org/eis/vocab/daq#computedOn> ;
    qb:order 2
  ], [
    qb:dimension <http://purl.org/linked-data/sdmx/2009/dimension#timePeriod> ;
    qb:order 3
  ], [ qb:measure <http://purl.org/eis/vocab/daq#value> ], [
    qb:attribute <http://purl.org/linked-data/sdmx/2009/attribute#unitMeasure> ;
    qb:componentRequired true ;
    qb:componentAttachment qb:DataSet
  ] .

<http://purl.org/eis/vocab/daq#QualityGraph>
  a rdfs:Class, owl:Class ;
  rdfs:subClassOf <http://www.w3.org/2004/03/trix/rdfg-1/Graph>, qb:DataSet, [
    a owl:Restriction ;
    owl:onProperty qb:structure ;
    owl:hasValue <http://purl.org/eis/vocab/daq#dsd>
  ] ;
  rdfs:comment "Defines a quality graph which will contain all metadata about quality metrics on the dataset." ;
  rdfs:label "Quality Graph Statistics" .

<http://purl.org/eis/vocab/daq#Observation>
  a rdfs:Class, owl:Class ;
  rdfs:subClassOf prov:Entity, qb:Observation ;
  rdfs:comment "A quality observation represents the statistical and provenance information of the attached metric's assessment activity." ;
  rdfs:label "Quality Observation" .

<http://purl.org/eis/vocab/daq#Category>
  a rdfs:Class, owl:Class ;
  rdfs:comment "The highest level of quality metric is a category. A category groups a number of dimensions relevant to each other which aims at measuring the quality of a dataset from different aspects. Categories are provided as subclasses of this abstract class, which is not intended for direct usage." ;
  rdfs:label "Category" .

<http://purl.org/eis/vocab/daq#Dimension>
  a rdfs:Class, owl:Class ;
  rdfs:comment "Each dimension is part of a larger group called category (See daq:Category). Each dimension has a number of metrics which are associated to it. A dimension is linked with a category using the daq:hasDimension property. Dimensions are provided as subclasses of this abstract class, which is not intended for direct usage." ;
  rdfs:label "Dimension" .

<http://purl.org/eis/vocab/daq#Metric>
  a rdfs:Class, owl:Class ;
  rdfs:comment """The smallest unit of measuring a quality dimension is a metric. A metric belongs to exactly one dimension. Each metric has one or more observations (	exttt{daq:hasObservation}), which records data quality assessment value following a computation. Metrics are provided as subclasses of this abstract class, which is not intended for direct usage.""" ;
  rdfs:label "Metric" .

<http://purl.org/eis/vocab/daq#computedBy>
  a rdf:Property, owl:ObjectProperty, qb:DimensionProperty ;
  rdfs:label "computed by" ;
  rdfs:comment "TODO: Define properly" ;
  rdfs:domain qb:Observation .

<http://purl.org/eis/vocab/daq#computedOn>
  a rdf:Property, owl:ObjectProperty, qb:DimensionProperty ;
  rdfs:label "computed on" ;
  rdfs:comment "Quality metrics can be (in principle) calculated on various forms of data (such as datasets, graphs, set of triples etc...). This vocabulary allow the owner/user of such RDF data to calculate metrics on multiple (and different) resources." ;
  rdfs:domain qb:Observation ;
  rdfs:range rdfs:Resource .

<http://purl.org/linked-data/sdmx/2009/dimension#timePeriod>
  rdfs:domain qb:Observation ;
  rdfs:range xsd:dateTime ;
  owl:cardinality "1"^^xsd:nonNegativeInteger .

<http://purl.org/eis/vocab/daq#hasObservation>
  a rdf:Property, owl:DatatypeProperty ;
  rdfs:label "has observation" ;
  rdfs:comment "Computed metrics can have 1 or more quality observations, where each computed resource has one observation." ;
  rdfs:domain <http://purl.org/eis/vocab/daq#Metric> ;
  rdfs:range <http://purl.org/eis/vocab/daq#Observation> ;
  owl:minCardinality "1"^^xsd:nonNegativeInteger ;
  owl:inverseOf <http://purl.org/eis/vocab/daq#metric> .

<http://purl.org/eis/vocab/daq#metric>
  a rdf:Property, owl:DatatypeProperty, qb:DimensionProperty ;
  rdfs:label "metric" ;
  rdfs:comment "Represents the metric being observed." ;
  rdfs:domain qb:Observation ;
  rdfs:range <http://purl.org/eis/vocab/daq#Metric> ;
  owl:minCardinality "1"^^xsd:nonNegativeInteger ;
  owl:inverseOf <http://purl.org/eis/vocab/daq#hasObservation> .

<http://purl.org/eis/vocab/daq#value>
  a rdf:Property, owl:DatatypeProperty, qb:MeasureProperty ;
  rdfs:label "value" ;
  rdfs:comment "Each metric will have a value computed. In order to deal with the different return type of the metric computation, this property links a metric with a value object (e.g. boolean, double, Literal)." ;
  rdfs:domain qb:Observation ;
  owl:cardinality "1"^^xsd:nonNegativeInteger .

<http://purl.org/eis/vocab/daq#expectedDataType>
  a rdf:Property, owl:DatatypeProperty ;
  rdfs:label "expected data type" ;
  rdfs:comment "Each metric should have an expect data type for it's observed value (e.g. xsd:boolean, xsd:double etc...)" ;
  rdfs:domain <http://purl.org/eis/vocab/daq#Metric> ;
  rdfs:range xsd:anySimpleType ;
  owl:cardinality "1"^^xsd:nonNegativeInteger .

<http://purl.org/eis/vocab/daq#requires>
  a rdf:Property, owl:ObjectProperty ;
  rdfs:label "requires" ;
  rdfs:comment "A metric might require a number of external resources (e.g. a gold standard) in order to be able to measure the quality. In order to cater for the most generic requirement, this property links a metric to the required resource (e.g. a URI to the gold standard dataset used)." ;
  rdfs:domain <http://purl.org/eis/vocab/daq#Metric> ;
  rdfs:range rdfs:Resource .

<http://purl.org/eis/vocab/daq#isEstimate>
  a rdf:Property, owl:ObjectProperty ;
  rdfs:label "is estimate" ;
  rdfs:comment "This property flags true if an assessed observation of a metric gives an estimate result instead of a more accurate one." ;
  rdfs:domain qb:Observation ;
  rdfs:range xsd:boolean ;
  owl:cardinality "1"^^xsd:nonNegativeInteger .

<http://purl.org/eis/vocab/daq#hasDimension>
  a rdf:Property, owl:ObjectProperty ;
  rdfs:label "hasDimension" ;
  rdfs:comment "The category concept classifies dimensions related to the measurement of quality for a specific criteria. This is an abstract property and should not be used directly. Specific sub-properties should be inherited for different dimensions." ;
  rdfs:domain <http://purl.org/eis/vocab/daq#Category> ;
  rdfs:range <http://purl.org/eis/vocab/daq#Dimension> .

<http://purl.org/eis/vocab/daq#hasMetric>
  a rdf:Property, owl:ObjectProperty ;
  rdfs:label "hasMetric" ;
  rdfs:comment "A dimension is an abstract concept which groups an number of more concrete metrics to measure quality of a dataset. This is an abstract property and should not be used directly. Specific sub-properties should be inherited for different metrics." ;
  rdfs:domain <http://purl.org/eis/vocab/daq#Dimension> ;
  rdfs:range <http://purl.org/eis/vocab/daq#Metric> .
