graphdb-workbench 2.4.2-TR1 → 2.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (74) hide show
  1. package/dist/108.99fadee1ed0c7110af9a.bundle.js +1 -1
  2. package/dist/{12.2a55bbc8fc029c5f151d.bundle.js → 12.dd3a24172cf3cdec30f0.bundle.js} +2 -2
  3. package/dist/13.ac00d726d1145cb0e057.bundle.js +1 -0
  4. package/dist/{137.802084605202b8b7aef1.bundle.js → 137.19836eabf5f16be529c0.bundle.js} +1 -1
  5. package/dist/{14.75489051dc19828ddf6a.bundle.js → 14.82b9ba9a0a77131aa582.bundle.js} +1 -1
  6. package/dist/168.34a1790ea589d9926a97.bundle.js +1 -1
  7. package/dist/170.e24cfa80d3f51df2b1b5.bundle.js +1 -1
  8. package/dist/171.49aabfdb3574cef3d14b.bundle.js +1 -0
  9. package/dist/173.5e3fea538a2a2d5b5c0c.bundle.js +1 -1
  10. package/dist/200.76fd30afe28687f92b15.bundle.js +1 -1
  11. package/dist/{22.3850ed5528218c3beb66.bundle.js → 22.197477933275583c65cb.bundle.js} +1 -1
  12. package/dist/23.dc3e430b47f766cc2366.bundle.js +1 -1
  13. package/dist/{25.d97f589a3debedff6dfb.bundle.js → 25.71b2ceec450a85158ba8.bundle.js} +1 -1
  14. package/dist/30.4712f3e92b6469d3d8dd.bundle.js +1 -1
  15. package/dist/33.0433fbc733c2359c389c.bundle.js +1 -0
  16. package/dist/37.356f6302c079cea446b6.bundle.js +1 -1
  17. package/dist/42.2226eabae24538761847.bundle.js +1 -0
  18. package/dist/44.f26e17d2d3f6033d8938.bundle.js +1 -0
  19. package/dist/49.b0d0df9a0bd2458a38f7.bundle.js +1 -1
  20. package/dist/50.3e3c5da47d3b02a13948.bundle.js +1 -0
  21. package/dist/70.0c7029d27bb084fd643c.bundle.js +1 -0
  22. package/dist/76.7d3ef13875f7533cc029.bundle.js +1 -0
  23. package/dist/81.824c9bdd22dd196eb3d9.bundle.js +1 -0
  24. package/dist/9.0e4d38f2390c619f5b26.bundle.js +1 -0
  25. package/dist/{bundle.247e31198b23654b053d.bundle.js → bundle.9d05dba42014b5be9b8f.bundle.js} +2 -2
  26. package/dist/css/new-sparql.css +31 -1
  27. package/dist/index.html +3 -3
  28. package/dist/js/angular/core/directives/autocomplete/templates/autocomplete.html +1 -1
  29. package/dist/js/angular/core/directives/operations-statuses-monitor/templates/operations-statuses-monitor.html +1 -1
  30. package/dist/js/angular/core/directives/queryeditor/templates/query-editor.html +4 -23
  31. package/dist/js/angular/core/directives/rdfresourcesearch/templates/rdfResourceSearchTemplate.html +1 -1
  32. package/dist/js/angular/security/templates/user.html +1 -1
  33. package/dist/license-checker.json +2 -2
  34. package/dist/pages/aclmanagement.html +1 -1
  35. package/dist/pages/autocomplete.html +1 -1
  36. package/dist/pages/choose-repository-type.html +1 -1
  37. package/dist/pages/cluster-management/clusterInfo.html +3 -3
  38. package/dist/pages/create-index.html +4 -4
  39. package/dist/pages/dependencies.html +1 -1
  40. package/dist/pages/domainRangeInfo.html +2 -2
  41. package/dist/pages/edit.html +1 -1
  42. package/dist/pages/explore.html +1 -1
  43. package/dist/pages/export.html +1 -1
  44. package/dist/pages/find.html +1 -1
  45. package/dist/pages/graph-config/saveGraphConfig.html +11 -11
  46. package/dist/pages/graphs-visualizations.html +7 -7
  47. package/dist/pages/guides.html +1 -1
  48. package/dist/pages/import.html +1 -1
  49. package/dist/pages/jdbc-create.html +5 -5
  50. package/dist/pages/monitor/backup-and-restore.html +1 -1
  51. package/dist/pages/monitor/queries.html +1 -1
  52. package/dist/pages/monitor/resources.html +2 -2
  53. package/dist/pages/namespaces.html +2 -2
  54. package/dist/pages/plugins.html +1 -1
  55. package/dist/pages/rdfClassHierarchyInfo.html +7 -7
  56. package/dist/pages/rdfrank.html +2 -2
  57. package/dist/pages/repositories.html +2 -2
  58. package/dist/pages/repository.html +2 -2
  59. package/dist/pages/similarity-indexes.html +1 -1
  60. package/dist/pages/sparql-template-create.html +5 -5
  61. package/dist/pages/sparql.html +3 -3
  62. package/dist/pages/webapi.html +2 -2
  63. package/dist/res/swagger/index.html +27 -27
  64. package/package.json +1 -1
  65. package/dist/13.7197ee7d89f056798f2f.bundle.js +0 -1
  66. package/dist/171.c0e7ce3fd59ef1bfc4f5.bundle.js +0 -1
  67. package/dist/33.b8fdd52b492f933a3730.bundle.js +0 -1
  68. package/dist/42.e33e9c7350f30402dbe0.bundle.js +0 -1
  69. package/dist/44.e63112a4f3ee65c29a0a.bundle.js +0 -1
  70. package/dist/50.f453781f031f1511a294.bundle.js +0 -1
  71. package/dist/70.fcca4105919427b384ee.bundle.js +0 -1
  72. package/dist/76.56266cca991e6450cb2e.bundle.js +0 -1
  73. package/dist/81.e4cdfbb440c07a0f9d1e.bundle.js +0 -1
  74. package/dist/9.a1218bf604d655a3d23b.bundle.js +0 -1
