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 @ComputerLanguage
does not seem to be a @Type
registered with GKG.
Alternatively @SoftwareApplication
is a registered @Type
so 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 types
you will get a comprehensive response that does NOT include ComputerLanguage
e.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 @Book
and @Event
primarily but no @ComputerLanguage
Will ping the Google API team to learn why @ComputerLanguage
is not in their search vocabulary.