German police have detained a person and are investigating whether there is a connection between them and a knife attack in the western German city of Solingen late on Friday that killed three and injured others earlier, they said on Saturday.