diff --git a/lib/query/woqlBuilder.js b/lib/query/woqlBuilder.js index 066cfa1..e1ec55a 100644 --- a/lib/query/woqlBuilder.js +++ b/lib/query/woqlBuilder.js @@ -171,13 +171,11 @@ WOQLQuery.prototype.nuke = function (graphRef) { }; /** - * * @param {string|Var} node - The IRI of a node or a variable containing an IRI which will * be the subject of the builder functions * @param {typedef.FuntionType} [type] - Optional type of builder function to build * (default is triple) * @returns {WOQLQuery} - A WOQLQuery which contains the partial Node pattern matching expression - * @example */ WOQLQuery.prototype.node = function (node, type) { diff --git a/lib/query/woqlDoc.js b/lib/query/woqlDoc.js index 6168441..4dfcd35 100644 --- a/lib/query/woqlDoc.js +++ b/lib/query/woqlDoc.js @@ -93,7 +93,7 @@ function convert(obj) { /** * @param {string} name The variable name - * @returns + * @returns {Var} */ function Var(name) { this.name = name; @@ -108,7 +108,7 @@ function Var(name) { let uniqueVarCounter = 0; /** * @param {string} name The variable name - * @returns + * @returns {VarUnique} */ function VarUnique(name) { uniqueVarCounter += 1; diff --git a/lib/query/woqlQuery.js b/lib/query/woqlQuery.js index eb81ccb..e8e32f9 100644 --- a/lib/query/woqlQuery.js +++ b/lib/query/woqlQuery.js @@ -88,7 +88,6 @@ class WOQLQuery extends WOQLCore { * @param {typedef.GraphRef} [graphRef] Resource String identifying the graph which will * be used for subsequent chained schema calls * @returns {WOQLQuery} A WOQLQuery which contains the partial Graph pattern matching expression - * @example */ graph(graphRef) { return this; } @@ -127,14 +126,12 @@ class WOQLQuery extends WOQLCore { /** * @param {boolean} tf * @returns {object} - * @example */ boolean(tf) { return {}; } /** * @param {string} s * @returns {object} - * @example */ string(s) { return {}; } @@ -142,16 +139,14 @@ class WOQLQuery extends WOQLCore { * @param {any} s * @param {string} t * @returns {object} - * @example + */ literal(s, t) { return {}; } /** - * @param {string} s - * @returns {object} - * @example - */ - + * @param {string} s + * @returns {object} + */ iri(s) { return {}; } // eslint-disable-next-line no-underscore-dangle @@ -1181,7 +1176,6 @@ WOQLQuery.prototype.idgenerator = WOQLQuery.prototype.idgen; * @param {string} prefix - prefix for the generated ID * @param {string} outputVar - variable that stores the generated ID * @returns {WOQLQuery} A WOQLQuery which contains the random ID generation pattern - * @example * idgen_random("Person/", "v:person_id") */ WOQLQuery.prototype.idgen_random = function (prefix, outputVar) { @@ -1439,7 +1433,6 @@ WOQLQuery.prototype.length = function (inputVarList, resultVarName) { * @param {number|string|Var} start - The start index (0-based, supports negative indices) * @param {number|string|Var} [end] - The end index (exclusive, optional - defaults to list length) * @returns {WOQLQuery} A WOQLQuery which contains the Slice pattern matching expression - * @example * let [result] = vars("result") * slice(["a", "b", "c", "d"], result, 1, 3) // result = ["b", "c"] * slice(["a", "b", "c", "d"], result, -2) // result = ["c", "d"] diff --git a/lib/viewer/frameRule.js b/lib/viewer/frameRule.js index bdd1799..7e9d7e4 100644 --- a/lib/viewer/frameRule.js +++ b/lib/viewer/frameRule.js @@ -9,7 +9,7 @@ const TerminusRule = require('./terminusRule'); /** - * @typedef {import('../typedef').Frame} Frame + * @typedef {Object} Frame */ /** @@ -26,7 +26,7 @@ Object.setPrototypeOf(FrameRule.prototype, TerminusRule.TerminusRule.prototype); /** * Returns an array of rules that match the paased frame - * @param {[FrameRule]} rules - array of rules to be tested + * @param {Array} rules - array of rules to be tested * @param {Frame | object} frame - document frame, object frame, or property frame to be tested * @param {function} [onmatch] - optional function to be called with args (frame, rule) * on each match diff --git a/lib/viewer/objectFrame.js b/lib/viewer/objectFrame.js index fc078bf..cd870ab 100644 --- a/lib/viewer/objectFrame.js +++ b/lib/viewer/objectFrame.js @@ -36,8 +36,6 @@ const WOQL = require('../woql'); * doc.loadJSON(json_frames, cls) //console.log(this.document) * doc.loadDataFrames(json_frames, cls) * doc.loadClassFrames(json_frames, cls) - * @example - * * @description Represents a frame for programmatic access to object frame, * anywhere within a document * Recursive data structure where this.children contains an indexed array of object frames @@ -49,7 +47,7 @@ const WOQL = require('../woql'); * @param classframe - an array of frames representing a class * @param archetypes list of class frames * @param parent parent object - * @returns + * @returns {ObjectFrame} */ function ObjectFrame(cls, jsonld, classframes, parent) { diff --git a/lib/viewer/woqlChooser.js b/lib/viewer/woqlChooser.js index 2d1ede2..b272cd5 100644 --- a/lib/viewer/woqlChooser.js +++ b/lib/viewer/woqlChooser.js @@ -7,7 +7,7 @@ const UTILS = require('../utils'); const { WOQLRule } = require('./woqlRule'); /** - * @typedef {import('../woqlClient')} WOQLClient + * @typedef {Object} WOQLClient */ /** diff --git a/lib/viewer/woqlResult.js b/lib/viewer/woqlResult.js index ae0c170..d406b81 100644 --- a/lib/viewer/woqlResult.js +++ b/lib/viewer/woqlResult.js @@ -10,7 +10,7 @@ const WOQL = require('../woql'); const WOQLQ = require('./woqlPaging'); /** - * @typedef {import('../query/woqlCore')} WOQLQuery + * @typedef {Object} WOQLQuery */ /** diff --git a/lib/viewer/woqlRule.js b/lib/viewer/woqlRule.js index b777524..c5dbbc6 100644 --- a/lib/viewer/woqlRule.js +++ b/lib/viewer/woqlRule.js @@ -21,7 +21,7 @@ Object.setPrototypeOf(WOQLRule.prototype, TerminusRule.TerminusRule.prototype); /** * Specifies that the rule only applies to specific variables returned by the WOQL query - * @param {[String]} - array of strings, each representing a variable name, variable prefixes + * @param {Array} vars - array of strings, each a variable name, variable prefixes * ("v:") are added automatically if absent */ WOQLRule.prototype.setVariables = function (vars) { @@ -80,7 +80,7 @@ WOQLRule.prototype.rownum = function (rownum) { /** * Specifies that the value of a variable must be one of the values contained in the list - * @param {[String|Number]} list - parameters are any atomic value (string | number) - + * @param {...(string|number)} list - parameters are any atomic value (string | number) - * the rule will match only cells that have one of these values */ WOQLRule.prototype.in = function (...list) { @@ -223,7 +223,7 @@ WOQLPattern.prototype.prettyPrint = function () { /** * @param {String|Object} data - * @param {String|[String, String]} [key] - a variable or an array of two variables + * @param {string|Array} [key] - a variable or an array of two variables * (in the case of edge scope) which constitutes the key being tested * @param {String} [scope] - the scope in which the test is being carried out (row, column, cell) */ diff --git a/lib/viewer/woqlStream.js b/lib/viewer/woqlStream.js index 71850c6..27a2b21 100644 --- a/lib/viewer/woqlStream.js +++ b/lib/viewer/woqlStream.js @@ -1,7 +1,7 @@ const WOQLStreamConfig = require('./streamConfig'); /** - * @typedef {import('../woqlClient')} WOQLClient + * @typedef {Object} WOQLClient */ /** diff --git a/lib/woqlClient.js b/lib/woqlClient.js index f6e23ec..382442b 100644 --- a/lib/woqlClient.js +++ b/lib/woqlClient.js @@ -15,7 +15,7 @@ const WOQL = require('./woql'); const WOQLQuery = require('./query/woqlCore'); /** - * @typedef {import('./typedef').NamedResourceData} NamedResourceData + * @typedef {Object} NamedResourceData */ /** diff --git a/package.json b/package.json index 6a955bd..60ab64b 100644 --- a/package.json +++ b/package.json @@ -59,6 +59,7 @@ "webpack-dev-server": "^5.2.1" }, "scripts": { + "mkdocs:docs": "npx jsdoc --template ./jsdoc-terminusdb-template --recurse ./lib/ > docs.json", "mkdocs:multi": "node ./docs/createDocs.js", "mkdocs:src": "docco lib/*.js -l plain -x md -o docs/api", "mkdocs:api": "jsdoc2md --configure docs/doc_config.json --partial docs/partial/scope.hbs docs/partial/member-index.hbs docs/partial/header.hbs --helper docs/helper/format.js --files lib/woql.js lib/woqlClient.js lib/typedef.js > docs/api/api.js.md",