I am trying to run a query on the Google Knowledge Graph API to find the Python programming language and am having trouble specifying a type of ComputerLanguage or programmingLanguage. These are both valid schema.org types, but I receive a 400 error:
{
"error": {
"code": 400,
"message": "Request contains an invalid argument.",
"status": "INVALID_ARGUMENT"
}
}
I can't find any list of the types that Google Knowledge Graph API accepts. Am I specifying the type wrong, and is there a list of valid types somewhere?
Thanks!
The type
@ComputerLanguagedoes not seem to be a@Typeregistered with GKG.Alternatively
@SoftwareApplicationis a registered@Typeso this query works:https://kgsearch.googleapis.com/v1/entities:search?query=Python&types=SoftwareApplication&key=where you BYO key.The search string does not appear to be case sensitive so either python or Python produces the same result.
Have tried alternative computer languages, such as JavaScript and C, and results are positive.
Tried a broader term (e.g.
@Intangible) but GKG does not appear to generate results for broad-terms, only leaf-node terms.Interestingly, if you do not specify
typesyou will get a comprehensive response that does NOT includeComputerLanguagee.g.https://kgsearch.googleapis.com/v1/entities:search?query=Python&key=If you use
https://kgsearch.googleapis.com/v1/entities:search?query=JavaScript&key=you get@Bookand@Eventprimarily but no@ComputerLanguageWill ping the Google API team to learn why
@ComputerLanguageis not in their search vocabulary.