graphdb-workbench 2.5.0 → 2.5.1-TR1

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.
Files changed (52) hide show
  1. package/dist/115.558ce3da00d3be87d18a.bundle.js +1 -1
  2. package/dist/14.0bb211bcdc29c6d8b3b5.bundle.js +1 -1
  3. package/dist/15.6a74adbd30b4d2930e10.bundle.js +1 -0
  4. package/dist/178.e10370553beb5c6bb839.bundle.js +1 -1
  5. package/dist/180.d37db50f3ce1b3a04a65.bundle.js +1 -1
  6. package/dist/183.a086e00d4dc3c7855611.bundle.js +1 -1
  7. package/dist/21.c981976c6528073c0a2f.bundle.js +1 -1
  8. package/dist/210.1ac38e393ca959703d4b.bundle.js +1 -1
  9. package/dist/24.9076b75f45ce0579f7be.bundle.js +1 -1
  10. package/dist/31.31b7b4bd073b82c09fda.bundle.js +1 -1
  11. package/dist/51.514a339efd6cd11db0f8.bundle.js +1 -1
  12. package/dist/52.410a7d8b4cb433fb24ca.bundle.js +1 -0
  13. package/dist/{bundle.926694af2feb5084a769.bundle.js → bundle.39b836d40f0926aeec16.bundle.js} +2 -2
  14. package/dist/index.html +3 -3
  15. package/dist/js/angular/core/directives/autocomplete/templates/autocomplete.html +1 -1
  16. package/dist/js/angular/core/directives/operations-statuses-monitor/templates/operations-statuses-monitor.html +1 -1
  17. package/dist/js/angular/core/directives/rdfresourcesearch/templates/rdfResourceSearchTemplate.html +1 -1
  18. package/dist/js/angular/security/templates/user.html +1 -1
  19. package/dist/license-checker.json +2 -2
  20. package/dist/pages/aclmanagement.html +1 -1
  21. package/dist/pages/autocomplete.html +1 -1
  22. package/dist/pages/choose-repository-type.html +1 -1
  23. package/dist/pages/cluster-management/clusterInfo.html +3 -3
  24. package/dist/pages/create-index.html +4 -4
  25. package/dist/pages/dependencies.html +1 -1
  26. package/dist/pages/domainRangeInfo.html +2 -2
  27. package/dist/pages/edit.html +1 -1
  28. package/dist/pages/explore.html +1 -1
  29. package/dist/pages/export.html +1 -1
  30. package/dist/pages/find.html +1 -1
  31. package/dist/pages/graph-config/saveGraphConfig.html +11 -11
  32. package/dist/pages/graphs-visualizations.html +7 -7
  33. package/dist/pages/guides.html +1 -1
  34. package/dist/pages/import.html +1 -1
  35. package/dist/pages/jdbc-create.html +5 -5
  36. package/dist/pages/monitor/backup-and-restore.html +1 -1
  37. package/dist/pages/monitor/queries.html +1 -1
  38. package/dist/pages/monitor/resources.html +1 -1
  39. package/dist/pages/namespaces.html +2 -2
  40. package/dist/pages/plugins.html +1 -1
  41. package/dist/pages/rdfClassHierarchyInfo.html +7 -7
  42. package/dist/pages/rdfrank.html +2 -2
  43. package/dist/pages/repositories.html +1 -1
  44. package/dist/pages/repository.html +1 -1
  45. package/dist/pages/similarity-indexes.html +1 -1
  46. package/dist/pages/sparql-template-create.html +5 -5
  47. package/dist/pages/sparql.html +3 -3
  48. package/dist/pages/webapi.html +2 -2
  49. package/dist/res/swagger/index.html +27 -27
  50. package/package.json +1 -1
  51. package/dist/15.35db798cdef3e654ff7e.bundle.js +0 -1
  52. package/dist/52.23ca96a9ed8d85651731.bundle.js +0 -1
