graphdb-workbench 3.0.1-RC2 → 3.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/231.909faa919088245e9988.bundle.js +1 -1
- package/dist/31.721783158dcfdee0b882.bundle.js +1 -1
- package/dist/410.a86d6bdafde1b951e239.bundle.js +1 -1
- package/dist/416.68f6286f80654cdbe4e4.bundle.js +1 -1
- package/dist/417.70adf0a6f0571c394764.bundle.js +1 -1
- package/dist/42.0147219d61d3814c266c.bundle.js +1 -1
- package/dist/423.6edb13ec0cf08388c947.bundle.js +1 -1
- package/dist/424.725b821051516e73783a.bundle.js +1 -1
- package/dist/425.03fcf969da1a4e92fec3.bundle.js +1 -1
- package/dist/426.aa6924f6f1192d037009.bundle.js +1 -1
- package/dist/427.5c7b72141707b841e8a3.bundle.js +1 -1
- package/dist/428.0d471ce7c68654947c04.bundle.js +1 -1
- package/dist/443.969280af4067a22d1a8b.bundle.js +1 -1
- package/dist/444.a5971579184b091ed392.bundle.js +1 -1
- package/dist/445.2b20cb9e68a11879f6c4.bundle.js +1 -1
- package/dist/446.fe3cf3d6e288c8c4444b.bundle.js +1 -1
- package/dist/447.d1d078921f6f28e2fa38.bundle.js +1 -1
- package/dist/448.d6c9bed6d99b8b23619f.bundle.js +1 -1
- package/dist/468.8e259940c62a68ef3055.bundle.js +1 -1
- package/dist/480.379bf3b338e0a3224a1f.bundle.js +1 -1
- package/dist/481.0387239b174f787e70ea.bundle.js +1 -1
- package/dist/483.c81275cb05dd78ce389f.bundle.js +1 -1
- package/dist/484.25a82c267c3a705d2a65.bundle.js +1 -1
- package/dist/485.91cbfbfd37eccde375c9.bundle.js +1 -1
- package/dist/488.a69dcce23066c0dafdf7.bundle.js +1 -1
- package/dist/489.a976085b601cccf438d4.bundle.js +1 -1
- package/dist/49.6b885bb67696745b1634.bundle.js +1 -1
- package/dist/490.d3e0f3e499b5a24f6808.bundle.js +1 -1
- package/dist/491.62c185868f9d99dd5713.bundle.js +1 -1
- package/dist/50.ee3ed147b2bc2382a0a2.bundle.js +1 -1
- package/dist/75.0e43af19262a978d6aab.bundle.js +1 -1
- package/dist/bundle.e7ff3a088b4fc9e2ec9e.bundle.js +2 -2
- package/dist/index.html +3 -3
- package/dist/js/angular/clustermanagement/templates/cluster-nodes-configuration.html +1 -1
- package/dist/js/angular/core/directives/autocomplete/templates/autocomplete.html +1 -1
- package/dist/js/angular/core/directives/dynamic-form/templates/dynamic-form.html +1 -1
- package/dist/js/angular/core/directives/operations-statuses-monitor/templates/operations-statuses-monitor.html +1 -1
- package/dist/js/angular/core/directives/rdfresourcesearch/templates/rdfResourceSearchTemplate.html +1 -1
- package/dist/js/angular/core/directives/shuttle-multiselect/templates/shuttle-multiselect.html +1 -1
- package/dist/js/angular/core/directives/yasgui-component/templates/yasgui-component.html +1 -1
- package/dist/js/angular/core/templates/cookie-policy/cookie-consent.html +1 -1
- package/dist/js/angular/core/templates/cookie-policy/cookie-policy.html +1 -1
- package/dist/js/angular/graphql/templates/create-graphql-endpoint.html +2 -2
- package/dist/js/angular/graphql/templates/graphql-endpoint-management.html +1 -1
- package/dist/js/angular/graphql/templates/graphql-playground.html +1 -1
- package/dist/js/angular/graphql/templates/modal/endpoint-configuration-modal.html +1 -1
- package/dist/js/angular/graphql/templates/modal/endpoint-generation-failure-result-modal.html +1 -1
- package/dist/js/angular/graphql/templates/modal/import-endpoint-definition-modal.html +1 -1
- package/dist/js/angular/security/templates/user.html +2 -2
- package/dist/js/angular/ttyg/templates/agent-list.html +1 -1
- package/dist/js/angular/ttyg/templates/agent-select-menu.html +1 -1
- package/dist/js/angular/ttyg/templates/chat-item-detail.html +1 -1
- package/dist/js/angular/ttyg/templates/chat-list.html +1 -1
- package/dist/js/angular/ttyg/templates/chat-panel.html +1 -1
- package/dist/js/angular/ttyg/templates/modal/agent-instructions-explain-modal.html +1 -1
- package/dist/js/angular/ttyg/templates/modal/agent-settings-modal.html +2 -2
- package/dist/js/angular/ttyg/templates/no-agents-view.html +1 -1
- package/dist/js/angular/ttyg/templates/ttyg.html +1 -1
- package/dist/license-checker.json +206 -206
- package/dist/pages/aclmanagement.html +2 -2
- package/dist/pages/autocomplete.html +1 -1
- package/dist/pages/choose-repository-type.html +1 -1
- package/dist/pages/cluster-management/clusterInfo.html +3 -3
- package/dist/pages/create-index.html +1 -1
- package/dist/pages/dependencies.html +1 -1
- package/dist/pages/domainRangeInfo.html +2 -2
- package/dist/pages/edit.html +1 -1
- package/dist/pages/explore.html +1 -1
- package/dist/pages/export.html +1 -1
- package/dist/pages/find.html +1 -1
- package/dist/pages/graph-config/saveGraphConfig.html +8 -8
- package/dist/pages/graphs-visualizations.html +7 -7
- package/dist/pages/guides.html +1 -1
- package/dist/pages/import.html +2 -2
- package/dist/pages/jdbc-create.html +1 -1
- package/dist/pages/monitor/backup-and-restore.html +1 -1
- package/dist/pages/monitor/queries.html +1 -1
- package/dist/pages/monitor/resources.html +1 -1
- package/dist/pages/namespaces.html +2 -2
- package/dist/pages/plugins.html +1 -1
- package/dist/pages/rdfClassHierarchyInfo.html +7 -7
- package/dist/pages/rdfrank.html +2 -2
- package/dist/pages/repositories.html +1 -1
- package/dist/pages/repository.html +1 -1
- package/dist/pages/similarity-indexes.html +1 -1
- package/dist/pages/sparql-editor.html +1 -1
- package/dist/pages/sparql-template-create.html +1 -1
- package/dist/pages/ux-test1.html +2 -2
- package/dist/pages/webapi.html +2 -2
- package/dist/res/swagger5/index.html +12 -12
- package/package.json +7 -3
- /package/dist/{vendor.108f4f0d292959f7fe7a.bundle.js → vendor.e2454ca87c2e3bd961de.bundle.js} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
(window.webpackJsonp=window.webpackJsonp||[]).push([[49,348,391],{120: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 a}));var r=n(24),i=function(e){return e.replace(/[()']/g,"")},o=function(e){return"string"==typeof e?"true"===e:Boolean(e)},a=function(e){return e?Object(r.upperFirst)(e.toLowerCase()):e}},159:function(e,t,n){"use strict";n.r(t),n.d(t,"STATIC_RULESETS",(function(){return r})),n.d(t,"REPOSITORY_TYPES",(function(){return i})),n.d(t,"FILENAME_PATTERN",(function(){return o})),n.d(t,"NUMBER_PATTERN",(function(){return a}));var r=[{id:"empty",name:"No inference"},{id:"rdfs-optimized",name:"RDFS (Optimized)"},{id:"rdfs",name:"RDFS"},{id:"rdfsplus-optimized",name:"RDFS-Plus (Optimized)"},{id:"owl-horst-optimized",name:"OWL-Horst (Optimized)"},{id:"owl-horst",name:"OWL-Horst"},{id:"owl2-ql-optimized",name:"OWL2-QL (Optimized)"},{id:"owl2-ql",name:"OWL2-QL"},{id:"owl-max-optimized",name:"OWL-Max (Optimized)"},{id:"owl-max",name:"OWL-Max"},{id:"owl2-rl-optimized",name:"OWL2-RL (Optimized)"},{id:"owl2-rl",name:"OWL2-RL"}],i={graphdbRepo:"graphdb",free:"free",eeWorker:"worker",eeMaster:"master",ontop:"ontop",se:"se",fedx:"fedx"},o=new RegExp("^[a-zA-Z0-9-_]+$"),a=new RegExp("^[0-9]+$")},302:function(e,t,n){"use strict";n.r(t);n(10),n(29),n(60);var r=n(647),i=n(658),o=(n(15),n(159)),a=n(120),s=n(11),c=n(42);function l(e){return function(e){if(Array.isArray(e))return u(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||d(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function d(e,t){if(e){if("string"==typeof e)return u(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?u(e,t):void 0}}function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function p(e){return(p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function f(e,t,n,u,f,h,g,m,y,v,x,S,I,w,b,k,L,C,T,N,A,P,M){e.languageChanged=!1,e.propertiesObj={},e.propertiesObj.items=[],e.propertiesQueryObj={},e.propertiesQueryObj.query="",e.propertiesSearchPlaceholder=N.instant("visual.search.instance.placeholder"),e.propertiesNotFiltered=[],e.searchVisible=!1,e.nodeSelected=!1,e.queryResultsMode=!1,e.embedded=y.search().embedded,e.openedNodeInfoPanel=void 0,e.invalidLimit=!1,e.INVALID_LINKS_MSG=N.instant("sidepanel.invalid.limit.links.msg"),e.INVALID_LINKS_TOOLTIP=N.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=function(){return angular.noop()},e.goToHome=function(){R(),y.url("graphs-visualizations")},e.shouldShowSettings=function(){return e.configLoaded&&e.configLoaded.id===e.defaultGraphConfig.id},e.shouldDisableSameAs=function(){var 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=function(t){return t.key.toLowerCase().indexOf(e.propertiesQueryObj.query.toLowerCase())>=0},e.toggleMoreInfo=function(e){angular.element(e.currentTarget).parent().next().toggle(200),angular.element(e.currentTarget).children("span").toggleClass("icon-caret-down").toggleClass("icon-caret-up")},e.copyToClipboard=function(e){S.openCopyToClipboardModal(e)},e.resetSettings=function(){e.settings=_.cloneDeep(e.defaultSettings),e.validateLinksLimit(),z()},e.changeLimit=function(t){var n=e.settings.linksLimit+t;n<1&&(n=1),n>1e3&&(n=1e3),e.settings.linksLimit=n},e.validateLinksLimit=function(){e.invalidLimit=!o.NUMBER_PATTERN.test(e.settings.linksLimit)},e.showSettings=function(){e.showInfoPanel=!0,e.showFilter=!0,e.showNodeInfo=!1,e.showPredicates=!1,e.saveSettings?e.settings=_.cloneDeep(e.saveSettings):e.settings=_.cloneDeep(e.defaultSettings),z()},e.updateSettings=function(){e.invalidLimit?f.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?D(e.rootNodeIri):e.queryResultsMode&&y.search().query?B(y.search().query,y.search().sameAs,y.search().inference):"query"===e.configLoaded.startMode&&Z(e.configLoaded),G(),e.showInfoPanel=!1,e.showFilter=!1,b.set(k.GRAPHS_VIZ,e.saveSettings))},e.getGraphConfigs=function(t){C.getGraphConfigs().success((function(n){e.graphConfigs=n,t&&t()})).error((function(e){f.error(getError(e),N.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=function(t){e.configLoaded=e.defaultGraphConfig,e.openUri(t)},e.deleteConfig=function(t){S.openSimpleModal({title:N.instant("common.confirm"),message:N.instant("graphexplore.delete.graph",{configName:t.name}),warning:!0}).result.then((function(){C.deleteGraphConfig(t).success((function(){e.getGraphConfigs(),e.refreshSavedGraphs()})).error((function(e){f.error(getError(e),N.instant("graphexplore.error.cannot.delete.config"))}))}))},e.goToGraphConfig=function(e){E({config:e.id},{config:e}),R(),Z(e)},e.replaceIRIWithPrefix=function(t){var n=e.namespaces,r=_.findLast(n,(function(e){return 0===t.indexOf(e.uri)}));return r?r.prefix+":"+t.substring(r.uri.length):t};var O=[];O.push(t.$on("$translateChangeSuccess",(function(){e.INVALID_LINKS_MSG=N.instant("sidepanel.invalid.limit.links.msg"),e.INVALID_LINKS_TOOLTIP=N.instant("sidepanel.invalid.limit.links.tooltip"),e.propertiesSearchPlaceholder=N.instant("visual.search.instance.placeholder")}))),O.push(P.onAutocompleteEnabledUpdated((function(t){e.isAutocompleteEnabled=t}))),O.push(P.onSelectedRepositoryIdUpdated((function(t){t?M.getNamespaces(t).then((function(t){e.repositoryNamespaces=t,e.namespaces=t.namespaces})).catch((function(e){var t=getError(e);f.error(t,N.instant("error.getting.namespaces.for.repo"))})):e.repositoryNamespaces=new s.NamespacesListModel}))),O.push(e.$on("repositoryIsSet",(function(t,n){n.newRepo&&(e.hasInitedRepository=!1),pe(n.newRepo),n.newRepo&&(R(),$(".graph-visualization svg").empty(),y.search().query&&(e.goToHome(),F()))})));O.push(t.$watch((function(){return t.key}),(function(){Y=0,_.each(e.propertiesObj.items,(function(e){t.key>e&&Y++})),X++})));O.push(e.$watch("propertiesObj.items",(function(){angular.isDefined(e.propertiesObj.items)&&e.propertiesObj.items.length>0&&h((function(){e.adapterContainer.adapter.reload()}),500)})));e.$on("$destroy",(function(){O.forEach((function(e){return e()}))}));var E=function(t,n){e.embedded&&(t.embedded=!0),y.search(t),y.state(n)},R=function(){e.searchVisible=!1,e.nodeSelected=!1,e.configLoaded=null,e.queryResultsMode=!1,e.lastSavedGraphName=null,e.lastSavedGraphId=null,e.shared=!1,e.numberOfPinnedNodes=0,ee={},te=0},j=function(){return A.isActive()?e.defaultSettings:e.saveSettings},G=function(){j().showLinksText?d3.selectAll("svg .link-wrapper text").style("display","block"):d3.selectAll("svg .link-wrapper text").style("display","none")},z=function(){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}}))},D=function(){e.rootNodeIri&&e.$broadcast("onRootNodeChange",e.rootNodeIri)},F=function(){y.search().query?(e.searchVisible=!1,e.queryResultsMode=!0,B(y.search().query,y.search().sameAs,y.search().inference)):e.$on("onRootNodeChange",(function(t,n){e.loading=!0;var r=j();angular.isDefined(n)&&(e.rootNodeIri=n,T.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");var n=(ue=new de).addNode(t.data,ce/2,le/2);se=ie,Ne(n,!0)})).catch((function(t){e.loading=!1,f.error(getError(t),N.instant("graphexplore.error.could.not.load.graph"))})))})),y.search().uri&&e.openUri(y.search().uri,!0),y.search().saved&&L.getSavedGraph(y.search().saved).success((function(t){e.loadSavedGraph(t)})).error((function(e){var t=getError(e);f.error(t,N.instant("graphexplore.error.could.not.open"))}))},B=function(t,n,r){var i=j(),o=void 0===n?i.sameAsState:!0===n,a=void 0===r?i.includeInferred:!0===r;e.loading=!0,T.updateGraph({query:t,linksLimit:i.linksLimit,languages:e.shouldShowSettings()?i.languages:[],includeInferred:a,sameAsState:o}).then((function(e){Te(e)}),(function(t){e.loading=!1,f.error(getError(t.data),N.instant("graphexplore.error.cannot.load.graph"))}))},U=function(e,t){var n=e.split(" ");return t?[n[0],n[1],n[2]].join(">"):[n[0],n[2]].join(">")},W=function(e){return[e.source.iri,e.target.iri].join(">")},q=function(e){if(e.isTriple){var t=document.getElementById(Object(a.removeSpecialChars)(U(e.iri)));if(t&&void 0!==t.__data__.x)return t.__data__.x}return e.x},V=function(e){if(e.isTriple){var t=document.getElementById(Object(a.removeSpecialChars)(U(e.iri)));if(t&&void 0!==t.__data__.y)return t.__data__.y}return e.y},H=function(e){var t=e.trim().split(" ");return"<<<".concat(t[0],"> <").concat(t[1],"> <").concat(t[2],">>>")},K=function(e){var t=e.source.isTriple?U(e.source.iri,!0):e.source.iri,n=e.target.isTriple?U(e.target.iri,!0):e.target.iri;return Object(a.removeSpecialChars)("".concat(t,">").concat(n,">marker"))},Z=function(t){e.configLoaded=t,"search"===t.startMode?e.searchVisible=!0:"node"===t.startMode&&t.startIRI?h((function(){e.openUri(t.startIRI,!0)}),0):"query"===t.startMode&&t.startGraphQuery&&(e.loading=!0,C.loadGraphForConfig(t,t.startQueryIncludeInferred,j().linksLimit,t.startQuerySameAs).then((function(e){Te(e)}),(function(t){e.loading=!1,f.error(getError(t),N.instant("graphexplore.error.graph.load"))})))},Q=function(){var t,n;y.search().config?(t=y.search().config,n=F,t===e.defaultGraphConfig.id?Z(e.defaultGraphConfig):C.getConfig(t).then((function(e){Z(e),n()})).catch((function(e){f.error(getError(e),N.instant("graphexplore.error.could.not.load.config",{configId:t}))}))):y.search().query||y.search().uri?(Z(e.defaultGraphConfig),F()):F()};w.onpopstate=function(t){R(),t.state&&(t.state.config?(Z(t.state.config),t.state.uri&&e.openUri(t.state.uri,!0)):t.state.savedGraph&&e.loadSavedGraph(t.state.savedGraph,!0))},e.embedded&&(y.search().query||y.search().uri||y.search().config||y.search().saved)&&(e.noGoHome=!0);var J,Y=0,X=0,ee={},te=0,ne=16,re=d3.zoom().scaleExtent([.1,10]),ie=d3.zoomIdentity.translate(0,-70).scale(1);re.on("zoom",(function(e){A.isActive()||(se=e.transform,J.attr("transform",se))}));var oe,ae,se=ie,ce=1e3,le=1e3;function de(){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(){var e={},t={};_.each(this.links,(function(n){var 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){var t=this.nodes;Array.prototype.push.apply(this.links,function(e,t){return _.map(e,(function(e){var n={source:e.isTripleSource?Re(e.source):_.find(t,(function(t){return t.iri===e.source})),target:e.isTripleTarget?Re(e.target):_.find(t,(function(t){return t.iri===e.target})),predicates:e.predicates};if(e.isTripleSource||e.isTripleTarget){var r=n.source.isTriple?U(n.source.iri):n.source.iri,i=n.target.isTriple?U(n.target.iri):n.target.iri,o="".concat(r,">").concat(i);if(ue.tripleLinksCopy.has(o)){var a,s=ue.tripleLinksCopy.get(o);return(a=s[0].predicates).push.apply(a,l(n.predicates)),s.push(n),ue.tripleLinksCopy.set(o,s),null}ue.tripleLinksCopy.set(o,[n])}return n}))}(e,t));var n,r=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=d(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}(ue.tripleLinksCopy.keys());try{for(r.s();!(n=r.n()).done;){var i=n.value;1===ue.tripleLinksCopy.get(i).length&&ue.tripleLinksCopy.delete(i)}}catch(e){r.e(e)}finally{r.f()}this.links=this.links.filter((function(e){return null!==e})),this.computeConnectedness()};var 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){var 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){var r=n(e,t),i=_.map(r,(function(e){return e.predicates}));return _.uniq(_.flatten(i))},this.removeTriples=function(e){var t=this,n=[];this.tripleNodes.size>0&&e.forEach((function(e){t.tripleNodes.has(e)&&(t.tripleNodes.delete(e),t.links=_.reject(t.links,(function(t){var r=e.split(">"),i=U(t.source.iri),o=U(t.target.iri);if(i===e&&ue.tripleNodes.delete(o)){var a=o.split(">");n.push({source:a[0],target:a[1]})}var s=i===e||o===e||t.source.iri===r[0]&&t.target.iri===r[1];return s&&(ue.tripleLinksCopy.delete("".concat(i,">").concat(o)),ue.tripleLinksCopy.delete("".concat(o,">").concat(i))),s})))})),n.forEach((function(e){t.links=_.reject(t.links,(function(t){return t.source.iri===e.source&&t.target.iri===e.target}))}))},this.removeNode=function(n){var r=[];this.links=_.reject(this.links,(function(e){var t=e.source.iri===n.iri||e.target.iri===n.iri;return t&&(e.target.isTriple&&r.push(U(e.target.iri)),e.source.isTriple||e.target.isTriple||r.push([e.source.iri,e.target.iri].join(">"))),t})),this.removeTriples(r);var 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){var r=[],i=this.links;this.links=_.reject(this.links,(function(o){var a=o.source.iri===e.iri&&1===t(o.target,i)&&!o.target.isTriple||o.target.iri===e.iri&&1===t(o.source,i)&&!o.source.isTriple;if(!a){var s;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||(s=n(o.source,i)):s=n(o.target,i),!s)return!1;a=(s[0].source.iri===e.iri||s[0].target.iri)&&(s[1].source.iri===e.iri||s[1].target.iri)}return a&&(o.target.isTriple&&r.push(U(o.target.iri)),o.source.isTriple||o.target.isTriple||r.push([o.source.iri,o.target.iri].join(">"))),a})),this.removeTriples(r),i=this.links,this.nodes=_.reject(this.nodes,(function(n){return 0===t(n,i)&&n.iri!==e.iri})),this.computeConnectedness()},this.addTriple=function(e,t,n){e.x=t,e.y=n,e.weight=0;var r=U(e.iri);if(this.tripleNodes.has(r)){var i=this.tripleNodes.get(r);i.push(e),this.tripleNodes.set(r,i)}else e.weight=10,this.tripleNodes.set(r,[e])},this.copyState=function(){var 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:te,type2color:ee,transform:se}},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)&&(te=t.colorIndex,ee=_.cloneDeep(t.type2color)),angular.isDefined(t.transform)&&(se=d3.zoomIdentity.translate(t.transform.x,t.transform.y).scale(t.transform.k)),we()}}e.datasource={get:function(t,n,r){return x.initLazyList(t,n,r,Y,e.propertiesObj.items)},revision:function(){return X}},m.when(v.getPrincipal()).then((function(t){return function(t){var 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;var r=b.get(k.GRAPHS_VIZ);if(r&&"object"===p(r))try{e.saveSettings=r,void 0===e.saveSettings.includeSchema&&(e.saveSettings.includeSchema=e.defaultSettings.includeSchema,e.saveSettings.rejectedPredicates=[].concat(l(e.saveSettings.rejectedPredicates),l(e.defaultSettings.rejectedPredicates)).unique())}catch(t){e.saveSettings=_.cloneDeep(e.defaultSettings),b.set(k.GRAPHS_VIZ,e.saveSettings)}else e.saveSettings=_.cloneDeep(e.defaultSettings)}(t)})),e.showInfoPanel=!1;var ue=new de;function pe(t){!n.getActiveRepository()||e.hasInitedRepository&&!t||(e.hasInitedRepository=!0,t||e.getGraphConfigs(Q))}e.addedTag=function(t){return t.text.indexOf(":")<0?(f.warning(N.instant("graphexplore.absolute.prefixed.iri")),null):(t.text=function(e,t){if(!/^<?(http|urn).*>?/.test(e)){var n=e.split(":"),r=n[0],i=n[1];if(!angular.isUndefined(i)){var o=g.getNamespaceUriForPrefix(t,r);if(o)return o+i}}return e}(t.text,e.namespaces),e.pageslideExpanded=!0,t)},e.validateTag=function(e,t,n){if(e.text.indexOf(":")<0)return n?f.warning(N.instant("graphexplore.absolute.prefixed.iri.option"),t):f.warning(N.instant("graphexplore.absolute.prefixed.iri"),t),!1;var r=e.text.indexOf("*");if(r>=0){if(!n)return f.warning(N.instant("graphexplore.wildcards.not.allowed"),t),!1;if(r<e.text.length-1)return f.warning(N.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 u.isLicenseValid()},pe();var fe=d3.scaleLinear().domain([0,9]).range(["hsl(0, 100%, 75%)","hsl(360, 90%, 82%)"]).interpolate(d3.interpolateHslLong),he=d3.scaleLinear().domain([0,9]).range(["hsl(180, 50%, 75%)","hsl(540, 40%, 82%)"]).interpolate(d3.interpolateHslLong);e.getColor=function(e){angular.isUndefined(ee[e])&&(ee[e]=te,te++);var t=ee[e];return t>39?"#c2c2c2":t%2==0?fe(t/2):he(t/2)};var ge=d3.forceX(ce/2).strength(.005),me=d3.forceY(le/2).strength(.005),ye=d3.forceSimulation().force("x",ge).force("y",me),ve=d3.select(".main-container .graph-visualization").append("svg").attr("viewBox","0 0 "+ce+" "+le).attr("preserveAspectRatio","xMidYMid meet");ve.append("rect").attr("width",10*ce).attr("height",10*le).attr("x",-(10*ce-ce)/2).attr("y",-(10*le-le)/2).style("fill","none").style("pointer-events","all").call(re).on("click",(function(e){e.stopPropagation(),Ae(),ye.stop()}));var xe=0,Se=0,Ie=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=3.0.1-RC2").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 we(t){d3.selectAll("svg g").remove(),d3.selectAll(".d3-tip").remove(),d3.selectAll(".menu-events").remove(),J=ve.append("g").attr("class","nodes-container").attr("transform",(function(){return angular.isDefined(se)&&!t?se:""}));var n,o=Object(i.a)().attr("class","d3-tip").customPosition((function(){var e=oe.getBoundingClientRect();return{top:e.bottom+10+"px",left:e.left-30+"px"}})).html((function(t){var n="";return t.fixed&&(n+='<i class="icon-pin"></i> '),t.types.length>0?n+=t.types.map((function(t){return"<div> · ".concat(e.replaceIRIWithPrefix(t),"</div>")})).join(""):n+="<i>".concat(N.instant("visual.node.tooltip.no_types"),"</i>"),n})),s=function(e){var t="";return t+=_.join(_.map(e.predicates,(function(t,n){if(0===n)return Ge(t);if(n<10)return" · "+Ge(t);if(10===n){var r=function(e){return e.predicates.length-10}(e),i=r>1?r+" predicates":r+" predicate";return" · "+N.instant("graphexplore.tip.text",{textToShow:i})}})),"")},l=Object(i.a)().attr("class","d3-tip").customPosition((function(e){var t=n.getBoundingClientRect(),r=function(e){var t=s(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:r+"px"}})).html((function(e){return s(e)})),d=function(){h.cancel(void 0),h.cancel(xe),oe=null,o.hide(),Se=h((function(){Ae()}),500)};ve.call(o);ve.call(l);var u=ve.selectAll(".link"),p=ve.selectAll(".node"),g=d3.forceCollide((function(e){return e.size+5})).strength(.5),m=d3.forceManyBody().strength(-300),y=d3.forceCenter(ce/2,le/2);ye.nodes(ue.nodes).force("charge",m).force("collide",g).force("center",y).force("link",d3.forceLink(ue.links).distance((function(e){return e.source.isTriple||e.target.isTriple?0:function(e){var t=$("<span></span>"),n=e.predicates[0].split("/"),r=n[n.length-1];t.addClass("predicate-text").text(r),$("body").append(t);var i=t.width()+2*e.source.size+2*e.target.size+50;return t.remove(),.75*i}(e)+30*e.connectedness}))),J.append("defs").selectAll("marker").data(ue.links).enter().append("marker").attr("class","arrow-marker").attr("id",(function(e){return K(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=J.selectAll(".link").data(ue.links).enter().append("g").attr("class","link-wrapper").attr("id",(function(e){return Object(a.removeSpecialChars)(W(e))})).append("line").attr("class","link").style("stroke-width",1).style("fill","transparent").style("marker-end",(function(e){var t=K(e);return"url(#".concat(t,")")}));var v,x=J.selectAll(".link-wrapper").append("text").text((function(e){return je(e)})).attr("class",(function(e){return e.predicates.length>1||ue.tripleNodes.has(W(e))?"predicates":"predicate"})).attr("dy","-0.5em").style("text-anchor","middle").style("display",j().showLinksText?"":"none").on("mouseover",(function(e,t){e.stopPropagation(),function(e,t){h.cancel(void 0);var r=n=e.target;h((function(){n===r&&t.predicates.length>1&&l.show(t,n)}),300)}(e,t)})).on("mouseout",(function(){h.cancel(void 0),n=null,l.hide()})).on("click",(function(t,n){t.stopPropagation(),function(t,n){Ee();var r=W(n);if(1===n.predicates.length&&ue.tripleNodes.has(r)){ae=null;var i=ue.tripleNodes.get(r)[0];if(Le(i,this,t.button)){var o={};o.iri=i.iri,o.pred=Ge(i.iri.split(" ")[1]),Me(o)}return}!function(t){if(e.showNodeInfo=!1,e.showPredicates=t.predicates.length>1,e.showFilter=!1,e.showInfoPanel=!1,ae===t)return e.showNodeInfo=!1,e.showInfoPanel=!1,void(ae=null);ae=t,e.showPredicates&&(e.predicates=_.map(t.predicates,(function(e){var n=function(e,t){var n=W(t);return ue.tripleNodes.has(n)?ue.tripleNodes.get(n).findIndex((function(t){return t.iri.indexOf(e)>=0})):-1}(e,t),r=n>-1;return{value:Ge(e),partOfTriple:r,linkId:r?W(t):"",nodeIndex:n}})),e.showInfoPanel=!0)}(n)}(t,n)})),S=0,I=null,w=null,b=function(t,n,r){var i=r||this.parentNode;Array.isArray(r)&&(i=r[n]),ue.countLinks(t,ue.links)<=j().linksLimit?Ne(t,!1,i):f.info(N.instant("graphexplore.increase.limit"),N.instant("graphexplore.node.at.max")),e.closeInfoPanel()};function k(e,t){var n,r,i,o,a=!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,a=!1}var s=J.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=s),a&&(s=s.transition().duration(1e3).style("font-size",(function(){return r+"px"})).attr("opacity",o),"down-fixed"!==t&&s.remove())}var L=d3.drag().subject((function(e){return e})).on("start",(function(e,t){if(A.isActive())return;0===e.sourceEvent.button&&(t.fixedBeforeDrag=t.fixed,t.isBeingDragged=!0,t.beginDragging=!0,Ae(),d3.select(this).classed("dragging",!0),ye.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));ye.alphaTarget(0)}));p=J.selectAll(".node").data(ue.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,n){var r=this;n.isBeingDragged||(h.cancel(Se),xe=h((function(){(function(t,n){if(e.showInfoPanel)return!1;(ke.closeIcon||ke.expandIcon||ke.focusIcon||ke.copyURIIcon)&&ke.removeIcons();if(ye.alpha()<.1)return ke.initIcons(t,n.parentNode),ye.stop(),be(),!0;return!1})(n,r)&&function(e,t){h.cancel(void 0);var n=oe=t.target;h((function(){oe===n&&o.show(e,oe)}),300)}(n,t)}),400))})).on("mouseout",d).on("click",(function(t,n){if(!t.button||0===t.button){var r=this;if(I&&w===r)return h.cancel(I),I=null,void b(n,0,r.parentNode);w=r,d(),e.showPredicates=!1,A.isActive()||(h.cancel(I),I=h((function(){Le(n,r,t),I=null}),540))}})).on("touchstart",(function(e,t){return function(e){S=0,v=h((function(){S<5&&Ce(e),v=null}),1e3)}(t)})).on("touchmove",(function(){S++})).on("touchend",(function(){h.cancel(v),v=null})).on("contextmenu",(function(t,n){t.shiftKey||(t.preventDefault(),Ae(),e.closeInfoPanel(),n.fixed?(e.numberOfPinnedNodes--,n.fixed=!1,n.fx=null,n.fy=null,k(n,"up"),ye.alpha(1).restart()):(e.numberOfPinnedNodes++,n.fixed=!0,k(n,"down")),function(e){oe&&o.show(e,oe)}(n))})).on("gdb-expand-node",(function(e,t){return b(t,0,e.srcElement.parentNode)})).on("gdb-show-node-info",(function(e,t){return Pe(t)})).call(L);var C=J.selectAll(".node-wrapper").append("foreignObject").style("pointer-events","none").attr("width",(function(e){return 2*e.size*1.75}));J.insert("g").attr("class","menu-events"),function(e){e.each((function(e){e.fontSize=r.a.Text.calcFontSizeRaw(e.labels[0].label,e.size,ne,!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").html((function(e){return c.HtmlUtil.getText(e.labels[0].label).replaceAll("\n","<br>")}))}(C),ye.on("tick",(function(){u.attr("x1",(function(e){return q(e.source)})).attr("y1",(function(e){return V(e.source)})).attr("x2",(function(e){return q(e.target)})).attr("y2",(function(e){return V(e.target)})),x.attr("x",(function(e){var t=q(e.source),n=q(e.target);return e.x=.5*(t+n)})).attr("y",(function(e){var t=V(e.source),n=V(e.target);return e.y=.5*(t+n)})).attr("transform",(function(e){return"rotate("+function(e,t){var n={x:q(e.source),y:V(e.source)},r={x:q(e.target),y:V(e.target)};if(t)return 180*Math.atan2(r.y-n.y,r.x-n.x)/Math.PI;var i=180*Math.atan2(r.y-n.y,r.x-n.x)/Math.PI;return i<=90&&i>=-90?i:(i>0?-1:1)*(180-Math.abs(i))}(e,e.direction)+", "+e.x+", "+e.y+")"})),p.attr("cx",(function(e){return e.x})).attr("cy",(function(e){return e.y})),J.select(".node-loader").attr("x",(function(e){return e.x-e.size+3})).attr("y",(function(e){return e.y-e.size})),J.select(".loader-container").attr("cx",(function(e){return e.x})).attr("cy",(function(e){return e.y})),C.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})),be()})),angular.isDefined(Ie)&&Ie.setLoadingState(!1),e.loading&&(e.loading=!1),d3.selectAll(".link-wrapper").each((function(){var e=$(this).attr("id").split(">")[0],t=$(this).attr("id").split(">")[1];d3.selectAll(".link").each((function(n){var r=Object(a.removeSpecialChars)(n.source.iri),i=Object(a.removeSpecialChars)(n.target.iri);if(r===t&&i===e){var o=r;o+=">",o+=i;var s=document.createTextNode(" ⟶");document.getElementById(o).lastChild.appendChild(s),n.direction="double"}}))})),d3.selectAll(".d3-actions-tip").remove(),ye.alpha(.3).restart()}function be(){t.d3alpha=ye.alpha()}var ke=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){var a=Object(i.a)().attr("class","d3-tip d3-actions-tip").customPosition((function(e,t){var n=t.target.getBoundingClientRect();return{top:n.top-20+"px",left:n.right+10+"px"}})).html((function(e){return e}));ve.call(a);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,ue.removeNodeLeafLinks(e),we()})).on("mouseover",(function(e){a.show(this.getAttribute("name"),e),h.cancel(xe),h.cancel(Se)})).on("mouseout",(function(){a.hide(),Se=h((function(){Ae()}),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(){Ne(r,!1,o)})).on("mouseover",(function(e){a.show(this.getAttribute("name"),e),h.cancel(Se),h.cancel(xe)})).on("mouseout",(function(){a.hide(),Se=h((function(){Ae()}),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){a.show(this.getAttribute("name"),e),h.cancel(Se),h.cancel(xe)})).on("mouseout",(function(){a.hide(),Se=h((function(){Ae()}),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),Ae(),a.hide()})).on("mouseover",(function(e){a.show("<div style='text-align: center;'><b>Copy to ClipBoard</b><br>"+r.iri+"</div>",e),h.cancel(Se),h.cancel(xe)})).on("mouseout",(function(){a.hide(),Se=h((function(){Ae()}),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(){Ce(r)})).on("mouseover",(function(e){a.show(this.getAttribute("name"),e),h.cancel(Se),h.cancel(xe)})).on("mouseout",(function(){a.hide(),Se=h((function(){Ae()}),500)})),this.animateMenu(r)},this.animateMenu=function(e){var t=d3.easeSin,r=0,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 n(i+=30,e)})).delay(r+=35),this.focusIcon.transition().duration(100).style("opacity",1).ease(t).attr("transform",(function(){return n(i+=30,e)})).delay(r+=35),this.closeIcon.transition().duration(100).style("opacity",1).ease(t).attr("transform",(function(){return n(i+=30,e)})).delay(r+=35),this.expandedState=!0}};function Le(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?(Ce(n),!1):void 0!==e.openedNodeInfoPanel&&e.openedNodeInfoPanel===n?(e.pageslideExpanded=!1,e.openedNodeInfoPanel=void 0,!1):(Pe(n),!0)}function Ce(e){ue.removeNode(e),we()}function Te(t){!function(t){e.nodeSelected=!0,null===t.data.types&&(t.data.types="greyColor"),ue=new de,se=ie}(t),_e(t)}function _e(t,n,r){var i=t.data;i=_.filter(i,(function(e){return-1===_.findIndex(ue.links,(function(t){return e.source===t.source.iri&&e.target===t.target.iri}))}));for(var o=[],a=ue.tripleLinksCopy.values(),s=0;s<ue.tripleLinksCopy.size;s++){a.next().value.forEach((function(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}));for(var c,l,d,u=(c="iri",l=_.union(_.flatten(_.map(t.data,(function(e){return[{iri:e.source,isTriple:e.isTripleSource},{iri:e.target,isTriple:e.isTripleTarget}]})))),d=l.map((function(e){return e[c]})),l.filter((function(e,t){return d.indexOf(e[c])===t}))),p=_.map(ue.nodes,(function(e){return{iri:e.iri,isTriple:Boolean(e.isTriple)}})),h=ue.tripleNodes.values(),g=0;g<ue.tripleNodes.size;g++){h.next().value.forEach((function(e){p.push({iri:e.iri,isTriple:e.isTriple})}))}var y=_.reject(u,(function(e){return _.some(p,e)}));if(0===y.length)(r||0===i.length)&&f.info(N.instant("graphexplore.error.node.connections")),ue.addAndMatchLinks(i),we();else{var v=[],x=[],S=j();_.forEach(y,(function(t,n){v.push(T.getInstanceNode({iri:t.isTriple?H(t.iri):t.iri,config:e.configLoaded.id,languages:e.shouldShowSettings()?S.languages:[],includeInferred:S.includeInferred,sameAsState:S.sameAsState}).then((function(e){x[n]=e.data})))})),m.all(v).then((function(){_.forEach(x,(function(e,t){var r=2*Math.PI*t/x.length,i=(n?n.x:0)+Math.cos(r)*le/3,o=(n?n.y:0)+Math.sin(r)*le/3;e.isTriple?ue.addTriple(e,i,o):ue.addNode(e,i,o)})),ue.addAndMatchLinks(i),n&&(n.isExpanded=!0),we()}))}}function Ne(t,n,r){if(!Ie.getLoadingState()){Ie.init(t,r);var i=j(),o=t.iri;T.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){_e(e,t,n)}),(function(t){var n=getError(t.data);f.error(n,N.instant("graphexplore.error.exploring.node")),e.loading=!1,Ie.setLoadingState(!1)}))}}function Ae(){angular.isDefined(ke)&&ke.expandedState&&ke.removeIcons()}function Pe(t){ye.stop(),e.openedNodeInfoPanel=t,e.showNodeInfo=!0,e.showFilter=!1,e.showPredicates=!1,e.nodeLabels=t.labels,e.nodeTypes=t.types,e.rdfRank=t.rdfRank,e.nodeIri=t.iri,e.resourceType=t.isTriple?"triple":"uri",e.encodedIri=t.isTriple?encodeURIComponent(H(t.iri)):encodeURIComponent(t.iri),e.showInfoPanel=!0,e.rdfsLabel=t.labels[0].label,e.rdfsComment=t.comment,e.expanded=!1,e.propertiesQueryObj.query="",e.dataNodeKeysQuery="";var n=j();T.getProperties({iri:t.isTriple?H(t.iri):t.iri,config:e.configLoaded.id,languages:e.shouldShowSettings()?n.languages:[],includeInferred:n.includeInferred,sameAsState:n.sameAsState,rejectedPredicates:e.shouldShowSettings()?n.rejectedPredicates:[]}).then((function(t){e.data=_.mapKeys(t.data,(function(t,n){return e.replaceIRIWithPrefix(n)})),e.propertiesObj.items=[],_.forEach(e.data,(function(t,n){e.propertiesObj.items.push({key:n,value:t})})),e.nodeImage=void 0,e.propertiesNotFiltered=e.propertiesObj.items;var 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){f.warning(getError(e.data),"Error")}))}function Me(e){Oe("predicate","var(--primary-color-dark)",e),Oe("predicates","var(--primary-color-dark)",e);var t=document.getElementsByClassName("link");t&&_.each(t,(function(t){var 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)}));var n=document.getElementsByClassName("arrow-marker");n&&_.each(n,(function(t){var 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 Oe(e,t,n){var r=document.getElementsByClassName(e);r&&_.each(r,(function(e){var r=e.__data__;n?((r.source.iri.indexOf(n.iri)>=0||r.target.iri.indexOf(n.iri)>=0)&&(e.style.fill=t),U(n.iri)===W(r)&&(e.textContent=n.pred,e.style.fill=t),n.oppLinkIRI&&n.oppLinkIRI===W(r)&&(e.textContent=n.oppTriplePred,e.style.fill=t)):(e.style.fill=t,e.textContent=je(r))}))}function Ee(){_.each(e.predicates,(function(e){var t=document.getElementById(e.linkId+e.nodeIndex);t&&(t.style.fontWeight="normal")}));var t=document.getElementsByClassName("link");t&&_.each(t,(function(e){e.style.stroke="#999",e.style.strokeWidth=1})),Oe("predicate",""),Oe("predicates","");var n=document.getElementsByClassName("arrow-marker");n&&_.each(n,(function(e){e.style.stroke="#999",e.__data__.target.isTriple||e.setAttribute("refX","59")}))}function Re(e){var t=U(e);if(ue.tripleNodes.has(t))return ue.tripleNodes.get(t).find((function(t){return t.iri===e}))}function je(e){return e.predicates.length>1?e.predicates.length+" predicates":Ge(e.predicates[0])}function Ge(t){var 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=[],ae=null,h((function(){e.showInfoPanel=!1}))},e.clickLink=function(t){if(ue.tripleNodes.has(t.linkId)){Ee();var n=ue.tripleNodes.get(t.linkId)[t.nodeIndex];Pe(n),e.showPredicates=!0;var r=document.getElementById(t.linkId+t.nodeIndex);r&&(r.style.fontWeight="bold");for(var i={},o=ue.tripleLinksCopy.values(),a=function(){var e=o.next().value;e.length>1&&e.every((function(t){return t.source.iri===n.iri?(i.iri=e[0].source.iri,t.target.isTriple&&(i.oppLinkIRI=U(t.target.iri),i.oppTriplePred=Ge(t.target.iri.split(" ")[1])),i.pred=Ge(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=U(t.source.iri),i.oppTriplePred=Ge(t.source.iri.split(" ")[1])),i.pred=Ge(n.iri.split(" ")[1]),1===t.predicates.length&&(i.linkPred=t.predicates[0]),!1)}))},s=0;s<ue.tripleLinksCopy.size;s++)a();i.iri||(i.iri=n.iri,i.pred=Ge(n.iri.split(" ")[1])),Me(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){Ae();var t=10*(e?1:-1)*Math.PI/180,n=Math.cos(t),r=Math.sin(t),i=ce/2,o=le/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)})),ye.alpha(1).restart()},e.openUri=function(t,n){if(!n){var r={};e.configLoaded.id!==e.defaultGraphConfig.id&&(r.config=e.configLoaded.id),r.uri=t,E(r,{uri:t,config:e.configLoaded})}e.$broadcast("onRootNodeChange",t)},e.saveOrUpdateGraph=function(){var t=JSON.stringify(ue.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})};var ze=function(t){L.editSavedGraph(t).success((function(){e.lastSavedGraphName=t.name,e.shared=t.shared,e.refreshSavedGraphs(),f.success(N.instant("graphexplore.saved.graph.was.edited",{name:t.name}))})).error((function(e){var t=getError(e);f.error(t,N.instant("graphexplore.error.cannot.edit"))}))};e.saveGraphModal=function(t,n,r){I.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),L.addNewSavedGraph(t).success((function(n,r,i){e.lastSavedGraphName=t.name,e.lastSavedGraphId=i()["x-saved-graph-id"],e.shared=t.shared,e.refreshSavedGraphs(),f.success(N.instant("graphexplore.saved.graph",{name:t.name}))})).error((function(n,r){if(422===r)e.saveGraphModal("new",t,!0);else{var i=getError(n);f.error(i,N.instant("graphexplore.error.cannot.create.graph"))}}))}(t.graph);break;case"update":case"rename":ze(t.graph)}}))},e.refreshSavedGraphs=function(){L.getSavedGraphs().success((function(t){e.savedGraphs=t})).error((function(e){var t=getError(e);f.error(t,N.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),y.url("?saved="+t.id),ue.restoreState(JSON.parse(t.data)),n||E({saved:t.id},{savedGraph:t})},e.copyToClipboardSavedGraph=function(t){var n=[location.protocol,"//",location.host,location.pathname,"?saved=",t.id].join("");e.copyToClipboard(n)},e.deleteSavedGraph=function(t){S.openSimpleModal({title:N.instant("common.confirm"),message:N.instant("graphexplore.confirm.delete.graph",{graphName:t.name}),warning:!0}).result.then((function(){!function(t){L.deleteSavedGraph(t).success((function(){e.refreshSavedGraphs(),f.success(N.instant("graphexplore.saved.graph.was.deleted",{name:t.name}))})).error((function(e){var t=getError(e);f.error(t,N.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(){Ae();var 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)})),ye.alpha(1).restart()},$("body").on("keydown",(function(t){!A.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 h(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",f).controller("SaveGraphModalCtrl",h).config(["$uibTooltipProvider",function(e){e.options({appendToBody:!0})}]),f.$inject=["$scope","$rootScope","$repositories","$licenseService","toastr","$timeout","ClassInstanceDetailsService","$q","$location","$jwtAuth","UiScrollService","ModalService","$uibModal","$window","LocalStorageAdapter","LSKeys","SavedGraphsRestService","GraphConfigRestService","GraphDataRestService","$translate","GuidesService","WorkbenchContextService","RDF4JRepositoriesService"],h.$inject=["$scope","$uibModalInstance","data","$translate"]},634:function(e,t,n){var r,i;r=[n(644)],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(644)),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(){var e=this.parentNode.firstChild;e&&this.parentNode.insertBefore(this,e)}))},d3}.apply(t,r))||(e.exports=i)},647:function(e,t,n){"use strict";n(634);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(){var e=function(e,n){for(var r,i=1,o=arguments.length;++i<o;)e[r=arguments[i]]=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,a,s;(a=n,s=d3.pointer(document.body),Math.sqrt(Math.pow(a[0]-s[0],2),Math.pow(a[1]-s[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},658:function(e,t,n){"use strict";t.a=function(){var e=function(){return"n"},t=function(){return[0,0]},n=function(){return" "},r=u(),i=null,o=null,a=null,s=null;function c(e){var t;i="svg"===(t=(t=e).node()).tagName.toLowerCase()?t:t.ownerSVGElement,o=i.createSVGPoint(),document.body.appendChild(r)}c.show=function(){var r=Array.prototype.slice.call(arguments);r[r.length-1]instanceof SVGElement&&(a=r.pop());var i,o=n.apply(this,r),u=t.apply(this,r),f=e.apply(this,r),h=p(),g=d.length,m=document.documentElement.scrollTop||document.body.scrollTop,y=document.documentElement.scrollLeft||document.body.scrollLeft,v=s.apply(this,r);for(h.html(o).style("opacity",1).style("pointer-events","all");g--;)h.classed(d[g],!1);var x=r.filter((function(e){return e instanceof Event}));return i=l.get(f).apply(this,x),v?Object.keys(v).forEach((function(e){h.style(e,v[e])})):h.classed(f,!0).style("top",i.top+u[0]+m+"px").style("left",i.left+u[1]+y+"px"),c},c.hide=function(){return p().style("opacity",0).style("pointer-events","none"),c},c.attr=function(e,t){if(arguments.length<2&&"string"==typeof e)return p().attr(e);var n=Array.prototype.slice.call(arguments);return d3.selection.prototype.attr.apply(p(),n),c},c.style=function(e,t){if(arguments.length<2&&"string"==typeof e)return p().style(e);var n=Array.prototype.slice.call(arguments);return d3.selection.prototype.style.apply(p(),n),c},c.direction=function(t){return arguments.length?(e=null==t?t: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?(s=null==e?e:h(e),c):s},c.destroy=function(){return r&&(p().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 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 p(){return null===r&&(r=u(),document.body.appendChild(r)),d3.select(r)}function f(e){for(var t=a||e.target;void 0===t.getScreenCTM&&"undefined"===t.parentNode;)t=t.parentNode;var n={},r=t.getScreenCTM(),i=t.getBBox(),s=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+=s,n.ne=o.matrixTransform(r),o.y+=c,n.se=o.matrixTransform(r),o.x-=s,n.sw=o.matrixTransform(r),o.y-=c/2,n.w=o.matrixTransform(r),o.x+=s,n.e=o.matrixTransform(r),o.x-=s/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([[49,348,391],{120: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 a}));var r=n(24),i=function(e){return e.replace(/[()']/g,"")},o=function(e){return"string"==typeof e?"true"===e:Boolean(e)},a=function(e){return e?Object(r.upperFirst)(e.toLowerCase()):e}},159:function(e,t,n){"use strict";n.r(t),n.d(t,"STATIC_RULESETS",(function(){return r})),n.d(t,"REPOSITORY_TYPES",(function(){return i})),n.d(t,"FILENAME_PATTERN",(function(){return o})),n.d(t,"NUMBER_PATTERN",(function(){return a}));var r=[{id:"empty",name:"No inference"},{id:"rdfs-optimized",name:"RDFS (Optimized)"},{id:"rdfs",name:"RDFS"},{id:"rdfsplus-optimized",name:"RDFS-Plus (Optimized)"},{id:"owl-horst-optimized",name:"OWL-Horst (Optimized)"},{id:"owl-horst",name:"OWL-Horst"},{id:"owl2-ql-optimized",name:"OWL2-QL (Optimized)"},{id:"owl2-ql",name:"OWL2-QL"},{id:"owl-max-optimized",name:"OWL-Max (Optimized)"},{id:"owl-max",name:"OWL-Max"},{id:"owl2-rl-optimized",name:"OWL2-RL (Optimized)"},{id:"owl2-rl",name:"OWL2-RL"}],i={graphdbRepo:"graphdb",free:"free",eeWorker:"worker",eeMaster:"master",ontop:"ontop",se:"se",fedx:"fedx"},o=new RegExp("^[a-zA-Z0-9-_]+$"),a=new RegExp("^[0-9]+$")},302:function(e,t,n){"use strict";n.r(t);n(10),n(29),n(60);var r=n(647),i=n(658),o=(n(15),n(159)),a=n(120),s=n(11),c=n(42);function l(e){return function(e){if(Array.isArray(e))return u(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||d(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function d(e,t){if(e){if("string"==typeof e)return u(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?u(e,t):void 0}}function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function p(e){return(p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function f(e,t,n,u,f,h,g,m,y,v,x,S,I,w,b,k,L,C,T,N,A,P,M){e.languageChanged=!1,e.propertiesObj={},e.propertiesObj.items=[],e.propertiesQueryObj={},e.propertiesQueryObj.query="",e.propertiesSearchPlaceholder=N.instant("visual.search.instance.placeholder"),e.propertiesNotFiltered=[],e.searchVisible=!1,e.nodeSelected=!1,e.queryResultsMode=!1,e.embedded=y.search().embedded,e.openedNodeInfoPanel=void 0,e.invalidLimit=!1,e.INVALID_LINKS_MSG=N.instant("sidepanel.invalid.limit.links.msg"),e.INVALID_LINKS_TOOLTIP=N.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=function(){return angular.noop()},e.goToHome=function(){R(),y.url("graphs-visualizations")},e.shouldShowSettings=function(){return e.configLoaded&&e.configLoaded.id===e.defaultGraphConfig.id},e.shouldDisableSameAs=function(){var 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=function(t){return t.key.toLowerCase().indexOf(e.propertiesQueryObj.query.toLowerCase())>=0},e.toggleMoreInfo=function(e){angular.element(e.currentTarget).parent().next().toggle(200),angular.element(e.currentTarget).children("span").toggleClass("icon-caret-down").toggleClass("icon-caret-up")},e.copyToClipboard=function(e){S.openCopyToClipboardModal(e)},e.resetSettings=function(){e.settings=_.cloneDeep(e.defaultSettings),e.validateLinksLimit(),z()},e.changeLimit=function(t){var n=e.settings.linksLimit+t;n<1&&(n=1),n>1e3&&(n=1e3),e.settings.linksLimit=n},e.validateLinksLimit=function(){e.invalidLimit=!o.NUMBER_PATTERN.test(e.settings.linksLimit)},e.showSettings=function(){e.showInfoPanel=!0,e.showFilter=!0,e.showNodeInfo=!1,e.showPredicates=!1,e.saveSettings?e.settings=_.cloneDeep(e.saveSettings):e.settings=_.cloneDeep(e.defaultSettings),z()},e.updateSettings=function(){e.invalidLimit?f.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?D(e.rootNodeIri):e.queryResultsMode&&y.search().query?B(y.search().query,y.search().sameAs,y.search().inference):"query"===e.configLoaded.startMode&&Z(e.configLoaded),G(),e.showInfoPanel=!1,e.showFilter=!1,b.set(k.GRAPHS_VIZ,e.saveSettings))},e.getGraphConfigs=function(t){C.getGraphConfigs().success((function(n){e.graphConfigs=n,t&&t()})).error((function(e){f.error(getError(e),N.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=function(t){e.configLoaded=e.defaultGraphConfig,e.openUri(t)},e.deleteConfig=function(t){S.openSimpleModal({title:N.instant("common.confirm"),message:N.instant("graphexplore.delete.graph",{configName:t.name}),warning:!0}).result.then((function(){C.deleteGraphConfig(t).success((function(){e.getGraphConfigs(),e.refreshSavedGraphs()})).error((function(e){f.error(getError(e),N.instant("graphexplore.error.cannot.delete.config"))}))}))},e.goToGraphConfig=function(e){E({config:e.id},{config:e}),R(),Z(e)},e.replaceIRIWithPrefix=function(t){var n=e.namespaces,r=_.findLast(n,(function(e){return 0===t.indexOf(e.uri)}));return r?r.prefix+":"+t.substring(r.uri.length):t};var O=[];O.push(t.$on("$translateChangeSuccess",(function(){e.INVALID_LINKS_MSG=N.instant("sidepanel.invalid.limit.links.msg"),e.INVALID_LINKS_TOOLTIP=N.instant("sidepanel.invalid.limit.links.tooltip"),e.propertiesSearchPlaceholder=N.instant("visual.search.instance.placeholder")}))),O.push(P.onAutocompleteEnabledUpdated((function(t){e.isAutocompleteEnabled=t}))),O.push(P.onSelectedRepositoryIdUpdated((function(t){t?M.getNamespaces(t).then((function(t){e.repositoryNamespaces=t,e.namespaces=t.namespaces})).catch((function(e){var t=getError(e);f.error(t,N.instant("error.getting.namespaces.for.repo"))})):e.repositoryNamespaces=new s.NamespacesListModel}))),O.push(e.$on("repositoryIsSet",(function(t,n){n.newRepo&&(e.hasInitedRepository=!1),pe(n.newRepo),n.newRepo&&(R(),$(".graph-visualization svg").empty(),y.search().query&&(e.goToHome(),F()))})));O.push(t.$watch((function(){return t.key}),(function(){Y=0,_.each(e.propertiesObj.items,(function(e){t.key>e&&Y++})),X++})));O.push(e.$watch("propertiesObj.items",(function(){angular.isDefined(e.propertiesObj.items)&&e.propertiesObj.items.length>0&&h((function(){e.adapterContainer.adapter.reload()}),500)})));e.$on("$destroy",(function(){O.forEach((function(e){return e()}))}));var E=function(t,n){e.embedded&&(t.embedded=!0),y.search(t),y.state(n)},R=function(){e.searchVisible=!1,e.nodeSelected=!1,e.configLoaded=null,e.queryResultsMode=!1,e.lastSavedGraphName=null,e.lastSavedGraphId=null,e.shared=!1,e.numberOfPinnedNodes=0,ee={},te=0},j=function(){return A.isActive()?e.defaultSettings:e.saveSettings},G=function(){j().showLinksText?d3.selectAll("svg .link-wrapper text").style("display","block"):d3.selectAll("svg .link-wrapper text").style("display","none")},z=function(){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}}))},D=function(){e.rootNodeIri&&e.$broadcast("onRootNodeChange",e.rootNodeIri)},F=function(){y.search().query?(e.searchVisible=!1,e.queryResultsMode=!0,B(y.search().query,y.search().sameAs,y.search().inference)):e.$on("onRootNodeChange",(function(t,n){e.loading=!0;var r=j();angular.isDefined(n)&&(e.rootNodeIri=n,T.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");var n=(ue=new de).addNode(t.data,ce/2,le/2);se=ie,Ne(n,!0)})).catch((function(t){e.loading=!1,f.error(getError(t),N.instant("graphexplore.error.could.not.load.graph"))})))})),y.search().uri&&e.openUri(y.search().uri,!0),y.search().saved&&L.getSavedGraph(y.search().saved).success((function(t){e.loadSavedGraph(t)})).error((function(e){var t=getError(e);f.error(t,N.instant("graphexplore.error.could.not.open"))}))},B=function(t,n,r){var i=j(),o=void 0===n?i.sameAsState:!0===n,a=void 0===r?i.includeInferred:!0===r;e.loading=!0,T.updateGraph({query:t,linksLimit:i.linksLimit,languages:e.shouldShowSettings()?i.languages:[],includeInferred:a,sameAsState:o}).then((function(e){Te(e)}),(function(t){e.loading=!1,f.error(getError(t.data),N.instant("graphexplore.error.cannot.load.graph"))}))},U=function(e,t){var n=e.split(" ");return t?[n[0],n[1],n[2]].join(">"):[n[0],n[2]].join(">")},W=function(e){return[e.source.iri,e.target.iri].join(">")},q=function(e){if(e.isTriple){var t=document.getElementById(Object(a.removeSpecialChars)(U(e.iri)));if(t&&void 0!==t.__data__.x)return t.__data__.x}return e.x},V=function(e){if(e.isTriple){var t=document.getElementById(Object(a.removeSpecialChars)(U(e.iri)));if(t&&void 0!==t.__data__.y)return t.__data__.y}return e.y},H=function(e){var t=e.trim().split(" ");return"<<<".concat(t[0],"> <").concat(t[1],"> <").concat(t[2],">>>")},K=function(e){var t=e.source.isTriple?U(e.source.iri,!0):e.source.iri,n=e.target.isTriple?U(e.target.iri,!0):e.target.iri;return Object(a.removeSpecialChars)("".concat(t,">").concat(n,">marker"))},Z=function(t){e.configLoaded=t,"search"===t.startMode?e.searchVisible=!0:"node"===t.startMode&&t.startIRI?h((function(){e.openUri(t.startIRI,!0)}),0):"query"===t.startMode&&t.startGraphQuery&&(e.loading=!0,C.loadGraphForConfig(t,t.startQueryIncludeInferred,j().linksLimit,t.startQuerySameAs).then((function(e){Te(e)}),(function(t){e.loading=!1,f.error(getError(t),N.instant("graphexplore.error.graph.load"))})))},Q=function(){var t,n;y.search().config?(t=y.search().config,n=F,t===e.defaultGraphConfig.id?Z(e.defaultGraphConfig):C.getConfig(t).then((function(e){Z(e),n()})).catch((function(e){f.error(getError(e),N.instant("graphexplore.error.could.not.load.config",{configId:t}))}))):y.search().query||y.search().uri?(Z(e.defaultGraphConfig),F()):F()};w.onpopstate=function(t){R(),t.state&&(t.state.config?(Z(t.state.config),t.state.uri&&e.openUri(t.state.uri,!0)):t.state.savedGraph&&e.loadSavedGraph(t.state.savedGraph,!0))},e.embedded&&(y.search().query||y.search().uri||y.search().config||y.search().saved)&&(e.noGoHome=!0);var J,Y=0,X=0,ee={},te=0,ne=16,re=d3.zoom().scaleExtent([.1,10]),ie=d3.zoomIdentity.translate(0,-70).scale(1);re.on("zoom",(function(e){A.isActive()||(se=e.transform,J.attr("transform",se))}));var oe,ae,se=ie,ce=1e3,le=1e3;function de(){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(){var e={},t={};_.each(this.links,(function(n){var 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){var t=this.nodes;Array.prototype.push.apply(this.links,function(e,t){return _.map(e,(function(e){var n={source:e.isTripleSource?Re(e.source):_.find(t,(function(t){return t.iri===e.source})),target:e.isTripleTarget?Re(e.target):_.find(t,(function(t){return t.iri===e.target})),predicates:e.predicates};if(e.isTripleSource||e.isTripleTarget){var r=n.source.isTriple?U(n.source.iri):n.source.iri,i=n.target.isTriple?U(n.target.iri):n.target.iri,o="".concat(r,">").concat(i);if(ue.tripleLinksCopy.has(o)){var a,s=ue.tripleLinksCopy.get(o);return(a=s[0].predicates).push.apply(a,l(n.predicates)),s.push(n),ue.tripleLinksCopy.set(o,s),null}ue.tripleLinksCopy.set(o,[n])}return n}))}(e,t));var n,r=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=d(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}(ue.tripleLinksCopy.keys());try{for(r.s();!(n=r.n()).done;){var i=n.value;1===ue.tripleLinksCopy.get(i).length&&ue.tripleLinksCopy.delete(i)}}catch(e){r.e(e)}finally{r.f()}this.links=this.links.filter((function(e){return null!==e})),this.computeConnectedness()};var 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){var 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){var r=n(e,t),i=_.map(r,(function(e){return e.predicates}));return _.uniq(_.flatten(i))},this.removeTriples=function(e){var t=this,n=[];this.tripleNodes.size>0&&e.forEach((function(e){t.tripleNodes.has(e)&&(t.tripleNodes.delete(e),t.links=_.reject(t.links,(function(t){var r=e.split(">"),i=U(t.source.iri),o=U(t.target.iri);if(i===e&&ue.tripleNodes.delete(o)){var a=o.split(">");n.push({source:a[0],target:a[1]})}var s=i===e||o===e||t.source.iri===r[0]&&t.target.iri===r[1];return s&&(ue.tripleLinksCopy.delete("".concat(i,">").concat(o)),ue.tripleLinksCopy.delete("".concat(o,">").concat(i))),s})))})),n.forEach((function(e){t.links=_.reject(t.links,(function(t){return t.source.iri===e.source&&t.target.iri===e.target}))}))},this.removeNode=function(n){var r=[];this.links=_.reject(this.links,(function(e){var t=e.source.iri===n.iri||e.target.iri===n.iri;return t&&(e.target.isTriple&&r.push(U(e.target.iri)),e.source.isTriple||e.target.isTriple||r.push([e.source.iri,e.target.iri].join(">"))),t})),this.removeTriples(r);var 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){var r=[],i=this.links;this.links=_.reject(this.links,(function(o){var a=o.source.iri===e.iri&&1===t(o.target,i)&&!o.target.isTriple||o.target.iri===e.iri&&1===t(o.source,i)&&!o.source.isTriple;if(!a){var s;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||(s=n(o.source,i)):s=n(o.target,i),!s)return!1;a=(s[0].source.iri===e.iri||s[0].target.iri)&&(s[1].source.iri===e.iri||s[1].target.iri)}return a&&(o.target.isTriple&&r.push(U(o.target.iri)),o.source.isTriple||o.target.isTriple||r.push([o.source.iri,o.target.iri].join(">"))),a})),this.removeTriples(r),i=this.links,this.nodes=_.reject(this.nodes,(function(n){return 0===t(n,i)&&n.iri!==e.iri})),this.computeConnectedness()},this.addTriple=function(e,t,n){e.x=t,e.y=n,e.weight=0;var r=U(e.iri);if(this.tripleNodes.has(r)){var i=this.tripleNodes.get(r);i.push(e),this.tripleNodes.set(r,i)}else e.weight=10,this.tripleNodes.set(r,[e])},this.copyState=function(){var 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:te,type2color:ee,transform:se}},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)&&(te=t.colorIndex,ee=_.cloneDeep(t.type2color)),angular.isDefined(t.transform)&&(se=d3.zoomIdentity.translate(t.transform.x,t.transform.y).scale(t.transform.k)),we()}}e.datasource={get:function(t,n,r){return x.initLazyList(t,n,r,Y,e.propertiesObj.items)},revision:function(){return X}},m.when(v.getPrincipal()).then((function(t){return function(t){var 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;var r=b.get(k.GRAPHS_VIZ);if(r&&"object"===p(r))try{e.saveSettings=r,void 0===e.saveSettings.includeSchema&&(e.saveSettings.includeSchema=e.defaultSettings.includeSchema,e.saveSettings.rejectedPredicates=[].concat(l(e.saveSettings.rejectedPredicates),l(e.defaultSettings.rejectedPredicates)).unique())}catch(t){e.saveSettings=_.cloneDeep(e.defaultSettings),b.set(k.GRAPHS_VIZ,e.saveSettings)}else e.saveSettings=_.cloneDeep(e.defaultSettings)}(t)})),e.showInfoPanel=!1;var ue=new de;function pe(t){!n.getActiveRepository()||e.hasInitedRepository&&!t||(e.hasInitedRepository=!0,t||e.getGraphConfigs(Q))}e.addedTag=function(t){return t.text.indexOf(":")<0?(f.warning(N.instant("graphexplore.absolute.prefixed.iri")),null):(t.text=function(e,t){if(!/^<?(http|urn).*>?/.test(e)){var n=e.split(":"),r=n[0],i=n[1];if(!angular.isUndefined(i)){var o=g.getNamespaceUriForPrefix(t,r);if(o)return o+i}}return e}(t.text,e.namespaces),e.pageslideExpanded=!0,t)},e.validateTag=function(e,t,n){if(e.text.indexOf(":")<0)return n?f.warning(N.instant("graphexplore.absolute.prefixed.iri.option"),t):f.warning(N.instant("graphexplore.absolute.prefixed.iri"),t),!1;var r=e.text.indexOf("*");if(r>=0){if(!n)return f.warning(N.instant("graphexplore.wildcards.not.allowed"),t),!1;if(r<e.text.length-1)return f.warning(N.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 u.isLicenseValid()},pe();var fe=d3.scaleLinear().domain([0,9]).range(["hsl(0, 100%, 75%)","hsl(360, 90%, 82%)"]).interpolate(d3.interpolateHslLong),he=d3.scaleLinear().domain([0,9]).range(["hsl(180, 50%, 75%)","hsl(540, 40%, 82%)"]).interpolate(d3.interpolateHslLong);e.getColor=function(e){angular.isUndefined(ee[e])&&(ee[e]=te,te++);var t=ee[e];return t>39?"#c2c2c2":t%2==0?fe(t/2):he(t/2)};var ge=d3.forceX(ce/2).strength(.005),me=d3.forceY(le/2).strength(.005),ye=d3.forceSimulation().force("x",ge).force("y",me),ve=d3.select(".main-container .graph-visualization").append("svg").attr("viewBox","0 0 "+ce+" "+le).attr("preserveAspectRatio","xMidYMid meet");ve.append("rect").attr("width",10*ce).attr("height",10*le).attr("x",-(10*ce-ce)/2).attr("y",-(10*le-le)/2).style("fill","none").style("pointer-events","all").call(re).on("click",(function(e){e.stopPropagation(),Ae(),ye.stop()}));var xe=0,Se=0,Ie=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=3.0.1").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 we(t){d3.selectAll("svg g").remove(),d3.selectAll(".d3-tip").remove(),d3.selectAll(".menu-events").remove(),J=ve.append("g").attr("class","nodes-container").attr("transform",(function(){return angular.isDefined(se)&&!t?se:""}));var n,o=Object(i.a)().attr("class","d3-tip").customPosition((function(){var e=oe.getBoundingClientRect();return{top:e.bottom+10+"px",left:e.left-30+"px"}})).html((function(t){var n="";return t.fixed&&(n+='<i class="icon-pin"></i> '),t.types.length>0?n+=t.types.map((function(t){return"<div> · ".concat(e.replaceIRIWithPrefix(t),"</div>")})).join(""):n+="<i>".concat(N.instant("visual.node.tooltip.no_types"),"</i>"),n})),s=function(e){var t="";return t+=_.join(_.map(e.predicates,(function(t,n){if(0===n)return Ge(t);if(n<10)return" · "+Ge(t);if(10===n){var r=function(e){return e.predicates.length-10}(e),i=r>1?r+" predicates":r+" predicate";return" · "+N.instant("graphexplore.tip.text",{textToShow:i})}})),"")},l=Object(i.a)().attr("class","d3-tip").customPosition((function(e){var t=n.getBoundingClientRect(),r=function(e){var t=s(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:r+"px"}})).html((function(e){return s(e)})),d=function(){h.cancel(void 0),h.cancel(xe),oe=null,o.hide(),Se=h((function(){Ae()}),500)};ve.call(o);ve.call(l);var u=ve.selectAll(".link"),p=ve.selectAll(".node"),g=d3.forceCollide((function(e){return e.size+5})).strength(.5),m=d3.forceManyBody().strength(-300),y=d3.forceCenter(ce/2,le/2);ye.nodes(ue.nodes).force("charge",m).force("collide",g).force("center",y).force("link",d3.forceLink(ue.links).distance((function(e){return e.source.isTriple||e.target.isTriple?0:function(e){var t=$("<span></span>"),n=e.predicates[0].split("/"),r=n[n.length-1];t.addClass("predicate-text").text(r),$("body").append(t);var i=t.width()+2*e.source.size+2*e.target.size+50;return t.remove(),.75*i}(e)+30*e.connectedness}))),J.append("defs").selectAll("marker").data(ue.links).enter().append("marker").attr("class","arrow-marker").attr("id",(function(e){return K(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=J.selectAll(".link").data(ue.links).enter().append("g").attr("class","link-wrapper").attr("id",(function(e){return Object(a.removeSpecialChars)(W(e))})).append("line").attr("class","link").style("stroke-width",1).style("fill","transparent").style("marker-end",(function(e){var t=K(e);return"url(#".concat(t,")")}));var v,x=J.selectAll(".link-wrapper").append("text").text((function(e){return je(e)})).attr("class",(function(e){return e.predicates.length>1||ue.tripleNodes.has(W(e))?"predicates":"predicate"})).attr("dy","-0.5em").style("text-anchor","middle").style("display",j().showLinksText?"":"none").on("mouseover",(function(e,t){e.stopPropagation(),function(e,t){h.cancel(void 0);var r=n=e.target;h((function(){n===r&&t.predicates.length>1&&l.show(t,n)}),300)}(e,t)})).on("mouseout",(function(){h.cancel(void 0),n=null,l.hide()})).on("click",(function(t,n){t.stopPropagation(),function(t,n){Ee();var r=W(n);if(1===n.predicates.length&&ue.tripleNodes.has(r)){ae=null;var i=ue.tripleNodes.get(r)[0];if(Le(i,this,t.button)){var o={};o.iri=i.iri,o.pred=Ge(i.iri.split(" ")[1]),Me(o)}return}!function(t){if(e.showNodeInfo=!1,e.showPredicates=t.predicates.length>1,e.showFilter=!1,e.showInfoPanel=!1,ae===t)return e.showNodeInfo=!1,e.showInfoPanel=!1,void(ae=null);ae=t,e.showPredicates&&(e.predicates=_.map(t.predicates,(function(e){var n=function(e,t){var n=W(t);return ue.tripleNodes.has(n)?ue.tripleNodes.get(n).findIndex((function(t){return t.iri.indexOf(e)>=0})):-1}(e,t),r=n>-1;return{value:Ge(e),partOfTriple:r,linkId:r?W(t):"",nodeIndex:n}})),e.showInfoPanel=!0)}(n)}(t,n)})),S=0,I=null,w=null,b=function(t,n,r){var i=r||this.parentNode;Array.isArray(r)&&(i=r[n]),ue.countLinks(t,ue.links)<=j().linksLimit?Ne(t,!1,i):f.info(N.instant("graphexplore.increase.limit"),N.instant("graphexplore.node.at.max")),e.closeInfoPanel()};function k(e,t){var n,r,i,o,a=!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,a=!1}var s=J.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=s),a&&(s=s.transition().duration(1e3).style("font-size",(function(){return r+"px"})).attr("opacity",o),"down-fixed"!==t&&s.remove())}var L=d3.drag().subject((function(e){return e})).on("start",(function(e,t){if(A.isActive())return;0===e.sourceEvent.button&&(t.fixedBeforeDrag=t.fixed,t.isBeingDragged=!0,t.beginDragging=!0,Ae(),d3.select(this).classed("dragging",!0),ye.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));ye.alphaTarget(0)}));p=J.selectAll(".node").data(ue.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,n){var r=this;n.isBeingDragged||(h.cancel(Se),xe=h((function(){(function(t,n){if(e.showInfoPanel)return!1;(ke.closeIcon||ke.expandIcon||ke.focusIcon||ke.copyURIIcon)&&ke.removeIcons();if(ye.alpha()<.1)return ke.initIcons(t,n.parentNode),ye.stop(),be(),!0;return!1})(n,r)&&function(e,t){h.cancel(void 0);var n=oe=t.target;h((function(){oe===n&&o.show(e,oe)}),300)}(n,t)}),400))})).on("mouseout",d).on("click",(function(t,n){if(!t.button||0===t.button){var r=this;if(I&&w===r)return h.cancel(I),I=null,void b(n,0,r.parentNode);w=r,d(),e.showPredicates=!1,A.isActive()||(h.cancel(I),I=h((function(){Le(n,r,t),I=null}),540))}})).on("touchstart",(function(e,t){return function(e){S=0,v=h((function(){S<5&&Ce(e),v=null}),1e3)}(t)})).on("touchmove",(function(){S++})).on("touchend",(function(){h.cancel(v),v=null})).on("contextmenu",(function(t,n){t.shiftKey||(t.preventDefault(),Ae(),e.closeInfoPanel(),n.fixed?(e.numberOfPinnedNodes--,n.fixed=!1,n.fx=null,n.fy=null,k(n,"up"),ye.alpha(1).restart()):(e.numberOfPinnedNodes++,n.fixed=!0,k(n,"down")),function(e){oe&&o.show(e,oe)}(n))})).on("gdb-expand-node",(function(e,t){return b(t,0,e.srcElement.parentNode)})).on("gdb-show-node-info",(function(e,t){return Pe(t)})).call(L);var C=J.selectAll(".node-wrapper").append("foreignObject").style("pointer-events","none").attr("width",(function(e){return 2*e.size*1.75}));J.insert("g").attr("class","menu-events"),function(e){e.each((function(e){e.fontSize=r.a.Text.calcFontSizeRaw(e.labels[0].label,e.size,ne,!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").html((function(e){return c.HtmlUtil.getText(e.labels[0].label).replaceAll("\n","<br>")}))}(C),ye.on("tick",(function(){u.attr("x1",(function(e){return q(e.source)})).attr("y1",(function(e){return V(e.source)})).attr("x2",(function(e){return q(e.target)})).attr("y2",(function(e){return V(e.target)})),x.attr("x",(function(e){var t=q(e.source),n=q(e.target);return e.x=.5*(t+n)})).attr("y",(function(e){var t=V(e.source),n=V(e.target);return e.y=.5*(t+n)})).attr("transform",(function(e){return"rotate("+function(e,t){var n={x:q(e.source),y:V(e.source)},r={x:q(e.target),y:V(e.target)};if(t)return 180*Math.atan2(r.y-n.y,r.x-n.x)/Math.PI;var i=180*Math.atan2(r.y-n.y,r.x-n.x)/Math.PI;return i<=90&&i>=-90?i:(i>0?-1:1)*(180-Math.abs(i))}(e,e.direction)+", "+e.x+", "+e.y+")"})),p.attr("cx",(function(e){return e.x})).attr("cy",(function(e){return e.y})),J.select(".node-loader").attr("x",(function(e){return e.x-e.size+3})).attr("y",(function(e){return e.y-e.size})),J.select(".loader-container").attr("cx",(function(e){return e.x})).attr("cy",(function(e){return e.y})),C.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})),be()})),angular.isDefined(Ie)&&Ie.setLoadingState(!1),e.loading&&(e.loading=!1),d3.selectAll(".link-wrapper").each((function(){var e=$(this).attr("id").split(">")[0],t=$(this).attr("id").split(">")[1];d3.selectAll(".link").each((function(n){var r=Object(a.removeSpecialChars)(n.source.iri),i=Object(a.removeSpecialChars)(n.target.iri);if(r===t&&i===e){var o=r;o+=">",o+=i;var s=document.createTextNode(" ⟶");document.getElementById(o).lastChild.appendChild(s),n.direction="double"}}))})),d3.selectAll(".d3-actions-tip").remove(),ye.alpha(.3).restart()}function be(){t.d3alpha=ye.alpha()}var ke=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){var a=Object(i.a)().attr("class","d3-tip d3-actions-tip").customPosition((function(e,t){var n=t.target.getBoundingClientRect();return{top:n.top-20+"px",left:n.right+10+"px"}})).html((function(e){return e}));ve.call(a);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,ue.removeNodeLeafLinks(e),we()})).on("mouseover",(function(e){a.show(this.getAttribute("name"),e),h.cancel(xe),h.cancel(Se)})).on("mouseout",(function(){a.hide(),Se=h((function(){Ae()}),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(){Ne(r,!1,o)})).on("mouseover",(function(e){a.show(this.getAttribute("name"),e),h.cancel(Se),h.cancel(xe)})).on("mouseout",(function(){a.hide(),Se=h((function(){Ae()}),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){a.show(this.getAttribute("name"),e),h.cancel(Se),h.cancel(xe)})).on("mouseout",(function(){a.hide(),Se=h((function(){Ae()}),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),Ae(),a.hide()})).on("mouseover",(function(e){a.show("<div style='text-align: center;'><b>Copy to ClipBoard</b><br>"+r.iri+"</div>",e),h.cancel(Se),h.cancel(xe)})).on("mouseout",(function(){a.hide(),Se=h((function(){Ae()}),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(){Ce(r)})).on("mouseover",(function(e){a.show(this.getAttribute("name"),e),h.cancel(Se),h.cancel(xe)})).on("mouseout",(function(){a.hide(),Se=h((function(){Ae()}),500)})),this.animateMenu(r)},this.animateMenu=function(e){var t=d3.easeSin,r=0,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 n(i+=30,e)})).delay(r+=35),this.focusIcon.transition().duration(100).style("opacity",1).ease(t).attr("transform",(function(){return n(i+=30,e)})).delay(r+=35),this.closeIcon.transition().duration(100).style("opacity",1).ease(t).attr("transform",(function(){return n(i+=30,e)})).delay(r+=35),this.expandedState=!0}};function Le(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?(Ce(n),!1):void 0!==e.openedNodeInfoPanel&&e.openedNodeInfoPanel===n?(e.pageslideExpanded=!1,e.openedNodeInfoPanel=void 0,!1):(Pe(n),!0)}function Ce(e){ue.removeNode(e),we()}function Te(t){!function(t){e.nodeSelected=!0,null===t.data.types&&(t.data.types="greyColor"),ue=new de,se=ie}(t),_e(t)}function _e(t,n,r){var i=t.data;i=_.filter(i,(function(e){return-1===_.findIndex(ue.links,(function(t){return e.source===t.source.iri&&e.target===t.target.iri}))}));for(var o=[],a=ue.tripleLinksCopy.values(),s=0;s<ue.tripleLinksCopy.size;s++){a.next().value.forEach((function(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}));for(var c,l,d,u=(c="iri",l=_.union(_.flatten(_.map(t.data,(function(e){return[{iri:e.source,isTriple:e.isTripleSource},{iri:e.target,isTriple:e.isTripleTarget}]})))),d=l.map((function(e){return e[c]})),l.filter((function(e,t){return d.indexOf(e[c])===t}))),p=_.map(ue.nodes,(function(e){return{iri:e.iri,isTriple:Boolean(e.isTriple)}})),h=ue.tripleNodes.values(),g=0;g<ue.tripleNodes.size;g++){h.next().value.forEach((function(e){p.push({iri:e.iri,isTriple:e.isTriple})}))}var y=_.reject(u,(function(e){return _.some(p,e)}));if(0===y.length)(r||0===i.length)&&f.info(N.instant("graphexplore.error.node.connections")),ue.addAndMatchLinks(i),we();else{var v=[],x=[],S=j();_.forEach(y,(function(t,n){v.push(T.getInstanceNode({iri:t.isTriple?H(t.iri):t.iri,config:e.configLoaded.id,languages:e.shouldShowSettings()?S.languages:[],includeInferred:S.includeInferred,sameAsState:S.sameAsState}).then((function(e){x[n]=e.data})))})),m.all(v).then((function(){_.forEach(x,(function(e,t){var r=2*Math.PI*t/x.length,i=(n?n.x:0)+Math.cos(r)*le/3,o=(n?n.y:0)+Math.sin(r)*le/3;e.isTriple?ue.addTriple(e,i,o):ue.addNode(e,i,o)})),ue.addAndMatchLinks(i),n&&(n.isExpanded=!0),we()}))}}function Ne(t,n,r){if(!Ie.getLoadingState()){Ie.init(t,r);var i=j(),o=t.iri;T.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){_e(e,t,n)}),(function(t){var n=getError(t.data);f.error(n,N.instant("graphexplore.error.exploring.node")),e.loading=!1,Ie.setLoadingState(!1)}))}}function Ae(){angular.isDefined(ke)&&ke.expandedState&&ke.removeIcons()}function Pe(t){ye.stop(),e.openedNodeInfoPanel=t,e.showNodeInfo=!0,e.showFilter=!1,e.showPredicates=!1,e.nodeLabels=t.labels,e.nodeTypes=t.types,e.rdfRank=t.rdfRank,e.nodeIri=t.iri,e.resourceType=t.isTriple?"triple":"uri",e.encodedIri=t.isTriple?encodeURIComponent(H(t.iri)):encodeURIComponent(t.iri),e.showInfoPanel=!0,e.rdfsLabel=t.labels[0].label,e.rdfsComment=t.comment,e.expanded=!1,e.propertiesQueryObj.query="",e.dataNodeKeysQuery="";var n=j();T.getProperties({iri:t.isTriple?H(t.iri):t.iri,config:e.configLoaded.id,languages:e.shouldShowSettings()?n.languages:[],includeInferred:n.includeInferred,sameAsState:n.sameAsState,rejectedPredicates:e.shouldShowSettings()?n.rejectedPredicates:[]}).then((function(t){e.data=_.mapKeys(t.data,(function(t,n){return e.replaceIRIWithPrefix(n)})),e.propertiesObj.items=[],_.forEach(e.data,(function(t,n){e.propertiesObj.items.push({key:n,value:t})})),e.nodeImage=void 0,e.propertiesNotFiltered=e.propertiesObj.items;var 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){f.warning(getError(e.data),"Error")}))}function Me(e){Oe("predicate","var(--primary-color-dark)",e),Oe("predicates","var(--primary-color-dark)",e);var t=document.getElementsByClassName("link");t&&_.each(t,(function(t){var 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)}));var n=document.getElementsByClassName("arrow-marker");n&&_.each(n,(function(t){var 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 Oe(e,t,n){var r=document.getElementsByClassName(e);r&&_.each(r,(function(e){var r=e.__data__;n?((r.source.iri.indexOf(n.iri)>=0||r.target.iri.indexOf(n.iri)>=0)&&(e.style.fill=t),U(n.iri)===W(r)&&(e.textContent=n.pred,e.style.fill=t),n.oppLinkIRI&&n.oppLinkIRI===W(r)&&(e.textContent=n.oppTriplePred,e.style.fill=t)):(e.style.fill=t,e.textContent=je(r))}))}function Ee(){_.each(e.predicates,(function(e){var t=document.getElementById(e.linkId+e.nodeIndex);t&&(t.style.fontWeight="normal")}));var t=document.getElementsByClassName("link");t&&_.each(t,(function(e){e.style.stroke="#999",e.style.strokeWidth=1})),Oe("predicate",""),Oe("predicates","");var n=document.getElementsByClassName("arrow-marker");n&&_.each(n,(function(e){e.style.stroke="#999",e.__data__.target.isTriple||e.setAttribute("refX","59")}))}function Re(e){var t=U(e);if(ue.tripleNodes.has(t))return ue.tripleNodes.get(t).find((function(t){return t.iri===e}))}function je(e){return e.predicates.length>1?e.predicates.length+" predicates":Ge(e.predicates[0])}function Ge(t){var 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=[],ae=null,h((function(){e.showInfoPanel=!1}))},e.clickLink=function(t){if(ue.tripleNodes.has(t.linkId)){Ee();var n=ue.tripleNodes.get(t.linkId)[t.nodeIndex];Pe(n),e.showPredicates=!0;var r=document.getElementById(t.linkId+t.nodeIndex);r&&(r.style.fontWeight="bold");for(var i={},o=ue.tripleLinksCopy.values(),a=function(){var e=o.next().value;e.length>1&&e.every((function(t){return t.source.iri===n.iri?(i.iri=e[0].source.iri,t.target.isTriple&&(i.oppLinkIRI=U(t.target.iri),i.oppTriplePred=Ge(t.target.iri.split(" ")[1])),i.pred=Ge(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=U(t.source.iri),i.oppTriplePred=Ge(t.source.iri.split(" ")[1])),i.pred=Ge(n.iri.split(" ")[1]),1===t.predicates.length&&(i.linkPred=t.predicates[0]),!1)}))},s=0;s<ue.tripleLinksCopy.size;s++)a();i.iri||(i.iri=n.iri,i.pred=Ge(n.iri.split(" ")[1])),Me(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){Ae();var t=10*(e?1:-1)*Math.PI/180,n=Math.cos(t),r=Math.sin(t),i=ce/2,o=le/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)})),ye.alpha(1).restart()},e.openUri=function(t,n){if(!n){var r={};e.configLoaded.id!==e.defaultGraphConfig.id&&(r.config=e.configLoaded.id),r.uri=t,E(r,{uri:t,config:e.configLoaded})}e.$broadcast("onRootNodeChange",t)},e.saveOrUpdateGraph=function(){var t=JSON.stringify(ue.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})};var ze=function(t){L.editSavedGraph(t).success((function(){e.lastSavedGraphName=t.name,e.shared=t.shared,e.refreshSavedGraphs(),f.success(N.instant("graphexplore.saved.graph.was.edited",{name:t.name}))})).error((function(e){var t=getError(e);f.error(t,N.instant("graphexplore.error.cannot.edit"))}))};e.saveGraphModal=function(t,n,r){I.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),L.addNewSavedGraph(t).success((function(n,r,i){e.lastSavedGraphName=t.name,e.lastSavedGraphId=i()["x-saved-graph-id"],e.shared=t.shared,e.refreshSavedGraphs(),f.success(N.instant("graphexplore.saved.graph",{name:t.name}))})).error((function(n,r){if(422===r)e.saveGraphModal("new",t,!0);else{var i=getError(n);f.error(i,N.instant("graphexplore.error.cannot.create.graph"))}}))}(t.graph);break;case"update":case"rename":ze(t.graph)}}))},e.refreshSavedGraphs=function(){L.getSavedGraphs().success((function(t){e.savedGraphs=t})).error((function(e){var t=getError(e);f.error(t,N.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),y.url("?saved="+t.id),ue.restoreState(JSON.parse(t.data)),n||E({saved:t.id},{savedGraph:t})},e.copyToClipboardSavedGraph=function(t){var n=[location.protocol,"//",location.host,location.pathname,"?saved=",t.id].join("");e.copyToClipboard(n)},e.deleteSavedGraph=function(t){S.openSimpleModal({title:N.instant("common.confirm"),message:N.instant("graphexplore.confirm.delete.graph",{graphName:t.name}),warning:!0}).result.then((function(){!function(t){L.deleteSavedGraph(t).success((function(){e.refreshSavedGraphs(),f.success(N.instant("graphexplore.saved.graph.was.deleted",{name:t.name}))})).error((function(e){var t=getError(e);f.error(t,N.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(){Ae();var 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)})),ye.alpha(1).restart()},$("body").on("keydown",(function(t){!A.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 h(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",f).controller("SaveGraphModalCtrl",h).config(["$uibTooltipProvider",function(e){e.options({appendToBody:!0})}]),f.$inject=["$scope","$rootScope","$repositories","$licenseService","toastr","$timeout","ClassInstanceDetailsService","$q","$location","$jwtAuth","UiScrollService","ModalService","$uibModal","$window","LocalStorageAdapter","LSKeys","SavedGraphsRestService","GraphConfigRestService","GraphDataRestService","$translate","GuidesService","WorkbenchContextService","RDF4JRepositoriesService"],h.$inject=["$scope","$uibModalInstance","data","$translate"]},634:function(e,t,n){var r,i;r=[n(644)],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(644)),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(){var e=this.parentNode.firstChild;e&&this.parentNode.insertBefore(this,e)}))},d3}.apply(t,r))||(e.exports=i)},647:function(e,t,n){"use strict";n(634);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(){var e=function(e,n){for(var r,i=1,o=arguments.length;++i<o;)e[r=arguments[i]]=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,a,s;(a=n,s=d3.pointer(document.body),Math.sqrt(Math.pow(a[0]-s[0],2),Math.pow(a[1]-s[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},658:function(e,t,n){"use strict";t.a=function(){var e=function(){return"n"},t=function(){return[0,0]},n=function(){return" "},r=u(),i=null,o=null,a=null,s=null;function c(e){var t;i="svg"===(t=(t=e).node()).tagName.toLowerCase()?t:t.ownerSVGElement,o=i.createSVGPoint(),document.body.appendChild(r)}c.show=function(){var r=Array.prototype.slice.call(arguments);r[r.length-1]instanceof SVGElement&&(a=r.pop());var i,o=n.apply(this,r),u=t.apply(this,r),f=e.apply(this,r),h=p(),g=d.length,m=document.documentElement.scrollTop||document.body.scrollTop,y=document.documentElement.scrollLeft||document.body.scrollLeft,v=s.apply(this,r);for(h.html(o).style("opacity",1).style("pointer-events","all");g--;)h.classed(d[g],!1);var x=r.filter((function(e){return e instanceof Event}));return i=l.get(f).apply(this,x),v?Object.keys(v).forEach((function(e){h.style(e,v[e])})):h.classed(f,!0).style("top",i.top+u[0]+m+"px").style("left",i.left+u[1]+y+"px"),c},c.hide=function(){return p().style("opacity",0).style("pointer-events","none"),c},c.attr=function(e,t){if(arguments.length<2&&"string"==typeof e)return p().attr(e);var n=Array.prototype.slice.call(arguments);return d3.selection.prototype.attr.apply(p(),n),c},c.style=function(e,t){if(arguments.length<2&&"string"==typeof e)return p().style(e);var n=Array.prototype.slice.call(arguments);return d3.selection.prototype.style.apply(p(),n),c},c.direction=function(t){return arguments.length?(e=null==t?t: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?(s=null==e?e:h(e),c):s},c.destroy=function(){return r&&(p().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 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 p(){return null===r&&(r=u(),document.body.appendChild(r)),d3.select(r)}function f(e){for(var t=a||e.target;void 0===t.getScreenCTM&&"undefined"===t.parentNode;)t=t.parentNode;var n={},r=t.getScreenCTM(),i=t.getBBox(),s=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+=s,n.ne=o.matrixTransform(r),o.y+=c,n.se=o.matrixTransform(r),o.x-=s,n.sw=o.matrixTransform(r),o.y-=c/2,n.w=o.matrixTransform(r),o.x+=s,n.e=o.matrixTransform(r),o.x-=s/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([[490],{628:function(module,exports){module.exports=function(obj){obj||(obj={});var __t,__p="";with(obj)__p+='<link href="css/ttyg/no-agents-view.css?v=3.0.1
|
|
1
|
+
(window.webpackJsonp=window.webpackJsonp||[]).push([[490],{628:function(module,exports){module.exports=function(obj){obj||(obj={});var __t,__p="";with(obj)__p+='<link href="css/ttyg/no-agents-view.css?v=3.0.1" rel="stylesheet"/>\n\n<div class="no-agents-view-component">\n <div class="content">\n <div class="alert alert-help mb-3" ng-bind-html="\'ttyg.agent.messages.help_1\' | translate | trustAsHtml"></div>\n <div class="alert alert-help mb-3" ng-bind-html="\'ttyg.agent.messages.help_2\' | translate | trustAsHtml"></div>\n\n <div class="actions">\n <button class="btn btn-outline-primary btn-lg text-xs-left create-agent-btn"\n gdb-tooltip="{{!canModifyAgent ? (\'ttyg.agent.fat_btn.create_agent.tooltip_disabled\' | translate) : \'\'}}"\n ng-disabled="!canModifyAgent"\n ng-click="onCreateAgent()" guide-selector="create-agent-btn">\n <i class="fa fa-message-bot fa-xl"></i>\n <span class="text">{{\'ttyg.agent.fat_btn.create_agent.label\' | translate}}</span>\n </button>\n </div>\n\n <div class="alert alert-warning mt-3">\n <div ng-bind-html="\'ttyg.agent.messages.help_config\' | translate: {talkToGraphDocumentationLink: talkToGraphDocumentationLink} | trustAsHtml"></div>\n </div>\n </div>\n</div>\n';return __p}}}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(window.webpackJsonp=window.webpackJsonp||[]).push([[491],{629:function(module,exports){module.exports=function(obj){obj||(obj={});var __t,__p="";with(obj)__p+='<link href="css/ttyg/ttyg.css?v=3.0.1
|
|
1
|
+
(window.webpackJsonp=window.webpackJsonp||[]).push([[491],{629:function(module,exports){module.exports=function(obj){obj||(obj={});var __t,__p="";with(obj)__p+='<link href="css/ttyg/ttyg.css?v=3.0.1" rel="stylesheet"/>\n\n<div class="ttyg-view" ng-class="{\'help-visible\': isHelpVisible}">\n <h1 id="ttyg-view-title">\n {{ title }}\n <page-info-tooltip></page-info-tooltip>\n </h1>\n\n <div core-errors></div>\n\n <div uib-collapse="!isHelpVisible" class="alert alert-info">\n <button type="button" ng-click="isHelpVisible = false" gdb-tooltip="{{\'common.close\' | translate}}" class="close"\n aria-label="Close"></button>\n <div ng-include="helpTemplateUrl"></div>\n </div>\n\n <div onto-loader-new\n ng-show="loadingAgents"\n class="ttyg-page-loader"\n size="100">\n </div>\n\n <no-agents-view ng-cloak ng-if="initialized && getActiveRepository() && !loadingAgents && !reloadingAgents && (!agents || agents.isEmpty())"></no-agents-view>\n\n <div id="ttyg-container" class="ttyg-container" ng-show="getActiveRepository() && !loadingAgents && agents && !agents.isEmpty()">\n\n <div id="left-sidebar" class="left-sidebar sidebar" ng-class="showChats ? \'expanded\' : \'collapsed\'">\n <div class="toolbar">\n <button class="btn btn-link btn-sm toggle-chats-sidebar-btn"\n ng-if="true"\n ng-click="toggleChatsListSidebar()"\n ng-disabled="false"\n gdb-tooltip="{{\'ttyg.chat.btn.\' + (showChats ? \'close_sidebar\' : \'open_sidebar\') + \'.tooltip\' | translate}}">\n <i class="fa fa-sidebar"></i>\n </button>\n <button class="btn btn-link btn-sm create-chat-btn" guide-selector="create-chat-btn"\n ng-if="chats && !chats.isEmpty()"\n ng-click="startNewChat()"\n ng-disabled="false"\n gdb-tooltip="{{\'ttyg.chat.btn.create_chat.tooltip\' | translate}}">\n <i class="fa fa-pen-to-square"></i>\n </button>\n </div>\n <pageslide\n ps-class="chat-list-panel slide-panel"\n ps-container="left-sidebar"\n ps-open="showChats"\n onopen="onopen"\n onclose="onclose"\n ps-side="left"\n ps-click-outside="false"\n ps-size="80vw">\n <div class="sidebar-content">\n <chat-list ng-if="chats"></chat-list>\n <div class="chat-list-panel-loader" ng-if="!chats && loadingChats">\n <div onto-loader-fancy message="{{\'ttyg.chat.loading_chats\' | translate}}"\n size="25"></div>\n </div>\n </div>\n </pageslide>\n </div>\n\n <div class="chat-content">\n <div class="chat">\n <div class="toolbar mb-2">\n <agent-select-menu class="mr-1"></agent-select-menu>\n <button class="btn btn-link btn-sm edit-current-agent-btn mr-1" guide-selector="edit-current-agent"\n ng-if="selectedAgent"\n ng-click="onOpenAgentSettings()"\n ng-disabled="!canModifyAgent"\n gdb-tooltip="{{ (canModifyAgent ? \'ttyg.agent.btn.edit_agent.tooltip\' : \'ttyg.agent.btn.edit_agent.tooltip_disabled\') | translate}}">\n <i class="icon-settings"></i>\n </button>\n </div>\n\n <div uib-collapse="!isCollapsed" id="ot-help-text" class="alert alert-info">\n <button type="button" ng-click="isCollapsed = false" gdb-tooltip="{{\'common.close\' | translate}}"\n class="close"\n aria-label="Close"></button>\n <div ng-include="helpTemplateUrl"></div>\n </div>\n\n <chat-panel class="selected-chat-panel"></chat-panel>\n </div>\n </div>\n\n <div id="right-sidebar" class="right-sidebar sidebar" ng-class="showAgents ? \'expanded\' : \'collapsed\'">\n <div class="toolbar">\n <button class="btn btn-link btn-sm help-btn"\n ng-if="true"\n ng-click="onToggleHelp()"\n ng-disabled="false"\n gdb-tooltip="{{\'ttyg.help.btn.show_help.tooltip\' | translate}}">\n <i class="icon-help"></i>\n </button>\n <button class="btn btn-link btn-sm create-agent-btn"\n ng-disabled="!canModifyAgent"\n ng-click="onOpenNewAgentSettings()"\n ng-disabled="false"\n gdb-tooltip="{{ (canModifyAgent ? \'ttyg.agent.btn.create_agent.tooltip\' : \'ttyg.agent.btn.create_agent.tooltip_disabled\') | translate}}"\n guide-selector="create-agent-btn">\n <i class="icon-plus"></i>\n </button>\n <button class="btn btn-link btn-sm toggle-agents-sidebar-btn"\n ng-if="!showAgents"\n ng-click="toggleAgentsListSidebar()"\n ng-disabled="!canModifyAgent"\n gdb-tooltip="{{\'ttyg.agent.btn.open_sidebar.\' + (canModifyAgent ? \'tooltip\' : \'tooltip_disabled\') | translate}}">\n <i class="fa fa-message-bot"></i>\n </button>\n <button class="btn btn-link btn-sm toggle-agents-sidebar-btn"\n ng-if="showAgents"\n ng-click="toggleAgentsListSidebar()"\n ng-disabled="false"\n gdb-tooltip="{{\'ttyg.agent.btn.close_sidebar\' + \'.tooltip\' | translate}}">\n <i class="icon-close"></i>\n </button>\n </div>\n\n <pageslide\n ps-class="agent-list-panel slide-panel"\n ps-container="right-sidebar"\n ps-open="showAgents"\n onopen="onopen"\n onclose="onclose"\n ps-side="right"\n ps-click-outside="false"\n ps-size="80vw">\n <div class="sidebar-content">\n <agent-list ng-if="agents && agentListFilterModel.length && !reloadingAgents" agent-list="agents"\n agent-list-filter-model="agentListFilterModel"></agent-list>\n <div ng-if="reloadingAgents" onto-loader-fancy message="{{\'ttyg.agent.loading_agents\' | translate}}"\n class="agent-list-loader"\n size="25" style="display: flex;"></div>\n </div>\n </pageslide>\n </div>\n </div>\n</div>\n';return __p}}}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(window.webpackJsonp=window.webpackJsonp||[]).push([[50],{304:function(e,t,n){"use strict";n.r(t);var r=n(658),a=n(684),i=n(647),o=n(648);n(15);function s(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return l(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?l(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,i=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw i}}}}function l(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function c(e,t,n,l,c,d,u,f,h,p,y,v,g){return{restrict:"AE",template:'<div id="classChart"></div>',scope:{classHierarchyData:"=",flattenedClassNames:"=",selectedClass:"=",currentSliderValue:"=",showClassInfoPanel:"=",showExternalElements:"=",hidePrefixes:"=",currentBrowserLimit:"="},link:function(u,m,x){!function(u,m){var x,w,S=d3.pack().size([780,780]),C=d3.scaleLinear().domain([0,4]).range(["hsl(19, 70%, 90%)","hsl(19, 70%, 50%)"]).interpolate(d3.interpolateHcl),E=d3.select("#classChart").insert("svg:svg","h2").attr("viewBox","0 0 800 800").attr("preserveAspectRatio","xMidYMid meet").on("dblclick.zoom",null);function T(){return E.append("svg:g").attrs({id:"main-group",transform:"translate(400,400)"})}function A(){return"true"===y.get(v.CLASS_HIERARCHY_HIDE_PREFIXES)}function R(){var e=o.a.Export.getCSSRules("css/rdf-class-hierarchy-labels.css?v=3.0.1-RC2");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-"+d.getActiveRepository()+".svg"})}u.hidePrefixes=A();var b,H,I=T();if(!u.classHierarchyData.classCount&&d.getActiveRepository()&&!d.isSystemRepository()){e.loader=!0,e.hierarchyError=!1;var P=y.get("classHierarchy-selectedGraph-".concat(d.getActiveRepository()));n.getClassHierarchyData(null!==P?P.contextID.uri:"").success((function(t,n,r){e.loader=!1,207===n&&f.warning(g.instant("graphexplore.update.diagram"),g.instant("graphexplore.repository.data.changed")),u.classHierarchyData=t,d3.select("#download-svg").on("mouseover",R)})).error((function(t){e.loader=!1,e.hierarchyError=getError(t),f.error(g.instant("graphexplore.error.request.failed",{name:p,error:getError(t)}))}))}var k,L,N,D,F,O,z,U={};function M(n,o,s,d){L&&L(),N&&N(),d3.selectAll("#main-group").remove(),I=T(),a.a.SingleChild.addPlaceholders(n,!0),(w=d3.hierarchy(n)).sum((function(e){return e.size})),k=s||w,S(w);var f,y=w.descendants();k.isInFocusTransitive=!0,a.a.SingleChild.removePlaceholders(y),a.a.SingleChild.centerNodes(y),a.a.SingleChild.makePositionsRelativeToZero(y),x||(x=Object(r.a)().attr("class","d3-tip").customPosition((function(e,t){return{top:"inherit",bottom:l.innerHeight-t.clientY+"px",right:l.innerWidth-t.clientX+"px"}})).html((function(e){return e.data.name})),E.call(x));var v=I.selectAll("circle").data(y).enter().append("g");o.doFade&&v.each((function(e){i.a.Transition.fadeIn(d3.select(this),550)}));var g,m=[],A=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?C(e.depth):"#E0D0D0"})).each((function(e){if(e.circle=d3.select(this),e.data.name!==p){var t=e.data.name;m.push({name:t}),U[[t]]=e,e.circle.classed("rdf-class",!0),e.circle.on("mouseover",(function(t){o.noPrefixes||e.textHidden?x.show(e,t):x.hide(e)})),e.circle.on("mouseout",x.hide)}})).on("gdb-focus",(function(e,t){return H(t)})).on("gdb-zoom",(function(e,t){return W(t)}));function R(e){d3.selectAll(".selected").classed("selected",e.selected=!1),e.circle.classed("selected",e.selected=!0),g=e}function P(){u.showClassInfoPanel=!1}m&&(m=_.uniqBy(m,"name"),u.flattenedClassNames=m);var D=i.a.Click.delayDblClick();d3.selectAll(".parent, .topLevelParent, .child, .root").call(D),H=function(e){W(e),e.data.name===p?(P(),d3.selectAll(".selected").classed("selected",!1)):(R(e),u.selectedClass=g,u.showClassInfoPanel=!0,u.$on("sidePanelClosed",(function(t){d3.selectAll(".selected").classed("selected",e.selected=!1)})))},D.on("click",(function(e,t){t.data.id&&l.history.pushState({id:t.data.id},"classHierarchyPage"+t.data.id,"hierarchy#"+t.data.id),x.hide(),H(t)})),D.on("dblclick",(function(t,r){r!==n&&(x.hide(),R(r),e.$broadcast("goToDomainRangeGraphView",g,k),t.stopPropagation())}));var F=0;E.on("wheel",(function(e){x.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=k),"in"===n){if(r!==k){for(;r.parent&&!r.parent.isInFocusTransitive;)r=r.parent;r.depth<k.depth&&(r=k)}if(r===k&&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=k.parent)&&W(r,!0);k.data.name===p&&l.history.replaceState({id:1},"classHierarchyPage1","hierarchy#1"),V()}}));var $=I.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===k.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)})),b=function(){function e(e){e&&A.each((function(t){+e===t.data.id&&H(t)}))}var n=t.hash();l.onpopstate=function(t){t.state&&e(t.state.id)},e(n)};var O=I.selectAll("circle, text");function z(e,t){var n=800/e[2];f=e,O.attr("transform",(function(t){return"translate("+(t.x-e[0])*n+","+(t.y-e[1])*n+")"})),A.attr("r",(function(e){return e.r*n})),t&&$.each((function(e){e.data.fullName!==k.data.topLevelParentUri&&k.data.topLevelParentUri!==p||(e.textSel.style("display","none"),k.children&&k.children.length?_.each(k.children,(function(e){e.textSel.style("display","inline")})):k.textSel.style("display","inline"),k.parent&&_.each(k.parent.children,(function(e){e.data.name!==k.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 M(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(){u.showExternalElements=e.data.name===p})),k!==e&&(e.data.id&&l.history.replaceState({id:e.data.id},"classHierarchyPage"+e.data.id,"hierarchy#"+e.data.id),e.children||(e=e.parent,k!==e))){if(t&&(P(),d3.selectAll(".selected").classed("selected",!1)),k.parent)for(var n=k;n;)n.isInFocusTransitive=!1,n=n.parent;for(n=e;n;)n.isInFocusTransitive=!!n.children,n=n.parent;if(2*(k=e).r/(2*k.r+20)<.3||u.currentSliderValue>u.currentBrowserLimit)z([k.x,k.y,M(k.r)]),$.each((function(e){B.call(this,e)}));else d3.transition().duration(h).tween("zoom",(function(e){var t=d3.interpolateZoom(f,[k.x,k.y,M(k.r)]);return function(e){z(t(e))}})).selectAll("text").each(B)}}z([k.x,k.y,M(k.r)],d),L=u.$on("rootFocus",(function(){l.history.pushState({id:1},"classHierarchyPage1","hierarchy#1"),H(w)})),N=u.$on("classSearch",(function(e){H(e)}))}function V(){var t=u.classHierarchyData.classCount,n=y.get(v.CLASS_HIERARCHY_CURRENT_SLIDER_VALUE);(!n||n>t)&&(n=t,y.set(v.CLASS_HIERARCHY_CURRENT_SLIDER_VALUE,n)),e.$broadcast("classCount",t,n)}window.addEventListener("resize",V),window.addEventListener("beforeunload",(function e(){window.removeEventListener("resize",V),window.removeEventListener("beforeunload",e)})),u.$watch("classHierarchyData",(function(){D&&D(),F&&F(),O&&O(),z&&z();var e=A();if(u.classHierarchyData.classCount){var t=function(e,t){var n={keepPrevState:!0,noPrefixes:A()};a=n.noPrefixes,M(r||e,n,k,!0),c((function(){y.set(v.CLASS_HIERARCHY_SWITCH_PREFIXES,t),b()}),70)},n=function(e,n,i){if(e){y.set(v.CLASS_HIERARCHY_CURRENT_SLIDER_VALUE,e),r={name:p,children:[]};for(var l=new Set,c=1;c<=e;c++)l.add(n[c].data.id),n[c].parent===n[0]&&r.children.push(n[c].data);if(function e(t){if(t.children){var n,r=[],a=s(t.children);try{for(a.s();!(n=a.n()).done;){var i=n.value;l.has(i.id)&&r.push($.extend({},i))}}catch(e){a.e(e)}finally{a.f()}t.children=r;var o,c=s(t.children);try{for(c.s();!(o=c.n()).done;){e(o.value)}}catch(e){c.e(e)}finally{c.f()}}}(r),i)a=angular.isUndefined(a)?A():a,M(r,{noPrefixes:a});else t(o)}};V();var r,a,i,o=_.cloneDeep(u.classHierarchyData),l=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(o)),d=y.get(v.CLASS_HIERARCHY_CURRENT_SLIDER_VALUE);if(d)n(d,l);else{var f={doFade:!0,keepPrevState:!0,noPrefixes:A()};M(o,f),b()}D=u.$watch("hidePrefixes",(function(n){angular.isUndefined(n)||e?e=void 0:c((function(){!function(e){angular.isUndefined(e)||y.set(v.CLASS_HIERARCHY_HIDE_PREFIXES,e)}(n),t(o,!0)}),50)}),!0),F=u.$watch("currentSliderValue",(function(e){n(e,l,!0)}),!0),z=u.$on("onEnterKeypressSearchAction",(function(e){i&&H(i)})),O=u.$on("searchedClass",(function(e,t){(i=U[t.name])&&H(i)}))}}),!0)}(u)}}}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",c),c.$inject=["$rootScope","$location","GraphDataRestService","$window","$timeout","$repositories","$licenseService","toastr","ZOOM_DURATION","ROOT_OBJ_NAME","LocalStorageAdapter","LSKeys","$translate"]},634:function(e,t,n){var r,a;r=[n(644)],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(644)),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(){var e=this.parentNode.firstChild;e&&this.parentNode.insertBefore(this,e)}))},d3}.apply(t,r))||(e.exports=a)},647:function(e,t,n){"use strict";n(634);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(){var e=function(e,n){for(var r,a=1,i=arguments.length;++a<i;)e[r=arguments[a]]=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},648:function(e,t,n){"use strict";n(634);var r=r||{};r.Export={getCSSRules:function(e){var t=$('link[href="'+e+'"]')[0].sheet.rules,n="";return _.each(t,(function(e){n+=e.cssText})),n},generateBase64ImageSource:function(e){e||(e="svg");var 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},658: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 l(e){var t;a="svg"===(t=(t=e).node()).tagName.toLowerCase()?t:t.ownerSVGElement,i=a.createSVGPoint(),document.body.appendChild(r)}l.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);var x=r.filter((function(e){return e instanceof Event}));return a=c.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"),l},l.hide=function(){return f().style("opacity",0).style("pointer-events","none"),l},l.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),l},l.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),l},l.direction=function(t){return arguments.length?(e=null==t?t:p(t),l):e},l.offset=function(e){return arguments.length?(t=null==e?e:p(e),l):t},l.html=function(e){return arguments.length?(n=null==e?e:p(e),l):n},l.customPosition=function(e){return arguments.length?(s=null==e?e:p(e),l):s},l.destroy=function(){return r&&(f().remove(),r=null),l};var c=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=c.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,l=a.height,c=a.x,d=a.y;return i.x=c,i.y=d,n.nw=i.matrixTransform(r),i.x+=s,n.ne=i.matrixTransform(r),i.y+=l,n.se=i.matrixTransform(r),i.x-=s,n.sw=i.matrixTransform(r),i.y-=l/2,n.w=i.matrixTransform(r),i.x+=s,n.e=i.matrixTransform(r),i.x-=s/2,i.y-=l/2,n.n=i.matrixTransform(r),i.y+=l,n.s=i.matrixTransform(r),n}function p(e){return"function"==typeof e?e:function(){return e}}return l}},684: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([[50],{304:function(e,t,n){"use strict";n.r(t);var r=n(658),a=n(684),i=n(647),o=n(648);n(15);function s(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return l(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?l(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,i=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw i}}}}function l(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function c(e,t,n,l,c,d,u,f,h,p,y,v,g){return{restrict:"AE",template:'<div id="classChart"></div>',scope:{classHierarchyData:"=",flattenedClassNames:"=",selectedClass:"=",currentSliderValue:"=",showClassInfoPanel:"=",showExternalElements:"=",hidePrefixes:"=",currentBrowserLimit:"="},link:function(u,m,x){!function(u,m){var x,w,S=d3.pack().size([780,780]),C=d3.scaleLinear().domain([0,4]).range(["hsl(19, 70%, 90%)","hsl(19, 70%, 50%)"]).interpolate(d3.interpolateHcl),E=d3.select("#classChart").insert("svg:svg","h2").attr("viewBox","0 0 800 800").attr("preserveAspectRatio","xMidYMid meet").on("dblclick.zoom",null);function T(){return E.append("svg:g").attrs({id:"main-group",transform:"translate(400,400)"})}function A(){return"true"===y.get(v.CLASS_HIERARCHY_HIDE_PREFIXES)}function R(){var e=o.a.Export.getCSSRules("css/rdf-class-hierarchy-labels.css?v=3.0.1");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-"+d.getActiveRepository()+".svg"})}u.hidePrefixes=A();var b,H,I=T();if(!u.classHierarchyData.classCount&&d.getActiveRepository()&&!d.isSystemRepository()){e.loader=!0,e.hierarchyError=!1;var P=y.get("classHierarchy-selectedGraph-".concat(d.getActiveRepository()));n.getClassHierarchyData(null!==P?P.contextID.uri:"").success((function(t,n,r){e.loader=!1,207===n&&f.warning(g.instant("graphexplore.update.diagram"),g.instant("graphexplore.repository.data.changed")),u.classHierarchyData=t,d3.select("#download-svg").on("mouseover",R)})).error((function(t){e.loader=!1,e.hierarchyError=getError(t),f.error(g.instant("graphexplore.error.request.failed",{name:p,error:getError(t)}))}))}var k,L,N,D,F,O,z,U={};function M(n,o,s,d){L&&L(),N&&N(),d3.selectAll("#main-group").remove(),I=T(),a.a.SingleChild.addPlaceholders(n,!0),(w=d3.hierarchy(n)).sum((function(e){return e.size})),k=s||w,S(w);var f,y=w.descendants();k.isInFocusTransitive=!0,a.a.SingleChild.removePlaceholders(y),a.a.SingleChild.centerNodes(y),a.a.SingleChild.makePositionsRelativeToZero(y),x||(x=Object(r.a)().attr("class","d3-tip").customPosition((function(e,t){return{top:"inherit",bottom:l.innerHeight-t.clientY+"px",right:l.innerWidth-t.clientX+"px"}})).html((function(e){return e.data.name})),E.call(x));var v=I.selectAll("circle").data(y).enter().append("g");o.doFade&&v.each((function(e){i.a.Transition.fadeIn(d3.select(this),550)}));var g,m=[],A=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?C(e.depth):"#E0D0D0"})).each((function(e){if(e.circle=d3.select(this),e.data.name!==p){var t=e.data.name;m.push({name:t}),U[[t]]=e,e.circle.classed("rdf-class",!0),e.circle.on("mouseover",(function(t){o.noPrefixes||e.textHidden?x.show(e,t):x.hide(e)})),e.circle.on("mouseout",x.hide)}})).on("gdb-focus",(function(e,t){return H(t)})).on("gdb-zoom",(function(e,t){return W(t)}));function R(e){d3.selectAll(".selected").classed("selected",e.selected=!1),e.circle.classed("selected",e.selected=!0),g=e}function P(){u.showClassInfoPanel=!1}m&&(m=_.uniqBy(m,"name"),u.flattenedClassNames=m);var D=i.a.Click.delayDblClick();d3.selectAll(".parent, .topLevelParent, .child, .root").call(D),H=function(e){W(e),e.data.name===p?(P(),d3.selectAll(".selected").classed("selected",!1)):(R(e),u.selectedClass=g,u.showClassInfoPanel=!0,u.$on("sidePanelClosed",(function(t){d3.selectAll(".selected").classed("selected",e.selected=!1)})))},D.on("click",(function(e,t){t.data.id&&l.history.pushState({id:t.data.id},"classHierarchyPage"+t.data.id,"hierarchy#"+t.data.id),x.hide(),H(t)})),D.on("dblclick",(function(t,r){r!==n&&(x.hide(),R(r),e.$broadcast("goToDomainRangeGraphView",g,k),t.stopPropagation())}));var F=0;E.on("wheel",(function(e){x.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=k),"in"===n){if(r!==k){for(;r.parent&&!r.parent.isInFocusTransitive;)r=r.parent;r.depth<k.depth&&(r=k)}if(r===k&&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=k.parent)&&W(r,!0);k.data.name===p&&l.history.replaceState({id:1},"classHierarchyPage1","hierarchy#1"),V()}}));var $=I.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===k.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)})),b=function(){function e(e){e&&A.each((function(t){+e===t.data.id&&H(t)}))}var n=t.hash();l.onpopstate=function(t){t.state&&e(t.state.id)},e(n)};var O=I.selectAll("circle, text");function z(e,t){var n=800/e[2];f=e,O.attr("transform",(function(t){return"translate("+(t.x-e[0])*n+","+(t.y-e[1])*n+")"})),A.attr("r",(function(e){return e.r*n})),t&&$.each((function(e){e.data.fullName!==k.data.topLevelParentUri&&k.data.topLevelParentUri!==p||(e.textSel.style("display","none"),k.children&&k.children.length?_.each(k.children,(function(e){e.textSel.style("display","inline")})):k.textSel.style("display","inline"),k.parent&&_.each(k.parent.children,(function(e){e.data.name!==k.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 M(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(){u.showExternalElements=e.data.name===p})),k!==e&&(e.data.id&&l.history.replaceState({id:e.data.id},"classHierarchyPage"+e.data.id,"hierarchy#"+e.data.id),e.children||(e=e.parent,k!==e))){if(t&&(P(),d3.selectAll(".selected").classed("selected",!1)),k.parent)for(var n=k;n;)n.isInFocusTransitive=!1,n=n.parent;for(n=e;n;)n.isInFocusTransitive=!!n.children,n=n.parent;if(2*(k=e).r/(2*k.r+20)<.3||u.currentSliderValue>u.currentBrowserLimit)z([k.x,k.y,M(k.r)]),$.each((function(e){B.call(this,e)}));else d3.transition().duration(h).tween("zoom",(function(e){var t=d3.interpolateZoom(f,[k.x,k.y,M(k.r)]);return function(e){z(t(e))}})).selectAll("text").each(B)}}z([k.x,k.y,M(k.r)],d),L=u.$on("rootFocus",(function(){l.history.pushState({id:1},"classHierarchyPage1","hierarchy#1"),H(w)})),N=u.$on("classSearch",(function(e){H(e)}))}function V(){var t=u.classHierarchyData.classCount,n=y.get(v.CLASS_HIERARCHY_CURRENT_SLIDER_VALUE);(!n||n>t)&&(n=t,y.set(v.CLASS_HIERARCHY_CURRENT_SLIDER_VALUE,n)),e.$broadcast("classCount",t,n)}window.addEventListener("resize",V),window.addEventListener("beforeunload",(function e(){window.removeEventListener("resize",V),window.removeEventListener("beforeunload",e)})),u.$watch("classHierarchyData",(function(){D&&D(),F&&F(),O&&O(),z&&z();var e=A();if(u.classHierarchyData.classCount){var t=function(e,t){var n={keepPrevState:!0,noPrefixes:A()};a=n.noPrefixes,M(r||e,n,k,!0),c((function(){y.set(v.CLASS_HIERARCHY_SWITCH_PREFIXES,t),b()}),70)},n=function(e,n,i){if(e){y.set(v.CLASS_HIERARCHY_CURRENT_SLIDER_VALUE,e),r={name:p,children:[]};for(var l=new Set,c=1;c<=e;c++)l.add(n[c].data.id),n[c].parent===n[0]&&r.children.push(n[c].data);if(function e(t){if(t.children){var n,r=[],a=s(t.children);try{for(a.s();!(n=a.n()).done;){var i=n.value;l.has(i.id)&&r.push($.extend({},i))}}catch(e){a.e(e)}finally{a.f()}t.children=r;var o,c=s(t.children);try{for(c.s();!(o=c.n()).done;){e(o.value)}}catch(e){c.e(e)}finally{c.f()}}}(r),i)a=angular.isUndefined(a)?A():a,M(r,{noPrefixes:a});else t(o)}};V();var r,a,i,o=_.cloneDeep(u.classHierarchyData),l=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(o)),d=y.get(v.CLASS_HIERARCHY_CURRENT_SLIDER_VALUE);if(d)n(d,l);else{var f={doFade:!0,keepPrevState:!0,noPrefixes:A()};M(o,f),b()}D=u.$watch("hidePrefixes",(function(n){angular.isUndefined(n)||e?e=void 0:c((function(){!function(e){angular.isUndefined(e)||y.set(v.CLASS_HIERARCHY_HIDE_PREFIXES,e)}(n),t(o,!0)}),50)}),!0),F=u.$watch("currentSliderValue",(function(e){n(e,l,!0)}),!0),z=u.$on("onEnterKeypressSearchAction",(function(e){i&&H(i)})),O=u.$on("searchedClass",(function(e,t){(i=U[t.name])&&H(i)}))}}),!0)}(u)}}}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",c),c.$inject=["$rootScope","$location","GraphDataRestService","$window","$timeout","$repositories","$licenseService","toastr","ZOOM_DURATION","ROOT_OBJ_NAME","LocalStorageAdapter","LSKeys","$translate"]},634:function(e,t,n){var r,a;r=[n(644)],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(644)),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(){var e=this.parentNode.firstChild;e&&this.parentNode.insertBefore(this,e)}))},d3}.apply(t,r))||(e.exports=a)},647:function(e,t,n){"use strict";n(634);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(){var e=function(e,n){for(var r,a=1,i=arguments.length;++a<i;)e[r=arguments[a]]=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},648:function(e,t,n){"use strict";n(634);var r=r||{};r.Export={getCSSRules:function(e){var t=$('link[href="'+e+'"]')[0].sheet.rules,n="";return _.each(t,(function(e){n+=e.cssText})),n},generateBase64ImageSource:function(e){e||(e="svg");var 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},658: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 l(e){var t;a="svg"===(t=(t=e).node()).tagName.toLowerCase()?t:t.ownerSVGElement,i=a.createSVGPoint(),document.body.appendChild(r)}l.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);var x=r.filter((function(e){return e instanceof Event}));return a=c.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"),l},l.hide=function(){return f().style("opacity",0).style("pointer-events","none"),l},l.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),l},l.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),l},l.direction=function(t){return arguments.length?(e=null==t?t:p(t),l):e},l.offset=function(e){return arguments.length?(t=null==e?e:p(e),l):t},l.html=function(e){return arguments.length?(n=null==e?e:p(e),l):n},l.customPosition=function(e){return arguments.length?(s=null==e?e:p(e),l):s},l.destroy=function(){return r&&(f().remove(),r=null),l};var c=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=c.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,l=a.height,c=a.x,d=a.y;return i.x=c,i.y=d,n.nw=i.matrixTransform(r),i.x+=s,n.ne=i.matrixTransform(r),i.y+=l,n.se=i.matrixTransform(r),i.x-=s,n.sw=i.matrixTransform(r),i.y-=l/2,n.w=i.matrixTransform(r),i.x+=s,n.e=i.matrixTransform(r),i.x-=s/2,i.y-=l/2,n.n=i.matrixTransform(r),i.y+=l,n.s=i.matrixTransform(r),n}function p(e){return"function"==typeof e?e:function(){return e}}return l}},684: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([[75],{305:function(t,e,r){"use strict";r.r(e);var a=r(648),n=r(647);r(15);function o(t,e,r,o,s,i,c,l,d,u,p,f,h){return{restrict:"AE",template:'<div id="domain-range"></div>',scope:{showPredicatesInfoPanel:"=",selectedPredicate:"=",collapseEdges:"="},link:function(u){var 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=a.a.Export.getCSSRules("css/domain-range-graph.css?v=3.0.1-RC2");$("defs").append('<style type="text/css"><![CDATA['+t+"]]></style>");var e=a.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,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(){i.set(c.DOMAIN_RANGE_WENT_BACK,!0)})),e.onpopstate=function(e){e.state&&t.$broadcast("changeCollapsedEdgesState",e.state.collapsed)},u.$watch("collapseEdges",(function(){angular.isUndefined(u.collapseEdges)||(i.set(c.DOMAIN_RANGE_COLLAPSE_EDGES,u.collapseEdges),"true"!==i.get(c.DOMAIN_RANGE_WENT_BACK)&&function(e){t.$broadcast("switchEdgeMode",{uri:m,name:v,collapsed:e})}(u.collapseEdges),i.remove(c.DOMAIN_RANGE_WENT_BACK))})),u.$watch("domainRangeGraphData",(function(){if(u.domainRangeGraphData){var r=function(t){t.style("stroke",f),t.style("stroke-width",2),t.attr("marker-end","url("+s.absUrl()+"#collapsed-arrow)")},a=function(){$.isEmptyObject(E)||(E.text.style("fill","black"),E.background.style("fill","#f0f0f0"))},o=function(t,e){a(),E.text=d3.select(this),E.background=d3.select(this.previousSibling),E.text.style("fill","white"),E.background.style("fill",f),l((function(){u.showPredicatesInfoPanel=!0,u.selectedPredicate=e})),t.stopPropagation()},i=_.cloneDeep(u.domainRangeGraphData),c=i.nodes,d=i.links;g.nodes(c).force("x",d3.forceX(600)).force("y",d3.forceY(300)).force("charge",d3.forceManyBody().strength(-800)).force("link",d3.forceLink(d).distance(1200/3.5));var x,k,b=p.selectAll(".link").data(d).enter().append("g"),w=0;b.each((function(t){if(t.objectPropNodeClassUri!==m)x=b.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?r(e):t.implicit&&e.style("stroke-dasharray","3, 3")}));else{if(angular.isUndefined(k)){k=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)}(w+=t.targetNodeEdgeCount)>1&&r(d3.select(".loop-link"))}}));var E={};$("document").ready((function(){$("#domain-range").bind("click",a)}));var N=b.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}));N.each((function(t){var r=d3.select(this);/\d\spredicates/.test(r.text())?r.style("font-weight","bold").on("click",o):r.on("click",(function(t,r){e.open("resource?uri="+encodeURIComponent(r.uri),"_blank")}))}));var R=2,C=b.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+2*R})).attr("height",(function(t){return t.calculatedHeight=this.previousSibling.getBBox().height,t.calculatedHeight+R})).attr("transform",(function(t){var e=R-1200/18/2*("objectLeft"===t.propertyType?1:-1);return"objectLeft"===t.propertyType&&(e+=t.calculatedWidth),"translate(-"+e+",-"+(R+t.calculatedHeight/2)+")"})).on("click",(function(t){t.stopPropagation()})),T=p.selectAll(".node").data(c).enter().append("g"),A=T.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,a){u.$apply((function(){t.$broadcast("reloadDomainRangeGraphView",r,a)}))})),T.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 L=T.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 n.a.Text.calcFontSize(v,1200/18)})).text(v).on("click",(function(){e.open("resource?uri="+encodeURIComponent(m),"_blank")}))}));var M=p.select(".class-node + text"),U=d3.select(".class-node"),P=d3.selectAll(".loop-link-background"),j=d3.selectAll(".loop-link-property-name");if(N=d3.selectAll(".property-name"),!angular.isUndefined(k)){var O=[];P.each((function(t,e){d3.select(this);O.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 a=[];P.each((function(n,o){a.push(n),o<h?function(a,n){var o=$.grep(O,(function(t){return t.idx==n}));n>0&&(e+=parseFloat(n*(o[0].height/(n/1.4)))),a.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",o),d3.select(".view-more-preds-rect").attr("height",e+2*R)}(a)}x.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})),A.each((function(t){"main"!==t.classPosition||angular.isUndefined(k)||(!function(t){var e=t.x+64,r=t.y-1200/18/5.7-5;k.attr("transform","rotate(270, "+t.x+","+t.y+") translate("+e+","+r+")")}(t),function(t){function e(e,r){var a=$.grep(O,(function(t){return t.idx==r})),n=0;r>0&&(n=parseFloat(2*r*(a[0].height/1.4)));var o=t.x,s=t.y-1200/18*2.1-n;e.attrs({x:o,y:s}).moveToFront()}j.each((function(t,r){var a=d3.select(this),n=j.size()-h;n<0?e(a,r):(0==r&&!u.collapseEdges&&n>1&&(!function(t,e,r){t.classed("view-more-preds-label",!0).text(r+" predicates more ..."),null!==this.nextSibling&&e.classed("view-more-preds-rect",!0)}(a,d3.select(this.nextSibling),n),e(a,r)),r<h?e(a,r):a.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=U.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}))})),M.attr("x",(function(t){return t.x})).attr("y",(function(t){return t.y})).moveToFront(),C.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(),N.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(),L.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()}))}}));var 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"]},634:function(t,e,r){var a,n;a=[r(644)],void 0===(n=function(){function t(t,e){return t.each((function(){var t=e.apply(this,arguments),r=select(this);for(var a in t)r.attr(a,t[a])}))}function e(t,e){for(var r in e)t.attr(r,e[r]);return t}return"undefined"==typeof d3&&(d3=r(644)),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(){var t=this.parentNode.firstChild;t&&this.parentNode.insertBefore(this,t)}))},d3}.apply(e,a))||(t.exports=n)},647:function(t,e,r){"use strict";r(634);var a=a||{};a.Text=function(){function t(t,e,r,a){r=r||10;var n=e/3;return"string"==typeof t?(n*=10/(t.substring(0,e/3).length+1.5),n+=1,t.match(/[\u0900-\u0DFF\u1100-\u11FF\u2E80-\u2EFF\u3000-\u9FFF]/)&&(n*=.6),n<r&&(n=r),Math.round(n)):(n<r&&(n=r),Math.round(n))}return{calcFontSizeRaw:t,calcFontSize:function(e,r,a,n){return t(e,r,a)+"px"},getTextWithElipsisIfNeeded:function(t,e){return"string"==typeof t&&t.length>e?t.substring(0,e-3)+"...":t}}}(),a.Transition={fadeIn:function(t,e){t.style("opacity",0).transition().duration(e).style("opacity",1)},fadeOut:function(t,e){t.style("opacity",1).transition().duration(e).style("opacity",0)}},a.Click=function(){var t=function(t,r){for(var a,n=1,o=arguments.length;++n<o;)t[a=arguments[n]]=e(t,r,r[a]);return t};function e(t,e,r){return function(){var a=r.apply(e,arguments);return a===e?t:a}}return{delayDblClick:function(){var e=d3.dispatch("click","dblclick");return t((function(t){var r,a=null;t.on("mousedown",(function(){r=d3.pointer(document.body),+new Date})),t.on("mouseup",(function(t,n){var o,s,i;(s=r,i=d3.pointer(document.body),Math.sqrt(Math.pow(s[0]-i[0],2),Math.pow(s[1]-i[1],2))>5)||(a?(window.clearTimeout(a),a=null,e.call("dblclick",t,t,n)):a=window.setTimeout((o=t,function(){e.call("click",o,o,n),a=null}),250))}))}),e,"on")}}}(),e.a=a},648:function(t,e,r){"use strict";r(634);var a=a||{};a.Export={getCSSRules:function(t){var e=$('link[href="'+t+'"]')[0].sheet.rules,r="";return _.each(e,(function(t){r+=t.cssText})),r},generateBase64ImageSource:function(t){t||(t="svg");var 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=a}}]);
|
|
1
|
+
(window.webpackJsonp=window.webpackJsonp||[]).push([[75],{305:function(t,e,r){"use strict";r.r(e);var a=r(648),n=r(647);r(15);function o(t,e,r,o,s,i,c,l,d,u,p,f,h){return{restrict:"AE",template:'<div id="domain-range"></div>',scope:{showPredicatesInfoPanel:"=",selectedPredicate:"=",collapseEdges:"="},link:function(u){var 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=a.a.Export.getCSSRules("css/domain-range-graph.css?v=3.0.1");$("defs").append('<style type="text/css"><![CDATA['+t+"]]></style>");var e=a.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,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(){i.set(c.DOMAIN_RANGE_WENT_BACK,!0)})),e.onpopstate=function(e){e.state&&t.$broadcast("changeCollapsedEdgesState",e.state.collapsed)},u.$watch("collapseEdges",(function(){angular.isUndefined(u.collapseEdges)||(i.set(c.DOMAIN_RANGE_COLLAPSE_EDGES,u.collapseEdges),"true"!==i.get(c.DOMAIN_RANGE_WENT_BACK)&&function(e){t.$broadcast("switchEdgeMode",{uri:m,name:v,collapsed:e})}(u.collapseEdges),i.remove(c.DOMAIN_RANGE_WENT_BACK))})),u.$watch("domainRangeGraphData",(function(){if(u.domainRangeGraphData){var r=function(t){t.style("stroke",f),t.style("stroke-width",2),t.attr("marker-end","url("+s.absUrl()+"#collapsed-arrow)")},a=function(){$.isEmptyObject(E)||(E.text.style("fill","black"),E.background.style("fill","#f0f0f0"))},o=function(t,e){a(),E.text=d3.select(this),E.background=d3.select(this.previousSibling),E.text.style("fill","white"),E.background.style("fill",f),l((function(){u.showPredicatesInfoPanel=!0,u.selectedPredicate=e})),t.stopPropagation()},i=_.cloneDeep(u.domainRangeGraphData),c=i.nodes,d=i.links;g.nodes(c).force("x",d3.forceX(600)).force("y",d3.forceY(300)).force("charge",d3.forceManyBody().strength(-800)).force("link",d3.forceLink(d).distance(1200/3.5));var x,k,b=p.selectAll(".link").data(d).enter().append("g"),w=0;b.each((function(t){if(t.objectPropNodeClassUri!==m)x=b.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?r(e):t.implicit&&e.style("stroke-dasharray","3, 3")}));else{if(angular.isUndefined(k)){k=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)}(w+=t.targetNodeEdgeCount)>1&&r(d3.select(".loop-link"))}}));var E={};$("document").ready((function(){$("#domain-range").bind("click",a)}));var N=b.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}));N.each((function(t){var r=d3.select(this);/\d\spredicates/.test(r.text())?r.style("font-weight","bold").on("click",o):r.on("click",(function(t,r){e.open("resource?uri="+encodeURIComponent(r.uri),"_blank")}))}));var R=2,C=b.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+2*R})).attr("height",(function(t){return t.calculatedHeight=this.previousSibling.getBBox().height,t.calculatedHeight+R})).attr("transform",(function(t){var e=R-1200/18/2*("objectLeft"===t.propertyType?1:-1);return"objectLeft"===t.propertyType&&(e+=t.calculatedWidth),"translate(-"+e+",-"+(R+t.calculatedHeight/2)+")"})).on("click",(function(t){t.stopPropagation()})),T=p.selectAll(".node").data(c).enter().append("g"),A=T.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,a){u.$apply((function(){t.$broadcast("reloadDomainRangeGraphView",r,a)}))})),T.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 L=T.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 n.a.Text.calcFontSize(v,1200/18)})).text(v).on("click",(function(){e.open("resource?uri="+encodeURIComponent(m),"_blank")}))}));var M=p.select(".class-node + text"),U=d3.select(".class-node"),P=d3.selectAll(".loop-link-background"),j=d3.selectAll(".loop-link-property-name");if(N=d3.selectAll(".property-name"),!angular.isUndefined(k)){var O=[];P.each((function(t,e){d3.select(this);O.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 a=[];P.each((function(n,o){a.push(n),o<h?function(a,n){var o=$.grep(O,(function(t){return t.idx==n}));n>0&&(e+=parseFloat(n*(o[0].height/(n/1.4)))),a.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",o),d3.select(".view-more-preds-rect").attr("height",e+2*R)}(a)}x.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})),A.each((function(t){"main"!==t.classPosition||angular.isUndefined(k)||(!function(t){var e=t.x+64,r=t.y-1200/18/5.7-5;k.attr("transform","rotate(270, "+t.x+","+t.y+") translate("+e+","+r+")")}(t),function(t){function e(e,r){var a=$.grep(O,(function(t){return t.idx==r})),n=0;r>0&&(n=parseFloat(2*r*(a[0].height/1.4)));var o=t.x,s=t.y-1200/18*2.1-n;e.attrs({x:o,y:s}).moveToFront()}j.each((function(t,r){var a=d3.select(this),n=j.size()-h;n<0?e(a,r):(0==r&&!u.collapseEdges&&n>1&&(!function(t,e,r){t.classed("view-more-preds-label",!0).text(r+" predicates more ..."),null!==this.nextSibling&&e.classed("view-more-preds-rect",!0)}(a,d3.select(this.nextSibling),n),e(a,r)),r<h?e(a,r):a.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=U.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}))})),M.attr("x",(function(t){return t.x})).attr("y",(function(t){return t.y})).moveToFront(),C.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(),N.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(),L.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()}))}}));var 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"]},634:function(t,e,r){var a,n;a=[r(644)],void 0===(n=function(){function t(t,e){return t.each((function(){var t=e.apply(this,arguments),r=select(this);for(var a in t)r.attr(a,t[a])}))}function e(t,e){for(var r in e)t.attr(r,e[r]);return t}return"undefined"==typeof d3&&(d3=r(644)),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(){var t=this.parentNode.firstChild;t&&this.parentNode.insertBefore(this,t)}))},d3}.apply(e,a))||(t.exports=n)},647:function(t,e,r){"use strict";r(634);var a=a||{};a.Text=function(){function t(t,e,r,a){r=r||10;var n=e/3;return"string"==typeof t?(n*=10/(t.substring(0,e/3).length+1.5),n+=1,t.match(/[\u0900-\u0DFF\u1100-\u11FF\u2E80-\u2EFF\u3000-\u9FFF]/)&&(n*=.6),n<r&&(n=r),Math.round(n)):(n<r&&(n=r),Math.round(n))}return{calcFontSizeRaw:t,calcFontSize:function(e,r,a,n){return t(e,r,a)+"px"},getTextWithElipsisIfNeeded:function(t,e){return"string"==typeof t&&t.length>e?t.substring(0,e-3)+"...":t}}}(),a.Transition={fadeIn:function(t,e){t.style("opacity",0).transition().duration(e).style("opacity",1)},fadeOut:function(t,e){t.style("opacity",1).transition().duration(e).style("opacity",0)}},a.Click=function(){var t=function(t,r){for(var a,n=1,o=arguments.length;++n<o;)t[a=arguments[n]]=e(t,r,r[a]);return t};function e(t,e,r){return function(){var a=r.apply(e,arguments);return a===e?t:a}}return{delayDblClick:function(){var e=d3.dispatch("click","dblclick");return t((function(t){var r,a=null;t.on("mousedown",(function(){r=d3.pointer(document.body),+new Date})),t.on("mouseup",(function(t,n){var o,s,i;(s=r,i=d3.pointer(document.body),Math.sqrt(Math.pow(s[0]-i[0],2),Math.pow(s[1]-i[1],2))>5)||(a?(window.clearTimeout(a),a=null,e.call("dblclick",t,t,n)):a=window.setTimeout((o=t,function(){e.call("click",o,o,n),a=null}),250))}))}),e,"on")}}}(),e.a=a},648:function(t,e,r){"use strict";r(634);var a=a||{};a.Export={getCSSRules:function(t){var e=$('link[href="'+t+'"]')[0].sheet.rules,r="";return _.each(e,(function(t){r+=t.cssText})),r},generateBase64ImageSource:function(t){t||(t="svg");var 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=a}}]);
|