rawData from Result

Hi,

I am using TypeScript in a project where I am using Answers Core to make a verticalSearch(). Nested inside each result of the verticalResults in the VerticalSearchResponse, there is a field called rawData of type Record<string, unknown>. I am making a query that returns Restraurant Entities from my Answers Experience but I will likely need to make requests for other entities in the future.

Are there certain fields in rawData that are ubiquitous across all entity types so that I can create a type called EntityRawData that can be extended to my Restaurant type and any other types I create in the future based on a Knowledge Graph entity?

Thanks.

Hi Aaron,

The only required fields for Knowledge Graph entities are name and id. However, with other backends (like Google custom search), neither of those fields are guarantees and would depend on the custom backend’s configuration.

If you’re certain of the fields on your entities, you could potentially assume other required fields, but that will depend on your Knowledge Graph.

Hope this helps!

Thanks,
Rose