@@ -1 +0,0 @@
1
- (window.webpackJsonp=window.webpackJsonp||[]).push([[15,11,38,52,83,84,146,163],{125:function(e,t,n){"use strict";n.r(t);n(7),n(22),n(26),n(57);function r(e,t,n,r,o,i){e.getSqlConfigurations=function(){!t.getActiveRepository()||t.isActiveRepoOntopType()||t.isActiveRepoFedXType()?e.jdbcConfigurations=[]:n.getJdbcConfigurations().success((function(t){e.jdbcConfigurations=t})).error((function(e){const t=getError(e);r.error(t,i.instant("jdbc.not.get.SQL.msg"))}))},e.$watch((function(){return t.getActiveRepository()}),(function(){e.getSqlConfigurations()})),e.deleteConfiguration=function(t){o.openSimpleModal({title:i.instant("common.warning"),message:i.instant("jdbc.delete.sql.table.warning.msg",{name:t}),warning:!0}).result.then((function(){n.deleteJdbcConfiguration(t).success((function(){e.getSqlConfigurations()})).error((function(e){r.error(getError(e),i.instant("jdbc.not.delete.sql.msg"))}))}))}}function o(e,t,n,r,o,i,a,s,u,c,l){e.name=t.search().name||"",e.getNamespaces=function(){m(!0,l.instant("common.refreshing.namespaces"),l.instant("common.extra.message")),s.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(){m(!1),b()}))},e.setLoader=m,e.addKnownPrefixes=h,e.page=1,e.noPadding={paddingRight:0,paddingLeft:0},e.sqlTypes=["string","iri","boolean","byte","short","int","long","float","double","decimal","date","time","timestamp","Get suggestion..."],e.currentTabConfig={},e.orientationViewMode=!0,e.currentQuery={},e.$watch((function(){return r.getActiveRepository()}),(function(e,n){e!==n&&t.path("jdbc")}));let d=null;e.goBack=function(){d=i((function(){o.history.back()}),1e3)};const g=e.$on("$locationChangeStart",(function(t){!function(t){e.currentQuery.isPristine||(confirm(l.instant("jdbc.warning.unsaved.changes"))?(window.removeEventListener("beforeunload",f),g(),i.cancel(d)):t.preventDefault())}(t)}));function f(t){e.currentQuery.isPristine||(t.returnValue=!0)}window.addEventListener("beforeunload",f),e.$on("$destroy",(function(e){window.removeEventListener("beforeunload",f),g(),i.cancel(d)}));const p={id:"1",name:"",query:"PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>\n\n# Selects two variables to use as columns\nSELECT ?id ?label {\n ?id rdfs:label ?label\n # The following placeholder must be present in the query\n #!filter\n}",inference:!0,sameAs:!0,isNewConfiguration:!0,isPristine:!0};var y;function m(t,n,r){const o=angular.element(document.getElementById("yasr-inner"));e.queryIsRunning=t,t?(e.queryStartTime=Date.now(),e.countTimeouted=!1,e.progressMessage=n,e.extraMessage=r,o.addClass("hide")):(e.progressMessage="",e.extraMessage="",o.removeClass("hide")),null===e.$$phase&&e.$apply()}function b(){e.tabsData=[e.currentQuery];const t=e.currentQuery;e.currentQuery.query?window.editor.setValue(e.currentQuery.query):window.editor.setValue(" "),i((function(){e.currentTabConfig={},e.currentTabConfig.queryType=t.queryType,e.currentTabConfig.resultsCount=t.resultsCount,e.currentTabConfig.offset=t.offset,e.currentTabConfig.allResultsCount=t.allResultsCount,e.currentTabConfig.page=t.page,e.currentTabConfig.pageSize=t.pageSize,e.currentTabConfig.timeFinished=t.timeFinished,e.currentTabConfig.timeTook=t.timeTook,e.currentTabConfig.sizeDelta=t.sizeDelta,e.$apply()}),0),e.canWriteActiveRepo()||(window.editor.options.readOnly=!0)}function w(){e.tabsData=e.tabs=[p],e.currentQuery=_.cloneDeep(p),C(),window.editor&&(e.setQuery(e.currentQuery.query),b()),e.$watch((function(){return e.currentQuery.query}),(function(t,n){t!==n&&e.setDirty()}))}function h(){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){const t=getError(e);return n.error(t,l.instant("common.add.known.prefixes.error")),!0}))}function T(){E()&&a.getColumnNames(e.currentQuery.query).success((function(t){a.getColumnsTypeSuggestion(e.currentQuery.query,t).success((function(n){const r=[];_.forEach(t,(function(e){r.push({column_name:e,column_type:n[e].column_type,nullable:!0,sparql_type:n[e].sparql_type})})),e.currentQuery.columns=r,e.setDirty()})).error((function(e){n.error(getError(e),l.instant("jdbc.not.suggest.column.types"))}))})).error((function(e){n.error(getError(e),l.instant("jdbc.not.suggest.column.names"))}))}function C(){2===e.page?e.viewMode="editor":e.viewMode="none"}function v(e,t,n,r,o){let i=n[r].value;i=i.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;");return"<div class = 'literal-cell'>"+("<p class='nonUri' style='border: none; background-color: transparent; padding: 0; margin: 0'>"+i+"</p>")+"</div>"}function q(){return window.editor&&"SELECT"===window.editor.getQueryType()}function S(){return E()&&function(){if(!e.currentQuery.columns||!e.currentQuery.columns.length)return n.error(l.instant("jdbc.warning.one.column.msg"),l.instant("jdbc.invalid.columns")),!1;if(e.containsUnknownColumns())return n.error(l.instant("jdbc.warning.all.column.msg"),l.instant("jdbc.invalid.columns")),!1;return!0}()}function E(){return!!q()||(n.error(l.instant("jdbc.warning.invalid.query"),l.instant("jdbc.invalid.query)")),!1)}e.resetCurrentTabConfig=function(){e.currentTabConfig={pageSize:100,page:1,allResultsCount:0,resultsCount:0,queryType:""}},e.saveTab=function(){},e.setQuery=function(e){window.editor.setValue(e||" ")},e.name?(y=e.name,a.getJdbcConfiguration(y).success((function(e){p.query=e.query,p.name=e.name,p.columns=e.columns,p.isNewConfiguration=!e.name,w()})).error((function(e){const t=getError(e);n.error(t,l.instant("jdbc.not.get.sql.msg2"))}))):w(),e.goToPage=function(t){e.page=t;const n=e.currentQuery.columns;2!==t||n&&0!==n.length||!q()||e.getColumnsSuggestions(),C()},e.save=function(){S()&&(e.currentQuery.name?e.currentQuery.isNewConfiguration?a.createNewJdbcConfiguration(e.currentQuery).success((function(){e.currentQuery.isPristine=!0,e.currentQuery.isNewConfiguration=!1,n.success(l.instant("jdbc.saved.configuration")),e.goBack()})).error((function(e){const t=getError(e);n.error(t,l.instant("jdbc.not.saved.configuration"))})):a.updateJdbcConfiguration(e.currentQuery).success((function(){e.currentQuery.isPristine=!0,e.currentQuery.isNewConfiguration=!1,n.success(l.instant("jdbc.configuration.updated")),e.goBack()})).error((function(e){const t=getError(e);n.error(t,l.instant("jdbc.not.saved.configuration"))})):n.error(l.instant("jdbc.required.configuration.name")))},e.hasPrecision=function(e){return"iri"===e||"string"===e||"decimal"===e},e.containsColumnsWithPrecision=function(t){return t&&t.some(t=>e.hasPrecision(t.column_type))},e.hasScale=function(e){return"decimal"===e},e.containsColumnsWithScale=function(t){return t&&t.some(t=>e.hasScale(t.column_type))},e.isLiteral=function(e){return"iri"!==e&&"unknown"!==e},e.containsNonLiteralColumnsOnly=function(t){return t&&t.every(t=>!e.isLiteral(t.column_type))},e.containsUnknownColumns=function(){return e.currentQuery.columns&&e.currentQuery.columns.find(e=>"unknown"===e.column_type)},$("textarea").on("paste",(function(){i((function(){h()}),0)})),e.selectColumnType=function(t,r){const o=_.find(e.currentQuery.columns,(function(e){return e.column_name===t}));"Get suggestion..."===o.column_type&&a.getColumnsTypeSuggestion(e.currentQuery.query,[t]).success((function(e){o.column_type=e[t].column_type,o.column_type===r?n.info(l.instant("jdbc.same.suggested.sql.type",{type:o.column_type}),l.instant("jdbc.suggest.sql.type"),{allowHtml:!0}):n.success(l.instant("jdbc.suggested.sql.type",{type:o.column_type}),l.instant("jdbc.suggest.sql.type"),{allowHtml:!0}),o.sparql_type=e[t].sparql_type})).error((function(e){n.error(getError(e),l.instant("jdbc.not.suggest.column.type"))})),e.setDirty()},e.getColumnsSuggestions=function(){e.currentQuery.columns&&e.currentQuery.columns.length>0?c.openSimpleModal({title:l.instant("common.warning"),message:l.instant("jdbc.warning.column.type.msg"),warning:!0}).result.then((function(){T()})):T()},e.deleteColumn=function(t,n){c.openSimpleModal({title:l.instant("common.warning"),message:l.instant("jdbc.warning.delete.column.msg",{columnName:t}),warning:!0}).result.then((function(){e.currentQuery.columns.splice(n,1),e.setDirty()}))},e.getPreview=function(){if(S()&&(e.executedQueryTab=e.currentQuery,!e.queryIsRunning)){$.ajaxSetup().headers=$.ajaxSetup().headers||{};const t=r.getActiveRepositoryObject();$.ajaxSetup().headers["X-GraphDB-Repository"]=t?t.id:void 0,$.ajaxSetup().headers["X-GraphDB-Repository-Location"]=t?t.location:void 0,e.currentQuery.outputType="table",e.resetCurrentTabConfig(),m(!0,l.instant("jdbc.preview.first.rows",{name:e.name}),l.instant("common.extra.message"));const o=function(t,r,o){!function(t,r,o){t.results&&t.results.bindings&&t.results.bindings.length?(window.yasr.plugins.table.options.getCellContent=v,e.currentTabConfig.queryType="SELECT",window.yasr.setResponse(r,o,null)):n.info(l.instant("jdbc.table.definition"),l.instant("jdbc.preview.sql"))}(t,o,r),m(!1)},i=function(e){m(!1),n.error(getError(e,0,100),l.instant("jdbc.not.show.preview"))};if(e.canWriteActiveRepo()){const t=JSON.stringify({name:e.currentQuery.name,query:e.currentQuery.query,columns:e.currentQuery.columns||[]});a.getNewSqlTablePreview(t).done(o).fail(i)}else a.getExistingSqlTablePreview(e.currentQuery.name).done(o).fail(i)}},e.setDirty=function(){e.currentQuery.isPristine=!1},e.getTypeLabel=function(e){switch(e){case"iri":return"VARCHAR: IRI";case"string":return"VARCHAR: String";default:return e.indexOf(" ")>0?e:e.toUpperCase()}}}angular.module("graphdb.framework.jdbc.controllers",["ui.bootstrap","graphdb.framework.core.services.repositories","graphdb.framework.rest.monitoring.service","toastr"],["graphdb.framework.utils.notifications"]).controller("JdbcListCtrl",r).controller("JdbcCreateCtrl",o),r.$inject=["$scope","$repositories","JdbcRestService","toastr","ModalService","$translate"],o.$inject=["$scope","$location","toastr","$repositories","$window","$timeout","JdbcRestService","RDF4JRepositoriesRestService","SparqlRestService","ModalService","$translate"]},126:function(e,t){angular.module("graphdb.framework.rest.jdbc.service",[]).factory("JdbcRestService",n),n.$inject=["$http","$repositories","$translate"];function n(e,t){return{getJdbcConfigurations:function(){return e.get("rest/sql-views/tables")},getJdbcConfiguration:function(t){return e.get("rest/sql-views/tables/"+t)},createNewJdbcConfiguration:function(e){return n("POST","",e)},updateJdbcConfiguration:function(e){return n("PUT",e.name,e)},deleteJdbcConfiguration:function(t){return e.delete("rest/sql-views/tables/"+t)},getColumnNames:function(t){return e.post("rest/sql-views/columns",t,{headers:{Accept:"application/json","Content-Type":"text/plain"}})},getColumnsTypeSuggestion:function(n,r){if(!Array.isArray(r))throw new Error(t.instant("jdbc.column.names.constraint"));return e({method:"POST",url:"rest/sql-views/types",data:{query:n,column_names:r}})},getExistingSqlTablePreview:function(e,t){return $.ajax({method:"GET",url:"rest/sql-views/preview/"+e,params:{limit:t}})},getNewSqlTablePreview:function(e,t){return $.ajax({method:"POST",url:"rest/sql-views/preview",contentType:"application/json; charset=utf-8",dataType:"json",data:e,params:{limit:t},headers:{Accept:"application/sparql-results+json"}})}};function n(t,n,r){return e({method:t,url:"rest/sql-views/tables/"+n,noCancelOnRouteChange:!0,data:{name:r.name,query:r.query,columns:r.columns||[]}})}}},180:function(e,t,n){"use strict";n.r(t);n(7),n(23),n(79),n(22),n(125),n(126),n(66),n(61),n(71);angular.module("graphdb.framework.jdbc",["toastr","ui.bootstrap","graphdb.framework.jdbc.controllers","graphdb.framework.core.services.repositories","graphdb.framework.core.directives","graphdb.framework.rest.jdbc.service","graphdb.framework.core.directives.queryeditor.controllers","graphdb.framework.core.directives.queryeditor.sparqltab","graphdb.framework.core.directives.queryeditor.queryeditor"])},314:function(e,t){e.exports=function(){throw new Error("define cannot be used indirect")}},315:function(e,t){(function(t){e.exports=t}).call(this,{})},57:function(e,t){function n(e,t){return{showToastMessageWithDelay:function(n){return new Promise(r=>{e.success(t.instant(n)),setTimeout(r,200)})}}}angular.module("graphdb.framework.utils.notifications",[]).factory("Notifications",n),n.$inject=["toastr","$translate"]},61:function(e,t,n){"use strict";n.r(t);n(10),n(27);var r=n(0);function o(e,t,n,o,i,a,s,u,c,l,d,g,f,p,y){const m={id:"1",name:"",query:"select * where { \n\t?s ?p ?o .\n} limit 100 \n",inference:!0,sameAs:!0};let b,w;function h(t){!function(){if(o.isActiveRepoOntopType())return;const t=document.getElementById("sameAs");!t||e.currentQuery.inference||t.disabled?e.currentQuery.inference&&t.disabled&&(t.removeAttribute("disabled"),e.currentQuery.sameAs=b.appSettings.DEFAULT_SAMEAS):(t.disabled=!0,e.currentQuery.sameAs=!1)}(),e.tabs.forEach((function(n,r){n.id===t.id&&(e.tabs[r].query=t.query,o.isActiveRepoOntopType()||(e.tabs[r].inference=t.inference,e.tabs[r].sameAs=t.sameAs))})),f.set(p.TABS_STATE,e.tabs)}function T(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 C(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 v(){C(!0)}function q(t,n){n.newRepo&&(e.tabsData=f.get(p.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})),f.set(p.TABS_STATE,e.tabsData),e.tabs=e.tabsData,e.currentQuery={},e.errorMessage=null,e.repositoryError=null)}function S(e){t((function(){$('a[data-id = "'+e+'"]').tab("show")}),0)}function E(r,i){if(e.executedQueryTab=e.currentQuery,i){if("SELECT"!==window.editor.getQueryType()&&"CONSTRUCT"!==window.editor.getQueryType()&&"DESCRIBE"!==window.editor.getQueryType())return void n.warning(y.instant("query.editor.warning.msg"));if(o.isActiveRepoOntopType())return void n.warning(y.instant("query.editor.virtual.repo.warning.msg"))}if(e.explainRequested=i,!e.queryIsRunning){if(r?e.currentTabConfig.resultsCount=0:e.resetCurrentTabConfig(),e.lastRunQueryMode=window.editor.getQueryMode(),"update"===e.lastRunQueryMode&&o.isActiveRepoOntopType())return void n.warning(y.instant("query.editor.virtual.repo.update.warning.msg"));if(T(!0,"update"===e.lastRunQueryMode?y.instant("query.editor.executing.update"):y.instant("query.editor.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(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 M(t){for(let n=0;n<e.tabsData.length;n++){if(e.tabsData[n].id===t)return n}}e.getPrincipal=function(){return l.getPrincipal().then(t=>{b=t,function(e,t){m.inference=t.appSettings.DEFAULT_INFERENCE,m.sameAs=t.appSettings.DEFAULT_SAMEAS,e.skipCountQuery=!t.appSettings.EXECUTE_COUNT,e.ignoreSharedQueries=t.appSettings.IGNORE_SHARED_QUERIES,e.tabsData=e.tabs=f.get(p.TABS_STATE)||[m],e.$watchCollection("[currentQuery.inference, currentQuery.sameAs]",(function(e,t,n){h(n.currentQuery)})),e.$on("repositoryIsSet",q)}(e,b)})},e.getPrincipal(),this.hint=document.createElement("span"),this.hint.innerHTML=y.instant("query.editor.autocomplete.hint"),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=M(t);if(void 0===n)return{};const r=e.tabsData[n];return e.saveQueryToLocal(r),r},e.loadTab=function(n){e.tabsData=f.get(p.TABS_STATE)||[m];const r=M(n),i=e.tabsData[r];i.yasrData&&T(!0,y.instant("query.editor.render.results.msg"),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}},T(!1)):t((function(){e.setYasrResponse(i.yasrData,i.textStatus,i.jqXhrOrErrorString),T(!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),f.set(p.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"),w||(w=setInterval(x,200));!function(){const t=o.isActiveRepoOntopType(),n=o.isActiveRepoFedXType();(function(e){const t=document.getElementById("sameAs"),n=document.getElementById("inference");t&&(t.disabled=!!e);n&&(n.disabled=!!e)})(t),e.nocount=!(!t&&!n)||!b.appSettings.EXECUTE_COUNT,t&&(e.currentQuery.inference=!0,e.currentQuery.sameAs=!0)}()},e.addNewTab=function(n,r,o){if(!j(!0))return;let i;i=r||o?{id:"1",name:r,query:o,inference:b.appSettings.DEFAULT_INFERENCE,sameAs:b.appSettings.DEFAULT_SAMEAS}:{id:"1",name:"",query:"select * where { \n\t?s ?p ?o .\n} limit 100 \n",inference:b.appSettings.DEFAULT_INFERENCE,sameAs:b.appSettings.DEFAULT_SAMEAS};D++;const a=""+D;e.tabsData=e.tabs;const s=i;s.id=a,e.tabsData.push(s),f.set(p.TABS_STATE_MAXID,D),f.set(p.TABS_STATE,e.tabsData);const u=Array.prototype.slice.call(arguments,1);t((function(){e.$apply(),S(a),n&&n.apply(this,u)}),0),e.tabs=e.tabsData},e.isTabChangeOk=j,e.runQuery=E,e.abortCurrentQuery=function(){g.deleteQuery(e.currentTrackAlias,o.getActiveRepository()).success((function(){e.abortRequested=!0}))},e.editQuery=function(t){i.open({templateUrl:"js/angular/core/directives/queryeditor/templates/query-sample.html",controller:"QuerySampleModalCtrl",resolve:{data:function(){return{title:y.instant("query.editor.edit.saved.query",{name:t.name}),query:t,edit:!0,okButtonText:y.instant("common.save.btn")}}}}).result.then((function(r){const o={name:r.name,body:r.body,shared:r.shared};t.name!==r.name?s.addNewSavedQuery(o).success((function(){e.deleteQueryHttp(t.name,!0)})).error((function(e){const t=getError(e);n.error(t,y.instant("query.editor.edit.saved.query.error"))})):s.editSavedQuery(o).success((function(){$("#editQueryContainer").modal("hide"),e.toggleSampleQueries(),n.success(y.instant("query.editor.edit.saved.query.success.msg",{name:t.name}))})).error((function(e){const t=getError(e);n.error(t,y.instant("query.editor.edit.saved.query.error"))}))}))},e.getNamespaces=function(){T(!0,y.instant("common.refreshing.namespaces"),y.instant("common.extra.message")),e.namespacesLoading=!0,d.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(){T(!1),e.namespacesLoading=!1}))},e.changePagination=function(){E(!0,e.explainRequested)},e.toggleSampleQueries=function(){s.getSavedQueries().success((function(t){e.sampleQueries=t.filter(t=>!e.ignoreSharedQueries||t.owner!==e.principal.username)})).error((function(e){const t=getError(e);n.error(t,y.instant("query.editor.get.saved.queries.error"))}))},e.addKnownPrefixes=function(){s.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,y.instant("common.add.known.prefixes.error")),!0}))},e.getExistingTabId=Q,e.querySelected=function(t){const n=Q(t);e.toggleSampleQueries(),e.isTabChangeOk(!1)&&(e.highlightNextTabChange=!0,angular.isDefined(n)?S(n):e.addNewTab(null,t.name,t.body))},e.deleteQuery=function(t){a.openSimpleModal({title:y.instant("common.confirm"),message:y.instant("query.editor.delete.saved.query.warning.msg",{savedQueryName:t}),warning:!0}).result.then((function(){e.deleteQueryHttp(t)}))},e.deleteQueryHttp=function(t,r){s.deleteSavedQuery(t).success((function(){e.toggleSampleQueries(),r||n.success(y.instant("query.editor.delete.saved.query.success.msg",{savedQueryName:t}))})).error((function(e){const t=getError(e);n.error(t,y.instant("query.editor.delete.saved.query.error"))}))},e.saveQuery=function(t,n){i.open({templateUrl:"js/angular/core/directives/queryeditor/templates/query-sample.html",controller:"QuerySampleModalCtrl",resolve:{data:function(){return{title:y.instant("query.editor.create.saved.query.msg"),query:{name:t.name,body:t.query,shared:t.shared},edit:!1,okButtonText:y.instant("common.create.btn"),queryExists:n,existingQueryErrMsg:Object(r.decodeHTML)(y.instant("query.sample.existing.query.warning",{name:t.name}))}}}}).result.then((function(t){e.saveQueryHttp(t)}),(function(){}))},e.saveQueryHttp=function(t){s.addNewSavedQuery(t).success((function(){n.success(y.instant("query.editor.save.saved.query.success.msg",{name:t.name}))})).error((function(r,o){const i=getError(r);n.error(i,y.instant("query.editor.create.saved.query.error"));let a=!1;409===o&&(a=!0),t.query=t.body,e.saveQuery(t,a)}))},e.saveQueryToLocal=h,e.setLoader=T,e.getLoaderMessage=function(){const t=(Date.now()-e.queryStartTime)/1e3;let n="",r="";e.noLoaderTimer||(n=e.getHumanReadableSeconds(t));r=e.progressMessage?y.instant("query.editor.progress.msg",{progressMessage:e.progressMessage,timeHuman:n}):y.instant("common.running.operation",{timeHuman:n});e.extraMessage&&t>10&&(r+=y.instant("query.editor.extra.msg",{extraMessage:e.extraMessage}));return r},e.fixSizesOnHorizontalViewModeSwitch=C,e.changeViewMode=function(){e.viewMode="none",e.orientationViewMode=!e.orientationViewMode,f.set(p.VIEW_MODE,e.orientationViewMode),C()},e.showHideEditor=v,e.focusQueryEditor=function(){angular.element(document).find(".editable-input").is(":focus")||angular.element(document).find(".CodeMirror textarea:first-child").focus()},e.orientationViewMode=!f.get(p.VIEW_MODE)||"true"===f.get(p.VIEW_MODE),e.viewMode="none",e.getActiveRepository=function(){return o.getActiveRepository()},e.getActiveRepositoryNoError=function(){if(!e.repositoryError)return o.getActiveRepository()},e.orientationViewMode||v(),window.onbeforeunload=function(){e.currentQuery&&e.saveTab(e.currentQuery.id),f.set(p.TABS_STATE,e.tabs)},e.$on("$destroy",(function(){e.currentQuery&&e.saveTab(e.currentQuery.id),f.set(p.TABS_STATE,e.tabs),clearInterval(w)})),e.$on("$destroy",(function(){clearInterval(w),window.editor=null,window.yasr=null}));let D=f.get(p.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 j(t){return!(e.queryIsRunning&&!e.namespacesLoading)||(t?n.info(y.instant("query.editor.new.tab.running.query.warning.msg")):n.info(y.instant("query.editor.tab.switching.running.query.warning.msg")),!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=["var(--primary-color)","","var(--primary-color)"],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.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=y.instant("query.editor.showing.results.from.msg")+u("currency")(e.currentTabConfig.offset,"",0)+y.instant("query.editor.to")+u("currency")(n,"",0),e.currentTabConfig.allResultsCount>0&&(t+=y.instant(e.currentTabConfig.allResultsCountExact?"query.editor.of":"query.editor.of.at.least"),t+=u("currency")(e.currentTabConfig.allResultsCount,"",0)),t+="."}return t},e.getUpdateDescription=function(){return e.currentTabConfig.customUpdateMessage?y.instant(e.currentTabConfig.customUpdateMessage.msg,{name:e.currentTabConfig.customUpdateMessage.name}):void 0===e.currentTabConfig.sizeDelta?"":e.currentTabConfig.sizeDelta<0?y.instant("yasr.removed.statements.result.msg",{sizeDelta:Math.abs(e.currentTabConfig.sizeDelta)}):e.currentTabConfig.sizeDelta>0?y.instant("yasr.added.statements.result.msg",{sizeDelta:e.currentTabConfig.sizeDelta}):y.instant("yasr.statements.no.change.msg")},e.getStaleWarningMessage=function(){const t=60*Math.round((Date.now()-e.currentTabConfig.timeFinished)/6e4);if(t>=3600)return y.instant("yasr.stale.result.msg",{secondsAgo:e.getHumanReadableSeconds(t)})};const k=function(){};angular.element(c).bind("resize",k),e.$on("$destroy",(function(){angular.element(c).unbind("resize",k)}))}function i(e,t,n,r){n.queryExists&&(e.queryExists=!0),e.query=_.cloneDeep(n.query),e.title=n.title,e.edit=n.edit,e.okButtonText=n.okButtonText,e.existingQueryErrMsg=r.trustAsHtml(n.existingQueryErrMsg),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",o).controller("QuerySampleModalCtrl",i),o.$inject=["$scope","$timeout","toastr","$repositories","$uibModal","ModalService","SparqlRestService","$filter","$window","$jwtAuth","RDF4JRepositoriesRestService","MonitoringRestService","LocalStorageAdapter","LSKeys","$translate"],i.$inject=["$scope","$uibModalInstance","data","$sce"]},66:function(e,t,n){"use strict";n.r(t);n(10);function r(e,t,n,r){return{restrict:"AE",template:'<a class="nav-link" role="tab" data-toggle="tab" blur="submit" editable-text="tab.name" e-form="editCurrentlySelectedOnly" ng-click="selectThisTab($event)" ng-dblclick="editCurrentTab()" ><span ng-class="{\'text-muted\': !tab.name}">{{ tab.name || (\'sparql.tab.directive.unnamed.tab.title\' | translate)}}</span><button type="button" ng-click="deleteTab($event)" class="btn btn-link btn-sm secondary delete-sparql-tab-btn" title="Delete tab"><i class="icon-close"></i></button></a>',replace:!0,controller:["$scope","$element","$rootScope","ModalService","toastr","$translate",function(e,r,o,i,a,s){function u(e){return $(e).attr("data-id")}function c(e){$('a[data-id = "'+e+'"]').tab("show")}e.state={},$(r).on("shown.bs.tab",(function(e){o.$broadcast("tabAction",e)})),e.deleteTab=function(l){if(l.preventDefault(),l.stopPropagation(),e.tabs.length<2)return void a.warning(s.instant("sparql.tab.directive.close.last.warning"));l.shiftKey?(e.state.selectedTabId=u(r),i.openSimpleModal({title:s.instant("common.confirm"),message:s.instant("sparql.tab.directive.delete.all.tabs.warning"),warning:!0}).result.then((function(){var r;r=e.state.selectedTabId,e.tabs=e.tabs.filter((function(e){if(e.id===r)return e})),c(e.tabs[0].id),t.set(n.TABS_STATE,e.tabs),o.$broadcast("deleteAllexeptSelected",e.tabs)}))):(e.state.idForDelete=u(r),i.openSimpleModal({title:s.instant("common.confirm"),message:s.instant("sparql.tab.directive.close.tab.warning"),warning:!0}).result.then((function(){!function(t){if(angular.isUndefined(t))throw"Delete by id was called with undefined id";const n=function(t){for(let n=0;n<e.tabs.length;n++){if(e.tabs[n].id===t)return n}}(t);e.tabs.splice(n,1),t===e.currentQuery.id&&e.tabs.length>0&&c(n>0?e.tabs[n-1].id:e.tabs[0].id)}(e.state.idForDelete)})));angular.element(document).find(".CodeMirror textarea:first-child").focus()},e.editCurrentTab=function(){if(u(r)!==e.currentQuery.id)return;e.editCurrentlySelectedOnly.$show();const t=$(".editable-buttons");t.children(".btn.btn-primary").addClass("btn-sm"),t.children(".btn.btn-default").addClass("btn-sm"),$(".editable-controls .editable-input").addClass("form-control-sm").on("change",(function(t){e.currentQuery.name=t.currentTarget.$$currentValue})),$(".editable-buttons .glyphicon.glyphicon-ok").removeClass("glyphicon glyphicon-ok").addClass("fa fa-check"),$(".editable-buttons .glyphicon.glyphicon-remove").removeClass("glyphicon glyphicon-remove").addClass("fa fa-close")},e.selectThisTab=function(t){t.preventDefault(),t.stopPropagation(),e.isTabChangeOk(!1)&&$(r).tab("show")}}]}}angular.module("graphdb.framework.core.directives.queryeditor.sparqltab",["graphdb.framework.core","graphdb.framework.utils.localstorageadapter"]).directive("sparqlTab",r),r.$inject=["$rootScope","LocalStorageAdapter","LSKeys","ModalService"]}}]);
@@ -1 +0,0 @@
1
- (window.webpackJsonp=window.webpackJsonp||[]).push([[52,163],{125:function(e,n,t){"use strict";t.r(n);t(7),t(22),t(26),t(57);function r(e,n,t,r,o,i){e.getSqlConfigurations=function(){!n.getActiveRepository()||n.isActiveRepoOntopType()||n.isActiveRepoFedXType()?e.jdbcConfigurations=[]:t.getJdbcConfigurations().success((function(n){e.jdbcConfigurations=n})).error((function(e){const n=getError(e);r.error(n,i.instant("jdbc.not.get.SQL.msg"))}))},e.$watch((function(){return n.getActiveRepository()}),(function(){e.getSqlConfigurations()})),e.deleteConfiguration=function(n){o.openSimpleModal({title:i.instant("common.warning"),message:i.instant("jdbc.delete.sql.table.warning.msg",{name:n}),warning:!0}).result.then((function(){t.deleteJdbcConfiguration(n).success((function(){e.getSqlConfigurations()})).error((function(e){r.error(getError(e),i.instant("jdbc.not.delete.sql.msg"))}))}))}}function o(e,n,t,r,o,i,s,u,c,a,l){e.name=n.search().name||"",e.getNamespaces=function(){y(!0,l.instant("common.refreshing.namespaces"),l.instant("common.extra.message")),u.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(){y(!1),w()}))},e.setLoader=y,e.addKnownPrefixes=C,e.page=1,e.noPadding={paddingRight:0,paddingLeft:0},e.sqlTypes=["string","iri","boolean","byte","short","int","long","float","double","decimal","date","time","timestamp","Get suggestion..."],e.currentTabConfig={},e.orientationViewMode=!0,e.currentQuery={},e.$watch((function(){return r.getActiveRepository()}),(function(e,t){e!==t&&n.path("jdbc")}));let g=null;e.goBack=function(){g=i((function(){o.history.back()}),1e3)};const d=e.$on("$locationChangeStart",(function(n){!function(n){e.currentQuery.isPristine||(confirm(l.instant("jdbc.warning.unsaved.changes"))?(window.removeEventListener("beforeunload",f),d(),i.cancel(g)):n.preventDefault())}(n)}));function f(n){e.currentQuery.isPristine||(n.returnValue=!0)}window.addEventListener("beforeunload",f),e.$on("$destroy",(function(e){window.removeEventListener("beforeunload",f),d(),i.cancel(g)}));const m={id:"1",name:"",query:"PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>\n\n# Selects two variables to use as columns\nSELECT ?id ?label {\n ?id rdfs:label ?label\n # The following placeholder must be present in the query\n #!filter\n}",inference:!0,sameAs:!0,isNewConfiguration:!0,isPristine:!0};var p;function y(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 w(){e.tabsData=[e.currentQuery];const n=e.currentQuery;e.currentQuery.query?window.editor.setValue(e.currentQuery.query):window.editor.setValue(" "),i((function(){e.currentTabConfig={},e.currentTabConfig.queryType=n.queryType,e.currentTabConfig.resultsCount=n.resultsCount,e.currentTabConfig.offset=n.offset,e.currentTabConfig.allResultsCount=n.allResultsCount,e.currentTabConfig.page=n.page,e.currentTabConfig.pageSize=n.pageSize,e.currentTabConfig.timeFinished=n.timeFinished,e.currentTabConfig.timeTook=n.timeTook,e.currentTabConfig.sizeDelta=n.sizeDelta,e.$apply()}),0),e.canWriteActiveRepo()||(window.editor.options.readOnly=!0)}function b(){e.tabsData=e.tabs=[m],e.currentQuery=_.cloneDeep(m),v(),window.editor&&(e.setQuery(e.currentQuery.query),w()),e.$watch((function(){return e.currentQuery.query}),(function(n,t){n!==t&&e.setDirty()}))}function C(){c.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 n=getError(e);return t.error(n,l.instant("common.add.known.prefixes.error")),!0}))}function h(){j()&&s.getColumnNames(e.currentQuery.query).success((function(n){s.getColumnsTypeSuggestion(e.currentQuery.query,n).success((function(t){const r=[];_.forEach(n,(function(e){r.push({column_name:e,column_type:t[e].column_type,nullable:!0,sparql_type:t[e].sparql_type})})),e.currentQuery.columns=r,e.setDirty()})).error((function(e){t.error(getError(e),l.instant("jdbc.not.suggest.column.types"))}))})).error((function(e){t.error(getError(e),l.instant("jdbc.not.suggest.column.names"))}))}function v(){2===e.page?e.viewMode="editor":e.viewMode="none"}function Q(e,n,t,r,o){let i=t[r].value;i=i.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;");return"<div class = 'literal-cell'>"+("<p class='nonUri' style='border: none; background-color: transparent; padding: 0; margin: 0'>"+i+"</p>")+"</div>"}function T(){return window.editor&&"SELECT"===window.editor.getQueryType()}function q(){return j()&&function(){if(!e.currentQuery.columns||!e.currentQuery.columns.length)return t.error(l.instant("jdbc.warning.one.column.msg"),l.instant("jdbc.invalid.columns")),!1;if(e.containsUnknownColumns())return t.error(l.instant("jdbc.warning.all.column.msg"),l.instant("jdbc.invalid.columns")),!1;return!0}()}function j(){return!!T()||(t.error(l.instant("jdbc.warning.invalid.query"),l.instant("jdbc.invalid.query)")),!1)}e.resetCurrentTabConfig=function(){e.currentTabConfig={pageSize:100,page:1,allResultsCount:0,resultsCount:0,queryType:""}},e.saveTab=function(){},e.setQuery=function(e){window.editor.setValue(e||" ")},e.name?(p=e.name,s.getJdbcConfiguration(p).success((function(e){m.query=e.query,m.name=e.name,m.columns=e.columns,m.isNewConfiguration=!e.name,b()})).error((function(e){const n=getError(e);t.error(n,l.instant("jdbc.not.get.sql.msg2"))}))):b(),e.goToPage=function(n){e.page=n;const t=e.currentQuery.columns;2!==n||t&&0!==t.length||!T()||e.getColumnsSuggestions(),v()},e.save=function(){q()&&(e.currentQuery.name?e.currentQuery.isNewConfiguration?s.createNewJdbcConfiguration(e.currentQuery).success((function(){e.currentQuery.isPristine=!0,e.currentQuery.isNewConfiguration=!1,t.success(l.instant("jdbc.saved.configuration")),e.goBack()})).error((function(e){const n=getError(e);t.error(n,l.instant("jdbc.not.saved.configuration"))})):s.updateJdbcConfiguration(e.currentQuery).success((function(){e.currentQuery.isPristine=!0,e.currentQuery.isNewConfiguration=!1,t.success(l.instant("jdbc.configuration.updated")),e.goBack()})).error((function(e){const n=getError(e);t.error(n,l.instant("jdbc.not.saved.configuration"))})):t.error(l.instant("jdbc.required.configuration.name")))},e.hasPrecision=function(e){return"iri"===e||"string"===e||"decimal"===e},e.containsColumnsWithPrecision=function(n){return n&&n.some(n=>e.hasPrecision(n.column_type))},e.hasScale=function(e){return"decimal"===e},e.containsColumnsWithScale=function(n){return n&&n.some(n=>e.hasScale(n.column_type))},e.isLiteral=function(e){return"iri"!==e&&"unknown"!==e},e.containsNonLiteralColumnsOnly=function(n){return n&&n.every(n=>!e.isLiteral(n.column_type))},e.containsUnknownColumns=function(){return e.currentQuery.columns&&e.currentQuery.columns.find(e=>"unknown"===e.column_type)},$("textarea").on("paste",(function(){i((function(){C()}),0)})),e.selectColumnType=function(n,r){const o=_.find(e.currentQuery.columns,(function(e){return e.column_name===n}));"Get suggestion..."===o.column_type&&s.getColumnsTypeSuggestion(e.currentQuery.query,[n]).success((function(e){o.column_type=e[n].column_type,o.column_type===r?t.info(l.instant("jdbc.same.suggested.sql.type",{type:o.column_type}),l.instant("jdbc.suggest.sql.type"),{allowHtml:!0}):t.success(l.instant("jdbc.suggested.sql.type",{type:o.column_type}),l.instant("jdbc.suggest.sql.type"),{allowHtml:!0}),o.sparql_type=e[n].sparql_type})).error((function(e){t.error(getError(e),l.instant("jdbc.not.suggest.column.type"))})),e.setDirty()},e.getColumnsSuggestions=function(){e.currentQuery.columns&&e.currentQuery.columns.length>0?a.openSimpleModal({title:l.instant("common.warning"),message:l.instant("jdbc.warning.column.type.msg"),warning:!0}).result.then((function(){h()})):h()},e.deleteColumn=function(n,t){a.openSimpleModal({title:l.instant("common.warning"),message:l.instant("jdbc.warning.delete.column.msg",{columnName:n}),warning:!0}).result.then((function(){e.currentQuery.columns.splice(t,1),e.setDirty()}))},e.getPreview=function(){if(q()&&(e.executedQueryTab=e.currentQuery,!e.queryIsRunning)){$.ajaxSetup().headers=$.ajaxSetup().headers||{};const n=r.getActiveRepositoryObject();$.ajaxSetup().headers["X-GraphDB-Repository"]=n?n.id:void 0,$.ajaxSetup().headers["X-GraphDB-Repository-Location"]=n?n.location:void 0,e.currentQuery.outputType="table",e.resetCurrentTabConfig(),y(!0,l.instant("jdbc.preview.first.rows",{name:e.name}),l.instant("common.extra.message"));const o=function(n,r,o){!function(n,r,o){n.results&&n.results.bindings&&n.results.bindings.length?(window.yasr.plugins.table.options.getCellContent=Q,e.currentTabConfig.queryType="SELECT",window.yasr.setResponse(r,o,null)):t.info(l.instant("jdbc.table.definition"),l.instant("jdbc.preview.sql"))}(n,o,r),y(!1)},i=function(e){y(!1),t.error(getError(e,0,100),l.instant("jdbc.not.show.preview"))};if(e.canWriteActiveRepo()){const n=JSON.stringify({name:e.currentQuery.name,query:e.currentQuery.query,columns:e.currentQuery.columns||[]});s.getNewSqlTablePreview(n).done(o).fail(i)}else s.getExistingSqlTablePreview(e.currentQuery.name).done(o).fail(i)}},e.setDirty=function(){e.currentQuery.isPristine=!1},e.getTypeLabel=function(e){switch(e){case"iri":return"VARCHAR: IRI";case"string":return"VARCHAR: String";default:return e.indexOf(" ")>0?e:e.toUpperCase()}}}angular.module("graphdb.framework.jdbc.controllers",["ui.bootstrap","graphdb.framework.core.services.repositories","graphdb.framework.rest.monitoring.service","toastr"],["graphdb.framework.utils.notifications"]).controller("JdbcListCtrl",r).controller("JdbcCreateCtrl",o),r.$inject=["$scope","$repositories","JdbcRestService","toastr","ModalService","$translate"],o.$inject=["$scope","$location","toastr","$repositories","$window","$timeout","JdbcRestService","RDF4JRepositoriesRestService","SparqlRestService","ModalService","$translate"]},57:function(e,n){function t(e,n){return{showToastMessageWithDelay:function(t){return new Promise(r=>{e.success(n.instant(t)),setTimeout(r,200)})}}}angular.module("graphdb.framework.utils.notifications",[]).factory("Notifications",t),t.$inject=["toastr","$translate"]}}]);