When setting data, Minecraft can "fix" things like leaving out the minecraft: part of item IDs. When testing for data, this will not happen. Therefore, replace id:tripwire_hook with id:"minecraft:tripwire_hook".