planeshifter / node-concept-net Goto Github PK
View Code? Open in Web Editor NEWnode.js interface to the ConceptNet semantic network API [DEPRECATED; ConceptNet API has changed]
License: MIT License
node.js interface to the ConceptNet semantic network API [DEPRECATED; ConceptNet API has changed]
License: MIT License
Hi
I was wondering whether uri strings are supported in the search method, i.e (end=/c/en/car)?
I looked through the code in src/store.js and in line 34 of the code "path += querystring.stringify(params)" it uses querystring to stringify the params part of the method. So if the params in the path variable was "end=/c/en/car" it will be translated to "end=%2Fc%2Fen%2Fcar" which will cause nothing to be found.
What might be ways to get around this?
as detailed here
This would allow a user to input any term, get the standard uri, and call the 3 methods (lookup, search, association) using it.
I'm trying the example code, basically:
const ConceptNet = require( 'concept-net' )
// let conceptNet = ConceptNet(null, null, '5.3')
let conceptNet = ConceptNet()
async checkIdea(word) {
conceptNet.search({
start: '/c/en/donut'
}, function onDone( err, result ) {
log(err)
log(result)
})
let xpath = '/c/en/toast' // + word
conceptNet.lookup( xpath, {
limit: 10,
offset: 0,
filter: 'core'
}, function onDone( err, result ) {
log(err)
log(result)
})
}
and getting the errors below back:
undefined
{ '@context': [ 'http://api.conceptnet.io/ld/conceptnet5.6/context.ld.json' ],
error:
{ details: '\'/data/5.4/c/en/toast\' isn\'t a URL that we understand.',
status: 404 } }
undefined
{ '@context': [ 'http://api.conceptnet.io/ld/conceptnet5.6/context.ld.json' ],
error:
{ details: '\'/data/5.4/search\' isn\'t a URL that we understand.',
status: 404 } }
have the URLs changed?
is '/data/5.4
the correct prepend for URI calls?
I also tried with the version exactly as you have specified in the examples
let conceptNet = ConceptNet(null, null, '5.3')
but that doesn't seem to change the error code in the context URI conceptnet5.6
undefined
{ '@context': [ 'http://api.conceptnet.io/ld/conceptnet5.6/context.ld.json' ],
error:
{ details: '\'/data/5.3/c/en/toast\' isn\'t a URL that we understand.',
status: 404 } }
Excited to try this out, appreciate any advice.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.