Skip to content
julianchaidez edited this page Nov 11, 2011 · 50 revisions

##ConceptNet5's Web API written by Christopher Fry and Yen-Ling Kuo ###Beginning The beginning of these url's is: http://conceptnet5.media.mit.edu. This url will show an "about" page for ConceptNet5. ###Format Following the beginning is the word "web" or "data". "web" provides a human readable page, whereas "data" provides teh information in JSON format for programs to make easier use of. The below just shows a "hello world" page.

Example : http://conceptnet5.media.mit.edu/web/ ###Nodes Conceptnet5 stores its information in "nodes". The types of node are:

  • concept
  • frame
  • relation
  • assertion
  • sense

Use one of the above words in the url to indicate which type of node you want information about. Note that the above URL does not work. It is included because it is the beginning of some useful urls.

Example : http://conceptnet5.media.mit.edu/data/concept/

Nodes are connected by "edges" in the knowledge base. An edge has a start node, an end node, a type and some other fields. Each node also has the following properties:

  • license
  • url
  • uri
  • dataset
  • normalized (true or false)
  • type (i.e the node_type of concept)

Some node types have additional properties. For example, concepts have the additional properites: language and name. Score is also a common attribute, although as of this writing not all nodes have a score. ###Language If the node type is concept or frame, it is followed by a natural language designator. Nodes of type relation are in just one language (usually English) but the point is, there's no need for a language designator. Assertions don't have an overall language designator but the individual concepts within the relation will (see below).

  • English - "en",
  • Traditional Chinese - "zh_TW",
  • Japanese - "ja".
  • Spanish - "es"
  • Hebrew - "he"

There are other language designators. These designators are taken from ISO 639-1 or ISO 639-2/3 when shorter codes are inapplicable.

Example : http://conceptnet5.media.mit.edu/data/frame/en/

Note: the above URL does not work. It is included because it is the beginning of some useful urls. ###Node Identifiers The format for the identifier for a given node depends on its node type.

###URL Attributes After the above URL's you can further refine your request by adding a question mark and one of three attributues:

  • get
  • per_page
  • max_score

If we do NOT add one of those attributes, we will effectively 'get' lots of information about the node. The 'get' call allows you to select which information about the identified node to retrieve, limiting the amount of information that comes back.

Example : http://conceptnet5.media.mit.edu/data/concept/en/book ###Get Following 'get' you may have 1 or more of the following parameters:

###Per-Page 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.

Example: http://conceptnet5.media.mit.edu/data/concept/en/dog?get=incoming_assertions&per_page=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.

Example: http://conceptnet5.media.mit.edu/data/concept/en/dog?get=incoming_edges&max_score=1000

Clone this wiki locally