3

I have created an ontology in protege. I am using the Pellet reasoner (it is enabled) and the snap sparql plugin.

I am trying to declare a small enterprise as an enterprise that has at most 20 employees.

Here are my triples. I am not able to see the inference that cs:SmithBrothers is a cs:SmallEnterprise (by the way of SPARQL query). Can someone please help me? I have been at this literally all day.

# employs 
cs:employs a owl:ObjectProperty ;
    rdfs:range cs:employee ;
    rdfs:domain cs:enterprise .


# is-employed-by (the inverse of employs)
cs:isEmployedBy a owl:ObjectProperty ;
    owl:inverseOf cs:employs .

# j. A small enterprise is an enterprise which employs at most 20 employees.
cs:smallEnterprise  a owl:class ;  
owl:equivalentClass [ 
    owl:intersectionOf (

    [ a owl:Restriction ;
    owl:onProperty cs:employs ;
    owl:maxCardinality 20 ]
    cs:enterprise 

)] .

# x. SmithBrothers is a family-based enterprise.
cs:SmithBrothers a cs:enterprise .

# y. Frank, Lea, Dave, Kate, Dino are employed by SmithBrothers.
cs:Frank cs:isEmployedBy cs:SmithBrothers .

cs:Lea cs:isEmployedBy cs:SmithBrothers .

cs:Dave cs:isEmployedBy cs:SmithBrothers .

cs:Kate cs:isEmployedBy cs:SmithBrothers .

cs:Dino cs:isEmployedBy cs:SmithBrothers .
#########################################

Thanks in advance.

  • 1
    Please read about *Open World Assumption* which holds in OWL. – UninformedUser Dec 13 '19 at 05:34
  • @AKSW Thanks - I did. I am not quite sure how this applies to my original question – Mason Baran Dec 13 '19 at 16:17
  • What I think *think* I am asking for is... the intersection of all enterprises and all classes that employ at most 20 people. – Mason Baran Dec 13 '19 at 16:44
  • 1
    well, *Open World Assumption* means everything not in the ontology is just unknown but not necessarily false or the negation. Which means absence of information can be treated as not existing anywhere in the world. For your example, there can still be more employees somewhere out in the world, just not in your ontology. So a reasoner cannot or to be more precise *must not* infer your intended conclusion. It can't say this inference is true because it doesn't know everything in the world. – UninformedUser Dec 13 '19 at 16:52
  • @AKSW Interesting. Thank you for sharing that with me. So how would one make this distinction? I am working from the book *Semantic Web for the Working Ontologist* and it makes no mention of this issue. – Mason Baran Dec 13 '19 at 17:13
  • @AKSW SO i have just changed employs and isEmployedBy to be Functional properties and I seem to have the inferred triple that SmithBrothers is a smal enterprise now. Did I stumble upon a dumb workaround or am I approaching the right declaration? Thanks so much for your time in posting here. – Mason Baran Dec 13 '19 at 17:24
  • 1
    making `employs` function means the the reasoner will infer that all employees will be the same real world individual. So it infers `cs:Lea owl:sameAs cs:Dave` etc. for pairs of employees. That can't be what you want ... and sure, now the reasoner knows that there is exactly 1 employee only which indeed is < max 20 – UninformedUser Dec 13 '19 at 17:35
  • Right, I have just discovered this. This is not what I want. – Mason Baran Dec 13 '19 at 17:37
  • You should "close the world". You could say that there are no `cs:employee`s besides these 5. If there are actually more than 20 `cs:employee`s, you shoud additionaly say that each of them is not `cs:isEmployedBy` `cs:SmithBrothers`. That approach is cumbersome and not very scalable. – Stanislav Kralin Dec 13 '19 at 17:45
  • However, if you can use SPARQL. you could define the `cs:LargeEnterprise` class and select enterprises that are not large. Do not forget to declare all employees to be different individuals (please read about Unique Name Assumption which does not hold in OWL). That approach seems to be less cumbersome. But I'm not sure, whether Snap SPARQL Plugin supports `NOT EXISTS` or not. – Stanislav Kralin Dec 13 '19 at 17:49
  • @StanislavKranlin thank you. I see. Given those options, what would the most elegant technique be? To create a `cs:largeEnterprise` and specificy a `owl:minCardinality`? Is this not a common thing done in OWL? It seems a bit strange to implement.. – Mason Baran Dec 13 '19 at 17:59
  • @StanislavKranlin Or could I perhaps create a new property of `cs:totalEmployees` with a `rdfs:range` of `int`? I don't tihnk that would work with `cardinality` though since it expects instances of a `property` – Mason Baran Dec 13 '19 at 18:03
  • Well, I'd say that this problem is typical for "enterprise" applications of OWL, where world is ckosed and names are unique. You could try Stardog's version of Pellet: https://github.com/stardog-union/pellet/wiki/FAQ#does-pellet-support-closed-world-reasoning. If you can recalculate `cs:totalEmployees` on every change, then you can use OWL datatype restriction. – Stanislav Kralin Dec 13 '19 at 18:19

0 Answers0