Siegmeyer
Siegmeyer

Reputation: 4512

How to reuse a list in OWL?

Let's say I'm defining a class Alcohol:

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

But I want members to be distinct:

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

How can I write those two statements without repeating the list?

Thanks.

Upvotes: 1

Views: 87

Answers (1)

ssz
ssz

Reputation: 835

As mentioned in the comment, use blank node reference:

: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 ) .

Upvotes: 0

Related Questions