> On 30 Nov 2020, at 14:39, Henrik Dibowski <h.dibow...@gmail.com> wrote:
> 
> Hi Irene and all,
> 
> I was looking for existing discussions about the problem we`re facing, and 
> found your post here. In SHACL I want to express that the object nodes of an 
> object property can be of either class A, B, C... That`s what I`m trying to 
> define in the PropertyShape of the object property via the sh:class 
> predicate. Here I need to define this alternative from a list of classes. 
> Using owl:unionOf does not seem to work here
> 

As Irene said:

> Second, SHACL is its own language. You cannot use OWL axioms in SHACL 
> definitions just as you can’t use SHACL statements in OWL axioms. SHACL has 
> its own logical expressions using sh:or, sh:and, sh:not, etc.


> , as the SHACL engine reports constraint violations for any subject instance, 
> which is not an instance of all the classes. Defining several values for 
> sh:class, as suggested by you, Irene, does not work either, as the 
> implemented semantics is not the union but the intersection, i.e. only 
> instances can be in the object position that are members of ALL the classes. 
> So that`s not the wanted behavior, but does quite the opposite of a union 
> construct.
> 
> My question to you: How can we define the desired expression? Or is the SHACL 
> engine faulty? I have this problem not only for the sh:class predicate, but 
> also for sh:targetClass of a NodeShape, where I want to have an easy way to 
> declare the union of several classes as target class. I do not want to go for 
> a SPARQL target definition here (there has to be a simpler solution!?), and 
> besides, for sh:class it would not be an option at all.
> 

The simplest approach is to make a superclass of the classes in question. In 
EDG you can declare that to be abstract too.

Cheers,
David


> Many thanks
> 
> 
> On Wednesday, February 5, 2020 at 3:19:21 PM UTC+1 Irene Polikoff wrote:
> Michel,
> 
> First, all target declarations are cumulative. The target is a union of all 
> targets https://www.w3.org/TR/shacl/#targets 
> <https://www.w3.org/TR/shacl/#targets>
> 
> So, for the validation purposes, you could simply do:
> 
> alim:NodeShape_1 sh:targetClass  bs:InformationObject, bs:Activity, 
> bs:PhysicalObject.
> 
> For the form view and edit purposes, you will see the rdfs:seeAlso  on the 
> form for instances of these classes, but not in the same display with the 
> fields that are defined directly for the class or for any class it is 
> connected to via rdfs:subClassOf statement, transitively. 
> 
> Instead, you will get a dropdown on the form that will let you switch to the 
> alim:NodeShape_1 view of a resource. This view will only show properties 
> defined for alim:NodeShape_1. Each node shape targeting a resource results in 
> its own view on a resource.
> 
> If this is not what you want, do not create a new node shape that will be an 
> alternative view. Instead, add a property shape for rdfs:seeAlso directly for 
> each of the classes or create a common super class and add the property shape 
> to it.
> 
> In EDG, for modeling convenience, there is an option to add already existing 
> property definitions (property shapes) to a class (node shape) as well as an 
> option to copy property definitions from another node shape.
> 
> Second, SHACL is its own language. You can not use OWL axioms in SHACL 
> definitions just as you can’t use SHACL statements in OWL axioms. SHACL has 
> its own logical expressions using sh:or, sh:and, sh:not, etc.
> 
> SHACL engines do not perform OWL inferencing e.g., to resolve the set 
> represented as a union. You can, in principle, run OWL inferencing on your 
> ontology which could insert rdfs:subClassOf statements from these 3 classes 
> to the union class which will be a blank node and you could attach a property 
> shape for rdfs:seeAlso to that blank node, but I would not recommend this.
> 
> 
> Third, if you want to see on a form a hyperlink to a document on a web, use 
> xsd:anyURI or, if values are text that includes links, use ref:HTML. You can 
> also specify multiple datatypes.
> 
> 
>> On Feb 5, 2020, at 7:16 AM, 'Bohms, H.M. (Michel)' via TopBraid Suite Users 
>> <topbrai...@googlegroups.com 
>> <applewebdata://2371D253-3DDA-4695-A88C-EC79EA3B215F>> wrote:
>> 
>> Dear Irene
>>  
>> Still bit struggling with TBCtoEDG.
>>  
>> Following your advice I made my ontology a shacl one in TBC.
>>  
>> I added:
>> alim:NodeShape_1
>>   rdf:type sh:NodeShape ;
>>   sh:property [
>>       sh:path rdfs:seeAlso ;
>>       sh:datatype xsd:string ;
>>     ] ;
>>   sh:targetClass [
>>       rdf:type owl:Class ;
>>       owl:unionOf (
>>           bs:InformationObject
>>           bs:Activity
>>           bs:PhysicalObject
>>         ) ;
>>     ] ;
>> .
>>  
>> This way I hoped to get a rdfs:seeAlso property in my 
>> bs:InformationObject/alim:Paper form. (I actually have data pointing to an 
>> doc on the web).
>>  
>> However when I use EDG (including this update shacl file) and go to a 
>> specific instance of InformationObject I get:
> 
>> <image001.jpg>
> 
>> 
>>  
>> And also an error is thrown in TBC:
> 
>> <image007.jpg>
> 
>> 
>>  
>> Thx for advice,
>> Michel
>>  
>> Ps
>> I attached the actual test ontology
>>  
>>  
>> Dr. ir. H.M. (Michel) Böhms
>> Senior Data Scientist
>> 
>> T +31888663107 <tel:+31%2088%20866%203107>
>> M +31630381220 <tel:+31%206%2030381220>
>> E michel...@tno.nl <applewebdata://2371D253-3DDA-4695-A88C-EC79EA3B215F>
>> Location
>> 
>>  
> 
>> <image006.gif>
> 
>> 
>> This message may contain information that is not intended for you. If you 
>> are not the addressee or if this message was sent to you by mistake, you are 
>> requested to inform the sender and delete the message. TNO accepts no 
>> liability for the content of this e-mail, for the manner in which you use it 
>> and for damage of any kind resulting from the risks inherent to the 
>> electronic transmission of messages.
>>  
>>  
>>  
>>  
>> 
> 
>> -- 
>> 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 
>> <applewebdata://2371D253-3DDA-4695-A88C-EC79EA3B215F>.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/topbraid-users/ec66e6a6d0f840b093c55230981f3446%40tno.nl
>>  
>> <https://groups.google.com/d/msgid/topbraid-users/ec66e6a6d0f840b093c55230981f3446%40tno.nl>.
>> <alim.shapes.ttl>
> 
> 
> -- 
> 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-users+unsubscr...@googlegroups.com 
> <mailto:topbraid-users+unsubscr...@googlegroups.com>.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/topbraid-users/e69817dc-062b-487a-a50c-2434a1b0f7dan%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/topbraid-users/e69817dc-062b-487a-a50c-2434a1b0f7dan%40googlegroups.com?utm_medium=email&utm_source=footer>.

UK +44 (0) 7788 561308
US +1 (336) 283-0808‬

-- 
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-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/topbraid-users/560E7839-E8B2-4EE6-A3EE-CE10C280F5B3%40topquadrant.com.

Reply via email to