简体   繁体   中英

Cardinality DL queries in OWL in Protégé

I'm trying to do a query with a cardinality restriction. The query looks like

ClassA and (roleA min 2 ClassB)

but this returns an empty set. On the other hand when I do the query

ClassA and (roleA some ClassB)

it returns some individuals of ClassA. Why does the cardinality query not work when I know there are definitely a least two roleAs on some ClassA individuals?

To be more specific, I have the classes Team , Player and Position , and object properties employs (which relates Teams and Players ), and hasPosition (which relates Players and Positions ). I'm trying to do the query

Team and employs min 2 (Player and hasPosition some { Striker**}**)

which should return the teams with two or more Strikers but obviously because OWL doesn't make the unique name assumption it returns an empty set. I have tried to declare that some of my individuals are distinct, but when I execute the query with the distinct individuals in place it causes Protégé to crash. Protégé does not crash when running the query without the distinct individuals.

Edit:

Error Message from Pellet in Protege 错误信息Striker shown in Ontology XML以本体 XML 显示的前锋

There's not enough information in this question yet to determine why you're not getting the results that you're looking for, but we can reproduce the scenario well enough to show that this achievable. Consider an ontology with three classes and some individuals:

  • Player {p1, p2}
  • Team {team1}
  • Position {Striker}

and the axioms

  • p1 ≠ p2
  • team1 employs p1
  • team1 employs p2
  • p1 hasPosition Striker
  • p2 hasPosition Striker

Then the query

  • Team and employs min 2 (Player and hasPosition value Striker)

returns the individual team1. (This works with “hasPosition some {Striker}”, too, but for just one value, I think that the value keyword is a better fit.)

结果在 Protege

Here's the ontology:

@prefix :      <http://stackoverflow.com/q/22688901/1281433/competitions#> .
@prefix rdfs:  <http://www.w3.org/2000/01/rdf-schema#> .
@prefix owl:   <http://www.w3.org/2002/07/owl#> .
@prefix xsd:   <http://www.w3.org/2001/XMLSchema#> .
@prefix rdf:   <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .

<http://stackoverflow.com/q/22688901/1281433/competitions>
        a       owl:Ontology .

:Player  a      owl:Class .
:Position  a    owl:Class .
:Team   a       owl:Class .

:hasPosition  a  owl:ObjectProperty .

:Striker  a     owl:NamedIndividual , :Position .

:p1     a             owl:NamedIndividual , :Player ;
        :hasPosition  :Striker .

:p2     a             owl:NamedIndividual , :Player ;
        :hasPosition  :Striker .

[ a                    owl:AllDifferent ;
  owl:distinctMembers  ( :p1 :p2 )
] .

:team1  a         owl:NamedIndividual , :Team ;
        :employs  :p1 , :p2 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM