@prefix owl: <http://www.w3.org/2002/07/owl#>.
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>.
@prefix : <foo:bla#>.
:Person owl:hasKey (:name) .
:name a owl:DatatypeProperty .
# :name a owl:InverseFunctionalProperty .  ## that would do it instead of hasKey
:father a owl:FunctionalProperty, owl:IrreflexiveProperty; rdfs:range :Person.
:bob a :Person; :father :john .
:john :name "John" .
:Adam owl:equivalentClass [ a owl:Restriction; owl:onProperty :name; owl:hasValue "Adam"] .
:Person rdfs:subClassOf
  [ a owl:Restriction; owl:onProperty :father; owl:someValuesFrom :Adam].
:JohnAdam owl:equivalentClass [ owl:intersectionOf ( :Adam
     [ a owl:Restriction; owl:onProperty :name; owl:hasValue "John"] ) ].
:hasFatherJohnAdam owl:equivalentClass [ a owl:Restriction;
     owl:onProperty :father; owl:someValuesFrom :JohnAdam ] .
:hasGrandpaAdam owl:equivalentClass [ a owl:Restriction; owl:onProperty :father;
    owl:someValuesFrom [ a owl:Restriction; owl:onProperty :father;
       owl:someValuesFrom :Adam ] ].
:AdamFatherAdam owl:equivalentClass [ owl:intersectionOf (:Adam
     [ a owl:Restriction; owl:onProperty :father;  owl:someValuesFrom :Adam] ) ] .
