Re: Schema.org related SHACL shapes

On 21/05/2020 22:10, James Hudson wrote:
> Hello Holger,
>
> Thank you for the clarification.
>
> This does prompt another question.
>
> Consider, for example, the https://schema.org/latitude property.
>
> When it is a Number, the value of a latitude, when expressed in 
> degrees, should be between -90 to 90. Currently the SHACL Shape 
> validating the latitude property would accept any valid instead of 
> producing a validation error when the values is outside of the valid 
> range. There are likely other (and better) similar examples which 
> http://datashapes.org/schema will not produce expected validation 
> errors for.
>
> Given how the shape is created, this is understandable. It would 
> require that valid ranges be specified and that is beyond the scope of 
> what a schema is or should be. An exception to this might be 
> properties like https://schema.org/byDay which, when it is a 
> https://schema.org/DayOfWeek, may produce a validation error if an 
> enumeration member is not provided.
>
> While http://datashapes.org/schema provides a basis for a solution to 
> validate schema.org <http://schema.org> data instances, it is missing 
> information to produce validation errors when they would be expected.
>
> Am I off base here?

You are correct. The SHACL schema from this (my) converter only converts 
what it can infer from the original official document. The official docs 
do not contain constraints such as the range of latitude. I do not know 
if this is an intentional design decision, but I guess adding something 
machine-readable (even if it uses xsd:minInclusive instead of 
sh:minInclusive) in the RDFa would make sense from my perspective. Of 
course, only in cases where the semantics are absolutely clear.

Holger


>
> Regards,
> James
>
> On Wed, May 20, 2020 at 9:57 PM Holger Knublauch 
> <holger@topquadrant.com <mailto:holger@topquadrant.com>> wrote:
>
>
>     On 21/05/2020 03:20, James Hudson wrote:
>>     Hello,
>>
>>     Dan B.,
>>
>>         While I am disappointed that no one has already done my work
>>         for me :-), what you have confirmed (I think) is that it is
>>         work worth doing and there are no known red flags against
>>         considering developing SHACL Shapes which would validate
>>         schema.org <http://schema.org> data instances.
>>
>>         If anyone can point me to specific work that have
>>         experimented with creating SHACL Shapes which validate
>>         schema.org <http://schema.org> data instances, I would be
>>         interested. I will keep looking.
>>
>>         Based on the breadth and extent of schema.org
>>         <http://schema.org>, it would seem to be a lot of work for
>>         complete validation.
>>
>>
>>     Alasdair,
>>
>>         I looked at your site, but did not see any SHACL Shapes
>>         related to schema.org <http://schema.org> classes or
>>         properties. I assume you are using them underneath
>>         somewhere...? Can they be shared?
>>
>>
>>     Gregory, Thomas,
>>
>>         Thank you for pointing me at http://datashapes.org/schema.
>>         Unless I am mistaken, it ( http://datashapes.org/schema.ttl )
>>         seems that is about validating schema.org <http://schema.org>
>>         classes and properties itself and not data instances.
>>
>     No, that SHACL file is actually for instances. It is generated
>     from the original RDFa definition of the schema.org
>     <http://schema.org> classes and properties and interprets the
>     specified ranges as sh:datatype and sh:class constraints. So you
>     *can* use it as a shapes graph when validating instances.
>
>     And yes, it's not entirely up to date - if anyone needs the very
>     latest version I could re-run the generator (which is also bundled
>     with TBC in case anyone has that).
>
>     Holger
>
>
>>
>>         Although, their "example file" (
>>         http://datashapes.org/schemashacl.shapes.ttl ) is what I am
>>         looking for, but it only covers one class. Still, there will
>>         be things in there that I can use.
>>
>>         It does provide some nice examples for how to do certain
>>         things in SHACL.
>>
>>
>>     Umut, Elias,
>>
>>         Thank you for pointing me at semantify.it
>>         <http://semantify.it>. I will have to take a closer look, but
>>         it does not appear to have what I am looking for this time,
>>         which is literally a SHACL Shape which can validate
>>         https://schema.org/Invoice#Invoice-gen-367 , for example --
>>         and beyond that, SHACL Shapes which could validate data
>>         instances of all of the schema.org <http://schema.org>
>>         classes and properties. Incomplete solutions would be of value.
>>
>>
>>     Regards,
>>     James
>>
>>
>>

Received on Friday, 22 May 2020 04:53:11 UTC