Open kurzum opened 1 year ago
Using JS DateTime "toISOString()" for all time-related fields now (ISO 8601)
We should add the DateTime regex to SHACL issued and modified and other datettime @manonthegithub could you find the correct/official regex for datetime?
I tested at https://shacl.org/playground/ with
@prefix dash: <http://datashapes.org/dash#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix schema: <http://schema.org/> .
@prefix sh: <http://www.w3.org/ns/shacl#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
schema:PersonShape
a sh:NodeShape ;
sh:targetClass schema:Person ;
sh:property [
sh:path schema:birthDate ;
sh:datatype xsd:dateTime ;
sh:maxCount 1 ;
] .
@prefix ex: <http://example.org/ns#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix schema: <http://schema.org/> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
ex:Bob
a schema:Person ;
schema:birthDate "Nonesense"^^xsd:dateTime .
Could you test the regex in the playground and post it here? We can change it in our SHACL php generator then.
Testing the inputs in Jena from store repo gives errors as expected.... The problem is not in shacl, but in the library used. I suggest either using another shacl library or just the service GStore already provides.
but Petra suggests the following:
^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+-]\d{2}:\d{2})?$
Lets duplicate official in the old docs:
-?([1-9][0-9]{3,}|0[0-9]{3})
-(0[1-9]|1[0-2])
-(0[1-9]|[12][0-9]|3[01])
T(([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9](\.[0-9]+)?|(24:00:00(\.0+)?))
(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?
Milliseconds are now in the issued and modified field. Should be caught by SHACL.
Also for distributions: