graphdb-workbench 2.8.3 → 2.8.4-TR2

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 (80) hide show
  1. package/dist/186.2c2a3daf2e31a391bc75.bundle.js +1 -1
  2. package/dist/23.b33b628c8b874334cdb1.bundle.js +1 -1
  3. package/dist/276.96e3a8f50384cb9d94b1.bundle.js +1 -0
  4. package/dist/348.c84b812c3cefa18bcdd0.bundle.js +1 -1
  5. package/dist/354.17ed256eb667904d08df.bundle.js +1 -1
  6. package/dist/357.bfd7aad3bdb3409ea17c.bundle.js +1 -1
  7. package/dist/358.c1194b10992666401cb5.bundle.js +1 -1
  8. package/dist/359.504a602752407371e3a4.bundle.js +1 -1
  9. package/dist/{36.7c3318e965fb19a54c09.bundle.js → 36.f7a5b5c428a450ac58e4.bundle.js} +1 -1
  10. package/dist/360.ec800e7ccf7c65846eac.bundle.js +1 -1
  11. package/dist/361.b515829257fc43342570.bundle.js +1 -1
  12. package/dist/391.0666a2c713a150170ff5.bundle.js +1 -1
  13. package/dist/403.d87d414670015e4f18cd.bundle.js +1 -1
  14. package/dist/404.4efe8914c8cbf7591932.bundle.js +1 -1
  15. package/dist/405.bb51a207dbe9fbfcd773.bundle.js +1 -1
  16. package/dist/406.0fe82124cb33838472c3.bundle.js +1 -1
  17. package/dist/407.d4525d358e6005ee0b02.bundle.js +1 -1
  18. package/dist/409.3c99979a0c06f995a321.bundle.js +1 -1
  19. package/dist/410.8e4e7b4205a7320a7640.bundle.js +1 -1
  20. package/dist/411.f1439685bbeb41c2ab30.bundle.js +1 -1
  21. package/dist/412.28a43e9de915ef681ee5.bundle.js +1 -1
  22. package/dist/42.245988033c04d2389901.bundle.js +1 -1
  23. package/dist/43.d473040175d53a3dc19a.bundle.js +1 -1
  24. package/dist/{48.2daa6db29a43f428bec3.bundle.js → 48.82a1b994b9ea41abfdbd.bundle.js} +1 -1
  25. package/dist/58.23979cb079b55c610619.bundle.js +1 -0
  26. package/dist/61.8a54322d4b106608e0e8.bundle.js +1 -1
  27. package/dist/72.43568229dc07f2bd1d87.bundle.js +1 -1
  28. package/dist/{bundle.01a28f05ec4d6942eb61.bundle.js → bundle.e263b1b7f4c2b0913d04.bundle.js} +2 -2
  29. package/dist/index.html +3 -3
  30. package/dist/js/angular/core/directives/autocomplete/templates/autocomplete.html +1 -1
  31. package/dist/js/angular/core/directives/operations-statuses-monitor/templates/operations-statuses-monitor.html +1 -1
  32. package/dist/js/angular/core/directives/rdfresourcesearch/templates/rdfResourceSearchTemplate.html +1 -1
  33. package/dist/js/angular/core/directives/yasgui-component/templates/yasgui-component.html +1 -1
  34. package/dist/js/angular/core/templates/cookie-policy/cookie-consent.html +1 -1
  35. package/dist/js/angular/core/templates/cookie-policy/cookie-policy.html +1 -1
  36. package/dist/js/angular/security/templates/user.html +1 -1
  37. package/dist/js/angular/ttyg/templates/agent-list.html +1 -1
  38. package/dist/js/angular/ttyg/templates/agent-select-menu.html +1 -1
  39. package/dist/js/angular/ttyg/templates/chat-item-detail.html +1 -1
  40. package/dist/js/angular/ttyg/templates/chat-list.html +1 -1
  41. package/dist/js/angular/ttyg/templates/chat-panel.html +1 -1
  42. package/dist/js/angular/ttyg/templates/modal/agent-instructions-explain-modal.html +1 -1
  43. package/dist/js/angular/ttyg/templates/modal/agent-settings-modal.html +1 -1
  44. package/dist/js/angular/ttyg/templates/no-agents-view.html +1 -1
  45. package/dist/js/angular/ttyg/templates/ttyg.html +1 -1
  46. package/dist/license-checker.json +2 -2
  47. package/dist/pages/aclmanagement.html +2 -2
  48. package/dist/pages/autocomplete.html +1 -1
  49. package/dist/pages/choose-repository-type.html +1 -1
  50. package/dist/pages/cluster-management/clusterInfo.html +3 -3
  51. package/dist/pages/create-index.html +1 -1
  52. package/dist/pages/dependencies.html +1 -1
  53. package/dist/pages/domainRangeInfo.html +2 -2
  54. package/dist/pages/edit.html +1 -1
  55. package/dist/pages/explore.html +1 -1
  56. package/dist/pages/export.html +1 -1
  57. package/dist/pages/find.html +1 -1
  58. package/dist/pages/graph-config/saveGraphConfig.html +8 -8
  59. package/dist/pages/graphs-visualizations.html +7 -7
  60. package/dist/pages/guides.html +1 -1
  61. package/dist/pages/import.html +2 -2
  62. package/dist/pages/jdbc-create.html +1 -1
  63. package/dist/pages/monitor/backup-and-restore.html +1 -1
  64. package/dist/pages/monitor/queries.html +1 -1
  65. package/dist/pages/monitor/resources.html +1 -1
  66. package/dist/pages/namespaces.html +2 -2
  67. package/dist/pages/plugins.html +1 -1
  68. package/dist/pages/rdfClassHierarchyInfo.html +7 -7
  69. package/dist/pages/rdfrank.html +2 -2
  70. package/dist/pages/repositories.html +1 -1
  71. package/dist/pages/repository.html +1 -1
  72. package/dist/pages/similarity-indexes.html +1 -1
  73. package/dist/pages/sparql-editor.html +1 -1
  74. package/dist/pages/sparql-template-create.html +1 -1
  75. package/dist/pages/ux-test1.html +2 -2
  76. package/dist/pages/webapi.html +2 -2
  77. package/dist/res/swagger5/index.html +12 -12
  78. package/package.json +1 -1
  79. package/dist/276.3e3057cfdd25bc12ab02.bundle.js +0 -1
  80. package/dist/58.cfb0de1cb17f24797a22.bundle.js +0 -1
