why class membership not inferred?

47 views
Skip to first unread message

Michel Böhms

unread,
Oct 28, 2024, 9:40:29 AM10/28/24
to TopBraid Suite Users

Can someone remind me why :

 

:Person_1 rdf:type :Girl .

is not inferred for:

 

 

# baseURI: http://w3id.org/nt

 

@prefix : http://w3id.org/nt# .

@prefix owl: http://www.w3.org/2002/07/owl# .

@prefix rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns# .

@prefix rdfs: http://www.w3.org/2000/01/rdf-schema# .

@prefix spin: http://spinrdf.org/spin# .

@prefix xsd: http://www.w3.org/2001/XMLSchema# .

 

http://w3id.org/nt

  a owl:Ontology ;

  spin:imports http://topbraid.org/spin/owlrl-all ;

  spin:imports http://topbraid.org/spin/rdfsplus ;

  owl:versionInfo "Created with TopBraid Composer" ;

.

:Girl

  a owl:Class ;

  rdfs:subClassOf :Person ;

  owl:equivalentClass [

      a owl:Class ;

      owl:intersectionOf (

          [

            a owl:Restriction ;

            owl:allValuesFrom [

                a rdfs:Datatype ;

                owl:onDatatype xsd:integer ;

                owl:withRestrictions (

                    [

                      xsd:maxExclusive 21 ;

                    ]

                  ) ;

              ] ;

            owl:onProperty :age ;

          ]

          [

            a owl:Restriction ;

            owl:hasValue "Female" ;

            owl:onProperty :gender ;

          ]

        ) ;

    ] ;

.

:Person

  a owl:Class ;

  rdfs:subClassOf owl:Thing ;

.

:Person_1

  a :Person ;

  :age 18 ;

  :firstname "Mabel" ;

  :gender "Female" ;

.

:age

  a owl:DatatypeProperty ;

  rdfs:range xsd:integer ;

.

:firstname

  a owl:DatatypeProperty ;

  rdfs:range xsd:string ;

.

:gender

  a owl:DatatypeProperty ;

  rdfs:range [

      a rdfs:Datatype ;

      owl:oneOf (

          "Male"

          "Female"

        ) ;

    ] ;

.

 

Thx a lot, Michel

Michel Böhms

unread,
Oct 28, 2024, 11:19:33 AM10/28/24
to TopBraid Suite Users
a bit simpler, but still no inference:

# baseURI: http://w3id.org/nt

@prefix : <http://w3id.org/nt#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix spin: <http://spinrdf.org/spin#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

<http://w3id.org/nt>
  a owl:Ontology ;
  spin:imports <http://topbraid.org/spin/owlrl-all> ;
  spin:imports <http://topbraid.org/spin/rdfsplus> ;
  owl:versionInfo "Created with TopBraid Composer" ;
