graphdb-workbench 1.10.1 → 1.11.0-TR4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/10.e1e902adfd32b7c4a241.bundle.js +2 -0
- package/dist/10.e1e902adfd32b7c4a241.bundle.js.map +1 -0
- package/dist/{111.b136aca89a5c4d49c088.bundle.js → 111.056eb71072bfd8f6551b.bundle.js} +2 -2
- package/dist/{111.b136aca89a5c4d49c088.bundle.js.map → 111.056eb71072bfd8f6551b.bundle.js.map} +1 -1
- package/dist/113.2c059fa7d06fd04149eb.bundle.js +1 -1
- package/dist/113.2c059fa7d06fd04149eb.bundle.js.map +1 -1
- package/dist/{12.449fb5148a68a44ba324.bundle.js → 12.60db051e76264d3f95b2.bundle.js} +2 -2
- package/dist/12.60db051e76264d3f95b2.bundle.js.map +1 -0
- package/dist/14.610f5a8ef2eedd3fe082.bundle.js +4 -0
- package/dist/14.610f5a8ef2eedd3fe082.bundle.js.map +1 -0
- package/dist/15.97d30c0784a0224dade4.bundle.js +2 -0
- package/dist/15.97d30c0784a0224dade4.bundle.js.map +1 -0
- package/dist/16.6029d21bf28b30749fb6.bundle.js +2 -0
- package/dist/16.6029d21bf28b30749fb6.bundle.js.map +1 -0
- package/dist/{18.e045a7a0f1de6ae60c0b.bundle.js → 18.7093ec69673a80c6c263.bundle.js} +2 -2
- package/dist/18.7093ec69673a80c6c263.bundle.js.map +1 -0
- package/dist/22.93d86caa997992a46006.bundle.js +1 -1
- package/dist/22.93d86caa997992a46006.bundle.js.map +1 -1
- package/dist/26.a7b51e1e02b31ee71f94.bundle.js +2 -0
- package/dist/26.a7b51e1e02b31ee71f94.bundle.js.map +1 -0
- package/dist/27.9363b742c27da92da504.bundle.js +2 -0
- package/dist/27.9363b742c27da92da504.bundle.js.map +1 -0
- package/dist/28.9f56a33e383eeb54d985.bundle.js +2 -0
- package/dist/28.9f56a33e383eeb54d985.bundle.js.map +1 -0
- package/dist/30.5ed60b4ae0a67956c66b.bundle.js +1 -1
- package/dist/30.5ed60b4ae0a67956c66b.bundle.js.map +1 -1
- package/dist/{34.af70302b47e62d49d058.bundle.js → 34.9dab6ede2827d8976d8a.bundle.js} +2 -2
- package/dist/34.9dab6ede2827d8976d8a.bundle.js.map +1 -0
- package/dist/35.b8c8d16a8707c20a1fcb.bundle.js +2 -0
- package/dist/35.b8c8d16a8707c20a1fcb.bundle.js.map +1 -0
- package/dist/36.53cea4c4866328aef1aa.bundle.js +2 -0
- package/dist/36.53cea4c4866328aef1aa.bundle.js.map +1 -0
- package/dist/37.571a0ab8fb0508c3f1fe.bundle.js +1 -1
- package/dist/37.571a0ab8fb0508c3f1fe.bundle.js.map +1 -1
- package/dist/38.c611acd72558ca546c47.bundle.js +1 -1
- package/dist/38.c611acd72558ca546c47.bundle.js.map +1 -1
- package/dist/48.52c5b13ab244c45a8c43.bundle.js +2 -0
- package/dist/48.52c5b13ab244c45a8c43.bundle.js.map +1 -0
- package/dist/{bundle.e7b22d8ef84fbe277d35.bundle.js → bundle.5c0b5a431cb9c6b94629.bundle.js} +4 -4
- package/dist/bundle.5c0b5a431cb9c6b94629.bundle.js.map +1 -0
- package/dist/css/graphs-vizualizations.css +9 -1
- package/dist/index.html +3 -3
- package/dist/js/angular/core/directives/queryeditor/templates/query-editor.html +1 -0
- package/dist/js/angular/core/directives/rdfresourcesearch/templates/rdfResourceSearchTemplate.html +1 -1
- package/dist/pages/autocomplete.html +1 -1
- package/dist/pages/choose-repository-type.html +1 -1
- package/dist/pages/clusterInfo.html +1 -1
- package/dist/pages/create-index.html +4 -4
- package/dist/pages/dependencies.html +1 -1
- package/dist/pages/domainRangeInfo.html +2 -2
- package/dist/pages/edit.html +1 -1
- package/dist/pages/explore.html +1 -1
- package/dist/pages/export.html +1 -1
- package/dist/pages/find.html +1 -1
- package/dist/pages/graph-config/saveGraphConfig.html +29 -17
- package/dist/pages/graphs-visualizations.html +19 -15
- package/dist/pages/import.html +1 -1
- package/dist/pages/jdbc-create.html +5 -5
- package/dist/pages/monitor/queries.html +1 -1
- package/dist/pages/monitor/resources.html +2 -2
- package/dist/pages/namespaces.html +2 -2
- package/dist/pages/rdfClassHierarchyInfo.html +7 -7
- package/dist/pages/rdfrank.html +2 -2
- package/dist/pages/repositories.html +2 -2
- package/dist/pages/repository.html +2 -2
- package/dist/pages/similarity-indexes.html +1 -1
- package/dist/pages/sparql-template-create.html +5 -5
- package/dist/pages/sparql.html +3 -3
- package/dist/pages/webapi.html +2 -2
- package/dist/res/swagger/index.html +25 -25
- package/package.json +1 -1
- package/dist/10.a1beb5a39f13b1df6fab.bundle.js +0 -2
- package/dist/10.a1beb5a39f13b1df6fab.bundle.js.map +0 -1
- package/dist/12.449fb5148a68a44ba324.bundle.js.map +0 -1
- package/dist/14.c7175f400470b470e034.bundle.js +0 -4
- package/dist/14.c7175f400470b470e034.bundle.js.map +0 -1
- package/dist/15.42e5580cb96eefbb1f0b.bundle.js +0 -2
- package/dist/15.42e5580cb96eefbb1f0b.bundle.js.map +0 -1
- package/dist/16.01bd96cfd64f6b616999.bundle.js +0 -2
- package/dist/16.01bd96cfd64f6b616999.bundle.js.map +0 -1
- package/dist/18.e045a7a0f1de6ae60c0b.bundle.js.map +0 -1
- package/dist/26.34bd7614fd5d46aa6d89.bundle.js +0 -2
- package/dist/26.34bd7614fd5d46aa6d89.bundle.js.map +0 -1
- package/dist/27.5089831daf42bf903e6c.bundle.js +0 -2
- package/dist/27.5089831daf42bf903e6c.bundle.js.map +0 -1
- package/dist/28.bbe49746541a2419b9a7.bundle.js +0 -2
- package/dist/28.bbe49746541a2419b9a7.bundle.js.map +0 -1
- package/dist/34.af70302b47e62d49d058.bundle.js.map +0 -1
- package/dist/35.8b3e5f2143c615155e8d.bundle.js +0 -2
- package/dist/35.8b3e5f2143c615155e8d.bundle.js.map +0 -1
- package/dist/36.466f06017a4f9d2277fb.bundle.js +0 -2
- package/dist/36.466f06017a4f9d2277fb.bundle.js.map +0 -1
- package/dist/48.14a8f14de3765cbe330c.bundle.js +0 -2
- package/dist/48.14a8f14de3765cbe330c.bundle.js.map +0 -1
- package/dist/bundle.e7b22d8ef84fbe277d35.bundle.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["webpack:///./src/js/angular/rest/connectors.rest.service.js","webpack:///./src/js/angular/externalsync/controllers.js"],"names":["angular","module","factory","ConnectorsRestService","$inject","CONNECTORS_ENDPOINT","$http","getConnectors","get","initConnector","prefix","hasConnector","checkConnector","data","post","headers","jsonToFormData","str","Object","keys","forEach","key","push","encodeURIComponent","join","mapCreateValuesToUiValues","values","options","i","length","option","__type","__name","j","__childOptions","child","k","valueK","hasOwnProperty","isDefined","__defaultValue","optionEl","isUndefined","map","_","value","toJson","_evaluateSparqlQuery","http","repository","query","buildNamePrefix","substring","createConnectorQuery","name","fields","reportError","fcopy","sortObject","obj","newObject","each","childOption","copy","arrayMap","reduce","acc","Error","fromJson","e","__label","message","removeEmptyValues","Array","isArray","filter","item","trim","finalString","replace","ConnectorsCtrl","$scope","$repositories","$modal","toastr","ModalService","$q","RDF4JRepositoriesRestService","resetProgress","repair","beingBuiltConnector","percentDone","status","processedEntities","estimatedEntities","indexedEntities","entitiesPerSecond","actionName","waitOnRepairStartOnce","eta","inline","iri","openProgressModal","$","extend","doneCallback","modalInstance","dismiss","open","templateUrl","controller","size","backdrop","scope","executeCreate","connector","errorCallback","modal","addStatements","getActiveRepository","update","then","res","existing","success","err","error","getError","finally","loader","controllers","definitions","getLoaderMessage","timeSeconds","Date","now","loaderStartTime","timeHuman","getHumanReadableSeconds","progressMessage","extraMessage","setLoader","isRunning","canWriteActiveRepo","connectors","all","connectorIris","createStatusQueryForAny","evaluateSparqlQuery","results","bindings","statusObject","JSON","parse","console","parseFirstBuildingResult","d","split","catch","getOptions","isEmpty","isObject","toPrettyJson","$watch","getActiveLocation","copyConnector","newValues","resolve","result","skipConversion","newConnector","inst","type","openSimpleModal","title","warning","delete","isExternal","indexOf","force","namePrefix","deleteConnectorQuery","viewQuery","DeleteConnectorCtrl","$modalInstance","ok","close","cancel","ExtendNewConnectorCtrl","toQuery","label","addField","index","optionName","newField","defaultValues","splice","addOption","array","deleteOption","addMapOption","deleteMapOption","form","$valid","CreateConnectorCtrl","$controller","this","CreateProgressCtrl","$interval","initProgress","statusIri","createStatusQueryForIri","progressInterval","getFirstStatusFromResult","toFixed","etaSeconds","$on","input","Math","ceil"],"mappings":"8EAAAA,QACKC,OAAO,4CAA6C,IACpDC,QAAQ,wBAAyBC,GAEtCA,EAAsBC,QAAU,CAAC,SAEjC,MAAMC,EAAsB,kBAE5B,SAASF,EAAsBG,GAE3B,MAAO,CACHC,cAMJ,WACI,OAAOD,EAAME,IAAIH,IANjBI,cASJ,SAAuBC,GACnB,OAAOJ,EAAME,IAAI,GAAGH,oBAAsCK,MAT1DC,aAYJ,SAAsBD,GAClB,OAAOJ,EAAME,IAAI,GAAGH,qBAAuCK,MAZ3DE,eAeJ,SAAwBC,GACpB,OAAOP,EAAMQ,KAAK,GAAGT,UAA6BQ,EAAM,CACpDE,QAAS,CACL,eAAgB,oB,gCChChC,mBAiBA,SAASC,EAAeH,GACpB,MAAMI,EAAM,GAIZ,OAHAC,OAAOC,KAAKN,GAAMO,SAAQ,SAAUC,GAChCJ,EAAIK,KAAKC,mBAAmBF,GAAO,IAAME,mBAAmBV,EAAKQ,QAE9DJ,EAAIO,KAAK,KAwBpB,SAASC,EAA0BC,EAAQC,GACvC,IAAK,IAAIC,EAAI,EAAGA,EAAID,EAAQE,OAAQD,IAAK,CACrC,MAAME,EAASH,EAAQC,GACvB,GAAsB,gBAAlBE,EAAOC,OACFL,EAAOI,EAAOE,UACfN,EAAOI,EAAOE,QAAU,CAAC,UAE1B,GAAsB,gBAAlBF,EAAOC,OACd,GAAKL,EAAOI,EAAOE,QAcf,IAAK,IAAIC,EAAI,EAAGA,EAAIH,EAAOI,eAAeL,OAAQI,IAAK,CACnD,MAAME,EAAQL,EAAOI,eAAeD,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oBxM,QAAU,CAAC,SAAU,cAAe,QAAS,iBAAkB,YAAa,SAAU,SAAU,WAqBpH2M,EAAmB3M,QAAU,CAAC,SAAU,YAAa,QAAS","file":"35.8b3e5f2143c615155e8d.bundle.js","sourcesContent":["angular\n .module('graphdb.framework.rest.connectors.service', [])\n .factory('ConnectorsRestService', ConnectorsRestService);\n\nConnectorsRestService.$inject = ['$http'];\n\nconst CONNECTORS_ENDPOINT = 'rest/connectors';\n\nfunction ConnectorsRestService($http) {\n\n return {\n getConnectors,\n initConnector,\n hasConnector,\n checkConnector\n };\n\n function getConnectors() {\n return $http.get(CONNECTORS_ENDPOINT);\n }\n\n function initConnector(prefix) {\n return $http.get(`${CONNECTORS_ENDPOINT}/options?prefix=${prefix}`);\n }\n\n function hasConnector(prefix) {\n return $http.get(`${CONNECTORS_ENDPOINT}/existing?prefix=${prefix}`);\n }\n\n function checkConnector(data) {\n return $http.post(`${CONNECTORS_ENDPOINT}/check`, data, {\n headers: {\n 'Content-Type': 'text/plain'\n }\n });\n }\n}\n","import 'angular/rest/rdf4j.repositories.rest.service';\nimport 'angular/rest/connectors.rest.service';\n\nconst modules = [\n 'graphdb.framework.rest.rdf4j.repositories.service',\n 'graphdb.framework.rest.connectors.service'\n];\n\nangular\n .module('graphdb.framework.externalsync.controllers', modules)\n .controller('ConnectorsCtrl', ConnectorsCtrl)\n .controller('ExtendNewConnectorCtrl', ExtendNewConnectorCtrl)\n .controller('CreateConnectorCtrl', CreateConnectorCtrl)\n .controller('CreateProgressCtrl', CreateProgressCtrl)\n .controller('DeleteConnectorCtrl', DeleteConnectorCtrl)\n .filter('ceil', ceil);\n\nfunction jsonToFormData(data) {\n const str = [];\n Object.keys(data).forEach(function (key) {\n str.push(encodeURIComponent(key) + '=' + encodeURIComponent(data[key]));\n });\n return str.join('&');\n}\n\nfunction toArrayMap(map) {\n return _.map(map, function (value, key) {\n return {key: key, value: value};\n });\n}\n\nfunction fromArrayMap(arrayMap) {\n return _.reduce(arrayMap, function (acc, value) {\n if (value.key === '' && value.value === '') {\n // empty pair, skip it\n } else if (value.key === '') {\n throw new Error('Key may not be empty with value \"' + value.value + '\"');\n } else if (acc.hasOwnProperty(value.key)) {\n throw new Error('Duplicate key ' + value.key);\n } else {\n acc[value.key] = value.value;\n }\n return acc;\n }, {});\n}\n\nfunction mapCreateValuesToUiValues(values, options) {\n for (let i = 0; i < options.length; i++) {\n const option = options[i];\n if (option.__type === 'StringArray') {\n if (!values[option.__name]) {\n values[option.__name] = [''];\n }\n } else if (option.__type === 'OptionArray') {\n if (!values[option.__name]) { // values has no entry for this option\n values[option.__name] = [];\n const optionEl = {};\n for (let j = 0; j < option.__childOptions.length; j++) {\n const child = option.__childOptions[j];\n if (child.__type === 'StringArray') {\n optionEl[child.__name] = [''];\n } else {\n optionEl[child.__name] = (!angular.isUndefined(child.__defaultValue) ? child.__defaultValue : '');\n }\n }\n values[option.__name].push(optionEl);\n } else { // values already has en entry for this option\n // Copies the default value for Boolean child options if no explicit value is set\n for (let j = 0; j < option.__childOptions.length; j++) {\n const child = option.__childOptions[j];\n if (child.__type === 'Boolean') {\n for (let k = 0; k < values[option.__name].length; k++) {\n const valueK = values[option.__name][k];\n if (!valueK.hasOwnProperty([child.__name]) && angular.isDefined(child.__defaultValue)) {\n valueK[child.__name] = child.__defaultValue;\n }\n }\n }\n }\n }\n } else if (option.__type === 'Map') {\n if (!values[option.__name]) {\n values[option.__name] = [];\n } else {\n values[option.__name] = toArrayMap(values[option.__name]);\n }\n } else if (option.__type === 'JsonString') {\n if (values[option.__name]) {\n values[option.__name] = angular.toJson(values[option.__name], 2);\n }\n } else {\n if (angular.isUndefined(values[option.__name])) {\n values[option.__name] = (!angular.isUndefined(option.__defaultValue) ? option.__defaultValue : '');\n }\n }\n }\n\n return values;\n}\n\nfunction _evaluateSparqlQuery(http, repository, query) {\n return http.post('repositories/' + repository, jsonToFormData({query: query}),\n {\n headers: {\n 'Content-Type': 'application/x-www-form-urlencoded',\n 'Accept': 'application/sparql-results+json',\n 'X-GraphDB-Local-Consistency': 'updating'\n }\n });\n}\n\nfunction buildNamePrefix(prefix) {\n return prefix.substring(0, prefix.length - 1) + '/instance#';\n}\n\nfunction createConnectorQuery(name, prefix, fields, options, reportError) {\n // Returns a copy of the parameter obj sorted according to the order in options\n function sortObject(obj, options) {\n const newObject = {};\n _.each(options, function (option) {\n if (angular.isDefined(obj[option.__name])) {\n if (option.__type === 'OptionArray') {\n newObject[option.__name] = [];\n _.each(obj[option.__name], function (childOption) {\n newObject[option.__name].push(sortObject(childOption, option.__childOptions));\n });\n } else {\n newObject[option.__name] = angular.copy(obj[option.__name]);\n }\n }\n });\n return newObject;\n }\n\n const fcopy = sortObject(fields, options);\n\n for (let i = 0; i < options.length; i++) {\n try {\n if (options[i].__type === 'Map') {\n fcopy[options[i].__name] = fromArrayMap(fcopy[options[i].__name]);\n } else if (options[i].__type === 'JsonString') {\n fcopy[options[i].__name] = angular.fromJson(fcopy[options[i].__name]);\n }\n } catch (e) {\n reportError(options[i].__label, e.message);\n return null;\n }\n }\n\n removeEmptyValues(fcopy);\n //escapeValues(fields);\n let finalString = '';\n finalString += 'PREFIX :<' + prefix + '>\\n';\n const namePrefix = buildNamePrefix(prefix);\n finalString += 'PREFIX inst:<' + namePrefix + '>\\n';\n finalString += 'INSERT DATA {\\n';\n finalString += \"\\tinst:\" + name + \" :createConnector '''\\n\"; // eslint-disable-line quotes\n finalString += angular.toJson(fcopy, 2);\n finalString += \"\\n''' .\\n}\\n\"; // eslint-disable-line quotes\n finalString = finalString.replace(/\\\\/g, '\\\\\\\\\\\\');\n return finalString;\n}\n\nfunction createStatusQueryForIri(iri) {\n const statusIri = iri.replace(/\\/instance#.+$/, '#connectorStatus');\n let finalString = '';\n finalString += 'SELECT ?status {\\n';\n finalString += '\\t<' + iri + '> <' + statusIri + '> ?status';\n finalString += '\\n}';\n return finalString;\n}\n\nfunction createStatusQueryForAny(connectors) {\n const connectorIris = _.map(connectors,\n function (k) {\n return '<' + k.value + 'connectorStatus' + '>';\n }).join('|');\n\n if (connectorIris) {\n return 'SELECT ?connector ?status { ?connector ' + connectorIris + ' ?status }';\n }\n\n return null;\n}\n\nfunction repairConnectorQuery(name, prefix) {\n const namePrefix = buildNamePrefix(prefix);\n return 'PREFIX prefix:<' + prefix + '>\\n' +\n 'INSERT DATA {\\n' +\n '\\t<' + namePrefix + name + '> prefix:repairConnector \"\"\\n' +\n '}';\n}\n\nfunction deleteConnectorQuery(name, prefix, force) {\n const namePrefix = prefix.substring(0, prefix.length - 1) + \"/instance#\";\n return 'PREFIX prefix:<' + prefix + '>\\n' +\n 'INSERT DATA {\\n' +\n '\\t<' + namePrefix + name + '> prefix:dropConnector \"' + (force ? \"force\" : \"\") + '\"\\n' +\n '}';\n}\n\nfunction removeEmptyValues(data) {\n // remove empty values from array\n if (Array.isArray(data)) {\n data = _.filter(data, function (item) {\n return item !== null && (!item.trim || item.trim() !== '');\n });\n }\n // remove empty values from object values\n Object.keys(data).forEach(function (key) {\n if ((data[key] === '' || data[key] == null) && data[key] !== false) {\n delete data[key];\n } else if (typeof data[key] === 'object') {\n data[key] = removeEmptyValues(data[key]);\n }\n });\n return data;\n}\n\nfunction parseFirstBuildingResult(results) {\n if (results.bindings) {\n for (let i = 0; i < results.bindings.length; i++) {\n try {\n const statusObject = JSON.parse(results.bindings[i].status.value);\n if (statusObject.status === 'BUILDING') {\n return {\n connector: results.bindings[i].connector.value,\n status: statusObject\n };\n }\n } catch (e) {\n console.error(e); // eslint-disable-line no-console\n }\n }\n }\n\n return {};\n}\n\nConnectorsCtrl.$inject = ['$scope', '$http', '$repositories', '$modal', 'toastr', 'ModalService', '$q', 'RDF4JRepositoriesRestService', 'ConnectorsRestService'];\n\nfunction ConnectorsCtrl($scope, $http, $repositories, $modal, toastr, ModalService, $q, RDF4JRepositoriesRestService, ConnectorsRestService) {\n $scope.loader = false;\n\n $scope.controllers = [];\n\n $scope.existing = {};\n\n $scope.definitions = {};\n\n $scope.getLoaderMessage = function () {\n const timeSeconds = (Date.now() - $scope.loaderStartTime) / 1000;\n const timeHuman = $scope.getHumanReadableSeconds(timeSeconds);\n let message = '';\n if ($scope.progressMessage) {\n message = $scope.progressMessage + '... ' + timeHuman;\n } else {\n message = 'Running operation...' + timeHuman;\n }\n if ($scope.extraMessage && timeSeconds > 10) {\n message += '\\n' + $scope.extraMessage;\n }\n\n return message;\n };\n\n $scope.setLoader = function (isRunning, progressMessage, extraMessage) {\n if (isRunning) {\n $scope.loader = true;\n $scope.loaderStartTime = Date.now();\n $scope.progressMessage = progressMessage;\n $scope.extraMessage = extraMessage;\n } else {\n $scope.loader = false;\n $scope.progressMessage = '';\n $scope.extraMessage = '';\n }\n };\n\n $scope.initConnector = function (connector) {\n return ConnectorsRestService.initConnector(encodeURIComponent(connector.value))\n .then(function (res) {\n $scope.definitions[connector.key] = res.data;\n\n return ConnectorsRestService.hasConnector(encodeURIComponent(connector.value))\n .then(function (res) {\n $scope.existing[connector.key] = res.data;\n\n });\n });\n };\n\n $scope.getConnectors = function () {\n if (!$scope.canWriteActiveRepo()) {\n return;\n }\n\n $scope.setLoader(true, 'Fetching connectors', 'Normally this is a fast operation but it may take longer if a bigger repository needs to be initialised first.');\n\n ConnectorsRestService.getConnectors()\n .then(function (res) {\n $scope.connectors = Object.keys(res.data).map(function (key) {\n return {key: key, value: res.data[key]};\n });\n\n $q.all(_.map($scope.connectors, function (connector) {\n return $scope.initConnector(connector);\n })).finally(function () {\n resetProgress();\n\n const query = createStatusQueryForAny($scope.connectors);\n\n if (query) {\n evaluateSparqlQuery(query)\n .then(function (res) {\n const status = parseFirstBuildingResult(res.data.results);\n if (status.connector) {\n // has a building connector, open progress indicator\n const d = status.connector.split(/#/);\n d[0] = d[0].replace(/\\/instance$/, '#');\n showProgress(d[0], d[1]);\n }\n })\n .finally(function () {\n $scope.setLoader(false);\n });\n } else {\n $scope.setLoader(false);\n }\n });\n }).catch(function (e) {\n $scope.setLoader(false);\n toastr.error(getError(e), 'Could not get connectors');\n });\n\n $scope.existing = {};\n };\n\n $scope.getOptions = function (connector) {\n return $scope.definitions[connector.key];\n };\n\n $scope.isEmpty = function (value) {\n return angular.isObject(value) && Object.keys(value).length === 0;\n };\n\n $scope.toPrettyJson = function (value) {\n return angular.toJson(value, 2);\n };\n\n $scope.$watch(function () {\n return $repositories.getActiveRepository();\n }, $scope.getConnectors);\n\n $scope.$watch(function () {\n return $repositories.getActiveLocation();\n }, $scope.getConnectors);\n\n function evaluateSparqlQuery(query) {\n return _evaluateSparqlQuery($http, $repositories.getActiveRepository(), query);\n }\n\n function resetProgress(repair) {\n $scope.beingBuiltConnector = {\n percentDone: 0,\n status: {\n processedEntities: 0,\n estimatedEntities: 0,\n indexedEntities: 0,\n entitiesPerSecond: 0\n },\n actionName: repair ? 'Repairing' : 'Creating',\n waitOnRepairStartOnce: !!repair,\n eta: '-',\n inline: false,\n iri: null\n };\n }\n\n function openProgressModal(prefix, name, repair) {\n resetProgress(repair);\n\n $.extend($scope.beingBuiltConnector, {\n iri: buildNamePrefix(prefix) + name,\n name: name,\n inline: false,\n doneCallback: function () {\n $scope.beingBuiltConnector.modalInstance.dismiss('cancel');\n }\n });\n\n $scope.beingBuiltConnector.modalInstance = $modal.open({\n templateUrl: 'pages/connectorProgress.html',\n controller: 'CreateProgressCtrl',\n size: 'lg',\n backdrop: 'static',\n scope: $scope\n });\n\n return $scope.beingBuiltConnector.modalInstance;\n }\n\n function showProgress(prefix, name) {\n resetProgress();\n\n $.extend($scope.beingBuiltConnector, {\n iri: buildNamePrefix(prefix) + name,\n name: name,\n inline: true,\n doneCallback: function () {\n $scope.beingBuiltConnector.inline = false;\n }\n });\n }\n\n function executeCreate(connector, obj, errorCallback) {\n const modal = openProgressModal(connector.value, obj.name, false);\n RDF4JRepositoriesRestService.addStatements($repositories.getActiveRepository(), jsonToFormData({update: obj.query}))\n .then(function () {\n ConnectorsRestService.getConnectors().then(function () {\n ConnectorsRestService.hasConnector(encodeURIComponent(connector.value)).then(function (res) {\n $scope.existing[connector.key] = res.data;\n });\n });\n toastr.success('Created connector ' + obj.name);\n }, function (err) {\n toastr.error(getError(err));\n errorCallback();\n }).finally(function () {\n modal.dismiss('cancel');\n });\n }\n\n $scope.copyConnector = function (connector, values) {\n let newValues;\n if (!angular.isUndefined(values)) {\n newValues = angular.copy(values);\n newValues.name = newValues.name + '-copy';\n }\n const modal = $modal.open({\n templateUrl: 'pages/createConnector.html',\n controller: 'CreateConnectorCtrl',\n size: 'lg',\n backdrop: 'static',\n resolve: {\n connector: function () {\n return connector;\n },\n values: function () {\n return angular.isUndefined(newValues) ? {name: '', values: {}} : newValues;\n },\n options: function () {\n return $scope.getOptions(connector);\n }\n }\n });\n\n modal.result.then(function (obj) {\n executeCreate(connector, obj, function () {\n obj.skipConversion = true;\n $scope.newConnector(connector, obj);\n });\n });\n };\n\n $scope.newConnector = function (connector, values) {\n const modal = $modal.open({\n templateUrl: 'pages/createConnector.html',\n controller: 'CreateConnectorCtrl',\n size: 'lg',\n backdrop: 'static',\n resolve: {\n connector: function () {\n return connector;\n },\n values: function () {\n return angular.isUndefined(values) ? {name: '', values: {}} : values;\n },\n options: function () {\n return $scope.getOptions(connector);\n }\n }\n });\n\n modal.result.then(function (obj) {\n executeCreate(connector, obj, function () {\n obj.skipConversion = true;\n $scope.newConnector(connector, obj);\n });\n });\n };\n\n $scope.repair = function (inst, type) {\n ModalService.openSimpleModal({\n title: 'Confirm repair',\n message: 'Are you sure you want to repair this connector?<br>Note that repair means delete + recreate with the same settings.',\n warning: true\n }).result\n .then(function () {\n const modal = openProgressModal(type.value, inst.name, true);\n\n const query = repairConnectorQuery(inst.name, type.value);\n\n RDF4JRepositoriesRestService.addStatements($repositories.getActiveRepository(), jsonToFormData({update: query}))\n .then(function () {\n ConnectorsRestService.getConnectors().then(function () {\n ConnectorsRestService.hasConnector(encodeURIComponent(type.value)).then(function (res) {\n $scope.existing[type.key] = res.data;\n });\n });\n toastr.success('Repaired connector ' + inst.name);\n }, function (err) {\n toastr.error(getError(err));\n }).finally(function () {\n modal.dismiss('cancel');\n });\n });\n };\n\n $scope.delete = function (inst, type) {\n const isExternal = type.key.indexOf(\"Elastic\") >= 0 || type.key.indexOf(\"Solr\") >= 0;\n\n $modal.open({\n templateUrl: 'js/angular/externalsync/templates/deleteConnector.html',\n controller: 'DeleteConnectorCtrl',\n resolve: {\n type: function () {\n return type.key;\n },\n isExternal: function () {\n return isExternal;\n }\n }\n }).result\n .then(function(force) {\n $scope.setLoader(true, 'Deleting connector ' + inst.name, 'This is usually a fast operation but it might take a while.');\n\n const query = deleteConnectorQuery(inst.name, type.value, force);\n RDF4JRepositoriesRestService.addStatements($repositories.getActiveRepository(), jsonToFormData({update: query}))\n .then(function () {\n ConnectorsRestService.getConnectors().then(function () {\n ConnectorsRestService.hasConnector(encodeURIComponent(type.value)).then(function (res) {\n $scope.existing[type.key] = res.data;\n });\n });\n if (force) {\n toastr.success(\"Deleted (with force) connector \" + inst.name);\n if (isExternal) {\n toastr.warning(\"You may have to remove the index manually from \" + type.key);\n }\n } else {\n toastr.success(\"Deleted connector \" + inst.name);\n }\n }, function (err) {\n toastr.error(getError(err));\n }).finally(function() {\n $scope.setLoader(false);\n });\n });\n };\n\n $scope.viewQuery = function (connector, inst) {\n $modal.open({\n templateUrl: 'pages/viewQuery.html',\n controller: 'ViewQueryCtrl',\n resolve: {\n query: function () {\n const options = $scope.getOptions(connector);\n return createConnectorQuery(inst.name, connector.value,\n mapCreateValuesToUiValues(inst.values, options), options);\n }\n }\n });\n };\n}\n\nDeleteConnectorCtrl.$inject = ['$scope', '$modalInstance', 'type', 'isExternal'];\nfunction DeleteConnectorCtrl($scope, $modalInstance, type, isExternal) {\n $scope.force = false;\n $scope.type = type;\n $scope.isExternal = isExternal;\n\n $scope.ok = function () {\n $modalInstance.close($scope.force);\n };\n\n $scope.cancel = function () {\n $modalInstance.dismiss();\n };\n}\n\nExtendNewConnectorCtrl.$inject = ['$scope', '$modalInstance', 'connector', '$modal', 'toastr'];\nfunction ExtendNewConnectorCtrl($scope, $modalInstance, connector, $modal, toastr) {\n\n $scope.connector = connector;\n\n $scope.addField = function (index, optionName) {\n const newField = angular.copy($scope.defaultValues[optionName][0]);\n $scope.values[optionName].splice(index + 1, 0, newField);\n };\n\n $scope.addOption = function (index, array) {\n array.splice(index + 1, 0, '');\n };\n\n $scope.deleteOption = function (index, array) {\n array.splice(index, 1);\n };\n\n $scope.addMapOption = function (index, array) {\n array.splice(index + 1, 0, {key: '', value: ''});\n };\n\n $scope.deleteMapOption = function (index, array) {\n array.splice(index, 1);\n };\n\n function toQuery() {\n return createConnectorQuery($scope.name, connector.value, $scope.values, $scope.options,\n function (label, error) {\n toastr.error(error, label);\n });\n }\n\n $scope.ok = function () {\n if ($scope.form.$valid) {\n const query = toQuery();\n\n if (query) {\n $modalInstance.close({name: $scope.name, values: $scope.values, options: $scope.options, query: query});\n }\n }\n };\n\n $scope.viewQuery = function () {\n const query = toQuery();\n\n if (query) {\n $modal.open({\n templateUrl: 'pages/viewQuery.html',\n controller: 'ViewQueryCtrl',\n resolve: {\n query: function () {\n return query;\n }\n }\n });\n }\n };\n\n $scope.cancel = function () {\n $modalInstance.dismiss('cancel');\n };\n}\n\nCreateConnectorCtrl.$inject = ['$scope', '$controller', '$http', '$modalInstance', 'connector', '$modal', 'values', 'options'];\n\nfunction CreateConnectorCtrl($scope, $controller, $http, $modalInstance, connector, $modal, values, options) {\n angular.extend(this, $controller('ExtendNewConnectorCtrl', {\n $scope: $scope,\n $modalInstance: $modalInstance,\n connector: connector,\n $modal: $modal\n }));\n $scope.values = values.values;\n $scope.options = options;\n $scope.name = values.name;\n if (!values.skipConversion) {\n $scope.values = mapCreateValuesToUiValues($scope.values, $scope.options);\n }\n $scope.defaultValues = angular.copy($scope.values);\n}\n\n// Note that this is a fancy controller: it's used both for a modal and for a directive.\n// This means you can't rely on custom injection through resolve in the modal and the scope\n// must be shared with the main connectors controller.\nCreateProgressCtrl.$inject = ['$scope', '$interval', '$http', '$repositories'];\n\nfunction CreateProgressCtrl($scope, $interval, $http, $repositories) {\n function evaluateSparqlQuery(query) {\n return _evaluateSparqlQuery($http, $repositories.getActiveRepository(), query);\n }\n\n function initProgress() {\n const query = createStatusQueryForIri($scope.beingBuiltConnector.iri);\n\n // reset iri value so that watch will fire again when we do something with the same connector\n $scope.beingBuiltConnector.iri = null;\n\n $scope.progressInterval = $interval(function () {\n function getFirstStatusFromResult(results) {\n if (results.bindings) {\n if (results.bindings.length > 0) {\n try {\n return JSON.parse(results.bindings[0].status.value);\n } catch (e) {\n console.error(e); // eslint-disable-line no-console\n }\n }\n }\n\n return {};\n }\n\n evaluateSparqlQuery(query)\n .then(function (res) {\n const status = getFirstStatusFromResult(res.data.results);\n if (status.status === 'BUILDING') {\n $scope.beingBuiltConnector.status = status;\n $scope.beingBuiltConnector.percentDone = (100 * status.processedEntities / status.estimatedEntities).toFixed(0);\n $scope.beingBuiltConnector.eta = $scope.getHumanReadableSeconds(status.etaSeconds);\n $scope.beingBuiltConnector.actionName = status.repair ? 'Repairing' : 'Creating';\n $scope.beingBuiltConnector.waitOnRepairStartOnce = false;\n } else if (status.status === 'BUILT' && !$scope.beingBuiltConnector.waitOnRepairStartOnce) {\n // done\n $interval.cancel($scope.progressInterval);\n if ($scope.beingBuiltConnector.doneCallback) {\n $scope.beingBuiltConnector.doneCallback();\n }\n }\n });\n }, 1000);\n\n $scope.$on('$destroy', function () {\n $interval.cancel($scope.progressInterval);\n });\n }\n\n $scope.beingBuiltConnector = $scope.beingBuiltConnector || {};\n\n // for modal instance we get the iri before hand and can start progress now\n if (!$scope.beingBuiltConnector.inline && $scope.beingBuiltConnector.iri) {\n initProgress();\n }\n\n // for inline progress we need to watch for the iri value\n $scope.$watch('beingBuiltConnector.iri', function (value) {\n if ($scope.beingBuiltConnector.inline && value) {\n initProgress();\n }\n });\n}\n\nfunction ceil() {\n return function (input) {\n return Math.ceil(input);\n };\n}\n"],"sourceRoot":""}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
(window.webpackJsonp=window.webpackJsonp||[]).push([[36,104],{31:function(e,n){function t(e){return{showToastMessageWithDelay:function(n){return new Promise(t=>{e.success(n),setTimeout(t,200)})}}}angular.module("graphdb.framework.utils.notifications",[]).factory("Notifications",t),t.$inject=["toastr"]},57:function(e,n,t){"use strict";t.r(n);t(31),t(4);function r(e,n,t,r,o,i,a,u,s,c,d,g,f,l,p,w){e.page=1,e.totalPages=5,e.helpHidden=1===p.get(w.HIDE_GRAPH_CONFIG_HELP),e.toggleHelp=function(n){void 0===n&&(n=p.get(w.HIDE_GRAPH_CONFIG_HELP)),1!==n?(p.set(w.HIDE_GRAPH_CONFIG_HELP,1),e.helpHidden=!0):(p.set(w.HIDE_GRAPH_CONFIG_HELP,0),e.helpHidden=!1)},e.fixedVisualCallback=function(n,t){e.newConfig.startIRI=n,e.newConfig.startIRILabel=t},e.isDefaultGraph=function(e){return"Minimal"===e.name||"Advanced"===e.name},e.isUserGraph=function(n){return!e.isDefaultGraph(n)},e.getSampleName=function(e,n){const t=e[n+"Description"];return t||(e.id?"Copy of "+e.name:e.name)};const y=function(){c.getGraphConfigSamples().success((function(n){e.samples=_.filter(n,(function(n){return!n.id||e.newConfig.id!==n.id||(e.revertConfig=n,!1)}))})).error((function(e){r.error(getError(e),"Could not get graph configs. You may not see sample values")}))},C=g.configName;function m(e){r.warning(e)}function h(n){let t;return"query"===n.startMode&&1===e.page?t=n.startGraphQuery:2===e.page?t=n.expandQuery:3===e.page?t=n.resourceQuery:4===e.page?t=n.predicateLabelQuery:5===e.page&&(t=n.resourcePropertiesQuery),angular.isDefined(t)?t:""}function b(){function i(){e.getAutocompletePromise=d.checkAutocompleteStatus()}y(),e.createGraphConfig=function(){c.createGraphConfig(e.newConfig).success((async function(){await f.showToastMessageWithDelay("Saved new graph config"),t.url("graphs-visualizations")})).error((function(e){r.error(getError(e),"Error! Could not create graph config")}))},e.updateGraphConfig=function(){c.updateGraphConfig(e.newConfig).success((async function(){await f.showToastMessageWithDelay("Graph config saved"),t.url("graphs-visualizations")})).error((function(e){r.error(getError(e),"Error! Could not save graph config")}))},e.$on("autocompleteStatus",(function(){i()})),i(),e.getNamespacesPromise=l.getNamespaces(e.getActiveRepository());const a=function(e,n,t,r,o,i){n?c.validateQuery(n,t,r,o,i).success((function(){e()})).error((function(e){m(getError(e))})):e()};e.validateCurrentPage=function(n){e.updateModel(),1===e.page?"node"!==e.newConfig.startMode||e.newConfig.startIRI?"query"!==e.newConfig.startMode||e.newConfig.startGraphQuery?"query"===e.newConfig.startMode?a(n,e.newConfig.startGraphQuery,"graph"):n():m("Please provide start graph query."):m("Please select start node."):2===e.page?a(n,e.newConfig.expandQuery,"construct",["node"]):3===e.page?a(n,e.newConfig.resourceQuery,"tuple",["node"],[],["type","label","comment","rank"]):4===e.page?a(n,e.newConfig.predicateLabelQuery,"tuple",["edge"],["label"]):5===e.page&&a(n,e.newConfig.resourcePropertiesQuery,"tuple",["node"],["property","value"])},e.goToPage=function(n){e.page!==n&&e.validateCurrentPage((function(){e.showEditor(),e.page=n,e.notoolbar=1!==e.page}))},e.goToPreviousPage=function(){e.page>1&&e.goToPage(e.page-1)},e.goToNextPage=function(){e.goToPage(e.page+1)},e.saveGraphConfig=function(){e.newConfig.startQueryIncludeInferred=e.currentQuery.inference,e.newConfig.startQuerySameAs=e.currentQuery.sameAs,e.validateCurrentPage((function(){e.newConfig.name?e.isUpdate?e.updateGraphConfig(e.newConfig):e.createGraphConfig(e.newConfig):m("Please provide config name.")}))},e.updateModel=function(){const n=window.editor.getValue().trim();"query"===e.newConfig.startMode&&1===e.page?e.newConfig.startGraphQuery=n:2===e.page?e.newConfig.expandQuery=n:3===e.page?e.newConfig.resourceQuery=n:4===e.page?e.newConfig.predicateLabelQuery=n:5===e.page&&(e.newConfig.resourcePropertiesQuery=n)},e.setQuery=function(e){window.editor.setValue(e||" ")},e.updateDirty=function(){if(e.revertConfig){const n=h(e.revertConfig),t=window.editor.getValue().trim();e.queryEditorIsDirty=n!==t}},e.updateEditor=function(){n((function(){e.currentQuery.query=h(e.newConfig),o.isActiveRepoOntopType()&&(e.nocount=!0),e.currentQuery.inference=e.newConfig.startQueryIncludeInferred,e.currentQuery.sameAs=e.newConfig.startQuerySameAs,D(e.currentQuery.id),E(e.currentQuery.id)}),100)},e.showEditor=function(){window.editor&&window.editor.xhr&&window.editor.xhr.abort(),e.viewMode="yasr"},e.showPreview=function(){e.currentQuery.outputType="table",e.runQuery()},e.revertEditor=function(){e.setQuery(h(e.revertConfig))},e.$watch("newConfig.startMode",(function(t){"query"===t&&n((function(){e.updateEditor()}),0)})),e.$watch("page",(function(t){("query"===e.newConfig.startMode||t>1)&&n((function(){e.showEditor(),e.updateEditor()}),0)}))}e.newConfig={startQueryIncludeInferred:!0,startQuerySameAs:!0},e.newConfig.startMode="search",e.isUpdate=!1,e.shared=!1,e.encodeQuery=function(e){return encodeURIComponent(e)},C?(e.isUpdate=!0,c.getConfig(C).success((function(n){e.newConfig=n,b()})).error((function(e){r.error(getError(e),"Could not load config for name "+C)}))):(e.isUpdate=!1,b());const Q={id:"1",name:"",query:"select * where { \n\t?s ?p ?o .\n} limit 100 \n",inference:e.newConfig.startQueryIncludeInferred,sameAs:e.newConfig.startQuerySameAs};e.resetCurrentTabConfig=function(){e.currentTabConfig={pageSize:100,page:1,allResultsCount:0,resultsCount:0}},e.queryExists=!1,e.resetCurrentTabConfig(),e.tabsData=e.tabs=[Q],e.saveTab=function(n){const t=function(n){for(let t=0;t<e.tabsData.length;t++){if(e.tabsData[t].id===n)return t}}(n);if(void 0===t)return{};const r=e.tabsData[t];return e.saveQueryToLocal(r),r},e.loadTab=D,e.addNewTab=function(e,n,t){},e.runQuery=R,e.getNamespaces=q,e.changePagination=function(){R(!0,e.explainRequested)},e.toggleSampleQueries=function(){},e.addKnownPrefixes=P,e.getExistingTabId=x,e.querySelected=function(n){const t=x(n);e.toggleSampleQueries(),angular.isDefined(t)?E(t):e.addNewTab(null,n.name,n.body)},e.saveQueryToLocal=T,e.setLoader=v,e.getLoaderMessage=function(){const n=(Date.now()-e.queryStartTime)/1e3,t=e.getHumanReadableSeconds(n);let r="";r=e.progressMessage?e.progressMessage+"... "+t:"Running operation..."+t;e.extraMessage&&n>10&&(r+="\n"+e.extraMessage);return r},e.fixSizesOnHorizontalViewModeSwitch=M,e.changeViewMode=function(t){e.viewMode="none",e.orientationViewMode=!e.orientationViewMode,M(),$(".dataTables_filter").remove(),$(".resultsTable").remove(),n((function(){D(t),E(t)}),100)},e.showHideEditor=S,e.focusQueryEditor=function(){angular.element(document).find(".editable-input").is(":focus")||angular.element(document).find(".CodeMirror textarea:first-child").focus()},e.orientationViewMode=!0;e.getActiveRepository();function T(e){}function v(n,t,r){const o=angular.element(document.getElementById("yasr-inner"));e.queryIsRunning=n,n?(e.queryStartTime=Date.now(),e.countTimeouted=!1,e.progressMessage=t,e.extraMessage=r,o.addClass("hide")):(e.progressMessage="",e.extraMessage="",o.removeClass("hide")),null===e.$$phase&&e.$apply()}function M(t){function r(){return window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight||0}const o=t;if(e.orientationViewMode){if("yasr"===e.viewMode){let e=r()-document.querySelector(".CodeMirror-wrap").getBoundingClientRect().top;e-=40,document.querySelector(".CodeMirror-wrap").style.height=e+"px"}else e.noPadding={},document.querySelector(".CodeMirror-wrap").style.height="";document.getElementById("yasr").style.minHeight=""}else if(e.noPadding={paddingRight:15,paddingLeft:0},window.editor&&document.querySelector(".CodeMirror-wrap")){let e=r()-document.querySelector(".CodeMirror-wrap").getBoundingClientRect().top;e-=40,document.querySelector(".CodeMirror-wrap").style.height=e+"px",document.getElementById("yasr").style.minHeight=e+"px"}else{let t;t=n(o?function(){e.fixSizesOnHorizontalViewModeSwitch(o)}:e.fixSizesOnHorizontalViewModeSwitch,100),e.$on("$destroy",(function(){n.cancel(t)}))}window.yasr&&window.yasr.container&&n((function(){window.yasr.container.resize()}),100)}function S(){M(!0)}function E(e){n((function(){$('a[data-id = "'+e+'"]').tab("show")}),0)}function R(n,t){e.executedQueryTab=e.currentQuery,t&&"SELECT"!==window.editor.getQueryType()&&"CONSTRUCT"!==window.editor.getQueryType()?r.warning("Explain only works with SELECT or CONSTRUCT queries."):"update"!==window.editor.getQueryMode()?(e.explainRequested=t,e.queryIsRunning||(n?e.currentTabConfig.resultsCount=0:e.resetCurrentTabConfig(),e.viewMode="editor",e.orientationViewMode&&e.fixSizesOnHorizontalViewModeSwitch(),v(!0,"Evaluating query"),window.editor.query())):r.warning("Cannot execute updates from this editor.")}function q(){v(!0,"Refreshing namespaces","Normally this is a fast operation but it may take longer if a bigger repository needs to be initialised first."),l.getRepositoryNamespaces().success((function(n){const t={};n.results.bindings.forEach((function(e){t[e.prefix.value]=e.namespace.value})),e.namespaces=t})).error((function(n){e.repositoryError=getError(n)})).finally((function(){v(!1)}))}function P(){u.addKnownPrefixes(JSON.stringify(window.editor.getValue())).success((function(e){angular.isDefined(window.editor)&&angular.isDefined(e)&&e!==window.editor.getValue()&&window.editor.setValue(e)})).error((function(e){let n=getError(e);return r.error(n,"Error! Could not add known prefixes"),!0}))}function x(n){let t=void 0;return angular.forEach(e.tabsData,(function(e){if(e.name===n.name&&e.query===n.body)return t=e.id,e})),t}e.orientationViewMode||S(),e.getActiveRepository()&&q(),e.$on("$destroy",(function(){window.editor=null,window.yasr=null})),$("textarea").on("paste",(function(){n((function(){P()}),0)})),e.$watchCollection("[currentQuery.inference, currentQuery.sameAs]",(function(){e.currentQuery}));function D(t){e.tabsData=[e.currentQuery];let r=e.currentQuery;null==e.currentQuery.query||""===e.currentQuery.query?window.editor.setValue(" "):window.editor.setValue(e.currentQuery.query),n((function(){e.currentTabConfig={},e.currentTabConfig.queryType=r.queryType,e.currentTabConfig.resultsCount=r.resultsCount,e.currentTabConfig.offset=r.offset,e.currentTabConfig.allResultsCount=r.allResultsCount,e.currentTabConfig.page=r.page,e.currentTabConfig.pageSize=r.pageSize,e.currentTabConfig.timeFinished=r.timeFinished,e.currentTabConfig.timeTook=r.timeTook,e.currentTabConfig.sizeDelta=r.sizeDelta,e.$apply()}),0),$("#yasr").css("padding","0")}function I(e){return $(e).attr("data-id")}e.$on("tabAction",(function(n,t){t.relatedTarget&&e.saveTab(I(t.relatedTarget)),e.loadTab(I(t.target))})),e.$on("deleteAllexeptSelected",(function(n,t){e.tabsData=t,e.tabs=t})),e.currentQuery=angular.copy(Q),e.showSampleQueries=!1,e.savedQuery={},e.sampleQueries={},e.getResultsDescription=function(){},e.getUpdateDescription=function(){},e.getStaleWarningMessage=function(){}}angular.module("graphdb.framework.graphexplore.controllers.graphviz.config",["graphdb.framework.utils.notifications","graphdb.framework.utils.localstorageadapter"]).controller("GraphConfigCtrl",r),r.$inject=["$scope","$timeout","$location","toastr","$repositories","$modal","ModalService","SparqlRestService","$filter","GraphConfigRestService","AutocompleteRestService","$routeParams","Notifications","RDF4JRepositoriesRestService","LocalStorageAdapter","LSKeys"]}}]);
|
|
2
|
-
//# sourceMappingURL=36.466f06017a4f9d2277fb.bundle.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["webpack:///./src/js/angular/utils/notifications.js","webpack:///./src/js/angular/graphexplore/controllers/graphs-config.controller.js"],"names":["Notifications","toastr","showToastMessageWithDelay","message","Promise","r","success","setTimeout","angular","module","factory","$inject","GraphConfigCtrl","$scope","$timeout","$location","$repositories","$modal","ModalService","SparqlRestService","$filter","GraphConfigRestService","AutocompleteRestService","$routeParams","RDF4JRepositoriesRestService","LocalStorageAdapter","LSKeys","page","totalPages","helpHidden","get","HIDE_GRAPH_CONFIG_HELP","toggleHelp","value","undefined","set","fixedVisualCallback","uri","label","newConfig","startIRI","startIRILabel","isDefaultGraph","sample","name","isUserGraph","getSampleName","property","extra","id","getGraphConfigSamples","data","samples","_","filter","s","revertConfig","error","getError","configName","showInvalidMsg","warning","getQueryForCurrentPage","config","query","startMode","startGraphQuery","expandQuery","resourceQuery","predicateLabelQuery","resourcePropertiesQuery","isDefined","initForConfig","checkAutocompleteStatus","getAutocompletePromise","createGraphConfig","async","url","updateGraphConfig","$on","getNamespacesPromise","getNamespaces","getActiveRepository","validateQueryWithCallback","successCallback","queryType","params","all","oneOf","validateQuery","validateCurrentPage","updateModel","goToPage","nextPage","showEditor","notoolbar","goToPreviousPage","goToNextPage","saveGraphConfig","startQueryIncludeInferred","currentQuery","inference","startQuerySameAs","sameAs","isUpdate","window","editor","getValue","trim","setQuery","setValue","updateDirty","q1","q2","queryEditorIsDirty","updateEditor","isActiveRepoOntopType","nocount","loadTab","selectTab","xhr","abort","viewMode","showPreview","outputType","runQuery","revertEditor","$watch","shared","encodeQuery","encodeURIComponent","getConfig","defaultTabConfig","resetCurrentTabConfig","currentTabConfig","pageSize","allResultsCount","resultsCount","queryExists","tabsData","tabs","saveTab","idx","i","length","findTabIndexByID","tab","saveQueryToLocal","addNewTab","callback","tabName","savedQuery","changePagination","explainRequested","toggleSampleQueries","addKnownPrefixes","getExistingTabId","querySelected","tabId","body","setLoader","getLoaderMessage","timeSeconds","Date","now","queryStartTime","timeHuman","getHumanReadableSeconds","progressMessage","extraMessage","fixSizesOnHorizontalViewModeSwitch","changeViewMode","tabID","orientationViewMode","$","remove","showHideEditor","focusQueryEditor","element","document","find","is","focus","currentQueryTab","isRunning","yasrInnerContainer","getElementById","queryIsRunning","countTimeouted","addClass","removeClass","$$phase","$apply","verticalViewParam","visibleWindowHeight","innerHeight","documentElement","clientHeight","verticalView","newHeight","querySelector","getBoundingClientRect","style","height","noPadding","minHeight","paddingRight","paddingLeft","timer","cancel","yasr","container","resize","changePage","explain","executedQueryTab","getQueryType","getQueryMode","getRepositoryNamespaces","usedPrefixes","results","bindings","forEach","e","prefix","namespace","namespaces","repositoryError","finally","JSON","stringify","msg","existingTabId","item","on","$watchCollection","offset","timeFinished","timeTook","sizeDelta","css","getQueryID","attr","tabEvent","relatedTarget","target","copy","showSampleQueries","sampleQueries","getResultsDescription","getUpdateDescription","getStaleWarningMessage","controller"],"mappings":"+E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,EAAOyH,iBAAiByG,UAAY7F,EAAI6F,UACxClO,EAAOmL,WACR,GAGHlB,EAAE,SAASkE,IAAI,UAAW,KAG9B,SAASC,EAAW/D,GAChB,OAAOJ,EAAEI,GAASgE,KAAK,WAG3BrO,EAAOkE,IAAI,aAAa,SAAUgJ,EAAGoB,GAC7BA,EAASC,eACTvO,EAAOgI,QAAQoG,EAAWE,EAASC,gBAEvCvO,EAAOyG,QAAQ2H,EAAWE,EAASE,YAGvCxO,EAAOkE,IAAI,0BAA0B,SAAUgJ,EAAGnF,GAC9C/H,EAAO8H,SAAWC,EAClB/H,EAAO+H,KAAOA,KAIlB/H,EAAOuF,aAAe5F,QAAQ8O,KAAKlH,GAEnCvH,EAAO0O,mBAAoB,EAC3B1O,EAAO0I,WAAa,GACpB1I,EAAO2O,cAAgB,GAEvB3O,EAAO4O,sBAAwB,aAG/B5O,EAAO6O,qBAAuB,aAG9B7O,EAAO8O,uBAAyB,aAtrBpCnP,QACKC,OAAO,6DAA8D,CAClE,wCACA,gDAEHmP,WAAW,kBAAmBhP,GAEnCA,EAAgBD,QAAU,CAAC,SAAU,WAAY,YAAa,SAAU,gBAAiB,SAAU,eAAgB,oBAAqB,UAAW,yBAA0B,0BAA2B,eAAgB,gBAAiB,+BAAgC,sBAAuB","file":"36.466f06017a4f9d2277fb.bundle.js","sourcesContent":["angular\n .module('graphdb.framework.utils.notifications', [])\n .factory('Notifications', Notifications);\n\nNotifications.$inject = ['toastr'];\n\nfunction Notifications(toastr) {\n return {\n showToastMessageWithDelay\n };\n\n /**\n * This method will show message with tiny delay and only after completion\n * of latter redirection to \"graphs-visualizations\" page will happen.\n * @param {string} message The message to be displayed.\n * @return {Promise<any>}\n */\n function showToastMessageWithDelay(message) {\n return new Promise((r) => {\n toastr.success(message);\n setTimeout(r, 200);\n });\n }\n}\n","import 'angular/utils/notifications';\nimport 'angular/utils/local-storage-adapter';\n\nangular\n .module('graphdb.framework.graphexplore.controllers.graphviz.config', [\n 'graphdb.framework.utils.notifications',\n 'graphdb.framework.utils.localstorageadapter'\n ])\n .controller('GraphConfigCtrl', GraphConfigCtrl);\n\nGraphConfigCtrl.$inject = ['$scope', '$timeout', '$location', 'toastr', '$repositories', '$modal', 'ModalService', 'SparqlRestService', '$filter', 'GraphConfigRestService', 'AutocompleteRestService', '$routeParams', 'Notifications', 'RDF4JRepositoriesRestService', 'LocalStorageAdapter', 'LSKeys'];\n\nfunction GraphConfigCtrl($scope, $timeout, $location, toastr, $repositories, $modal, ModalService, SparqlRestService, $filter, GraphConfigRestService, AutocompleteRestService, $routeParams, Notifications, RDF4JRepositoriesRestService, LocalStorageAdapter, LSKeys) {\n\n $scope.page = 1;\n $scope.totalPages = 5;\n\n $scope.helpHidden = LocalStorageAdapter.get(LSKeys.HIDE_GRAPH_CONFIG_HELP) === 1;\n\n $scope.toggleHelp = function (value) {\n if (value === undefined) {\n value = LocalStorageAdapter.get(LSKeys.HIDE_GRAPH_CONFIG_HELP);\n }\n if (value !== 1) {\n LocalStorageAdapter.set(LSKeys.HIDE_GRAPH_CONFIG_HELP, 1);\n $scope.helpHidden = true;\n } else {\n LocalStorageAdapter.set(LSKeys.HIDE_GRAPH_CONFIG_HELP, 0);\n $scope.helpHidden = false;\n }\n };\n\n $scope.fixedVisualCallback = function (uri, label) {\n $scope.newConfig.startIRI = uri;\n $scope.newConfig.startIRILabel = label;\n };\n\n $scope.isDefaultGraph = function (sample) {\n return (sample.name === 'Minimal' || sample.name === 'Advanced');\n };\n\n $scope.isUserGraph = function (sample) {\n return !$scope.isDefaultGraph(sample);\n };\n\n $scope.getSampleName = function (sample, property) {\n const extra = sample[property + 'Description'];\n if (extra) {\n // Sample has description, use it\n return extra;\n } else {\n // Sample is a copy of existing config, prepend Copy of to name\n return sample.id ? 'Copy of ' + sample.name : sample.name;\n }\n };\n\n const getGraphConfigSamples = function () {\n GraphConfigRestService.getGraphConfigSamples()\n .success(function (data) {\n $scope.samples = _.filter(data, function (s) {\n // Skip the currently edited config from samples and store it into a revert variable\n if (!s.id || $scope.newConfig.id !== s.id) {\n return true;\n } else {\n $scope.revertConfig = s;\n return false;\n }\n });\n }).error(function (data) {\n toastr.error(getError(data), 'Could not get graph configs. You may not see sample values');\n });\n };\n\n const configName = $routeParams.configName;\n $scope.newConfig = {startQueryIncludeInferred: true, startQuerySameAs: true};\n $scope.newConfig.startMode = 'search';\n $scope.isUpdate = false;\n $scope.shared = false;\n\n $scope.encodeQuery = function (query) {\n return encodeURIComponent(query);\n };\n\n function showInvalidMsg(message) {\n toastr.warning(message);\n }\n\n if (configName) {\n $scope.isUpdate = true;\n GraphConfigRestService.getConfig(configName)\n .success(function (data) {\n $scope.newConfig = data;\n initForConfig();\n })\n .error(function (data) {\n toastr.error(getError(data), 'Could not load config for name ' + configName);\n });\n } else {\n $scope.isUpdate = false;\n initForConfig();\n }\n\n function getQueryForCurrentPage(config) {\n let query;\n\n if (config.startMode === 'query' && $scope.page === 1) {\n query = config.startGraphQuery;\n } else if ($scope.page === 2) {\n query = config.expandQuery;\n } else if ($scope.page === 3) {\n query = config.resourceQuery;\n } else if ($scope.page === 4) {\n query = config.predicateLabelQuery;\n } else if ($scope.page === 5) {\n query = config.resourcePropertiesQuery;\n }\n\n return angular.isDefined(query) ? query : '';\n }\n\n function initForConfig() {\n getGraphConfigSamples();\n $scope.createGraphConfig = function () {\n GraphConfigRestService.createGraphConfig($scope.newConfig)\n .success(async function () {\n await Notifications.showToastMessageWithDelay('Saved new graph config');\n $location.url('graphs-visualizations');\n }).error(function (data) {\n toastr.error(getError(data), 'Error! Could not create graph config');\n });\n };\n\n $scope.updateGraphConfig = function () {\n GraphConfigRestService.updateGraphConfig($scope.newConfig)\n .success(async function () {\n await Notifications.showToastMessageWithDelay('Graph config saved');\n $location.url('graphs-visualizations');\n }).error(function (data) {\n toastr.error(getError(data), 'Error! Could not save graph config');\n });\n };\n\n function checkAutocompleteStatus() {\n $scope.getAutocompletePromise = AutocompleteRestService.checkAutocompleteStatus();\n }\n\n $scope.$on('autocompleteStatus', function() {\n checkAutocompleteStatus();\n });\n\n checkAutocompleteStatus();\n $scope.getNamespacesPromise = RDF4JRepositoriesRestService.getNamespaces($scope.getActiveRepository());\n\n const validateQueryWithCallback = function (successCallback, query, queryType, params, all, oneOf) {\n if (!query) {\n successCallback();\n } else {\n GraphConfigRestService.validateQuery(query, queryType, params, all, oneOf)\n .success(function () {\n successCallback();\n }).error(function (data) {\n showInvalidMsg(getError(data));\n });\n }\n };\n\n $scope.validateCurrentPage = function (successCallback) {\n $scope.updateModel();\n\n if ($scope.page === 1) {\n if ($scope.newConfig.startMode === 'node' && !$scope.newConfig.startIRI) {\n showInvalidMsg('Please select start node.');\n } else if ($scope.newConfig.startMode === 'query' && !$scope.newConfig.startGraphQuery) {\n showInvalidMsg('Please provide start graph query.');\n } else if ($scope.newConfig.startMode === 'query') {\n validateQueryWithCallback(successCallback, $scope.newConfig.startGraphQuery, 'graph')\n } else {\n successCallback();\n }\n } else if ($scope.page === 2) {\n validateQueryWithCallback(successCallback, $scope.newConfig.expandQuery, 'construct', ['node'])\n } else if ($scope.page === 3) {\n validateQueryWithCallback(successCallback, $scope.newConfig.resourceQuery, 'tuple', ['node'], [], ['type', 'label', 'comment', 'rank']);\n } else if ($scope.page === 4) {\n validateQueryWithCallback(successCallback, $scope.newConfig.predicateLabelQuery, 'tuple', ['edge'], ['label']);\n } else if ($scope.page === 5) {\n validateQueryWithCallback(successCallback, $scope.newConfig.resourcePropertiesQuery, 'tuple', ['node'], ['property', 'value']);\n }\n };\n\n $scope.goToPage = function (nextPage) {\n if ($scope.page === nextPage) {\n // already there\n return;\n }\n\n $scope.validateCurrentPage(function () {\n $scope.showEditor();\n $scope.page = nextPage;\n $scope.notoolbar = $scope.page !== 1;\n });\n };\n\n $scope.goToPreviousPage = function () {\n if ($scope.page > 1) {\n $scope.goToPage($scope.page - 1);\n }\n };\n\n $scope.goToNextPage = function () {\n $scope.goToPage($scope.page + 1);\n };\n\n $scope.saveGraphConfig = function () {\n $scope.newConfig.startQueryIncludeInferred = $scope.currentQuery.inference;\n $scope.newConfig.startQuerySameAs = $scope.currentQuery.sameAs;\n\n $scope.validateCurrentPage(function () {\n if (!$scope.newConfig.name) {\n showInvalidMsg('Please provide config name.');\n return;\n }\n $scope.isUpdate ? $scope.updateGraphConfig($scope.newConfig) : $scope.createGraphConfig($scope.newConfig);\n });\n };\n\n $scope.updateModel = function () {\n const query = window.editor.getValue().trim();\n if ($scope.newConfig.startMode === 'query' && $scope.page === 1) {\n $scope.newConfig.startGraphQuery = query;\n } else if ($scope.page === 2) {\n $scope.newConfig.expandQuery = query;\n } else if ($scope.page === 3) {\n $scope.newConfig.resourceQuery = query;\n } else if ($scope.page === 4) {\n $scope.newConfig.predicateLabelQuery = query;\n } else if ($scope.page === 5) {\n $scope.newConfig.resourcePropertiesQuery = query;\n }\n };\n\n // Called when user clicks on a sample query\n $scope.setQuery = function (query) {\n // Hack for YASQE bug\n window.editor.setValue(query ? query : ' ');\n };\n\n $scope.updateDirty = function () {\n if ($scope.revertConfig) {\n const q1 = getQueryForCurrentPage($scope.revertConfig);\n const q2 = window.editor.getValue().trim();\n $scope.queryEditorIsDirty = q1 !== q2;\n }\n };\n\n // Updates the position of the query editor to match the current div placeholder\n // and sets the editor's query to the relevant query from the model.\n $scope.updateEditor = function () {\n $timeout(function () {\n $scope.currentQuery.query = getQueryForCurrentPage($scope.newConfig);\n // // Check for ontop repository and override nocount property (it's default value is false)\n if ($repositories.isActiveRepoOntopType()) {\n $scope.nocount = true;\n }\n $scope.currentQuery.inference = $scope.newConfig.startQueryIncludeInferred;\n $scope.currentQuery.sameAs = $scope.newConfig.startQuerySameAs;\n loadTab($scope.currentQuery.id);\n selectTab($scope.currentQuery.id);\n }, 100);\n\n };\n\n $scope.showEditor = function () {\n if (window.editor && window.editor.xhr) {\n window.editor.xhr.abort();\n }\n $scope.viewMode = 'yasr';\n };\n\n $scope.showPreview = function () {\n // For some reason YASR gets confused and sets this to rawResponse\n // if we execute a CONSTRUCT and then a SELECT. This makes sure it's always table.\n $scope.currentQuery.outputType = 'table';\n $scope.runQuery();\n };\n\n $scope.revertEditor = function () {\n $scope.setQuery(getQueryForCurrentPage($scope.revertConfig));\n };\n\n // Trigger for showing the editor and moving it to the right position\n $scope.$watch('newConfig.startMode', function (value) {\n if (value === 'query') {\n $timeout(function () {\n $scope.updateEditor();\n }, 0);\n }\n });\n\n // Trigger for showing the editor and moving it to the right position\n $scope.$watch('page', function (value) {\n if ($scope.newConfig.startMode === 'query' || value > 1) {\n $timeout(function () {\n $scope.showEditor();\n $scope.updateEditor();\n }, 0);\n }\n });\n }\n\n // DOWN HERE WE KEEP EVERYTHING PURELY QUERY EDITOR (MOSTLY BORROWED FROM query-editor.controller.js)\n // But Why? Can't we reuse it instead of borrow?\n\n const defaultTabConfig = {\n id: '1',\n name: '',\n query: 'select * where { \\n' +\n '\\t?s ?p ?o .\\n' +\n '} limit 100 \\n',\n inference: $scope.newConfig.startQueryIncludeInferred,\n sameAs: $scope.newConfig.startQuerySameAs\n };\n\n $scope.resetCurrentTabConfig = function () {\n $scope.currentTabConfig = {\n pageSize: 100, // page limit 100 as this is only used for preview\n page: 1,\n allResultsCount: 0,\n resultsCount: 0\n };\n };\n\n $scope.queryExists = false;\n\n $scope.resetCurrentTabConfig();\n\n $scope.tabsData = $scope.tabs = [defaultTabConfig];\n\n // query tab operations\n $scope.saveTab = saveTab;\n $scope.loadTab = loadTab;\n $scope.addNewTab = addNewTab;\n\n // query operations\n $scope.runQuery = runQuery;\n $scope.getNamespaces = getNamespaces;\n $scope.changePagination = changePagination;\n $scope.toggleSampleQueries = toggleSampleQueries;\n $scope.addKnownPrefixes = addKnownPrefixes;\n $scope.getExistingTabId = getExistingTabId;\n $scope.querySelected = querySelected;\n $scope.saveQueryToLocal = saveQueryToLocal;\n\n $scope.setLoader = setLoader;\n $scope.getLoaderMessage = getLoaderMessage;\n\n // query editor and results orientation\n $scope.fixSizesOnHorizontalViewModeSwitch = fixSizesOnHorizontalViewModeSwitch;\n $scope.changeViewMode = changeViewMode;\n $scope.showHideEditor = showHideEditor;\n $scope.focusQueryEditor = focusQueryEditor;\n $scope.orientationViewMode = true;\n\n // start of repository actions\n let backendRepositoryID = $scope.getActiveRepository();\n\n function saveQueryToLocal(currentQueryTab) {\n }\n\n function setLoader(isRunning, progressMessage, extraMessage) {\n const yasrInnerContainer = angular.element(document.getElementById('yasr-inner'));\n $scope.queryIsRunning = isRunning;\n if (isRunning) {\n $scope.queryStartTime = Date.now();\n $scope.countTimeouted = false;\n $scope.progressMessage = progressMessage;\n $scope.extraMessage = extraMessage;\n yasrInnerContainer.addClass('hide');\n } else {\n $scope.progressMessage = '';\n $scope.extraMessage = '';\n yasrInnerContainer.removeClass('hide');\n }\n // We might call this from angular or outside angular so take care of applying the scope.\n if ($scope.$$phase === null) {\n $scope.$apply();\n }\n }\n\n function getLoaderMessage() {\n const timeSeconds = (Date.now() - $scope.queryStartTime) / 1000;\n const timeHuman = $scope.getHumanReadableSeconds(timeSeconds);\n let message = '';\n\n if ($scope.progressMessage) {\n message = $scope.progressMessage + '... ' + timeHuman;\n } else {\n message = 'Running operation...' + timeHuman;\n }\n if ($scope.extraMessage && timeSeconds > 10) {\n message += '\\n' + $scope.extraMessage;\n }\n\n return message;\n }\n\n\n // start of query editor results orientation operations\n function fixSizesOnHorizontalViewModeSwitch(verticalViewParam) {\n function visibleWindowHeight() {\n return window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight || 0;\n }\n\n const codemirrorWrapperSelector = '.CodeMirror-wrap';\n const verticalView = verticalViewParam;\n if (!$scope.orientationViewMode) {\n $scope.noPadding = {paddingRight: 15, paddingLeft: 0};\n\n // window.editor is undefined if no repo is selected\n if (window.editor && document.querySelector(codemirrorWrapperSelector)) {\n let newHeight = visibleWindowHeight() - (document.querySelector(codemirrorWrapperSelector).getBoundingClientRect().top);\n newHeight -= 40;\n document.querySelector(codemirrorWrapperSelector).style.height = newHeight + 'px';\n document.getElementById('yasr').style.minHeight = newHeight + 'px';\n } else {\n let timer;\n if (verticalView) {\n timer = $timeout(function () {\n $scope.fixSizesOnHorizontalViewModeSwitch(verticalView)\n }, 100);\n } else {\n timer = $timeout($scope.fixSizesOnHorizontalViewModeSwitch, 100);\n }\n\n $scope.$on('$destroy', function () {\n $timeout.cancel(timer);\n });\n }\n } else {\n if ($scope.viewMode === 'yasr') {\n let newHeight = visibleWindowHeight() - (document.querySelector(codemirrorWrapperSelector).getBoundingClientRect().top);\n newHeight -= 40;\n document.querySelector(codemirrorWrapperSelector).style.height = newHeight + 'px';\n } else {\n $scope.noPadding = {};\n document.querySelector(codemirrorWrapperSelector).style.height = '';\n }\n document.getElementById('yasr').style.minHeight = '';\n }\n if (window.yasr && window.yasr.container) {\n $timeout(function () {\n window.yasr.container.resize();\n }, 100);\n }\n }\n\n if (!$scope.orientationViewMode) {\n showHideEditor();\n }\n\n function changeViewMode(tabID) {\n $scope.viewMode = 'none';\n $scope.orientationViewMode = !$scope.orientationViewMode;\n fixSizesOnHorizontalViewModeSwitch();\n $('.dataTables_filter').remove();\n $('.resultsTable').remove();\n $timeout(function () {\n loadTab(tabID);\n selectTab(tabID);\n }, 100);\n }\n\n function showHideEditor() {\n fixSizesOnHorizontalViewModeSwitch(true);\n }\n\n function focusQueryEditor() {\n if (!angular.element(document).find('.editable-input').is(':focus')) {\n angular.element(document).find('.CodeMirror textarea:first-child').focus();\n }\n }\n\n // end of query editor results orientation operations\n\n function deleteCachedSparqlResults() {\n }\n\n function selectTab(id) {\n $timeout(function () {\n $('a[data-id = \"' + id + '\"]').tab('show');\n }, 0);\n }\n\n // start of query operations\n function runQuery(changePage, explain) {\n $scope.executedQueryTab = $scope.currentQuery;\n if (explain && !(window.editor.getQueryType() === 'SELECT' || window.editor.getQueryType() === 'CONSTRUCT')) {\n toastr.warning('Explain only works with SELECT or CONSTRUCT queries.');\n return;\n }\n\n if (window.editor.getQueryMode() === 'update') {\n toastr.warning('Cannot execute updates from this editor.');\n return;\n }\n\n $scope.explainRequested = explain;\n if (!$scope.queryIsRunning) {\n if (changePage) {\n $scope.currentTabConfig.resultsCount = 0;\n } else {\n $scope.resetCurrentTabConfig();\n }\n\n // Hides the editor and shows the yasr results\n $scope.viewMode = 'editor';\n if ($scope.orientationViewMode) {\n $scope.fixSizesOnHorizontalViewModeSwitch()\n }\n\n setLoader(true, 'Evaluating query');\n window.editor.query();\n }\n }\n\n function getNamespaces() {\n // Signals the namespaces are to be fetched => loader will be shown\n setLoader(true, 'Refreshing namespaces', 'Normally this is a fast operation but it may take longer if a bigger repository needs to be initialised first.');\n RDF4JRepositoriesRestService.getRepositoryNamespaces()\n .success(function (data) {\n const usedPrefixes = {};\n data.results.bindings.forEach(function (e) {\n usedPrefixes[e.prefix.value] = e.namespace.value;\n });\n $scope.namespaces = usedPrefixes;\n })\n .error(function (data) {\n $scope.repositoryError = getError(data);\n })\n .finally(function () {\n // Signals namespaces were fetched => loader will be hidden\n setLoader(false);\n });\n }\n\n function changePagination() {\n runQuery(true, $scope.explainRequested);\n }\n\n if ($scope.getActiveRepository()) {\n getNamespaces();\n }\n\n $scope.$on('$destroy', function () {\n window.editor = null;\n window.yasr = null;\n });\n\n function toggleSampleQueries() {\n }\n\n // Add known prefixes\n function addKnownPrefixes() {\n SparqlRestService.addKnownPrefixes(JSON.stringify(window.editor.getValue()))\n .success(function (data) {\n if (angular.isDefined(window.editor) && angular.isDefined(data) && data !== window.editor.getValue()) {\n window.editor.setValue(data);\n }\n })\n .error(function (data) {\n let msg = getError(data);\n toastr.error(msg, 'Error! Could not add known prefixes');\n return true;\n });\n }\n\n $('textarea').on('paste', function () {\n $timeout(function () {\n addKnownPrefixes();\n }, 0);\n });\n\n function querySelected(query) {\n const tabId = getExistingTabId(query);\n $scope.toggleSampleQueries();\n if (!angular.isDefined(tabId)) {\n $scope.addNewTab(null, query.name, query.body);\n } else {\n selectTab(tabId);\n }\n }\n\n function getExistingTabId(query) {\n let existingTabId = undefined;\n angular.forEach($scope.tabsData, function (item) {\n if (item.name === query.name && item.query === query.body) {\n existingTabId = item.id;\n return item;\n }\n });\n\n return existingTabId;\n }\n\n // end of query operations\n\n // start of query tab operations\n function findTabIndexByID(id) {\n for (let i = 0; i < $scope.tabsData.length; i++) {\n const tab = $scope.tabsData[i];\n if (tab.id === id) {\n return i;\n }\n }\n }\n\n $scope.$watchCollection('[currentQuery.inference, currentQuery.sameAs]', function () {\n saveQueryToLocal($scope.currentQuery);\n });\n\n function saveTab(id) {\n const idx = findTabIndexByID(id);\n // Tab was deleted, don't try to save it's state\n if (idx === undefined) {\n return {};\n }\n const tab = $scope.tabsData[idx];\n $scope.saveQueryToLocal(tab);\n return tab;\n }\n\n let maxID = 1;\n\n function addNewTab(callback, tabName, savedQuery) {\n }\n\n function loadTab(id) {\n $scope.tabsData = [$scope.currentQuery];\n\n let tab = $scope.currentQuery;\n\n if ($scope.currentQuery.query == null || $scope.currentQuery.query === '') {\n // hack for YASQE bug\n window.editor.setValue(' ');\n } else {\n window.editor.setValue($scope.currentQuery.query);\n }\n\n $timeout(function () {\n $scope.currentTabConfig = {};\n $scope.currentTabConfig.queryType = tab.queryType;\n $scope.currentTabConfig.resultsCount = tab.resultsCount;\n\n $scope.currentTabConfig.offset = tab.offset;\n $scope.currentTabConfig.allResultsCount = tab.allResultsCount;\n $scope.currentTabConfig.page = tab.page;\n $scope.currentTabConfig.pageSize = tab.pageSize;\n\n $scope.currentTabConfig.timeFinished = tab.timeFinished;\n $scope.currentTabConfig.timeTook = tab.timeTook;\n $scope.currentTabConfig.sizeDelta = tab.sizeDelta;\n $scope.$apply();\n }, 0);\n\n //Remove padding of yasr so it will be aligned with sparql editor\n $('#yasr').css('padding', '0');\n }\n\n function getQueryID(element) {\n return $(element).attr('data-id');\n }\n\n $scope.$on('tabAction', function (e, tabEvent) {\n if (tabEvent.relatedTarget) {\n $scope.saveTab(getQueryID(tabEvent.relatedTarget));\n }\n $scope.loadTab(getQueryID(tabEvent.target));\n });\n\n $scope.$on('deleteAllexeptSelected', function (e, tabs) {\n $scope.tabsData = tabs;\n $scope.tabs = tabs;\n });\n // end of query tab operations\n\n $scope.currentQuery = angular.copy(defaultTabConfig);\n // $scope.state = {};\n $scope.showSampleQueries = false;\n $scope.savedQuery = {};\n $scope.sampleQueries = {};\n\n $scope.getResultsDescription = function () {\n };\n\n $scope.getUpdateDescription = function () {\n };\n\n $scope.getStaleWarningMessage = function () {\n }\n\n}\n"],"sourceRoot":""}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
(window.webpackJsonp=window.webpackJsonp||[]).push([[48],{33:function(e,t,n){"use strict";n.r(t);n(4),n(12);function r(e,t,n,r,o,i,a,s,u,c,l,d,g,f){const p={id:"1",name:"",query:"select * where { \n\t?s ?p ?o .\n} limit 100 \n",inference:!0,sameAs:!0};let y,m=c.getPrincipal();function h(e,t){p.inference=t.appSettings.DEFAULT_INFERENCE,p.sameAs=t.appSettings.DEFAULT_SAMEAS,e.skipCountQuery=!t.appSettings.EXECUTE_COUNT,e.ignoreSharedQueries=t.appSettings.IGNORE_SHARED_QUERIES,e.tabsData=e.tabs=g.get(f.TABS_STATE)||[p],e.$watchCollection("[currentQuery.inference, currentQuery.sameAs]",(function(e,t,n){T(n.currentQuery)})),e.$on("repositoryIsSet",S)}function T(t){e.tabs.forEach((function(n,r){n.id===t.id&&(e.tabs[r].query=t.query,e.tabs[r].inference=t.inference,e.tabs[r].sameAs=t.sameAs)})),g.set(f.TABS_STATE,e.tabs)}function w(t,n,r,o){const i=angular.element(document.getElementById("yasr-inner"));e.queryIsRunning=t,t?(e.queryStartTime=Date.now(),e.countTimeouted=!1,e.progressMessage=n,e.extraMessage=r,e.noLoaderTimer=o,i.addClass("hide")):(e.progressMessage="",e.extraMessage="",e.noLoaderTimer=!1,e.currentTrackAlias=null,e.abortRequested=!1,i.removeClass("hide")),null===e.$$phase&&e.$apply()}function b(n){function r(){return window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight||0}if(e.orientationViewMode){if("yasr"===e.viewMode){let e=r()-document.querySelector(".CodeMirror-wrap").getBoundingClientRect().top;e-=40,document.querySelector(".CodeMirror-wrap").style.height=e+"px"}else e.noPadding={},document.querySelector(".CodeMirror-wrap").style.height="";document.getElementById("yasr").style.minHeight=""}else if(e.noPadding={paddingRight:15,paddingLeft:0},window.editor&&document.querySelector(".CodeMirror-wrap")){let e=r()-document.querySelector(".CodeMirror-wrap").getBoundingClientRect().top;e-=40,document.querySelector(".CodeMirror-wrap").style.height=e+"px",document.getElementById("yasr").style.minHeight=e+"px"}else{let r;r=t(n?function(){e.fixSizesOnHorizontalViewModeSwitch(n)}:e.fixSizesOnHorizontalViewModeSwitch,100),e.$on("$destroy",(function(){t.cancel(r)}))}window.yasr&&window.yasr.container&&t((function(){window.yasr.container.resize()}),100)}function C(){b(!0)}function S(t,n){n.newRepo&&(e.tabsData=g.get(f.TABS_STATE),e.tabsData.forEach((function(e){e.yasrData=void 0,e.queryType=void 0,e.resultsCount=0,e.allResultsCount=0,e.sizeDelta=void 0})),g.set(f.TABS_STATE,e.tabsData),e.tabs=e.tabsData,e.currentQuery={},e.errorMessage=null,e.repositoryError=null)}function E(e){t((function(){$('a[data-id = "'+e+'"]').tab("show")}),0)}function v(o,i){if(e.executedQueryTab=e.currentQuery,i){if("SELECT"!==window.editor.getQueryType()&&"CONSTRUCT"!==window.editor.getQueryType())return void n.warning("Explain only works with SELECT or CONSTRUCT queries.");if(r.isActiveRepoOntopType())return void n.warning("Explain not supported for Virtual repositories.")}if(e.explainRequested=i,!e.queryIsRunning){if(o?e.currentTabConfig.resultsCount=0:e.resetCurrentTabConfig(),e.lastRunQueryMode=window.editor.getQueryMode(),"update"===e.lastRunQueryMode&&r.isActiveRepoOntopType())return void n.warning("Updates are not supported for Virtual repositories.");if(w(!0,"update"===e.lastRunQueryMode?"Executing update":"Evaluating query"),"none"!==e.viewMode){e.viewMode="none",e.orientationViewMode&&e.fixSizesOnHorizontalViewModeSwitch();const n=t(window.editor.query,500);e.$on("$destroy",(function(){t.cancel(n)}))}else window.editor.query()}}function Q(){e.showSampleQueries=!e.showSampleQueries,e.showSampleQueries?a.getSavedQueries().success((function(t){e.sampleQueries=t,$("#sampleQueriesCollapse").collapse("show").width("300px")})).error((function(e){const t=getError(e);n.error(t,"Error! Could not get saved queries")})):$("#sampleQueriesCollapse").collapse("hide")}function M(t){let n=void 0;return e.tabsData.forEach((function(e){if(e.name===t.name&&e.query===t.body)return n=e.id,e})),n}function A(t){return function(n,r,o){e.savedQuery={name:n,query:r||window.editor.getValue(),shared:o},$(t).modal("show")}}function q(t){for(let n=0;n<e.tabsData.length;n++){if(e.tabsData[n].id===t)return n}}m?h(e,m):e.$on("securityInit",(function(e){m=c.getPrincipal(),h(e.currentScope,m)})),this.hint=document.createElement("span"),this.hint.innerHTML='Hint: "abC" matches "abC*", "ab c*" and "ab-c*"',this.hint.style.fontSize="12px",this.hint.style.color="gray",this.hint.style.backgroundColor="white",this.hint.style.position="absolute",this.hint.style.zIndex="3",this.hint.style.paddingLeft="12px",e.$watch((function(){return angular.element(".CodeMirror-hints").length}),e=>{if(e){const e=angular.element(".CodeMirror-hints")[0].getBoundingClientRect();document.body.appendChild(this.hint),this.hint.style.top=e.top-20+"px",this.hint.style.left=e.right-this.hint.offsetWidth-12+"px"}else this.hint&&this.hint.parentNode&&this.hint.parentNode.removeChild(this.hint)}),e.resetCurrentTabConfig=function(){e.currentTabConfig={pageSize:1e3,page:1,allResultsCount:0,resultsCount:0}},e.queryExists=!1,e.resetCurrentTabConfig(),e.saveTab=function(t){const n=q(t);if(void 0===n)return{};const r=e.tabsData[n];return e.saveQueryToLocal(r),r},e.loadTab=function(n){e.tabsData=g.get(f.TABS_STATE)||[p];const o=q(n),i=e.tabsData[o];i.yasrData&&w(!0,"Rendering results",null,!0);t((function(){""===e.currentQuery.query&&(e.currentQuery.query=" "),t((function(){window.editor.setValue(e.currentQuery.query),e.yasr.updateDownloadDropdown(),e.$broadcast("tabLoaded",e.currentQuery.id),e.yasr.options.output=i.outputType,i.yasrData&&(i.yasrData.customError?(e.yasr.results={getException:function(){return i.yasrData.customError}},w(!1)):t((function(){e.setYasrResponse(i.yasrData,i.textStatus,i.jqXhrOrErrorString),w(!1),$(".yasr_btnGroup li:nth-child(2)").hasClass("active")&&t((function(){$(".yasr_btnGroup li:nth-child(2) a").get(0).click()}),0)}),0))}),0)}),0),g.set(f.TABS_STATE_CURRENT_ID,n),e.currentQuery=i,t((function(){e.currentTabConfig={},e.currentTabConfig.queryType=i.queryType,e.currentTabConfig.resultsCount=i.resultsCount,e.currentTabConfig.offset=i.offset,e.currentTabConfig.allResultsCount=i.allResultsCount,e.currentTabConfig.allResultsCountExact=i.allResultsCountExact,e.currentTabConfig.page=i.page,e.currentTabConfig.pageSize=i.pageSize,e.currentTabConfig.timeFinished=i.timeFinished,e.currentTabConfig.timeTook=i.timeTook,e.currentTabConfig.sizeDelta=i.sizeDelta,e.currentTabConfig.customUpdateMessage=i.customUpdateMessage,e.currentTabConfig.errorMessage=i.errorMessage,e.currentTabConfig.warningMessage=i.warningMessage,e.$apply()}),0),$("#yasr").css("padding","0"),y||(y=setInterval(x,200));!function(){const t=r.isActiveRepoOntopType(),n=r.isActiveRepoFedXType();(function(e){const t=document.getElementById("sameAs"),n=document.getElementById("inference");t.disabled=!(!t||!e),n.disabled=!(!n||!e)})(t),e.nocount=!(!t&&!n)||!m.appSettings.EXECUTE_COUNT,e.currentQuery.inference=!!t||m.appSettings.DEFAULT_INFERENCE,e.currentQuery.sameAs=!!t||m.appSettings.DEFAULT_SAMEAS}()},e.addNewTab=function(n,r,o){if(!N(!0))return;let i;i=r||o?{id:"1",name:r,query:o,inference:m.appSettings.DEFAULT_INFERENCE,sameAs:m.appSettings.DEFAULT_SAMEAS}:{id:"1",name:"",query:"select * where { \n\t?s ?p ?o .\n} limit 100 \n",inference:m.appSettings.DEFAULT_INFERENCE,sameAs:m.appSettings.DEFAULT_SAMEAS};D++;const a=""+D;e.tabsData=e.tabs;const s=i;s.id=a,e.tabsData.push(s),g.set(f.TABS_STATE_MAXID,D),g.set(f.TABS_STATE,e.tabsData);const u=Array.prototype.slice.call(arguments,1);t((function(){e.$apply(),E(a),n&&n.apply(this,u)}),0),e.tabs=e.tabsData},e.isTabChangeOk=N,e.runQuery=v,e.abortCurrentQuery=function(){d.abortQueryByAlias(e.currentTrackAlias).success((function(){e.abortRequested=!0}))},e.editQuery=function(t){o.open({templateUrl:"js/angular/core/directives/queryeditor/templates/query-sample.html",controller:"QuerySampleModalCtrl",resolve:{data:function(){return{title:'Edit Saved Query: "'+t.name+'"',query:t,edit:!0,okButtonText:"Save"}}}}).result.then((function(r){const o={name:r.name,body:r.body,shared:r.shared};t.name!==r.name?a.addNewSavedQuery(o).success((function(){e.deleteQueryHttp(t.name,!0)})).error((function(e){const t=getError(e);n.error(t,"Error! Cannot edit saved query")})):a.editSavedQuery(o).success((function(){$("#editQueryContainer").modal("hide"),e.toggleSampleQueries(),n.success("Saved query "+t.name+" was edited.")})).error((function(e){const t=getError(e);n.error(t,"Error! Cannot edit Saved query")}))}))},e.getNamespaces=function(){w(!0,"Refreshing namespaces","Normally this is a fast operation but it may take longer if a bigger repository needs to be initialised first."),e.namespacesLoading=!0,l.getRepositoryNamespaces().success((function(t){const n={};t.results.bindings.forEach((function(e){n[e.prefix.value]=e.namespace.value})),e.namespaces=n})).error((function(t){e.repositoryError=getError(t)})).finally((function(){w(!1),e.namespacesLoading=!1}))},e.changePagination=function(){v(!0,e.explainRequested)},e.toggleSampleQueries=Q,e.addKnownPrefixes=function(){a.addKnownPrefixes(JSON.stringify(window.editor.getValue())).success((function(e){angular.isDefined(window.editor)&&angular.isDefined(e)&&e!==window.editor.getValue()&&window.editor.setValue(e)})).error((function(e){const t=getError(e);return n.error(t,"Error! Could not add known prefixes"),!0}))},e.getExistingTabId=M,e.querySelected=function(t){const n=M(t);e.toggleSampleQueries(),e.isTabChangeOk(!1)&&(e.highlightNextTabChange=!0,angular.isDefined(n)?E(n):e.addNewTab(null,t.name,t.body))},e.deleteQuery=function(t){i.openSimpleModal({title:"Confirm",message:"Are you sure you want to delete the saved query '"+t+"'?",warning:!0}).result.then((function(){e.deleteQueryHttp(t)}))},e.deleteQueryHttp=function(t,r){a.deleteSavedQuery(t).success((function(){e.toggleSampleQueries(),r||n.success("Saved query: "+t+" was deleted.")})).error((function(e){const t=getError(e);n.error(t,"Error! Cannot delete saved query")}))},e.saveQuery=function(t,n){o.open({templateUrl:"js/angular/core/directives/queryeditor/templates/query-sample.html",controller:"QuerySampleModalCtrl",resolve:{data:function(){return{title:"Create New Saved Query",query:{name:t.name,body:t.query,shared:t.shared},edit:!1,okButtonText:"Create",queryExists:n}}}}).result.then((function(t){e.saveQueryHttp(t)}),(function(){}))},e.saveQueryHttp=function(t){a.addNewSavedQuery(t).success((function(){n.success("Saved query "+t.name+" was saved.")})).error((function(r){let o=getError(r);if(n.error(o,"Error! Cannot create saved query"),o="Query '"+t.name+"' already exists!"){t.query=t.body;const n=!0;e.saveQuery(t,n)}}))},e.saveQueryToLocal=T,e.setLoader=w,e.getLoaderMessage=function(){const t=(Date.now()-e.queryStartTime)/1e3;let n="",r="";e.noLoaderTimer||(n=e.getHumanReadableSeconds(t));r=e.progressMessage?e.progressMessage+"... "+n:"Running operation... "+n;e.extraMessage&&t>10&&(r+="\n"+e.extraMessage);return r},e.fixSizesOnHorizontalViewModeSwitch=b,e.changeViewMode=function(){e.viewMode="none",e.orientationViewMode=!e.orientationViewMode,g.set(f.VIEW_MODE,e.orientationViewMode),b()},e.showHideEditor=C,e.focusQueryEditor=function(){angular.element(document).find(".editable-input").is(":focus")||angular.element(document).find(".CodeMirror textarea:first-child").focus()},e.orientationViewMode=!g.get(f.VIEW_MODE)||"true"===g.get(f.VIEW_MODE),e.viewMode="none",e.getActiveRepository=function(){return r.getActiveRepository()},e.getActiveRepositoryNoError=function(){if(!e.repositoryError)return r.getActiveRepository()},e.orientationViewMode||C(),window.onbeforeunload=function(){e.currentQuery&&e.saveTab(e.currentQuery.id),g.set(f.TABS_STATE,e.tabs)},e.$on("$destroy",(function(){e.currentQuery&&e.saveTab(e.currentQuery.id),g.set(f.TABS_STATE,e.tabs),clearInterval(y)})),e.$on("$destroy",(function(){clearInterval(y),window.editor=null,window.yasr=null})),$(document).mouseup((function(t){const n=$("#sampleQueriesCollapse");!n.is(t.target)&&0===n.has(t.target).length&&e.showSampleQueries&&Q()}));let D=g.get(f.TABS_STATE_MAXID)||1;function R(e){return $(e).attr("data-id")}function x(){if(e.currentTabConfig.resultsCount>=0){const e=$(".saveAsDropDown");e.length>0&&!window.editor.queryValid?yasr.header.find(".saveAsDropDown").remove():0===e.length&&window.editor.queryValid&&yasr.updateDownloadDropdown()}}function N(t){return!(e.queryIsRunning&&!e.namespacesLoading)||(t?n.info("New tabs may not be opened while query or update is running."):n.info("Tabs may not be switched while query or update is running."),!1)}e.highlightNextTabChange=!1,e.$on("tabAction",(function(n,r){r.relatedTarget&&(t.cancel(r.relatedTarget.timer),$(r.relatedTarget).css("color",""),e.saveTab(R(r.relatedTarget))),e.loadTab(R(r.target));const o=["#ED4F2F","","#ED4F2F"],i=[400,400,400];if(e.highlightNextTabChange){e.highlightNextTabChange=!1;let n=0;$(r.target).css("color",o[n]);const a=function(){n++,n<o.length?($(r.target).css("color",o[n]),r.target.timer=t(a,i[n])):$(r.target).css("color","")};t(a,i[n])}})),e.$on("deleteAllexeptSelected",(function(t,n){e.tabsData=n,e.tabs=n})),e.currentQuery={},e.showSampleQueries=!1,e.savedQuery={},e.sampleQueries={},e.editQueryModal=A("#editQueryContainer"),e.deleteQueryModal=A("#confirmDeleteContainer"),e.saveQueryModal=A("#saveQueryContainer"),e.getResultsDescription=function(){let t;if(0===e.currentTabConfig.resultsCount)t="No results.";else{const n=(e.currentTabConfig.page-1)*e.currentTabConfig.pageSize+Math.min(e.currentTabConfig.resultsCount,e.currentTabConfig.pageSize);t="Showing results from "+s("currency")(e.currentTabConfig.offset,"",0)+" to "+s("currency")(n,"",0),e.currentTabConfig.allResultsCount>0&&(t+=e.currentTabConfig.allResultsCountExact?" of ":" of at least ",t+=s("currency")(e.currentTabConfig.allResultsCount,"",0)),t+="."}return t},e.getUpdateDescription=function(){return e.currentTabConfig.customUpdateMessage?e.currentTabConfig.customUpdateMessage:void 0===e.currentTabConfig.sizeDelta?"":e.currentTabConfig.sizeDelta<0?"Removed "+Math.abs(e.currentTabConfig.sizeDelta)+" statements.":e.currentTabConfig.sizeDelta>0?"Added "+e.currentTabConfig.sizeDelta+" statements.":"The number of statements did not change."},e.getStaleWarningMessage=function(){const t=60*Math.round((Date.now()-e.currentTabConfig.timeFinished)/6e4);if(t>=3600)return"Possibly stale result (obtained "+e.getHumanReadableSeconds(t)+" ago)."};const _=function(){};angular.element(u).bind("resize",_),e.$on("$destroy",(function(){angular.element(u).unbind("resize",_)}))}function o(e,t,n){n.queryExists&&(e.queryExists=!0),e.query=angular.copy(n.query),e.title=n.title,e.edit=n.edit,e.okButtonText=n.okButtonText,e.ok=function(){e.form.$valid&&t.close(e.query)},e.cancel=function(){t.dismiss("cancel")}}angular.module("graphdb.framework.core.directives.queryeditor.controllers",["graphdb.framework.utils.localstorageadapter","graphdb.framework.rest.sparql.service"]).controller("QueryEditorCtrl",r).controller("QuerySampleModalCtrl",o),r.$inject=["$scope","$timeout","toastr","$repositories","$modal","ModalService","SparqlRestService","$filter","$window","$jwtAuth","RDF4JRepositoriesRestService","MonitoringRestService","LocalStorageAdapter","LSKeys"],o.$inject=["$scope","$modalInstance","data"]}}]);
|
|
2
|
-
//# sourceMappingURL=48.14a8f14de3765cbe330c.bundle.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["webpack:///./src/js/angular/core/directives/queryeditor/query-editor.controller.js"],"names":["QueryEditorCtrl","$scope","$timeout","toastr","$repositories","$modal","ModalService","SparqlRestService","$filter","$window","$jwtAuth","RDF4JRepositoriesRestService","MonitoringRestService","LocalStorageAdapter","LSKeys","defaultTabConfig","id","name","query","inference","sameAs","checkQueryIntervalId","principal","getPrincipal","initTabs","scope","appSettings","DEFAULT_INFERENCE","DEFAULT_SAMEAS","skipCountQuery","EXECUTE_COUNT","ignoreSharedQueries","IGNORE_SHARED_QUERIES","tabsData","tabs","get","TABS_STATE","$watchCollection","newVal","oldVal","saveQueryToLocal","currentQuery","$on","deleteCachedSparqlResults","currentQueryTab","forEach","tab","index","set","setLoader","isRunning","progressMessage","extraMessage","noTimer","yasrInnerContainer","angular","element","document","getElementById","queryIsRunning","queryStartTime","Date","now","countTimeouted","noLoaderTimer","addClass","currentTrackAlias","abortRequested","removeClass","$$phase","$apply","fixSizesOnHorizontalViewModeSwitch","verticalView","visibleWindowHeight","window","innerHeight","documentElement","clientHeight","body","orientationViewMode","viewMode","newHeight","querySelector","getBoundingClientRect","style","height","noPadding","minHeight","paddingRight","paddingLeft","editor","timer","cancel","yasr","container","resize","showHideEditor","foo","params","newRepo","item","yasrData","undefined","queryType","resultsCount","allResultsCount","sizeDelta","errorMessage","repositoryError","selectTab","$","runQuery","changePage","explain","executedQueryTab","getQueryType","warning","isActiveRepoOntopType","explainRequested","currentTabConfig","resetCurrentTabConfig","lastRunQueryMode","getQueryMode","toggleSampleQueries","showSampleQueries","getSavedQueries","success","data","sampleQueries","collapse","width","error","msg","getError","getExistingTabId","existingTabId","showModal","modalSelector","shared","savedQuery","getValue","modal","findTabIndexByID","i","length","currentScope","this","hint","createElement","innerHTML","fontSize","color","backgroundColor","position","zIndex","$watch","newValue","elRect","appendChild","top","left","right","offsetWidth","parentNode","removeChild","pageSize","page","queryExists","saveTab","idx","loadTab","setValue","updateDownloadDropdown","$broadcast","options","output","outputType","customError","results","getException","setYasrResponse","textStatus","jqXhrOrErrorString","hasClass","click","TABS_STATE_CURRENT_ID","offset","allResultsCountExact","timeFinished","timeTook","customUpdateMessage","warningMessage","css","setInterval","showOrHideSaveAsDropDown","isOntop","isFedX","isActiveRepoFedXType","sameAsBtn","inferenceBtn","disabled","handleSameAsAndInferenceBtns","nocount","overrideSameAsInferenceAndNoCountIfNeeded","addNewTab","callback","tabName","isTabChangeOk","maxID","newID","newTab","push","TABS_STATE_MAXID","callbackArgs","Array","prototype","slice","call","arguments","apply","abortCurrentQuery","abortQueryByAlias","editQuery","open","templateUrl","controller","resolve","title","edit","okButtonText","result","then","queryModal","addNewSavedQuery","deleteQueryHttp","editSavedQuery","getNamespaces","namespacesLoading","getRepositoryNamespaces","usedPrefixes","bindings","e","prefix","value","namespace","namespaces","finally","changePagination","addKnownPrefixes","JSON","stringify","isDefined","querySelected","tabId","highlightNextTabChange","deleteQuery","savedQueryName","openSimpleModal","message","deleteSavedQuery","saveQuery","saveQueryHttp","getLoaderMessage","timeSeconds","timeHuman","getHumanReadableSeconds","changeViewMode","VIEW_MODE","focusQueryEditor","find","is","focus","getActiveRepository","getActiveRepositoryNoError","onbeforeunload","clearInterval","mouseup","event","target","has","getQueryID","attr","$saveAsDropDown","queryValid","header","remove","isNew","info","tabEvent","relatedTarget","colors","times","highlightFun","editQueryModal","deleteQueryModal","saveQueryModal","getResultsDescription","desc","currentPageEnd","Math","min","getUpdateDescription","abs","getStaleWarningMessage","secondsAgo","round","bind","unbind","QuerySampleModalCtrl","$modalInstance","copy","ok","form","$valid","close","dismiss","module","$inject"],"mappings":"0FAAA,kBAaA,SAASA,EAAgBC,EAAQC,EAAUC,EAAQC,EAAeC,EAAQC,EAAcC,EAAmBC,EAASC,EAASC,EAAUC,EAA8BC,EAAuBC,EAAqBC,GAC7M,MAAMC,EAAmB,CACrBC,GAAI,IACJC,KAAM,GACNC,MAAO,kDAGPC,WAAW,EACXC,QAAQ,GAGZ,IACIC,EADAC,EAAYZ,EAASa,eAYzB,SAASC,EAASC,EAAOH,GACrBP,EAAiBI,UAAYG,EAAUI,YAAYC,kBACnDZ,EAAiBK,OAASE,EAAUI,YAAYE,eAEhDH,EAAMI,gBAAkBP,EAAUI,YAAYI,cAC9CL,EAAMM,oBAAsBT,EAAUI,YAAYM,sBAClDP,EAAMQ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AAiBb,WAAa,eAC3DzG,EAAOsH,iBAAiBb,UAAY,EACpC,SAAWzG,EAAOsH,iBAAiBb,UAAY,eAE/C,4CAIfzG,EAAO8S,uBAAyB,WAC5B,MAAMC,EAAuF,GAA1EL,KAAKM,OAAOpP,KAAKC,MAAQ7D,EAAOsH,iBAAiBqE,cAAgB,KACpF,GAAIoH,GAAc,KACd,MAAO,mCAAqC/S,EAAOwQ,wBAAwBuC,GAAc,UAIjG,MAAMjN,EAAS,aAIfxC,QAAQC,QAAQ/C,GAASyS,KAAK,SAAUnN,GAExC9F,EAAOyC,IAAI,YAAY,WACnBa,QAAQC,QAAQ/C,GAAS0S,OAAO,SAAUpN,MA4BlD,SAASqN,EAAqBnT,EAAQoT,EAAgBtL,GAC9CA,EAAKwC,cACLtK,EAAOsK,aAAc,GAEzBtK,EAAOiB,MAAQqC,QAAQ+P,KAAKvL,EAAK7G,OACjCjB,EAAOkO,MAAQpG,EAAKoG,MACpBlO,EAAOmO,KAAOrG,EAAKqG,KACnBnO,EAAOoO,aAAetG,EAAKsG,aAC3BpO,EAAOsT,GAAK,WACJtT,EAAOuT,KAAKC,QACZJ,EAAeK,MAAMzT,EAAOiB,QAIpCjB,EAAO2F,OAAS,WACZyN,EAAeM,QAAQ,WAj5B/BpQ,QACKqQ,OAAO,4DAA6D,CACjE,8CACA,0CAEH3F,WAAW,kBAAmBjO,GAC9BiO,WAAW,uBAAwBmF,GAExCpT,EAAgB6T,QAAU,CAAC,SAAU,WAAY,SAAU,gBAAiB,SAAU,eAAgB,oBAAqB,UAAW,UAAW,WAAY,+BAAgC,wBAAyB,sBAAuB,UAw3B7OT,EAAqBS,QAAU,CAAC,SAAU,iBAAkB","file":"48.14a8f14de3765cbe330c.bundle.js","sourcesContent":["import 'angular/utils/local-storage-adapter';\nimport 'angular/rest/sparql.rest.service';\n\nangular\n .module('graphdb.framework.core.directives.queryeditor.controllers', [\n 'graphdb.framework.utils.localstorageadapter',\n 'graphdb.framework.rest.sparql.service'\n ])\n .controller('QueryEditorCtrl', QueryEditorCtrl)\n .controller('QuerySampleModalCtrl', QuerySampleModalCtrl);\n\nQueryEditorCtrl.$inject = ['$scope', '$timeout', 'toastr', '$repositories', '$modal', 'ModalService', 'SparqlRestService', '$filter', '$window', '$jwtAuth', 'RDF4JRepositoriesRestService', 'MonitoringRestService', 'LocalStorageAdapter', 'LSKeys'];\n\nfunction QueryEditorCtrl($scope, $timeout, toastr, $repositories, $modal, ModalService, SparqlRestService, $filter, $window, $jwtAuth, RDF4JRepositoriesRestService, MonitoringRestService, LocalStorageAdapter, LSKeys) {\n const defaultTabConfig = {\n id: \"1\",\n name: '',\n query: 'select * where { \\n' +\n '\\t?s ?p ?o .\\n' +\n '} limit 100 \\n',\n inference: true,\n sameAs: true\n };\n\n let principal = $jwtAuth.getPrincipal();\n let checkQueryIntervalId;\n if (principal) {\n initTabs($scope, principal);\n // principal is not yet set, wait for its initialization\n } else {\n $scope.$on('securityInit', function (scope) {\n principal = $jwtAuth.getPrincipal();\n initTabs(scope.currentScope, principal);\n });\n }\n\n function initTabs(scope, principal) {\n defaultTabConfig.inference = principal.appSettings.DEFAULT_INFERENCE;\n defaultTabConfig.sameAs = principal.appSettings.DEFAULT_SAMEAS;\n\n scope.skipCountQuery = !principal.appSettings.EXECUTE_COUNT;\n scope.ignoreSharedQueries = principal.appSettings.IGNORE_SHARED_QUERIES;\n scope.tabsData = scope.tabs = LocalStorageAdapter.get(LSKeys.TABS_STATE) || [defaultTabConfig];\n\n scope.$watchCollection('[currentQuery.inference, currentQuery.sameAs]', function (newVal, oldVal, scope) {\n saveQueryToLocal(scope.currentQuery);\n });\n\n scope.$on('repositoryIsSet', deleteCachedSparqlResults);\n }\n\n this.hint = document.createElement(\"span\");\n this.hint.innerHTML = \"Hint: \\\"abC\\\" matches \\\"abC*\\\", \\\"ab c*\\\" and \\\"ab-c*\\\"\";\n this.hint.style.fontSize = \"12px\";\n this.hint.style.color = \"gray\";\n this.hint.style.backgroundColor = \"white\";\n this.hint.style.position = \"absolute\";\n this.hint.style.zIndex = \"3\";\n this.hint.style.paddingLeft = 12 + \"px\";\n\n $scope.$watch(function() {\n return angular.element('.CodeMirror-hints').length;\n }, (newValue) => {\n if (newValue) {\n const elRect = angular.element('.CodeMirror-hints')[0].getBoundingClientRect();\n document.body.appendChild(this.hint);\n this.hint.style.top = elRect.top - 20 + \"px\";\n this.hint.style.left = elRect.right - this.hint.offsetWidth - 12 + \"px\";\n } else {\n this.hint && this.hint.parentNode && this.hint.parentNode.removeChild(this.hint);\n }\n });\n\n $scope.resetCurrentTabConfig = function () {\n $scope.currentTabConfig = {\n pageSize: 1000,\n page: 1,\n allResultsCount: 0,\n resultsCount: 0\n };\n };\n\n $scope.queryExists = false;\n\n $scope.resetCurrentTabConfig();\n\n // query tab operations\n $scope.saveTab = saveTab;\n $scope.loadTab = loadTab;\n $scope.addNewTab = addNewTab;\n $scope.isTabChangeOk = isTabChangeOk;\n\n // query operations\n $scope.runQuery = runQuery;\n $scope.abortCurrentQuery = abortCurrentQuery;\n $scope.editQuery = editQuery;\n $scope.getNamespaces = getNamespaces;\n $scope.changePagination = changePagination;\n $scope.toggleSampleQueries = toggleSampleQueries;\n $scope.addKnownPrefixes = addKnownPrefixes;\n $scope.getExistingTabId = getExistingTabId;\n $scope.querySelected = querySelected;\n $scope.deleteQuery = deleteQuery;\n $scope.deleteQueryHttp = deleteQueryHttp;\n $scope.saveQuery = saveQuery;\n $scope.saveQueryHttp = saveQueryHttp;\n $scope.saveQueryToLocal = saveQueryToLocal;\n\n $scope.setLoader = setLoader;\n $scope.getLoaderMessage = getLoaderMessage;\n\n // query editor and results orientation\n $scope.fixSizesOnHorizontalViewModeSwitch = fixSizesOnHorizontalViewModeSwitch;\n $scope.changeViewMode = changeViewMode;\n $scope.showHideEditor = showHideEditor;\n $scope.focusQueryEditor = focusQueryEditor;\n $scope.orientationViewMode = LocalStorageAdapter.get(LSKeys.VIEW_MODE) ? LocalStorageAdapter.get(LSKeys.VIEW_MODE) === \"true\" : true;\n $scope.viewMode = 'none';\n\n // start of repository actions\n // FIXME: do we need this??\n // $scope.getActiveRepository();\n $scope.getActiveRepository = function () {\n // same as getActiveRepository() but takes into account repo errors\n return $repositories.getActiveRepository();\n };\n\n $scope.getActiveRepositoryNoError = function () {\n if (!$scope.repositoryError) {\n return $repositories.getActiveRepository();\n }\n };\n\n function saveQueryToLocal(currentQueryTab) {\n $scope.tabs.forEach(function (tab, index) {\n if (tab.id === currentQueryTab.id) {\n $scope.tabs[index].query = currentQueryTab.query;\n $scope.tabs[index].inference = currentQueryTab.inference;\n $scope.tabs[index].sameAs = currentQueryTab.sameAs;\n }\n });\n LocalStorageAdapter.set(LSKeys.TABS_STATE, $scope.tabs);\n }\n\n function setLoader(isRunning, progressMessage, extraMessage, noTimer) {\n const yasrInnerContainer = angular.element(document.getElementById(\"yasr-inner\"));\n $scope.queryIsRunning = isRunning;\n if (isRunning) {\n $scope.queryStartTime = Date.now();\n $scope.countTimeouted = false;\n $scope.progressMessage = progressMessage;\n $scope.extraMessage = extraMessage;\n $scope.noLoaderTimer = noTimer;\n yasrInnerContainer.addClass(\"hide\");\n } else {\n $scope.progressMessage = \"\";\n $scope.extraMessage = \"\";\n $scope.noLoaderTimer = false;\n $scope.currentTrackAlias = null;\n $scope.abortRequested = false;\n yasrInnerContainer.removeClass(\"hide\");\n }\n // We might call this from angular or outside angular so take care of applying the scope.\n if ($scope.$$phase === null) {\n $scope.$apply();\n }\n }\n\n function getLoaderMessage() {\n const timeSeconds = (Date.now() - $scope.queryStartTime) / 1000;\n let timeHuman = \"\";\n let message = \"\";\n\n if (!$scope.noLoaderTimer) {\n timeHuman = $scope.getHumanReadableSeconds(timeSeconds);\n }\n\n if ($scope.progressMessage) {\n message = $scope.progressMessage + \"... \" + timeHuman;\n } else {\n message = \"Running operation... \" + timeHuman;\n }\n if ($scope.extraMessage && timeSeconds > 10) {\n message += \"\\n\" + $scope.extraMessage;\n }\n\n return message;\n }\n\n // start of query editor results orientation operations\n function fixSizesOnHorizontalViewModeSwitch(verticalView) {\n function visibleWindowHeight() {\n return window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight || 0;\n }\n\n if (!$scope.orientationViewMode) {\n $scope.noPadding = {paddingRight: 15, paddingLeft: 0};\n\n // window.editor is undefined if no repo is selected\n if (window.editor && document.querySelector('.CodeMirror-wrap')) {\n let newHeight = visibleWindowHeight() - (document.querySelector('.CodeMirror-wrap').getBoundingClientRect().top);\n newHeight -= 40;\n document.querySelector('.CodeMirror-wrap').style.height = newHeight + 'px';\n document.getElementById('yasr').style.minHeight = newHeight + 'px';\n //window.editor.refresh();\n } else {\n let timer;\n if (verticalView) {\n timer = $timeout(function () {\n $scope.fixSizesOnHorizontalViewModeSwitch(verticalView);\n }, 100);\n } else {\n timer = $timeout($scope.fixSizesOnHorizontalViewModeSwitch, 100);\n }\n\n $scope.$on(\"$destroy\", function () {\n $timeout.cancel(timer);\n });\n }\n } else {\n if ($scope.viewMode === 'yasr') {\n let newHeight = visibleWindowHeight() - (document.querySelector('.CodeMirror-wrap').getBoundingClientRect().top);\n newHeight -= 40;\n document.querySelector('.CodeMirror-wrap').style.height = newHeight + 'px';\n //window.editor.refresh();\n } else {\n $scope.noPadding = {};\n document.querySelector('.CodeMirror-wrap').style.height = '';\n //window.editor.refresh();\n }\n document.getElementById('yasr').style.minHeight = '';\n }\n if (window.yasr && window.yasr.container) {\n $timeout(function () {\n window.yasr.container.resize();\n }, 100);\n }\n }\n\n if (!$scope.orientationViewMode) {\n showHideEditor();\n }\n\n function changeViewMode() {\n $scope.viewMode = 'none';\n $scope.orientationViewMode = !$scope.orientationViewMode;\n LocalStorageAdapter.set(LSKeys.VIEW_MODE, $scope.orientationViewMode);\n fixSizesOnHorizontalViewModeSwitch();\n }\n\n function showHideEditor() {\n fixSizesOnHorizontalViewModeSwitch(true);\n }\n\n function focusQueryEditor() {\n if (!angular.element(document).find('.editable-input').is(\":focus\")) {\n angular.element(document).find('.CodeMirror textarea:first-child').focus();\n }\n }\n\n // end of query editor results orientation operations\n\n function deleteCachedSparqlResults(foo, params) {\n if (params.newRepo) {\n $scope.tabsData = LocalStorageAdapter.get(LSKeys.TABS_STATE);\n $scope.tabsData.forEach(function (item) {\n item.yasrData = undefined;\n item.queryType = undefined;\n item.resultsCount = 0;\n item.allResultsCount = 0;\n item.sizeDelta = undefined;\n });\n\n LocalStorageAdapter.set(LSKeys.TABS_STATE, $scope.tabsData);\n $scope.tabs = $scope.tabsData;\n\n // The repository is changed. Remove error messages as well, if any\n $scope.currentQuery = {};\n $scope.errorMessage = null;\n $scope.repositoryError = null;\n }\n }\n\n function selectTab(id) {\n $timeout(function () {\n $('a[data-id = \"' + id + '\"]').tab('show');\n }, 0);\n }\n\n window.onbeforeunload = function () {\n if ($scope.currentQuery) {\n $scope.saveTab($scope.currentQuery.id);\n }\n LocalStorageAdapter.set(LSKeys.TABS_STATE, $scope.tabs);\n };\n\n $scope.$on('$destroy', function () {\n if ($scope.currentQuery) {\n $scope.saveTab($scope.currentQuery.id);\n }\n LocalStorageAdapter.set(LSKeys.TABS_STATE, $scope.tabs);\n clearInterval(checkQueryIntervalId);\n });\n\n // start of query operations\n function runQuery(changePage, explain) {\n $scope.executedQueryTab = $scope.currentQuery;\n if (explain) {\n if (!(window.editor.getQueryType() === 'SELECT' || window.editor.getQueryType() === 'CONSTRUCT')) {\n toastr.warning('Explain only works with SELECT or CONSTRUCT queries.');\n return;\n }\n\n if ($repositories.isActiveRepoOntopType()) {\n toastr.warning('Explain not supported for Virtual repositories.');\n return;\n }\n }\n\n $scope.explainRequested = explain;\n if (!$scope.queryIsRunning) {\n if (changePage) {\n $scope.currentTabConfig.resultsCount = 0;\n } else {\n $scope.resetCurrentTabConfig();\n }\n\n $scope.lastRunQueryMode = window.editor.getQueryMode();\n\n if ($scope.lastRunQueryMode === 'update' && $repositories.isActiveRepoOntopType()) {\n toastr.warning('Updates are not supported for Virtual repositories.');\n return;\n }\n\n setLoader(true, $scope.lastRunQueryMode === 'update' ? 'Executing update' : 'Evaluating query');\n if ($scope.viewMode !== 'none') {\n $scope.viewMode = 'none';\n if ($scope.orientationViewMode) {\n $scope.fixSizesOnHorizontalViewModeSwitch();\n }\n const timer = $timeout(window.editor.query, 500);\n $scope.$on('$destroy', function () {\n $timeout.cancel(timer);\n });\n } else {\n window.editor.query();\n }\n }\n }\n\n function abortCurrentQuery() {\n MonitoringRestService.abortQueryByAlias($scope.currentTrackAlias)\n .success(function () {\n $scope.abortRequested = true;\n });\n }\n\n function getNamespaces() {\n // Signals the namespaces are to be fetched => loader will be shown\n setLoader(true, 'Refreshing namespaces', 'Normally this is a fast operation but it may take longer if a bigger repository needs to be initialised first.');\n $scope.namespacesLoading = true;\n\n RDF4JRepositoriesRestService.getRepositoryNamespaces()\n .success(function (data) {\n const usedPrefixes = {};\n data.results.bindings.forEach(function (e) {\n usedPrefixes[e.prefix.value] = e.namespace.value;\n });\n $scope.namespaces = usedPrefixes;\n })\n .error(function (data) {\n $scope.repositoryError = getError(data);\n })\n .finally(function () {\n // Signals namespaces were fetched => loader will be hidden\n setLoader(false);\n $scope.namespacesLoading = false;\n });\n }\n\n function changePagination() {\n runQuery(true, $scope.explainRequested);\n }\n\n $scope.$on(\"$destroy\", function () {\n clearInterval(checkQueryIntervalId);\n window.editor = null;\n window.yasr = null;\n });\n\n function toggleSampleQueries() {\n $scope.showSampleQueries = !$scope.showSampleQueries;\n if ($scope.showSampleQueries) {\n SparqlRestService.getSavedQueries()\n .success(function (data) {\n $scope.sampleQueries = data;\n $('#sampleQueriesCollapse').collapse('show').width('300px');\n })\n .error(function (data) {\n const msg = getError(data);\n toastr.error(msg, 'Error! Could not get saved queries');\n });\n } else {\n $('#sampleQueriesCollapse').collapse('hide');\n }\n }\n\n // Hide the sample queries when the user clicks somewhere else in the UI.\n $(document).mouseup(function (event) {\n const container = $('#sampleQueriesCollapse');\n if (!container.is(event.target) // if the target of the click isn't the container..\n && container.has(event.target).length === 0 //... nor a descendant of the container\n && $scope.showSampleQueries) {\n toggleSampleQueries();\n }\n });\n\n // Add known prefixes\n function addKnownPrefixes() {\n SparqlRestService.addKnownPrefixes(JSON.stringify(window.editor.getValue()))\n .success(function (data) {\n if (angular.isDefined(window.editor) && angular.isDefined(data) && data !== window.editor.getValue()) {\n window.editor.setValue(data);\n }\n })\n .error(function (data) {\n const msg = getError(data);\n toastr.error(msg, 'Error! Could not add known prefixes');\n return true;\n });\n }\n\n function querySelected(query) {\n const tabId = getExistingTabId(query);\n $scope.toggleSampleQueries();\n\n if ($scope.isTabChangeOk(false)) {\n $scope.highlightNextTabChange = true;\n if (!angular.isDefined(tabId)) {\n $scope.addNewTab(null, query.name, query.body);\n } else {\n selectTab(tabId);\n }\n }\n }\n\n function getExistingTabId(query) {\n let existingTabId = undefined;\n $scope.tabsData.forEach(function (item) {\n if (item.name === query.name && item.query === query.body) {\n existingTabId = item.id;\n return item;\n }\n });\n return existingTabId;\n }\n\n function editQuery(query) {\n const modalInstance = $modal.open({\n templateUrl: 'js/angular/core/directives/queryeditor/templates/query-sample.html',\n controller: 'QuerySampleModalCtrl',\n resolve: {\n data: function () {\n return {\n title: 'Edit Saved Query: \"' + query.name + '\"',\n query: query,\n edit: true,\n okButtonText: 'Save'\n };\n }\n }\n });\n\n modalInstance.result.then(function (queryModal) {\n const data = {\n name: queryModal.name,\n body: queryModal.body,\n shared: queryModal.shared\n };\n if (query.name !== queryModal.name) {\n SparqlRestService.addNewSavedQuery(data)\n .success(function () {\n $scope.deleteQueryHttp(query.name, true);\n })\n .error(function (data) {\n const msg = getError(data);\n toastr.error(msg, 'Error! Cannot edit saved query');\n });\n } else {\n SparqlRestService.editSavedQuery(data)\n .success(function () {\n $('#editQueryContainer').modal('hide');\n $scope.toggleSampleQueries();\n toastr.success('Saved query ' + query.name + ' was edited.');\n })\n .error(function (data) {\n const msg = getError(data);\n toastr.error(msg, 'Error! Cannot edit Saved query');\n });\n }\n });\n }\n\n function deleteQueryHttp(savedQueryName, edit) {\n SparqlRestService.deleteSavedQuery(savedQueryName)\n .success(function () {\n $scope.toggleSampleQueries();\n if (!edit) {\n toastr.success('Saved query: ' + savedQueryName + ' was deleted.');\n }\n })\n .error(function (data) {\n const msg = getError(data);\n toastr.error(msg, 'Error! Cannot delete saved query');\n });\n }\n\n function deleteQuery(savedQueryName) {\n ModalService.openSimpleModal({\n title: 'Confirm',\n message: 'Are you sure you want to delete the saved query ' + '\\'' + savedQueryName + '\\'?',\n warning: true\n }).result\n .then(function () {\n $scope.deleteQueryHttp(savedQueryName);\n });\n }\n\n function saveQueryHttp(query) {\n SparqlRestService.addNewSavedQuery(query)\n .success(function () {\n toastr.success('Saved query ' + query.name + ' was saved.');\n })\n .error(function (data) {\n let msg = getError(data);\n toastr.error(msg, 'Error! Cannot create saved query');\n // TODO: This condition will always be true\n if (msg = \"Query '\" + query.name + \"' already exists!\") {\n query.query = query.body;\n const queryExists = true;\n $scope.saveQuery(query, queryExists);\n }\n });\n }\n\n function saveQuery(query, queryExists) {\n const modalInstance = $modal.open({\n templateUrl: 'js/angular/core/directives/queryeditor/templates/query-sample.html',\n controller: 'QuerySampleModalCtrl',\n resolve: {\n data: function () {\n return {\n title: 'Create New Saved Query',\n query: {name: query.name, body: query.query, shared: query.shared},\n edit: false,\n okButtonText: 'Create',\n queryExists: queryExists\n };\n }\n }\n });\n\n modalInstance.result.then(function (query) {\n $scope.saveQueryHttp(query);\n }, function () {\n });\n }\n\n // end of query operations\n\n function showModal(modalSelector) {\n return function (name, query, shared) {\n $scope.savedQuery = {\n name: name,\n query: query || window.editor.getValue(),\n shared: shared\n };\n $(modalSelector).modal('show');\n };\n }\n\n\n // start of query tab operations\n function findTabIndexByID(id) {\n for (let i = 0; i < $scope.tabsData.length; i++) {\n const tab = $scope.tabsData[i];\n if (tab.id === id) {\n return i;\n }\n }\n }\n\n function saveTab(id) {\n const idx = findTabIndexByID(id);\n // Tab was deleted, don't try to save it's state\n if (idx === undefined) {\n return {};\n }\n const tab = $scope.tabsData[idx];\n //tab.query = window.editor.getValue();\n $scope.saveQueryToLocal(tab);\n return tab;\n }\n\n let maxID = LocalStorageAdapter.get(LSKeys.TABS_STATE_MAXID) || 1;\n\n function addNewTab(callback, tabName, savedQuery) { // optional callback to call after tab has been added\n if (!isTabChangeOk(true)) {\n return;\n }\n let defaultTabConfig;\n if (tabName || savedQuery) {\n defaultTabConfig = {\n id: \"1\",\n name: tabName,\n query: savedQuery,\n inference: principal.appSettings.DEFAULT_INFERENCE,\n sameAs: principal.appSettings.DEFAULT_SAMEAS\n };\n } else {\n defaultTabConfig = {\n id: \"1\",\n name: '',\n query: 'select * where { \\n' +\n '\\t?s ?p ?o .\\n' +\n '} limit 100 \\n',\n inference: principal.appSettings.DEFAULT_INFERENCE,\n sameAs: principal.appSettings.DEFAULT_SAMEAS\n };\n }\n\n maxID++;\n const newID = '' + maxID;\n $scope.tabsData = $scope.tabs;\n\n const newTab = defaultTabConfig;\n newTab.id = newID;\n\n $scope.tabsData.push(newTab);\n\n LocalStorageAdapter.set(LSKeys.TABS_STATE_MAXID, maxID);\n LocalStorageAdapter.set(LSKeys.TABS_STATE, $scope.tabsData);\n const callbackArgs = Array.prototype.slice.call(arguments, 1); // skip one argument, i.e. the callback itself\n $timeout(function () {\n $scope.$apply();\n selectTab(newID);\n if (callback) {\n callback.apply(this, callbackArgs);\n }\n }, 0);\n $scope.tabs = $scope.tabsData;\n }\n\n function loadTab(id) {\n $scope.tabsData = LocalStorageAdapter.get(LSKeys.TABS_STATE) || [defaultTabConfig];\n\n // find available tab\n const idx = findTabIndexByID(id);\n const tab = $scope.tabsData[idx];\n\n if (tab.yasrData) {\n setLoader(true, 'Rendering results', null, true);\n }\n\n // set query in editor available on the current tab\n $timeout(function () {\n if ($scope.currentQuery.query === '') {\n $scope.currentQuery.query = \" \";\n }\n $timeout(function () {\n window.editor.setValue($scope.currentQuery.query);\n $scope.yasr.updateDownloadDropdown();\n $scope.$broadcast('tabLoaded', $scope.currentQuery.id);\n\n // set query results in query results sections after\n // previous query execution. Yasr response rendering depends on the\n // query type of window.editor!\n $scope.yasr.options.output = tab.outputType; // this may be undefined, that's fine!\n if (tab.yasrData) {\n if (tab.yasrData.customError) {\n // Our injected custom (not real HTTP) error\n $scope.yasr.results = {\n getException: function () {\n return tab.yasrData.customError;\n }\n };\n setLoader(false);\n } else {\n // Real YASR result\n $timeout(function () {\n $scope.setYasrResponse(tab.yasrData, tab.textStatus, tab.jqXhrOrErrorString);\n setLoader(false);\n if ($('.yasr_btnGroup li:nth-child(2)').hasClass(\"active\")) {\n $timeout(function () {\n $('.yasr_btnGroup li:nth-child(2) a').get(0).click();\n }, 0);\n }\n }, 0);\n }\n }\n }, 0);\n }, 0);\n\n\n // persist current tab id in local storage\n LocalStorageAdapter.set(LSKeys.TABS_STATE_CURRENT_ID, id);\n\n $scope.currentQuery = tab;\n\n $timeout(function () {\n $scope.currentTabConfig = {};\n $scope.currentTabConfig.queryType = tab.queryType;\n $scope.currentTabConfig.resultsCount = tab.resultsCount;\n\n $scope.currentTabConfig.offset = tab.offset;\n $scope.currentTabConfig.allResultsCount = tab.allResultsCount;\n $scope.currentTabConfig.allResultsCountExact = tab.allResultsCountExact;\n $scope.currentTabConfig.page = tab.page;\n $scope.currentTabConfig.pageSize = tab.pageSize;\n\n $scope.currentTabConfig.timeFinished = tab.timeFinished;\n $scope.currentTabConfig.timeTook = tab.timeTook;\n $scope.currentTabConfig.sizeDelta = tab.sizeDelta;\n $scope.currentTabConfig.customUpdateMessage = tab.customUpdateMessage;\n $scope.currentTabConfig.errorMessage = tab.errorMessage;\n $scope.currentTabConfig.warningMessage = tab.warningMessage;\n\n $scope.$apply();\n }, 0);\n\n //Remove paddign of yasr so it will be aligned with sparql editor\n $('#yasr').css('padding', '0');\n\n if (!checkQueryIntervalId) {\n checkQueryIntervalId = setInterval(showOrHideSaveAsDropDown, 200);\n }\n overrideSameAsInferenceAndNoCountIfNeeded();\n }\n\n function getQueryID(element) {\n return $(element).attr('data-id');\n }\n\n function showOrHideSaveAsDropDown() {\n // If selected tab has results and query in editor controller is invalid save as\n // dropdown menu will be removed and on fixing query latter will be added\n if ($scope.currentTabConfig.resultsCount >= 0) {\n const $saveAsDropDown = $('.saveAsDropDown');\n if ($saveAsDropDown.length > 0 && !window.editor.queryValid) {\n yasr.header.find('.saveAsDropDown').remove();\n } else if ($saveAsDropDown.length === 0 && window.editor.queryValid) {\n yasr.updateDownloadDropdown();\n }\n }\n }\n\n function isTabChangeOk(isNew) {\n if ($scope.queryIsRunning && !$scope.namespacesLoading) {\n if (isNew) {\n toastr.info('New tabs may not be opened while query or update is running.');\n } else {\n toastr.info('Tabs may not be switched while query or update is running.');\n }\n\n return false;\n }\n\n return true;\n }\n\n // Raise this flag to provide visual feedback to the user the next time a tab changes\n // (either manually or by the system). See GDB-1983.\n $scope.highlightNextTabChange = false;\n $scope.$on('tabAction', function (e, tabEvent) {\n if (tabEvent.relatedTarget) {\n // Cancel any highlight timer that might have been left by the last highlight\n $timeout.cancel(tabEvent.relatedTarget.timer);\n $(tabEvent.relatedTarget).css('color', '');\n\n $scope.saveTab(getQueryID(tabEvent.relatedTarget));\n }\n\n $scope.loadTab(getQueryID(tabEvent.target));\n\n // These arrays define how the tab change will be visually enhanced.\n // colors contains the colors to set to the tab name,\n // while times defines the times in milliseconds to keep each color.\n // Once we cycle through the arrays we restore the default color.\n const colors = ['#ED4F2F', '', '#ED4F2F'];\n const times = [400, 400, 400];\n if ($scope.highlightNextTabChange) {\n $scope.highlightNextTabChange = false;\n let index = 0;\n $(tabEvent.target).css('color', colors[index]);\n const highlightFun = function () {\n index++;\n if (index < colors.length) {\n $(tabEvent.target).css('color', colors[index]);\n tabEvent.target.timer = $timeout(highlightFun, times[index]);\n } else {\n $(tabEvent.target).css('color', '');\n }\n };\n $timeout(highlightFun, times[index]);\n }\n });\n\n $scope.$on('deleteAllexeptSelected', function (e, tabs) {\n $scope.tabsData = tabs;\n $scope.tabs = tabs;\n });\n // end of query tab operations\n\n $scope.currentQuery = {};\n // $scope.state = {};\n $scope.showSampleQueries = false;\n $scope.savedQuery = {};\n $scope.sampleQueries = {};\n $scope.editQueryModal = showModal('#editQueryContainer');\n $scope.deleteQueryModal = showModal('#confirmDeleteContainer');\n $scope.saveQueryModal = showModal('#saveQueryContainer');\n\n $scope.getResultsDescription = function () {\n let desc;\n if ($scope.currentTabConfig.resultsCount === 0) {\n desc = \"No results.\";\n } else {\n const currentPageEnd = ($scope.currentTabConfig.page - 1) * $scope.currentTabConfig.pageSize\n + Math.min($scope.currentTabConfig.resultsCount, $scope.currentTabConfig.pageSize);\n desc = \"Showing results from \" + $filter('currency')($scope.currentTabConfig.offset, '', 0)\n + \" to \" + $filter('currency')(currentPageEnd, '', 0);\n if ($scope.currentTabConfig.allResultsCount > 0) {\n // Unsure total results count \"of at least\" happens if counting timed out or\n // counting was disabled and we got at least $pageSize + 1 results for the current page.\n // It may reset become exact when we navigate and reach the end of results.\n desc += $scope.currentTabConfig.allResultsCountExact\n ? \" of \" : \" of at least \";\n desc += $filter('currency')($scope.currentTabConfig.allResultsCount, '', 0);\n }\n desc += \".\";\n }\n\n return desc;\n };\n\n $scope.getUpdateDescription = function () {\n if ($scope.currentTabConfig.customUpdateMessage) {\n return $scope.currentTabConfig.customUpdateMessage;\n } else if ($scope.currentTabConfig.sizeDelta === undefined) {\n return '';\n } else if ($scope.currentTabConfig.sizeDelta < 0) {\n return 'Removed ' + Math.abs($scope.currentTabConfig.sizeDelta) + ' statements.';\n } else if ($scope.currentTabConfig.sizeDelta > 0) {\n return 'Added ' + $scope.currentTabConfig.sizeDelta + ' statements.';\n } else {\n return 'The number of statements did not change.';\n }\n };\n\n $scope.getStaleWarningMessage = function () {\n const secondsAgo = Math.round((Date.now() - $scope.currentTabConfig.timeFinished) / 60000) * 60;\n if (secondsAgo >= 3600) { // must be at least an hour\n return \"Possibly stale result (obtained \" + $scope.getHumanReadableSeconds(secondsAgo) + \" ago).\";\n }\n };\n\n const resize = function () {\n // $scope.fixSizesOnHorizontalViewModeSwitch();\n };\n\n angular.element($window).bind('resize', resize);\n\n $scope.$on('$destroy', function () {\n angular.element($window).unbind('resize', resize);\n });\n\n /**\n * In case of Ontop repository, sameAs, inference and nocount are\n * overridden to true and #sameAs and #inference buttons is disabled, In case of FedX repo nocount is overriden\n */\n function overrideSameAsInferenceAndNoCountIfNeeded() {\n const isOntop = $repositories.isActiveRepoOntopType();\n const isFedX = $repositories.isActiveRepoFedXType();\n handleSameAsAndInferenceBtns(isOntop);\n\n $scope.nocount = (isOntop || isFedX) ? true : !principal.appSettings.EXECUTE_COUNT;\n $scope.currentQuery.inference = isOntop ? true : principal.appSettings.DEFAULT_INFERENCE;\n $scope.currentQuery.sameAs = isOntop ? true : principal.appSettings.DEFAULT_SAMEAS;\n }\n\n function handleSameAsAndInferenceBtns(isOntop) {\n const sameAsBtn = document.getElementById('sameAs');\n const inferenceBtn = document.getElementById('inference');\n\n sameAsBtn.disabled = !!(sameAsBtn && isOntop);\n inferenceBtn.disabled = !!(inferenceBtn && isOntop);\n }\n}\n\nQuerySampleModalCtrl.$inject = ['$scope', '$modalInstance', 'data'];\n\nfunction QuerySampleModalCtrl($scope, $modalInstance, data) {\n if (data.queryExists) {\n $scope.queryExists = true;\n }\n $scope.query = angular.copy(data.query);\n $scope.title = data.title;\n $scope.edit = data.edit;\n $scope.okButtonText = data.okButtonText;\n $scope.ok = function () {\n if ($scope.form.$valid) {\n $modalInstance.close($scope.query);\n }\n };\n\n $scope.cancel = function () {\n $modalInstance.dismiss('cancel');\n };\n}\n"],"sourceRoot":""}
|