GRValidator Implemented E1

Error 1

=== E1: For all intervals: Check that Max<=Min (for quantitative properties and for currencyValue) ===

Validator Tool: Step # 1

Error Message

All maximun values must be greater than minimun values, including currencies.

Potential Problem

Prices and quantitative product properties can be specified as intervals using the gr:hasMinValueFloat - gr:hasMaxValueFloat, gr:hasMinValueInteger - gr:hasMaxValueInteger and gr:hasMinCurrencyValue - gr:hasMaxCurrencyValue properties. Care must be taken that the "min" values are lower or equal to the "max" values.

Examples of Wrong Data

Wrong Data: hasMinValueFloat, hasMaxValueFloat

@prefix gr: <http://purl.org/goodrelations/v1#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix toy: <http://www.heppnetz.de/ontologies/examples/toy#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
<http://www.heppnetz.de/ontologies/examples/gr> rdf:type owl:Ontology ;
    owl:imports <http://www.heppnetz.de/ontologies/examples/toy> ,
        <http://purl.org/goodrelations/v1> .
<http://www.heppnetz.de/ontologies/examples/gr#mySony100TVSet> rdf:type gr:ActualProductOrServiceInstance .
<http://www.heppnetz.de/ontologies/examples/gr#QuantitativeValueFloat_1> rdf:type gr:QuantitativeValueFloat ;
    gr:hasUnitOfMeasurement "CMT"^^<http://www.w3.org/2001/XMLSchema#string> ;
    gr:hasMinValueFloat "300.0"^^<http://www.w3.org/2001/XMLSchema#float> ;
    gr:hasMaxValueFloat "150.0"^^<http://www.w3.org/2001/XMLSchema#float> .
<http://www.heppnetz.de/ontologies/examples/gr#mySony100TVSet> toy:hasScreenSize
<http://www.heppnetz.de/ontologies/examples/gr#QuantitativeValueFloat_1> ;
    rdf:type toy:TVSet .
<http://www.heppnetz.de/ontologies/examples/gr#ElectronicsCom> rdf:type gr:BusinessEntity ;
    gr:legalName "Electronics.com Ltd."^^<http://www.w3.org/2001/XMLSchema#string> ;
    rdfs:seeAlso <http://www.electronics.com> .

Wrong Data: hasMinCurrencyaValue, hasMaxCurrencyValue

@prefix gr: <http://purl.org/goodrelations/v1#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix toy: <http://www.heppnetz.de/ontologies/examples/toy#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
<http://www.heppnetz.de/ontologies/examples/gr> rdf:type owl:Ontology ;
    owl:imports <http://www.heppnetz.de/ontologies/examples/toy> ,
        <http://purl.org/goodrelations/v1> .
<http://www.heppnetz.de/ontologies/examples/gr#mySony100TVSet> rdf:type gr:ActualProductOrServiceInstance .
<http://www.heppnetz.de/ontologies/examples/gr#UnitPriceSpecification_1> rdf:type gr:UnitPriceSpecification ;
    gr:hasUnitOfMeasurement "CMT"^^<http://www.w3.org/2001/XMLSchema#string> ;
    gr:hasMinCurrencyValue "300.0"^^<http://www.w3.org/2001/XMLSchema#float> ;
    gr:hasMaxCurrencyValue "150.0"^^<http://www.w3.org/2001/XMLSchema#float> .
<http://www.heppnetz.de/ontologies/examples/gr#mySony100TVSet> toy:hasScreenSize
<http://www.heppnetz.de/ontologies/examples/gr#UnitPriceSpecification_1> ;
    rdf:type toy:TVSet .
<http://www.heppnetz.de/ontologies/examples/gr#ElectronicsCom> rdf:type gr:BusinessEntity ;
    gr:legalName "Electronics.com Ltd."^^<http://www.w3.org/2001/XMLSchema#string> ;
    rdfs:seeAlso <http://www.electronics.com> .

SPARQL Query

PREFIX gr:<http://purl.org/goodrelations/v1#>

SELECT ?object
WHERE {
  {
    ?object a gr:QuantitativeValue .
    ?object gr:hasMinValue ?minValue .
    ?object gr:hasMaxValue ?maxValue .
    FILTER( (?maxValue < ?minValue) )
  } UNION {
    ?object a gr:QuantitativeValueFloat .
    ?object gr:hasMinValue ?minValue .
    ?object gr:hasMaxValue ?maxValue .
    FILTER( (?maxValue < ?minValue) )
  } UNION {
    ?object a gr:QuantitativeInteger .
    ?object gr:hasMinValue ?minValue .
    ?object gr:hasMaxValue ?maxValue .
    FILTER( (?maxValue < ?minValue) )
  } UNION {
    ?object a gr:QuantitativeValueFloat .
    ?object gr:hasMinValueFloat ?minValue .
    ?object gr:hasMaxValueFloat ?maxValue .
    FILTER( (?maxValue < ?minValue) )
  } UNION {
    ?object a gr:QuantitativeValueInteger .
    ?object gr:hasMinValueInteger ?minValue .
    ?object gr:hasMaxValueInteger ?maxValue .
    FILTER( (?maxValue < ?minValue) )
  } UNION {
    ?object a gr:PriceSpecification .
    ?object gr:hasMinCurrencyValue ?minValue .
    ?object gr:hasMaxCurrencyValue ?maxValue .
    FILTER( (?maxValue < ?minValue) )
  } UNION {
    ?object a gr:UnitPriceSpecification .
    ?object gr:hasMinCurrencyValue ?minValue .
    ?object gr:hasMaxCurrencyValue ?maxValue .
    FILTER( (?maxValue < ?minValue) )
  } UNION {
    ?object a gr:DeliveryChargeSpecification .
    ?object gr:hasMinCurrencyValue ?minValue .
    ?object gr:hasMaxCurrencyValue ?maxValue .
    FILTER( (?maxValue < ?minValue) )
  } UNION {
    ?object a gr:PaymentChargeSpecification .
    ?object gr:hasMinCurrencyValue ?minValue .
    ?object gr:hasMaxCurrencyValue ?maxValue .
    FILTER( (?maxValue < ?minValue) )
  }
}

[CATEGORY: GRVALIDATOR_STEP]