GRValidator Implemented E17
From Wiki of the E-Business and Web Science Research Group
Contents |
Error 17
E17: Check that gr:opens and gr:closes use following format: hh:mm:ss (ISO 8601)
Validator Tool: Step # 29
Error Message
Open and close hours must be in 24 hours format and must follow one of the next conventions: hh:mm:ss, hh:mm:ssZ, hh:mm:ss+hh:mm, hh:mm:ss-hh:mm.
Potential Problem
Care must be taken that open a close hours follow the given format, otherwise it is not possible to know whether or not an hour is correct.
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 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#Opening_1> rdf:type gr:OpeningHoursSpecification ; gr:opens "00:00:00Z" ; gr:closes "23:13:00+00:30" . <http://www.heppnetz.de/ontologies/examples/gr#OpeningHoursSpecification_Mon_am> rdf:type gr:OpeningHoursSpecification ; gr:hasOpeningHoursDayOfWeek gr:Monday ; gr:opens "08:00:00Z00:30"^^<http://www.w3.org/2001/XMLSchema#time> ; gr:closes "20:00:00"^^<http://www.w3.org/2001/XMLSchema#time> .
SPARQL Query
PREFIX gr:<http://purl.org/goodrelations/v1#>
SELECT ?object
WHERE
{
?object a gr:OpeningHoursSpecification .
?object gr:opens ?opens .
?object gr:closes ?closes .
FILTER (
!( regex(str(?opens), "^(0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]$") ||
regex(str(?opens), "^(0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]Z$") ||
regex(str(?opens), "^(0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9][-+](0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$") ) ||
!( regex(str(?closes), "^(0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]$") ||
regex(str(?closes), "^(0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]Z$") ||
regex(str(?closes), "^(0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9][-+](0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$") )
)
}