What about making the function parameters a named object?
So instead of:
conn.query("db-name",
"select distinct * where { ?s ?p ?o } limit 5",
null, 5, 0, function (data) {});
you get:
conn.query('db-name', {query: 'select distinct * where { ?s ?p ?o} limit 5',
baseURI: null,
limit: 5,
offset: 0}, function cb(data){});
which is self-documenting, and collapses to:
conn.query('db-name', {query: 'select distinct * where { ?s ?p ?o} limit 5',
limit: 5}, function cb(data){});
since baseURI and offset are not required, they don't need to be set.
Code samples can look like this:
var query = {},
query.query = "select distinct * where { ?s ?p ?o} limit 5",
query.limit = 5;
conn.query("db-name", query, function cb(data) {});
What about making the function parameters a named object?
So instead of:
you get:
which is self-documenting, and collapses to:
since baseURI and offset are not required, they don't need to be set.
Code samples can look like this: