graphdb-workbench 1.11.2 → 1.11.3-TR1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/10.94e753e068396d6b6ec9.bundle.js +2 -0
- package/dist/10.94e753e068396d6b6ec9.bundle.js.map +1 -0
- package/dist/11.043e8d20764e39c10e31.bundle.js +2 -0
- package/dist/11.043e8d20764e39c10e31.bundle.js.map +1 -0
- package/dist/111.73819c3722ceee587ce7.bundle.js +2 -0
- package/dist/111.73819c3722ceee587ce7.bundle.js.map +1 -0
- package/dist/112.b48a6ea437c1c3ddd7b5.bundle.js +2 -0
- package/dist/112.b48a6ea437c1c3ddd7b5.bundle.js.map +1 -0
- package/dist/113.09a0a17c31bfc387c352.bundle.js +2 -0
- package/dist/113.09a0a17c31bfc387c352.bundle.js.map +1 -0
- package/dist/{114.edebb3161ce52d4ca2e1.bundle.js → 114.dcc909bf7059e08fad2a.bundle.js} +2 -2
- package/dist/{114.edebb3161ce52d4ca2e1.bundle.js.map → 114.dcc909bf7059e08fad2a.bundle.js.map} +1 -1
- package/dist/119.08aed6d34851afdefac5.bundle.js +2 -0
- package/dist/119.08aed6d34851afdefac5.bundle.js.map +1 -0
- package/dist/12.bb55709d82da219afedf.bundle.js +2 -0
- package/dist/12.bb55709d82da219afedf.bundle.js.map +1 -0
- package/dist/121.574db48a413271cafc2e.bundle.js +2 -0
- package/dist/121.574db48a413271cafc2e.bundle.js.map +1 -0
- package/dist/123.9ba8fea15f3fcddc734d.bundle.js +2 -0
- package/dist/123.9ba8fea15f3fcddc734d.bundle.js.map +1 -0
- package/dist/125.4ffda62ed511df3132f6.bundle.js +2 -0
- package/dist/125.4ffda62ed511df3132f6.bundle.js.map +1 -0
- package/dist/126.c5fd3ba65878ffcc3c03.bundle.js +2 -0
- package/dist/126.c5fd3ba65878ffcc3c03.bundle.js.map +1 -0
- package/dist/129.5d023d0fbbb2c517932c.bundle.js +2 -0
- package/dist/129.5d023d0fbbb2c517932c.bundle.js.map +1 -0
- package/dist/131.e7a34e7f2b2e5898249d.bundle.js +2 -0
- package/dist/131.e7a34e7f2b2e5898249d.bundle.js.map +1 -0
- package/dist/132.b98cc245bf2c668b2ffd.bundle.js +2 -0
- package/dist/132.b98cc245bf2c668b2ffd.bundle.js.map +1 -0
- package/dist/134.72b76429fe72a9fc5119.bundle.js +2 -0
- package/dist/134.72b76429fe72a9fc5119.bundle.js.map +1 -0
- package/dist/136.991f41ef4565f68c31a7.bundle.js +2 -0
- package/dist/136.991f41ef4565f68c31a7.bundle.js.map +1 -0
- package/dist/137.b62f0afcb15c29764c04.bundle.js +2 -0
- package/dist/137.b62f0afcb15c29764c04.bundle.js.map +1 -0
- package/dist/138.fba22be7b3b98750e0c3.bundle.js +2 -0
- package/dist/138.fba22be7b3b98750e0c3.bundle.js.map +1 -0
- package/dist/{14.0c709b039159410b0b91.bundle.js → 14.6f8b993e972dee32e159.bundle.js} +2 -2
- package/dist/14.6f8b993e972dee32e159.bundle.js.map +1 -0
- package/dist/140.b4777706146b1ac867ed.bundle.js +2 -0
- package/dist/140.b4777706146b1ac867ed.bundle.js.map +1 -0
- package/dist/141.4464fb26b1893e0dbc7a.bundle.js +2 -0
- package/dist/141.4464fb26b1893e0dbc7a.bundle.js.map +1 -0
- package/dist/142.4d4fdae663dbeb2df310.bundle.js +2 -0
- package/dist/142.4d4fdae663dbeb2df310.bundle.js.map +1 -0
- package/dist/145.c9ab7d2a56005326406c.bundle.js +2 -0
- package/dist/145.c9ab7d2a56005326406c.bundle.js.map +1 -0
- package/dist/146.f5efcb8ef74bf52d3daf.bundle.js +2 -0
- package/dist/146.f5efcb8ef74bf52d3daf.bundle.js.map +1 -0
- package/dist/{147.0798c61ee5472e70b552.bundle.js → 147.fa44265c07ea2c3c5615.bundle.js} +2 -2
- package/dist/{147.0798c61ee5472e70b552.bundle.js.map → 147.fa44265c07ea2c3c5615.bundle.js.map} +1 -1
- package/dist/148.8b1e910543c6c25b2f0b.bundle.js +2 -0
- package/dist/148.8b1e910543c6c25b2f0b.bundle.js.map +1 -0
- package/dist/15.eb562ad073aa0fcd725f.bundle.js +2 -0
- package/dist/15.eb562ad073aa0fcd725f.bundle.js.map +1 -0
- package/dist/16.0a3c03f05a4bbdfe83ef.bundle.js +2 -0
- package/dist/16.0a3c03f05a4bbdfe83ef.bundle.js.map +1 -0
- package/dist/18.c3e44ed00a2532402729.bundle.js +3 -0
- package/dist/18.c3e44ed00a2532402729.bundle.js.map +1 -0
- package/dist/20.264daf29beccbf7de84a.bundle.js +2 -0
- package/dist/20.264daf29beccbf7de84a.bundle.js.map +1 -0
- package/dist/22.e85ffde858c596437b7a.bundle.js +1 -1
- package/dist/22.e85ffde858c596437b7a.bundle.js.map +1 -1
- package/dist/23.c58eff831306fad29d42.bundle.js +2 -0
- package/dist/23.c58eff831306fad29d42.bundle.js.map +1 -0
- package/dist/25.8c10d875bf32c8648157.bundle.js +2 -0
- package/dist/25.8c10d875bf32c8648157.bundle.js.map +1 -0
- package/dist/{26.57526f30f6b3c581334d.bundle.js → 26.c59631eb4bc0bf8d26b2.bundle.js} +2 -2
- package/dist/26.c59631eb4bc0bf8d26b2.bundle.js.map +1 -0
- package/dist/27.ed9e0cc8aaa3a12c1fa2.bundle.js +2 -0
- package/dist/27.ed9e0cc8aaa3a12c1fa2.bundle.js.map +1 -0
- package/dist/28.8f5d9fc8ee46db2a6357.bundle.js +2 -0
- package/dist/28.8f5d9fc8ee46db2a6357.bundle.js.map +1 -0
- package/dist/30.d341c7532759bc79f41a.bundle.js +1 -1
- package/dist/30.d341c7532759bc79f41a.bundle.js.map +1 -1
- package/dist/{32.ba5b5ca3e4b7dcf5bd15.bundle.js → 32.1059e272ed99ba3db699.bundle.js} +2 -2
- package/dist/32.1059e272ed99ba3db699.bundle.js.map +1 -0
- package/dist/{35.b8c8d16a8707c20a1fcb.bundle.js → 35.1f53c71368afc468cc10.bundle.js} +2 -2
- package/dist/35.1f53c71368afc468cc10.bundle.js.map +1 -0
- package/dist/{36.d96e6ee811e8340ae320.bundle.js → 36.aced0c9768c16e4d29ef.bundle.js} +2 -2
- package/dist/36.aced0c9768c16e4d29ef.bundle.js.map +1 -0
- package/dist/37.dcbe2e4e1f86ca2da209.bundle.js +1 -1
- package/dist/37.dcbe2e4e1f86ca2da209.bundle.js.map +1 -1
- package/dist/38.171aa543e807777b4f29.bundle.js +1 -1
- package/dist/38.171aa543e807777b4f29.bundle.js.map +1 -1
- package/dist/40.f660048c67e9b6d478dc.bundle.js +2 -0
- package/dist/40.f660048c67e9b6d478dc.bundle.js.map +1 -0
- package/dist/{42.190f8880ee8f3a97a042.bundle.js → 42.9bbccd6cb2c263d7b873.bundle.js} +2 -2
- package/dist/42.9bbccd6cb2c263d7b873.bundle.js.map +1 -0
- package/dist/{43.899bf21ce1de203ace21.bundle.js → 43.6f609ec150488009b166.bundle.js} +2 -2
- package/dist/43.6f609ec150488009b166.bundle.js.map +1 -0
- package/dist/{44.c649782fa0755b53a62c.bundle.js → 44.8be8b582a97146d3ad6f.bundle.js} +2 -2
- package/dist/44.8be8b582a97146d3ad6f.bundle.js.map +1 -0
- package/dist/47.b94dca10f70c70009f46.bundle.js +2 -0
- package/dist/47.b94dca10f70c70009f46.bundle.js.map +1 -0
- package/dist/{48.52c5b13ab244c45a8c43.bundle.js → 48.10699147cdbee9af3c2b.bundle.js} +2 -2
- package/dist/48.10699147cdbee9af3c2b.bundle.js.map +1 -0
- package/dist/{5.21d2da4b4bc2b26e2534.bundle.js → 5.275d1f74283aff0821f2.bundle.js} +2 -2
- package/dist/5.275d1f74283aff0821f2.bundle.js.map +1 -0
- package/dist/{56.ce399f5788c0f5fe937b.bundle.js → 56.dae3cb719fcb013d7a06.bundle.js} +2 -2
- package/dist/56.dae3cb719fcb013d7a06.bundle.js.map +1 -0
- package/dist/68.5fa639981e7ce624fb73.bundle.js +2 -0
- package/dist/68.5fa639981e7ce624fb73.bundle.js.map +1 -0
- package/dist/{7.a0f5ec224bebd08058f4.bundle.js → 7.9946929545b7635857ac.bundle.js} +2 -2
- package/dist/7.9946929545b7635857ac.bundle.js.map +1 -0
- package/dist/75.3dd1e0c0ad0cf40ed6a1.bundle.js +2 -0
- package/dist/75.3dd1e0c0ad0cf40ed6a1.bundle.js.map +1 -0
- package/dist/78.6caec59329b53bb098ee.bundle.js +2 -0
- package/dist/78.6caec59329b53bb098ee.bundle.js.map +1 -0
- package/dist/{79.f4a2c3ec71bed08d61b9.bundle.js → 79.0f7567cb18c210d45806.bundle.js} +2 -2
- package/dist/79.0f7567cb18c210d45806.bundle.js.map +1 -0
- package/dist/{9.c9fc88a79b7990e29e04.bundle.js → 9.c4b55fc1e3fc858be626.bundle.js} +2 -2
- package/dist/9.c4b55fc1e3fc858be626.bundle.js.map +1 -0
- package/dist/{94.3efcd047d4d4e506cbd7.bundle.js → 94.afe4c166f07dbf1bc30f.bundle.js} +2 -2
- package/dist/94.afe4c166f07dbf1bc30f.bundle.js.map +1 -0
- package/dist/{96.754454264340bc9d9a70.bundle.js → 96.f7d3f181e8860ce2bd8b.bundle.js} +2 -2
- package/dist/96.f7d3f181e8860ce2bd8b.bundle.js.map +1 -0
- package/dist/bundle.48ae48a008439cff2323.bundle.js +79 -0
- package/dist/bundle.48ae48a008439cff2323.bundle.js.map +1 -0
- package/dist/index.html +7 -7
- package/dist/js/angular/core/directives/queryeditor/templates/query-editor.html +18 -18
- package/dist/js/angular/core/directives/queryeditor/templates/query-sample.html +1 -1
- package/dist/js/angular/core/directives/rdfresourcesearch/templates/rdfResourceSearchTemplate.html +3 -3
- package/dist/js/angular/core/templates/core-errors.html +1 -1
- package/dist/js/angular/core/templates/search-resource-input.html +3 -3
- package/dist/js/angular/externalsync/templates/deleteConnector.html +1 -1
- package/dist/js/angular/graphexplore/templates/modal/save-graph.html +1 -1
- package/dist/js/angular/graphexplore/templates/rdfsCommentLabelTemplate.html +3 -3
- package/dist/js/angular/graphexplore/templates/searchIconInputTemplate.html +3 -3
- package/dist/js/angular/import/templates/filesTable.html +12 -12
- package/dist/js/angular/import/templates/settingsModal.html +19 -19
- package/dist/js/angular/import/templates/textSnippet.html +4 -4
- package/dist/js/angular/import/templates/urlImport.html +4 -4
- package/dist/js/angular/repositories/templates/fedx-repo.html +28 -19
- package/dist/js/angular/repositories/templates/ontop-repo.html +8 -8
- package/dist/js/angular/security/templates/modal/default-authorities.html +3 -3
- package/dist/js/angular/security/templates/user.html +12 -12
- package/dist/js/angular/security/templates/users.html +11 -11
- package/dist/js/angular/settings/modal/location-settings.html +5 -5
- package/dist/js/angular/templates/modal/add-location.html +3 -3
- package/dist/js/angular/templates/modal/edit-location.html +3 -3
- package/dist/js/angular/templates/modal/editRepoFile.html +1 -1
- package/dist/js/angular/templates/modal/upload-repository-config.html +2 -2
- package/dist/pages/autocomplete.html +8 -8
- package/dist/pages/choose-repository-type.html +1 -1
- package/dist/pages/clusterInfo.html +2 -2
- package/dist/pages/connectorsInfo.html +5 -5
- package/dist/pages/create-index.html +16 -16
- package/dist/pages/createConnector.html +22 -22
- package/dist/pages/dependencies.html +12 -12
- package/dist/pages/domainRangeInfo.html +4 -4
- package/dist/pages/edit.html +7 -7
- package/dist/pages/explore.html +10 -10
- package/dist/pages/export.html +14 -14
- package/dist/pages/find.html +2 -2
- package/dist/pages/graph-config/saveGraphConfig.html +28 -40
- package/dist/pages/graphs-visualizations.html +46 -46
- package/dist/pages/home.html +10 -10
- package/dist/pages/import.html +7 -7
- package/dist/pages/info.html +16 -16
- package/dist/pages/jdbc-create.html +20 -20
- package/dist/pages/jdbc.html +3 -3
- package/dist/pages/licenseInfo.html +1 -1
- package/dist/pages/login.html +2 -2
- package/dist/pages/monitor/queries.html +6 -6
- package/dist/pages/monitor/resources.html +3 -3
- package/dist/pages/namespaces.html +14 -14
- package/dist/pages/ontorefine.html +1 -1
- package/dist/pages/rdfClassHierarchyInfo.html +16 -16
- package/dist/pages/rdfrank.html +17 -17
- package/dist/pages/registerLicenseInfo.html +3 -3
- package/dist/pages/repositories.html +22 -22
- package/dist/pages/repository.html +28 -28
- package/dist/pages/similarity-indexes.html +15 -15
- package/dist/pages/sparql-template-create.html +9 -9
- package/dist/pages/sparql-templates.html +3 -3
- package/dist/pages/sparql.html +8 -8
- package/dist/pages/webapi.html +3 -3
- package/dist/res/swagger/index.html +25 -25
- package/package.json +5 -4
- package/dist/10.f0277e5092cea150b5a8.bundle.js +0 -2
- package/dist/10.f0277e5092cea150b5a8.bundle.js.map +0 -1
- package/dist/11.bdd794940dcfd5daa9a1.bundle.js +0 -2
- package/dist/11.bdd794940dcfd5daa9a1.bundle.js.map +0 -1
- package/dist/111.056eb71072bfd8f6551b.bundle.js +0 -2
- package/dist/111.056eb71072bfd8f6551b.bundle.js.map +0 -1
- package/dist/112.50fd62c66c6594e055a3.bundle.js +0 -2
- package/dist/112.50fd62c66c6594e055a3.bundle.js.map +0 -1
- package/dist/113.2c059fa7d06fd04149eb.bundle.js +0 -2
- package/dist/113.2c059fa7d06fd04149eb.bundle.js.map +0 -1
- package/dist/119.dfdf8b9afa2c31b90232.bundle.js +0 -2
- package/dist/119.dfdf8b9afa2c31b90232.bundle.js.map +0 -1
- package/dist/12.a3762f9fba854a28c1cb.bundle.js +0 -2
- package/dist/12.a3762f9fba854a28c1cb.bundle.js.map +0 -1
- package/dist/121.aa10886f87136602a6cf.bundle.js +0 -2
- package/dist/121.aa10886f87136602a6cf.bundle.js.map +0 -1
- package/dist/123.318a247a0939300080aa.bundle.js +0 -2
- package/dist/123.318a247a0939300080aa.bundle.js.map +0 -1
- package/dist/125.4978d60a14b65499a047.bundle.js +0 -2
- package/dist/125.4978d60a14b65499a047.bundle.js.map +0 -1
- package/dist/126.4a830f0d18f079b1dca7.bundle.js +0 -2
- package/dist/126.4a830f0d18f079b1dca7.bundle.js.map +0 -1
- package/dist/129.7ca4a0a32cacb6feb225.bundle.js +0 -2
- package/dist/129.7ca4a0a32cacb6feb225.bundle.js.map +0 -1
- package/dist/131.087611adf6562e7e1b00.bundle.js +0 -2
- package/dist/131.087611adf6562e7e1b00.bundle.js.map +0 -1
- package/dist/132.b1ed3e4c9238c5b6303b.bundle.js +0 -2
- package/dist/132.b1ed3e4c9238c5b6303b.bundle.js.map +0 -1
- package/dist/134.653804476f9803033cbe.bundle.js +0 -2
- package/dist/134.653804476f9803033cbe.bundle.js.map +0 -1
- package/dist/136.5d60eb9d8d66581003ce.bundle.js +0 -2
- package/dist/136.5d60eb9d8d66581003ce.bundle.js.map +0 -1
- package/dist/137.0cfdd5934c6a400ab990.bundle.js +0 -2
- package/dist/137.0cfdd5934c6a400ab990.bundle.js.map +0 -1
- package/dist/138.611df35cbfdfec860909.bundle.js +0 -2
- package/dist/138.611df35cbfdfec860909.bundle.js.map +0 -1
- package/dist/14.0c709b039159410b0b91.bundle.js.map +0 -1
- package/dist/140.b0310ba39e9c3237f48a.bundle.js +0 -2
- package/dist/140.b0310ba39e9c3237f48a.bundle.js.map +0 -1
- package/dist/141.5d76be84a3151e69fc9d.bundle.js +0 -2
- package/dist/141.5d76be84a3151e69fc9d.bundle.js.map +0 -1
- package/dist/142.a4094b510036aaf72b0b.bundle.js +0 -2
- package/dist/142.a4094b510036aaf72b0b.bundle.js.map +0 -1
- package/dist/145.6536295098a4f2e030e3.bundle.js +0 -2
- package/dist/145.6536295098a4f2e030e3.bundle.js.map +0 -1
- package/dist/146.ee9db0da29c25ec7fbf9.bundle.js +0 -2
- package/dist/146.ee9db0da29c25ec7fbf9.bundle.js.map +0 -1
- package/dist/148.0ce4968734a80e71b2b9.bundle.js +0 -2
- package/dist/148.0ce4968734a80e71b2b9.bundle.js.map +0 -1
- package/dist/15.fc7c799455b5aec64393.bundle.js +0 -2
- package/dist/15.fc7c799455b5aec64393.bundle.js.map +0 -1
- package/dist/16.005766c64d76f95231b1.bundle.js +0 -2
- package/dist/16.005766c64d76f95231b1.bundle.js.map +0 -1
- package/dist/18.2ddbba81e5b663db1894.bundle.js +0 -3
- package/dist/18.2ddbba81e5b663db1894.bundle.js.map +0 -1
- package/dist/20.a35d80fb5e80ae3874ce.bundle.js +0 -2
- package/dist/20.a35d80fb5e80ae3874ce.bundle.js.map +0 -1
- package/dist/23.102a20601f717ba91551.bundle.js +0 -2
- package/dist/23.102a20601f717ba91551.bundle.js.map +0 -1
- package/dist/25.bd69d5c4040e1547800b.bundle.js +0 -2
- package/dist/25.bd69d5c4040e1547800b.bundle.js.map +0 -1
- package/dist/26.57526f30f6b3c581334d.bundle.js.map +0 -1
- package/dist/27.ab75434b1389b977291c.bundle.js +0 -2
- package/dist/27.ab75434b1389b977291c.bundle.js.map +0 -1
- package/dist/28.b2180a7cba95d9328e1a.bundle.js +0 -2
- package/dist/28.b2180a7cba95d9328e1a.bundle.js.map +0 -1
- package/dist/32.ba5b5ca3e4b7dcf5bd15.bundle.js.map +0 -1
- package/dist/35.b8c8d16a8707c20a1fcb.bundle.js.map +0 -1
- package/dist/36.d96e6ee811e8340ae320.bundle.js.map +0 -1
- package/dist/40.c754ab2b3b35c2acb854.bundle.js +0 -2
- package/dist/40.c754ab2b3b35c2acb854.bundle.js.map +0 -1
- package/dist/42.190f8880ee8f3a97a042.bundle.js.map +0 -1
- package/dist/43.899bf21ce1de203ace21.bundle.js.map +0 -1
- package/dist/44.c649782fa0755b53a62c.bundle.js.map +0 -1
- package/dist/47.421938875d2461427ae3.bundle.js +0 -2
- package/dist/47.421938875d2461427ae3.bundle.js.map +0 -1
- package/dist/48.52c5b13ab244c45a8c43.bundle.js.map +0 -1
- package/dist/5.21d2da4b4bc2b26e2534.bundle.js.map +0 -1
- package/dist/56.ce399f5788c0f5fe937b.bundle.js.map +0 -1
- package/dist/68.6b887fe6160e5bd8742b.bundle.js +0 -2
- package/dist/68.6b887fe6160e5bd8742b.bundle.js.map +0 -1
- package/dist/7.a0f5ec224bebd08058f4.bundle.js.map +0 -1
- package/dist/75.dbd9915663de96056138.bundle.js +0 -2
- package/dist/75.dbd9915663de96056138.bundle.js.map +0 -1
- package/dist/78.608f8074bef29a89d68b.bundle.js +0 -2
- package/dist/78.608f8074bef29a89d68b.bundle.js.map +0 -1
- package/dist/79.f4a2c3ec71bed08d61b9.bundle.js.map +0 -1
- package/dist/9.c9fc88a79b7990e29e04.bundle.js.map +0 -1
- package/dist/94.3efcd047d4d4e506cbd7.bundle.js.map +0 -1
- package/dist/96.754454264340bc9d9a70.bundle.js.map +0 -1
- package/dist/bundle.ac70985c70f7da448f2d.bundle.js +0 -79
- package/dist/bundle.ac70985c70f7da448f2d.bundle.js.map +0 -1
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
(window.webpackJsonp=window.webpackJsonp||[]).push([[28,35,84],{29:function(e,t){angular.module("graphdb.framework.rest.connectors.service",[]).factory("ConnectorsRestService",r),r.$inject=["$http"];const n="rest/connectors";function r(e){return{getConnectors:function(){return e.get(n)},initConnector:function(t){return e.get(`${n}/options?prefix=${t}`)},hasConnector:function(t){return e.get(`${n}/existing?prefix=${t}`)},checkConnector:function(t){return e.post(`${n}/check`,t,{headers:{"Content-Type":"text/plain"}})}}}},32:function(e,t,n){"use strict";n.r(t);n(10),n(29);function r(e){const t=[];return Object.keys(e).forEach((function(n){t.push(encodeURIComponent(n)+"="+encodeURIComponent(e[n]))})),t.join("&")}function o(e,t){for(let r=0;r<t.length;r++){const o=t[r];if("StringArray"===o.__type)e[o.__name]||(e[o.__name]=[""]);else if("OptionArray"===o.__type)if(e[o.__name])for(let t=0;t<o.__childOptions.length;t++){const n=o.__childOptions[t];if("Boolean"===n.__type)for(let t=0;t<e[o.__name].length;t++){const r=e[o.__name][t];!r.hasOwnProperty([n.__name])&&angular.isDefined(n.__defaultValue)&&(r[n.__name]=n.__defaultValue)}}else{e[o.__name]=[];const t={};for(let e=0;e<o.__childOptions.length;e++){const n=o.__childOptions[e];"StringArray"===n.__type?t[n.__name]=[""]:t[n.__name]=angular.isUndefined(n.__defaultValue)?"":n.__defaultValue}e[o.__name].push(t)}else"Map"===o.__type?e[o.__name]?e[o.__name]=(n=e[o.__name],_.map(n,(function(e,t){return{key:t,value:e}}))):e[o.__name]=[]:"JsonString"===o.__type?!e[o.__name]||e[o.__name]instanceof String||"string"==typeof e[o.__name]||(e[o.__name]=angular.toJson(e[o.__name],2)):angular.isUndefined(e[o.__name])&&(e[o.__name]=angular.isUndefined(o.__defaultValue)?"":o.__defaultValue)}var n;return e}function a(e,t,n){return e.post("repositories/"+t,r({query:n}),{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 s(e,t,n,r,o){const a=function e(t,n){const r={};return _.each(n,(function(n){angular.isDefined(t[n.__name])&&("OptionArray"===n.__type?(r[n.__name]=[],_.each(t[n.__name],(function(t){r[n.__name].push(e(t,n.__childOptions))}))):r[n.__name]=angular.copy(t[n.__name]))})),r}(n,r);for(let e=0;e<r.length;e++)try{"Map"===r[e].__type?a[r[e].__name]=(s=a[r[e].__name],_.reduce(s,(function(e,t){if(""===t.key&&""===t.value);else{if(""===t.key)throw new Error('Key may not be empty with value "'+t.value+'"');if(e.hasOwnProperty(t.key))throw new Error("Duplicate key "+t.key);e[t.key]=t.value}return e}),{})):"JsonString"===r[e].__type&&(a[r[e].__name]=angular.fromJson(a[r[e].__name]))}catch(t){return o(r[e].__label,t.message),null}var s;!function e(t){Array.isArray(t)&&(t=_.filter(t,(function(e){return null!==e&&(!e.trim||""!==e.trim())})));return Object.keys(t).forEach((function(n){""!==t[n]&&null!=t[n]||!1===t[n]?"object"==typeof t[n]&&(t[n]=e(t[n])):delete t[n]})),t}(a);let u="";return u+="PREFIX :<"+t+">\n",u+="PREFIX inst:<"+i(t)+">\n",u+="INSERT DATA {\n",u+="\tinst:"+e+" :createConnector '''\n",u+=angular.toJson(a,2),u+="\n''' .\n}\n",u=u.replace(/\\/g,"\\\\\\"),u}function u(e,t,n,u,c,l,d,p,g){function f(t){e.beingBuiltConnector={percentDone:0,status:{processedEntities:0,estimatedEntities:0,indexedEntities:0,entitiesPerSecond:0},actionName:t?"Repairing":"Creating",waitOnRepairStartOnce:!!t,eta:"-",inline:!1,iri:null}}function m(t,n,r){return f(r),$.extend(e.beingBuiltConnector,{iri:i(t)+n,name:n,inline:!1,doneCallback:function(){e.beingBuiltConnector.modalInstance.dismiss("cancel")}}),e.beingBuiltConnector.modalInstance=u.open({templateUrl:"pages/connectorProgress.html",controller:"CreateProgressCtrl",size:"lg",backdrop:"static",scope:e}),e.beingBuiltConnector.modalInstance}function y(t,o,a){const i=m(t.value,o.name,!1);p.addStatements(n.getActiveRepository(),r({update:o.query})).then((function(){g.getConnectors().then((function(){g.hasConnector(encodeURIComponent(t.value)).then((function(n){e.existing[t.key]=n.data}))})),c.success("Created connector "+o.name)}),(function(e){c.error(getError(e)),a()})).finally((function(){i.dismiss("cancel")}))}e.loader=!1,e.controllers=[],e.existing={},e.definitions={},e.getLoaderMessage=function(){const t=(Date.now()-e.loaderStartTime)/1e3,n=e.getHumanReadableSeconds(t);let r="";return r=e.progressMessage?e.progressMessage+"... "+n:"Running operation..."+n,e.extraMessage&&t>10&&(r+="\n"+e.extraMessage),r},e.setLoader=function(t,n,r){t?(e.loader=!0,e.loaderStartTime=Date.now(),e.progressMessage=n,e.extraMessage=r):(e.loader=!1,e.progressMessage="",e.extraMessage="")},e.initConnector=function(t){return g.initConnector(encodeURIComponent(t.value)).then((function(n){return e.definitions[t.key]=n.data,g.hasConnector(encodeURIComponent(t.value)).then((function(n){e.existing[t.key]=n.data}))}))},e.getConnectors=function(){e.canWriteActiveRepo()&&(e.setLoader(!0,"Fetching connectors","Normally this is a fast operation but it may take longer if a bigger repository needs to be initialised first."),g.getConnectors().then((function(r){e.connectors=Object.keys(r.data).map((function(e){return{key:e,value:r.data[e]}})),d.all(_.map(e.connectors,(function(t){return e.initConnector(t)}))).finally((function(){f();const r=function(e){const t=_.map(e,(function(e){return"<"+e.value+"connectorStatus>"})).join("|");return t?"SELECT ?connector ?status { ?connector "+t+" ?status }":null}(e.connectors);r?function(e){return a(t,n.getActiveRepository(),e)}(r).then((function(t){const n=function(e){if(e.bindings)for(let t=0;t<e.bindings.length;t++)try{const n=JSON.parse(e.bindings[t].status.value);if("BUILDING"===n.status)return{connector:e.bindings[t].connector.value,status:n}}catch(e){console.error(e)}return{}}(t.data.results);if(n.connector){const t=n.connector.split(/#/);t[0]=t[0].replace(/\/instance$/,"#"),r=t[0],o=t[1],f(),$.extend(e.beingBuiltConnector,{iri:i(r)+o,name:o,inline:!0,doneCallback:function(){e.beingBuiltConnector.inline=!1}})}var r,o})).finally((function(){e.setLoader(!1)})):e.setLoader(!1)}))})).catch((function(t){e.setLoader(!1),c.error(getError(t),"Could not get connectors")})),e.existing={})},e.getOptions=function(t){return e.definitions[t.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 n.getActiveRepository()}),e.getConnectors),e.$watch((function(){return n.getActiveLocation()}),e.getConnectors),e.copyConnector=function(t,n){let r;angular.isUndefined(n)||(r=angular.copy(n),r.name=r.name+"-copy"),u.open({templateUrl:"pages/createConnector.html",controller:"CreateConnectorCtrl",size:"lg",backdrop:"static",resolve:{connector:function(){return t},values:function(){return angular.isUndefined(r)?{name:"",values:{}}:r},options:function(){return e.getOptions(t)}}}).result.then((function(n){y(t,n,(function(){n.skipConversion=!0,e.newConnector(t,n)}))}))},e.newConnector=function(t,n){u.open({templateUrl:"pages/createConnector.html",controller:"CreateConnectorCtrl",size:"lg",backdrop:"static",resolve:{connector:function(){return t},values:function(){return angular.isUndefined(n)?{name:"",values:{}}:n},options:function(){return e.getOptions(t)}}}).result.then((function(n){y(t,n,(function(){n.skipConversion=!0,e.newConnector(t,n)}))}))},e.repair=function(t,o){l.openSimpleModal({title:"Confirm repair",message:"Are you sure you want to repair this connector?<br>Note that repair means delete + recreate with the same settings.",warning:!0}).result.then((function(){const a=m(o.value,t.name,!0),s=(u=t.name,"PREFIX prefix:<"+(l=o.value)+">\nINSERT DATA {\n\t<"+i(l)+u+'> prefix:repairConnector ""\n}');var u,l;p.addStatements(n.getActiveRepository(),r({update:s})).then((function(){g.getConnectors().then((function(){g.hasConnector(encodeURIComponent(o.value)).then((function(t){e.existing[o.key]=t.data}))})),c.success("Repaired connector "+t.name)}),(function(e){c.error(getError(e))})).finally((function(){a.dismiss("cancel")}))}))},e.delete=function(t,o){const a=o.key.indexOf("Elastic")>=0||o.key.indexOf("Solr")>=0;u.open({templateUrl:"js/angular/externalsync/templates/deleteConnector.html",controller:"DeleteConnectorCtrl",resolve:{type:function(){return o.key},isExternal:function(){return a}}}).result.then((function(i){e.setLoader(!0,"Deleting connector "+t.name,"This is usually a fast operation but it might take a while.");const s=function(e,t,n){const r=t.substring(0,t.length-1)+"/instance#";return"PREFIX prefix:<"+t+">\nINSERT DATA {\n\t<"+r+e+'> prefix:dropConnector "'+(n?"force":"")+'"\n}'}(t.name,o.value,i);p.addStatements(n.getActiveRepository(),r({update:s})).then((function(){g.getConnectors().then((function(){g.hasConnector(encodeURIComponent(o.value)).then((function(t){e.existing[o.key]=t.data}))})),i?(c.success("Deleted (with force) connector "+t.name),a&&c.warning("You may have to remove the index manually from "+o.key)):c.success("Deleted connector "+t.name)}),(function(e){c.error(getError(e))})).finally((function(){e.setLoader(!1)}))}))},e.viewQuery=function(t,n){u.open({templateUrl:"pages/viewQuery.html",controller:"ViewQueryCtrl",resolve:{query:function(){const r=e.getOptions(t);return s(n.name,t.value,o(n.values,r),r)}}})}}function c(e,t,n,r){e.force=!1,e.type=n,e.isExternal=r,e.ok=function(){t.close(e.force)},e.cancel=function(){t.dismiss()}}function l(e,t,n,r,o){function a(){return s(e.name,n.value,e.values,e.options,(function(e,t){o.error(t,e)}))}e.connector=n,e.addField=function(t,n){const r=angular.copy(e.defaultValues[n][0]);e.values[n].splice(t+1,0,r)},e.addOption=function(e,t){t.splice(e+1,0,"")},e.deleteOption=function(e,t){t.splice(e,1)},e.addMapOption=function(e,t){t.splice(e+1,0,{key:"",value:""})},e.deleteMapOption=function(e,t){t.splice(e,1)},e.ok=function(){if(e.form.$valid){const n=a();n&&t.close({name:e.name,values:e.values,options:e.options,query:n})}},e.viewQuery=function(){const e=a();e&&r.open({templateUrl:"pages/viewQuery.html",controller:"ViewQueryCtrl",resolve:{query:function(){return e}}})},e.cancel=function(){t.dismiss("cancel")}}function d(e,t,n,r,a,i,s,u){angular.extend(this,t("ExtendNewConnectorCtrl",{$scope:e,$modalInstance:r,connector:a,$modal:i})),e.values=s.values,e.options=u,e.name=s.name,s.skipConversion||(e.values=o(e.values,e.options)),e.defaultValues=angular.copy(e.values)}function p(e,t,n,r){function o(){const o=function(e){const t=e.replace(/\/instance#.+$/,"#connectorStatus");let n="";return n+="SELECT ?status {\n",n+="\t<"+e+"> <"+t+"> ?status",n+="\n}",n}(e.beingBuiltConnector.iri);e.beingBuiltConnector.iri=null,e.progressInterval=t((function(){(function(e){return a(n,r.getActiveRepository(),e)})(o).then((function(n){const r=function(e){if(e.bindings&&e.bindings.length>0)try{return JSON.parse(e.bindings[0].status.value)}catch(e){console.error(e)}return{}}(n.data.results);"BUILDING"===r.status?(e.beingBuiltConnector.status=r,e.beingBuiltConnector.percentDone=(100*r.processedEntities/r.estimatedEntities).toFixed(0),e.beingBuiltConnector.eta=e.getHumanReadableSeconds(r.etaSeconds),e.beingBuiltConnector.actionName=r.repair?"Repairing":"Creating",e.beingBuiltConnector.waitOnRepairStartOnce=!1):"BUILT"!==r.status||e.beingBuiltConnector.waitOnRepairStartOnce||(t.cancel(e.progressInterval),e.beingBuiltConnector.doneCallback&&e.beingBuiltConnector.doneCallback())}))}),1e3),e.$on("$destroy",(function(){t.cancel(e.progressInterval)}))}e.beingBuiltConnector=e.beingBuiltConnector||{},!e.beingBuiltConnector.inline&&e.beingBuiltConnector.iri&&o(),e.$watch("beingBuiltConnector.iri",(function(t){e.beingBuiltConnector.inline&&t&&o()}))}angular.module("graphdb.framework.externalsync.controllers",["graphdb.framework.rest.rdf4j.repositories.service","graphdb.framework.rest.connectors.service"]).controller("ConnectorsCtrl",u).controller("ExtendNewConnectorCtrl",l).controller("CreateConnectorCtrl",d).controller("CreateProgressCtrl",p).controller("DeleteConnectorCtrl",c).filter("ceil",(function(){return function(e){return Math.ceil(e)}})),u.$inject=["$scope","$http","$repositories","$modal","toastr","ModalService","$q","RDF4JRepositoriesRestService","ConnectorsRestService"],c.$inject=["$scope","$modalInstance","type","isExternal"],l.$inject=["$scope","$modalInstance","connector","$modal","toastr"],d.$inject=["$scope","$controller","$http","$modalInstance","connector","$modal","values","options"],p.$inject=["$scope","$interval","$http","$repositories"]},34:function(e,t,n){"use strict";n.r(t);n(29),n(4),n(32);var r=n(210),o=n.n(r),a=n(208),i=n.n(a);function s(e,t,n,r,a,s,u,c,l,d,p,g){let f;return{restrict:"AE",scope:!1,templateUrl:"js/angular/core/directives/queryeditor/templates/query-editor.html",link:function(m,y,C){m.nostorage=C.hasOwnProperty("nostorage"),m.notabs=C.hasOwnProperty("notabs"),m.notoolbar=C.hasOwnProperty("notoolbar"),m.notoolbarSaved=C.hasOwnProperty("notoolbarSaved"),m.notoolbarCopy=C.hasOwnProperty("notoolbarCopy"),m.notoolbarInference=C.hasOwnProperty("notoolbarInference"),m.notoolbarSameAs=C.hasOwnProperty("notoolbarSameAs"),m.nostatus=C.hasOwnProperty("nostatus"),m.norun=C.hasOwnProperty("norun"),m.runButtonName="Run",C.runButtonName&&(m.runButtonName=C.runButtonName);if(m.nocount="true"===C.nocount,C.callbackOnChange){const e=m[C.callbackOnChange];"function"==typeof e&&(f=e)}e((function(){!function(m){function y(){angular.element("#wb-sparql-saveQuery")[0].click()}function C(){m.runQuery(!1,!1)}function h(){m.runQuery(!1,!0)}function b(){if(m.tabs.length<2||!m.currentQuery.id||!m.isTabChangeOk(!1))return;let e=O(m.currentQuery.id);e=(e+1)%m.tabs.length,w(m.tabs[e].id)}function T(){if(m.tabs.length<2||!m.currentQuery.id||!m.isTabChangeOk(!1))return;let e=O(m.currentQuery.id);e--,-1===e&&(e=m.tabs.length-1),w(m.tabs[e].id)}function w(t){e((function(){let e=$('a[data-id = "'+t+'"]');0===e.length&&(e=$("a[data-id]").first()),e.tab("show")}),0)}m.changePagination=function(){m.runQuery(!0,m.explainRequested)},window.editor=o.a.fromTextArea(document.getElementById("query"),{persistent:null,value:"",indentUnit:4,createShareLink:null,cursorHeight:1,sparql:{showQueryButton:!1,acceptHeaderGraph:"application/x-graphdb-table-results+json, application/rdf+json;q=0.9, */*;q=0.8",acceptHeaderSelect:"application/x-sparqlstar-results+json, application/sparql-results+json;q=0.9, */*;q=0.8"},extraKeys:{"Ctrl-Enter":C,"Cmd-Enter":C,"Shift-Ctrl-Enter":h,"Shift-Cmd-Enter":h,"Ctrl-Alt-T":m.addNewTab,"Cmd-Alt-T":m.addNewTab,"Ctrl-S":y,"Cmd-S":y,"Ctrl-Alt-Left":T,"Cmd-Alt-Left":T,"Ctrl-Alt-Right":b,"Cmd-Alt-Right":b}}),window.editor.toastBuildIndex=function(){n.warning("",'<div class="autocomplete-toast"><a href="autocomplete">Autocomplete is OFF<br>Go to Setup -> Autocomplete</a></div>',{allowHtml:!0})},window.editor.toastError=function(e){n.error("Cannot execute autocomplete query. "+getError(e))},window.editor.on("changes",(function(){angular.element(".CodeMirror-linenumbers").css("width","1px"),angular.element(".CodeMirror-sizer").css("margin-left","0px"),clearTimeout(m.changesTimeout);const e=!window.editor.queryValid;m.changesTimeout=setTimeout(f?f():function(){const t=O(m.currentQuery.id)+1;$('a[data-id = "'+t+'"]').toggleClass("query-has-error",e).attr("title",e?"Query contains a syntax error. See the relevant line for more information.":"")},200),m.currentQuery.query=window.editor.getValue(),m.currentQuery.queryType=window.editor.getQueryType()})),$(".fullscreenToggleBtns").hide();const v=function(e){$(e.target).removeClass("fa-link").addClass("fa-check").blur(),setTimeout((function(){$(e.target).removeClass("fa-check").addClass("fa-link")}),1e3)};window.onbeforeunload=function(){m.nostorage||p.set(g.TABS_STATE,m.tabs),m.saveTab(m.currentQuery.id)};const R=o.a.executeQuery,S=o.a.getUrlArguments;function x(e,t,n){return{status:e,statusText:t,responseText:n}}let A,E;m.$on("$destroy",(function(){m.nostorage||p.set(g.TABS_STATE,m.tabs),o.a.executeQuery=R,o.a.getUrlArguments=S,m.saveTab(m.currentQuery.id)})),o.a.drawButtons=function(e){e.buttons=$("#yasqe_buttons_mocked")},o.a.getActiveRepository=function(){return r.getActiveRepository()},o.a.getUrlArguments=function(e,t){const n=S(e,t),r=window.editor.getQueryType();return"SELECT"!==r&&"CONSTRUCT"!==r&&"DESCRIBE"!==r||(n.push({name:"limit",value:m.currentTabConfig.pageSize+1}),m.currentTabConfig.offset=(m.currentTabConfig.page-1)*m.currentTabConfig.pageSize+1,n.push({name:"offset",value:m.currentTabConfig.offset-1})),!m.explainRequested||"SELECT"!==r&&"CONSTRUCT"!==r||n.push({name:"explain",value:"true"}),n},o.a.executeQuery=function(e){if(E&&$(E.resultsContainer).length&&$(E.resultsContainer).empty(),e.options.sparql.headers["X-GraphDB-Catch"]=m.currentTabConfig.pageSize+"; throw",m.currentTrackAlias="query-editor-"+performance.now()+"-"+Date.now(),e.options.sparql.headers["X-GraphDB-Track-Alias"]=m.currentTrackAlias,m.countTimeouted=!1,"query"===e.getQueryMode()?e.options.sparql.endpoint="repositories/"+r.getActiveRepository():"update"===e.getQueryMode()&&(e.options.sparql.endpoint="repositories/"+r.getActiveRepository()+"/statements"),e.options.sparql.args=[{name:"infer",value:m.currentQuery.inference},{name:"sameAs",value:m.currentQuery.sameAs}],m.currentTabConfig.customUpdateMessage="","update"!==window.editor.getQueryMode()){const t=m.currentTabConfig,n=m.executedQueryTab.id;return window.editor.options.sparql.handlers.countCallback=function(e,r,o){if(200===e.status){const a=m.tabs[O(n)];a&&(E.setResultsCount(e,r,o),t.allResultsCount=E.allCount,a.allResultsCount=E.allCount,t.allResultsCountExact=!0,a.allResultsCountExact=!0,m.saveTab(a.id))}else t.countTimeouted=!0},null!=m.currentQuery.outputType?E.options.output=m.currentQuery.outputType:E.options.output="table",m.currentTabConfig.queryType=window.editor.getQueryType(),m.queryStartTime=(new Date).getTime(),R(e,{setQueryLimit:function(e){return"CONSTRUCT"===m.currentTabConfig.queryType&&r.isActiveRepoOntopType()?window.editor.getValueWithoutComments():e}})}{const t=function(){m.currentTabConfig.queryType="UPDATE",l.getRepositorySize().success((function(t){return m.repoSize=parseInt(t),m.queryStartTime=(new Date).getTime(),R(e,{})})).error((function(t){return n.warning("Could not get repository size for: "+r.getActiveRepository()+"; "+getError(t)),m.queryStartTime=(new Date).getTime(),R(e,{})}))};d.checkConnector(window.editor.getValue()).then((function(e){if(e.data.command&&!e.data.hasSupport){m.currentTabConfig.queryType="ERROR",m.currentTabConfig.timeFinished=Date.now(),m.currentTabConfig.timeTook=(m.currentTabConfig.timeFinished-m.queryStartTime)/1e3;const t=x(-1,"No support for "+e.data.connectorName,e.data.connectorName+" connectors are not supported because the plugin "+e.data.pluginName+" is not active.");return E.results={getException:function(){return t}},m.setLoader(!1),void q({customError:t},"",null)}if("create"===e.data.command||"repair"===e.data.command){const t="repair"===e.data.command;t?(m.setLoader(!0,"Repairing connector "+e.data.name),m.currentTabConfig.customUpdateMessage="Repaired connector "+e.data.name+"."):(m.setLoader(!0,"Creating connector "+e.data.name),m.currentTabConfig.customUpdateMessage="Created connector "+e.data.name+".");const n=m.$new(!0);n.beingBuiltConnector={percentDone:0,status:{processedEntities:0,estimatedEntities:0,indexedEntities:0,entitiesPerSecond:0},actionName:t?"Repairing":"Creating",eta:"-",inline:!1,iri:e.data.iri,name:e.data.name,doneCallback:function(){A.dismiss("cancel")}},n.getHumanReadableSeconds=m.getHumanReadableSeconds,A=u.open({templateUrl:"pages/connectorProgress.html",controller:"CreateProgressCtrl",size:"lg",backdrop:"static",scope:n})}else"drop"===e.data.command&&(m.setLoader(!0,"Deleting connector "+e.data.name),m.currentTabConfig.customUpdateMessage="Deleted connector "+e.data.name+".");t()}),(function(){t()}))}};const k=o.a.getAjaxConfig;function q(e,t,n){e.getResponseHeader&&e.getResponseHeader("content-type")&&(e.contentType=e.getResponseHeader("content-type")),delete e.response;const r=O(m.executedQueryTab.id),o=m.tabs[r],a={queryType:m.currentTabConfig.queryType,yasrData:e,textStatus:t,jqXhrOrErrorString:n,page:m.currentTabConfig.page,pageSize:m.currentTabConfig.pageSize,allResultsCount:m.currentTabConfig.allResultsCount,allResultsCountExact:m.currentTabConfig.allResultsCountExact,resultsCount:m.currentTabConfig.resultsCount,offset:m.currentTabConfig.offset,timeTook:m.currentTabConfig.timeTook,timeFinished:m.currentTabConfig.timeFinished,sizeDelta:m.currentTabConfig.sizeDelta,customUpdateMessage:m.currentTabConfig.customUpdateMessage,errorMessage:m.currentTabConfig.errorMessage,warningMessage:m.currentTabConfig.warningMessage};"ERROR"!==m.currentTabConfig.queryType&&"UPDATE"!==m.currentTabConfig.queryType&&"ASK"!==m.currentTabConfig.queryType&&(a.outputType=m.yasr.options.output),angular.extend(m.currentQuery,a),angular.extend(o,a),m.nostorage||p.set(g.TABS_STATE,m.tabs),$('a[data-id = "'+m.executedQueryTab.id+'"]').tab("show")}function Q(){var e=E.results.getBindings(),t=E.results.getVariables(),n=e[0],r=t[0];if(1===t.length&&1===e.length&&"plan"===r&&n[r].value.includes("# NOTE: Optimization groups")){var a=document.getElementsByClassName("nonUri")[0];a.classList.add("cm-s-default"),a.setAttribute("id","highlighted_output");var i=a.innerText.substring(1,a.innerText.length-1);a.innerHTML="",o.a.runMode(i,"sparql11",document.getElementById("highlighted_output"))}}function O(e){for(let t=0;t<m.tabs.length;t++){if(m.tabs[t].id===e)return t}}function B(e){return angular.isDefined(e)&&"false"!==e}function D(e,n,r){const o=m.getExistingTabId(e),a=m.$on("tabLoaded",(function(){angular.isDefined(n)&&(m.currentQuery.inference=B(n)),angular.isDefined(r)&&(m.currentQuery.sameAs=B(r)),B(t.search().execute)&&("update"===window.editor.getQueryMode()?s.openSimpleModal({title:"Confirm execute",message:"This is an update and it may change the data in the repository.<br>Are you sure you want to execute it automatically?",warning:!0}).result.then((function(){m.runQuery(!1)})):m.runQuery(!1)),a()}));m.highlightNextTabChange=!0,angular.isDefined(o)?w(o):m.addNewTab(null,e.name,e.body)}function U(){if(t.search().savedQueryName)e=t.search().savedQueryName,r=t.search().owner,o=t.search().infer,i=t.search().sameAs,a.getSavedQuery(e,r).success((function(e){D(e,o,i)})).error((function(t){n.error("Could not get data for saved query: "+e+"; "+getError(t))}));else if(t.search().query){D({name:t.search().name,body:t.search().query},t.search().infer,t.search().sameAs)}else{w(p.get(g.TABS_STATE_CURRENT_ID))}var e,r,o,i}function N(){m.getNamespaces(),o.a.signal(window.editor,"repositoryOrAuthorizationChanged",r.getActiveRepository(),c.getAuthToken()),U()}o.a.getAjaxConfig=function(e,t){const n=k(e,t);return _.extend(n.headers,{Authorization:c.getAuthToken()}),n},m.copyToClipboardQuery=function(e,t){s.openCopyToClipboardModal(function(e,t){let n=[location.protocol,"//",location.host,location.pathname].join("");e?(n=n+"?savedQueryName="+encodeURIComponent(e),null!=t&&(n+="&owner="+encodeURIComponent(t))):n=n+"?"+$.param({name:m.currentQuery.name,infer:m.currentQuery.inference,sameAs:m.currentQuery.sameAs,query:window.editor.getValue()});return n}(e,t))},m.copyToClipboardResult=function(e){s.openCopyToClipboardModal(e)},m.goToVisual=function(){const e={query:window.editor.getValue(),sameAs:m.currentQuery.sameAs,inference:m.currentQuery.inference};t.path("graphs-visualizations").search(e)},$("textarea").on("paste",(function(){e((function(){m.addKnownPrefixes()}),0)})),E=i()(document.getElementById("yasr"),{getUsedPrefixes:{},persistency:!1}),window.yasr=E,E.afterCopy=v,E.getQueryResultsAsFormat=function(e){const t=$("#wb-download");t.attr("action","repositories/"+r.getActiveRepository()),$("#wb-download-query").val(m.currentQuery.query),window.editor.getValue()!==m.currentQuery.query&&n.warning("The query in your editor does not match the query results. Download will save the results from the last executed query."),$("#wb-download-infer").val(m.currentQuery.inference),$("#wb-download-sameAs").val(m.currentQuery.sameAs);const o=localStorage.getItem("com.ontotext.graphdb.auth");o&&$("#wb-auth-token").val(o),$("#wb-download-accept").val(e),t.submit()},window.editor.options.sparql.handlers.complete=function(t,r,o){function a(){q(t,r,o)}if(A&&A.dismiss("cancel"),null===window.editor)return void m.setLoader(!1);if(m.currentTabConfig.errorMessage=t.getResponseHeader("X-GraphDB-Error"),m.currentTabConfig.warningMessage=t.getResponseHeader("X-GraphDB-Warning"),E.currentQuery=m.currentQuery,m.currentTabConfig.timeFinished=Date.now(),m.currentTabConfig.timeTook=(m.currentTabConfig.timeFinished-m.queryStartTime)/1e3,t.status>=400)return t.responseText=t.responseText.replace(/^([^: ]+: )+/,""),m.currentTabConfig.queryType="ERROR",a(),m.setYasrResponse(t,r,o),void m.setLoader(!1);if(0===t.status){m.currentTabConfig.queryType="ERROR";const e=x(-1,"Request was aborted","The request has been aborted. There are no results to show.");return E.results={getException:function(){return e}},m.setLoader(!1),void q({customError:e},"",null)}let i;if(m.setLoader(!1),"update"===window.editor.getQueryMode())i=function(){l.getRepositorySize().success((function(e){let t;void 0!==m.repoSize&&(t=Number(e)-m.repoSize),m.currentTabConfig.sizeDelta=t,a()})).error((function(e){n.warning("Could not get repository size for: "+m.getActiveRepository()+"; "+getError(e)),m.currentTabConfig.sizeDelta=void 0,a()}))};else{if(200===t.status){const e=t.getResponseHeader("Content-Type");0!==e.indexOf("application/sparql-results+json")&&0!==e.indexOf("application/x-sparqlstar-results+json")&&0!==e.indexOf("application/x-graphdb-table-results+json")||t.responseJSON.results&&(m.currentTabConfig.resultsCount=t.responseJSON.results.bindings.length,t.responseJSON.results.bindings.length>m.currentTabConfig.pageSize&&(t.responseJSON.results.bindings.length=m.currentTabConfig.pageSize),m.currentTabConfig.allResultsCountExact||((m.nocount||m.countTimeouted||m.currentTabConfig.resultsCount<=m.currentTabConfig.pageSize)&&(t.status=204),m.currentTabConfig.allResultsCount=Math.max(m.currentTabConfig.allResultsCount,m.currentTabConfig.pageSize*(m.currentTabConfig.page-1)+m.currentTabConfig.resultsCount),m.currentTabConfig.resultsCount<=m.currentTabConfig.pageSize&&(m.currentTabConfig.allResultsCountExact=!0)))}m.setLoader(!0,"Rendering results",null,!0),i=function(){m.setYasrResponse(t,r,o),a(),m.setLoader(!1)}}e((function(){i(),"CONSTRUCT"!==window.editor.getQueryType()?($(".yasr_btnGroup.nav.nav-tabs li a.disabled").removeClass("disabled").css("font-weight","400"),$(".yasr_btnGroup.nav.nav-tabs li.disabled a").addClass("disabled").css("font-weight","200"),"DESCRIBE"===window.editor.getQueryType()&&$(".yasr_btnGroup.nav.nav-tabs li a").removeClass("disabled").css("font-weight","400")):"CONSTRUCT"===window.editor.getQueryType()&&$(".yasr_btnGroup.nav.nav-tabs li a.disabled").removeClass("disabled").css("font-weight","400"),$("#yasr").css("padding","0"),$(".yasr_btnGroup li:nth-child(2)").hasClass("active")&&e((function(){$(".yasr_btnGroup li:nth-child(2) a").get(0).click()}),100),$("#wb-sparql-addNewTab").click((function(){$(".dataTables_filter").hide(),$(".resultsTable").hide()}))}),100)},window.editor.options.sparql.handlers.resetResults=function(){},m.yasr=E,m.setYasrResponse=function(e,t,n){e.responseJSON&&(e.response=e.responseJSON,e.responseText=void 0),window.yasr.plugins.table.options.highlightLiteralCellResult=Q,E.setResponse(e,t,n)},m.$watch("yasr.options.output",(function(e){if(e&&"UPDATE"!==m.currentTabConfig.queryType&&"ASK"!==m.currentTabConfig.queryType){const t=m.tabs[O(m.currentQuery.id)];angular.isDefined(t)&&m.currentTabConfig.queryType&&t.outputType!==e&&(t.outputType=m.currentQuery.outputType=e,m.saveTab(t.id))}})),void m.$watch("namespaces",(function(){m.namespaces&&(E&&E.options&&m.namespaces&&(E.options.getUsedPrefixes=m.namespaces),o.a.signal(window.editor,"namespacesChanged",m.namespaces))})),$(document).mouseup((function(e){const t=$("#sampleQueriesCollapse");!t.is(e.target)&&0===t.has(e.target).length&&m.showSampleQueries&&m.toggleSampleQueries()})),r.getActiveRepository()&&N();m.$on("repositoryIsSet",(function(){r.getActiveRepository()&&N()})),e((function(){angular.element(document).find(".CodeMirror textarea:first-child").focus()}),50)}(m)}),150)}}}angular.module("graphdb.framework.core.directives.queryeditor.queryeditor",["ngCookies","graphdb.framework.externalsync.controllers","graphdb.framework.rest.connectors.service","graphdb.framework.utils.localstorageadapter"]).directive("queryEditor",s),s.$inject=["$timeout","$location","toastr","$repositories","SparqlRestService","ModalService","$modal","$jwtAuth","RDF4JRepositoriesRestService","ConnectorsRestService","LocalStorageAdapter","LSKeys"]}}]);
|
|
2
|
-
//# sourceMappingURL=28.b2180a7cba95d9328e1a.bundle.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["webpack:///./src/js/angular/rest/connectors.rest.service.js","webpack:///./src/js/angular/externalsync/controllers.js","webpack:///./src/js/angular/core/directives/queryeditor/query-editor.directive.js"],"names":["angular","module","factory","ConnectorsRestService","$inject","CONNECTORS_ENDPOINT","$http","getConnectors","get","initConnector","prefix","hasConnector","checkConnector","data","post","headers","jsonToFormData","str","Object","keys","forEach","key","push","encodeURIComponent","join","mapCreateValuesToUiValues","values","options","i","length","option","__type","__name","j","__childOptions","child","k","valueK","hasOwnProperty","isDefined","__defaultValue","optionEl","isUndefined","map","_","value","String","toJson","_evaluateSparqlQuery","http","repository","query","buildNamePrefix","substring","createConnectorQuery","name","fields","reportError","fcopy","sortObject","obj","newObject","each","childOption","copy","arrayMap","reduce","acc","Error","fromJson","e","__label","message","removeEmptyValues","Array","isArray","filter","item","trim","finalString","replace","ConnectorsCtrl","$scope","$repositories","$modal","toastr","ModalService","$q","RDF4JRepositoriesRestService","resetProgress","repair","beingBuiltConnector","percentDone","status","processedEntities","estimatedEntities","indexedEntities","entitiesPerSecond","actionName","waitOnRepairStartOnce","eta","inline","iri","openProgressModal","$","extend","doneCallback","modalInstance","dismiss","open","templateUrl","controller","size","backdrop","scope","executeCreate","connector","errorCallback","modal","addStatements","getActiveRepository","update","then","res","existing","success","err","error","getError","finally","loader","controllers","definitions","getLoaderMessage","timeSeconds","Date","now","loaderStartTime","timeHuman","getHumanReadableSeconds","progressMessage","extraMessage","setLoader","isRunning","canWriteActiveRepo","connectors","all","connectorIris","createStatusQueryForAny","evaluateSparqlQuery","results","bindings","statusObject","JSON","parse","console","parseFirstBuildingResult","d","split","catch","getOptions","isEmpty","isObject","toPrettyJson","$watch","getActiveLocation","copyConnector","newValues","resolve","result","skipConversion","newConnector","inst","type","openSimpleModal","title","warning","delete","isExternal","indexOf","force","namePrefix","deleteConnectorQuery","viewQuery","DeleteConnectorCtrl","$modalInstance","ok","close","cancel","ExtendNewConnectorCtrl","toQuery","label","addField","index","optionName","newField","defaultValues","splice","addOption","array","deleteOption","addMapOption","deleteMapOption","form","$valid","CreateConnectorCtrl","$controller","this","CreateProgressCtrl","$interval","initProgress","statusIri","createStatusQueryForIri","progressInterval","getFirstStatusFromResult","toFixed","etaSeconds","$on","input","Math","ceil","queryEditorDirective","$timeout","$location","SparqlRestService","$jwtAuth","LocalStorageAdapter","LSKeys","callbackOnChange","restrict","link","element","attrs","nostorage","notabs","notoolbar","notoolbarSaved","notoolbarCopy","notoolbarInference","notoolbarSameAs","nostatus","norun","runButtonName","nocount","callback","saveQueryAction","click","runQueryAction","runQuery","explainQueryAction","goToNextTabAction","tabs","currentQuery","id","isTabChangeOk","idx","findTabIndexByID","selectTab","goToPreviousTabAction","requestedTab","first","tab","changePagination","explainRequested","window","editor","fromTextArea","document","getElementById","persistent","indentUnit","createShareLink","cursorHeight","sparql","showQueryButton","acceptHeaderGraph","acceptHeaderSelect","extraKeys","addNewTab","toastBuildIndex","allowHtml","toastError","on","css","clearTimeout","changesTimeout","hasError","queryValid","setTimeout","toggleClass","attr","getValue","queryType","getQueryType","hide","afterCopy","event","target","removeClass","addClass","blur","onbeforeunload","set","TABS_STATE","saveTab","originalExecuteQuery","executeQuery","originalGetUrlArguments","getUrlArguments","createCustomError","statusText","responseText","connectorProgressModal","yasr","drawButtons","yasqe","buttons","config","qType","currentTabConfig","pageSize","offset","page","cm","resultsContainer","empty","currentTrackAlias","performance","countTimeouted","getQueryMode","endpoint","args","inference","sameAs","customUpdateMessage","thisTabConfig","thisTabId","executedQueryTab","handlers","countCallback","dataOrJqXhr","textStatus","jqXhrOrErrorString","setResultsCount","allResultsCount","allCount","allResultsCountExact","outputType","output","queryStartTime","getTime","setQueryLimit","isActiveRepoOntopType","getValueWithoutComments","doExecute","getRepositorySize","repoSize","parseInt","command","hasSupport","timeFinished","timeTook","customError","connectorName","pluginName","getException","setNewTabState","progressScope","$new","originalGetAjaxConfig","getAjaxConfig","getResponseHeader","contentType","response","executedQueryTabIdx","queryResultState","yasrData","resultsCount","sizeDelta","errorMessage","warningMessage","highlightExplainPlan","getBindings","vars","getVariables","singleBinding","planVar","includes","queryResultElement","getElementsByClassName","classList","add","setAttribute","queryResultValue","innerText","innerHTML","runMode","toBoolean","v","loadQueryIntoExistingOrNewTab","infer","tabId","getExistingTabId","onHandler","search","execute","highlightNextTabChange","body","addTabWithQueryIfNeeded","savedQueryName","owner","getSavedQuery","TABS_STATE_CURRENT_ID","updateRepositoryAndSecurity","getNamespaces","signal","getAuthToken","callbackOrConfig","copyToClipboardQuery","openCopyToClipboardModal","url","location","protocol","host","pathname","param","createQueryURL","copyToClipboardResult","resultURI","goToVisual","paramsToParse","path","addKnownPrefixes","getUsedPrefixes","persistency","getQueryResultsAsFormat","downloadFormat","$wbDownload","val","auth","localStorage","getItem","submit","complete","setNewTabStateForThis","setYasrResponse","updateResultsCallback","repoSizeDiff","undefined","Number","responseJSON","max","hasClass","resetResults","plugins","table","highlightLiteralCellResult","setResponse","namespaces","mouseup","container","is","has","showSampleQueries","toggleSampleQueries","find","focus","drawQueryEditor","directive"],"mappings":"iFAAAA,QACKC,OAAO,4CAA6C,IACpDC,QAAQ,wBAAyBC,GAEtCA,EAAsBC,QAAU,CAAC,SAEjC,MAAMC,EAAsB,kBAE5B,SAASF,EAAsBG,GAE3B,MAAO,CACHC,cAMJ,WACI,OAAOD,EAAME,IAAI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ACA,4CACA,gDAEHmd,UAAU,cAAevP,GAE9BA,EAAqBzN,QAAU,CAAC,WAAY,YAAa,SAAU,gBAAiB,oBAAqB,eAAgB,SAAU,WAAY,+BAAgC,wBAAyB,sBAAuB","file":"28.b2180a7cba95d9328e1a.bundle.js","sourcesContent":["angular\n .module('graphdb.framework.rest.connectors.service', [])\n .factory('ConnectorsRestService', ConnectorsRestService);\n\nConnectorsRestService.$inject = ['$http'];\n\nconst CONNECTORS_ENDPOINT = 'rest/connectors';\n\nfunction ConnectorsRestService($http) {\n\n return {\n getConnectors,\n initConnector,\n hasConnector,\n checkConnector\n };\n\n function getConnectors() {\n return $http.get(CONNECTORS_ENDPOINT);\n }\n\n function initConnector(prefix) {\n return $http.get(`${CONNECTORS_ENDPOINT}/options?prefix=${prefix}`);\n }\n\n function hasConnector(prefix) {\n return $http.get(`${CONNECTORS_ENDPOINT}/existing?prefix=${prefix}`);\n }\n\n function checkConnector(data) {\n return $http.post(`${CONNECTORS_ENDPOINT}/check`, data, {\n headers: {\n 'Content-Type': 'text/plain'\n }\n });\n }\n}\n","import 'angular/rest/rdf4j.repositories.rest.service';\nimport 'angular/rest/connectors.rest.service';\n\nconst modules = [\n 'graphdb.framework.rest.rdf4j.repositories.service',\n 'graphdb.framework.rest.connectors.service'\n];\n\nangular\n .module('graphdb.framework.externalsync.controllers', modules)\n .controller('ConnectorsCtrl', ConnectorsCtrl)\n .controller('ExtendNewConnectorCtrl', ExtendNewConnectorCtrl)\n .controller('CreateConnectorCtrl', CreateConnectorCtrl)\n .controller('CreateProgressCtrl', CreateProgressCtrl)\n .controller('DeleteConnectorCtrl', DeleteConnectorCtrl)\n .filter('ceil', ceil);\n\nfunction jsonToFormData(data) {\n const str = [];\n Object.keys(data).forEach(function (key) {\n str.push(encodeURIComponent(key) + '=' + encodeURIComponent(data[key]));\n });\n return str.join('&');\n}\n\nfunction toArrayMap(map) {\n return _.map(map, function (value, key) {\n return {key: key, value: value};\n });\n}\n\nfunction fromArrayMap(arrayMap) {\n return _.reduce(arrayMap, function (acc, value) {\n if (value.key === '' && value.value === '') {\n // empty pair, skip it\n } else if (value.key === '') {\n throw new Error('Key may not be empty with value \"' + value.value + '\"');\n } else if (acc.hasOwnProperty(value.key)) {\n throw new Error('Duplicate key ' + value.key);\n } else {\n acc[value.key] = value.value;\n }\n return acc;\n }, {});\n}\n\nfunction mapCreateValuesToUiValues(values, options) {\n for (let i = 0; i < options.length; i++) {\n const option = options[i];\n if (option.__type === 'StringArray') {\n if (!values[option.__name]) {\n values[option.__name] = [''];\n }\n } else if (option.__type === 'OptionArray') {\n if (!values[option.__name]) { // values has no entry for this option\n values[option.__name] = [];\n const optionEl = {};\n for (let j = 0; j < option.__childOptions.length; j++) {\n const child = option.__childOptions[j];\n if (child.__type === 'StringArray') {\n optionEl[child.__name] = [''];\n } else {\n optionEl[child.__name] = (!angular.isUndefined(child.__defaultValue) ? child.__defaultValue : '');\n }\n }\n values[option.__name].push(optionEl);\n } else { // values already has en entry for this option\n // Copies the default value for Boolean child options if no explicit value is set\n for (let j = 0; j < option.__childOptions.length; j++) {\n const child = option.__childOptions[j];\n if (child.__type === 'Boolean') {\n for (let k = 0; k < values[option.__name].length; k++) {\n const valueK = values[option.__name][k];\n if (!valueK.hasOwnProperty([child.__name]) && angular.isDefined(child.__defaultValue)) {\n valueK[child.__name] = child.__defaultValue;\n }\n }\n }\n }\n }\n } else if (option.__type === 'Map') {\n if (!values[option.__name]) {\n values[option.__name] = [];\n } else {\n values[option.__name] = toArrayMap(values[option.__name]);\n }\n } else if (option.__type === 'JsonString') {\n if (values[option.__name] && !(values[option.__name] instanceof String) && typeof values[option.__name] !== 'string') {\n values[option.__name] = angular.toJson(values[option.__name], 2);\n }\n } else {\n if (angular.isUndefined(values[option.__name])) {\n values[option.__name] = (!angular.isUndefined(option.__defaultValue) ? option.__defaultValue : '');\n }\n }\n }\n\n return values;\n}\n\nfunction _evaluateSparqlQuery(http, repository, query) {\n return http.post('repositories/' + repository, jsonToFormData({query: query}),\n {\n headers: {\n 'Content-Type': 'application/x-www-form-urlencoded',\n 'Accept': 'application/sparql-results+json',\n 'X-GraphDB-Local-Consistency': 'updating'\n }\n });\n}\n\nfunction buildNamePrefix(prefix) {\n return prefix.substring(0, prefix.length - 1) + '/instance#';\n}\n\nfunction createConnectorQuery(name, prefix, fields, options, reportError) {\n // Returns a copy of the parameter obj sorted according to the order in options\n function sortObject(obj, options) {\n const newObject = {};\n _.each(options, function (option) {\n if (angular.isDefined(obj[option.__name])) {\n if (option.__type === 'OptionArray') {\n newObject[option.__name] = [];\n _.each(obj[option.__name], function (childOption) {\n newObject[option.__name].push(sortObject(childOption, option.__childOptions));\n });\n } else {\n newObject[option.__name] = angular.copy(obj[option.__name]);\n }\n }\n });\n return newObject;\n }\n\n const fcopy = sortObject(fields, options);\n\n for (let i = 0; i < options.length; i++) {\n try {\n if (options[i].__type === 'Map') {\n fcopy[options[i].__name] = fromArrayMap(fcopy[options[i].__name]);\n } else if (options[i].__type === 'JsonString') {\n fcopy[options[i].__name] = angular.fromJson(fcopy[options[i].__name]);\n }\n } catch (e) {\n reportError(options[i].__label, e.message);\n return null;\n }\n }\n\n removeEmptyValues(fcopy);\n //escapeValues(fields);\n let finalString = '';\n finalString += 'PREFIX :<' + prefix + '>\\n';\n const namePrefix = buildNamePrefix(prefix);\n finalString += 'PREFIX inst:<' + namePrefix + '>\\n';\n finalString += 'INSERT DATA {\\n';\n finalString += \"\\tinst:\" + name + \" :createConnector '''\\n\"; // eslint-disable-line quotes\n finalString += angular.toJson(fcopy, 2);\n finalString += \"\\n''' .\\n}\\n\"; // eslint-disable-line quotes\n finalString = finalString.replace(/\\\\/g, '\\\\\\\\\\\\');\n return finalString;\n}\n\nfunction createStatusQueryForIri(iri) {\n const statusIri = iri.replace(/\\/instance#.+$/, '#connectorStatus');\n let finalString = '';\n finalString += 'SELECT ?status {\\n';\n finalString += '\\t<' + iri + '> <' + statusIri + '> ?status';\n finalString += '\\n}';\n return finalString;\n}\n\nfunction createStatusQueryForAny(connectors) {\n const connectorIris = _.map(connectors,\n function (k) {\n return '<' + k.value + 'connectorStatus' + '>';\n }).join('|');\n\n if (connectorIris) {\n return 'SELECT ?connector ?status { ?connector ' + connectorIris + ' ?status }';\n }\n\n return null;\n}\n\nfunction repairConnectorQuery(name, prefix) {\n const namePrefix = buildNamePrefix(prefix);\n return 'PREFIX prefix:<' + prefix + '>\\n' +\n 'INSERT DATA {\\n' +\n '\\t<' + namePrefix + name + '> prefix:repairConnector \"\"\\n' +\n '}';\n}\n\nfunction deleteConnectorQuery(name, prefix, force) {\n const namePrefix = prefix.substring(0, prefix.length - 1) + \"/instance#\";\n return 'PREFIX prefix:<' + prefix + '>\\n' +\n 'INSERT DATA {\\n' +\n '\\t<' + namePrefix + name + '> prefix:dropConnector \"' + (force ? \"force\" : \"\") + '\"\\n' +\n '}';\n}\n\nfunction removeEmptyValues(data) {\n // remove empty values from array\n if (Array.isArray(data)) {\n data = _.filter(data, function (item) {\n return item !== null && (!item.trim || item.trim() !== '');\n });\n }\n // remove empty values from object values\n Object.keys(data).forEach(function (key) {\n if ((data[key] === '' || data[key] == null) && data[key] !== false) {\n delete data[key];\n } else if (typeof data[key] === 'object') {\n data[key] = removeEmptyValues(data[key]);\n }\n });\n return data;\n}\n\nfunction parseFirstBuildingResult(results) {\n if (results.bindings) {\n for (let i = 0; i < results.bindings.length; i++) {\n try {\n const statusObject = JSON.parse(results.bindings[i].status.value);\n if (statusObject.status === 'BUILDING') {\n return {\n connector: results.bindings[i].connector.value,\n status: statusObject\n };\n }\n } catch (e) {\n console.error(e); // eslint-disable-line no-console\n }\n }\n }\n\n return {};\n}\n\nConnectorsCtrl.$inject = ['$scope', '$http', '$repositories', '$modal', 'toastr', 'ModalService', '$q', 'RDF4JRepositoriesRestService', 'ConnectorsRestService'];\n\nfunction ConnectorsCtrl($scope, $http, $repositories, $modal, toastr, ModalService, $q, RDF4JRepositoriesRestService, ConnectorsRestService) {\n $scope.loader = false;\n\n $scope.controllers = [];\n\n $scope.existing = {};\n\n $scope.definitions = {};\n\n $scope.getLoaderMessage = function () {\n const timeSeconds = (Date.now() - $scope.loaderStartTime) / 1000;\n const timeHuman = $scope.getHumanReadableSeconds(timeSeconds);\n let message = '';\n if ($scope.progressMessage) {\n message = $scope.progressMessage + '... ' + timeHuman;\n } else {\n message = 'Running operation...' + timeHuman;\n }\n if ($scope.extraMessage && timeSeconds > 10) {\n message += '\\n' + $scope.extraMessage;\n }\n\n return message;\n };\n\n $scope.setLoader = function (isRunning, progressMessage, extraMessage) {\n if (isRunning) {\n $scope.loader = true;\n $scope.loaderStartTime = Date.now();\n $scope.progressMessage = progressMessage;\n $scope.extraMessage = extraMessage;\n } else {\n $scope.loader = false;\n $scope.progressMessage = '';\n $scope.extraMessage = '';\n }\n };\n\n $scope.initConnector = function (connector) {\n return ConnectorsRestService.initConnector(encodeURIComponent(connector.value))\n .then(function (res) {\n $scope.definitions[connector.key] = res.data;\n\n return ConnectorsRestService.hasConnector(encodeURIComponent(connector.value))\n .then(function (res) {\n $scope.existing[connector.key] = res.data;\n\n });\n });\n };\n\n $scope.getConnectors = function () {\n if (!$scope.canWriteActiveRepo()) {\n return;\n }\n\n $scope.setLoader(true, 'Fetching connectors', 'Normally this is a fast operation but it may take longer if a bigger repository needs to be initialised first.');\n\n ConnectorsRestService.getConnectors()\n .then(function (res) {\n $scope.connectors = Object.keys(res.data).map(function (key) {\n return {key: key, value: res.data[key]};\n });\n\n $q.all(_.map($scope.connectors, function (connector) {\n return $scope.initConnector(connector);\n })).finally(function () {\n resetProgress();\n\n const query = createStatusQueryForAny($scope.connectors);\n\n if (query) {\n evaluateSparqlQuery(query)\n .then(function (res) {\n const status = parseFirstBuildingResult(res.data.results);\n if (status.connector) {\n // has a building connector, open progress indicator\n const d = status.connector.split(/#/);\n d[0] = d[0].replace(/\\/instance$/, '#');\n showProgress(d[0], d[1]);\n }\n })\n .finally(function () {\n $scope.setLoader(false);\n });\n } else {\n $scope.setLoader(false);\n }\n });\n }).catch(function (e) {\n $scope.setLoader(false);\n toastr.error(getError(e), 'Could not get connectors');\n });\n\n $scope.existing = {};\n };\n\n $scope.getOptions = function (connector) {\n return $scope.definitions[connector.key];\n };\n\n $scope.isEmpty = function (value) {\n return angular.isObject(value) && Object.keys(value).length === 0;\n };\n\n $scope.toPrettyJson = function (value) {\n return angular.toJson(value, 2);\n };\n\n $scope.$watch(function () {\n return $repositories.getActiveRepository();\n }, $scope.getConnectors);\n\n $scope.$watch(function () {\n return $repositories.getActiveLocation();\n }, $scope.getConnectors);\n\n function evaluateSparqlQuery(query) {\n return _evaluateSparqlQuery($http, $repositories.getActiveRepository(), query);\n }\n\n function resetProgress(repair) {\n $scope.beingBuiltConnector = {\n percentDone: 0,\n status: {\n processedEntities: 0,\n estimatedEntities: 0,\n indexedEntities: 0,\n entitiesPerSecond: 0\n },\n actionName: repair ? 'Repairing' : 'Creating',\n waitOnRepairStartOnce: !!repair,\n eta: '-',\n inline: false,\n iri: null\n };\n }\n\n function openProgressModal(prefix, name, repair) {\n resetProgress(repair);\n\n $.extend($scope.beingBuiltConnector, {\n iri: buildNamePrefix(prefix) + name,\n name: name,\n inline: false,\n doneCallback: function () {\n $scope.beingBuiltConnector.modalInstance.dismiss('cancel');\n }\n });\n\n $scope.beingBuiltConnector.modalInstance = $modal.open({\n templateUrl: 'pages/connectorProgress.html',\n controller: 'CreateProgressCtrl',\n size: 'lg',\n backdrop: 'static',\n scope: $scope\n });\n\n return $scope.beingBuiltConnector.modalInstance;\n }\n\n function showProgress(prefix, name) {\n resetProgress();\n\n $.extend($scope.beingBuiltConnector, {\n iri: buildNamePrefix(prefix) + name,\n name: name,\n inline: true,\n doneCallback: function () {\n $scope.beingBuiltConnector.inline = false;\n }\n });\n }\n\n function executeCreate(connector, obj, errorCallback) {\n const modal = openProgressModal(connector.value, obj.name, false);\n RDF4JRepositoriesRestService.addStatements($repositories.getActiveRepository(), jsonToFormData({update: obj.query}))\n .then(function () {\n ConnectorsRestService.getConnectors().then(function () {\n ConnectorsRestService.hasConnector(encodeURIComponent(connector.value)).then(function (res) {\n $scope.existing[connector.key] = res.data;\n });\n });\n toastr.success('Created connector ' + obj.name);\n }, function (err) {\n toastr.error(getError(err));\n errorCallback();\n }).finally(function () {\n modal.dismiss('cancel');\n });\n }\n\n $scope.copyConnector = function (connector, values) {\n let newValues;\n if (!angular.isUndefined(values)) {\n newValues = angular.copy(values);\n newValues.name = newValues.name + '-copy';\n }\n const modal = $modal.open({\n templateUrl: 'pages/createConnector.html',\n controller: 'CreateConnectorCtrl',\n size: 'lg',\n backdrop: 'static',\n resolve: {\n connector: function () {\n return connector;\n },\n values: function () {\n return angular.isUndefined(newValues) ? {name: '', values: {}} : newValues;\n },\n options: function () {\n return $scope.getOptions(connector);\n }\n }\n });\n\n modal.result.then(function (obj) {\n executeCreate(connector, obj, function () {\n obj.skipConversion = true;\n $scope.newConnector(connector, obj);\n });\n });\n };\n\n $scope.newConnector = function (connector, values) {\n const modal = $modal.open({\n templateUrl: 'pages/createConnector.html',\n controller: 'CreateConnectorCtrl',\n size: 'lg',\n backdrop: 'static',\n resolve: {\n connector: function () {\n return connector;\n },\n values: function () {\n return angular.isUndefined(values) ? {name: '', values: {}} : values;\n },\n options: function () {\n return $scope.getOptions(connector);\n }\n }\n });\n\n modal.result.then(function (obj) {\n executeCreate(connector, obj, function () {\n obj.skipConversion = true;\n $scope.newConnector(connector, obj);\n });\n });\n };\n\n $scope.repair = function (inst, type) {\n ModalService.openSimpleModal({\n title: 'Confirm repair',\n message: 'Are you sure you want to repair this connector?<br>Note that repair means delete + recreate with the same settings.',\n warning: true\n }).result\n .then(function () {\n const modal = openProgressModal(type.value, inst.name, true);\n\n const query = repairConnectorQuery(inst.name, type.value);\n\n RDF4JRepositoriesRestService.addStatements($repositories.getActiveRepository(), jsonToFormData({update: query}))\n .then(function () {\n ConnectorsRestService.getConnectors().then(function () {\n ConnectorsRestService.hasConnector(encodeURIComponent(type.value)).then(function (res) {\n $scope.existing[type.key] = res.data;\n });\n });\n toastr.success('Repaired connector ' + inst.name);\n }, function (err) {\n toastr.error(getError(err));\n }).finally(function () {\n modal.dismiss('cancel');\n });\n });\n };\n\n $scope.delete = function (inst, type) {\n const isExternal = type.key.indexOf(\"Elastic\") >= 0 || type.key.indexOf(\"Solr\") >= 0;\n\n $modal.open({\n templateUrl: 'js/angular/externalsync/templates/deleteConnector.html',\n controller: 'DeleteConnectorCtrl',\n resolve: {\n type: function () {\n return type.key;\n },\n isExternal: function () {\n return isExternal;\n }\n }\n }).result\n .then(function(force) {\n $scope.setLoader(true, 'Deleting connector ' + inst.name, 'This is usually a fast operation but it might take a while.');\n\n const query = deleteConnectorQuery(inst.name, type.value, force);\n RDF4JRepositoriesRestService.addStatements($repositories.getActiveRepository(), jsonToFormData({update: query}))\n .then(function () {\n ConnectorsRestService.getConnectors().then(function () {\n ConnectorsRestService.hasConnector(encodeURIComponent(type.value)).then(function (res) {\n $scope.existing[type.key] = res.data;\n });\n });\n if (force) {\n toastr.success(\"Deleted (with force) connector \" + inst.name);\n if (isExternal) {\n toastr.warning(\"You may have to remove the index manually from \" + type.key);\n }\n } else {\n toastr.success(\"Deleted connector \" + inst.name);\n }\n }, function (err) {\n toastr.error(getError(err));\n }).finally(function() {\n $scope.setLoader(false);\n });\n });\n };\n\n $scope.viewQuery = function (connector, inst) {\n $modal.open({\n templateUrl: 'pages/viewQuery.html',\n controller: 'ViewQueryCtrl',\n resolve: {\n query: function () {\n const options = $scope.getOptions(connector);\n return createConnectorQuery(inst.name, connector.value,\n mapCreateValuesToUiValues(inst.values, options), options);\n }\n }\n });\n };\n}\n\nDeleteConnectorCtrl.$inject = ['$scope', '$modalInstance', 'type', 'isExternal'];\nfunction DeleteConnectorCtrl($scope, $modalInstance, type, isExternal) {\n $scope.force = false;\n $scope.type = type;\n $scope.isExternal = isExternal;\n\n $scope.ok = function () {\n $modalInstance.close($scope.force);\n };\n\n $scope.cancel = function () {\n $modalInstance.dismiss();\n };\n}\n\nExtendNewConnectorCtrl.$inject = ['$scope', '$modalInstance', 'connector', '$modal', 'toastr'];\nfunction ExtendNewConnectorCtrl($scope, $modalInstance, connector, $modal, toastr) {\n\n $scope.connector = connector;\n\n $scope.addField = function (index, optionName) {\n const newField = angular.copy($scope.defaultValues[optionName][0]);\n $scope.values[optionName].splice(index + 1, 0, newField);\n };\n\n $scope.addOption = function (index, array) {\n array.splice(index + 1, 0, '');\n };\n\n $scope.deleteOption = function (index, array) {\n array.splice(index, 1);\n };\n\n $scope.addMapOption = function (index, array) {\n array.splice(index + 1, 0, {key: '', value: ''});\n };\n\n $scope.deleteMapOption = function (index, array) {\n array.splice(index, 1);\n };\n\n function toQuery() {\n return createConnectorQuery($scope.name, connector.value, $scope.values, $scope.options,\n function (label, error) {\n toastr.error(error, label);\n });\n }\n\n $scope.ok = function () {\n if ($scope.form.$valid) {\n const query = toQuery();\n\n if (query) {\n $modalInstance.close({name: $scope.name, values: $scope.values, options: $scope.options, query: query});\n }\n }\n };\n\n $scope.viewQuery = function () {\n const query = toQuery();\n\n if (query) {\n $modal.open({\n templateUrl: 'pages/viewQuery.html',\n controller: 'ViewQueryCtrl',\n resolve: {\n query: function () {\n return query;\n }\n }\n });\n }\n };\n\n $scope.cancel = function () {\n $modalInstance.dismiss('cancel');\n };\n}\n\nCreateConnectorCtrl.$inject = ['$scope', '$controller', '$http', '$modalInstance', 'connector', '$modal', 'values', 'options'];\n\nfunction CreateConnectorCtrl($scope, $controller, $http, $modalInstance, connector, $modal, values, options) {\n angular.extend(this, $controller('ExtendNewConnectorCtrl', {\n $scope: $scope,\n $modalInstance: $modalInstance,\n connector: connector,\n $modal: $modal\n }));\n $scope.values = values.values;\n $scope.options = options;\n $scope.name = values.name;\n if (!values.skipConversion) {\n $scope.values = mapCreateValuesToUiValues($scope.values, $scope.options);\n }\n $scope.defaultValues = angular.copy($scope.values);\n}\n\n// Note that this is a fancy controller: it's used both for a modal and for a directive.\n// This means you can't rely on custom injection through resolve in the modal and the scope\n// must be shared with the main connectors controller.\nCreateProgressCtrl.$inject = ['$scope', '$interval', '$http', '$repositories'];\n\nfunction CreateProgressCtrl($scope, $interval, $http, $repositories) {\n function evaluateSparqlQuery(query) {\n return _evaluateSparqlQuery($http, $repositories.getActiveRepository(), query);\n }\n\n function initProgress() {\n const query = createStatusQueryForIri($scope.beingBuiltConnector.iri);\n\n // reset iri value so that watch will fire again when we do something with the same connector\n $scope.beingBuiltConnector.iri = null;\n\n $scope.progressInterval = $interval(function () {\n function getFirstStatusFromResult(results) {\n if (results.bindings) {\n if (results.bindings.length > 0) {\n try {\n return JSON.parse(results.bindings[0].status.value);\n } catch (e) {\n console.error(e); // eslint-disable-line no-console\n }\n }\n }\n\n return {};\n }\n\n evaluateSparqlQuery(query)\n .then(function (res) {\n const status = getFirstStatusFromResult(res.data.results);\n if (status.status === 'BUILDING') {\n $scope.beingBuiltConnector.status = status;\n $scope.beingBuiltConnector.percentDone = (100 * status.processedEntities / status.estimatedEntities).toFixed(0);\n $scope.beingBuiltConnector.eta = $scope.getHumanReadableSeconds(status.etaSeconds);\n $scope.beingBuiltConnector.actionName = status.repair ? 'Repairing' : 'Creating';\n $scope.beingBuiltConnector.waitOnRepairStartOnce = false;\n } else if (status.status === 'BUILT' && !$scope.beingBuiltConnector.waitOnRepairStartOnce) {\n // done\n $interval.cancel($scope.progressInterval);\n if ($scope.beingBuiltConnector.doneCallback) {\n $scope.beingBuiltConnector.doneCallback();\n }\n }\n });\n }, 1000);\n\n $scope.$on('$destroy', function () {\n $interval.cancel($scope.progressInterval);\n });\n }\n\n $scope.beingBuiltConnector = $scope.beingBuiltConnector || {};\n\n // for modal instance we get the iri before hand and can start progress now\n if (!$scope.beingBuiltConnector.inline && $scope.beingBuiltConnector.iri) {\n initProgress();\n }\n\n // for inline progress we need to watch for the iri value\n $scope.$watch('beingBuiltConnector.iri', function (value) {\n if ($scope.beingBuiltConnector.inline && value) {\n initProgress();\n }\n });\n}\n\nfunction ceil() {\n return function (input) {\n return Math.ceil(input);\n };\n}\n","import 'angular/rest/connectors.rest.service';\nimport 'angular/utils/local-storage-adapter';\nimport 'angular/externalsync/controllers';\nimport YASQE from 'lib/yasqe.bundled';\nimport YASR from 'lib/yasr.bundled';\n\nangular\n .module('graphdb.framework.core.directives.queryeditor.queryeditor', [\n 'ngCookies',\n 'graphdb.framework.externalsync.controllers',\n 'graphdb.framework.rest.connectors.service',\n 'graphdb.framework.utils.localstorageadapter'\n ])\n .directive('queryEditor', queryEditorDirective);\n\nqueryEditorDirective.$inject = ['$timeout', '$location', 'toastr', '$repositories', 'SparqlRestService', 'ModalService', '$modal', '$jwtAuth', 'RDF4JRepositoriesRestService', 'ConnectorsRestService', 'LocalStorageAdapter', 'LSKeys'];\n\nfunction queryEditorDirective($timeout, $location, toastr, $repositories, SparqlRestService, ModalService, $modal, $jwtAuth, RDF4JRepositoriesRestService, ConnectorsRestService, LocalStorageAdapter, LSKeys) {\n\n let callbackOnChange;\n\n return {\n restrict: 'AE',\n scope: false,\n templateUrl: 'js/angular/core/directives/queryeditor/templates/query-editor.html',\n link: linkFunc\n };\n\n //function updateLineGutter() in Yasqe receive wrong data and line numbers div have width 100%\n // magic value 150 seems to work well (including Safari), smaller values work on other browsers but not always on Safari\n function linkFunc(scope, element, attrs) {\n // Doesn't store anything in local storage\n scope.nostorage = attrs.hasOwnProperty('nostorage');\n // Doesn't allow multiple tabs in the editor, only a single tab is active\n scope.notabs = attrs.hasOwnProperty('notabs');\n // Hides all the vertical toolbar inside the editor\n scope.notoolbar = attrs.hasOwnProperty('notoolbar');\n // Hides the saved queries icons in the toolbar\n scope.notoolbarSaved = attrs.hasOwnProperty('notoolbarSaved');\n // Hides the copy query link icon in the toolbar\n scope.notoolbarCopy = attrs.hasOwnProperty('notoolbarCopy');\n // Hides the inference icon in the toolbar\n scope.notoolbarInference = attrs.hasOwnProperty('notoolbarInference');\n // Hides the sameAs icon in the toolbar\n scope.notoolbarSameAs = attrs.hasOwnProperty('notoolbarSameAs');\n // Doesn't show any status messages in YASR (e.g. no results, query took that many seconds, etc)\n scope.nostatus = attrs.hasOwnProperty('nostatus');\n // Doesn't show the run button\n scope.norun = attrs.hasOwnProperty('norun');\n // Name of the Run button in the editor\n scope.runButtonName = \"Run\";\n if (attrs.runButtonName) {\n scope.runButtonName = attrs.runButtonName;\n }\n // Doesn't execute the count query\n scope.nocount = attrs.nocount === \"true\";\n\n // Custom callback to call when the content changes (fired within timeout of 200)\n if (attrs.callbackOnChange) {\n const callback = scope[attrs.callbackOnChange];\n if (typeof callback === 'function') {\n callbackOnChange = callback;\n }\n }\n\n $timeout(function () {\n drawQueryEditor(scope);\n }, 150);\n }\n\n function drawQueryEditor(scope) {\n scope.changePagination = changePagination;\n\n // start of keyboard shortcut actions\n function saveQueryAction() {\n angular.element('#wb-sparql-saveQuery')[0].click();\n }\n\n function runQueryAction() {\n scope.runQuery(false, false);\n }\n\n function explainQueryAction() {\n scope.runQuery(false, true);\n }\n\n function goToNextTabAction() {\n if (scope.tabs.length < 2 || !scope.currentQuery.id || !scope.isTabChangeOk(false)) {\n return;\n }\n let idx = findTabIndexByID(scope.currentQuery.id);\n idx = (idx + 1) % scope.tabs.length;\n const tab = scope.tabs[idx];\n selectTab(tab.id);\n }\n\n function goToPreviousTabAction() {\n if (scope.tabs.length < 2 || !scope.currentQuery.id || !scope.isTabChangeOk(false)) {\n return;\n }\n let idx = findTabIndexByID(scope.currentQuery.id);\n idx--;\n if (idx === -1) {\n idx = scope.tabs.length - 1;\n }\n const tab = scope.tabs[idx];\n selectTab(tab.id);\n }\n\n window.editor = YASQE.fromTextArea(\n document.getElementById(\"query\"), {\n persistent: null,\n value: \"\",\n indentUnit: 4,\n createShareLink: null,\n cursorHeight: 1.0,\n sparql: {\n showQueryButton: false,\n acceptHeaderGraph: \"application/x-graphdb-table-results+json, application/rdf+json;q=0.9, */*;q=0.8\",\n acceptHeaderSelect: \"application/x-sparqlstar-results+json, application/sparql-results+json;q=0.9, */*;q=0.8\"\n },\n // We provide a wrapper for executeQuery so we have to redefine those here\n extraKeys: {\n \"Ctrl-Enter\": runQueryAction,\n \"Cmd-Enter\": runQueryAction,\n \"Shift-Ctrl-Enter\": explainQueryAction,\n \"Shift-Cmd-Enter\": explainQueryAction,\n \"Ctrl-Alt-T\": scope.addNewTab,\n \"Cmd-Alt-T\": scope.addNewTab,\n \"Ctrl-S\": saveQueryAction,\n \"Cmd-S\": saveQueryAction,\n \"Ctrl-Alt-Left\": goToPreviousTabAction,\n \"Cmd-Alt-Left\": goToPreviousTabAction,\n \"Ctrl-Alt-Right\": goToNextTabAction,\n \"Cmd-Alt-Right\": goToNextTabAction\n }\n }\n );\n\n window.editor.toastBuildIndex = function () {\n toastr.warning('', '<div class=\"autocomplete-toast\"><a href=\"autocomplete\">Autocomplete is OFF<br>Go to Setup -> Autocomplete</a></div>',\n {allowHtml: true});\n };\n\n window.editor.toastError = function (data) {\n toastr.error('Cannot execute autocomplete query. ' + getError(data));\n };\n\n window.editor.on(\"changes\", function () {\n angular.element('.CodeMirror-linenumbers').css('width', '1px');\n angular.element('.CodeMirror-sizer').css('margin-left', '0px');\n clearTimeout(scope.changesTimeout);\n const hasError = !window.editor.queryValid;\n scope.changesTimeout = setTimeout(callbackOnChange ? callbackOnChange() : function () {\n const idx = findTabIndexByID(scope.currentQuery.id) + 1;\n $('a[data-id = \"' + idx + '\"]')\n .toggleClass('query-has-error', hasError)\n .attr('title', hasError ?\n 'Query contains a syntax error. See the relevant line for more information.' :\n '');\n }, 200);\n scope.currentQuery.query = window.editor.getValue();\n scope.currentQuery.queryType = window.editor.getQueryType();\n });\n\n\n function selectTab(id) {\n $timeout(function () {\n let requestedTab = $('a[data-id = \"' + id + '\"]');\n if (requestedTab.length === 0) {\n // tab has been deleted in another browser window or something else occurred,\n // select first tab instead\n requestedTab = $('a[data-id]').first();\n }\n requestedTab.tab('show');\n }, 0);\n }\n\n // hide unneeded yasqe fullscreen button\n $(\".fullscreenToggleBtns\").hide();\n\n const afterCopy = function (event) {\n $(event.target).removeClass('fa-link').addClass('fa-check').blur();\n setTimeout(function () {\n $(event.target).removeClass('fa-check').addClass('fa-link');\n }, 1000);\n };\n\n window.onbeforeunload = function () {\n if (!scope.nostorage) {\n LocalStorageAdapter.set(LSKeys.TABS_STATE, scope.tabs);\n }\n scope.saveTab(scope.currentQuery.id);\n };\n\n /*\n * Patch the execute query to take into account the inference\n * and the same as options\n */\n const originalExecuteQuery = YASQE.executeQuery;\n const originalGetUrlArguments = YASQE.getUrlArguments;\n\n scope.$on('$destroy', function () {\n if (!scope.nostorage) {\n LocalStorageAdapter.set(LSKeys.TABS_STATE, scope.tabs);\n }\n YASQE.executeQuery = originalExecuteQuery;\n YASQE.getUrlArguments = originalGetUrlArguments;\n scope.saveTab(scope.currentQuery.id);\n });\n\n /*\n * Add our own buttons\n */\n YASQE.drawButtons = function (yasqe) {\n // Define this property because otherwise there are errors in yasgui's code.\n yasqe.buttons = $(\"#yasqe_buttons_mocked\");\n };\n\n YASQE.getActiveRepository = function () {\n return $repositories.getActiveRepository();\n };\n\n YASQE.getUrlArguments = function (yasqe, config) {\n const data = originalGetUrlArguments(yasqe, config);\n const qType = window.editor.getQueryType();\n if ('SELECT' === qType || 'CONSTRUCT' === qType || 'DESCRIBE' === qType) {\n // We request pageSize + 1 to know if there are more pages when total count isn't known\n data.push({name: 'limit', value: scope.currentTabConfig.pageSize + 1});\n scope.currentTabConfig.offset = (scope.currentTabConfig.page - 1) * scope.currentTabConfig.pageSize + 1;\n data.push({name: 'offset', value: scope.currentTabConfig.offset - 1});\n }\n // even though we have explainRequested in our scope too it doesn't always contain a fresh value\n if (scope.explainRequested && ('SELECT' === qType || 'CONSTRUCT' === qType)) {\n data.push({name: 'explain', value: 'true'});\n }\n return data;\n };\n\n function createCustomError(status, statusText, responseText) {\n return {\n status: status,\n statusText: statusText,\n responseText: responseText\n };\n }\n\n // Generates a new tracking alias for queries based on time\n function newTrackAlias() {\n return \"query-editor-\" + performance.now() + \"-\" + Date.now();\n }\n\n let connectorProgressModal;\n let yasr;\n\n YASQE.executeQuery = function (cm) {\n if (yasr && $(yasr.resultsContainer).length) {\n $(yasr.resultsContainer).empty();\n }\n // Request extra error/warning handling\n cm.options.sparql.headers['X-GraphDB-Catch'] = scope.currentTabConfig.pageSize + '; throw';\n scope.currentTrackAlias = newTrackAlias();\n cm.options.sparql.headers['X-GraphDB-Track-Alias'] = scope.currentTrackAlias;\n scope.countTimeouted = false;\n if (cm.getQueryMode() === 'query') {\n cm.options.sparql.endpoint = 'repositories/' + $repositories.getActiveRepository();\n } else if (cm.getQueryMode() === 'update') {\n cm.options.sparql.endpoint = 'repositories/' + $repositories.getActiveRepository() + '/statements';\n }\n cm.options.sparql.args = [{\n name: 'infer',\n value: scope.currentQuery.inference\n },\n {\n name: 'sameAs',\n value: scope.currentQuery.sameAs\n }];\n\n scope.currentTabConfig.customUpdateMessage = \"\";\n\n if (window.editor.getQueryMode() === \"update\") {\n const doExecute = function () {\n scope.currentTabConfig.queryType = \"UPDATE\";\n\n RDF4JRepositoriesRestService.getRepositorySize()\n .success(function (data) {\n scope.repoSize = parseInt(data);\n scope.queryStartTime = new Date().getTime();\n return originalExecuteQuery(cm, {});\n })\n .error(function (data) {\n toastr.warning('Could not get repository size for: ' + $repositories.getActiveRepository() + '; ' + getError(data));\n scope.queryStartTime = new Date().getTime();\n return originalExecuteQuery(cm, {});\n });\n };\n\n ConnectorsRestService.checkConnector(window.editor.getValue())\n .then(function (res) {\n if (res.data.command && !res.data.hasSupport) {\n // it's a connector query but the relevant plugin isn't active, stop executing and warn the user\n scope.currentTabConfig.queryType = 'ERROR';\n scope.currentTabConfig.timeFinished = Date.now();\n scope.currentTabConfig.timeTook = (scope.currentTabConfig.timeFinished - scope.queryStartTime) / 1000;\n\n const customError = createCustomError(-1, 'No support for ' + res.data.connectorName, res.data.connectorName\n + ' connectors are not supported because the plugin ' + res.data.pluginName + ' is not active.');\n\n yasr.results = {\n getException: function () {\n return customError;\n }\n };\n\n scope.setLoader(false);\n\n setNewTabState({customError: customError}, '', null);\n\n return;\n }\n\n if (res.data.command === 'create' || res.data.command === 'repair') {\n const repair = res.data.command === 'repair';\n if (repair) {\n scope.setLoader(true, 'Repairing connector ' + res.data.name);\n scope.currentTabConfig.customUpdateMessage = 'Repaired connector ' + res.data.name + '.';\n } else {\n scope.setLoader(true, 'Creating connector ' + res.data.name);\n scope.currentTabConfig.customUpdateMessage = 'Created connector ' + res.data.name + '.';\n }\n\n const progressScope = scope.$new(true);\n\n // This duplicates code in the externalsync module but we can't get it from there\n progressScope.beingBuiltConnector = {\n percentDone: 0,\n status: {\n processedEntities: 0,\n estimatedEntities: 0,\n indexedEntities: 0,\n entitiesPerSecond: 0\n },\n actionName: repair ? 'Repairing' : 'Creating',\n eta: \"-\",\n inline: false,\n iri: res.data.iri,\n name: res.data.name,\n doneCallback: function () {\n connectorProgressModal.dismiss('cancel');\n }\n };\n progressScope.getHumanReadableSeconds = scope.getHumanReadableSeconds;\n\n connectorProgressModal = $modal.open({\n templateUrl: 'pages/connectorProgress.html',\n controller: 'CreateProgressCtrl',\n size: 'lg',\n backdrop: 'static',\n scope: progressScope\n });\n } else if (res.data.command === 'drop') {\n scope.setLoader(true, 'Deleting connector ' + res.data.name);\n scope.currentTabConfig.customUpdateMessage = 'Deleted connector ' + res.data.name + '.';\n }\n\n doExecute();\n }, function () {\n // for some reason we couldn't check if this is a connector update, so just execute it\n doExecute();\n });\n\n } else {\n const thisTabConfig = scope.currentTabConfig;\n const thisTabId = scope.executedQueryTab.id;\n\n // Assign a fresh callback function so that we can associate the count result\n // with the right tab (or lack of tab).\n window.editor.options.sparql.handlers.countCallback = function (dataOrJqXhr, textStatus, jqXhrOrErrorString) {\n if (dataOrJqXhr.status === 200) {\n const tab = scope.tabs[findTabIndexByID(thisTabId)];\n if (tab) {\n yasr.setResultsCount(dataOrJqXhr, textStatus, jqXhrOrErrorString);\n thisTabConfig.allResultsCount = yasr.allCount;\n tab.allResultsCount = yasr.allCount;\n thisTabConfig.allResultsCountExact = true;\n tab.allResultsCountExact = true;\n scope.saveTab(tab.id);\n } // Else tab was closed while we wait for the count, ignore result\n } else {\n // count query timed out or something else went wrong\n thisTabConfig.countTimeouted = true;\n }\n };\n\n // Tell YASR what format we want, or else it will mess it up when switching between tabs.\n if (scope.currentQuery.outputType != null) {\n yasr.options.output = scope.currentQuery.outputType;\n } else { // Default to table if no format has been configured yet.\n yasr.options.output = \"table\";\n }\n scope.currentTabConfig.queryType = window.editor.getQueryType();\n scope.queryStartTime = new Date().getTime();\n return originalExecuteQuery(cm, {\n setQueryLimit: function (query) {\n // Until weird conversion of CONSTRUCT queries is fixed\n // in Ontop project, comments should be removed from them\n // TODO: Remove this check when ${link https://github.com/ontop/ontop/issues/362} is fixed\n if (scope.currentTabConfig.queryType === 'CONSTRUCT' && $repositories.isActiveRepoOntopType()) {\n return window.editor.getValueWithoutComments();\n }\n // For all types of queries we handle limit/offset in our RepositoriesController.\n // TODO: Get rid of this method\n return query;\n }\n });\n }\n\n };\n\n // Override yasqe's getAjaxConfig() so we can inject our authorization header\n const originalGetAjaxConfig = YASQE.getAjaxConfig;\n YASQE.getAjaxConfig = function (yasqe, callbackOrConfig) {\n const config = originalGetAjaxConfig(yasqe, callbackOrConfig);\n\n _.extend(config.headers, {\n 'Authorization': $jwtAuth.getAuthToken()\n });\n\n return config;\n };\n\n function createQueryURL(savedQueryName, owner) {\n let url = [location.protocol, '//', location.host, location.pathname].join('');\n if (savedQueryName) {\n url = url + '?savedQueryName=' + encodeURIComponent(savedQueryName);\n if (owner != null) {\n url += '&owner=' + encodeURIComponent(owner);\n }\n } else {\n url = url + '?' + $.param({\n name: scope.currentQuery.name,\n infer: scope.currentQuery.inference,\n sameAs: scope.currentQuery.sameAs,\n query: window.editor.getValue()\n });\n }\n return url;\n }\n\n scope.copyToClipboardQuery = function (savedQueryName, owner) {\n ModalService.openCopyToClipboardModal(createQueryURL(savedQueryName, owner));\n };\n\n scope.copyToClipboardResult = function (resultURI) {\n ModalService.openCopyToClipboardModal(resultURI);\n };\n\n scope.goToVisual = function () {\n const paramsToParse = {\n query: window.editor.getValue(),\n sameAs: scope.currentQuery.sameAs,\n inference: scope.currentQuery.inference\n };\n\n $location.path('graphs-visualizations').search(paramsToParse);\n };\n\n // Adds prefixes when the user pastes a query. This was in the controller before and it stopped working\n // (needs to happen to after YASQE adds the textarea), see GDB-1936\n $('textarea').on('paste', function () {\n $timeout(function () {\n scope.addKnownPrefixes();\n }, 0);\n });\n\n function setNewTabState(dataOrJqXhr, textStatus, jqXhrOrErrorString) {\n // store explicitly the contentType\n if (dataOrJqXhr.getResponseHeader && dataOrJqXhr.getResponseHeader(\"content-type\")) {\n dataOrJqXhr.contentType = dataOrJqXhr.getResponseHeader(\"content-type\");\n }\n\n // We use this when we set YASR results to avoid double JSON parsing and to enforce\n // using the modified responseJSON. We'll save responseJSON instead (no need to save both).\n delete dataOrJqXhr.response;\n\n const executedQueryTabIdx = findTabIndexByID(scope.executedQueryTab.id);\n const executedQueryTab = scope.tabs[executedQueryTabIdx];\n const queryResultState = {\n queryType: scope.currentTabConfig.queryType,\n yasrData: dataOrJqXhr,\n textStatus: textStatus,\n jqXhrOrErrorString: jqXhrOrErrorString,\n page: scope.currentTabConfig.page,\n pageSize: scope.currentTabConfig.pageSize,\n allResultsCount: scope.currentTabConfig.allResultsCount,\n allResultsCountExact: scope.currentTabConfig.allResultsCountExact,\n resultsCount: scope.currentTabConfig.resultsCount,\n offset: scope.currentTabConfig.offset,\n timeTook: scope.currentTabConfig.timeTook,\n timeFinished: scope.currentTabConfig.timeFinished,\n sizeDelta: scope.currentTabConfig.sizeDelta,\n customUpdateMessage: scope.currentTabConfig.customUpdateMessage,\n errorMessage: scope.currentTabConfig.errorMessage,\n warningMessage: scope.currentTabConfig.warningMessage\n };\n\n // Save the output type only if it isn't an update or an ask query.\n // This way we preserve the existing output type when we execute an update and then\n // execute a non-ask query.\n if (scope.currentTabConfig.queryType !== \"ERROR\" && scope.currentTabConfig.queryType !== \"UPDATE\"\n && scope.currentTabConfig.queryType !== \"ASK\") {\n queryResultState.outputType = scope.yasr.options.output;\n }\n\n // merge query results state with the tab object\n angular.extend(scope.currentQuery, queryResultState);\n\n angular.extend(executedQueryTab, queryResultState);\n if (!scope.nostorage) {\n LocalStorageAdapter.set(LSKeys.TABS_STATE, scope.tabs);\n }\n $('a[data-id = \"' + scope.executedQueryTab.id + '\"]').tab('show');\n }\n\n function initYasr() {\n yasr = YASR(document.getElementById(\"yasr\"), { // eslint-disable-line new-cap\n getUsedPrefixes: {}, // initially blank, populated when we fetch the namespaces\n persistency: false\n });\n window.yasr = yasr;\n yasr.afterCopy = afterCopy;\n yasr.getQueryResultsAsFormat = function (downloadFormat) {\n // Simple cross-browser download with a form\n const $wbDownload = $('#wb-download');\n $wbDownload.attr('action', 'repositories/' + $repositories.getActiveRepository());\n $('#wb-download-query').val(scope.currentQuery.query);\n if (window.editor.getValue() !== scope.currentQuery.query) {\n toastr.warning('The query in your editor does not match the query results. Download will save the results from the last executed query.');\n }\n $('#wb-download-infer').val(scope.currentQuery.inference);\n $('#wb-download-sameAs').val(scope.currentQuery.sameAs);\n const auth = localStorage.getItem('com.ontotext.graphdb.auth');\n if (auth) {\n $('#wb-auth-token').val(auth);\n }\n $('#wb-download-accept').val(downloadFormat);\n $wbDownload.submit();\n };\n window.editor.options.sparql.handlers.complete = function (dataOrJqXhr, textStatus, jqXhrOrErrorString) {\n function setNewTabStateForThis() {\n setNewTabState(dataOrJqXhr, textStatus, jqXhrOrErrorString);\n }\n\n if (connectorProgressModal) {\n connectorProgressModal.dismiss('cancel');\n }\n\n // If yasqe was destroyed when scope was destroyed, do nothing\n if (null === window.editor) {\n scope.setLoader(false);\n\n return;\n }\n\n // Extra error/warning through headers\n scope.currentTabConfig.errorMessage = dataOrJqXhr.getResponseHeader('X-GraphDB-Error');\n scope.currentTabConfig.warningMessage = dataOrJqXhr.getResponseHeader('X-GraphDB-Warning');\n\n yasr.currentQuery = scope.currentQuery;\n\n scope.currentTabConfig.timeFinished = Date.now();\n scope.currentTabConfig.timeTook = (scope.currentTabConfig.timeFinished - scope.queryStartTime) / 1000;\n\n if (dataOrJqXhr.status >= 400) {\n // Removes useless com.blah.whatever.FooException: ... from the error message\n dataOrJqXhr.responseText = dataOrJqXhr.responseText.replace(/^([^: ]+: )+/, '');\n\n scope.currentTabConfig.queryType = 'ERROR';\n setNewTabStateForThis();\n scope.setYasrResponse(dataOrJqXhr, textStatus, jqXhrOrErrorString);\n\n scope.setLoader(false);\n\n return;\n }\n\n if (dataOrJqXhr.status === 0) {\n // Query was aborted, typically through window.editor.xhr.abort()\n\n scope.currentTabConfig.queryType = 'ERROR';\n\n const customError = createCustomError(-1, 'Request was aborted', 'The request has been aborted. There are no results to show.');\n\n yasr.results = {\n getException: function () {\n return customError;\n }\n };\n\n scope.setLoader(false);\n\n setNewTabState({customError: customError}, '', null);\n\n return;\n }\n\n scope.setLoader(false);\n\n let updateResultsCallback;\n\n if (window.editor.getQueryMode() === \"update\") {\n updateResultsCallback = function () {\n RDF4JRepositoriesRestService.getRepositorySize()\n .success(function (data) {\n let repoSizeDiff;\n if (scope.repoSize !== undefined) {\n repoSizeDiff = Number(data) - scope.repoSize;\n }\n scope.currentTabConfig.sizeDelta = repoSizeDiff;\n setNewTabStateForThis();\n }).error(function (data) {\n toastr.warning('Could not get repository size for: ' + scope.getActiveRepository() + '; ' + getError(data));\n scope.currentTabConfig.sizeDelta = undefined;\n setNewTabStateForThis();\n });\n };\n } else {\n if (dataOrJqXhr.status === 200) {\n const contentType = dataOrJqXhr.getResponseHeader('Content-Type');\n\n if (contentType.indexOf('application/sparql-results+json') === 0\n || contentType.indexOf('application/x-sparqlstar-results+json') === 0\n || contentType.indexOf('application/x-graphdb-table-results+json') === 0) {\n if (dataOrJqXhr.responseJSON.results) {\n // SELECT results in one of the standard formats or\n // CONSTRUCT or DESCRIBE results in our custom format that looks\n // like a SELECT result.\n scope.currentTabConfig.resultsCount = dataOrJqXhr.responseJSON.results.bindings.length;\n if (dataOrJqXhr.responseJSON.results.bindings.length > scope.currentTabConfig.pageSize) {\n // The results are more than the page size (because we request +1), truncate to page size\n // and raise flag to know we have at least one page more.\n dataOrJqXhr.responseJSON.results.bindings.length = scope.currentTabConfig.pageSize;\n }\n if (!scope.currentTabConfig.allResultsCountExact) {\n if (scope.nocount || scope.countTimeouted\n || scope.currentTabConfig.resultsCount <= scope.currentTabConfig.pageSize) {\n // No count requested or count timed out or the results are less than the pageSize + 1 buffer\n // In all of these cases it doesn't make sense to run\n // the counting query so we tweak the status to signal that to YASQE.\n dataOrJqXhr.status = 204; // 204 is no content, YASQE counts only if status is 200\n }\n\n // Calculate an \"at least\" all results count, i.e. at least what we have until now + 1.\n // The number will increase when we go to the next page eventually reaching the exact count.\n // A count query may also provide the exact count asynchronously.\n scope.currentTabConfig.allResultsCount = Math.max(scope.currentTabConfig.allResultsCount,\n scope.currentTabConfig.pageSize * (scope.currentTabConfig.page - 1) + scope.currentTabConfig.resultsCount);\n\n // We know we reached the end and the count is exact now.\n if (scope.currentTabConfig.resultsCount <= scope.currentTabConfig.pageSize) {\n scope.currentTabConfig.allResultsCountExact = true;\n }\n }\n }\n }\n }\n\n // The following long-running code needs to be in timeout to get the updated loader message\n scope.setLoader(true, 'Rendering results', null, true);\n\n updateResultsCallback = function () {\n scope.setYasrResponse(dataOrJqXhr, textStatus, jqXhrOrErrorString);\n\n setNewTabStateForThis();\n scope.setLoader(false);\n };\n }\n\n // By having this in timeout we manage to get the updated loader message\n $timeout(function () {\n updateResultsCallback();\n\n // Move disabled class to a, and clean from the li\n if (window.editor.getQueryType() !== \"CONSTRUCT\") {\n $('.yasr_btnGroup.nav.nav-tabs li a.disabled').removeClass('disabled').css('font-weight', '400');\n $('.yasr_btnGroup.nav.nav-tabs li.disabled a').addClass('disabled').css('font-weight', '200');\n if (window.editor.getQueryType() === \"DESCRIBE\") {\n $('.yasr_btnGroup.nav.nav-tabs li a').removeClass('disabled').css('font-weight', '400');\n }\n } else if (window.editor.getQueryType() === \"CONSTRUCT\") {\n $('.yasr_btnGroup.nav.nav-tabs li a.disabled').removeClass('disabled').css('font-weight', '400');\n }\n\n\n //Remove paddign of yasr so it will be aligned with sparql editor\n $('#yasr').css('padding', '0');\n\n if ($('.yasr_btnGroup li:nth-child(2)').hasClass(\"active\")) {\n $timeout(function () {\n $('.yasr_btnGroup li:nth-child(2) a').get(0).click();\n }, 100);\n }\n\n //\n $('#wb-sparql-addNewTab').click(function () {\n $('.dataTables_filter').hide();\n $('.resultsTable').hide();\n });\n }, 100);\n };\n\n window.editor.options.sparql.handlers.resetResults = function () {\n };\n\n scope.yasr = yasr;\n\n scope.setYasrResponse = function(dataOrJqXhr, textStatus, jqXhrOrErrorString) {\n // If YASR doesn't see a \"response\" property it will parse the textual JSON in \"responseText\".\n // This is both slow and interferes with the +1 result per page policy when we truncate responseJSON.\n if (dataOrJqXhr.responseJSON) {\n dataOrJqXhr.response = dataOrJqXhr.responseJSON;\n dataOrJqXhr.responseText = undefined;\n }\n window.yasr.plugins.table.options.highlightLiteralCellResult = highlightExplainPlan;\n yasr.setResponse(dataOrJqXhr, textStatus, jqXhrOrErrorString);\n };\n\n // Track changes in the output type (tab in yasr) so that we can save this together with\n // the rest of the tab's data.\n scope.$watch('yasr.options.output', function (value) {\n // Save the output type only if it isn't an update or an ask query (see comment where we save all properties).\n if (value && scope.currentTabConfig.queryType !== \"UPDATE\" && scope.currentTabConfig.queryType !== \"ASK\") {\n const tab = scope.tabs[findTabIndexByID(scope.currentQuery.id)];\n // Do not save tab on default yasr initalization since default table overrides saved value\n if (angular.isDefined(tab) && scope.currentTabConfig.queryType) {\n if (tab.outputType !== value) {\n tab.outputType = scope.currentQuery.outputType = value;\n scope.saveTab(tab.id);\n }\n }\n }\n });\n\n scope.$watch('namespaces', function () {\n if (scope.namespaces) {\n if (yasr && yasr.options && scope.namespaces) {\n // this way, the URLs in the results are prettified using the defined prefixes\n yasr.options.getUsedPrefixes = scope.namespaces;\n }\n\n // Notify YASQE about the new namespaces\n YASQE.signal(window.editor, 'namespacesChanged', scope.namespaces);\n }\n });\n }\n\n initYasr();\n\n function changePagination() {\n scope.runQuery(true, scope.explainRequested);\n }\n\n function highlightExplainPlan() {\n var bindings = yasr.results.getBindings();\n var vars = yasr.results.getVariables();\n var singleBinding = bindings[0];\n var planVar = vars[0];\n if (vars.length === 1 && bindings.length === 1 && planVar === \"plan\" && singleBinding[planVar].value.includes(\"# NOTE: Optimization groups\")) {\n var queryResultElement = document.getElementsByClassName('nonUri')[0];\n queryResultElement.classList.add(\"cm-s-default\");\n queryResultElement.setAttribute(\"id\", \"highlighted_output\");\n var queryResultValue = queryResultElement.innerText.substring(1, queryResultElement.innerText.length - 1);\n queryResultElement.innerHTML = \"\";\n YASQE.runMode(queryResultValue, \"sparql11\", document.getElementById(\"highlighted_output\"));\n }\n }\n\n // Hide the sample queries when the user clicks somewhere else in the UI.\n $(document).mouseup(function (event) {\n const container = $('#sampleQueriesCollapse');\n if (!container.is(event.target) // if the target of the click isn't the container..\n && container.has(event.target).length === 0 //... nor a descendant of the container\n && scope.showSampleQueries) {\n scope.toggleSampleQueries();\n }\n });\n\n function findTabIndexByID(id) {\n for (let i = 0; i < scope.tabs.length; i++) {\n const tab = scope.tabs[i];\n if (tab.id === id) {\n return i;\n }\n }\n }\n\n // functions to load query param or saved queries\n function toBoolean(v) {\n return angular.isDefined(v) && v !== 'false';\n }\n\n function autoexecuteQueryIfRequested() {\n const isRequested = toBoolean($location.search().execute);\n\n if (isRequested) {\n if (window.editor.getQueryMode() === 'update') {\n ModalService.openSimpleModal({\n title: 'Confirm execute',\n message: 'This is an update and it may change the data in the repository.<br>Are you sure you want to execute it automatically?',\n warning: true\n }).result\n .then(function () {\n scope.runQuery(false);\n });\n } else {\n scope.runQuery(false);\n }\n }\n }\n\n function loadQueryIntoExistingOrNewTab(query, infer, sameAs) {\n const tabId = scope.getExistingTabId(query);\n // Ah, the joys of non-synchronous events\n const onHandler = scope.$on('tabLoaded', function () {\n if (angular.isDefined(infer)) {\n scope.currentQuery.inference = toBoolean(infer);\n }\n if (angular.isDefined(sameAs)) {\n scope.currentQuery.sameAs = toBoolean(sameAs);\n }\n autoexecuteQueryIfRequested();\n onHandler();\n });\n\n // See comment about this flag in controller. It's a good idea to be consistent and do this\n // every time a tab changes without the user clicking on it.\n scope.highlightNextTabChange = true;\n\n if (!angular.isDefined(tabId)) {\n scope.addNewTab(null, query.name, query.body);\n } else {\n selectTab(tabId);\n }\n }\n\n function loadSavedQueryIntoExistingOrNewTab(savedQueryName, owner, infer, sameAs) {\n SparqlRestService.getSavedQuery(savedQueryName, owner)\n .success(function (data) {\n loadQueryIntoExistingOrNewTab(data, infer, sameAs);\n })\n .error(function (data) {\n toastr.error('Could not get data for saved query: ' + savedQueryName + '; ' + getError(data));\n });\n }\n\n function addTabWithQueryIfNeeded() {\n if ($location.search().savedQueryName) {\n // new way\n loadSavedQueryIntoExistingOrNewTab($location.search().savedQueryName, $location.search().owner,\n $location.search().infer, $location.search().sameAs);\n } else if ($location.search().query) {\n const query = {name: $location.search().name, body: $location.search().query};\n loadQueryIntoExistingOrNewTab(query, $location.search().infer, $location.search().sameAs);\n } else {\n // Restore the previous tab after the dom has loaded\n const currentid = LocalStorageAdapter.get(LSKeys.TABS_STATE_CURRENT_ID);\n selectTab(currentid);\n }\n }\n\n function updateRepositoryAndSecurity() {\n scope.getNamespaces();\n YASQE.signal(window.editor, \"repositoryOrAuthorizationChanged\",\n $repositories.getActiveRepository(), $jwtAuth.getAuthToken());\n addTabWithQueryIfNeeded();\n }\n\n if ($repositories.getActiveRepository()) {\n updateRepositoryAndSecurity();\n }\n\n // When no repo is selected (editor hidden) and the user selects a repo the SPARQL params should be handled\n scope.$on('repositoryIsSet', function () {\n if ($repositories.getActiveRepository()) {\n updateRepositoryAndSecurity();\n }\n });\n // end of repository actions\n\n // focus the editor\n $timeout(function () {\n angular.element(document).find('.CodeMirror textarea:first-child').focus();\n }, 50);\n\n }\n}\n"],"sourceRoot":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["webpack:///./src/js/angular/autocomplete/controllers.js","webpack:///./src/js/angular/autocomplete/app.js"],"names":["AutocompleteCtrl","$scope","$interval","toastr","$repositories","$modal","$timeout","AutocompleteRestService","$autocompleteStatus","timer","cancelTimer","cancel","pluginName","setPluginIsActive","isPluginActive","pluginIsActive","refreshEnabledStatus","checkAutocompleteStatus","success","data","autocompleteEnabled","setAutocompleteStatus","error","getError","refreshIndexIRIs","shouldIndexIRIs","refreshIndexStatus","indexStatus","refreshLabelConfig","labelConfig","checkForPlugin","pluginFound","setLoader","loading","finally","pullStatus","$broadcast","$on","loader","message","loaderTimeout","loaderMessage","getLoaderMessage","toggleAutocomplete","newValue","toggleIndexIRIs","buildIndex","interruptIndexing","getDegradedReason","addLabel","editLabel","labelIri","languages","label","isNew","open","templateUrl","controller","resolve","result","then","addLabelConfig","removeLabel","removeLabelConfig","getActiveRepository","isActiveRepoOntopType","isActiveRepoFedXType","AddLabelCtrl","$modalInstance","angular","copy","ok","form","$valid","close","dismiss","setTemplate","iri","$","focus","module","$inject"],"mappings":"6FAAA,aAcA,SAASA,EAAiBC,EAAQC,EAAWC,EAAQC,EAAeC,EAAQC,EAAUC,EAAyBC,GAE3G,IAAIC,EAEJ,SAASC,IACDD,GACAP,EAAUS,OAAOF,GAIzBR,EAAOW,WAAa,eAEpBX,EAAOY,kBAAoB,SAAUC,GACjCb,EAAOc,eAAiBD,GAG5B,MAAME,EAAuB,WACzBT,EAAwBU,0BACnBC,SAAQ,SAAUC,GACflB,EAAOmB,oBAAsBD,EAC7BX,EAAoBa,sBAAsBF,MAC3CG,OAAM,SAAUH,GACfhB,EAAOmB,MAAMC,SAASJ,QAI5BK,EAAmB,WACrBjB,EAAwBiB,mBACnBN,SAAQ,SAAUC,GACflB,EAAOwB,gBAAkBN,KAC1BG,OAAM,SAAUH,GACfhB,EAAOmB,MA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ACfhB,EAAOmB,MAAMC,SAASJ,OACvBe,SAAQ,WACPjC,EAAO+B,WAAU,MAsJzB+B,CAAkBV,IAGtBpD,EAAOoC,IAAI,mBAAmB,WAC1B3B,KACKN,EAAc4D,uBACX5D,EAAc6D,yBACV7D,EAAc8D,yBAG1BjE,EAAO6B,iBACPK,SAvHK/B,EAAc4D,uBACX5D,EAAc6D,yBACV7D,EAAc8D,yBAG1BjE,EAAO6B,iBACPK,KAyHR,SAASgC,EAAalE,EAAQmE,EAAgB9D,EAAUa,GACpDlB,EAAOoD,MAAQgB,QAAQC,KAAKnD,EAAKkC,OACjCpD,EAAOqD,MAAQnC,EAAKmC,MAEpBrD,EAAOsE,GAAK,WACJtE,EAAOuE,KAAKC,QACZL,EAAeM,MAAMzE,EAAOoD,QAIpCpD,EAAOU,OAAS,WACZyD,EAAeO,QAAQ,WAG3B1E,EAAO2E,YAAc,SAAUC,GAC3B5E,EAAOoD,MAAMF,SAAW0B,EACxBvE,GAAS,WACLwE,EAAE,8BAA8BC,UACjC,IAhRXV,QACKW,OAAO,6CANI,CACZ,SACA,gDAKCvB,WAAW,mBAAoBzD,GAC/ByD,WAAW,eAAgBU,GAEhCnE,EAAiBiF,QAAU,CAAC,SAAU,YAAa,SAAU,gBAAiB,SAAU,WAAY,0BAA2B,uBAuP/Hd,EAAac,QAAU,CAAC,SAAU,iBAAkB,WAAY,S,gCCnQhE,aAOAZ,QAAQW,OAAO,iCALC,CACZ,UACA","file":"32.ba5b5ca3e4b7dcf5bd15.bundle.js","sourcesContent":["import 'angular/rest/autocomplete.rest.service';\n\nconst modules = [\n 'toastr',\n 'graphdb.framework.rest.autocomplete.service'\n];\n\nangular\n .module('graphdb.framework.autocomplete.controllers', modules)\n .controller('AutocompleteCtrl', AutocompleteCtrl)\n .controller('AddLabelCtrl', AddLabelCtrl);\n\nAutocompleteCtrl.$inject = ['$scope', '$interval', 'toastr', '$repositories', '$modal', '$timeout', 'AutocompleteRestService', '$autocompleteStatus'];\n\nfunction AutocompleteCtrl($scope, $interval, toastr, $repositories, $modal, $timeout, AutocompleteRestService, $autocompleteStatus) {\n\n let timer;\n\n function cancelTimer() {\n if (timer) {\n $interval.cancel(timer);\n }\n }\n\n $scope.pluginName = 'autocomplete';\n\n $scope.setPluginIsActive = function (isPluginActive) {\n $scope.pluginIsActive = isPluginActive;\n }\n\n const refreshEnabledStatus = function () {\n AutocompleteRestService.checkAutocompleteStatus()\n .success(function (data) {\n $scope.autocompleteEnabled = data;\n $autocompleteStatus.setAutocompleteStatus(data);\n }).error(function (data) {\n toastr.error(getError(data));\n });\n };\n\n const refreshIndexIRIs = function () {\n AutocompleteRestService.refreshIndexIRIs()\n .success(function (data) {\n $scope.shouldIndexIRIs = data;\n }).error(function (data) {\n toastr.error(getError(data));\n });\n };\n\n const refreshIndexStatus = function () {\n AutocompleteRestService.refreshIndexStatus()\n .success(function (data) {\n $scope.indexStatus = data;\n })\n .error(function (data) {\n toastr.error(getError(data));\n });\n };\n\n const refreshLabelConfig = function () {\n AutocompleteRestService.refreshLabelConfig()\n .success(function (data) {\n $scope.labelConfig = data;\n }).error(function (data) {\n toastr.error(getError(data));\n });\n };\n\n const addLabelConfig = function (label) {\n $scope.setLoader(true, 'Updating label config...');\n\n AutocompleteRestService.addLabelConfig(label)\n .success(function () {\n refreshLabelConfig();\n refreshIndexStatus();\n }).error(function (data) {\n toastr.error(getError(data));\n }).finally(function () {\n $scope.setLoader(false);\n });\n };\n\n const removeLabelConfig = function (label) {\n $scope.setLoader(true, 'Updating label config...');\n\n AutocompleteRestService.removeLabelConfig(label)\n .success(function () {\n refreshLabelConfig();\n refreshIndexStatus();\n }).error(function (data) {\n toastr.error(getError(data));\n }).finally(function () {\n $scope.setLoader(false);\n });\n };\n\n $scope.checkForPlugin = function () {\n $scope.pluginFound = false;\n\n $scope.setLoader(true);\n\n AutocompleteRestService.checkForPlugin()\n .success(function (data) {\n $scope.pluginFound = data === true;\n if ($scope.pluginFound) {\n refreshEnabledStatus();\n refreshIndexIRIs();\n refreshIndexStatus();\n refreshLabelConfig();\n } else {\n $scope.autocompleteEnabled = false;\n $scope.loading = false;\n }\n }).error(function (data) {\n toastr.error(getError(data));\n }).finally(function () {\n $scope.setLoader(false);\n });\n };\n\n const pullStatus = function () {\n timer = $interval(function () {\n $scope.$broadcast('checkIsActive');\n if ($scope.autocompleteEnabled) {\n refreshIndexStatus();\n }\n }, 5000);\n };\n\n $scope.$on(\"$destroy\", function () {\n cancelTimer();\n });\n\n const init = function() {\n if (!$repositories.getActiveRepository() ||\n $repositories.isActiveRepoOntopType() ||\n $repositories.isActiveRepoFedXType()) {\n return;\n }\n $scope.checkForPlugin();\n pullStatus();\n };\n\n $scope.setLoader = function (loader, message) {\n $timeout.cancel($scope.loaderTimeout);\n if (loader) {\n $scope.loaderTimeout = $timeout(function () {\n $scope.loader = loader;\n $scope.loaderMessage = message;\n }, 300);\n } else {\n $scope.loader = false;\n }\n };\n\n $scope.getLoaderMessage = function () {\n return $scope.loaderMessage || 'Loading...';\n };\n\n $scope.toggleAutocomplete = function () {\n const newValue = !$scope.autocompleteEnabled;\n $scope.setLoader(true, newValue ? 'Enabling autocomplete...' : 'Disabling autocomplete...');\n\n AutocompleteRestService.toggleAutocomplete(newValue)\n .success(function () {\n refreshEnabledStatus();\n refreshIndexStatus();\n }).error(function (data) {\n toastr.error(getError(data));\n }).finally(function () {\n $scope.setLoader(false);\n });\n };\n\n $scope.toggleIndexIRIs = function () {\n $scope.setLoader(true, 'Setting index IRIs...');\n\n AutocompleteRestService.toggleIndexIRIs(!$scope.shouldIndexIRIs)\n .success(function () {\n refreshIndexIRIs();\n refreshIndexStatus();\n }).error(function (data) {\n toastr.error(getError(data));\n }).finally(function () {\n $scope.setLoader(false);\n });\n };\n\n $scope.buildIndex = function () {\n $scope.setLoader(true, 'Requesting index build...');\n\n AutocompleteRestService.buildIndex()\n .success(function () {\n $scope.indexStatus = 'BUILDING';\n }).error(function (data) {\n toastr.error(getError(data));\n }).finally(function () {\n $scope.setLoader(false);\n });\n };\n\n $scope.interruptIndexing = function () {\n $scope.setLoader(true, 'Interrupting index...');\n\n AutocompleteRestService.interruptIndexing()\n .success(function () {\n refreshIndexStatus();\n }).error(function (data) {\n toastr.error(getError(data));\n }).finally(function () {\n $scope.setLoader(false);\n });\n };\n\n $scope.getDegradedReason = function () {\n return $repositories.getDegradedReason();\n };\n\n $scope.addLabel = function () {\n $scope.editLabel({labelIri: '', languages: ''}, true);\n };\n\n $scope.editLabel = function (label, isNew) {\n const modalInstance = $modal.open({\n templateUrl: 'js/angular/autocomplete/templates/modal/add-label.html',\n controller: 'AddLabelCtrl',\n resolve: {\n data: function () {\n return {\n label: label,\n isNew: isNew\n };\n }\n }\n });\n\n modalInstance.result.then(function (label) {\n addLabelConfig(label);\n });\n };\n\n $scope.removeLabel = function (label) {\n removeLabelConfig(label);\n };\n\n $scope.$on('repositoryIsSet', function () {\n cancelTimer();\n if (!$repositories.getActiveRepository() ||\n $repositories.isActiveRepoOntopType() ||\n $repositories.isActiveRepoFedXType()) {\n return;\n }\n $scope.checkForPlugin();\n pullStatus();\n });\n\n init();\n}\n\nAddLabelCtrl.$inject = ['$scope', '$modalInstance', '$timeout', 'data'];\n\nfunction AddLabelCtrl($scope, $modalInstance, $timeout, data) {\n $scope.label = angular.copy(data.label);\n $scope.isNew = data.isNew;\n\n $scope.ok = function () {\n if ($scope.form.$valid) {\n $modalInstance.close($scope.label);\n }\n };\n\n $scope.cancel = function () {\n $modalInstance.dismiss('cancel');\n };\n\n $scope.setTemplate = function (iri) {\n $scope.label.labelIri = iri;\n $timeout(function () {\n $('#wb-autocomplete-languages').focus();\n }, 0);\n };\n}\n","import 'angular/autocomplete/controllers';\n\nconst modules = [\n 'ngRoute',\n 'graphdb.framework.autocomplete.controllers'\n];\n\nangular.module('graphdb.framework.autocomplete', modules);\n"],"sourceRoot":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["webpack:///./src/js/angular/rest/connectors.rest.service.js","webpack:///./src/js/angular/externalsync/controllers.js"],"names":["angular","module","factory","ConnectorsRestService","$inject","CONNECTORS_ENDPOINT","$http","getConnectors","get","initConnector","prefix","hasConnector","checkConnector","data","post","headers","jsonToFormData","str","Object","keys","forEach","key","push","encodeURIComponent","join","mapCreateValuesToUiValues","values","options","i","length","option","__type","__name","j","__childOptions","child","k","valueK","hasOwnProperty","isDefined","__defaultValue","optionEl","isUndefined","map","_","value","String","toJson","_evaluateSparqlQuery","http","repository","query","buildNamePrefix","substring","createConnectorQuery","name","fields","reportError","fcopy","sortObject","obj","newObject","each","childOption","copy","arrayMap","reduce","acc","Error","fromJson","e","__label","message","removeEmptyValues","Array","isArray","filter","item","trim","finalString","replace","ConnectorsCtrl","$scope","$repositories","$modal","toastr","ModalService","$q","RDF4JRepositoriesRestService","resetProgress","repair","beingBuiltConnector","percentDone","status","processedEntities","estimatedEntities","indexedEntities","entitiesPerSecond","actionName","waitOnRepairStartOnce","eta","inline","iri","openProgressModal","$","extend","doneCallback","modalInstance","dismiss","open","templateUrl","controller","size","backdrop","scope","executeCreate","connector","errorCallback","modal","addStatements","getActiveRepository","update","then","res","existing","success","err","error","getError","finally","loader","controllers","definitions","getLoaderMessage","timeSeconds","Date","now","loaderStartTime","timeHuman","getHumanReadableSeconds","progressMessage","extraMessage","setLoader","isRunning","canWriteActiveRepo","connectors","all","connectorIris","createStatusQueryForAny","evaluateSparqlQuery","results","bindings","statusObject","JSON","parse","console","parseFirstBuildingResult","d","split","catch","getOptions","isEmpty","isObject","toPrettyJson","$watch","getActiveLocation","copyConnector","newValues","resolve","result","skipConversion","newConnector","inst","type","openSimpleModal","title","warning","delete","isExternal","indexOf","force","namePrefix","deleteConnectorQuery","viewQuery","DeleteConnectorCtrl","$modalInstance","ok","close","cancel","ExtendNewConnectorCtrl","toQuery","label","addField","index","optionName","newField","defaultValues","splice","addOption","array","deleteOption","addMapOption","deleteMapOption","form","$valid","CreateConnectorCtrl","$controller","this","CreateProgressCtrl","$interval","initProgress","statusIri","createStatusQueryForIri","progressInterval","getFirstStatusFromResult","toFixed","etaSeconds","$on","input","Math","ceil"],"mappings":"8EAAAA,QACKC,OAAO,4CAA6C,IACpDC,QAAQ,wBAAyBC,GAEtCA,EAAsBC,QAAU,CAAC,SAEjC,MAAMC,EAAsB,kBAE5B,SAASF,EAAsBG,GAE3B,MAAO,CACHC,cAMJ,WACI,OAAOD,EAAME,IAAIH,IANjBI,cASJ,SAAuBC,GACnB,OAAOJ,EAAME,IAAI,GAAGH,oBAAsCK,MAT1DC,aAYJ,SAAsBD,GAClB,OAAOJ,EAAME,IAAI,GAAGH,qBAAuCK,MAZ3DE,eAeJ,SAAwBC,GACpB,OAAOP,EAAMQ,KAAK,GAAGT,UAA6BQ,EAAM,CACpDE,QAAS,CACL,eAAgB,oB,gCChChC,mBAiBA,SAASC,EAAeH,GACpB,MAAMI,EAAM,GAIZ,OAHAC,OAAOC,KAAKN,GAAMO,SAAQ,SAAUC,GAChCJ,EAAIK,KAAKC,mBAAmBF,GAAO,IAAME,mBAAmBV,EAAKQ,QAE9DJ,EAAIO,KAAK,KAwBpB,SAASC,EAA0BC,EAAQC,GACvC,IAAK,IAAIC,EAAI,EAAGA,EAAID,EAAQE,OAAQD,IAAK,CACrC,MAAME,EAASH,EAAQC,GACvB,GAAsB,gBAAlBE,EAAOC,OACFL,EAAOI,EAAOE,UACfN,EAAOI,EAAOE,QAAU,CAAC,UAE1B,GAAsB,gBAAlBF,EAAOC,OACd,GAAKL,EAAOI,EAAOE,QAcf,IAAK,IAAIC,EAAI,EAAGA,EAAIH,EAAOI,eAAeL,OAAQI,IAAK,CACnD,MAAME,EAAQL,EAAOI,eAAeD,GACpC,GAAqB,YAAjBE,EAAMJ,OACN,IAAK,IAAIK,EAAI,EAAGA,EAAIV,EAAOI,EAAOE,QAAQH,OAAQO,IAAK,CACnD,MAAMC,EAASX,EAAOI,EAAOE,QAAQI,IAChCC,EAAOC,eAAe,CAACH,EAAMH,UAAYhC,QAA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8c8d16a8707c20a1fcb.bundle.js","sourcesContent":["angular\n .module('graphdb.framework.rest.connectors.service', [])\n .factory('ConnectorsRestService', ConnectorsRestService);\n\nConnectorsRestService.$inject = ['$http'];\n\nconst CONNECTORS_ENDPOINT = 'rest/connectors';\n\nfunction ConnectorsRestService($http) {\n\n return {\n getConnectors,\n initConnector,\n hasConnector,\n checkConnector\n };\n\n function getConnectors() {\n return $http.get(CONNECTORS_ENDPOINT);\n }\n\n function initConnector(prefix) {\n return $http.get(`${CONNECTORS_ENDPOINT}/options?prefix=${prefix}`);\n }\n\n function hasConnector(prefix) {\n return $http.get(`${CONNECTORS_ENDPOINT}/existing?prefix=${prefix}`);\n }\n\n function checkConnector(data) {\n return $http.post(`${CONNECTORS_ENDPOINT}/check`, data, {\n headers: {\n 'Content-Type': 'text/plain'\n }\n });\n }\n}\n","import 'angular/rest/rdf4j.repositories.rest.service';\nimport 'angular/rest/connectors.rest.service';\n\nconst modules = [\n 'graphdb.framework.rest.rdf4j.repositories.service',\n 'graphdb.framework.rest.connectors.service'\n];\n\nangular\n .module('graphdb.framework.externalsync.controllers', modules)\n .controller('ConnectorsCtrl', ConnectorsCtrl)\n .controller('ExtendNewConnectorCtrl', ExtendNewConnectorCtrl)\n .controller('CreateConnectorCtrl', CreateConnectorCtrl)\n .controller('CreateProgressCtrl', CreateProgressCtrl)\n .controller('DeleteConnectorCtrl', DeleteConnectorCtrl)\n .filter('ceil', ceil);\n\nfunction jsonToFormData(data) {\n const str = [];\n Object.keys(data).forEach(function (key) {\n str.push(encodeURIComponent(key) + '=' + encodeURIComponent(data[key]));\n });\n return str.join('&');\n}\n\nfunction toArrayMap(map) {\n return _.map(map, function (value, key) {\n return {key: key, value: value};\n });\n}\n\nfunction fromArrayMap(arrayMap) {\n return _.reduce(arrayMap, function (acc, value) {\n if (value.key === '' && value.value === '') {\n // empty pair, skip it\n } else if (value.key === '') {\n throw new Error('Key may not be empty with value \"' + value.value + '\"');\n } else if (acc.hasOwnProperty(value.key)) {\n throw new Error('Duplicate key ' + value.key);\n } else {\n acc[value.key] = value.value;\n }\n return acc;\n }, {});\n}\n\nfunction mapCreateValuesToUiValues(values, options) {\n for (let i = 0; i < options.length; i++) {\n const option = options[i];\n if (option.__type === 'StringArray') {\n if (!values[option.__name]) {\n values[option.__name] = [''];\n }\n } else if (option.__type === 'OptionArray') {\n if (!values[option.__name]) { // values has no entry for this option\n values[option.__name] = [];\n const optionEl = {};\n for (let j = 0; j < option.__childOptions.length; j++) {\n const child = option.__childOptions[j];\n if (child.__type === 'StringArray') {\n optionEl[child.__name] = [''];\n } else {\n optionEl[child.__name] = (!angular.isUndefined(child.__defaultValue) ? child.__defaultValue : '');\n }\n }\n values[option.__name].push(optionEl);\n } else { // values already has en entry for this option\n // Copies the default value for Boolean child options if no explicit value is set\n for (let j = 0; j < option.__childOptions.length; j++) {\n const child = option.__childOptions[j];\n if (child.__type === 'Boolean') {\n for (let k = 0; k < values[option.__name].length; k++) {\n const valueK = values[option.__name][k];\n if (!valueK.hasOwnProperty([child.__name]) && angular.isDefined(child.__defaultValue)) {\n valueK[child.__name] = child.__defaultValue;\n }\n }\n }\n }\n }\n } else if (option.__type === 'Map') {\n if (!values[option.__name]) {\n values[option.__name] = [];\n } else {\n values[option.__name] = toArrayMap(values[option.__name]);\n }\n } else if (option.__type === 'JsonString') {\n if (values[option.__name] && !(values[option.__name] instanceof String) && typeof values[option.__name] !== 'string') {\n values[option.__name] = angular.toJson(values[option.__name], 2);\n }\n } else {\n if (angular.isUndefined(values[option.__name])) {\n values[option.__name] = (!angular.isUndefined(option.__defaultValue) ? option.__defaultValue : '');\n }\n }\n }\n\n return values;\n}\n\nfunction _evaluateSparqlQuery(http, repository, query) {\n return http.post('repositories/' + repository, jsonToFormData({query: query}),\n {\n headers: {\n 'Content-Type': 'application/x-www-form-urlencoded',\n 'Accept': 'application/sparql-results+json',\n 'X-GraphDB-Local-Consistency': 'updating'\n }\n });\n}\n\nfunction buildNamePrefix(prefix) {\n return prefix.substring(0, prefix.length - 1) + '/instance#';\n}\n\nfunction createConnectorQuery(name, prefix, fields, options, reportError) {\n // Returns a copy of the parameter obj sorted according to the order in options\n function sortObject(obj, options) {\n const newObject = {};\n _.each(options, function (option) {\n if (angular.isDefined(obj[option.__name])) {\n if (option.__type === 'OptionArray') {\n newObject[option.__name] = [];\n _.each(obj[option.__name], function (childOption) {\n newObject[option.__name].push(sortObject(childOption, option.__childOptions));\n });\n } else {\n newObject[option.__name] = angular.copy(obj[option.__name]);\n }\n }\n });\n return newObject;\n }\n\n const fcopy = sortObject(fields, options);\n\n for (let i = 0; i < options.length; i++) {\n try {\n if (options[i].__type === 'Map') {\n fcopy[options[i].__name] = fromArrayMap(fcopy[options[i].__name]);\n } else if (options[i].__type === 'JsonString') {\n fcopy[options[i].__name] = angular.fromJson(fcopy[options[i].__name]);\n }\n } catch (e) {\n reportError(options[i].__label, e.message);\n return null;\n }\n }\n\n removeEmptyValues(fcopy);\n //escapeValues(fields);\n let finalString = '';\n finalString += 'PREFIX :<' + prefix + '>\\n';\n const namePrefix = buildNamePrefix(prefix);\n finalString += 'PREFIX inst:<' + namePrefix + '>\\n';\n finalString += 'INSERT DATA {\\n';\n finalString += \"\\tinst:\" + name + \" :createConnector '''\\n\"; // eslint-disable-line quotes\n finalString += angular.toJson(fcopy, 2);\n finalString += \"\\n''' .\\n}\\n\"; // eslint-disable-line quotes\n finalString = finalString.replace(/\\\\/g, '\\\\\\\\\\\\');\n return finalString;\n}\n\nfunction createStatusQueryForIri(iri) {\n const statusIri = iri.replace(/\\/instance#.+$/, '#connectorStatus');\n let finalString = '';\n finalString += 'SELECT ?status {\\n';\n finalString += '\\t<' + iri + '> <' + statusIri + '> ?status';\n finalString += '\\n}';\n return finalString;\n}\n\nfunction createStatusQueryForAny(connectors) {\n const connectorIris = _.map(connectors,\n function (k) {\n return '<' + k.value + 'connectorStatus' + '>';\n }).join('|');\n\n if (connectorIris) {\n return 'SELECT ?connector ?status { ?connector ' + connectorIris + ' ?status }';\n }\n\n return null;\n}\n\nfunction repairConnectorQuery(name, prefix) {\n const namePrefix = buildNamePrefix(prefix);\n return 'PREFIX prefix:<' + prefix + '>\\n' +\n 'INSERT DATA {\\n' +\n '\\t<' + namePrefix + name + '> prefix:repairConnector \"\"\\n' +\n '}';\n}\n\nfunction deleteConnectorQuery(name, prefix, force) {\n const namePrefix = prefix.substring(0, prefix.length - 1) + \"/instance#\";\n return 'PREFIX prefix:<' + prefix + '>\\n' +\n 'INSERT DATA {\\n' +\n '\\t<' + namePrefix + name + '> prefix:dropConnector \"' + (force ? \"force\" : \"\") + '\"\\n' +\n '}';\n}\n\nfunction removeEmptyValues(data) {\n // remove empty values from array\n if (Array.isArray(data)) {\n data = _.filter(data, function (item) {\n return item !== null && (!item.trim || item.trim() !== '');\n });\n }\n // remove empty values from object values\n Object.keys(data).forEach(function (key) {\n if ((data[key] === '' || data[key] == null) && data[key] !== false) {\n delete data[key];\n } else if (typeof data[key] === 'object') {\n data[key] = removeEmptyValues(data[key]);\n }\n });\n return data;\n}\n\nfunction parseFirstBuildingResult(results) {\n if (results.bindings) {\n for (let i = 0; i < results.bindings.length; i++) {\n try {\n const statusObject = JSON.parse(results.bindings[i].status.value);\n if (statusObject.status === 'BUILDING') {\n return {\n connector: results.bindings[i].connector.value,\n status: statusObject\n };\n }\n } catch (e) {\n console.error(e); // eslint-disable-line no-console\n }\n }\n }\n\n return {};\n}\n\nConnectorsCtrl.$inject = ['$scope', '$http', '$repositories', '$modal', 'toastr', 'ModalService', '$q', 'RDF4JRepositoriesRestService', 'ConnectorsRestService'];\n\nfunction ConnectorsCtrl($scope, $http, $repositories, $modal, toastr, ModalService, $q, RDF4JRepositoriesRestService, ConnectorsRestService) {\n $scope.loader = false;\n\n $scope.controllers = [];\n\n $scope.existing = {};\n\n $scope.definitions = {};\n\n $scope.getLoaderMessage = function () {\n const timeSeconds = (Date.now() - $scope.loaderStartTime) / 1000;\n const timeHuman = $scope.getHumanReadableSeconds(timeSeconds);\n let message = '';\n if ($scope.progressMessage) {\n message = $scope.progressMessage + '... ' + timeHuman;\n } else {\n message = 'Running operation...' + timeHuman;\n }\n if ($scope.extraMessage && timeSeconds > 10) {\n message += '\\n' + $scope.extraMessage;\n }\n\n return message;\n };\n\n $scope.setLoader = function (isRunning, progressMessage, extraMessage) {\n if (isRunning) {\n $scope.loader = true;\n $scope.loaderStartTime = Date.now();\n $scope.progressMessage = progressMessage;\n $scope.extraMessage = extraMessage;\n } else {\n $scope.loader = false;\n $scope.progressMessage = '';\n $scope.extraMessage = '';\n }\n };\n\n $scope.initConnector = function (connector) {\n return ConnectorsRestService.initConnector(encodeURIComponent(connector.value))\n .then(function (res) {\n $scope.definitions[connector.key] = res.data;\n\n return ConnectorsRestService.hasConnector(encodeURIComponent(connector.value))\n .then(function (res) {\n $scope.existing[connector.key] = res.data;\n\n });\n });\n };\n\n $scope.getConnectors = function () {\n if (!$scope.canWriteActiveRepo()) {\n return;\n }\n\n $scope.setLoader(true, 'Fetching connectors', 'Normally this is a fast operation but it may take longer if a bigger repository needs to be initialised first.');\n\n ConnectorsRestService.getConnectors()\n .then(function (res) {\n $scope.connectors = Object.keys(res.data).map(function (key) {\n return {key: key, value: res.data[key]};\n });\n\n $q.all(_.map($scope.connectors, function (connector) {\n return $scope.initConnector(connector);\n })).finally(function () {\n resetProgress();\n\n const query = createStatusQueryForAny($scope.connectors);\n\n if (query) {\n evaluateSparqlQuery(query)\n .then(function (res) {\n const status = parseFirstBuildingResult(res.data.results);\n if (status.connector) {\n // has a building connector, open progress indicator\n const d = status.connector.split(/#/);\n d[0] = d[0].replace(/\\/instance$/, '#');\n showProgress(d[0], d[1]);\n }\n })\n .finally(function () {\n $scope.setLoader(false);\n });\n } else {\n $scope.setLoader(false);\n }\n });\n }).catch(function (e) {\n $scope.setLoader(false);\n toastr.error(getError(e), 'Could not get connectors');\n });\n\n $scope.existing = {};\n };\n\n $scope.getOptions = function (connector) {\n return $scope.definitions[connector.key];\n };\n\n $scope.isEmpty = function (value) {\n return angular.isObject(value) && Object.keys(value).length === 0;\n };\n\n $scope.toPrettyJson = function (value) {\n return angular.toJson(value, 2);\n };\n\n $scope.$watch(function () {\n return $repositories.getActiveRepository();\n }, $scope.getConnectors);\n\n $scope.$watch(function () {\n return $repositories.getActiveLocation();\n }, $scope.getConnectors);\n\n function evaluateSparqlQuery(query) {\n return _evaluateSparqlQuery($http, $repositories.getActiveRepository(), query);\n }\n\n function resetProgress(repair) {\n $scope.beingBuiltConnector = {\n percentDone: 0,\n status: {\n processedEntities: 0,\n estimatedEntities: 0,\n indexedEntities: 0,\n entitiesPerSecond: 0\n },\n actionName: repair ? 'Repairing' : 'Creating',\n waitOnRepairStartOnce: !!repair,\n eta: '-',\n inline: false,\n iri: null\n };\n }\n\n function openProgressModal(prefix, name, repair) {\n resetProgress(repair);\n\n $.extend($scope.beingBuiltConnector, {\n iri: buildNamePrefix(prefix) + name,\n name: name,\n inline: false,\n doneCallback: function () {\n $scope.beingBuiltConnector.modalInstance.dismiss('cancel');\n }\n });\n\n $scope.beingBuiltConnector.modalInstance = $modal.open({\n templateUrl: 'pages/connectorProgress.html',\n controller: 'CreateProgressCtrl',\n size: 'lg',\n backdrop: 'static',\n scope: $scope\n });\n\n return $scope.beingBuiltConnector.modalInstance;\n }\n\n function showProgress(prefix, name) {\n resetProgress();\n\n $.extend($scope.beingBuiltConnector, {\n iri: buildNamePrefix(prefix) + name,\n name: name,\n inline: true,\n doneCallback: function () {\n $scope.beingBuiltConnector.inline = false;\n }\n });\n }\n\n function executeCreate(connector, obj, errorCallback) {\n const modal = openProgressModal(connector.value, obj.name, false);\n RDF4JRepositoriesRestService.addStatements($repositories.getActiveRepository(), jsonToFormData({update: obj.query}))\n .then(function () {\n ConnectorsRestService.getConnectors().then(function () {\n ConnectorsRestService.hasConnector(encodeURIComponent(connector.value)).then(function (res) {\n $scope.existing[connector.key] = res.data;\n });\n });\n toastr.success('Created connector ' + obj.name);\n }, function (err) {\n toastr.error(getError(err));\n errorCallback();\n }).finally(function () {\n modal.dismiss('cancel');\n });\n }\n\n $scope.copyConnector = function (connector, values) {\n let newValues;\n if (!angular.isUndefined(values)) {\n newValues = angular.copy(values);\n newValues.name = newValues.name + '-copy';\n }\n const modal = $modal.open({\n templateUrl: 'pages/createConnector.html',\n controller: 'CreateConnectorCtrl',\n size: 'lg',\n backdrop: 'static',\n resolve: {\n connector: function () {\n return connector;\n },\n values: function () {\n return angular.isUndefined(newValues) ? {name: '', values: {}} : newValues;\n },\n options: function () {\n return $scope.getOptions(connector);\n }\n }\n });\n\n modal.result.then(function (obj) {\n executeCreate(connector, obj, function () {\n obj.skipConversion = true;\n $scope.newConnector(connector, obj);\n });\n });\n };\n\n $scope.newConnector = function (connector, values) {\n const modal = $modal.open({\n templateUrl: 'pages/createConnector.html',\n controller: 'CreateConnectorCtrl',\n size: 'lg',\n backdrop: 'static',\n resolve: {\n connector: function () {\n return connector;\n },\n values: function () {\n return angular.isUndefined(values) ? {name: '', values: {}} : values;\n },\n options: function () {\n return $scope.getOptions(connector);\n }\n }\n });\n\n modal.result.then(function (obj) {\n executeCreate(connector, obj, function () {\n obj.skipConversion = true;\n $scope.newConnector(connector, obj);\n });\n });\n };\n\n $scope.repair = function (inst, type) {\n ModalService.openSimpleModal({\n title: 'Confirm repair',\n message: 'Are you sure you want to repair this connector?<br>Note that repair means delete + recreate with the same settings.',\n warning: true\n }).result\n .then(function () {\n const modal = openProgressModal(type.value, inst.name, true);\n\n const query = repairConnectorQuery(inst.name, type.value);\n\n RDF4JRepositoriesRestService.addStatements($repositories.getActiveRepository(), jsonToFormData({update: query}))\n .then(function () {\n ConnectorsRestService.getConnectors().then(function () {\n ConnectorsRestService.hasConnector(encodeURIComponent(type.value)).then(function (res) {\n $scope.existing[type.key] = res.data;\n });\n });\n toastr.success('Repaired connector ' + inst.name);\n }, function (err) {\n toastr.error(getError(err));\n }).finally(function () {\n modal.dismiss('cancel');\n });\n });\n };\n\n $scope.delete = function (inst, type) {\n const isExternal = type.key.indexOf(\"Elastic\") >= 0 || type.key.indexOf(\"Solr\") >= 0;\n\n $modal.open({\n templateUrl: 'js/angular/externalsync/templates/deleteConnector.html',\n controller: 'DeleteConnectorCtrl',\n resolve: {\n type: function () {\n return type.key;\n },\n isExternal: function () {\n return isExternal;\n }\n }\n }).result\n .then(function(force) {\n $scope.setLoader(true, 'Deleting connector ' + inst.name, 'This is usually a fast operation but it might take a while.');\n\n const query = deleteConnectorQuery(inst.name, type.value, force);\n RDF4JRepositoriesRestService.addStatements($repositories.getActiveRepository(), jsonToFormData({update: query}))\n .then(function () {\n ConnectorsRestService.getConnectors().then(function () {\n ConnectorsRestService.hasConnector(encodeURIComponent(type.value)).then(function (res) {\n $scope.existing[type.key] = res.data;\n });\n });\n if (force) {\n toastr.success(\"Deleted (with force) connector \" + inst.name);\n if (isExternal) {\n toastr.warning(\"You may have to remove the index manually from \" + type.key);\n }\n } else {\n toastr.success(\"Deleted connector \" + inst.name);\n }\n }, function (err) {\n toastr.error(getError(err));\n }).finally(function() {\n $scope.setLoader(false);\n });\n });\n };\n\n $scope.viewQuery = function (connector, inst) {\n $modal.open({\n templateUrl: 'pages/viewQuery.html',\n controller: 'ViewQueryCtrl',\n resolve: {\n query: function () {\n const options = $scope.getOptions(connector);\n return createConnectorQuery(inst.name, connector.value,\n mapCreateValuesToUiValues(inst.values, options), options);\n }\n }\n });\n };\n}\n\nDeleteConnectorCtrl.$inject = ['$scope', '$modalInstance', 'type', 'isExternal'];\nfunction DeleteConnectorCtrl($scope, $modalInstance, type, isExternal) {\n $scope.force = false;\n $scope.type = type;\n $scope.isExternal = isExternal;\n\n $scope.ok = function () {\n $modalInstance.close($scope.force);\n };\n\n $scope.cancel = function () {\n $modalInstance.dismiss();\n };\n}\n\nExtendNewConnectorCtrl.$inject = ['$scope', '$modalInstance', 'connector', '$modal', 'toastr'];\nfunction ExtendNewConnectorCtrl($scope, $modalInstance, connector, $modal, toastr) {\n\n $scope.connector = connector;\n\n $scope.addField = function (index, optionName) {\n const newField = angular.copy($scope.defaultValues[optionName][0]);\n $scope.values[optionName].splice(index + 1, 0, newField);\n };\n\n $scope.addOption = function (index, array) {\n array.splice(index + 1, 0, '');\n };\n\n $scope.deleteOption = function (index, array) {\n array.splice(index, 1);\n };\n\n $scope.addMapOption = function (index, array) {\n array.splice(index + 1, 0, {key: '', value: ''});\n };\n\n $scope.deleteMapOption = function (index, array) {\n array.splice(index, 1);\n };\n\n function toQuery() {\n return createConnectorQuery($scope.name, connector.value, $scope.values, $scope.options,\n function (label, error) {\n toastr.error(error, label);\n });\n }\n\n $scope.ok = function () {\n if ($scope.form.$valid) {\n const query = toQuery();\n\n if (query) {\n $modalInstance.close({name: $scope.name, values: $scope.values, options: $scope.options, query: query});\n }\n }\n };\n\n $scope.viewQuery = function () {\n const query = toQuery();\n\n if (query) {\n $modal.open({\n templateUrl: 'pages/viewQuery.html',\n controller: 'ViewQueryCtrl',\n resolve: {\n query: function () {\n return query;\n }\n }\n });\n }\n };\n\n $scope.cancel = function () {\n $modalInstance.dismiss('cancel');\n };\n}\n\nCreateConnectorCtrl.$inject = ['$scope', '$controller', '$http', '$modalInstance', 'connector', '$modal', 'values', 'options'];\n\nfunction CreateConnectorCtrl($scope, $controller, $http, $modalInstance, connector, $modal, values, options) {\n angular.extend(this, $controller('ExtendNewConnectorCtrl', {\n $scope: $scope,\n $modalInstance: $modalInstance,\n connector: connector,\n $modal: $modal\n }));\n $scope.values = values.values;\n $scope.options = options;\n $scope.name = values.name;\n if (!values.skipConversion) {\n $scope.values = mapCreateValuesToUiValues($scope.values, $scope.options);\n }\n $scope.defaultValues = angular.copy($scope.values);\n}\n\n// Note that this is a fancy controller: it's used both for a modal and for a directive.\n// This means you can't rely on custom injection through resolve in the modal and the scope\n// must be shared with the main connectors controller.\nCreateProgressCtrl.$inject = ['$scope', '$interval', '$http', '$repositories'];\n\nfunction CreateProgressCtrl($scope, $interval, $http, $repositories) {\n function evaluateSparqlQuery(query) {\n return _evaluateSparqlQuery($http, $repositories.getActiveRepository(), query);\n }\n\n function initProgress() {\n const query = createStatusQueryForIri($scope.beingBuiltConnector.iri);\n\n // reset iri value so that watch will fire again when we do something with the same connector\n $scope.beingBuiltConnector.iri = null;\n\n $scope.progressInterval = $interval(function () {\n function getFirstStatusFromResult(results) {\n if (results.bindings) {\n if (results.bindings.length > 0) {\n try {\n return JSON.parse(results.bindings[0].status.value);\n } catch (e) {\n console.error(e); // eslint-disable-line no-console\n }\n }\n }\n\n return {};\n }\n\n evaluateSparqlQuery(query)\n .then(function (res) {\n const status = getFirstStatusFromResult(res.data.results);\n if (status.status === 'BUILDING') {\n $scope.beingBuiltConnector.status = status;\n $scope.beingBuiltConnector.percentDone = (100 * status.processedEntities / status.estimatedEntities).toFixed(0);\n $scope.beingBuiltConnector.eta = $scope.getHumanReadableSeconds(status.etaSeconds);\n $scope.beingBuiltConnector.actionName = status.repair ? 'Repairing' : 'Creating';\n $scope.beingBuiltConnector.waitOnRepairStartOnce = false;\n } else if (status.status === 'BUILT' && !$scope.beingBuiltConnector.waitOnRepairStartOnce) {\n // done\n $interval.cancel($scope.progressInterval);\n if ($scope.beingBuiltConnector.doneCallback) {\n $scope.beingBuiltConnector.doneCallback();\n }\n }\n });\n }, 1000);\n\n $scope.$on('$destroy', function () {\n $interval.cancel($scope.progressInterval);\n });\n }\n\n $scope.beingBuiltConnector = $scope.beingBuiltConnector || {};\n\n // for modal instance we get the iri before hand and can start progress now\n if (!$scope.beingBuiltConnector.inline && $scope.beingBuiltConnector.iri) {\n initProgress();\n }\n\n // for inline progress we need to watch for the iri value\n $scope.$watch('beingBuiltConnector.iri', function (value) {\n if ($scope.beingBuiltConnector.inline && value) {\n initProgress();\n }\n });\n}\n\nfunction ceil() {\n return function (input) {\n return Math.ceil(input);\n };\n}\n"],"sourceRoot":""}
|