question wrt qualified constraint

55 views
Skip to first unread message

Bohms, H.M. (Michel)

unread,
Nov 10, 2023, 4:23:27 AM11/10/23
to topbrai...@googlegroups.com

I have a qualified constraint question.

 

To  define a meronomy (typical hasPart hierarchy) we now use in OWA/OWL:

 

:Vehicle

  a owl:Class ;

  rdfs:subClassOf [

      a owl:Restriction ;

      owl:minQualifiedCardinality "0"^^xsd:nonNegativeInteger ;

      owl:onClass :Engine ;

      owl:onProperty :hasPart ;

    ] .

 

We explicitly model this mincard=0 to indicate relevance (it is not an obligatory part).

(because we cannot leave the restriction out).

 

Now my question how does this translate into cwa/shacl?

 

:VehicleShape

  a sh:NodeShape ;

  sh:targetClass :Vehicle ;

  sh:property [

    sh:path :hasPart ;

    sh:qualifiedMinCount 0 ;

    sh:qualifiedValueShape [

                sh:class :Engine ;

                               ] ;

   sh:qualifiedMinCount 0 ;

.

 

Or can I delete the red now?

 

Similar (example not for decomposition):

 

        sh:property      [ sh:path                 https://w3id.org/nen2660/def#hasInterior ;

                           sh:qualifiedValueShape  [ sh:class  https://otl.waternet.nl/def/cff9206f-72ae-4eb8-a671-9c3dd73b62c0 ]

                         ] .

 

Is it ok to leave minCard/maxCard out?

 

Personally I guess NOT since I always have to give the actual constraint where the valueshape is ‘just’ the context when to be applied, right?

 

So I put in minCar = 0 again or is there in shape a smarter way to indicate this “relevance”?

 

Thx a lot, Michel

 

 

Michel Böhms
Data Scientist

 


Mobile +31 630381220
E-mail  
michel...@tno.nl

Location

 

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.

 

 

 

 

Holger Knublauch

unread,
Nov 10, 2023, 6:08:28 AM11/10/23
to 'Bohms, H.M. (Michel)' via TopBraid Suite Users
In both cases the constraint isn't doing any validation at all, so you can leave the sh:qualifiedMinCount out, if you only intend to use it to indicate relevance.

Holger


 
 
Michel Böhms
Data Scientist
 
<image001.png>
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.
 
 
 
 

-- 
The topics of this mailing list include TopBraid EDG and related technologies such as SHACL.
To post to this group, send email to topbrai...@googlegroups.com
--- 
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/topbraid-users/8f1ba4e23ebe4932bcaff5319933f7d1%40tno.nl.

Bohms, H.M. (Michel)

unread,
Nov 10, 2023, 7:09:48 AM11/10/23
to topbrai...@googlegroups.com
Ok, thx

So there is also no better way to model that y and z are typical (can be) parts of x where say r and s are not.
Like kind of qualified closure like sh:closed is on property level....
Michel

Op 10 nov. 2023 12:08 schreef Holger Knublauch <hol...@topquadrant.com>:

Holger Knublauch

unread,
Nov 10, 2023, 7:20:27 AM11/10/23
to 'Bohms, H.M. (Michel)' via TopBraid Suite Users
In almost all cases that I have seen, qualified value constraints are a pain to work with, either in OWL or SHACL. I have no recommendations for them as I almost never use them. I would just introduce a property :hasEngine and get rid of :hasPart.

Holger


David Price

unread,
Nov 10, 2023, 7:21:45 AM11/10/23
to topbrai...@googlegroups.com
Following on from Holger’s comment …

Typical” and “relevance” are not generally supported modeling concepts in RDF-land. “possible" and “cardinality" are basically it.

Min 0 just means optional and is therefore ignored by every rdf-based engine I know.

I guess in SHACL you could make a property shape that did a SPARQL NOT EXISTS and report an sh:Warning or sh:Info rather than a sh:Violation. But users might get tired of seeing the warnings repeatedly.

If you need to communicate “typical” to humans, then the documentation is a much better place. If I see “min 0” in a data model, I usually assume it’s a mistake and so would probably not understand the intent.

Cheers,
David

Bohms, H.M. (Michel)

unread,
Nov 10, 2023, 9:13:46 AM11/10/23
to topbrai...@googlegroups.com
Hi holger, david

See all your points.
Wished decomposition was better incorporated in our modelling languages, like in uml eg.

Specializing properties like hasEngine is a solution but you loose the actual decomposition semantics or you have to assume it in the "has" of "hasX" but typically "has" is also used for attributes or nonpart relations.

Anyway, thx for your views
Michel

Op 10 nov. 2023 13:21 schreef David Price <dpr...@topquadrant.com>:

Bohms, H.M. (Michel)

unread,
Nov 13, 2023, 12:09:42 PM11/13/23
to topbrai...@googlegroups.com

One more idea on this.

 

Would it be better to model the typical decomposition via some union range.

 

:Vehicle

  a owl:Class ;

  rdfs:subClassOf [

      a owl:Restriction ;

      owl:minQualifiedCardinality "0"^^xsd:nonNegativeInteger ;

      owl:onClass :Engine ;

      owl:onProperty :hasPart ;

    ] .

 

>>> 

 

:Vehicle

  a owl:Class ;

  rdfs:subClassOf [

      a owl:Restriction ;

       owl:allValuesFrom owl:unionOf (:Engine, :Chassis, …) ;

      owl:onProperty :hasPart ;

    ] .

 

???

(similar in shacl, sh:class being a union etc.)

 

Thx Michel

Holger Knublauch

unread,
Nov 13, 2023, 5:28:24 PM11/13/23
to 'Bohms, H.M. (Michel)' via TopBraid Suite Users
Can you not simply introduce a superclass :VehiclePart?

Holger


Bohms, H.M. (Michel)

unread,
Nov 13, 2023, 5:42:06 PM11/13/23
to topbrai...@googlegroups.com
Too many extra classes that are nonsemantical...would my proposed solution not  be more natural?

Op 13 nov. 2023 23:28 schreef Holger Knublauch <hol...@topquadrant.com>:

Holger Knublauch

unread,
Nov 14, 2023, 3:34:04 AM11/14/23
to 'Bohms, H.M. (Michel)' via TopBraid Suite Users

On 13 Nov 2023, at 11:42 pm, 'Bohms, H.M. (Michel)' via TopBraid Suite Users <topbrai...@googlegroups.com> wrote:

Too many extra classes that are nonsemantical...would my proposed solution not  be more natural?

I don't know the full model and cannot really comment further on this.

Holger



Bohms, H.M. (Michel)

unread,
Nov 14, 2023, 4:13:05 AM11/14/23
to topbrai...@googlegroups.com

Hi Holger

 

It is not really one specific model.

 

The context is CEN TC442/WG4/TG3 EN17632 “Semantic Modelling and Linking” standard, where we want to give recommendations for patterns on how to model with LD/SW-tech.

So we would like to give a guideline on how to model a Meronony (typical typical decomposition) in both OWL/OWA and SHACL/CWA.

 

In case cardinality constraint are in place (typically minCard=1) the situation is simple:

 

ex:Bridge

a owl:Class ;

  rdfs:subClassOf [

    a owl:Restriction ;

    owl:onClass ex:Deck ;

    owl:onProperty sml:hasPart ;

    owl:qualifiedCardinality "1"^^xsd:nonNegativeInteger ;

] .

 

The issue is in case there is no constraint, like with optional BridgeFurniture.

So my proposal to always add a “closing” restriction like:

 

ex:Bridge

  a owl:Class ;

  rdfs:subClassOf [

      a owl:Restriction ;

      owl:allValuesFrom owl:unionOf (ex:Deck, ex:BridgeFurnuture, …) ;

      owl:onProperty sml:hasPart ;

] .

 

To indicate that the BridgeFurniture is an optional part and all other things not mentioned are not.

 

Gr Michel

Reply all
Reply to author
Forward
0 new messages