W3C home > Mailing lists > Public > public-rdf-shapes@w3.org > October 2017

Re: Some SHACL Examples

From: Holger Knublauch <holger@topquadrant.com>
Date: Thu, 5 Oct 2017 12:56:10 +1000
To: public-rdf-shapes@w3.org
Message-ID: <718f6d2d-6943-d90f-4c6e-edda4eaeee4e@topquadrant.com>


On 5/10/2017 2:15, Thomas Francart wrote:
> Hello
>
> I am trying to write SHACL Shapes for 
> https://github.com/FranckCo/Stamina/blob/master/doc/xkos-best-practice.md. 
> And I am struggling :-)
> I would be particularly interested to see examples (in 
> https://www.w3.org/wiki/SHACL/Examples, maybe ?) of how to define the 
> following :
>
>   * How to check that the values of skos:notation do _not_ have a
>     language tag ? (maybe by saying they have xsd:string datatype ?)
>

Yes, using sh:datatype xsd:string. xsd:string is disjoint with 
rdf:langString in SHACL validation.

>   * How to check that skos:prefLabel must have at least one value with
>     language @en, but others can exist as well with a different
>     language ? (maybe using |sh:zeroOrMorePath ?)|
>

ex:PrefLabelShape
     a sh:NodeShape ;
     sh:targetSubjectsOf skos:prefLabel ;
     sh:property [
         sh:path skos:prefLabel ;
         sh:datatype rdf:langString ;
         sh:qualifiedMinCount 1 ;
         sh:qualifiedValueShape [ sh:languageIn ( "en" ) ] ;
     ] .

>   * How to check that every value of skos:prefLabel must have a
>     language (whatever the language) ? (maybe checking that the
>     datatype is rdf:langLiteral ?)
>

Yes, see above: sh:datatype rdf:langString.

HTH
Holger


> Thanks !
>
> Thomas
>
> -- 
> *
> *
> *Thomas Francart* -*SPARNA*
> Web de _données_ | Architecture de l'_information_ | Accès aux 
> _connaissances_
> blog : blog.sparna.fr <http://blog.sparna.fr>, site : sparna.fr 
> <http://sparna.fr>, linkedin : fr.linkedin.com/in/thomasfrancart 
> <https://fr.linkedin.com/in/thomasfrancart>
> tel :  +33 (0)6.71.11.25.97, skype : francartthomas
Received on Thursday, 5 October 2017 02:56:36 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 17:02:51 UTC