@@ -1 +1 @@
1
- (window.webpackJsonp=window.webpackJsonp||[]).push([[42,288,329],{100:function(e,t,n){"use strict";n.r(t),n.d(t,"removeSpecialChars",(function(){return i})),n.d(t,"toBoolean",(function(){return o})),n.d(t,"toTitleCase",(function(){return s}));var r=n(18);const i=e=>e.replace(/[()']/g,""),o=e=>"string"==typeof e?"true"===e:Boolean(e),s=e=>e?Object(r.upperFirst)(e.toLowerCase()):e},133: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 s}));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-_]+$"),s=new RegExp("^[0-9]+$")},255:function(e,t,n){"use strict";n.r(t);n(9),n(23),n(47);var r=n(550),i=n(562),o=(n(13),n(133)),s=n(100),a=n(8);function c(e,t,n,c,l,d,p,u,f,h,g,m,y,x,v,I,S,w,k,L,C,b,T){e.languageChanged=!1,e.propertiesObj={},e.propertiesObj.items=[],e.propertiesQueryObj={},e.propertiesQueryObj.query="",e.propertiesSearchPlaceholder=L.instant("visual.search.instance.placeholder"),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"),e.datasource=void 0,e.adapterContainer={adapter:{remain:!0}},e.hasInitedRepository=!1,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=_.cloneDeep(e.defaultSettings),e.defaultGraphConfig={id:"default",name:"Easy graph",startMode:"search"},t.key="",e.onopen=e.onclose=()=>angular.noop(),e.goToHome=()=>{A(),f.url("graphs-visualizations")},e.shouldShowSettings=()=>e.configLoaded&&e.configLoaded.id===e.defaultGraphConfig.id,e.shouldDisableSameAs=()=>{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.propertiesFilterFunc=t=>t.key.toLowerCase().indexOf(e.propertiesQueryObj.query.toLowerCase())>=0,e.toggleMoreInfo=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=e=>{m.openCopyToClipboardModal(e)},e.resetSettings=()=>{e.settings=_.cloneDeep(e.defaultSettings),e.validateLinksLimit(),E()},e.changeLimit=t=>{let n=e.settings.linksLimit+t;n<1&&(n=1),n>1e3&&(n=1e3),e.settings.linksLimit=n},e.validateLinksLimit=()=>{e.invalidLimit=!o.NUMBER_PATTERN.test(e.settings.linksLimit)},e.showSettings=()=>{e.showInfoPanel=!0,e.showFilter=!0,e.showNodeInfo=!1,e.showPredicates=!1,e.saveSettings?e.settings=_.cloneDeep(e.saveSettings):e.settings=_.cloneDeep(e.defaultSettings),E()},e.updateSettings=()=>{e.invalidLimit?l.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?R(e.rootNodeIri):e.queryResultsMode&&f.search().query?j(f.search().query,f.search().sameAs,f.search().inference):"query"===e.configLoaded.startMode&&q(e.configLoaded),O(),e.showInfoPanel=!1,e.showFilter=!1,v.set(I.GRAPHS_VIZ,e.saveSettings))},e.getGraphConfigs=t=>{w.getGraphConfigs().success((function(n){e.graphConfigs=n,t&&t()})).error((function(e){l.error(getError(e),L.instant("graphexplore.error.graph.configs.short.msg"))}))},e.findConfigById=function(t){return t===e.defaultGraphConfig.id?e.defaultGraphConfig:$.grep(e.graphConfigs,(function(e){return e.id===t}))[0]},e.easyGraphSearch=t=>{e.configLoaded=e.defaultGraphConfig,e.openUri(t)},e.deleteConfig=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){l.error(getError(e),L.instant("graphexplore.error.cannot.delete.config"))}))}))},e.goToGraphConfig=e=>{P({config:e.id},{config:e}),A(),q(e)},e.replaceIRIWithPrefix=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};const N=[];N.push(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")}))),N.push(b.onAutocompleteEnabledUpdated(t=>{e.isAutocompleteEnabled=t})),N.push(b.onSelectedRepositoryIdUpdated(t=>{t?T.getNamespaces(t).then(t=>{e.repositoryNamespaces=t,e.namespaces=t.namespaces}).catch(e=>{const t=getError(e);l.error(t,L.instant("error.getting.namespaces.for.repo"))}):e.repositoryNamespaces=new a.NamespacesListModel})),N.push(e.$on("repositoryIsSet",(function(t,n){n.newRepo&&(e.hasInitedRepository=!1),ce(n.newRepo),n.newRepo&&(A(),$(".graph-visualization svg").empty(),f.search().query&&(e.goToHome(),G()))})));N.push(t.$watch(()=>t.key,()=>{H=0,_.each(e.propertiesObj.items,(function(e){t.key>e&&H++})),K++}));N.push(e.$watch("propertiesObj.items",()=>{angular.isDefined(e.propertiesObj.items)&&e.propertiesObj.items.length>0&&d((function(){e.adapterContainer.adapter.reload()}),500)}));e.$on("$destroy",()=>{N.forEach(e=>e())});const P=(t,n)=>{e.embedded&&(t.embedded=!0),f.search(t),f.state(n)},A=()=>{e.searchVisible=!1,e.nodeSelected=!1,e.configLoaded=null,e.queryResultsMode=!1,e.lastSavedGraphName=null,e.lastSavedGraphId=null,e.shared=!1,e.numberOfPinnedNodes=0,Z={},Q=0},M=()=>C.isActive()?e.defaultSettings:e.saveSettings,O=()=>{M().showLinksText?d3.selectAll("svg .link-wrapper text").style("display","block"):d3.selectAll("svg .link-wrapper text").style("display","none")},E=()=>{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}}))},R=()=>{e.rootNodeIri&&e.$broadcast("onRootNodeChange",e.rootNodeIri)},G=()=>{f.search().query?(e.searchVisible=!1,e.queryResultsMode=!0,j(f.search().query,f.search().sameAs,f.search().inference)):e.$on("onRootNodeChange",(function(t,n){e.loading=!0;const r=M();angular.isDefined(n)&&(e.rootNodeIri=n,k.getInstanceNode({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"),ae=new se;const n=ae.addNode(t.data,ne/2,re/2);te=ee,Ce(n,!0)})).catch((function(t){e.loading=!1,l.error(getError(t),L.instant("graphexplore.error.could.not.load.graph"))})))})),f.search().uri&&e.openUri(f.search().uri,!0),f.search().saved&&S.getSavedGraph(f.search().saved).success((function(t){e.loadSavedGraph(t)})).error((function(e){const t=getError(e);l.error(t,L.instant("graphexplore.error.could.not.open"))}))},j=(t,n,r)=>{const i=M(),o=void 0===n?i.sameAsState:!0===n,s=void 0===r?i.includeInferred:!0===r;e.loading=!0,k.updateGraph({query:t,linksLimit:i.linksLimit,languages:e.shouldShowSettings()?i.languages:[],includeInferred:s,sameAsState:o}).then((function(e){ke(e)}),(function(t){e.loading=!1,l.error(getError(t.data),L.instant("graphexplore.error.cannot.load.graph"))}))},z=(e,t)=>{const n=e.split(" ");return t?[n[0],n[1],n[2]].join(">"):[n[0],n[2]].join(">")},D=e=>[e.source.iri,e.target.iri].join(">"),F=e=>{if(e.isTriple){const t=document.getElementById(Object(s.removeSpecialChars)(z(e.iri)));if(t&&void 0!==t.__data__.x)return t.__data__.x}return e.x},B=e=>{if(e.isTriple){const t=document.getElementById(Object(s.removeSpecialChars)(z(e.iri)));if(t&&void 0!==t.__data__.y)return t.__data__.y}return e.y},U=e=>{const t=e.trim().split(" ");return`<<<${t[0]}> <${t[1]}> <${t[2]}>>>`},W=e=>{const t=e.source.isTriple?z(e.source.iri,!0):e.source.iri,n=e.target.isTriple?z(e.target.iri,!0):e.target.iri;return Object(s.removeSpecialChars)(`${t}>${n}>marker`)},q=t=>{e.configLoaded=t,"search"===t.startMode?e.searchVisible=!0:"node"===t.startMode&&t.startIRI?d((function(){e.openUri(t.startIRI,!0)}),0):"query"===t.startMode&&t.startGraphQuery&&(e.loading=!0,w.loadGraphForConfig(t,t.startQueryIncludeInferred,M().linksLimit,t.startQuerySameAs).then((function(e){ke(e)}),(function(t){e.loading=!1,l.error(getError(t),L.instant("graphexplore.error.graph.load"))})))},V=function(){var t,n;f.search().config?(t=f.search().config,n=G,t===e.defaultGraphConfig.id?q(e.defaultGraphConfig):w.getConfig(t).then(e=>{q(e),n()}).catch(e=>{l.error(getError(e),L.instant("graphexplore.error.could.not.load.config",{configId:t}))})):f.search().query||f.search().uri?(q(e.defaultGraphConfig),G()):G()};x.onpopstate=function(t){A(),t.state&&(t.state.config?(q(t.state.config),t.state.uri&&e.openUri(t.state.uri,!0)):t.state.savedGraph&&e.loadSavedGraph(t.state.savedGraph,!0))},e.embedded&&(f.search().query||f.search().uri||f.search().config||f.search().saved)&&(e.noGoHome=!0);let H=0,K=0,Z={},Q=0;const J=16,Y=d3.zoom().scaleExtent([.1,10]);let X;const ee=d3.zoomIdentity.translate(0,-70).scale(1);Y.on("zoom",(function(e){C.isActive()||(te=e.transform,X.attr("transform",te))}));let te=ee;const ne=1e3,re=1e3;let ie,oe;function se(){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?Ae(e.source):_.find(t,(function(t){return t.iri===e.source})),r=e.isTripleTarget?Ae(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?z(i.source.iri):i.source.iri}>${i.target.isTriple?z(i.target.iri):i.target.iri}`;if(ae.tripleLinksCopy.has(e)){let t=ae.tripleLinksCopy.get(e);return t[0].predicates.push(...i.predicates),t.push(i),ae.tripleLinksCopy.set(e,t),null}ae.tripleLinksCopy.set(e,[i])}return i}))}(e,t));for(let e of ae.tripleLinksCopy.keys())1===ae.tripleLinksCopy.get(e).length&&ae.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=z(n.source.iri),o=z(n.target.iri);if(i===e&&ae.tripleNodes.delete(o)){let e=o.split(">");t.push({source:e[0],target:e[1]})}let s=i===e||o===e||n.source.iri===r[0]&&n.target.iri===r[1];return s&&(ae.tripleLinksCopy.delete(`${i}>${o}`),ae.tripleLinksCopy.delete(`${o}>${i}`)),s})))}),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(z(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 s=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(!s){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;s=(r[0].source.iri===e.iri||r[0].target.iri)&&(r[1].source.iri===e.iri||r[1].target.iri)}return s&&(o.target.isTriple&&r.push(z(o.target.iri)),o.source.isTriple||o.target.isTriple||r.push([o.source.iri,o.target.iri].join(">"))),s})),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=z(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:_.cloneDeep(e.labels),types:_.cloneDeep(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:Q,type2color:Z,transform:te}},this.restoreState=function(t){e.nodeSelected=!0,e.searchVisible=!1,this.nodes=_.cloneDeep(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)&&(Q=t.colorIndex,Z=_.cloneDeep(t.type2color)),angular.isDefined(t.transform)&&(te=d3.zoomIdentity.translate(t.transform.x,t.transform.y).scale(t.transform.k)),xe()}}e.datasource={get:function(t,n,r){return g.initLazyList(t,n,r,H,e.propertiesObj.items)},revision:function(){return K}},u.when(h.getPrincipal()).then(t=>(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=v.get(I.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=_.cloneDeep(e.defaultSettings),v.set(I.GRAPHS_VIZ,e.saveSettings)}else e.saveSettings=_.cloneDeep(e.defaultSettings)})(t)),e.showInfoPanel=!1;let ae=new se;function ce(t){!n.getActiveRepository()||e.hasInitedRepository&&!t||(e.hasInitedRepository=!0,t||e.getGraphConfigs(V))}e.addedTag=function(t){return t.text.indexOf(":")<0?(l.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=p.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?l.warning(L.instant("graphexplore.absolute.prefixed.iri.option"),t):l.warning(L.instant("graphexplore.absolute.prefixed.iri"),t),!1;const r=e.text.indexOf("*");if(r>=0){if(!n)return l.warning(L.instant("graphexplore.wildcards.not.allowed"),t),!1;if(r<e.text.length-1)return l.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 c.isLicenseValid()},ce();const le=d3.scaleLinear().domain([0,9]).range(["hsl(0, 100%, 75%)","hsl(360, 90%, 82%)"]).interpolate(d3.interpolateHslLong),de=d3.scaleLinear().domain([0,9]).range(["hsl(180, 50%, 75%)","hsl(540, 40%, 82%)"]).interpolate(d3.interpolateHslLong);e.getColor=function(e){angular.isUndefined(Z[e])&&(Z[e]=Q,Q++);const t=Z[e];return t>39?"#c2c2c2":t%2==0?le(t/2):de(t/2)};const pe=d3.forceX(ne/2).strength(.005),ue=d3.forceY(re/2).strength(.005),fe=d3.forceSimulation().force("x",pe).force("y",ue),he=d3.select(".main-container .graph-visualization").append("svg").attr("viewBox","0 0 "+ne+" "+re).attr("preserveAspectRatio","xMidYMid meet");he.append("rect").attr("width",10*ne).attr("height",10*re).attr("x",-(10*ne-ne)/2).attr("y",-(10*re-re)/2).style("fill","none").style("pointer-events","all").call(Y).on("click",(function(e){e.stopPropagation(),be(),fe.stop()}));let ge=0,me=0;const ye=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.8.3").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 xe(t){d3.selectAll("svg g").remove(),d3.selectAll(".d3-tip").remove(),d3.selectAll(".menu-events").remove(),X=he.append("g").attr("class","nodes-container").attr("transform",(function(){return angular.isDefined(te)&&!t?te:""}));const n=Object(i.a)().attr("class","d3-tip").customPosition((function(){const e=ie.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})),o=function(e){let t="";return t+=_.join(_.map(e.predicates,(function(t,n){if(0===n)return Oe(t);if(n<10)return" · "+Oe(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 a;const c=Object(i.a)().attr("class","d3-tip").customPosition((function(e){const t=a.getBoundingClientRect(),n=function(e){const t=o(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 o(e)}));const p=function(){d.cancel(void 0),d.cancel(ge),ie=null,n.hide(),me=d((function(){be()}),500)};he.call(n);he.call(c);let u=he.selectAll(".link"),f=he.selectAll(".node");const h=d3.forceCollide(e=>e.size+5).strength(.5),g=d3.forceManyBody().strength(-300),m=d3.forceCenter(ne/2,re/2);fe.nodes(ae.nodes).force("charge",g).force("collide",h).force("center",m).force("link",d3.forceLink(ae.links).distance((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}))),X.append("defs").selectAll("marker").data(ae.links).enter().append("marker").attr("class","arrow-marker").attr("id",(function(e){return W(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"),u=X.selectAll(".link").data(ae.links).enter().append("g").attr("class","link-wrapper").attr("id",(function(e){return Object(s.removeSpecialChars)(D(e))})).append("line").attr("class","link").style("stroke-width",1).style("fill","transparent").style("marker-end",(function(e){return`url(#${W(e)})`}));const y=X.selectAll(".link-wrapper").append("text").text((function(e){return Me(e)})).attr("class",(function(e){return e.predicates.length>1||ae.tripleNodes.has(D(e))?"predicates":"predicate"})).attr("dy","-0.5em").style("text-anchor","middle").style("display",M().showLinksText?"":"none").on("mouseover",(function(e,t){e.stopPropagation(),function(e,t){d.cancel(void 0);const n=a=e.target;d((function(){a===n&&t.predicates.length>1&&c.show(t,a)}),300)}(e,t)})).on("mouseout",(function(){d.cancel(void 0),a=null,c.hide()})).on("click",(function(t,n){t.stopPropagation(),function(t,n){Pe();const r=D(n);if(1===n.predicates.length&&ae.tripleNodes.has(r)){oe=null;const e=ae.tripleNodes.get(r)[0];if(Se(e,this,t.button)){const t={};t.iri=e.iri,t.pred=Oe(e.iri.split(" ")[1]),_e(t)}return}!function(t){if(e.showNodeInfo=!1,e.showPredicates=t.predicates.length>1,e.showFilter=!1,e.showInfoPanel=!1,oe===t)return e.showNodeInfo=!1,e.showInfoPanel=!1,void(oe=null);oe=t,e.showPredicates&&(e.predicates=_.map(t.predicates,(function(e){const n=function(e,t){const n=D(t);return ae.tripleNodes.has(n)?ae.tripleNodes.get(n).findIndex(t=>t.iri.indexOf(e)>=0):-1}(e,t),r=n>-1;return{value:Oe(e),partOfTriple:r,linkId:r?D(t):"",nodeIndex:n}})),e.showInfoPanel=!0)}(n)}(t,n)}));let x,v=0,I=null,S=null;const w=function(t,n,r){let i=r||this.parentNode;Array.isArray(r)&&(i=r[n]);ae.countLinks(t,ae.links)<=M().linksLimit?Ce(t,!1,i):l.info(L.instant("graphexplore.increase.limit"),L.instant("graphexplore.node.at.max")),e.closeInfoPanel()};function k(e,t){let n,r,i,o,s=!0;if("down"===t)n=2*e.size,r=e.size/3,i=.8,o=.3;else if("down-fixed"===t)n=2*e.size,r=e.size,i=.8,o=.66;else if("up"===t)n=e.size/3,r=2*e.size,i=.3,o=.8;else{if("fixed"!==t)return;n=e.size,i=.66,s=!1}let a=X.selectAll(".node-wrapper").filter((function(t){return t===e})).append("text").text("").classed("icon-any pinned",!0).style("font-size",n+"px").attr("x",(function(e){return e.x})).attr("y",(function(e){return e.y})).attr("opacity",i);"fixed"!==t&&"down-fixed"!==t||(e.pin=a),s&&(a=a.transition().duration(1e3).style("font-size",(function(){return r+"px"})).attr("opacity",o),"down-fixed"!==t&&a.remove())}const b=d3.drag().subject((function(e){return e})).on("start",(function(e,t){if(C.isActive())return;0===e.sourceEvent.button&&(t.fixedBeforeDrag=t.fixed,t.isBeingDragged=!0,t.beginDragging=!0,be(),d3.select(this).classed("dragging",!0),fe.alphaTarget(.3).restart())})).on("drag",(function(t,n){n.isBeingDragged&&(n.fx=t.x,n.fy=t.y,n.fixed?n.beginDragging&&k(n,"fixed"):(e.numberOfPinnedNodes++,n.fixed=!0,k(n,"down-fixed")),n.pinWasFixed=!0,n.beginDragging=null)})).on("end",(function(e,t){t.isBeingDragged&&(t.pinWasFixed&&(t.pinWasFixed=null,d3.select(".pinned").remove()),t.isBeingDragged=!1,d3.select(this).classed("dragging",!1));fe.alphaTarget(0)}));f=X.selectAll(".node").data(ae.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])})).on("mouseover",(function(t,r){r.isBeingDragged||(d.cancel(me),ge=d(()=>{(function(t,n){if(e.showInfoPanel)return!1;(Ie.closeIcon||Ie.expandIcon||Ie.focusIcon||Ie.copyURIIcon)&&Ie.removeIcons();if(fe.alpha()<.1)return Ie.initIcons(t,n.parentNode),fe.stop(),ve(),!0;return!1})(r,this)&&function(e,t){d.cancel(void 0);const r=ie=t.target;d((function(){ie===r&&n.show(e,ie)}),300)}(r,t)},400))})).on("mouseout",p).on("click",(function(t,n){if(t.button&&0!==t.button)return;const r=this;if(I&&S===r)return d.cancel(I),I=null,void w(n,0,r.parentNode);S=r,p(),e.showPredicates=!1,C.isActive()||(d.cancel(I),I=d((function(){Se(n,r,t),I=null}),540))})).on("touchstart",(e,t)=>function(e){v=0,x=d((function(){v<5&&we(e),x=null}),1e3)}(t)).on("touchmove",(function(){v++})).on("touchend",(function(){d.cancel(x),x=null})).on("contextmenu",(function(t,r){t.shiftKey||(t.preventDefault(),be(),e.closeInfoPanel(),r.fixed?(e.numberOfPinnedNodes--,r.fixed=!1,r.fx=null,r.fy=null,k(r,"up"),fe.alpha(1).restart()):(e.numberOfPinnedNodes++,r.fixed=!0,k(r,"down")),function(e){ie&&n.show(e,ie)}(r))})).on("gdb-expand-node",(e,t)=>w(t,0,e.srcElement.parentNode)).on("gdb-show-node-info",(e,t)=>Te(t)).call(b);const T=X.selectAll(".node-wrapper").append("foreignObject").style("pointer-events","none").attr("width",(function(e){return 2*e.size*1.75}));X.insert("g").attr("class","menu-events"),(e=>{e.each((function(e){e.fontSize=r.a.Text.calcFontSizeRaw(e.labels[0].label,e.size,J,!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})),d((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),fe.on("tick",(function(){u.attr("x1",(function(e){return F(e.source)})).attr("y1",(function(e){return B(e.source)})).attr("x2",(function(e){return F(e.target)})).attr("y2",(function(e){return B(e.target)})),y.attr("x",(function(e){let t=F(e.source),n=F(e.target);return e.x=.5*(t+n)})).attr("y",(function(e){let t=B(e.source),n=B(e.target);return e.y=.5*(t+n)})).attr("transform",(function(e){return"rotate("+function(e,t){const n={x:F(e.source),y:B(e.source)},r={x:F(e.target),y:B(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})),X.select(".node-loader").attr("x",(function(e){return e.x-e.size+3})).attr("y",(function(e){return e.y-e.size})),X.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})),ve()})),angular.isDefined(ye)&&ye.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){const r=Object(s.removeSpecialChars)(n.source.iri),i=Object(s.removeSpecialChars)(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(),fe.alpha(.3).restart()}function ve(){t.d3alpha=fe.alpha()}const Ie=new function(){function n(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(r,o){const s=Object(i.a)().attr("class","d3-tip d3-actions-tip").customPosition((function(e,t){const n=t.target.getBoundingClientRect();return{top:n.top-20+"px",left:n.right+10+"px"}})).html((function(e){return e}));he.call(s);r.isExpanded?(this.collapseIcon=d3.select(".menu-events").append("g").attr("class","collapse-icon").attr("name","collapse").attr("transform",(function(){return n(20,r)})),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=r).isExpanded=!1,ae.removeNodeLeafLinks(e),xe()})).on("mouseover",(function(e){s.show(this.getAttribute("name"),e),d.cancel(ge),d.cancel(me)})).on("mouseout",(function(){s.hide(),me=d((function(){be()}),500)}))):(this.expandIcon=d3.select(".menu-events").append("g").attr("class","expand-icon").attr("name","expand").attr("transform",(function(){return n(20,r)})),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(){Ce(r,!1,o)})).on("mouseover",(function(e){s.show(this.getAttribute("name"),e),d.cancel(me),d.cancel(ge)})).on("mouseout",(function(){s.hide(),me=d((function(){be()}),500)}))),this.focusIcon=d3.select(".menu-events").append("g").attr("class","focus-icon").attr("name","focus").attr("transform",(function(){return n(20,r)})),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",r.iri)})).on("mouseover",(function(e){s.show(this.getAttribute("name"),e),d.cancel(me),d.cancel(ge)})).on("mouseout",(function(){s.hide(),me=d((function(){be()}),500)})),this.copyURIIcon=d3.select(".menu-events").append("g").attr("class","icon-link").attr("name","link").attr("transform",(function(){return n(20,r)})),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(){e.copyToClipboard(r.iri),be(),s.hide()})).on("mouseover",(function(e){s.show("<div style='text-align: center;'><b>Copy to ClipBoard</b><br>"+r.iri+"</div>",e),d.cancel(me),d.cancel(ge)})).on("mouseout",(function(){s.hide(),me=d((function(){be()}),500)})),this.closeIcon=d3.select(".menu-events").append("g").attr("class","close-icon").attr("name","remove").attr("transform",(function(){return n(20,r)})),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(){we(r)})).on("mouseover",(function(e){s.show(this.getAttribute("name"),e),d.cancel(me),d.cancel(ge)})).on("mouseout",(function(){s.hide(),me=d((function(){be()}),500)})),this.animateMenu(r)},this.animateMenu=function(e){const t=d3.easeSin;let r=0;let i=20;this.expandIcon&&this.expandIcon.transition().duration(100).style("opacity",1).ease(t).attr("transform",(function(){return n(i,e)})).delay(r+=35),this.collapseIcon&&this.collapseIcon.transition().duration(100).style("opacity",1).ease(t).attr("transform",(function(){return n(i,e)})).delay(r+=35),this.copyURIIcon.transition().duration(100).style("opacity",1).ease(t).attr("transform",(function(){return i+=30,n(i,e)})).delay(r+=35),this.focusIcon.transition().duration(100).style("opacity",1).ease(t).attr("transform",(function(){return i+=30,n(i,e)})).delay(r+=35),this.closeIcon.transition().duration(100).style("opacity",1).ease(t).attr("transform",(function(){return i+=30,n(i,e)})).delay(r+=35),this.expandedState=!0}};function Se(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?(we(n),!1):void 0!==e.openedNodeInfoPanel&&e.openedNodeInfoPanel===n?(e.pageslideExpanded=!1,e.openedNodeInfoPanel=void 0,!1):(Te(n),!0)}function we(e){ae.removeNode(e),xe()}function ke(t){!function(t){e.nodeSelected=!0,null===t.data.types&&(t.data.types="greyColor"),ae=new se,te=ee}(t),Le(t)}function Le(t,n,r){let i=t.data;i=_.filter(i,(function(e){return-1===_.findIndex(ae.links,(function(t){return e.source===t.source.iri&&e.target===t.target.iri}))}));const o=[],s=ae.tripleLinksCopy.values();for(let e=0;e<ae.tripleLinksCopy.size;e++){s.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 a=((e,t)=>{const n=t.map(t=>t[e]);return t.filter((t,r)=>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}]}))))),c=_.map(ae.nodes,(function(e){return{iri:e.iri,isTriple:Boolean(e.isTriple)}})),d=ae.tripleNodes.values();for(let e=0;e<ae.tripleNodes.size;e++){d.next().value.forEach(e=>{c.push({iri:e.iri,isTriple:e.isTriple})})}const p=_.reject(a,(function(e){return _.some(c,e)}));if(0===p.length)(r||0===i.length)&&l.info(L.instant("graphexplore.error.node.connections")),ae.addAndMatchLinks(i),xe();else{const t=[],r=[],o=M();_.forEach(p,(function(n,i){t.push(k.getInstanceNode({iri:n.isTriple?U(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})))})),u.all(t).then((function(){_.forEach(r,(function(e,t){const i=2*Math.PI*t/r.length,o=(n?n.x:0)+Math.cos(i)*re/3,s=(n?n.y:0)+Math.sin(i)*re/3;e.isTriple?ae.addTriple(e,o,s):ae.addNode(e,o,s)})),ae.addAndMatchLinks(i),n&&(n.isExpanded=!0),xe()}))}}function Ce(t,n,r){if(ye.getLoadingState())return;ye.init(t,r);const i=M(),o=t.iri;k.getInstanceNodeLinks({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){Le(e,t,n)}),(function(t){const n=getError(t.data);l.error(n,L.instant("graphexplore.error.exploring.node")),e.loading=!1,ye.setLoadingState(!1)}))}function be(){angular.isDefined(Ie)&&Ie.expandedState&&Ie.removeIcons()}function Te(t){fe.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(U(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=M();k.getProperties({iri:t.isTriple?U(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){l.warning(getError(e.data),"Error")}))}function _e(e){Ne("predicate","var(--primary-color-dark)",e),Ne("predicates","var(--primary-color-dark)",e);const t=document.getElementsByClassName("link");t&&_.each(t,(function(t){const 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)}));const n=document.getElementsByClassName("arrow-marker");n&&_.each(n,(function(t){const 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 Ne(e,t,n){const r=document.getElementsByClassName(e);r&&_.each(r,(function(e){const r=e.__data__;n?((r.source.iri.indexOf(n.iri)>=0||r.target.iri.indexOf(n.iri)>=0)&&(e.style.fill=t),z(n.iri)===D(r)&&(e.textContent=n.pred,e.style.fill=t),n.oppLinkIRI&&n.oppLinkIRI===D(r)&&(e.textContent=n.oppTriplePred,e.style.fill=t)):(e.style.fill=t,e.textContent=Me(r))}))}function Pe(){_.each(e.predicates,(function(e){const t=document.getElementById(e.linkId+e.nodeIndex);t&&(t.style.fontWeight="normal")}));const t=document.getElementsByClassName("link");t&&_.each(t,(function(e){e.style.stroke="#999",e.style.strokeWidth=1})),Ne("predicate",""),Ne("predicates","");const n=document.getElementsByClassName("arrow-marker");n&&_.each(n,(function(e){e.style.stroke="#999",e.__data__.target.isTriple||e.setAttribute("refX","59")}))}function Ae(e){const t=z(e);if(ae.tripleNodes.has(t))return ae.tripleNodes.get(t).find(t=>t.iri===e)}function Me(e){return e.predicates.length>1?e.predicates.length+" predicates":Oe(e.predicates[0])}function Oe(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=[],oe=null,d((function(){e.showInfoPanel=!1}))},e.clickLink=function(t){if(ae.tripleNodes.has(t.linkId)){Pe();const n=ae.tripleNodes.get(t.linkId)[t.nodeIndex];Te(n),e.showPredicates=!0;const r=document.getElementById(t.linkId+t.nodeIndex);r&&(r.style.fontWeight="bold");const i={},o=ae.tripleLinksCopy.values();for(let e=0;e<ae.tripleLinksCopy.size;e++){const 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=z(t.target.iri),i.oppTriplePred=Oe(t.target.iri.split(" ")[1])),i.pred=Oe(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=z(t.source.iri),i.oppTriplePred=Oe(t.source.iri.split(" ")[1])),i.pred=Oe(n.iri.split(" ")[1]),1===t.predicates.length&&(i.linkPred=t.predicates[0]),!1))}i.iri||(i.iri=n.iri,i.pred=Oe(n.iri.split(" ")[1])),_e(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){be();const t=10*(e?1:-1)*Math.PI/180,n=Math.cos(t),r=Math.sin(t),i=ne/2,o=re/2;d3.selectAll(".node-wrapper").each((function(e){e.x=i+(n*(e.x-i)+r*(e.y-o)),e.y=o+(-r*(e.x-i)+n*(e.y-o)),e.fixed&&(e.fx=e.x,e.fy=e.y)})),fe.alpha(1).restart()},e.openUri=function(t,n){if(!n){const n={};e.configLoaded.id!==e.defaultGraphConfig.id&&(n.config=e.configLoaded.id),n.uri=t,P(n,{uri:t,config:e.configLoaded})}e.$broadcast("onRootNodeChange",t)},e.saveOrUpdateGraph=function(){const t=JSON.stringify(ae.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 Ee=function(t){S.editSavedGraph(t).success((function(){e.lastSavedGraphName=t.name,e.shared=t.shared,e.refreshSavedGraphs(),l.success(L.instant("graphexplore.saved.graph.was.edited",{name:t.name}))})).error((function(e){const t=getError(e);l.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),S.addNewSavedGraph(t).success((function(n,r,i){e.lastSavedGraphName=t.name,e.lastSavedGraphId=i()["x-saved-graph-id"],e.shared=t.shared,e.refreshSavedGraphs(),l.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);l.error(e,L.instant("graphexplore.error.cannot.create.graph"))}}))}(t.graph);break;case"update":case"rename":Ee(t.graph)}}))},e.refreshSavedGraphs=function(){S.getSavedGraphs().success((function(t){e.savedGraphs=t})).error((function(e){const t=getError(e);l.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),ae.restoreState(JSON.parse(t.data)),n||P({saved:t.id},{savedGraph:t})},e.copyToClipboardSavedGraph=function(t){const n=[location.protocol,"//",location.host,location.pathname,"?saved=",t.id].join("");e.copyToClipboard(n)},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){S.deleteSavedGraph(t).success((function(){e.refreshSavedGraphs(),l.success(L.instant("graphexplore.saved.graph.was.deleted",{name:t.name}))})).error((function(e){const t=getError(e);l.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(){be();const t=angular.isUndefined(e.numberOfPinnedNodes)||e.numberOfPinnedNodes<=0;e.numberOfPinnedNodes=0,d3.selectAll(".node").each((function(n){n.fixed=t,t?(e.numberOfPinnedNodes++,n.fx=n.x,n.fy=n.y):(n.fx=null,n.fy=null)})),fe.alpha(1).restart()},$("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 l(e,t,n,r){switch(e.mode=n.mode,e.graph=_.cloneDeep(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","graphdb.core.services.workbench-context","graphdb.framework.core.services.rdf4j.repositories"]).controller("GraphsVisualizationsCtrl",c).controller("SaveGraphModalCtrl",l).config(["$uibTooltipProvider",function(e){e.options({appendToBody:!0})}]),c.$inject=["$scope","$rootScope","$repositories","$licenseService","toastr","$timeout","ClassInstanceDetailsService","$q","$location","$jwtAuth","UiScrollService","ModalService","$uibModal","$window","LocalStorageAdapter","LSKeys","SavedGraphsRestService","GraphConfigRestService","GraphDataRestService","$translate","GuidesService","WorkbenchContextService","RDF4JRepositoriesService"],l.$inject=["$scope","$uibModalInstance","data","$translate"]},538:function(e,t,n){var r,i;r=[n(546)],void 0===(i=function(){function e(e,t){return e.each((function(){var e=t.apply(this,arguments),n=select(this);for(var r in e)n.attr(r,e[r])}))}function t(e,t){for(var n in t)e.attr(n,t[n]);return e}return"undefined"==typeof d3&&(d3=n(546)),d3.selection.prototype.attrs=function(n){return("function"==typeof n?e:t)(this,n)},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 e=this.parentNode.firstChild;e&&this.parentNode.insertBefore(this,e)}))},d3}.apply(t,r))||(e.exports=i)},550:function(e,t,n){"use strict";n(538);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=function(){const e=function(e,n){let r,i=1,o=arguments.length;for(;++i<o;)r=arguments[i],e[r]=t(e,n,n[r]);return e};function t(e,t,n){return function(){var r=n.apply(t,arguments);return r===t?e:r}}return{delayDblClick:function(){var t=d3.dispatch("click","dblclick");return e((function(e){var n,r=null;e.on("mousedown",(function(){n=d3.pointer(document.body),+new Date})),e.on("mouseup",(function(e,i){var o,s,a;(s=n,a=d3.pointer(document.body),Math.sqrt(Math.pow(s[0]-a[0],2),Math.pow(s[1]-a[1],2))>5)||(r?(window.clearTimeout(r),r=null,t.call("dblclick",e,e,i)):r=window.setTimeout((o=e,function(){t.call("click",o,o,i),r=null}),250))}))}),t,"on")}}}(),t.a=r},562:function(e,t,n){"use strict";t.a=function(){var e=function(){return"n"},t=function(){return[0,0]},n=function(){return" "},r=p(),i=null,o=null,s=null,a=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&&(s=r.pop());var i,o=n.apply(this,r),p=t.apply(this,r),f=e.apply(this,r),h=u(),g=d.length,m=document.documentElement.scrollTop||document.body.scrollTop,y=document.documentElement.scrollLeft||document.body.scrollLeft,x=a.apply(this,r);for(h.html(o).style("opacity",1).style("pointer-events","all");g--;)h.classed(d[g],!1);const v=r.filter(e=>e instanceof Event);return i=l.get(f).apply(this,v),x?Object.keys(x).forEach((function(e){h.style(e,x[e])})):h.classed(f,!0).style("top",i.top+p[0]+m+"px").style("left",i.left+p[1]+y+"px"),c},c.hide=function(){return u().style("opacity",0).style("pointer-events","none"),c},c.attr=function(e,t){if(arguments.length<2&&"string"==typeof e)return u().attr(e);var n=Array.prototype.slice.call(arguments);return d3.selection.prototype.attr.apply(u(),n),c},c.style=function(e,t){if(arguments.length<2&&"string"==typeof e)return u().style(e);var n=Array.prototype.slice.call(arguments);return d3.selection.prototype.style.apply(u(),n),c},c.direction=function(t){return arguments.length?(e=null==t?t:h(t),c):e},c.offset=function(e){return arguments.length?(t=null==e?e:h(e),c):t},c.html=function(e){return arguments.length?(n=null==e?e:h(e),c):n},c.customPosition=function(e){return arguments.length?(a=null==e?e:h(e),c):a},c.destroy=function(){return r&&(u().remove(),r=null),c};var l=new Map(Object.entries({n:function(e){var t=f(e);return{top:t.n.y-r.offsetHeight,left:t.n.x-r.offsetWidth/2}},s:function(e){var t=f(e);return{top:t.s.y,left:t.s.x-r.offsetWidth/2}},e:function(e){var t=f(e);return{top:t.e.y-r.offsetHeight/2,left:t.e.x}},w:function(e){var t=f(e);return{top:t.w.y-r.offsetHeight/2,left:t.w.x-r.offsetWidth}},nw:function(e){var t=f(e);return{top:t.nw.y-r.offsetHeight,left:t.nw.x-r.offsetWidth}},ne:function(e){var t=f(e);return{top:t.ne.y-r.offsetHeight,left:t.ne.x}},sw:function(e){var t=f(e);return{top:t.sw.y,left:t.sw.x-r.offsetWidth}},se:function(e){var t=f(e);return{top:t.se.y,left:t.e.x}}})),d=l.keys();function p(){var e=d3.select(document.createElement("div"));return e.style("position","absolute").style("top",0).style("opacity",0).style("pointer-events","none").style("box-sizing","border-box"),e.node()}function u(){return null===r&&(r=p(),document.body.appendChild(r)),d3.select(r)}function f(e){for(var t=s||e.target;void 0===t.getScreenCTM&&"undefined"===t.parentNode;)t=t.parentNode;var n={},r=t.getScreenCTM(),i=t.getBBox(),a=i.width,c=i.height,l=i.x,d=i.y;return o.x=l,o.y=d,n.nw=o.matrixTransform(r),o.x+=a,n.ne=o.matrixTransform(r),o.y+=c,n.se=o.matrixTransform(r),o.x-=a,n.sw=o.matrixTransform(r),o.y-=c/2,n.w=o.matrixTransform(r),o.x+=a,n.e=o.matrixTransform(r),o.x-=a/2,o.y-=c/2,n.n=o.matrixTransform(r),o.y+=c,n.s=o.matrixTransform(r),n}function h(e){return"function"==typeof e?e:function(){return e}}return c}}}]);
1
+ (window.webpackJsonp=window.webpackJsonp||[]).push([[42,288,329],{100:function(e,t,n){"use strict";n.r(t),n.d(t,"removeSpecialChars",(function(){return i})),n.d(t,"toBoolean",(function(){return o})),n.d(t,"toTitleCase",(function(){return s}));var r=n(18);const i=e=>e.replace(/[()']/g,""),o=e=>"string"==typeof e?"true"===e:Boolean(e),s=e=>e?Object(r.upperFirst)(e.toLowerCase()):e},133: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 s}));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-_]+$"),s=new RegExp("^[0-9]+$")},255:function(e,t,n){"use strict";n.r(t);n(9),n(23),n(47);var r=n(550),i=n(562),o=(n(13),n(133)),s=n(100),a=n(8);function c(e,t,n,c,l,d,p,u,f,h,g,m,y,x,v,I,S,w,k,L,C,b,T){e.languageChanged=!1,e.propertiesObj={},e.propertiesObj.items=[],e.propertiesQueryObj={},e.propertiesQueryObj.query="",e.propertiesSearchPlaceholder=L.instant("visual.search.instance.placeholder"),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"),e.datasource=void 0,e.adapterContainer={adapter:{remain:!0}},e.hasInitedRepository=!1,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=_.cloneDeep(e.defaultSettings),e.defaultGraphConfig={id:"default",name:"Easy graph",startMode:"search"},t.key="",e.onopen=e.onclose=()=>angular.noop(),e.goToHome=()=>{A(),f.url("graphs-visualizations")},e.shouldShowSettings=()=>e.configLoaded&&e.configLoaded.id===e.defaultGraphConfig.id,e.shouldDisableSameAs=()=>{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.propertiesFilterFunc=t=>t.key.toLowerCase().indexOf(e.propertiesQueryObj.query.toLowerCase())>=0,e.toggleMoreInfo=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=e=>{m.openCopyToClipboardModal(e)},e.resetSettings=()=>{e.settings=_.cloneDeep(e.defaultSettings),e.validateLinksLimit(),E()},e.changeLimit=t=>{let n=e.settings.linksLimit+t;n<1&&(n=1),n>1e3&&(n=1e3),e.settings.linksLimit=n},e.validateLinksLimit=()=>{e.invalidLimit=!o.NUMBER_PATTERN.test(e.settings.linksLimit)},e.showSettings=()=>{e.showInfoPanel=!0,e.showFilter=!0,e.showNodeInfo=!1,e.showPredicates=!1,e.saveSettings?e.settings=_.cloneDeep(e.saveSettings):e.settings=_.cloneDeep(e.defaultSettings),E()},e.updateSettings=()=>{e.invalidLimit?l.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?R(e.rootNodeIri):e.queryResultsMode&&f.search().query?j(f.search().query,f.search().sameAs,f.search().inference):"query"===e.configLoaded.startMode&&q(e.configLoaded),O(),e.showInfoPanel=!1,e.showFilter=!1,v.set(I.GRAPHS_VIZ,e.saveSettings))},e.getGraphConfigs=t=>{w.getGraphConfigs().success((function(n){e.graphConfigs=n,t&&t()})).error((function(e){l.error(getError(e),L.instant("graphexplore.error.graph.configs.short.msg"))}))},e.findConfigById=function(t){return t===e.defaultGraphConfig.id?e.defaultGraphConfig:$.grep(e.graphConfigs,(function(e){return e.id===t}))[0]},e.easyGraphSearch=t=>{e.configLoaded=e.defaultGraphConfig,e.openUri(t)},e.deleteConfig=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){l.error(getError(e),L.instant("graphexplore.error.cannot.delete.config"))}))}))},e.goToGraphConfig=e=>{P({config:e.id},{config:e}),A(),q(e)},e.replaceIRIWithPrefix=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};const N=[];N.push(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")}))),N.push(b.onAutocompleteEnabledUpdated(t=>{e.isAutocompleteEnabled=t})),N.push(b.onSelectedRepositoryIdUpdated(t=>{t?T.getNamespaces(t).then(t=>{e.repositoryNamespaces=t,e.namespaces=t.namespaces}).catch(e=>{const t=getError(e);l.error(t,L.instant("error.getting.namespaces.for.repo"))}):e.repositoryNamespaces=new a.NamespacesListModel})),N.push(e.$on("repositoryIsSet",(function(t,n){n.newRepo&&(e.hasInitedRepository=!1),ce(n.newRepo),n.newRepo&&(A(),$(".graph-visualization svg").empty(),f.search().query&&(e.goToHome(),G()))})));N.push(t.$watch(()=>t.key,()=>{H=0,_.each(e.propertiesObj.items,(function(e){t.key>e&&H++})),K++}));N.push(e.$watch("propertiesObj.items",()=>{angular.isDefined(e.propertiesObj.items)&&e.propertiesObj.items.length>0&&d((function(){e.adapterContainer.adapter.reload()}),500)}));e.$on("$destroy",()=>{N.forEach(e=>e())});const P=(t,n)=>{e.embedded&&(t.embedded=!0),f.search(t),f.state(n)},A=()=>{e.searchVisible=!1,e.nodeSelected=!1,e.configLoaded=null,e.queryResultsMode=!1,e.lastSavedGraphName=null,e.lastSavedGraphId=null,e.shared=!1,e.numberOfPinnedNodes=0,Z={},Q=0},M=()=>C.isActive()?e.defaultSettings:e.saveSettings,O=()=>{M().showLinksText?d3.selectAll("svg .link-wrapper text").style("display","block"):d3.selectAll("svg .link-wrapper text").style("display","none")},E=()=>{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}}))},R=()=>{e.rootNodeIri&&e.$broadcast("onRootNodeChange",e.rootNodeIri)},G=()=>{f.search().query?(e.searchVisible=!1,e.queryResultsMode=!0,j(f.search().query,f.search().sameAs,f.search().inference)):e.$on("onRootNodeChange",(function(t,n){e.loading=!0;const r=M();angular.isDefined(n)&&(e.rootNodeIri=n,k.getInstanceNode({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"),ae=new se;const n=ae.addNode(t.data,ne/2,re/2);te=ee,Ce(n,!0)})).catch((function(t){e.loading=!1,l.error(getError(t),L.instant("graphexplore.error.could.not.load.graph"))})))})),f.search().uri&&e.openUri(f.search().uri,!0),f.search().saved&&S.getSavedGraph(f.search().saved).success((function(t){e.loadSavedGraph(t)})).error((function(e){const t=getError(e);l.error(t,L.instant("graphexplore.error.could.not.open"))}))},j=(t,n,r)=>{const i=M(),o=void 0===n?i.sameAsState:!0===n,s=void 0===r?i.includeInferred:!0===r;e.loading=!0,k.updateGraph({query:t,linksLimit:i.linksLimit,languages:e.shouldShowSettings()?i.languages:[],includeInferred:s,sameAsState:o}).then((function(e){ke(e)}),(function(t){e.loading=!1,l.error(getError(t.data),L.instant("graphexplore.error.cannot.load.graph"))}))},z=(e,t)=>{const n=e.split(" ");return t?[n[0],n[1],n[2]].join(">"):[n[0],n[2]].join(">")},D=e=>[e.source.iri,e.target.iri].join(">"),F=e=>{if(e.isTriple){const t=document.getElementById(Object(s.removeSpecialChars)(z(e.iri)));if(t&&void 0!==t.__data__.x)return t.__data__.x}return e.x},B=e=>{if(e.isTriple){const t=document.getElementById(Object(s.removeSpecialChars)(z(e.iri)));if(t&&void 0!==t.__data__.y)return t.__data__.y}return e.y},U=e=>{const t=e.trim().split(" ");return`<<<${t[0]}> <${t[1]}> <${t[2]}>>>`},W=e=>{const t=e.source.isTriple?z(e.source.iri,!0):e.source.iri,n=e.target.isTriple?z(e.target.iri,!0):e.target.iri;return Object(s.removeSpecialChars)(`${t}>${n}>marker`)},q=t=>{e.configLoaded=t,"search"===t.startMode?e.searchVisible=!0:"node"===t.startMode&&t.startIRI?d((function(){e.openUri(t.startIRI,!0)}),0):"query"===t.startMode&&t.startGraphQuery&&(e.loading=!0,w.loadGraphForConfig(t,t.startQueryIncludeInferred,M().linksLimit,t.startQuerySameAs).then((function(e){ke(e)}),(function(t){e.loading=!1,l.error(getError(t),L.instant("graphexplore.error.graph.load"))})))},V=function(){var t,n;f.search().config?(t=f.search().config,n=G,t===e.defaultGraphConfig.id?q(e.defaultGraphConfig):w.getConfig(t).then(e=>{q(e),n()}).catch(e=>{l.error(getError(e),L.instant("graphexplore.error.could.not.load.config",{configId:t}))})):f.search().query||f.search().uri?(q(e.defaultGraphConfig),G()):G()};x.onpopstate=function(t){A(),t.state&&(t.state.config?(q(t.state.config),t.state.uri&&e.openUri(t.state.uri,!0)):t.state.savedGraph&&e.loadSavedGraph(t.state.savedGraph,!0))},e.embedded&&(f.search().query||f.search().uri||f.search().config||f.search().saved)&&(e.noGoHome=!0);let H=0,K=0,Z={},Q=0;const J=16,Y=d3.zoom().scaleExtent([.1,10]);let X;const ee=d3.zoomIdentity.translate(0,-70).scale(1);Y.on("zoom",(function(e){C.isActive()||(te=e.transform,X.attr("transform",te))}));let te=ee;const ne=1e3,re=1e3;let ie,oe;function se(){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?Ae(e.source):_.find(t,(function(t){return t.iri===e.source})),r=e.isTripleTarget?Ae(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?z(i.source.iri):i.source.iri}>${i.target.isTriple?z(i.target.iri):i.target.iri}`;if(ae.tripleLinksCopy.has(e)){let t=ae.tripleLinksCopy.get(e);return t[0].predicates.push(...i.predicates),t.push(i),ae.tripleLinksCopy.set(e,t),null}ae.tripleLinksCopy.set(e,[i])}return i}))}(e,t));for(let e of ae.tripleLinksCopy.keys())1===ae.tripleLinksCopy.get(e).length&&ae.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=z(n.source.iri),o=z(n.target.iri);if(i===e&&ae.tripleNodes.delete(o)){let e=o.split(">");t.push({source:e[0],target:e[1]})}let s=i===e||o===e||n.source.iri===r[0]&&n.target.iri===r[1];return s&&(ae.tripleLinksCopy.delete(`${i}>${o}`),ae.tripleLinksCopy.delete(`${o}>${i}`)),s})))}),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(z(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 s=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(!s){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;s=(r[0].source.iri===e.iri||r[0].target.iri)&&(r[1].source.iri===e.iri||r[1].target.iri)}return s&&(o.target.isTriple&&r.push(z(o.target.iri)),o.source.isTriple||o.target.isTriple||r.push([o.source.iri,o.target.iri].join(">"))),s})),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=z(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:_.cloneDeep(e.labels),types:_.cloneDeep(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:Q,type2color:Z,transform:te}},this.restoreState=function(t){e.nodeSelected=!0,e.searchVisible=!1,this.nodes=_.cloneDeep(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)&&(Q=t.colorIndex,Z=_.cloneDeep(t.type2color)),angular.isDefined(t.transform)&&(te=d3.zoomIdentity.translate(t.transform.x,t.transform.y).scale(t.transform.k)),xe()}}e.datasource={get:function(t,n,r){return g.initLazyList(t,n,r,H,e.propertiesObj.items)},revision:function(){return K}},u.when(h.getPrincipal()).then(t=>(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=v.get(I.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=_.cloneDeep(e.defaultSettings),v.set(I.GRAPHS_VIZ,e.saveSettings)}else e.saveSettings=_.cloneDeep(e.defaultSettings)})(t)),e.showInfoPanel=!1;let ae=new se;function ce(t){!n.getActiveRepository()||e.hasInitedRepository&&!t||(e.hasInitedRepository=!0,t||e.getGraphConfigs(V))}e.addedTag=function(t){return t.text.indexOf(":")<0?(l.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=p.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?l.warning(L.instant("graphexplore.absolute.prefixed.iri.option"),t):l.warning(L.instant("graphexplore.absolute.prefixed.iri"),t),!1;const r=e.text.indexOf("*");if(r>=0){if(!n)return l.warning(L.instant("graphexplore.wildcards.not.allowed"),t),!1;if(r<e.text.length-1)return l.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 c.isLicenseValid()},ce();const le=d3.scaleLinear().domain([0,9]).range(["hsl(0, 100%, 75%)","hsl(360, 90%, 82%)"]).interpolate(d3.interpolateHslLong),de=d3.scaleLinear().domain([0,9]).range(["hsl(180, 50%, 75%)","hsl(540, 40%, 82%)"]).interpolate(d3.interpolateHslLong);e.getColor=function(e){angular.isUndefined(Z[e])&&(Z[e]=Q,Q++);const t=Z[e];return t>39?"#c2c2c2":t%2==0?le(t/2):de(t/2)};const pe=d3.forceX(ne/2).strength(.005),ue=d3.forceY(re/2).strength(.005),fe=d3.forceSimulation().force("x",pe).force("y",ue),he=d3.select(".main-container .graph-visualization").append("svg").attr("viewBox","0 0 "+ne+" "+re).attr("preserveAspectRatio","xMidYMid meet");he.append("rect").attr("width",10*ne).attr("height",10*re).attr("x",-(10*ne-ne)/2).attr("y",-(10*re-re)/2).style("fill","none").style("pointer-events","all").call(Y).on("click",(function(e){e.stopPropagation(),be(),fe.stop()}));let ge=0,me=0;const ye=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.8.4-TR2").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 xe(t){d3.selectAll("svg g").remove(),d3.selectAll(".d3-tip").remove(),d3.selectAll(".menu-events").remove(),X=he.append("g").attr("class","nodes-container").attr("transform",(function(){return angular.isDefined(te)&&!t?te:""}));const n=Object(i.a)().attr("class","d3-tip").customPosition((function(){const e=ie.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})),o=function(e){let t="";return t+=_.join(_.map(e.predicates,(function(t,n){if(0===n)return Oe(t);if(n<10)return" · "+Oe(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 a;const c=Object(i.a)().attr("class","d3-tip").customPosition((function(e){const t=a.getBoundingClientRect(),n=function(e){const t=o(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 o(e)}));const p=function(){d.cancel(void 0),d.cancel(ge),ie=null,n.hide(),me=d((function(){be()}),500)};he.call(n);he.call(c);let u=he.selectAll(".link"),f=he.selectAll(".node");const h=d3.forceCollide(e=>e.size+5).strength(.5),g=d3.forceManyBody().strength(-300),m=d3.forceCenter(ne/2,re/2);fe.nodes(ae.nodes).force("charge",g).force("collide",h).force("center",m).force("link",d3.forceLink(ae.links).distance((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}))),X.append("defs").selectAll("marker").data(ae.links).enter().append("marker").attr("class","arrow-marker").attr("id",(function(e){return W(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"),u=X.selectAll(".link").data(ae.links).enter().append("g").attr("class","link-wrapper").attr("id",(function(e){return Object(s.removeSpecialChars)(D(e))})).append("line").attr("class","link").style("stroke-width",1).style("fill","transparent").style("marker-end",(function(e){return`url(#${W(e)})`}));const y=X.selectAll(".link-wrapper").append("text").text((function(e){return Me(e)})).attr("class",(function(e){return e.predicates.length>1||ae.tripleNodes.has(D(e))?"predicates":"predicate"})).attr("dy","-0.5em").style("text-anchor","middle").style("display",M().showLinksText?"":"none").on("mouseover",(function(e,t){e.stopPropagation(),function(e,t){d.cancel(void 0);const n=a=e.target;d((function(){a===n&&t.predicates.length>1&&c.show(t,a)}),300)}(e,t)})).on("mouseout",(function(){d.cancel(void 0),a=null,c.hide()})).on("click",(function(t,n){t.stopPropagation(),function(t,n){Pe();const r=D(n);if(1===n.predicates.length&&ae.tripleNodes.has(r)){oe=null;const e=ae.tripleNodes.get(r)[0];if(Se(e,this,t.button)){const t={};t.iri=e.iri,t.pred=Oe(e.iri.split(" ")[1]),_e(t)}return}!function(t){if(e.showNodeInfo=!1,e.showPredicates=t.predicates.length>1,e.showFilter=!1,e.showInfoPanel=!1,oe===t)return e.showNodeInfo=!1,e.showInfoPanel=!1,void(oe=null);oe=t,e.showPredicates&&(e.predicates=_.map(t.predicates,(function(e){const n=function(e,t){const n=D(t);return ae.tripleNodes.has(n)?ae.tripleNodes.get(n).findIndex(t=>t.iri.indexOf(e)>=0):-1}(e,t),r=n>-1;return{value:Oe(e),partOfTriple:r,linkId:r?D(t):"",nodeIndex:n}})),e.showInfoPanel=!0)}(n)}(t,n)}));let x,v=0,I=null,S=null;const w=function(t,n,r){let i=r||this.parentNode;Array.isArray(r)&&(i=r[n]);ae.countLinks(t,ae.links)<=M().linksLimit?Ce(t,!1,i):l.info(L.instant("graphexplore.increase.limit"),L.instant("graphexplore.node.at.max")),e.closeInfoPanel()};function k(e,t){let n,r,i,o,s=!0;if("down"===t)n=2*e.size,r=e.size/3,i=.8,o=.3;else if("down-fixed"===t)n=2*e.size,r=e.size,i=.8,o=.66;else if("up"===t)n=e.size/3,r=2*e.size,i=.3,o=.8;else{if("fixed"!==t)return;n=e.size,i=.66,s=!1}let a=X.selectAll(".node-wrapper").filter((function(t){return t===e})).append("text").text("").classed("icon-any pinned",!0).style("font-size",n+"px").attr("x",(function(e){return e.x})).attr("y",(function(e){return e.y})).attr("opacity",i);"fixed"!==t&&"down-fixed"!==t||(e.pin=a),s&&(a=a.transition().duration(1e3).style("font-size",(function(){return r+"px"})).attr("opacity",o),"down-fixed"!==t&&a.remove())}const b=d3.drag().subject((function(e){return e})).on("start",(function(e,t){if(C.isActive())return;0===e.sourceEvent.button&&(t.fixedBeforeDrag=t.fixed,t.isBeingDragged=!0,t.beginDragging=!0,be(),d3.select(this).classed("dragging",!0),fe.alphaTarget(.3).restart())})).on("drag",(function(t,n){n.isBeingDragged&&(n.fx=t.x,n.fy=t.y,n.fixed?n.beginDragging&&k(n,"fixed"):(e.numberOfPinnedNodes++,n.fixed=!0,k(n,"down-fixed")),n.pinWasFixed=!0,n.beginDragging=null)})).on("end",(function(e,t){t.isBeingDragged&&(t.pinWasFixed&&(t.pinWasFixed=null,d3.select(".pinned").remove()),t.isBeingDragged=!1,d3.select(this).classed("dragging",!1));fe.alphaTarget(0)}));f=X.selectAll(".node").data(ae.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])})).on("mouseover",(function(t,r){r.isBeingDragged||(d.cancel(me),ge=d(()=>{(function(t,n){if(e.showInfoPanel)return!1;(Ie.closeIcon||Ie.expandIcon||Ie.focusIcon||Ie.copyURIIcon)&&Ie.removeIcons();if(fe.alpha()<.1)return Ie.initIcons(t,n.parentNode),fe.stop(),ve(),!0;return!1})(r,this)&&function(e,t){d.cancel(void 0);const r=ie=t.target;d((function(){ie===r&&n.show(e,ie)}),300)}(r,t)},400))})).on("mouseout",p).on("click",(function(t,n){if(t.button&&0!==t.button)return;const r=this;if(I&&S===r)return d.cancel(I),I=null,void w(n,0,r.parentNode);S=r,p(),e.showPredicates=!1,C.isActive()||(d.cancel(I),I=d((function(){Se(n,r,t),I=null}),540))})).on("touchstart",(e,t)=>function(e){v=0,x=d((function(){v<5&&we(e),x=null}),1e3)}(t)).on("touchmove",(function(){v++})).on("touchend",(function(){d.cancel(x),x=null})).on("contextmenu",(function(t,r){t.shiftKey||(t.preventDefault(),be(),e.closeInfoPanel(),r.fixed?(e.numberOfPinnedNodes--,r.fixed=!1,r.fx=null,r.fy=null,k(r,"up"),fe.alpha(1).restart()):(e.numberOfPinnedNodes++,r.fixed=!0,k(r,"down")),function(e){ie&&n.show(e,ie)}(r))})).on("gdb-expand-node",(e,t)=>w(t,0,e.srcElement.parentNode)).on("gdb-show-node-info",(e,t)=>Te(t)).call(b);const T=X.selectAll(".node-wrapper").append("foreignObject").style("pointer-events","none").attr("width",(function(e){return 2*e.size*1.75}));X.insert("g").attr("class","menu-events"),(e=>{e.each((function(e){e.fontSize=r.a.Text.calcFontSizeRaw(e.labels[0].label,e.size,J,!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})),d((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),fe.on("tick",(function(){u.attr("x1",(function(e){return F(e.source)})).attr("y1",(function(e){return B(e.source)})).attr("x2",(function(e){return F(e.target)})).attr("y2",(function(e){return B(e.target)})),y.attr("x",(function(e){let t=F(e.source),n=F(e.target);return e.x=.5*(t+n)})).attr("y",(function(e){let t=B(e.source),n=B(e.target);return e.y=.5*(t+n)})).attr("transform",(function(e){return"rotate("+function(e,t){const n={x:F(e.source),y:B(e.source)},r={x:F(e.target),y:B(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})),X.select(".node-loader").attr("x",(function(e){return e.x-e.size+3})).attr("y",(function(e){return e.y-e.size})),X.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})),ve()})),angular.isDefined(ye)&&ye.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){const r=Object(s.removeSpecialChars)(n.source.iri),i=Object(s.removeSpecialChars)(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(),fe.alpha(.3).restart()}function ve(){t.d3alpha=fe.alpha()}const Ie=new function(){function n(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(r,o){const s=Object(i.a)().attr("class","d3-tip d3-actions-tip").customPosition((function(e,t){const n=t.target.getBoundingClientRect();return{top:n.top-20+"px",left:n.right+10+"px"}})).html((function(e){return e}));he.call(s);r.isExpanded?(this.collapseIcon=d3.select(".menu-events").append("g").attr("class","collapse-icon").attr("name","collapse").attr("transform",(function(){return n(20,r)})),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=r).isExpanded=!1,ae.removeNodeLeafLinks(e),xe()})).on("mouseover",(function(e){s.show(this.getAttribute("name"),e),d.cancel(ge),d.cancel(me)})).on("mouseout",(function(){s.hide(),me=d((function(){be()}),500)}))):(this.expandIcon=d3.select(".menu-events").append("g").attr("class","expand-icon").attr("name","expand").attr("transform",(function(){return n(20,r)})),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(){Ce(r,!1,o)})).on("mouseover",(function(e){s.show(this.getAttribute("name"),e),d.cancel(me),d.cancel(ge)})).on("mouseout",(function(){s.hide(),me=d((function(){be()}),500)}))),this.focusIcon=d3.select(".menu-events").append("g").attr("class","focus-icon").attr("name","focus").attr("transform",(function(){return n(20,r)})),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",r.iri)})).on("mouseover",(function(e){s.show(this.getAttribute("name"),e),d.cancel(me),d.cancel(ge)})).on("mouseout",(function(){s.hide(),me=d((function(){be()}),500)})),this.copyURIIcon=d3.select(".menu-events").append("g").attr("class","icon-link").attr("name","link").attr("transform",(function(){return n(20,r)})),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(){e.copyToClipboard(r.iri),be(),s.hide()})).on("mouseover",(function(e){s.show("<div style='text-align: center;'><b>Copy to ClipBoard</b><br>"+r.iri+"</div>",e),d.cancel(me),d.cancel(ge)})).on("mouseout",(function(){s.hide(),me=d((function(){be()}),500)})),this.closeIcon=d3.select(".menu-events").append("g").attr("class","close-icon").attr("name","remove").attr("transform",(function(){return n(20,r)})),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(){we(r)})).on("mouseover",(function(e){s.show(this.getAttribute("name"),e),d.cancel(me),d.cancel(ge)})).on("mouseout",(function(){s.hide(),me=d((function(){be()}),500)})),this.animateMenu(r)},this.animateMenu=function(e){const t=d3.easeSin;let r=0;let i=20;this.expandIcon&&this.expandIcon.transition().duration(100).style("opacity",1).ease(t).attr("transform",(function(){return n(i,e)})).delay(r+=35),this.collapseIcon&&this.collapseIcon.transition().duration(100).style("opacity",1).ease(t).attr("transform",(function(){return n(i,e)})).delay(r+=35),this.copyURIIcon.transition().duration(100).style("opacity",1).ease(t).attr("transform",(function(){return i+=30,n(i,e)})).delay(r+=35),this.focusIcon.transition().duration(100).style("opacity",1).ease(t).attr("transform",(function(){return i+=30,n(i,e)})).delay(r+=35),this.closeIcon.transition().duration(100).style("opacity",1).ease(t).attr("transform",(function(){return i+=30,n(i,e)})).delay(r+=35),this.expandedState=!0}};function Se(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?(we(n),!1):void 0!==e.openedNodeInfoPanel&&e.openedNodeInfoPanel===n?(e.pageslideExpanded=!1,e.openedNodeInfoPanel=void 0,!1):(Te(n),!0)}function we(e){ae.removeNode(e),xe()}function ke(t){!function(t){e.nodeSelected=!0,null===t.data.types&&(t.data.types="greyColor"),ae=new se,te=ee}(t),Le(t)}function Le(t,n,r){let i=t.data;i=_.filter(i,(function(e){return-1===_.findIndex(ae.links,(function(t){return e.source===t.source.iri&&e.target===t.target.iri}))}));const o=[],s=ae.tripleLinksCopy.values();for(let e=0;e<ae.tripleLinksCopy.size;e++){s.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 a=((e,t)=>{const n=t.map(t=>t[e]);return t.filter((t,r)=>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}]}))))),c=_.map(ae.nodes,(function(e){return{iri:e.iri,isTriple:Boolean(e.isTriple)}})),d=ae.tripleNodes.values();for(let e=0;e<ae.tripleNodes.size;e++){d.next().value.forEach(e=>{c.push({iri:e.iri,isTriple:e.isTriple})})}const p=_.reject(a,(function(e){return _.some(c,e)}));if(0===p.length)(r||0===i.length)&&l.info(L.instant("graphexplore.error.node.connections")),ae.addAndMatchLinks(i),xe();else{const t=[],r=[],o=M();_.forEach(p,(function(n,i){t.push(k.getInstanceNode({iri:n.isTriple?U(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})))})),u.all(t).then((function(){_.forEach(r,(function(e,t){const i=2*Math.PI*t/r.length,o=(n?n.x:0)+Math.cos(i)*re/3,s=(n?n.y:0)+Math.sin(i)*re/3;e.isTriple?ae.addTriple(e,o,s):ae.addNode(e,o,s)})),ae.addAndMatchLinks(i),n&&(n.isExpanded=!0),xe()}))}}function Ce(t,n,r){if(ye.getLoadingState())return;ye.init(t,r);const i=M(),o=t.iri;k.getInstanceNodeLinks({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){Le(e,t,n)}),(function(t){const n=getError(t.data);l.error(n,L.instant("graphexplore.error.exploring.node")),e.loading=!1,ye.setLoadingState(!1)}))}function be(){angular.isDefined(Ie)&&Ie.expandedState&&Ie.removeIcons()}function Te(t){fe.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(U(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=M();k.getProperties({iri:t.isTriple?U(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){l.warning(getError(e.data),"Error")}))}function _e(e){Ne("predicate","var(--primary-color-dark)",e),Ne("predicates","var(--primary-color-dark)",e);const t=document.getElementsByClassName("link");t&&_.each(t,(function(t){const 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)}));const n=document.getElementsByClassName("arrow-marker");n&&_.each(n,(function(t){const 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 Ne(e,t,n){const r=document.getElementsByClassName(e);r&&_.each(r,(function(e){const r=e.__data__;n?((r.source.iri.indexOf(n.iri)>=0||r.target.iri.indexOf(n.iri)>=0)&&(e.style.fill=t),z(n.iri)===D(r)&&(e.textContent=n.pred,e.style.fill=t),n.oppLinkIRI&&n.oppLinkIRI===D(r)&&(e.textContent=n.oppTriplePred,e.style.fill=t)):(e.style.fill=t,e.textContent=Me(r))}))}function Pe(){_.each(e.predicates,(function(e){const t=document.getElementById(e.linkId+e.nodeIndex);t&&(t.style.fontWeight="normal")}));const t=document.getElementsByClassName("link");t&&_.each(t,(function(e){e.style.stroke="#999",e.style.strokeWidth=1})),Ne("predicate",""),Ne("predicates","");const n=document.getElementsByClassName("arrow-marker");n&&_.each(n,(function(e){e.style.stroke="#999",e.__data__.target.isTriple||e.setAttribute("refX","59")}))}function Ae(e){const t=z(e);if(ae.tripleNodes.has(t))return ae.tripleNodes.get(t).find(t=>t.iri===e)}function Me(e){return e.predicates.length>1?e.predicates.length+" predicates":Oe(e.predicates[0])}function Oe(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=[],oe=null,d((function(){e.showInfoPanel=!1}))},e.clickLink=function(t){if(ae.tripleNodes.has(t.linkId)){Pe();const n=ae.tripleNodes.get(t.linkId)[t.nodeIndex];Te(n),e.showPredicates=!0;const r=document.getElementById(t.linkId+t.nodeIndex);r&&(r.style.fontWeight="bold");const i={},o=ae.tripleLinksCopy.values();for(let e=0;e<ae.tripleLinksCopy.size;e++){const 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=z(t.target.iri),i.oppTriplePred=Oe(t.target.iri.split(" ")[1])),i.pred=Oe(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=z(t.source.iri),i.oppTriplePred=Oe(t.source.iri.split(" ")[1])),i.pred=Oe(n.iri.split(" ")[1]),1===t.predicates.length&&(i.linkPred=t.predicates[0]),!1))}i.iri||(i.iri=n.iri,i.pred=Oe(n.iri.split(" ")[1])),_e(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){be();const t=10*(e?1:-1)*Math.PI/180,n=Math.cos(t),r=Math.sin(t),i=ne/2,o=re/2;d3.selectAll(".node-wrapper").each((function(e){e.x=i+(n*(e.x-i)+r*(e.y-o)),e.y=o+(-r*(e.x-i)+n*(e.y-o)),e.fixed&&(e.fx=e.x,e.fy=e.y)})),fe.alpha(1).restart()},e.openUri=function(t,n){if(!n){const n={};e.configLoaded.id!==e.defaultGraphConfig.id&&(n.config=e.configLoaded.id),n.uri=t,P(n,{uri:t,config:e.configLoaded})}e.$broadcast("onRootNodeChange",t)},e.saveOrUpdateGraph=function(){const t=JSON.stringify(ae.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 Ee=function(t){S.editSavedGraph(t).success((function(){e.lastSavedGraphName=t.name,e.shared=t.shared,e.refreshSavedGraphs(),l.success(L.instant("graphexplore.saved.graph.was.edited",{name:t.name}))})).error((function(e){const t=getError(e);l.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),S.addNewSavedGraph(t).success((function(n,r,i){e.lastSavedGraphName=t.name,e.lastSavedGraphId=i()["x-saved-graph-id"],e.shared=t.shared,e.refreshSavedGraphs(),l.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);l.error(e,L.instant("graphexplore.error.cannot.create.graph"))}}))}(t.graph);break;case"update":case"rename":Ee(t.graph)}}))},e.refreshSavedGraphs=function(){S.getSavedGraphs().success((function(t){e.savedGraphs=t})).error((function(e){const t=getError(e);l.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),ae.restoreState(JSON.parse(t.data)),n||P({saved:t.id},{savedGraph:t})},e.copyToClipboardSavedGraph=function(t){const n=[location.protocol,"//",location.host,location.pathname,"?saved=",t.id].join("");e.copyToClipboard(n)},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){S.deleteSavedGraph(t).success((function(){e.refreshSavedGraphs(),l.success(L.instant("graphexplore.saved.graph.was.deleted",{name:t.name}))})).error((function(e){const t=getError(e);l.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(){be();const t=angular.isUndefined(e.numberOfPinnedNodes)||e.numberOfPinnedNodes<=0;e.numberOfPinnedNodes=0,d3.selectAll(".node").each((function(n){n.fixed=t,t?(e.numberOfPinnedNodes++,n.fx=n.x,n.fy=n.y):(n.fx=null,n.fy=null)})),fe.alpha(1).restart()},$("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 l(e,t,n,r){switch(e.mode=n.mode,e.graph=_.cloneDeep(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","graphdb.core.services.workbench-context","graphdb.framework.core.services.rdf4j.repositories"]).controller("GraphsVisualizationsCtrl",c).controller("SaveGraphModalCtrl",l).config(["$uibTooltipProvider",function(e){e.options({appendToBody:!0})}]),c.$inject=["$scope","$rootScope","$repositories","$licenseService","toastr","$timeout","ClassInstanceDetailsService","$q","$location","$jwtAuth","UiScrollService","ModalService","$uibModal","$window","LocalStorageAdapter","LSKeys","SavedGraphsRestService","GraphConfigRestService","GraphDataRestService","$translate","GuidesService","WorkbenchContextService","RDF4JRepositoriesService"],l.$inject=["$scope","$uibModalInstance","data","$translate"]},538:function(e,t,n){var r,i;r=[n(546)],void 0===(i=function(){function e(e,t){return e.each((function(){var e=t.apply(this,arguments),n=select(this);for(var r in e)n.attr(r,e[r])}))}function t(e,t){for(var n in t)e.attr(n,t[n]);return e}return"undefined"==typeof d3&&(d3=n(546)),d3.selection.prototype.attrs=function(n){return("function"==typeof n?e:t)(this,n)},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 e=this.parentNode.firstChild;e&&this.parentNode.insertBefore(this,e)}))},d3}.apply(t,r))||(e.exports=i)},550:function(e,t,n){"use strict";n(538);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=function(){const e=function(e,n){let r,i=1,o=arguments.length;for(;++i<o;)r=arguments[i],e[r]=t(e,n,n[r]);return e};function t(e,t,n){return function(){var r=n.apply(t,arguments);return r===t?e:r}}return{delayDblClick:function(){var t=d3.dispatch("click","dblclick");return e((function(e){var n,r=null;e.on("mousedown",(function(){n=d3.pointer(document.body),+new Date})),e.on("mouseup",(function(e,i){var o,s,a;(s=n,a=d3.pointer(document.body),Math.sqrt(Math.pow(s[0]-a[0],2),Math.pow(s[1]-a[1],2))>5)||(r?(window.clearTimeout(r),r=null,t.call("dblclick",e,e,i)):r=window.setTimeout((o=e,function(){t.call("click",o,o,i),r=null}),250))}))}),t,"on")}}}(),t.a=r},562:function(e,t,n){"use strict";t.a=function(){var e=function(){return"n"},t=function(){return[0,0]},n=function(){return" "},r=p(),i=null,o=null,s=null,a=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&&(s=r.pop());var i,o=n.apply(this,r),p=t.apply(this,r),f=e.apply(this,r),h=u(),g=d.length,m=document.documentElement.scrollTop||document.body.scrollTop,y=document.documentElement.scrollLeft||document.body.scrollLeft,x=a.apply(this,r);for(h.html(o).style("opacity",1).style("pointer-events","all");g--;)h.classed(d[g],!1);const v=r.filter(e=>e instanceof Event);return i=l.get(f).apply(this,v),x?Object.keys(x).forEach((function(e){h.style(e,x[e])})):h.classed(f,!0).style("top",i.top+p[0]+m+"px").style("left",i.left+p[1]+y+"px"),c},c.hide=function(){return u().style("opacity",0).style("pointer-events","none"),c},c.attr=function(e,t){if(arguments.length<2&&"string"==typeof e)return u().attr(e);var n=Array.prototype.slice.call(arguments);return d3.selection.prototype.attr.apply(u(),n),c},c.style=function(e,t){if(arguments.length<2&&"string"==typeof e)return u().style(e);var n=Array.prototype.slice.call(arguments);return d3.selection.prototype.style.apply(u(),n),c},c.direction=function(t){return arguments.length?(e=null==t?t:h(t),c):e},c.offset=function(e){return arguments.length?(t=null==e?e:h(e),c):t},c.html=function(e){return arguments.length?(n=null==e?e:h(e),c):n},c.customPosition=function(e){return arguments.length?(a=null==e?e:h(e),c):a},c.destroy=function(){return r&&(u().remove(),r=null),c};var l=new Map(Object.entries({n:function(e){var t=f(e);return{top:t.n.y-r.offsetHeight,left:t.n.x-r.offsetWidth/2}},s:function(e){var t=f(e);return{top:t.s.y,left:t.s.x-r.offsetWidth/2}},e:function(e){var t=f(e);return{top:t.e.y-r.offsetHeight/2,left:t.e.x}},w:function(e){var t=f(e);return{top:t.w.y-r.offsetHeight/2,left:t.w.x-r.offsetWidth}},nw:function(e){var t=f(e);return{top:t.nw.y-r.offsetHeight,left:t.nw.x-r.offsetWidth}},ne:function(e){var t=f(e);return{top:t.ne.y-r.offsetHeight,left:t.ne.x}},sw:function(e){var t=f(e);return{top:t.sw.y,left:t.sw.x-r.offsetWidth}},se:function(e){var t=f(e);return{top:t.se.y,left:t.e.x}}})),d=l.keys();function p(){var e=d3.select(document.createElement("div"));return e.style("position","absolute").style("top",0).style("opacity",0).style("pointer-events","none").style("box-sizing","border-box"),e.node()}function u(){return null===r&&(r=p(),document.body.appendChild(r)),d3.select(r)}function f(e){for(var t=s||e.target;void 0===t.getScreenCTM&&"undefined"===t.parentNode;)t=t.parentNode;var n={},r=t.getScreenCTM(),i=t.getBBox(),a=i.width,c=i.height,l=i.x,d=i.y;return o.x=l,o.y=d,n.nw=o.matrixTransform(r),o.x+=a,n.ne=o.matrixTransform(r),o.y+=c,n.se=o.matrixTransform(r),o.x-=a,n.sw=o.matrixTransform(r),o.y-=c/2,n.w=o.matrixTransform(r),o.x+=a,n.e=o.matrixTransform(r),o.x-=a/2,o.y-=c/2,n.n=o.matrixTransform(r),o.y+=c,n.s=o.matrixTransform(r),n}function h(e){return"function"==typeof e?e:function(){return e}}return c}}}]);
@@ -1 +1 @@
1
- (window.webpackJsonp=window.webpackJsonp||[]).push([[43],{257:function(e,t,n){"use strict";n.r(t);var r=n(562),a=n(587),i=n(550),o=n(551);n(13);function s(e,t,n,s,c,l,d,u,f,h,p,y,v){return{restrict:"AE",template:'<div id="classChart"></div>',scope:{classHierarchyData:"=",flattenedClassNames:"=",selectedClass:"=",currentSliderValue:"=",showClassInfoPanel:"=",showExternalElements:"=",hidePrefixes:"=",currentBrowserLimit:"="},link:function(d,g,m){!function(d,g){var m,x,w=d3.pack().size([780,780]),S=d3.scaleLinear().domain([0,4]).range(["hsl(19, 70%, 90%)","hsl(19, 70%, 50%)"]).interpolate(d3.interpolateHcl),C=d3.select("#classChart").insert("svg:svg","h2").attr("viewBox","0 0 800 800").attr("preserveAspectRatio","xMidYMid meet").on("dblclick.zoom",null);function E(){return C.append("svg:g").attrs({id:"main-group",transform:"translate(400,400)"})}function T(){return"true"===p.get(y.CLASS_HIERARCHY_HIDE_PREFIXES)}function R(){var e=o.a.Export.getCSSRules("css/rdf-class-hierarchy-labels.css?v=2.8.3");d3.selectAll("#main-group").append("defs"),$("defs").append('<style type="text/css"><![CDATA['+e+"]]></style>"),d3.selectAll("g").style("opacity",1);var t=o.a.Export.generateBase64ImageSource("#classChart svg");d3.select(this).attrs({href:t,download:"class-hierarchy-"+l.getActiveRepository()+".svg"})}d.hidePrefixes=T();var A,H,P=E();if(!d.classHierarchyData.classCount&&l.getActiveRepository()&&!l.isSystemRepository()){e.loader=!0,e.hierarchyError=!1;const t=p.get("classHierarchy-selectedGraph-"+l.getActiveRepository());n.getClassHierarchyData(null!==t?t.contextID.uri:"").success((function(t,n,r){e.loader=!1,207===n&&u.warning(v.instant("graphexplore.update.diagram"),v.instant("graphexplore.repository.data.changed")),d.classHierarchyData=t,d3.select("#download-svg").on("mouseover",R)})).error((function(t){e.loader=!1,e.hierarchyError=getError(t),u.error(v.instant("graphexplore.error.request.failed",{name:h,error:getError(t)}))}))}var I,b,k,L,N,D,F,z={};function O(n,o,l,u){b&&b(),k&&k(),d3.selectAll("#main-group").remove(),P=E(),a.a.SingleChild.addPlaceholders(n,!0),(x=d3.hierarchy(n)).sum((function(e){return e.size})),I=l||x,w(x);var p,y=x.descendants();I.isInFocusTransitive=!0,a.a.SingleChild.removePlaceholders(y),a.a.SingleChild.centerNodes(y),a.a.SingleChild.makePositionsRelativeToZero(y),m||(m=Object(r.a)().attr("class","d3-tip").customPosition((function(e,t){return{top:"inherit",bottom:s.innerHeight-t.clientY+"px",right:s.innerWidth-t.clientX+"px"}})).html((function(e){return e.data.name})),C.call(m));var v=P.selectAll("circle").data(y).enter().append("g");o.doFade&&v.each((function(e){i.a.Transition.fadeIn(d3.select(this),550)}));var g,T=[],R=v.append("circle").attr("class",(function(e){return e.data.role})).attr("guide-selector",(function(e){return"class-"+e.data.name})).style("fill",(function(e){return e.children?S(e.depth):"#E0D0D0"})).each((function(e){if(e.circle=d3.select(this),e.data.name!==h){var t=e.data.name;T.push({name:t}),z[[t]]=e,e.circle.classed("rdf-class",!0),e.circle.on("mouseover",(function(t){o.noPrefixes||e.textHidden?m.show(e,t):m.hide(e)})),e.circle.on("mouseout",m.hide)}})).on("gdb-focus",(e,t)=>H(t)).on("gdb-zoom",(e,t)=>W(t));function L(e){d3.selectAll(".selected").classed("selected",e.selected=!1),e.circle.classed("selected",e.selected=!0),g=e}function N(){d.showClassInfoPanel=!1}T&&(T=_.uniqBy(T,"name"),d.flattenedClassNames=T);var D=i.a.Click.delayDblClick();d3.selectAll(".parent, .topLevelParent, .child, .root").call(D),H=function(e){W(e),e.data.name===h?(N(),d3.selectAll(".selected").classed("selected",!1)):(L(e),d.selectedClass=g,d.showClassInfoPanel=!0,d.$on("sidePanelClosed",(function(t){d3.selectAll(".selected").classed("selected",e.selected=!1)})))},D.on("click",(function(e,t){t.data.id&&s.history.pushState({id:t.data.id},"classHierarchyPage"+t.data.id,"hierarchy#"+t.data.id),m.hide(),H(t)})),D.on("dblclick",(function(t,r){r!==n&&(m.hide(),L(r),e.$broadcast("goToDomainRangeGraphView",g,I),t.stopPropagation())}));var F=0;C.on("wheel",(function(e){m.hide(),e.preventDefault(),e.stopPropagation();var t=(new Date).getTime();if(t-F>100){F=t;var n="";e.deltaY<=-1?n="in":e.deltaY>=1&&(n="out");var r=e.target.__data__;if(r||(r=I),"in"===n){if(r!==I){for(;r.parent&&!r.parent.isInFocusTransitive;)r=r.parent;r.depth<I.depth&&(r=I)}if(r===I&&r.children){for(var a=r.children[0],i=1;i<r.children.length;i++)r.children[i].sortingRank>a.sortingRank&&(a=r.children[i]);a.children&&(r=a)}else r.children||(r=r.parent);W(r,!0)}else"out"===n&&(r=I.parent)&&W(r,!0);I.data.name===h&&s.history.replaceState({id:1},"classHierarchyPage1","hierarchy#1"),U()}}));var $=P.selectAll("text").data(y).enter().append("text").attr("class",(function(e){return e.children&&e.children.length?"label":"label child-label"})).each((function(e){e.textSel=d3.select(this)}));o.noPrefixes?($.each((function(e){var t=e.data.name.indexOf(":");e.data.name.indexOf("http://")>-1?e.noPrefixName=e.data.name:t>-1&&(e.noPrefixName=e.data.name.substring(t+1))})),$.style("font-size",(function(e){return i.a.Text.calcFontSize(e.noPrefixName,e.r)})).text((function(e){return i.a.Text.getTextWithElipsisIfNeeded(e.noPrefixName,e.r/3)}))):$.style("font-size",(function(e){return i.a.Text.calcFontSize(e.data.name,e.r)})).text((function(e){return i.a.Text.getTextWithElipsisIfNeeded(e.data.name,e.r/3)})),$.style("display",(function(e){return e.parent&&e.parent.data===I.data?(e.textHidden=this.textContent.indexOf("...")+3===this.textContent.length,null):(e.textHidden=!0,"none")})),o.doFade&&!o.keepPrevState&&$.each((function(e){i.a.Transition.fadeIn(d3.select(this),550)})),A=function(){function e(e){e&&R.each((function(t){+e===t.data.id&&H(t)}))}var n=t.hash();s.onpopstate=function(t){t.state&&e(t.state.id)},e(n)};var O=P.selectAll("circle, text");function M(e,t){var n=800/e[2];p=e,O.attr("transform",(function(t){return"translate("+(t.x-e[0])*n+","+(t.y-e[1])*n+")"})),R.attr("r",(function(e){return e.r*n})),t&&$.each((function(e){e.data.fullName!==I.data.topLevelParentUri&&I.data.topLevelParentUri!==h||(e.textSel.style("display","none"),I.children&&I.children.length?_.each(I.children,(function(e){e.textSel.style("display","inline")})):I.textSel.style("display","inline"),I.parent&&_.each(I.parent.children,(function(e){e.data.name!==I.data.name&&e.textSel.style("display","inline")})))})),$.style("font-size",(function(e){return o.noPrefixes?i.a.Text.calcFontSize(e.noPrefixName,e.r*n):i.a.Text.calcFontSize(e.data.name,e.r*n)})).text((function(e){return o.noPrefixes?i.a.Text.getTextWithElipsisIfNeeded(e.noPrefixName,e.r*n/3):i.a.Text.getTextWithElipsisIfNeeded(e.data.name,e.r*n/3)}))}function V(e){var t=2*e+20;return 2*e/t<.3&&(t=2*e+2),t}function B(e){!e.isInFocusTransitive&&e.parent&&e.parent.isInFocusTransitive?(e.textHidden=this.textContent.indexOf("...")+3===this.textContent.length,this.style.display=""):(e.textHidden=!0,this.style.display="none")}function W(e,t){if(c((function(){d.showExternalElements=e.data.name===h})),I!==e&&(e.data.id&&s.history.replaceState({id:e.data.id},"classHierarchyPage"+e.data.id,"hierarchy#"+e.data.id),e.children||(e=e.parent,I!==e))){if(t&&(N(),d3.selectAll(".selected").classed("selected",!1)),I.parent)for(var n=I;n;)n.isInFocusTransitive=!1,n=n.parent;for(n=e;n;)n.isInFocusTransitive=!!n.children,n=n.parent;if(2*(I=e).r/(2*I.r+20)<.3||d.currentSliderValue>d.currentBrowserLimit)M([I.x,I.y,V(I.r)]),$.each((function(e){B.call(this,e)}));else d3.transition().duration(f).tween("zoom",(function(e){var t=d3.interpolateZoom(p,[I.x,I.y,V(I.r)]);return function(e){M(t(e))}})).selectAll("text").each(B)}}M([I.x,I.y,V(I.r)],u),b=d.$on("rootFocus",(function(){s.history.pushState({id:1},"classHierarchyPage1","hierarchy#1"),H(x)})),k=d.$on("classSearch",(function(e){H(e)}))}function U(){const t=d.classHierarchyData.classCount;let n=p.get(y.CLASS_HIERARCHY_CURRENT_SLIDER_VALUE);(!n||n>t)&&(n=t,p.set(y.CLASS_HIERARCHY_CURRENT_SLIDER_VALUE,n)),e.$broadcast("classCount",t,n)}window.addEventListener("resize",U),window.addEventListener("beforeunload",(function e(){window.removeEventListener("resize",U),window.removeEventListener("beforeunload",e)})),d.$watch("classHierarchyData",(function(){L&&L(),N&&N(),D&&D(),F&&F();var e=T();if(d.classHierarchyData.classCount){U();var t=_.cloneDeep(d.classHierarchyData);var n,r,a=function(e){return e.descendants().sort((function(e,t){return e.data.sortingRank>t.data.sortingRank?-1:e.data.sortingRank<t.data.sortingRank||e.data.depth>t.data.depth?1:e.data.depth<t.data.depth?-1:0}))}(d3.hierarchy(t));function i(e,t){const a={keepPrevState:!0,noPrefixes:T()};r=a.noPrefixes,O(n||e,a,I,!0),c((function(){p.set(y.CLASS_HIERARCHY_SWITCH_PREFIXES,t),A()}),70)}function o(e,a,o){if(!e)return;p.set(y.CLASS_HIERARCHY_CURRENT_SLIDER_VALUE,e),n={name:h,children:[]};const s=new Set;for(let t=1;t<=e;t++)s.add(a[t].data.id),a[t].parent===a[0]&&n.children.push(a[t].data);if(function e(t){if(!t.children)return;const n=[];for(const e of t.children)s.has(e.id)&&n.push($.extend({},e));t.children=n;for(const n of t.children)e(n)}(n),o){r=angular.isUndefined(r)?T():r;O(n,{noPrefixes:r})}else i(t)}var s,l=p.get(y.CLASS_HIERARCHY_CURRENT_SLIDER_VALUE);if(l)o(l,a);else{var u={doFade:!0,keepPrevState:!0,noPrefixes:T()};O(t,u),A()}L=d.$watch("hidePrefixes",(function(n){angular.isUndefined(n)||e?e=void 0:c((function(){!function(e){angular.isUndefined(e)||p.set(y.CLASS_HIERARCHY_HIDE_PREFIXES,e)}(n),i(t,!0)}),50)}),!0),N=d.$watch("currentSliderValue",(function(e){o(e,a,!0)}),!0),F=d.$on("onEnterKeypressSearchAction",(function(e){s&&H(s)})),D=d.$on("searchedClass",(function(e,t){(s=z[t.name])&&H(s)}))}}),!0)}(d)}}}angular.module("graphdb.framework.graphexplore.directives.class",["graphdb.framework.graphexplore.controllers.class","graphdb.framework.utils.localstorageadapter"]).constant("ZOOM_DURATION",500).constant("ROOT_OBJ_NAME","RDF Class Hierarchy").directive("rdfClassHierarchy",s),s.$inject=["$rootScope","$location","GraphDataRestService","$window","$timeout","$repositories","$licenseService","toastr","ZOOM_DURATION","ROOT_OBJ_NAME","LocalStorageAdapter","LSKeys","$translate"]},538:function(e,t,n){var r,a;r=[n(546)],void 0===(a=function(){function e(e,t){return e.each((function(){var e=t.apply(this,arguments),n=select(this);for(var r in e)n.attr(r,e[r])}))}function t(e,t){for(var n in t)e.attr(n,t[n]);return e}return"undefined"==typeof d3&&(d3=n(546)),d3.selection.prototype.attrs=function(n){return("function"==typeof n?e:t)(this,n)},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 e=this.parentNode.firstChild;e&&this.parentNode.insertBefore(this,e)}))},d3}.apply(t,r))||(e.exports=a)},550:function(e,t,n){"use strict";n(538);var r=r||{};r.Text=function(){function e(e,t,n,r){n=n||10;var a=t/3;return"string"==typeof e?(a*=10/(e.substring(0,t/3).length+1.5),a+=1,e.match(/[\u0900-\u0DFF\u1100-\u11FF\u2E80-\u2EFF\u3000-\u9FFF]/)&&(a*=.6),a<n&&(a=n),Math.round(a)):(a<n&&(a=n),Math.round(a))}return{calcFontSizeRaw:e,calcFontSize:function(t,n,r,a){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=function(){const e=function(e,n){let r,a=1,i=arguments.length;for(;++a<i;)r=arguments[a],e[r]=t(e,n,n[r]);return e};function t(e,t,n){return function(){var r=n.apply(t,arguments);return r===t?e:r}}return{delayDblClick:function(){var t=d3.dispatch("click","dblclick");return e((function(e){var n,r=null;e.on("mousedown",(function(){n=d3.pointer(document.body),+new Date})),e.on("mouseup",(function(e,a){var i,o,s;(o=n,s=d3.pointer(document.body),Math.sqrt(Math.pow(o[0]-s[0],2),Math.pow(o[1]-s[1],2))>5)||(r?(window.clearTimeout(r),r=null,t.call("dblclick",e,e,a)):r=window.setTimeout((i=e,function(){t.call("click",i,i,a),r=null}),250))}))}),t,"on")}}}(),t.a=r},551:function(e,t,n){"use strict";n(538);var r=r||{};r.Export={getCSSRules:function(e){const t=$('link[href="'+e+'"]')[0].sheet.rules;let n="";return _.each(t,(function(e){n+=e.cssText})),n},generateBase64ImageSource:function(e){e||(e="svg");const t=d3.selectAll(e).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(t)))}},t.a=r},562:function(e,t,n){"use strict";t.a=function(){var e=function(){return"n"},t=function(){return[0,0]},n=function(){return" "},r=u(),a=null,i=null,o=null,s=null;function c(e){var t;a="svg"===(t=(t=e).node()).tagName.toLowerCase()?t:t.ownerSVGElement,i=a.createSVGPoint(),document.body.appendChild(r)}c.show=function(){var r=Array.prototype.slice.call(arguments);r[r.length-1]instanceof SVGElement&&(o=r.pop());var a,i=n.apply(this,r),u=t.apply(this,r),h=e.apply(this,r),p=f(),y=d.length,v=document.documentElement.scrollTop||document.body.scrollTop,g=document.documentElement.scrollLeft||document.body.scrollLeft,m=s.apply(this,r);for(p.html(i).style("opacity",1).style("pointer-events","all");y--;)p.classed(d[y],!1);const x=r.filter(e=>e instanceof Event);return a=l.get(h).apply(this,x),m?Object.keys(m).forEach((function(e){p.style(e,m[e])})):p.classed(h,!0).style("top",a.top+u[0]+v+"px").style("left",a.left+u[1]+g+"px"),c},c.hide=function(){return f().style("opacity",0).style("pointer-events","none"),c},c.attr=function(e,t){if(arguments.length<2&&"string"==typeof e)return f().attr(e);var n=Array.prototype.slice.call(arguments);return d3.selection.prototype.attr.apply(f(),n),c},c.style=function(e,t){if(arguments.length<2&&"string"==typeof e)return f().style(e);var n=Array.prototype.slice.call(arguments);return d3.selection.prototype.style.apply(f(),n),c},c.direction=function(t){return arguments.length?(e=null==t?t:p(t),c):e},c.offset=function(e){return arguments.length?(t=null==e?e:p(e),c):t},c.html=function(e){return arguments.length?(n=null==e?e:p(e),c):n},c.customPosition=function(e){return arguments.length?(s=null==e?e:p(e),c):s},c.destroy=function(){return r&&(f().remove(),r=null),c};var l=new Map(Object.entries({n:function(e){var t=h(e);return{top:t.n.y-r.offsetHeight,left:t.n.x-r.offsetWidth/2}},s:function(e){var t=h(e);return{top:t.s.y,left:t.s.x-r.offsetWidth/2}},e:function(e){var t=h(e);return{top:t.e.y-r.offsetHeight/2,left:t.e.x}},w:function(e){var t=h(e);return{top:t.w.y-r.offsetHeight/2,left:t.w.x-r.offsetWidth}},nw:function(e){var t=h(e);return{top:t.nw.y-r.offsetHeight,left:t.nw.x-r.offsetWidth}},ne:function(e){var t=h(e);return{top:t.ne.y-r.offsetHeight,left:t.ne.x}},sw:function(e){var t=h(e);return{top:t.sw.y,left:t.sw.x-r.offsetWidth}},se:function(e){var t=h(e);return{top:t.se.y,left:t.e.x}}})),d=l.keys();function u(){var e=d3.select(document.createElement("div"));return e.style("position","absolute").style("top",0).style("opacity",0).style("pointer-events","none").style("box-sizing","border-box"),e.node()}function f(){return null===r&&(r=u(),document.body.appendChild(r)),d3.select(r)}function h(e){for(var t=o||e.target;void 0===t.getScreenCTM&&"undefined"===t.parentNode;)t=t.parentNode;var n={},r=t.getScreenCTM(),a=t.getBBox(),s=a.width,c=a.height,l=a.x,d=a.y;return i.x=l,i.y=d,n.nw=i.matrixTransform(r),i.x+=s,n.ne=i.matrixTransform(r),i.y+=c,n.se=i.matrixTransform(r),i.x-=s,n.sw=i.matrixTransform(r),i.y-=c/2,n.w=i.matrixTransform(r),i.x+=s,n.e=i.matrixTransform(r),i.x-=s/2,i.y-=c/2,n.n=i.matrixTransform(r),i.y+=c,n.s=i.matrixTransform(r),n}function p(e){return"function"==typeof e?e:function(){return e}}return c}},587:function(e,t,n){"use strict";var r=r||{};r.SingleChild={addPlaceholders:function e(t,n){if(t.children){for(var r=0;r<t.children.length;r++)e(t.children[r]);if(1===t.children.length){var a=1.2*t.size;n&&(a=.1*t.children[0].size),t.children.push({name:"placeholder",size:a})}}},removePlaceholders:function e(t){for(var n=t.length-1;n>=0;n--){var r=t[n];"placeholder"===r.data.name?t.splice(n,1):r.children&&e(r.children)}},centerNodes:function(e){for(var t=0;t<e.length;t++){var n=e[t];if(n.children&&1===n.children.length){var r=n.x-n.children[0].x;n.children[0].x+=r,a(n.children[0],r)}}function a(e,t){if(e.children)for(var n=0;n<e.children.length;n++)e.children[n].x+=t,a(e.children[n],t)}},makePositionsRelativeToZero:function(e){for(var t=e[0].x,n=e[0].y,r=0;r<e.length;r++){var a=e[r];a.x-=t,a.y-=n}}},t.a=r}}]);
1
+ (window.webpackJsonp=window.webpackJsonp||[]).push([[43],{257:function(e,t,n){"use strict";n.r(t);var r=n(562),a=n(587),i=n(550),o=n(551);n(13);function s(e,t,n,s,c,l,d,u,f,h,p,y,v){return{restrict:"AE",template:'<div id="classChart"></div>',scope:{classHierarchyData:"=",flattenedClassNames:"=",selectedClass:"=",currentSliderValue:"=",showClassInfoPanel:"=",showExternalElements:"=",hidePrefixes:"=",currentBrowserLimit:"="},link:function(d,g,m){!function(d,g){var m,x,w=d3.pack().size([780,780]),S=d3.scaleLinear().domain([0,4]).range(["hsl(19, 70%, 90%)","hsl(19, 70%, 50%)"]).interpolate(d3.interpolateHcl),C=d3.select("#classChart").insert("svg:svg","h2").attr("viewBox","0 0 800 800").attr("preserveAspectRatio","xMidYMid meet").on("dblclick.zoom",null);function E(){return C.append("svg:g").attrs({id:"main-group",transform:"translate(400,400)"})}function T(){return"true"===p.get(y.CLASS_HIERARCHY_HIDE_PREFIXES)}function R(){var e=o.a.Export.getCSSRules("css/rdf-class-hierarchy-labels.css?v=2.8.4-TR2");d3.selectAll("#main-group").append("defs"),$("defs").append('<style type="text/css"><![CDATA['+e+"]]></style>"),d3.selectAll("g").style("opacity",1);var t=o.a.Export.generateBase64ImageSource("#classChart svg");d3.select(this).attrs({href:t,download:"class-hierarchy-"+l.getActiveRepository()+".svg"})}d.hidePrefixes=T();var A,H,P=E();if(!d.classHierarchyData.classCount&&l.getActiveRepository()&&!l.isSystemRepository()){e.loader=!0,e.hierarchyError=!1;const t=p.get("classHierarchy-selectedGraph-"+l.getActiveRepository());n.getClassHierarchyData(null!==t?t.contextID.uri:"").success((function(t,n,r){e.loader=!1,207===n&&u.warning(v.instant("graphexplore.update.diagram"),v.instant("graphexplore.repository.data.changed")),d.classHierarchyData=t,d3.select("#download-svg").on("mouseover",R)})).error((function(t){e.loader=!1,e.hierarchyError=getError(t),u.error(v.instant("graphexplore.error.request.failed",{name:h,error:getError(t)}))}))}var I,b,k,L,N,D,F,z={};function O(n,o,l,u){b&&b(),k&&k(),d3.selectAll("#main-group").remove(),P=E(),a.a.SingleChild.addPlaceholders(n,!0),(x=d3.hierarchy(n)).sum((function(e){return e.size})),I=l||x,w(x);var p,y=x.descendants();I.isInFocusTransitive=!0,a.a.SingleChild.removePlaceholders(y),a.a.SingleChild.centerNodes(y),a.a.SingleChild.makePositionsRelativeToZero(y),m||(m=Object(r.a)().attr("class","d3-tip").customPosition((function(e,t){return{top:"inherit",bottom:s.innerHeight-t.clientY+"px",right:s.innerWidth-t.clientX+"px"}})).html((function(e){return e.data.name})),C.call(m));var v=P.selectAll("circle").data(y).enter().append("g");o.doFade&&v.each((function(e){i.a.Transition.fadeIn(d3.select(this),550)}));var g,T=[],R=v.append("circle").attr("class",(function(e){return e.data.role})).attr("guide-selector",(function(e){return"class-"+e.data.name})).style("fill",(function(e){return e.children?S(e.depth):"#E0D0D0"})).each((function(e){if(e.circle=d3.select(this),e.data.name!==h){var t=e.data.name;T.push({name:t}),z[[t]]=e,e.circle.classed("rdf-class",!0),e.circle.on("mouseover",(function(t){o.noPrefixes||e.textHidden?m.show(e,t):m.hide(e)})),e.circle.on("mouseout",m.hide)}})).on("gdb-focus",(e,t)=>H(t)).on("gdb-zoom",(e,t)=>W(t));function L(e){d3.selectAll(".selected").classed("selected",e.selected=!1),e.circle.classed("selected",e.selected=!0),g=e}function N(){d.showClassInfoPanel=!1}T&&(T=_.uniqBy(T,"name"),d.flattenedClassNames=T);var D=i.a.Click.delayDblClick();d3.selectAll(".parent, .topLevelParent, .child, .root").call(D),H=function(e){W(e),e.data.name===h?(N(),d3.selectAll(".selected").classed("selected",!1)):(L(e),d.selectedClass=g,d.showClassInfoPanel=!0,d.$on("sidePanelClosed",(function(t){d3.selectAll(".selected").classed("selected",e.selected=!1)})))},D.on("click",(function(e,t){t.data.id&&s.history.pushState({id:t.data.id},"classHierarchyPage"+t.data.id,"hierarchy#"+t.data.id),m.hide(),H(t)})),D.on("dblclick",(function(t,r){r!==n&&(m.hide(),L(r),e.$broadcast("goToDomainRangeGraphView",g,I),t.stopPropagation())}));var F=0;C.on("wheel",(function(e){m.hide(),e.preventDefault(),e.stopPropagation();var t=(new Date).getTime();if(t-F>100){F=t;var n="";e.deltaY<=-1?n="in":e.deltaY>=1&&(n="out");var r=e.target.__data__;if(r||(r=I),"in"===n){if(r!==I){for(;r.parent&&!r.parent.isInFocusTransitive;)r=r.parent;r.depth<I.depth&&(r=I)}if(r===I&&r.children){for(var a=r.children[0],i=1;i<r.children.length;i++)r.children[i].sortingRank>a.sortingRank&&(a=r.children[i]);a.children&&(r=a)}else r.children||(r=r.parent);W(r,!0)}else"out"===n&&(r=I.parent)&&W(r,!0);I.data.name===h&&s.history.replaceState({id:1},"classHierarchyPage1","hierarchy#1"),U()}}));var $=P.selectAll("text").data(y).enter().append("text").attr("class",(function(e){return e.children&&e.children.length?"label":"label child-label"})).each((function(e){e.textSel=d3.select(this)}));o.noPrefixes?($.each((function(e){var t=e.data.name.indexOf(":");e.data.name.indexOf("http://")>-1?e.noPrefixName=e.data.name:t>-1&&(e.noPrefixName=e.data.name.substring(t+1))})),$.style("font-size",(function(e){return i.a.Text.calcFontSize(e.noPrefixName,e.r)})).text((function(e){return i.a.Text.getTextWithElipsisIfNeeded(e.noPrefixName,e.r/3)}))):$.style("font-size",(function(e){return i.a.Text.calcFontSize(e.data.name,e.r)})).text((function(e){return i.a.Text.getTextWithElipsisIfNeeded(e.data.name,e.r/3)})),$.style("display",(function(e){return e.parent&&e.parent.data===I.data?(e.textHidden=this.textContent.indexOf("...")+3===this.textContent.length,null):(e.textHidden=!0,"none")})),o.doFade&&!o.keepPrevState&&$.each((function(e){i.a.Transition.fadeIn(d3.select(this),550)})),A=function(){function e(e){e&&R.each((function(t){+e===t.data.id&&H(t)}))}var n=t.hash();s.onpopstate=function(t){t.state&&e(t.state.id)},e(n)};var O=P.selectAll("circle, text");function M(e,t){var n=800/e[2];p=e,O.attr("transform",(function(t){return"translate("+(t.x-e[0])*n+","+(t.y-e[1])*n+")"})),R.attr("r",(function(e){return e.r*n})),t&&$.each((function(e){e.data.fullName!==I.data.topLevelParentUri&&I.data.topLevelParentUri!==h||(e.textSel.style("display","none"),I.children&&I.children.length?_.each(I.children,(function(e){e.textSel.style("display","inline")})):I.textSel.style("display","inline"),I.parent&&_.each(I.parent.children,(function(e){e.data.name!==I.data.name&&e.textSel.style("display","inline")})))})),$.style("font-size",(function(e){return o.noPrefixes?i.a.Text.calcFontSize(e.noPrefixName,e.r*n):i.a.Text.calcFontSize(e.data.name,e.r*n)})).text((function(e){return o.noPrefixes?i.a.Text.getTextWithElipsisIfNeeded(e.noPrefixName,e.r*n/3):i.a.Text.getTextWithElipsisIfNeeded(e.data.name,e.r*n/3)}))}function V(e){var t=2*e+20;return 2*e/t<.3&&(t=2*e+2),t}function B(e){!e.isInFocusTransitive&&e.parent&&e.parent.isInFocusTransitive?(e.textHidden=this.textContent.indexOf("...")+3===this.textContent.length,this.style.display=""):(e.textHidden=!0,this.style.display="none")}function W(e,t){if(c((function(){d.showExternalElements=e.data.name===h})),I!==e&&(e.data.id&&s.history.replaceState({id:e.data.id},"classHierarchyPage"+e.data.id,"hierarchy#"+e.data.id),e.children||(e=e.parent,I!==e))){if(t&&(N(),d3.selectAll(".selected").classed("selected",!1)),I.parent)for(var n=I;n;)n.isInFocusTransitive=!1,n=n.parent;for(n=e;n;)n.isInFocusTransitive=!!n.children,n=n.parent;if(2*(I=e).r/(2*I.r+20)<.3||d.currentSliderValue>d.currentBrowserLimit)M([I.x,I.y,V(I.r)]),$.each((function(e){B.call(this,e)}));else d3.transition().duration(f).tween("zoom",(function(e){var t=d3.interpolateZoom(p,[I.x,I.y,V(I.r)]);return function(e){M(t(e))}})).selectAll("text").each(B)}}M([I.x,I.y,V(I.r)],u),b=d.$on("rootFocus",(function(){s.history.pushState({id:1},"classHierarchyPage1","hierarchy#1"),H(x)})),k=d.$on("classSearch",(function(e){H(e)}))}function U(){const t=d.classHierarchyData.classCount;let n=p.get(y.CLASS_HIERARCHY_CURRENT_SLIDER_VALUE);(!n||n>t)&&(n=t,p.set(y.CLASS_HIERARCHY_CURRENT_SLIDER_VALUE,n)),e.$broadcast("classCount",t,n)}window.addEventListener("resize",U),window.addEventListener("beforeunload",(function e(){window.removeEventListener("resize",U),window.removeEventListener("beforeunload",e)})),d.$watch("classHierarchyData",(function(){L&&L(),N&&N(),D&&D(),F&&F();var e=T();if(d.classHierarchyData.classCount){U();var t=_.cloneDeep(d.classHierarchyData);var n,r,a=function(e){return e.descendants().sort((function(e,t){return e.data.sortingRank>t.data.sortingRank?-1:e.data.sortingRank<t.data.sortingRank||e.data.depth>t.data.depth?1:e.data.depth<t.data.depth?-1:0}))}(d3.hierarchy(t));function i(e,t){const a={keepPrevState:!0,noPrefixes:T()};r=a.noPrefixes,O(n||e,a,I,!0),c((function(){p.set(y.CLASS_HIERARCHY_SWITCH_PREFIXES,t),A()}),70)}function o(e,a,o){if(!e)return;p.set(y.CLASS_HIERARCHY_CURRENT_SLIDER_VALUE,e),n={name:h,children:[]};const s=new Set;for(let t=1;t<=e;t++)s.add(a[t].data.id),a[t].parent===a[0]&&n.children.push(a[t].data);if(function e(t){if(!t.children)return;const n=[];for(const e of t.children)s.has(e.id)&&n.push($.extend({},e));t.children=n;for(const n of t.children)e(n)}(n),o){r=angular.isUndefined(r)?T():r;O(n,{noPrefixes:r})}else i(t)}var s,l=p.get(y.CLASS_HIERARCHY_CURRENT_SLIDER_VALUE);if(l)o(l,a);else{var u={doFade:!0,keepPrevState:!0,noPrefixes:T()};O(t,u),A()}L=d.$watch("hidePrefixes",(function(n){angular.isUndefined(n)||e?e=void 0:c((function(){!function(e){angular.isUndefined(e)||p.set(y.CLASS_HIERARCHY_HIDE_PREFIXES,e)}(n),i(t,!0)}),50)}),!0),N=d.$watch("currentSliderValue",(function(e){o(e,a,!0)}),!0),F=d.$on("onEnterKeypressSearchAction",(function(e){s&&H(s)})),D=d.$on("searchedClass",(function(e,t){(s=z[t.name])&&H(s)}))}}),!0)}(d)}}}angular.module("graphdb.framework.graphexplore.directives.class",["graphdb.framework.graphexplore.controllers.class","graphdb.framework.utils.localstorageadapter"]).constant("ZOOM_DURATION",500).constant("ROOT_OBJ_NAME","RDF Class Hierarchy").directive("rdfClassHierarchy",s),s.$inject=["$rootScope","$location","GraphDataRestService","$window","$timeout","$repositories","$licenseService","toastr","ZOOM_DURATION","ROOT_OBJ_NAME","LocalStorageAdapter","LSKeys","$translate"]},538:function(e,t,n){var r,a;r=[n(546)],void 0===(a=function(){function e(e,t){return e.each((function(){var e=t.apply(this,arguments),n=select(this);for(var r in e)n.attr(r,e[r])}))}function t(e,t){for(var n in t)e.attr(n,t[n]);return e}return"undefined"==typeof d3&&(d3=n(546)),d3.selection.prototype.attrs=function(n){return("function"==typeof n?e:t)(this,n)},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 e=this.parentNode.firstChild;e&&this.parentNode.insertBefore(this,e)}))},d3}.apply(t,r))||(e.exports=a)},550:function(e,t,n){"use strict";n(538);var r=r||{};r.Text=function(){function e(e,t,n,r){n=n||10;var a=t/3;return"string"==typeof e?(a*=10/(e.substring(0,t/3).length+1.5),a+=1,e.match(/[\u0900-\u0DFF\u1100-\u11FF\u2E80-\u2EFF\u3000-\u9FFF]/)&&(a*=.6),a<n&&(a=n),Math.round(a)):(a<n&&(a=n),Math.round(a))}return{calcFontSizeRaw:e,calcFontSize:function(t,n,r,a){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=function(){const e=function(e,n){let r,a=1,i=arguments.length;for(;++a<i;)r=arguments[a],e[r]=t(e,n,n[r]);return e};function t(e,t,n){return function(){var r=n.apply(t,arguments);return r===t?e:r}}return{delayDblClick:function(){var t=d3.dispatch("click","dblclick");return e((function(e){var n,r=null;e.on("mousedown",(function(){n=d3.pointer(document.body),+new Date})),e.on("mouseup",(function(e,a){var i,o,s;(o=n,s=d3.pointer(document.body),Math.sqrt(Math.pow(o[0]-s[0],2),Math.pow(o[1]-s[1],2))>5)||(r?(window.clearTimeout(r),r=null,t.call("dblclick",e,e,a)):r=window.setTimeout((i=e,function(){t.call("click",i,i,a),r=null}),250))}))}),t,"on")}}}(),t.a=r},551:function(e,t,n){"use strict";n(538);var r=r||{};r.Export={getCSSRules:function(e){const t=$('link[href="'+e+'"]')[0].sheet.rules;let n="";return _.each(t,(function(e){n+=e.cssText})),n},generateBase64ImageSource:function(e){e||(e="svg");const t=d3.selectAll(e).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(t)))}},t.a=r},562:function(e,t,n){"use strict";t.a=function(){var e=function(){return"n"},t=function(){return[0,0]},n=function(){return" "},r=u(),a=null,i=null,o=null,s=null;function c(e){var t;a="svg"===(t=(t=e).node()).tagName.toLowerCase()?t:t.ownerSVGElement,i=a.createSVGPoint(),document.body.appendChild(r)}c.show=function(){var r=Array.prototype.slice.call(arguments);r[r.length-1]instanceof SVGElement&&(o=r.pop());var a,i=n.apply(this,r),u=t.apply(this,r),h=e.apply(this,r),p=f(),y=d.length,v=document.documentElement.scrollTop||document.body.scrollTop,g=document.documentElement.scrollLeft||document.body.scrollLeft,m=s.apply(this,r);for(p.html(i).style("opacity",1).style("pointer-events","all");y--;)p.classed(d[y],!1);const x=r.filter(e=>e instanceof Event);return a=l.get(h).apply(this,x),m?Object.keys(m).forEach((function(e){p.style(e,m[e])})):p.classed(h,!0).style("top",a.top+u[0]+v+"px").style("left",a.left+u[1]+g+"px"),c},c.hide=function(){return f().style("opacity",0).style("pointer-events","none"),c},c.attr=function(e,t){if(arguments.length<2&&"string"==typeof e)return f().attr(e);var n=Array.prototype.slice.call(arguments);return d3.selection.prototype.attr.apply(f(),n),c},c.style=function(e,t){if(arguments.length<2&&"string"==typeof e)return f().style(e);var n=Array.prototype.slice.call(arguments);return d3.selection.prototype.style.apply(f(),n),c},c.direction=function(t){return arguments.length?(e=null==t?t:p(t),c):e},c.offset=function(e){return arguments.length?(t=null==e?e:p(e),c):t},c.html=function(e){return arguments.length?(n=null==e?e:p(e),c):n},c.customPosition=function(e){return arguments.length?(s=null==e?e:p(e),c):s},c.destroy=function(){return r&&(f().remove(),r=null),c};var l=new Map(Object.entries({n:function(e){var t=h(e);return{top:t.n.y-r.offsetHeight,left:t.n.x-r.offsetWidth/2}},s:function(e){var t=h(e);return{top:t.s.y,left:t.s.x-r.offsetWidth/2}},e:function(e){var t=h(e);return{top:t.e.y-r.offsetHeight/2,left:t.e.x}},w:function(e){var t=h(e);return{top:t.w.y-r.offsetHeight/2,left:t.w.x-r.offsetWidth}},nw:function(e){var t=h(e);return{top:t.nw.y-r.offsetHeight,left:t.nw.x-r.offsetWidth}},ne:function(e){var t=h(e);return{top:t.ne.y-r.offsetHeight,left:t.ne.x}},sw:function(e){var t=h(e);return{top:t.sw.y,left:t.sw.x-r.offsetWidth}},se:function(e){var t=h(e);return{top:t.se.y,left:t.e.x}}})),d=l.keys();function u(){var e=d3.select(document.createElement("div"));return e.style("position","absolute").style("top",0).style("opacity",0).style("pointer-events","none").style("box-sizing","border-box"),e.node()}function f(){return null===r&&(r=u(),document.body.appendChild(r)),d3.select(r)}function h(e){for(var t=o||e.target;void 0===t.getScreenCTM&&"undefined"===t.parentNode;)t=t.parentNode;var n={},r=t.getScreenCTM(),a=t.getBBox(),s=a.width,c=a.height,l=a.x,d=a.y;return i.x=l,i.y=d,n.nw=i.matrixTransform(r),i.x+=s,n.ne=i.matrixTransform(r),i.y+=c,n.se=i.matrixTransform(r),i.x-=s,n.sw=i.matrixTransform(r),i.y-=c/2,n.w=i.matrixTransform(r),i.x+=s,n.e=i.matrixTransform(r),i.x-=s/2,i.y-=c/2,n.n=i.matrixTransform(r),i.y+=c,n.s=i.matrixTransform(r),n}function p(e){return"function"==typeof e?e:function(){return e}}return c}},587:function(e,t,n){"use strict";var r=r||{};r.SingleChild={addPlaceholders:function e(t,n){if(t.children){for(var r=0;r<t.children.length;r++)e(t.children[r]);if(1===t.children.length){var a=1.2*t.size;n&&(a=.1*t.children[0].size),t.children.push({name:"placeholder",size:a})}}},removePlaceholders:function e(t){for(var n=t.length-1;n>=0;n--){var r=t[n];"placeholder"===r.data.name?t.splice(n,1):r.children&&e(r.children)}},centerNodes:function(e){for(var t=0;t<e.length;t++){var n=e[t];if(n.children&&1===n.children.length){var r=n.x-n.children[0].x;n.children[0].x+=r,a(n.children[0],r)}}function a(e,t){if(e.children)for(var n=0;n<e.children.length;n++)e.children[n].x+=t,a(e.children[n],t)}},makePositionsRelativeToZero:function(e){for(var t=e[0].x,n=e[0].y,r=0;r<e.length;r++){var a=e[r];a.x-=t,a.y-=n}}},t.a=r}}]);
@@ -1 +1 @@
1
- (window.webpackJsonp=window.webpackJsonp||[]).push([[48,101,260,261,302],{103:function(e,i){angular.module("graphdb.framework.rest.similarity.service",[]).factory("SimilarityRestService",t),t.$inject=["$http","$repositories"];function t(e){return{getIndexes:function(i,t){if(i)return e.get("rest/similarity",{headers:{"X-GraphDB-Repository":i,"X-GraphDB-Repository-Location":t}});return e.get("rest/similarity")},getSearchQueries:function(){return e.get("rest/similarity/config")},rebuildIndex:function(e){return i("PUT",e.name,e.options,e.selectQuery,e.searchQuery,e.analogicalQuery,e.stopList,e.infer,e.sameAs,e.type)},deleteIndex:function(i){return e.delete("rest/similarity?name="+i.name)},createIndex:i,getSamples:function(){return e.get("rest/similarity/samples")},getQuery:function(i){return e.get("rest/similarity/query",{params:{name:i.indexName,options:i.indexOptions,stopList:i.indexStopList,selectQuery:i.query,infer:i.queryInference,sameAs:i.querySameAs,type:i.viewType,analyzer:i.indexAnalyzer}})},saveSearchQuery:function(i){return e({method:"put",url:"rest/similarity/search-query",data:i})}};function i(i,t,r,a,s,c,n,l,o,y,p){return e({method:i,url:"rest/similarity",noCancelOnRouteChange:!0,data:{name:t,options:r,selectQuery:a,stopList:n,infer:l,sameAs:o,type:y,analyzer:p,searchQuery:s,analogicalQuery:c}})}}},124:function(e,i,t){"use strict";t.r(i),t.d(i,"SimilaritySearchType",(function(){return r}));const r={SEARCH_TERM:"searchTerm",SEARCH_ANALOGICAL:"searchAnalogical",SEARCH_ENTITY:"searchEntity",SEARCH_ENTITY_PREDICATE:"searchEntityPredicate",SEARCH_DOCUMENT:"searchDocumentID",isSearchTermType:e=>r.SEARCH_TERM===e,isSearchAnalogicalType:e=>r.SEARCH_ANALOGICAL===e,isSearchEntityType:e=>r.SEARCH_ENTITY===e,isSearchEntityPredicateType:e=>r.SEARCH_ENTITY_PREDICATE===e,isSearchDocumentType:e=>r.SEARCH_DOCUMENT===e}},191:function(e,i,t){"use strict";t.r(i),t.d(i,"SimilarityResultType",(function(){return r}));const r={TERM_RESULT:"termResult",DOCUMENT_RESULT:"documentResult",ENTITY_RESULT:"entityResult",isResultDocumentType:e=>r.DOCUMENT_RESULT===e,isResultTermType:e=>r.TERM_RESULT===e}},192:function(e,i,t){"use strict";t.r(i),t.d(i,"SimilaritySearch",(function(){return a}));var r=t(124);class a{constructor(){this.type=r.SimilaritySearchType.SEARCH_TERM,this.predicate="",this.termOrSubject=""}isSearchAnalogicalType(){return r.SimilaritySearchType.isSearchAnalogicalType(this.type)}isSearchTermType(){return r.SimilaritySearchType.isSearchTermType(this.type)}isSearchEntityType(){return r.SimilaritySearchType.isSearchEntityType(this.type)}isSearchEntityPredicateType(){return r.SimilaritySearchType.isSearchEntityPredicateType(this.type)}isSearchDocumentType(){return r.SimilaritySearchType.isSearchDocumentType(this.type)}}},310:function(e,i,t){"use strict";t.r(i);t(23),t(47);var r=t(0),a=t(124),s=t(191),c=t(93),n=t(91),l=t(98),o=t(192),y=t(89),p=t(8);function d(e,i,t,d,u,m,S,h,T,g,R,x,I,E,b,A){const f="http://www.ontotext.com/graphdb/similarity/",v="http://www.ontotext.com/graphdb/similarity/psi/",w=v+"any";e.pluginName="similarity",e.pluginIsActive=!0,e.isLoading=!1,e.selectedSimilarityIndex=void 0,e.similarityIndexStatus=c.SimilarityIndexStatus,e.similarityIndexType=n.SimilarityIndexType,e.similaritySearchType=a.SimilaritySearchType,e.searchType=a.SimilaritySearchType.SEARCH_TERM,e.similarityResultType=s.SimilarityResultType,e.resultType=s.SimilarityResultType.TERM_RESULT,e.info=R,e.isGraphDBRepository=void 0,e.canEditRepo=e.canWriteActiveRepo(),e.loadSimilarityIndexesTimer=void 0,e.loadSimilarityIndexes=()=>{e.isGraphDBRepository&&e.pluginIsActive&&T.getIndexes().success(i=>e.similarityIndexes=Object(l.mapIndexesResponseToSimilarityIndex)(i)).error(e=>t.error(getError(e),I.instant("similarity.could.not.get.indexes.error")))},e.reloadSimilarityIndexes=()=>{e.loadSimilarityIndexes(),e.loadSimilarityIndexesTimer||(e.loadSimilarityIndexesTimer=i((function(){e.$broadcast("checkIsActive"),"false"!==$("#indexes-table").attr("aria-expanded")&&e.loadSimilarityIndexes()}),5e3))},e.goToSimilarityIndex=i=>{(i.isBuiltStatus()||i.isOutdatedStatus()||i.isRebuildingStatus())&&(e.empty=!0,e.selectedSimilarityIndex!==i&&(e.lastSearch=void 0,e.selectedSimilarityIndex=i),i.isTextType()?e.searchType=a.SimilaritySearchType.SEARCH_TERM:i.isPredicationType()&&(e.searchType=a.SimilaritySearchType.SEARCH_ENTITY),(i.isTextType()||i.isPredicationType())&&$("#indexes-table").collapse("hide"))},e.performSearch=(i,r,a,s,c)=>{e.isLoading=!0,U(a,r);const n=M(i,r,a,s,c);E.getQueryResult(d.getActiveRepository(),n,"application/x-sparqlstar-results+json, application/sparql-results+json;q=0.9, */*;q=0.8").then(e=>Y(e)).catch(e=>t.error(getError(e.data),I.instant("similarity.get.resource.error"))).finally(()=>e.isLoading=!1)},e.viewSearchQuery=()=>{let i;i=e.lastSearch.isSearchAnalogicalType()?e.selectedSimilarityIndex.analogicalQuery?e.selectedSimilarityIndex.analogicalQuery:e.searchQueries.analogical:e.selectedSimilarityIndex.searchQuery?e.selectedSimilarityIndex.searchQuery:e.searchQueries[e.selectedSimilarityIndex.type];let t=[],r="";t=i.match(/[a-zA-Z0-9-]+:<http:\/\/www.ontotext.com\/graphdb\/similarity\/instance\/>/),r=null==t?"similarity-index":t[0].substring(0,t[0].indexOf(":"));const s=i.replace("?index",r+":"+e.selectedSimilarityIndex.name).replace("?query",e.lastSearch.termOrSubject).replace("?searchType",(e.selectedSimilarityIndex.isTextType()?":":"psi:")+(e.lastSearch.isSearchEntityPredicateType()?a.SimilaritySearchType.SEARCH_ENTITY:e.lastSearch.type)).replace("?resultType",e.selectedSimilarityIndex.isTextType()?":"+e.resultType:"psi:entityResult").replace("?parameters",L(e.searchParameters?e.searchParameters:"")).replace("?psiPredicate",e.lastSearch.predicate?O(e.lastSearch.predicate):O(w)).replace("?givenSubject",O(e.analogicalSubject)).replace("?givenObject",O(e.analogicalObject)).replace("?searchSubject",O(e.searchSubject));h.open({templateUrl:"pages/viewQuery.html",controller:"ViewQueryCtrl",resolve:{query:()=>s}})},e.deleteSimilarityIndex=i=>{S.openSimpleModal({title:I.instant("common.confirm"),message:I.instant("similarity.delete.index.warning",{name:i.name}),warning:!0}).result.then((function(){T.deleteIndex(i).then(()=>e.loadSimilarityIndexes()).catch(e=>t.error(getError(e)))}))},e.viewCreateQuery=e=>{T.getQuery({indexName:e.name,indexOptions:e.options,query:e.selectQuery,indexStopList:e.stopList,queryInference:e.infer,querySameAs:e.sameAs,viewType:e.type,indexAnalyzer:e.analyzer}).success(e=>{h.open({templateUrl:"pages/viewQuery.html",controller:"ViewQueryCtrl",resolve:{query:()=>e}})})},e.rebuildIndex=i=>{i.searchQuery||(i.searchQuery=i.type?e.searchQueries[i.type]:e.searchQueries.text),S.openSimpleModal({title:I.instant("common.confirm"),message:Object(r.decodeHTML)(I.instant("similarity.rebuild.index.warning",{name:i.name})),warning:!0}).result.then(()=>{i.status=c.SimilarityIndexStatus.REBUILDING,T.rebuildIndex(i).catch(e=>t.error(getError(e)))})},e.setPluginIsActive=i=>{e.pluginIsActive=i},e.encodeURIComponent=e=>encodeURIComponent(e),e.copyToClipboardResult=e=>{S.openCopyToClipboardModal(e)},e.trimIRI=e=>_.trim(e,"<>"),e.updateSearchType=i=>{e.searchType=i},e.updateResultType=i=>{e.resultType=i},e.editSimilarityIndex=e=>{Q(e)},e.cloneSimilataryIndex=e=>{Q(e,!0)},e.setPsiSubject=i=>{e.psiSubject=i},e.setAnalogicalSubject=i=>{e.analogicalSubject=i},e.setAnalogicalObject=i=>{e.analogicalObject=i};const Q=(e,i=!1)=>{const t={selectQuery:e.selectQuery,options:e.options,name:e.name,editSearchQuery:!i,infer:e.infer,sameAs:e.sameAs,stopList:e.stopList,type:e.type,analyzer:e.analyzer,searchQuery:e.searchQuery?e.searchQuery:"",analogicalQuery:e.analogicalQuery?e.analogicalQuery:""};m.path("similarity/index/create").search(t)},C=()=>{const i=e.getActiveRepository();i&&e.activeRepository!==i&&(e.canEditRepo=e.canWriteActiveRepo(),e.activeRepository=i,e.isGraphDBRepository=N(),e.isGraphDBRepository&&(u.isLicenseValid()&&e.reloadSimilarityIndexes(),j()))},j=()=>{T.getSearchQueries().success(i=>e.searchQueries=i).error(e=>t.error(getError(e),I.instant("similarity.could.not.get.search.queries.error")))},L=e=>'"'+e+'"',O=e=>void 0===e||e.startsWith("<<")&&e.endsWith(">>")?e:"<"+e+">",N=()=>e.getActiveRepository()&&!e.isActiveRepoOntopType()&&!e.isActiveRepoFedXType(),D=[];D.push(e.$on("repositoryIsSet",C));e.$on("$destroy",()=>{P(),e.loadSimilarityIndexesTimer&&i.cancel(e.loadSimilarityIndexesTimer)});const P=()=>{D.forEach(e=>e())};D.push(b.onAutocompleteEnabledUpdated(i=>{e.isAutocompleteEnabled=i})),D.push(b.onSelectedRepositoryIdUpdated(i=>{i?A.getNamespaces(i).then(i=>{e.repositoryNamespaces=i}).catch(e=>{const i=getError(e);t.error(i,I.instant("error.getting.namespaces.for.repo"))}):e.repositoryNamespaces=new p.NamespacesListModel}));D.push(e.$watch("searchType",()=>{e.empty=!0}));const q=e.$watch(e.getActiveRepositoryObject,e=>{e&&(C(),q())}),M=(i,t,r,c,n)=>{const l={query:H(e.lastSearch.type),$index:O("http://www.ontotext.com/graphdb/similarity/instance/"+i.name),$query:e.lastSearch.termOrSubject,$searchType:O((e.selectedSimilarityIndex.isTextType()?f:v)+(a.SimilaritySearchType.isSearchEntityPredicateType(r)?a.SimilaritySearchType.SEARCH_ENTITY:r)),$resultType:O(e.selectedSimilarityIndex.isTextType()?f+c:v+s.SimilarityResultType.ENTITY_RESULT),$parameters:L(n)};return a.SimilaritySearchType.isSearchEntityPredicateType(r)&&(l.$psiPredicate=e.lastSearch.predicate?O(e.lastSearch.predicate):O(w)),a.SimilaritySearchType.isSearchAnalogicalType(r)&&(e.searchSubject=t,l.$givenSubject=O(e.analogicalSubject),l.$givenObject=O(e.analogicalObject),l.$searchSubject=O(t)),l},U=(i,t)=>{e.lastSearch=new o.SimilaritySearch,e.lastSearch.type=i,a.SimilaritySearchType.isSearchEntityPredicateType(i)&&(e.lastSearch.predicate=t),e.lastSearch.termOrSubject=k(e.lastSearch.type,t,e.psiSubject)},H=i=>{let t;return t=a.SimilaritySearchType.isSearchAnalogicalType(i)?e.selectedSimilarityIndex.analogicalQuery?e.selectedSimilarityIndex.analogicalQuery:e.searchQueries.analogical:e.selectedSimilarityIndex.searchQuery?e.selectedSimilarityIndex.searchQuery:e.searchQueries[e.selectedSimilarityIndex.type],t},k=(e,i,t)=>{let r=i;return r=a.SimilaritySearchType.isSearchEntityPredicateType(e)?t:a.SimilaritySearchType.isSearchTermType(e)?L(r):O(r),r},Y=i=>{e.yasguiConfig={showEditorTabs:!1,showToolbar:!1,showResultTabs:!1,showQueryButton:!1,downloadAsOn:!1,showResultInfo:!1,componentId:"similarity-list-component",maxPersistentResponseSize:0,render:y.RenderingMode.YASR,sparqlResponse:i.data}}}angular.module("graphdb.framework.similarity.controllers.list",["graphdb.core.services.workbench-context","graphdb.framework.core.services.rdf4j.repositories"]).controller("SimilarityCtrl",d),d.$inject=["$scope","$interval","toastr","$repositories","$licenseService","$location","ModalService","$uibModal","SimilarityRestService","AutocompleteRestService","productInfo","RDF4JRepositoriesRestService","$translate","SparqlRestService","WorkbenchContextService","RDF4JRepositoriesService"]},397:function(e,i,t){"use strict";t.r(i);t(9),t(40),t(46),t(103),t(310),t(321),t(140);angular.module("graphdb.framework.similarity",["graphdb.framework.core.controllers","graphdb.framework.core.directives","graphdb.framework.rest.similarity.service","graphdb.framework.similarity.controllers.create","graphdb.framework.similarity.controllers.list","graphdb.framework.core.directives.yasgui-component"])}}]);
1
+ (window.webpackJsonp=window.webpackJsonp||[]).push([[48,101,260,261,302],{103:function(e,i){angular.module("graphdb.framework.rest.similarity.service",[]).factory("SimilarityRestService",t),t.$inject=["$http","$repositories"];function t(e){return{getIndexes:function(i,t){if(i)return e.get("rest/similarity",{headers:{"X-GraphDB-Repository":i,"X-GraphDB-Repository-Location":t}});return e.get("rest/similarity")},getSearchQueries:function(){return e.get("rest/similarity/config")},rebuildIndex:function(e){return i("PUT",e.name,e.options,e.selectQuery,e.searchQuery,e.analogicalQuery,e.stopList,e.infer,e.sameAs,e.type)},deleteIndex:function(i){return e.delete("rest/similarity?name="+i.name)},createIndex:i,getSamples:function(){return e.get("rest/similarity/samples")},getQuery:function(i){return e.get("rest/similarity/query",{params:{name:i.indexName,options:i.indexOptions,stopList:i.indexStopList,selectQuery:i.query,infer:i.queryInference,sameAs:i.querySameAs,type:i.viewType,analyzer:i.indexAnalyzer}})},saveSearchQuery:function(i){return e({method:"put",url:"rest/similarity/search-query",data:i})}};function i(i,t,r,a,s,c,n,l,o,y,p){return e({method:i,url:"rest/similarity",noCancelOnRouteChange:!0,data:{name:t,options:r,selectQuery:a,stopList:n,infer:l,sameAs:o,type:y,analyzer:p,searchQuery:s,analogicalQuery:c}})}}},124:function(e,i,t){"use strict";t.r(i),t.d(i,"SimilaritySearchType",(function(){return r}));const r={SEARCH_TERM:"searchTerm",SEARCH_ANALOGICAL:"searchAnalogical",SEARCH_ENTITY:"searchEntity",SEARCH_ENTITY_PREDICATE:"searchEntityPredicate",SEARCH_DOCUMENT:"searchDocumentID",isSearchTermType:e=>r.SEARCH_TERM===e,isSearchAnalogicalType:e=>r.SEARCH_ANALOGICAL===e,isSearchEntityType:e=>r.SEARCH_ENTITY===e,isSearchEntityPredicateType:e=>r.SEARCH_ENTITY_PREDICATE===e,isSearchDocumentType:e=>r.SEARCH_DOCUMENT===e}},191:function(e,i,t){"use strict";t.r(i),t.d(i,"SimilarityResultType",(function(){return r}));const r={TERM_RESULT:"termResult",DOCUMENT_RESULT:"documentResult",ENTITY_RESULT:"entityResult",isResultDocumentType:e=>r.DOCUMENT_RESULT===e,isResultTermType:e=>r.TERM_RESULT===e}},192:function(e,i,t){"use strict";t.r(i),t.d(i,"SimilaritySearch",(function(){return a}));var r=t(124);class a{constructor(){this.type=r.SimilaritySearchType.SEARCH_TERM,this.predicate="",this.termOrSubject=""}isSearchAnalogicalType(){return r.SimilaritySearchType.isSearchAnalogicalType(this.type)}isSearchTermType(){return r.SimilaritySearchType.isSearchTermType(this.type)}isSearchEntityType(){return r.SimilaritySearchType.isSearchEntityType(this.type)}isSearchEntityPredicateType(){return r.SimilaritySearchType.isSearchEntityPredicateType(this.type)}isSearchDocumentType(){return r.SimilaritySearchType.isSearchDocumentType(this.type)}}},310:function(e,i,t){"use strict";t.r(i);t(23),t(47);var r=t(0),a=t(124),s=t(191),c=t(93),n=t(91),l=t(98),o=t(192),y=t(89),p=t(8);function d(e,i,t,d,u,m,S,h,T,g,R,x,I,E,b,A){const f="http://www.ontotext.com/graphdb/similarity/",v="http://www.ontotext.com/graphdb/similarity/psi/",w=v+"any";e.pluginName="similarity",e.pluginIsActive=!0,e.isLoading=!1,e.selectedSimilarityIndex=void 0,e.similarityIndexStatus=c.SimilarityIndexStatus,e.similarityIndexType=n.SimilarityIndexType,e.similaritySearchType=a.SimilaritySearchType,e.searchType=a.SimilaritySearchType.SEARCH_TERM,e.similarityResultType=s.SimilarityResultType,e.resultType=s.SimilarityResultType.TERM_RESULT,e.info=R,e.isGraphDBRepository=void 0,e.canEditRepo=e.canWriteActiveRepo(),e.loadSimilarityIndexesTimer=void 0,e.loadSimilarityIndexes=()=>{e.isGraphDBRepository&&e.pluginIsActive&&T.getIndexes().success(i=>e.similarityIndexes=Object(l.mapIndexesResponseToSimilarityIndex)(i)).error(e=>t.error(getError(e),I.instant("similarity.could.not.get.indexes.error")))},e.reloadSimilarityIndexes=()=>{e.loadSimilarityIndexes(),e.loadSimilarityIndexesTimer||(e.loadSimilarityIndexesTimer=i((function(){e.$broadcast("checkIsActive"),"false"!==$("#indexes-table").attr("aria-expanded")&&e.loadSimilarityIndexes()}),5e3))},e.goToSimilarityIndex=i=>{(i.isBuiltStatus()||i.isOutdatedStatus()||i.isRebuildingStatus())&&(e.empty=!0,e.selectedSimilarityIndex!==i&&(e.lastSearch=void 0,e.selectedSimilarityIndex=i),i.isTextType()?e.searchType=a.SimilaritySearchType.SEARCH_TERM:i.isPredicationType()&&(e.searchType=a.SimilaritySearchType.SEARCH_ENTITY),(i.isTextType()||i.isPredicationType())&&$("#indexes-table").collapse("hide"))},e.performSearch=(i,r,a,s,c)=>{e.isLoading=!0,U(a,r);const n=M(i,r,a,s,c);E.getQueryResult(d.getActiveRepository(),n,"application/x-sparqlstar-results+json, application/sparql-results+json;q=0.9, */*;q=0.8").then(e=>Y(e)).catch(e=>t.error(getError(e.data),I.instant("similarity.get.resource.error"))).finally(()=>e.isLoading=!1)},e.viewSearchQuery=()=>{let i;i=e.lastSearch.isSearchAnalogicalType()?e.selectedSimilarityIndex.analogicalQuery?e.selectedSimilarityIndex.analogicalQuery:e.searchQueries.analogical:e.selectedSimilarityIndex.searchQuery?e.selectedSimilarityIndex.searchQuery:e.searchQueries[e.selectedSimilarityIndex.type];let t=[],r="";t=i.match(/[a-zA-Z0-9-]+:<http:\/\/www.ontotext.com\/graphdb\/similarity\/instance\/>/),r=null==t?"similarity-index":t[0].substring(0,t[0].indexOf(":"));const s=i.replace("?index",r+":"+e.selectedSimilarityIndex.name).replace("?query",e.lastSearch.termOrSubject).replace("?searchType",(e.selectedSimilarityIndex.isTextType()?":":"psi:")+(e.lastSearch.isSearchEntityPredicateType()?a.SimilaritySearchType.SEARCH_ENTITY:e.lastSearch.type)).replace("?resultType",e.selectedSimilarityIndex.isTextType()?":"+e.resultType:"psi:entityResult").replace("?parameters",L(e.searchParameters?e.searchParameters:"")).replace("?psiPredicate",e.lastSearch.predicate?O(e.lastSearch.predicate):O(w)).replace("?givenSubject",O(e.analogicalSubject)).replace("?givenObject",O(e.analogicalObject)).replace("?searchSubject",O(e.searchSubject));h.open({templateUrl:"pages/viewQuery.html",controller:"ViewQueryCtrl",resolve:{query:()=>s}})},e.deleteSimilarityIndex=i=>{S.openSimpleModal({title:I.instant("common.confirm"),message:I.instant("similarity.delete.index.warning",{name:i.name}),warning:!0}).result.then((function(){T.deleteIndex(i).then(()=>e.loadSimilarityIndexes()).catch(e=>t.error(getError(e)))}))},e.viewCreateQuery=e=>{T.getQuery({indexName:e.name,indexOptions:e.options,query:e.selectQuery,indexStopList:e.stopList,queryInference:e.infer,querySameAs:e.sameAs,viewType:e.type,indexAnalyzer:e.analyzer}).success(e=>{h.open({templateUrl:"pages/viewQuery.html",controller:"ViewQueryCtrl",resolve:{query:()=>e}})})},e.rebuildIndex=i=>{i.searchQuery||(i.searchQuery=i.type?e.searchQueries[i.type]:e.searchQueries.text),S.openSimpleModal({title:I.instant("common.confirm"),message:Object(r.decodeHTML)(I.instant("similarity.rebuild.index.warning",{name:i.name})),warning:!0}).result.then(()=>{i.status=c.SimilarityIndexStatus.REBUILDING,T.rebuildIndex(i).catch(e=>t.error(getError(e)))})},e.setPluginIsActive=i=>{e.pluginIsActive=i},e.encodeURIComponent=e=>encodeURIComponent(e),e.copyToClipboardResult=e=>{S.openCopyToClipboardModal(e)},e.trimIRI=e=>_.trim(e,"<>"),e.updateSearchType=i=>{e.searchType=i},e.updateResultType=i=>{e.resultType=i},e.editSimilarityIndex=e=>{Q(e)},e.cloneSimilataryIndex=e=>{Q(e,!0)},e.setPsiSubject=i=>{e.psiSubject=i},e.setAnalogicalSubject=i=>{e.analogicalSubject=i},e.setAnalogicalObject=i=>{e.analogicalObject=i};const Q=(e,i=!1)=>{const t={selectQuery:e.selectQuery,options:e.options,name:e.name,editSearchQuery:!i,infer:e.infer,sameAs:e.sameAs,stopList:e.stopList,type:e.type,analyzer:e.analyzer,searchQuery:e.searchQuery?e.searchQuery:"",analogicalQuery:e.analogicalQuery?e.analogicalQuery:""};m.path("similarity/index/create").search(t)},C=()=>{const i=e.getActiveRepository();i&&e.activeRepository!==i&&(e.canEditRepo=e.canWriteActiveRepo(),e.activeRepository=i,e.isGraphDBRepository=N(),e.isGraphDBRepository&&(u.isLicenseValid()&&e.reloadSimilarityIndexes(),j()))},j=()=>{T.getSearchQueries().success(i=>e.searchQueries=i).error(e=>t.error(getError(e),I.instant("similarity.could.not.get.search.queries.error")))},L=e=>'"'+e+'"',O=e=>void 0===e||e.startsWith("<<")&&e.endsWith(">>")?e:"<"+e+">",N=()=>e.getActiveRepository()&&!e.isActiveRepoOntopType()&&!e.isActiveRepoFedXType(),D=[];D.push(e.$on("repositoryIsSet",C));e.$on("$destroy",()=>{P(),e.loadSimilarityIndexesTimer&&i.cancel(e.loadSimilarityIndexesTimer)});const P=()=>{D.forEach(e=>e())};D.push(b.onAutocompleteEnabledUpdated(i=>{e.isAutocompleteEnabled=i})),D.push(b.onSelectedRepositoryIdUpdated(i=>{i?A.getNamespaces(i).then(i=>{e.repositoryNamespaces=i}).catch(e=>{const i=getError(e);t.error(i,I.instant("error.getting.namespaces.for.repo"))}):e.repositoryNamespaces=new p.NamespacesListModel}));D.push(e.$watch("searchType",()=>{e.empty=!0}));const q=e.$watch(e.getActiveRepositoryObject,e=>{e&&(C(),q())}),M=(i,t,r,c,n)=>{const l={query:H(e.lastSearch.type),$index:O("http://www.ontotext.com/graphdb/similarity/instance/"+i.name),$query:e.lastSearch.termOrSubject,$searchType:O((e.selectedSimilarityIndex.isTextType()?f:v)+(a.SimilaritySearchType.isSearchEntityPredicateType(r)?a.SimilaritySearchType.SEARCH_ENTITY:r)),$resultType:O(e.selectedSimilarityIndex.isTextType()?f+c:v+s.SimilarityResultType.ENTITY_RESULT),$parameters:L(n)};return a.SimilaritySearchType.isSearchEntityPredicateType(r)&&(l.$psiPredicate=e.lastSearch.predicate?O(e.lastSearch.predicate):O(w)),a.SimilaritySearchType.isSearchAnalogicalType(r)&&(e.searchSubject=t,l.$givenSubject=O(e.analogicalSubject),l.$givenObject=O(e.analogicalObject),l.$searchSubject=O(t)),l},U=(i,t)=>{e.lastSearch=new o.SimilaritySearch,e.lastSearch.type=i,a.SimilaritySearchType.isSearchEntityPredicateType(i)&&(e.lastSearch.predicate=t),e.lastSearch.termOrSubject=k(e.lastSearch.type,t,e.psiSubject)},H=i=>{let t;return t=a.SimilaritySearchType.isSearchAnalogicalType(i)?e.selectedSimilarityIndex.analogicalQuery?e.selectedSimilarityIndex.analogicalQuery:e.searchQueries.analogical:e.selectedSimilarityIndex.searchQuery?e.selectedSimilarityIndex.searchQuery:e.searchQueries[e.selectedSimilarityIndex.type],t},k=(e,i,t)=>{let r=i;return a.SimilaritySearchType.isSearchEntityPredicateType(e)&&(r=t),r=a.SimilaritySearchType.isSearchTermType(e)?L(r):O(r),r},Y=i=>{e.yasguiConfig={showEditorTabs:!1,showToolbar:!1,showResultTabs:!1,showQueryButton:!1,downloadAsOn:!1,showResultInfo:!1,componentId:"similarity-list-component",maxPersistentResponseSize:0,render:y.RenderingMode.YASR,sparqlResponse:i.data}}}angular.module("graphdb.framework.similarity.controllers.list",["graphdb.core.services.workbench-context","graphdb.framework.core.services.rdf4j.repositories"]).controller("SimilarityCtrl",d),d.$inject=["$scope","$interval","toastr","$repositories","$licenseService","$location","ModalService","$uibModal","SimilarityRestService","AutocompleteRestService","productInfo","RDF4JRepositoriesRestService","$translate","SparqlRestService","WorkbenchContextService","RDF4JRepositoriesService"]},397:function(e,i,t){"use strict";t.r(i);t(9),t(40),t(46),t(103),t(310),t(321),t(140);angular.module("graphdb.framework.similarity",["graphdb.framework.core.controllers","graphdb.framework.core.directives","graphdb.framework.rest.similarity.service","graphdb.framework.similarity.controllers.create","graphdb.framework.similarity.controllers.list","graphdb.framework.core.directives.yasgui-component"])}}]);
@@ -0,0 +1 @@
1
+ (window.webpackJsonp=window.webpackJsonp||[]).push([[58,146,276,277],{118:function(e,a){angular.module("graphdb.framework.core.directives.paginations",[]).directive("paginations",["$translate","$rootScope","$compile",function(e,a,n){return{link:function(e,t){const s=()=>{const a=n('<uib-pagination class="nav navbar-right" total-items="matchedElements.length" items-per-page="pageSize" ng-model="page" ng-change="changePagination()" direction-links="false" boundary-links="true" max-size="5" rotate="true" first-text="{{\'paginator.first.page.label\' | translate}}" last-text="{{\'paginator.last.page.label\' | translate}}"></uib-pagination>')(e);t.html(a)};s();const r=a.$on("$translateChangeSuccess",s);e.$on("$destroy",r)}}}])},299:function(e,a,n){"use strict";n.r(a);n(9),n(42),n(41),n(49);const t=angular.module("graphdb.framework.namespaces.controllers",["ui.bootstrap","graphdb.framework.core.services.repositories","graphdb.framework.core.services.jwtauth","graphdb.framework.rest.repositories.service","graphdb.framework.rest.rdf4j.repositories.service","toastr"]),s=function(){const e="[A-Z]|[a-z]|[À-Ö]|[Ø-ö]|[ø-˿]|[Ͱ-ͽ]|[Ϳ-῿]|[‌-‍]|[⁰-↏]|[Ⰰ-⿯]|[、-퟿]|[豈-﷏]|[ﷰ-�]",a="[A-Z]|[a-z]|[À-Ö]|[Ø-ö]|[ø-˿]|[Ͱ-ͽ]|[Ϳ-῿]|[‌-‍]|[⁰-↏]|[Ⰰ-⿯]|[、-퟿]|[豈-﷏]|[ﷰ-�]|_|-|[0-9]|·|[̀-ͯ]|[‿-⁀]";return new RegExp("^(?:"+e+")(?:(?:"+a+"|\\.)*(?:"+a+"))?$")}();t.controller("NamespacesCtrl",["$scope","$http","$repositories","toastr","$uibModal","ModalService","RepositoriesRestService","RDF4JRepositoriesRestService","$translate",function(e,a,n,t,r,c,i,o,p){e.namespaces={},e.namespace={},e.loader=!1,e.haveSelected=!1,e.pageSizeOptions=[10,20,50,100],e.page=1,e.pageSize=e.pageSizeOptions[0],e.displayedNamespaces=[],e.getNamespaces=function(){n.getActiveRepository()&&(e.loader=!0,e.namespaces={},o.getNamespaces(n.getActiveRepository()).success((function(a){e.namespaces=a.results.bindings.map((function(e){return{prefix:e.prefix.value,namespace:e.namespace.value}})),e.namespaces.length>0&&(e.namespaces.sort((function(e,a){const n=e.prefix.toUpperCase(),t=a.prefix.toUpperCase();return n<t?-1:n>t?1:0})),e.matchedElements=e.namespaces,e.changePagination()),0===e.namespaces.length&&(e.loader=!1)})).error((function(a){const n=getError(a);t.error(n),e.loader=!1})))},e.changePagination=function(){angular.isDefined(e.namespaces)&&(e.displayedNamespaces=e.namespaces.slice(e.pageSize*(e.page-1),e.pageSize*e.page))},e.changePageSize=function(a){$(".ot-graph-page-size").removeClass("active"),e.page=1,e.searchNamespaces="",a&&(e.getNamespaces(),e.pageSize=a)},e.$watch("matchedElements",(function(){angular.isDefined(e.matchedElements)&&(e.displayedNamespaces=e.matchedElements.slice(e.pageSize*(e.page-1),e.pageSize*e.page))})),e.$watch((function(){return n.getActiveRepository()}),(function(){e.searchNamespaces="",e.getNamespaces(),e.selectedAll=!1})),e.onNamespaceSearch=function(){e.haveSelected=!1,e.selectedAll=!1,e.matchedElements=[],g(),l()};const l=function(){angular.forEach(e.namespaces,(function(a){-1===a.namespace.indexOf(e.searchNamespaces)&&-1===a.prefix.indexOf(e.searchNamespaces)||e.matchedElements.push(a)}))};e.saveNamespace=function(a,s){return e.loader=!0,o.updateNamespacePrefix(n.getActiveRepository(),s,a).then((function(){e.getNamespaces(),t.success(p.instant("namespace.saved")),e.loader=!1})).catch((function(a){const n=getError(a);return t.error(n,p.instant("common.error")),e.loader=!1,Promise.reject(a)}))},e.editPrefix=function(a,s){e.loader=!0,i.getPrefix(n.getActiveRepository(),{from:a,to:s,location:n.getActiveRepositoryObject().location}).success((function(){e.getNamespaces(),e.loader=!1})).error((function(a){const n=getError(a);t.error(n,p.instant("common.error")),e.loader=!1}))};e.editPrefixAndNamespace=async(e,a,n)=>{try{const t=a;let s=e;if(e||(s=""),!h(s,t))return"Prefix or namespace is invalid";const r=n.prefix;return m(s,r)&&await c.openSimpleModal({title:p.instant("namespace.confirm.replace"),message:p.instant("namespace.already.exists.msg"),warning:!0}).result,d(s,r,t)}catch(e){return"Prefix overwrite cancelled"}};const m=(a,n)=>!!e.namespaces.find(e=>e.prefix===a&&n!==a),d=(a,n,t)=>e.saveNamespace(n,t).then((function(){n!==a&&e.editPrefix(n,a)}));e.addNamespace=function(){if(e.namespace.prefix||(e.namespace.prefix=""),!h(e.namespace.prefix,e.namespace.namespace))return;e.selectedAll=!1;let a=!1;for(let n=0;n<e.namespaces.length;n++)e.namespaces[n].prefix===e.namespace.prefix&&(a=!0);a?c.openSimpleModal({title:p.instant("namespace.confirm.replace"),message:p.instant("namespace.already.exists.msg"),warning:!0}).result.then(f):f()};const f=()=>{e.saveNamespace(e.namespace.prefix,e.namespace.namespace).then(()=>{e.namespace.namespace="",e.namespace.prefix="",setTimeout(()=>{e.form.$setUntouched(),e.form.$setPristine()})}).catch(()=>{})};e.removeNamespace=function(e){c.openSimpleModal({title:p.instant("common.confirm.delete"),message:p.instant("namespace.warning.delete.msg",{prefix:e.prefix}),warning:!0}).result.then((function(){u(e)}))},e.checkAll=function(){angular.forEach(e.displayedNamespaces,(function(a){a.selected=e.selectedAll}))},e.deleteSelected=function(){let a=!1;angular.forEach(e.displayedNamespaces,(function(n){a||n.selected&&(a=!0,c.openSimpleModal({title:p.instant("common.confirm.delete"),message:p.instant("namespace.warning.delete.selected"),warning:!0}).result.then((function(){e.loader=!0;const a=[];angular.forEach(e.displayedNamespaces,(function(e){e.selected&&a.push(e)})),u(a.shift(),a),e.selectedAll=!1}),(function(){e.getNamespaces(),e.selectedAll=!1,e.searchNamespaces=""})))}))};const u=(a,s)=>{let r;r="object"==typeof a?a.prefix:a,o.deleteNamespacePrefix(n.getActiveRepository(),r).success((function(){s&&s.length>0?(a=s.shift(),u(a,s)):(e.selectedAll=!1,e.namespace={},e.getNamespaces(),e.searchNamespaces="",e.haveSelected=!1,e.loader=!1,e.displayedNamespaces=[],void 0===s?t.success(p.instant("namespace.prefix.deleted.successfully",{prefix:r}),""):t.success(p.instant("namespace.selected.namespaces.deleted.successfully"),""))})).error((function(a){const n=getError(a);t.error(n,p.instant("common.error")),e.loader=!1}))};e.checkIfSelectedNamespace=function(){e.haveSelected=!1,angular.forEach(e.namespaces,(function(a){a.selected&&(e.haveSelected=!0)}))};const g=function(){angular.forEach(e.namespaces,(function(e){e.selected=!1}))},h=(e,a)=>function(e){return""===e||e.match(s)}(e)?!angular.isUndefined(a)&&""!==a||(t.error(p.instant("namespace.warning.provide.namespace"),p.instant("common.error")),!1):(t.error(p.instant("namespace.invalid.prefix",{prefix:e},p.instant("common.error"))),!1)}]),t.controller("StandartModalCtrl",["$scope","$uibModalInstance",function(e,a){e.ok=function(){a.close(!0)},e.cancel=function(){a.dismiss("cancel")}}])},300:function(e,a){angular.module("graphdb.framework.namespaces.directives",["ngRoute"]).directive("loaderPostRepeatDirective",["$timeout",function(e){return function(a){a.$last&&e((function(){a.$parent.loader=!1}),0)}}])},380:function(e,a,n){"use strict";n.r(a);n(9),n(40),n(41),n(299),n(300),n(118),n(652);angular.module("graphdb.framework.namespaces",["LocalStorageModule","xeditable","ngAnimate","ngRoute","toastr","graphdb.framework.namespaces.controllers","graphdb.framework.namespaces.directives","graphdb.framework.core.services.repositories","graphdb.framework.core.directives","graphdb.framework.core.directives.paginations"]).run(["editableOptions",function(e){e.theme="bs3"}])}}]);
@@ -1 +1 @@
1
- (window.webpackJsonp=window.webpackJsonp||[]).push([[61],{258:function(t,e,r){"use strict";r.r(e);var n=r(551),a=r(550);r(13);function o(t,e,r,o,s,c,i,l,d,u,p,f,h){return{restrict:"AE",template:'<div id="domain-range"></div>',scope:{showPredicatesInfoPanel:"=",selectedPredicate:"=",collapseEdges:"="},link:function(u){const p=l((function(){!function(u){var p=d3.select("#domain-range").append("svg").attr("viewBox","0 0 1200 600").attr("preserveAspectRatio","xMidYMid meet").on("dblclick.zoom",null),g=d3.forceSimulation(),y=d3.drag().subject((function(t){return t})).on("start",(function(t,e){g.stop(),e.fx=t.x,e.fy=t.y,d3.select(this).classed("selected",!0)})).on("end",(function(t,e){e.fx=null,e.fy=null,d3.select(this).classed("selected",!1),b?(g.alpha(.2).restart(),b=!1):g.restart()})).on("drag",(function(t,e){b=!0,g.alphaTarget(0).restart(),e.fx=t.x,e.fy=t.y})),x=p.append("defs");x.append("marker").attrs({id:"arrow",viewBox:"0 -5 10 10",refX:10,refY:0,markerUnits:"strokeWidth",markerWidth:5,markerHeight:5,orient:"auto",fill:f}).append("path").attrs({d:"M0,-5L10,0L0,5",class:"arrowHead"}),x.append("marker").attrs({id:"collapsed-arrow",viewBox:"0 -5 10 10",refX:9,refY:0,markerUnits:"strokeWidth",markerWidth:4,markerHeight:4,orient:"auto",fill:f}).append("path").attrs({d:"M0,-5L10,0L0,5",class:"arrowHead"}),x.append("marker").attrs({id:"arrow-loop",viewBox:"0 -5 10 10",refX:7,refY:0,markerUnits:"strokeWidth",markerWidth:5,markerHeight:5,orient:"auto",fill:f}).append("path").attrs({d:"M0,-5L10,0L0,5",class:"arrowHead"}),d3.select("#download-svg").on("mouseover",(function(){var t=n.a.Export.getCSSRules("css/domain-range-graph.css?v=2.8.3");$("defs").append('<style type="text/css"><![CDATA['+t+"]]></style>");var e=n.a.Export.generateBase64ImageSource("#domain-range svg");d3.select(this).attrs({href:e,download:"domain-range-graph-"+r.getActiveRepository()+".svg"})})),function(){var t=d3.select(".legend-container").append("svg").attr("viewBox","0 0 "+1200/7+" "+1200/7*1.2).attr("preserveAspectRatio","xMidYMid meet");t.append("rect").attrs({width:1200/7,height:1200/7*1.2}).style("fill","rgba(235, 235, 235, 0.9)");var e=16+1200/18/2.5,r=e+1200/90;t.append("circle").attrs({class:"legend-class-node",cx:(16+e)/2,cy:30,r:1200/18/4.5}),t.append("text").attrs({x:r,y:30+1200/370}).style("font-size",1200/90/1.1+"px").text("main class node"),t.append("circle").attrs({class:"legend-object-node",cx:(16+e)/2,cy:70,r:1200/110/1.25}),t.append("text").attrs({x:r,y:30+1200/370+40}).style("font-size",1200/90/1.1+"px").text("class node"),t.append("circle").attrs({class:"legend-datatype-node",cx:(16+e)/2,cy:70+1200/45,r:1200/110/2}),t.append("text").attrs({x:r,y:99.90990990990991}).style("font-size",1200/90/1.1+"px").text("datatype node"),t.append("line").attrs({class:"property-arrow",x1:16,y1:123.33333333333334,x2:e,y2:123.33333333333334}).style("stroke-width",1.2).attr("marker-end","url("+s.absUrl()+"#arrow)"),t.append("text").attrs({x:r,y:126.57657657657658}).style("font-size",1200/90/1.1+"px").text("explicit property"),t.append("line").attrs({class:"implicit-property-arrow",x1:16,y1:150,x2:e,y2:150}).style("stroke-width",1.2).attr("marker-end","url("+s.absUrl()+"#arrow)"),t.append("text").attrs({x:r,y:150+1200/370}).style("font-size",1200/90/1.1+"px").text("implicit property"),t.append("line").attrs({class:"collapsed-property-arrow",x1:16,y1:150+1200/45,x2:e,y2:150+1200/45}).style("stroke-width",2).attr("marker-end","url("+s.absUrl()+"#collapsed-arrow)"),t.append("text").attrs({x:r,y:179.9099099099099}).style("font-size",1200/90/1.1+"px").text("collapsed property")}();var m=s.search().uri,v=s.search().name;const k=s.search().collapsed;(function(t,e){o.getDomainRangeData(t,e).success((function(t,e,r){u.domainRangeGraphData=t})).error((function(t){d.error("Request for "+v+" failed!")}))})(m,k),$(window).on("popstate",(function(){c.set(i.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)||(c.set(i.DOMAIN_RANGE_COLLAPSE_EDGES,u.collapseEdges),"true"!==c.get(i.DOMAIN_RANGE_WENT_BACK)&&function(e){t.$broadcast("switchEdgeMode",{uri:m,name:v,collapsed:e})}(u.collapseEdges),c.remove(i.DOMAIN_RANGE_WENT_BACK))})),u.$watch("domainRangeGraphData",(function(){if(u.domainRangeGraphData){var r=_.cloneDeep(u.domainRangeGraphData);const P=r.nodes,j=r.links;g.nodes(P).force("x",d3.forceX(600)).force("y",d3.forceY(300)).force("charge",d3.forceManyBody().strength(-800)).force("link",d3.forceLink(j).distance(1200/3.5));var n=p.selectAll(".link").data(j).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 c,i,d=0;n.each((function(t){if(t.objectPropNodeClassUri!==m)c=n.append("line").attrs({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(i)){i=d3.select(this).append("path").attrs({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 x={};function k(){$.isEmptyObject(x)||(x.text.style("fill","black"),x.background.style("fill","#f0f0f0"))}function b(t,e){k(),x.text=d3.select(this),x.background=d3.select(this.previousSibling),x.text.style("fill","white"),x.background.style("fill",f),l((function(){u.showPredicatesInfoPanel=!0,u.selectedPredicate=e})),t.stopPropagation()}$("document").ready((function(){$("#domain-range").bind("click",k)}));var w=n.append("text").attr("class",(function(t){return t.objectPropNodeClassUri===m?"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}));w.each((function(t){var r=d3.select(this);/\d\spredicates/.test(r.text())?r.style("font-weight","bold").on("click",b):r.on("click",(function(t,r){e.open("resource?uri="+encodeURIComponent(r.uri),"_blank")}))}));var E=n.append("rect").attr("class",(function(t){return t.objectPropNodeClassUri!==m?"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){t.stopPropagation()})),N=p.selectAll(".node").data(P).enter().append("g"),R=N.filter((function(t){return t.objectPropClassUri!==m})).append("circle").each((function(t){var e=d3.select(this);"main"===t.classPosition?e.attrs({class:"class-node",r:1200/18}).attr("marker-end","url("+s.absUrl()+"#loop-link)"):null===t.objectPropClassName?e.attrs({class:"datatype-node",r:1200/110/2}):e.attrs({class:"object-prop-node",r:1200/110})})).call(y);d3.selectAll(".object-prop-node").on("dblclick",(function(e,r,n){u.$apply((function(){t.$broadcast("reloadDomainRangeGraphView",r,n)}))})),N.filter((function(t){return t.objectPropClassName&&t.objectPropClassUri!==m})).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,r){e.open("resource?uri="+encodeURIComponent(r.objectPropClassUri),"_blank")}));var C=N.select("text");p.select(".class-node").each((function(){d3.select(this.parentNode).append("text").attr("class","rdf-class-label").style("font-size",(function(t){return a.a.Text.calcFontSize(v,1200/18)})).text(v).on("click",(function(){e.open("resource?uri="+encodeURIComponent(m),"_blank")}))}));var T=p.select(".class-node + text"),A=d3.select(".class-node"),L=d3.selectAll(".loop-link-background"),M=d3.selectAll(".loop-link-property-name");if(w=d3.selectAll(".property-name"),!angular.isUndefined(i)){var U=[];L.each((function(t,e){d3.select(this);U.push({idx:e,width:t.calculatedWidth,height:t.calculatedHeight})}))}g.on("tick",(function(t){var e=8*g.alpha();function r(t){var e=t.x+1200/18*2,r=t.y-1200/18/1.9;var n=[];L.each((function(a,o){n.push(a),o<h?function(n,a){var o=$.grep(U,(function(t){return t.idx==a}));a>0&&(e+=parseFloat(a*(o[0].height/(a/1.4)))),n.attrs({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",b),d3.select(".view-more-preds-rect").attr("height",e+4)}(n)}c.filter((function(t){return t.objectPropNodeClassUri!==m})).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(i)||(!function(t){var e=t.x+64,r=t.y-1200/18/5.7-5;i.attr("transform","rotate(270, "+t.x+","+t.y+") translate("+e+","+r+")")}(t),function(t){function e(e,r){var n=$.grep(U,(function(t){return t.idx==r})),a=0;r>0&&(a=parseFloat(2*r*(n[0].height/1.4)));var o=t.x,s=t.y-1200/18*2.1-a;e.attrs({x:o,y:s}).moveToFront()}M.each((function(t,r){var n=d3.select(this),a=M.size()-h;a<0?e(n,r):(0==r&&!u.collapseEdges&&a>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)}(n,d3.select(this.nextSibling),a),e(n,r)),r<h?e(n,r):n.remove())}))}(t),r(t)),t.objectPropClassUri!==m&&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(),E.filter((function(t){return t.objectPropNodeClassUri!==m})).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(),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(),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()}))}}));let b=!1}(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"]},538:function(t,e,r){var n,a;n=[r(546)],void 0===(a=function(){function t(t,e){return t.each((function(){var t=e.apply(this,arguments),r=select(this);for(var n in t)r.attr(n,t[n])}))}function e(t,e){for(var r in e)t.attr(r,e[r]);return t}return"undefined"==typeof d3&&(d3=r(546)),d3.selection.prototype.attrs=function(r){return("function"==typeof r?t:e)(this,r)},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)}))},d3}.apply(e,n))||(t.exports=a)},550:function(t,e,r){"use strict";r(538);var n=n||{};n.Text=function(){function t(t,e,r,n){r=r||10;var a=e/3;return"string"==typeof t?(a*=10/(t.substring(0,e/3).length+1.5),a+=1,t.match(/[\u0900-\u0DFF\u1100-\u11FF\u2E80-\u2EFF\u3000-\u9FFF]/)&&(a*=.6),a<r&&(a=r),Math.round(a)):(a<r&&(a=r),Math.round(a))}return{calcFontSizeRaw:t,calcFontSize:function(e,r,n,a){return t(e,r,n)+"px"},getTextWithElipsisIfNeeded:function(t,e){return"string"==typeof t&&t.length>e?t.substring(0,e-3)+"...":t}}}(),n.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)}},n.Click=function(){const t=function(t,r){let n,a=1,o=arguments.length;for(;++a<o;)n=arguments[a],t[n]=e(t,r,r[n]);return t};function e(t,e,r){return function(){var n=r.apply(e,arguments);return n===e?t:n}}return{delayDblClick:function(){var e=d3.dispatch("click","dblclick");return t((function(t){var r,n=null;t.on("mousedown",(function(){r=d3.pointer(document.body),+new Date})),t.on("mouseup",(function(t,a){var o,s,c;(s=r,c=d3.pointer(document.body),Math.sqrt(Math.pow(s[0]-c[0],2),Math.pow(s[1]-c[1],2))>5)||(n?(window.clearTimeout(n),n=null,e.call("dblclick",t,t,a)):n=window.setTimeout((o=t,function(){e.call("click",o,o,a),n=null}),250))}))}),e,"on")}}}(),e.a=n},551:function(t,e,r){"use strict";r(538);var 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=d3.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([[61],{258:function(t,e,r){"use strict";r.r(e);var n=r(551),a=r(550);r(13);function o(t,e,r,o,s,c,i,l,d,u,p,f,h){return{restrict:"AE",template:'<div id="domain-range"></div>',scope:{showPredicatesInfoPanel:"=",selectedPredicate:"=",collapseEdges:"="},link:function(u){const p=l((function(){!function(u){var p=d3.select("#domain-range").append("svg").attr("viewBox","0 0 1200 600").attr("preserveAspectRatio","xMidYMid meet").on("dblclick.zoom",null),g=d3.forceSimulation(),y=d3.drag().subject((function(t){return t})).on("start",(function(t,e){g.stop(),e.fx=t.x,e.fy=t.y,d3.select(this).classed("selected",!0)})).on("end",(function(t,e){e.fx=null,e.fy=null,d3.select(this).classed("selected",!1),b?(g.alpha(.2).restart(),b=!1):g.restart()})).on("drag",(function(t,e){b=!0,g.alphaTarget(0).restart(),e.fx=t.x,e.fy=t.y})),x=p.append("defs");x.append("marker").attrs({id:"arrow",viewBox:"0 -5 10 10",refX:10,refY:0,markerUnits:"strokeWidth",markerWidth:5,markerHeight:5,orient:"auto",fill:f}).append("path").attrs({d:"M0,-5L10,0L0,5",class:"arrowHead"}),x.append("marker").attrs({id:"collapsed-arrow",viewBox:"0 -5 10 10",refX:9,refY:0,markerUnits:"strokeWidth",markerWidth:4,markerHeight:4,orient:"auto",fill:f}).append("path").attrs({d:"M0,-5L10,0L0,5",class:"arrowHead"}),x.append("marker").attrs({id:"arrow-loop",viewBox:"0 -5 10 10",refX:7,refY:0,markerUnits:"strokeWidth",markerWidth:5,markerHeight:5,orient:"auto",fill:f}).append("path").attrs({d:"M0,-5L10,0L0,5",class:"arrowHead"}),d3.select("#download-svg").on("mouseover",(function(){var t=n.a.Export.getCSSRules("css/domain-range-graph.css?v=2.8.4-TR2");$("defs").append('<style type="text/css"><![CDATA['+t+"]]></style>");var e=n.a.Export.generateBase64ImageSource("#domain-range svg");d3.select(this).attrs({href:e,download:"domain-range-graph-"+r.getActiveRepository()+".svg"})})),function(){var t=d3.select(".legend-container").append("svg").attr("viewBox","0 0 "+1200/7+" "+1200/7*1.2).attr("preserveAspectRatio","xMidYMid meet");t.append("rect").attrs({width:1200/7,height:1200/7*1.2}).style("fill","rgba(235, 235, 235, 0.9)");var e=16+1200/18/2.5,r=e+1200/90;t.append("circle").attrs({class:"legend-class-node",cx:(16+e)/2,cy:30,r:1200/18/4.5}),t.append("text").attrs({x:r,y:30+1200/370}).style("font-size",1200/90/1.1+"px").text("main class node"),t.append("circle").attrs({class:"legend-object-node",cx:(16+e)/2,cy:70,r:1200/110/1.25}),t.append("text").attrs({x:r,y:30+1200/370+40}).style("font-size",1200/90/1.1+"px").text("class node"),t.append("circle").attrs({class:"legend-datatype-node",cx:(16+e)/2,cy:70+1200/45,r:1200/110/2}),t.append("text").attrs({x:r,y:99.90990990990991}).style("font-size",1200/90/1.1+"px").text("datatype node"),t.append("line").attrs({class:"property-arrow",x1:16,y1:123.33333333333334,x2:e,y2:123.33333333333334}).style("stroke-width",1.2).attr("marker-end","url("+s.absUrl()+"#arrow)"),t.append("text").attrs({x:r,y:126.57657657657658}).style("font-size",1200/90/1.1+"px").text("explicit property"),t.append("line").attrs({class:"implicit-property-arrow",x1:16,y1:150,x2:e,y2:150}).style("stroke-width",1.2).attr("marker-end","url("+s.absUrl()+"#arrow)"),t.append("text").attrs({x:r,y:150+1200/370}).style("font-size",1200/90/1.1+"px").text("implicit property"),t.append("line").attrs({class:"collapsed-property-arrow",x1:16,y1:150+1200/45,x2:e,y2:150+1200/45}).style("stroke-width",2).attr("marker-end","url("+s.absUrl()+"#collapsed-arrow)"),t.append("text").attrs({x:r,y:179.9099099099099}).style("font-size",1200/90/1.1+"px").text("collapsed property")}();var m=s.search().uri,v=s.search().name;const k=s.search().collapsed;(function(t,e){o.getDomainRangeData(t,e).success((function(t,e,r){u.domainRangeGraphData=t})).error((function(t){d.error("Request for "+v+" failed!")}))})(m,k),$(window).on("popstate",(function(){c.set(i.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)||(c.set(i.DOMAIN_RANGE_COLLAPSE_EDGES,u.collapseEdges),"true"!==c.get(i.DOMAIN_RANGE_WENT_BACK)&&function(e){t.$broadcast("switchEdgeMode",{uri:m,name:v,collapsed:e})}(u.collapseEdges),c.remove(i.DOMAIN_RANGE_WENT_BACK))})),u.$watch("domainRangeGraphData",(function(){if(u.domainRangeGraphData){var r=_.cloneDeep(u.domainRangeGraphData);const P=r.nodes,j=r.links;g.nodes(P).force("x",d3.forceX(600)).force("y",d3.forceY(300)).force("charge",d3.forceManyBody().strength(-800)).force("link",d3.forceLink(j).distance(1200/3.5));var n=p.selectAll(".link").data(j).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 c,i,d=0;n.each((function(t){if(t.objectPropNodeClassUri!==m)c=n.append("line").attrs({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(i)){i=d3.select(this).append("path").attrs({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 x={};function k(){$.isEmptyObject(x)||(x.text.style("fill","black"),x.background.style("fill","#f0f0f0"))}function b(t,e){k(),x.text=d3.select(this),x.background=d3.select(this.previousSibling),x.text.style("fill","white"),x.background.style("fill",f),l((function(){u.showPredicatesInfoPanel=!0,u.selectedPredicate=e})),t.stopPropagation()}$("document").ready((function(){$("#domain-range").bind("click",k)}));var w=n.append("text").attr("class",(function(t){return t.objectPropNodeClassUri===m?"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}));w.each((function(t){var r=d3.select(this);/\d\spredicates/.test(r.text())?r.style("font-weight","bold").on("click",b):r.on("click",(function(t,r){e.open("resource?uri="+encodeURIComponent(r.uri),"_blank")}))}));var E=n.append("rect").attr("class",(function(t){return t.objectPropNodeClassUri!==m?"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){t.stopPropagation()})),N=p.selectAll(".node").data(P).enter().append("g"),R=N.filter((function(t){return t.objectPropClassUri!==m})).append("circle").each((function(t){var e=d3.select(this);"main"===t.classPosition?e.attrs({class:"class-node",r:1200/18}).attr("marker-end","url("+s.absUrl()+"#loop-link)"):null===t.objectPropClassName?e.attrs({class:"datatype-node",r:1200/110/2}):e.attrs({class:"object-prop-node",r:1200/110})})).call(y);d3.selectAll(".object-prop-node").on("dblclick",(function(e,r,n){u.$apply((function(){t.$broadcast("reloadDomainRangeGraphView",r,n)}))})),N.filter((function(t){return t.objectPropClassName&&t.objectPropClassUri!==m})).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,r){e.open("resource?uri="+encodeURIComponent(r.objectPropClassUri),"_blank")}));var C=N.select("text");p.select(".class-node").each((function(){d3.select(this.parentNode).append("text").attr("class","rdf-class-label").style("font-size",(function(t){return a.a.Text.calcFontSize(v,1200/18)})).text(v).on("click",(function(){e.open("resource?uri="+encodeURIComponent(m),"_blank")}))}));var T=p.select(".class-node + text"),A=d3.select(".class-node"),L=d3.selectAll(".loop-link-background"),M=d3.selectAll(".loop-link-property-name");if(w=d3.selectAll(".property-name"),!angular.isUndefined(i)){var U=[];L.each((function(t,e){d3.select(this);U.push({idx:e,width:t.calculatedWidth,height:t.calculatedHeight})}))}g.on("tick",(function(t){var e=8*g.alpha();function r(t){var e=t.x+1200/18*2,r=t.y-1200/18/1.9;var n=[];L.each((function(a,o){n.push(a),o<h?function(n,a){var o=$.grep(U,(function(t){return t.idx==a}));a>0&&(e+=parseFloat(a*(o[0].height/(a/1.4)))),n.attrs({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",b),d3.select(".view-more-preds-rect").attr("height",e+4)}(n)}c.filter((function(t){return t.objectPropNodeClassUri!==m})).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(i)||(!function(t){var e=t.x+64,r=t.y-1200/18/5.7-5;i.attr("transform","rotate(270, "+t.x+","+t.y+") translate("+e+","+r+")")}(t),function(t){function e(e,r){var n=$.grep(U,(function(t){return t.idx==r})),a=0;r>0&&(a=parseFloat(2*r*(n[0].height/1.4)));var o=t.x,s=t.y-1200/18*2.1-a;e.attrs({x:o,y:s}).moveToFront()}M.each((function(t,r){var n=d3.select(this),a=M.size()-h;a<0?e(n,r):(0==r&&!u.collapseEdges&&a>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)}(n,d3.select(this.nextSibling),a),e(n,r)),r<h?e(n,r):n.remove())}))}(t),r(t)),t.objectPropClassUri!==m&&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(),E.filter((function(t){return t.objectPropNodeClassUri!==m})).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(),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(),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()}))}}));let b=!1}(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"]},538:function(t,e,r){var n,a;n=[r(546)],void 0===(a=function(){function t(t,e){return t.each((function(){var t=e.apply(this,arguments),r=select(this);for(var n in t)r.attr(n,t[n])}))}function e(t,e){for(var r in e)t.attr(r,e[r]);return t}return"undefined"==typeof d3&&(d3=r(546)),d3.selection.prototype.attrs=function(r){return("function"==typeof r?t:e)(this,r)},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)}))},d3}.apply(e,n))||(t.exports=a)},550:function(t,e,r){"use strict";r(538);var n=n||{};n.Text=function(){function t(t,e,r,n){r=r||10;var a=e/3;return"string"==typeof t?(a*=10/(t.substring(0,e/3).length+1.5),a+=1,t.match(/[\u0900-\u0DFF\u1100-\u11FF\u2E80-\u2EFF\u3000-\u9FFF]/)&&(a*=.6),a<r&&(a=r),Math.round(a)):(a<r&&(a=r),Math.round(a))}return{calcFontSizeRaw:t,calcFontSize:function(e,r,n,a){return t(e,r,n)+"px"},getTextWithElipsisIfNeeded:function(t,e){return"string"==typeof t&&t.length>e?t.substring(0,e-3)+"...":t}}}(),n.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)}},n.Click=function(){const t=function(t,r){let n,a=1,o=arguments.length;for(;++a<o;)n=arguments[a],t[n]=e(t,r,r[n]);return t};function e(t,e,r){return function(){var n=r.apply(e,arguments);return n===e?t:n}}return{delayDblClick:function(){var e=d3.dispatch("click","dblclick");return t((function(t){var r,n=null;t.on("mousedown",(function(){r=d3.pointer(document.body),+new Date})),t.on("mouseup",(function(t,a){var o,s,c;(s=r,c=d3.pointer(document.body),Math.sqrt(Math.pow(s[0]-c[0],2),Math.pow(s[1]-c[1],2))>5)||(n?(window.clearTimeout(n),n=null,e.call("dblclick",t,t,a)):n=window.setTimeout((o=t,function(){e.call("click",o,o,a),n=null}),250))}))}),e,"on")}}}(),e.a=n},551:function(t,e,r){"use strict";r(538);var 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=d3.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 +1 @@
1
- (window.webpackJsonp=window.webpackJsonp||[]).push([[72,186,188],{277:function(r,i){function e(r){return{restrict:"A",require:"ngModel",link:function(i,e,t,o){o.$parsers.unshift((function(i){const e=r.isValidIri(i,i.toString());return o.$setValidity("validateUri",e),i}))}}}angular.module("graphdb.framework.import.directives.validate-uri",[]).directive("validateUri",e),e.$inject=["UriUtils"]},278:function(r,i){function e(){return{link:function(r,i,e){r.$watch("file.status",(function(){"IMPORTING"!==r.file.status&&"UPLOADING"!==r.file.status||!$(i).has("object").length>0&&$(i).append('<object width="'+e.size+'" height="'+e.size+'" data="js/angular/templates/loader/ot-loader.svg?v=2.8.3">{{\'common.loading\' | translate}}</object>')}))}}}angular.module("graphdb.framework.import.directives.import-progress-indicator",[]).directive("ImportProgressIndicator",e),e.$inject=[]},354:function(r,i,e){"use strict";e.r(i);e(9),e(40),e(265),e(277),e(278),e(318),e(41),e(82),e(83);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.import.directives.validate-uri","graphdb.framework.import.directives.import-progress-indicator","graphdb.framework.import.directives.import-resource-tree"])}}]);
1
+ (window.webpackJsonp=window.webpackJsonp||[]).push([[72,186,188],{277:function(r,i){function e(r){return{restrict:"A",require:"ngModel",link:function(i,e,t,o){o.$parsers.unshift((function(i){const e=r.isValidIri(i,i.toString());return o.$setValidity("validateUri",e),i}))}}}angular.module("graphdb.framework.import.directives.validate-uri",[]).directive("validateUri",e),e.$inject=["UriUtils"]},278:function(r,i){function e(){return{link:function(r,i,e){r.$watch("file.status",(function(){"IMPORTING"!==r.file.status&&"UPLOADING"!==r.file.status||!$(i).has("object").length>0&&$(i).append('<object width="'+e.size+'" height="'+e.size+'" data="js/angular/templates/loader/ot-loader.svg?v=2.8.4-TR2">{{\'common.loading\' | translate}}</object>')}))}}}angular.module("graphdb.framework.import.directives.import-progress-indicator",[]).directive("ImportProgressIndicator",e),e.$inject=[]},354:function(r,i,e){"use strict";e.r(i);e(9),e(40),e(265),e(277),e(278),e(318),e(41),e(82),e(83);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.import.directives.validate-uri","graphdb.framework.import.directives.import-progress-indicator","graphdb.framework.import.directives.import-resource-tree"])}}]);