.
:Girl
  a owl:Class ;
  rdfs:subClassOf :Person ;
  owl:equivalentClass [
      a owl:Class ;
      owl:intersectionOf (
          [
            a owl:Restriction ;
            owl:onProperty :age ;
            owl:someValuesFrom [

                a rdfs:Datatype ;
                owl:onDatatype xsd:integer ;
                owl:withRestrictions (
                    [
                      xsd:maxExclusive 21 ;
                    ]
                  ) ;
              ] ;
Op maandag 28 oktober 2024 om 14:40:29 UTC+1 schreef Michel Böhms:

David Price

unread,
Oct 28, 2024, 11:47:44 AM10/28/24
to 'Felix Sasaki' via TopBraid Suite Users
I guess I wonder why you are asking this here rather than asking OWL experts somewhere?

My guess is the use of maxInclusive, but I do not know for sure. May even depend on which DL reasoner you are using.

Cheers,
David
--
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 visit https://groups.google.com/d/msgid/topbraid-users/887434fd-7124-49d4-b07d-0eac4f31c39dn%40googlegroups.com.

Bohms, H.M. (Michel)

unread,
Oct 28, 2024, 11:55:21 AM10/28/24
to topbrai...@googlegroups.com

Dear David

 

Could be modelling issue, could be tooling issue.

Maybe I forgot a setting or maybe TBC would not infer at all.

(like using ranges in equivalent classes are not supported?)

 

I am using the standard workspace settings:

And set:

I hoped OWL 2 RL would do the inferencing for me? Wasn’t sure about RDFS Plus so I ticjked too..

 

Thx for any clues, Michel

 

 

 

Dr.ir. H.M. Böhms (Michel)
Strategic advisor digitalisation
Mobility & Built Environment

Web:     LinkedIn
Mobile: +31630381220
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.

 

-- 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,
Oct 28, 2024, 11:58:11 AM10/28/24
to 'Luis Enrique Ramos García' via TopBraid Suite Users
I doubt that OWL RL does support this type of inferencing.

And yes, this is very old technology that we no longer really support. There are many alternative ways of expressing such rules, including SHACL.

Holger


On 28 Oct 2024, at 4:55 PM, 'Bohms, H.M. (Michel)' via TopBraid Suite Users <topbrai...@googlegroups.com> wrote:

Dear David
 
Could be modelling issue, could be tooling issue.
Maybe I forgot a setting or maybe TBC would not infer at all.
(like using ranges in equivalent classes are not supported?)
 
I am using the standard workspace settings:
<image002.png>
And set:
<image003.png>
I hoped OWL 2 RL would do the inferencing for me? Wasn’t sure about RDFS Plus so I ticjked too..
 
Thx for any clues, Michel
 
 
 
Dr.ir. H.M. Böhms (Michel)
Strategic advisor digitalisation
Mobility & Built Environment
Web:     LinkedIn
Mobile: +31630381220
E-mail:  
michel...@tno.nl

Bohms, H.M. (Michel)

unread,
Oct 28, 2024, 12:01:10 PM10/28/24
to topbrai...@googlegroups.com

I know, but some people are still using owl….

 

But ok, will rewrite example in shacl….

 

thx

 

 

Dr.ir. H.M. Böhms (Michel)
Strategic advisor digitalisation
Mobility & Built Environment

Web:     LinkedIn
Mobile: +31630381220
E-mail: 
michel...@tno.nl

Location

 

 

David Price

unread,
Oct 28, 2024, 12:02:00 PM10/28/24
to 'Felix Sasaki' via TopBraid Suite Users
Hi,

Maybe that specific inference is outside of that RL profile ( i.e. maybe maxInclusive is not covered in RL)? 

I cannot remember, so probably better to ask on an OWL forum somewhere.

Cheers,
David
On 28 Oct 2024, at 15:55, 'Bohms, H.M. (Michel)' via TopBraid Suite Users <topbrai...@googlegroups.com> wrote:

Dear David
 
Could be modelling issue, could be tooling issue.
Maybe I forgot a setting or maybe TBC would not infer at all.
(like using ranges in equivalent classes are not supported?)
 
I am using the standard workspace settings:
image002.png
And set:
image003.png
I hoped OWL 2 RL would do the inferencing for me? Wasn’t sure about RDFS Plus so I ticjked too..
 
Thx for any clues, Michel
 
 
 
Dr.ir. H.M. Böhms (Michel)
Strategic advisor digitalisation
Mobility & Built Environment
Web:     LinkedIn
Mobile: +31630381220
E-mail:  
michel...@tno.nl
 
image001.png

Michel Böhms

unread,
Oct 28, 2024, 12:50:50 PM10/28/24
to topbrai...@googlegroups.com
ok.....so what shacl rule to add to below to actually infer the triple ":Person_1 rdf:type :Girl" ?
(the info is now only used to CWA-validate, but I'dd like to do some automatic classification too...).


@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

<http://w3id.org/nt>
  a owl:Ontology ;
  owl:imports <http://www.w3.org/ns/shacl> ;
.
:Girl
  a rdfs:Class ;
  a sh:NodeShape ;
  rdfs:subClassOf :Person ;
  sh:property [
      sh:path :age ;
      sh:datatype xsd:integer ;
      sh:maxExclusive 21 ;
    ] ;
  sh:property [
      sh:path :gender ;
      sh:hasValue "Female" ;
    ] ;
.
:Person
  a rdfs:Class ;
  a sh:NodeShape ;
  sh:Property [
      sh:path :age ;
      sh:datatype xsd:integer ;
    ] ;
  sh:Property [
      sh:path :firstName ;
      sh:datatype xsd:string ;
    ] ;
  sh:Property [
      sh:path :gender ;
      sh:datatype xsd:string ;
      sh:in (
          "Male"
          "Female"
        ) ;
    ] ;
.
:Person_1
  a :Person ;
  :age "18^^xsd:integer" ;

  :firstname "Mabel" ;
  :gender "Female" ;
.
:age
  a rdf:Property ;
.
:firstname
  a rdf:Property ;
.
:gender
  a rdf:property ;
.

Op ma 28 okt 2024 om 17:02 schreef David Price <dpr...@topquadrant.com>:
You received this message because you are subscribed to a topic in the Google Groups "TopBraid Suite Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/topbraid-users/NJuFQVALFow/unsubscribe.
To unsubscribe from this group and all its topics, send an email to topbraid-user...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/topbraid-users/377F3A4A-BCDA-4C7E-9942-39FDFA514FD7%40topquadrant.com.

David Price

unread,
Oct 28, 2024, 1:19:44 PM10/28/24
to 'Felix Sasaki' via TopBraid Suite Users
Hi,

Simplest thing is probably to write a SPARQL query that constructs the rdf:type statement you want and then turn that into a SHACL rule.

Cheers,
David

Michel Böhms

unread,
Oct 28, 2024, 2:25:42 PM10/28/24
to topbrai...@googlegroups.com
Hi David, Holger

Thx, works as expected now with (both checking and inferencing):

:Person
  a rdfs:Class ;
.
:PersonShape
  a sh:NodeShape ;
  sh:targetClass :Person ;

  sh:Property [
      sh:path :age ;
      sh:datatype xsd:integer ;
    ] ;
  sh:Property [
      sh:path :firstName ;
      sh:datatype xsd:string ;
    ] ;
  sh:Property [
      sh:path :gender ;
      sh:datatype xsd:string ;
      sh:in (
          "Male"
          "Female"
        ) ;
    ] ;
  sh:rule [
    a sh:TripleRule ;
    sh:condition :GirlShape ;
    sh:subject sh:this ;
    sh:predicate rdf:type ;
    sh:object :Girl ;
  ] ;

.
:Girl
  a rdfs:Class ;
  rdfs:subClassOf :Person ;
.
:GirlShape
  a sh:NodeShape ;
  sh:targetClass :Girl ;

  sh:property [
      sh:path :age ;
      sh:datatype xsd:integer ;
      sh:maxExclusive 21 ;
    ] ;
  sh:property [
      sh:path :gender ;
      sh:datatype xsd:string ;
      sh:hasValue "Female" ;
    ] ;
  sh:property [

      sh:path :firstName ;
      sh:datatype xsd:string ;
    ] ;
.
:Person_1
  a :Person ;
  :age 18 ;
  :firstName "Mabel" ;

  :gender "Female" ;
.
:age
  a rdf:Property ;
.
:firstName

  a rdf:Property ;
.
:gender
  a rdf:Property ;
.


Op ma 28 okt 2024 om 18:19 schreef David Price <dpr...@topquadrant.com>:
Reply all
Reply to author
Forward
0 new messages