PREFIX : PREFIX foaf: DELETE { ?a foaf:knows ?Var_B . } INSERT { ?a foaf:knows ?a . } WHERE { { ?a foaf:name "Alan" . } { ?a foaf:knows ?Var_B . } }