GRValidator Implemented E25

Error 25

E25: Check that the validity of the offer covers the validity of all price specifications.

Validator Tool: Step # 26

Error Message

There are some elements not defined in V1 of GoodRelations.

Examples of Wrong Data

@prefix gr: <http://purl.org/goodrelations/v1#>.
@prefix xsd: <http://www.w3.org/2001/XMLSchema#>.
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>.
@prefix toy: <http://www.heppnetz.de/ontologies/examples/toy#>.
@prefix dc: <http://purl.org/dc/elements/1.1/>.
@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#Offering_1> a gr:Offering;
        gr:hasBusinessFunction <http://www.heppnetz.de/ontologies/examples/&gr;Sell>;
    gr:hasPriceSpecification <http://www.heppnetz.de/ontologies/examples/gr#UPS_wrong_too_early>,
                         <http://www.heppnetz.de/ontologies/examples/gr#UPS_wrong_too_late>;
    gr:validFrom "2010-11-12T00:00:00+01:00"^^<&xsd;dateTime>;
    gr:validThrough "2010-11-12T23:59:59+01:00"^^<&xsd;dateTime>.
<http://www.heppnetz.de/ontologies/examples/gr#UPS_wrong_too_early> a gr:UnitPriceSpecification;
        gr:hasCurrency "USD"^^<&xsd;string>;
    gr:hasCurrencyValue "9.99"^^<&xsd;float>;
    gr:hasUnitOfMeasurement "C62"^^<&xsd;string>;
    gr:validFrom "2010-11-10T00:00:00+01:00"^^<&xsd;dateTime>;
    gr:validThrough "2010-11-12T23:59:59+01:00"^^<&xsd;dateTime>.
<http://www.heppnetz.de/ontologies/examples/gr#UPS_wrong_too_late> a gr:UnitPriceSpecification;
        gr:hasCurrency "USD"^^<&xsd;string>;
    gr:hasCurrencyValue "9.99"^^<&xsd;float>;
    gr:hasUnitOfMeasurement "C62"^^<&xsd;string>;
    gr:validFrom "2010-11-12T00:00:00+01:00"^^<&xsd;dateTime>;
    gr:validThrough "2010-11-13T23:59:59+01:00"^^<&xsd;dateTime>.

SPARQL Query

DEFINE input:inference "http://uriburner.com/inference/rules/goodrelations#"
SELECT * WHERE {
  ?pricespec a gr:PriceSpecification.
  ?pricespec gr:validFrom ?validfrom_price.
  ?pricespec gr:validThrough ?validthrough_price.

  ?offering a gr:Offering .
  ?offering gr:hasPriceSpecification ?pricespec.
  ?offering gr:validFrom ?validfrom_offering.
  ?offering gr:validThrough ?validthrough_offering.

  FILTER (xsd:dateTime(?validfrom_offering) > xsd:dateTime(?validfrom_price)
          ||
          xsd:dateTime(?validthrough_price) > xsd:dateTime(?validthrough_offering)
  )

}