I'm pretty sure any time someone uses a bomb it should be considered terrorism until it can definitely be ruled out (assassination, personal grudge, insurance scam, whatever). De Blasio seemed much less certain on this point, and while I will concede defining terrorism is a messy and convoluted affair, it seems safe to say that putting a bomb on a crowded street is a classic tactic of terrorism.
I don't think the stabbing is linked, except in that vague, empheral way that all Muslims everywhere are linked (which is why we have to burn down mosques in revenge for suicide bombings). The guy did definitely scream something about Allah before he was shot, and the police are treating the investigation as terrorism linked. Stabbing attacks were also, of course, promoted by ISIS a couple of years back. But bombings and stabbing are a very different kind of tactic. At the very least, the bomber was looking not to be injured themselves, and may have even been undertaking trial runs, while the knife attacker had to know they were going to die.
However the safe bet in both cases is "self-radicalised lone wolf". The bomb technique was in one of those ISIS jihadi training manuals they put on the web, and likely the other idiot had been watching propaganda on liveleak or whatever.