You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is adapted from bad json-ld found in the wild (but on an important enterprise website) where Google is able to make sense in the SDTT, but our parser is making an unfortunate mistake ...
The source json block is lacking @id, and in these cases I add one set to the url of the page before parsing; the json-ld is parsed by json.loads(), I add js['@id'] = response.url + tag and then json.dumps() into js_text -- what follows is the rdflib transform:
notice that the source json-ld has no context property, and has it's own id property that is just a unique string, so it is already a gamble what rdflib might do with it ;) What happens, though, is the @id property is dropped, and the id property is mistakenly taken as the @id, and lacking the protocol and host, is assumed to be a file://... item:
This is adapted from bad json-ld found in the wild (but on an important enterprise website) where Google is able to make sense in the SDTT, but our parser is making an unfortunate mistake ...
The source json block is lacking
@id
, and in these cases I add one set to the url of the page before parsing; the json-ld is parsed by json.loads(), I addjs['@id'] = response.url + tag
and then json.dumps() into js_text -- what follows is the rdflib transform:notice that the source json-ld has no
context
property, and has it's ownid
property that is just a unique string, so it is already a gamble what rdflib might do with it ;) What happens, though, is the@id
property is dropped, and theid
property is mistakenly taken as the@id
, and lacking the protocol and host, is assumed to be afile://...
item:So the source json is incorrect as far as schema.org or json-ld goes, however the Google SDTT extracts semi-correctly:
but my question is why was
@id
ignored andid
taken as the base node? Is this expected?The text was updated successfully, but these errors were encountered: