my first shacl try

54 views
Skip to first unread message

Bohms, H.M. (Michel)

unread,
Aug 29, 2017, 10:45:55 AM8/29/17
to topbrai...@googlegroups.com

Hi Irene,

 

When converting the owl restrictions to SHACL within tbc, the 2 restrictions from:

 

:BigSpace

  rdf:type owl:Class ;

  rdfs:subClassOf :Space ;

  rdfs:subClassOf [

      rdf:type owl:Restriction ;

      owl:allValuesFrom :BigPump ;

      owl:onProperty :hasPump ;

    ] ;

  owl:disjointWith :SmallSpace ;

  owl:equivalentClass [

      rdf:type owl:Restriction ;

      owl:allValuesFrom [

          rdf:type rdfs:Datatype ;

          owl:onDatatype xsd:float ;

          owl:withRestrictions (

              [

                xsd:minExclusive "150.0"^^xsd:float ;

              ]

            ) ;

        ] ;

      owl:onProperty :area ;

    ] ;

.

 

 

Seem not converted.

 

Was this to be expected?

 

What IS generated, I do not understand:

 

[

  rdf:type rdfs:Datatype ;

  owl:onDatatype :area ;

].

[

  rdf:type rdfs:Datatype ;

  owl:onDatatype :area ;

].

[

  sh:class :BigPump ;

].

[

  sh:class :SmallPump ;

].

 

 

Thx Michel

 

 

 

 

Dr. ir. H.M. (Michel) Böhms
Senior Data Scientist

+31888663107
+31630381220
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.

 

 

 

 

Irene Polikoff

unread,
Aug 29, 2017, 1:15:26 PM8/29/17
to topbrai...@googlegroups.com
Michel,

I have not tried the OWL to SHACL converter in 5.3, only in the 5.4 which is not yet generally available. 

The converter is “work in progress” and I know that it was extended for 5.4. However, it will not convert all possible combinations of OWL axioms. Only the most common ones. To decide what constitute a common pattern, we looked at several well known ontologies such as FIBO and picked patterns that cover 80-90% of the modeling axioms.

Based on my 5.4 experience:

  rdfs:subClassOf [
      rdf:type owl:Restriction ;
      owl:allValuesFrom :BigPump ;
      owl:onProperty :hasPump ;
    ] ;

Should be converted

You should see something like

:BigSpace
sh:property [
sh:path :hasPump ;
sh:class :BigPump ;
]

  owl:equivalentClass [
      rdf:type owl:Restriction ;
      owl:allValuesFrom [
          rdf:type rdfs:Datatype ;
          owl:onDatatype xsd:float ;
          owl:withRestrictions (
              [
                xsd:minExclusive "150.0"^^xsd:float ;
              ]
            ) ;
        ] ;
      owl:onProperty :area ;
    ] ;

Will not be converted. It is not one of the patterns we currently support in the conversion.


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.
For more options, visit https://groups.google.com/d/optout.

Holger Knublauch

unread,
Aug 29, 2017, 6:43:07 PM8/29/17
to topbrai...@googlegroups.com
Yes, this is because owl:equivalentClass axioms really do carry different meaning, and we don't want to pretend that they can be converted automatically. Some manual post-processing will be needed in these cases, e.g. converting them to SHACL-AF rules.

Holger

Bohms, H.M. (Michel)

unread,
Aug 30, 2017, 2:56:54 AM8/30/17
to topbrai...@googlegroups.com

Ok, clear

 

I note that it doesnt help here when the better subClassOf iso equivalentClass is used.

 

Wrt to the simple restriction: it does not seem to convert either in 5.3.2. So I’ll wait for the release of 5.4 for that.

 

Below you see the result after conversion (this time without deleting the original owl/rdfs restrictions):

 

:BigSpace

  rdf:type owl:Class ;

  rdf:type sh:NodeShape ;

  rdfs:subClassOf :Space ;

  rdfs:subClassOf [

      rdf:type owl:Restriction ;

      owl:allValuesFrom :BigPump ;

      owl:onProperty :hasPump ;

    ] ;

  owl:disjointWith :SmallSpace ;

  owl:equivalentClass [

      rdf:type owl:Restriction ;

      owl:allValuesFrom [

          rdf:type rdfs:Datatype ;

          owl:onDatatype xsd:float ;

          owl:withRestrictions (

              [

                xsd:minExclusive "150.0"^^xsd:float ;

              ]

            ) ;

        ] ;

      owl:onProperty :area ;

    ] ;

.

As you can see only

  rdf:type sh:NodeShape ;

has been added.

 

Greetings Michel

 

 

 

Dr. ir. H.M. (Michel) Böhms
Senior Data Scientist

+31888663107
+31630381220
michel...@tno.nl

Location

 

Irene Polikoff

unread,
Aug 30, 2017, 9:45:54 AM8/30/17
to topbrai...@googlegroups.com
I wonder if we could just send you the files with updated conversion rules from 5.4, so you could test it. Holger, what do you think?

Holger Knublauch

unread,
Aug 30, 2017, 5:58:43 PM8/30/17
to topbrai...@googlegroups.com
There have been some other changes to the converter, in Java code. We could revert the process however - if someone wants to send me their OWL files (off or on list), I could use them to test the converter and send the outcome back.

Holger

Bohms, H.M. (Michel)

unread,
Aug 31, 2017, 3:50:40 AM8/31/17
to topbrai...@googlegroups.com

Hi Holger,

Hereby my small example (having the 2 restrictions where only would was expected to be converted) FYI.

Greetings, Michel

 

 

 

 

 

Dr. ir. H.M. (Michel) Böhms
Senior Data Scientist

+31888663107
+31630381220
michel...@tno.nl

Location

 

priva-owl.ttl

Holger Knublauch

unread,
Aug 31, 2017, 4:04:48 AM8/31/17
to topbrai...@googlegroups.com
Attached the output of the current SHACL converter. Note we don't support the xsd:minExclusive yet, although we could certainly turn them into sh:minExclusive. How commonly used is that?

In case anyone is interested, I have also attached the converter file itself (written in SHACL rules). It likely requires the upcoming 5.4 release of TopBraid to run (or the open source API).

Holger
priva-owl.shapes.ttl
owl2shacl.ttl

Bohms, H.M. (Michel)

unread,
Aug 31, 2017, 7:17:14 AM8/31/17
to topbrai...@googlegroups.com

Thx

Is there some special benefit for the dash-individuals over anonymous (that you might do the manual way).
or is this just convertor-technical?

--

Holger Knublauch

unread,
Aug 31, 2017, 7:42:39 AM8/31/17
to topbrai...@googlegroups.com


On 31/08/2017 21:17, Bohms, H.M. (Michel) wrote:

Thx

Is there some special benefit for the dash-individuals over anonymous (that you might do the manual way).
or is this just convertor-technical?


I assume you are referring to the property shapes. Technically they may either be URIs or blank nodes. We typically use URIs because this allows users to reference them, in particular from other files. This is useful to attach additional triples into existing property shapes, e.g. sh:deactivated=true. Using URIs thus improves reusability of your models by applications that want to deactivate parts of your constraints.

Holger
Reply all
Reply to author
Forward
0 new messages