ktbs: fixed a bug in json-ld parser (and made it more robust)