简体   繁体   中英

What schema.org types does google knowledge graph api support?

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 (eg @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 eg 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM