select distinct ?r ?reqProp1
where  {
  {
    { 
      ?r <http://www.semanticdesktop.org/ontologies/2007/03/22/nmo#to> ?v1 . 
      ?v1 <http://www.semanticdesktop.org/ontologies/2007/03/22/nco#hasEmailAddress> ?v2 . 
      ?v2 <http://www.semanticdesktop.org/ontologies/2007/03/22/nco#emailAddress> ?v3 . 
      FILTER(REGEX(STR(?v3), 'kdab', 'i')) . 
    } UNION {
      ?r <http://www.semanticdesktop.org/ontologies/2007/03/22/nmo#cc> ?v4 . 
      ?v4 <http://www.semanticdesktop.org/ontologies/2007/03/22/nco#hasEmailAddress> ?v5 . 
      ?v5 <http://www.semanticdesktop.org/ontologies/2007/03/22/nco#emailAddress> ?v6 .
      FILTER(REGEX(STR(?v6), 'kdab', 'i')) .
    } UNION {
      ?r <http://www.semanticdesktop.org/ontologies/2007/03/22/nmo#bcc> ?v7 .
      ?v7 <http://www.semanticdesktop.org/ontologies/2007/03/22/nco#hasEmailAddress> ?v8 .
      ?v8 <http://www.semanticdesktop.org/ontologies/2007/03/22/nco#emailAddress> ?v9 .
      FILTER(REGEX(STR(?v9), 'kdab', 'i')) . 
    } .
    ?r a ?v10 .
    ?v10 <http://www.w3.org/2000/01/rdf-schema#subClassOf> <http://www.semanticdesktop.org/ontologies/2007/03/22/nmo#Email> .
  } .
  ?r <http://akonadi-project.org/ontologies/aneo#akonadiItemId> ?reqProp1 .
}
