graphdb
Version:
Javascript client library supporting GraphDB and RDF4J REST API.
66 lines (64 loc) • 3.37 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.RepositoryConfig = 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); }
/**
* Helper class to use when new repository is programmatically created.
*
* @class
* @author Teodossi Dossev
*/
var RepositoryConfig = exports.RepositoryConfig = /*#__PURE__*/function () {
/**
* @param {string} [id] Repository ID
* @param {string} [location] Repository location
* @param {Object} [params] Map of repository configuration parameters.
* See {@link https://graphdb.ontotext.com/documentation/standard/configuring-a-repository.html#configuring-a-repository-configuration-parameters
* GraphDB Documentation}
* @param {string} [sesameType] Repository type as sesame rdf type.
* May be one of the following:
* <code>owlim:ReplicationCluster</code> for master repository
* <code>owlim:ReplicationClusterWorker</code> for worker repository
* <code>owlim:MonitorRepository</code> for se repository
* <code>openrdf:SailRepository</code> for se repository
* <code>graphdb:SailRepository</code> for free repository
* <code>openrdf:SystemRepository</code> for openrdf-system repository
* <code>graphdb:OntopRepository</code> for ontop repository
* @param {string} [title] Repository title
* @param {string} [type] Repository type as {@link RepositoryType}
*/
function RepositoryConfig(id, location, params, sesameType, title, type) {
_classCallCheck(this, RepositoryConfig);
this.id = id;
this.location = location;
this.params = params || {};
this.sesameType = sesameType;
this.title = title;
this.type = type;
}
/**
* Repository configuration to json getter
* @return {Object} Repository configuration as key value pairs object
*/
return _createClass(RepositoryConfig, [{
key: "toJson",
value: function toJson() {
return {
id: this.id,
location: this.location,
params: this.params,
sesameType: this.sesameType,
title: this.title,
type: this.type
};
}
}]);
}();
module.exports = RepositoryConfig;