{"id":16718679,"url":"https://github.com/planeshifter/node-concept-net","last_synced_at":"2025-03-21T21:30:35.051Z","repository":{"id":18315361,"uuid":"21494221","full_name":"Planeshifter/node-concept-net","owner":"Planeshifter","description":"node.js interface to the ConceptNet semantic network API [DEPRECATED; ConceptNet API has changed]","archived":false,"fork":false,"pushed_at":"2017-10-05T18:02:36.000Z","size":121,"stargazers_count":30,"open_issues_count":1,"forks_count":3,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-18T05:11:44.859Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Planeshifter.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-07-04T10:43:55.000Z","updated_at":"2024-11-07T00:29:41.000Z","dependencies_parsed_at":"2022-09-16T04:11:18.753Z","dependency_job_id":null,"html_url":"https://github.com/Planeshifter/node-concept-net","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Planeshifter%2Fnode-concept-net","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Planeshifter%2Fnode-concept-net/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Planeshifter%2Fnode-concept-net/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Planeshifter%2Fnode-concept-net/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Planeshifter","download_url":"https://codeload.github.com/Planeshifter/node-concept-net/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244874093,"owners_count":20524572,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-12T21:38:05.256Z","updated_at":"2025-03-21T21:30:34.317Z","avatar_url":"https://github.com/Planeshifter.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![NPM version][npm-image]][npm-url]\n[![Build Status][travis-image]][travis-url]\n[![Coverage Status][coveralls-image]][coveralls-url]\n[![Dependencies][dependencies-image]][dependencies-url]\n\nConceptNet\n===============\n\nnode.js interface to the ConceptNet semantic network API. For further information, consult the website of the project:\n[http://conceptnet5.media.mit.edu/](http://conceptnet5.media.mit.edu/).\n\n\n# Introduction\n\nThe ConceptNet package can be easily installed via npm:\n\n```\nnpm install concept-net\n```\n\nTo require the module in a project, we can use the expression:\n\n```javascript\nvar ConceptNet = require( 'concept-net' );\n```\n\n# Getting Started\n\nThe module exports a single constructor which can be used to open an API connection. Simply call it an store the\nexpression result in a variable:\n\n```javascript\nvar conceptNet = ConceptNet();\n```\n\nIn case that you are running an own copy of the ConceptNet server, the constructor takes the hostname of the\nserver as an optional argument. The default option evaluates to \"conceptnet5.media.mit.edu:80\".\n\n```javascript\nConceptNet( '\u003chostname\u003e', '\u003cport\u003e', '\u003cconceptnet version number\u003e' );\n```\n\nExample:\n```javascript\nvar conceptNet = ConceptNet( '10.0.0.1', '10053', '5.3' );\n```\nNote you can modify only the version by just passing null to the first two arguments:\n\n```javascript\nvar conceptNet = ConceptNet( null, null, '5.3' );\n```\n\nWe can then use the following three methods to query the ConceptNet API:\n\n## Methods\n\n### `.lookup( uri[, params], callback )`\n\nThis method expects a valid ConceptNet URI as its first argument. See [the documentation](https://github.com/commonsense/conceptnet5/wiki/URI-hierarchy).\nParams is an (optional) object that specifies the arguments of the GET request. It can have the keys *limit*, *offset* and\n*filter*. The callback function has two parameters: The *err* parameter will return error objects in case that something goes\nwrong during the function invocation. If the query is successful, *err* is `undefined` and the *result* parameter holds the result set from the query.\n\nExample code:\n```javascript\nconceptNet.lookup( '/c/en/toast', {\n\tlimit: 10,\n\toffset: 0,\n\tfilter: 'core'\n}, function onDone( err, result ) {\n\t// insert code here\n})\n```\n\n### `.getURI( text[, language], callback )`\n\nThis method finds out what the [ConceptNet URI](https://github.com/commonsense/conceptnet5/wiki/API#uri-standardization) is for a given text, applying steps such as reducing English words to their root form. The `language` parameter can be supplied a code for the language to use. If only two arguments are supplied, `language` is set to the default value `en`.\n\nExample code:\n```javascript\nconceptNet.getURI( 'ground beef', 'en', function onDone( err, result ) {\n\t// insert code here\n})\n```\n\n### `.search( params, callback )`\n\nThe search method takes a parameter object and hands the retrieved results to the callback function.\nThe official ConceptNet API documentation provides a full overview of the possible search parameters:\n[ConceptNet API documentation](https://github.com/commonsense/conceptnet5/wiki/API#search).\n\nExample code:\n```javascript\nconceptNet.search({\n\tstart: '/c/en/donut'\n}, function onDone( err, result ) {\n\t// insert code here\n})\n```\n\n### `.association( input[, params], callback )`\n\nThe association method takes as its first input either a valid ConceptNet URI or a `/list/\u003clanguage\u003e/\u003cterm list\u003e`\npath.\n\nExample code:\n```javascript\nconceptNet.association( '/c/en/hotdog', {\n\tlimit: 10,\n\tfilter: '/c/en/donut'\n}, function onDone( err, result ){\n\t// insert code here\n})\n```\n\n## Unit Tests\n\nRun tests via the command `npm test`\n\n---\n## License\n\n[MIT license](http://opensource.org/licenses/MIT).\n\n[npm-image]: https://badge.fury.io/js/concept-net.svg\n[npm-url]: http://badge.fury.io/js/concept-net\n\n[travis-image]: https://travis-ci.org/Planeshifter/node-concept-net.svg\n[travis-url]: https://travis-ci.org/Planeshifter/node-concept-net\n\n[coveralls-image]: https://img.shields.io/coveralls/Planeshifter/node-concept-net/master.svg\n[coveralls-url]: https://coveralls.io/r/Planeshifter/node-concept-net?branch=master\n\n[dependencies-image]: http://img.shields.io/david/Planeshifter/node-concept-net.svg\n[dependencies-url]: https://david-dm.org/Planeshifter/node-concept-net\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fplaneshifter%2Fnode-concept-net","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fplaneshifter%2Fnode-concept-net","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fplaneshifter%2Fnode-concept-net/lists"}