YPG has strong ties to PKK, which is recognized as a terrorist organization by NATO and EU [1] [2].
I strongly dislike Erdogan and his policies, and certainly don't approve the attack but YPG is a different issue. It is sad that most outsiders' view about the Kurdish conflict boils down to 'Turkey hates Kurds'. It's just not like that. We should all unite against terrorism.