GoogleKnowledgeGraph & KG ID


I tried adding this to the <Parse> section of the GoogleKnowledgeGraph.xml connector, but it failed because it didn’t recognize the path I used:

<JsonPath Expr="result.@id" Id="id" Title="Knowledge Graph ID" Converter="String" DefaultValue="" HelpText="The KG:id"/>

When I deleted the @ from the path, a query no longer failed, but the ID field was blank.

The JSON path, when I tested it, was $..result.@id — I’m not sure what I’m doing wrong.

(I’d like to pull in the KG ID because with it I can create a link to the actual Knowledge Graph displayed on Google, like so:

Taylor Swift - Google Knowledge Graph ➚

Here’s a sample JSON result, provided by Google:

  "@context": {
    "@vocab": "",
    "goog": "",
    "resultScore": "goog:resultScore",
    "detailedDescription": "goog:detailedDescription",
    "EntitySearchResult": "goog:EntitySearchResult",
    "kg": ""
  "@type": "ItemList",
  "itemListElement": [
      "@type": "EntitySearchResult",
      "result": {
        "@id": "kg:/m/0dl567",
        "name": "Taylor Swift",
        "@type": [
        "description": "Singer-songwriter",
        "image": {
          "contentUrl": "",
          "url": "",
          "license": ""
        "detailedDescription": {
          "articleBody": "Taylor Alison Swift is an American singer-songwriter and actress. Raised in Wyomissing, Pennsylvania, she moved to Nashville, Tennessee, at the age of 14 to pursue a career in country music. ",
          "url": "",
          "license": ""
        "url": ""
      "resultScore": 4850

@ needs to be escaped by double @ sign:

I have updated the connector with the id field:

1 Like

Ah, ha!

Excellent, thank you very much, and thanks for the escape tip!