GRValidator Implemented E10
From Wiki of the E-Business and Web Science Research Group
Contents |
Error 10
E10: Check that both validThrough and hasValidFrom exist in offerings.
Note: This validation must be done before E11
Validator Tool: Step # 17
Error Message
Both validFrom and validThrough must be specified.
Potential Problem
One offering can specify valid dates by means of gr:validFrom and gr:validThrough. Care must be taken that both values exist because one has no sense without the other.
Examples of Wrong Data
@prefix toy: <http://www.heppnetz.de/ontologies/examples/toy#> . @prefix protege: <http://protege.stanford.edu/plugins/owl/protege#> . @prefix xsd: <http://www.w3.org/2001/XMLSchema#> . @prefix gr: <http://purl.org/goodrelations/v1#> . @prefix owl: <http://www.w3.org/2002/07/owl#> . @prefix xml: <http://www.w3.org/XML/1998/namespace> . @prefix dc: <http://purl.org/dc/elements/1.1/> . @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . <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#ElectronicsCom> rdf:type gr:BusinessEntity ; gr:legalName "Electronics.com Ltd."^^<&xsd;string> ; rdfs:seeAlso "" ; gr:offers <http://www.heppnetz.de/ontologies/examples/gr#Offering_1> . <http://www.heppnetz.de/ontologies/examples/gr#mySony100TVSet> rdf:type gr:ActualProductOrServiceInstance , <http://www.heppnetz.de/ontologies/examples/&toy;TVSet> ; toy:hasScreenSize <http://www.heppnetz.de/ontologies/examples/gr#QuantitativeValueFloat_1> . <http://www.heppnetz.de/ontologies/examples/gr#Offering_1> rdf:type gr:Offering ; gr:hasPriceSpecification <http://www.heppnetz.de/ontologies/examples/gr#UnitPriceSpecification_1> ; gr:hasBusinessFunction <http://www.heppnetz.de/ontologies/examples/&gr;Sell> ; gr:includesObject <http://www.heppnetz.de/ontologies/examples/gr#TypeAndQuantityNode_1> ; gr:validThrough "2009-04-24T00:00:00+01:00"^^<&xsd;dateTime> . <http://www.heppnetz.de/ontologies/examples/gr#QuantitativeValueFloat_1> rdf:type gr:QuantitativeValueFloat ; gr:hasValueFloat "30.0"^^<&xsd;float> ; gr:hasUnitOfMeasurement "CMT"^^<&xsd;string> . <http://www.heppnetz.de/ontologies/examples/gr#TypeAndQuantityNode_1> rdf:type gr:TypeAndQuantityNode ; gr:hasUnitOfMeasurement "C62"@en ; gr:typeOfGood <http://www.heppnetz.de/ontologies/examples/gr#mySony100TVSet> . <http://www.heppnetz.de/ontologies/examples/gr#UnitPriceSpecification_1> rdf:type gr:UnitPriceSpecification ; gr:hasCurrencyValue "200.0"^^<&xsd;float> ; gr:hasUnitOfMeasurement "C62"^^<&xsd;string> ; gr:hasCurrency "EUR"^^<&xsd;string> .
SPARQL Query
PREFIX gr:<http://purl.org/goodrelations/v1#>
SELECT ?object
WHERE {
?object a gr:Offering.
OPTIONAL { ?object gr:validFrom ?from } .
OPTIONAL { ?object gr:validThrough ?through } .
FILTER (!bound(?through) || !bound(?from) )
}