Troubleshooting Glossary Items Ingestion with DataHub GraphQL Query

Original Slack Thread

Hello All /<@U02G4B6ADL6>,

I am trying to get all the glossary items ingested in datahub,
and i am using follwing code, i get 200 but no data, can anyone please help?

import http.client

conn = http.client.HTTPConnection(“localhost:8080”)

payload = “{ "query": "{dataset(urn: \"urn:li:dataset:(urn:li:dataPlatform:hive,fct_users_created,PROD)\") {glossaryTerms {terms {term {urn glossaryTermInfo { name description } } } } } }", "variables":{}}”

headers = {
‘Authorization’: “Bearer <my-access-token>”,
‘Content-Type’: “application/json”
}

conn.request(“POST”, “/api/graphql”, payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode(“utf-8”))

Try below query:

graphQl = """
query getGlossaryTerms {
   searchAcrossEntities (input:{
    types:[GLOSSARY_TERM],
    query:"*",
    start:0
    count:1000  
  }) {
    searchResults{
      entity{
        urn
      }
    }
  }
  } 
"""```

Thanks Walt, i was able to get the result using the query above, however i am looking to get the name and description of glossary item and i am getting

“searchResults”: [
{
“entity”: {
“urn”: “urn:li:glossaryTerm:00601529b797fa6a905ca1bcd5be53dd”
}
},
{
“entity”: {
“urn”: “urn:li:glossaryTerm:00c0b6b1e4560fa7851f976630418201”
}
},
{
“entity”: {
“urn”: “urn:li:glossaryTerm:0111319484eb3fd5a3b53317712d41ea”
}
},
{
“entity”: {
“urn”: “urn:li:glossaryTerm:016b8554353b868cbc818a502a477422”
}
},
{
“entity”: {
“urn”: “urn:li:glossaryTerm:01a8c298bc2eb31fdf4089d20b449505”
}
},
{
“entity”: {
“urn”: “urn:li:glossaryTerm:01cefd5f50d1b8f387766741ad301b36”
}
},
{
“entity”: {
“urn”: “urn:li:glossaryTerm:02735c9f8d0e7deb1d1d13266059b478”
}
},
{
“entity”: {
“urn”: “urn:li:glossaryTerm:0290a420455f40144010b136754f631f”
}
},
{
“entity”: {
“urn”: “urn:li:glossaryTerm:036174d8bc7abebf13cb9a7c1a5e9f77”
}
},
{
“entity”: {
“urn”: “urn:li:glossaryTerm:0375f3d6d31331627f5ab7440800fc07”
}
}

Thanks Walt, i was able to get the result using the query above, however i am looking to get the name and description of glossary item and i am getting,

whatever i try i am getting

“searchResults”: [
{
“entity”: {
“urn”: “urn:li:glossaryTerm:00601529b797fa6a905ca1bcd5be53dd”
}
}

i modified the query to the following but i am getting error “Validation error (MissingFieldArgument@[dataset]) : Missing field argument ‘urn’”,

query getGlossaryTerms {
searchAcrossEntities(
input: {types: [GLOSSARY_TERM], query: “*”, start: 0, count: 1000}
) {
searchResults {
entity {
urn
}
}
}
dataset {
properties {
name
description
}
}
}

query getGlossaryTerms {
searchAcrossEntities (input:{
types:[GLOSSARY_TERM],
query:"*",
start:0
count:1000
}) {
searchResults{
entity{
urn
...on GlossaryTerm {
properties{
name,
description
}
}
}
}
}
}

Thanks Walt, it worked