3

Can we define a restriction as a named class? I mean, instead of using this:

:myclass owl:equivalentClass 
         [ rdf:type owl:Restriction ;
           owl:onProperty :hasAge ;
           owl:cardinality "2"^^xsd:nonNegativeInteger ] . 

to use this:

:myclass rdf:type owl:Restriction ;
         owl:onProperty :hasAge ;
         owl:cardinality "2"^^xsd:nonNegativeInteger.  

Is that ok?

kwstas
  • 147
  • 6
  • 1
    What happens when you try it? – Ken White Jan 20 '12 at 23:50
  • 1
    I created a restriction in Protege, I stored the file in turtle format, I manually edited it as on the example above and when I re-opened the file with Protege, there was a "myclass" named class with the restriction in the "Annotation" window. – kwstas Jan 21 '12 at 18:39

2 Answers2

4

Yes, that's absolutely fine. It's a bit unusual perhaps, but AFAIK there is nothing in the OWL specs that forces restrictions to be anonymous. In fact, naming them like you suggest makes reuse of restrictions in multiple classes a lot easier.

Jeen Broekstra
  • 21,642
  • 4
  • 51
  • 73
  • Yes that's exactly my point. I mean, when you decide to define a new class based on a restriction, wouldn't it be the norm to create a named restriction? Otherwise you will have to create at least one more statement (`equivalentClass` or `subClassOf`). So, the fact that I couldn't find any example with a named restriction, seemed strange to me. – kwstas Jan 21 '12 at 18:48
0

Yes, you can give names to restrictions, just declare that a named class is equivalent to the restriction. There are plenty of examples in the OWL documentation, see e.g.

where you find examples like

EquivalentClasses(
    :HappyPerson 
    ObjectAllValuesFrom( :hasChild :HappyPerson )
)

EquivalentClasses(
    :NarcisticPerson 
    ObjectHasSelf( :loves ) 
)

EquivalentClasses(
    a:DogOwner
    ObjectSomeValuesFrom( a:hasPet a:Dog )
)
Kaarel
  • 10,554
  • 4
  • 56
  • 78
  • The examples you wrote is like the first example of mine. What I wanted to know is if my second example is valid ;) – kwstas Feb 03 '12 at 13:39
  • Sorry, I don't know, I don't know much about RDF... But why is your first example not good for you? Maybe you could elaborate on that in your question... – Kaarel Feb 04 '12 at 19:33
  • It's just plain curiosity:-) I know that you can use the "equivalent" construct. I just wanted to know if the second example is legal too – kwstas Feb 05 '12 at 21:25