如何重用OWL中的列表?

时间:2018-04-08 12:47:52

标签: owl semantic-web

假设我正在定义一个类 Alcohol

:Alcohol rdf:type owl:Class ;
         owl:equivalentClass [ 
             rdf:type owl:Class ;
             owl:oneOf ( :Vodka :Champagne :Bourbon :Tequila :Whiskey ) ] .

但我希望成员们与众不同:

[ rdf:type owl:AllDifferent ;
  owl:distinctMembers ( :Bourbon :Vodka :Champagne :Whiskey :Tequila ) ] .

如何在不重复列表的情况下编写这两个语句?

感谢。

1 个答案:

答案 0 :(得分:0)

如评论中所述,使用空白节点参考:

:Alcohol a owl:Class ;
    owl:equivalentClass [ a owl:Class ;
                          owl:oneOf _:b0 ] .

[ a owl:AllDifferent ;
  owl:distinctMembers  _:b0 ] .

_:b0 rdf:first :Vodka ;
    rdf:rest ( :Champagne :Bourbon :Tequila :Whiskey ) .