Constraining forms to use individuals of a particular class AND scheme.

12 views
Skip to first unread message

Steven Michael Folsom

unread,
Oct 10, 2017, 2:46:54 PM10/10/17
to topbrai...@googlegroups.com

I’m building constraints for form building, and I'm wondering the best way to constrain a PropertyShape to say for a given property not only link to individuals of a particular class type, but also individuals from a particular scheme.

For example, in the following we want to use the property rdau:P60552 to link to individuals skos:inScheme <http://rdaregistry.info/termList/configPlayback> .

sh:property [
      sh:path <http://rdaregistry.info/Elements/u/P60552> ;
      sh:class <http://www.w3.org/2004/02/skos/core#Concept> ;
      sh:description "Relates a resource to a number of sound channels used to make a recording." ;
      sh:name "Has playback channels" ;
      sh:nodeKind sh:IRI ;
 

I have a feeling based on the SHACL spec the answer is somewhere in the SPARQL-based constraints, but could someone confirm?


Thanks in advance for any pointers,

Steven

 

-- 

Steven Folsom

Metadata Specialist

Cornell University Library

http://orcid.org/0000-0003-3427-5769

http://vivo.cornell.edu/individual/sf433

@sf433

 

Irene Polikoff

unread,
Oct 10, 2017, 3:06:14 PM10/10/17
to topbrai...@googlegroups.com
Steven,

sh:path can be used for paths, not just for single properties

So, you can place another property constraint to say that the value of http://rdaregistry.info/Elements/u/P60552/skos:inScheme path must be http://rdaregistry.info/termList/configPlayback. You can use sh:hasValue constraint for this.
> --
> You received this message because you are subscribed to the Google Groups "TopBraid Suite Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to topbraid-user...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Steven Folsom

unread,
Oct 12, 2017, 4:12:40 PM10/12/17
to TopBraid Suite Users
Irene,

Thanks this is helpful. If I want to say the value used with a property can come from one or more acceptable schemes, I'm guessing that I'll need to use sh:or, right? (Since sh:hasValue says at least one value node is equal to the given term.)

E.g. Let's see if I can get this right...

sh:property [
      sh:path http://rdaregistry.info/Elements/u/P60552/skos:inScheme ;
      sh:nodeKind sh:IRI ;

      sh:or (
           [ sh:value <http://rdaregistry.info/termList/configPlayback> ;

           

           [ sh:value <http://xyz.org/otherscheme> ;

           ]

        ) ;

  ];



Thanks,
Steven

Holger Knublauch

unread,
Oct 12, 2017, 6:01:17 PM10/12/17
to topbrai...@googlegroups.com
Hi Steven,

unless I misunderstand something, I think you can use sh:in here:


sh:property [
      sh:path <http://rdaregistry.info/Elements/u/P60552/skos:inScheme> ;
      sh:nodeKind sh:IRI ;

      sh:in ( <http://rdaregistry.info/termList/configPlayback> <http://xyz.org/otherscheme> ) ;

      sh:minCount 1 ;

  ];

and use sh:minCount 1 to get equivalence of sh:hasValue.

Holger
Reply all
Reply to author
Forward
0 new messages