graphdb-workbench 2.7.0-RC2 → 2.7.0-RC4
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.c2b5d87a7e6f853df225.bundle.js → 10.ce305151da3c9af58aad.bundle.js} +1 -1
- package/dist/{11.019c95d9d3e48f128001.bundle.js → 11.e440b7bed78eefd4f85a.bundle.js} +1 -1
- package/dist/{12.3eba2ce927223d6beaae.bundle.js → 12.27901cde5137cef7ebd9.bundle.js} +1 -1
- package/dist/13.73f9ba20665547175128.bundle.js +1 -0
- package/dist/{14.d4c62f427432d74a286e.bundle.js → 14.58ab8f49a90296b65686.bundle.js} +1 -1
- package/dist/149.fa1d474cfaf6b767889b.bundle.js +1 -1
- package/dist/{153.20647b70a0991741b133.bundle.js → 153.7249b1b2b0ab80c53e87.bundle.js} +1 -1
- package/dist/{17.f97ce9ca8c87ba2dc2f5.bundle.js → 17.61150aea9442c9814294.bundle.js} +2 -2
- package/dist/{18.fa5f92b1325d6c237490.bundle.js → 18.c922a4fb70ba4a120a7a.bundle.js} +1 -1
- package/dist/{183.d02eb491d82a20662078.bundle.js → 183.7768f56fc77e5a16d4ff.bundle.js} +1 -1
- package/dist/{19.d25fcec1a634b83a4ab5.bundle.js → 19.aa6e3b73dc45c5a3035e.bundle.js} +2 -2
- package/dist/{195.b79966a034a4bde84b69.bundle.js → 195.e2715a3321ecc8164188.bundle.js} +1 -1
- package/dist/{2.29a14f778c53393e96b5.bundle.js → 2.581f30abc14038706ded.bundle.js} +2 -2
- package/dist/{21.83559c0ea33f912ece16.bundle.js → 21.d96ddea8d7e8b867a63c.bundle.js} +1 -1
- package/dist/{22.0fa3c8910376d3560df6.bundle.js → 22.02e8b7b0709262b2e06c.bundle.js} +1 -1
- package/dist/{23.f80e6c86fdefaa8beb7b.bundle.js → 23.15edc73a618d1d6a9a01.bundle.js} +1 -1
- package/dist/{24.f18e0c402a2edbe15a21.bundle.js → 24.294d31e50bae2567c146.bundle.js} +1 -1
- package/dist/{25.5883938465085bed6a70.bundle.js → 25.1a1ee5e65c44791876c8.bundle.js} +1 -1
- package/dist/{27.a2d2a0aeca206f315ff4.bundle.js → 27.2045bafbfb60ed2b845c.bundle.js} +1 -1
- package/dist/{275.52fa7d7d23192c71c15d.bundle.js → 275.f6045911522b9f4e92c1.bundle.js} +1 -1
- package/dist/{28.d9a0920f543c599508f7.bundle.js → 28.8699576c7fe3a1d8fc03.bundle.js} +1 -1
- package/dist/29.15213e151364f5ecfcd5.bundle.js +1 -1
- package/dist/300.cef8eccb11324bcfdb36.bundle.js +1 -1
- package/dist/302.7a5d2ba28bd6479a77be.bundle.js +1 -1
- package/dist/303.e817b957f010153de97a.bundle.js +1 -1
- package/dist/304.fd2e766c67cd966f6751.bundle.js +1 -1
- package/dist/{32.1500547152b61817bf4b.bundle.js → 32.f778720d1f10edf95fe6.bundle.js} +1 -1
- package/dist/{33.658b4b7dfd8907299bd2.bundle.js → 33.7de66dd3c9e2630bbe2f.bundle.js} +1 -1
- package/dist/333.9f051c77b4c6747b320c.bundle.js +1 -1
- package/dist/{34.b083f40f22c7cba13c9b.bundle.js → 34.5b8a3444a651893bb5a5.bundle.js} +1 -1
- package/dist/{35.6e98d4f02ec70ab9c18d.bundle.js → 35.cb6e9c691883bc18bee5.bundle.js} +1 -1
- package/dist/{36.514b83c5c76d798f194b.bundle.js → 36.75c914cb6b09164de5fc.bundle.js} +1 -1
- package/dist/{38.ee84d1f49e7b0dd1ab19.bundle.js → 38.f6041187665bc215d153.bundle.js} +1 -1
- package/dist/42.52befbab22e69bb433f4.bundle.js +1 -1
- package/dist/{43.aa5e0ebcdf8f97aa89fa.bundle.js → 43.51797617f14c61a5cce9.bundle.js} +1 -1
- package/dist/44.7097ceaa507506d35977.bundle.js +1 -0
- package/dist/51.ebafb19025c2f912a73d.bundle.js +1 -1
- package/dist/{59.6f241e911b33e8f887bd.bundle.js → 59.53531269a8e4d1db4a18.bundle.js} +1 -1
- package/dist/{6.06c5378d91089fc0d3c0.bundle.js → 6.804dbf883e52a8933e16.bundle.js} +1 -1
- package/dist/{67.147b4b01815dbf0fb888.bundle.js → 67.d66b2a07784d748382b9.bundle.js} +1 -1
- package/dist/{68.bbb9167b9a325038c4c5.bundle.js → 68.522250906a7247f87fd2.bundle.js} +1 -1
- package/dist/{73.49f51849b45a708ecef3.bundle.js → 73.c2d512008af03be5b97f.bundle.js} +1 -1
- package/dist/76.ba3fe7e40f243d6c7c4a.bundle.js +1 -0
- package/dist/{8.02e89c644497d344f233.bundle.js → 8.af3c6a52fb5920ace418.bundle.js} +1 -1
- package/dist/{9.843879ddf6bab478ae3d.bundle.js → 9.deafb4fc416741d5d621.bundle.js} +1 -1
- package/dist/{96.6a570ad81b7588bffb76.bundle.js → 96.babb34b1317abe847f48.bundle.js} +1 -1
- package/dist/{bundle.a0c228dbfde457104657.bundle.js → bundle.f15808f9a6068388d32f.bundle.js} +5 -5
- package/dist/index.html +3 -3
- package/dist/js/angular/core/directives/autocomplete/templates/autocomplete.html +1 -1
- package/dist/js/angular/core/directives/operations-statuses-monitor/templates/operations-statuses-monitor.html +1 -1
- package/dist/js/angular/core/directives/rdfresourcesearch/templates/rdfResourceSearchTemplate.html +1 -1
- package/dist/js/angular/core/directives/yasgui-component/templates/yasgui-component.html +1 -1
- package/dist/js/angular/security/templates/user.html +1 -1
- package/dist/license-checker.json +2 -2
- package/dist/pages/aclmanagement.html +2 -2
- package/dist/pages/autocomplete.html +1 -1
- package/dist/pages/choose-repository-type.html +1 -1
- package/dist/pages/cluster-management/clusterInfo.html +3 -3
- package/dist/pages/create-index.html +1 -1
- 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 +8 -8
- package/dist/pages/graphs-visualizations.html +7 -7
- package/dist/pages/guides.html +1 -1
- package/dist/pages/import.html +2 -2
- package/dist/pages/jdbc-create.html +1 -1
- package/dist/pages/monitor/backup-and-restore.html +1 -1
- package/dist/pages/monitor/queries.html +1 -1
- package/dist/pages/monitor/resources.html +1 -1
- package/dist/pages/namespaces.html +2 -2
- package/dist/pages/plugins.html +1 -1
- package/dist/pages/rdfClassHierarchyInfo.html +7 -7
- package/dist/pages/rdfrank.html +2 -2
- package/dist/pages/repositories.html +1 -1
- package/dist/pages/repository.html +1 -1
- package/dist/pages/similarity-indexes.html +1 -1
- package/dist/pages/sparql-editor.html +1 -1
- package/dist/pages/sparql-template-create.html +1 -1
- package/dist/pages/ux-test1.html +2 -2
- package/dist/pages/webapi.html +2 -2
- package/dist/res/swagger5/index.html +12 -12
- package/package.json +1 -1
- package/dist/13.d2b2f107c437155c7902.bundle.js +0 -1
- package/dist/44.dfaaad81b2f47956d038.bundle.js +0 -1
- package/dist/76.689c7abcb01082bcf286.bundle.js +0 -1
- /package/dist/{30.da81fc6adae87760bef3.bundle.js → 30.c8e21736ca2a4afad5e1.bundle.js} +0 -0
- /package/dist/{45.35f80633b00a33777b62.bundle.js → 45.a81310b7f09b158f7422.bundle.js} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
(window.webpackJsonp=window.webpackJsonp||[]).push([[10,34,46,55,195,203,215,216,217,218,221,273],{104:function(e,i,t){"use strict";t.r(i),t.d(i,"SimilarityQueryType",(function(){return r}));const r={DATA:"DATA",SEARCH:"SEARCH",ANALOGICAL:"ANALOGICAL"}},105:function(e,i,t){"use strict";t.r(i),t.d(i,"mapIndexesResponseToSimilarityIndex",(function(){return n}));var r=t(76);const n=e=>e.map(e=>{const i=new r.SimilarityIndex;return i.type=e.type,i.stopList=e.stopList,i.status=e.status,i.selectQuery=e.selectQuery,i.searchQuery=e.searchQuery,i.sameAs=e.sameAs,i.options=e.options,i.name=e.name,i.infer=e.infer,i.analyzer=e.analyzer,i.analogicalQuery=e.analogicalQuery,i})},221:function(e,i,t){"use strict";t.r(i),t.d(i,"SimilarityIndexError",(function(){return r}));class r extends Error{}},222:function(e,i,t){"use strict";t.r(i),t.d(i,"SimilarityIndexInfo",(function(){return y}));var r=t(76),n=t(104),s=t(64);const a=new RegExp("^[a-zA-Z0-9-_]+$");class y{constructor(){this.similarityIndex=new r.SimilarityIndex,this.isNameExist=!1,this.invalidSelectQueryType=!1,this.invalidSelectQuery=!1,this.invalidSearchQueryType=!1,this.invalidSearchQuery=!1,this.invalidAnalogicalQueryType=!1,this.invalidAnalogicalQuery=!1,this.selectedQueryType=n.SimilarityQueryType.DATA,this.selectedYasguiRenderMode=s.RenderingMode.YASQE}setQuery(e,i){const t=i||this.selectedQueryType;n.SimilarityQueryType.DATA!==t?n.SimilarityQueryType.SEARCH!==t?n.SimilarityQueryType.ANALOGICAL===t&&(this.similarityIndex.analogicalQuery=e):this.similarityIndex.searchQuery=e:this.similarityIndex.selectQuery=e}getQuery(e){switch(e||this.selectedQueryType){case n.SimilarityQueryType.DATA:return this.similarityIndex.selectQuery;case n.SimilarityQueryType.SEARCH:return this.similarityIndex.searchQuery;case n.SimilarityQueryType.ANALOGICAL:return this.similarityIndex.analogicalQuery}}markInvalidQuery(e,i=!0){const t=e||this.selectedQueryType;n.SimilarityQueryType.DATA!==t?n.SimilarityQueryType.SEARCH!==t?n.SimilarityQueryType.ANALOGICAL===t&&(this.invalidAnalogicalQuery=i):this.invalidSearchQuery=i:this.invalidSelectQuery=i}markInvalidQueryType(e,i=!0){const t=e||this.selectedQueryType;n.SimilarityQueryType.DATA!==t?n.SimilarityQueryType.SEARCH!==t?n.SimilarityQueryType.ANALOGICAL===t&&(this.invalidAnalogicalQueryType=i):this.invalidSearchQueryType=i:this.invalidSelectQueryType=i}setSelectedQueryType(e){this.selectedQueryType=e}getSelectedQueryType(){return this.selectedQueryType}setSelectedYasguiRenderMode(e){this.selectedYasguiRenderMode=e}getSelectedYasguiRenderMode(){return this.selectedYasguiRenderMode}isDataQueryTypeSelected(){return n.SimilarityQueryType.DATA===this.selectedQueryType}isSearchQueryTypeSelected(){return n.SimilarityQueryType.SEARCH===this.selectedQueryType}isAnalogicalQueryTypeSelected(){return n.SimilarityQueryType.ANALOGICAL===this.selectedQueryType}isTextType(){return this.similarityIndex.isTextType()}isPredicationType(){return this.similarityIndex.isPredicationType()}isTextLiteralType(){return this.similarityIndex.isTextLiteralType()}hasName(){return!!this.similarityIndex.name}isNameValid(){return a.test(this.similarityIndex.name)}hasSelectQuery(){return!!this.similarityIndex.selectQuery}hasSearchQuery(){return!!this.similarityIndex.searchQuery}hasAnalogicalQuery(){return!!this.similarityIndex.analogicalQuery}isYasqeRenderMode(){return s.RenderingMode.YASQE===this.getSelectedYasguiRenderMode()}isYasrRenderMode(){return s.RenderingMode.YASR===this.getSelectedYasguiRenderMode()}getName(){return this.similarityIndex.name}setName(e){this.similarityIndex.name=e}setInputIndex(e){this.similarityIndex.inputIndex=e}getInputIndex(){return this.similarityIndex.inputIndex}setLiteralIndex(e=!1){this.similarityIndex.isLiteralIndex=e}getSimilarityIndex(){return this.similarityIndex}setStopList(e){this.similarityIndex.stopList=e}getStopList(){return this.similarityIndex.stopList}setAnalyzer(e="org.apache.lucene.analysis.en.EnglishAnalyzer"){this.similarityIndex.analyzer=e}getAnalyzer(){return this.similarityIndex.analyzer}setType(e){this.similarityIndex.type=e}getType(){return this.similarityIndex.type}setOptions(e){this.similarityIndex.options=e}getOptions(){return this.similarityIndex.options}getInference(){return this.similarityIndex.infer}getSameAs(){return this.similarityIndex.sameAs}}},223:function(e,i,t){"use strict";t.r(i),t.d(i,"SimilarityViewMode",(function(){return r}));const r={CREATE:"CREATE",EDIT:"EDIT",CLONE:"CLONE"}},245:function(e,i,t){"use strict";t.r(i);t(68),t(10),t(15);var r=t(105),n=t(14),s=t(64),a=t(67),y=t(223),o=t(104),l=t(70),d=t(221),u=t(94),c=t(222);function I(e,i,t,I,m,S,p,h,T,x,g,Q,E,A,f,v){e.productInfo=h,e.SimilarityQueryType=o.SimilarityQueryType,e.SimilarityIndexType=l.SimilarityIndexType,e.similarityIndexInfo=void 0,e.samples=void 0,e.yasguiConfig=void 0,e.saveOrUpdateExecuted=!1,e.loadingControllerResources=!1,e.helpHidden=1===g.get(Q.HIDE_SIMILARITY_HELP);let R=!1,L=void 0,w=void 0,C=void 0,M=y.SimilarityViewMode.CREATE;e.changeSimilarityIndexType=(i,t=o.SimilarityQueryType.DATA)=>{e.similarityIndexInfo.setType(i),e.similarityIndexInfo.isPredicationType()?e.samples=w[l.SimilarityIndexType.PREDICATION]:e.samples=w[l.SimilarityIndexType.TEXT],e.changeQueryTab(t).then(i=>{P(e.similarityIndexInfo),e.setEditorQuery(e.similarityIndexInfo.getQuery())})},e.changeQueryTab=i=>{const t=e.similarityIndexInfo.getSelectedQueryType();return t===i?Promise.resolve():(e.similarityIndexInfo.setSelectedQueryType(i),D(e.similarityIndexInfo,t).then(e=>Z(e,t)).then(e=>K(e,t)).catch(e=>{e instanceof d.SimilarityIndexError||console.log(e)}).finally(()=>{const i=H();e.similarityIndexInfo.setSelectedYasguiRenderMode(s.RenderingMode.YASQE),i.changeRenderMode(e.similarityIndexInfo.getSelectedYasguiRenderMode()),e.similarityIndexInfo.isDataQueryTypeSelected()?i.showYasqeActionButton([n.YasqeButtonName.INFER_STATEMENTS,n.YasqeButtonName.EXPANDS_RESULTS]):i.hideYasqeActionButton([n.YasqeButtonName.INFER_STATEMENTS,n.YasqeButtonName.EXPANDS_RESULTS]),i.setQuery(e.similarityIndexInfo.getQuery())}))},e.createSimilarityIndex=()=>{e.saveOrUpdateExecuted=!0,D(e.similarityIndexInfo).then(Z).then(K).then(z).then(k).then(e=>_(e.getSimilarityIndex())).catch(e=>{e instanceof d.SimilarityIndexError||i.error(getError(e),E.instant("similarity.could.not.get.indexes.error"))})},e.viewQuery=()=>{D(e.similarityIndexInfo).then(z).then(N).then(O).catch(e=>i.error(getError(e)))},e.preview=()=>{D(e.similarityIndexInfo).then(K).then(Z).then(()=>{const i=H();e.similarityIndexInfo.setSelectedYasguiRenderMode(s.RenderingMode.YASR),i.query(e.similarityIndexInfo.getSelectedYasguiRenderMode())})},e.saveSearchQuery=function(){e.saveOrUpdateExecuted=!0,R||V(),e.saveOrUpdateExecuted=!0,D(e.similarityIndexInfo).then(F).then(Z).then(K).then(X).then(J).then(b).then(U).catch(e=>{e instanceof d.SimilarityIndexError||i.error(getError(e),E.instant("similarity.change.query.error"))})},e.setEditorQuery=i=>{e.similarityIndexInfo.markInvalidQuery(void 0,!1),e.similarityIndexInfo.markInvalidQueryType(void 0,!1),e.yasguiConfig?H().setQuery(i):q({initialQuery:i||" "})},e.similarityIndexNameChanged=()=>{e.setDirty(),e.similarityIndexInfo.isNameExist=!1},e.queryChanged=()=>{e.setDirty(),e.similarityIndexInfo.markInvalidQuery(void 0,!1),e.similarityIndexInfo.markInvalidQueryType(void 0,!1)},e.isCloneViewMode=()=>y.SimilarityViewMode.CLONE===M,e.isEditViewMode=()=>y.SimilarityViewMode.EDIT===M,e.isCreateViewMode=()=>y.SimilarityViewMode.CREATE===M,e.setDirty=()=>{R=!0},e.isYasqeShown=()=>e.similarityIndexInfo&&e.similarityIndexInfo.isYasqeRenderMode(),e.isYasrShown=()=>e.similarityIndexInfo&&e.similarityIndexInfo.isYasrRenderMode(),e.showEditor=()=>{const i=H();i.abortQuery().then(()=>i.setQuery(e.similarityIndexInfo.getQuery())).then(()=>(e.similarityIndexInfo.setSelectedYasguiRenderMode(s.RenderingMode.YASQE),i.changeRenderMode(e.similarityIndexInfo.getSelectedYasguiRenderMode())))},e.toggleHelp=i=>{void 0===i&&(i=g.get(Q.HIDE_SIMILARITY_HELP)),1!==i?(g.set(Q.HIDE_SIMILARITY_HELP,1),e.helpHidden=!0):(g.set(Q.HIDE_SIMILARITY_HELP,0),e.helpHidden=!1)},e.getCloseBtnMsg=function(){let i=e.editSearchQuery?E.instant("similarity.query.edition.msg"):E.instant("similarity.index.creation.msg");return E.instant("similarity.close.btn.msg",{operation:i})},e.hasQueryError=()=>{const i=e.similarityIndexInfo.getSelectedQueryType();return o.SimilarityQueryType.DATA===i?e.hasSelectQueryError():o.SimilarityQueryType.SEARCH===i?e.hasSearchQueryError():o.SimilarityQueryType.ANALOGICAL===i&&e.hasAnalogicalQueryError()},e.hasSelectQueryError=()=>!e.similarityIndexInfo.hasSelectQuery()||e.similarityIndexInfo.invalidSelectQuery||e.similarityIndexInfo.invalidSelectQueryType,e.hasSearchQueryError=()=>!e.similarityIndexInfo.hasSearchQuery()||e.similarityIndexInfo.invalidSearchQuery||e.similarityIndexInfo.invalidSearchQueryType,e.hasAnalogicalQueryError=()=>!e.similarityIndexInfo.hasAnalogicalQuery()||e.similarityIndexInfo.invalidAnalogicalQuery||e.similarityIndexInfo.invalidAnalogicalQueryType,e.getQueryErrorMessage=()=>{const i=e.similarityIndexInfo.getSelectedQueryType();let t=!1,r=!1,n=!1;o.SimilarityQueryType.DATA===i?(t=!e.similarityIndexInfo.hasSelectQuery(),r=e.similarityIndexInfo.invalidSelectQueryType,n=e.similarityIndexInfo.invalidSelectQuery):o.SimilarityQueryType.SEARCH===i?(t=!e.similarityIndexInfo.hasSearchQuery(),r=e.similarityIndexInfo.invalidSearchQueryType,n=e.similarityIndexInfo.invalidSearchQuery):o.SimilarityQueryType.ANALOGICAL===i&&(t=!e.similarityIndexInfo.hasAnalogicalQuery(),r=e.similarityIndexInfo.invalidAnalogicalQueryType,n=e.similarityIndexInfo.invalidAnalogicalQuery);const s={queryType:E.instant(`similarity.query.type.${i}.name`)};return t?E.instant("similarity.error.query.empty",s):n?E.instant("similarity.error.query.invalid",s):r?E.instant("similarity.error.query.invalid_type",s):""};const D=(e,i)=>H().getQuery().then(t=>e.setQuery(t,i)).then(()=>e),N=e=>m.getQuery({indexName:e.getName(),indexOptions:e.getOptions(),query:e.getQuery(),indexStopList:e.getStopList(),queryInference:e.getInference(),querySameAs:e.getSameAs(),viewType:e.getSelectedQueryType(),indexAnalyzer:e.getAnalyzer()}).then(e=>e.data),O=e=>{e&&t.open({templateUrl:"pages/viewQuery.html",controller:"ViewQueryCtrl",resolve:{query:function(){return e}}})},P=i=>{const t=i.getType();if(!e.isEditViewMode()&&L&&(i.setQuery(L[t],o.SimilarityQueryType.SEARCH),i.setQuery(L.analogical,o.SimilarityQueryType.ANALOGICAL)),w)if(l.SimilarityIndexType.PREDICATION===t){const e=w[l.SimilarityIndexType.PREDICATION].predication;i.setQuery(e,o.SimilarityQueryType.DATA)}else{const e=w[l.SimilarityIndexType.TEXT].literals;i.setQuery(e,o.SimilarityQueryType.DATA)}},Y=()=>{const t=new c.SimilarityIndexInfo;t.setName(G()),t.setType(j()),t.setSelectedQueryType(e.isEditViewMode()?o.SimilarityQueryType.SEARCH:o.SimilarityQueryType.DATA);const n=p.search().options;n?t.setOptions(n):t.setOptions(t.isTextType()?"-termweight idf":""),P(t);const s=p.search().searchQuery;s&&t.setQuery(s,o.SimilarityQueryType.SEARCH);const a=p.search().selectQuery;a&&t.setQuery(a,o.SimilarityQueryType.DATA);const y=p.search().analogicalQuery;if(y&&t.setQuery(y,o.SimilarityQueryType.ANALOGICAL),t.isTextType()){t.setStopList(p.search().stopList),t.setAnalyzer(p.search().analyzer);const e=$(t.getSimilarityIndex(),"-literal_index");void 0!==e&&t.setLiteralIndex(e)}return t.isPredicationType()?m.getIndexes().then(i=>{const n=Object(r.mapIndexesResponseToSimilarityIndex)(i.data).filter(e=>e.isTextLiteralType()&&(e.isBuiltStatus()||e.isOutdatedStatus())).map(e=>e.name);if(e.literalIndexes=["no-index"].concat(n),void 0===t.getInputIndex()){const i=$(t.getSimilarityIndex(),"-input_index");if(void 0!==i)for(let r=0;r<e.literalIndexes.length;r++)i===e.literalIndexes[r]&&t.setInputIndex(e.literalIndexes[r])}return void 0===t.getInputIndex()&&t.setInputIndex(e.literalIndexes[0]),t}).catch((function(e){const t=getError(e);i.error(t,E.instant("similarity.could.not.get.indexes.error"))})):Promise.resolve(t)},q=i=>{const t={endpoint:B,componentId:"create-index",showEditorTabs:!1,showToolbar:!1,showResultTabs:!1,showYasqeActionButtons:!1,showQueryButton:!1,downloadAsOn:!1,showResultInfo:!1,showYasqeResizer:!1,pageSize:100,prefixes:C,render:e.similarityIndexInfo.getSelectedYasguiRenderMode(),yasqeActionButtons:e.isEditViewMode()||!e.similarityIndexInfo.isDataQueryTypeSelected()?n.DISABLE_YASQE_BUTTONS_CONFIGURATION:n.INFERRED_AND_SAME_AS_BUTTONS_CONFIGURATION,maxPersistentResponseSize:0,yasqeMode:e.canWriteActiveRepo()?a.YasqeMode.WRITE:a.YasqeMode.PROTECTED},r={};angular.extend(r,t,i),e.yasguiConfig=r},B=()=>"repositories/"+A.getActiveRepository(),_=t=>{if(void 0!==e.literalIndexes){const i=t.inputIndex;i!==e.literalIndexes[0]&&(t.options=t.options+(""===t.options?"":" ")+"-input_index "+i)}return"true"===t.isLiteralIndex&&(t.options=t.options+(""===t.options?"":" ")+"-literal_index true",t.type=l.SimilarityIndexType.TEXT_LITERAL),V(),R=!1,m.createIndex("POST",t.name,t.options,t.selectQuery,t.searchQuery,t.isPredicationType()?t.analogicalQuery:"",t.stopList,t.infer,t.sameAs,t.type,t.analyzer).then(()=>(i.success(E.instant("similarity.create.index.successfully")),t)).catch((function(e){const t=getError(e);return i.error(t,E.instant("similarity.create.index.error")),console.log(t),Promise.reject(new d.SimilarityIndexError("Could not create index."))}))},U=async e=>{await T.showToastMessageWithDelay(e?"similarity.changed.search.query.msg":"similarity.changed.analogical.query.msg"),p.url("similarity")},b=e=>{const i=e.isSearchQueryTypeSelected();let t={name:e.getSimilarityIndex().name,changedQuery:e.getQuery(),isSearchQuery:i};return m.saveSearchQuery(JSON.stringify(t)).then(()=>(R=!1,i))},V=()=>{setTimeout(()=>p.url("similarity"),100)},H=()=>n.YasguiComponentDirectiveUtil.getOntotextYasguiElement("#query-editor"),G=()=>{const i=p.search().name||"";return e.isCloneViewMode()?`${E.instant("similarity.copy_of.prefix")}_${i}`:i},j=()=>{const e=p.search().type;return void 0===e||e.startsWith("text")?l.SimilarityIndexType.TEXT:e},$=(e,i)=>{const t=e.options.split(" ");for(let r=0;r<t.length;r++)if(t[r]===i&&r+1<t.length){const i=t[r+1];return delete t[r],delete t[r+1],e.options=t.join(" "),i}},z=e=>Promise.all([F(e).then(W).then(X).then(J).then(K).then(Z)]).then(()=>e),k=e=>m.getIndexes().then(i=>i.data.some(i=>i.name===e.getName())?(e.isNameExist=!0,Promise.reject(new d.SimilarityIndexError("Similarity index name exists."))):e),F=e=>e.getSimilarityIndex().name?e.isNameValid()?Promise.resolve(e):Promise.reject(new d.SimilarityIndexError("Invalid similarity name.")):Promise.reject(new d.SimilarityIndexError("Missing similarity name.")),W=e=>e.hasSelectQuery()?e.invalidSelectQuery?Promise.reject(new d.SimilarityIndexError("Invalid select query")):e.invalidSelectQueryType?Promise.reject(new d.SimilarityIndexError("Invalid select query type")):Promise.resolve(e):Promise.reject(new d.SimilarityIndexError("Missing select query.")),X=e=>e.hasSearchQuery()?e.invalidSearchQuery?Promise.reject(new d.SimilarityIndexError("Invalid search query")):e.invalidSearchQueryType?Promise.reject(new d.SimilarityIndexError("Invalid search query type")):Promise.resolve(e):Promise.reject(new d.SimilarityIndexError("Missing search query.")),J=e=>e.isPredicationType()&&!e.hasAnalogicalQuery()?Promise.reject(new d.SimilarityIndexError("Missing analogical query.")):e.invalidAnalogicalQuery?Promise.reject(new d.SimilarityIndexError("Invalid analogical query")):e.invalidAnalogicalQueryType?Promise.reject(new d.SimilarityIndexError("Invalid analogical query type")):Promise.resolve(e),K=(e,i)=>H().getQueryType().then(t=>u.QueryType.SELECT!==t?(e.markInvalidQueryType(i),Promise.reject(new d.SimilarityIndexError("Query type is not valid."))):(e.markInvalidQueryType(i,!1),e)),Z=(e,i)=>H().isQueryValid().then(t=>t?(e.markInvalidQuery(i,!1),e):(e.markInvalidQuery(i),Promise.reject(new d.SimilarityIndexError("Query is not valid.")))),ee=(e,i,t,r)=>{v.openSimpleModal({title:e,message:i,warning:!0}).result.then((function(){angular.isFunction(t)&&t()}),(function(){angular.isFunction(r)&&r()}))},ie=()=>{e.isYasrShown()&&e.similarityIndexInfo.isDataQueryTypeSelected()&&e.showEditor(),e.canEditActiveRepo=e.canWriteActiveRepo();const i={...e.yasguiConfig,yasqeMode:e.canWriteActiveRepo()};q(i)},te=e=>{R&&(e.returnValue=!0)},re=()=>{window.removeEventListener("beforeunload",te),ne.forEach(e=>e())},ne=[];ne.push(f.subscribe("repositoryWillChangeEvent",i=>new Promise((function(t){if(e.isCreateViewMode()||e.isCloneViewMode())return void t(i);const r=()=>{R=!1,V(),t(i)};if(R){const e=()=>{i.cancel=!0,t(i)},n=E.instant("common.confirm"),s=E.instant("similarity.warning.unsaved.changes");ee(n,s,r,e)}else r()})))),ne.push(e.$on("$locationChangeStart",(e,i)=>{if(R){e.preventDefault();const t=E.instant("common.confirm"),r=E.instant("similarity.warning.unsaved.changes");ee(t,r,()=>{re();const e=p.absUrl().length-p.url().length,t=i.substring(e);p.path(t)})}else re()})),ne.push(e.$on("$destroy",re)),window.addEventListener("beforeunload",te),M=(()=>{if(void 0===p.search().name)return y.SimilarityViewMode.CREATE;const e=p.search().editSearchQuery;return void 0===e?y.SimilarityViewMode.CLONE:"string"==typeof e?"false"===e?y.SimilarityViewMode.CLONE:y.SimilarityViewMode.EDIT:e?y.SimilarityViewMode.EDIT:y.SimilarityViewMode.CLONE})();const se=e.$watch((function(){return e.getActiveRepositoryObject()}),(function(i){i&&(e.loadingControllerResources=!0,Promise.all([m.getSearchQueries(),m.getSamples(),A.getPrefixes(i.id)]).then(([i,t,r])=>{e.canEditActiveRepo=e.canWriteActiveRepo(),L=i?i.data:[],w=t?t.data:[],C=r,Y().then(i=>{e.similarityIndexInfo=i;let t=o.SimilarityQueryType.DATA;e.isEditViewMode()&&(t=o.SimilarityQueryType.SEARCH),e.changeSimilarityIndexType(i.getType(),t)})}).catch(i=>{console.log(i),e.repositoryError=getError(i)}).finally(()=>{ne.push(e.$on("repositoryIsSet",ie)),se(),e.loadingControllerResources=!1}))}))}angular.module("graphdb.framework.similarity.controllers.create",["graphdb.framework.utils.notifications","graphdb.framework.utils.localstorageadapter"]).controller("CreateSimilarityIdxCtrl",I),I.$inject=["$scope","toastr","$uibModal","$timeout","SimilarityRestService","SparqlRestService","$location","productInfo","Notifications","RDF4JRepositoriesRestService","LocalStorageAdapter","LSKeys","$translate","$repositories","EventEmitterService","ModalService"]},64:function(e,i,t){"use strict";t.r(i),t.d(i,"RenderingMode",(function(){return r}));const r={YASGUI:"mode-yasgui",YASQE:"mode-yasqe",YASR:"mode-yasr"}},67:function(e,i,t){"use strict";t.r(i),t.d(i,"YasqeMode",(function(){return r}));const r={WRITE:"WRITE",READ:"READ",PROTECTED:"PROTECTED"}},68:function(e,i){function t(e,i){return{showToastMessageWithDelay:function(t){return new Promise(r=>{e.success(i.instant(t)),setTimeout(r,200)})}}}angular.module("graphdb.framework.utils.notifications",[]).factory("Notifications",t),t.$inject=["toastr","$translate"]},70:function(e,i,t){"use strict";t.r(i),t.d(i,"SimilarityIndexType",(function(){return r}));const r={TEXT:"text",TEXT_LITERAL:"textLiteral",PREDICATION:"predication",isTextType:e=>r.TEXT===e,isTextLiteralType:e=>r.TEXT_LITERAL===e,isPredicationType:e=>r.PREDICATION===e}},72:function(e,i,t){"use strict";t.r(i),t.d(i,"SimilarityIndexStatus",(function(){return r}));const r={CREATING:"CREATING",BUILDING:"BUILDING",BUILT:"BUILT",REBUILDING:"REBUILDING",OUTDATED:"OUTDATED",INTERRUPTED:"INTERRUPTED",OBSOLETE:"OBSOLETE",FAILED:"FAILED",isCreatingStatus:e=>r.CREATING===e,isBuildingStatus:e=>r.BUILDING===e,isBuiltStatus:e=>r.BUILT===e,isRebuildingStatus:e=>r.REBUILDING===e,isOutdatedStatus:e=>r.OUTDATED===e,isInterruptedStatus:e=>r.INTERRUPTED===e,isObsoleteStatus:e=>r.OBSOLETE===e,isFailedStatus:e=>r.FAILED===e}},76:function(e,i,t){"use strict";t.r(i),t.d(i,"SimilarityIndex",(function(){return s}));var r=t(70),n=t(72);class s{constructor(){this.analyzer="",this.infer=!0,this.options="",this.sameAs=!0,this.searchQuery="",this.selectQuery="",this.stopList=void 0,this.name="",this.type=r.SimilarityIndexType.TEXT,this.status=void 0,this.analogicalQuery=void 0,this.inputIndex=void 0,this.isLiteralIndex=""}isTextType(){return r.SimilarityIndexType.isTextType(this.type)}isTextLiteralType(){return r.SimilarityIndexType.isTextLiteralType(this.type)}isPredicationType(){return r.SimilarityIndexType.isPredicationType(this.type)}isCreatingStatus(){return n.SimilarityIndexStatus.isCreatingStatus(this.status)}isBuildingStatus(){return n.SimilarityIndexStatus.isBuildingStatus(this.status)}isBuiltStatus(){return n.SimilarityIndexStatus.isBuiltStatus(this.status)}isRebuildingStatus(){return n.SimilarityIndexStatus.isRebuildingStatus(this.status)}isOutdatedStatus(){return n.SimilarityIndexStatus.isOutdatedStatus(this.status)}isInterruptedStatus(){return n.SimilarityIndexStatus.isInterruptedStatus(this.status)}isObsoleteStatus(){return n.SimilarityIndexStatus.isObsoleteStatus(this.status)}isFailedStatus(){return n.SimilarityIndexStatus.isFailedStatus(this.status)}}}}]);
|
|
1
|
+
(window.webpackJsonp=window.webpackJsonp||[]).push([[10,34,46,55,195,203,215,216,217,218,221,273],{104:function(e,i,t){"use strict";t.r(i),t.d(i,"SimilarityQueryType",(function(){return r}));const r={DATA:"DATA",SEARCH:"SEARCH",ANALOGICAL:"ANALOGICAL"}},105:function(e,i,t){"use strict";t.r(i),t.d(i,"mapIndexesResponseToSimilarityIndex",(function(){return n}));var r=t(76);const n=e=>e.map(e=>{const i=new r.SimilarityIndex;return i.type=e.type,i.stopList=e.stopList,i.status=e.status,i.selectQuery=e.selectQuery,i.searchQuery=e.searchQuery,i.sameAs=e.sameAs,i.options=e.options,i.name=e.name,i.infer=e.infer,i.analyzer=e.analyzer,i.analogicalQuery=e.analogicalQuery,i})},221:function(e,i,t){"use strict";t.r(i),t.d(i,"SimilarityIndexError",(function(){return r}));class r extends Error{}},222:function(e,i,t){"use strict";t.r(i),t.d(i,"SimilarityIndexInfo",(function(){return y}));var r=t(76),n=t(104),s=t(65);const a=new RegExp("^[a-zA-Z0-9-_]+$");class y{constructor(){this.similarityIndex=new r.SimilarityIndex,this.isNameExist=!1,this.invalidSelectQueryType=!1,this.invalidSelectQuery=!1,this.invalidSearchQueryType=!1,this.invalidSearchQuery=!1,this.invalidAnalogicalQueryType=!1,this.invalidAnalogicalQuery=!1,this.selectedQueryType=n.SimilarityQueryType.DATA,this.selectedYasguiRenderMode=s.RenderingMode.YASQE}setQuery(e,i){const t=i||this.selectedQueryType;n.SimilarityQueryType.DATA!==t?n.SimilarityQueryType.SEARCH!==t?n.SimilarityQueryType.ANALOGICAL===t&&(this.similarityIndex.analogicalQuery=e):this.similarityIndex.searchQuery=e:this.similarityIndex.selectQuery=e}getQuery(e){switch(e||this.selectedQueryType){case n.SimilarityQueryType.DATA:return this.similarityIndex.selectQuery;case n.SimilarityQueryType.SEARCH:return this.similarityIndex.searchQuery;case n.SimilarityQueryType.ANALOGICAL:return this.similarityIndex.analogicalQuery}}markInvalidQuery(e,i=!0){const t=e||this.selectedQueryType;n.SimilarityQueryType.DATA!==t?n.SimilarityQueryType.SEARCH!==t?n.SimilarityQueryType.ANALOGICAL===t&&(this.invalidAnalogicalQuery=i):this.invalidSearchQuery=i:this.invalidSelectQuery=i}markInvalidQueryType(e,i=!0){const t=e||this.selectedQueryType;n.SimilarityQueryType.DATA!==t?n.SimilarityQueryType.SEARCH!==t?n.SimilarityQueryType.ANALOGICAL===t&&(this.invalidAnalogicalQueryType=i):this.invalidSearchQueryType=i:this.invalidSelectQueryType=i}setSelectedQueryType(e){this.selectedQueryType=e}getSelectedQueryType(){return this.selectedQueryType}setSelectedYasguiRenderMode(e){this.selectedYasguiRenderMode=e}getSelectedYasguiRenderMode(){return this.selectedYasguiRenderMode}isDataQueryTypeSelected(){return n.SimilarityQueryType.DATA===this.selectedQueryType}isSearchQueryTypeSelected(){return n.SimilarityQueryType.SEARCH===this.selectedQueryType}isAnalogicalQueryTypeSelected(){return n.SimilarityQueryType.ANALOGICAL===this.selectedQueryType}isTextType(){return this.similarityIndex.isTextType()}isPredicationType(){return this.similarityIndex.isPredicationType()}isTextLiteralType(){return this.similarityIndex.isTextLiteralType()}hasName(){return!!this.similarityIndex.name}isNameValid(){return a.test(this.similarityIndex.name)}hasSelectQuery(){return!!this.similarityIndex.selectQuery}hasSearchQuery(){return!!this.similarityIndex.searchQuery}hasAnalogicalQuery(){return!!this.similarityIndex.analogicalQuery}isYasqeRenderMode(){return s.RenderingMode.YASQE===this.getSelectedYasguiRenderMode()}isYasrRenderMode(){return s.RenderingMode.YASR===this.getSelectedYasguiRenderMode()}getName(){return this.similarityIndex.name}setName(e){this.similarityIndex.name=e}setInputIndex(e){this.similarityIndex.inputIndex=e}getInputIndex(){return this.similarityIndex.inputIndex}setLiteralIndex(e=!1){this.similarityIndex.isLiteralIndex=e}getSimilarityIndex(){return this.similarityIndex}setStopList(e){this.similarityIndex.stopList=e}getStopList(){return this.similarityIndex.stopList}setAnalyzer(e="org.apache.lucene.analysis.en.EnglishAnalyzer"){this.similarityIndex.analyzer=e}getAnalyzer(){return this.similarityIndex.analyzer}setType(e){this.similarityIndex.type=e}getType(){return this.similarityIndex.type}setOptions(e){this.similarityIndex.options=e}getOptions(){return this.similarityIndex.options}getInference(){return this.similarityIndex.infer}getSameAs(){return this.similarityIndex.sameAs}}},223:function(e,i,t){"use strict";t.r(i),t.d(i,"SimilarityViewMode",(function(){return r}));const r={CREATE:"CREATE",EDIT:"EDIT",CLONE:"CLONE"}},245:function(e,i,t){"use strict";t.r(i);t(68),t(10),t(15);var r=t(105),n=t(14),s=t(65),a=t(67),y=t(223),o=t(104),l=t(70),d=t(221),u=t(94),c=t(222);function I(e,i,t,I,m,S,p,h,T,x,g,Q,E,A,f,v){e.productInfo=h,e.SimilarityQueryType=o.SimilarityQueryType,e.SimilarityIndexType=l.SimilarityIndexType,e.similarityIndexInfo=void 0,e.samples=void 0,e.yasguiConfig=void 0,e.saveOrUpdateExecuted=!1,e.loadingControllerResources=!1,e.helpHidden=1===g.get(Q.HIDE_SIMILARITY_HELP);let R=!1,L=void 0,w=void 0,C=void 0,M=y.SimilarityViewMode.CREATE;e.changeSimilarityIndexType=(i,t=o.SimilarityQueryType.DATA)=>{e.similarityIndexInfo.setType(i),e.similarityIndexInfo.isPredicationType()?e.samples=w[l.SimilarityIndexType.PREDICATION]:e.samples=w[l.SimilarityIndexType.TEXT],e.changeQueryTab(t).then(i=>{P(e.similarityIndexInfo),e.setEditorQuery(e.similarityIndexInfo.getQuery())})},e.changeQueryTab=i=>{const t=e.similarityIndexInfo.getSelectedQueryType();return t===i?Promise.resolve():(e.similarityIndexInfo.setSelectedQueryType(i),D(e.similarityIndexInfo,t).then(e=>Z(e,t)).then(e=>K(e,t)).catch(e=>{e instanceof d.SimilarityIndexError||console.log(e)}).finally(()=>{const i=H();e.similarityIndexInfo.setSelectedYasguiRenderMode(s.RenderingMode.YASQE),i.changeRenderMode(e.similarityIndexInfo.getSelectedYasguiRenderMode()),e.similarityIndexInfo.isDataQueryTypeSelected()?i.showYasqeActionButton([n.YasqeButtonName.INFER_STATEMENTS,n.YasqeButtonName.EXPANDS_RESULTS]):i.hideYasqeActionButton([n.YasqeButtonName.INFER_STATEMENTS,n.YasqeButtonName.EXPANDS_RESULTS]),i.setQuery(e.similarityIndexInfo.getQuery())}))},e.createSimilarityIndex=()=>{e.saveOrUpdateExecuted=!0,D(e.similarityIndexInfo).then(Z).then(K).then(z).then(k).then(e=>_(e.getSimilarityIndex())).catch(e=>{e instanceof d.SimilarityIndexError||i.error(getError(e),E.instant("similarity.could.not.get.indexes.error"))})},e.viewQuery=()=>{D(e.similarityIndexInfo).then(z).then(N).then(O).catch(e=>i.error(getError(e)))},e.preview=()=>{D(e.similarityIndexInfo).then(K).then(Z).then(()=>{const i=H();e.similarityIndexInfo.setSelectedYasguiRenderMode(s.RenderingMode.YASR),i.query(e.similarityIndexInfo.getSelectedYasguiRenderMode())})},e.saveSearchQuery=function(){e.saveOrUpdateExecuted=!0,R||V(),e.saveOrUpdateExecuted=!0,D(e.similarityIndexInfo).then(F).then(Z).then(K).then(X).then(J).then(b).then(U).catch(e=>{e instanceof d.SimilarityIndexError||i.error(getError(e),E.instant("similarity.change.query.error"))})},e.setEditorQuery=i=>{e.similarityIndexInfo.markInvalidQuery(void 0,!1),e.similarityIndexInfo.markInvalidQueryType(void 0,!1),e.yasguiConfig?H().setQuery(i):q({initialQuery:i||" "})},e.similarityIndexNameChanged=()=>{e.setDirty(),e.similarityIndexInfo.isNameExist=!1},e.queryChanged=()=>{e.setDirty(),e.similarityIndexInfo.markInvalidQuery(void 0,!1),e.similarityIndexInfo.markInvalidQueryType(void 0,!1)},e.isCloneViewMode=()=>y.SimilarityViewMode.CLONE===M,e.isEditViewMode=()=>y.SimilarityViewMode.EDIT===M,e.isCreateViewMode=()=>y.SimilarityViewMode.CREATE===M,e.setDirty=()=>{R=!0},e.isYasqeShown=()=>e.similarityIndexInfo&&e.similarityIndexInfo.isYasqeRenderMode(),e.isYasrShown=()=>e.similarityIndexInfo&&e.similarityIndexInfo.isYasrRenderMode(),e.showEditor=()=>{const i=H();i.abortQuery().then(()=>i.setQuery(e.similarityIndexInfo.getQuery())).then(()=>(e.similarityIndexInfo.setSelectedYasguiRenderMode(s.RenderingMode.YASQE),i.changeRenderMode(e.similarityIndexInfo.getSelectedYasguiRenderMode())))},e.toggleHelp=i=>{void 0===i&&(i=g.get(Q.HIDE_SIMILARITY_HELP)),1!==i?(g.set(Q.HIDE_SIMILARITY_HELP,1),e.helpHidden=!0):(g.set(Q.HIDE_SIMILARITY_HELP,0),e.helpHidden=!1)},e.getCloseBtnMsg=function(){let i=e.editSearchQuery?E.instant("similarity.query.edition.msg"):E.instant("similarity.index.creation.msg");return E.instant("similarity.close.btn.msg",{operation:i})},e.hasQueryError=()=>{const i=e.similarityIndexInfo.getSelectedQueryType();return o.SimilarityQueryType.DATA===i?e.hasSelectQueryError():o.SimilarityQueryType.SEARCH===i?e.hasSearchQueryError():o.SimilarityQueryType.ANALOGICAL===i&&e.hasAnalogicalQueryError()},e.hasSelectQueryError=()=>!e.similarityIndexInfo.hasSelectQuery()||e.similarityIndexInfo.invalidSelectQuery||e.similarityIndexInfo.invalidSelectQueryType,e.hasSearchQueryError=()=>!e.similarityIndexInfo.hasSearchQuery()||e.similarityIndexInfo.invalidSearchQuery||e.similarityIndexInfo.invalidSearchQueryType,e.hasAnalogicalQueryError=()=>!e.similarityIndexInfo.hasAnalogicalQuery()||e.similarityIndexInfo.invalidAnalogicalQuery||e.similarityIndexInfo.invalidAnalogicalQueryType,e.getQueryErrorMessage=()=>{const i=e.similarityIndexInfo.getSelectedQueryType();let t=!1,r=!1,n=!1;o.SimilarityQueryType.DATA===i?(t=!e.similarityIndexInfo.hasSelectQuery(),r=e.similarityIndexInfo.invalidSelectQueryType,n=e.similarityIndexInfo.invalidSelectQuery):o.SimilarityQueryType.SEARCH===i?(t=!e.similarityIndexInfo.hasSearchQuery(),r=e.similarityIndexInfo.invalidSearchQueryType,n=e.similarityIndexInfo.invalidSearchQuery):o.SimilarityQueryType.ANALOGICAL===i&&(t=!e.similarityIndexInfo.hasAnalogicalQuery(),r=e.similarityIndexInfo.invalidAnalogicalQueryType,n=e.similarityIndexInfo.invalidAnalogicalQuery);const s={queryType:E.instant(`similarity.query.type.${i}.name`)};return t?E.instant("similarity.error.query.empty",s):n?E.instant("similarity.error.query.invalid",s):r?E.instant("similarity.error.query.invalid_type",s):""};const D=(e,i)=>H().getQuery().then(t=>e.setQuery(t,i)).then(()=>e),N=e=>m.getQuery({indexName:e.getName(),indexOptions:e.getOptions(),query:e.getQuery(),indexStopList:e.getStopList(),queryInference:e.getInference(),querySameAs:e.getSameAs(),viewType:e.getSelectedQueryType(),indexAnalyzer:e.getAnalyzer()}).then(e=>e.data),O=e=>{e&&t.open({templateUrl:"pages/viewQuery.html",controller:"ViewQueryCtrl",resolve:{query:function(){return e}}})},P=i=>{const t=i.getType();if(!e.isEditViewMode()&&L&&(i.setQuery(L[t],o.SimilarityQueryType.SEARCH),i.setQuery(L.analogical,o.SimilarityQueryType.ANALOGICAL)),w)if(l.SimilarityIndexType.PREDICATION===t){const e=w[l.SimilarityIndexType.PREDICATION].predication;i.setQuery(e,o.SimilarityQueryType.DATA)}else{const e=w[l.SimilarityIndexType.TEXT].literals;i.setQuery(e,o.SimilarityQueryType.DATA)}},Y=()=>{const t=new c.SimilarityIndexInfo;t.setName(G()),t.setType(j()),t.setSelectedQueryType(e.isEditViewMode()?o.SimilarityQueryType.SEARCH:o.SimilarityQueryType.DATA);const n=p.search().options;n?t.setOptions(n):t.setOptions(t.isTextType()?"-termweight idf":""),P(t);const s=p.search().searchQuery;s&&t.setQuery(s,o.SimilarityQueryType.SEARCH);const a=p.search().selectQuery;a&&t.setQuery(a,o.SimilarityQueryType.DATA);const y=p.search().analogicalQuery;if(y&&t.setQuery(y,o.SimilarityQueryType.ANALOGICAL),t.isTextType()){t.setStopList(p.search().stopList),t.setAnalyzer(p.search().analyzer);const e=$(t.getSimilarityIndex(),"-literal_index");void 0!==e&&t.setLiteralIndex(e)}return t.isPredicationType()?m.getIndexes().then(i=>{const n=Object(r.mapIndexesResponseToSimilarityIndex)(i.data).filter(e=>e.isTextLiteralType()&&(e.isBuiltStatus()||e.isOutdatedStatus())).map(e=>e.name);if(e.literalIndexes=["no-index"].concat(n),void 0===t.getInputIndex()){const i=$(t.getSimilarityIndex(),"-input_index");if(void 0!==i)for(let r=0;r<e.literalIndexes.length;r++)i===e.literalIndexes[r]&&t.setInputIndex(e.literalIndexes[r])}return void 0===t.getInputIndex()&&t.setInputIndex(e.literalIndexes[0]),t}).catch((function(e){const t=getError(e);i.error(t,E.instant("similarity.could.not.get.indexes.error"))})):Promise.resolve(t)},q=i=>{const t={endpoint:B,componentId:"create-index",showEditorTabs:!1,showToolbar:!1,showResultTabs:!1,showYasqeActionButtons:!1,showQueryButton:!1,downloadAsOn:!1,showResultInfo:!1,showYasqeResizer:!1,pageSize:100,prefixes:C,render:e.similarityIndexInfo.getSelectedYasguiRenderMode(),yasqeActionButtons:e.isEditViewMode()||!e.similarityIndexInfo.isDataQueryTypeSelected()?n.DISABLE_YASQE_BUTTONS_CONFIGURATION:n.INFERRED_AND_SAME_AS_BUTTONS_CONFIGURATION,maxPersistentResponseSize:0,yasqeMode:e.canWriteActiveRepo()?a.YasqeMode.WRITE:a.YasqeMode.PROTECTED},r={};angular.extend(r,t,i),e.yasguiConfig=r},B=()=>"repositories/"+A.getActiveRepository(),_=t=>{if(void 0!==e.literalIndexes){const i=t.inputIndex;i!==e.literalIndexes[0]&&(t.options=t.options+(""===t.options?"":" ")+"-input_index "+i)}return"true"===t.isLiteralIndex&&(t.options=t.options+(""===t.options?"":" ")+"-literal_index true",t.type=l.SimilarityIndexType.TEXT_LITERAL),V(),R=!1,m.createIndex("POST",t.name,t.options,t.selectQuery,t.searchQuery,t.isPredicationType()?t.analogicalQuery:"",t.stopList,t.infer,t.sameAs,t.type,t.analyzer).then(()=>(i.success(E.instant("similarity.create.index.successfully")),t)).catch((function(e){const t=getError(e);return i.error(t,E.instant("similarity.create.index.error")),console.log(t),Promise.reject(new d.SimilarityIndexError("Could not create index."))}))},U=async e=>{await T.showToastMessageWithDelay(e?"similarity.changed.search.query.msg":"similarity.changed.analogical.query.msg"),p.url("similarity")},b=e=>{const i=e.isSearchQueryTypeSelected();let t={name:e.getSimilarityIndex().name,changedQuery:e.getQuery(),isSearchQuery:i};return m.saveSearchQuery(JSON.stringify(t)).then(()=>(R=!1,i))},V=()=>{setTimeout(()=>p.url("similarity"),100)},H=()=>n.YasguiComponentDirectiveUtil.getOntotextYasguiElement("#query-editor"),G=()=>{const i=p.search().name||"";return e.isCloneViewMode()?`${E.instant("similarity.copy_of.prefix")}_${i}`:i},j=()=>{const e=p.search().type;return void 0===e||e.startsWith("text")?l.SimilarityIndexType.TEXT:e},$=(e,i)=>{const t=e.options.split(" ");for(let r=0;r<t.length;r++)if(t[r]===i&&r+1<t.length){const i=t[r+1];return delete t[r],delete t[r+1],e.options=t.join(" "),i}},z=e=>Promise.all([F(e).then(W).then(X).then(J).then(K).then(Z)]).then(()=>e),k=e=>m.getIndexes().then(i=>i.data.some(i=>i.name===e.getName())?(e.isNameExist=!0,Promise.reject(new d.SimilarityIndexError("Similarity index name exists."))):e),F=e=>e.getSimilarityIndex().name?e.isNameValid()?Promise.resolve(e):Promise.reject(new d.SimilarityIndexError("Invalid similarity name.")):Promise.reject(new d.SimilarityIndexError("Missing similarity name.")),W=e=>e.hasSelectQuery()?e.invalidSelectQuery?Promise.reject(new d.SimilarityIndexError("Invalid select query")):e.invalidSelectQueryType?Promise.reject(new d.SimilarityIndexError("Invalid select query type")):Promise.resolve(e):Promise.reject(new d.SimilarityIndexError("Missing select query.")),X=e=>e.hasSearchQuery()?e.invalidSearchQuery?Promise.reject(new d.SimilarityIndexError("Invalid search query")):e.invalidSearchQueryType?Promise.reject(new d.SimilarityIndexError("Invalid search query type")):Promise.resolve(e):Promise.reject(new d.SimilarityIndexError("Missing search query.")),J=e=>e.isPredicationType()&&!e.hasAnalogicalQuery()?Promise.reject(new d.SimilarityIndexError("Missing analogical query.")):e.invalidAnalogicalQuery?Promise.reject(new d.SimilarityIndexError("Invalid analogical query")):e.invalidAnalogicalQueryType?Promise.reject(new d.SimilarityIndexError("Invalid analogical query type")):Promise.resolve(e),K=(e,i)=>H().getQueryType().then(t=>u.QueryType.SELECT!==t?(e.markInvalidQueryType(i),Promise.reject(new d.SimilarityIndexError("Query type is not valid."))):(e.markInvalidQueryType(i,!1),e)),Z=(e,i)=>H().isQueryValid().then(t=>t?(e.markInvalidQuery(i,!1),e):(e.markInvalidQuery(i),Promise.reject(new d.SimilarityIndexError("Query is not valid.")))),ee=(e,i,t,r)=>{v.openSimpleModal({title:e,message:i,warning:!0}).result.then((function(){angular.isFunction(t)&&t()}),(function(){angular.isFunction(r)&&r()}))},ie=()=>{e.isYasrShown()&&e.similarityIndexInfo.isDataQueryTypeSelected()&&e.showEditor(),e.canEditActiveRepo=e.canWriteActiveRepo();const i={...e.yasguiConfig,yasqeMode:e.canWriteActiveRepo()};q(i)},te=e=>{R&&(e.returnValue=!0)},re=()=>{window.removeEventListener("beforeunload",te),ne.forEach(e=>e())},ne=[];ne.push(f.subscribe("repositoryWillChangeEvent",i=>new Promise((function(t){if(e.isCreateViewMode()||e.isCloneViewMode())return void t(i);const r=()=>{R=!1,V(),t(i)};if(R){const e=()=>{i.cancel=!0,t(i)},n=E.instant("common.confirm"),s=E.instant("similarity.warning.unsaved.changes");ee(n,s,r,e)}else r()})))),ne.push(e.$on("$locationChangeStart",(e,i)=>{if(R){e.preventDefault();const t=E.instant("common.confirm"),r=E.instant("similarity.warning.unsaved.changes");ee(t,r,()=>{re();const e=p.absUrl().length-p.url().length,t=i.substring(e);p.path(t)})}else re()})),ne.push(e.$on("$destroy",re)),window.addEventListener("beforeunload",te),M=(()=>{if(void 0===p.search().name)return y.SimilarityViewMode.CREATE;const e=p.search().editSearchQuery;return void 0===e?y.SimilarityViewMode.CLONE:"string"==typeof e?"false"===e?y.SimilarityViewMode.CLONE:y.SimilarityViewMode.EDIT:e?y.SimilarityViewMode.EDIT:y.SimilarityViewMode.CLONE})();const se=e.$watch((function(){return e.getActiveRepositoryObject()}),(function(i){i&&(e.loadingControllerResources=!0,Promise.all([m.getSearchQueries(),m.getSamples(),A.getPrefixes(i.id)]).then(([i,t,r])=>{e.canEditActiveRepo=e.canWriteActiveRepo(),L=i?i.data:[],w=t?t.data:[],C=r,Y().then(i=>{e.similarityIndexInfo=i;let t=o.SimilarityQueryType.DATA;e.isEditViewMode()&&(t=o.SimilarityQueryType.SEARCH),e.changeSimilarityIndexType(i.getType(),t)})}).catch(i=>{console.log(i),e.repositoryError=getError(i)}).finally(()=>{ne.push(e.$on("repositoryIsSet",ie)),se(),e.loadingControllerResources=!1}))}))}angular.module("graphdb.framework.similarity.controllers.create",["graphdb.framework.utils.notifications","graphdb.framework.utils.localstorageadapter"]).controller("CreateSimilarityIdxCtrl",I),I.$inject=["$scope","toastr","$uibModal","$timeout","SimilarityRestService","SparqlRestService","$location","productInfo","Notifications","RDF4JRepositoriesRestService","LocalStorageAdapter","LSKeys","$translate","$repositories","EventEmitterService","ModalService"]},65:function(e,i,t){"use strict";t.r(i),t.d(i,"RenderingMode",(function(){return r}));const r={YASGUI:"mode-yasgui",YASQE:"mode-yasqe",YASR:"mode-yasr"}},67:function(e,i,t){"use strict";t.r(i),t.d(i,"YasqeMode",(function(){return r}));const r={WRITE:"WRITE",READ:"READ",PROTECTED:"PROTECTED"}},68:function(e,i){function t(e,i){return{showToastMessageWithDelay:function(t){return new Promise(r=>{e.success(i.instant(t)),setTimeout(r,200)})}}}angular.module("graphdb.framework.utils.notifications",[]).factory("Notifications",t),t.$inject=["toastr","$translate"]},70:function(e,i,t){"use strict";t.r(i),t.d(i,"SimilarityIndexType",(function(){return r}));const r={TEXT:"text",TEXT_LITERAL:"textLiteral",PREDICATION:"predication",isTextType:e=>r.TEXT===e,isTextLiteralType:e=>r.TEXT_LITERAL===e,isPredicationType:e=>r.PREDICATION===e}},72:function(e,i,t){"use strict";t.r(i),t.d(i,"SimilarityIndexStatus",(function(){return r}));const r={CREATING:"CREATING",BUILDING:"BUILDING",BUILT:"BUILT",REBUILDING:"REBUILDING",OUTDATED:"OUTDATED",INTERRUPTED:"INTERRUPTED",OBSOLETE:"OBSOLETE",FAILED:"FAILED",isCreatingStatus:e=>r.CREATING===e,isBuildingStatus:e=>r.BUILDING===e,isBuiltStatus:e=>r.BUILT===e,isRebuildingStatus:e=>r.REBUILDING===e,isOutdatedStatus:e=>r.OUTDATED===e,isInterruptedStatus:e=>r.INTERRUPTED===e,isObsoleteStatus:e=>r.OBSOLETE===e,isFailedStatus:e=>r.FAILED===e}},76:function(e,i,t){"use strict";t.r(i),t.d(i,"SimilarityIndex",(function(){return s}));var r=t(70),n=t(72);class s{constructor(){this.analyzer="",this.infer=!0,this.options="",this.sameAs=!0,this.searchQuery="",this.selectQuery="",this.stopList=void 0,this.name="",this.type=r.SimilarityIndexType.TEXT,this.status=void 0,this.analogicalQuery=void 0,this.inputIndex=void 0,this.isLiteralIndex=""}isTextType(){return r.SimilarityIndexType.isTextType(this.type)}isTextLiteralType(){return r.SimilarityIndexType.isTextLiteralType(this.type)}isPredicationType(){return r.SimilarityIndexType.isPredicationType(this.type)}isCreatingStatus(){return n.SimilarityIndexStatus.isCreatingStatus(this.status)}isBuildingStatus(){return n.SimilarityIndexStatus.isBuildingStatus(this.status)}isBuiltStatus(){return n.SimilarityIndexStatus.isBuiltStatus(this.status)}isRebuildingStatus(){return n.SimilarityIndexStatus.isRebuildingStatus(this.status)}isOutdatedStatus(){return n.SimilarityIndexStatus.isOutdatedStatus(this.status)}isInterruptedStatus(){return n.SimilarityIndexStatus.isInterruptedStatus(this.status)}isObsoleteStatus(){return n.SimilarityIndexStatus.isObsoleteStatus(this.status)}isFailedStatus(){return n.SimilarityIndexStatus.isFailedStatus(this.status)}}}}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(window.webpackJsonp=window.webpackJsonp||[]).push([[11,72,159,181,201,224,248,275],{122:function(e,n,t){"use strict";t.r(n);t(32),t(88);function o(e){const n=[];return Object.keys(e).forEach((function(t){n.push(encodeURIComponent(t)+"="+encodeURIComponent(e[t]))})),n.join("&")}function r(e,n){return _.reduce(e,(function(e,t){if(""===t.key&&""===t.value);else{if(""===t.key)throw new Error(n.instant("externalsync.empty.value.key.error",{value:t.value}));if(e.hasOwnProperty(t.key))throw new Error(n.instant("externalsync.duplicate.key.error",{key:t.key}));e[t.key]=t.value}return e}),{})}function a(e,n){for(let o=0;o<n.length;o++){const r=n[o];if("StringArray"===r.__type)e[r.__name]||(e[r.__name]=[""]);else if("OptionArray"===r.__type)if(e[r.__name])for(let n=0;n<r.__childOptions.length;n++){const t=r.__childOptions[n];if("Boolean"===t.__type)for(let n=0;n<e[r.__name].length;n++){const o=e[r.__name][n];!o.hasOwnProperty([t.__name])&&angular.isDefined(t.__defaultValue)&&(o[t.__name]=t.__defaultValue)}}else{e[r.__name]=[];const n={};for(let e=0;e<r.__childOptions.length;e++){const t=r.__childOptions[e];"StringArray"===t.__type?n[t.__name]=[""]:n[t.__name]=angular.isUndefined(t.__defaultValue)?"":t.__defaultValue}e[r.__name].push(n)}else"Map"===r.__type?e[r.__name]?e[r.__name]=(t=e[r.__name],_.map(t,(function(e,n){return{key:n,value:e}}))):e[r.__name]=[]:"JsonString"===r.__type?!e[r.__name]||e[r.__name]instanceof String||"string"==typeof e[r.__name]||(e[r.__name]=angular.toJson(e[r.__name],2)):angular.isUndefined(e[r.__name])&&(e[r.__name]=angular.isUndefined(r.__defaultValue)?"":r.__defaultValue)}var t;return e}function s(e,n,t){return e.post("repositories/"+n,o({query:t}),{headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/sparql-results+json","X-GraphDB-Local-Consistency":"updating"}})}function i(e){return e.substring(0,e.length-1)+"/instance#"}function c(e,n,t,o,a){const s=function e(n,t){const o={};return _.each(t,(function(t){angular.isDefined(n[t.__name])&&("OptionArray"===t.__type?(o[t.__name]=[],_.each(n[t.__name],(function(n){o[t.__name].push(e(n,t.__childOptions))}))):o[t.__name]=_.cloneDeep(n[t.__name]))})),o}(t,o);for(let e=0;e<o.length;e++)try{"Map"===o[e].__type?s[o[e].__name]=r(s[o[e].__name],$translate):"JsonString"===o[e].__type&&(s[o[e].__name]=angular.fromJson(s[o[e].__name]))}catch(n){return a(o[e].__label,n.message),null}!function e(n){Array.isArray(n)&&(n=_.filter(n,(function(e){return null!==e&&(!e.trim||""!==e.trim())})));return Object.keys(n).forEach((function(t){""!==n[t]&&null!=n[t]||!1===n[t]?"object"==typeof n[t]&&(n[t]=e(n[t])):delete n[t]})),n}(s);let c="";c+="PREFIX :<"+n+">\n";return c+="PREFIX inst:<"+i(n)+">\n",c+="INSERT DATA {\n",c+="\tinst:"+e+" :createConnector '''\n",c+=angular.toJson(s,2),c+="\n''' .\n}\n",c=c.replace(/\\/g,"\\\\\\"),c}function u(e,n,t,r,u,l,d,p,g,f){function m(n){e.beingBuiltConnector={percentDone:0,status:{processedEntities:0,estimatedEntities:0,indexedEntities:0,entitiesPerSecond:0},actionName:n?f.instant("externalsync.repairing"):f.instant("externalsync.creating"),waitOnRepairStartOnce:!!n,eta:"-",inline:!1,iri:null}}function y(n,t,o){return m(o),$.extend(e.beingBuiltConnector,{iri:i(n)+t,name:t,inline:!1,doneCallback:function(){e.beingBuiltConnector.modalInstance.dismiss("cancel")}}),e.beingBuiltConnector.modalInstance=r.open({templateUrl:"pages/connectorProgress.html",controller:"CreateProgressCtrl",size:"lg",backdrop:"static",scope:e}),e.beingBuiltConnector.modalInstance}function C(n,r,a){const s=y(n.value,r.name,!1);p.addStatements(t.getActiveRepository(),o({update:r.query})).then((function(){g.getConnectors().then((function(){g.hasConnector(encodeURIComponent(n.value)).then((function(t){e.existing[n.key]=t.data}))})),u.success(f.instant("created.connector",{name:r.name}))}),(function(e){u.error(getError(e)),a()})).finally((function(){s.dismiss("cancel")}))}e.loader=!1,e.controllers=[],e.existing={},e.definitions={},e.getLoaderMessage=function(){const n=(Date.now()-e.loaderStartTime)/1e3,t=e.getHumanReadableSeconds(n);let o="";return o=e.progressMessage?e.progressMessage+"... "+t:f.instant("common.running.operation",{timeHuman:t}),e.extraMessage&&n>10&&(o+="\n"+e.extraMessage),o},e.setLoader=function(n,t,o){n?(e.loader=!0,e.loaderStartTime=Date.now(),e.progressMessage=t,e.extraMessage=o):(e.loader=!1,e.progressMessage="",e.extraMessage="")},e.initConnector=function(n){return g.initConnector(encodeURIComponent(n.value)).then((function(t){return e.definitions[n.key]=t.data,g.hasConnector(encodeURIComponent(n.value)).then((function(t){e.existing[n.key]=t.data}))}))},e.getConnectors=function(){e.isLicenseValid()&&e.canWriteActiveRepo()&&(e.setLoader(!0,f.instant("externalsync.fetching.connectors"),f.instant("common.extra.message")),g.getConnectors().then((function(o){e.connectors=Object.keys(o.data).map((function(e){return{key:e,value:o.data[e]}})),d.all(_.map(e.connectors,(function(n){return e.initConnector(n)}))).finally((function(){m();const o=function(e){const n=_.map(e,(function(e){return"<"+e.value+"connectorStatus>"})).join("|");return n?"SELECT ?connector ?status { ?connector "+n+" ?status }":null}(e.connectors);o?function(e){return s(n,t.getActiveRepository(),e)}(o).then((function(n){const t=function(e){if(e.bindings)for(let n=0;n<e.bindings.length;n++)try{const t=JSON.parse(e.bindings[n].status.value);if("BUILDING"===t.status)return{connector:e.bindings[n].connector.value,status:t}}catch(e){console.error(e)}return{}}(n.data.results);if(t.connector){const n=t.connector.split(/#/);n[0]=n[0].replace(/\/instance$/,"#"),o=n[0],r=n[1],m(),$.extend(e.beingBuiltConnector,{iri:i(o)+r,name:r,inline:!0,doneCallback:function(){e.beingBuiltConnector.inline=!1}})}var o,r})).finally((function(){e.setLoader(!1)})):e.setLoader(!1)}))})).catch((function(n){e.setLoader(!1),u.error(getError(n),f.instant("externalsync.could.not.get.connectors.error"))})),e.existing={})},e.getOptions=function(n){return e.definitions[n.key]},e.isEmpty=function(e){return angular.isObject(e)&&0===Object.keys(e).length},e.toPrettyJson=function(e){return angular.toJson(e,2)},e.$watch((function(){return t.getActiveRepository()}),e.getConnectors),e.$watch((function(){return t.getActiveLocation()}),e.getConnectors),e.copyConnector=function(n,t){let o;angular.isUndefined(t)||(o=_.cloneDeep(t),o.name=o.name+"-copy");r.open({templateUrl:"pages/createConnector.html",controller:"CreateConnectorCtrl",size:"lg",backdrop:"static",resolve:{connector:function(){return n},values:function(){return angular.isUndefined(o)?{name:"",values:{}}:o},options:function(){return e.getOptions(n)}}}).result.then((function(t){C(n,t,(function(){t.skipConversion=!0,e.newConnector(n,t)}))}))},e.newConnector=function(n,t){r.open({templateUrl:"pages/createConnector.html",controller:"CreateConnectorCtrl",size:"lg",backdrop:"static",resolve:{connector:function(){return n},values:function(){return angular.isUndefined(t)?{name:"",values:{}}:t},options:function(){return e.getOptions(n)}}}).result.then((function(t){C(n,t,(function(){t.skipConversion=!0,e.newConnector(n,t)}))}))},e.repair=function(n,r){l.openSimpleModal({title:f.instant("externalsync.confirm.repair"),message:f.instant("externalsync.repair.warning.msg"),warning:!0}).result.then((function(){const a=y(r.value,n.name,!0),s=(c=n.name,"PREFIX prefix:<"+(l=r.value)+">\nINSERT DATA {\n\t<"+i(l)+c+'> prefix:repairConnector ""\n}');var c,l;p.addStatements(t.getActiveRepository(),o({update:s})).then((function(){g.getConnectors().then((function(){g.hasConnector(encodeURIComponent(r.value)).then((function(n){e.existing[r.key]=n.data}))})),u.success(f.instant("externalsync.repair.success.msg",{name:n.name}))}),(function(e){u.error(getError(e))})).finally((function(){a.dismiss("cancel")}))}))},e.delete=function(n,a){const s=a.key.indexOf("Elastic")>=0||a.key.indexOf("Solr")>=0;r.open({templateUrl:"js/angular/externalsync/templates/deleteConnector.html",controller:"DeleteConnectorCtrl",resolve:{popoverMsg:function(){return s?f.instant("delete.connector.conditional",{type:a.key}):""}}}).result.then((function(r){e.setLoader(!0,f.instant("externalsync.delete.progress.msg",{name:n.name}),f.instant("externalsync.extra.message.warning"));const i=function(e,n,t){const o=n.substring(0,n.length-1)+"/instance#";return"PREFIX prefix:<"+n+">\nINSERT DATA {\n\t<"+o+e+'> prefix:dropConnector "'+(t?"force":"")+'"\n}'}(n.name,a.value,r);p.addStatements(t.getActiveRepository(),o({update:i})).then((function(){g.getConnectors().then((function(){g.hasConnector(encodeURIComponent(a.value)).then((function(n){e.existing[a.key]=n.data}))})),r?(u.success(f.instant("externalsync.delete.force.success.msg",{name:n.name})),s&&u.warning(f.instant("externalsync.delete.remote.warning",{key:a.key}))):u.success(f.instant("externalsync.delete.success.msg",{name:n.name}))}),(function(e){u.error(getError(e))})).finally((function(){e.setLoader(!1)}))}))},e.viewQuery=function(n,t){r.open({templateUrl:"pages/viewQuery.html",controller:"ViewQueryCtrl",resolve:{query:function(){const o=e.getOptions(n);return c(t.name,n.value,a(t.values,o),o)}}})}}function l(e,n,t){e.force=!1,e.popoverMsg=t,e.ok=function(){n.close(e.force)},e.cancel=function(){n.dismiss()}}function d(e,n,t,o,r){function a(){return c(e.name,t.value,e.values,e.options,(function(e,n){r.error(n,e)}))}e.connector=t,e.addField=function(n,t){const o=_.cloneDeep(e.defaultValues[t][0]);e.values[t].splice(n+1,0,o)},e.addOption=function(e,n){n.splice(e+1,0,"")},e.deleteOption=function(e,n){n.splice(e,1)},e.addMapOption=function(e,n){n.splice(e+1,0,{key:"",value:""})},e.deleteMapOption=function(e,n){n.splice(e,1)},e.ok=function(){if(e.form.$valid){const t=a();t&&n.close({name:e.name,values:e.values,options:e.options,query:t})}},e.viewQuery=function(){const e=a();e&&o.open({templateUrl:"pages/viewQuery.html",controller:"ViewQueryCtrl",resolve:{query:function(){return e}}})},e.cancel=function(){n.dismiss("cancel")}}function p(e,n,t,o,r,s,i,c){angular.extend(this,n("ExtendNewConnectorCtrl",{$scope:e,$uibModalInstance:o,connector:r,$uibModal:s})),e.values=i.values,e.options=c,e.name=i.name,i.skipConversion||(e.values=a(e.values,e.options)),e.defaultValues=_.cloneDeep(e.values)}function g(e,n,t,o,r){function a(){const a=function(e){const n=e.replace(/\/instance#.+$/,"#connectorStatus");let t="";return t+="SELECT ?status {\n",t+="\t<"+e+"> <"+n+"> ?status",t+="\n}",t}(e.beingBuiltConnector.iri);e.beingBuiltConnector.iri=null,e.progressInterval=n((function(){(function(e){return s(t,o.getActiveRepository(),e)})(a).then((function(t){const o=function(e){if(e.bindings&&e.bindings.length>0)try{return JSON.parse(e.bindings[0].status.value)}catch(e){console.error(e)}return{}}(t.data.results);"BUILDING"===o.status?(e.beingBuiltConnector.status=o,e.beingBuiltConnector.percentDone=(100*o.processedEntities/o.estimatedEntities).toFixed(0),e.beingBuiltConnector.eta=e.getHumanReadableSeconds(o.etaSeconds),e.beingBuiltConnector.actionName=o.repair?r.instant("externalsync.repairing"):r.instant("externalsync.creating"),e.beingBuiltConnector.waitOnRepairStartOnce=!1):"BUILT"!==o.status||e.beingBuiltConnector.waitOnRepairStartOnce||(n.cancel(e.progressInterval),e.beingBuiltConnector.doneCallback&&e.beingBuiltConnector.doneCallback())}))}),1e3),e.$on("$destroy",(function(){n.cancel(e.progressInterval)}))}e.beingBuiltConnector=e.beingBuiltConnector||{},!e.beingBuiltConnector.inline&&e.beingBuiltConnector.iri&&a(),e.$watch("beingBuiltConnector.iri",(function(n){e.beingBuiltConnector.inline&&n&&a()}))}angular.module("graphdb.framework.externalsync.controllers",["graphdb.framework.rest.rdf4j.repositories.service","graphdb.framework.rest.connectors.service"]).controller("ConnectorsCtrl",u).controller("ExtendNewConnectorCtrl",d).controller("CreateConnectorCtrl",p).controller("CreateProgressCtrl",g).controller("DeleteConnectorCtrl",l).filter("ceil",(function(){return function(e){return Math.ceil(e)}})),u.$inject=["$scope","$http","$repositories","$uibModal","toastr","ModalService","$q","RDF4JRepositoriesRestService","ConnectorsRestService","$translate"],l.$inject=["$scope","$uibModalInstance","popoverMsg"],d.$inject=["$scope","$uibModalInstance","connector","$uibModal","toastr"],p.$inject=["$scope","$controller","$http","$uibModalInstance","connector","$uibModal","values","options"],g.$inject=["$scope","$interval","$http","$repositories","$translate"]},216:function(e,n,t){"use strict";t.r(n),t.d(n,"ConnectorCommand",(function(){return o}));const o={CREATE:"create",REPAIR:"repair",DROP:"drop"}},217:function(e,n,t){"use strict";t.r(n),t.d(n,"BeforeUpdateQueryResult",(function(){return o})),t.d(n,"BeforeUpdateQueryResultStatus",(function(){return r}));class o{constructor(e,n,t,o){this.status=e,this.mesage=o,this.messageLabelKey=n,this.parameters=t}}const r={ERROR:"error",SUCCESS:"success"}},220:function(e,n,t){"use strict";t.r(n),t.d(n,"YasguiResetFlags",(function(){return o}));class o{constructor(e,n,t,o){this.resetCurrentTab=e,this.resetInferResults=n,this.resetSameAs=t,this.resetYasr=o}}},224:function(e,n,t){"use strict";t.r(n),t.d(n,"CancelAbortingQuery",(function(){return o}));class o extends Error{}},246:function(e,n,t){"use strict";t.r(n);var o=t(108),r=t(92),a=(t(88),t(122),t(14)),s=t(94),i=t(216),c=t(217),u=t(87),l=t(0),d=t(71),p=t(95),g=t(224),f=t(12),m=(t(15),t(220));function y(e,n,t,y,C,h,v,_,b,S,R,E,w,x,U,$){this.repository="";let k=!0;n.yasguiConfig=void 0,n.savedQueryConfig=void 0,n.prefixes={},n.inferUserSetting=!0,n.sameAsUserSetting=!0;const A=new Map;let O=!1;n.updateConfig=()=>{n.yasguiConfig={endpoint:q,componentId:p.VIEW_SPARQL_EDITOR,prefixes:n.prefixes,infer:n.inferUserSetting,sameAs:n.sameAsUserSetting,yasrToolbarPlugins:[N],beforeUpdateQuery:J(),outputHandlers:new Map([[u.EventDataType.QUERY_EXECUTED,B],[u.EventDataType.REQUEST_ABORTED,M]])}},n.getActiveRepositoryNoError=()=>v.getActiveRepository();const q=e=>{const n=(e=>{const n=e.getTab();if(n)return n.getYasqe()})(e);if(n)return v.resolveSparqlEndpoint(n.getQueryMode())},B=e=>{const n=A.get(e.tabId);n&&(n.dismiss(),A.delete(e.tabId))},M=e=>{if(e&&f.QueryMode.UPDATE!==e.queryMode){const n=e.getRepository(),t=e.getQueryTrackAlias();n&&t&&U.deleteQuery(t,n)}},I=e=>{const n=e[r.RouteConstants.savedQueryName],t=e[r.RouteConstants.savedQueryOwner];R.getSavedQuery(n,t).then(e=>{const n=Object(o.savedQueryResponseMapper)(e);T(n).then(L).finally(D)}).catch(e=>{b.error(S.instant("query.editor.missing.saved.query.data.error",{savedQueryName:n,error:getError(e)}))})},Q=e=>{const n=e[r.RouteConstants.name],t=e[r.RouteConstants.query],a=e[r.RouteConstants.owner],s=Object(o.buildQueryModel)(t,n,a,!0);T(s).then(L).finally(D)},T=e=>a.YasguiComponentDirectiveUtil.getOntotextYasguiElementAsync("#query-editor").then(n=>n.openTab(e)).then(e=>a.YasguiComponentDirectiveUtil.highlightTabName(e)),D=()=>{O=!0,y.search({}),y.replace()},L=()=>Object(d.toBoolean)(y.search().execute)?a.YasguiComponentDirectiveUtil.getOntotextYasguiElementAsync("#query-editor").then(P).then(j):Promise.resolve(),P=e=>e.getQueryMode().then(n=>({yasguiComponent:e,queryMode:n})),j=({yasguiComponent:e,queryMode:n})=>"update"!==n?e.query():new Promise(n=>{const t=S.instant("confirm.execute"),o=Object(l.decodeHTML)(S.instant("query.editor.automatically.execute.update.warning"));x.openConfirmation(t,o,()=>n(e.query()),()=>n())}),N={createElement:e=>{const n=document.createElement("span");n.classList.add("explore-visual-graph-button-name");const t=document.createElement("button");return t.classList.add("explore-visual-graph-button"),t.classList.add("icon-data"),t.onclick=function(){const n={query:e.yasqe.getValue(),sameAs:e.yasqe.getSameAs(),inference:e.yasqe.getInfer()};y.path("graphs-visualizations").search(n)},t.appendChild(n),t},updateElement:(e,n)=>{if(e.classList.add("hidden"),!n.hasResults())return;const t=n.yasqe.getQueryType();s.QueryType.CONSTRUCT!==t&&s.QueryType.DESCRIBE!==t||e.classList.remove("hidden"),e.querySelector(".explore-visual-graph-button-name").innerText=S.instant("query.editor.visual.btn")},getOrder:()=>2},Y=(e,n)=>({key:e,value:n}),F=e=>[Y("name",e.data.name)],V=(e,t,o)=>{const r=n.$new(!0);r.beingBuiltConnector={percentDone:0,status:{processedEntities:0,estimatedEntities:0,indexedEntities:0,entitiesPerSecond:0},actionName:e,eta:"-",inline:!1,iri:t,name:o,doneCallback:function(){a.dismiss("cancel")}},r.getHumanReadableSeconds=n.getHumanReadableSeconds;const a=_.open({templateUrl:"pages/connectorProgress.html",controller:"CreateProgressCtrl",size:"lg",backdrop:"static",scope:r});return a},J=()=>(e,n)=>E.checkConnector(e).then(e=>e.data.command?e.data.hasSupport?i.ConnectorCommand.CREATE===e.data.command?((e,n)=>{const t=V(S.instant("externalsync.creating"),e.data.iri,e.data.name);return A.set(n,t),new c.BeforeUpdateQueryResult(c.BeforeUpdateQueryResultStatus.SUCCESS,"created.connector",F(e))})(e,n):i.ConnectorCommand.REPAIR===e.data.command?((e,n)=>{const t=V(S.instant("externalsync.repairing"),e.data.iri,e.data.name);return A.set(n,t),new c.BeforeUpdateQueryResult(c.BeforeUpdateQueryResultStatus.SUCCESS,"query.editor.repaired.connector",F(e))})(e,n):i.ConnectorCommand.DROP===e.data.command?(e=>new c.BeforeUpdateQueryResult(c.BeforeUpdateQueryResultStatus.SUCCESS,"externalsync.delete.success.msg",F(e)))(e):void 0:(e=>{const n=[Y("connectorName",e.data.connectorName),Y("pluginName",e.data.pluginName)];return new c.BeforeUpdateQueryResult(c.BeforeUpdateQueryResultStatus.ERROR,"query.editor.inactive.plugin.warning.msg",n)})(e):new c.BeforeUpdateQueryResult(c.BeforeUpdateQueryResultStatus.SUCCESS)).catch(e=>{console.log("Checking connector error: ",e)}),H=()=>{const e=document.querySelectorAll('script[src*="https://www.gstatic.com/"]');if(e.length>0){const n=C.getLanguage();let t="module.js";if("en"!==n&&(t=`module__${n}.js`),!Array.prototype.some.call(e,e=>e.src.includes(t)))return void location.reload()}Promise.all([h.getPrincipal(),v.getPrefixes(v.getActiveRepository())]).then(([e,t])=>{n.prefixes=t,(e=>{n.inferUserSetting=e.appSettings.DEFAULT_INFERENCE,n.sameAsUserSetting=e.appSettings.DEFAULT_SAMEAS})(e),(()=>{n.updateConfig();const e=y.search();e.hasOwnProperty(r.RouteConstants.savedQueryName)?I(e):e.hasOwnProperty(r.RouteConstants.query)?Q(e):w.isActive()&&T()})()})},X=[],z=e=>{const n=a.YasguiComponentDirectiveUtil.getOntotextYasguiElement("#query-editor");n&&n.abortAllRequests().then(()=>{})};window.addEventListener("beforeunload",z);const G=e=>new Promise((n,t)=>{if(!e||e.queriesCount<1&&e.updatesCount<1)return void n();const o=S.instant("common.confirm"),r=Object(l.decodeHTML)((e=>{let n="view.sparql-editor.leave_page.run_queries.confirmation.";!e||e.queriesCount<1?n+="none_queries_":1===e.queriesCount?n+="one_query_":n+="queries_",e.updatesCount&&0!==e.updatesCount?1===e.updatesCount?n+="one_update":n+="updates":n+="non_updates",n+=".message";const t={queriesCount:e.queriesCount,updatesCount:e.updatesCount};return S.instant(n,t)})(e));x.openSimpleModal({title:o,message:r,warning:!0}).result.then((function(){n()}),(function(){t(new g.CancelAbortingQuery)}))});let W=void 0;X.push(e.$on("$locationChangeStart",e=>{if(O)return void(O=!1);const n=a.YasguiComponentDirectiveUtil.getOntotextYasguiElement("#query-editor");if(!n||W)return;e.preventDefault();const t=y.path(),o=y.search();n.getOngoingRequestsInfo().then(e=>G(e)).then(()=>n.abortAllRequests()).then(()=>{W=!0,y.path(t).search(o)}).catch(e=>{if(!(e instanceof g.CancelAbortingQuery))throw e})}));X.push(n.$on("language-changed",(function(){location.reload()}))),X.push($.subscribe("before-language-change",(function(e){return new Promise(n=>{x.openSimpleModal({title:S.instant("query.editor.language.change.warning.title"),message:S.instant("query.editor.reload.page.warning"),warning:!0}).result.then((function(){n(e)}),(function(){e.cancel=!0,n(e)}))})}))),n.$on("$destroy",()=>{X.forEach(e=>e()),window.removeEventListener("beforeunload",z)}),X.push(n.$watch(n.getActiveRepositoryObject,e=>{if(e){if(!k){(e=>{a.YasguiComponentDirectiveUtil.getOntotextYasguiElementAsync("#query-editor").then(n=>n.reInitYasgui(e)).catch(()=>{console.error("Failed to reset yasr results")})})(new m.YasguiResetFlags(!0,!0,!0,!0))}H(),k=!1}}))}angular.module("graphdb.framework.sparql-editor.controllers",["ui.bootstrap","graphdb.framework.rest.connectors.service","graphdb.framework.externalsync.controllers","graphdb.framework.utils.event-emitter-service"]).controller("SparqlEditorCtrl",y),y.$inject=["$rootScope","$scope","$q","$location","$languageService","$jwtAuth","$repositories","$uibModal","toastr","$translate","SparqlRestService","ConnectorsRestService","GuidesService","ModalService","MonitoringRestService","EventEmitterService"]},71:function(e,n,t){"use strict";t.r(n),t.d(n,"removeSpecialChars",(function(){return r})),t.d(n,"toBoolean",(function(){return a})),t.d(n,"toTitleCase",(function(){return s}));var o=t(65);const r=e=>e.replace(/[()']/g,""),a=e=>"string"==typeof e?"true"===e:Boolean(e),s=e=>e?Object(o.upperFirst)(e.toLowerCase()):e},88:function(e,n){angular.module("graphdb.framework.rest.connectors.service",[]).factory("ConnectorsRestService",t),t.$inject=["$http"];function t(e){return{getConnectors:function(){return e.get("rest/connectors")},initConnector:function(n){return e.get("rest/connectors/options?prefix="+n)},hasConnector:function(n){return e.get("rest/connectors/existing?prefix="+n)},checkConnector:function(n){return e.post("rest/connectors/check",n,{headers:{"Content-Type":"text/plain"}})}}}}}]);
|
|
1
|
+
(window.webpackJsonp=window.webpackJsonp||[]).push([[11,72,159,181,201,224,248,275],{122:function(e,n,t){"use strict";t.r(n);t(32),t(88);function o(e){const n=[];return Object.keys(e).forEach((function(t){n.push(encodeURIComponent(t)+"="+encodeURIComponent(e[t]))})),n.join("&")}function r(e,n){return _.reduce(e,(function(e,t){if(""===t.key&&""===t.value);else{if(""===t.key)throw new Error(n.instant("externalsync.empty.value.key.error",{value:t.value}));if(e.hasOwnProperty(t.key))throw new Error(n.instant("externalsync.duplicate.key.error",{key:t.key}));e[t.key]=t.value}return e}),{})}function a(e,n){for(let o=0;o<n.length;o++){const r=n[o];if("StringArray"===r.__type)e[r.__name]||(e[r.__name]=[""]);else if("OptionArray"===r.__type)if(e[r.__name])for(let n=0;n<r.__childOptions.length;n++){const t=r.__childOptions[n];if("Boolean"===t.__type)for(let n=0;n<e[r.__name].length;n++){const o=e[r.__name][n];!o.hasOwnProperty([t.__name])&&angular.isDefined(t.__defaultValue)&&(o[t.__name]=t.__defaultValue)}}else{e[r.__name]=[];const n={};for(let e=0;e<r.__childOptions.length;e++){const t=r.__childOptions[e];"StringArray"===t.__type?n[t.__name]=[""]:n[t.__name]=angular.isUndefined(t.__defaultValue)?"":t.__defaultValue}e[r.__name].push(n)}else"Map"===r.__type?e[r.__name]?e[r.__name]=(t=e[r.__name],_.map(t,(function(e,n){return{key:n,value:e}}))):e[r.__name]=[]:"JsonString"===r.__type?!e[r.__name]||e[r.__name]instanceof String||"string"==typeof e[r.__name]||(e[r.__name]=angular.toJson(e[r.__name],2)):angular.isUndefined(e[r.__name])&&(e[r.__name]=angular.isUndefined(r.__defaultValue)?"":r.__defaultValue)}var t;return e}function s(e,n,t){return e.post("repositories/"+n,o({query:t}),{headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/sparql-results+json","X-GraphDB-Local-Consistency":"updating"}})}function i(e){return e.substring(0,e.length-1)+"/instance#"}function c(e,n,t,o,a){const s=function e(n,t){const o={};return _.each(t,(function(t){angular.isDefined(n[t.__name])&&("OptionArray"===t.__type?(o[t.__name]=[],_.each(n[t.__name],(function(n){o[t.__name].push(e(n,t.__childOptions))}))):o[t.__name]=_.cloneDeep(n[t.__name]))})),o}(t,o);for(let e=0;e<o.length;e++)try{"Map"===o[e].__type?s[o[e].__name]=r(s[o[e].__name],$translate):"JsonString"===o[e].__type&&(s[o[e].__name]=angular.fromJson(s[o[e].__name]))}catch(n){return a(o[e].__label,n.message),null}!function e(n){Array.isArray(n)&&(n=_.filter(n,(function(e){return null!==e&&(!e.trim||""!==e.trim())})));return Object.keys(n).forEach((function(t){""!==n[t]&&null!=n[t]||!1===n[t]?"object"==typeof n[t]&&(n[t]=e(n[t])):delete n[t]})),n}(s);let c="";c+="PREFIX :<"+n+">\n";return c+="PREFIX inst:<"+i(n)+">\n",c+="INSERT DATA {\n",c+="\tinst:"+e+" :createConnector '''\n",c+=angular.toJson(s,2),c+="\n''' .\n}\n",c=c.replace(/\\/g,"\\\\\\"),c}function u(e,n,t,r,u,l,d,p,g,f){function m(n){e.beingBuiltConnector={percentDone:0,status:{processedEntities:0,estimatedEntities:0,indexedEntities:0,entitiesPerSecond:0},actionName:n?f.instant("externalsync.repairing"):f.instant("externalsync.creating"),waitOnRepairStartOnce:!!n,eta:"-",inline:!1,iri:null}}function y(n,t,o){return m(o),$.extend(e.beingBuiltConnector,{iri:i(n)+t,name:t,inline:!1,doneCallback:function(){e.beingBuiltConnector.modalInstance.dismiss("cancel")}}),e.beingBuiltConnector.modalInstance=r.open({templateUrl:"pages/connectorProgress.html",controller:"CreateProgressCtrl",size:"lg",backdrop:"static",scope:e}),e.beingBuiltConnector.modalInstance}function C(n,r,a){const s=y(n.value,r.name,!1);p.addStatements(t.getActiveRepository(),o({update:r.query})).then((function(){g.getConnectors().then((function(){g.hasConnector(encodeURIComponent(n.value)).then((function(t){e.existing[n.key]=t.data}))})),u.success(f.instant("created.connector",{name:r.name}))}),(function(e){u.error(getError(e)),a()})).finally((function(){s.dismiss("cancel")}))}e.loader=!1,e.controllers=[],e.existing={},e.definitions={},e.getLoaderMessage=function(){const n=(Date.now()-e.loaderStartTime)/1e3,t=e.getHumanReadableSeconds(n);let o="";return o=e.progressMessage?e.progressMessage+"... "+t:f.instant("common.running.operation",{timeHuman:t}),e.extraMessage&&n>10&&(o+="\n"+e.extraMessage),o},e.setLoader=function(n,t,o){n?(e.loader=!0,e.loaderStartTime=Date.now(),e.progressMessage=t,e.extraMessage=o):(e.loader=!1,e.progressMessage="",e.extraMessage="")},e.initConnector=function(n){return g.initConnector(encodeURIComponent(n.value)).then((function(t){return e.definitions[n.key]=t.data,g.hasConnector(encodeURIComponent(n.value)).then((function(t){e.existing[n.key]=t.data}))}))},e.getConnectors=function(){e.isLicenseValid()&&e.canWriteActiveRepo()&&(e.setLoader(!0,f.instant("externalsync.fetching.connectors"),f.instant("common.extra.message")),g.getConnectors().then((function(o){e.connectors=Object.keys(o.data).map((function(e){return{key:e,value:o.data[e]}})),d.all(_.map(e.connectors,(function(n){return e.initConnector(n)}))).finally((function(){m();const o=function(e){const n=_.map(e,(function(e){return"<"+e.value+"connectorStatus>"})).join("|");return n?"SELECT ?connector ?status { ?connector "+n+" ?status }":null}(e.connectors);o?function(e){return s(n,t.getActiveRepository(),e)}(o).then((function(n){const t=function(e){if(e.bindings)for(let n=0;n<e.bindings.length;n++)try{const t=JSON.parse(e.bindings[n].status.value);if("BUILDING"===t.status)return{connector:e.bindings[n].connector.value,status:t}}catch(e){console.error(e)}return{}}(n.data.results);if(t.connector){const n=t.connector.split(/#/);n[0]=n[0].replace(/\/instance$/,"#"),o=n[0],r=n[1],m(),$.extend(e.beingBuiltConnector,{iri:i(o)+r,name:r,inline:!0,doneCallback:function(){e.beingBuiltConnector.inline=!1}})}var o,r})).finally((function(){e.setLoader(!1)})):e.setLoader(!1)}))})).catch((function(n){e.setLoader(!1),u.error(getError(n),f.instant("externalsync.could.not.get.connectors.error"))})),e.existing={})},e.getOptions=function(n){return e.definitions[n.key]},e.isEmpty=function(e){return angular.isObject(e)&&0===Object.keys(e).length},e.toPrettyJson=function(e){return angular.toJson(e,2)},e.$watch((function(){return t.getActiveRepository()}),e.getConnectors),e.$watch((function(){return t.getActiveLocation()}),e.getConnectors),e.copyConnector=function(n,t){let o;angular.isUndefined(t)||(o=_.cloneDeep(t),o.name=o.name+"-copy");r.open({templateUrl:"pages/createConnector.html",controller:"CreateConnectorCtrl",size:"lg",backdrop:"static",resolve:{connector:function(){return n},values:function(){return angular.isUndefined(o)?{name:"",values:{}}:o},options:function(){return e.getOptions(n)}}}).result.then((function(t){C(n,t,(function(){t.skipConversion=!0,e.newConnector(n,t)}))}))},e.newConnector=function(n,t){r.open({templateUrl:"pages/createConnector.html",controller:"CreateConnectorCtrl",size:"lg",backdrop:"static",resolve:{connector:function(){return n},values:function(){return angular.isUndefined(t)?{name:"",values:{}}:t},options:function(){return e.getOptions(n)}}}).result.then((function(t){C(n,t,(function(){t.skipConversion=!0,e.newConnector(n,t)}))}))},e.repair=function(n,r){l.openSimpleModal({title:f.instant("externalsync.confirm.repair"),message:f.instant("externalsync.repair.warning.msg"),warning:!0}).result.then((function(){const a=y(r.value,n.name,!0),s=(c=n.name,"PREFIX prefix:<"+(l=r.value)+">\nINSERT DATA {\n\t<"+i(l)+c+'> prefix:repairConnector ""\n}');var c,l;p.addStatements(t.getActiveRepository(),o({update:s})).then((function(){g.getConnectors().then((function(){g.hasConnector(encodeURIComponent(r.value)).then((function(n){e.existing[r.key]=n.data}))})),u.success(f.instant("externalsync.repair.success.msg",{name:n.name}))}),(function(e){u.error(getError(e))})).finally((function(){a.dismiss("cancel")}))}))},e.delete=function(n,a){const s=a.key.indexOf("Elastic")>=0||a.key.indexOf("Solr")>=0;r.open({templateUrl:"js/angular/externalsync/templates/deleteConnector.html",controller:"DeleteConnectorCtrl",resolve:{popoverMsg:function(){return s?f.instant("delete.connector.conditional",{type:a.key}):""}}}).result.then((function(r){e.setLoader(!0,f.instant("externalsync.delete.progress.msg",{name:n.name}),f.instant("externalsync.extra.message.warning"));const i=function(e,n,t){const o=n.substring(0,n.length-1)+"/instance#";return"PREFIX prefix:<"+n+">\nINSERT DATA {\n\t<"+o+e+'> prefix:dropConnector "'+(t?"force":"")+'"\n}'}(n.name,a.value,r);p.addStatements(t.getActiveRepository(),o({update:i})).then((function(){g.getConnectors().then((function(){g.hasConnector(encodeURIComponent(a.value)).then((function(n){e.existing[a.key]=n.data}))})),r?(u.success(f.instant("externalsync.delete.force.success.msg",{name:n.name})),s&&u.warning(f.instant("externalsync.delete.remote.warning",{key:a.key}))):u.success(f.instant("externalsync.delete.success.msg",{name:n.name}))}),(function(e){u.error(getError(e))})).finally((function(){e.setLoader(!1)}))}))},e.viewQuery=function(n,t){r.open({templateUrl:"pages/viewQuery.html",controller:"ViewQueryCtrl",resolve:{query:function(){const o=e.getOptions(n);return c(t.name,n.value,a(t.values,o),o)}}})}}function l(e,n,t){e.force=!1,e.popoverMsg=t,e.ok=function(){n.close(e.force)},e.cancel=function(){n.dismiss()}}function d(e,n,t,o,r){function a(){return c(e.name,t.value,e.values,e.options,(function(e,n){r.error(n,e)}))}e.connector=t,e.addField=function(n,t){const o=_.cloneDeep(e.defaultValues[t][0]);e.values[t].splice(n+1,0,o)},e.addOption=function(e,n){n.splice(e+1,0,"")},e.deleteOption=function(e,n){n.splice(e,1)},e.addMapOption=function(e,n){n.splice(e+1,0,{key:"",value:""})},e.deleteMapOption=function(e,n){n.splice(e,1)},e.ok=function(){if(e.form.$valid){const t=a();t&&n.close({name:e.name,values:e.values,options:e.options,query:t})}},e.viewQuery=function(){const e=a();e&&o.open({templateUrl:"pages/viewQuery.html",controller:"ViewQueryCtrl",resolve:{query:function(){return e}}})},e.cancel=function(){n.dismiss("cancel")}}function p(e,n,t,o,r,s,i,c){angular.extend(this,n("ExtendNewConnectorCtrl",{$scope:e,$uibModalInstance:o,connector:r,$uibModal:s})),e.values=i.values,e.options=c,e.name=i.name,i.skipConversion||(e.values=a(e.values,e.options)),e.defaultValues=_.cloneDeep(e.values)}function g(e,n,t,o,r){function a(){const a=function(e){const n=e.replace(/\/instance#.+$/,"#connectorStatus");let t="";return t+="SELECT ?status {\n",t+="\t<"+e+"> <"+n+"> ?status",t+="\n}",t}(e.beingBuiltConnector.iri);e.beingBuiltConnector.iri=null,e.progressInterval=n((function(){(function(e){return s(t,o.getActiveRepository(),e)})(a).then((function(t){const o=function(e){if(e.bindings&&e.bindings.length>0)try{return JSON.parse(e.bindings[0].status.value)}catch(e){console.error(e)}return{}}(t.data.results);"BUILDING"===o.status?(e.beingBuiltConnector.status=o,e.beingBuiltConnector.percentDone=(100*o.processedEntities/o.estimatedEntities).toFixed(0),e.beingBuiltConnector.eta=e.getHumanReadableSeconds(o.etaSeconds),e.beingBuiltConnector.actionName=o.repair?r.instant("externalsync.repairing"):r.instant("externalsync.creating"),e.beingBuiltConnector.waitOnRepairStartOnce=!1):"BUILT"!==o.status||e.beingBuiltConnector.waitOnRepairStartOnce||(n.cancel(e.progressInterval),e.beingBuiltConnector.doneCallback&&e.beingBuiltConnector.doneCallback())}))}),1e3),e.$on("$destroy",(function(){n.cancel(e.progressInterval)}))}e.beingBuiltConnector=e.beingBuiltConnector||{},!e.beingBuiltConnector.inline&&e.beingBuiltConnector.iri&&a(),e.$watch("beingBuiltConnector.iri",(function(n){e.beingBuiltConnector.inline&&n&&a()}))}angular.module("graphdb.framework.externalsync.controllers",["graphdb.framework.rest.rdf4j.repositories.service","graphdb.framework.rest.connectors.service"]).controller("ConnectorsCtrl",u).controller("ExtendNewConnectorCtrl",d).controller("CreateConnectorCtrl",p).controller("CreateProgressCtrl",g).controller("DeleteConnectorCtrl",l).filter("ceil",(function(){return function(e){return Math.ceil(e)}})),u.$inject=["$scope","$http","$repositories","$uibModal","toastr","ModalService","$q","RDF4JRepositoriesRestService","ConnectorsRestService","$translate"],l.$inject=["$scope","$uibModalInstance","popoverMsg"],d.$inject=["$scope","$uibModalInstance","connector","$uibModal","toastr"],p.$inject=["$scope","$controller","$http","$uibModalInstance","connector","$uibModal","values","options"],g.$inject=["$scope","$interval","$http","$repositories","$translate"]},216:function(e,n,t){"use strict";t.r(n),t.d(n,"ConnectorCommand",(function(){return o}));const o={CREATE:"create",REPAIR:"repair",DROP:"drop"}},217:function(e,n,t){"use strict";t.r(n),t.d(n,"BeforeUpdateQueryResult",(function(){return o})),t.d(n,"BeforeUpdateQueryResultStatus",(function(){return r}));class o{constructor(e,n,t,o){this.status=e,this.mesage=o,this.messageLabelKey=n,this.parameters=t}}const r={ERROR:"error",SUCCESS:"success"}},220:function(e,n,t){"use strict";t.r(n),t.d(n,"YasguiResetFlags",(function(){return o}));class o{constructor(e,n,t,o){this.resetCurrentTab=e,this.resetInferResults=n,this.resetSameAs=t,this.resetYasr=o}}},224:function(e,n,t){"use strict";t.r(n),t.d(n,"CancelAbortingQuery",(function(){return o}));class o extends Error{}},246:function(e,n,t){"use strict";t.r(n);var o=t(108),r=t(92),a=(t(88),t(122),t(14)),s=t(94),i=t(216),c=t(217),u=t(87),l=t(0),d=t(71),p=t(95),g=t(224),f=t(12),m=(t(15),t(220));function y(e,n,t,y,C,h,v,_,b,S,R,E,w,x,U,$){this.repository="";let k=!0;n.yasguiConfig=void 0,n.savedQueryConfig=void 0,n.prefixes={},n.inferUserSetting=!0,n.sameAsUserSetting=!0;const A=new Map;let O=!1;n.updateConfig=()=>{n.yasguiConfig={endpoint:q,componentId:p.VIEW_SPARQL_EDITOR,prefixes:n.prefixes,infer:n.inferUserSetting,sameAs:n.sameAsUserSetting,yasrToolbarPlugins:[N],beforeUpdateQuery:J(),outputHandlers:new Map([[u.EventDataType.QUERY_EXECUTED,B],[u.EventDataType.REQUEST_ABORTED,M]])}},n.getActiveRepositoryNoError=()=>v.getActiveRepository();const q=e=>{const n=(e=>{const n=e.getTab();if(n)return n.getYasqe()})(e);if(n)return v.resolveSparqlEndpoint(n.getQueryMode())},B=e=>{const n=A.get(e.tabId);n&&(n.dismiss(),A.delete(e.tabId))},M=e=>{if(e&&f.QueryMode.UPDATE!==e.queryMode){const n=e.getRepository(),t=e.getQueryTrackAlias();n&&t&&U.deleteQuery(t,n)}},I=e=>{const n=e[r.RouteConstants.savedQueryName],t=e[r.RouteConstants.savedQueryOwner];R.getSavedQuery(n,t).then(e=>{const n=Object(o.savedQueryResponseMapper)(e);T(n).then(L).finally(D)}).catch(e=>{b.error(S.instant("query.editor.missing.saved.query.data.error",{savedQueryName:n,error:getError(e)}))})},Q=e=>{const n=e[r.RouteConstants.name],t=e[r.RouteConstants.query],a=e[r.RouteConstants.owner],s=Object(o.buildQueryModel)(t,n,a,!0);T(s).then(L).finally(D)},T=e=>a.YasguiComponentDirectiveUtil.getOntotextYasguiElementAsync("#query-editor").then(n=>n.openTab(e)).then(e=>a.YasguiComponentDirectiveUtil.highlightTabName(e)),D=()=>{O=!0,y.search({}),y.replace()},L=()=>Object(d.toBoolean)(y.search().execute)?a.YasguiComponentDirectiveUtil.getOntotextYasguiElementAsync("#query-editor").then(P).then(j):Promise.resolve(),P=e=>e.getQueryMode().then(n=>({yasguiComponent:e,queryMode:n})),j=({yasguiComponent:e,queryMode:n})=>"update"!==n?e.query():new Promise(n=>{const t=S.instant("confirm.execute"),o=Object(l.decodeHTML)(S.instant("query.editor.automatically.execute.update.warning"));x.openConfirmation(t,o,()=>n(e.query()),()=>n())}),N={createElement:e=>{const n=document.createElement("span");n.classList.add("explore-visual-graph-button-name");const t=document.createElement("button");return t.classList.add("explore-visual-graph-button"),t.classList.add("icon-data"),t.onclick=function(){const n={query:e.yasqe.getValue(),sameAs:e.yasqe.getSameAs(),inference:e.yasqe.getInfer()};y.path("graphs-visualizations").search(n)},t.appendChild(n),t},updateElement:(e,n)=>{if(e.classList.add("hidden"),!n.hasResults())return;const t=n.yasqe.getQueryType();s.QueryType.CONSTRUCT!==t&&s.QueryType.DESCRIBE!==t||e.classList.remove("hidden"),e.querySelector(".explore-visual-graph-button-name").innerText=S.instant("query.editor.visual.btn")},getOrder:()=>2},Y=(e,n)=>({key:e,value:n}),F=e=>[Y("name",e.data.name)],V=(e,t,o)=>{const r=n.$new(!0);r.beingBuiltConnector={percentDone:0,status:{processedEntities:0,estimatedEntities:0,indexedEntities:0,entitiesPerSecond:0},actionName:e,eta:"-",inline:!1,iri:t,name:o,doneCallback:function(){a.dismiss("cancel")}},r.getHumanReadableSeconds=n.getHumanReadableSeconds;const a=_.open({templateUrl:"pages/connectorProgress.html",controller:"CreateProgressCtrl",size:"lg",backdrop:"static",scope:r});return a},J=()=>(e,n)=>E.checkConnector(e).then(e=>e.data.command?e.data.hasSupport?i.ConnectorCommand.CREATE===e.data.command?((e,n)=>{const t=V(S.instant("externalsync.creating"),e.data.iri,e.data.name);return A.set(n,t),new c.BeforeUpdateQueryResult(c.BeforeUpdateQueryResultStatus.SUCCESS,"created.connector",F(e))})(e,n):i.ConnectorCommand.REPAIR===e.data.command?((e,n)=>{const t=V(S.instant("externalsync.repairing"),e.data.iri,e.data.name);return A.set(n,t),new c.BeforeUpdateQueryResult(c.BeforeUpdateQueryResultStatus.SUCCESS,"query.editor.repaired.connector",F(e))})(e,n):i.ConnectorCommand.DROP===e.data.command?(e=>new c.BeforeUpdateQueryResult(c.BeforeUpdateQueryResultStatus.SUCCESS,"externalsync.delete.success.msg",F(e)))(e):void 0:(e=>{const n=[Y("connectorName",e.data.connectorName),Y("pluginName",e.data.pluginName)];return new c.BeforeUpdateQueryResult(c.BeforeUpdateQueryResultStatus.ERROR,"query.editor.inactive.plugin.warning.msg",n)})(e):new c.BeforeUpdateQueryResult(c.BeforeUpdateQueryResultStatus.SUCCESS)).catch(e=>{console.log("Checking connector error: ",e)}),H=()=>{const e=document.querySelectorAll('script[src*="https://www.gstatic.com/"]');if(e.length>0){const n=C.getLanguage();let t="module.js";if("en"!==n&&(t=`module__${n}.js`),!Array.prototype.some.call(e,e=>e.src.includes(t)))return void location.reload()}Promise.all([h.getPrincipal(),v.getPrefixes(v.getActiveRepository())]).then(([e,t])=>{n.prefixes=t,(e=>{n.inferUserSetting=e.appSettings.DEFAULT_INFERENCE,n.sameAsUserSetting=e.appSettings.DEFAULT_SAMEAS})(e),(()=>{n.updateConfig();const e=y.search();e.hasOwnProperty(r.RouteConstants.savedQueryName)?I(e):e.hasOwnProperty(r.RouteConstants.query)?Q(e):w.isActive()&&T()})()})},X=[],z=e=>{const n=a.YasguiComponentDirectiveUtil.getOntotextYasguiElement("#query-editor");n&&n.abortAllRequests().then(()=>{})};window.addEventListener("beforeunload",z);const G=e=>new Promise((n,t)=>{if(!e||e.queriesCount<1&&e.updatesCount<1)return void n();const o=S.instant("common.confirm"),r=Object(l.decodeHTML)((e=>{let n="view.sparql-editor.leave_page.run_queries.confirmation.";!e||e.queriesCount<1?n+="none_queries_":1===e.queriesCount?n+="one_query_":n+="queries_",e.updatesCount&&0!==e.updatesCount?1===e.updatesCount?n+="one_update":n+="updates":n+="non_updates",n+=".message";const t={queriesCount:e.queriesCount,updatesCount:e.updatesCount};return S.instant(n,t)})(e));x.openSimpleModal({title:o,message:r,warning:!0}).result.then((function(){n()}),(function(){t(new g.CancelAbortingQuery)}))});let W=void 0;X.push(e.$on("$locationChangeStart",e=>{if(O)return void(O=!1);const n=a.YasguiComponentDirectiveUtil.getOntotextYasguiElement("#query-editor");if(!n||W)return;e.preventDefault();const t=y.path(),o=y.search();n.getOngoingRequestsInfo().then(e=>G(e)).then(()=>n.abortAllRequests()).then(()=>{W=!0,y.path(t).search(o)}).catch(e=>{if(!(e instanceof g.CancelAbortingQuery))throw e})}));X.push(n.$on("language-changed",(function(){location.reload()}))),X.push($.subscribe("before-language-change",(function(e){return new Promise(n=>{x.openSimpleModal({title:S.instant("query.editor.language.change.warning.title"),message:S.instant("query.editor.reload.page.warning"),warning:!0}).result.then((function(){n(e)}),(function(){e.cancel=!0,n(e)}))})}))),n.$on("$destroy",()=>{X.forEach(e=>e()),window.removeEventListener("beforeunload",z)}),X.push(n.$watch(n.getActiveRepositoryObject,e=>{if(e){if(!k){(e=>{a.YasguiComponentDirectiveUtil.getOntotextYasguiElementAsync("#query-editor").then(n=>n.reInitYasgui(e)).catch(()=>{console.error("Failed to reset yasr results")})})(new m.YasguiResetFlags(!0,!0,!0,!0))}H(),k=!1}}))}angular.module("graphdb.framework.sparql-editor.controllers",["ui.bootstrap","graphdb.framework.rest.connectors.service","graphdb.framework.externalsync.controllers","graphdb.framework.utils.event-emitter-service"]).controller("SparqlEditorCtrl",y),y.$inject=["$rootScope","$scope","$q","$location","$languageService","$jwtAuth","$repositories","$uibModal","toastr","$translate","SparqlRestService","ConnectorsRestService","GuidesService","ModalService","MonitoringRestService","EventEmitterService"]},71:function(e,n,t){"use strict";t.r(n),t.d(n,"removeSpecialChars",(function(){return r})),t.d(n,"toBoolean",(function(){return a})),t.d(n,"toTitleCase",(function(){return s}));var o=t(64);const r=e=>e.replace(/[()']/g,""),a=e=>"string"==typeof e?"true"===e:Boolean(e),s=e=>e?Object(o.upperFirst)(e.toLowerCase()):e},88:function(e,n){angular.module("graphdb.framework.rest.connectors.service",[]).factory("ConnectorsRestService",t),t.$inject=["$http"];function t(e){return{getConnectors:function(){return e.get("rest/connectors")},initConnector:function(n){return e.get("rest/connectors/options?prefix="+n)},hasConnector:function(n){return e.get("rest/connectors/existing?prefix="+n)},checkConnector:function(n){return e.post("rest/connectors/check",n,{headers:{"Content-Type":"text/plain"}})}}}}}]);
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
(window.webpackJsonp=window.webpackJsonp||[]).push([[12,110,250,270],{170:function(e,t){angular.module("graphdb.framework.rest.export.service",[]).factory("ExportRestService",n),n.$inject=["$http","$repositories","$translate"];function n(e,t,n){return{getExportedStatementsAsJSONLD:function(t,n,o,r,a){const i=`repositories/${n.id}/statements?infer=false`,s={location:n.location},l={accept:a.accept};Array.isArray(t)?s.context=t.map(e=>decodeURIComponent(e)):t&&(s.context=decodeURIComponent(o[t.value].exportUri));r&&(s.authToken=r);a.link&&""!==a.link&&(l.link=a.link);return e({url:i,method:"GET",params:s,headers:l,responseType:"blob"}).then((function(e){const t=e.data;let n=e.headers()["content-disposition"].split("filename=")[1];return n=n.substring(0,n.length),{data:t,filename:n}}))}}}},241:function(e,t,n){"use strict";n.r(t);n(7),n(26),n(27),n(96),n(170);var o=n(463),r=n(0),a=n(65),i=n(86);angular.module("graphdb.framework.impex.export.controllers",["ngCookies","ui.bootstrap","toastr","graphdb.framework.core.services.repositories","graphdb.framework.core.services.jwtauth","graphdb.workbench.utils.filetypes","graphdb.framework.rest.export.service"]).controller("ExportCtrl",["$scope","$http","$location","$timeout","ModalService","filterFilter","$repositories","toastr","ExportRestService","RDF4JRepositoriesRestService","FileTypes","$translate","AuthTokenService","$uibModal",function(e,t,n,s,l,p,c,d,u,g,f,h,m,x){e.getActiveRepository=function(){return c.getActiveRepository()},e.exportFormats=f,e.deleting={},e.showExportDDTooltip=!0,e.page=1,e.pageSize=10,e.pageSizeOptions=[10,20,50,100],e.displayGraphs=[],e.exportFilter="",e.export=!0,e.exportMultipleGraphs=!1,e.repoExportFormat={name:"TriG",type:"application/x-trig",extension:".trig"},e.selectedGraphs={exportGraphs:{}},e.$watch((function(){return c.getActiveRepository()}),(function(){e.exportFilter="",e.getGraphs(),e.selectedAll=!1,s((function(){e.changePageSize(10)}),100)})),e.isShacl=function(e){return"http%3A%2F%2Frdf4j.org%2Fschema%2Frdf4j%23SHACLShapeGraph"===e},e.getGraphs=function(){e.getActiveRepository()?(e.loader=!0,g.getGraphs(e.getActiveRepository()).success((function(t){t.results.bindings.unshift({contextID:{type:"default",value:"import.default.graph"}}),e.graphsByValue={},Object.keys(t.results.bindings).forEach((function(n){const o=t.results.bindings[n];"bnode"===o.contextID.type?o.contextID.value="_:"+o.contextID.value:"default"===o.contextID.type?(o.contextID.uri=encodeURIComponent("http://www.openrdf.org/schema/sesame#nil"),o.contextID.clearUri="DEFAULT",o.contextID.exportUri="null",o.contextID.longName="default graph"):(o.contextID.uri=encodeURIComponent(o.contextID.value),o.contextID.clearUri="GRAPH <"+o.contextID.value+">",o.contextID.exportUri=encodeURIComponent("<"+o.contextID.value+">"),o.contextID.longName="named graph "+o.contextID.value),e.graphsByValue[o.contextID.value]=o.contextID})),e.graphs=t.results.bindings,e.filteredGraphs=Object(a.cloneDeep)(e.graphs),e.displayGraphs=e.filteredGraphs.slice(e.pageSize*(e.page-1),e.pageSize*e.page),e.loader=!1,e.selectedGraphs.exportGraphs={},e.matchedElements=e.graphs})).error((function(t,n){const o=getError(t,n);"There is no active location!"===o&&(c.setRepository(""),d.error(o,h.instant("common.error"))),e.loader=!1}))):e.loader=!1},e.onGraphSearch=function(){e.matchedElements=[],e.deselectAll(),e.filterResults()},e.filterResults=function(){angular.forEach(e.graphs,(function(t){-1!==t.contextID.value.indexOf(e.exportFilter)&&e.matchedElements.push(t)}))},e.downloadExport=function(e,t){let n=e+"&Accept="+encodeURIComponent(t.type);const o=m.getAuthToken();o&&(n=n+"&authToken="+encodeURIComponent(o));let r=window.open(n);s((function(){"about:blank"!==r.document.location.href&&(r.close(),d.error("Could not export graph. Check GraphDB logs for detailed reason."))}),100)},e.openExportDDTooltip=function(){e.showExportDDTooltip&&(s((function(){$("#tooltipTarget").trigger("showExportDDTooltip")}),0),s((function(){$("#tooltipTarget").trigger("showExportDDTooltip")}),3e3),e.showExportDDTooltip=!1)},e.exportRepo=function(t,n){"application/rdf+xml"===t.type||"text/plain"===t.type||"text/turtle"===t.type||"application/x-turtlestar"===t.type||"text/rdf+n3"===t.type?l.openSimpleModal({title:h.instant("common.warning"),message:Object(r.decodeHTML)(h.instant("export.format.warning.msg")),warning:!0}).result.then((function(){e.startDownload(t,n)})):e.startDownload(t,n)},e.openJSONLDExportSettings=function(t,n){x.open({templateUrl:"js/angular/core/components/export-settings-modal/exportSettingsModal.html",controller:i.ExportSettingsCtrl,size:"lg",scope:e,resolve:{format:function(){return t.name}}}).result.then((function(r){const a=r.link?"<"+r.link+">":"";!function(e,t,n,r,a,i){const s={accept:e.type+";profile="+i.link,link:n};u.getExportedStatementsAsJSONLD(t,r,a,m.getAuthToken(),s).then((function({data:e,filename:t}){Object(o.saveAs)(e,t)})).catch((function(e){e.data.text().then(t=>{431===e.status?d.error(e.statusText,h.instant("common.error")):d.error(t,h.instant("common.error"))})}))}(t,n,a,c.getActiveRepositoryObject(),e.graphsByValue,r.currentMode)}))},e.startDownload=function(t,n){let o;const r=c.getActiveRepositoryObject();o=n?`repositories/${r.id}/statements?infer=false&context=${e.graphsByValue[n.value].exportUri}&location=${encodeURIComponent(r.location)}`:`repositories/${r.id}/statements?infer=false&location=${encodeURIComponent(r.location)}`,e.downloadExport(o,t)},e.hasMultipleSelected=function(){if(_.isEmpty(e.selectedGraphs.exportGraphs))return!_.isEmpty(e.selectedGraphs.exportGraphs);for(const t in e.selectedGraphs.exportGraphs)if(!0===e.selectedGraphs.exportGraphs[t])return!0;return!1},e.openJSONLDExportSettingsForSelectedGraphs=function(t){const n=Object.keys(e.selectedGraphs.exportGraphs).filter(t=>e.selectedGraphs.exportGraphs[t]).map(t=>e.graphsByValue[t].exportUri);n?e.openJSONLDExportSettings(t,n):l.openSimpleModal({title:h.instant("export.multiple.graph"),message:h.instant("export.check.graphs.msg"),warning:!0})},e.exportSelectedGraphs=function(t){let n="";for(const t in e.selectedGraphs.exportGraphs)e.selectedGraphs.exportGraphs[t]&&(n+="context="+e.graphsByValue[t].exportUri+"&");if(n){const o=function(){n=n.substring(0,n.length-1);const o="repositories/"+e.getActiveRepository()+"/statements?infer=false&"+n;e.downloadExport(o,t)};"application/rdf+xml"===t.type||"text/plain"===t.type||"text/turtle"===t.type||"application/x-turtlestar"===t.type||"text/rdf+n3"===t.type?l.openSimpleModal({title:h.instant("common.warning"),message:Object(r.decodeHTML)(h.instant("export.format.warning.msg")),warning:!0}).result.then((function(){o()})):o()}else l.openSimpleModal({title:h.instant("export.multiple.graph"),message:h.instant("export.check.graphs.msg"),warning:!0})},e.$watch("exportFilter",(function(){if(e.filteredGraphs=p(e.graphs,e.exportFilter),e.getActiveRepository()&&angular.element(document).find(".btn.btn-secondary.btn-sm.dropdown-toggle span").length){const t=angular.element(document).find(".btn.btn-secondary.btn-sm.dropdown-toggle span")[0].innerHTML.trim();let n;"All"===t&&(n=e.filteredGraphs.length),e.filteredGraphs&&e.filteredGraphs.length>e.pageSize&&"All"!==t&&(n=e.pageSize),e.changePageSize(n),e.changePagination()}})),e.changePagination=function(){e.selectedAll=!1,angular.isDefined(e.filteredGraphs)&&(e.displayGraphs=e.filteredGraphs.slice(e.pageSize*(e.page-1),e.pageSize*e.page))},e.changePageSize=function(t){$(".ot-graph-page-size").removeClass("active"),e.page=1,t&&(e.pageSize=t,e.changePagination()),e.filteredGraphs&&""!==e.exportFilter&&(e.displayGraphs=e.filteredGraphs)},e.checkAll=function(){e.selectedAll=e.selectedAll||!1,angular.forEach(e.displayGraphs,(function(t){t.contextID.uri&&(e.selectedGraphs.exportGraphs[t.contextID.value]=e.selectedAll)}))},e.deselectAll=function(){e.selectedAll=!1,angular.forEach(e.displayGraphs,(function(t){t.contextID.uri&&(e.selectedGraphs.exportGraphs[t.contextID.value]=!1)}))},e.dropRepository=function(){e.canWriteActiveRepo()&&(e.deleting["*"]=!0,l.openSimpleModal({title:h.instant("export.confirm.clear.msg"),message:h.instant("export.warning.clear.repo.msg",{repo:c.getActiveRepository()}),warning:!0}).result.then((function(){s((function(){g.addStatements(c.getActiveRepository(),"update=CLEAR ALL").then((function(){e.deleting["*"]=!1,d.success(h.instant("export.cleared.repo",{repo:c.getActiveRepository()})),e.getGraphs()}),(function(t){e.deleting["*"]=!1;const n=t.data;"string"==typeof n&&n.indexOf("Clearing all statements in the repository is incompatible with collecting history")>-1?d.error(h.instant("export.clearing.statements.warning")):d.error(h.instant("export.cleared.repo.failed.msg",{repo:c.getActiveRepository()}),t)}))}),100)})))},e.dropContext=function(t){e.canWriteActiveRepo()&&(angular.isDefined(t)?function(t){const n=t.contextID.longName;e.deleting[t]=!0,l.openSimpleModal({title:h.instant("export.confirm.clear.graph"),message:h.instant("export.clear.graph.warning",{longName:n}),warning:!0}).result.then((function(){s((function(){const o="update=CLEAR "+t.contextID.clearUri;g.addStatements(c.getActiveRepository(),o).then((function(){e.deleting[t]=!1,d.success(h.instant("export.cleared.graph",{longName:n})),e.getGraphs(),e.exportFilter="",e.filteredGraphs.length=0,e.updateResults(),e.changePageSize(e.pageSize)}),(function(o){e.deleting[t]=!1,d.error(h.instant("export.clear.graph.msg",{longName:n}),getError(o,o.status))}))}),100)}),(function(){e.deleting[t]=!1}))}(t):function(t){const n=[];angular.forEach(e.selectedGraphs.exportGraphs,(function(e,t){e&&n.push(t)})),n.length>0&&(e.deleting[t]=!0,l.openSimpleModal({title:h.instant("export.confirm.clear.graph"),message:h.instant("export.warning.clear.graph.msg"),warning:!0}).result.then((function(){s((function(){let t=0;angular.forEach(n,(function(o){const r="update=CLEAR "+e.graphsByValue[o].clearUri;g.addStatements(c.getActiveRepository(),r).then((function(){e.loader=!0,e.selectedGraphs.exportGraphs[o]=!1,delete e.selectedGraphs.exportGraphs[o],t++,n.length===t&&(e.selectedAll=!1,e.exportFilter="",e.filteredGraphs.length=0,e.getGraphs(),e.updateResults(),e.changePageSize(e.pageSize),d.success(h.instant("export.cleared.graph.msg")),e.loader=!1)}),(function(t){const n=e.graphsByValue[o].longName;d.error(h.instant("export.clear.graph.msg",{longName:n}),getError(t,t.status)),e.selectedAll=!1}))}))}),100)}),(function(){e.deleting[t]=!1})))}(t))}}])},462:function(e,t){(function(t){e.exports=t}).call(this,{})},463:function(e,t,n){var o,r=r||function(e){"use strict";if("undefined"==typeof navigator||!/MSIE [1-9]\./.test(navigator.userAgent)){var t=e.document,n=function(){return e.URL||e.webkitURL||e},o=t.createElementNS("http://www.w3.org/1999/xhtml","a"),r=e.webkitRequestFileSystem,a=e.requestFileSystem||r||e.mozRequestFileSystem,i=function(t){(e.setImmediate||e.setTimeout)((function(){throw t}),0)},s=0,l=function(t){var o=function(){"string"==typeof t?n().revokeObjectURL(t):t.remove()};e.chrome?o():setTimeout(o,500)},p=function(e,t,n){for(var o=(t=[].concat(t)).length;o--;){var r=e["on"+t[o]];if("function"==typeof r)try{r.call(e,n||e)}catch(e){i(e)}}},c=function(e){return/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob(["\ufeff",e],{type:e.type}):e},d=function(t,i){t=c(t);var d,u,g,f=this,h=t.type,m=!1,x=function(){p(f,"writestart progress write writeend".split(" "))},y=function(){(!m&&d||(d=n().createObjectURL(t)),u)?u.location.href=d:null==e.open(d,"_blank")&&"undefined"!=typeof safari&&(e.location.href=d);f.readyState=f.DONE,x(),l(d)},w=function(e){return function(){if(f.readyState!==f.DONE)return e.apply(this,arguments)}},S={create:!0,exclusive:!1};if(f.readyState=f.INIT,i||(i="download"),o)return d=n().createObjectURL(t),o.href=d,o.download=i,void setTimeout((function(){var e,t;e=o,t=new MouseEvent("click"),e.dispatchEvent(t),x(),l(d),f.readyState=f.DONE}));e.chrome&&h&&"application/octet-stream"!==h&&(g=t.slice||t.webkitSlice,t=g.call(t,0,t.size,"application/octet-stream"),m=!0),r&&"download"!==i&&(i+=".download"),("application/octet-stream"===h||r)&&(u=e),a?(s+=t.size,a(e.TEMPORARY,s,w((function(e){e.root.getDirectory("saved",S,w((function(e){var n=function(){e.getFile(i,S,w((function(e){e.createWriter(w((function(n){n.onwriteend=function(t){u.location.href=e.toURL(),f.readyState=f.DONE,p(f,"writeend",t),l(e)},n.onerror=function(){var e=n.error;e.code!==e.ABORT_ERR&&y()},"writestart progress write abort".split(" ").forEach((function(e){n["on"+e]=f["on"+e]})),n.write(t),f.abort=function(){n.abort(),f.readyState=f.DONE},f.readyState=f.WRITING})),y)})),y)};e.getFile(i,{create:!1},w((function(e){e.remove(),n()})),w((function(e){e.code===e.NOT_FOUND_ERR?n():y()})))})),y)})),y)):y()},u=d.prototype;return"undefined"!=typeof navigator&&navigator.msSaveOrOpenBlob?function(e,t){return navigator.msSaveOrOpenBlob(c(e),t)}:(u.abort=function(){this.readyState=this.DONE,p(this,"abort")},u.readyState=u.INIT=0,u.WRITING=1,u.DONE=2,u.error=u.onwritestart=u.onprogress=u.onwrite=u.onabort=u.onerror=u.onwriteend=null,function(e,t){return new d(e,t)})}}("undefined"!=typeof self&&self||"undefined"!=typeof window&&window||this.content);
|
|
1
|
+
(window.webpackJsonp=window.webpackJsonp||[]).push([[12,110,250,270],{170:function(e,t){angular.module("graphdb.framework.rest.export.service",[]).factory("ExportRestService",n),n.$inject=["$http","$repositories","$translate"];function n(e,t,n){return{getExportedStatementsAsJSONLD:function(t,n,o,r,a){const i=`repositories/${n.id}/statements?infer=false`,s={location:n.location},l={accept:a.accept};Array.isArray(t)?s.context=t.map(e=>decodeURIComponent(e)):t&&(s.context=decodeURIComponent(o[t.value].exportUri));r&&(s.authToken=r);a.link&&""!==a.link&&(l.link=a.link);return e({url:i,method:"GET",params:s,headers:l,responseType:"blob"}).then((function(e){const t=e.data;let n=e.headers()["content-disposition"].split("filename=")[1];return n=n.substring(0,n.length),{data:t,filename:n}}))}}}},241:function(e,t,n){"use strict";n.r(t);n(7),n(26),n(27),n(96),n(170);var o=n(463),r=n(0),a=n(64),i=n(86);angular.module("graphdb.framework.impex.export.controllers",["ngCookies","ui.bootstrap","toastr","graphdb.framework.core.services.repositories","graphdb.framework.core.services.jwtauth","graphdb.workbench.utils.filetypes","graphdb.framework.rest.export.service"]).controller("ExportCtrl",["$scope","$http","$location","$timeout","ModalService","filterFilter","$repositories","toastr","ExportRestService","RDF4JRepositoriesRestService","FileTypes","$translate","AuthTokenService","$uibModal",function(e,t,n,s,l,p,c,d,u,g,f,h,m,x){e.getActiveRepository=function(){return c.getActiveRepository()},e.exportFormats=f,e.deleting={},e.showExportDDTooltip=!0,e.page=1,e.pageSize=10,e.pageSizeOptions=[10,20,50,100],e.displayGraphs=[],e.exportFilter="",e.export=!0,e.exportMultipleGraphs=!1,e.repoExportFormat={name:"TriG",type:"application/x-trig",extension:".trig"},e.selectedGraphs={exportGraphs:{}},e.$watch((function(){return c.getActiveRepository()}),(function(){e.exportFilter="",e.getGraphs(),e.selectedAll=!1,s((function(){e.changePageSize(10)}),100)})),e.isShacl=function(e){return"http%3A%2F%2Frdf4j.org%2Fschema%2Frdf4j%23SHACLShapeGraph"===e},e.getGraphs=function(){e.getActiveRepository()?(e.loader=!0,g.getGraphs(e.getActiveRepository()).success((function(t){t.results.bindings.unshift({contextID:{type:"default",value:"import.default.graph"}}),e.graphsByValue={},Object.keys(t.results.bindings).forEach((function(n){const o=t.results.bindings[n];"bnode"===o.contextID.type?o.contextID.value="_:"+o.contextID.value:"default"===o.contextID.type?(o.contextID.uri=encodeURIComponent("http://www.openrdf.org/schema/sesame#nil"),o.contextID.clearUri="DEFAULT",o.contextID.exportUri="null",o.contextID.longName="default graph"):(o.contextID.uri=encodeURIComponent(o.contextID.value),o.contextID.clearUri="GRAPH <"+o.contextID.value+">",o.contextID.exportUri=encodeURIComponent("<"+o.contextID.value+">"),o.contextID.longName="named graph "+o.contextID.value),e.graphsByValue[o.contextID.value]=o.contextID})),e.graphs=t.results.bindings,e.filteredGraphs=Object(a.cloneDeep)(e.graphs),e.displayGraphs=e.filteredGraphs.slice(e.pageSize*(e.page-1),e.pageSize*e.page),e.loader=!1,e.selectedGraphs.exportGraphs={},e.matchedElements=e.graphs})).error((function(t,n){const o=getError(t,n);"There is no active location!"===o&&(c.setRepository(""),d.error(o,h.instant("common.error"))),e.loader=!1}))):e.loader=!1},e.onGraphSearch=function(){e.matchedElements=[],e.deselectAll(),e.filterResults()},e.filterResults=function(){angular.forEach(e.graphs,(function(t){-1!==t.contextID.value.indexOf(e.exportFilter)&&e.matchedElements.push(t)}))},e.downloadExport=function(e,t){let n=e+"&Accept="+encodeURIComponent(t.type);const o=m.getAuthToken();o&&(n=n+"&authToken="+encodeURIComponent(o));let r=window.open(n);s((function(){"about:blank"!==r.document.location.href&&(r.close(),d.error("Could not export graph. Check GraphDB logs for detailed reason."))}),100)},e.openExportDDTooltip=function(){e.showExportDDTooltip&&(s((function(){$("#tooltipTarget").trigger("showExportDDTooltip")}),0),s((function(){$("#tooltipTarget").trigger("showExportDDTooltip")}),3e3),e.showExportDDTooltip=!1)},e.exportRepo=function(t,n){"application/rdf+xml"===t.type||"text/plain"===t.type||"text/turtle"===t.type||"application/x-turtlestar"===t.type||"text/rdf+n3"===t.type?l.openSimpleModal({title:h.instant("common.warning"),message:Object(r.decodeHTML)(h.instant("export.format.warning.msg")),warning:!0}).result.then((function(){e.startDownload(t,n)})):e.startDownload(t,n)},e.openJSONLDExportSettings=function(t,n){x.open({templateUrl:"js/angular/core/components/export-settings-modal/exportSettingsModal.html",controller:i.ExportSettingsCtrl,size:"lg",scope:e,resolve:{format:function(){return t.name}}}).result.then((function(r){const a=r.link?"<"+r.link+">":"";!function(e,t,n,r,a,i){const s={accept:e.type+";profile="+i.link,link:n};u.getExportedStatementsAsJSONLD(t,r,a,m.getAuthToken(),s).then((function({data:e,filename:t}){Object(o.saveAs)(e,t)})).catch((function(e){e.data.text().then(t=>{431===e.status?d.error(e.statusText,h.instant("common.error")):d.error(t,h.instant("common.error"))})}))}(t,n,a,c.getActiveRepositoryObject(),e.graphsByValue,r.currentMode)}))},e.startDownload=function(t,n){let o;const r=c.getActiveRepositoryObject();o=n?`repositories/${r.id}/statements?infer=false&context=${e.graphsByValue[n.value].exportUri}&location=${encodeURIComponent(r.location)}`:`repositories/${r.id}/statements?infer=false&location=${encodeURIComponent(r.location)}`,e.downloadExport(o,t)},e.hasMultipleSelected=function(){if(_.isEmpty(e.selectedGraphs.exportGraphs))return!_.isEmpty(e.selectedGraphs.exportGraphs);for(const t in e.selectedGraphs.exportGraphs)if(!0===e.selectedGraphs.exportGraphs[t])return!0;return!1},e.openJSONLDExportSettingsForSelectedGraphs=function(t){const n=Object.keys(e.selectedGraphs.exportGraphs).filter(t=>e.selectedGraphs.exportGraphs[t]).map(t=>e.graphsByValue[t].exportUri);n?e.openJSONLDExportSettings(t,n):l.openSimpleModal({title:h.instant("export.multiple.graph"),message:h.instant("export.check.graphs.msg"),warning:!0})},e.exportSelectedGraphs=function(t){let n="";for(const t in e.selectedGraphs.exportGraphs)e.selectedGraphs.exportGraphs[t]&&(n+="context="+e.graphsByValue[t].exportUri+"&");if(n){const o=function(){n=n.substring(0,n.length-1);const o="repositories/"+e.getActiveRepository()+"/statements?infer=false&"+n;e.downloadExport(o,t)};"application/rdf+xml"===t.type||"text/plain"===t.type||"text/turtle"===t.type||"application/x-turtlestar"===t.type||"text/rdf+n3"===t.type?l.openSimpleModal({title:h.instant("common.warning"),message:Object(r.decodeHTML)(h.instant("export.format.warning.msg")),warning:!0}).result.then((function(){o()})):o()}else l.openSimpleModal({title:h.instant("export.multiple.graph"),message:h.instant("export.check.graphs.msg"),warning:!0})},e.$watch("exportFilter",(function(){if(e.filteredGraphs=p(e.graphs,e.exportFilter),e.getActiveRepository()&&angular.element(document).find(".btn.btn-secondary.btn-sm.dropdown-toggle span").length){const t=angular.element(document).find(".btn.btn-secondary.btn-sm.dropdown-toggle span")[0].innerHTML.trim();let n;"All"===t&&(n=e.filteredGraphs.length),e.filteredGraphs&&e.filteredGraphs.length>e.pageSize&&"All"!==t&&(n=e.pageSize),e.changePageSize(n),e.changePagination()}})),e.changePagination=function(){e.selectedAll=!1,angular.isDefined(e.filteredGraphs)&&(e.displayGraphs=e.filteredGraphs.slice(e.pageSize*(e.page-1),e.pageSize*e.page))},e.changePageSize=function(t){$(".ot-graph-page-size").removeClass("active"),e.page=1,t&&(e.pageSize=t,e.changePagination()),e.filteredGraphs&&""!==e.exportFilter&&(e.displayGraphs=e.filteredGraphs)},e.checkAll=function(){e.selectedAll=e.selectedAll||!1,angular.forEach(e.displayGraphs,(function(t){t.contextID.uri&&(e.selectedGraphs.exportGraphs[t.contextID.value]=e.selectedAll)}))},e.deselectAll=function(){e.selectedAll=!1,angular.forEach(e.displayGraphs,(function(t){t.contextID.uri&&(e.selectedGraphs.exportGraphs[t.contextID.value]=!1)}))},e.dropRepository=function(){e.canWriteActiveRepo()&&(e.deleting["*"]=!0,l.openSimpleModal({title:h.instant("export.confirm.clear.msg"),message:h.instant("export.warning.clear.repo.msg",{repo:c.getActiveRepository()}),warning:!0}).result.then((function(){s((function(){g.addStatements(c.getActiveRepository(),"update=CLEAR ALL").then((function(){e.deleting["*"]=!1,d.success(h.instant("export.cleared.repo",{repo:c.getActiveRepository()})),e.getGraphs()}),(function(t){e.deleting["*"]=!1;const n=t.data;"string"==typeof n&&n.indexOf("Clearing all statements in the repository is incompatible with collecting history")>-1?d.error(h.instant("export.clearing.statements.warning")):d.error(h.instant("export.cleared.repo.failed.msg",{repo:c.getActiveRepository()}),t)}))}),100)})))},e.dropContext=function(t){e.canWriteActiveRepo()&&(angular.isDefined(t)?function(t){const n=t.contextID.longName;e.deleting[t]=!0,l.openSimpleModal({title:h.instant("export.confirm.clear.graph"),message:h.instant("export.clear.graph.warning",{longName:n}),warning:!0}).result.then((function(){s((function(){const o="update=CLEAR "+t.contextID.clearUri;g.addStatements(c.getActiveRepository(),o).then((function(){e.deleting[t]=!1,d.success(h.instant("export.cleared.graph",{longName:n})),e.getGraphs(),e.exportFilter="",e.filteredGraphs.length=0,e.updateResults(),e.changePageSize(e.pageSize)}),(function(o){e.deleting[t]=!1,d.error(h.instant("export.clear.graph.msg",{longName:n}),getError(o,o.status))}))}),100)}),(function(){e.deleting[t]=!1}))}(t):function(t){const n=[];angular.forEach(e.selectedGraphs.exportGraphs,(function(e,t){e&&n.push(t)})),n.length>0&&(e.deleting[t]=!0,l.openSimpleModal({title:h.instant("export.confirm.clear.graph"),message:h.instant("export.warning.clear.graph.msg"),warning:!0}).result.then((function(){s((function(){let t=0;angular.forEach(n,(function(o){const r="update=CLEAR "+e.graphsByValue[o].clearUri;g.addStatements(c.getActiveRepository(),r).then((function(){e.loader=!0,e.selectedGraphs.exportGraphs[o]=!1,delete e.selectedGraphs.exportGraphs[o],t++,n.length===t&&(e.selectedAll=!1,e.exportFilter="",e.filteredGraphs.length=0,e.getGraphs(),e.updateResults(),e.changePageSize(e.pageSize),d.success(h.instant("export.cleared.graph.msg")),e.loader=!1)}),(function(t){const n=e.graphsByValue[o].longName;d.error(h.instant("export.clear.graph.msg",{longName:n}),getError(t,t.status)),e.selectedAll=!1}))}))}),100)}),(function(){e.deleting[t]=!1})))}(t))}}])},462:function(e,t){(function(t){e.exports=t}).call(this,{})},463:function(e,t,n){var o,r=r||function(e){"use strict";if("undefined"==typeof navigator||!/MSIE [1-9]\./.test(navigator.userAgent)){var t=e.document,n=function(){return e.URL||e.webkitURL||e},o=t.createElementNS("http://www.w3.org/1999/xhtml","a"),r=e.webkitRequestFileSystem,a=e.requestFileSystem||r||e.mozRequestFileSystem,i=function(t){(e.setImmediate||e.setTimeout)((function(){throw t}),0)},s=0,l=function(t){var o=function(){"string"==typeof t?n().revokeObjectURL(t):t.remove()};e.chrome?o():setTimeout(o,500)},p=function(e,t,n){for(var o=(t=[].concat(t)).length;o--;){var r=e["on"+t[o]];if("function"==typeof r)try{r.call(e,n||e)}catch(e){i(e)}}},c=function(e){return/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob(["\ufeff",e],{type:e.type}):e},d=function(t,i){t=c(t);var d,u,g,f=this,h=t.type,m=!1,x=function(){p(f,"writestart progress write writeend".split(" "))},y=function(){(!m&&d||(d=n().createObjectURL(t)),u)?u.location.href=d:null==e.open(d,"_blank")&&"undefined"!=typeof safari&&(e.location.href=d);f.readyState=f.DONE,x(),l(d)},w=function(e){return function(){if(f.readyState!==f.DONE)return e.apply(this,arguments)}},S={create:!0,exclusive:!1};if(f.readyState=f.INIT,i||(i="download"),o)return d=n().createObjectURL(t),o.href=d,o.download=i,void setTimeout((function(){var e,t;e=o,t=new MouseEvent("click"),e.dispatchEvent(t),x(),l(d),f.readyState=f.DONE}));e.chrome&&h&&"application/octet-stream"!==h&&(g=t.slice||t.webkitSlice,t=g.call(t,0,t.size,"application/octet-stream"),m=!0),r&&"download"!==i&&(i+=".download"),("application/octet-stream"===h||r)&&(u=e),a?(s+=t.size,a(e.TEMPORARY,s,w((function(e){e.root.getDirectory("saved",S,w((function(e){var n=function(){e.getFile(i,S,w((function(e){e.createWriter(w((function(n){n.onwriteend=function(t){u.location.href=e.toURL(),f.readyState=f.DONE,p(f,"writeend",t),l(e)},n.onerror=function(){var e=n.error;e.code!==e.ABORT_ERR&&y()},"writestart progress write abort".split(" ").forEach((function(e){n["on"+e]=f["on"+e]})),n.write(t),f.abort=function(){n.abort(),f.readyState=f.DONE},f.readyState=f.WRITING})),y)})),y)};e.getFile(i,{create:!1},w((function(e){e.remove(),n()})),w((function(e){e.code===e.NOT_FOUND_ERR?n():y()})))})),y)})),y)):y()},u=d.prototype;return"undefined"!=typeof navigator&&navigator.msSaveOrOpenBlob?function(e,t){return navigator.msSaveOrOpenBlob(c(e),t)}:(u.abort=function(){this.readyState=this.DONE,p(this,"abort")},u.readyState=u.INIT=0,u.WRITING=1,u.DONE=2,u.error=u.onwritestart=u.onprogress=u.onwrite=u.onabort=u.onerror=u.onwriteend=null,function(e,t){return new d(e,t)})}}("undefined"!=typeof self&&self||"undefined"!=typeof window&&window||this.content);
|
|
2
2
|
/*! @source http://purl.eligrey.com/github/FileSaver.js/blob/master/FileSaver.js */e.exports?e.exports.saveAs=r:null!==n(474)&&null!=n(462)&&(void 0===(o=function(){return r}.apply(t,[]))||(e.exports=o))},474:function(e,t){e.exports=function(){throw new Error("define cannot be used indirect")}},86:function(e,t,n){"use strict";function o(e,t,n,o,r){e.JSONLDModes=[{name:"framed",link:"http://www.w3.org/ns/json-ld#framed"},{name:"expanded",link:"http://www.w3.org/ns/json-ld#expanded"},{name:"flattened",link:"http://www.w3.org/ns/json-ld#flattened"},{name:"compacted",link:"http://www.w3.org/ns/json-ld#compacted"}],e.JSONLDModesNames=e.JSONLDModes.reduce((function(e,t){return e[t.name]=t.name,e}),{}),e.JSONLDFramedModes=[e.JSONLDModesNames.framed],e.JSONLDContextModes=[e.JSONLDModesNames.compacted,e.JSONLDModesNames.flattened],e.defaultMode=e.JSONLDModes.find(e=>"expanded"===e.name),e.currentMode=e.defaultMode,e.link=null,e.fileFormat=r.toLowerCase(),e.setJSONLDSettingsToLocalStorage=function(e,t,r){n.set(o.JSONLD_EXPORT_SETTINGS,JSON.stringify({jsonldFormName:e,jsonldFormLink:t,jsonldLink:r}))},e.cancel=function(){t.dismiss()},e.reset=function(){e.currentMode=e.defaultMode,e.link="",e.setJSONLDSettingsToLocalStorage(e.currentMode.name,e.currentMode.link,e.link)},e.clearLinkInput=function(){e.link="",e.setJSONLDSettingsToLocalStorage(e.currentMode.name,e.currentMode.link,e.link)},e.exportJsonLD=function(){e.setJSONLDSettingsToLocalStorage(e.currentMode.name,e.currentMode.link,e.link),t.close({currentMode:e.currentMode,link:e.link})};!function(){const t=n.get(o.JSONLD_EXPORT_SETTINGS);t&&(e.currentMode=e.JSONLDModes.find(e=>e.name===t.jsonldFormName),e.link=t.jsonldLink)}()}n.r(t),n.d(t,"ExportSettingsCtrl",(function(){return o})),angular.module("graphdb.framework.core.components.export-settings-modal",["graphdb.framework.utils.localstorageadapter"]).controller("ExportSettingsCtrl",o),o.$inject=["$scope","$uibModalInstance","LocalStorageAdapter","LSKeys","format"]},96:function(e,t){angular.module("graphdb.workbench.utils.filetypes",[]).value("FileTypes",[{name:"JSON",translateKey:"download.as.json",type:"application/rdf+json",extension:".json"},{name:"JSON-LD",translateKey:"download.as.jsonld",type:"application/ld+json",extension:".jsonld"},{name:"NDJSON-LD",translateKey:"download.as.ndjsonld",type:"application/x-ld+ndjson",extension:".ndjsonld"},{name:"RDF-XML",translateKey:"download.as.rdfxml",type:"application/rdf+xml",extension:".rdf"},{name:"N3",translateKey:"download.as.n3",type:"text/rdf+n3",extension:".n3"},{name:"N-Triples",translateKey:"download.as.ntriples",type:"text/plain",extension:".nt"},{name:"N-Quads",translateKey:"download.as.nquads",type:"text/x-nquads",extension:".nq"},{name:"Turtle",translateKey:"download.as.turtle",type:"text/turtle",extension:".ttl"},{name:"Turtle*",translateKey:"download.as.turtlestar",type:"application/x-turtlestar",extension:".ttls"},{name:"TriX",translateKey:"download.as.trix",type:"application/trix",extension:".trix"},{name:"TriG",translateKey:"download.as.trig",type:"application/x-trig",extension:".trig"},{name:"TriG*",translateKey:"download.as.trigstar",type:"application/x-trigstar",extension:".trigs"},{name:"Binary RDF",translateKey:"download.as.binaryrdf",type:"application/x-binary-rdf",extension:".brf"}])}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(window.webpackJsonp=window.webpackJsonp||[]).push([[13,145,150],{102:function(e,t,s){"use strict";s.r(t),s.d(t,"ImportResourceTreeElement",(function(){return i}));var r=s(66),o=s(64);class i{constructor(){this.importResource=void 0,this.parent=void 0,this.partialSelected=!1,this.indent=0,this.isImportable=!1,this.hasOngoingImport=!1,this.hasStatusInfo=!1,this.canResetStatus=!1,this.name="",this.shortenedName="",this.path="",this.shortenedContext="",this.selected=!1,this.directories=[],this.files=[],this.isImportedBiggerThanModified=!1,this.isModifiedBiggerThanImported=!1,this.isEditable=!1,this.iconClass="",this.shortenedMessage=""}addResource(e){if(e.isFile())this.files.push(e);else{if(!e.isDirectory())throw new Error("Unsupported resource type!");this.directories.push(e)}}removeResource(e){e.isFile()?this.files=this.files.filter(t=>e.importResource.name!==t.importResource.name):this.directories=this.directories.filter(t=>e.importResource.name!==t.importResource.name)}remove(){this.isRoot()||this.parent.removeResource(this)}getOrCreateDirectory(e){let t=this.directories.find(t=>t.name===e);return t||(t=new i,t.name=e,this.directories.push(t)),t}getRoot(){return this.isRoot()?this:this.parent.getRoot()}isRoot(){return void 0===this.parent}isDirectory(){return this.importResource.isDirectory()}isFile(){return!this.isRoot()&&this.importResource.isFile()}isEmpty(){return 0===this.directories.length&&0===this.files.length}toList(){const e=[];return this.parent&&e.push(this),this.directories.forEach(t=>{e.push(...t.toList())}),e.push(...this.files),e}setSelection(e,t=!0){this.selected=e,this.files.forEach(t=>t.setSelection(e,!1)),this.directories.forEach(t=>t.setSelection(e,!1)),t&&this.getRoot().updateSelectionState()}updateSelectionState(){if(this.directories.forEach(e=>e.updateSelectionState()),this.parent&&this.isDirectory()){const e=this.hasUnselectedChildren(),t=this.hasSelectedChildren();this.selected=t&&!e,this.partialSelected=t&&e}}hasUnselectedChildren(){return this.files.some(e=>!e.selected)||this.directories.some(e=>!e.selected||e.hasUnselectedChildren())}hasSelectedChildren(){return this.files.some(e=>e.selected)||this.directories.some(e=>e.selected||e.hasSelectedChildren())}selectAllWithStatus(e){this.importResource&&e.indexOf(this.importResource.status)>-1&&(this.selected=!0),this.files.forEach(t=>t.selectAllWithStatus(e)),this.directories.forEach(t=>t.selectAllWithStatus(e))}getAllSelectedForImport(){const e=[],t=this.isRoot();return!t&&this.selected&&e.push(this),(t||this.isDirectory()&&!this.selected)&&(this.files.forEach(t=>e.push(...t.getAllSelectedForImport())),this.directories.forEach(t=>e.push(...t.getAllSelectedForImport()))),Object(o.cloneDeep)(e)}getAllSelected(){const e=[];return!this.isRoot()&&this.selected&&e.push(this),this.files.forEach(t=>e.push(...t.getAllSelected())),this.directories.forEach(t=>e.push(...t.getAllSelected())),Object(o.cloneDeep)(e)}getSelectedImportedResources(){return this.getAllSelected().some(e=>e.importResource.status===r.ImportResourceStatus.DONE)}deselectAll(){this.files.forEach(e=>e.deselectAll()),this.directories.forEach(e=>e.deselectAll()),this.selected=!1,this.partialSelected=!1}getAllSelectedFiles(){const e=[];return!this.isRoot()&&this.selected&&e.push(this.importResource),this.files.forEach(t=>e.push(...t.getAllSelectedFiles())),this.directories.forEach(t=>e.push(...t.getAllSelectedFiles())),e}getAllSelectedFilesNames(){return this.getAllSelectedFiles().map(e=>e.name)}getResourceByName(e){if(this.importResource&&this.importResource.name===e)return this;const t=this.files.find(t=>t.importResource.name===e);if(t)return t;for(const t of this.directories){const s=t.getResourceByName(e);if(s)return s}return null}hasTextInResourcesName(e){return!!this.importResource.name.toLowerCase().includes(e.toLowerCase())||(!!this.files.some(t=>t.importResource.name.toLowerCase().includes(e.toLowerCase()))||this.directories.some(t=>t.hasTextInDirectoriesName(e)))}hasTextInDirectoriesName(e){return!(!this.isDirectory()||!this.name.toLowerCase().includes(e.toLowerCase()))||this.directories.some(t=>t.hasTextInDirectoriesName(e))}hasTextInFilesName(e){return!(!this.isFile()||!this.name.toLowerCase().includes(e.toLowerCase()))||(!!this.files.some(t=>t.importResource.name.toLowerCase().includes(e.toLowerCase()))||this.directories.some(t=>t.hasTextInFilesName(e)))}sort(e){this.directories.sort(e),this.files.sort(e),this.directories.forEach(t=>t.sort(e))}getSize(){return this.toList().length}}},126:function(e,t){function s(e,t,s,r,o){e.message=o,e.close=()=>{t.dismiss()},e.copyToClipboard=()=>{navigator.clipboard.writeText(e.message).then(()=>{r.success(s.instant("import.help.messages.copied_to_clipboard")),e.close()},e=>{console.error("Could not copy text: ",e)})}}angular.module("graphdb.framework.impex.import.controllers.import-resource-message-dialog",[]).controller("ImportResourceMessageDialogController",s),s.$inject=["$scope","$uibModalInstance","$translate","toastr","message"]},202:function(e,t,s){"use strict";s.r(t);s(126);var r=s(66),o=s(71);function i(e){return{restrict:"E",templateUrl:"js/angular/import/templates/import-resource-message.html",scope:{resource:"="},link:t=>{t.ImportResourceStatus=r.ImportResourceStatus,t.toTitleCase=e=>o.toTitleCase(e),t.hasReplacedGraphs=t.resource.importResource.numReplacedGraphs>0,t.hasAddedStatements=t.resource.importResource.addedStatements>0,t.hasRemovedStatements=t.resource.importResource.removedStatements>0,t.showMessage=t=>{e.open({templateUrl:"js/angular/import/templates/import-resource-message-dialog.html",controller:"ImportResourceMessageDialogController",size:"lg",windowClass:"import-resource-message-dialog",backdrop:"static",resolve:{message:function(){return t?t.importResource.message:""}}})}}}}angular.module("graphdb.framework.import.directives.import-resource-message",["graphdb.framework.impex.import.controllers.import-resource-message-dialog"]).directive("importResourceMessage",i),i.$inject=["$uibModal"]},203:function(e,t){function s(e,t){return{restrict:"E",templateUrl:"js/angular/import/templates/import-resource-status-info.html",scope:{resource:"="},link:s=>{const r=[];s.popoverTemplate="resourceStatusInfoTemplate.html",s.popoverIsOpen=!1,s.context=s.resource.importResource.context,s.replaceGraphs=s.resource.importResource.replaceGraphs,s.baseUrl=decodeURIComponent(s.resource.importResource.baseURI),s.forceSerial=s.resource.importResource.forceSerial,s.importedOn=s.resource.importResource.importedOn,s.parserSettings=s.resource.importResource.parserSettings,s.hasReplacedGraphs=s.resource.importResource.numReplacedGraphs>0,s.hasAddedStatements=s.resource.importResource.addedStatements>0,s.hasRemovedStatements=s.resource.importResource.removedStatements>0,s.open=()=>{s.closeAllDialogs(),s.popoverIsOpen=!0},s.closeAllDialogs=()=>{e.$broadcast("closePopovers")},s.close=()=>{s.popoverIsOpen=!1};const o=e=>{"Escape"===e.key&&s.$apply(()=>{s.close()})};r.push(s.$on("closePopovers",s.close)),t.on("keydown",o),s.$on("$destroy",()=>{t.off("keydown",o),r.forEach(e=>e())})}}}angular.module("graphdb.framework.import.directives.import-resource-status-info",[]).directive("importResourceStatusInfo",s),s.$inject=["$rootScope","$document"]},204:function(e,t,s){"use strict";s.r(t),s.d(t,"INDENT",(function(){return c})),s.d(t,"serverImportResourceTypeToIconMapping",(function(){return a})),s.d(t,"userImportResourceTypeToIconMapping",(function(){return n})),s.d(t,"ImportResourceTreeService",(function(){return u}));var r=s(75),o=s(102),i=s(66);const c=30,a=new Map;a.set(r.ImportResourceType.DIRECTORY,"icon-folder"),a.set(r.ImportResourceType.FILE,"icon-file");const n=new Map;n.set(r.ImportResourceType.DIRECTORY,"icon-folder"),n.set(r.ImportResourceType.FILE,"icon-upload"),n.set(r.ImportResourceType.URL,"icon-link"),n.set(r.ImportResourceType.TEXT,"icon-sparql");class u{static toImportResourceTree(e,t){const s=new o.ImportResourceTreeElement;return e.forEach(e=>{u.addResourceToTree(s,e,t)}),s}static mergeResourceTree(e,t,s){e.getRoot().toList().forEach(e=>{t.find(t=>t.name===e.importResource.name)||e.remove()}),t.forEach(t=>{const r=e.getResourceByName(t.name);r?r.importResource=t:u.addResourceToTree(e,t,s)})}static addResourceToTree(e,t,s){const r=u.getPath(t);let i;i=t.isDirectory()?r:r.slice(0,r.length-1);const c=u.getOrCreateParent(e,i);if(t.isFile()){const e=new o.ImportResourceTreeElement;return e.parent=c,e.importResource=t,e.path=r.join("/"),e.name=r[r.length-1],c.addResource(e),u.setIcon(e,s),e}return c.importResource=t,c.path=r.join("/"),u.setIcon(c,s),c}static setIcon(e,t){e.iconClass=t?n.get(e.importResource.type):a.get(e.importResource.type)}static getOrCreateParent(e,t){let s=e;return t.forEach(e=>{const t=s.getOrCreateDirectory(e);t.parent=s,s=t}),s}static getPath(e){if(e.isURL())return[e.name];const t=/[/\\]/;return t.test(e.name)?e.name.split(t):[e.name]}static calculateElementIndent(e){e.indent=8+u.getParentsCount(e)*c+"px",e.directories.forEach(e=>u.calculateElementIndent(e)),e.files.forEach(e=>u.calculateElementIndent(e))}static setupAfterTreeInitProperties(e){e.isRoot()||(e.isImportable=u.isImportable(e.importResource),e.hasOngoingImport=u.hasOngoingImport(e.importResource),e.canResetStatus=u.canResetStatus(e.importResource),e.hasStatusInfo="DONE"===e.importResource.status||"ERROR"===e.importResource.status,e.isEditable=e.importResource.isText(),u.setupShortenedMessage(e),u.setupShortenedContext(e),u.setupShortenedName(e),u.setupImportedAndModifiedComparableProperties(e)),e.directories.forEach(e=>u.setupAfterTreeInitProperties(e)),e.files.forEach(e=>u.setupAfterTreeInitProperties(e))}static setupShortenedMessage(e){const t=e.importResource?e.importResource.message:"";t.length>150&&(e.shortenedMessage=t.substring(0,150)+"...")}static setupShortenedContext(e){const t=e.importResource?e.importResource.context:"";t.length>63&&(e.shortenedContext=t.substring(0,30)+"..."+t.substring(t.length-30))}static setupShortenedName(e){const t=e.name||"";t.length>123&&(e.shortenedName=t.substring(0,30)+"..."+t.substring(t.length-30))}static setupImportedAndModifiedComparableProperties(e){const t=e.importResource;if(t){if(0===t.importedOn||0===t.modifiedOn||t.importedOn===t.modifiedOn)return;e.isImportedBiggerThanModified=t.importedOn>t.modifiedOn,e.isModifiedBiggerThanImported=!e.isImportedBiggerThanModified}}static isImportable(e){return e.status!==i.ImportResourceStatus.IMPORTING&&e.status!==i.ImportResourceStatus.UPLOADING&&e.status!==i.ImportResourceStatus.PENDING&&e.status!==i.ImportResourceStatus.INTERRUPTING}static hasOngoingImport(e){return e.status===i.ImportResourceStatus.IMPORTING||e.status===i.ImportResourceStatus.UPLOADING||e.status===i.ImportResourceStatus.PENDING||e.status===i.ImportResourceStatus.INTERRUPTING}static canResetStatus(e){return e.status===i.ImportResourceStatus.DONE||e.status===i.ImportResourceStatus.ERROR}static getParentsCount(e){let t=0;if(void 0===e.parent)return t;let s=e.parent;for(;s;)s=s.parent,t++;return t-1}}},243:function(e,t,s){"use strict";s.r(t);var r=s(66),o=(s(202),s(203),s(125)),i=s(102),c=s(82),a=s(204);const n={FILE:"FILE",DIRECTORY:"DIRECTORY",ALL:"ALL"},u={ALL:"ALL",NONE:"NONE",IMPORTED:"IMPORTED",NOT_IMPORTED:"NOT_IMPORTED"};function l(e,t){return{restrict:"E",templateUrl:"js/angular/import/templates/import-resource-tree.html",scope:{columnKeys:"=",showTypeFilter:"=",sortBy:"=",asc:"=",onImport:"&",onImportAll:"&",onReset:"&",onRemove:"&",onStopImport:"&",onEditResource:"&"},link:(s,l,p)=>{s.resources=new i.ImportResourceTreeElement,s.displayResources=[],s.TYPE_FILTER_OPTIONS=n,s.filterByType=n.ALL,s.filterByFileName="",s.STATUS_OPTIONS=u,s.selectedByStatus=void 0,s.areAllDisplayedImportResourcesSelected=!1,s.areAllDisplayedImportResourcesPartialSelected=!1,s.ImportResourceStatus=r.ImportResourceStatus,s.canRemoveResource=angular.isDefined(p.onRemove),s.canResetSelectedResources=!1,s.SORTING_TYPES=o.SortingType,s.sortAsc=!angular.isDefined(p.asc)||s.asc,s.sortedBy=s.sortBy,s.showLoader=t.getShowLoader(),s.hasSelection=!1,s.selectionChanged=e=>{e.setSelection(e.selected),R(),m(),h()},s.selectResourceWithStatus=e=>{s.selectedByStatus=e,s.resources.setSelection(!1),u.ALL===s.selectedByStatus?s.resources.setSelection(!0):u.IMPORTED===s.selectedByStatus?s.resources.selectAllWithStatus([r.ImportResourceStatus.DONE]):u.NOT_IMPORTED===s.selectedByStatus&&s.resources.selectAllWithStatus([r.ImportResourceStatus.IMPORTING,r.ImportResourceStatus.NONE,r.ImportResourceStatus.ERROR,r.ImportResourceStatus.PENDING,r.ImportResourceStatus.INTERRUPTING]),d(),m()},s.filterByTypeChanged=e=>{s.filterByType=e,d()},s.filterByFileNameChanged=e=>{s.filterByFileName=e,N(d,100)},s.onResetStatus=()=>{const e=s.resources.getAllSelected().filter(e=>!e.isDirectory()).map(e=>e.path);e.length>0&&s.onReset({resources:e})},s.resetStatus=e=>{s.onReset({resources:[e.path]})},s.onRemoveResources=()=>{const e=s.resources.getAllSelected();e&&e.length>0&&s.onRemove({resources:e})},s.removeResource=e=>{s.onRemove({resources:[e]})},s.importAll=e=>{const t=s.resources.getAllSelectedForImport();t.length>0&&s.onImportAll({selectedResources:t,withoutChangingSettings:e})},s.stopImport=e=>{s.onStopImport({resource:e})},s.sort=e=>{s.sortedBy===e?s.sortAsc=!s.sortAsc:s.sortAsc=!0,s.sortedBy=e,d()},s.editResource=e=>{s.onEditResource({resource:e})};const m=()=>{s.canResetSelectedResources=s.resources.getSelectedImportedResources()},d=()=>{s.resources.getRoot().updateSelectionState(),I(),s.displayResources=s.resources.toList().filter(E).filter(O),h(),R()},h=()=>{const e=s.resources.getAllSelectedFilesNames();s.hasSelection=e.length>0,t.updateSelectedFilesNames(e)},R=()=>{const e=s.displayResources.some(e=>!e.selected),t=s.displayResources.some(e=>e.selected);s.areAllDisplayedImportResourcesSelected=t&&!e,s.areAllDisplayedImportResourcesPartialSelected=t&&e},I=()=>{o.SortingType.NAME===s.sortedBy?s.resources.sort(g(s.sortAsc)):o.SortingType.SIZE===s.sortedBy?s.resources.sort(f(s.sortAsc)):o.SortingType.MODIFIED===s.sortedBy?s.resources.sort(S(s.sortAsc)):o.SortingType.IMPORTED===s.sortedBy?s.resources.sort(T(s.sortAsc)):o.SortingType.CONTEXT===s.sortedBy&&s.resources.sort(y(s.sortAsc))},g=e=>(t,s)=>e?t.importResource.name.localeCompare(s.importResource.name):s.importResource.name.localeCompare(t.importResource.name),f=e=>(t,s)=>{const r=0|t.importResource.size,o=0|s.importResource.size;return e?r-o:o-r},S=e=>(t,s)=>{const r=0|t.importResource.modifiedOn,o=0|s.importResource.modifiedOn;return e?r-o:o-r},T=e=>(t,s)=>{const r=0|t.importResource.importedOn,o=0|s.importResource.importedOn;return e?r-o:o-r},y=e=>(t,s)=>e?t.importResource.context.localeCompare(s.importResource.context):s.importResource.context.localeCompare(t.importResource.context),E=e=>n.ALL===s.filterByType||(s.filterByType===n.FILE?e.isFile():s.filterByType===n.DIRECTORY&&e.isDirectory()),O=e=>!s.filterByFileName||(s.filterByType===n.DIRECTORY?e.hasTextInDirectoriesName(s.filterByFileName):s.filterByType===n.FILE?e.hasTextInFilesName(s.filterByFileName):e.hasTextInResourcesName(s.filterByFileName));let A;const N=(t,s)=>{A&&e.cancel(A),A=e(t,s)},C=[];C.push(t.onResourcesUpdated((e=[])=>{const r=c.TABS.USER===t.getActiveTabId();s.resources.isEmpty()?(s.resources=a.ImportResourceTreeService.toImportResourceTree(e,r),r&&(s.sortedBy=o.SortingType.MODIFIED)):a.ImportResourceTreeService.mergeResourceTree(s.resources,e,r),a.ImportResourceTreeService.calculateElementIndent(s.resources),a.ImportResourceTreeService.setupAfterTreeInitProperties(s.resources),d(),m()})),C.push(t.onShowLoaderUpdated(e=>s.showLoader=e)),C.push(t.onActiveTabIdUpdated(()=>s.resources=new i.ImportResourceTreeElement));s.$on("$destroy",()=>{C.forEach(e=>e())})}}}angular.module("graphdb.framework.import.directives.import-resource-tree",["graphdb.framework.import.directives.import-resource-message","graphdb.framework.import.directives.import-resource-status-info"]).directive("importResourceTree",l),l.$inject=["$timeout","ImportContextService"]}}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(window.webpackJsonp=window.webpackJsonp||[]).push([[14,59,96,246,254],{142:function(e,t){angular.module("graphdb.framework.rest.aclmanagement.service",[]).factory("AclManagementRestService",s),s.$inject=["$http"];function s(e){return{getAcl:function(t){return e.get(`rest/repositories/${t}/acl`)},updateAcl:function(t,s){return e.put(`rest/repositories/${t}/acl`,s)}}}},143:function(e,t,s){"use strict";s.r(t),s.d(t,"mapAclRulesResponse",(function(){return l}));var o=s(99);const l=e=>{const t=new o.ACListModel;return e&&e.data&&e.data.forEach(e=>{t.appendNewRule(e.scope,e.policy,e.role,e.operation,e.subject,e.predicate,e.object,e.context,e.plugin)}),t}},239:function(e,t,s){"use strict";s.r(t);s(34),s(142);var o=s(143),l=s(65),n=s(77),r=s(99);function i(e,t,s,i,a,c,u,d,p){e.contextValue=void 0;const h=[];e.ruleData={},e.loading=!1,e.namespaces=[],e.rulesModel=void 0,e.rulesModelCopy=void 0,e.selectedRule=void 0,e.editedRuleIndex=void 0,e.editedRuleScope=void 0,e.editedRuleCopy=void 0,e.isNewRule=!1,e.modelIsDirty=!1,e.dirtyScope=new Set,e.activeTabScope=r.ACL_SCOPE.STATEMENT,e.ACL_SCOPE=r.ACL_SCOPE,e.DEFAULT_CONTEXT_VALUES=r.DEFAULT_CONTEXT_VALUES,e.DEFAULT_CLEAR_GRAPH_CONTEXT_VALUES=r.DEFAULT_CLEAR_GRAPH_CONTEXT_VALUES,e.DEFAULT_URI_VALUES=r.DEFAULT_URI_VALUES,e.rowHeights={},e.isEditMode=()=>void 0===e.editedRuleIndex&&e.rulesModel&&e.modelIsDirty&&e.dirtyScope.size>0,e.addRule=(t,s)=>{e.rulesModel.addRule(t,s),e.editedRuleIndex=s,e.editedRuleScope=t,e.isNewRule=!0,f(t)},e.editRule=(t,s)=>{e.editedRuleIndex=s,e.editedRuleScope=t,e.isNewRule=!1,e.editedRuleCopy=e.rulesModel.getRuleCopy(t,s),e.getRowHeight="height: "+e.rowHeights[e.editedRuleIndex],f(t)},e.deleteRule=(t,s)=>{u.openConfirmation(c.instant("common.confirm"),c.instant("acl_management.rulestable.messages.delete_rule_confirmation",{index:s+1}),()=>{e.rulesModel.removeRule(t,s),f(t)})},e.saveRule=t=>{e.rulesModel.isRuleDuplicated(e.editedRuleScope,e.editedRuleIndex)?v():(e.editedRuleIndex=void 0,e.editedRuleScope=void 0,e.isNewRule=!1,f(t))},e.cancelEditing=(t,s)=>{e.isNewRule?(e.rulesModel.removeRule(t,s),e.isNewRule=!1):(e.rulesModel.replaceRule(t,s,e.editedRuleCopy),e.editedRuleCopy=void 0),e.editedRuleIndex=void 0,e.editedRuleScope=void 0,f(t)},e.moveUp=(t,s)=>{e.rulesModel.moveUp(t,s),f(t),e.modelIsDirty?e.selectedRule=s-1:e.selectedRule=void 0},e.moveDown=(t,s)=>{e.rulesModel.moveDown(t,s),f(t),e.modelIsDirty?e.selectedRule=s+1:e.selectedRule=void 0},e.saveAcl=()=>{e.loading=!0,_().then(R).catch(e=>{const t=getError(e);s.error(t,c.instant("acl_management.errors.updating_rules"))}).finally(()=>{e.loading=!1})},e.cancelAclSave=()=>{u.openConfirmation(c.instant("common.confirm"),c.instant("acl_management.rulestable.messages.revert_acl_list"),()=>{g(),s.success(c.instant("acl_management.rulestable.messages.rules_reverted"))})},e.switchTab=(t,s)=>{void 0===e.editedRuleIndex?(e.selectedRule=void 0,e.activeTabScope=s,e.ruleKeys=e.rulesModel.getRuleKeysByScope(e.activeTabScope)):t.preventDefault()},e.setDirty=function(e){f(e)},e.performSearchActionOnEnter=function(t,s,o){13===t.keyCode&&(t.stopPropagation(),t.preventDefault(),e.triggerValidation(o),o.$valid&&e.saveRule(s))},e.triggerValidation=function(e){angular.forEach(e,(function(e){"object"==typeof e&&e.hasOwnProperty("$modelValue")&&e.$setTouched()}))};const R=()=>{const t=A();return i.getAcl(t).then(t=>{e.rulesModel=Object(o.mapAclRulesResponse)(t),e.rulesModelCopy=Object(o.mapAclRulesResponse)(t),m()}).catch(e=>{const t=getError(e);s.error(t,c.instant("acl_management.errors.loading_rules"))})},_=()=>{const t=A();return i.updateAcl(t,e.rulesModel.toJSON()).then(()=>{s.success(c.instant("acl_management.rulestable.messages.rules_updated"))})},g=()=>{A()&&(e.loading=!0,R().finally(()=>{e.loading=!1}))},m=()=>{e.selectedRule=void 0,e.editedRuleIndex=void 0,e.editedRuleScope=void 0,e.modelIsDirty=!1,e.editedRuleCopy=void 0,e.dirtyScope.clear()},f=t=>{!Object(l.isEqual)(e.rulesModel.getRulesByScope(t),e.rulesModelCopy.getRulesByScope(t))?e.dirtyScope.add(t):e.dirtyScope.delete(t),e.modelIsDirty=e.dirtyScope.size>0},A=()=>a.getActiveRepository(),v=()=>{s.error(c.instant("acl_management.errors.duplicated_rules"))},y=t=>{e.modelIsDirty&&(t.returnValue=!0)},S=()=>{window.removeEventListener("beforeunload",y),h.forEach(e=>e())},E=(s,o)=>{e.modelIsDirty&&(s.preventDefault(),u.openSimpleModal({title:c.instant("common.confirm"),message:c.instant("acl_management.rulestable.messages.unsaved_changes_confirmation"),warning:!0}).result.then((function(){S();const e=t.absUrl().length-t.url().length,s=o.substring(e);t.path(s)}),(function(){})))},L=()=>{e.getAutocompletePromise=p.checkAutocompleteStatus()};a.getActiveRepository()&&d.getNamespaces(a.getActiveRepository()).then(n.mapNamespacesResponse).then(t=>{e.namespaces=t}).catch(e=>{const t=getError(e);s.error(t,c.instant("error.getting.namespaces.for.repo"))}),h.push(e.$on("autocompleteStatus",L)),h.push(e.$watch(A,()=>{m(),g()})),h.push(e.$on("$locationChangeStart",E)),h.push(e.$on("$destroy",S)),window.addEventListener("beforeunload",y)}angular.module("graphdb.framework.aclmanagement.controllers",["graphdb.framework.rest.plugins.service","graphdb.framework.rest.aclmanagement.service"]).controller("AclManagementCtrl",i),i.$inject=["$scope","$location","toastr","AclManagementRestService","$repositories","$translate","ModalService","RDF4JRepositoriesRestService","AutocompleteRestService"]},77:function(e,t,s){"use strict";s.r(t),s.d(t,"mapNamespacesResponse",(function(){return o}));const o=e=>e&&e.data?e.data.results.bindings.map(e=>({prefix:e.prefix.value,uri:e.namespace.value})):[]},99:function(e,t,s){"use strict";s.r(t),s.d(t,"ACListModel",(function(){return l})),s.d(t,"ACRuleModel",(function(){return n})),s.d(t,"StatementACRuleModel",(function(){return r})),s.d(t,"PluginACRuleModel",(function(){return i})),s.d(t,"ClearGraphACRuleModel",(function(){return a})),s.d(t,"SystemACRuleModel",(function(){return c})),s.d(t,"ACL_POLICY",(function(){return d})),s.d(t,"ACL_OPERATION",(function(){return p})),s.d(t,"ACL_SCOPE",(function(){return h})),s.d(t,"DEFAULT_CONTEXT_VALUES",(function(){return R})),s.d(t,"DEFAULT_CLEAR_GRAPH_CONTEXT_VALUES",(function(){return _})),s.d(t,"DEFAULT_URI_VALUES",(function(){return g}));var o=s(65);class l{constructor(e=[]){this._aclRules=new Map,e.forEach(e=>{const t=e.scope;this._aclRules.has(t)||this._aclRules.set(t,[]),this._aclRules.get(t).push(e)})}size(e){return this._aclRules.get(e)&&this._aclRules.get(e).length}appendNewRule(e,t,s,o,l,n,r,i,a){const c=u.createRule(e,t,s,o,l,n,r,i,a);this._aclRules.has(e)||this._aclRules.set(e,[]),this._aclRules.get(e).push(c)}addRule(e,t){const s=this._aclRules.get(e);s?s.splice(t,0,u.createRule(e)):this._aclRules.set(e,[u.createRule(e)])}removeRule(e,t){const s=this._aclRules.get(e);s&&s.splice(t,1)}replaceRule(e,t,s){const o=this._aclRules.get(e);o&&o.splice(t,1,s)}getRule(e,t){const s=this._aclRules.get(e);return s?s[t]:null}isRuleDuplicated(e,t){const s=this.getRule(e,t);return!!s&&this._aclRules.get(e).some((e,l)=>l!==t&&Object(o.isEqual)(s,e))}getRuleCopy(e,t){const s=this.getRule(e,t);return u.createRule(s.scope,s.policy,s.role,s.operation,s.subject,s.predicate,s.object,s.context,s.plugin)}moveUp(e,t){const s=this._aclRules.get(e),o=s[t-1];s[t-1]=s[t],s[t]=o}moveDown(e,t){const s=this._aclRules.get(e),o=s[t+1];s[t+1]=s[t],s[t]=o}toJSON(){const e=[];return this._aclRules.forEach(t=>{t.forEach(t=>e.push(t.toJSON()))}),e}get aclRules(){return this._aclRules}set aclRules(e){this._aclRules=e}getRulesByScope(e){return this._aclRules.get(e)||[]}getRuleKeysByScope(e){return Object.keys(this.getRulesByScope(e)[0]||{})}}class n{constructor(e,t,s=d.ALLOW){this._scope=e,this._role=t,this._policy=s}get scope(){return this._scope}set scope(e){this._scope=e}get roleWithoutCustomPrefix(){return this._role.startsWith("!")?this._role.replace("CUSTOM_"," "):this._role.replace("CUSTOM_","")}get role(){return this._role}set role(e){this._role=e}get policy(){return this._policy}set policy(e){this._policy=e}toJSON(){}}class r extends n{constructor(e,t,s,o,l,n,r){super(h.STATEMENT,e,t),this._subject=s||"*",this._predicate=o||"*",this._object=l||"*",this._context=n||"*",this._operation=r||p.ALL}get subject(){return this._subject}set subject(e){this._subject=e}get predicate(){return this._predicate}set predicate(e){this._predicate=e}get object(){return this._object}set object(e){this._object=e}get context(){return this._context}set context(e){this._context=e}get operation(){return this._operation}set operation(e){this._operation=e}toJSON(){return{scope:this.scope,policy:this.policy,role:this.role,operation:this.operation,subject:this.subject,predicate:this.predicate,object:this.object,context:this.context}}}class i extends n{constructor(e,t,s,o){super(h.PLUGIN,e,t),this._plugin=s||"*",this._operation=o||p.ALL}get plugin(){return this._plugin}set plugin(e){this._plugin=e}get operation(){return this._operation}set operation(e){this._operation=e}toJSON(){return{scope:this.scope,policy:this.policy,role:this.role,operation:this.operation,plugin:this.plugin}}}class a extends n{constructor(e,t,s,o){super(h.CLEAR_GRAPH,e,t),this._context=s||"*",this._defaultResults=o||["*","default","custom"]}get context(){return this._context}set context(e){this._context=e}get defaultResults(){return this._defaultResults}set defaultResults(e){this._defaultResults=e}toJSON(){return{scope:this.scope,policy:this.policy,role:this.role,context:this.context}}}class c extends n{constructor(e,t,s){super(h.SYSTEM,e,t),this._operation=s||p.ALL}get operation(){return this._operation}set operation(e){this._operation=e}toJSON(){return{scope:this.scope,policy:this.policy,role:this.role,operation:this.operation}}}class u{static createRule(e,t,s,o,l,n,u,d,p){switch(e){case h.STATEMENT:return new r(s,t,l,n,u,d,o);case h.PLUGIN:return new i(s,t,p,o);case h.CLEAR_GRAPH:return new a(s,t,d);case h.SYSTEM:return new c(s,t,o);default:throw new Error("Invalid scope: "+e+" provided")}}}const d={ALLOW:"allow",DENY:"deny"},p={READ:"read",WRITE:"write",ALL:"*"},h={STATEMENT:"statement",CLEAR_GRAPH:"clear_graph",PLUGIN:"plugin",SYSTEM:"system"},R=[{type:"default",value:"*",description:"acl_management.defaults.asterisk"},{type:"default",value:"default",description:"acl_management.defaults.default"},{type:"default",value:"named",description:"acl_management.defaults.named"}],_=[{type:"default",value:"*",description:"acl_management.defaults.asterisk"},{type:"default",value:"all",description:"acl_management.defaults.all"},{type:"default",value:"default",description:"acl_management.defaults.default"},{type:"default",value:"named",description:"acl_management.defaults.named"}],g=[{type:"default",value:"*",description:"acl_management.defaults.asterisk"}]}}]);
|
|
1
|
+
(window.webpackJsonp=window.webpackJsonp||[]).push([[14,59,96,246,254],{142:function(e,t){angular.module("graphdb.framework.rest.aclmanagement.service",[]).factory("AclManagementRestService",s),s.$inject=["$http"];function s(e){return{getAcl:function(t){return e.get(`rest/repositories/${t}/acl`)},updateAcl:function(t,s){return e.put(`rest/repositories/${t}/acl`,s)}}}},143:function(e,t,s){"use strict";s.r(t),s.d(t,"mapAclRulesResponse",(function(){return l}));var o=s(99);const l=e=>{const t=new o.ACListModel;return e&&e.data&&e.data.forEach(e=>{t.appendNewRule(e.scope,e.policy,e.role,e.operation,e.subject,e.predicate,e.object,e.context,e.plugin)}),t}},239:function(e,t,s){"use strict";s.r(t);s(34),s(142);var o=s(143),l=s(64),n=s(77),r=s(99);function i(e,t,s,i,a,c,u,d,p){e.contextValue=void 0;const h=[];e.ruleData={},e.loading=!1,e.namespaces=[],e.rulesModel=void 0,e.rulesModelCopy=void 0,e.selectedRule=void 0,e.editedRuleIndex=void 0,e.editedRuleScope=void 0,e.editedRuleCopy=void 0,e.isNewRule=!1,e.modelIsDirty=!1,e.dirtyScope=new Set,e.activeTabScope=r.ACL_SCOPE.STATEMENT,e.ACL_SCOPE=r.ACL_SCOPE,e.DEFAULT_CONTEXT_VALUES=r.DEFAULT_CONTEXT_VALUES,e.DEFAULT_CLEAR_GRAPH_CONTEXT_VALUES=r.DEFAULT_CLEAR_GRAPH_CONTEXT_VALUES,e.DEFAULT_URI_VALUES=r.DEFAULT_URI_VALUES,e.rowHeights={},e.isEditMode=()=>void 0===e.editedRuleIndex&&e.rulesModel&&e.modelIsDirty&&e.dirtyScope.size>0,e.addRule=(t,s)=>{e.rulesModel.addRule(t,s),e.editedRuleIndex=s,e.editedRuleScope=t,e.isNewRule=!0,f(t)},e.editRule=(t,s)=>{e.editedRuleIndex=s,e.editedRuleScope=t,e.isNewRule=!1,e.editedRuleCopy=e.rulesModel.getRuleCopy(t,s),e.getRowHeight="height: "+e.rowHeights[e.editedRuleIndex],f(t)},e.deleteRule=(t,s)=>{u.openConfirmation(c.instant("common.confirm"),c.instant("acl_management.rulestable.messages.delete_rule_confirmation",{index:s+1}),()=>{e.rulesModel.removeRule(t,s),f(t)})},e.saveRule=t=>{e.rulesModel.isRuleDuplicated(e.editedRuleScope,e.editedRuleIndex)?v():(e.editedRuleIndex=void 0,e.editedRuleScope=void 0,e.isNewRule=!1,f(t))},e.cancelEditing=(t,s)=>{e.isNewRule?(e.rulesModel.removeRule(t,s),e.isNewRule=!1):(e.rulesModel.replaceRule(t,s,e.editedRuleCopy),e.editedRuleCopy=void 0),e.editedRuleIndex=void 0,e.editedRuleScope=void 0,f(t)},e.moveUp=(t,s)=>{e.rulesModel.moveUp(t,s),f(t),e.modelIsDirty?e.selectedRule=s-1:e.selectedRule=void 0},e.moveDown=(t,s)=>{e.rulesModel.moveDown(t,s),f(t),e.modelIsDirty?e.selectedRule=s+1:e.selectedRule=void 0},e.saveAcl=()=>{e.loading=!0,_().then(R).catch(e=>{const t=getError(e);s.error(t,c.instant("acl_management.errors.updating_rules"))}).finally(()=>{e.loading=!1})},e.cancelAclSave=()=>{u.openConfirmation(c.instant("common.confirm"),c.instant("acl_management.rulestable.messages.revert_acl_list"),()=>{g(),s.success(c.instant("acl_management.rulestable.messages.rules_reverted"))})},e.switchTab=(t,s)=>{void 0===e.editedRuleIndex?(e.selectedRule=void 0,e.activeTabScope=s,e.ruleKeys=e.rulesModel.getRuleKeysByScope(e.activeTabScope)):t.preventDefault()},e.setDirty=function(e){f(e)},e.performSearchActionOnEnter=function(t,s,o){13===t.keyCode&&(t.stopPropagation(),t.preventDefault(),e.triggerValidation(o),o.$valid&&e.saveRule(s))},e.triggerValidation=function(e){angular.forEach(e,(function(e){"object"==typeof e&&e.hasOwnProperty("$modelValue")&&e.$setTouched()}))};const R=()=>{const t=A();return i.getAcl(t).then(t=>{e.rulesModel=Object(o.mapAclRulesResponse)(t),e.rulesModelCopy=Object(o.mapAclRulesResponse)(t),m()}).catch(e=>{const t=getError(e);s.error(t,c.instant("acl_management.errors.loading_rules"))})},_=()=>{const t=A();return i.updateAcl(t,e.rulesModel.toJSON()).then(()=>{s.success(c.instant("acl_management.rulestable.messages.rules_updated"))})},g=()=>{A()&&(e.loading=!0,R().finally(()=>{e.loading=!1}))},m=()=>{e.selectedRule=void 0,e.editedRuleIndex=void 0,e.editedRuleScope=void 0,e.modelIsDirty=!1,e.editedRuleCopy=void 0,e.dirtyScope.clear()},f=t=>{!Object(l.isEqual)(e.rulesModel.getRulesByScope(t),e.rulesModelCopy.getRulesByScope(t))?e.dirtyScope.add(t):e.dirtyScope.delete(t),e.modelIsDirty=e.dirtyScope.size>0},A=()=>a.getActiveRepository(),v=()=>{s.error(c.instant("acl_management.errors.duplicated_rules"))},y=t=>{e.modelIsDirty&&(t.returnValue=!0)},S=()=>{window.removeEventListener("beforeunload",y),h.forEach(e=>e())},E=(s,o)=>{e.modelIsDirty&&(s.preventDefault(),u.openSimpleModal({title:c.instant("common.confirm"),message:c.instant("acl_management.rulestable.messages.unsaved_changes_confirmation"),warning:!0}).result.then((function(){S();const e=t.absUrl().length-t.url().length,s=o.substring(e);t.path(s)}),(function(){})))},L=()=>{e.getAutocompletePromise=p.checkAutocompleteStatus()};a.getActiveRepository()&&d.getNamespaces(a.getActiveRepository()).then(n.mapNamespacesResponse).then(t=>{e.namespaces=t}).catch(e=>{const t=getError(e);s.error(t,c.instant("error.getting.namespaces.for.repo"))}),h.push(e.$on("autocompleteStatus",L)),h.push(e.$watch(A,()=>{m(),g()})),h.push(e.$on("$locationChangeStart",E)),h.push(e.$on("$destroy",S)),window.addEventListener("beforeunload",y)}angular.module("graphdb.framework.aclmanagement.controllers",["graphdb.framework.rest.plugins.service","graphdb.framework.rest.aclmanagement.service"]).controller("AclManagementCtrl",i),i.$inject=["$scope","$location","toastr","AclManagementRestService","$repositories","$translate","ModalService","RDF4JRepositoriesRestService","AutocompleteRestService"]},77:function(e,t,s){"use strict";s.r(t),s.d(t,"mapNamespacesResponse",(function(){return o}));const o=e=>e&&e.data?e.data.results.bindings.map(e=>({prefix:e.prefix.value,uri:e.namespace.value})):[]},99:function(e,t,s){"use strict";s.r(t),s.d(t,"ACListModel",(function(){return l})),s.d(t,"ACRuleModel",(function(){return n})),s.d(t,"StatementACRuleModel",(function(){return r})),s.d(t,"PluginACRuleModel",(function(){return i})),s.d(t,"ClearGraphACRuleModel",(function(){return a})),s.d(t,"SystemACRuleModel",(function(){return c})),s.d(t,"ACL_POLICY",(function(){return d})),s.d(t,"ACL_OPERATION",(function(){return p})),s.d(t,"ACL_SCOPE",(function(){return h})),s.d(t,"DEFAULT_CONTEXT_VALUES",(function(){return R})),s.d(t,"DEFAULT_CLEAR_GRAPH_CONTEXT_VALUES",(function(){return _})),s.d(t,"DEFAULT_URI_VALUES",(function(){return g}));var o=s(64);class l{constructor(e=[]){this._aclRules=new Map,e.forEach(e=>{const t=e.scope;this._aclRules.has(t)||this._aclRules.set(t,[]),this._aclRules.get(t).push(e)})}size(e){return this._aclRules.get(e)&&this._aclRules.get(e).length}appendNewRule(e,t,s,o,l,n,r,i,a){const c=u.createRule(e,t,s,o,l,n,r,i,a);this._aclRules.has(e)||this._aclRules.set(e,[]),this._aclRules.get(e).push(c)}addRule(e,t){const s=this._aclRules.get(e);s?s.splice(t,0,u.createRule(e)):this._aclRules.set(e,[u.createRule(e)])}removeRule(e,t){const s=this._aclRules.get(e);s&&s.splice(t,1)}replaceRule(e,t,s){const o=this._aclRules.get(e);o&&o.splice(t,1,s)}getRule(e,t){const s=this._aclRules.get(e);return s?s[t]:null}isRuleDuplicated(e,t){const s=this.getRule(e,t);return!!s&&this._aclRules.get(e).some((e,l)=>l!==t&&Object(o.isEqual)(s,e))}getRuleCopy(e,t){const s=this.getRule(e,t);return u.createRule(s.scope,s.policy,s.role,s.operation,s.subject,s.predicate,s.object,s.context,s.plugin)}moveUp(e,t){const s=this._aclRules.get(e),o=s[t-1];s[t-1]=s[t],s[t]=o}moveDown(e,t){const s=this._aclRules.get(e),o=s[t+1];s[t+1]=s[t],s[t]=o}toJSON(){const e=[];return this._aclRules.forEach(t=>{t.forEach(t=>e.push(t.toJSON()))}),e}get aclRules(){return this._aclRules}set aclRules(e){this._aclRules=e}getRulesByScope(e){return this._aclRules.get(e)||[]}getRuleKeysByScope(e){return Object.keys(this.getRulesByScope(e)[0]||{})}}class n{constructor(e,t,s=d.ALLOW){this._scope=e,this._role=t,this._policy=s}get scope(){return this._scope}set scope(e){this._scope=e}get roleWithoutCustomPrefix(){return this._role.startsWith("!")?this._role.replace("CUSTOM_"," "):this._role.replace("CUSTOM_","")}get role(){return this._role}set role(e){this._role=e}get policy(){return this._policy}set policy(e){this._policy=e}toJSON(){}}class r extends n{constructor(e,t,s,o,l,n,r){super(h.STATEMENT,e,t),this._subject=s||"*",this._predicate=o||"*",this._object=l||"*",this._context=n||"*",this._operation=r||p.ALL}get subject(){return this._subject}set subject(e){this._subject=e}get predicate(){return this._predicate}set predicate(e){this._predicate=e}get object(){return this._object}set object(e){this._object=e}get context(){return this._context}set context(e){this._context=e}get operation(){return this._operation}set operation(e){this._operation=e}toJSON(){return{scope:this.scope,policy:this.policy,role:this.role,operation:this.operation,subject:this.subject,predicate:this.predicate,object:this.object,context:this.context}}}class i extends n{constructor(e,t,s,o){super(h.PLUGIN,e,t),this._plugin=s||"*",this._operation=o||p.ALL}get plugin(){return this._plugin}set plugin(e){this._plugin=e}get operation(){return this._operation}set operation(e){this._operation=e}toJSON(){return{scope:this.scope,policy:this.policy,role:this.role,operation:this.operation,plugin:this.plugin}}}class a extends n{constructor(e,t,s,o){super(h.CLEAR_GRAPH,e,t),this._context=s||"*",this._defaultResults=o||["*","default","custom"]}get context(){return this._context}set context(e){this._context=e}get defaultResults(){return this._defaultResults}set defaultResults(e){this._defaultResults=e}toJSON(){return{scope:this.scope,policy:this.policy,role:this.role,context:this.context}}}class c extends n{constructor(e,t,s){super(h.SYSTEM,e,t),this._operation=s||p.ALL}get operation(){return this._operation}set operation(e){this._operation=e}toJSON(){return{scope:this.scope,policy:this.policy,role:this.role,operation:this.operation}}}class u{static createRule(e,t,s,o,l,n,u,d,p){switch(e){case h.STATEMENT:return new r(s,t,l,n,u,d,o);case h.PLUGIN:return new i(s,t,p,o);case h.CLEAR_GRAPH:return new a(s,t,d);case h.SYSTEM:return new c(s,t,o);default:throw new Error("Invalid scope: "+e+" provided")}}}const d={ALLOW:"allow",DENY:"deny"},p={READ:"read",WRITE:"write",ALL:"*"},h={STATEMENT:"statement",CLEAR_GRAPH:"clear_graph",PLUGIN:"plugin",SYSTEM:"system"},R=[{type:"default",value:"*",description:"acl_management.defaults.asterisk"},{type:"default",value:"default",description:"acl_management.defaults.default"},{type:"default",value:"named",description:"acl_management.defaults.named"}],_=[{type:"default",value:"*",description:"acl_management.defaults.asterisk"},{type:"default",value:"all",description:"acl_management.defaults.all"},{type:"default",value:"default",description:"acl_management.defaults.default"},{type:"default",value:"named",description:"acl_management.defaults.named"}],g=[{type:"default",value:"*",description:"acl_management.defaults.asterisk"}]}}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(window.webpackJsonp=window.webpackJsonp||[]).push([[149],{201:function(t,e){function o(){return{link:function(t,e,o){t.$watch("file.status",(function(){"IMPORTING"!==t.file.status&&"UPLOADING"!==t.file.status||!$(e).has("object").length>0&&$(e).append('<object width="'+o.size+'" height="'+o.size+'" data="js/angular/templates/loader/ot-loader.svg?v=2.7.0-
|
|
1
|
+
(window.webpackJsonp=window.webpackJsonp||[]).push([[149],{201:function(t,e){function o(){return{link:function(t,e,o){t.$watch("file.status",(function(){"IMPORTING"!==t.file.status&&"UPLOADING"!==t.file.status||!$(e).has("object").length>0&&$(e).append('<object width="'+o.size+'" height="'+o.size+'" data="js/angular/templates/loader/ot-loader.svg?v=2.7.0-RC4">{{\'common.loading\' | translate}}</object>')}))}}}angular.module("graphdb.framework.import.directives.import-progress-indicator",[]).directive("ImportProgressIndicator",o),o.$inject=[]}}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(window.webpackJsonp=window.webpackJsonp||[]).push([[153],{82:function(e,t,n){"use strict";n.r(t),n.d(t,"TABS",(function(){return r}));var d=n(
|
|
1
|
+
(window.webpackJsonp=window.webpackJsonp||[]).push([[153],{82:function(e,t,n){"use strict";n.r(t),n.d(t,"TABS",(function(){return r}));var d=n(64);const r={USER:"user",SERVER:"server"};function i(e){let t=r.USER,n=void 0,i=[],o=!0,c=[];return{updateActiveTabId:function(n){t=n,e.emit("activeTabIdUpdated",a())},getActiveTabId:a,onActiveTabIdUpdated:function(t){return e.subscribe("activeTabIdUpdated",()=>t(a()))},getFiles:p,addFile:function(t){i.push(t),e.emit("fileAdded",Object(d.cloneDeep)(t))},updateFiles:function(t){i=t,e.emit("filesUpdated",p())},onFilesUpdated:function(t){return e.subscribe("filesUpdated",()=>t(p()))},updateResources:function(t){n=t,e.emit("resourcesUpdated",f())},getResources:f,onResourcesUpdated:function(t){return e.subscribe("resourcesUpdated",()=>t(f()))},updateShowLoader:function(t){o=t,e.emit("showLoaderUpdated",s())},getShowLoader:s,onShowLoaderUpdated:function(t){return e.subscribe("showLoaderUpdated",()=>t(s()))},updateSelectedFilesNames:function(t){c=t,e.emit("selectedFilesNamesUpdated",u())},getSelectedFilesNames:u,onSelectedFilesNamesUpdated:function(t){return e.subscribe("selectedFilesNamesUpdated",()=>t(s()))}};function u(){return c}function s(){return o}function a(){return t}function p(){return Object(d.cloneDeep)(i)}function f(){return Object(d.cloneDeep)(n)}}angular.module("graphdb.framework.import.services.importcontext",[]).factory("ImportContextService",i),i.$inject=["EventEmitterService"]}}]);
|