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?
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.