@@ -1 +1 @@
1
- (window.webpackJsonp=window.webpackJsonp||[]).push([[30,130],{107:function(e,t,n){"use strict";n.r(t);n(7);var r=n(301),i=n(298),o=n.n(i),a=(n(10),n(77));function s(e,t,n,i,s,c,l,d,u,p,f,h,g,m,y,v,x,S,I,w,k,L,C){e.languageChanged=!1,e.propertiesObj={},e.propertiesQueryObj={},e.propertiesObj.items=[],e.propertiesNotFiltered=[],e.searchVisible=!1,e.nodeSelected=!1,e.queryResultsMode=!1,e.embedded=f.search().embedded,e.openedNodeInfoPanel=void 0,e.invalidLimit=!1,e.INVALID_LINKS_MSG=L.instant("sidepanel.invalid.limit.links.msg"),e.INVALID_LINKS_TOOLTIP=L.instant("sidepanel.invalid.limit.links.tooltip"),t.$on("$translateChangeSuccess",(function(){e.INVALID_LINKS_MSG=L.instant("sidepanel.invalid.limit.links.msg"),e.INVALID_LINKS_TOOLTIP=L.instant("sidepanel.invalid.limit.links.tooltip"),e.propertiesSearchPlaceholder=L.instant("visual.search.instance.placeholder")})),e.onopen=e.onclose=()=>angular.noop(),e.embedded&&(f.search().query||f.search().uri||f.search().config||f.search().saved)&&(e.noGoHome=!0);const T={};let b=0,N=0,P={},A=0;const M=d3.behavior.zoom().scaleExtent([.5,10]);let E;let G,R;function O(){return C.isActive()?e.defaultSettings:e.saveSettings}function j(e){m.openCopyToClipboardModal(e)}function z(){e.settings.languagesMap=_.map(e.settings.languages,(function(e){return{text:e}})),e.settings.preferredTypesMap=_.map(e.settings.preferredTypes,(function(e){return{text:e}})),e.settings.rejectedTypesMap=_.map(e.settings.rejectedTypes,(function(e){return{text:e}})),e.settings.preferredPredicatesMap=_.map(e.settings.preferredPredicates,(function(e){return{text:e}})),e.settings.rejectedPredicatesMap=_.map(e.settings.rejectedPredicates,(function(e){return{text:e}}))}t.key="",T.get=function(t,n,r){return g.initLazyList(t,n,r,b,e.propertiesObj.items)},t.$watch((function(){return t.key}),(function(){b=0,_.each(e.propertiesObj.items,(function(e){t.key>e&&b++})),N++})),T.revision=function(){return N},e.datasource=T,e.adapterContainer={adapter:{remain:!0}},e.propertiesQueryObj.query="",e.propertiesSearchPlaceholder=L.instant("visual.search.instance.placeholder"),e.propertiesFilterFunc=function(t){return t.key.toLowerCase().indexOf(e.propertiesQueryObj.query.toLowerCase())>=0},e.resetState=function(){e.searchVisible=!1,e.nodeSelected=!1,e.configLoaded=null,e.queryResultsMode=!1,e.lastSavedGraphName=null,e.lastSavedGraphId=null,e.shared=!1,e.numberOfPinnedNodes=0,P={},A=0},e.pushHistory=function(t,n){e.embedded&&(t.embedded=!0),f.search(t),f.state(n)},e.goToHome=function(){e.resetState(),f.url("graphs-visualizations")},e.shouldShowSettings=function(){return e.configLoaded&&e.configLoaded.id===e.defaultGraphConfig.id},e.shouldDisableSameAs=function(){const t=$("#sameAsCheck");return e.settings&&!e.settings.includeInferred&&t.prop("checked")&&(t.prop("checked",!1),e.settings.sameAsState=!1),e.settings&&!e.settings.includeInferred},e.$watch("propertiesObj.items",(function(){angular.isDefined(e.propertiesObj.items)&&e.propertiesObj.items.length>0&&c((function(){e.adapterContainer.adapter.reload()}),500)})),e.toggleMoreInfo=function(e){angular.element(e.currentTarget).parent().next().toggle(200),angular.element(e.currentTarget).children("span").toggleClass("icon-caret-down").toggleClass("icon-caret-up")},e.copyToClipboard=j,e.defaultSettings={linksLimit:20,includeInferred:!0,sameAsState:!0,languages:["en"],showLinksText:!0,preferredTypes:[],rejectedTypes:[],preferredPredicates:[],rejectedPredicates:["http://dbpedia.org/property/logo","http://dbpedia.org/property/hasPhotoCollection","http://dbpedia.org/property/website","http://dbpedia.org/property/homepage","http://dbpedia.org/ontology/thumbnail","http://xmlns.com/foaf/0.1/depiction","http://xmlns.com/foaf/0.1/homepage","http://xmlns.com/foaf/0.1/mbox","http://dbpedia.org/ontology/wikiPage*","http://dbpedia.org/property/wikiPage*","http://factforge.net/*"],preferredTypesOnly:!1,preferredPredicatesOnly:!1,includeSchema:!0},e.saveSettings=angular.copy(e.defaultSettings),p.when(h.getPrincipal()).then(t=>function(t){const n=t.appSettings;e.defaultSettings.includeInferred=n.DEFAULT_INFERENCE,e.defaultSettings.sameAsState=n.DEFAULT_INFERENCE&&n.DEFAULT_SAMEAS,e.defaultSettings.includeSchema=n.DEFAULT_VIS_GRAPH_SCHEMA;const r=x.get(S.GRAPHS_VIZ);if(r&&"object"==typeof r)try{e.saveSettings=r,void 0===e.saveSettings.includeSchema&&(e.saveSettings.includeSchema=e.defaultSettings.includeSchema,e.saveSettings.rejectedPredicates=[...e.saveSettings.rejectedPredicates,...e.defaultSettings.rejectedPredicates].unique())}catch(t){e.saveSettings=angular.copy(e.defaultSettings),x.set(S.GRAPHS_VIZ,e.saveSettings)}else e.saveSettings=angular.copy(e.defaultSettings)}(t)),e.resetSettings=function(){e.settings=angular.copy(e.defaultSettings),e.validateLinksLimit(),z()},e.changeLimit=function(t){let n=e.settings.linksLimit+t;n<1&&(n=1),n>1e3&&(n=1e3),e.settings.linksLimit=n},e.validateLinksLimit=function(){e.invalidLimit=!a.NUMBER_PATTERN.test(e.settings.linksLimit)},e.showSettings=function(){e.showInfoPanel=!0,e.showFilter=!0,e.showNodeInfo=!1,e.showPredicates=!1,e.saveSettings?e.settings=angular.copy(e.saveSettings):e.settings=angular.copy(e.defaultSettings),z()},e.reExpandNode=function(){e.rootNodeIri&&e.$broadcast("onRootNodeChange",e.rootNodeIri)};const D=function(t,n,r){const i=O(),o=void 0===n?i.sameAsState:!0===n,a=void 0===r?i.includeInferred:!0===r;e.loading=!0,l({url:"rest/explore-graph/graph",method:"POST",headers:{"Content-Type":"application/json"},data:{query:t,linksLimit:i.linksLimit,languages:e.shouldShowSettings()?i.languages:[],includeInferred:a,sameAsState:o}}).then((function(e){pe(e)}),(function(t){e.loading=!1,s.error(getError(t.data),L.instant("graphexplore.error.cannot.load.graph"))}))};function F(e){return e.replace(/[()']/g,"")}function B(e,t){let n=e.split(" ");return t?[n[0],n[1],n[2]].join(">"):[n[0],n[2]].join(">")}function W(e){return[e.source.iri,e.target.iri].join(">")}function U(e){if(e.isTriple){let t=document.getElementById(F(B(e.iri)));if(t&&void 0!==t.__data__.x)return t.__data__.x}return e.x}function q(e){if(e.isTriple){let t=document.getElementById(F(B(e.iri)));if(t&&void 0!==t.__data__.y)return t.__data__.y}return e.y}function H(e){let t=e.trim().split(" ");return`<<<${t[0]}> <${t[1]}> <${t[2]}>>>`}function V(e){return F(`${e.source.isTriple?B(e.source.iri,!0):e.source.iri}>${e.target.isTriple?B(e.target.iri,!0):e.target.iri}>marker`)}function K(){this.nodes=[],this.links=[],this.tripleNodes=new Map,this.tripleLinksCopy=new Map,this.addNode=function(e,t,n){return e.x=t,e.y=n,this.nodes.push(e),e},this.computeConnectedness=function(){const e={},t={};_.each(this.links,(function(n){const r=n.source.iri,i=n.target.iri,o=_.min([r,i])+"|"+_.max([r,i]);t[o]||(t[o]=1,e[r]=(e[r]||0)+1,e[i]=(e[i]||0)+1)})),_.each(this.links,(function(t){e[t.source.iri]>1&&e[t.target.iri]>1?t.connectedness=Math.min(5,Math.max(e[t.source.iri],e[t.target.iri])-1):t.connectedness=0}))},this.addAndMatchLinks=function(e){const t=this.nodes;Array.prototype.push.apply(this.links,function(e,t){return _.map(e,(function(e){let n,r;n=e.isTripleSource?Se(e.source):_.find(t,(function(t){return t.iri===e.source})),r=e.isTripleTarget?Se(e.target):_.find(t,(function(t){return t.iri===e.target}));let i={source:n,target:r,predicates:e.predicates};if(e.isTripleSource||e.isTripleTarget){let e=`${i.source.isTriple?B(i.source.iri):i.source.iri}>${i.target.isTriple?B(i.target.iri):i.target.iri}`;if(Z.tripleLinksCopy.has(e)){let t=Z.tripleLinksCopy.get(e);return t[0].predicates.push(...i.predicates),t.push(i),Z.tripleLinksCopy.set(e,t),null}Z.tripleLinksCopy.set(e,[i])}return i}))}(e,t));for(let e of Z.tripleLinksCopy.keys())1===Z.tripleLinksCopy.get(e).length&&Z.tripleLinksCopy.delete(e);this.links=this.links.filter(e=>null!==e),this.computeConnectedness()};const t=function(e,t){return n(e,t).length};function n(e,t){return _.filter(t,(function(t){return t.source.iri===e.iri||t.target.iri===e.iri}))}this.countLinks=t,this.linksTypes=function(e,t){const r=n(e,t),i=_.map(r,(function(t){return t.source.iri===e.iri?t.target.types:t.source.types}));return _.uniq(_.flatten(i))},this.linksPredicates=function(e,t){const r=n(e,t),i=_.map(r,(function(e){return e.predicates}));return _.uniq(_.flatten(i))},this.removeTriples=function(e){let t=[];this.tripleNodes.size>0&&e.forEach(e=>{this.tripleNodes.has(e)&&(this.tripleNodes.delete(e),this.links=_.reject(this.links,(function(n){let r=e.split(">"),i=B(n.source.iri),o=B(n.target.iri);if(i===e&&Z.tripleNodes.delete(o)){let e=o.split(">");t.push({source:e[0],target:e[1]})}let a=i===e||o===e||n.source.iri===r[0]&&n.target.iri===r[1];return a&&(Z.tripleLinksCopy.delete(`${i}>${o}`),Z.tripleLinksCopy.delete(`${o}>${i}`)),a})))}),t.forEach(e=>{this.links=_.reject(this.links,(function(t){return t.source.iri===e.source&&t.target.iri===e.target}))})},this.removeNode=function(n){let r=[];this.links=_.reject(this.links,(function(e){let t=e.source.iri===n.iri||e.target.iri===n.iri;return t&&(e.target.isTriple&&r.push(B(e.target.iri)),e.source.isTriple||e.target.isTriple||r.push([e.source.iri,e.target.iri].join(">"))),t})),this.removeTriples(r);const i=this.links;this.nodes=_.reject(this.nodes,(function(e){return 0===t(e,i)})),0===this.nodes.length&&(e.nodeSelected=!1),this.computeConnectedness()},this.removeNodeLeafLinks=function(e){let r=[],i=this.links;this.links=_.reject(this.links,(function(o){let a=o.source.iri===e.iri&&1===t(o.target,i)&&!o.target.isTriple||o.target.iri===e.iri&&1===t(o.source,i)&&!o.source.isTriple;if(!a){let r;if(o.source.iri!==e.iri||2!==t(o.target,i)||o.target.isTriple?o.target.iri!==e.iri||2!==t(o.source,i)||o.source.isTriple||(r=n(o.source,i)):r=n(o.target,i),!r)return!1;a=(r[0].source.iri===e.iri||r[0].target.iri)&&(r[1].source.iri===e.iri||r[1].target.iri)}return a&&(o.target.isTriple&&r.push(B(o.target.iri)),o.source.isTriple||o.target.isTriple||r.push([o.source.iri,o.target.iri].join(">"))),a})),this.removeTriples(r),i=this.links,this.nodes=_.reject(this.nodes,(function(n){return 0===t(n,i)&&n.iri!==e.iri})),this.computeConnectedness()},this.addTriple=function(e,t,n){e.x=t,e.y=n,e.weight=0;let r=B(e.iri);if(this.tripleNodes.has(r)){let t=this.tripleNodes.get(r);t.push(e),this.tripleNodes.set(r,t)}else e.weight=10,this.tripleNodes.set(r,[e])},this.copyState=function(){const e=_.map(this.nodes,(function(e){return{iri:e.iri,isTriple:e.isTriple,size:e.size,labels:angular.copy(e.labels),types:angular.copy(e.types),rdfRank:e.rdfRank,x:e.x,y:e.y,fixed:e.fixed}})),t=JSON.stringify(Array.from(this.tripleNodes.entries())),n=JSON.stringify(Array.from(this.tripleLinksCopy.entries()));return{nodes:e,links:_.map(this.links,(function(e){return{source:e.source.iri,isTripleSource:e.source.isTriple,target:e.target.iri,isTripleTarget:e.target.isTriple,predicates:e.predicates}})),tripleNodes:t,tripleLinksCopy:n,colorIndex:A,type2color:P,scale:M.scale(),translate:M.translate()}},this.restoreState=function(t){e.nodeSelected=!0,e.searchVisible=!1,this.nodes=angular.copy(t.nodes),this.tripleNodes=t.tripleNodes?new Map(JSON.parse(t.tripleNodes)):new Map,this.links=[],this.addAndMatchLinks(t.links),this.tripleLinksCopy=t.tripleLinksCopy?new Map(JSON.parse(t.tripleLinksCopy)):new Map,_.each(this.nodes,(function(t){t.fixed&&e.numberOfPinnedNodes++})),angular.isDefined(t.colorIndex)&&angular.isDefined(t.type2color)&&(A=t.colorIndex,P=angular.copy(t.type2color)),angular.isDefined(t.translate)&&angular.isDefined(t.scale)&&(E="translate("+t.translate[0]+", "+t.translate[1]+") scale("+t.scale+")",M.translate(t.translate),M.scale(t.scale)),se()}}e.updateSettings=function(){e.invalidLimit?s.error(e.INVALID_LINKS_TOOLTIP,e.INVALID_LINKS_MSG):(e.saveSettings=e.settings,e.saveSettings.languages=_.map(e.saveSettings.languagesMap,(function(e){return e.text})),e.saveSettings.preferredTypes=_.map(e.saveSettings.preferredTypesMap,(function(e){return e.text})),e.saveSettings.rejectedTypes=_.map(e.saveSettings.rejectedTypesMap,(function(e){return e.text})),e.saveSettings.preferredPredicates=_.map(e.saveSettings.preferredPredicatesMap,(function(e){return e.text})),e.saveSettings.rejectedPredicates=_.map(e.saveSettings.rejectedPredicatesMap,(function(e){return e.text})),e.rootNodeIri?e.reExpandNode(e.rootNodeIri):e.queryResultsMode&&f.search().query?D(f.search().query,f.search().sameAs,f.search().inference):"query"===e.configLoaded.startMode&&e.loadGraphConfig(e.configLoaded),O().showLinksText?d3.selectAll("svg .link-wrapper text").style("display","block"):d3.selectAll("svg .link-wrapper text").style("display","none"),e.showInfoPanel=!1,e.showFilter=!1,x.set(S.GRAPHS_VIZ,e.saveSettings))},e.showInfoPanel=!1;let Z=new K;e.defaultGraphConfig={id:"default",name:"Easy graph",startMode:"search"},e.getGraphConfigs=function(t){w.getGraphConfigs().success((function(n){e.graphConfigs=n,t&&t()})).error((function(e){s.error(getError(e),L.instant("graphexplore.error.graph.configs.short.msg"))}))},e.loadConfigForId=function(t,n){t===e.defaultGraphConfig.id?e.loadGraphConfig(e.defaultGraphConfig):w.getConfig(t).success((function(t){e.loadGraphConfig(t),n()})).error((function(e){s.error(getError(e),L.instant("graphexplore.error.could.not.load.config",{configId:t}))}))},e.findConfigById=function(t){return t===e.defaultGraphConfig.id?e.defaultGraphConfig:$.grep(e.graphConfigs,(function(e){return e.id===t}))[0]},e.easyGraphSearch=function(t){e.configLoaded=e.defaultGraphConfig,e.openUri(t)},e.loadGraphConfig=function(t){e.configLoaded=t,"search"===t.startMode?e.searchVisible=!0:"node"===t.startMode&&t.startIRI?c((function(){e.openUri(t.startIRI,!0)}),0):"query"===t.startMode&&t.startGraphQuery&&(e.loading=!0,w.loadGraphForConfig(t,t.startQueryIncludeInferred,O().linksLimit,t.startQuerySameAs).then((function(e){pe(e)}),(function(t){e.loading=!1,s.error(getError(t),L.instant("graphexplore.error.graph.load"))})))},e.deleteConfig=function(t){m.openSimpleModal({title:L.instant("common.confirm"),message:L.instant("graphexplore.delete.graph",{configName:t.name}),warning:!0}).result.then((function(){w.deleteGraphConfig(t).success((function(){e.getGraphConfigs(),e.refreshSavedGraphs()})).error((function(e){s.error(getError(e),L.instant("graphexplore.error.cannot.delete.config"))}))}))},e.goToGraphConfig=function(t){e.pushHistory({config:t.id},{config:t}),e.resetState(),e.loadGraphConfig(t)},v.onpopstate=function(t){e.resetState(),t.state&&(t.state.config?(e.loadGraphConfig(t.state.config),t.state.uri&&e.openUri(t.state.uri,!0)):t.state.savedGraph&&e.loadSavedGraph(t.state.savedGraph,!0))};const Q=function(){f.search().query?(e.searchVisible=!1,e.queryResultsMode=!0,D(f.search().query,f.search().sameAs,f.search().inference)):e.$on("onRootNodeChange",(function(t,n){e.loading=!0;const r=O();angular.isDefined(n)&&(e.rootNodeIri=n,l({url:"rest/explore-graph/node",method:"GET",params:{iri:n,config:e.configLoaded?e.configLoaded.id:e.defaultGraphConfig.id,languages:e.shouldShowSettings()?r.languages:[],includeInferred:r.includeInferred,sameAsState:r.sameAsState}}).then((function(t){e.nodeSelected=!0,e.searchVisible=!1,null===t.data.types&&(t.data.types="greyColor"),Z=new K;const n=Z.addNode(t.data,500,500);E="translate(0, -70) scale(1)",M.translate([0,-70]),M.scale(1),he(n,!0)})).catch((function(t){e.loading=!1,s.error(getError(t),L.instant("graphexplore.error.could.not.load.graph"))})))})),f.search().uri&&e.openUri(f.search().uri,!0),f.search().saved&&I.getSavedGraph(f.search().saved).success((function(t){e.loadSavedGraph(t)})).error((function(e){const t=getError(e);s.error(t,L.instant("graphexplore.error.could.not.open"))}))},J=function(){f.search().config?e.loadConfigForId(f.search().config,Q):f.search().query||f.search().uri?(e.loadGraphConfig(e.defaultGraphConfig),Q()):Q()};function Y(t){!n.getActiveRepository()||e.hasInitedRepository&&!t||(e.hasInitedRepository=!0,t||e.getGraphConfigs(J),e.getNamespacesPromise=k.getNamespaces(e.getActiveRepository()).success((function(t){const n=_.map(t.results.bindings,(function(e){return{uri:e.namespace.value,prefix:e.prefix.value}}));e.namespaces=_.sortBy(n,(function(e){return e.uri.length})),X()})).error((function(e){s.error(getError(e),L.instant("graphexplore.error.view.will.not.work"))})))}function X(){i.isLicenseValid()&&(e.getAutocompletePromise=u.checkAutocompleteStatus())}e.replaceIRIWithPrefix=function(t){const n=e.namespaces,r=_.findLast(n,(function(e){return 0===t.indexOf(e.uri)}));return r?r.prefix+":"+t.substring(r.uri.length):t},e.addedTag=function(t){return t.text.indexOf(":")<0?(s.warning(L.instant("graphexplore.absolute.prefixed.iri")),null):(t.text=function(e,t){if(!/^<?(http|urn).*>?/.test(e)){const n=e.split(":"),r=n[0],i=n[1];if(!angular.isUndefined(i)){const e=d.getNamespaceUriForPrefix(t,r);if(e)return e+i}}return e}(t.text,e.namespaces),e.pageslideExpanded=!0,t)},e.validateTag=function(e,t,n){if(e.text.indexOf(":")<0)return n?s.warning(L.instant("graphexplore.absolute.prefixed.iri.option"),t):s.warning(L.instant("graphexplore.absolute.prefixed.iri"),t),!1;const r=e.text.indexOf("*");if(r>=0){if(!n)return s.warning(L.instant("graphexplore.wildcards.not.allowed"),t),!1;if(r<e.text.length-1)return s.warning(L.instant("graphexplore.wildcards.last.char"),t),!1}return!0},e.getTagClass=function(e){return e.endsWith("*")?"tag-item-wildcard":null},e.getActiveRepository=function(){return n.getActiveRepository()},e.isLicenseValid=function(){return i.isLicenseValid()},e.hasInitedRepository=!1,e.$on("autocompleteStatus",(function(){X()})),e.$on("repositoryIsSet",(function(t,n){n.newRepo&&(e.hasInitedRepository=!1),Y(n.newRepo),n.newRepo&&(e.resetState(),$(".graph-visualization svg").empty(),f.search().query&&(e.goToHome(),Q()))})),Y();const ee=d3.scale.linear().domain([0,9]).range(["hsl(0, 100%, 75%)","hsl(360, 90%, 82%)"]).interpolate(d3.interpolateHslLong),te=d3.scale.linear().domain([0,9]).range(["hsl(180, 50%, 75%)","hsl(540, 40%, 82%)"]).interpolate(d3.interpolateHslLong);e.getColor=function(e){angular.isUndefined(P[e])&&(P[e]=A,A++);const t=P[e];return t>39?"#c2c2c2":t%2==0?ee(t/2):te(t/2)};const ne=d3.layout.force().gravity(.07).size([1e3,1e3]),re=d3.select(".main-container .graph-visualization").append("svg").attr("viewBox","0 0 1000 1000").attr("preserveAspectRatio","xMidYMid meet");let ie=0,oe=0;const ae=new function(){this.state=!1,this.setLoadingState=function(e){this.state=e},this.getLoadingState=function(){return this.state},this.init=function(e,t){d3.select(t).append("circle").attr("cx",(function(){return e.x})).attr("cy",(function(){return e.y})).attr("class","loader-container").attr("r",(function(){return e.size})).style("fill","fff").style("opacity","0.7"),d3.select(t).append("image").attr("xlink:href","js/angular/templates/loader/ot-loader.svg?v=2.4.2-TR1").attr("x",(function(){return e.x-e.size+5})).attr("y",(function(){return e.y-e.size})).attr("width",(function(){return 2*e.size})).attr("height",(function(){return 2*e.size})).attr("class","node-loader")}};function se(t){d3.selectAll("svg g").remove(),d3.selectAll("svg rect").remove(),d3.selectAll(".d3-tip").remove(),d3.selectAll(".menu-events").remove(),M.on("zoom",(function(){if(C.isActive())return;E="translate("+d3.event.translate+") scale("+d3.event.scale+")",n.attr("transform",E)})),re.append("rect").attr("width",1e4).attr("height",1e4).attr("x",-4500).attr("y",-4500).style("fill","none").style("pointer-events","all").call(M).on("click",(function(){d3.event.stopPropagation(),ge(),ne.stop()}));const n=re.append("g").attr("class","nodes-container").attr("transform",(function(){return angular.isDefined(E)&&!t?E:""})),i=o()().attr("class","d3-tip").customPosition((function(){const e=G.getBoundingClientRect();return{top:e.bottom+10+"px",left:e.left-30+"px"}})).html((function(t){let n="";return t.fixed&&(n+='<i class="icon-pin"></i>&nbsp;&nbsp;'),t.types.length>0?n+=_.join(_.map(t.types,(function(t){return e.replaceIRIWithPrefix(t)}))," · "):n+="<i>No types</i>",n})),a=function(e){let t="";return t+=_.join(_.map(e.predicates,(function(t,n){if(0===n)return we(t);if(n<10)return" · "+we(t);if(10===n){const t=function(e){return e.predicates.length-10}(e),n=t>1?t+" predicates":t+" predicate";return" · "+L.instant("graphexplore.tip.text",{textToShow:n})}})),""),t};let l;const d=o()().attr("class","d3-tip").customPosition((function(e){const t=l.getBoundingClientRect(),n=function(e){const t=a(e),n=document.createElement("canvas").getContext("2d");return n.font="13px Arial",e.predicates.length<10?n.measureText(t).width:n.measureText(t).width/2}(e);return{top:t.top-30+"px",left:t.left-30+"px",width:n+"px"}})).html((function(e){return a(e)}));const u=function(){c.cancel(void 0),c.cancel(ie),G=null,i.hide(),oe=c((function(){ge()}),500)};re.call(i);re.call(d);let p=re.selectAll(".link"),f=re.selectAll(".node");ne.nodes(Z.nodes).charge(-3e3),ne.links(Z.links).linkDistance((function(e){return e.source.isTriple||e.target.isTriple?0:function(e){const t=$("<span></span>"),n=e.predicates[0].split("/"),r=n[n.length-1];t.addClass("predicate-text").text(r),$("body").append(t);const i=t.width()+2*e.source.size+2*e.target.size+50;return t.remove(),.75*i}(e)+30*e.connectedness})),n.append("defs").selectAll("marker").data(ne.links()).enter().append("marker").attr("class","arrow-marker").attr("id",(function(e){return V(e)})).attr("viewBox","0 -5 10 10").attr("refX",(function(e){return e.target.isTriple?11:e.target.size+11})).attr("refY",0).attr("markerWidth",10).attr("markerHeight",10).attr("orient","auto").append("path").attr("d","M0,-5L10,0L0,5 L10,0 L0, -5"),p=n.selectAll(".link").data(Z.links).enter().append("g").attr("class","link-wrapper").attr("id",(function(e){return F(W(e))})).append("line").attr("class","link").style("stroke-width",1).style("fill","transparent").style("marker-end",(function(e){return`url(#${V(e)})`}));const h=n.selectAll(".link-wrapper").append("text").text((function(e){return Ie(e)})).attr("class",(function(e){return e.predicates.length>1||Z.tripleNodes.has(W(e))?"predicates":"predicate"})).attr("dy","-0.5em").style("text-anchor","middle").style("display",O().showLinksText?"":"none").on("mouseover",(function(e){d3.event.stopPropagation(),function(e){c.cancel(void 0);const t=l=d3.event.target;c((function(){l===t&&e.predicates.length>1&&d.show(e,l)}),300)}(e)})).on("mouseout",(function(){c.cancel(void 0),l=null,d.hide()})).on("click",(function(t){d3.event.stopPropagation(),function(t){xe();let n=W(t);if(1===t.predicates.length&&Z.tripleNodes.has(n)){R=null;let e=Z.tripleNodes.get(n)[0];if(de(e,this,d3.event.button)){let t={};t.iri=e.iri,t.pred=we(e.iri.split(" ")[1]),ye(t)}return}!function(t){if(e.showNodeInfo=!1,e.showPredicates=t.predicates.length>1,e.showFilter=!1,e.showInfoPanel=!1,R===t)return e.showNodeInfo=!1,e.showInfoPanel=!1,void(R=null);R=t,e.showPredicates&&(e.predicates=_.map(t.predicates,(function(e){let n=function(e,t){let n=W(t);return Z.tripleNodes.has(n)?Z.tripleNodes.get(n).findIndex(t=>t.iri.indexOf(e)>=0):-1}(e,t),r=n>-1;return{value:we(e),partOfTriple:r,linkId:r?W(t):"",nodeIndex:n}})),e.showInfoPanel=!0)}(t)}(t)}));let g,m=0,y=0,v=0;const x=function(){d3.event.button&&0!==d3.event.button||(u(),c.cancel(g),e.showPredicates=!1,d3.event.timeStamp-m<500?y++:y=1,m=d3.event.timeStamp,d3.event.preventDefault())},S=function(t,n,r){Z.countLinks(t,Z.links)<=O().linksLimit?he(t,!1,r||this.parentNode):s.info(L.instant("graphexplore.increase.limit"),L.instant("graphexplore.node.at.max")),e.closeInfoPanel()},I=function(e){if(d3.event.button&&0!==d3.event.button)return;c.cancel(g);const t=d3.event,n=this;C.isActive()||d3.event.timeStamp-m<500&&(1===y?g=c((function(){de(e,n,t)}),540-(d3.event.timeStamp-m)):2===y&&S(e,0,n.parentNode)),d3.event.preventDefault()};function w(e,t){let r,i,o,a,s=!0;if("down"===t)r=2*e.size,i=e.size/3,o=.8,a=.3;else if("down-fixed"===t)r=2*e.size,i=e.size,o=.8,a=.66;else if("up"===t)r=e.size/3,i=2*e.size,o=.3,a=.8;else{if("fixed"!==t)return;r=e.size,o=.66,s=!1}let c=n.selectAll(".node-wrapper").filter((function(t){return t===e})).append("text").text("").classed("icon-any pinned",!0).style("font-size",r+"px").attr("x",(function(e){return e.x})).attr("y",(function(e){return e.y})).attr("opacity",o);"fixed"!==t&&"down-fixed"!==t||(e.pin=c),s&&(c=c.transition().duration(1e3).style("font-size",(function(){return i+"px"})).attr("opacity",a),"down-fixed"!==t&&c.remove())}const k=d3.behavior.drag().origin((function(e){return e})).on("dragstart",(function(e){if(C.isActive())return;0===d3.event.sourceEvent.button&&(e.fixedBeforeDrag=e.fixed,e.isBeingDragged=!0,e.beginDragging=!0,ge(),d3.event.sourceEvent.stopPropagation(),d3.select(this).classed("dragging",!0))})).on("drag",(function(t){t.isBeingDragged&&(y=0,t.px=d3.event.x,t.py=d3.event.y,t.fixed?t.beginDragging&&w(t,"fixed"):(e.numberOfPinnedNodes++,t.fixed=!0,w(t,"down-fixed")),t.pinWasFixed=!0,t.beginDragging=null,ne.resume())})).on("dragend",(function(e){e.isBeingDragged&&(e.pinWasFixed&&(e.pinWasFixed=null,d3.select(".pinned").remove()),e.isBeingDragged=!1,d3.select(this).classed("dragging",!1))}));f=n.selectAll(".node").data(Z.nodes).enter().append("g").attr("class","node-wrapper").attr("id",(function(e){return e.iri})).append("circle").attr("class","node").attr("r",(function(e){return e.size})).style("fill",(function(t){return"greyColor"===t.types?"c2c2c2":e.getColor(t.types[0])})).call(k).on("mouseover",(function(t){if(!t.isBeingDragged){const n=d3.event;c.cancel(oe),ie=c(()=>{(function(t,n){if(e.showInfoPanel)return!1;(le.closeIcon||le.expandIcon||le.focusIcon||le.copyURIIcon)&&le.removeIcons();if(ne.alpha()<.02)return le.initIcons(t,n.parentNode),ne.stop(),ce(),!0;return!1})(t,this)&&function(e,t){c.cancel(void 0);const n=G=t.target;c((function(){G===n&&i.show(e,G)}),300)}(t,n)},400)}})).on("mouseout",u).on("mousedown",x).on("touchstart",(function(e){x(),v=0,g=c((function(){v<5&&ue(e),g=null,y=0}),1e3)})).on("touchmove",(function(){v++})).on("mouseup",I).on("touchend",I).on("contextmenu",(function(t){d3.event.shiftKey||(d3.event.preventDefault(),ge(),e.closeInfoPanel(),t.fixed?(e.numberOfPinnedNodes--,t.fixed=!1,w(t,"up"),ne.resume()):(e.numberOfPinnedNodes++,t.fixed=!0,w(t,"down")),function(e){G&&i.show(e,G)}(t))})).on("gdb-expand-node",S).on("gdb-show-node-info",me);const T=n.selectAll(".node-wrapper").append("foreignObject").style("pointer-events","none").attr("width",(function(e){return 2*e.size*1.75}));n.insert("g").attr("class","menu-events"),function(e){e.each((function(e){e.fontSize=r.a.Text.calcFontSizeRaw(e.labels[0].label,e.size,16,!0)})).attr("height",(function(e){return 3*e.fontSize})).append("xhtml:div").attr("class","node-label-body").style("font-size",(function(e){return e.fontSize+"px"})).append("xhtml:div").text((function(e){return e.labels[0].label})),c((function(){$(".node-label-body div").each((function(e,t){let n=t.textContent.substring(0,t.textContent.length-1);let r=0;for(;r<200&&(t.scrollHeight>t.clientHeight||t.scrollWidth>t.clientWidth);)n=n.substring(0,n.length-1),t.textContent=n+"…",r++}))}),50)}(T),ne.on("tick",(function(){d3.geom.quadtree(Z.nodes);Z.nodes.length;p.attr("x1",(function(e){return U(e.source)})).attr("y1",(function(e){return q(e.source)})).attr("x2",(function(e){return U(e.target)})).attr("y2",(function(e){return q(e.target)})),h.attr("x",(function(e){let t=U(e.source),n=U(e.target);return e.x=.5*(t+n)})).attr("y",(function(e){let t=q(e.source),n=q(e.target);return e.y=.5*(t+n)})).attr("transform",(function(e){return"rotate("+function(e,t){const n={x:U(e.source),y:q(e.source)},r={x:U(e.target),y:q(e.target)};if(t)return 180*Math.atan2(r.y-n.y,r.x-n.x)/Math.PI;{const e=180*Math.atan2(r.y-n.y,r.x-n.x)/Math.PI;return e<=90&&e>=-90?e:(e>0?-1:1)*(180-Math.abs(e))}}(e,e.direction)+", "+e.x+", "+e.y+")"})),f.attr("cx",(function(e){return e.x})).attr("cy",(function(e){return e.y})),n.select(".node-loader").attr("x",(function(e){return e.x-e.size+3})).attr("y",(function(e){return e.y-e.size})),n.select(".loader-container").attr("cx",(function(e){return e.x})).attr("cy",(function(e){return e.y})),T.attr("x",(function(e){return e.x-1.75*e.size})).attr("y",(function(e){return e.y-3*e.fontSize/2})),d3.select(".pinned").attr("x",(function(e){return e.x})).attr("y",(function(e){return e.y})),ce()})),angular.isDefined(ae)&&ae.setLoadingState(!1),e.loading&&(e.loading=!1),d3.selectAll(".link-wrapper").each((function(){const e=$(this).attr("id").split(">")[0],t=$(this).attr("id").split(">")[1];d3.selectAll(".link").each((function(n){let r=F(n.source.iri),i=F(n.target.iri);if(r===t&&i===e){let e=r;e+=">",e+=i;const t=document.createTextNode(" ⟶");document.getElementById(e).lastChild.appendChild(t),n.direction="double"}}))})),d3.selectAll(".d3-actions-tip").remove(),ne.start()}function ce(){t.d3alpha=ne.alpha()}se();const le=new function(){function e(e,t){return"translate("+(t.x-14+(t.size+15)*Math.cos(e*Math.PI/180-Math.PI/2))+","+(t.y-14+(t.size+15)*Math.sin(e*Math.PI/180-Math.PI/2))+")"}this.closeIcon=void 0,this.expandIcon=void 0,this.collapseIcon=void 0,this.focusIcon=void 0,this.copyURIIcon=void 0,this.actionsTip=void 0,this.removeIcons=function(){this.closeIcon.remove("g"),this.expandIcon&&this.expandIcon.remove("g"),this.collapseIcon&&this.collapseIcon.remove("g"),this.focusIcon.remove("g"),this.copyURIIcon.remove("g"),this.closeIcon=void 0,this.expandIcon=void 0,this.collapseIcon=void 0,this.focusIcon=void 0,this.copyURIIcon=void 0,this.expandedState=!1},this.expandedState=!1,this.initIcons=function(n,r){const i=o()().attr("class","d3-tip d3-actions-tip").customPosition((function(){const e=d3.event.target.getBoundingClientRect();return{top:e.top-20+"px",left:e.right+10+"px"}})).html((function(e){return e}));re.call(i);n.isExpanded?(this.collapseIcon=d3.select(".menu-events").append("g").attr("class","collapse-icon").attr("name","collapse").attr("transform",(function(){return e(20,n)})),this.collapseIcon.append("circle").attr("cx",14).attr("cy",14).attr("r",13).style("fill","#eee"),this.collapseIcon.append("path").attr("d","M22.67,12a.59.59,0,0,1-.53.65l-6.88.72H15.2a.59.59,0,0,1-.59-.65l.72-6.88A.58.58,0,0,1,16,5.33a.59.59,0,0,1,.53.65L16,11.11,21.3,5.79a.64.64,0,0,1,.91.91L16.89,12,22,11.49A.59.59,0,0,1,22.67,12ZM12.59,14.75l-6.75.85a.59.59,0,0,0-.51.66.58.58,0,0,0,.66.51l4.95-.62-5.2,5.2a.64.64,0,1,0,.91.91l5.2-5.2L11.23,22a.59.59,0,0,0,.51.66h.07a.59.59,0,0,0,.59-.52l.85-6.75a.59.59,0,0,0-.17-.49A.58.58,0,0,0,12.59,14.75Z").style("fill","var(--primary-color)"),this.collapseIcon.on("click",(function(){var e;(e=n).isExpanded=!1,Z.removeNodeLeafLinks(e),se()})).on("mouseover",(function(){i.show(this.getAttribute("name")),c.cancel(ie),c.cancel(oe)})).on("mouseout",(function(){i.hide(),oe=c((function(){ge()}),500)}))):(this.expandIcon=d3.select(".menu-events").append("g").attr("class","expand-icon").attr("name","expand").attr("transform",(function(){return e(20,n)})),this.expandIcon.append("circle").attr("cx",14).attr("cy",14).attr("r",13).style("fill","#eee"),this.expandIcon.append("path").attr("d","M22.37,6.28l-.72,6.88a.59.59,0,0,1-.59.53H21a.59.59,0,0,1-.53-.65L21,7.9l-5.32,5.32a.64.64,0,0,1-.91-.91L20.1,7,15,7.53a.59.59,0,0,1-.12-1.18l6.88-.72a.59.59,0,0,1,.65.65ZM12.89,20.34,7.95,21l5.2-5.2a.64.64,0,0,0-.91-.91L7,20.05l.62-4.95A.59.59,0,0,0,6.48,15l-.85,6.75a.59.59,0,0,0,.59.67h.07L13,21.52a.59.59,0,1,0-.15-1.18Z").style("fill","var(--primary-color)"),this.expandIcon.on("click",(function(){he(n,!1,r)})).on("mouseover",(function(){i.show(this.getAttribute("name")),c.cancel(oe),c.cancel(ie)})).on("mouseout",(function(){i.hide(),oe=c((function(){ge()}),500)}))),this.focusIcon=d3.select(".menu-events").append("g").attr("class","focus-icon").attr("name","focus").attr("transform",(function(){return e(20,n)})),this.focusIcon.append("circle").attr("cx",14).attr("cy",14).attr("r",13).style("fill","#eee"),this.focusIcon.append("path").attr("d","M14.2,23.81a9.8,9.8,0,1,1,6.93-2.87h0A9.74,9.74,0,0,1,14.2,23.81Zm0-18.17a8.37,8.37,0,1,0,5.92,14.29h0A8.37,8.37,0,0,0,14.2,5.64Zm1.42,6.95a2,2,0,1,0,0,2.85A2,2,0,0,0,15.62,12.59Z").style("fill","var(--primary-color)"),this.focusIcon.on("click",(function(){t.$broadcast("onRootNodeChange",n.iri)})).on("mouseover",(function(){i.show(this.getAttribute("name")),c.cancel(oe),c.cancel(ie)})).on("mouseout",(function(){i.hide(),oe=c((function(){ge()}),500)})),this.copyURIIcon=d3.select(".menu-events").append("g").attr("class","icon-link").attr("name","link").attr("transform",(function(){return e(20,n)})),this.copyURIIcon.append("circle").attr("cx",14).attr("cy",14).attr("r",13).style("fill","#eee"),this.copyURIIcon.append("path").attr("d","M 13.457031 10.164062 C 13.648438 10.164062 13.820312 10.242188 13.941406 10.363281 L 15.492188 11.859375 C 15.984375 12.332031 16.292969 12.992188 16.292969 13.714844 C 16.292969 14.441406 15.984375 15.097656 15.492188 15.574219 L 10.394531 20.496094 C 9.902344 20.972656 9.222656 21.265625 8.472656 21.265625 C 7.71875 21.265625 7.039062 20.972656 6.546875 20.496094 L 4.996094 19 C 4.507812 18.523438 4.203125 17.867188 4.203125 17.144531 C 4.203125 16.421875 4.507812 15.765625 4.996094 15.289062 L 7.542969 12.824219 C 7.667969 12.707031 7.84375 12.628906 8.035156 12.628906 C 8.417969 12.628906 8.726562 12.929688 8.726562 13.300781 C 8.726562 13.484375 8.648438 13.652344 8.523438 13.773438 L 5.976562 16.234375 C 5.738281 16.46875 5.589844 16.792969 5.589844 17.148438 C 5.589844 17.503906 5.738281 17.824219 5.976562 18.058594 L 7.527344 19.566406 C 7.773438 19.792969 8.105469 19.929688 8.472656 19.929688 C 8.835938 19.929688 9.167969 19.792969 9.414062 19.566406 L 14.511719 14.644531 C 14.753906 14.410156 14.90625 14.089844 14.90625 13.730469 C 14.90625 13.375 14.753906 13.054688 14.511719 12.820312 L 12.964844 11.324219 C 12.839844 11.203125 12.761719 11.039062 12.761719 10.855469 C 12.761719 10.488281 13.070312 10.1875 13.449219 10.1875 Z M 17.082031 3.976562 C 17.082031 3.976562 17.085938 3.976562 17.085938 3.976562 C 17.824219 3.976562 18.492188 4.261719 18.980469 4.722656 L 20.535156 6.203125 C 21.042969 6.679688 21.355469 7.34375 21.355469 8.082031 C 21.355469 8.792969 21.058594 9.441406 20.582031 9.914062 L 18.0625 12.402344 C 17.9375 12.527344 17.761719 12.605469 17.566406 12.605469 C 17.183594 12.605469 16.875 12.304688 16.875 11.9375 C 16.875 11.753906 16.949219 11.589844 17.070312 11.46875 L 19.605469 8.984375 C 19.847656 8.75 19.996094 8.429688 19.996094 8.070312 C 19.996094 7.714844 19.847656 7.394531 19.605469 7.160156 L 18.019531 5.667969 C 17.773438 5.445312 17.4375 5.304688 17.070312 5.300781 C 16.703125 5.304688 16.367188 5.453125 16.128906 5.691406 L 11.085938 10.667969 C 10.84375 10.898438 10.695312 11.222656 10.695312 11.578125 C 10.695312 11.933594 10.84375 12.257812 11.085938 12.488281 L 12.675781 13.980469 C 12.804688 14.101562 12.882812 14.273438 12.882812 14.457031 C 12.882812 14.828125 12.574219 15.128906 12.191406 15.128906 C 12.003906 15.128906 11.832031 15.054688 11.707031 14.9375 L 10.140625 13.457031 C 9.636719 12.980469 9.324219 12.316406 9.324219 11.582031 C 9.324219 10.863281 9.621094 10.214844 10.101562 9.742188 L 15.140625 4.765625 C 15.625 4.285156 16.304688 3.980469 17.054688 3.976562 Z M 17.082031 3.976562").style("fill","var(--primary-color)"),this.copyURIIcon.on("click",(function(){j(n.iri),ge(),i.hide()})).on("mouseover",(function(){i.show("<div style='text-align: center;'><b>Copy to ClipBoard</b><br>"+n.iri+"</div>"),c.cancel(oe),c.cancel(ie)})).on("mouseout",(function(){i.hide(),oe=c((function(){ge()}),500)})),this.closeIcon=d3.select(".menu-events").append("g").attr("class","close-icon").attr("name","remove").attr("transform",(function(){return e(20,n)})),this.closeIcon.append("circle").attr("cx",14).attr("cy",14).attr("r",13).style("fill","#eee"),this.closeIcon.append("path").attr("d","M14.94,14l5.87-5.87a.66.66,0,1,0-.94-.94L14,13.06,8.13,7.19a.66.66,0,0,0-.94.94L13.06,14,7.19,19.87a.66.66,0,1,0,.94.94L14,14.94l5.87,5.87a.66.66,0,1,0,.94-.94Z").style("fill","var(--primary-color)"),this.closeIcon.on("click",(function(){ue(n)})).on("mouseover",(function(){i.show(this.getAttribute("name")),c.cancel(oe),c.cancel(ie)})).on("mouseout",(function(){i.hide(),oe=c((function(){ge()}),500)})),this.animateMenu(n)},this.animateMenu=function(t){let n=0;let r=20;this.expandIcon&&this.expandIcon.transition().duration(100).style("opacity",1).ease("sin").attr("transform",(function(){return e(r,t)})).delay(n+=35),this.collapseIcon&&this.collapseIcon.transition().duration(100).style("opacity",1).ease("sin").attr("transform",(function(){return e(r,t)})).delay(n+=35),this.copyURIIcon.transition().duration(100).style("opacity",1).ease("sin").attr("transform",(function(){return r+=30,e(r,t)})).delay(n+=35),this.focusIcon.transition().duration(100).style("opacity",1).ease("sin").attr("transform",(function(){return r+=30,e(r,t)})).delay(n+=35),this.closeIcon.transition().duration(100).style("opacity",1).ease("sin").attr("transform",(function(){return r+=30,e(r,t)})).delay(n+=35),this.expandedState=!0}};function de(n,r,i){return e.showInfoPanel=!1,e.showPredicates=!1,e.showNodeInfo=!1,i.shiftKey&&(i.ctrlKey||i.metaKey)?(t.$broadcast("onRootNodeChange",n.iri),!1):i.ctrlKey||i.metaKey?(ue(n),!1):void 0!==e.openedNodeInfoPanel&&e.openedNodeInfoPanel===n?(e.pageslideExpanded=!1,e.openedNodeInfoPanel=void 0,!1):(me(n),!0)}function ue(e){Z.removeNode(e),se()}function pe(t){!function(t){e.nodeSelected=!0,null===t.data.types&&(t.data.types="greyColor"),Z=new K,E="translate(0, -70) scale(1)",M.translate([0,-70]),M.scale(1)}(t),fe(t)}function fe(t,n,r){let i=t.data;i=_.filter(i,(function(e){return-1===_.findIndex(Z.links,(function(t){return e.source===t.source.iri&&e.target===t.target.iri}))}));let o=[];const a=Z.tripleLinksCopy.values();for(let e=0;e<Z.tripleLinksCopy.size;e++){a.next().value.forEach(e=>{o.push(e)})}i=_.filter(i,(function(e){return-1===_.findIndex(o,(function(t){return e.source===t.source.iri&&e.target===t.target.iri}))})),i=_.filter(i,(function(e){return e.source!==e.target}));const c=function(e,t){let n=t.map((function(t){return t[e]}));return t.filter((function(t,r){return n.indexOf(t[e])===r}))}("iri",_.union(_.flatten(_.map(t.data,(function(e){return[{iri:e.source,isTriple:e.isTripleSource},{iri:e.target,isTriple:e.isTripleTarget}]}))))),d=_.map(Z.nodes,(function(e){return{iri:e.iri,isTriple:Boolean(e.isTriple)}})),u=Z.tripleNodes.values();for(let e=0;e<Z.tripleNodes.size;e++){u.next().value.forEach(e=>{d.push({iri:e.iri,isTriple:e.isTriple})})}const f=_.reject(c,(function(e){return _.some(d,e)}));if(0===f.length)(r||0===i.length)&&s.info(L.instant("graphexplore.error.node.connections")),Z.addAndMatchLinks(i),se();else{const t=[],r=[],o=O();_.forEach(f,(function(n,i){t.push(l({url:"rest/explore-graph/node",method:"GET",params:{iri:n.isTriple?H(n.iri):n.iri,config:e.configLoaded.id,languages:e.shouldShowSettings()?o.languages:[],includeInferred:o.includeInferred,sameAsState:o.sameAsState}}).then((function(e){r[i]=e.data})))})),p.all(t).then((function(){_.forEach(r,(function(e,t){const i=2*Math.PI*t/r.length,o=(n?n.x:0)+1e3*Math.cos(i)/3,a=(n?n.y:0)+1e3*Math.sin(i)/3;e.isTriple?Z.addTriple(e,o,a):Z.addNode(e,o,a)})),Z.addAndMatchLinks(i),n&&(n.isExpanded=!0),se()}))}}function he(t,n,r){if(ae.getLoadingState())return;ae.init(t,r);const i=O(),o=t.iri;l({url:"rest/explore-graph/links",method:"GET",params:{iri:o,linksLimit:i.linksLimit,includeInferred:i.includeInferred,config:e.configLoaded.id,preferredTypes:e.shouldShowSettings()?i.preferredTypes:[],rejectedTypes:e.shouldShowSettings()?i.rejectedTypes:[],preferredPredicates:e.shouldShowSettings()?i.preferredPredicates:[],rejectedPredicates:e.shouldShowSettings()?i.rejectedPredicates:[],preferredTypesOnly:e.shouldShowSettings()?i.preferredTypesOnly:[],preferredPredicatesOnly:e.shouldShowSettings()?i.preferredPredicatesOnly:[],languages:e.shouldShowSettings()?i.languages:[],sameAsState:i.sameAsState,includeSchema:i.includeSchema}}).then((function(e){fe(e,t,n)}),(function(t){const n=getError(t.data);s.error(n,L.instant("graphexplore.error.exploring.node")),e.loading=!1,ae.setLoadingState(!1)}))}function ge(){angular.isDefined(le)&&le.expandedState&&le.removeIcons()}function me(t){ne.stop(),e.openedNodeInfoPanel=t,e.showNodeInfo=!0,e.showFilter=!1,e.showPredicates=!1,e.nodeLabels=t.labels,e.nodeTypes=t.types,e.rdfRank=t.rdfRank,e.nodeIri=t.iri,e.resourceType=t.isTriple?"triple":"uri",e.encodedIri=t.isTriple?encodeURIComponent(H(t.iri)):encodeURIComponent(t.iri),e.showInfoPanel=!0,e.rdfsLabel=t.labels[0].label,e.rdfsComment=t.comment,e.expanded=!1,e.propertiesQueryObj.query="",e.dataNodeKeysQuery="";const n=O();l.get("rest/explore-graph/properties",{params:{iri:t.isTriple?H(t.iri):t.iri,config:e.configLoaded.id,languages:e.shouldShowSettings()?n.languages:[],includeInferred:n.includeInferred,sameAsState:n.sameAsState,rejectedPredicates:e.shouldShowSettings()?n.rejectedPredicates:[]}}).then((function(t){e.data=_.mapKeys(t.data,(function(t,n){return e.replaceIRIWithPrefix(n)})),e.propertiesObj.items=[],_.forEach(e.data,(function(t,n){e.propertiesObj.items.push({key:n,value:t})})),e.nodeImage=void 0,e.propertiesNotFiltered=e.propertiesObj.items;const n=_.find(e.propertiesObj.items,(function(e){return"image"===e.key}));n&&(e.nodeImage=n.value[0].v),e.propertiesObj.items=_.reject(e.propertiesObj.items,(function(e){return"image"===e.key})),e.propertiesNotFiltered=e.propertiesObj.items}),(function(e){s.warning(getError(e.data),"Error")}))}function ye(e){ve("predicate","var(--primary-color-dark)",e),ve("predicates","var(--primary-color-dark)",e);let t=document.getElementsByClassName("link");t&&_.each(t,(function(t){let n=t.__data__;(n.source.iri.indexOf(e.iri)>=0||n.target.iri.indexOf(e.iri)>=0)&&(t.style.stroke="var(--primary-color-dark)",t.style.strokeWidth=4)}));let n=document.getElementsByClassName("arrow-marker");n&&_.each(n,(function(t){let n=t.__data__;(n.source.iri.indexOf(e.iri)>=0||n.target.iri.indexOf(e.iri)>=0)&&(t.style.stroke="var(--primary-color-dark)",t.__data__.target.isTriple||t.setAttribute("refX","23"))}))}function ve(e,t,n){let r=document.getElementsByClassName(e);r&&_.each(r,(function(e){let r=e.__data__;n?((r.source.iri.indexOf(n.iri)>=0||r.target.iri.indexOf(n.iri)>=0)&&(e.style.fill=t),B(n.iri)===W(r)&&(e.textContent=n.pred,e.style.fill=t),n.oppLinkIRI&&n.oppLinkIRI===W(r)&&(e.textContent=n.oppTriplePred,e.style.fill=t)):(e.style.fill=t,e.textContent=Ie(r))}))}function xe(){_.each(e.predicates,(function(e){let t=document.getElementById(e.linkId+e.nodeIndex);t&&(t.style.fontWeight="normal")}));let t=document.getElementsByClassName("link");t&&_.each(t,(function(e){e.style.stroke="#999",e.style.strokeWidth=1})),ve("predicate",""),ve("predicates","");let n=document.getElementsByClassName("arrow-marker");n&&_.each(n,(function(e){e.style.stroke="#999",e.__data__.target.isTriple||e.setAttribute("refX","59")}))}function Se(e){let t=B(e);if(Z.tripleNodes.has(t))return Z.tripleNodes.get(t).find(t=>t.iri===e)}function Ie(e){return e.predicates.length>1?e.predicates.length+" predicates":we(e.predicates[0])}function we(t){const n=e.replaceIRIWithPrefix(t);return n.length===t.length?t.split("/")[t.split("/").length-1]:n}e.toggleSidePanel=function(){e.pageslideExpanded=!e.pageslideExpanded},e.closeInfoPanel=function(){e.pageslideExpanded=!1,e.openedNodeInfoPanel=void 0,e.predicates=[],R=null,c((function(){e.showInfoPanel=!1}))},e.clickLink=function(t){if(Z.tripleNodes.has(t.linkId)){xe();let n=Z.tripleNodes.get(t.linkId)[t.nodeIndex];me(n),e.showPredicates=!0;let r=document.getElementById(t.linkId+t.nodeIndex);r&&(r.style.fontWeight="bold");let i={};const o=Z.tripleLinksCopy.values();for(let e=0;e<Z.tripleLinksCopy.size;e++){let e=o.next().value;e.length>1&&e.every(t=>t.source.iri===n.iri?(i.iri=e[0].source.iri,t.target.isTriple&&(i.oppLinkIRI=B(t.target.iri),i.oppTriplePred=we(t.target.iri.split(" ")[1])),i.pred=we(n.iri.split(" ")[1]),1===t.predicates.length&&(i.linkPred=t.predicates[0]),!1):t.target.iri!==n.iri||(i.iri=e[0].target.iri,t.source.isTriple&&(i.oppLinkIRI=B(t.source.iri),i.oppTriplePred=we(t.source.iri.split(" ")[1])),i.pred=we(n.iri.split(" ")[1]),1===t.predicates.length&&(i.linkPred=t.predicates[0]),!1))}i.iri||(i.iri=n.iri,i.pred=we(n.iri.split(" ")[1])),ye(i)}},e.splitPredicate=function(e){return e.split("/")[e.split("/").length-1]},e.getActiveRepository=function(){return n.getActiveRepository()},e.isLoadingLocation=function(){return n.isLoadingLocation()},e.hasActiveLocation=function(){return n.hasActiveLocation()},e.rotate=function(e){ge();const t=2*(e?1:-1)*Math.PI/180,n=Math.cos(t),r=Math.sin(t);d3.selectAll(".node-wrapper").each((function(e){e.x=n*(e.x-500)+r*(e.y-500)+500,e.y=-r*(e.x-500)+n*(e.y-500)+500,e.fixed&&(e.px=e.x,e.py=e.y)})),ne.resume()},e.openUri=function(t,n){if(!n){const n={};e.configLoaded.id!==e.defaultGraphConfig.id&&(n.config=e.configLoaded.id),n.uri=t,e.pushHistory(n,{uri:t,config:e.configLoaded})}e.$broadcast("onRootNodeChange",t)},e.saveOrUpdateGraph=function(){const t=JSON.stringify(Z.copyState()),n={id:e.lastSavedGraphId,name:e.lastSavedGraphName,data:t,shared:e.shared};n.id?e.saveGraphModal("update",n):e.saveGraphModal("new",n)},e.renameSavedGraph=function(t){e.saveGraphModal("rename",{id:t.id,name:t.name,config:t.config,shared:t.shared})};const ke=function(t){I.editSavedGraph(t).success((function(){e.lastSavedGraphName=t.name,e.shared=t.shared,e.refreshSavedGraphs(),s.success(L.instant("graphexplore.saved.graph.was.edited",{name:t.name}))})).error((function(e){const t=getError(e);s.error(t,L.instant("graphexplore.error.cannot.edit"))}))};e.saveGraphModal=function(t,n,r){y.open({templateUrl:"js/angular/graphexplore/templates/modal/save-graph.html",controller:"SaveGraphModalCtrl",resolve:{data:function(){return{mode:t,graph:n,graphExists:r,shared:n.shared}}}}).result.then((function(t){if(t.restart)e.saveGraphModal(t.mode,t.graph,!1);else switch(t.mode){case"new":!function(t){e.configLoaded&&(t.config=e.configLoaded.id),I.addNewSavedGraph(t).success((function(n,r,i){e.lastSavedGraphName=t.name,e.lastSavedGraphId=i()["x-saved-graph-id"],e.shared=t.shared,e.refreshSavedGraphs(),s.success(L.instant("graphexplore.saved.graph",{name:t.name}))})).error((function(n,r){if(422===r)e.saveGraphModal("new",t,!0);else{const e=getError(n);s.error(e,L.instant("graphexplore.error.cannot.create.graph"))}}))}(t.graph);break;case"update":case"rename":ke(t.graph)}}))},e.refreshSavedGraphs=function(){I.getSavedGraphs().success((function(t){e.savedGraphs=t})).error((function(e){const t=getError(e);s.error(t,L.instant("graphexplore.error.getting.saved.graphs"))}))},e.loadSavedGraph=function(t,n){t.owner?(e.lastSavedGraphName=t.name,e.lastSavedGraphId=t.id,e.shared=t.shared,e.configLoaded=e.findConfigById(t.config)):(e.lastSavedGraphName=null,e.lastSavedGraphId=null,e.shared=t.shared),e.configLoaded||(e.configLoaded=e.defaultGraphConfig),f.url("?saved="+t.id),Z.restoreState(JSON.parse(t.data)),n||e.pushHistory({saved:t.id},{savedGraph:t})},e.copyToClipboardSavedGraph=function(e){j([location.protocol,"//",location.host,location.pathname,"?saved=",e.id].join(""))},e.deleteSavedGraph=function(t){m.openSimpleModal({title:L.instant("common.confirm"),message:L.instant("graphexplore.confirm.delete.graph",{graphName:t.name}),warning:!0}).result.then((function(){!function(t){I.deleteSavedGraph(t).success((function(){e.refreshSavedGraphs(),s.success(L.instant("graphexplore.saved.graph.was.deleted",{name:t.name}))})).error((function(e){const t=getError(e);s.error(t,L.instant("graphexplore.error.cannot.delete"))}))}(t)}))},e.openIRI=function(t,n){return n.shiftKey?e.$broadcast("onRootNodeChange",t):window.open(t,"_blank"),!1},e.togglePinAllNodes=function(){ge();const t=e.numberOfPinnedNodes<=0;e.numberOfPinnedNodes=0,d3.selectAll(".node").each((function(n){n.fixed=t,t&&e.numberOfPinnedNodes++})),ne.resume()},$("body").on("keydown",(function(t){!C.isActive()&&"input"!==t.target.nodeName&&e.nodeSelected&&(37===t.keyCode?e.rotate(!0):39===t.keyCode&&e.rotate(!1))})),e.getLiteralFromPropValue=function(e){return e.substring(e.indexOf(":")+1)}}function c(e,t,n,r){switch(e.mode=n.mode,e.graph=angular.copy(n.graph),e.graphExists=n.graphExists,e.mode){case"new":e.title=r.instant("graphexplore.create.new.graph"),e.okButtonText=r.instant("common.create.btn");break;case"update":e.title=r.instant("graphexplore.update"),e.okButtonText=r.instant("common.save.btn");break;case"rename":e.title=r.instant("graphexplore.rename"),e.okButtonText=r.instant("common.save.btn")}e.ok=function(){e.form.$valid&&t.close({graph:e.graph,mode:e.mode})},e.saveNew=function(){e.graph.name=e.graph.name+" (new)",t.close({graph:e.graph,mode:"new",restart:!0})},e.cancel=function(){t.dismiss("cancel")}}angular.module("graphdb.framework.graphexplore.controllers.graphviz",["ui.scroll.jqlite","ui.scroll","toastr","ui.bootstrap","ngTagsInput","graphdb.framework.utils.localstorageadapter"]).controller("GraphsVisualizationsCtrl",s).controller("SaveGraphModalCtrl",c).config(["$uibTooltipProvider",function(e){e.options({appendToBody:!0})}]),s.$inject=["$scope","$rootScope","$repositories","$licenseService","toastr","$timeout","$http","ClassInstanceDetailsService","AutocompleteRestService","$q","$location","$jwtAuth","UiScrollService","ModalService","$uibModal","$window","LocalStorageAdapter","LSKeys","SavedGraphsRestService","GraphConfigRestService","RDF4JRepositoriesRestService","$translate","GuidesService"],c.$inject=["$scope","$uibModalInstance","data","$translate"]},298:function(e,t,n){var r,i,o;i=[],void 0===(o="function"==typeof(r=function(){return function(){var e=function(){return"n"},t=function(){return[0,0]},n=function(){return" "},r=u(),i=null,o=null,a=null,s=null;function c(e){var t;i="svg"===(t=(t=e).node()).tagName.toLowerCase()?t:t.ownerSVGElement,o=i.createSVGPoint(),document.body.appendChild(r)}c.show=function(){var r=Array.prototype.slice.call(arguments);r[r.length-1]instanceof SVGElement&&(a=r.pop());var i,o=n.apply(this,r),u=t.apply(this,r),f=e.apply(this,r),h=p(),g=d.length,m=document.documentElement.scrollTop||document.body.scrollTop,y=document.documentElement.scrollLeft||document.body.scrollLeft,v=s.apply(this,r);for(h.html(o).style({opacity:1,"pointer-events":"all"});g--;)h.classed(d[g],!1);return i=l.get(f).apply(this),v?h.style(v):h.classed(f,!0).style({top:i.top+u[0]+m+"px",left:i.left+u[1]+y+"px"}),c},c.hide=function(){return p().style({opacity:0,"pointer-events":"none"}),c},c.attr=function(e,t){if(arguments.length<2&&"string"==typeof e)return p().attr(e);var n=Array.prototype.slice.call(arguments);return d3.selection.prototype.attr.apply(p(),n),c},c.style=function(e,t){if(arguments.length<2&&"string"==typeof e)return p().style(e);var n=Array.prototype.slice.call(arguments);return d3.selection.prototype.style.apply(p(),n),c},c.direction=function(t){return arguments.length?(e=null==t?t:d3.functor(t),c):e},c.offset=function(e){return arguments.length?(t=null==e?e:d3.functor(e),c):t},c.html=function(e){return arguments.length?(n=null==e?e:d3.functor(e),c):n},c.customPosition=function(e){return arguments.length?(s=null==e?e:d3.functor(e),c):s},c.destroy=function(){return r&&(p().remove(),r=null),c};var l=d3.map({n:function(){var e=f();return{top:e.n.y-r.offsetHeight,left:e.n.x-r.offsetWidth/2}},s:function(){var e=f();return{top:e.s.y,left:e.s.x-r.offsetWidth/2}},e:function(){var e=f();return{top:e.e.y-r.offsetHeight/2,left:e.e.x}},w:function(){var e=f();return{top:e.w.y-r.offsetHeight/2,left:e.w.x-r.offsetWidth}},nw:function(){var e=f();return{top:e.nw.y-r.offsetHeight,left:e.nw.x-r.offsetWidth}},ne:function(){var e=f();return{top:e.ne.y-r.offsetHeight,left:e.ne.x}},sw:function(){var e=f();return{top:e.sw.y,left:e.sw.x-r.offsetWidth}},se:function(){var e=f();return{top:e.se.y,left:e.e.x}}}),d=l.keys();function u(){var e=d3.select(document.createElement("div"));return e.style({position:"absolute",top:0,opacity:0,"pointer-events":"none","box-sizing":"border-box"}),e.node()}function p(){return null===r&&(r=u(),document.body.appendChild(r)),d3.select(r)}function f(){for(var e=a||d3.event.target;void 0===e.getScreenCTM&&"undefined"===e.parentNode;)e=e.parentNode;var t={},n=e.getScreenCTM(),r=e.getBBox(),i=r.width,s=r.height,c=r.x,l=r.y;return o.x=c,o.y=l,t.nw=o.matrixTransform(n),o.x+=i,t.ne=o.matrixTransform(n),o.y+=s,t.se=o.matrixTransform(n),o.x-=i,t.sw=o.matrixTransform(n),o.y-=s/2,t.w=o.matrixTransform(n),o.x+=i,t.e=o.matrixTransform(n),o.x-=i/2,o.y-=s/2,t.n=o.matrixTransform(n),o.y+=s,t.s=o.matrixTransform(n),t}return c}})?r.apply(t,i):r)||(e.exports=o)},301:function(e,t,n){"use strict";var r=r||{};r.Text=function(){function e(e,t,n,r){n=n||10;var i=t/3;return"string"==typeof e?(i*=10/(e.substring(0,t/3).length+1.5),i+=1,e.match(/[\u0900-\u0DFF\u1100-\u11FF\u2E80-\u2EFF\u3000-\u9FFF]/)&&(i*=.6),i<n&&(i=n),Math.round(i)):(i<n&&(i=n),Math.round(i))}return{calcFontSizeRaw:e,calcFontSize:function(t,n,r,i){return e(t,n,r)+"px"},getTextWithElipsisIfNeeded:function(e,t){return"string"==typeof e&&e.length>t?e.substring(0,t-3)+"...":e}}}(),r.Transition={fadeIn:function(e,t){e.style("opacity",0).transition().duration(t).style("opacity",1)},fadeOut:function(e,t){e.style("opacity",1).transition().duration(t).style("opacity",0)}},r.Click={delayDblClick:function(){var e=d3.dispatch("click","dblclick");return d3.rebind((function(t){var n,r=null;t.on("mousedown",(function(){n=d3.mouse(document.body),new Date})),t.on("mouseup",(function(t){var i,o;i=n,o=d3.mouse(document.body),Math.sqrt(Math.pow(i[0]-o[0],2),Math.pow(i[1]-o[1],2))>5||(r?(window.clearTimeout(r),r=null,e.dblclick(t)):r=window.setTimeout((d3.event,function(){e.click(t),r=null}),250))}))}),e,"on")}},t.a=r},77:function(e,t,n){"use strict";n.r(t),n.d(t,"STATIC_RULESETS",(function(){return r})),n.d(t,"REPOSITORY_TYPES",(function(){return i})),n.d(t,"FILENAME_PATTERN",(function(){return o})),n.d(t,"NUMBER_PATTERN",(function(){return a}));const r=[{id:"empty",name:"No inference"},{id:"rdfs-optimized",name:"RDFS (Optimized)"},{id:"rdfs",name:"RDFS"},{id:"rdfsplus-optimized",name:"RDFS-Plus (Optimized)"},{id:"owl-horst-optimized",name:"OWL-Horst (Optimized)"},{id:"owl-horst",name:"OWL-Horst"},{id:"owl2-ql-optimized",name:"OWL2-QL (Optimized)"},{id:"owl2-ql",name:"OWL2-QL"},{id:"owl-max-optimized",name:"OWL-Max (Optimized)"},{id:"owl-max",name:"OWL-Max"},{id:"owl2-rl-optimized",name:"OWL2-RL (Optimized)"},{id:"owl2-rl",name:"OWL2-RL"}],i={graphdbRepo:"graphdb",free:"free",eeWorker:"worker",eeMaster:"master",ontop:"ontop",se:"se",fedx:"fedx"},o=new RegExp("^[a-zA-Z0-9-_]+$"),a=new RegExp("^[0-9]+$")}}]);
1
+ (window.webpackJsonp=window.webpackJsonp||[]).push([[30,130],{107:function(e,t,n){"use strict";n.r(t);n(7);var r=n(301),i=n(298),o=n.n(i),a=(n(10),n(77));function s(e,t,n,i,s,c,l,d,u,p,f,h,g,m,y,v,x,S,I,w,k,L,C){e.languageChanged=!1,e.propertiesObj={},e.propertiesQueryObj={},e.propertiesObj.items=[],e.propertiesNotFiltered=[],e.searchVisible=!1,e.nodeSelected=!1,e.queryResultsMode=!1,e.embedded=f.search().embedded,e.openedNodeInfoPanel=void 0,e.invalidLimit=!1,e.INVALID_LINKS_MSG=L.instant("sidepanel.invalid.limit.links.msg"),e.INVALID_LINKS_TOOLTIP=L.instant("sidepanel.invalid.limit.links.tooltip"),t.$on("$translateChangeSuccess",(function(){e.INVALID_LINKS_MSG=L.instant("sidepanel.invalid.limit.links.msg"),e.INVALID_LINKS_TOOLTIP=L.instant("sidepanel.invalid.limit.links.tooltip"),e.propertiesSearchPlaceholder=L.instant("visual.search.instance.placeholder")})),e.onopen=e.onclose=()=>angular.noop(),e.embedded&&(f.search().query||f.search().uri||f.search().config||f.search().saved)&&(e.noGoHome=!0);const T={};let b=0,N=0,P={},A=0;const M=d3.behavior.zoom().scaleExtent([.5,10]);let E;let G,R;function O(){return C.isActive()?e.defaultSettings:e.saveSettings}function j(e){m.openCopyToClipboardModal(e)}function z(){e.settings.languagesMap=_.map(e.settings.languages,(function(e){return{text:e}})),e.settings.preferredTypesMap=_.map(e.settings.preferredTypes,(function(e){return{text:e}})),e.settings.rejectedTypesMap=_.map(e.settings.rejectedTypes,(function(e){return{text:e}})),e.settings.preferredPredicatesMap=_.map(e.settings.preferredPredicates,(function(e){return{text:e}})),e.settings.rejectedPredicatesMap=_.map(e.settings.rejectedPredicates,(function(e){return{text:e}}))}t.key="",T.get=function(t,n,r){return g.initLazyList(t,n,r,b,e.propertiesObj.items)},t.$watch((function(){return t.key}),(function(){b=0,_.each(e.propertiesObj.items,(function(e){t.key>e&&b++})),N++})),T.revision=function(){return N},e.datasource=T,e.adapterContainer={adapter:{remain:!0}},e.propertiesQueryObj.query="",e.propertiesSearchPlaceholder=L.instant("visual.search.instance.placeholder"),e.propertiesFilterFunc=function(t){return t.key.toLowerCase().indexOf(e.propertiesQueryObj.query.toLowerCase())>=0},e.resetState=function(){e.searchVisible=!1,e.nodeSelected=!1,e.configLoaded=null,e.queryResultsMode=!1,e.lastSavedGraphName=null,e.lastSavedGraphId=null,e.shared=!1,e.numberOfPinnedNodes=0,P={},A=0},e.pushHistory=function(t,n){e.embedded&&(t.embedded=!0),f.search(t),f.state(n)},e.goToHome=function(){e.resetState(),f.url("graphs-visualizations")},e.shouldShowSettings=function(){return e.configLoaded&&e.configLoaded.id===e.defaultGraphConfig.id},e.shouldDisableSameAs=function(){const t=$("#sameAsCheck");return e.settings&&!e.settings.includeInferred&&t.prop("checked")&&(t.prop("checked",!1),e.settings.sameAsState=!1),e.settings&&!e.settings.includeInferred},e.$watch("propertiesObj.items",(function(){angular.isDefined(e.propertiesObj.items)&&e.propertiesObj.items.length>0&&c((function(){e.adapterContainer.adapter.reload()}),500)})),e.toggleMoreInfo=function(e){angular.element(e.currentTarget).parent().next().toggle(200),angular.element(e.currentTarget).children("span").toggleClass("icon-caret-down").toggleClass("icon-caret-up")},e.copyToClipboard=j,e.defaultSettings={linksLimit:20,includeInferred:!0,sameAsState:!0,languages:["en"],showLinksText:!0,preferredTypes:[],rejectedTypes:[],preferredPredicates:[],rejectedPredicates:["http://dbpedia.org/property/logo","http://dbpedia.org/property/hasPhotoCollection","http://dbpedia.org/property/website","http://dbpedia.org/property/homepage","http://dbpedia.org/ontology/thumbnail","http://xmlns.com/foaf/0.1/depiction","http://xmlns.com/foaf/0.1/homepage","http://xmlns.com/foaf/0.1/mbox","http://dbpedia.org/ontology/wikiPage*","http://dbpedia.org/property/wikiPage*","http://factforge.net/*"],preferredTypesOnly:!1,preferredPredicatesOnly:!1,includeSchema:!0},e.saveSettings=angular.copy(e.defaultSettings),p.when(h.getPrincipal()).then(t=>function(t){const n=t.appSettings;e.defaultSettings.includeInferred=n.DEFAULT_INFERENCE,e.defaultSettings.sameAsState=n.DEFAULT_INFERENCE&&n.DEFAULT_SAMEAS,e.defaultSettings.includeSchema=n.DEFAULT_VIS_GRAPH_SCHEMA;const r=x.get(S.GRAPHS_VIZ);if(r&&"object"==typeof r)try{e.saveSettings=r,void 0===e.saveSettings.includeSchema&&(e.saveSettings.includeSchema=e.defaultSettings.includeSchema,e.saveSettings.rejectedPredicates=[...e.saveSettings.rejectedPredicates,...e.defaultSettings.rejectedPredicates].unique())}catch(t){e.saveSettings=angular.copy(e.defaultSettings),x.set(S.GRAPHS_VIZ,e.saveSettings)}else e.saveSettings=angular.copy(e.defaultSettings)}(t)),e.resetSettings=function(){e.settings=angular.copy(e.defaultSettings),e.validateLinksLimit(),z()},e.changeLimit=function(t){let n=e.settings.linksLimit+t;n<1&&(n=1),n>1e3&&(n=1e3),e.settings.linksLimit=n},e.validateLinksLimit=function(){e.invalidLimit=!a.NUMBER_PATTERN.test(e.settings.linksLimit)},e.showSettings=function(){e.showInfoPanel=!0,e.showFilter=!0,e.showNodeInfo=!1,e.showPredicates=!1,e.saveSettings?e.settings=angular.copy(e.saveSettings):e.settings=angular.copy(e.defaultSettings),z()},e.reExpandNode=function(){e.rootNodeIri&&e.$broadcast("onRootNodeChange",e.rootNodeIri)};const D=function(t,n,r){const i=O(),o=void 0===n?i.sameAsState:!0===n,a=void 0===r?i.includeInferred:!0===r;e.loading=!0,l({url:"rest/explore-graph/graph",method:"POST",headers:{"Content-Type":"application/json"},data:{query:t,linksLimit:i.linksLimit,languages:e.shouldShowSettings()?i.languages:[],includeInferred:a,sameAsState:o}}).then((function(e){pe(e)}),(function(t){e.loading=!1,s.error(getError(t.data),L.instant("graphexplore.error.cannot.load.graph"))}))};function F(e){return e.replace(/[()']/g,"")}function B(e,t){let n=e.split(" ");return t?[n[0],n[1],n[2]].join(">"):[n[0],n[2]].join(">")}function W(e){return[e.source.iri,e.target.iri].join(">")}function U(e){if(e.isTriple){let t=document.getElementById(F(B(e.iri)));if(t&&void 0!==t.__data__.x)return t.__data__.x}return e.x}function q(e){if(e.isTriple){let t=document.getElementById(F(B(e.iri)));if(t&&void 0!==t.__data__.y)return t.__data__.y}return e.y}function H(e){let t=e.trim().split(" ");return`<<<${t[0]}> <${t[1]}> <${t[2]}>>>`}function V(e){return F(`${e.source.isTriple?B(e.source.iri,!0):e.source.iri}>${e.target.isTriple?B(e.target.iri,!0):e.target.iri}>marker`)}function K(){this.nodes=[],this.links=[],this.tripleNodes=new Map,this.tripleLinksCopy=new Map,this.addNode=function(e,t,n){return e.x=t,e.y=n,this.nodes.push(e),e},this.computeConnectedness=function(){const e={},t={};_.each(this.links,(function(n){const r=n.source.iri,i=n.target.iri,o=_.min([r,i])+"|"+_.max([r,i]);t[o]||(t[o]=1,e[r]=(e[r]||0)+1,e[i]=(e[i]||0)+1)})),_.each(this.links,(function(t){e[t.source.iri]>1&&e[t.target.iri]>1?t.connectedness=Math.min(5,Math.max(e[t.source.iri],e[t.target.iri])-1):t.connectedness=0}))},this.addAndMatchLinks=function(e){const t=this.nodes;Array.prototype.push.apply(this.links,function(e,t){return _.map(e,(function(e){let n,r;n=e.isTripleSource?Se(e.source):_.find(t,(function(t){return t.iri===e.source})),r=e.isTripleTarget?Se(e.target):_.find(t,(function(t){return t.iri===e.target}));let i={source:n,target:r,predicates:e.predicates};if(e.isTripleSource||e.isTripleTarget){let e=`${i.source.isTriple?B(i.source.iri):i.source.iri}>${i.target.isTriple?B(i.target.iri):i.target.iri}`;if(Z.tripleLinksCopy.has(e)){let t=Z.tripleLinksCopy.get(e);return t[0].predicates.push(...i.predicates),t.push(i),Z.tripleLinksCopy.set(e,t),null}Z.tripleLinksCopy.set(e,[i])}return i}))}(e,t));for(let e of Z.tripleLinksCopy.keys())1===Z.tripleLinksCopy.get(e).length&&Z.tripleLinksCopy.delete(e);this.links=this.links.filter(e=>null!==e),this.computeConnectedness()};const t=function(e,t){return n(e,t).length};function n(e,t){return _.filter(t,(function(t){return t.source.iri===e.iri||t.target.iri===e.iri}))}this.countLinks=t,this.linksTypes=function(e,t){const r=n(e,t),i=_.map(r,(function(t){return t.source.iri===e.iri?t.target.types:t.source.types}));return _.uniq(_.flatten(i))},this.linksPredicates=function(e,t){const r=n(e,t),i=_.map(r,(function(e){return e.predicates}));return _.uniq(_.flatten(i))},this.removeTriples=function(e){let t=[];this.tripleNodes.size>0&&e.forEach(e=>{this.tripleNodes.has(e)&&(this.tripleNodes.delete(e),this.links=_.reject(this.links,(function(n){let r=e.split(">"),i=B(n.source.iri),o=B(n.target.iri);if(i===e&&Z.tripleNodes.delete(o)){let e=o.split(">");t.push({source:e[0],target:e[1]})}let a=i===e||o===e||n.source.iri===r[0]&&n.target.iri===r[1];return a&&(Z.tripleLinksCopy.delete(`${i}>${o}`),Z.tripleLinksCopy.delete(`${o}>${i}`)),a})))}),t.forEach(e=>{this.links=_.reject(this.links,(function(t){return t.source.iri===e.source&&t.target.iri===e.target}))})},this.removeNode=function(n){let r=[];this.links=_.reject(this.links,(function(e){let t=e.source.iri===n.iri||e.target.iri===n.iri;return t&&(e.target.isTriple&&r.push(B(e.target.iri)),e.source.isTriple||e.target.isTriple||r.push([e.source.iri,e.target.iri].join(">"))),t})),this.removeTriples(r);const i=this.links;this.nodes=_.reject(this.nodes,(function(e){return 0===t(e,i)})),0===this.nodes.length&&(e.nodeSelected=!1),this.computeConnectedness()},this.removeNodeLeafLinks=function(e){let r=[],i=this.links;this.links=_.reject(this.links,(function(o){let a=o.source.iri===e.iri&&1===t(o.target,i)&&!o.target.isTriple||o.target.iri===e.iri&&1===t(o.source,i)&&!o.source.isTriple;if(!a){let r;if(o.source.iri!==e.iri||2!==t(o.target,i)||o.target.isTriple?o.target.iri!==e.iri||2!==t(o.source,i)||o.source.isTriple||(r=n(o.source,i)):r=n(o.target,i),!r)return!1;a=(r[0].source.iri===e.iri||r[0].target.iri)&&(r[1].source.iri===e.iri||r[1].target.iri)}return a&&(o.target.isTriple&&r.push(B(o.target.iri)),o.source.isTriple||o.target.isTriple||r.push([o.source.iri,o.target.iri].join(">"))),a})),this.removeTriples(r),i=this.links,this.nodes=_.reject(this.nodes,(function(n){return 0===t(n,i)&&n.iri!==e.iri})),this.computeConnectedness()},this.addTriple=function(e,t,n){e.x=t,e.y=n,e.weight=0;let r=B(e.iri);if(this.tripleNodes.has(r)){let t=this.tripleNodes.get(r);t.push(e),this.tripleNodes.set(r,t)}else e.weight=10,this.tripleNodes.set(r,[e])},this.copyState=function(){const e=_.map(this.nodes,(function(e){return{iri:e.iri,isTriple:e.isTriple,size:e.size,labels:angular.copy(e.labels),types:angular.copy(e.types),rdfRank:e.rdfRank,x:e.x,y:e.y,fixed:e.fixed}})),t=JSON.stringify(Array.from(this.tripleNodes.entries())),n=JSON.stringify(Array.from(this.tripleLinksCopy.entries()));return{nodes:e,links:_.map(this.links,(function(e){return{source:e.source.iri,isTripleSource:e.source.isTriple,target:e.target.iri,isTripleTarget:e.target.isTriple,predicates:e.predicates}})),tripleNodes:t,tripleLinksCopy:n,colorIndex:A,type2color:P,scale:M.scale(),translate:M.translate()}},this.restoreState=function(t){e.nodeSelected=!0,e.searchVisible=!1,this.nodes=angular.copy(t.nodes),this.tripleNodes=t.tripleNodes?new Map(JSON.parse(t.tripleNodes)):new Map,this.links=[],this.addAndMatchLinks(t.links),this.tripleLinksCopy=t.tripleLinksCopy?new Map(JSON.parse(t.tripleLinksCopy)):new Map,_.each(this.nodes,(function(t){t.fixed&&e.numberOfPinnedNodes++})),angular.isDefined(t.colorIndex)&&angular.isDefined(t.type2color)&&(A=t.colorIndex,P=angular.copy(t.type2color)),angular.isDefined(t.translate)&&angular.isDefined(t.scale)&&(E="translate("+t.translate[0]+", "+t.translate[1]+") scale("+t.scale+")",M.translate(t.translate),M.scale(t.scale)),se()}}e.updateSettings=function(){e.invalidLimit?s.error(e.INVALID_LINKS_TOOLTIP,e.INVALID_LINKS_MSG):(e.saveSettings=e.settings,e.saveSettings.languages=_.map(e.saveSettings.languagesMap,(function(e){return e.text})),e.saveSettings.preferredTypes=_.map(e.saveSettings.preferredTypesMap,(function(e){return e.text})),e.saveSettings.rejectedTypes=_.map(e.saveSettings.rejectedTypesMap,(function(e){return e.text})),e.saveSettings.preferredPredicates=_.map(e.saveSettings.preferredPredicatesMap,(function(e){return e.text})),e.saveSettings.rejectedPredicates=_.map(e.saveSettings.rejectedPredicatesMap,(function(e){return e.text})),e.rootNodeIri?e.reExpandNode(e.rootNodeIri):e.queryResultsMode&&f.search().query?D(f.search().query,f.search().sameAs,f.search().inference):"query"===e.configLoaded.startMode&&e.loadGraphConfig(e.configLoaded),O().showLinksText?d3.selectAll("svg .link-wrapper text").style("display","block"):d3.selectAll("svg .link-wrapper text").style("display","none"),e.showInfoPanel=!1,e.showFilter=!1,x.set(S.GRAPHS_VIZ,e.saveSettings))},e.showInfoPanel=!1;let Z=new K;e.defaultGraphConfig={id:"default",name:"Easy graph",startMode:"search"},e.getGraphConfigs=function(t){w.getGraphConfigs().success((function(n){e.graphConfigs=n,t&&t()})).error((function(e){s.error(getError(e),L.instant("graphexplore.error.graph.configs.short.msg"))}))},e.loadConfigForId=function(t,n){t===e.defaultGraphConfig.id?e.loadGraphConfig(e.defaultGraphConfig):w.getConfig(t).success((function(t){e.loadGraphConfig(t),n()})).error((function(e){s.error(getError(e),L.instant("graphexplore.error.could.not.load.config",{configId:t}))}))},e.findConfigById=function(t){return t===e.defaultGraphConfig.id?e.defaultGraphConfig:$.grep(e.graphConfigs,(function(e){return e.id===t}))[0]},e.easyGraphSearch=function(t){e.configLoaded=e.defaultGraphConfig,e.openUri(t)},e.loadGraphConfig=function(t){e.configLoaded=t,"search"===t.startMode?e.searchVisible=!0:"node"===t.startMode&&t.startIRI?c((function(){e.openUri(t.startIRI,!0)}),0):"query"===t.startMode&&t.startGraphQuery&&(e.loading=!0,w.loadGraphForConfig(t,t.startQueryIncludeInferred,O().linksLimit,t.startQuerySameAs).then((function(e){pe(e)}),(function(t){e.loading=!1,s.error(getError(t),L.instant("graphexplore.error.graph.load"))})))},e.deleteConfig=function(t){m.openSimpleModal({title:L.instant("common.confirm"),message:L.instant("graphexplore.delete.graph",{configName:t.name}),warning:!0}).result.then((function(){w.deleteGraphConfig(t).success((function(){e.getGraphConfigs(),e.refreshSavedGraphs()})).error((function(e){s.error(getError(e),L.instant("graphexplore.error.cannot.delete.config"))}))}))},e.goToGraphConfig=function(t){e.pushHistory({config:t.id},{config:t}),e.resetState(),e.loadGraphConfig(t)},v.onpopstate=function(t){e.resetState(),t.state&&(t.state.config?(e.loadGraphConfig(t.state.config),t.state.uri&&e.openUri(t.state.uri,!0)):t.state.savedGraph&&e.loadSavedGraph(t.state.savedGraph,!0))};const Q=function(){f.search().query?(e.searchVisible=!1,e.queryResultsMode=!0,D(f.search().query,f.search().sameAs,f.search().inference)):e.$on("onRootNodeChange",(function(t,n){e.loading=!0;const r=O();angular.isDefined(n)&&(e.rootNodeIri=n,l({url:"rest/explore-graph/node",method:"GET",params:{iri:n,config:e.configLoaded?e.configLoaded.id:e.defaultGraphConfig.id,languages:e.shouldShowSettings()?r.languages:[],includeInferred:r.includeInferred,sameAsState:r.sameAsState}}).then((function(t){e.nodeSelected=!0,e.searchVisible=!1,null===t.data.types&&(t.data.types="greyColor"),Z=new K;const n=Z.addNode(t.data,500,500);E="translate(0, -70) scale(1)",M.translate([0,-70]),M.scale(1),he(n,!0)})).catch((function(t){e.loading=!1,s.error(getError(t),L.instant("graphexplore.error.could.not.load.graph"))})))})),f.search().uri&&e.openUri(f.search().uri,!0),f.search().saved&&I.getSavedGraph(f.search().saved).success((function(t){e.loadSavedGraph(t)})).error((function(e){const t=getError(e);s.error(t,L.instant("graphexplore.error.could.not.open"))}))},J=function(){f.search().config?e.loadConfigForId(f.search().config,Q):f.search().query||f.search().uri?(e.loadGraphConfig(e.defaultGraphConfig),Q()):Q()};function Y(t){!n.getActiveRepository()||e.hasInitedRepository&&!t||(e.hasInitedRepository=!0,t||e.getGraphConfigs(J),e.getNamespacesPromise=k.getNamespaces(e.getActiveRepository()).success((function(t){const n=_.map(t.results.bindings,(function(e){return{uri:e.namespace.value,prefix:e.prefix.value}}));e.namespaces=_.sortBy(n,(function(e){return e.uri.length})),X()})).error((function(e){s.error(getError(e),L.instant("graphexplore.error.view.will.not.work"))})))}function X(){i.isLicenseValid()&&(e.getAutocompletePromise=u.checkAutocompleteStatus())}e.replaceIRIWithPrefix=function(t){const n=e.namespaces,r=_.findLast(n,(function(e){return 0===t.indexOf(e.uri)}));return r?r.prefix+":"+t.substring(r.uri.length):t},e.addedTag=function(t){return t.text.indexOf(":")<0?(s.warning(L.instant("graphexplore.absolute.prefixed.iri")),null):(t.text=function(e,t){if(!/^<?(http|urn).*>?/.test(e)){const n=e.split(":"),r=n[0],i=n[1];if(!angular.isUndefined(i)){const e=d.getNamespaceUriForPrefix(t,r);if(e)return e+i}}return e}(t.text,e.namespaces),e.pageslideExpanded=!0,t)},e.validateTag=function(e,t,n){if(e.text.indexOf(":")<0)return n?s.warning(L.instant("graphexplore.absolute.prefixed.iri.option"),t):s.warning(L.instant("graphexplore.absolute.prefixed.iri"),t),!1;const r=e.text.indexOf("*");if(r>=0){if(!n)return s.warning(L.instant("graphexplore.wildcards.not.allowed"),t),!1;if(r<e.text.length-1)return s.warning(L.instant("graphexplore.wildcards.last.char"),t),!1}return!0},e.getTagClass=function(e){return e.endsWith("*")?"tag-item-wildcard":null},e.getActiveRepository=function(){return n.getActiveRepository()},e.isLicenseValid=function(){return i.isLicenseValid()},e.hasInitedRepository=!1,e.$on("autocompleteStatus",(function(){X()})),e.$on("repositoryIsSet",(function(t,n){n.newRepo&&(e.hasInitedRepository=!1),Y(n.newRepo),n.newRepo&&(e.resetState(),$(".graph-visualization svg").empty(),f.search().query&&(e.goToHome(),Q()))})),Y();const ee=d3.scale.linear().domain([0,9]).range(["hsl(0, 100%, 75%)","hsl(360, 90%, 82%)"]).interpolate(d3.interpolateHslLong),te=d3.scale.linear().domain([0,9]).range(["hsl(180, 50%, 75%)","hsl(540, 40%, 82%)"]).interpolate(d3.interpolateHslLong);e.getColor=function(e){angular.isUndefined(P[e])&&(P[e]=A,A++);const t=P[e];return t>39?"#c2c2c2":t%2==0?ee(t/2):te(t/2)};const ne=d3.layout.force().gravity(.07).size([1e3,1e3]),re=d3.select(".main-container .graph-visualization").append("svg").attr("viewBox","0 0 1000 1000").attr("preserveAspectRatio","xMidYMid meet");let ie=0,oe=0;const ae=new function(){this.state=!1,this.setLoadingState=function(e){this.state=e},this.getLoadingState=function(){return this.state},this.init=function(e,t){d3.select(t).append("circle").attr("cx",(function(){return e.x})).attr("cy",(function(){return e.y})).attr("class","loader-container").attr("r",(function(){return e.size})).style("fill","fff").style("opacity","0.7"),d3.select(t).append("image").attr("xlink:href","js/angular/templates/loader/ot-loader.svg?v=2.4.2").attr("x",(function(){return e.x-e.size+5})).attr("y",(function(){return e.y-e.size})).attr("width",(function(){return 2*e.size})).attr("height",(function(){return 2*e.size})).attr("class","node-loader")}};function se(t){d3.selectAll("svg g").remove(),d3.selectAll("svg rect").remove(),d3.selectAll(".d3-tip").remove(),d3.selectAll(".menu-events").remove(),M.on("zoom",(function(){if(C.isActive())return;E="translate("+d3.event.translate+") scale("+d3.event.scale+")",n.attr("transform",E)})),re.append("rect").attr("width",1e4).attr("height",1e4).attr("x",-4500).attr("y",-4500).style("fill","none").style("pointer-events","all").call(M).on("click",(function(){d3.event.stopPropagation(),ge(),ne.stop()}));const n=re.append("g").attr("class","nodes-container").attr("transform",(function(){return angular.isDefined(E)&&!t?E:""})),i=o()().attr("class","d3-tip").customPosition((function(){const e=G.getBoundingClientRect();return{top:e.bottom+10+"px",left:e.left-30+"px"}})).html((function(t){let n="";return t.fixed&&(n+='<i class="icon-pin"></i>&nbsp;&nbsp;'),t.types.length>0?n+=_.join(_.map(t.types,(function(t){return e.replaceIRIWithPrefix(t)}))," · "):n+="<i>No types</i>",n})),a=function(e){let t="";return t+=_.join(_.map(e.predicates,(function(t,n){if(0===n)return we(t);if(n<10)return" · "+we(t);if(10===n){const t=function(e){return e.predicates.length-10}(e),n=t>1?t+" predicates":t+" predicate";return" · "+L.instant("graphexplore.tip.text",{textToShow:n})}})),""),t};let l;const d=o()().attr("class","d3-tip").customPosition((function(e){const t=l.getBoundingClientRect(),n=function(e){const t=a(e),n=document.createElement("canvas").getContext("2d");return n.font="13px Arial",e.predicates.length<10?n.measureText(t).width:n.measureText(t).width/2}(e);return{top:t.top-30+"px",left:t.left-30+"px",width:n+"px"}})).html((function(e){return a(e)}));const u=function(){c.cancel(void 0),c.cancel(ie),G=null,i.hide(),oe=c((function(){ge()}),500)};re.call(i);re.call(d);let p=re.selectAll(".link"),f=re.selectAll(".node");ne.nodes(Z.nodes).charge(-3e3),ne.links(Z.links).linkDistance((function(e){return e.source.isTriple||e.target.isTriple?0:function(e){const t=$("<span></span>"),n=e.predicates[0].split("/"),r=n[n.length-1];t.addClass("predicate-text").text(r),$("body").append(t);const i=t.width()+2*e.source.size+2*e.target.size+50;return t.remove(),.75*i}(e)+30*e.connectedness})),n.append("defs").selectAll("marker").data(ne.links()).enter().append("marker").attr("class","arrow-marker").attr("id",(function(e){return V(e)})).attr("viewBox","0 -5 10 10").attr("refX",(function(e){return e.target.isTriple?11:e.target.size+11})).attr("refY",0).attr("markerWidth",10).attr("markerHeight",10).attr("orient","auto").append("path").attr("d","M0,-5L10,0L0,5 L10,0 L0, -5"),p=n.selectAll(".link").data(Z.links).enter().append("g").attr("class","link-wrapper").attr("id",(function(e){return F(W(e))})).append("line").attr("class","link").style("stroke-width",1).style("fill","transparent").style("marker-end",(function(e){return`url(#${V(e)})`}));const h=n.selectAll(".link-wrapper").append("text").text((function(e){return Ie(e)})).attr("class",(function(e){return e.predicates.length>1||Z.tripleNodes.has(W(e))?"predicates":"predicate"})).attr("dy","-0.5em").style("text-anchor","middle").style("display",O().showLinksText?"":"none").on("mouseover",(function(e){d3.event.stopPropagation(),function(e){c.cancel(void 0);const t=l=d3.event.target;c((function(){l===t&&e.predicates.length>1&&d.show(e,l)}),300)}(e)})).on("mouseout",(function(){c.cancel(void 0),l=null,d.hide()})).on("click",(function(t){d3.event.stopPropagation(),function(t){xe();let n=W(t);if(1===t.predicates.length&&Z.tripleNodes.has(n)){R=null;let e=Z.tripleNodes.get(n)[0];if(de(e,this,d3.event.button)){let t={};t.iri=e.iri,t.pred=we(e.iri.split(" ")[1]),ye(t)}return}!function(t){if(e.showNodeInfo=!1,e.showPredicates=t.predicates.length>1,e.showFilter=!1,e.showInfoPanel=!1,R===t)return e.showNodeInfo=!1,e.showInfoPanel=!1,void(R=null);R=t,e.showPredicates&&(e.predicates=_.map(t.predicates,(function(e){let n=function(e,t){let n=W(t);return Z.tripleNodes.has(n)?Z.tripleNodes.get(n).findIndex(t=>t.iri.indexOf(e)>=0):-1}(e,t),r=n>-1;return{value:we(e),partOfTriple:r,linkId:r?W(t):"",nodeIndex:n}})),e.showInfoPanel=!0)}(t)}(t)}));let g,m=0,y=0,v=0;const x=function(){d3.event.button&&0!==d3.event.button||(u(),c.cancel(g),e.showPredicates=!1,d3.event.timeStamp-m<500?y++:y=1,m=d3.event.timeStamp,d3.event.preventDefault())},S=function(t,n,r){Z.countLinks(t,Z.links)<=O().linksLimit?he(t,!1,r||this.parentNode):s.info(L.instant("graphexplore.increase.limit"),L.instant("graphexplore.node.at.max")),e.closeInfoPanel()},I=function(e){if(d3.event.button&&0!==d3.event.button)return;c.cancel(g);const t=d3.event,n=this;C.isActive()||d3.event.timeStamp-m<500&&(1===y?g=c((function(){de(e,n,t)}),540-(d3.event.timeStamp-m)):2===y&&S(e,0,n.parentNode)),d3.event.preventDefault()};function w(e,t){let r,i,o,a,s=!0;if("down"===t)r=2*e.size,i=e.size/3,o=.8,a=.3;else if("down-fixed"===t)r=2*e.size,i=e.size,o=.8,a=.66;else if("up"===t)r=e.size/3,i=2*e.size,o=.3,a=.8;else{if("fixed"!==t)return;r=e.size,o=.66,s=!1}let c=n.selectAll(".node-wrapper").filter((function(t){return t===e})).append("text").text("").classed("icon-any pinned",!0).style("font-size",r+"px").attr("x",(function(e){return e.x})).attr("y",(function(e){return e.y})).attr("opacity",o);"fixed"!==t&&"down-fixed"!==t||(e.pin=c),s&&(c=c.transition().duration(1e3).style("font-size",(function(){return i+"px"})).attr("opacity",a),"down-fixed"!==t&&c.remove())}const k=d3.behavior.drag().origin((function(e){return e})).on("dragstart",(function(e){if(C.isActive())return;0===d3.event.sourceEvent.button&&(e.fixedBeforeDrag=e.fixed,e.isBeingDragged=!0,e.beginDragging=!0,ge(),d3.event.sourceEvent.stopPropagation(),d3.select(this).classed("dragging",!0))})).on("drag",(function(t){t.isBeingDragged&&(y=0,t.px=d3.event.x,t.py=d3.event.y,t.fixed?t.beginDragging&&w(t,"fixed"):(e.numberOfPinnedNodes++,t.fixed=!0,w(t,"down-fixed")),t.pinWasFixed=!0,t.beginDragging=null,ne.resume())})).on("dragend",(function(e){e.isBeingDragged&&(e.pinWasFixed&&(e.pinWasFixed=null,d3.select(".pinned").remove()),e.isBeingDragged=!1,d3.select(this).classed("dragging",!1))}));f=n.selectAll(".node").data(Z.nodes).enter().append("g").attr("class","node-wrapper").attr("id",(function(e){return e.iri})).append("circle").attr("class","node").attr("r",(function(e){return e.size})).style("fill",(function(t){return"greyColor"===t.types?"c2c2c2":e.getColor(t.types[0])})).call(k).on("mouseover",(function(t){if(!t.isBeingDragged){const n=d3.event;c.cancel(oe),ie=c(()=>{(function(t,n){if(e.showInfoPanel)return!1;(le.closeIcon||le.expandIcon||le.focusIcon||le.copyURIIcon)&&le.removeIcons();if(ne.alpha()<.02)return le.initIcons(t,n.parentNode),ne.stop(),ce(),!0;return!1})(t,this)&&function(e,t){c.cancel(void 0);const n=G=t.target;c((function(){G===n&&i.show(e,G)}),300)}(t,n)},400)}})).on("mouseout",u).on("mousedown",x).on("touchstart",(function(e){x(),v=0,g=c((function(){v<5&&ue(e),g=null,y=0}),1e3)})).on("touchmove",(function(){v++})).on("mouseup",I).on("touchend",I).on("contextmenu",(function(t){d3.event.shiftKey||(d3.event.preventDefault(),ge(),e.closeInfoPanel(),t.fixed?(e.numberOfPinnedNodes--,t.fixed=!1,w(t,"up"),ne.resume()):(e.numberOfPinnedNodes++,t.fixed=!0,w(t,"down")),function(e){G&&i.show(e,G)}(t))})).on("gdb-expand-node",S).on("gdb-show-node-info",me);const T=n.selectAll(".node-wrapper").append("foreignObject").style("pointer-events","none").attr("width",(function(e){return 2*e.size*1.75}));n.insert("g").attr("class","menu-events"),function(e){e.each((function(e){e.fontSize=r.a.Text.calcFontSizeRaw(e.labels[0].label,e.size,16,!0)})).attr("height",(function(e){return 3*e.fontSize})).append("xhtml:div").attr("class","node-label-body").style("font-size",(function(e){return e.fontSize+"px"})).append("xhtml:div").text((function(e){return e.labels[0].label})),c((function(){$(".node-label-body div").each((function(e,t){let n=t.textContent.substring(0,t.textContent.length-1);let r=0;for(;r<200&&(t.scrollHeight>t.clientHeight||t.scrollWidth>t.clientWidth);)n=n.substring(0,n.length-1),t.textContent=n+"…",r++}))}),50)}(T),ne.on("tick",(function(){d3.geom.quadtree(Z.nodes);Z.nodes.length;p.attr("x1",(function(e){return U(e.source)})).attr("y1",(function(e){return q(e.source)})).attr("x2",(function(e){return U(e.target)})).attr("y2",(function(e){return q(e.target)})),h.attr("x",(function(e){let t=U(e.source),n=U(e.target);return e.x=.5*(t+n)})).attr("y",(function(e){let t=q(e.source),n=q(e.target);return e.y=.5*(t+n)})).attr("transform",(function(e){return"rotate("+function(e,t){const n={x:U(e.source),y:q(e.source)},r={x:U(e.target),y:q(e.target)};if(t)return 180*Math.atan2(r.y-n.y,r.x-n.x)/Math.PI;{const e=180*Math.atan2(r.y-n.y,r.x-n.x)/Math.PI;return e<=90&&e>=-90?e:(e>0?-1:1)*(180-Math.abs(e))}}(e,e.direction)+", "+e.x+", "+e.y+")"})),f.attr("cx",(function(e){return e.x})).attr("cy",(function(e){return e.y})),n.select(".node-loader").attr("x",(function(e){return e.x-e.size+3})).attr("y",(function(e){return e.y-e.size})),n.select(".loader-container").attr("cx",(function(e){return e.x})).attr("cy",(function(e){return e.y})),T.attr("x",(function(e){return e.x-1.75*e.size})).attr("y",(function(e){return e.y-3*e.fontSize/2})),d3.select(".pinned").attr("x",(function(e){return e.x})).attr("y",(function(e){return e.y})),ce()})),angular.isDefined(ae)&&ae.setLoadingState(!1),e.loading&&(e.loading=!1),d3.selectAll(".link-wrapper").each((function(){const e=$(this).attr("id").split(">")[0],t=$(this).attr("id").split(">")[1];d3.selectAll(".link").each((function(n){let r=F(n.source.iri),i=F(n.target.iri);if(r===t&&i===e){let e=r;e+=">",e+=i;const t=document.createTextNode(" ⟶");document.getElementById(e).lastChild.appendChild(t),n.direction="double"}}))})),d3.selectAll(".d3-actions-tip").remove(),ne.start()}function ce(){t.d3alpha=ne.alpha()}se();const le=new function(){function e(e,t){return"translate("+(t.x-14+(t.size+15)*Math.cos(e*Math.PI/180-Math.PI/2))+","+(t.y-14+(t.size+15)*Math.sin(e*Math.PI/180-Math.PI/2))+")"}this.closeIcon=void 0,this.expandIcon=void 0,this.collapseIcon=void 0,this.focusIcon=void 0,this.copyURIIcon=void 0,this.actionsTip=void 0,this.removeIcons=function(){this.closeIcon.remove("g"),this.expandIcon&&this.expandIcon.remove("g"),this.collapseIcon&&this.collapseIcon.remove("g"),this.focusIcon.remove("g"),this.copyURIIcon.remove("g"),this.closeIcon=void 0,this.expandIcon=void 0,this.collapseIcon=void 0,this.focusIcon=void 0,this.copyURIIcon=void 0,this.expandedState=!1},this.expandedState=!1,this.initIcons=function(n,r){const i=o()().attr("class","d3-tip d3-actions-tip").customPosition((function(){const e=d3.event.target.getBoundingClientRect();return{top:e.top-20+"px",left:e.right+10+"px"}})).html((function(e){return e}));re.call(i);n.isExpanded?(this.collapseIcon=d3.select(".menu-events").append("g").attr("class","collapse-icon").attr("name","collapse").attr("transform",(function(){return e(20,n)})),this.collapseIcon.append("circle").attr("cx",14).attr("cy",14).attr("r",13).style("fill","#eee"),this.collapseIcon.append("path").attr("d","M22.67,12a.59.59,0,0,1-.53.65l-6.88.72H15.2a.59.59,0,0,1-.59-.65l.72-6.88A.58.58,0,0,1,16,5.33a.59.59,0,0,1,.53.65L16,11.11,21.3,5.79a.64.64,0,0,1,.91.91L16.89,12,22,11.49A.59.59,0,0,1,22.67,12ZM12.59,14.75l-6.75.85a.59.59,0,0,0-.51.66.58.58,0,0,0,.66.51l4.95-.62-5.2,5.2a.64.64,0,1,0,.91.91l5.2-5.2L11.23,22a.59.59,0,0,0,.51.66h.07a.59.59,0,0,0,.59-.52l.85-6.75a.59.59,0,0,0-.17-.49A.58.58,0,0,0,12.59,14.75Z").style("fill","var(--primary-color)"),this.collapseIcon.on("click",(function(){var e;(e=n).isExpanded=!1,Z.removeNodeLeafLinks(e),se()})).on("mouseover",(function(){i.show(this.getAttribute("name")),c.cancel(ie),c.cancel(oe)})).on("mouseout",(function(){i.hide(),oe=c((function(){ge()}),500)}))):(this.expandIcon=d3.select(".menu-events").append("g").attr("class","expand-icon").attr("name","expand").attr("transform",(function(){return e(20,n)})),this.expandIcon.append("circle").attr("cx",14).attr("cy",14).attr("r",13).style("fill","#eee"),this.expandIcon.append("path").attr("d","M22.37,6.28l-.72,6.88a.59.59,0,0,1-.59.53H21a.59.59,0,0,1-.53-.65L21,7.9l-5.32,5.32a.64.64,0,0,1-.91-.91L20.1,7,15,7.53a.59.59,0,0,1-.12-1.18l6.88-.72a.59.59,0,0,1,.65.65ZM12.89,20.34,7.95,21l5.2-5.2a.64.64,0,0,0-.91-.91L7,20.05l.62-4.95A.59.59,0,0,0,6.48,15l-.85,6.75a.59.59,0,0,0,.59.67h.07L13,21.52a.59.59,0,1,0-.15-1.18Z").style("fill","var(--primary-color)"),this.expandIcon.on("click",(function(){he(n,!1,r)})).on("mouseover",(function(){i.show(this.getAttribute("name")),c.cancel(oe),c.cancel(ie)})).on("mouseout",(function(){i.hide(),oe=c((function(){ge()}),500)}))),this.focusIcon=d3.select(".menu-events").append("g").attr("class","focus-icon").attr("name","focus").attr("transform",(function(){return e(20,n)})),this.focusIcon.append("circle").attr("cx",14).attr("cy",14).attr("r",13).style("fill","#eee"),this.focusIcon.append("path").attr("d","M14.2,23.81a9.8,9.8,0,1,1,6.93-2.87h0A9.74,9.74,0,0,1,14.2,23.81Zm0-18.17a8.37,8.37,0,1,0,5.92,14.29h0A8.37,8.37,0,0,0,14.2,5.64Zm1.42,6.95a2,2,0,1,0,0,2.85A2,2,0,0,0,15.62,12.59Z").style("fill","var(--primary-color)"),this.focusIcon.on("click",(function(){t.$broadcast("onRootNodeChange",n.iri)})).on("mouseover",(function(){i.show(this.getAttribute("name")),c.cancel(oe),c.cancel(ie)})).on("mouseout",(function(){i.hide(),oe=c((function(){ge()}),500)})),this.copyURIIcon=d3.select(".menu-events").append("g").attr("class","icon-link").attr("name","link").attr("transform",(function(){return e(20,n)})),this.copyURIIcon.append("circle").attr("cx",14).attr("cy",14).attr("r",13).style("fill","#eee"),this.copyURIIcon.append("path").attr("d","M 13.457031 10.164062 C 13.648438 10.164062 13.820312 10.242188 13.941406 10.363281 L 15.492188 11.859375 C 15.984375 12.332031 16.292969 12.992188 16.292969 13.714844 C 16.292969 14.441406 15.984375 15.097656 15.492188 15.574219 L 10.394531 20.496094 C 9.902344 20.972656 9.222656 21.265625 8.472656 21.265625 C 7.71875 21.265625 7.039062 20.972656 6.546875 20.496094 L 4.996094 19 C 4.507812 18.523438 4.203125 17.867188 4.203125 17.144531 C 4.203125 16.421875 4.507812 15.765625 4.996094 15.289062 L 7.542969 12.824219 C 7.667969 12.707031 7.84375 12.628906 8.035156 12.628906 C 8.417969 12.628906 8.726562 12.929688 8.726562 13.300781 C 8.726562 13.484375 8.648438 13.652344 8.523438 13.773438 L 5.976562 16.234375 C 5.738281 16.46875 5.589844 16.792969 5.589844 17.148438 C 5.589844 17.503906 5.738281 17.824219 5.976562 18.058594 L 7.527344 19.566406 C 7.773438 19.792969 8.105469 19.929688 8.472656 19.929688 C 8.835938 19.929688 9.167969 19.792969 9.414062 19.566406 L 14.511719 14.644531 C 14.753906 14.410156 14.90625 14.089844 14.90625 13.730469 C 14.90625 13.375 14.753906 13.054688 14.511719 12.820312 L 12.964844 11.324219 C 12.839844 11.203125 12.761719 11.039062 12.761719 10.855469 C 12.761719 10.488281 13.070312 10.1875 13.449219 10.1875 Z M 17.082031 3.976562 C 17.082031 3.976562 17.085938 3.976562 17.085938 3.976562 C 17.824219 3.976562 18.492188 4.261719 18.980469 4.722656 L 20.535156 6.203125 C 21.042969 6.679688 21.355469 7.34375 21.355469 8.082031 C 21.355469 8.792969 21.058594 9.441406 20.582031 9.914062 L 18.0625 12.402344 C 17.9375 12.527344 17.761719 12.605469 17.566406 12.605469 C 17.183594 12.605469 16.875 12.304688 16.875 11.9375 C 16.875 11.753906 16.949219 11.589844 17.070312 11.46875 L 19.605469 8.984375 C 19.847656 8.75 19.996094 8.429688 19.996094 8.070312 C 19.996094 7.714844 19.847656 7.394531 19.605469 7.160156 L 18.019531 5.667969 C 17.773438 5.445312 17.4375 5.304688 17.070312 5.300781 C 16.703125 5.304688 16.367188 5.453125 16.128906 5.691406 L 11.085938 10.667969 C 10.84375 10.898438 10.695312 11.222656 10.695312 11.578125 C 10.695312 11.933594 10.84375 12.257812 11.085938 12.488281 L 12.675781 13.980469 C 12.804688 14.101562 12.882812 14.273438 12.882812 14.457031 C 12.882812 14.828125 12.574219 15.128906 12.191406 15.128906 C 12.003906 15.128906 11.832031 15.054688 11.707031 14.9375 L 10.140625 13.457031 C 9.636719 12.980469 9.324219 12.316406 9.324219 11.582031 C 9.324219 10.863281 9.621094 10.214844 10.101562 9.742188 L 15.140625 4.765625 C 15.625 4.285156 16.304688 3.980469 17.054688 3.976562 Z M 17.082031 3.976562").style("fill","var(--primary-color)"),this.copyURIIcon.on("click",(function(){j(n.iri),ge(),i.hide()})).on("mouseover",(function(){i.show("<div style='text-align: center;'><b>Copy to ClipBoard</b><br>"+n.iri+"</div>"),c.cancel(oe),c.cancel(ie)})).on("mouseout",(function(){i.hide(),oe=c((function(){ge()}),500)})),this.closeIcon=d3.select(".menu-events").append("g").attr("class","close-icon").attr("name","remove").attr("transform",(function(){return e(20,n)})),this.closeIcon.append("circle").attr("cx",14).attr("cy",14).attr("r",13).style("fill","#eee"),this.closeIcon.append("path").attr("d","M14.94,14l5.87-5.87a.66.66,0,1,0-.94-.94L14,13.06,8.13,7.19a.66.66,0,0,0-.94.94L13.06,14,7.19,19.87a.66.66,0,1,0,.94.94L14,14.94l5.87,5.87a.66.66,0,1,0,.94-.94Z").style("fill","var(--primary-color)"),this.closeIcon.on("click",(function(){ue(n)})).on("mouseover",(function(){i.show(this.getAttribute("name")),c.cancel(oe),c.cancel(ie)})).on("mouseout",(function(){i.hide(),oe=c((function(){ge()}),500)})),this.animateMenu(n)},this.animateMenu=function(t){let n=0;let r=20;this.expandIcon&&this.expandIcon.transition().duration(100).style("opacity",1).ease("sin").attr("transform",(function(){return e(r,t)})).delay(n+=35),this.collapseIcon&&this.collapseIcon.transition().duration(100).style("opacity",1).ease("sin").attr("transform",(function(){return e(r,t)})).delay(n+=35),this.copyURIIcon.transition().duration(100).style("opacity",1).ease("sin").attr("transform",(function(){return r+=30,e(r,t)})).delay(n+=35),this.focusIcon.transition().duration(100).style("opacity",1).ease("sin").attr("transform",(function(){return r+=30,e(r,t)})).delay(n+=35),this.closeIcon.transition().duration(100).style("opacity",1).ease("sin").attr("transform",(function(){return r+=30,e(r,t)})).delay(n+=35),this.expandedState=!0}};function de(n,r,i){return e.showInfoPanel=!1,e.showPredicates=!1,e.showNodeInfo=!1,i.shiftKey&&(i.ctrlKey||i.metaKey)?(t.$broadcast("onRootNodeChange",n.iri),!1):i.ctrlKey||i.metaKey?(ue(n),!1):void 0!==e.openedNodeInfoPanel&&e.openedNodeInfoPanel===n?(e.pageslideExpanded=!1,e.openedNodeInfoPanel=void 0,!1):(me(n),!0)}function ue(e){Z.removeNode(e),se()}function pe(t){!function(t){e.nodeSelected=!0,null===t.data.types&&(t.data.types="greyColor"),Z=new K,E="translate(0, -70) scale(1)",M.translate([0,-70]),M.scale(1)}(t),fe(t)}function fe(t,n,r){let i=t.data;i=_.filter(i,(function(e){return-1===_.findIndex(Z.links,(function(t){return e.source===t.source.iri&&e.target===t.target.iri}))}));let o=[];const a=Z.tripleLinksCopy.values();for(let e=0;e<Z.tripleLinksCopy.size;e++){a.next().value.forEach(e=>{o.push(e)})}i=_.filter(i,(function(e){return-1===_.findIndex(o,(function(t){return e.source===t.source.iri&&e.target===t.target.iri}))})),i=_.filter(i,(function(e){return e.source!==e.target}));const c=function(e,t){let n=t.map((function(t){return t[e]}));return t.filter((function(t,r){return n.indexOf(t[e])===r}))}("iri",_.union(_.flatten(_.map(t.data,(function(e){return[{iri:e.source,isTriple:e.isTripleSource},{iri:e.target,isTriple:e.isTripleTarget}]}))))),d=_.map(Z.nodes,(function(e){return{iri:e.iri,isTriple:Boolean(e.isTriple)}})),u=Z.tripleNodes.values();for(let e=0;e<Z.tripleNodes.size;e++){u.next().value.forEach(e=>{d.push({iri:e.iri,isTriple:e.isTriple})})}const f=_.reject(c,(function(e){return _.some(d,e)}));if(0===f.length)(r||0===i.length)&&s.info(L.instant("graphexplore.error.node.connections")),Z.addAndMatchLinks(i),se();else{const t=[],r=[],o=O();_.forEach(f,(function(n,i){t.push(l({url:"rest/explore-graph/node",method:"GET",params:{iri:n.isTriple?H(n.iri):n.iri,config:e.configLoaded.id,languages:e.shouldShowSettings()?o.languages:[],includeInferred:o.includeInferred,sameAsState:o.sameAsState}}).then((function(e){r[i]=e.data})))})),p.all(t).then((function(){_.forEach(r,(function(e,t){const i=2*Math.PI*t/r.length,o=(n?n.x:0)+1e3*Math.cos(i)/3,a=(n?n.y:0)+1e3*Math.sin(i)/3;e.isTriple?Z.addTriple(e,o,a):Z.addNode(e,o,a)})),Z.addAndMatchLinks(i),n&&(n.isExpanded=!0),se()}))}}function he(t,n,r){if(ae.getLoadingState())return;ae.init(t,r);const i=O(),o=t.iri;l({url:"rest/explore-graph/links",method:"GET",params:{iri:o,linksLimit:i.linksLimit,includeInferred:i.includeInferred,config:e.configLoaded.id,preferredTypes:e.shouldShowSettings()?i.preferredTypes:[],rejectedTypes:e.shouldShowSettings()?i.rejectedTypes:[],preferredPredicates:e.shouldShowSettings()?i.preferredPredicates:[],rejectedPredicates:e.shouldShowSettings()?i.rejectedPredicates:[],preferredTypesOnly:e.shouldShowSettings()?i.preferredTypesOnly:[],preferredPredicatesOnly:e.shouldShowSettings()?i.preferredPredicatesOnly:[],languages:e.shouldShowSettings()?i.languages:[],sameAsState:i.sameAsState,includeSchema:i.includeSchema}}).then((function(e){fe(e,t,n)}),(function(t){const n=getError(t.data);s.error(n,L.instant("graphexplore.error.exploring.node")),e.loading=!1,ae.setLoadingState(!1)}))}function ge(){angular.isDefined(le)&&le.expandedState&&le.removeIcons()}function me(t){ne.stop(),e.openedNodeInfoPanel=t,e.showNodeInfo=!0,e.showFilter=!1,e.showPredicates=!1,e.nodeLabels=t.labels,e.nodeTypes=t.types,e.rdfRank=t.rdfRank,e.nodeIri=t.iri,e.resourceType=t.isTriple?"triple":"uri",e.encodedIri=t.isTriple?encodeURIComponent(H(t.iri)):encodeURIComponent(t.iri),e.showInfoPanel=!0,e.rdfsLabel=t.labels[0].label,e.rdfsComment=t.comment,e.expanded=!1,e.propertiesQueryObj.query="",e.dataNodeKeysQuery="";const n=O();l.get("rest/explore-graph/properties",{params:{iri:t.isTriple?H(t.iri):t.iri,config:e.configLoaded.id,languages:e.shouldShowSettings()?n.languages:[],includeInferred:n.includeInferred,sameAsState:n.sameAsState,rejectedPredicates:e.shouldShowSettings()?n.rejectedPredicates:[]}}).then((function(t){e.data=_.mapKeys(t.data,(function(t,n){return e.replaceIRIWithPrefix(n)})),e.propertiesObj.items=[],_.forEach(e.data,(function(t,n){e.propertiesObj.items.push({key:n,value:t})})),e.nodeImage=void 0,e.propertiesNotFiltered=e.propertiesObj.items;const n=_.find(e.propertiesObj.items,(function(e){return"image"===e.key}));n&&(e.nodeImage=n.value[0].v),e.propertiesObj.items=_.reject(e.propertiesObj.items,(function(e){return"image"===e.key})),e.propertiesNotFiltered=e.propertiesObj.items}),(function(e){s.warning(getError(e.data),"Error")}))}function ye(e){ve("predicate","var(--primary-color-dark)",e),ve("predicates","var(--primary-color-dark)",e);let t=document.getElementsByClassName("link");t&&_.each(t,(function(t){let n=t.__data__;(n.source.iri.indexOf(e.iri)>=0||n.target.iri.indexOf(e.iri)>=0)&&(t.style.stroke="var(--primary-color-dark)",t.style.strokeWidth=4)}));let n=document.getElementsByClassName("arrow-marker");n&&_.each(n,(function(t){let n=t.__data__;(n.source.iri.indexOf(e.iri)>=0||n.target.iri.indexOf(e.iri)>=0)&&(t.style.stroke="var(--primary-color-dark)",t.__data__.target.isTriple||t.setAttribute("refX","23"))}))}function ve(e,t,n){let r=document.getElementsByClassName(e);r&&_.each(r,(function(e){let r=e.__data__;n?((r.source.iri.indexOf(n.iri)>=0||r.target.iri.indexOf(n.iri)>=0)&&(e.style.fill=t),B(n.iri)===W(r)&&(e.textContent=n.pred,e.style.fill=t),n.oppLinkIRI&&n.oppLinkIRI===W(r)&&(e.textContent=n.oppTriplePred,e.style.fill=t)):(e.style.fill=t,e.textContent=Ie(r))}))}function xe(){_.each(e.predicates,(function(e){let t=document.getElementById(e.linkId+e.nodeIndex);t&&(t.style.fontWeight="normal")}));let t=document.getElementsByClassName("link");t&&_.each(t,(function(e){e.style.stroke="#999",e.style.strokeWidth=1})),ve("predicate",""),ve("predicates","");let n=document.getElementsByClassName("arrow-marker");n&&_.each(n,(function(e){e.style.stroke="#999",e.__data__.target.isTriple||e.setAttribute("refX","59")}))}function Se(e){let t=B(e);if(Z.tripleNodes.has(t))return Z.tripleNodes.get(t).find(t=>t.iri===e)}function Ie(e){return e.predicates.length>1?e.predicates.length+" predicates":we(e.predicates[0])}function we(t){const n=e.replaceIRIWithPrefix(t);return n.length===t.length?t.split("/")[t.split("/").length-1]:n}e.toggleSidePanel=function(){e.pageslideExpanded=!e.pageslideExpanded},e.closeInfoPanel=function(){e.pageslideExpanded=!1,e.openedNodeInfoPanel=void 0,e.predicates=[],R=null,c((function(){e.showInfoPanel=!1}))},e.clickLink=function(t){if(Z.tripleNodes.has(t.linkId)){xe();let n=Z.tripleNodes.get(t.linkId)[t.nodeIndex];me(n),e.showPredicates=!0;let r=document.getElementById(t.linkId+t.nodeIndex);r&&(r.style.fontWeight="bold");let i={};const o=Z.tripleLinksCopy.values();for(let e=0;e<Z.tripleLinksCopy.size;e++){let e=o.next().value;e.length>1&&e.every(t=>t.source.iri===n.iri?(i.iri=e[0].source.iri,t.target.isTriple&&(i.oppLinkIRI=B(t.target.iri),i.oppTriplePred=we(t.target.iri.split(" ")[1])),i.pred=we(n.iri.split(" ")[1]),1===t.predicates.length&&(i.linkPred=t.predicates[0]),!1):t.target.iri!==n.iri||(i.iri=e[0].target.iri,t.source.isTriple&&(i.oppLinkIRI=B(t.source.iri),i.oppTriplePred=we(t.source.iri.split(" ")[1])),i.pred=we(n.iri.split(" ")[1]),1===t.predicates.length&&(i.linkPred=t.predicates[0]),!1))}i.iri||(i.iri=n.iri,i.pred=we(n.iri.split(" ")[1])),ye(i)}},e.splitPredicate=function(e){return e.split("/")[e.split("/").length-1]},e.getActiveRepository=function(){return n.getActiveRepository()},e.isLoadingLocation=function(){return n.isLoadingLocation()},e.hasActiveLocation=function(){return n.hasActiveLocation()},e.rotate=function(e){ge();const t=2*(e?1:-1)*Math.PI/180,n=Math.cos(t),r=Math.sin(t);d3.selectAll(".node-wrapper").each((function(e){e.x=n*(e.x-500)+r*(e.y-500)+500,e.y=-r*(e.x-500)+n*(e.y-500)+500,e.fixed&&(e.px=e.x,e.py=e.y)})),ne.resume()},e.openUri=function(t,n){if(!n){const n={};e.configLoaded.id!==e.defaultGraphConfig.id&&(n.config=e.configLoaded.id),n.uri=t,e.pushHistory(n,{uri:t,config:e.configLoaded})}e.$broadcast("onRootNodeChange",t)},e.saveOrUpdateGraph=function(){const t=JSON.stringify(Z.copyState()),n={id:e.lastSavedGraphId,name:e.lastSavedGraphName,data:t,shared:e.shared};n.id?e.saveGraphModal("update",n):e.saveGraphModal("new",n)},e.renameSavedGraph=function(t){e.saveGraphModal("rename",{id:t.id,name:t.name,config:t.config,shared:t.shared})};const ke=function(t){I.editSavedGraph(t).success((function(){e.lastSavedGraphName=t.name,e.shared=t.shared,e.refreshSavedGraphs(),s.success(L.instant("graphexplore.saved.graph.was.edited",{name:t.name}))})).error((function(e){const t=getError(e);s.error(t,L.instant("graphexplore.error.cannot.edit"))}))};e.saveGraphModal=function(t,n,r){y.open({templateUrl:"js/angular/graphexplore/templates/modal/save-graph.html",controller:"SaveGraphModalCtrl",resolve:{data:function(){return{mode:t,graph:n,graphExists:r,shared:n.shared}}}}).result.then((function(t){if(t.restart)e.saveGraphModal(t.mode,t.graph,!1);else switch(t.mode){case"new":!function(t){e.configLoaded&&(t.config=e.configLoaded.id),I.addNewSavedGraph(t).success((function(n,r,i){e.lastSavedGraphName=t.name,e.lastSavedGraphId=i()["x-saved-graph-id"],e.shared=t.shared,e.refreshSavedGraphs(),s.success(L.instant("graphexplore.saved.graph",{name:t.name}))})).error((function(n,r){if(422===r)e.saveGraphModal("new",t,!0);else{const e=getError(n);s.error(e,L.instant("graphexplore.error.cannot.create.graph"))}}))}(t.graph);break;case"update":case"rename":ke(t.graph)}}))},e.refreshSavedGraphs=function(){I.getSavedGraphs().success((function(t){e.savedGraphs=t})).error((function(e){const t=getError(e);s.error(t,L.instant("graphexplore.error.getting.saved.graphs"))}))},e.loadSavedGraph=function(t,n){t.owner?(e.lastSavedGraphName=t.name,e.lastSavedGraphId=t.id,e.shared=t.shared,e.configLoaded=e.findConfigById(t.config)):(e.lastSavedGraphName=null,e.lastSavedGraphId=null,e.shared=t.shared),e.configLoaded||(e.configLoaded=e.defaultGraphConfig),f.url("?saved="+t.id),Z.restoreState(JSON.parse(t.data)),n||e.pushHistory({saved:t.id},{savedGraph:t})},e.copyToClipboardSavedGraph=function(e){j([location.protocol,"//",location.host,location.pathname,"?saved=",e.id].join(""))},e.deleteSavedGraph=function(t){m.openSimpleModal({title:L.instant("common.confirm"),message:L.instant("graphexplore.confirm.delete.graph",{graphName:t.name}),warning:!0}).result.then((function(){!function(t){I.deleteSavedGraph(t).success((function(){e.refreshSavedGraphs(),s.success(L.instant("graphexplore.saved.graph.was.deleted",{name:t.name}))})).error((function(e){const t=getError(e);s.error(t,L.instant("graphexplore.error.cannot.delete"))}))}(t)}))},e.openIRI=function(t,n){return n.shiftKey?e.$broadcast("onRootNodeChange",t):window.open(t,"_blank"),!1},e.togglePinAllNodes=function(){ge();const t=e.numberOfPinnedNodes<=0;e.numberOfPinnedNodes=0,d3.selectAll(".node").each((function(n){n.fixed=t,t&&e.numberOfPinnedNodes++})),ne.resume()},$("body").on("keydown",(function(t){!C.isActive()&&"input"!==t.target.nodeName&&e.nodeSelected&&(37===t.keyCode?e.rotate(!0):39===t.keyCode&&e.rotate(!1))})),e.getLiteralFromPropValue=function(e){return e.substring(e.indexOf(":")+1)}}function c(e,t,n,r){switch(e.mode=n.mode,e.graph=angular.copy(n.graph),e.graphExists=n.graphExists,e.mode){case"new":e.title=r.instant("graphexplore.create.new.graph"),e.okButtonText=r.instant("common.create.btn");break;case"update":e.title=r.instant("graphexplore.update"),e.okButtonText=r.instant("common.save.btn");break;case"rename":e.title=r.instant("graphexplore.rename"),e.okButtonText=r.instant("common.save.btn")}e.ok=function(){e.form.$valid&&t.close({graph:e.graph,mode:e.mode})},e.saveNew=function(){e.graph.name=e.graph.name+" (new)",t.close({graph:e.graph,mode:"new",restart:!0})},e.cancel=function(){t.dismiss("cancel")}}angular.module("graphdb.framework.graphexplore.controllers.graphviz",["ui.scroll.jqlite","ui.scroll","toastr","ui.bootstrap","ngTagsInput","graphdb.framework.utils.localstorageadapter"]).controller("GraphsVisualizationsCtrl",s).controller("SaveGraphModalCtrl",c).config(["$uibTooltipProvider",function(e){e.options({appendToBody:!0})}]),s.$inject=["$scope","$rootScope","$repositories","$licenseService","toastr","$timeout","$http","ClassInstanceDetailsService","AutocompleteRestService","$q","$location","$jwtAuth","UiScrollService","ModalService","$uibModal","$window","LocalStorageAdapter","LSKeys","SavedGraphsRestService","GraphConfigRestService","RDF4JRepositoriesRestService","$translate","GuidesService"],c.$inject=["$scope","$uibModalInstance","data","$translate"]},298:function(e,t,n){var r,i,o;i=[],void 0===(o="function"==typeof(r=function(){return function(){var e=function(){return"n"},t=function(){return[0,0]},n=function(){return" "},r=u(),i=null,o=null,a=null,s=null;function c(e){var t;i="svg"===(t=(t=e).node()).tagName.toLowerCase()?t:t.ownerSVGElement,o=i.createSVGPoint(),document.body.appendChild(r)}c.show=function(){var r=Array.prototype.slice.call(arguments);r[r.length-1]instanceof SVGElement&&(a=r.pop());var i,o=n.apply(this,r),u=t.apply(this,r),f=e.apply(this,r),h=p(),g=d.length,m=document.documentElement.scrollTop||document.body.scrollTop,y=document.documentElement.scrollLeft||document.body.scrollLeft,v=s.apply(this,r);for(h.html(o).style({opacity:1,"pointer-events":"all"});g--;)h.classed(d[g],!1);return i=l.get(f).apply(this),v?h.style(v):h.classed(f,!0).style({top:i.top+u[0]+m+"px",left:i.left+u[1]+y+"px"}),c},c.hide=function(){return p().style({opacity:0,"pointer-events":"none"}),c},c.attr=function(e,t){if(arguments.length<2&&"string"==typeof e)return p().attr(e);var n=Array.prototype.slice.call(arguments);return d3.selection.prototype.attr.apply(p(),n),c},c.style=function(e,t){if(arguments.length<2&&"string"==typeof e)return p().style(e);var n=Array.prototype.slice.call(arguments);return d3.selection.prototype.style.apply(p(),n),c},c.direction=function(t){return arguments.length?(e=null==t?t:d3.functor(t),c):e},c.offset=function(e){return arguments.length?(t=null==e?e:d3.functor(e),c):t},c.html=function(e){return arguments.length?(n=null==e?e:d3.functor(e),c):n},c.customPosition=function(e){return arguments.length?(s=null==e?e:d3.functor(e),c):s},c.destroy=function(){return r&&(p().remove(),r=null),c};var l=d3.map({n:function(){var e=f();return{top:e.n.y-r.offsetHeight,left:e.n.x-r.offsetWidth/2}},s:function(){var e=f();return{top:e.s.y,left:e.s.x-r.offsetWidth/2}},e:function(){var e=f();return{top:e.e.y-r.offsetHeight/2,left:e.e.x}},w:function(){var e=f();return{top:e.w.y-r.offsetHeight/2,left:e.w.x-r.offsetWidth}},nw:function(){var e=f();return{top:e.nw.y-r.offsetHeight,left:e.nw.x-r.offsetWidth}},ne:function(){var e=f();return{top:e.ne.y-r.offsetHeight,left:e.ne.x}},sw:function(){var e=f();return{top:e.sw.y,left:e.sw.x-r.offsetWidth}},se:function(){var e=f();return{top:e.se.y,left:e.e.x}}}),d=l.keys();function u(){var e=d3.select(document.createElement("div"));return e.style({position:"absolute",top:0,opacity:0,"pointer-events":"none","box-sizing":"border-box"}),e.node()}function p(){return null===r&&(r=u(),document.body.appendChild(r)),d3.select(r)}function f(){for(var e=a||d3.event.target;void 0===e.getScreenCTM&&"undefined"===e.parentNode;)e=e.parentNode;var t={},n=e.getScreenCTM(),r=e.getBBox(),i=r.width,s=r.height,c=r.x,l=r.y;return o.x=c,o.y=l,t.nw=o.matrixTransform(n),o.x+=i,t.ne=o.matrixTransform(n),o.y+=s,t.se=o.matrixTransform(n),o.x-=i,t.sw=o.matrixTransform(n),o.y-=s/2,t.w=o.matrixTransform(n),o.x+=i,t.e=o.matrixTransform(n),o.x-=i/2,o.y-=s/2,t.n=o.matrixTransform(n),o.y+=s,t.s=o.matrixTransform(n),t}return c}})?r.apply(t,i):r)||(e.exports=o)},301:function(e,t,n){"use strict";var r=r||{};r.Text=function(){function e(e,t,n,r){n=n||10;var i=t/3;return"string"==typeof e?(i*=10/(e.substring(0,t/3).length+1.5),i+=1,e.match(/[\u0900-\u0DFF\u1100-\u11FF\u2E80-\u2EFF\u3000-\u9FFF]/)&&(i*=.6),i<n&&(i=n),Math.round(i)):(i<n&&(i=n),Math.round(i))}return{calcFontSizeRaw:e,calcFontSize:function(t,n,r,i){return e(t,n,r)+"px"},getTextWithElipsisIfNeeded:function(e,t){return"string"==typeof e&&e.length>t?e.substring(0,t-3)+"...":e}}}(),r.Transition={fadeIn:function(e,t){e.style("opacity",0).transition().duration(t).style("opacity",1)},fadeOut:function(e,t){e.style("opacity",1).transition().duration(t).style("opacity",0)}},r.Click={delayDblClick:function(){var e=d3.dispatch("click","dblclick");return d3.rebind((function(t){var n,r=null;t.on("mousedown",(function(){n=d3.mouse(document.body),new Date})),t.on("mouseup",(function(t){var i,o;i=n,o=d3.mouse(document.body),Math.sqrt(Math.pow(i[0]-o[0],2),Math.pow(i[1]-o[1],2))>5||(r?(window.clearTimeout(r),r=null,e.dblclick(t)):r=window.setTimeout((d3.event,function(){e.click(t),r=null}),250))}))}),e,"on")}},t.a=r},77:function(e,t,n){"use strict";n.r(t),n.d(t,"STATIC_RULESETS",(function(){return r})),n.d(t,"REPOSITORY_TYPES",(function(){return i})),n.d(t,"FILENAME_PATTERN",(function(){return o})),n.d(t,"NUMBER_PATTERN",(function(){return a}));const r=[{id:"empty",name:"No inference"},{id:"rdfs-optimized",name:"RDFS (Optimized)"},{id:"rdfs",name:"RDFS"},{id:"rdfsplus-optimized",name:"RDFS-Plus (Optimized)"},{id:"owl-horst-optimized",name:"OWL-Horst (Optimized)"},{id:"owl-horst",name:"OWL-Horst"},{id:"owl2-ql-optimized",name:"OWL2-QL (Optimized)"},{id:"owl2-ql",name:"OWL2-QL"},{id:"owl-max-optimized",name:"OWL-Max (Optimized)"},{id:"owl-max",name:"OWL-Max"},{id:"owl2-rl-optimized",name:"OWL2-RL (Optimized)"},{id:"owl2-rl",name:"OWL2-RL"}],i={graphdbRepo:"graphdb",free:"free",eeWorker:"worker",eeMaster:"master",ontop:"ontop",se:"se",fedx:"fedx"},o=new RegExp("^[a-zA-Z0-9-_]+$"),a=new RegExp("^[0-9]+$")}}]);
@@ -0,0 +1 @@
1
+ (window.webpackJsonp=window.webpackJsonp||[]).push([[33,42,138],{138:function(e,t,o){"use strict";o.r(t);o(91);angular.module("graphdb.framework.autocomplete",["ngRoute","graphdb.framework.autocomplete.controllers"])},60:function(e,t,o){"use strict";o.r(t),o.d(t,"mapNamespacesResponse",(function(){return n}));const n=e=>e&&e.data?e.data.results.bindings.map(e=>({prefix:e.prefix.value,uri:e.namespace.value})):[]},91:function(e,t,o){"use strict";o.r(t);o(31);var n=o(60),r=o(0);function i(e,t,o,i,c,a,s,u,l,d,f,p){let g;function m(){g&&t.cancel(g)}e.pluginName="autocomplete",e.setPluginIsActive=function(t){e.pluginIsActive=t};const b=function(){d.checkAutocompleteStatus().success((function(t){e.autocompleteEnabled=t,f.setAutocompleteStatus(t)})).error((function(e){o.error(getError(e))}))},I=function(){d.refreshIndexIRIs().success((function(t){e.shouldIndexIRIs=t})).error((function(e){o.error(getError(e))}))},L=function(){d.refreshIndexStatus().success((function(t){e.indexStatus=t})).error((function(e){o.error(getError(e))}))},v=function(){d.refreshLabelConfig().success((function(t){e.labelConfig=t})).error((function(e){o.error(getError(e))}))};e.checkForPlugin=function(){e.pluginFound=!1,e.setLoader(!0),d.checkForPlugin().success((function(t){e.pluginFound=!0===t,e.pluginFound?(R(),b(),I(),L(),v()):(e.autocompleteEnabled=!1,e.loading=!1)})).error((function(e){o.error(getError(e))})).finally((function(){e.setLoader(!1)}))};const h=function(){g=t((function(){e.$broadcast("checkIsActive"),e.autocompleteEnabled&&L()}),5e3)};e.$on("$destroy",(function(){m()}));e.setLoader=function(t,o){s.cancel(e.loaderTimeout),t?e.loaderTimeout=s((function(){e.loader=t,e.loaderMessage=o}),300):e.loader=!1},e.getLoaderMessage=function(){return e.loaderMessage||p.instant("common.loading")},e.toggleAutocomplete=function(){const t=!e.autocompleteEnabled;e.setLoader(!0,t?p.instant("autocomplete.enabling"):p.instant("autocomplete.disabling")),d.toggleAutocomplete(t).success((function(){b(),L()})).error((function(e){o.error(getError(e))})).finally((function(){e.setLoader(!1)}))},e.toggleIndexIRIs=function(){e.setLoader(!0,p.instant("autocomplete.index.iri")),d.toggleIndexIRIs(!e.shouldIndexIRIs).success((function(){I(),L()})).error((function(e){o.error(getError(e))})).finally((function(){e.setLoader(!1)}))},e.buildIndex=function(){e.setLoader(!0,p.instant("autocomplete.index.build")),d.buildIndex().success((function(){e.indexStatus="BUILDING"})).error((function(e){o.error(getError(e))})).finally((function(){e.setLoader(!1)}))},e.interruptIndexing=function(){e.setLoader(!0,p.instant("index.interrupt")),d.interruptIndexing().success((function(){L()})).error((function(e){o.error(getError(e))})).finally((function(){e.setLoader(!1)}))},e.getDegradedReason=function(){return i.getDegradedReason()},e.addLabel=function(){e.editLabel({labelIri:"",languages:""},!0)},e.editLabel=function(t,n){a.open({templateUrl:"js/angular/autocomplete/templates/modal/add-label.html",controller:"AddLabelCtrl",resolve:{data:function(){return{label:t,isNew:n}}}}).result.then((function(t){!function(t){e.setLoader(!0,p.instant("autocomplete.update"));let n=t.labelIri.toString();if(n=l.expandPrefix(n,e.namespaces),l.isValidIri(t,n)&&""!==n)t.labelIri=n,d.addLabelConfig(t).success((function(){v(),L()})).error((function(e){o.error(getError(e))})).finally((function(){e.setLoader(!1)}));else{const n=Object(r.decodeHTML)(p.instant("not.valid.iri",{value:t.labelIri.toString()}));o.error(n),e.setLoader(!1)}}(t)}))},e.removeLabel=function(t){!function(t){e.setLoader(!0,p.instant("autocomplete.update")),d.removeLabelConfig(t).success((function(){v(),L()})).error((function(e){o.error(getError(e))})).finally((function(){e.setLoader(!1)}))}(t)},e.$on("repositoryIsSet",(function(){m(),c.isLicenseValid()&&i.getActiveRepository()&&!i.isActiveRepoOntopType()&&!i.isActiveRepoFedXType()&&(e.checkForPlugin(),h())}));const R=()=>{u.getNamespaces(i.getActiveRepository()).then(n.mapNamespacesResponse).then(t=>{e.namespaces=t}).catch(e=>{const t=getError(e);o.error(t,p.instant("error.getting.namespaces.for.repo"))})};c.isLicenseValid()&&i.getActiveRepository()&&!i.isActiveRepoOntopType()&&!i.isActiveRepoFedXType()&&(e.checkForPlugin(),h())}function c(e,t,o,n){e.label=angular.copy(n.label),e.isNew=n.isNew,e.ok=function(){e.form.$valid&&t.close(e.label)},e.cancel=function(){t.dismiss("cancel")},e.setTemplate=function(t){e.label.labelIri=t,o((function(){$("#wb-autocomplete-languages").focus()}),0)}}angular.module("graphdb.framework.autocomplete.controllers",["toastr","graphdb.framework.rest.autocomplete.service"]).controller("AutocompleteCtrl",i).controller("AddLabelCtrl",c),i.$inject=["$scope","$interval","toastr","$repositories","$licenseService","$uibModal","$timeout","RDF4JRepositoriesRestService","UriUtils","AutocompleteRestService","$autocompleteStatus","$translate"],c.$inject=["$scope","$uibModalInstance","$timeout","data"]}}]);
@@ -1 +1 @@
1
- (window.webpackJsonp=window.webpackJsonp||[]).push([[37],{110:function(t,e,r){"use strict";r.r(e);var a=r(302),n=r(301);r(10);function o(t,e,r,o,s,i,c,l,d,u,p,f,g){return{restrict:"AE",template:'<div id="domain-range"></div>',scope:{showPredicatesInfoPanel:"=",selectedPredicate:"=",collapseEdges:"="},link:function(u){const p=l((function(){!function(u){d3.selection.prototype.moveToFront=function(){return this.each((function(){d3.select(this.parentNode.appendChild(this))}))},d3.selection.prototype.moveToBack=function(){return this.each((function(){const t=this.parentNode.firstChild;t&&this.parentNode.insertBefore(this,t)}))};var p=d3.layout.force().size([1200,600]).charge(-900),h=p.drag().on("dragstart",(function(t){d3.select(this).classed("selected",t.selected=!0)})),y=d3.select("#domain-range").append("svg").attr("viewBox","0 0 1200 600").attr("preserveAspectRatio","xMidYMid meet").on("dblclick.zoom",null),x=y.append("defs");x.append("marker").attr({id:"arrow",viewBox:"0 -5 10 10",refX:10,refY:0,markerUnits:"strokeWidth",markerWidth:5,markerHeight:5,orient:"auto",fill:f}).append("path").attr({d:"M0,-5L10,0L0,5",class:"arrowHead"}),x.append("marker").attr({id:"collapsed-arrow",viewBox:"0 -5 10 10",refX:9,refY:0,markerUnits:"strokeWidth",markerWidth:4,markerHeight:4,orient:"auto",fill:f}).append("path").attr({d:"M0,-5L10,0L0,5",class:"arrowHead"}),x.append("marker").attr({id:"arrow-loop",viewBox:"0 -5 10 10",refX:7,refY:0,markerUnits:"strokeWidth",markerWidth:5,markerHeight:5,orient:"auto",fill:f}).append("path").attr({d:"M0,-5L10,0L0,5",class:"arrowHead"}),d3.select("#download-svg").on("mouseover",(function(){var t=a.a.Export.getCSSRules("css/domain-range-graph.css?v=2.4.2-TR1");$("defs").append('<style type="text/css"><![CDATA['+t+"]]></style>");var e=a.a.Export.generateBase64ImageSource("#domain-range svg");d3.select(this).attr({href:e,download:"domain-range-graph-"+r.getActiveRepository()+".svg"})}));var m=d3.select(".legend-container").append("svg").attr("viewBox","0 0 "+1200/7+" "+1200/7*1.2).attr("preserveAspectRatio","xMidYMid meet");m.append("rect").attr({width:1200/7,height:1200/7*1.2}).style("fill","rgba(235, 235, 235, 0.9)");var v=16+1200/18/2.5,k=v+1200/90;m.append("circle").attr({class:"legend-class-node",cx:(16+v)/2,cy:30,r:1200/18/4.5});m.append("text").attr({x:k,y:30+1200/370}).style("font-size",1200/90/1.1+"px").text("main class node");m.append("circle").attr({class:"legend-object-node",cx:(16+v)/2,cy:70,r:1200/110/1.25});m.append("text").attr({x:k,y:30+1200/370+40}).style("font-size",1200/90/1.1+"px").text("class node");m.append("circle").attr({class:"legend-datatype-node",cx:(16+v)/2,cy:70+1200/45,r:1200/110/2});m.append("text").attr({x:k,y:99.90990990990991}).style("font-size",1200/90/1.1+"px").text("datatype node");d3.select(".legend-class-node");m.append("line").attr({class:"property-arrow",x1:16,y1:123.33333333333334,x2:v,y2:123.33333333333334}).style("stroke-width",1.2).attr("marker-end","url("+s.absUrl()+"#arrow)"),m.append("text").attr({x:k,y:126.57657657657658}).style("font-size",1200/90/1.1+"px").text("explicit property");m.append("line").attr({class:"implicit-property-arrow",x1:16,y1:150,x2:v,y2:150}).style("stroke-width",1.2).attr("marker-end","url("+s.absUrl()+"#arrow)"),m.append("text").attr({x:k,y:150+1200/370}).style("font-size",1200/90/1.1+"px").text("implicit property");m.append("line").attr({class:"collapsed-property-arrow",x1:16,y1:150+1200/45,x2:v,y2:150+1200/45}).style("stroke-width",2).attr("marker-end","url("+s.absUrl()+"#collapsed-arrow)"),m.append("text").attr({x:k,y:179.9099099099099}).style("font-size",1200/90/1.1+"px").text("collapsed property");var b=y,w=s.search().uri,E=s.search().name,N=s.search().collapsed;o.getDomainRangeData(w,N).success((function(t,e,r){u.domainRangeGraphData=t})).error((function(t){d.error("Request for "+E+" failed!")})),$(window).on("popstate",(function(){i.set(c.DOMAIN_RANGE_WENT_BACK,!0)})),e.onpopstate=function(e){e.state&&t.$broadcast("changeCollapsedEdgesState",e.state.collapsed)},u.$watch("collapseEdges",(function(){angular.isUndefined(u.collapseEdges)||(i.set(c.DOMAIN_RANGE_COLLAPSE_EDGES,u.collapseEdges),"true"!==i.get(c.DOMAIN_RANGE_WENT_BACK)&&function(e){t.$broadcast("switchEdgeMode",{uri:w,name:E,collapsed:e})}(u.collapseEdges),i.remove(c.DOMAIN_RANGE_WENT_BACK))})),u.$watch("domainRangeGraphData",(function(){if(u.domainRangeGraphData){var r=angular.copy(u.domainRangeGraphData);p.nodes(r.nodes).links(r.links);var a=b.selectAll(".link").data(r.links).enter().append("g");function o(t){t.style("stroke",f),t.style("stroke-width",2),t.attr("marker-end","url("+s.absUrl()+"#collapsed-arrow)")}var i,c,d=0;a.each((function(t){if(t.objectPropNodeClassUri!==w)i=a.append("line").attr({class:"link","marker-end":"url("+s.absUrl()+"#arrow)"}).style("stroke-width",1.2).each((function(t){switch(t.propertyType){case"objectLeft":t.targetRadius=1200/18;break;case"objectRight":t.targetRadius=1200/110;break;case"datatype":t.targetRadius=1200/110/2;break;default:t.targetRadius=0}var e=d3.select(this);t.targetNodeEdgeCount>1?o(e):t.implicit&&e.style("stroke-dasharray","3, 3")}));else{if(angular.isUndefined(c)){c=d3.select(this).append("path").attr({d:"M 0 0 A "+1200/18/2+" "+1200/18/2+" 0 1 1 0 "+1200/18/2,class:"loop-link",fill:"none","marker-end":"url("+s.absUrl()+"#arrow-loop)"}).style("stroke-width",1.2)}(d+=t.targetNodeEdgeCount)>1&&o(d3.select(".loop-link"))}}));var y={};function x(){$.isEmptyObject(y)||(y.text.style("fill","black"),y.background.style("fill","#f0f0f0"))}function m(t){x(),y.text=d3.select(this),y.background=d3.select(this.previousSibling),y.text.style("fill","white"),y.background.style("fill",f),l((function(){u.showPredicatesInfoPanel=!0,u.selectedPredicate=t})),d3.event.stopPropagation()}$("document").ready((function(){$("#domain-range").bind("click",x)}));var v=a.append("text").attr("class",(function(t){return t.objectPropNodeClassUri===w?"loop-link-property-name":"property-name"})).attr("dx",(function(t){return 1200/18/2*("objectLeft"===t.propertyType?1:-1)})).style("text-anchor",(function(t){return"objectLeft"===t.propertyType?"end":"start"})).style("font-size",1200/90).text((function(t){return t.targetNodeEdgeCount>1?t.targetNodeEdgeCount+" predicates":t.name}));v.each((function(t){var r=d3.select(this);/\d\spredicates/.test(r.text())?r.style("font-weight","bold").on("click",m):r.on("click",(function(t){e.open("resource?uri="+encodeURIComponent(t.uri),"_blank")}))}));var k=a.append("rect").attr("class",(function(t){return t.objectPropNodeClassUri!==w?"link-background":"loop-link-background"})).attr("width",(function(t){return t.calculatedWidth=this.previousSibling.getBBox().width,t.calculatedWidth+4})).attr("height",(function(t){return t.calculatedHeight=this.previousSibling.getBBox().height,t.calculatedHeight+2})).attr("transform",(function(t){var e=2-1200/18/2*("objectLeft"===t.propertyType?1:-1);return"objectLeft"===t.propertyType&&(e+=t.calculatedWidth),"translate(-"+e+",-"+(2+t.calculatedHeight/2)+")"})).on("click",(function(t){d3.event.stopPropagation()})),N=b.selectAll(".node").data(r.nodes).enter().append("g"),R=N.filter((function(t){return t.objectPropClassUri!==w})).append("circle").each((function(t){var e=d3.select(this);"main"===t.classPosition?e.attr({class:"class-node",r:1200/18}).attr("marker-end","url("+s.absUrl()+"#loop-link)"):null===t.objectPropClassName?e.attr({class:"datatype-node",r:1200/110/2}):e.attr({class:"object-prop-node",r:1200/110})})).call(h);d3.selectAll(".object-prop-node").on("dblclick",(function(e,r){u.$apply((function(){t.$broadcast("reloadDomainRangeGraphView",e,r)}))})),N.filter((function(t){return t.objectPropClassName&&t.objectPropClassUri!==w})).append("text").attr("class",(function(t){return t.classPosition+"-class-label"})).style("font-size",1200/90).text((function(t){return t.objectPropClassName})).on("click",(function(t){e.open("resource?uri="+encodeURIComponent(t.objectPropClassUri),"_blank")}));var C=N.select("text");b.select(".class-node").each((function(){d3.select(this.parentNode).append("text").attr("class","rdf-class-label").style("font-size",(function(t){return n.a.Text.calcFontSize(E,1200/18)})).text(E).on("click",(function(t){e.open("resource?uri="+encodeURIComponent(w),"_blank")}))}));var T=b.select(".class-node + text"),A=d3.select(".class-node"),L=d3.selectAll(".loop-link-background"),_=d3.selectAll(".loop-link-property-name");if(v=d3.selectAll(".property-name"),!angular.isUndefined(c)){var M=[];L.each((function(t,e){d3.select(this);M.push({idx:e,width:t.calculatedWidth,height:t.calculatedHeight})}))}p.on("tick",(function(t){var e=8*t.alpha;function r(t){var e=t.x+1200/18*2,r=t.y-1200/18/1.9;var a=[];L.each((function(n,o){a.push(n),o<g?function(a,n){var o=$.grep(M,(function(t){return t.idx==n}));n>0&&(e+=parseFloat(n*(o[0].height/(n/1.4)))),a.attr({transform:"rotate(270, "+t.x+","+t.y+") translate("+e+","+r+")",width:o[0].height,height:o[0].width})}(d3.select(this),o):d3.select(this).remove()})),function(t){var e;d3.select(".view-more-preds-label").style("font-weight","bold").each((function(r){r.target.allEdges=t,e=this.getComputedTextLength()})).on("click",m),d3.select(".view-more-preds-rect").attr("height",e+4)}(a)}i.filter((function(t){return t.objectPropNodeClassUri!==w})).attr("x1",(function(t){return t.source.x})).attr("y1",(function(t){return t.source.y})).attr("x2",(function(t){return t.targetX})).attr("y2",(function(t){return t.targetY})).each((function(t){!function(t){"objectLeft"===t.propertyType?(t.source.x-=8*e,t.source.y-=e/9):(t.target.x+=8*e,t.target.y-=e/9)}(t);var r=Math.atan2(t.target.y-t.source.y,t.target.x-t.source.x);t.targetX=t.target.x-Math.cos(r)*t.targetRadius,t.targetY=t.target.y-Math.sin(r)*t.targetRadius})),R.each((function(t){"main"!==t.classPosition||angular.isUndefined(c)||(!function(t){var e=t.x+64,r=t.y-1200/18/5.7-5;c.attr("transform","rotate(270, "+t.x+","+t.y+") translate("+e+","+r+")")}(t),function(t){function e(e,r){var a=$.grep(M,(function(t){return t.idx==r})),n=0;r>0&&(n=parseFloat(2*r*(a[0].height/1.4)));var o=t.x,s=t.y-1200/18*2.1-n;e.attr({x:o,y:s}).moveToFront()}_.each((function(t,r){var a=d3.select(this),n=_.size()-g;n<0?e(a,r):(0==r&&!u.collapseEdges&&n>1&&(!function(t,e,r){t.classed("view-more-preds-label",!0).text(r+" predicates more ..."),null!==this.nextSibling&&e.classed("view-more-preds-rect",!0)}(a,d3.select(this.nextSibling),n),e(a,r)),r<g?e(a,r):a.remove())}))}(t),r(t)),t.objectPropClassUri!==w&&d3.select(this).attr("cx",(function(t){return"main"===t.classPosition?function(t){!window.ActiveXObject&&"ActiveXObject"in window&&(Math.log10=function(t){return Math.log(t)/Math.LN10});var e=A.attr("cx")-600,r=.5*Math.log10(Math.abs(e));return t.x+=e>0?-r:r,t.x}(t):t.x})).attr("cy",(function(t){return t.y}))})),T.attr("x",(function(t){return t.x})).attr("y",(function(t){return t.y})).moveToFront(),k.filter((function(t){return t.objectPropNodeClassUri!==w})).attr("x",(function(t){return t.target.x>t.source.x?t.source.x+(t.target.x-t.source.x)/2:t.target.x+(t.source.x-t.target.x)/2})).attr("y",(function(t){return t.target.y>t.source.y?t.source.y+(t.target.y-t.source.y)/2:t.target.y+(t.source.y-t.target.y)/2})).moveToFront(),v.attr("x",(function(t){return t.target.x>t.source.x?t.source.x+(t.target.x-t.source.x)/2:t.target.x+(t.source.x-t.target.x)/2})).attr("y",(function(t){return t.target.y>t.source.y?t.source.y+(t.target.y-t.source.y)/2:t.target.y+(t.source.y-t.target.y)/2})).moveToFront(),C.attr("x",(function(t){return"right"===t.classPosition?t.x+1200/110*1.2:t.x-1200/110*1.2})).attr("y",(function(t){return t.y})).moveToFront()})).linkDistance(1200/3.5).start()}}))}(u)}),50);u.$on("$destroy",(function(){l.cancel(p)}))}}}angular.module("graphdb.framework.graphexplore.directives.domainrange",["graphdb.framework.graphexplore.controllers.domainrange","graphdb.framework.utils.localstorageadapter"]).constant("ONTO_RED","var(--primary-color)").constant("ONTO_GREEN","var(--tertiary-color)").constant("ONTO_BLUE","var(--secondary-color)").constant("NON_COLLAPSED_REFLEXIVE_LINK_LIMIT",6).directive("domainRangeGraph",o),o.$inject=["$rootScope","$window","$repositories","GraphDataRestService","$location","LocalStorageAdapter","LSKeys","$timeout","toastr","ONTO_RED","ONTO_GREEN","ONTO_BLUE","NON_COLLAPSED_REFLEXIVE_LINK_LIMIT"]},301:function(t,e,r){"use strict";var a=a||{};a.Text=function(){function t(t,e,r,a){r=r||10;var n=e/3;return"string"==typeof t?(n*=10/(t.substring(0,e/3).length+1.5),n+=1,t.match(/[\u0900-\u0DFF\u1100-\u11FF\u2E80-\u2EFF\u3000-\u9FFF]/)&&(n*=.6),n<r&&(n=r),Math.round(n)):(n<r&&(n=r),Math.round(n))}return{calcFontSizeRaw:t,calcFontSize:function(e,r,a,n){return t(e,r,a)+"px"},getTextWithElipsisIfNeeded:function(t,e){return"string"==typeof t&&t.length>e?t.substring(0,e-3)+"...":t}}}(),a.Transition={fadeIn:function(t,e){t.style("opacity",0).transition().duration(e).style("opacity",1)},fadeOut:function(t,e){t.style("opacity",1).transition().duration(e).style("opacity",0)}},a.Click={delayDblClick:function(){var t=d3.dispatch("click","dblclick");return d3.rebind((function(e){var r,a=null;e.on("mousedown",(function(){r=d3.mouse(document.body),new Date})),e.on("mouseup",(function(e){var n,o;n=r,o=d3.mouse(document.body),Math.sqrt(Math.pow(n[0]-o[0],2),Math.pow(n[1]-o[1],2))>5||(a?(window.clearTimeout(a),a=null,t.dblclick(e)):a=window.setTimeout((d3.event,function(){t.click(e),a=null}),250))}))}),t,"on")}},e.a=a},302:function(t,e,r){"use strict";var a=r(297),n=n||{};n.Export={getCSSRules:function(t){const e=$('link[href="'+t+'"]')[0].sheet.rules;let r="";return _.each(e,(function(t){r+=t.cssText})),r},generateBase64ImageSource:function(t){t||(t="svg");const e=a.selectAll(t).attr("version","1.1").attr("xmlns","http://www.w3.org/2000/svg").node().parentNode.innerHTML;return"data:image/svg+xml;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(e)))}},e.a=n}}]);
1
+ (window.webpackJsonp=window.webpackJsonp||[]).push([[37],{110:function(t,e,r){"use strict";r.r(e);var a=r(302),n=r(301);r(10);function o(t,e,r,o,s,i,c,l,d,u,p,f,g){return{restrict:"AE",template:'<div id="domain-range"></div>',scope:{showPredicatesInfoPanel:"=",selectedPredicate:"=",collapseEdges:"="},link:function(u){const p=l((function(){!function(u){d3.selection.prototype.moveToFront=function(){return this.each((function(){d3.select(this.parentNode.appendChild(this))}))},d3.selection.prototype.moveToBack=function(){return this.each((function(){const t=this.parentNode.firstChild;t&&this.parentNode.insertBefore(this,t)}))};var p=d3.layout.force().size([1200,600]).charge(-900),h=p.drag().on("dragstart",(function(t){d3.select(this).classed("selected",t.selected=!0)})),y=d3.select("#domain-range").append("svg").attr("viewBox","0 0 1200 600").attr("preserveAspectRatio","xMidYMid meet").on("dblclick.zoom",null),x=y.append("defs");x.append("marker").attr({id:"arrow",viewBox:"0 -5 10 10",refX:10,refY:0,markerUnits:"strokeWidth",markerWidth:5,markerHeight:5,orient:"auto",fill:f}).append("path").attr({d:"M0,-5L10,0L0,5",class:"arrowHead"}),x.append("marker").attr({id:"collapsed-arrow",viewBox:"0 -5 10 10",refX:9,refY:0,markerUnits:"strokeWidth",markerWidth:4,markerHeight:4,orient:"auto",fill:f}).append("path").attr({d:"M0,-5L10,0L0,5",class:"arrowHead"}),x.append("marker").attr({id:"arrow-loop",viewBox:"0 -5 10 10",refX:7,refY:0,markerUnits:"strokeWidth",markerWidth:5,markerHeight:5,orient:"auto",fill:f}).append("path").attr({d:"M0,-5L10,0L0,5",class:"arrowHead"}),d3.select("#download-svg").on("mouseover",(function(){var t=a.a.Export.getCSSRules("css/domain-range-graph.css?v=2.4.2");$("defs").append('<style type="text/css"><![CDATA['+t+"]]></style>");var e=a.a.Export.generateBase64ImageSource("#domain-range svg");d3.select(this).attr({href:e,download:"domain-range-graph-"+r.getActiveRepository()+".svg"})}));var m=d3.select(".legend-container").append("svg").attr("viewBox","0 0 "+1200/7+" "+1200/7*1.2).attr("preserveAspectRatio","xMidYMid meet");m.append("rect").attr({width:1200/7,height:1200/7*1.2}).style("fill","rgba(235, 235, 235, 0.9)");var v=16+1200/18/2.5,k=v+1200/90;m.append("circle").attr({class:"legend-class-node",cx:(16+v)/2,cy:30,r:1200/18/4.5});m.append("text").attr({x:k,y:30+1200/370}).style("font-size",1200/90/1.1+"px").text("main class node");m.append("circle").attr({class:"legend-object-node",cx:(16+v)/2,cy:70,r:1200/110/1.25});m.append("text").attr({x:k,y:30+1200/370+40}).style("font-size",1200/90/1.1+"px").text("class node");m.append("circle").attr({class:"legend-datatype-node",cx:(16+v)/2,cy:70+1200/45,r:1200/110/2});m.append("text").attr({x:k,y:99.90990990990991}).style("font-size",1200/90/1.1+"px").text("datatype node");d3.select(".legend-class-node");m.append("line").attr({class:"property-arrow",x1:16,y1:123.33333333333334,x2:v,y2:123.33333333333334}).style("stroke-width",1.2).attr("marker-end","url("+s.absUrl()+"#arrow)"),m.append("text").attr({x:k,y:126.57657657657658}).style("font-size",1200/90/1.1+"px").text("explicit property");m.append("line").attr({class:"implicit-property-arrow",x1:16,y1:150,x2:v,y2:150}).style("stroke-width",1.2).attr("marker-end","url("+s.absUrl()+"#arrow)"),m.append("text").attr({x:k,y:150+1200/370}).style("font-size",1200/90/1.1+"px").text("implicit property");m.append("line").attr({class:"collapsed-property-arrow",x1:16,y1:150+1200/45,x2:v,y2:150+1200/45}).style("stroke-width",2).attr("marker-end","url("+s.absUrl()+"#collapsed-arrow)"),m.append("text").attr({x:k,y:179.9099099099099}).style("font-size",1200/90/1.1+"px").text("collapsed property");var b=y,w=s.search().uri,E=s.search().name,N=s.search().collapsed;o.getDomainRangeData(w,N).success((function(t,e,r){u.domainRangeGraphData=t})).error((function(t){d.error("Request for "+E+" failed!")})),$(window).on("popstate",(function(){i.set(c.DOMAIN_RANGE_WENT_BACK,!0)})),e.onpopstate=function(e){e.state&&t.$broadcast("changeCollapsedEdgesState",e.state.collapsed)},u.$watch("collapseEdges",(function(){angular.isUndefined(u.collapseEdges)||(i.set(c.DOMAIN_RANGE_COLLAPSE_EDGES,u.collapseEdges),"true"!==i.get(c.DOMAIN_RANGE_WENT_BACK)&&function(e){t.$broadcast("switchEdgeMode",{uri:w,name:E,collapsed:e})}(u.collapseEdges),i.remove(c.DOMAIN_RANGE_WENT_BACK))})),u.$watch("domainRangeGraphData",(function(){if(u.domainRangeGraphData){var r=angular.copy(u.domainRangeGraphData);p.nodes(r.nodes).links(r.links);var a=b.selectAll(".link").data(r.links).enter().append("g");function o(t){t.style("stroke",f),t.style("stroke-width",2),t.attr("marker-end","url("+s.absUrl()+"#collapsed-arrow)")}var i,c,d=0;a.each((function(t){if(t.objectPropNodeClassUri!==w)i=a.append("line").attr({class:"link","marker-end":"url("+s.absUrl()+"#arrow)"}).style("stroke-width",1.2).each((function(t){switch(t.propertyType){case"objectLeft":t.targetRadius=1200/18;break;case"objectRight":t.targetRadius=1200/110;break;case"datatype":t.targetRadius=1200/110/2;break;default:t.targetRadius=0}var e=d3.select(this);t.targetNodeEdgeCount>1?o(e):t.implicit&&e.style("stroke-dasharray","3, 3")}));else{if(angular.isUndefined(c)){c=d3.select(this).append("path").attr({d:"M 0 0 A "+1200/18/2+" "+1200/18/2+" 0 1 1 0 "+1200/18/2,class:"loop-link",fill:"none","marker-end":"url("+s.absUrl()+"#arrow-loop)"}).style("stroke-width",1.2)}(d+=t.targetNodeEdgeCount)>1&&o(d3.select(".loop-link"))}}));var y={};function x(){$.isEmptyObject(y)||(y.text.style("fill","black"),y.background.style("fill","#f0f0f0"))}function m(t){x(),y.text=d3.select(this),y.background=d3.select(this.previousSibling),y.text.style("fill","white"),y.background.style("fill",f),l((function(){u.showPredicatesInfoPanel=!0,u.selectedPredicate=t})),d3.event.stopPropagation()}$("document").ready((function(){$("#domain-range").bind("click",x)}));var v=a.append("text").attr("class",(function(t){return t.objectPropNodeClassUri===w?"loop-link-property-name":"property-name"})).attr("dx",(function(t){return 1200/18/2*("objectLeft"===t.propertyType?1:-1)})).style("text-anchor",(function(t){return"objectLeft"===t.propertyType?"end":"start"})).style("font-size",1200/90).text((function(t){return t.targetNodeEdgeCount>1?t.targetNodeEdgeCount+" predicates":t.name}));v.each((function(t){var r=d3.select(this);/\d\spredicates/.test(r.text())?r.style("font-weight","bold").on("click",m):r.on("click",(function(t){e.open("resource?uri="+encodeURIComponent(t.uri),"_blank")}))}));var k=a.append("rect").attr("class",(function(t){return t.objectPropNodeClassUri!==w?"link-background":"loop-link-background"})).attr("width",(function(t){return t.calculatedWidth=this.previousSibling.getBBox().width,t.calculatedWidth+4})).attr("height",(function(t){return t.calculatedHeight=this.previousSibling.getBBox().height,t.calculatedHeight+2})).attr("transform",(function(t){var e=2-1200/18/2*("objectLeft"===t.propertyType?1:-1);return"objectLeft"===t.propertyType&&(e+=t.calculatedWidth),"translate(-"+e+",-"+(2+t.calculatedHeight/2)+")"})).on("click",(function(t){d3.event.stopPropagation()})),N=b.selectAll(".node").data(r.nodes).enter().append("g"),R=N.filter((function(t){return t.objectPropClassUri!==w})).append("circle").each((function(t){var e=d3.select(this);"main"===t.classPosition?e.attr({class:"class-node",r:1200/18}).attr("marker-end","url("+s.absUrl()+"#loop-link)"):null===t.objectPropClassName?e.attr({class:"datatype-node",r:1200/110/2}):e.attr({class:"object-prop-node",r:1200/110})})).call(h);d3.selectAll(".object-prop-node").on("dblclick",(function(e,r){u.$apply((function(){t.$broadcast("reloadDomainRangeGraphView",e,r)}))})),N.filter((function(t){return t.objectPropClassName&&t.objectPropClassUri!==w})).append("text").attr("class",(function(t){return t.classPosition+"-class-label"})).style("font-size",1200/90).text((function(t){return t.objectPropClassName})).on("click",(function(t){e.open("resource?uri="+encodeURIComponent(t.objectPropClassUri),"_blank")}));var C=N.select("text");b.select(".class-node").each((function(){d3.select(this.parentNode).append("text").attr("class","rdf-class-label").style("font-size",(function(t){return n.a.Text.calcFontSize(E,1200/18)})).text(E).on("click",(function(t){e.open("resource?uri="+encodeURIComponent(w),"_blank")}))}));var T=b.select(".class-node + text"),A=d3.select(".class-node"),L=d3.selectAll(".loop-link-background"),_=d3.selectAll(".loop-link-property-name");if(v=d3.selectAll(".property-name"),!angular.isUndefined(c)){var M=[];L.each((function(t,e){d3.select(this);M.push({idx:e,width:t.calculatedWidth,height:t.calculatedHeight})}))}p.on("tick",(function(t){var e=8*t.alpha;function r(t){var e=t.x+1200/18*2,r=t.y-1200/18/1.9;var a=[];L.each((function(n,o){a.push(n),o<g?function(a,n){var o=$.grep(M,(function(t){return t.idx==n}));n>0&&(e+=parseFloat(n*(o[0].height/(n/1.4)))),a.attr({transform:"rotate(270, "+t.x+","+t.y+") translate("+e+","+r+")",width:o[0].height,height:o[0].width})}(d3.select(this),o):d3.select(this).remove()})),function(t){var e;d3.select(".view-more-preds-label").style("font-weight","bold").each((function(r){r.target.allEdges=t,e=this.getComputedTextLength()})).on("click",m),d3.select(".view-more-preds-rect").attr("height",e+4)}(a)}i.filter((function(t){return t.objectPropNodeClassUri!==w})).attr("x1",(function(t){return t.source.x})).attr("y1",(function(t){return t.source.y})).attr("x2",(function(t){return t.targetX})).attr("y2",(function(t){return t.targetY})).each((function(t){!function(t){"objectLeft"===t.propertyType?(t.source.x-=8*e,t.source.y-=e/9):(t.target.x+=8*e,t.target.y-=e/9)}(t);var r=Math.atan2(t.target.y-t.source.y,t.target.x-t.source.x);t.targetX=t.target.x-Math.cos(r)*t.targetRadius,t.targetY=t.target.y-Math.sin(r)*t.targetRadius})),R.each((function(t){"main"!==t.classPosition||angular.isUndefined(c)||(!function(t){var e=t.x+64,r=t.y-1200/18/5.7-5;c.attr("transform","rotate(270, "+t.x+","+t.y+") translate("+e+","+r+")")}(t),function(t){function e(e,r){var a=$.grep(M,(function(t){return t.idx==r})),n=0;r>0&&(n=parseFloat(2*r*(a[0].height/1.4)));var o=t.x,s=t.y-1200/18*2.1-n;e.attr({x:o,y:s}).moveToFront()}_.each((function(t,r){var a=d3.select(this),n=_.size()-g;n<0?e(a,r):(0==r&&!u.collapseEdges&&n>1&&(!function(t,e,r){t.classed("view-more-preds-label",!0).text(r+" predicates more ..."),null!==this.nextSibling&&e.classed("view-more-preds-rect",!0)}(a,d3.select(this.nextSibling),n),e(a,r)),r<g?e(a,r):a.remove())}))}(t),r(t)),t.objectPropClassUri!==w&&d3.select(this).attr("cx",(function(t){return"main"===t.classPosition?function(t){!window.ActiveXObject&&"ActiveXObject"in window&&(Math.log10=function(t){return Math.log(t)/Math.LN10});var e=A.attr("cx")-600,r=.5*Math.log10(Math.abs(e));return t.x+=e>0?-r:r,t.x}(t):t.x})).attr("cy",(function(t){return t.y}))})),T.attr("x",(function(t){return t.x})).attr("y",(function(t){return t.y})).moveToFront(),k.filter((function(t){return t.objectPropNodeClassUri!==w})).attr("x",(function(t){return t.target.x>t.source.x?t.source.x+(t.target.x-t.source.x)/2:t.target.x+(t.source.x-t.target.x)/2})).attr("y",(function(t){return t.target.y>t.source.y?t.source.y+(t.target.y-t.source.y)/2:t.target.y+(t.source.y-t.target.y)/2})).moveToFront(),v.attr("x",(function(t){return t.target.x>t.source.x?t.source.x+(t.target.x-t.source.x)/2:t.target.x+(t.source.x-t.target.x)/2})).attr("y",(function(t){return t.target.y>t.source.y?t.source.y+(t.target.y-t.source.y)/2:t.target.y+(t.source.y-t.target.y)/2})).moveToFront(),C.attr("x",(function(t){return"right"===t.classPosition?t.x+1200/110*1.2:t.x-1200/110*1.2})).attr("y",(function(t){return t.y})).moveToFront()})).linkDistance(1200/3.5).start()}}))}(u)}),50);u.$on("$destroy",(function(){l.cancel(p)}))}}}angular.module("graphdb.framework.graphexplore.directives.domainrange",["graphdb.framework.graphexplore.controllers.domainrange","graphdb.framework.utils.localstorageadapter"]).constant("ONTO_RED","var(--primary-color)").constant("ONTO_GREEN","var(--tertiary-color)").constant("ONTO_BLUE","var(--secondary-color)").constant("NON_COLLAPSED_REFLEXIVE_LINK_LIMIT",6).directive("domainRangeGraph",o),o.$inject=["$rootScope","$window","$repositories","GraphDataRestService","$location","LocalStorageAdapter","LSKeys","$timeout","toastr","ONTO_RED","ONTO_GREEN","ONTO_BLUE","NON_COLLAPSED_REFLEXIVE_LINK_LIMIT"]},301:function(t,e,r){"use strict";var a=a||{};a.Text=function(){function t(t,e,r,a){r=r||10;var n=e/3;return"string"==typeof t?(n*=10/(t.substring(0,e/3).length+1.5),n+=1,t.match(/[\u0900-\u0DFF\u1100-\u11FF\u2E80-\u2EFF\u3000-\u9FFF]/)&&(n*=.6),n<r&&(n=r),Math.round(n)):(n<r&&(n=r),Math.round(n))}return{calcFontSizeRaw:t,calcFontSize:function(e,r,a,n){return t(e,r,a)+"px"},getTextWithElipsisIfNeeded:function(t,e){return"string"==typeof t&&t.length>e?t.substring(0,e-3)+"...":t}}}(),a.Transition={fadeIn:function(t,e){t.style("opacity",0).transition().duration(e).style("opacity",1)},fadeOut:function(t,e){t.style("opacity",1).transition().duration(e).style("opacity",0)}},a.Click={delayDblClick:function(){var t=d3.dispatch("click","dblclick");return d3.rebind((function(e){var r,a=null;e.on("mousedown",(function(){r=d3.mouse(document.body),new Date})),e.on("mouseup",(function(e){var n,o;n=r,o=d3.mouse(document.body),Math.sqrt(Math.pow(n[0]-o[0],2),Math.pow(n[1]-o[1],2))>5||(a?(window.clearTimeout(a),a=null,t.dblclick(e)):a=window.setTimeout((d3.event,function(){t.click(e),a=null}),250))}))}),t,"on")}},e.a=a},302:function(t,e,r){"use strict";var a=r(297),n=n||{};n.Export={getCSSRules:function(t){const e=$('link[href="'+t+'"]')[0].sheet.rules;let r="";return _.each(e,(function(t){r+=t.cssText})),r},generateBase64ImageSource:function(t){t||(t="svg");const e=a.selectAll(t).attr("version","1.1").attr("xmlns","http://www.w3.org/2000/svg").node().parentNode.innerHTML;return"data:image/svg+xml;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(e)))}},e.a=n}}]);
@@ -0,0 +1 @@
1
+ (window.webpackJsonp=window.webpackJsonp||[]).push([[42,138],{60:function(e,t,o){"use strict";o.r(t),o.d(t,"mapNamespacesResponse",(function(){return n}));const n=e=>e&&e.data?e.data.results.bindings.map(e=>({prefix:e.prefix.value,uri:e.namespace.value})):[]},91:function(e,t,o){"use strict";o.r(t);o(31);var n=o(60),r=o(0);function i(e,t,o,i,c,a,s,u,l,d,f,p){let g;function m(){g&&t.cancel(g)}e.pluginName="autocomplete",e.setPluginIsActive=function(t){e.pluginIsActive=t};const b=function(){d.checkAutocompleteStatus().success((function(t){e.autocompleteEnabled=t,f.setAutocompleteStatus(t)})).error((function(e){o.error(getError(e))}))},I=function(){d.refreshIndexIRIs().success((function(t){e.shouldIndexIRIs=t})).error((function(e){o.error(getError(e))}))},L=function(){d.refreshIndexStatus().success((function(t){e.indexStatus=t})).error((function(e){o.error(getError(e))}))},v=function(){d.refreshLabelConfig().success((function(t){e.labelConfig=t})).error((function(e){o.error(getError(e))}))};e.checkForPlugin=function(){e.pluginFound=!1,e.setLoader(!0),d.checkForPlugin().success((function(t){e.pluginFound=!0===t,e.pluginFound?(h(),b(),I(),L(),v()):(e.autocompleteEnabled=!1,e.loading=!1)})).error((function(e){o.error(getError(e))})).finally((function(){e.setLoader(!1)}))};const R=function(){g=t((function(){e.$broadcast("checkIsActive"),e.autocompleteEnabled&&L()}),5e3)};e.$on("$destroy",(function(){m()}));e.setLoader=function(t,o){s.cancel(e.loaderTimeout),t?e.loaderTimeout=s((function(){e.loader=t,e.loaderMessage=o}),300):e.loader=!1},e.getLoaderMessage=function(){return e.loaderMessage||p.instant("common.loading")},e.toggleAutocomplete=function(){const t=!e.autocompleteEnabled;e.setLoader(!0,t?p.instant("autocomplete.enabling"):p.instant("autocomplete.disabling")),d.toggleAutocomplete(t).success((function(){b(),L()})).error((function(e){o.error(getError(e))})).finally((function(){e.setLoader(!1)}))},e.toggleIndexIRIs=function(){e.setLoader(!0,p.instant("autocomplete.index.iri")),d.toggleIndexIRIs(!e.shouldIndexIRIs).success((function(){I(),L()})).error((function(e){o.error(getError(e))})).finally((function(){e.setLoader(!1)}))},e.buildIndex=function(){e.setLoader(!0,p.instant("autocomplete.index.build")),d.buildIndex().success((function(){e.indexStatus="BUILDING"})).error((function(e){o.error(getError(e))})).finally((function(){e.setLoader(!1)}))},e.interruptIndexing=function(){e.setLoader(!0,p.instant("index.interrupt")),d.interruptIndexing().success((function(){L()})).error((function(e){o.error(getError(e))})).finally((function(){e.setLoader(!1)}))},e.getDegradedReason=function(){return i.getDegradedReason()},e.addLabel=function(){e.editLabel({labelIri:"",languages:""},!0)},e.editLabel=function(t,n){a.open({templateUrl:"js/angular/autocomplete/templates/modal/add-label.html",controller:"AddLabelCtrl",resolve:{data:function(){return{label:t,isNew:n}}}}).result.then((function(t){!function(t){e.setLoader(!0,p.instant("autocomplete.update"));let n=t.labelIri.toString();if(n=l.expandPrefix(n,e.namespaces),l.isValidIri(t,n)&&""!==n)t.labelIri=n,d.addLabelConfig(t).success((function(){v(),L()})).error((function(e){o.error(getError(e))})).finally((function(){e.setLoader(!1)}));else{const n=Object(r.decodeHTML)(p.instant("not.valid.iri",{value:t.labelIri.toString()}));o.error(n),e.setLoader(!1)}}(t)}))},e.removeLabel=function(t){!function(t){e.setLoader(!0,p.instant("autocomplete.update")),d.removeLabelConfig(t).success((function(){v(),L()})).error((function(e){o.error(getError(e))})).finally((function(){e.setLoader(!1)}))}(t)},e.$on("repositoryIsSet",(function(){m(),c.isLicenseValid()&&i.getActiveRepository()&&!i.isActiveRepoOntopType()&&!i.isActiveRepoFedXType()&&(e.checkForPlugin(),R())}));const h=()=>{u.getNamespaces(i.getActiveRepository()).then(n.mapNamespacesResponse).then(t=>{e.namespaces=t}).catch(e=>{const t=getError(e);o.error(t,p.instant("error.getting.namespaces.for.repo"))})};c.isLicenseValid()&&i.getActiveRepository()&&!i.isActiveRepoOntopType()&&!i.isActiveRepoFedXType()&&(e.checkForPlugin(),R())}function c(e,t,o,n){e.label=angular.copy(n.label),e.isNew=n.isNew,e.ok=function(){e.form.$valid&&t.close(e.label)},e.cancel=function(){t.dismiss("cancel")},e.setTemplate=function(t){e.label.labelIri=t,o((function(){$("#wb-autocomplete-languages").focus()}),0)}}angular.module("graphdb.framework.autocomplete.controllers",["toastr","graphdb.framework.rest.autocomplete.service"]).controller("AutocompleteCtrl",i).controller("AddLabelCtrl",c),i.$inject=["$scope","$interval","toastr","$repositories","$licenseService","$uibModal","$timeout","RDF4JRepositoriesRestService","UriUtils","AutocompleteRestService","$autocompleteStatus","$translate"],c.$inject=["$scope","$uibModalInstance","$timeout","data"]}}]);
@@ -0,0 +1 @@
1
+ (window.webpackJsonp=window.webpackJsonp||[]).push([[44,70],{142:function(t,e,o){"use strict";o.r(e);o(93);angular.module("graphdb.framework.chatgpt",["ngRoute","graphdb.framework.chatgpt.controllers"])},93:function(t,e){angular.module("graphdb.framework.chatgpt.controllers",["toastr","graphdb.framework.utils.localstorageadapter"]).controller("ChatGptCtrl",o).controller("ChatGptSettingsCtrl",n),o.$inject=["$scope","$http","$timeout","$translate","$uibModal","$repositories","toastr","ModalService","LocalStorageAdapter"];function o(t,e,o,n,r,s,i,a,c){function l(){o(()=>{document.getElementById("messages-scrollable").scrollIntoView({behavior:"smooth",block:"end",inline:"nearest"})},0)}function u(){t.history=[],t.askSettings={queryTemplate:{query:"string"},groundTruths:[],echoVectorQuery:!1,topK:5};const e=c.get("ttyg"),o=s.getActiveRepository();if(e&&e[o]){const n=e[o];n.history&&(t.history=n.history),t.connectorID=n.connectorID,n.askSettings&&(t.askSettings=n.askSettings)}l()}function g(){const e=c.get("ttyg")||{};e[s.getActiveRepository()]={history:t.history,connectorID:t.connectorID,askSettings:t.askSettings},c.set("ttyg",e)}t.helpTemplateUrl="js/angular/chatgpt/templates/chatInfo.html",t.getIcon=function(t){return"question"===t?"user":"assistant"===t?"data":"help"},t.ask=function(){if(!t.question.trim())return;const o=t.history.filter(t=>!t.error),n={connectorID:t.connectorID,question:t.question,askSettings:t.askSettings,history:o},r={role:"question",content:t.question};e.post("rest/chat/retrieval?repositoryID="+s.getActiveRepository(),n).then(e=>{t.history.pop(),e.data.forEach(e=>t.history.push(e))}).catch(t=>{r.error=!0,i.error(getError(t,0,100))}).finally(()=>{t.loader=!1,l(),g()}),t.history.push(r),t.loader=!0,l(),t.question=""},t.clear=function(){a.openSimpleModal({title:n.instant("common.confirm"),message:n.instant("ttyg.clear.history.confirmation"),warning:!0}).result.then((function(){t.history=[],g()}))},t.openSettings=function(){r.open({templateUrl:"js/angular/chatgpt/templates/modal/settings.html",controller:"ChatGptSettingsCtrl",size:"lg",resolve:{data:function(){return{askSettings:t.askSettings,connectorID:t.connectorID}}}}).result.then((function(e){t.connectorID=e.connectorID,t.askSettings=e.askSettings,g()}))},t.$on("repositoryIsSet",(function(){u()})),s.getActiveRepository()&&u()}function n(t,e,o,n){t.dialogTitle=e.instant("ttyg.settings.title"),t.save=function(){if(t.form.$valid){const e={queryTemplate:JSON.parse(t.queryTemplate),groundTruths:t.groundTruths.split("\n"),topK:t.topK,echoVectorQuery:t.echoVectorQuery};o.close({askSettings:e,connectorID:t.connectorID})}},t.cancel=function(){o.dismiss("cancel")},t.connectorID=n.connectorID,t.queryTemplate=JSON.stringify(n.askSettings.queryTemplate,null," "),t.topK=n.askSettings.topK,t.echoVectorQuery=n.askSettings.echoVectorQuery,t.groundTruths=n.askSettings.groundTruths.map(t=>t.trim()).filter(t=>""!==t).join("\n")}n.$inject=["$scope","$translate","$uibModalInstance","data"]}}]);
@@ -1 +1 @@
1
- (window.webpackJsonp=window.webpackJsonp||[]).push([[49,108],{117:function(e,r,t){"use strict";t.r(r);t(7),t(26);const i=angular.module("graphdb.framework.impex.import.directives",["graphdb.framework.utils.uriutils"]);i.directive("validateUri",["UriUtils",function(e){return{restrict:"A",require:"ngModel",link:function(r,t,i,a){a.$parsers.unshift((function(t){let i=!0;return"named"===r.target&&(i=e.isValidIri(t,t.toString())),a.$setValidity("validateUri",i),t}))}}}]),i.directive("filesTable",(function(){return{restrict:"A",templateUrl:"js/angular/import/templates/filesTable.html"}})),i.directive("filesOntoLoader",(function(){return{link:function(e,r,t){e.$watch("file.status",(function(){"IMPORTING"!==e.file.status&&"UPLOADING"!==e.file.status||!$(r).has("object").length>0&&$(r).append('<object width="'+t.size+'" height="'+t.size+'" data="js/angular/templates/loader/ot-loader.svg?v=2.4.2-TR1">{{\'common.loading\' | translate}}</object>')}))}}}))},168:function(e,r,t){"use strict";t.r(r);t(7),t(23),t(134),t(117),t(22),t(53),t(54);angular.module("graphdb.framework.impex.import",["toastr","ngRoute","ngFileUpload","ui.bootstrap","graphdb.framework.impex.import.directives","graphdb.framework.impex.import.controllers","graphdb.framework.core.services.repositories","graphdb.framework.core.directives"])}}]);
1
+ (window.webpackJsonp=window.webpackJsonp||[]).push([[49,108],{117:function(e,r,t){"use strict";t.r(r);t(7),t(26);const i=angular.module("graphdb.framework.impex.import.directives",["graphdb.framework.utils.uriutils"]);i.directive("validateUri",["UriUtils",function(e){return{restrict:"A",require:"ngModel",link:function(r,t,i,a){a.$parsers.unshift((function(t){let i=!0;return"named"===r.target&&(i=e.isValidIri(t,t.toString())),a.$setValidity("validateUri",i),t}))}}}]),i.directive("filesTable",(function(){return{restrict:"A",templateUrl:"js/angular/import/templates/filesTable.html"}})),i.directive("filesOntoLoader",(function(){return{link:function(e,r,t){e.$watch("file.status",(function(){"IMPORTING"!==e.file.status&&"UPLOADING"!==e.file.status||!$(r).has("object").length>0&&$(r).append('<object width="'+t.size+'" height="'+t.size+'" data="js/angular/templates/loader/ot-loader.svg?v=2.4.2">{{\'common.loading\' | translate}}</object>')}))}}}))},168:function(e,r,t){"use strict";t.r(r);t(7),t(23),t(134),t(117),t(22),t(53),t(54);angular.module("graphdb.framework.impex.import",["toastr","ngRoute","ngFileUpload","ui.bootstrap","graphdb.framework.impex.import.directives","graphdb.framework.impex.import.controllers","graphdb.framework.core.services.repositories","graphdb.framework.core.directives"])}}]);
@@ -0,0 +1 @@
1
+ (window.webpackJsonp=window.webpackJsonp||[]).push([[50,154],{118:function(e,n,t){"use strict";t.r(n);t(7),t(22),t(25),t(58);function r(e,n,t,r,o,i){e.getSqlConfigurations=function(){!n.getActiveRepository()||n.isActiveRepoOntopType()||n.isActiveRepoFedXType()?e.jdbcConfigurations=[]:t.getJdbcConfigurations().success((function(n){e.jdbcConfigurations=n})).error((function(e){const n=getError(e);r.error(n,i.instant("jdbc.not.get.SQL.msg"))}))},e.$watch((function(){return n.getActiveRepository()}),(function(){e.getSqlConfigurations()})),e.deleteConfiguration=function(n){o.openSimpleModal({title:i.instant("common.warning"),message:i.instant("jdbc.delete.sql.table.warning.msg",{name:n}),warning:!0}).result.then((function(){t.deleteJdbcConfiguration(n).success((function(){e.getSqlConfigurations()})).error((function(e){r.error(getError(e),i.instant("jdbc.not.delete.sql.msg"))}))}))}}function o(e,n,t,r,o,i,s,u,c,a,l){e.name=n.search().name||"",e.getNamespaces=function(){y(!0,l.instant("common.refreshing.namespaces"),l.instant("common.extra.message")),u.getRepositoryNamespaces().success((function(n){const t={};n.results.bindings.forEach((function(e){t[e.prefix.value]=e.namespace.value})),e.namespaces=t})).error((function(n){e.repositoryError=getError(n)})).finally((function(){y(!1),w()}))},e.setLoader=y,e.addKnownPrefixes=C,e.page=1,e.noPadding={paddingRight:0,paddingLeft:0},e.sqlTypes=["string","iri","boolean","byte","short","int","long","float","double","decimal","date","time","timestamp","Get suggestion..."],e.currentTabConfig={},e.orientationViewMode=!0,e.currentQuery={},e.$watch((function(){return r.getActiveRepository()}),(function(e,t){e!==t&&n.path("jdbc")}));let g=null;e.goBack=function(){g=i((function(){o.history.back()}),1e3)};const d=e.$on("$locationChangeStart",(function(n){!function(n){e.currentQuery.isPristine||(confirm(l.instant("jdbc.warning.unsaved.changes"))?(window.removeEventListener("beforeunload",f),d(),i.cancel(g)):n.preventDefault())}(n)}));function f(n){e.currentQuery.isPristine||(n.returnValue=!0)}window.addEventListener("beforeunload",f),e.$on("$destroy",(function(e){window.removeEventListener("beforeunload",f),d(),i.cancel(g)}));const m={id:"1",name:"",query:"PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>\n\n# Selects two variables to use as columns\nSELECT ?id ?label {\n ?id rdfs:label ?label\n # The following placeholder must be present in the query\n #!filter\n}",inference:!0,sameAs:!0,isNewConfiguration:!0,isPristine:!0};var p;function y(n,t,r){const o=angular.element(document.getElementById("yasr-inner"));e.queryIsRunning=n,n?(e.queryStartTime=Date.now(),e.countTimeouted=!1,e.progressMessage=t,e.extraMessage=r,o.addClass("hide")):(e.progressMessage="",e.extraMessage="",o.removeClass("hide")),null===e.$$phase&&e.$apply()}function w(){e.tabsData=[e.currentQuery];const n=e.currentQuery;e.currentQuery.query?window.editor.setValue(e.currentQuery.query):window.editor.setValue(" "),i((function(){e.currentTabConfig={},e.currentTabConfig.queryType=n.queryType,e.currentTabConfig.resultsCount=n.resultsCount,e.currentTabConfig.offset=n.offset,e.currentTabConfig.allResultsCount=n.allResultsCount,e.currentTabConfig.page=n.page,e.currentTabConfig.pageSize=n.pageSize,e.currentTabConfig.timeFinished=n.timeFinished,e.currentTabConfig.timeTook=n.timeTook,e.currentTabConfig.sizeDelta=n.sizeDelta,e.$apply()}),0),e.canWriteActiveRepo()||(window.editor.options.readOnly=!0)}function b(){e.tabsData=e.tabs=[m],e.currentQuery=angular.copy(m),v(),window.editor&&(e.setQuery(e.currentQuery.query),w()),e.$watch((function(){return e.currentQuery.query}),(function(n,t){n!==t&&e.setDirty()}))}function C(){c.addKnownPrefixes(JSON.stringify(window.editor.getValue())).success((function(e){angular.isDefined(window.editor)&&angular.isDefined(e)&&e!==window.editor.getValue()&&window.editor.setValue(e)})).error((function(e){const n=getError(e);return t.error(n,l.instant("common.add.known.prefixes.error")),!0}))}function h(){j()&&s.getColumnNames(e.currentQuery.query).success((function(n){s.getColumnsTypeSuggestion(e.currentQuery.query,n).success((function(t){const r=[];_.forEach(n,(function(e){r.push({column_name:e,column_type:t[e].column_type,nullable:!0,sparql_type:t[e].sparql_type})})),e.currentQuery.columns=r,e.setDirty()})).error((function(e){t.error(getError(e),l.instant("jdbc.not.suggest.column.types"))}))})).error((function(e){t.error(getError(e),l.instant("jdbc.not.suggest.column.names"))}))}function v(){2===e.page?e.viewMode="editor":e.viewMode="none"}function Q(e,n,t,r,o){let i=t[r].value;i=i.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;");return"<div class = 'literal-cell'>"+("<p class='nonUri' style='border: none; background-color: transparent; padding: 0; margin: 0'>"+i+"</p>")+"</div>"}function T(){return window.editor&&"SELECT"===window.editor.getQueryType()}function q(){return j()&&function(){if(!e.currentQuery.columns||!e.currentQuery.columns.length)return t.error(l.instant("jdbc.warning.one.column.msg"),l.instant("jdbc.invalid.columns")),!1;if(e.containsUnknownColumns())return t.error(l.instant("jdbc.warning.all.column.msg"),l.instant("jdbc.invalid.columns")),!1;return!0}()}function j(){return!!T()||(t.error(l.instant("jdbc.warning.invalid.query"),l.instant("jdbc.invalid.query)")),!1)}e.resetCurrentTabConfig=function(){e.currentTabConfig={pageSize:100,page:1,allResultsCount:0,resultsCount:0,queryType:""}},e.saveTab=function(){},e.setQuery=function(e){window.editor.setValue(e||" ")},e.name?(p=e.name,s.getJdbcConfiguration(p).success((function(e){m.query=e.query,m.name=e.name,m.columns=e.columns,m.isNewConfiguration=!e.name,b()})).error((function(e){const n=getError(e);t.error(n,l.instant("jdbc.not.get.sql.msg2"))}))):b(),e.goToPage=function(n){e.page=n;const t=e.currentQuery.columns;2!==n||t&&0!==t.length||!T()||e.getColumnsSuggestions(),v()},e.save=function(){q()&&(e.currentQuery.name?e.currentQuery.isNewConfiguration?s.createNewJdbcConfiguration(e.currentQuery).success((function(){e.currentQuery.isPristine=!0,e.currentQuery.isNewConfiguration=!1,t.success(l.instant("jdbc.saved.configuration")),e.goBack()})).error((function(e){const n=getError(e);t.error(n,l.instant("jdbc.not.saved.configuration"))})):s.updateJdbcConfiguration(e.currentQuery).success((function(){e.currentQuery.isPristine=!0,e.currentQuery.isNewConfiguration=!1,t.success(l.instant("jdbc.configuration.updated")),e.goBack()})).error((function(e){const n=getError(e);t.error(n,l.instant("jdbc.not.saved.configuration"))})):t.error(l.instant("jdbc.required.configuration.name")))},e.hasPrecision=function(e){return"iri"===e||"string"===e||"decimal"===e},e.containsColumnsWithPrecision=function(n){return n&&n.some(n=>e.hasPrecision(n.column_type))},e.hasScale=function(e){return"decimal"===e},e.containsColumnsWithScale=function(n){return n&&n.some(n=>e.hasScale(n.column_type))},e.isLiteral=function(e){return"iri"!==e&&"unknown"!==e},e.containsNonLiteralColumnsOnly=function(n){return n&&n.every(n=>!e.isLiteral(n.column_type))},e.containsUnknownColumns=function(){return e.currentQuery.columns&&e.currentQuery.columns.find(e=>"unknown"===e.column_type)},$("textarea").on("paste",(function(){i((function(){C()}),0)})),e.selectColumnType=function(n,r){const o=_.find(e.currentQuery.columns,(function(e){return e.column_name===n}));"Get suggestion..."===o.column_type&&s.getColumnsTypeSuggestion(e.currentQuery.query,[n]).success((function(e){o.column_type=e[n].column_type,o.column_type===r?t.info(l.instant("jdbc.same.suggested.sql.type",{type:o.column_type}),l.instant("jdbc.suggest.sql.type"),{allowHtml:!0}):t.success(l.instant("jdbc.suggested.sql.type",{type:o.column_type}),l.instant("jdbc.suggest.sql.type"),{allowHtml:!0}),o.sparql_type=e[n].sparql_type})).error((function(e){t.error(getError(e),l.instant("jdbc.not.suggest.column.type"))})),e.setDirty()},e.getColumnsSuggestions=function(){e.currentQuery.columns&&e.currentQuery.columns.length>0?a.openSimpleModal({title:l.instant("common.warning"),message:l.instant("jdbc.warning.column.type.msg"),warning:!0}).result.then((function(){h()})):h()},e.deleteColumn=function(n,t){a.openSimpleModal({title:l.instant("common.warning"),message:l.instant("jdbc.warning.delete.column.msg",{columnName:n}),warning:!0}).result.then((function(){e.currentQuery.columns.splice(t,1),e.setDirty()}))},e.getPreview=function(){if(q()&&(e.executedQueryTab=e.currentQuery,!e.queryIsRunning)){$.ajaxSetup().headers=$.ajaxSetup().headers||{};const n=r.getActiveRepositoryObject();$.ajaxSetup().headers["X-GraphDB-Repository"]=n?n.id:void 0,$.ajaxSetup().headers["X-GraphDB-Repository-Location"]=n?n.location:void 0,e.currentQuery.outputType="table",e.resetCurrentTabConfig(),y(!0,l.instant("jdbc.preview.first.rows",{name:e.name}),l.instant("common.extra.message"));const o=function(n,r,o){!function(n,r,o){n.results&&n.results.bindings&&n.results.bindings.length?(window.yasr.plugins.table.options.getCellContent=Q,e.currentTabConfig.queryType="SELECT",window.yasr.setResponse(r,o,null)):t.info(l.instant("jdbc.table.definition"),l.instant("jdbc.preview.sql"))}(n,o,r),y(!1)},i=function(e){y(!1),t.error(getError(e,0,100),l.instant("jdbc.not.show.preview"))};if(e.canWriteActiveRepo()){const n=JSON.stringify({name:e.currentQuery.name,query:e.currentQuery.query,columns:e.currentQuery.columns||[]});s.getNewSqlTablePreview(n).done(o).fail(i)}else s.getExistingSqlTablePreview(e.currentQuery.name).done(o).fail(i)}},e.setDirty=function(){e.currentQuery.isPristine=!1},e.getTypeLabel=function(e){switch(e){case"iri":return"VARCHAR: IRI";case"string":return"VARCHAR: String";default:return e.indexOf(" ")>0?e:e.toUpperCase()}}}angular.module("graphdb.framework.jdbc.controllers",["ui.bootstrap","graphdb.framework.core.services.repositories","graphdb.framework.rest.monitoring.service","toastr"],["graphdb.framework.utils.notifications"]).controller("JdbcListCtrl",r).controller("JdbcCreateCtrl",o),r.$inject=["$scope","$repositories","JdbcRestService","toastr","ModalService","$translate"],o.$inject=["$scope","$location","toastr","$repositories","$window","$timeout","JdbcRestService","RDF4JRepositoriesRestService","SparqlRestService","ModalService","$translate"]},58:function(e,n){function t(e,n){return{showToastMessageWithDelay:function(t){return new Promise(r=>{e.success(n.instant(t)),setTimeout(r,200)})}}}angular.module("graphdb.framework.utils.notifications",[]).factory("Notifications",t),t.$inject=["toastr","$translate"]}}]);
@@ -0,0 +1 @@
1
+ (window.webpackJsonp=window.webpackJsonp||[]).push([[70],{93:function(t,e){angular.module("graphdb.framework.chatgpt.controllers",["toastr","graphdb.framework.utils.localstorageadapter"]).controller("ChatGptCtrl",o).controller("ChatGptSettingsCtrl",n),o.$inject=["$scope","$http","$timeout","$translate","$uibModal","$repositories","toastr","ModalService","LocalStorageAdapter"];function o(t,e,o,n,r,s,i,a,c){function l(){o(()=>{document.getElementById("messages-scrollable").scrollIntoView({behavior:"smooth",block:"end",inline:"nearest"})},0)}function u(){t.history=[],t.askSettings={queryTemplate:{query:"string"},groundTruths:[],echoVectorQuery:!1,topK:5};const e=c.get("ttyg"),o=s.getActiveRepository();if(e&&e[o]){const n=e[o];n.history&&(t.history=n.history),t.connectorID=n.connectorID,n.askSettings&&(t.askSettings=n.askSettings)}l()}function g(){const e=c.get("ttyg")||{};e[s.getActiveRepository()]={history:t.history,connectorID:t.connectorID,askSettings:t.askSettings},c.set("ttyg",e)}t.helpTemplateUrl="js/angular/chatgpt/templates/chatInfo.html",t.getIcon=function(t){return"question"===t?"user":"assistant"===t?"data":"help"},t.ask=function(){if(!t.question.trim())return;const o=t.history.filter(t=>!t.error),n={connectorID:t.connectorID,question:t.question,askSettings:t.askSettings,history:o},r={role:"question",content:t.question};e.post("rest/chat/retrieval?repositoryID="+s.getActiveRepository(),n).then(e=>{t.history.pop(),e.data.forEach(e=>t.history.push(e))}).catch(t=>{r.error=!0,i.error(getError(t,0,100))}).finally(()=>{t.loader=!1,l(),g()}),t.history.push(r),t.loader=!0,l(),t.question=""},t.clear=function(){a.openSimpleModal({title:n.instant("common.confirm"),message:n.instant("ttyg.clear.history.confirmation"),warning:!0}).result.then((function(){t.history=[],g()}))},t.openSettings=function(){r.open({templateUrl:"js/angular/chatgpt/templates/modal/settings.html",controller:"ChatGptSettingsCtrl",size:"lg",resolve:{data:function(){return{askSettings:t.askSettings,connectorID:t.connectorID}}}}).result.then((function(e){t.connectorID=e.connectorID,t.askSettings=e.askSettings,g()}))},t.$on("repositoryIsSet",(function(){u()})),s.getActiveRepository()&&u()}function n(t,e,o,n){t.dialogTitle=e.instant("ttyg.settings.title"),t.save=function(){if(t.form.$valid){const e={queryTemplate:JSON.parse(t.queryTemplate),groundTruths:t.groundTruths.split("\n"),topK:t.topK,echoVectorQuery:t.echoVectorQuery};o.close({askSettings:e,connectorID:t.connectorID})}},t.cancel=function(){o.dismiss("cancel")},t.connectorID=n.connectorID,t.queryTemplate=JSON.stringify(n.askSettings.queryTemplate,null," "),t.topK=n.askSettings.topK,t.echoVectorQuery=n.askSettings.echoVectorQuery,t.groundTruths=n.askSettings.groundTruths.map(t=>t.trim()).filter(t=>""!==t).join("\n")}n.$inject=["$scope","$translate","$uibModalInstance","data"]}}]);
@@ -0,0 +1 @@
1
+ (window.webpackJsonp=window.webpackJsonp||[]).push([[76,9],{63:function(e,t,n){"use strict";n.r(t);n(10),n(27);var r=n(0);function i(e,t,n,i,o,a,s,u,c,d,l,g,y,f,p){const m={id:"1",name:"",query:"select * where { \n\t?s ?p ?o .\n} limit 100 \n",inference:!0,sameAs:!0};let T,h;function b(t){!function(){if(i.isActiveRepoOntopType())return;const t=document.getElementById("sameAs");!t||e.currentQuery.inference||t.disabled?e.currentQuery.inference&&t.disabled&&(t.removeAttribute("disabled"),e.currentQuery.sameAs=T.appSettings.DEFAULT_SAMEAS):(t.disabled=!0,e.currentQuery.sameAs=!1)}(),e.tabs.forEach((function(n,r){n.id===t.id&&(e.tabs[r].query=t.query,i.isActiveRepoOntopType()||(e.tabs[r].inference=t.inference,e.tabs[r].sameAs=t.sameAs))})),y.set(f.TABS_STATE,e.tabs)}function w(t,n,r,i){const o=angular.element(document.getElementById("yasr-inner"));e.queryIsRunning=t,t?(e.queryStartTime=Date.now(),e.countTimeouted=!1,e.progressMessage=n,e.extraMessage=r,e.noLoaderTimer=i,o.addClass("hide")):(e.progressMessage="",e.extraMessage="",e.noLoaderTimer=!1,e.currentTrackAlias=null,e.abortRequested=!1,o.removeClass("hide")),null===e.$$phase&&e.$apply()}function C(n){function r(){return window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight||0}if(e.orientationViewMode){if("yasr"===e.viewMode){let e=r()-document.querySelector(".CodeMirror-wrap").getBoundingClientRect().top;e-=40,document.querySelector(".CodeMirror-wrap").style.height=e+"px"}else e.noPadding={},document.querySelector(".CodeMirror-wrap").style.height="";document.getElementById("yasr").style.minHeight=""}else if(e.noPadding={paddingRight:15,paddingLeft:0},window.editor&&document.querySelector(".CodeMirror-wrap")){let e=r()-document.querySelector(".CodeMirror-wrap").getBoundingClientRect().top;e-=40,document.querySelector(".CodeMirror-wrap").style.height=e+"px",document.getElementById("yasr").style.minHeight=e+"px"}else{let r;r=t(n?function(){e.fixSizesOnHorizontalViewModeSwitch(n)}:e.fixSizesOnHorizontalViewModeSwitch,100),e.$on("$destroy",(function(){t.cancel(r)}))}window.yasr&&window.yasr.container&&t((function(){window.yasr.container.resize()}),100)}function S(){C(!0)}function q(t,n){n.newRepo&&(e.tabsData=y.get(f.TABS_STATE),e.tabsData.forEach((function(e){e.yasrData=void 0,e.queryType=void 0,e.resultsCount=0,e.allResultsCount=0,e.sizeDelta=void 0})),y.set(f.TABS_STATE,e.tabsData),e.tabs=e.tabsData,e.currentQuery={},e.errorMessage=null,e.repositoryError=null)}function E(e){t((function(){$('a[data-id = "'+e+'"]').tab("show")}),0)}function v(r,o){if(e.executedQueryTab=e.currentQuery,o){if("SELECT"!==window.editor.getQueryType()&&"CONSTRUCT"!==window.editor.getQueryType()&&"DESCRIBE"!==window.editor.getQueryType())return void n.warning(p.instant("query.editor.warning.msg"));if(i.isActiveRepoOntopType())return void n.warning(p.instant("query.editor.virtual.repo.warning.msg"))}if(e.explainRequested=o,!e.queryIsRunning){if(r?e.currentTabConfig.resultsCount=0:e.resetCurrentTabConfig(),e.lastRunQueryMode=window.editor.getQueryMode(),"update"===e.lastRunQueryMode&&i.isActiveRepoOntopType())return void n.warning(p.instant("query.editor.virtual.repo.update.warning.msg"));if(w(!0,"update"===e.lastRunQueryMode?p.instant("query.editor.executing.update"):p.instant("query.editor.evaluating.query")),"none"!==e.viewMode){e.viewMode="none",e.orientationViewMode&&e.fixSizesOnHorizontalViewModeSwitch();const n=t(window.editor.query,500);e.$on("$destroy",(function(){t.cancel(n)}))}else window.editor.query()}}function M(t){let n=void 0;return e.tabsData.forEach((function(e){if(e.name===t.name&&e.query===t.body)return n=e.id,e})),n}function Q(t){return function(n,r,i){e.savedQuery={name:n,query:r||window.editor.getValue(),shared:i},$(t).modal("show")}}function A(t){for(let n=0;n<e.tabsData.length;n++){if(e.tabsData[n].id===t)return n}}e.getPrincipal=function(){return d.getPrincipal().then(t=>{T=t,function(e,t){m.inference=t.appSettings.DEFAULT_INFERENCE,m.sameAs=t.appSettings.DEFAULT_SAMEAS,e.skipCountQuery=!t.appSettings.EXECUTE_COUNT,e.ignoreSharedQueries=t.appSettings.IGNORE_SHARED_QUERIES,e.tabsData=e.tabs=y.get(f.TABS_STATE)||[m],e.$watchCollection("[currentQuery.inference, currentQuery.sameAs]",(function(e,t,n){b(n.currentQuery)})),e.$on("repositoryIsSet",q)}(e,T)})},e.getPrincipal(),this.hint=document.createElement("span"),this.hint.innerHTML=p.instant("query.editor.autocomplete.hint"),this.hint.style.fontSize="12px",this.hint.style.color="gray",this.hint.style.backgroundColor="white",this.hint.style.position="absolute",this.hint.style.zIndex="3",this.hint.style.paddingLeft="12px",e.$watch((function(){return angular.element(".CodeMirror-hints").length}),e=>{if(e){const e=angular.element(".CodeMirror-hints")[0].getBoundingClientRect();document.body.appendChild(this.hint),this.hint.style.top=e.top-20+"px",this.hint.style.left=e.right-this.hint.offsetWidth-12+"px"}else this.hint&&this.hint.parentNode&&this.hint.parentNode.removeChild(this.hint)}),e.resetCurrentTabConfig=function(){e.currentTabConfig={pageSize:1e3,page:1,allResultsCount:0,resultsCount:0}},e.queryExists=!1,e.resetCurrentTabConfig(),e.saveTab=function(t){const n=A(t);if(void 0===n)return{};const r=e.tabsData[n];return e.saveQueryToLocal(r),r},e.loadTab=function(n){e.tabsData=y.get(f.TABS_STATE)||[m];const r=A(n),o=e.tabsData[r];o.yasrData&&w(!0,p.instant("query.editor.render.results.msg"),null,!0);t((function(){""===e.currentQuery.query&&(e.currentQuery.query=" "),t((function(){window.editor.setValue(e.currentQuery.query),e.yasr.updateDownloadDropdown(),e.$broadcast("tabLoaded",e.currentQuery.id),e.yasr.options.output=o.outputType,o.yasrData&&(o.yasrData.customError?(e.yasr.results={getException:function(){return o.yasrData.customError}},w(!1)):t((function(){e.setYasrResponse(o.yasrData,o.textStatus,o.jqXhrOrErrorString),w(!1),$(".yasr_btnGroup li:nth-child(2)").hasClass("active")&&t((function(){$(".yasr_btnGroup li:nth-child(2) a").get(0).click()}),0)}),0))}),0)}),0),y.set(f.TABS_STATE_CURRENT_ID,n),e.currentQuery=o,t((function(){e.currentTabConfig={},e.currentTabConfig.queryType=o.queryType,e.currentTabConfig.resultsCount=o.resultsCount,e.currentTabConfig.offset=o.offset,e.currentTabConfig.allResultsCount=o.allResultsCount,e.currentTabConfig.allResultsCountExact=o.allResultsCountExact,e.currentTabConfig.page=o.page,e.currentTabConfig.pageSize=o.pageSize,e.currentTabConfig.timeFinished=o.timeFinished,e.currentTabConfig.timeTook=o.timeTook,e.currentTabConfig.sizeDelta=o.sizeDelta,e.currentTabConfig.customUpdateMessage=o.customUpdateMessage,e.currentTabConfig.errorMessage=o.errorMessage,e.currentTabConfig.warningMessage=o.warningMessage,e.$apply()}),0),$("#yasr").css("padding","0"),h||(h=setInterval(x,200));!function(){const t=i.isActiveRepoOntopType(),n=i.isActiveRepoFedXType();(function(e){const t=document.getElementById("sameAs"),n=document.getElementById("inference");t&&(t.disabled=!!e);n&&(n.disabled=!!e)})(t),e.nocount=!(!t&&!n)||!T.appSettings.EXECUTE_COUNT,t&&(e.currentQuery.inference=!0,e.currentQuery.sameAs=!0)}()},e.addNewTab=function(n,r,i){if(!_(!0))return;let o;o=r||i?{id:"1",name:r,query:i,inference:T.appSettings.DEFAULT_INFERENCE,sameAs:T.appSettings.DEFAULT_SAMEAS}:{id:"1",name:"",query:"select * where { \n\t?s ?p ?o .\n} limit 100 \n",inference:T.appSettings.DEFAULT_INFERENCE,sameAs:T.appSettings.DEFAULT_SAMEAS};D++;const a=""+D;e.tabsData=e.tabs;const s=o;s.id=a,e.tabsData.push(s),y.set(f.TABS_STATE_MAXID,D),y.set(f.TABS_STATE,e.tabsData);const u=Array.prototype.slice.call(arguments,1);t((function(){e.$apply(),E(a),n&&n.apply(this,u)}),0),e.tabs=e.tabsData},e.isTabChangeOk=_,e.runQuery=v,e.abortCurrentQuery=function(){g.deleteQuery(e.currentTrackAlias,i.getActiveRepository()).success((function(){e.abortRequested=!0}))},e.editQuery=function(t){o.open({templateUrl:"js/angular/core/directives/queryeditor/templates/query-sample.html",controller:"QuerySampleModalCtrl",resolve:{data:function(){return{title:p.instant("query.editor.edit.saved.query",{name:t.name}),query:t,edit:!0,okButtonText:p.instant("common.save.btn")}}}}).result.then((function(r){const i={name:r.name,body:r.body,shared:r.shared};t.name!==r.name?s.addNewSavedQuery(i).success((function(){e.deleteQueryHttp(t.name,!0)})).error((function(e){const t=getError(e);n.error(t,p.instant("query.editor.edit.saved.query.error"))})):s.editSavedQuery(i).success((function(){$("#editQueryContainer").modal("hide"),e.toggleSampleQueries(),n.success(p.instant("query.editor.edit.saved.query.success.msg",{name:t.name}))})).error((function(e){const t=getError(e);n.error(t,p.instant("query.editor.edit.saved.query.error"))}))}))},e.getNamespaces=function(){w(!0,p.instant("common.refreshing.namespaces"),p.instant("common.extra.message")),e.namespacesLoading=!0,l.getRepositoryNamespaces().success((function(t){const n={};t.results.bindings.forEach((function(e){n[e.prefix.value]=e.namespace.value})),e.namespaces=n})).error((function(t){e.repositoryError=getError(t)})).finally((function(){w(!1),e.namespacesLoading=!1}))},e.changePagination=function(){v(!0,e.explainRequested)},e.toggleSampleQueries=function(){s.getSavedQueries().success((function(t){e.sampleQueries=t.filter(t=>!e.ignoreSharedQueries||t.owner!==e.principal.username)})).error((function(e){const t=getError(e);n.error(t,p.instant("query.editor.get.saved.queries.error"))}))},e.addKnownPrefixes=function(){s.addKnownPrefixes(JSON.stringify(window.editor.getValue())).success((function(e){angular.isDefined(window.editor)&&angular.isDefined(e)&&e!==window.editor.getValue()&&window.editor.setValue(e)})).error((function(e){const t=getError(e);return n.error(t,p.instant("common.add.known.prefixes.error")),!0}))},e.getExistingTabId=M,e.querySelected=function(t){const n=M(t);e.toggleSampleQueries(),e.isTabChangeOk(!1)&&(e.highlightNextTabChange=!0,angular.isDefined(n)?E(n):e.addNewTab(null,t.name,t.body))},e.deleteQuery=function(t){a.openSimpleModal({title:p.instant("common.confirm"),message:p.instant("query.editor.delete.saved.query.warning.msg",{savedQueryName:t}),warning:!0}).result.then((function(){e.deleteQueryHttp(t)}))},e.deleteQueryHttp=function(t,r){s.deleteSavedQuery(t).success((function(){e.toggleSampleQueries(),r||n.success(p.instant("query.editor.delete.saved.query.success.msg",{savedQueryName:t}))})).error((function(e){const t=getError(e);n.error(t,p.instant("query.editor.delete.saved.query.error"))}))},e.saveQuery=function(t,n){o.open({templateUrl:"js/angular/core/directives/queryeditor/templates/query-sample.html",controller:"QuerySampleModalCtrl",resolve:{data:function(){return{title:p.instant("query.editor.create.saved.query.msg"),query:{name:t.name,body:t.query,shared:t.shared},edit:!1,okButtonText:p.instant("common.create.btn"),queryExists:n,existingQueryErrMsg:Object(r.decodeHTML)(p.instant("query.sample.existing.query.warning",{name:t.name}))}}}}).result.then((function(t){e.saveQueryHttp(t)}),(function(){}))},e.saveQueryHttp=function(t){s.addNewSavedQuery(t).success((function(){n.success(p.instant("query.editor.save.saved.query.success.msg",{name:t.name}))})).error((function(r,i){const o=getError(r);n.error(o,p.instant("query.editor.create.saved.query.error"));let a=!1;409===i&&(a=!0),t.query=t.body,e.saveQuery(t,a)}))},e.saveQueryToLocal=b,e.setLoader=w,e.getLoaderMessage=function(){const t=(Date.now()-e.queryStartTime)/1e3;let n="",r="";e.noLoaderTimer||(n=e.getHumanReadableSeconds(t));r=e.progressMessage?p.instant("query.editor.progress.msg",{progressMessage:e.progressMessage,timeHuman:n}):p.instant("common.running.operation",{timeHuman:n});e.extraMessage&&t>10&&(r+=p.instant("query.editor.extra.msg",{extraMessage:e.extraMessage}));return r},e.fixSizesOnHorizontalViewModeSwitch=C,e.changeViewMode=function(){e.viewMode="none",e.orientationViewMode=!e.orientationViewMode,y.set(f.VIEW_MODE,e.orientationViewMode),C()},e.showHideEditor=S,e.focusQueryEditor=function(){angular.element(document).find(".editable-input").is(":focus")||angular.element(document).find(".CodeMirror textarea:first-child").focus()},e.orientationViewMode=!y.get(f.VIEW_MODE)||"true"===y.get(f.VIEW_MODE),e.viewMode="none",e.getActiveRepository=function(){return i.getActiveRepository()},e.getActiveRepositoryNoError=function(){if(!e.repositoryError)return i.getActiveRepository()},e.orientationViewMode||S(),window.onbeforeunload=function(){e.currentQuery&&e.saveTab(e.currentQuery.id),y.set(f.TABS_STATE,e.tabs)},e.$on("$destroy",(function(){e.currentQuery&&e.saveTab(e.currentQuery.id),y.set(f.TABS_STATE,e.tabs),clearInterval(h)})),e.$on("$destroy",(function(){clearInterval(h),window.editor=null,window.yasr=null}));let D=y.get(f.TABS_STATE_MAXID)||1;function R(e){return $(e).attr("data-id")}function x(){if(e.currentTabConfig.resultsCount>=0){const e=$(".saveAsDropDown");e.length>0&&!window.editor.queryValid?yasr.header.find(".saveAsDropDown").remove():0===e.length&&window.editor.queryValid&&yasr.updateDownloadDropdown()}}function _(t){return!(e.queryIsRunning&&!e.namespacesLoading)||(t?n.info(p.instant("query.editor.new.tab.running.query.warning.msg")):n.info(p.instant("query.editor.tab.switching.running.query.warning.msg")),!1)}e.highlightNextTabChange=!1,e.$on("tabAction",(function(n,r){r.relatedTarget&&(t.cancel(r.relatedTarget.timer),$(r.relatedTarget).css("color",""),e.saveTab(R(r.relatedTarget))),e.loadTab(R(r.target));const i=["var(--primary-color)","","var(--primary-color)"],o=[400,400,400];if(e.highlightNextTabChange){e.highlightNextTabChange=!1;let n=0;$(r.target).css("color",i[n]);const a=function(){n++,n<i.length?($(r.target).css("color",i[n]),r.target.timer=t(a,o[n])):$(r.target).css("color","")};t(a,o[n])}})),e.$on("deleteAllexeptSelected",(function(t,n){e.tabsData=n,e.tabs=n})),e.currentQuery={},e.savedQuery={},e.sampleQueries={},e.editQueryModal=Q("#editQueryContainer"),e.deleteQueryModal=Q("#confirmDeleteContainer"),e.saveQueryModal=Q("#saveQueryContainer"),e.getResultsDescription=function(){let t;if(0===e.currentTabConfig.resultsCount)t="No results.";else{const n=(e.currentTabConfig.page-1)*e.currentTabConfig.pageSize+Math.min(e.currentTabConfig.resultsCount,e.currentTabConfig.pageSize);t=p.instant("query.editor.showing.results.from.msg")+u("currency")(e.currentTabConfig.offset,"",0)+p.instant("query.editor.to")+u("currency")(n,"",0),e.currentTabConfig.allResultsCount>0&&(t+=p.instant(e.currentTabConfig.allResultsCountExact?"query.editor.of":"query.editor.of.at.least"),t+=u("currency")(e.currentTabConfig.allResultsCount,"",0)),t+="."}return t},e.getUpdateDescription=function(){return e.currentTabConfig.customUpdateMessage?p.instant(e.currentTabConfig.customUpdateMessage.msg,{name:e.currentTabConfig.customUpdateMessage.name}):void 0===e.currentTabConfig.sizeDelta?"":e.currentTabConfig.sizeDelta<0?p.instant("yasr.removed.statements.result.msg",{sizeDelta:Math.abs(e.currentTabConfig.sizeDelta)}):e.currentTabConfig.sizeDelta>0?p.instant("yasr.added.statements.result.msg",{sizeDelta:e.currentTabConfig.sizeDelta}):p.instant("yasr.statements.no.change.msg")},e.getStaleWarningMessage=function(){const t=60*Math.round((Date.now()-e.currentTabConfig.timeFinished)/6e4);if(t>=3600)return p.instant("yasr.stale.result.msg",{secondsAgo:e.getHumanReadableSeconds(t)})};const z=function(){};angular.element(c).bind("resize",z),e.$on("$destroy",(function(){angular.element(c).unbind("resize",z)}))}function o(e,t,n,r){n.queryExists&&(e.queryExists=!0),e.query=angular.copy(n.query),e.title=n.title,e.edit=n.edit,e.okButtonText=n.okButtonText,e.existingQueryErrMsg=r.trustAsHtml(n.existingQueryErrMsg),e.ok=function(){e.form.$valid&&t.close(e.query)},e.cancel=function(){t.dismiss("cancel")}}angular.module("graphdb.framework.core.directives.queryeditor.controllers",["graphdb.framework.utils.localstorageadapter","graphdb.framework.rest.sparql.service"]).controller("QueryEditorCtrl",i).controller("QuerySampleModalCtrl",o),i.$inject=["$scope","$timeout","toastr","$repositories","$uibModal","ModalService","SparqlRestService","$filter","$window","$jwtAuth","RDF4JRepositoriesRestService","MonitoringRestService","LocalStorageAdapter","LSKeys","$translate"],o.$inject=["$scope","$uibModalInstance","data","$sce"]}}]);
@@ -0,0 +1 @@
1
+ (window.webpackJsonp=window.webpackJsonp||[]).push([[81],{96:function(e,t){function a(){return{transformToTrig:function(e){let t="";const a={};for(let t=0;t<e.length;t++){const l=e[t];if(void 0===l.context?l.context="":l.context=_.trim(l.context),angular.isUndefined(a[l.context])){const e=[];e.push(l),a[l.context]=e}else a[l.context].push(l)}const l=Object.keys(a);for(let e=0;e<l.length;e++){const n=l[e];t+=""===n?"\n{":"\n<"+n+"> {";const w=a[n];for(let e=0;e<w.length;e++){const a=w[e];t+="\n\t<"+a.subject+"> <"+a.predicate+"> ";let l=a.object.value;"uri"===a.object.type?t+="<"+l+"> .":l.toString().includes('"')?("'"===l[0]&&(l='"'+l.slice(1,l.length)),l[l.length-1]&&(l=l.slice(0,-1)+'"'),t+="'''"+l+"'''"+(a.object.datatype?"^^<"+a.object.datatype+">":a.object.lang?"@"+a.object.lang:"")+" ."):t+='"""'+l+'"""'+(a.object.datatype?"^^<"+a.object.datatype+">":a.object.lang?"@"+a.object.lang:"")+" ."}t+="\n}"}return t},buildStatements:function(e,t){const a=[];if(!_.isEmpty(e.data)){const l=e.data[t],n=Object.keys(l);for(let e=0;e<n.length;e++){const w=n[e],o=l[w];for(let e=0;e<o.length;e++){const l=o[e];for(let e=0;e<l.graphs.length;e++){let n=l.graphs[e];"http://www.ontotext.com/explicit"===n&&(n=""),l.lang&&(l.datatype=""),l.datatype||(l.datatype=""),a.push({subject:t,predicate:w,object:{value:l.value,type:l.type,datatype:l.datatype,lang:l.lang},context:n})}}}}return a},getDatatypeOptions:function(){return[{value:"",label:"string"},{value:"http://www.w3.org/2001/XMLSchema#boolean",label:"boolean"},{value:"http://www.w3.org/2001/XMLSchema#decimal",label:"decimal"},{value:"http://www.w3.org/2001/XMLSchema#integer",label:"integer"},{value:"http://www.w3.org/2001/XMLSchema#double",label:"double"},{value:"http://www.w3.org/2001/XMLSchema#float",label:"float"},{value:"http://www.w3.org/2001/XMLSchema#date",label:"date"},{value:"http://www.w3.org/2001/XMLSchema#time",label:"time"},{value:"http://www.w3.org/2001/XMLSchema#dateTime",label:"date time"},{value:"http://www.w3.org/2001/XMLSchema#byte",label:"byte"},{value:"http://www.w3.org/2001/XMLSchema#short",label:"short"},{value:"http://www.w3.org/2001/XMLSchema#int",label:"int"},{value:"http://www.w3.org/2001/XMLSchema#long",label:"long"},{value:"http://www.w3.org/2001/XMLSchema#unsignedByte",label:"unsigned byte"},{value:"http://www.w3.org/2001/XMLSchema#unsignedShort",label:"unsigned short"},{value:"http://www.w3.org/2001/XMLSchema#unsignedInt",label:"unsigned int"},{value:"http://www.w3.org/2001/XMLSchema#unsignedLong",label:"unsigned long"},{value:"http://www.w3.org/2001/XMLSchema#positoveInteger",label:"positive integer"},{value:"http://www.w3.org/2001/XMLSchema#nonNegativeInteger",label:"non-negative integer"},{value:"http://www.w3.org/2001/XMLSchema#negativeInteger",label:"negative integer"},{value:"http://www.w3.org/2001/XMLSchema#nonPositiveInteger",label:"non-positive integer"},{value:"http://www.w3.org/2001/XMLSchema#gYear",label:"gYear"},{value:"http://www.w3.org/2001/XMLSchema#gMonth",label:"gMonth"},{value:"http://www.w3.org/2001/XMLSchema#gDay",label:"gDay"},{value:"http://www.w3.org/2001/XMLSchema#gYearMonth",label:"gYearMonth"},{value:"http://www.w3.org/2001/XMLSchema#gMonthDay",label:"gMonthDay"},{value:"http://www.w3.org/2001/XMLSchema#duration",label:"duration"},{value:"http://www.w3.org/2001/XMLSchema#hexBinary",label:"hex binary"},{value:"http://www.w3.org/2001/XMLSchema#base64Binary",label:"base64 binary"}]}}}angular.module("graphdb.framework.explore.services",[]).factory("StatementsService",a),a.$inject=[]}}]);
@@ -0,0 +1 @@
1
+ (window.webpackJsonp=window.webpackJsonp||[]).push([[9,76],{63:function(e,t,n){"use strict";n.r(t);n(10),n(27);var r=n(0);function i(e,t,n,i,o,a,s,u,c,d,l,g,y,f,p){const m={id:"1",name:"",query:"select * where { \n\t?s ?p ?o .\n} limit 100 \n",inference:!0,sameAs:!0};let T,h;function b(t){!function(){if(i.isActiveRepoOntopType())return;const t=document.getElementById("sameAs");!t||e.currentQuery.inference||t.disabled?e.currentQuery.inference&&t.disabled&&(t.removeAttribute("disabled"),e.currentQuery.sameAs=T.appSettings.DEFAULT_SAMEAS):(t.disabled=!0,e.currentQuery.sameAs=!1)}(),e.tabs.forEach((function(n,r){n.id===t.id&&(e.tabs[r].query=t.query,i.isActiveRepoOntopType()||(e.tabs[r].inference=t.inference,e.tabs[r].sameAs=t.sameAs))})),y.set(f.TABS_STATE,e.tabs)}function w(t,n,r,i){const o=angular.element(document.getElementById("yasr-inner"));e.queryIsRunning=t,t?(e.queryStartTime=Date.now(),e.countTimeouted=!1,e.progressMessage=n,e.extraMessage=r,e.noLoaderTimer=i,o.addClass("hide")):(e.progressMessage="",e.extraMessage="",e.noLoaderTimer=!1,e.currentTrackAlias=null,e.abortRequested=!1,o.removeClass("hide")),null===e.$$phase&&e.$apply()}function C(n){function r(){return window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight||0}if(e.orientationViewMode){if("yasr"===e.viewMode){let e=r()-document.querySelector(".CodeMirror-wrap").getBoundingClientRect().top;e-=40,document.querySelector(".CodeMirror-wrap").style.height=e+"px"}else e.noPadding={},document.querySelector(".CodeMirror-wrap").style.height="";document.getElementById("yasr").style.minHeight=""}else if(e.noPadding={paddingRight:15,paddingLeft:0},window.editor&&document.querySelector(".CodeMirror-wrap")){let e=r()-document.querySelector(".CodeMirror-wrap").getBoundingClientRect().top;e-=40,document.querySelector(".CodeMirror-wrap").style.height=e+"px",document.getElementById("yasr").style.minHeight=e+"px"}else{let r;r=t(n?function(){e.fixSizesOnHorizontalViewModeSwitch(n)}:e.fixSizesOnHorizontalViewModeSwitch,100),e.$on("$destroy",(function(){t.cancel(r)}))}window.yasr&&window.yasr.container&&t((function(){window.yasr.container.resize()}),100)}function S(){C(!0)}function q(t,n){n.newRepo&&(e.tabsData=y.get(f.TABS_STATE),e.tabsData.forEach((function(e){e.yasrData=void 0,e.queryType=void 0,e.resultsCount=0,e.allResultsCount=0,e.sizeDelta=void 0})),y.set(f.TABS_STATE,e.tabsData),e.tabs=e.tabsData,e.currentQuery={},e.errorMessage=null,e.repositoryError=null)}function E(e){t((function(){$('a[data-id = "'+e+'"]').tab("show")}),0)}function v(r,o){if(e.executedQueryTab=e.currentQuery,o){if("SELECT"!==window.editor.getQueryType()&&"CONSTRUCT"!==window.editor.getQueryType()&&"DESCRIBE"!==window.editor.getQueryType())return void n.warning(p.instant("query.editor.warning.msg"));if(i.isActiveRepoOntopType())return void n.warning(p.instant("query.editor.virtual.repo.warning.msg"))}if(e.explainRequested=o,!e.queryIsRunning){if(r?e.currentTabConfig.resultsCount=0:e.resetCurrentTabConfig(),e.lastRunQueryMode=window.editor.getQueryMode(),"update"===e.lastRunQueryMode&&i.isActiveRepoOntopType())return void n.warning(p.instant("query.editor.virtual.repo.update.warning.msg"));if(w(!0,"update"===e.lastRunQueryMode?p.instant("query.editor.executing.update"):p.instant("query.editor.evaluating.query")),"none"!==e.viewMode){e.viewMode="none",e.orientationViewMode&&e.fixSizesOnHorizontalViewModeSwitch();const n=t(window.editor.query,500);e.$on("$destroy",(function(){t.cancel(n)}))}else window.editor.query()}}function M(t){let n=void 0;return e.tabsData.forEach((function(e){if(e.name===t.name&&e.query===t.body)return n=e.id,e})),n}function Q(t){return function(n,r,i){e.savedQuery={name:n,query:r||window.editor.getValue(),shared:i},$(t).modal("show")}}function A(t){for(let n=0;n<e.tabsData.length;n++){if(e.tabsData[n].id===t)return n}}e.getPrincipal=function(){return d.getPrincipal().then(t=>{T=t,function(e,t){m.inference=t.appSettings.DEFAULT_INFERENCE,m.sameAs=t.appSettings.DEFAULT_SAMEAS,e.skipCountQuery=!t.appSettings.EXECUTE_COUNT,e.ignoreSharedQueries=t.appSettings.IGNORE_SHARED_QUERIES,e.tabsData=e.tabs=y.get(f.TABS_STATE)||[m],e.$watchCollection("[currentQuery.inference, currentQuery.sameAs]",(function(e,t,n){b(n.currentQuery)})),e.$on("repositoryIsSet",q)}(e,T)})},e.getPrincipal(),this.hint=document.createElement("span"),this.hint.innerHTML=p.instant("query.editor.autocomplete.hint"),this.hint.style.fontSize="12px",this.hint.style.color="gray",this.hint.style.backgroundColor="white",this.hint.style.position="absolute",this.hint.style.zIndex="3",this.hint.style.paddingLeft="12px",e.$watch((function(){return angular.element(".CodeMirror-hints").length}),e=>{if(e){const e=angular.element(".CodeMirror-hints")[0].getBoundingClientRect();document.body.appendChild(this.hint),this.hint.style.top=e.top-20+"px",this.hint.style.left=e.right-this.hint.offsetWidth-12+"px"}else this.hint&&this.hint.parentNode&&this.hint.parentNode.removeChild(this.hint)}),e.resetCurrentTabConfig=function(){e.currentTabConfig={pageSize:1e3,page:1,allResultsCount:0,resultsCount:0}},e.queryExists=!1,e.resetCurrentTabConfig(),e.saveTab=function(t){const n=A(t);if(void 0===n)return{};const r=e.tabsData[n];return e.saveQueryToLocal(r),r},e.loadTab=function(n){e.tabsData=y.get(f.TABS_STATE)||[m];const r=A(n),o=e.tabsData[r];o.yasrData&&w(!0,p.instant("query.editor.render.results.msg"),null,!0);t((function(){""===e.currentQuery.query&&(e.currentQuery.query=" "),t((function(){window.editor.setValue(e.currentQuery.query),e.yasr.updateDownloadDropdown(),e.$broadcast("tabLoaded",e.currentQuery.id),e.yasr.options.output=o.outputType,o.yasrData&&(o.yasrData.customError?(e.yasr.results={getException:function(){return o.yasrData.customError}},w(!1)):t((function(){e.setYasrResponse(o.yasrData,o.textStatus,o.jqXhrOrErrorString),w(!1),$(".yasr_btnGroup li:nth-child(2)").hasClass("active")&&t((function(){$(".yasr_btnGroup li:nth-child(2) a").get(0).click()}),0)}),0))}),0)}),0),y.set(f.TABS_STATE_CURRENT_ID,n),e.currentQuery=o,t((function(){e.currentTabConfig={},e.currentTabConfig.queryType=o.queryType,e.currentTabConfig.resultsCount=o.resultsCount,e.currentTabConfig.offset=o.offset,e.currentTabConfig.allResultsCount=o.allResultsCount,e.currentTabConfig.allResultsCountExact=o.allResultsCountExact,e.currentTabConfig.page=o.page,e.currentTabConfig.pageSize=o.pageSize,e.currentTabConfig.timeFinished=o.timeFinished,e.currentTabConfig.timeTook=o.timeTook,e.currentTabConfig.sizeDelta=o.sizeDelta,e.currentTabConfig.customUpdateMessage=o.customUpdateMessage,e.currentTabConfig.errorMessage=o.errorMessage,e.currentTabConfig.warningMessage=o.warningMessage,e.$apply()}),0),$("#yasr").css("padding","0"),h||(h=setInterval(x,200));!function(){const t=i.isActiveRepoOntopType(),n=i.isActiveRepoFedXType();(function(e){const t=document.getElementById("sameAs"),n=document.getElementById("inference");t&&(t.disabled=!!e);n&&(n.disabled=!!e)})(t),e.nocount=!(!t&&!n)||!T.appSettings.EXECUTE_COUNT,t&&(e.currentQuery.inference=!0,e.currentQuery.sameAs=!0)}()},e.addNewTab=function(n,r,i){if(!_(!0))return;let o;o=r||i?{id:"1",name:r,query:i,inference:T.appSettings.DEFAULT_INFERENCE,sameAs:T.appSettings.DEFAULT_SAMEAS}:{id:"1",name:"",query:"select * where { \n\t?s ?p ?o .\n} limit 100 \n",inference:T.appSettings.DEFAULT_INFERENCE,sameAs:T.appSettings.DEFAULT_SAMEAS};D++;const a=""+D;e.tabsData=e.tabs;const s=o;s.id=a,e.tabsData.push(s),y.set(f.TABS_STATE_MAXID,D),y.set(f.TABS_STATE,e.tabsData);const u=Array.prototype.slice.call(arguments,1);t((function(){e.$apply(),E(a),n&&n.apply(this,u)}),0),e.tabs=e.tabsData},e.isTabChangeOk=_,e.runQuery=v,e.abortCurrentQuery=function(){g.deleteQuery(e.currentTrackAlias,i.getActiveRepository()).success((function(){e.abortRequested=!0}))},e.editQuery=function(t){o.open({templateUrl:"js/angular/core/directives/queryeditor/templates/query-sample.html",controller:"QuerySampleModalCtrl",resolve:{data:function(){return{title:p.instant("query.editor.edit.saved.query",{name:t.name}),query:t,edit:!0,okButtonText:p.instant("common.save.btn")}}}}).result.then((function(r){const i={name:r.name,body:r.body,shared:r.shared};t.name!==r.name?s.addNewSavedQuery(i).success((function(){e.deleteQueryHttp(t.name,!0)})).error((function(e){const t=getError(e);n.error(t,p.instant("query.editor.edit.saved.query.error"))})):s.editSavedQuery(i).success((function(){$("#editQueryContainer").modal("hide"),e.toggleSampleQueries(),n.success(p.instant("query.editor.edit.saved.query.success.msg",{name:t.name}))})).error((function(e){const t=getError(e);n.error(t,p.instant("query.editor.edit.saved.query.error"))}))}))},e.getNamespaces=function(){w(!0,p.instant("common.refreshing.namespaces"),p.instant("common.extra.message")),e.namespacesLoading=!0,l.getRepositoryNamespaces().success((function(t){const n={};t.results.bindings.forEach((function(e){n[e.prefix.value]=e.namespace.value})),e.namespaces=n})).error((function(t){e.repositoryError=getError(t)})).finally((function(){w(!1),e.namespacesLoading=!1}))},e.changePagination=function(){v(!0,e.explainRequested)},e.toggleSampleQueries=function(){s.getSavedQueries().success((function(t){e.sampleQueries=t.filter(t=>!e.ignoreSharedQueries||t.owner!==e.principal.username)})).error((function(e){const t=getError(e);n.error(t,p.instant("query.editor.get.saved.queries.error"))}))},e.addKnownPrefixes=function(){s.addKnownPrefixes(JSON.stringify(window.editor.getValue())).success((function(e){angular.isDefined(window.editor)&&angular.isDefined(e)&&e!==window.editor.getValue()&&window.editor.setValue(e)})).error((function(e){const t=getError(e);return n.error(t,p.instant("common.add.known.prefixes.error")),!0}))},e.getExistingTabId=M,e.querySelected=function(t){const n=M(t);e.toggleSampleQueries(),e.isTabChangeOk(!1)&&(e.highlightNextTabChange=!0,angular.isDefined(n)?E(n):e.addNewTab(null,t.name,t.body))},e.deleteQuery=function(t){a.openSimpleModal({title:p.instant("common.confirm"),message:p.instant("query.editor.delete.saved.query.warning.msg",{savedQueryName:t}),warning:!0}).result.then((function(){e.deleteQueryHttp(t)}))},e.deleteQueryHttp=function(t,r){s.deleteSavedQuery(t).success((function(){e.toggleSampleQueries(),r||n.success(p.instant("query.editor.delete.saved.query.success.msg",{savedQueryName:t}))})).error((function(e){const t=getError(e);n.error(t,p.instant("query.editor.delete.saved.query.error"))}))},e.saveQuery=function(t,n){o.open({templateUrl:"js/angular/core/directives/queryeditor/templates/query-sample.html",controller:"QuerySampleModalCtrl",resolve:{data:function(){return{title:p.instant("query.editor.create.saved.query.msg"),query:{name:t.name,body:t.query,shared:t.shared},edit:!1,okButtonText:p.instant("common.create.btn"),queryExists:n,existingQueryErrMsg:Object(r.decodeHTML)(p.instant("query.sample.existing.query.warning",{name:t.name}))}}}}).result.then((function(t){e.saveQueryHttp(t)}),(function(){}))},e.saveQueryHttp=function(t){s.addNewSavedQuery(t).success((function(){n.success(p.instant("query.editor.save.saved.query.success.msg",{name:t.name}))})).error((function(r,i){const o=getError(r);n.error(o,p.instant("query.editor.create.saved.query.error"));let a=!1;409===i&&(a=!0),t.query=t.body,e.saveQuery(t,a)}))},e.saveQueryToLocal=b,e.setLoader=w,e.getLoaderMessage=function(){const t=(Date.now()-e.queryStartTime)/1e3;let n="",r="";e.noLoaderTimer||(n=e.getHumanReadableSeconds(t));r=e.progressMessage?p.instant("query.editor.progress.msg",{progressMessage:e.progressMessage,timeHuman:n}):p.instant("common.running.operation",{timeHuman:n});e.extraMessage&&t>10&&(r+=p.instant("query.editor.extra.msg",{extraMessage:e.extraMessage}));return r},e.fixSizesOnHorizontalViewModeSwitch=C,e.changeViewMode=function(){e.viewMode="none",e.orientationViewMode=!e.orientationViewMode,y.set(f.VIEW_MODE,e.orientationViewMode),C()},e.showHideEditor=S,e.focusQueryEditor=function(){angular.element(document).find(".editable-input").is(":focus")||angular.element(document).find(".CodeMirror textarea:first-child").focus()},e.orientationViewMode=!y.get(f.VIEW_MODE)||"true"===y.get(f.VIEW_MODE),e.viewMode="none",e.getActiveRepository=function(){return i.getActiveRepository()},e.getActiveRepositoryNoError=function(){if(!e.repositoryError)return i.getActiveRepository()},e.orientationViewMode||S(),window.onbeforeunload=function(){e.currentQuery&&e.saveTab(e.currentQuery.id),y.set(f.TABS_STATE,e.tabs)},e.$on("$destroy",(function(){e.currentQuery&&e.saveTab(e.currentQuery.id),y.set(f.TABS_STATE,e.tabs),clearInterval(h)})),e.$on("$destroy",(function(){clearInterval(h),window.editor=null,window.yasr=null}));let D=y.get(f.TABS_STATE_MAXID)||1;function R(e){return $(e).attr("data-id")}function x(){if(e.currentTabConfig.resultsCount>=0){const e=$(".saveAsDropDown");e.length>0&&!window.editor.queryValid?yasr.header.find(".saveAsDropDown").remove():0===e.length&&window.editor.queryValid&&yasr.updateDownloadDropdown()}}function _(t){return!(e.queryIsRunning&&!e.namespacesLoading)||(t?n.info(p.instant("query.editor.new.tab.running.query.warning.msg")):n.info(p.instant("query.editor.tab.switching.running.query.warning.msg")),!1)}e.highlightNextTabChange=!1,e.$on("tabAction",(function(n,r){r.relatedTarget&&(t.cancel(r.relatedTarget.timer),$(r.relatedTarget).css("color",""),e.saveTab(R(r.relatedTarget))),e.loadTab(R(r.target));const i=["var(--primary-color)","","var(--primary-color)"],o=[400,400,400];if(e.highlightNextTabChange){e.highlightNextTabChange=!1;let n=0;$(r.target).css("color",i[n]);const a=function(){n++,n<i.length?($(r.target).css("color",i[n]),r.target.timer=t(a,o[n])):$(r.target).css("color","")};t(a,o[n])}})),e.$on("deleteAllexeptSelected",(function(t,n){e.tabsData=n,e.tabs=n})),e.currentQuery={},e.savedQuery={},e.sampleQueries={},e.editQueryModal=Q("#editQueryContainer"),e.deleteQueryModal=Q("#confirmDeleteContainer"),e.saveQueryModal=Q("#saveQueryContainer"),e.getResultsDescription=function(){let t;if(0===e.currentTabConfig.resultsCount)t="No results.";else{const n=(e.currentTabConfig.page-1)*e.currentTabConfig.pageSize+Math.min(e.currentTabConfig.resultsCount,e.currentTabConfig.pageSize);t=p.instant("query.editor.showing.results.from.msg")+u("currency")(e.currentTabConfig.offset,"",0)+p.instant("query.editor.to")+u("currency")(n,"",0),e.currentTabConfig.allResultsCount>0&&(t+=p.instant(e.currentTabConfig.allResultsCountExact?"query.editor.of":"query.editor.of.at.least"),t+=u("currency")(e.currentTabConfig.allResultsCount,"",0)),t+="."}return t},e.getUpdateDescription=function(){return e.currentTabConfig.customUpdateMessage?p.instant(e.currentTabConfig.customUpdateMessage.msg,{name:e.currentTabConfig.customUpdateMessage.name}):void 0===e.currentTabConfig.sizeDelta?"":e.currentTabConfig.sizeDelta<0?p.instant("yasr.removed.statements.result.msg",{sizeDelta:Math.abs(e.currentTabConfig.sizeDelta)}):e.currentTabConfig.sizeDelta>0?p.instant("yasr.added.statements.result.msg",{sizeDelta:e.currentTabConfig.sizeDelta}):p.instant("yasr.statements.no.change.msg")},e.getStaleWarningMessage=function(){const t=60*Math.round((Date.now()-e.currentTabConfig.timeFinished)/6e4);if(t>=3600)return p.instant("yasr.stale.result.msg",{secondsAgo:e.getHumanReadableSeconds(t)})};const z=function(){};angular.element(c).bind("resize",z),e.$on("$destroy",(function(){angular.element(c).unbind("resize",z)}))}function o(e,t,n,r){n.queryExists&&(e.queryExists=!0),e.query=angular.copy(n.query),e.title=n.title,e.edit=n.edit,e.okButtonText=n.okButtonText,e.existingQueryErrMsg=r.trustAsHtml(n.existingQueryErrMsg),e.ok=function(){e.form.$valid&&t.close(e.query)},e.cancel=function(){t.dismiss("cancel")}}angular.module("graphdb.framework.core.directives.queryeditor.controllers",["graphdb.framework.utils.localstorageadapter","graphdb.framework.rest.sparql.service"]).controller("QueryEditorCtrl",i).controller("QuerySampleModalCtrl",o),i.$inject=["$scope","$timeout","toastr","$repositories","$uibModal","ModalService","SparqlRestService","$filter","$window","$jwtAuth","RDF4JRepositoriesRestService","MonitoringRestService","LocalStorageAdapter","LSKeys","$translate"],o.$inject=["$scope","$uibModalInstance","data","$sce"]}}]);