graphdb
Version:
Javascript client library supporting GraphDB and RDF4J REST API.
115 lines (109 loc) • 4.73 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.AppSettings = void 0;
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
/**
* Application settings help you to configure the default behavior
* of the GraphDB Workbench.
* Use with extreme caution, as the changes that are made to the
* application settings may possibly change the behavior of the
* GraphDB Workbench for the logged-in user or for all users
* if logged in as admin.
*
* @class
* @author Teodossi Dossev
*/
var AppSettings = exports.AppSettings = /*#__PURE__*/function () {
/**
* Constructor.
* @param {boolean} defaultInference This is the default value for
* the Include inferred data in results option in the Workbench's SPARQL
* editor. It is taken each time a new tab is created.
* @param {boolean} defaultSameas This is the default value for
* the Expand results over owl:SameAs option in the Workbench's
* SPARQL editor. It is taken each time a new tab is created.
* @param {boolean} ignoreSharedQueries Whether to ignore
* shared between users queries.
* @param {boolean} executeCount For each query without limit
* sent through the SPARQL editor, an additional query is sent
* to determine the total number of results.
*/
function AppSettings(defaultInference, defaultSameas, ignoreSharedQueries, executeCount) {
_classCallCheck(this, AppSettings);
this.defaultInference = defaultInference;
this.defaultSameas = defaultSameas;
this.ignoreSharedQueries = ignoreSharedQueries;
this.executeCount = executeCount;
}
/**
* DefaultInference setter.
* @param {boolean} defaultInference <code>true</code> if is enabled and
* <code>false</code> otherwise.
* @return {AppSettings}
*/
return _createClass(AppSettings, [{
key: "setDefaultInference",
value: function setDefaultInference(defaultInference) {
this.defaultInference = defaultInference;
return this;
}
/**
* DefaultSameas setter.
* @param {boolean} defaultSameas <code>true</code> if is enabled and
* <code>false</code> otherwise.
* @return {AppSettings}
*/
}, {
key: "setDefaultSameas",
value: function setDefaultSameas(defaultSameas) {
this.defaultSameas = defaultSameas;
return this;
}
/**
* Ignores queries, shared between users.
* @param {boolean} ignoreSharedQueries <code>true</code> if ignored and
* <code>false</code> otherwise.
* @return {AppSettings}
*/
}, {
key: "setIgnoreSharedQueries",
value: function setIgnoreSharedQueries(ignoreSharedQueries) {
this.ignoreSharedQueries = ignoreSharedQueries;
return this;
}
/**
* Count all SPARQL results setter.
* @param {boolean} executeCount <code>true</code> if is enabled and
* <code>false</code> otherwise.
* @return {AppSettings}
*/
}, {
key: "setExecuteCount",
value: function setExecuteCount(executeCount) {
this.executeCount = executeCount;
return this;
}
/**
* AppSettings to json getter
* @return {Object} Application settings as key value pairs object
*/
}, {
key: "toJson",
value: function toJson() {
return {
DEFAULT_INFERENCE: this.defaultInference,
DEFAULT_SAMEAS: this.defaultSameas,
IGNORE_SHARED_QUERIES: this.ignoreSharedQueries,
EXECUTE_COUNT: this.executeCount
};
}
}]);
}();
module.exports = AppSettings;