-
Notifications
You must be signed in to change notification settings - Fork 358
API
##The Node Request
The current REST API allows a single basic type of request, the Node request. This type of request will return information about the node which is being queried, or about nodes related to that node in some way. This type of request is formated as follows:
http://conceptnet5.media.mit.edu/data/{uri goes here}?{properties go here}
An example of a valid url is:
http://conceptnet5.media.mit.edu/data/concept/en/watermelon?get=incoming_assertions&max_score=10000
There are currently three properties which can be utilized:
-
"get" This property can be used to indicate a specific type of desired information. There are currently eight valid get parameter values:
-
'properties' - Only the properties of the Node that is being queried (i.e its name, uri, score etc.)
-
'incoming_edges' - The incoming edges to the node that is being queried, ordered by score. This will also return a url directed to
http://conceptnet5.media.mit.edu/data/{uri}?get=incoming_edges, under the name 'incoming_edges_url'. -
'outgoing_edges' - The outgoing edges from the node that is being queried, ordered by score. This will also return a url directed to
http://conceptnet5.media.mit.edu/data/{uri}?get=outgoing_edges, under the name 'outgoing_edges_url'. -
'incoming_assertions' - The incoming assertions to the node being queried, ordered by score. This will also return a url directed to
http://conceptnet5.media.mit.edu/data/{uri}?get=incoming_nodes, under the name 'incoming_assertions_url'. -
'word_senses' - The word senses of the node being queried, unordered.
-
'word_sense_of' - The nodes that refer to the node being queried as a word sense, unordered.
-
'normalized' - The normalized nodes of the node being queried, unordered.
-
'normalized_of' - The nodes that refer to the node being queried as a normalized node, unordered.
Assigning no 'get' parameter will return a json file with every category of data for a node, with the default number of returns per request. Multiple get values (seperated by a '+') will return all of those values, categorized under their get tag, in a single json file. An example of this parameter in use is http://conceptnet5.media.mit.edu/data/concept/en/dog?**get=properties+normalized_of** .
-
-
"rpp" - The number of results returned per page (results per page). This value will apply to all categories (if you request multiple categories in your 'get' parameter). This can be used if less than 50 results are wanted, and it will reduce response time. This value is an integer, and is limited to between 0 and 100. The default value is 50. An example of this parameter in use is http://conceptnet5.media.mit.edu/data/concept/en/dog?get=incoming_assertions&**rpp=10** .
-
"max_score" - The maximum score of any node that should be returned by a given query. Most queries are sorted in descending order by score. This value is a float, and is limited between 0 and None (meaning no upper bound). The default value is None. The value of max_score will be ignored when more than 1 category of information is being returned. An example of this parameter in use is http://conceptnet5.media.mit.edu/data/concept/en/dog?get=incoming_edges&**max_score=1000** .
Starting points
Reproducibility
Details