graphdb-workbench 2.6.0 → 2.6.1-RC1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/dist/131.f41a0b6b9036447b1077.bundle.js +1 -1
  2. package/dist/16.028d7ea5baf358e315cb.bundle.js +1 -1
  3. package/dist/242.eafa039a4e07364e4a8f.bundle.js +1 -0
  4. package/dist/257.943f597bddc0d65103c5.bundle.js +1 -1
  5. package/dist/259.2c88332b7f1b47935a47.bundle.js +1 -1
  6. package/dist/260.d745422c537bdd9647bb.bundle.js +1 -1
  7. package/dist/261.7efff7f93f61f061f5ca.bundle.js +1 -1
  8. package/dist/27.92bfb161b420732902a3.bundle.js +1 -1
  9. package/dist/28.2e0277168c8f14f9c085.bundle.js +1 -1
  10. package/dist/288.6cef162ec3cec3cde603.bundle.js +1 -1
  11. package/dist/303.85715cdc00dfd6ef1521.bundle.js +1 -0
  12. package/dist/40.53352fda81f370182e99.bundle.js +1 -1
  13. package/dist/63.dbce2c16115eac52fed2.bundle.js +1 -1
  14. package/dist/{bundle.782865d765633c869a40.bundle.js → bundle.3aedab803b7c4896e885.bundle.js} +3 -3
  15. package/dist/css/import.css +10 -0
  16. package/dist/index.html +3 -3
  17. package/dist/js/angular/core/directives/autocomplete/templates/autocomplete.html +1 -1
  18. package/dist/js/angular/core/directives/operations-statuses-monitor/templates/operations-statuses-monitor.html +1 -1
  19. package/dist/js/angular/core/directives/rdfresourcesearch/templates/rdfResourceSearchTemplate.html +1 -1
  20. package/dist/js/angular/core/directives/yasgui-component/templates/yasgui-component.html +1 -1
  21. package/dist/js/angular/security/templates/user.html +1 -1
  22. package/dist/license-checker.json +4 -4
  23. package/dist/pages/aclmanagement.html +2 -2
  24. package/dist/pages/autocomplete.html +1 -1
  25. package/dist/pages/choose-repository-type.html +1 -1
  26. package/dist/pages/cluster-management/clusterInfo.html +3 -3
  27. package/dist/pages/create-index.html +1 -1
  28. package/dist/pages/dependencies.html +1 -1
  29. package/dist/pages/domainRangeInfo.html +2 -2
  30. package/dist/pages/edit.html +1 -1
  31. package/dist/pages/explore.html +1 -1
  32. package/dist/pages/export.html +1 -1
  33. package/dist/pages/find.html +1 -1
  34. package/dist/pages/graph-config/saveGraphConfig.html +8 -8
  35. package/dist/pages/graphs-visualizations.html +7 -7
  36. package/dist/pages/guides.html +1 -1
  37. package/dist/pages/import.html +33 -26
  38. package/dist/pages/jdbc-create.html +1 -1
  39. package/dist/pages/monitor/backup-and-restore.html +1 -1
  40. package/dist/pages/monitor/queries.html +1 -1
  41. package/dist/pages/monitor/resources.html +1 -1
  42. package/dist/pages/namespaces.html +2 -2
  43. package/dist/pages/plugins.html +1 -1
  44. package/dist/pages/rdfClassHierarchyInfo.html +7 -7
  45. package/dist/pages/rdfrank.html +2 -2
  46. package/dist/pages/repositories.html +1 -1
  47. package/dist/pages/repository.html +1 -1
  48. package/dist/pages/similarity-indexes.html +1 -1
  49. package/dist/pages/sparql-editor.html +1 -1
  50. package/dist/pages/sparql-template-create.html +1 -1
  51. package/dist/pages/webapi.html +2 -2
  52. package/dist/res/swagger/index.html +27 -27
  53. package/package.json +2 -2
  54. package/dist/242.91371576625ebddd82e9.bundle.js +0 -1
  55. package/dist/303.4ab6b30437bce5474d30.bundle.js +0 -1
@@ -1,3 +1,3 @@
1
- (window.webpackJsonp=window.webpackJsonp||[]).push([[16,3,17,19,26,27,28,29,39,40,45,60,64,66,67,69,83,101,108,109,110,111,112,113,114,116,117,136,151,152,153,154,155,156,157,158,160,161,162,163,164,165,170,172,191,193,207,215,219,233,234,235],{100:function(e,t,r){"use strict";r.r(t),r.d(t,"YasguiPersistenceMigrationService",(function(){return o}));var n=r(72);const a="yagui__"+n.VIEW_SPARQL_EDITOR,i="completed",s="rejected",o=function(){const e=()=>({val:{active:null,tabs:[],tabConfig:{}}}),t=(e,t,r=null)=>{e.val.migration={date:(new Date).toISOString(),status:t,error:r}},r=(e,t)=>{e.val.tabs.push(t)},n=(e,t)=>{e.val.tabConfig[t.id]=t},o=e=>{let t=localStorage.getItem(e);if(t)return t=JSON.parse(t),t},c=e=>{e.val.tabs=e.val.tabs.filter(e=>!e.startsWith("_"))},l=e=>{for(const t in e.val.tabConfig)t.startsWith("_")&&delete e.val.tabConfig[t]},u=(e,t)=>{localStorage.setItem(e,JSON.stringify(t))},d=(e,t)=>`${t} ${e}`,p=()=>Math.random().toString(36).substring(7);return{isMigrationNeeded:()=>{const e=o(a);let t=!1;return e&&(t=e.val.migration&&(e.val.migration.status===i||e.val.migration.status===s)),!(!localStorage.getItem("ls.tabs-state")||t)},revertMigration:()=>{const e=o(a);c(e),l(e),u(a,e)},migrateYasguiPersistence:s=>{let c=o("ls.tabs-state");c=Object.freeze(c);let l=o(a);l||(l=e()),c.map(e=>({id:e.id,name:e.name,yasqe:{value:e.query,sameAs:e.sameAs,infer:e.inference,pageSize:1e3,pageNumber:1},yasr:{response:null,settings:{selectedPlugin:"extended_table",pluginsConfig:{}}},requestConfig:{method:"POST"}})).forEach((e,t)=>{e.id="_"+p(),e.name=e.name||d(t,s),r(l,e.id),n(l,e)}),l.val.active=l.val.tabs[0],t(l,i),u(a,l)},rejectMigration:()=>{const e=o(a);t(e,s),u(a,e)}}}()},102:function(e,t,r){"use strict";r.r(t),r.d(t,"removeSpecialChars",(function(){return n})),r.d(t,"toBoolean",(function(){return a}));const n=e=>e.replace(/[()']/g,""),a=e=>"string"==typeof e?"true"===e:Boolean(e)},105:function(e,t){angular.module("graphdb.framework.rest.graphexplore.data.service",[]).factory("GraphDataRestService",r),r.$inject=["$http"];function r(e){return{getClassHierarchyData:function(t){return e.get("rest/class-hierarchy",{params:{graphURI:t}})},reloadClassHierarchy:function(t){return e.get("rest/class-hierarchy",{params:{doReload:!0,graphURI:t}})},getClassInstances:function(t){return e.get("rest/class-hierarchy/class-instances",{params:{targetUri:t}})},getDomainRangeData:function(t,r){return e.get("rest/domain-range",{params:{targetUri:t,collapsed:r}})},checkDomainRangeData:function(t){return e.head("rest/domain-range",{params:{targetUri:t}})},getRelationshipsData:function(t,r,n){return e.get("rest/dependencies/matrix",{params:{mode:r,classes:_.map(t,(function(e){return e.name})),graphURI:n}})},getRelationshipsClasses:function(t,r){return e.get("rest/dependencies/classes",{params:{mode:t,graphURI:r}})},getRelationshipsStatus:function(t){return e.get("rest/dependencies/status",{params:{graphURI:t}})},calculateRelationships:function(t){return e.get("rest/dependencies/update",{params:{graphURI:t}})},getPredicates:function(t,r,n){return e.get("rest/dependencies/predicates",{params:{from:t,to:r,mode:"all",graphURI:n}})},getInstanceNode:function(t){return e.get("rest/explore-graph/node",{params:t})},getInstanceNodeLinks:function(t){return e.get("rest/explore-graph/links",{params:t})},getProperties:function(t){return e.get("rest/explore-graph/properties",{params:t})},updateGraph:function(t){let r={headers:{"Content-Type":"application/json"}};return r=Object.assign(r,t),e.post("rest/explore-graph/graph",r)},getRdfsLabelAndComment:function(t,r,n){const a=n||{};return e({url:"rest/explore/details",method:"GET",params:_.extend(a,{uri:t,languages:r}),headers:{Accept:"application/json"}})}}}},150:function(e,t){function r(e){return{initLazyList:function(t,r,n,a,i){return e((function(){const e=t+a-1,s=Math.max(0-a,e),o=Math.min(e+r-1,i.length);s>o?n([]):$.isArray(i)&&n(i.slice(s,o+1))}),100,!0)}}}angular.module("graphdb.framework.graphexplore.services.uiscroll",[]).factory("UiScrollService",r),r.$inject=["$timeout"]},151:function(e,t){angular.module("graphdb.framework.graphexplore.services.rdfsdetails",[]).factory("RdfsLabelCommentService",(function(){return{processAndFilterLabelAndComment:function(e){function t(e){const t={};for(let r in e)if(e.hasOwnProperty(r)){let n=r;r.indexOf(":")>-1&&(n=r,r=r.split(":")[1].toLowerCase()),t[r]=e[n]}return t}const r=e.results.bindings,n=[],a=[];_.each(r,(function(e){let r;angular.isUndefined(e.label)||(r=t(e.label),n.push(r)),angular.isUndefined(e.comment)||(r=t(e.comment),a.push(r))}));const i=function(e){return"en"===e.lang||"de"===e.lang},s=$.grep(n,i)[0],o=$.grep(a,i)[0],c=angular.isUndefined(s)?n.length>0?n[0].value:void 0:s.value,l=angular.isUndefined(o)?a.length>0?a[0].value:void 0:o.value;return{rdfsLabel:c,rdfsComment:l}}}}))},152:function(e,t){angular.module("graphdb.framework.rest.graphexplore.savedgraphs.service",[]).factory("SavedGraphsRestService",r),r.$inject=["$http"];function r(e){return{getSavedGraphs:function(){return e.get("rest/explore-graph/saved")},getSavedGraph:function(t){return e.get("rest/explore-graph/saved/"+encodeURIComponent(t))},editSavedGraph:function(t){return e.put("rest/explore-graph/saved/"+encodeURIComponent(t.id),t)},deleteSavedGraph:function(t){return e.delete("rest/explore-graph/saved/"+encodeURIComponent(t.id))},addNewSavedGraph:function(t){return e.post("rest/explore-graph/saved",t)}}}},153:function(e,t,r){"use strict";r.r(t);var n=r(93);angular.module("graphdb.framework.rest.graphconfig.service",[]).factory("GraphConfigRestService",a);function a(e){return{getGraphConfigs:function(){return e.get("rest/explore-graph/config")},getGraphConfigSamples:function(){return e.get("rest/explore-graph/samples")},loadGraphForConfig:function(t,r,n,a){return e.get(`rest/explore-graph/config/graph/${encodeURIComponent(t.id)}?includeInferred=${r}&linksLimit=${n}&sameAsState=${a}`)},getConfig:function(t){return e.get("rest/explore-graph/config/"+encodeURIComponent(t)).then(e=>Object(n.mapGraphsConfigResponseToModel)(e.data))},createGraphConfig:function(t){return e.post("rest/explore-graph/config",t)},updateGraphConfig:function(t){return console.log("rest update",t),e.put("rest/explore-graph/config/"+encodeURIComponent(t.id),t)},deleteGraphConfig:function(t){return e.delete("rest/explore-graph/config/"+encodeURIComponent(t.id))},validateQuery:function(t,r,n,a,i){return e({method:"POST",url:"rest/explore-graph/validate",data:{query:t,queryType:r,params:n,all:a,oneOf:i}})}}}a.$inject=["$http"]},154:function(e,t,r){"use strict";r.r(t);r(10);function n(e,t,r,n,a,i,s,o,c,l,u,d,p,h,f,g,m){e.classHierarchyData={},e.instancesObj={},e.instancesQueryObj={},e.instancesObj.items=[],e.instancesNotFiltered=[],e.isWarningShowed=!1,e.onopen=e.onclose=()=>angular.noop(),e.currentBrowserLimit=2e3,p.firefox?e.currentBrowserLimit=50:(p.safari||p.msie||p.msedge)&&(e.currentBrowserLimit=400);const y={};let v=0,x=0;t.key="",y.get=function(t,r,n){return c.initLazyList(t,r,n,v,e.instancesObj.items)};let S=allGraphs;const C=function(){if(e.getActiveRepository())return g.resolveGraphs(n.getActiveRepository()).success((function(t){e.graphsInRepo=t.results.bindings.length>1002?t.results.bindings.slice(0,1002):t.results.bindings,b()})).error((function(t){e.repositoryError=getError(t),s.error(getError(t),m.instant("graphexplore.error.getting.graphs"))}))},b=function(){const t=h.get("classHierarchy-selectedGraph-"+n.getActiveRepository());null!==t&&e.graphsInRepo.some(e=>e.contextID.uri===t.contextID.uri)?S=t:h.set("classHierarchy-selectedGraph-"+n.getActiveRepository(),S)};function w(t,r,n){e.classCountSlider.options&&e.classCountSlider.options.ceil!==r&&(e.classCountSlider={});var a;e.classCountSlider.value||(e.showExternalElements=!0,e.classCountSlider={value:r,options:{floor:1,ceil:r,vertical:!0,showSelectionBar:!0,onChange:function(){u(E,100,!0)}}},null===h.get(f.CLASS_HIERARCHY_CURRENT_SLIDER_VALUE)&&r>e.currentBrowserLimit&&(a=e.currentBrowserLimit,p.chrome?s.warning(m.instant("graphexplore.disabling.animations",{classLimit:a}),m.instant("graphexplore.reducing.visual.effects")):s.warning(m.instant("graphexplore.browser.performance",{browser:p.name,classLimit:a}),m.instant("graphexplore.reducing.visual.effects"))));const i=h.get(f.CLASS_HIERARCHY_SWITCH_PREFIXES);null!=i&&"true"!==i&&(e.showExternalElements=!0),n?e.classCountSlider.value=n:r>=1500&&(e.classCountSlider.value=1500,s.warning(m.instant("graphexplore.class.count.slider",{count:1500}),m.instant("graphexplore.reducing.class.count"))),r>=25&&!window.ActiveXObject&&"ActiveXObject"in window&&!e.isWarningShowed&&(e.classCountSlider.value=25,e.isWarningShowed=!0,s.warning(m.instant("graphexplore.class.count.browser",{count:25}),m.instant("graphexplore.reducing.class.count"))),u((function(){e.$broadcast("reCalcViewDimensions")}),200),E();let o=0;$("rzslider").on("wheel",(function(t){t.preventDefault(),t.stopPropagation();const r=(new Date).getTime();if(!(r-o>100))return;o=r,t=t.originalEvent;let n=e.classCountSlider.value;t.deltaY<=-1?n+=1:t.deltaY>=1&&(n-=1),n!==e.classCountSlider.value&&n>=e.classCountSlider.options.floor&&n<=e.classCountSlider.options.ceil&&e.$apply((function(){e.classCountSlider.value=n,u(E,100,!0)}))}))}function E(){e.currentSliderValue=e.classCountSlider.value}function R(e){const t=e.data.fullName,n=e.data.name;o.checkDomainRangeData(t).success((function(e,a){204===a?s.warning(m.instant("graphexplore.no.domain.range",{name:n})):(h.set(f.CLASS_HIERARCHY_LAST_SELECTED_CLASS,r.hash()),r.hash("").path("domain-range-graph").search("uri",t).search("name",n))})).error((function(){s.error(m.instant("graphexplore.error.request.failed",{name:n}))}))}function I(){r.replace().hash("1"),e.instancesObj.items=[],e.showExternalElements=!1,e.showClassInfoPanel=!1,h.clearClassHieararchyState(),e.hidePrefixes="true"===h.get(f.CLASS_HIERARCHY_HIDE_PREFIXES),e.currentSliderValue=void 0,e.classHierarchyData={},t.$broadcast("angucomplete-alt:clearInput")}function T(){e.hasClassHierarchy()&&u((function(){$("#toolbar").removeClass("ng-hide")}),0)}t.$watch((function(){return t.key}),(function(){v=0,_.each(e.instancesObj.items,(function(e){t.key>e&&v++})),x++})),y.revision=function(){return x},e.adapterContainer={adapter:{remain:!0}},e.$on("goToDomainRangeGraphView",(function(e,t){R(t)})),e.$on("classCount",w),e.$on("repositoryIsSet",(function(){if(!a.isLicenseValid())return;if(A===n.getActiveRepository())return;A=n.getActiveRepository();if(e.repositoryError=null,!A)return;S=allGraphs,C().then(L)})),e.datasource=y,e.goToDomainRangeGraphView=R,e.toggleClassInfoSidePanel=function(){e.showClassInfoPanel=!e.showClassInfoPanel,t.$broadcast("sidePanelClosed")},e.getActiveRepositoryNoError=function(){if(!e.repositoryError)return n.getActiveRepository()},e.isSystemRepository=function(){return n.isSystemRepository()},e.confirmReloadClassHierarchy=function(){d.openSimpleModal({title:m.instant("confirm.operation"),message:m.instant("graphexplore.calculating.hierarchy"),warning:!0}).result.then((function(){I(),e.loader=!0,e.hierarchyError=!1,o.reloadClassHierarchy(S.contextID.uri).success((function(t){e.loader=!1,e.classHierarchyData=t,T(),w()})).error((function(t){e.loader=!1,e.hierarchyError=getError(t),s.error(getError(t),m.instant("graphexplore.error.rdf.class.request"))}))}))},e.focusOnRoot=function(){e.$broadcast("rootFocus")},e.copyToClipboard=function(e){d.openCopyToClipboardModal(e)},e.searchedClassCallback=function(e){if(e){const r={name:e.title};t.$broadcast("searchedClass",r)}},e.instancesQueryObj.query="",e.instancesFilterFunc=function(t){return t.resolvedUri.toLowerCase().indexOf(e.instancesQueryObj.query.toLowerCase())>=0},C(),e.$watch("instancesObj.items",(function(){e.instancesObj.items.length>0&&u((function(){e.adapterContainer.adapter.reload()}),30)})),e.$watch("selectedClass",(function(){e.showClassInfoPanel&&function(t){const r=t.data.fullName;let n=t.data.name;if(n===r){const e=n.lastIndexOf("#");n=n.substring(e+1)}e.encodedUri=encodeURIComponent(r);const a=encodeURIComponent("prefix onto:<http://www.ontotext.com/>\nselect ?s {\n ?s a <"+r+"> .\n}");e.viewInstancesUri="sparql?name="+n+"&infer=true&sameAs=false&query="+a+"&execute=true",o.getRdfsLabelAndComment(r).success((function(t){e.rdfsLabel=t.label,e.rdfsComment=t.comment,e.expanded=!1})).error((function(){s.error("Error getting rdfs:label and rdfs:comment")})),e.instancesQueryObj.query="",e.instancesLoader=!0,o.getClassInstances(r).success((function(t){e.instancesObj.items=[],_.each(t,(function(t,r){const n={};n.type=t.startsWith("<<")&&t.endsWith(">>")?"triple":"uri",n.absUri=encodeURIComponent(t),n.absUriNonEncoded=t,n.resolvedUri=r,e.instancesObj.items.push(n)})),e.instancesLoader=!1,e.instancesSearchPlaceholder=e.instancesObj.items.length<1e3?"Search class instances":"Search first 1000 class instances",e.instancesNotFiltered=e.instancesObj.items})).error((function(){s.error(m.instant("graphexplore.error.instances.request"))}))}(e.selectedClass)})),$(document).ready((function(){$(".prefix-toggle").click((function(){$(".tooltip").hide()}))}));let A=n.getActiveRepository();function L(){I(),!e.isSystemRepository()&&e.isLicenseValid()&&(e.hierarchyError=!1,e.loader=!0,o.getClassHierarchyData(S.contextID.uri).success((function(t,r){e.showExternalElements=!0,e.loader=!1,e.classHierarchyData=t,207===r&&s.warning(m.instant("graphexplore.update.diagram"),m.instant("graphexplore.repository.data.changed")),T()})).error((function(t){e.loader=!1,e.hierarchyError=getError(t),s.error(getError(t),m.instant("graphexplore.error.rdf.class.request"))})))}e.hasClassHierarchy=function(){return e.classHierarchyData.classCount&&e.getActiveRepositoryNoError()&&!e.isSystemRepository()},e.isLicenseValid=function(){return a.isLicenseValid()},e.chosenGraph=function(e){S=e,L(),h.set("classHierarchy-selectedGraph-"+n.getActiveRepository(),S)},e.getSelGraphValue=function(){return S.contextID.value},e.isAllGraphsSelected=function(){return"all.graphs.label"===e.getSelGraphValue()}}angular.module("graphdb.framework.graphexplore.controllers.class",["pageslide-directive","ngAnimate","ui.scroll.jqlite","ui.scroll","angucomplete-alt","rzSlider","toastr","graphdb.framework.utils.localstorageadapter"]).controller("RdfClassHierarchyCtlr",n),n.$inject=["$scope","$rootScope","$location","$repositories","$licenseService","$window","toastr","GraphDataRestService","UiScrollService","RdfsLabelCommentService","$timeout","ModalService","bowser","LocalStorageAdapter","LSKeys","RDF4JRepositoriesRestService","$translate"]},155:function(e,t,r){"use strict";r.r(t);r(10);function n(e,t,r,n,a,i,s,o,c,l,u,d,p){e.predicatesObj={},e.predicatesQueryObj={},e.predicatesObj.items=[],e.predicatesQueryObj.query="",e.predicatesListNotFiltered=[],e.predicatesSearchPlaceholder="Search predicates",e.onopen=e.onclose=()=>angular.noop();const h={};let f=0,g=0;r.key="",h.get=function(t,r,n){return l.initLazyList(t,r,n,f,e.predicatesObj.items)},r.$watch((function(){return r.key}),(function(){f=0,_.each(e.predicatesObj.items,(function(e){r.key>e&&f++})),g++})),h.revision=function(){return g},e.adapterContainer={adapter:{remain:!0}};const m=s.get(o.DOMAIN_RANGE_COLLAPSE_EDGES);function y(){const e=s.get(o.CLASS_HIERARCHY_LAST_SELECTED_CLASS);t.search("").hash(e).path("hierarchy")}e.collapseEdges=null===m||"true"===m,e.datasource=h,e.$on("reloadDomainRangeGraphView",(function(e,r){const n=r.objectPropClassUri,a=r.objectPropClassName;t.path("domain-range-graph").search("uri",n).search("name",a)})),e.$on("switchEdgeMode",(function(e,r){t.path("domain-range-graph").search("uri",r.uri).search("name",r.name).search("collapsed",r.collapsed)})),e.$on("repositoryIsSet",(function(){if(v===a.getActiveRepository())return;v=a.getActiveRepository();y()})),e.$on("changeCollapsedEdgesState",(function(t,r){e.collapseEdges=!r,s.set(o.DOMAIN_RANGE_COLLAPSE_EDGES,e.collapseEdges)})),e.goToClassHierarchyView=y,e.copyToClipboard=function(e){u.openCopyToClipboardModal(e)},e.toggleCollapseEdgesState=function(){e.collapseEdges=!e.collapseEdges,i.history.pushState({collapsed:e.collapseEdges},"domainRangePage",null)},e.predicatesListFilterFunc=function(t){return t.resolvedUri.toLowerCase().indexOf(e.predicatesQueryObj.query.toLowerCase())>=0},e.$watch("predicatesObj.items",(function(){e.predicatesObj.items>0&&n((function(){e.adapterContainer.adapter.reload()}),30)})),e.$watch("selectedPredicate",(function(){e.showPredicatesInfoPanel&&function(t){const r=t.target,n=t.source;e.encodedUri=encodeURIComponent(t.uri),e.sourceTargetObjectNodeUri=r.objectPropClassUri?r.objectPropClassUri:n.objectPropClassUri,e.encodedSourceTargetObjectNodeUri=encodeURIComponent(e.sourceTargetObjectNodeUri),e.sourceTargetObjectNodeName=r.objectPropClassName?r.objectPropClassName:n.objectPropClassName?n.objectPropClassName:"<i>Literal</i>",-1===e.sourceTargetObjectNodeName.indexOf("Literal")?c.getRdfsLabelAndComment(e.sourceTargetObjectNodeUri).success((function(t){e.rdfsLabel=t.label,e.rdfsComment=t.comment})).error((function(){d.error(p.instant("domain.range.error.get.label.comment"))})):(e.rdfsComment=void 0,e.rdfsLabel=void 0);e.predicatesObj.items=[],e.predicatesQueryObj.query="";const a=r.allEdges?r.allEdges:n.allEdges;_.each(a,(function(t){const r={};r.absUri=encodeURIComponent(t.uri),r.absUriNonEncoded=t.uri,r.resolvedUri=t.name,r.isImplicit=t.implicit,e.predicatesObj.items.push(r)})),e.predicatesListNotFiltered=e.predicatesObj.items}(e.selectedPredicate)})),$(document).ready((function(){$(".compact-mode-toggle").click((function(){$(".tooltip").hide()}))}));let v=a.getActiveRepository()}angular.module("graphdb.framework.graphexplore.controllers.domainrange",["ui.scroll.jqlite","ui.scroll","ngSanitize","graphdb.framework.utils.localstorageadapter"]).controller("DomainRangeGraphCtlr",n),n.$inject=["$scope","$location","$rootScope","$timeout","$repositories","$window","LocalStorageAdapter","LSKeys","GraphDataRestService","UiScrollService","ModalService","toastr","$translate"]},156:function(e,t,r){(function(e){const t="WAIT",r="NO_REPO",n="READY",a="IN_PROGRESS",i="ERROR",s={contextID:{type:"all",value:"all.graphs.label",uri:""}};function o(e){if(e<1e3)return e;const t=Math.floor(Math.log(e)/Math.log(1e3));let r=e/Math.pow(1e3,t);return r=r%1>1/Math.pow(1e3,t-1)?r.toFixed(2):r.toFixed(0),r+["K","M","G","T","P","H"][t-1]}function c(e,o,c,l,u,d,p,h,f,g,m){let y=null;e.status=c.getActiveRepository()?t:r;let v=s;const x=function(){g.resolveGraphs(c.getActiveRepository()).success((function(t){e.graphsInRepo=t.results.bindings.length>1002?t.results.bindings.slice(0,1002):t.results.bindings,S(),e.isSystemRepository()?"READY"!==e.status&&b():(e.status="WAIT",b(!0))})).error((function(t){e.repositoryError=getError(t),l.error(getError(t),m.instant("graphexplore.error.getting.graph"))}))},S=function(){const t=f.get("dependencies-selectedGraph-"+c.getActiveRepository());null!==t&&e.graphsInRepo.some(e=>e.contextID.uri===t.contextID.uri)?v=t:f.set("dependencies-selectedGraph-"+c.getActiveRepository(),v)},C=function(r){d3.select("#dependencies-chord").html(""),e.status=t,d.getRelationshipsData(r,e.direction,v.contextID.uri).success((function(t){e.dependenciesData={matrix:t.right,nodes:t.left,hasLinks:_.sum(_.map(t.right,(function(e){return _.sum(e)})))>0,direction:e.direction},e.status=n})).error((function(t){e.status=n,l.error(getError(t),m.instant("graphexplore.error.dependencies.count"))}))},b=function(r){(e.status!==n||r)&&(e.status=t,d.getRelationshipsStatus(v.contextID.uri).success((function(t){if(e.status=t,e.status===a){if(null!==y)return;y=u(b,2e3)}e.status===n&&(null!==y&&(u.cancel(y),y=null),d.getRelationshipsClasses(e.direction,v.contextID.uri).success((function(t,r){e.allClasses.items=_.filter(t,I),e.allNotFilteredClasses=t,e.selectedClasses=void 0,angular.isUndefined(e.selectedClasses)&&(e.selectedClasses=t.slice(0,10)),C(e.selectedClasses),207===r&&l.warning(m.instant("graphexplore.update.diagram"),m.instant("graphexplore.repository.data.changed"))}))),0===e.status.indexOf("ERROR;")&&(e.status=i,l.error(m.instant("graphexplore.error.dependencies.calc",{error:e.status.substring("ERROR;".length)})))})).error((function(t){e.status=i,l.error(getError(t),m.instant("graphexplore.error.dependencies.count.status"))})))};e.allClasses={},e.allClasses.items=[],e.allNotFilteredClasses=[],e.direction="all";const w={};let E=0,R=0;function I(t){return-1!==t.name.toLowerCase().indexOf(e.classQuery.query.toLowerCase())}o.key="",w.get=function(t,r,n){return p.initLazyList(t,r,n,E,e.allClasses.items)},o.$watch((function(){return o.key}),(function(){E=0,_.each(e.allClasses.items,(function(e){o.key>e&&E++})),R++})),w.revision=function(){return R},e.datasource=w,e.adapterContainer={adapter:{remain:!0}},e.classQuery={},e.classQuery.query="",e.classFilterFunc=I,e.$watch("allClasses.items",(function(){e.allClasses.items.length>0&&u((function(){e.adapterContainer.adapter.reload()}),30)})),e.$watch("direction",(function(){!c.getActiveRepository()||e.isSystemRepository()||c.isActiveRepoFedXType()||x()})),e.$on("$destroy",(function(){u.cancel(y)})),e.isLoading=function(){return e.status===a||e.status===t},e.confirmCalculateDependencies=function(){h.openSimpleModal({title:m.instant("confirm.operation"),message:m.instant("graphexplore.calculating.relationships"),warning:!0}).result.then((function(){e.calculateDependencies()}))},e.calculateDependencies=function(){e.status=t,e.selectedClasses=void 0,d.calculateRelationships(v.contextID.uri).success((function(t){0===t.indexOf("ERROR;")?l.error(m.instant("graphexplore.error.dependencies.calc",{error:e.status.substring("ERROR;".length)})):b()})).error((function(e){l.error(m.instant("graphexplore.error.could.not.force.count",{error:getError(e)}))}))},e.addClass=function(t){e.selectedClasses.push(t),C(e.selectedClasses)},e.removeClass=function(t){_.remove(e.selectedClasses,(function(e){return e.name===t.name})),C(e.selectedClasses)},e.showClass=function(t){e.classToShow=t},e.isClassByNameShown=function(t){return void 0!==_.find(e.selectedClasses,{name:t})},e.addClassByName=function(t){e.selectedClasses.push(_.find(e.allClasses.items,{name:t})),C(e.selectedClasses)},e.removeClassByName=function(t){_.remove(e.selectedClasses,(function(e){return e.name===t})),C(e.selectedClasses)},e.removeAllClasses=function(){e.selectedClasses=[],C(e.selectedClasses)},e.isSystemRepository=function(){return"SYSTEM"===c.getActiveRepository()};const T=e.$on("repositoryIsSet",(function(){e.classQuery={},e.classQuery.query="",e.repositoryError=null,v=s,c.getActiveRepository()&&!c.isActiveRepoFedXType()?x():e.status=r}));window.addEventListener("beforeunload",(function e(){T(),window.removeEventListener("beforeunload",e)})),e.selectGraph=function(e){v=e,b(!0),f.set("dependencies-selectedGraph-"+c.getActiveRepository(),v)},e.getSelectedGraphValue=function(){return v.contextID.value},e.isAllGraphsSelected=function(){return"all.graphs.label"===e.getSelectedGraphValue()}}Object.defineProperty(e,"allGraphs",{get:()=>s}),angular.module("graphdb.framework.graphexplore.controllers.dependencies",["ui.scroll.jqlite","ui.scroll","toastr","ui.bootstrap","graphdb.framework.core.services.repositories","graphdb.framework.utils.localstorageadapter"]).controller("DependenciesChordCtrl",c).config(["$uibTooltipProvider",function(e){e.options({appendToBody:!0})}]).filter("humanize",(function(){return o})),c.$inject=["$scope","$rootScope","$repositories","toastr","$timeout","GraphDataRestService","UiScrollService","ModalService","LocalStorageAdapter","RDF4JRepositoriesRestService","$translate"]}).call(this,r(11))},157:function(e,t,r){"use strict";r.r(t);r(7);var n=r(400),a=r(402),i=(r(10),r(94)),s=r(102);function o(e,t,r,o,c,l,u,d,p,h,f,g,m,y,v,x,S,C,b,w,E,R,I){e.languageChanged=!1,e.propertiesObj={},e.propertiesObj.items=[],e.propertiesQueryObj={},e.propertiesQueryObj.query="",e.propertiesSearchPlaceholder=R.instant("visual.search.instance.placeholder"),e.propertiesNotFiltered=[],e.searchVisible=!1,e.nodeSelected=!1,e.queryResultsMode=!1,e.embedded=h.search().embedded,e.openedNodeInfoPanel=void 0,e.invalidLimit=!1,e.INVALID_LINKS_MSG=R.instant("sidepanel.invalid.limit.links.msg"),e.INVALID_LINKS_TOOLTIP=R.instant("sidepanel.invalid.limit.links.tooltip"),e.datasource=void 0,e.adapterContainer={adapter:{remain:!0}},e.hasInitedRepository=!1,e.defaultSettings={linksLimit:20,includeInferred:!0,sameAsState:!0,languages:["en"],showLinksText:!0,preferredTypes:[],rejectedTypes:[],preferredPredicates:[],rejectedPredicates:["http://dbpedia.org/property/logo","http://dbpedia.org/property/hasPhotoCollection","http://dbpedia.org/property/website","http://dbpedia.org/property/homepage","http://dbpedia.org/ontology/thumbnail","http://xmlns.com/foaf/0.1/depiction","http://xmlns.com/foaf/0.1/homepage","http://xmlns.com/foaf/0.1/mbox","http://dbpedia.org/ontology/wikiPage*","http://dbpedia.org/property/wikiPage*","http://factforge.net/*"],preferredTypesOnly:!1,preferredPredicatesOnly:!1,includeSchema:!0},e.saveSettings=_.cloneDeep(e.defaultSettings),e.defaultGraphConfig={id:"default",name:"Easy graph",startMode:"search"},t.key="",e.onopen=e.onclose=()=>angular.noop(),e.goToHome=()=>{L(),h.url("graphs-visualizations")},e.shouldShowSettings=()=>e.configLoaded&&e.configLoaded.id===e.defaultGraphConfig.id,e.shouldDisableSameAs=()=>{const t=$("#sameAsCheck");return e.settings&&!e.settings.includeInferred&&t.prop("checked")&&(t.prop("checked",!1),e.settings.sameAsState=!1),e.settings&&!e.settings.includeInferred},e.propertiesFilterFunc=t=>t.key.toLowerCase().indexOf(e.propertiesQueryObj.query.toLowerCase())>=0,e.toggleMoreInfo=e=>{angular.element(e.currentTarget).parent().next().toggle(200),angular.element(e.currentTarget).children("span").toggleClass("icon-caret-down").toggleClass("icon-caret-up")},e.copyToClipboard=e=>{m.openCopyToClipboardModal(e)},e.resetSettings=()=>{e.settings=_.cloneDeep(e.defaultSettings),e.validateLinksLimit(),O()},e.changeLimit=t=>{let r=e.settings.linksLimit+t;r<1&&(r=1),r>1e3&&(r=1e3),e.settings.linksLimit=r},e.validateLinksLimit=()=>{e.invalidLimit=!i.NUMBER_PATTERN.test(e.settings.linksLimit)},e.showSettings=()=>{e.showInfoPanel=!0,e.showFilter=!0,e.showNodeInfo=!1,e.showPredicates=!1,e.saveSettings?e.settings=_.cloneDeep(e.saveSettings):e.settings=_.cloneDeep(e.defaultSettings),O()},e.updateSettings=()=>{e.invalidLimit?c.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?P(e.rootNodeIri):e.queryResultsMode&&h.search().query?Q(h.search().query,h.search().sameAs,h.search().inference):"query"===e.configLoaded.startMode&&H(e.configLoaded),N(),e.showInfoPanel=!1,e.showFilter=!1,x.set(S.GRAPHS_VIZ,e.saveSettings))},e.getGraphConfigs=t=>{b.getGraphConfigs().success((function(r){e.graphConfigs=r,t&&t()})).error((function(e){c.error(getError(e),R.instant("graphexplore.error.graph.configs.short.msg"))}))},e.findConfigById=function(t){return t===e.defaultGraphConfig.id?e.defaultGraphConfig:$.grep(e.graphConfigs,(function(e){return e.id===t}))[0]},e.easyGraphSearch=t=>{e.configLoaded=e.defaultGraphConfig,e.openUri(t)},e.deleteConfig=t=>{m.openSimpleModal({title:R.instant("common.confirm"),message:R.instant("graphexplore.delete.graph",{configName:t.name}),warning:!0}).result.then((function(){b.deleteGraphConfig(t).success((function(){e.getGraphConfigs(),e.refreshSavedGraphs()})).error((function(e){c.error(getError(e),R.instant("graphexplore.error.cannot.delete.config"))}))}))},e.goToGraphConfig=e=>{A({config:e.id},{config:e}),L(),H(e)},e.replaceIRIWithPrefix=t=>{const r=e.namespaces,n=_.findLast(r,(function(e){return 0===t.indexOf(e.uri)}));return n?n.prefix+":"+t.substring(n.uri.length):t};const T=[];t.$on("$translateChangeSuccess",(function(){e.INVALID_LINKS_MSG=R.instant("sidepanel.invalid.limit.links.msg"),e.INVALID_LINKS_TOOLTIP=R.instant("sidepanel.invalid.limit.links.tooltip"),e.propertiesSearchPlaceholder=R.instant("visual.search.instance.placeholder")})),e.$on("autocompleteStatus",(function(){ce()})),e.$on("repositoryIsSet",(function(t,r){r.newRepo&&(e.hasInitedRepository=!1),oe(r.newRepo),r.newRepo&&(L(),$(".graph-visualization svg").empty(),h.search().query&&(e.goToHome(),D()))}));T.push(t.$watch(()=>t.key,()=>{z=0,_.each(e.propertiesObj.items,(function(e){t.key>e&&z++})),B++}));T.push(e.$watch("propertiesObj.items",()=>{angular.isDefined(e.propertiesObj.items)&&e.propertiesObj.items.length>0&&l((function(){e.adapterContainer.adapter.reload()}),500)}));e.$on("$destroy",()=>{T.forEach(e=>e())});const A=(t,r)=>{e.embedded&&(t.embedded=!0),h.search(t),h.state(r)},L=()=>{e.searchVisible=!1,e.nodeSelected=!1,e.configLoaded=null,e.queryResultsMode=!1,e.lastSavedGraphName=null,e.lastSavedGraphId=null,e.shared=!1,e.numberOfPinnedNodes=0,W={},V=0},k=()=>I.isActive()?e.defaultSettings:e.saveSettings,N=()=>{k().showLinksText?d3.selectAll("svg .link-wrapper text").style("display","block"):d3.selectAll("svg .link-wrapper text").style("display","none")},O=()=>{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}}))},P=()=>{e.rootNodeIri&&e.$broadcast("onRootNodeChange",e.rootNodeIri)},D=()=>{h.search().query?(e.searchVisible=!1,e.queryResultsMode=!0,Q(h.search().query,h.search().sameAs,h.search().inference)):e.$on("onRootNodeChange",(function(t,r){e.loading=!0;const n=k();angular.isDefined(r)&&(e.rootNodeIri=r,w.getInstanceNode({iri:r,config:e.configLoaded?e.configLoaded.id:e.defaultGraphConfig.id,languages:e.shouldShowSettings()?n.languages:[],includeInferred:n.includeInferred,sameAsState:n.sameAsState}).then((function(t){e.nodeSelected=!0,e.searchVisible=!1,null===t.data.types&&(t.data.types="greyColor"),se=new ie;const r=se.addNode(t.data,te/2,re/2);ee=Z,Re(r,!0)})).catch((function(t){e.loading=!1,c.error(getError(t),R.instant("graphexplore.error.could.not.load.graph"))})))})),h.search().uri&&e.openUri(h.search().uri,!0),h.search().saved&&C.getSavedGraph(h.search().saved).success((function(t){e.loadSavedGraph(t)})).error((function(e){const t=getError(e);c.error(t,R.instant("graphexplore.error.could.not.open"))}))},Q=(t,r,n)=>{const a=k(),i=void 0===r?a.sameAsState:!0===r,s=void 0===n?a.includeInferred:!0===n;e.loading=!0,w.updateGraph({query:t,linksLimit:a.linksLimit,languages:e.shouldShowSettings()?a.languages:[],includeInferred:s,sameAsState:i}).then((function(e){we(e)}),(function(t){e.loading=!1,c.error(getError(t.data),R.instant("graphexplore.error.cannot.load.graph"))}))},M=(e,t)=>{const r=e.split(" ");return t?[r[0],r[1],r[2]].join(">"):[r[0],r[2]].join(">")},j=e=>[e.source.iri,e.target.iri].join(">"),U=e=>{if(e.isTriple){const t=document.getElementById(Object(s.removeSpecialChars)(M(e.iri)));if(t&&void 0!==t.__data__.x)return t.__data__.x}return e.x},G=e=>{if(e.isTriple){const t=document.getElementById(Object(s.removeSpecialChars)(M(e.iri)));if(t&&void 0!==t.__data__.y)return t.__data__.y}return e.y},q=e=>{const t=e.trim().split(" ");return`<<<${t[0]}> <${t[1]}> <${t[2]}>>>`},F=e=>{const t=e.source.isTriple?M(e.source.iri,!0):e.source.iri,r=e.target.isTriple?M(e.target.iri,!0):e.target.iri;return Object(s.removeSpecialChars)(`${t}>${r}>marker`)},H=t=>{e.configLoaded=t,"search"===t.startMode?e.searchVisible=!0:"node"===t.startMode&&t.startIRI?l((function(){e.openUri(t.startIRI,!0)}),0):"query"===t.startMode&&t.startGraphQuery&&(e.loading=!0,b.loadGraphForConfig(t,t.startQueryIncludeInferred,k().linksLimit,t.startQuerySameAs).then((function(e){we(e)}),(function(t){e.loading=!1,c.error(getError(t),R.instant("graphexplore.error.graph.load"))})))},Y=function(){var t,r;h.search().config?(t=h.search().config,r=D,t===e.defaultGraphConfig.id?H(e.defaultGraphConfig):b.getConfig(t).then(e=>{H(e),r()}).catch(e=>{c.error(getError(e),R.instant("graphexplore.error.could.not.load.config",{configId:t}))})):h.search().query||h.search().uri?(H(e.defaultGraphConfig),D()):D()};v.onpopstate=function(t){L(),t.state&&(t.state.config?(H(t.state.config),t.state.uri&&e.openUri(t.state.uri,!0)):t.state.savedGraph&&e.loadSavedGraph(t.state.savedGraph,!0))},e.embedded&&(h.search().query||h.search().uri||h.search().config||h.search().saved)&&(e.noGoHome=!0);let z=0,B=0,W={},V=0;const X=16,K=d3.zoom().scaleExtent([.5,10]);let J;const Z=d3.zoomIdentity.translate(0,-70).scale(1);K.on("zoom",(function(e){I.isActive()||(ee=e.transform,J.attr("transform",ee))}));let ee=Z;const te=1e3,re=1e3;let ne,ae;function ie(){this.nodes=[],this.links=[],this.tripleNodes=new Map,this.tripleLinksCopy=new Map,this.addNode=function(e,t,r){return e.x=t,e.y=r,this.nodes.push(e),e},this.computeConnectedness=function(){const e={},t={};_.each(this.links,(function(r){const n=r.source.iri,a=r.target.iri,i=_.min([n,a])+"|"+_.max([n,a]);t[i]||(t[i]=1,e[n]=(e[n]||0)+1,e[a]=(e[a]||0)+1)})),_.each(this.links,(function(t){e[t.source.iri]>1&&e[t.target.iri]>1?t.connectedness=Math.min(5,Math.max(e[t.source.iri],e[t.target.iri])-1):t.connectedness=0}))},this.addAndMatchLinks=function(e){const t=this.nodes;Array.prototype.push.apply(this.links,function(e,t){return _.map(e,(function(e){let r,n;r=e.isTripleSource?ke(e.source):_.find(t,(function(t){return t.iri===e.source})),n=e.isTripleTarget?ke(e.target):_.find(t,(function(t){return t.iri===e.target}));let a={source:r,target:n,predicates:e.predicates};if(e.isTripleSource||e.isTripleTarget){let e=`${a.source.isTriple?M(a.source.iri):a.source.iri}>${a.target.isTriple?M(a.target.iri):a.target.iri}`;if(se.tripleLinksCopy.has(e)){let t=se.tripleLinksCopy.get(e);return t[0].predicates.push(...a.predicates),t.push(a),se.tripleLinksCopy.set(e,t),null}se.tripleLinksCopy.set(e,[a])}return a}))}(e,t));for(let e of se.tripleLinksCopy.keys())1===se.tripleLinksCopy.get(e).length&&se.tripleLinksCopy.delete(e);this.links=this.links.filter(e=>null!==e),this.computeConnectedness()};const t=function(e,t){return r(e,t).length};function r(e,t){return _.filter(t,(function(t){return t.source.iri===e.iri||t.target.iri===e.iri}))}this.countLinks=t,this.linksTypes=function(e,t){const n=r(e,t),a=_.map(n,(function(t){return t.source.iri===e.iri?t.target.types:t.source.types}));return _.uniq(_.flatten(a))},this.linksPredicates=function(e,t){const n=r(e,t),a=_.map(n,(function(e){return e.predicates}));return _.uniq(_.flatten(a))},this.removeTriples=function(e){let t=[];this.tripleNodes.size>0&&e.forEach(e=>{this.tripleNodes.has(e)&&(this.tripleNodes.delete(e),this.links=_.reject(this.links,(function(r){let n=e.split(">"),a=M(r.source.iri),i=M(r.target.iri);if(a===e&&se.tripleNodes.delete(i)){let e=i.split(">");t.push({source:e[0],target:e[1]})}let s=a===e||i===e||r.source.iri===n[0]&&r.target.iri===n[1];return s&&(se.tripleLinksCopy.delete(`${a}>${i}`),se.tripleLinksCopy.delete(`${i}>${a}`)),s})))}),t.forEach(e=>{this.links=_.reject(this.links,(function(t){return t.source.iri===e.source&&t.target.iri===e.target}))})},this.removeNode=function(r){let n=[];this.links=_.reject(this.links,(function(e){let t=e.source.iri===r.iri||e.target.iri===r.iri;return t&&(e.target.isTriple&&n.push(M(e.target.iri)),e.source.isTriple||e.target.isTriple||n.push([e.source.iri,e.target.iri].join(">"))),t})),this.removeTriples(n);const a=this.links;this.nodes=_.reject(this.nodes,(function(e){return 0===t(e,a)})),0===this.nodes.length&&(e.nodeSelected=!1),this.computeConnectedness()},this.removeNodeLeafLinks=function(e){let n=[],a=this.links;this.links=_.reject(this.links,(function(i){let s=i.source.iri===e.iri&&1===t(i.target,a)&&!i.target.isTriple||i.target.iri===e.iri&&1===t(i.source,a)&&!i.source.isTriple;if(!s){let n;if(i.source.iri!==e.iri||2!==t(i.target,a)||i.target.isTriple?i.target.iri!==e.iri||2!==t(i.source,a)||i.source.isTriple||(n=r(i.source,a)):n=r(i.target,a),!n)return!1;s=(n[0].source.iri===e.iri||n[0].target.iri)&&(n[1].source.iri===e.iri||n[1].target.iri)}return s&&(i.target.isTriple&&n.push(M(i.target.iri)),i.source.isTriple||i.target.isTriple||n.push([i.source.iri,i.target.iri].join(">"))),s})),this.removeTriples(n),a=this.links,this.nodes=_.reject(this.nodes,(function(r){return 0===t(r,a)&&r.iri!==e.iri})),this.computeConnectedness()},this.addTriple=function(e,t,r){e.x=t,e.y=r,e.weight=0;let n=M(e.iri);if(this.tripleNodes.has(n)){let t=this.tripleNodes.get(n);t.push(e),this.tripleNodes.set(n,t)}else e.weight=10,this.tripleNodes.set(n,[e])},this.copyState=function(){const e=_.map(this.nodes,(function(e){return{iri:e.iri,isTriple:e.isTriple,size:e.size,labels:_.cloneDeep(e.labels),types:_.cloneDeep(e.types),rdfRank:e.rdfRank,x:e.x,y:e.y,fixed:e.fixed}})),t=JSON.stringify(Array.from(this.tripleNodes.entries())),r=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:r,colorIndex:V,type2color:W,transform:ee}},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)&&(V=t.colorIndex,W=_.cloneDeep(t.type2color)),angular.isDefined(t.transform)&&(ee=d3.zoomIdentity.translate(t.transform.x,t.transform.y).scale(t.transform.k)),ve()}}e.datasource={get:function(t,r,n){return g.initLazyList(t,r,n,z,e.propertiesObj.items)},revision:function(){return B}},p.when(f.getPrincipal()).then(t=>(t=>{const r=t.appSettings;e.defaultSettings.includeInferred=r.DEFAULT_INFERENCE,e.defaultSettings.sameAsState=r.DEFAULT_INFERENCE&&r.DEFAULT_SAMEAS,e.defaultSettings.includeSchema=r.DEFAULT_VIS_GRAPH_SCHEMA;const n=x.get(S.GRAPHS_VIZ);if(n&&"object"==typeof n)try{e.saveSettings=n,void 0===e.saveSettings.includeSchema&&(e.saveSettings.includeSchema=e.defaultSettings.includeSchema,e.saveSettings.rejectedPredicates=[...e.saveSettings.rejectedPredicates,...e.defaultSettings.rejectedPredicates].unique())}catch(t){e.saveSettings=_.cloneDeep(e.defaultSettings),x.set(S.GRAPHS_VIZ,e.saveSettings)}else e.saveSettings=_.cloneDeep(e.defaultSettings)})(t)),e.showInfoPanel=!1;let se=new ie;function oe(t){!r.getActiveRepository()||e.hasInitedRepository&&!t||(e.hasInitedRepository=!0,t||e.getGraphConfigs(Y),e.getNamespacesPromise=E.getNamespaces(e.getActiveRepository()).success((function(t){const r=_.map(t.results.bindings,(function(e){return{uri:e.namespace.value,prefix:e.prefix.value}}));e.namespaces=_.sortBy(r,(function(e){return e.uri.length})),ce()})).error((function(e){c.error(getError(e),R.instant("graphexplore.error.view.will.not.work"))})))}function ce(){o.isLicenseValid()&&(e.getAutocompletePromise=d.checkAutocompleteStatus())}e.addedTag=function(t){return t.text.indexOf(":")<0?(c.warning(R.instant("graphexplore.absolute.prefixed.iri")),null):(t.text=function(e,t){if(!/^<?(http|urn).*>?/.test(e)){const r=e.split(":"),n=r[0],a=r[1];if(!angular.isUndefined(a)){const e=u.getNamespaceUriForPrefix(t,n);if(e)return e+a}}return e}(t.text,e.namespaces),e.pageslideExpanded=!0,t)},e.validateTag=function(e,t,r){if(e.text.indexOf(":")<0)return r?c.warning(R.instant("graphexplore.absolute.prefixed.iri.option"),t):c.warning(R.instant("graphexplore.absolute.prefixed.iri"),t),!1;const n=e.text.indexOf("*");if(n>=0){if(!r)return c.warning(R.instant("graphexplore.wildcards.not.allowed"),t),!1;if(n<e.text.length-1)return c.warning(R.instant("graphexplore.wildcards.last.char"),t),!1}return!0},e.getTagClass=function(e){return e.endsWith("*")?"tag-item-wildcard":null},e.getActiveRepository=function(){return r.getActiveRepository()},e.isLicenseValid=function(){return o.isLicenseValid()},oe();const le=d3.scaleLinear().domain([0,9]).range(["hsl(0, 100%, 75%)","hsl(360, 90%, 82%)"]).interpolate(d3.interpolateHslLong),ue=d3.scaleLinear().domain([0,9]).range(["hsl(180, 50%, 75%)","hsl(540, 40%, 82%)"]).interpolate(d3.interpolateHslLong);e.getColor=function(e){angular.isUndefined(W[e])&&(W[e]=V,V++);const t=W[e];return t>39?"#c2c2c2":t%2==0?le(t/2):ue(t/2)};const de=d3.forceX(te/2).strength(.005),pe=d3.forceY(re/2).strength(.005),he=d3.forceSimulation().force("x",de).force("y",pe),fe=d3.select(".main-container .graph-visualization").append("svg").attr("viewBox","0 0 "+te+" "+re).attr("preserveAspectRatio","xMidYMid meet");fe.append("rect").attr("width",10*te).attr("height",10*re).attr("x",-(10*te-te)/2).attr("y",-(10*re-re)/2).style("fill","none").style("pointer-events","all").call(K).on("click",(function(e){e.stopPropagation(),Ie(),he.stop()}));let ge=0,me=0;const ye=new function(){this.state=!1,this.setLoadingState=function(e){this.state=e},this.getLoadingState=function(){return this.state},this.init=function(e,t){d3.select(t).append("circle").attr("cx",(function(){return e.x})).attr("cy",(function(){return e.y})).attr("class","loader-container").attr("r",(function(){return e.size})).style("fill","fff").style("opacity","0.7"),d3.select(t).append("image").attr("xlink:href","js/angular/templates/loader/ot-loader.svg?v=2.6.0").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 ve(t){d3.selectAll("svg g").remove(),d3.selectAll(".d3-tip").remove(),d3.selectAll(".menu-events").remove(),J=fe.append("g").attr("class","nodes-container").attr("transform",(function(){return angular.isDefined(ee)&&!t?ee:""}));const r=Object(a.a)().attr("class","d3-tip").customPosition((function(){const e=ne.getBoundingClientRect();return{top:e.bottom+10+"px",left:e.left-30+"px"}})).html((function(t){let r="";return t.fixed&&(r+='<i class="icon-pin"></i>&nbsp;&nbsp;'),t.types.length>0?r+=_.join(_.map(t.types,(function(t){return e.replaceIRIWithPrefix(t)}))," · "):r+="<i>No types</i>",r})),i=function(e){let t="";return t+=_.join(_.map(e.predicates,(function(t,r){if(0===r)return Oe(t);if(r<10)return" · "+Oe(t);if(10===r){const t=function(e){return e.predicates.length-10}(e),r=t>1?t+" predicates":t+" predicate";return" · "+R.instant("graphexplore.tip.text",{textToShow:r})}})),""),t};let o;const u=Object(a.a)().attr("class","d3-tip").customPosition((function(e){const t=o.getBoundingClientRect(),r=function(e){const t=i(e),r=document.createElement("canvas").getContext("2d");return r.font="13px Arial",e.predicates.length<10?r.measureText(t).width:r.measureText(t).width/2}(e);return{top:t.top-30+"px",left:t.left-30+"px",width:r+"px"}})).html((function(e){return i(e)}));const d=function(){l.cancel(void 0),l.cancel(ge),ne=null,r.hide(),me=l((function(){Ie()}),500)};fe.call(r);fe.call(u);let p=fe.selectAll(".link"),h=fe.selectAll(".node");const f=d3.forceCollide(e=>e.size+5).strength(.5),g=d3.forceManyBody().strength(-300),m=d3.forceCenter(te/2,re/2);he.nodes(se.nodes).force("charge",g).force("collide",f).force("center",m).force("link",d3.forceLink(se.links).distance((function(e){return e.source.isTriple||e.target.isTriple?0:function(e){const t=$("<span></span>"),r=e.predicates[0].split("/"),n=r[r.length-1];t.addClass("predicate-text").text(n),$("body").append(t);const a=t.width()+2*e.source.size+2*e.target.size+50;return t.remove(),.75*a}(e)+30*e.connectedness}))),J.append("defs").selectAll("marker").data(se.links).enter().append("marker").attr("class","arrow-marker").attr("id",(function(e){return F(e)})).attr("viewBox","0 -5 10 10").attr("refX",(function(e){return e.target.isTriple?11:e.target.size+11})).attr("refY",0).attr("markerWidth",10).attr("markerHeight",10).attr("orient","auto").append("path").attr("d","M0,-5L10,0L0,5 L10,0 L0, -5"),p=J.selectAll(".link").data(se.links).enter().append("g").attr("class","link-wrapper").attr("id",(function(e){return Object(s.removeSpecialChars)(j(e))})).append("line").attr("class","link").style("stroke-width",1).style("fill","transparent").style("marker-end",(function(e){return`url(#${F(e)})`}));const y=J.selectAll(".link-wrapper").append("text").text((function(e){return Ne(e)})).attr("class",(function(e){return e.predicates.length>1||se.tripleNodes.has(j(e))?"predicates":"predicate"})).attr("dy","-0.5em").style("text-anchor","middle").style("display",k().showLinksText?"":"none").on("mouseover",(function(e,t){e.stopPropagation(),function(e,t){l.cancel(void 0);const r=o=e.target;l((function(){o===r&&t.predicates.length>1&&u.show(t,o)}),300)}(e,t)})).on("mouseout",(function(){l.cancel(void 0),o=null,u.hide()})).on("click",(function(t,r){t.stopPropagation(),function(t,r){Le();const n=j(r);if(1===r.predicates.length&&se.tripleNodes.has(n)){ae=null;const e=se.tripleNodes.get(n)[0];if(Ce(e,this,t.button)){const t={};t.iri=e.iri,t.pred=Oe(e.iri.split(" ")[1]),Te(t)}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){const r=function(e,t){const r=j(t);return se.tripleNodes.has(r)?se.tripleNodes.get(r).findIndex(t=>t.iri.indexOf(e)>=0):-1}(e,t),n=r>-1;return{value:Oe(e),partOfTriple:n,linkId:n?j(t):"",nodeIndex:r}})),e.showInfoPanel=!0)}(r)}(t,r)}));let v,x=0,S=null,C=null;const b=function(t,r,n){let a=n||this.parentNode;Array.isArray(n)&&(a=n[r]);se.countLinks(t,se.links)<=k().linksLimit?Re(t,!1,a):c.info(R.instant("graphexplore.increase.limit"),R.instant("graphexplore.node.at.max")),e.closeInfoPanel()};function w(e,t){let r,n,a,i,s=!0;if("down"===t)r=2*e.size,n=e.size/3,a=.8,i=.3;else if("down-fixed"===t)r=2*e.size,n=e.size,a=.8,i=.66;else if("up"===t)r=e.size/3,n=2*e.size,a=.3,i=.8;else{if("fixed"!==t)return;r=e.size,a=.66,s=!1}let o=J.selectAll(".node-wrapper").filter((function(t){return t===e})).append("text").text("").classed("icon-any pinned",!0).style("font-size",r+"px").attr("x",(function(e){return e.x})).attr("y",(function(e){return e.y})).attr("opacity",a);"fixed"!==t&&"down-fixed"!==t||(e.pin=o),s&&(o=o.transition().duration(1e3).style("font-size",(function(){return n+"px"})).attr("opacity",i),"down-fixed"!==t&&o.remove())}const E=d3.drag().subject((function(e){return e})).on("start",(function(e,t){if(I.isActive())return;0===e.sourceEvent.button&&(t.fixedBeforeDrag=t.fixed,t.isBeingDragged=!0,t.beginDragging=!0,Ie(),d3.select(this).classed("dragging",!0),he.alphaTarget(.3).restart())})).on("drag",(function(t,r){r.isBeingDragged&&(r.fx=t.x,r.fy=t.y,r.fixed?r.beginDragging&&w(r,"fixed"):(e.numberOfPinnedNodes++,r.fixed=!0,w(r,"down-fixed")),r.pinWasFixed=!0,r.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));he.alphaTarget(0)}));h=J.selectAll(".node").data(se.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){n.isBeingDragged||(l.cancel(me),ge=l(()=>{(function(t,r){if(e.showInfoPanel)return!1;(Se.closeIcon||Se.expandIcon||Se.focusIcon||Se.copyURIIcon)&&Se.removeIcons();if(he.alpha()<.1)return Se.initIcons(t,r.parentNode),he.stop(),xe(),!0;return!1})(n,this)&&function(e,t){l.cancel(void 0);const n=ne=t.target;l((function(){ne===n&&r.show(e,ne)}),300)}(n,t)},400))})).on("mouseout",d).on("click",(function(t,r){if(t.button&&0!==t.button)return;const n=this;if(S&&C===n)return l.cancel(S),S=null,void b(r,0,n.parentNode);C=n,d(),e.showPredicates=!1,I.isActive()||(l.cancel(S),S=l((function(){Ce(r,n,t),S=null}),540))})).on("touchstart",(e,t)=>function(e){x=0,v=l((function(){x<5&&be(e),v=null}),1e3)}(t)).on("touchmove",(function(){x++})).on("touchend",(function(){l.cancel(v),v=null})).on("contextmenu",(function(t,n){t.shiftKey||(t.preventDefault(),Ie(),e.closeInfoPanel(),n.fixed?(e.numberOfPinnedNodes--,n.fixed=!1,n.fx=null,n.fy=null,w(n,"up"),he.alpha(1).restart()):(e.numberOfPinnedNodes++,n.fixed=!0,w(n,"down")),function(e){ne&&r.show(e,ne)}(n))})).on("gdb-expand-node",(e,t)=>b(t,0,e.srcElement.parentNode)).on("gdb-show-node-info",(e,t)=>_e(t)).call(E);const T=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"),(e=>{e.each((function(e){e.fontSize=n.a.Text.calcFontSizeRaw(e.labels[0].label,e.size,X,!0)})).attr("height",(function(e){return 3*e.fontSize})).append("xhtml:div").attr("class","node-label-body").style("font-size",(function(e){return e.fontSize+"px"})).append("xhtml:div").text((function(e){return e.labels[0].label})),l((function(){$(".node-label-body div").each((function(e,t){let r=t.textContent.substring(0,t.textContent.length-1);let n=0;for(;n<200&&(t.scrollHeight>t.clientHeight||t.scrollWidth>t.clientWidth);)r=r.substring(0,r.length-1),t.textContent=r+"…",n++}))}),50)})(T),he.on("tick",(function(){p.attr("x1",(function(e){return U(e.source)})).attr("y1",(function(e){return G(e.source)})).attr("x2",(function(e){return U(e.target)})).attr("y2",(function(e){return G(e.target)})),y.attr("x",(function(e){let t=U(e.source),r=U(e.target);return e.x=.5*(t+r)})).attr("y",(function(e){let t=G(e.source),r=G(e.target);return e.y=.5*(t+r)})).attr("transform",(function(e){return"rotate("+function(e,t){const r={x:U(e.source),y:G(e.source)},n={x:U(e.target),y:G(e.target)};if(t)return 180*Math.atan2(n.y-r.y,n.x-r.x)/Math.PI;{const e=180*Math.atan2(n.y-r.y,n.x-r.x)/Math.PI;return e<=90&&e>=-90?e:(e>0?-1:1)*(180-Math.abs(e))}}(e,e.direction)+", "+e.x+", "+e.y+")"})),h.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})),T.attr("x",(function(e){return e.x-1.75*e.size})).attr("y",(function(e){return e.y-3*e.fontSize/2})),d3.select(".pinned").attr("x",(function(e){return e.x})).attr("y",(function(e){return e.y})),xe()})),angular.isDefined(ye)&&ye.setLoadingState(!1),e.loading&&(e.loading=!1),d3.selectAll(".link-wrapper").each((function(){const e=$(this).attr("id").split(">")[0],t=$(this).attr("id").split(">")[1];d3.selectAll(".link").each((function(r){const n=Object(s.removeSpecialChars)(r.source.iri),a=Object(s.removeSpecialChars)(r.target.iri);if(n===t&&a===e){let e=n;e+=">",e+=a;const t=document.createTextNode(" ⟶");document.getElementById(e).lastChild.appendChild(t),r.direction="double"}}))})),d3.selectAll(".d3-actions-tip").remove(),he.alpha(.3).restart()}function xe(){t.d3alpha=he.alpha()}const Se=new function(){function r(e,t){return"translate("+(t.x-14+(t.size+15)*Math.cos(e*Math.PI/180-Math.PI/2))+","+(t.y-14+(t.size+15)*Math.sin(e*Math.PI/180-Math.PI/2))+")"}this.closeIcon=void 0,this.expandIcon=void 0,this.collapseIcon=void 0,this.focusIcon=void 0,this.copyURIIcon=void 0,this.actionsTip=void 0,this.removeIcons=function(){this.closeIcon.remove("g"),this.expandIcon&&this.expandIcon.remove("g"),this.collapseIcon&&this.collapseIcon.remove("g"),this.focusIcon.remove("g"),this.copyURIIcon.remove("g"),this.closeIcon=void 0,this.expandIcon=void 0,this.collapseIcon=void 0,this.focusIcon=void 0,this.copyURIIcon=void 0,this.expandedState=!1},this.expandedState=!1,this.initIcons=function(n,i){const s=Object(a.a)().attr("class","d3-tip d3-actions-tip").customPosition((function(e,t){const r=t.target.getBoundingClientRect();return{top:r.top-20+"px",left:r.right+10+"px"}})).html((function(e){return e}));fe.call(s);n.isExpanded?(this.collapseIcon=d3.select(".menu-events").append("g").attr("class","collapse-icon").attr("name","collapse").attr("transform",(function(){return r(20,n)})),this.collapseIcon.append("circle").attr("cx",14).attr("cy",14).attr("r",13).style("fill","#eee"),this.collapseIcon.append("path").attr("d","M22.67,12a.59.59,0,0,1-.53.65l-6.88.72H15.2a.59.59,0,0,1-.59-.65l.72-6.88A.58.58,0,0,1,16,5.33a.59.59,0,0,1,.53.65L16,11.11,21.3,5.79a.64.64,0,0,1,.91.91L16.89,12,22,11.49A.59.59,0,0,1,22.67,12ZM12.59,14.75l-6.75.85a.59.59,0,0,0-.51.66.58.58,0,0,0,.66.51l4.95-.62-5.2,5.2a.64.64,0,1,0,.91.91l5.2-5.2L11.23,22a.59.59,0,0,0,.51.66h.07a.59.59,0,0,0,.59-.52l.85-6.75a.59.59,0,0,0-.17-.49A.58.58,0,0,0,12.59,14.75Z").style("fill","var(--primary-color)"),this.collapseIcon.on("click",(function(){var e;(e=n).isExpanded=!1,se.removeNodeLeafLinks(e),ve()})).on("mouseover",(function(e){s.show(this.getAttribute("name"),e),l.cancel(ge),l.cancel(me)})).on("mouseout",(function(){s.hide(),me=l((function(){Ie()}),500)}))):(this.expandIcon=d3.select(".menu-events").append("g").attr("class","expand-icon").attr("name","expand").attr("transform",(function(){return r(20,n)})),this.expandIcon.append("circle").attr("cx",14).attr("cy",14).attr("r",13).style("fill","#eee"),this.expandIcon.append("path").attr("d","M22.37,6.28l-.72,6.88a.59.59,0,0,1-.59.53H21a.59.59,0,0,1-.53-.65L21,7.9l-5.32,5.32a.64.64,0,0,1-.91-.91L20.1,7,15,7.53a.59.59,0,0,1-.12-1.18l6.88-.72a.59.59,0,0,1,.65.65ZM12.89,20.34,7.95,21l5.2-5.2a.64.64,0,0,0-.91-.91L7,20.05l.62-4.95A.59.59,0,0,0,6.48,15l-.85,6.75a.59.59,0,0,0,.59.67h.07L13,21.52a.59.59,0,1,0-.15-1.18Z").style("fill","var(--primary-color)"),this.expandIcon.on("click",(function(){Re(n,!1,i)})).on("mouseover",(function(e){s.show(this.getAttribute("name"),e),l.cancel(me),l.cancel(ge)})).on("mouseout",(function(){s.hide(),me=l((function(){Ie()}),500)}))),this.focusIcon=d3.select(".menu-events").append("g").attr("class","focus-icon").attr("name","focus").attr("transform",(function(){return r(20,n)})),this.focusIcon.append("circle").attr("cx",14).attr("cy",14).attr("r",13).style("fill","#eee"),this.focusIcon.append("path").attr("d","M14.2,23.81a9.8,9.8,0,1,1,6.93-2.87h0A9.74,9.74,0,0,1,14.2,23.81Zm0-18.17a8.37,8.37,0,1,0,5.92,14.29h0A8.37,8.37,0,0,0,14.2,5.64Zm1.42,6.95a2,2,0,1,0,0,2.85A2,2,0,0,0,15.62,12.59Z").style("fill","var(--primary-color)"),this.focusIcon.on("click",(function(){t.$broadcast("onRootNodeChange",n.iri)})).on("mouseover",(function(e){s.show(this.getAttribute("name"),e),l.cancel(me),l.cancel(ge)})).on("mouseout",(function(){s.hide(),me=l((function(){Ie()}),500)})),this.copyURIIcon=d3.select(".menu-events").append("g").attr("class","icon-link").attr("name","link").attr("transform",(function(){return r(20,n)})),this.copyURIIcon.append("circle").attr("cx",14).attr("cy",14).attr("r",13).style("fill","#eee"),this.copyURIIcon.append("path").attr("d","M 13.457031 10.164062 C 13.648438 10.164062 13.820312 10.242188 13.941406 10.363281 L 15.492188 11.859375 C 15.984375 12.332031 16.292969 12.992188 16.292969 13.714844 C 16.292969 14.441406 15.984375 15.097656 15.492188 15.574219 L 10.394531 20.496094 C 9.902344 20.972656 9.222656 21.265625 8.472656 21.265625 C 7.71875 21.265625 7.039062 20.972656 6.546875 20.496094 L 4.996094 19 C 4.507812 18.523438 4.203125 17.867188 4.203125 17.144531 C 4.203125 16.421875 4.507812 15.765625 4.996094 15.289062 L 7.542969 12.824219 C 7.667969 12.707031 7.84375 12.628906 8.035156 12.628906 C 8.417969 12.628906 8.726562 12.929688 8.726562 13.300781 C 8.726562 13.484375 8.648438 13.652344 8.523438 13.773438 L 5.976562 16.234375 C 5.738281 16.46875 5.589844 16.792969 5.589844 17.148438 C 5.589844 17.503906 5.738281 17.824219 5.976562 18.058594 L 7.527344 19.566406 C 7.773438 19.792969 8.105469 19.929688 8.472656 19.929688 C 8.835938 19.929688 9.167969 19.792969 9.414062 19.566406 L 14.511719 14.644531 C 14.753906 14.410156 14.90625 14.089844 14.90625 13.730469 C 14.90625 13.375 14.753906 13.054688 14.511719 12.820312 L 12.964844 11.324219 C 12.839844 11.203125 12.761719 11.039062 12.761719 10.855469 C 12.761719 10.488281 13.070312 10.1875 13.449219 10.1875 Z M 17.082031 3.976562 C 17.082031 3.976562 17.085938 3.976562 17.085938 3.976562 C 17.824219 3.976562 18.492188 4.261719 18.980469 4.722656 L 20.535156 6.203125 C 21.042969 6.679688 21.355469 7.34375 21.355469 8.082031 C 21.355469 8.792969 21.058594 9.441406 20.582031 9.914062 L 18.0625 12.402344 C 17.9375 12.527344 17.761719 12.605469 17.566406 12.605469 C 17.183594 12.605469 16.875 12.304688 16.875 11.9375 C 16.875 11.753906 16.949219 11.589844 17.070312 11.46875 L 19.605469 8.984375 C 19.847656 8.75 19.996094 8.429688 19.996094 8.070312 C 19.996094 7.714844 19.847656 7.394531 19.605469 7.160156 L 18.019531 5.667969 C 17.773438 5.445312 17.4375 5.304688 17.070312 5.300781 C 16.703125 5.304688 16.367188 5.453125 16.128906 5.691406 L 11.085938 10.667969 C 10.84375 10.898438 10.695312 11.222656 10.695312 11.578125 C 10.695312 11.933594 10.84375 12.257812 11.085938 12.488281 L 12.675781 13.980469 C 12.804688 14.101562 12.882812 14.273438 12.882812 14.457031 C 12.882812 14.828125 12.574219 15.128906 12.191406 15.128906 C 12.003906 15.128906 11.832031 15.054688 11.707031 14.9375 L 10.140625 13.457031 C 9.636719 12.980469 9.324219 12.316406 9.324219 11.582031 C 9.324219 10.863281 9.621094 10.214844 10.101562 9.742188 L 15.140625 4.765625 C 15.625 4.285156 16.304688 3.980469 17.054688 3.976562 Z M 17.082031 3.976562").style("fill","var(--primary-color)"),this.copyURIIcon.on("click",(function(){e.copyToClipboard(n.iri),Ie(),s.hide()})).on("mouseover",(function(e){s.show("<div style='text-align: center;'><b>Copy to ClipBoard</b><br>"+n.iri+"</div>",e),l.cancel(me),l.cancel(ge)})).on("mouseout",(function(){s.hide(),me=l((function(){Ie()}),500)})),this.closeIcon=d3.select(".menu-events").append("g").attr("class","close-icon").attr("name","remove").attr("transform",(function(){return r(20,n)})),this.closeIcon.append("circle").attr("cx",14).attr("cy",14).attr("r",13).style("fill","#eee"),this.closeIcon.append("path").attr("d","M14.94,14l5.87-5.87a.66.66,0,1,0-.94-.94L14,13.06,8.13,7.19a.66.66,0,0,0-.94.94L13.06,14,7.19,19.87a.66.66,0,1,0,.94.94L14,14.94l5.87,5.87a.66.66,0,1,0,.94-.94Z").style("fill","var(--primary-color)"),this.closeIcon.on("click",(function(){be(n)})).on("mouseover",(function(e){s.show(this.getAttribute("name"),e),l.cancel(me),l.cancel(ge)})).on("mouseout",(function(){s.hide(),me=l((function(){Ie()}),500)})),this.animateMenu(n)},this.animateMenu=function(e){const t=d3.easeSin;let n=0;let a=20;this.expandIcon&&this.expandIcon.transition().duration(100).style("opacity",1).ease(t).attr("transform",(function(){return r(a,e)})).delay(n+=35),this.collapseIcon&&this.collapseIcon.transition().duration(100).style("opacity",1).ease(t).attr("transform",(function(){return r(a,e)})).delay(n+=35),this.copyURIIcon.transition().duration(100).style("opacity",1).ease(t).attr("transform",(function(){return a+=30,r(a,e)})).delay(n+=35),this.focusIcon.transition().duration(100).style("opacity",1).ease(t).attr("transform",(function(){return a+=30,r(a,e)})).delay(n+=35),this.closeIcon.transition().duration(100).style("opacity",1).ease(t).attr("transform",(function(){return a+=30,r(a,e)})).delay(n+=35),this.expandedState=!0}};function Ce(r,n,a){return e.showInfoPanel=!1,e.showPredicates=!1,e.showNodeInfo=!1,a.shiftKey&&(a.ctrlKey||a.metaKey)?(t.$broadcast("onRootNodeChange",r.iri),!1):a.ctrlKey||a.metaKey?(be(r),!1):void 0!==e.openedNodeInfoPanel&&e.openedNodeInfoPanel===r?(e.pageslideExpanded=!1,e.openedNodeInfoPanel=void 0,!1):(_e(r),!0)}function be(e){se.removeNode(e),ve()}function we(t){!function(t){e.nodeSelected=!0,null===t.data.types&&(t.data.types="greyColor"),se=new ie,ee=Z}(t),Ee(t)}function Ee(t,r,n){let a=t.data;a=_.filter(a,(function(e){return-1===_.findIndex(se.links,(function(t){return e.source===t.source.iri&&e.target===t.target.iri}))}));const i=[],s=se.tripleLinksCopy.values();for(let e=0;e<se.tripleLinksCopy.size;e++){s.next().value.forEach(e=>{i.push(e)})}a=_.filter(a,(function(e){return-1===_.findIndex(i,(function(t){return e.source===t.source.iri&&e.target===t.target.iri}))})),a=_.filter(a,(function(e){return e.source!==e.target}));const o=((e,t)=>{const r=t.map(t=>t[e]);return t.filter((t,n)=>r.indexOf(t[e])===n)})("iri",_.union(_.flatten(_.map(t.data,(function(e){return[{iri:e.source,isTriple:e.isTripleSource},{iri:e.target,isTriple:e.isTripleTarget}]}))))),l=_.map(se.nodes,(function(e){return{iri:e.iri,isTriple:Boolean(e.isTriple)}})),u=se.tripleNodes.values();for(let e=0;e<se.tripleNodes.size;e++){u.next().value.forEach(e=>{l.push({iri:e.iri,isTriple:e.isTriple})})}const d=_.reject(o,(function(e){return _.some(l,e)}));if(0===d.length)(n||0===a.length)&&c.info(R.instant("graphexplore.error.node.connections")),se.addAndMatchLinks(a),ve();else{const t=[],n=[],i=k();_.forEach(d,(function(r,a){t.push(w.getInstanceNode({iri:r.isTriple?q(r.iri):r.iri,config:e.configLoaded.id,languages:e.shouldShowSettings()?i.languages:[],includeInferred:i.includeInferred,sameAsState:i.sameAsState}).then((function(e){n[a]=e.data})))})),p.all(t).then((function(){_.forEach(n,(function(e,t){const a=2*Math.PI*t/n.length,i=(r?r.x:0)+Math.cos(a)*re/3,s=(r?r.y:0)+Math.sin(a)*re/3;e.isTriple?se.addTriple(e,i,s):se.addNode(e,i,s)})),se.addAndMatchLinks(a),r&&(r.isExpanded=!0),ve()}))}}function Re(t,r,n){if(ye.getLoadingState())return;ye.init(t,n);const a=k(),i=t.iri;w.getInstanceNodeLinks({iri:i,linksLimit:a.linksLimit,includeInferred:a.includeInferred,config:e.configLoaded.id,preferredTypes:e.shouldShowSettings()?a.preferredTypes:[],rejectedTypes:e.shouldShowSettings()?a.rejectedTypes:[],preferredPredicates:e.shouldShowSettings()?a.preferredPredicates:[],rejectedPredicates:e.shouldShowSettings()?a.rejectedPredicates:[],preferredTypesOnly:e.shouldShowSettings()?a.preferredTypesOnly:[],preferredPredicatesOnly:e.shouldShowSettings()?a.preferredPredicatesOnly:[],languages:e.shouldShowSettings()?a.languages:[],sameAsState:a.sameAsState,includeSchema:a.includeSchema}).then((function(e){Ee(e,t,r)}),(function(t){const r=getError(t.data);c.error(r,R.instant("graphexplore.error.exploring.node")),e.loading=!1,ye.setLoadingState(!1)}))}function Ie(){angular.isDefined(Se)&&Se.expandedState&&Se.removeIcons()}function _e(t){he.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(q(t.iri)):encodeURIComponent(t.iri),e.showInfoPanel=!0,e.rdfsLabel=t.labels[0].label,e.rdfsComment=t.comment,e.expanded=!1,e.propertiesQueryObj.query="",e.dataNodeKeysQuery="";const r=k();w.getProperties({iri:t.isTriple?q(t.iri):t.iri,config:e.configLoaded.id,languages:e.shouldShowSettings()?r.languages:[],includeInferred:r.includeInferred,sameAsState:r.sameAsState,rejectedPredicates:e.shouldShowSettings()?r.rejectedPredicates:[]}).then((function(t){e.data=_.mapKeys(t.data,(function(t,r){return e.replaceIRIWithPrefix(r)})),e.propertiesObj.items=[],_.forEach(e.data,(function(t,r){e.propertiesObj.items.push({key:r,value:t})})),e.nodeImage=void 0,e.propertiesNotFiltered=e.propertiesObj.items;const r=_.find(e.propertiesObj.items,(function(e){return"image"===e.key}));r&&(e.nodeImage=r.value[0].v),e.propertiesObj.items=_.reject(e.propertiesObj.items,(function(e){return"image"===e.key})),e.propertiesNotFiltered=e.propertiesObj.items}),(function(e){c.warning(getError(e.data),"Error")}))}function Te(e){Ae("predicate","var(--primary-color-dark)",e),Ae("predicates","var(--primary-color-dark)",e);const t=document.getElementsByClassName("link");t&&_.each(t,(function(t){const r=t.__data__;(r.source.iri.indexOf(e.iri)>=0||r.target.iri.indexOf(e.iri)>=0)&&(t.style.stroke="var(--primary-color-dark)",t.style.strokeWidth=4)}));const r=document.getElementsByClassName("arrow-marker");r&&_.each(r,(function(t){const r=t.__data__;(r.source.iri.indexOf(e.iri)>=0||r.target.iri.indexOf(e.iri)>=0)&&(t.style.stroke="var(--primary-color-dark)",t.__data__.target.isTriple||t.setAttribute("refX","23"))}))}function Ae(e,t,r){const n=document.getElementsByClassName(e);n&&_.each(n,(function(e){const n=e.__data__;r?((n.source.iri.indexOf(r.iri)>=0||n.target.iri.indexOf(r.iri)>=0)&&(e.style.fill=t),M(r.iri)===j(n)&&(e.textContent=r.pred,e.style.fill=t),r.oppLinkIRI&&r.oppLinkIRI===j(n)&&(e.textContent=r.oppTriplePred,e.style.fill=t)):(e.style.fill=t,e.textContent=Ne(n))}))}function Le(){_.each(e.predicates,(function(e){const t=document.getElementById(e.linkId+e.nodeIndex);t&&(t.style.fontWeight="normal")}));const t=document.getElementsByClassName("link");t&&_.each(t,(function(e){e.style.stroke="#999",e.style.strokeWidth=1})),Ae("predicate",""),Ae("predicates","");const r=document.getElementsByClassName("arrow-marker");r&&_.each(r,(function(e){e.style.stroke="#999",e.__data__.target.isTriple||e.setAttribute("refX","59")}))}function ke(e){const t=M(e);if(se.tripleNodes.has(t))return se.tripleNodes.get(t).find(t=>t.iri===e)}function Ne(e){return e.predicates.length>1?e.predicates.length+" predicates":Oe(e.predicates[0])}function Oe(t){const r=e.replaceIRIWithPrefix(t);return r.length===t.length?t.split("/")[t.split("/").length-1]:r}e.toggleSidePanel=function(){e.pageslideExpanded=!e.pageslideExpanded},e.closeInfoPanel=function(){e.pageslideExpanded=!1,e.openedNodeInfoPanel=void 0,e.predicates=[],ae=null,l((function(){e.showInfoPanel=!1}))},e.clickLink=function(t){if(se.tripleNodes.has(t.linkId)){Le();const r=se.tripleNodes.get(t.linkId)[t.nodeIndex];_e(r),e.showPredicates=!0;const n=document.getElementById(t.linkId+t.nodeIndex);n&&(n.style.fontWeight="bold");const a={},i=se.tripleLinksCopy.values();for(let e=0;e<se.tripleLinksCopy.size;e++){const e=i.next().value;e.length>1&&e.every(t=>t.source.iri===r.iri?(a.iri=e[0].source.iri,t.target.isTriple&&(a.oppLinkIRI=M(t.target.iri),a.oppTriplePred=Oe(t.target.iri.split(" ")[1])),a.pred=Oe(r.iri.split(" ")[1]),1===t.predicates.length&&(a.linkPred=t.predicates[0]),!1):t.target.iri!==r.iri||(a.iri=e[0].target.iri,t.source.isTriple&&(a.oppLinkIRI=M(t.source.iri),a.oppTriplePred=Oe(t.source.iri.split(" ")[1])),a.pred=Oe(r.iri.split(" ")[1]),1===t.predicates.length&&(a.linkPred=t.predicates[0]),!1))}a.iri||(a.iri=r.iri,a.pred=Oe(r.iri.split(" ")[1])),Te(a)}},e.splitPredicate=function(e){return e.split("/")[e.split("/").length-1]},e.getActiveRepository=function(){return r.getActiveRepository()},e.isLoadingLocation=function(){return r.isLoadingLocation()},e.hasActiveLocation=function(){return r.hasActiveLocation()},e.rotate=function(e){Ie();const t=10*(e?1:-1)*Math.PI/180,r=Math.cos(t),n=Math.sin(t),a=te/2,i=re/2;d3.selectAll(".node-wrapper").each((function(e){e.x=a+(r*(e.x-a)+n*(e.y-i)),e.y=i+(-n*(e.x-a)+r*(e.y-i)),e.fixed&&(e.fx=e.x,e.fy=e.y)})),he.alpha(1).restart()},e.openUri=function(t,r){if(!r){const r={};e.configLoaded.id!==e.defaultGraphConfig.id&&(r.config=e.configLoaded.id),r.uri=t,A(r,{uri:t,config:e.configLoaded})}e.$broadcast("onRootNodeChange",t)},e.saveOrUpdateGraph=function(){const t=JSON.stringify(se.copyState()),r={id:e.lastSavedGraphId,name:e.lastSavedGraphName,data:t,shared:e.shared};r.id?e.saveGraphModal("update",r):e.saveGraphModal("new",r)},e.renameSavedGraph=function(t){e.saveGraphModal("rename",{id:t.id,name:t.name,config:t.config,shared:t.shared})};const Pe=function(t){C.editSavedGraph(t).success((function(){e.lastSavedGraphName=t.name,e.shared=t.shared,e.refreshSavedGraphs(),c.success(R.instant("graphexplore.saved.graph.was.edited",{name:t.name}))})).error((function(e){const t=getError(e);c.error(t,R.instant("graphexplore.error.cannot.edit"))}))};e.saveGraphModal=function(t,r,n){y.open({templateUrl:"js/angular/graphexplore/templates/modal/save-graph.html",controller:"SaveGraphModalCtrl",resolve:{data:function(){return{mode:t,graph:r,graphExists:n,shared:r.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),C.addNewSavedGraph(t).success((function(r,n,a){e.lastSavedGraphName=t.name,e.lastSavedGraphId=a()["x-saved-graph-id"],e.shared=t.shared,e.refreshSavedGraphs(),c.success(R.instant("graphexplore.saved.graph",{name:t.name}))})).error((function(r,n){if(422===n)e.saveGraphModal("new",t,!0);else{const e=getError(r);c.error(e,R.instant("graphexplore.error.cannot.create.graph"))}}))}(t.graph);break;case"update":case"rename":Pe(t.graph)}}))},e.refreshSavedGraphs=function(){C.getSavedGraphs().success((function(t){e.savedGraphs=t})).error((function(e){const t=getError(e);c.error(t,R.instant("graphexplore.error.getting.saved.graphs"))}))},e.loadSavedGraph=function(t,r){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),h.url("?saved="+t.id),se.restoreState(JSON.parse(t.data)),r||A({saved:t.id},{savedGraph:t})},e.copyToClipboardSavedGraph=function(t){const r=[location.protocol,"//",location.host,location.pathname,"?saved=",t.id].join("");e.copyToClipboard(r)},e.deleteSavedGraph=function(t){m.openSimpleModal({title:R.instant("common.confirm"),message:R.instant("graphexplore.confirm.delete.graph",{graphName:t.name}),warning:!0}).result.then((function(){!function(t){C.deleteSavedGraph(t).success((function(){e.refreshSavedGraphs(),c.success(R.instant("graphexplore.saved.graph.was.deleted",{name:t.name}))})).error((function(e){const t=getError(e);c.error(t,R.instant("graphexplore.error.cannot.delete"))}))}(t)}))},e.openIRI=function(t,r){return r.shiftKey?e.$broadcast("onRootNodeChange",t):window.open(t,"_blank"),!1},e.togglePinAllNodes=function(){Ie();const t=angular.isUndefined(e.numberOfPinnedNodes)||e.numberOfPinnedNodes<=0;e.numberOfPinnedNodes=0,d3.selectAll(".node").each((function(r){r.fixed=t,t?(e.numberOfPinnedNodes++,r.fx=r.x,r.fy=r.y):(r.fx=null,r.fy=null)})),he.alpha(1).restart()},$("body").on("keydown",(function(t){!I.isActive()&&"input"!==t.target.nodeName&&e.nodeSelected&&(37===t.keyCode?e.rotate(!0):39===t.keyCode&&e.rotate(!1))})),e.getLiteralFromPropValue=function(e){return e.substring(e.indexOf(":")+1)}}function c(e,t,r,n){switch(e.mode=r.mode,e.graph=_.cloneDeep(r.graph),e.graphExists=r.graphExists,e.mode){case"new":e.title=n.instant("graphexplore.create.new.graph"),e.okButtonText=n.instant("common.create.btn");break;case"update":e.title=n.instant("graphexplore.update"),e.okButtonText=n.instant("common.save.btn");break;case"rename":e.title=n.instant("graphexplore.rename"),e.okButtonText=n.instant("common.save.btn")}e.ok=function(){e.form.$valid&&t.close({graph:e.graph,mode:e.mode})},e.saveNew=function(){e.graph.name=e.graph.name+" (new)",t.close({graph:e.graph,mode:"new",restart:!0})},e.cancel=function(){t.dismiss("cancel")}}angular.module("graphdb.framework.graphexplore.controllers.graphviz",["ui.scroll.jqlite","ui.scroll","toastr","ui.bootstrap","ngTagsInput","graphdb.framework.utils.localstorageadapter"]).controller("GraphsVisualizationsCtrl",o).controller("SaveGraphModalCtrl",c).config(["$uibTooltipProvider",function(e){e.options({appendToBody:!0})}]),o.$inject=["$scope","$rootScope","$repositories","$licenseService","toastr","$timeout","ClassInstanceDetailsService","AutocompleteRestService","$q","$location","$jwtAuth","UiScrollService","ModalService","$uibModal","$window","LocalStorageAdapter","LSKeys","SavedGraphsRestService","GraphConfigRestService","GraphDataRestService","RDF4JRepositoriesRestService","$translate","GuidesService"],c.$inject=["$scope","$uibModalInstance","data","$translate"]},158:function(e,t,r){"use strict";r.r(t);r(64),r(10);var n=r(62),a=r(61),i=r(14),s=r(73),o=r(93);function c(e,t,r,c,l,u,d,p,h,f,g,m,y,v,x,S){let C;e.newConfig=new s.GraphsConfig,e.revertConfig=void 0,e.page=1,e.totalPages=5,e.helpHidden=1===y.get(v.HIDE_GRAPH_CONFIG_HELP),e.isUpdate=!1,e.shared=!1,e.canEditActiveRepo=e.canWriteActiveRepo(),e.samples=[],e.tabConfig={inference:e.newConfig.startQueryIncludeInferred,sameAs:e.newConfig.startQuerySameAs},e.getAutocompletePromise=void 0,e.getNamespacesPromise=void 0,e.tabsViewModel=[{page:1,label:x.instant("starting.point.label"),type:"startGraphQuery"},{page:2,label:x.instant("graph.expansion"),type:"expandQuery"},{page:3,label:x.instant("node.basics"),type:"resourceQuery"},{page:4,label:x.instant("edge.basics"),type:"predicateLabelQuery"},{page:5,label:x.instant("node.extra"),type:"resourcePropertiesQuery"}];const b=f.configName,w=l.getActiveRepository();e.toggleHelp=t=>{void 0===t&&(t=y.get(v.HIDE_GRAPH_CONFIG_HELP)),1!==t?(y.set(v.HIDE_GRAPH_CONFIG_HELP,1),e.helpHidden=!0):(y.set(v.HIDE_GRAPH_CONFIG_HELP,0),e.helpHidden=!1)},e.fixedVisualCallback=(t,r)=>{e.newConfig.startIRI=t,e.newConfig.startIRILabel=r,C=!0},e.isDefaultGraph=e=>e.isDefaultGraph(),e.isUserGraph=e=>!e.isDefaultGraph(),e.getSampleName=(e,t)=>{if(!e)return"";const r=e.getPropertyDescription(t);return r||(e.id?"Copy of "+e.name:e.name)},e.createGraphConfig=e=>{p.createGraphConfig(e).success((async function(){await g.showToastMessageWithDelay("graphexplore.saved.new.config"),r.url("graphs-visualizations")})).error((function(e){c.error(getError(e),x.instant("graphexplore.error.could.not.create"))}))},e.updateGraphConfig=e=>{p.updateGraphConfig(e).success((async function(){await g.showToastMessageWithDelay("graphexplore.saved.config"),r.url("graphs-visualizations")})).error((function(e){c.error(getError(e),x.instant("graphexplore.error.could.not.save"))}))},e.goToPage=t=>{e.page!==t&&L(()=>{e.showEditor(),e.page=t})},e.goToPreviousPage=()=>{e.page>1&&e.goToPage(e.page-1),Q()&&(C=!1)},e.goToNextPage=()=>{D(),e.newConfig.isStartMode(s.StartMode.NODE)&&!C||e.goToPage(e.page+1)},e.saveGraphConfig=()=>{D(),Q()&&!C||(e.newConfig.startQueryIncludeInferred=e.tabConfig.inference,e.newConfig.startQuerySameAs=e.tabConfig.sameAs,L(()=>{e.newConfig.name?(e.queryEditorIsDirty=!1,e.isUpdate?e.updateGraphConfig(e.newConfig.toSavePayload()):e.createGraphConfig(e.newConfig.toSavePayload())):N(x.instant("graphexplore.provide.config.name"))}))},e.setQuery=async t=>{const r=t||" ";(await E()).setQuery(r),e.markDirty()},e.markDirty=async()=>{if(e.revertConfig){const t=e.revertConfig.getQueryType(e.page),r=await T();e.queryEditorIsDirty=t!==r}},e.showEditor=()=>{e.viewMode="yasr",A(),_()},e.showPreview=()=>{e.viewMode="editor",R()},e.revertEditor=()=>{e.setQuery(e.revertConfig.getQueryType(e.page)),e.queryEditorIsDirty=!1};const E=()=>i.YasguiComponentDirectiveUtil.getOntotextYasguiElementAsync("#query-editor"),R=async(t,r)=>{const n=await E(),a=await n.getQueryType();if(r&&"SELECT"!==a&&"CONSTRUCT"!==a&&"DESCRIBE"!==a)return void c.warning(x.instant("query.editor.warning.msg"));"update"!==await n.getQueryMode()?e.queryIsRunning||(e.viewMode="editor",I()):c.warning(x.instant("cannot.execute.update.error"))},I=async()=>{(await E()).query(a.RenderingMode.YASR)},_=async()=>(await E()).changeRenderMode(a.RenderingMode.YASQE),T=async()=>(await E()).getQuery(),A=async()=>(await E()).abortQuery(),L=async t=>{const r=await(async()=>{const t=await E();let r=await t.getQuery();return r=r.trim(),e.newConfig.updateModel(r,e.page)})();1===e.page?r.isStartMode(s.StartMode.NODE)&&!r.startIRI?N(x.instant("graphexplore.select.start.node")):r.isStartMode(s.StartMode.QUERY)&&!r.startGraphQuery?N(x.instant("graphexplore.provide.query")):r.isStartMode(s.StartMode.QUERY)?P(t,r.startGraphQuery,"graph"):t():2===e.page?P(t,r.expandQuery,"construct",["node"]):3===e.page?P(t,r.resourceQuery,"tuple",["node"],[],["type","label","comment","rank"]):4===e.page?P(t,r.predicateLabelQuery,"tuple",["edge"],["label"]):5===e.page&&P(t,r.resourcePropertiesQuery,"tuple",["node"],["property","value"])},k=()=>{e.tabConfig.inference=e.newConfig.startQueryIncludeInferred,e.tabConfig.sameAs=e.newConfig.startQuerySameAs,e.setQuery(e.newConfig.getQueryType(e.page))},N=e=>{c.warning(e)},O=()=>{e.getAutocompletePromise=h.checkAutocompleteStatus()},P=(e,t,r,n,a,i)=>{t?p.validateQuery(t,r,n,a,i).success(()=>{e()}).error(e=>{N(getError(e))}):e()},D=()=>{Q()&&e.$broadcast("addStartFixedNodeAutomatically",{startIRI:e.newConfig.startIRI})},Q=()=>1===e.page&&e.newConfig.isStartMode(s.StartMode.NODE),M=()=>{p.getGraphConfigSamples().success((function(t){e.samples=Object(o.mapGraphConfigSamplesToGraphConfigs)(t).filter(t=>!t.id||e.newConfig.id!==t.id||(e.revertConfig=t,!1))})).error((function(e){c.error(getError(e),x.instant("graphexplore.error.graph.configs"))})),O(),e.getNamespacesPromise=m.getNamespaces(e.getActiveRepository())},$={endpoint:()=>"/repositories/"+l.getActiveRepository(),showEditorTabs:!1,showToolbar:!1,showResultTabs:!1,showYasqeActionButtons:!1,yasqeActionButtons:i.INFERRED_AND_SAME_AS_BUTTONS_CONFIGURATION,showQueryButton:!1,initialQuery:" ",componentId:"graphs-config",render:a.RenderingMode.YASQE,maxPersistentResponseSize:0,yasqeMode:n.YasqeMode.PROTECTED,infer:e.newConfig.startQueryIncludeInferred,sameAs:e.newConfig.startQuerySameAs},j=(t,r,n)=>{e.queryIsRunning=t},U=()=>{window.removeEventListener("beforeunload",G),q.forEach(e=>e())},G=t=>{e.queryEditorIsDirty&&(t.returnValue=!0)},q=[];q.push(e.$on("autocompleteStatus",O)),q.push(e.$on("$locationChangeStart",(t,n)=>{if(e.queryEditorIsDirty){t.preventDefault();((e,t,r,n)=>{S.openSimpleModal({title:e,message:t,warning:!0}).result.then((function(){angular.isFunction(r)&&r()}),(function(){angular.isFunction(n)&&n()}))})(x.instant("common.confirm"),x.instant("visual.config.warning.unsaved.changes"),()=>{U();const e=r.absUrl().length-r.url().length,t=n.substring(e);r.path(t)})}else U()})),q.push(e.$on("$destroy",U)),q.push(e.$watch(e.getActiveRepositoryObject,()=>{(e.newConfig.isStartMode(s.StartMode.QUERY)||e.page>1)&&(e.viewMode="yasr",A().then(_))})),window.addEventListener("beforeunload",G),e.$watch("newConfig.startMode",e=>{e===s.StartMode.QUERY&&k()}),e.$watch("page",t=>{(e.newConfig.isStartMode(s.StartMode.QUERY)||t>1)&&(e.showEditor(),k())}),l.getPrefixes(w).then(t=>(t=>{const r=e.$watch((function(){return e.getActiveRepositoryObject()}),(function(a){if(a){e.canEditActiveRepo=e.canWriteActiveRepo();const a=angular.extend({},$,{prefixes:t,yasqeMode:e.canWriteActiveRepo()?n.YasqeMode.WRITE:n.YasqeMode.PROTECTED});e.yasguiConfig=a,r()}}))})(t)).finally(()=>j(!1)),b?(e.isUpdate=!0,p.getConfig(b).then((function(t){e.newConfig=t,M()})).catch(e=>{c.error(getError(e),x.instant("created.connector",{name:b}))})):(e.isUpdate=!1,M()),e.getActiveRepository()&&(j(!0,x.instant("common.refreshing.namespaces"),x.instant("common.extra.message")),l.getPrefixes(l.getActiveRepository()).then(t=>{e.namespaces=t}).catch((function(t){e.repositoryError=getError(t)})).finally((function(){j(!1)})))}angular.module("graphdb.framework.graphexplore.controllers.graphviz.config",["graphdb.framework.utils.notifications","graphdb.framework.utils.localstorageadapter"]).controller("GraphConfigCtrl",c),c.$inject=["$scope","$timeout","$location","toastr","$repositories","SparqlRestService","$filter","GraphConfigRestService","AutocompleteRestService","$routeParams","Notifications","RDF4JRepositoriesRestService","LocalStorageAdapter","LSKeys","$translate","ModalService"]},159:function(e,t,r){"use strict";r.r(t);var n=r(402),a=r(432),i=r(400),s=r(401);r(10);function o(e,t,r,o,c,l,u,d,p,h,f,g,m){return{restrict:"AE",template:'<div id="classChart"></div>',scope:{classHierarchyData:"=",flattenedClassNames:"=",selectedClass:"=",currentSliderValue:"=",showClassInfoPanel:"=",showExternalElements:"=",hidePrefixes:"=",currentBrowserLimit:"="},link:function(u,y,v){!function(u,y){var v,x,S=d3.pack().size([780,780]),C=d3.scaleLinear().domain([0,4]).range(["hsl(19, 70%, 90%)","hsl(19, 70%, 50%)"]).interpolate(d3.interpolateHcl),b=d3.select("#classChart").insert("svg:svg","h2").attr("viewBox","0 0 800 800").attr("preserveAspectRatio","xMidYMid meet").on("dblclick.zoom",null);function w(){return b.append("svg:g").attrs({id:"main-group",transform:"translate(400,400)"})}function E(){return"true"===f.get(g.CLASS_HIERARCHY_HIDE_PREFIXES)}function R(){var e=s.a.Export.getCSSRules("css/rdf-class-hierarchy-labels.css?v=2.6.0");d3.selectAll("#main-group").append("defs"),$("defs").append('<style type="text/css"><![CDATA['+e+"]]></style>"),d3.selectAll("g").style("opacity",1);var t=s.a.Export.generateBase64ImageSource("#classChart svg");d3.select(this).attrs({href:t,download:"class-hierarchy-"+l.getActiveRepository()+".svg"})}u.hidePrefixes=E();var I,T,A=w();if(!u.classHierarchyData.classCount&&l.getActiveRepository()&&!l.isSystemRepository()){e.loader=!0,e.hierarchyError=!1;const t=f.get("classHierarchy-selectedGraph-"+l.getActiveRepository());r.getClassHierarchyData(null!==t?t.contextID.uri:"").success((function(t,r,n){e.loader=!1,207===r&&d.warning(m.instant("graphexplore.update.diagram"),m.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),d.error(m.instant("graphexplore.error.request.failed",{name:h,error:getError(t)}))}))}var L,k,N,O,P,D,Q,M={};function j(r,s,l,d){k&&k(),N&&N(),d3.selectAll("#main-group").remove(),A=w(),a.a.SingleChild.addPlaceholders(r,!0),(x=d3.hierarchy(r)).sum((function(e){return e.size})),L=l||x,S(x);var f,g=x.descendants();L.isInFocusTransitive=!0,a.a.SingleChild.removePlaceholders(g),a.a.SingleChild.centerNodes(g),a.a.SingleChild.makePositionsRelativeToZero(g),v||(v=Object(n.a)().attr("class","d3-tip").customPosition((function(e,t){return{top:"inherit",bottom:o.innerHeight-t.clientY+"px",right:o.innerWidth-t.clientX+"px"}})).html((function(e){return e.data.name})),b.call(v));var m=A.selectAll("circle").data(g).enter().append("g");s.doFade&&m.each((function(e){i.a.Transition.fadeIn(d3.select(this),550)}));var y,E=[],R=m.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!==h){var t=e.data.name;E.push({name:t}),M[[t]]=e,e.circle.classed("rdf-class",!0),e.circle.on("mouseover",(function(t){s.noPrefixes||e.textHidden?v.show(e,t):v.hide(e)})),e.circle.on("mouseout",v.hide)}})).on("gdb-focus",(e,t)=>T(t)).on("gdb-zoom",(e,t)=>H(t));function O(e){d3.selectAll(".selected").classed("selected",e.selected=!1),e.circle.classed("selected",e.selected=!0),y=e}function P(){u.showClassInfoPanel=!1}E&&(E=_.uniqBy(E,"name"),u.flattenedClassNames=E);var D=i.a.Click.delayDblClick();d3.selectAll(".parent, .topLevelParent, .child, .root").call(D),T=function(e){H(e),e.data.name===h?(P(),d3.selectAll(".selected").classed("selected",!1)):(O(e),u.selectedClass=y,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&&o.history.pushState({id:t.data.id},"classHierarchyPage"+t.data.id,"hierarchy#"+t.data.id),v.hide(),T(t)})),D.on("dblclick",(function(t,n){n!==r&&(v.hide(),O(n),e.$broadcast("goToDomainRangeGraphView",y,L),t.stopPropagation())}));var Q=0;b.on("wheel",(function(e){v.hide(),e.preventDefault(),e.stopPropagation();var t=(new Date).getTime();if(t-Q>100){Q=t;var r="";e.deltaY<=-1?r="in":e.deltaY>=1&&(r="out");var n=e.target.__data__;if(n||(n=L),"in"===r){if(n!==L){for(;n.parent&&!n.parent.isInFocusTransitive;)n=n.parent;n.depth<L.depth&&(n=L)}if(n===L&&n.children){for(var a=n.children[0],i=1;i<n.children.length;i++)n.children[i].sortingRank>a.sortingRank&&(a=n.children[i]);a.children&&(n=a)}else n.children||(n=n.parent);H(n,!0)}else"out"===r&&(n=L.parent)&&H(n,!0);L.data.name===h&&o.history.replaceState({id:1},"classHierarchyPage1","hierarchy#1"),U()}}));var $=A.selectAll("text").data(g).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)}));s.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===L.data?(e.textHidden=this.textContent.indexOf("...")+3===this.textContent.length,null):(e.textHidden=!0,"none")})),s.doFade&&!s.keepPrevState&&$.each((function(e){i.a.Transition.fadeIn(d3.select(this),550)})),I=function(){function e(e){e&&R.each((function(t){+e===t.data.id&&T(t)}))}var r=t.hash();o.onpopstate=function(t){t.state&&e(t.state.id)},e(r)};var j=A.selectAll("circle, text");function G(e,t){var r=800/e[2];f=e,j.attr("transform",(function(t){return"translate("+(t.x-e[0])*r+","+(t.y-e[1])*r+")"})),R.attr("r",(function(e){return e.r*r})),t&&$.each((function(e){e.data.fullName!==L.data.topLevelParentUri&&L.data.topLevelParentUri!==h||(e.textSel.style("display","none"),L.children&&L.children.length?_.each(L.children,(function(e){e.textSel.style("display","inline")})):L.textSel.style("display","inline"),L.parent&&_.each(L.parent.children,(function(e){e.data.name!==L.data.name&&e.textSel.style("display","inline")})))})),$.style("font-size",(function(e){return s.noPrefixes?i.a.Text.calcFontSize(e.noPrefixName,e.r*r):i.a.Text.calcFontSize(e.data.name,e.r*r)})).text((function(e){return s.noPrefixes?i.a.Text.getTextWithElipsisIfNeeded(e.noPrefixName,e.r*r/3):i.a.Text.getTextWithElipsisIfNeeded(e.data.name,e.r*r/3)}))}function q(e){var t=2*e+20;return 2*e/t<.3&&(t=2*e+2),t}function F(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 H(e,t){if(c((function(){u.showExternalElements=e.data.name===h})),L!==e&&(e.data.id&&o.history.replaceState({id:e.data.id},"classHierarchyPage"+e.data.id,"hierarchy#"+e.data.id),e.children||(e=e.parent,L!==e))){if(t&&(P(),d3.selectAll(".selected").classed("selected",!1)),L.parent)for(var r=L;r;)r.isInFocusTransitive=!1,r=r.parent;for(r=e;r;)r.isInFocusTransitive=!!r.children,r=r.parent;if(2*(L=e).r/(2*L.r+20)<.3||u.currentSliderValue>u.currentBrowserLimit)G([L.x,L.y,q(L.r)]),$.each((function(e){F.call(this,e)}));else d3.transition().duration(p).tween("zoom",(function(e){var t=d3.interpolateZoom(f,[L.x,L.y,q(L.r)]);return function(e){G(t(e))}})).selectAll("text").each(F)}}G([L.x,L.y,q(L.r)],d),k=u.$on("rootFocus",(function(){o.history.pushState({id:1},"classHierarchyPage1","hierarchy#1"),T(x)})),N=u.$on("classSearch",(function(e){T(e)}))}function U(){const t=u.classHierarchyData.classCount;let r=f.get(g.CLASS_HIERARCHY_CURRENT_SLIDER_VALUE);(!r||r>t)&&(r=t,f.set(g.CLASS_HIERARCHY_CURRENT_SLIDER_VALUE,r)),e.$broadcast("classCount",t,r)}window.addEventListener("resize",U),window.addEventListener("beforeunload",(function e(){window.removeEventListener("resize",U),window.removeEventListener("beforeunload",e)})),u.$watch("classHierarchyData",(function(){O&&O(),P&&P(),D&&D(),Q&&Q();var e=E();if(u.classHierarchyData.classCount){U();var t=_.cloneDeep(u.classHierarchyData);var r,n,a=function(e){return e.descendants().sort((function(e,t){return e.data.sortingRank>t.data.sortingRank?-1:e.data.sortingRank<t.data.sortingRank||e.data.depth>t.data.depth?1:e.data.depth<t.data.depth?-1:0}))}(d3.hierarchy(t));function i(e,t){const a={keepPrevState:!0,noPrefixes:E()};n=a.noPrefixes,j(r||e,a,L,!0),c((function(){f.set(g.CLASS_HIERARCHY_SWITCH_PREFIXES,t),I()}),70)}function s(e,a,s){if(!e)return;f.set(g.CLASS_HIERARCHY_CURRENT_SLIDER_VALUE,e),r={name:h,children:[]};const o=new Set;for(let t=1;t<=e;t++)o.add(a[t].data.id),a[t].parent===a[0]&&r.children.push(a[t].data);if(function e(t){if(!t.children)return;const r=[];for(const e of t.children)o.has(e.id)&&r.push($.extend({},e));t.children=r;for(const r of t.children)e(r)}(r),s){n=angular.isUndefined(n)?E():n;j(r,{noPrefixes:n})}else i(t)}var o,l=f.get(g.CLASS_HIERARCHY_CURRENT_SLIDER_VALUE);if(l)s(l,a);else{var d={doFade:!0,keepPrevState:!0,noPrefixes:E()};j(t,d),I()}O=u.$watch("hidePrefixes",(function(r){angular.isUndefined(r)||e?e=void 0:c((function(){!function(e){angular.isUndefined(e)||f.set(g.CLASS_HIERARCHY_HIDE_PREFIXES,e)}(r),i(t,!0)}),50)}),!0),P=u.$watch("currentSliderValue",(function(e){s(e,a,!0)}),!0),Q=u.$on("onEnterKeypressSearchAction",(function(e){o&&T(o)})),D=u.$on("searchedClass",(function(e,t){(o=M[t.name])&&T(o)}))}}),!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",o),o.$inject=["$rootScope","$location","GraphDataRestService","$window","$timeout","$repositories","$licenseService","toastr","ZOOM_DURATION","ROOT_OBJ_NAME","LocalStorageAdapter","LSKeys","$translate"]},160:function(e,t,r){"use strict";r.r(t);var n=r(401),a=r(400);r(10);function i(e,t,r,i,s,o,c,l,u,d,p,h,f){return{restrict:"AE",template:'<div id="domain-range"></div>',scope:{showPredicatesInfoPanel:"=",selectedPredicate:"=",collapseEdges:"="},link:function(d){const p=l((function(){!function(d){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(),m=d3.drag().subject((function(e){return e})).on("start",(function(e,t){g.stop(),t.fx=e.x,t.fy=e.y,d3.select(this).classed("selected",!0)})).on("end",(function(e,t){t.fx=null,t.fy=null,d3.select(this).classed("selected",!1),C?(g.alpha(.2).restart(),C=!1):g.restart()})).on("drag",(function(e,t){C=!0,g.alphaTarget(0).restart(),t.fx=e.x,t.fy=e.y})),y=p.append("defs");y.append("marker").attrs({id:"arrow",viewBox:"0 -5 10 10",refX:10,refY:0,markerUnits:"strokeWidth",markerWidth:5,markerHeight:5,orient:"auto",fill:h}).append("path").attrs({d:"M0,-5L10,0L0,5",class:"arrowHead"}),y.append("marker").attrs({id:"collapsed-arrow",viewBox:"0 -5 10 10",refX:9,refY:0,markerUnits:"strokeWidth",markerWidth:4,markerHeight:4,orient:"auto",fill:h}).append("path").attrs({d:"M0,-5L10,0L0,5",class:"arrowHead"}),y.append("marker").attrs({id:"arrow-loop",viewBox:"0 -5 10 10",refX:7,refY:0,markerUnits:"strokeWidth",markerWidth:5,markerHeight:5,orient:"auto",fill:h}).append("path").attrs({d:"M0,-5L10,0L0,5",class:"arrowHead"}),d3.select("#download-svg").on("mouseover",(function(){var e=n.a.Export.getCSSRules("css/domain-range-graph.css?v=2.6.0");$("defs").append('<style type="text/css"><![CDATA['+e+"]]></style>");var t=n.a.Export.generateBase64ImageSource("#domain-range svg");d3.select(this).attrs({href:t,download:"domain-range-graph-"+r.getActiveRepository()+".svg"})})),function(){var e=d3.select(".legend-container").append("svg").attr("viewBox","0 0 "+1200/7+" "+1200/7*1.2).attr("preserveAspectRatio","xMidYMid meet");e.append("rect").attrs({width:1200/7,height:1200/7*1.2}).style("fill","rgba(235, 235, 235, 0.9)");var t=16+1200/18/2.5,r=t+1200/90;e.append("circle").attrs({class:"legend-class-node",cx:(16+t)/2,cy:30,r:1200/18/4.5}),e.append("text").attrs({x:r,y:30+1200/370}).style("font-size",1200/90/1.1+"px").text("main class node"),e.append("circle").attrs({class:"legend-object-node",cx:(16+t)/2,cy:70,r:1200/110/1.25}),e.append("text").attrs({x:r,y:30+1200/370+40}).style("font-size",1200/90/1.1+"px").text("class node"),e.append("circle").attrs({class:"legend-datatype-node",cx:(16+t)/2,cy:70+1200/45,r:1200/110/2}),e.append("text").attrs({x:r,y:99.90990990990991}).style("font-size",1200/90/1.1+"px").text("datatype node"),e.append("line").attrs({class:"property-arrow",x1:16,y1:123.33333333333334,x2:t,y2:123.33333333333334}).style("stroke-width",1.2).attr("marker-end","url("+s.absUrl()+"#arrow)"),e.append("text").attrs({x:r,y:126.57657657657658}).style("font-size",1200/90/1.1+"px").text("explicit property"),e.append("line").attrs({class:"implicit-property-arrow",x1:16,y1:150,x2:t,y2:150}).style("stroke-width",1.2).attr("marker-end","url("+s.absUrl()+"#arrow)"),e.append("text").attrs({x:r,y:150+1200/370}).style("font-size",1200/90/1.1+"px").text("implicit property"),e.append("line").attrs({class:"collapsed-property-arrow",x1:16,y1:150+1200/45,x2:t,y2:150+1200/45}).style("stroke-width",2).attr("marker-end","url("+s.absUrl()+"#collapsed-arrow)"),e.append("text").attrs({x:r,y:179.9099099099099}).style("font-size",1200/90/1.1+"px").text("collapsed property")}();var v=s.search().uri,x=s.search().name;const S=s.search().collapsed;(function(e,t){i.getDomainRangeData(e,t).success((function(e,t,r){d.domainRangeGraphData=e})).error((function(e){u.error("Request for "+x+" failed!")}))})(v,S),$(window).on("popstate",(function(){o.set(c.DOMAIN_RANGE_WENT_BACK,!0)})),t.onpopstate=function(t){t.state&&e.$broadcast("changeCollapsedEdgesState",t.state.collapsed)},d.$watch("collapseEdges",(function(){angular.isUndefined(d.collapseEdges)||(o.set(c.DOMAIN_RANGE_COLLAPSE_EDGES,d.collapseEdges),"true"!==o.get(c.DOMAIN_RANGE_WENT_BACK)&&function(t){e.$broadcast("switchEdgeMode",{uri:v,name:x,collapsed:t})}(d.collapseEdges),o.remove(c.DOMAIN_RANGE_WENT_BACK))})),d.$watch("domainRangeGraphData",(function(){if(d.domainRangeGraphData){var r=_.cloneDeep(d.domainRangeGraphData);const O=r.nodes,P=r.links;g.nodes(O).force("x",d3.forceX(600)).force("y",d3.forceY(300)).force("charge",d3.forceManyBody().strength(-800)).force("link",d3.forceLink(P).distance(1200/3.5));var n=p.selectAll(".link").data(P).enter().append("g");function i(e){e.style("stroke",h),e.style("stroke-width",2),e.attr("marker-end","url("+s.absUrl()+"#collapsed-arrow)")}var o,c,u=0;n.each((function(e){if(e.objectPropNodeClassUri!==v)o=n.append("line").attrs({class:"link","marker-end":"url("+s.absUrl()+"#arrow)"}).style("stroke-width",1.2).each((function(e){switch(e.propertyType){case"objectLeft":e.targetRadius=1200/18;break;case"objectRight":e.targetRadius=1200/110;break;case"datatype":e.targetRadius=1200/110/2;break;default:e.targetRadius=0}var t=d3.select(this);e.targetNodeEdgeCount>1?i(t):e.implicit&&t.style("stroke-dasharray","3, 3")}));else{if(angular.isUndefined(c)){c=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)}(u+=e.targetNodeEdgeCount)>1&&i(d3.select(".loop-link"))}}));var y={};function S(){$.isEmptyObject(y)||(y.text.style("fill","black"),y.background.style("fill","#f0f0f0"))}function C(e,t){S(),y.text=d3.select(this),y.background=d3.select(this.previousSibling),y.text.style("fill","white"),y.background.style("fill",h),l((function(){d.showPredicatesInfoPanel=!0,d.selectedPredicate=t})),e.stopPropagation()}$("document").ready((function(){$("#domain-range").bind("click",S)}));var b=n.append("text").attr("class",(function(e){return e.objectPropNodeClassUri===v?"loop-link-property-name":"property-name"})).attr("dx",(function(e){return 1200/18/2*("objectLeft"===e.propertyType?1:-1)})).style("text-anchor",(function(e){return"objectLeft"===e.propertyType?"end":"start"})).style("font-size",1200/90).text((function(e){return e.targetNodeEdgeCount>1?e.targetNodeEdgeCount+" predicates":e.name}));b.each((function(e){var r=d3.select(this);/\d\spredicates/.test(r.text())?r.style("font-weight","bold").on("click",C):r.on("click",(function(e,r){t.open("resource?uri="+encodeURIComponent(r.uri),"_blank")}))}));var w=n.append("rect").attr("class",(function(e){return e.objectPropNodeClassUri!==v?"link-background":"loop-link-background"})).attr("width",(function(e){return e.calculatedWidth=this.previousSibling.getBBox().width,e.calculatedWidth+4})).attr("height",(function(e){return e.calculatedHeight=this.previousSibling.getBBox().height,e.calculatedHeight+2})).attr("transform",(function(e){var t=2-1200/18/2*("objectLeft"===e.propertyType?1:-1);return"objectLeft"===e.propertyType&&(t+=e.calculatedWidth),"translate(-"+t+",-"+(2+e.calculatedHeight/2)+")"})).on("click",(function(e){e.stopPropagation()})),E=p.selectAll(".node").data(O).enter().append("g"),R=E.filter((function(e){return e.objectPropClassUri!==v})).append("circle").each((function(e){var t=d3.select(this);"main"===e.classPosition?t.attrs({class:"class-node",r:1200/18}).attr("marker-end","url("+s.absUrl()+"#loop-link)"):null===e.objectPropClassName?t.attrs({class:"datatype-node",r:1200/110/2}):t.attrs({class:"object-prop-node",r:1200/110})})).call(m);d3.selectAll(".object-prop-node").on("dblclick",(function(t,r,n){d.$apply((function(){e.$broadcast("reloadDomainRangeGraphView",r,n)}))})),E.filter((function(e){return e.objectPropClassName&&e.objectPropClassUri!==v})).append("text").attr("class",(function(e){return e.classPosition+"-class-label"})).style("font-size",1200/90).text((function(e){return e.objectPropClassName})).on("click",(function(e,r){t.open("resource?uri="+encodeURIComponent(r.objectPropClassUri),"_blank")}));var I=E.select("text");p.select(".class-node").each((function(){d3.select(this.parentNode).append("text").attr("class","rdf-class-label").style("font-size",(function(e){return a.a.Text.calcFontSize(x,1200/18)})).text(x).on("click",(function(){t.open("resource?uri="+encodeURIComponent(v),"_blank")}))}));var T=p.select(".class-node + text"),A=d3.select(".class-node"),L=d3.selectAll(".loop-link-background"),k=d3.selectAll(".loop-link-property-name");if(b=d3.selectAll(".property-name"),!angular.isUndefined(c)){var N=[];L.each((function(e,t){d3.select(this);N.push({idx:t,width:e.calculatedWidth,height:e.calculatedHeight})}))}g.on("tick",(function(e){var t=8*g.alpha();function r(e){var t=e.x+1200/18*2,r=e.y-1200/18/1.9;var n=[];L.each((function(a,i){n.push(a),i<f?function(n,a){var i=$.grep(N,(function(e){return e.idx==a}));a>0&&(t+=parseFloat(a*(i[0].height/(a/1.4)))),n.attrs({transform:"rotate(270, "+e.x+","+e.y+") translate("+t+","+r+")",width:i[0].height,height:i[0].width})}(d3.select(this),i):d3.select(this).remove()})),function(e){var t;d3.select(".view-more-preds-label").style("font-weight","bold").each((function(r){r.target.allEdges=e,t=this.getComputedTextLength()})).on("click",C),d3.select(".view-more-preds-rect").attr("height",t+4)}(n)}o.filter((function(e){return e.objectPropNodeClassUri!==v})).attr("x1",(function(e){return e.source.x})).attr("y1",(function(e){return e.source.y})).attr("x2",(function(e){return e.targetX})).attr("y2",(function(e){return e.targetY})).each((function(e){!function(e){"objectLeft"===e.propertyType?(e.source.x-=8*t,e.source.y-=t/9):(e.target.x+=8*t,e.target.y-=t/9)}(e);var r=Math.atan2(e.target.y-e.source.y,e.target.x-e.source.x);e.targetX=e.target.x-Math.cos(r)*e.targetRadius,e.targetY=e.target.y-Math.sin(r)*e.targetRadius})),R.each((function(e){"main"!==e.classPosition||angular.isUndefined(c)||(!function(e){var t=e.x+64,r=e.y-1200/18/5.7-5;c.attr("transform","rotate(270, "+e.x+","+e.y+") translate("+t+","+r+")")}(e),function(e){function t(t,r){var n=$.grep(N,(function(e){return e.idx==r})),a=0;r>0&&(a=parseFloat(2*r*(n[0].height/1.4)));var i=e.x,s=e.y-1200/18*2.1-a;t.attrs({x:i,y:s}).moveToFront()}k.each((function(e,r){var n=d3.select(this),a=k.size()-f;a<0?t(n,r):(0==r&&!d.collapseEdges&&a>1&&(!function(e,t,r){e.classed("view-more-preds-label",!0).text(r+" predicates more ..."),null!==this.nextSibling&&t.classed("view-more-preds-rect",!0)}(n,d3.select(this.nextSibling),a),t(n,r)),r<f?t(n,r):n.remove())}))}(e),r(e)),e.objectPropClassUri!==v&&d3.select(this).attr("cx",(function(e){return"main"===e.classPosition?function(e){!window.ActiveXObject&&"ActiveXObject"in window&&(Math.log10=function(e){return Math.log(e)/Math.LN10});var t=A.attr("cx")-600,r=.5*Math.log10(Math.abs(t));return e.x+=t>0?-r:r,e.x}(e):e.x})).attr("cy",(function(e){return e.y}))})),T.attr("x",(function(e){return e.x})).attr("y",(function(e){return e.y})).moveToFront(),w.filter((function(e){return e.objectPropNodeClassUri!==v})).attr("x",(function(e){return e.target.x>e.source.x?e.source.x+(e.target.x-e.source.x)/2:e.target.x+(e.source.x-e.target.x)/2})).attr("y",(function(e){return e.target.y>e.source.y?e.source.y+(e.target.y-e.source.y)/2:e.target.y+(e.source.y-e.target.y)/2})).moveToFront(),b.attr("x",(function(e){return e.target.x>e.source.x?e.source.x+(e.target.x-e.source.x)/2:e.target.x+(e.source.x-e.target.x)/2})).attr("y",(function(e){return e.target.y>e.source.y?e.source.y+(e.target.y-e.source.y)/2:e.target.y+(e.source.y-e.target.y)/2})).moveToFront(),I.attr("x",(function(e){return"right"===e.classPosition?e.x+1200/110*1.2:e.x-1200/110*1.2})).attr("y",(function(e){return e.y})).moveToFront()}))}}));let C=!1}(d)}),50);d.$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",i),i.$inject=["$rootScope","$window","$repositories","GraphDataRestService","$location","LocalStorageAdapter","LSKeys","$timeout","toastr","ONTO_RED","ONTO_GREEN","ONTO_BLUE","NON_COLLAPSED_REFLEXIVE_LINK_LIMIT"]},161:function(e,t){function r(e,t){return{restrict:"A",scope:{},templateUrl:"js/angular/graphexplore/templates/systemRepoWarningTemplate.html",link:function(r){r.isSystemRepository=function(){return"SYSTEM"===e.getActiveRepository()},r.hasPermission=function(){return t.hasPermission()}}}}angular.module("graphdb.framework.graphexplore.directives.sysrepo",["graphdb.framework.graphexplore.controllers.class"]).directive("systemRepoWarning",r),r.$inject=["$repositories","$rootScope"]},162:function(e,t){function r(e){return{restrict:"AE",scope:{rdfsLabel:"=",rdfsComment:"=",expanded:"=",alwaysExpanded:"="},templateUrl:"js/angular/graphexplore/templates/rdfsCommentLabelTemplate.html",link:function(t,r){t.stringLimit=e,t.scrollToTop=function(){r[0].getElementsByClassName("rdfs-comment")[0].scrollTop=0},t.checkCommentLength=function(){return r[0].getElementsByClassName("rdfs-comment-text")[0].innerText.length<e},t.equalHeights=function(){const e=r[0].getElementsByClassName("rdfs-comment-text")[0].innerHeight;e<250&&t.expanded&&(r[0].getElementsByClassName("rdfs-comment")[0].innerHeight=e)},t.toggleFullComment=function(){t.expanded=!t.expanded},t.$watch("expanded || alwaysExpanded",(function(r){t.stringLimit=r?t.rdfsComment.length:e}))}}}angular.module("graphdb.framework.graphexplore.directives.rdfsdetails",[]).directive("rdfsCommentLabel",r).constant("SHORT_COMMENT_LENGTH",100),r.$inject=["SHORT_COMMENT_LENGTH"]},163:function(e,t,r){"use strict";r.r(t);var n=r(401);r(105);function a(e,t){return{restrict:"A",template:'<div id="dependencies-chord"></div>',scope:{dependenciesData:"="},link:function(r){r.$watch("dependenciesData",(function(){if(r.dependenciesData){const a=r.dependenciesData;!function(a,i){if(function(){let e=!0;for(const t of a){if(t.some(e=>0!==e)){e=!1;break}}return e}())return;const s=d3.scaleOrdinal(d3.schemeCategory10),o=d3.select("body").append("div").attr("class","tooltip").style("opacity",0);d3.select("body").on("click",(function(){o.style("opacity",0)}));const c=Math.min(800,800)/2.8,l=c-24,u=d3.arc().innerRadius(l).outerRadius(c),d=d3.chord().padAngle(.04).sortSubgroups(d3.descending).sortChords(d3.ascending),p=d3.ribbon().radius(l),h=d3.select("#dependencies-chord").append("svg").attr("viewBox","0 0 800 800").attr("preserveAspectRatio","xMidYMid meet").style("font","10px sans-serif").append("g").attr("id","circle").attr("transform","translate(400,400)");h.append("circle").attr("r",c).style("fill","none");const f=d(a),g=h.selectAll(".group").data(f.groups).enter().append("g").attr("class","group").on("mouseover",(function(){const e=g.nodes().indexOf(this);m.classed("fade",(function(t){return t.source.index!==e&&t.target.index!==e}))}));g.append("title").text((function(e,t){return i[t]})),g.append("path").attr("id",(function(e,t){return"group"+t})).attr("d",u).style("fill",(function(e,t){return s(t)})),g.append("text").each((function(e){e.angle=(e.startAngle+e.endAngle)/2})).attr("dy",".35em").attr("transform",(function(e){return"rotate("+(180*e.angle/Math.PI-90)+")translate("+(l+26)+")"+(e.angle>Math.PI?"rotate(180)":"")})).style("text-anchor",(function(e){return e.angle>Math.PI?"end":null})).text((function(e){return i[e.index]}));const m=h.selectAll(".chord").data(f).enter().append("path").attr("class","chord").style("fill",(function(e){return s(e.target.index)})).style("fill-opacity",".67").style("stroke","#000").style("stroke-width",".25px").style("cursor","pointer").attr("d",p);m.on("mouseover",(function(){d3.select(this).style("fill-opacity","1")})),m.on("mouseout",(function(){d3.select(this).style("fill-opacity",".67")})),m.on("click",(function(e,n){const a=i[n.source.index],s=i[n.target.index],c=e.pageX,l=e.pageY;t.getPredicates(a,s,r.selectedGraph&&r.selectedGraph.contextID.uri).success((function(e){let t="<div class='dependencies-tooltip'>"+("<div class='row'>"+a+" <i class='fa fa-exchange'></i> "+s+"</div>")+_.map(e.slice(0,10),(function(e){const t=" <i class='fa fa-long-arrow-"+("out"===e.direction?"right":"left")+"'></i>";return"<div class='row'>"+e.predicate+" : "+e.weight+t+" </div>"})).join("");e.length>10?t=t+"<div class='pull-right'>And "+(e.length-10).toString()+" more...</div></div>":t+="</div>",o.html(t).style("left",c+"px").style("top",l+"px")})),o.transition().duration(200).style("opacity",1)})),d3.select("#circle").on("mouseleave",(function(){h.selectAll(".chord").classed("fade",!1)})),d3.select("#download-svg").on("mouseover",(function(){const t=n.a.Export.generateBase64ImageSource(".dependencies-chord svg");d3.select(this).attrs({href:t,download:"dependencies-"+e.getActiveRepository()+".svg"})}))}(a.matrix,a.nodes,a.direction)}}))}}}angular.module("graphdb.framework.graphexplore.directives.dependencies",["graphdb.framework.graphexplore.controllers.dependencies","graphdb.framework.rest.graphexplore.data.service"]).directive("dependenciesChord",a),a.$inject=["$repositories","GraphDataRestService"]},164:function(e,t){function r(){return{restrict:"AE",scope:{filterQueryObj:"=",filterFunction:"&",listItemsObj:"=",listItemsNotFiltered:"=",searchPlaceholder:"@"},templateUrl:"js/angular/graphexplore/templates/listItemsSearchFilterTemplate.html",link:function(e){e.filterFunction=e.filterFunction(),e.$watch("filterQueryObj.query",(function(){var t,r,n,a;e.listItemsObj.items=(t=e.filterQueryObj.query,r=e.listItemsObj.items,n=e.listItemsNotFiltered,a=e.filterFunction,t.length>0?_.filter(n,a):r.length!==n.length?n:r)}))}}}angular.module("graphdb.framework.graphexplore.directives.searchfilter",[]).directive("listItemsSearchFilter",r),r.$inject=[]},165:function(e,t){function r(e,t){return{restrict:"AE",scope:{searchData:"=",searchFields:"@",titleField:"@",searchPlaceholder:"@",initialValue:"=",searchedObjCallback:"&"},templateUrl:"js/angular/graphexplore/templates/searchIconInputTemplate.html",link:function(r,n){r.searchedObjCallback=r.searchedObjCallback(),r.performSearchActionOnEnter=function(){e.$broadcast("onEnterKeypressSearchAction")},r.showInput=function(){$("#selectGraphDropdown").hide(),n.find("#search_input #search_input_value")[0].value="",n.find(".search-icon").addClass("animated bounceOut").css("z-index","-1"),n.find("#search_input .angucomplete-holder").css("display","block"),t((function(){n.find("#search_input .angucomplete-holder").css("width","250px").css("left","-215px"),t((function(){n.find(".close-icon").css("display","block").addClass("animated bounceIn").css("z-index","3"),n.find("#search_input #search_input_value").focus()}),200)}),1)},r.hideInput=function(){n.find("#search_input #search_input_value")[0].value="",n.find("#search_input .angucomplete-holder").css("width","0px").css("left","35px"),t((function(){n.find("#search_input .angucomplete-holder").css("display","none"),$("#selectGraphDropdown").show()}),250),n.find(".close-icon").addClass("animated bounceOut").removeClass("bounceOut").css("z-index","-1").css("display","none").click((function(){$(".tooltip").hide()})),t((function(){n.find(".search-icon").css("display","inline-block").removeClass("bounceOut").addClass("bounceIn").css("z-index","3")}),200)}}}}angular.module("graphdb.framework.graphexplore.directives.searchcontrols",[]).directive("searchIconInput",r),r.$inject=["$rootScope","$timeout"]},223:function(e,t,r){"use strict";r.r(t);r(7),r(30),r(25),r(24),r(610),r(611),r(393),r(402),r(449),r(612),r(613),r(418),r(400),r(432),r(401),r(105),r(150),r(151),r(152),r(153),r(154),r(155),r(156),r(157),r(158),r(159),r(160),r(161),r(162),r(163),r(164),r(165),r(78);angular.module("graphdb.framework.graphexplore",["graphdb.framework.core.controllers","graphdb.framework.core.directives","graphdb.framework.rest.graphexplore.data.service","graphdb.framework.graphexplore.services.uiscroll","graphdb.framework.graphexplore.services.rdfsdetails","graphdb.framework.rest.graphexplore.savedgraphs.service","graphdb.framework.rest.graphconfig.service","graphdb.framework.graphexplore.controllers.class","graphdb.framework.graphexplore.controllers.domainrange","graphdb.framework.graphexplore.controllers.dependencies","graphdb.framework.graphexplore.controllers.graphviz","graphdb.framework.graphexplore.controllers.graphviz.config","graphdb.framework.graphexplore.directives.sysrepo","graphdb.framework.graphexplore.directives.rdfsdetails","graphdb.framework.graphexplore.directives.searchfilter","graphdb.framework.graphexplore.directives.class","graphdb.framework.graphexplore.directives.domainrange","graphdb.framework.graphexplore.directives.dependencies","graphdb.framework.graphexplore.directives.searchcontrols","graphdb.framework.core.directives.yasgui-component"])},393:function(e,t,r){var n,a;n=[r(398)],void 0===(a=function(){function e(e,t){return e.each((function(){var e=t.apply(this,arguments),r=select(this);for(var n in e)r.attr(n,e[n])}))}function t(e,t){for(var r in t)e.attr(r,t[r]);return e}return"undefined"==typeof d3&&(d3=r(398)),d3.selection.prototype.attrs=function(r){return("function"==typeof r?e:t)(this,r)},d3.selection.prototype.moveToFront=function(){return this.each((function(){d3.select(this.parentNode.appendChild(this))}))},d3.selection.prototype.moveToBack=function(){return this.each((function(){const e=this.parentNode.firstChild;e&&this.parentNode.insertBefore(this,e)}))},d3}.apply(t,n))||(e.exports=a)},400:function(e,t,r){"use strict";r(393);var n=n||{};n.Text=function(){function e(e,t,r,n){r=r||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<r&&(a=r),Math.round(a)):(a<r&&(a=r),Math.round(a))}return{calcFontSizeRaw:e,calcFontSize:function(t,r,n,a){return e(t,r,n)+"px"},getTextWithElipsisIfNeeded:function(e,t){return"string"==typeof e&&e.length>t?e.substring(0,t-3)+"...":e}}}(),n.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)}},n.Click=function(){const e=function(e,r){let n,a=1,i=arguments.length;for(;++a<i;)n=arguments[a],e[n]=t(e,r,r[n]);return e};function t(e,t,r){return function(){var n=r.apply(t,arguments);return n===t?e:n}}return{delayDblClick:function(){var t=d3.dispatch("click","dblclick");return e((function(e){var r,n=null;e.on("mousedown",(function(){r=d3.pointer(document.body),+new Date})),e.on("mouseup",(function(e,a){var i,s,o;(s=r,o=d3.pointer(document.body),Math.sqrt(Math.pow(s[0]-o[0],2),Math.pow(s[1]-o[1],2))>5)||(n?(window.clearTimeout(n),n=null,t.call("dblclick",e,e,a)):n=window.setTimeout((i=e,function(){t.call("click",i,i,a),n=null}),250))}))}),t,"on")}}}(),t.a=n},401:function(e,t,r){"use strict";r(393);var n=n||{};n.Export={getCSSRules:function(e){const t=$('link[href="'+e+'"]')[0].sheet.rules;let r="";return _.each(t,(function(e){r+=e.cssText})),r},generateBase64ImageSource:function(e){e||(e="svg");const t=d3.selectAll(e).attr("version","1.1").attr("xmlns","http://www.w3.org/2000/svg").node().parentNode.innerHTML;return"data:image/svg+xml;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(t)))}},t.a=n},402:function(e,t,r){"use strict";t.a=function(){var e=function(){return"n"},t=function(){return[0,0]},r=function(){return" "},n=d(),a=null,i=null,s=null,o=null;function c(e){var t;a="svg"===(t=(t=e).node()).tagName.toLowerCase()?t:t.ownerSVGElement,i=a.createSVGPoint(),document.body.appendChild(n)}c.show=function(){var n=Array.prototype.slice.call(arguments);n[n.length-1]instanceof SVGElement&&(s=n.pop());var a,i=r.apply(this,n),d=t.apply(this,n),h=e.apply(this,n),f=p(),g=u.length,m=document.documentElement.scrollTop||document.body.scrollTop,y=document.documentElement.scrollLeft||document.body.scrollLeft,v=o.apply(this,n);for(f.html(i).style("opacity",1).style("pointer-events","all");g--;)f.classed(u[g],!1);const x=n.filter(e=>e instanceof Event);return a=l.get(h).apply(this,x),v?Object.keys(v).forEach((function(e){f.style(e,v[e])})):f.classed(h,!0).style("top",a.top+d[0]+m+"px").style("left",a.left+d[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 r=Array.prototype.slice.call(arguments);return d3.selection.prototype.attr.apply(p(),r),c},c.style=function(e,t){if(arguments.length<2&&"string"==typeof e)return p().style(e);var r=Array.prototype.slice.call(arguments);return d3.selection.prototype.style.apply(p(),r),c},c.direction=function(t){return arguments.length?(e=null==t?t:f(t),c):e},c.offset=function(e){return arguments.length?(t=null==e?e:f(e),c):t},c.html=function(e){return arguments.length?(r=null==e?e:f(e),c):r},c.customPosition=function(e){return arguments.length?(o=null==e?e:f(e),c):o},c.destroy=function(){return n&&(p().remove(),n=null),c};var l=new Map(Object.entries({n:function(e){var t=h(e);return{top:t.n.y-n.offsetHeight,left:t.n.x-n.offsetWidth/2}},s:function(e){var t=h(e);return{top:t.s.y,left:t.s.x-n.offsetWidth/2}},e:function(e){var t=h(e);return{top:t.e.y-n.offsetHeight/2,left:t.e.x}},w:function(e){var t=h(e);return{top:t.w.y-n.offsetHeight/2,left:t.w.x-n.offsetWidth}},nw:function(e){var t=h(e);return{top:t.nw.y-n.offsetHeight,left:t.nw.x-n.offsetWidth}},ne:function(e){var t=h(e);return{top:t.ne.y-n.offsetHeight,left:t.ne.x}},sw:function(e){var t=h(e);return{top:t.sw.y,left:t.sw.x-n.offsetWidth}},se:function(e){var t=h(e);return{top:t.se.y,left:t.e.x}}})),u=l.keys();function d(){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===n&&(n=d(),document.body.appendChild(n)),d3.select(n)}function h(e){for(var t=s||e.target;void 0===t.getScreenCTM&&"undefined"===t.parentNode;)t=t.parentNode;var r={},n=t.getScreenCTM(),a=t.getBBox(),o=a.width,c=a.height,l=a.x,u=a.y;return i.x=l,i.y=u,r.nw=i.matrixTransform(n),i.x+=o,r.ne=i.matrixTransform(n),i.y+=c,r.se=i.matrixTransform(n),i.x-=o,r.sw=i.matrixTransform(n),i.y-=c/2,r.w=i.matrixTransform(n),i.x+=o,r.e=i.matrixTransform(n),i.x-=o/2,i.y-=c/2,r.n=i.matrixTransform(n),i.y+=c,r.s=i.matrixTransform(n),r}function f(e){return"function"==typeof e?e:function(){return e}}return c}},432:function(e,t,r){"use strict";var n=n||{};n.SingleChild={addPlaceholders:function e(t,r){if(t.children){for(var n=0;n<t.children.length;n++)e(t.children[n]);if(1===t.children.length){var a=1.2*t.size;r&&(a=.1*t.children[0].size),t.children.push({name:"placeholder",size:a})}}},removePlaceholders:function e(t){for(var r=t.length-1;r>=0;r--){var n=t[r];"placeholder"===n.data.name?t.splice(r,1):n.children&&e(n.children)}},centerNodes:function(e){for(var t=0;t<e.length;t++){var r=e[t];if(r.children&&1===r.children.length){var n=r.x-r.children[0].x;r.children[0].x+=n,a(r.children[0],n)}}function a(e,t){if(e.children)for(var r=0;r<e.children.length;r++)e.children[r].x+=t,a(e.children[r],t)}},makePositionsRelativeToZero:function(e){for(var t=e[0].x,r=e[0].y,n=0;n<e.length;n++){var a=e[n];a.x-=t,a.y-=r}}},t.a=n},61:function(e,t,r){"use strict";r.r(t),r.d(t,"RenderingMode",(function(){return n}));const n={YASGUI:"mode-yasgui",YASQE:"mode-yasqe",YASR:"mode-yasr"}},613:function(e,t){
1
+ (window.webpackJsonp=window.webpackJsonp||[]).push([[16,3,17,19,26,27,28,29,39,40,45,60,64,66,67,69,83,101,108,109,110,111,112,113,114,116,117,136,151,152,153,154,155,156,157,158,160,161,162,163,164,165,170,172,191,193,207,215,219,233,234,235],{100:function(e,t,r){"use strict";r.r(t),r.d(t,"YasguiPersistenceMigrationService",(function(){return o}));var n=r(72);const a="yagui__"+n.VIEW_SPARQL_EDITOR,i="completed",s="rejected",o=function(){const e=()=>({val:{active:null,tabs:[],tabConfig:{}}}),t=(e,t,r=null)=>{e.val.migration={date:(new Date).toISOString(),status:t,error:r}},r=(e,t)=>{e.val.tabs.push(t)},n=(e,t)=>{e.val.tabConfig[t.id]=t},o=e=>{let t=localStorage.getItem(e);if(t)return t=JSON.parse(t),t},c=e=>{e.val.tabs=e.val.tabs.filter(e=>!e.startsWith("_"))},l=e=>{for(const t in e.val.tabConfig)t.startsWith("_")&&delete e.val.tabConfig[t]},u=(e,t)=>{localStorage.setItem(e,JSON.stringify(t))},d=(e,t)=>`${t} ${e}`,p=()=>Math.random().toString(36).substring(7);return{isMigrationNeeded:()=>{const e=o(a);let t=!1;return e&&(t=e.val.migration&&(e.val.migration.status===i||e.val.migration.status===s)),!(!localStorage.getItem("ls.tabs-state")||t)},revertMigration:()=>{const e=o(a);c(e),l(e),u(a,e)},migrateYasguiPersistence:s=>{let c=o("ls.tabs-state");c=Object.freeze(c);let l=o(a);l||(l=e()),c.map(e=>({id:e.id,name:e.name,yasqe:{value:e.query,sameAs:e.sameAs,infer:e.inference,pageSize:1e3,pageNumber:1},yasr:{response:null,settings:{selectedPlugin:"extended_table",pluginsConfig:{}}},requestConfig:{method:"POST"}})).forEach((e,t)=>{e.id="_"+p(),e.name=e.name||d(t,s),r(l,e.id),n(l,e)}),l.val.active=l.val.tabs[0],t(l,i),u(a,l)},rejectMigration:()=>{const e=o(a);t(e,s),u(a,e)}}}()},102:function(e,t,r){"use strict";r.r(t),r.d(t,"removeSpecialChars",(function(){return n})),r.d(t,"toBoolean",(function(){return a}));const n=e=>e.replace(/[()']/g,""),a=e=>"string"==typeof e?"true"===e:Boolean(e)},105:function(e,t){angular.module("graphdb.framework.rest.graphexplore.data.service",[]).factory("GraphDataRestService",r),r.$inject=["$http"];function r(e){return{getClassHierarchyData:function(t){return e.get("rest/class-hierarchy",{params:{graphURI:t}})},reloadClassHierarchy:function(t){return e.get("rest/class-hierarchy",{params:{doReload:!0,graphURI:t}})},getClassInstances:function(t){return e.get("rest/class-hierarchy/class-instances",{params:{targetUri:t}})},getDomainRangeData:function(t,r){return e.get("rest/domain-range",{params:{targetUri:t,collapsed:r}})},checkDomainRangeData:function(t){return e.head("rest/domain-range",{params:{targetUri:t}})},getRelationshipsData:function(t,r,n){return e.get("rest/dependencies/matrix",{params:{mode:r,classes:_.map(t,(function(e){return e.name})),graphURI:n}})},getRelationshipsClasses:function(t,r){return e.get("rest/dependencies/classes",{params:{mode:t,graphURI:r}})},getRelationshipsStatus:function(t){return e.get("rest/dependencies/status",{params:{graphURI:t}})},calculateRelationships:function(t){return e.get("rest/dependencies/update",{params:{graphURI:t}})},getPredicates:function(t,r,n){return e.get("rest/dependencies/predicates",{params:{from:t,to:r,mode:"all",graphURI:n}})},getInstanceNode:function(t){return e.get("rest/explore-graph/node",{params:t})},getInstanceNodeLinks:function(t){return e.get("rest/explore-graph/links",{params:t})},getProperties:function(t){return e.get("rest/explore-graph/properties",{params:t})},updateGraph:function(t){let r={headers:{"Content-Type":"application/json"}};return r=Object.assign(r,t),e.post("rest/explore-graph/graph",r)},getRdfsLabelAndComment:function(t,r,n){const a=n||{};return e({url:"rest/explore/details",method:"GET",params:_.extend(a,{uri:t,languages:r}),headers:{Accept:"application/json"}})}}}},150:function(e,t){function r(e){return{initLazyList:function(t,r,n,a,i){return e((function(){const e=t+a-1,s=Math.max(0-a,e),o=Math.min(e+r-1,i.length);s>o?n([]):$.isArray(i)&&n(i.slice(s,o+1))}),100,!0)}}}angular.module("graphdb.framework.graphexplore.services.uiscroll",[]).factory("UiScrollService",r),r.$inject=["$timeout"]},151:function(e,t){angular.module("graphdb.framework.graphexplore.services.rdfsdetails",[]).factory("RdfsLabelCommentService",(function(){return{processAndFilterLabelAndComment:function(e){function t(e){const t={};for(let r in e)if(e.hasOwnProperty(r)){let n=r;r.indexOf(":")>-1&&(n=r,r=r.split(":")[1].toLowerCase()),t[r]=e[n]}return t}const r=e.results.bindings,n=[],a=[];_.each(r,(function(e){let r;angular.isUndefined(e.label)||(r=t(e.label),n.push(r)),angular.isUndefined(e.comment)||(r=t(e.comment),a.push(r))}));const i=function(e){return"en"===e.lang||"de"===e.lang},s=$.grep(n,i)[0],o=$.grep(a,i)[0],c=angular.isUndefined(s)?n.length>0?n[0].value:void 0:s.value,l=angular.isUndefined(o)?a.length>0?a[0].value:void 0:o.value;return{rdfsLabel:c,rdfsComment:l}}}}))},152:function(e,t){angular.module("graphdb.framework.rest.graphexplore.savedgraphs.service",[]).factory("SavedGraphsRestService",r),r.$inject=["$http"];function r(e){return{getSavedGraphs:function(){return e.get("rest/explore-graph/saved")},getSavedGraph:function(t){return e.get("rest/explore-graph/saved/"+encodeURIComponent(t))},editSavedGraph:function(t){return e.put("rest/explore-graph/saved/"+encodeURIComponent(t.id),t)},deleteSavedGraph:function(t){return e.delete("rest/explore-graph/saved/"+encodeURIComponent(t.id))},addNewSavedGraph:function(t){return e.post("rest/explore-graph/saved",t)}}}},153:function(e,t,r){"use strict";r.r(t);var n=r(93);angular.module("graphdb.framework.rest.graphconfig.service",[]).factory("GraphConfigRestService",a);function a(e){return{getGraphConfigs:function(){return e.get("rest/explore-graph/config")},getGraphConfigSamples:function(){return e.get("rest/explore-graph/samples")},loadGraphForConfig:function(t,r,n,a){return e.get(`rest/explore-graph/config/graph/${encodeURIComponent(t.id)}?includeInferred=${r}&linksLimit=${n}&sameAsState=${a}`)},getConfig:function(t){return e.get("rest/explore-graph/config/"+encodeURIComponent(t)).then(e=>Object(n.mapGraphsConfigResponseToModel)(e.data))},createGraphConfig:function(t){return e.post("rest/explore-graph/config",t)},updateGraphConfig:function(t){return console.log("rest update",t),e.put("rest/explore-graph/config/"+encodeURIComponent(t.id),t)},deleteGraphConfig:function(t){return e.delete("rest/explore-graph/config/"+encodeURIComponent(t.id))},validateQuery:function(t,r,n,a,i){return e({method:"POST",url:"rest/explore-graph/validate",data:{query:t,queryType:r,params:n,all:a,oneOf:i}})}}}a.$inject=["$http"]},154:function(e,t,r){"use strict";r.r(t);r(10);function n(e,t,r,n,a,i,s,o,c,l,u,d,p,h,f,g,m){e.classHierarchyData={},e.instancesObj={},e.instancesQueryObj={},e.instancesObj.items=[],e.instancesNotFiltered=[],e.isWarningShowed=!1,e.onopen=e.onclose=()=>angular.noop(),e.currentBrowserLimit=2e3,p.firefox?e.currentBrowserLimit=50:(p.safari||p.msie||p.msedge)&&(e.currentBrowserLimit=400);const y={};let v=0,x=0;t.key="",y.get=function(t,r,n){return c.initLazyList(t,r,n,v,e.instancesObj.items)};let S=allGraphs;const C=function(){if(e.getActiveRepository())return g.resolveGraphs(n.getActiveRepository()).success((function(t){e.graphsInRepo=t.results.bindings.length>1002?t.results.bindings.slice(0,1002):t.results.bindings,b()})).error((function(t){e.repositoryError=getError(t),s.error(getError(t),m.instant("graphexplore.error.getting.graphs"))}))},b=function(){const t=h.get("classHierarchy-selectedGraph-"+n.getActiveRepository());null!==t&&e.graphsInRepo.some(e=>e.contextID.uri===t.contextID.uri)?S=t:h.set("classHierarchy-selectedGraph-"+n.getActiveRepository(),S)};function w(t,r,n){e.classCountSlider.options&&e.classCountSlider.options.ceil!==r&&(e.classCountSlider={});var a;e.classCountSlider.value||(e.showExternalElements=!0,e.classCountSlider={value:r,options:{floor:1,ceil:r,vertical:!0,showSelectionBar:!0,onChange:function(){u(E,100,!0)}}},null===h.get(f.CLASS_HIERARCHY_CURRENT_SLIDER_VALUE)&&r>e.currentBrowserLimit&&(a=e.currentBrowserLimit,p.chrome?s.warning(m.instant("graphexplore.disabling.animations",{classLimit:a}),m.instant("graphexplore.reducing.visual.effects")):s.warning(m.instant("graphexplore.browser.performance",{browser:p.name,classLimit:a}),m.instant("graphexplore.reducing.visual.effects"))));const i=h.get(f.CLASS_HIERARCHY_SWITCH_PREFIXES);null!=i&&"true"!==i&&(e.showExternalElements=!0),n?e.classCountSlider.value=n:r>=1500&&(e.classCountSlider.value=1500,s.warning(m.instant("graphexplore.class.count.slider",{count:1500}),m.instant("graphexplore.reducing.class.count"))),r>=25&&!window.ActiveXObject&&"ActiveXObject"in window&&!e.isWarningShowed&&(e.classCountSlider.value=25,e.isWarningShowed=!0,s.warning(m.instant("graphexplore.class.count.browser",{count:25}),m.instant("graphexplore.reducing.class.count"))),u((function(){e.$broadcast("reCalcViewDimensions")}),200),E();let o=0;$("rzslider").on("wheel",(function(t){t.preventDefault(),t.stopPropagation();const r=(new Date).getTime();if(!(r-o>100))return;o=r,t=t.originalEvent;let n=e.classCountSlider.value;t.deltaY<=-1?n+=1:t.deltaY>=1&&(n-=1),n!==e.classCountSlider.value&&n>=e.classCountSlider.options.floor&&n<=e.classCountSlider.options.ceil&&e.$apply((function(){e.classCountSlider.value=n,u(E,100,!0)}))}))}function E(){e.currentSliderValue=e.classCountSlider.value}function R(e){const t=e.data.fullName,n=e.data.name;o.checkDomainRangeData(t).success((function(e,a){204===a?s.warning(m.instant("graphexplore.no.domain.range",{name:n})):(h.set(f.CLASS_HIERARCHY_LAST_SELECTED_CLASS,r.hash()),r.hash("").path("domain-range-graph").search("uri",t).search("name",n))})).error((function(){s.error(m.instant("graphexplore.error.request.failed",{name:n}))}))}function I(){r.replace().hash("1"),e.instancesObj.items=[],e.showExternalElements=!1,e.showClassInfoPanel=!1,h.clearClassHieararchyState(),e.hidePrefixes="true"===h.get(f.CLASS_HIERARCHY_HIDE_PREFIXES),e.currentSliderValue=void 0,e.classHierarchyData={},t.$broadcast("angucomplete-alt:clearInput")}function T(){e.hasClassHierarchy()&&u((function(){$("#toolbar").removeClass("ng-hide")}),0)}t.$watch((function(){return t.key}),(function(){v=0,_.each(e.instancesObj.items,(function(e){t.key>e&&v++})),x++})),y.revision=function(){return x},e.adapterContainer={adapter:{remain:!0}},e.$on("goToDomainRangeGraphView",(function(e,t){R(t)})),e.$on("classCount",w),e.$on("repositoryIsSet",(function(){if(!a.isLicenseValid())return;if(A===n.getActiveRepository())return;A=n.getActiveRepository();if(e.repositoryError=null,!A)return;S=allGraphs,C().then(L)})),e.datasource=y,e.goToDomainRangeGraphView=R,e.toggleClassInfoSidePanel=function(){e.showClassInfoPanel=!e.showClassInfoPanel,t.$broadcast("sidePanelClosed")},e.getActiveRepositoryNoError=function(){if(!e.repositoryError)return n.getActiveRepository()},e.isSystemRepository=function(){return n.isSystemRepository()},e.confirmReloadClassHierarchy=function(){d.openSimpleModal({title:m.instant("confirm.operation"),message:m.instant("graphexplore.calculating.hierarchy"),warning:!0}).result.then((function(){I(),e.loader=!0,e.hierarchyError=!1,o.reloadClassHierarchy(S.contextID.uri).success((function(t){e.loader=!1,e.classHierarchyData=t,T(),w()})).error((function(t){e.loader=!1,e.hierarchyError=getError(t),s.error(getError(t),m.instant("graphexplore.error.rdf.class.request"))}))}))},e.focusOnRoot=function(){e.$broadcast("rootFocus")},e.copyToClipboard=function(e){d.openCopyToClipboardModal(e)},e.searchedClassCallback=function(e){if(e){const r={name:e.title};t.$broadcast("searchedClass",r)}},e.instancesQueryObj.query="",e.instancesFilterFunc=function(t){return t.resolvedUri.toLowerCase().indexOf(e.instancesQueryObj.query.toLowerCase())>=0},C(),e.$watch("instancesObj.items",(function(){e.instancesObj.items.length>0&&u((function(){e.adapterContainer.adapter.reload()}),30)})),e.$watch("selectedClass",(function(){e.showClassInfoPanel&&function(t){const r=t.data.fullName;let n=t.data.name;if(n===r){const e=n.lastIndexOf("#");n=n.substring(e+1)}e.encodedUri=encodeURIComponent(r);const a=encodeURIComponent("prefix onto:<http://www.ontotext.com/>\nselect ?s {\n ?s a <"+r+"> .\n}");e.viewInstancesUri="sparql?name="+n+"&infer=true&sameAs=false&query="+a+"&execute=true",o.getRdfsLabelAndComment(r).success((function(t){e.rdfsLabel=t.label,e.rdfsComment=t.comment,e.expanded=!1})).error((function(){s.error("Error getting rdfs:label and rdfs:comment")})),e.instancesQueryObj.query="",e.instancesLoader=!0,o.getClassInstances(r).success((function(t){e.instancesObj.items=[],_.each(t,(function(t,r){const n={};n.type=t.startsWith("<<")&&t.endsWith(">>")?"triple":"uri",n.absUri=encodeURIComponent(t),n.absUriNonEncoded=t,n.resolvedUri=r,e.instancesObj.items.push(n)})),e.instancesLoader=!1,e.instancesSearchPlaceholder=e.instancesObj.items.length<1e3?"Search class instances":"Search first 1000 class instances",e.instancesNotFiltered=e.instancesObj.items})).error((function(){s.error(m.instant("graphexplore.error.instances.request"))}))}(e.selectedClass)})),$(document).ready((function(){$(".prefix-toggle").click((function(){$(".tooltip").hide()}))}));let A=n.getActiveRepository();function L(){I(),!e.isSystemRepository()&&e.isLicenseValid()&&(e.hierarchyError=!1,e.loader=!0,o.getClassHierarchyData(S.contextID.uri).success((function(t,r){e.showExternalElements=!0,e.loader=!1,e.classHierarchyData=t,207===r&&s.warning(m.instant("graphexplore.update.diagram"),m.instant("graphexplore.repository.data.changed")),T()})).error((function(t){e.loader=!1,e.hierarchyError=getError(t),s.error(getError(t),m.instant("graphexplore.error.rdf.class.request"))})))}e.hasClassHierarchy=function(){return e.classHierarchyData.classCount&&e.getActiveRepositoryNoError()&&!e.isSystemRepository()},e.isLicenseValid=function(){return a.isLicenseValid()},e.chosenGraph=function(e){S=e,L(),h.set("classHierarchy-selectedGraph-"+n.getActiveRepository(),S)},e.getSelGraphValue=function(){return S.contextID.value},e.isAllGraphsSelected=function(){return"all.graphs.label"===e.getSelGraphValue()}}angular.module("graphdb.framework.graphexplore.controllers.class",["pageslide-directive","ngAnimate","ui.scroll.jqlite","ui.scroll","angucomplete-alt","rzSlider","toastr","graphdb.framework.utils.localstorageadapter"]).controller("RdfClassHierarchyCtlr",n),n.$inject=["$scope","$rootScope","$location","$repositories","$licenseService","$window","toastr","GraphDataRestService","UiScrollService","RdfsLabelCommentService","$timeout","ModalService","bowser","LocalStorageAdapter","LSKeys","RDF4JRepositoriesRestService","$translate"]},155:function(e,t,r){"use strict";r.r(t);r(10);function n(e,t,r,n,a,i,s,o,c,l,u,d,p){e.predicatesObj={},e.predicatesQueryObj={},e.predicatesObj.items=[],e.predicatesQueryObj.query="",e.predicatesListNotFiltered=[],e.predicatesSearchPlaceholder="Search predicates",e.onopen=e.onclose=()=>angular.noop();const h={};let f=0,g=0;r.key="",h.get=function(t,r,n){return l.initLazyList(t,r,n,f,e.predicatesObj.items)},r.$watch((function(){return r.key}),(function(){f=0,_.each(e.predicatesObj.items,(function(e){r.key>e&&f++})),g++})),h.revision=function(){return g},e.adapterContainer={adapter:{remain:!0}};const m=s.get(o.DOMAIN_RANGE_COLLAPSE_EDGES);function y(){const e=s.get(o.CLASS_HIERARCHY_LAST_SELECTED_CLASS);t.search("").hash(e).path("hierarchy")}e.collapseEdges=null===m||"true"===m,e.datasource=h,e.$on("reloadDomainRangeGraphView",(function(e,r){const n=r.objectPropClassUri,a=r.objectPropClassName;t.path("domain-range-graph").search("uri",n).search("name",a)})),e.$on("switchEdgeMode",(function(e,r){t.path("domain-range-graph").search("uri",r.uri).search("name",r.name).search("collapsed",r.collapsed)})),e.$on("repositoryIsSet",(function(){if(v===a.getActiveRepository())return;v=a.getActiveRepository();y()})),e.$on("changeCollapsedEdgesState",(function(t,r){e.collapseEdges=!r,s.set(o.DOMAIN_RANGE_COLLAPSE_EDGES,e.collapseEdges)})),e.goToClassHierarchyView=y,e.copyToClipboard=function(e){u.openCopyToClipboardModal(e)},e.toggleCollapseEdgesState=function(){e.collapseEdges=!e.collapseEdges,i.history.pushState({collapsed:e.collapseEdges},"domainRangePage",null)},e.predicatesListFilterFunc=function(t){return t.resolvedUri.toLowerCase().indexOf(e.predicatesQueryObj.query.toLowerCase())>=0},e.$watch("predicatesObj.items",(function(){e.predicatesObj.items>0&&n((function(){e.adapterContainer.adapter.reload()}),30)})),e.$watch("selectedPredicate",(function(){e.showPredicatesInfoPanel&&function(t){const r=t.target,n=t.source;e.encodedUri=encodeURIComponent(t.uri),e.sourceTargetObjectNodeUri=r.objectPropClassUri?r.objectPropClassUri:n.objectPropClassUri,e.encodedSourceTargetObjectNodeUri=encodeURIComponent(e.sourceTargetObjectNodeUri),e.sourceTargetObjectNodeName=r.objectPropClassName?r.objectPropClassName:n.objectPropClassName?n.objectPropClassName:"<i>Literal</i>",-1===e.sourceTargetObjectNodeName.indexOf("Literal")?c.getRdfsLabelAndComment(e.sourceTargetObjectNodeUri).success((function(t){e.rdfsLabel=t.label,e.rdfsComment=t.comment})).error((function(){d.error(p.instant("domain.range.error.get.label.comment"))})):(e.rdfsComment=void 0,e.rdfsLabel=void 0);e.predicatesObj.items=[],e.predicatesQueryObj.query="";const a=r.allEdges?r.allEdges:n.allEdges;_.each(a,(function(t){const r={};r.absUri=encodeURIComponent(t.uri),r.absUriNonEncoded=t.uri,r.resolvedUri=t.name,r.isImplicit=t.implicit,e.predicatesObj.items.push(r)})),e.predicatesListNotFiltered=e.predicatesObj.items}(e.selectedPredicate)})),$(document).ready((function(){$(".compact-mode-toggle").click((function(){$(".tooltip").hide()}))}));let v=a.getActiveRepository()}angular.module("graphdb.framework.graphexplore.controllers.domainrange",["ui.scroll.jqlite","ui.scroll","ngSanitize","graphdb.framework.utils.localstorageadapter"]).controller("DomainRangeGraphCtlr",n),n.$inject=["$scope","$location","$rootScope","$timeout","$repositories","$window","LocalStorageAdapter","LSKeys","GraphDataRestService","UiScrollService","ModalService","toastr","$translate"]},156:function(e,t,r){(function(e){const t="WAIT",r="NO_REPO",n="READY",a="IN_PROGRESS",i="ERROR",s={contextID:{type:"all",value:"all.graphs.label",uri:""}};function o(e){if(e<1e3)return e;const t=Math.floor(Math.log(e)/Math.log(1e3));let r=e/Math.pow(1e3,t);return r=r%1>1/Math.pow(1e3,t-1)?r.toFixed(2):r.toFixed(0),r+["K","M","G","T","P","H"][t-1]}function c(e,o,c,l,u,d,p,h,f,g,m){let y=null;e.status=c.getActiveRepository()?t:r;let v=s;const x=function(){g.resolveGraphs(c.getActiveRepository()).success((function(t){e.graphsInRepo=t.results.bindings.length>1002?t.results.bindings.slice(0,1002):t.results.bindings,S(),e.isSystemRepository()?"READY"!==e.status&&b():(e.status="WAIT",b(!0))})).error((function(t){e.repositoryError=getError(t),l.error(getError(t),m.instant("graphexplore.error.getting.graph"))}))},S=function(){const t=f.get("dependencies-selectedGraph-"+c.getActiveRepository());null!==t&&e.graphsInRepo.some(e=>e.contextID.uri===t.contextID.uri)?v=t:f.set("dependencies-selectedGraph-"+c.getActiveRepository(),v)},C=function(r){d3.select("#dependencies-chord").html(""),e.status=t,d.getRelationshipsData(r,e.direction,v.contextID.uri).success((function(t){e.dependenciesData={matrix:t.right,nodes:t.left,hasLinks:_.sum(_.map(t.right,(function(e){return _.sum(e)})))>0,direction:e.direction},e.status=n})).error((function(t){e.status=n,l.error(getError(t),m.instant("graphexplore.error.dependencies.count"))}))},b=function(r){(e.status!==n||r)&&(e.status=t,d.getRelationshipsStatus(v.contextID.uri).success((function(t){if(e.status=t,e.status===a){if(null!==y)return;y=u(b,2e3)}e.status===n&&(null!==y&&(u.cancel(y),y=null),d.getRelationshipsClasses(e.direction,v.contextID.uri).success((function(t,r){e.allClasses.items=_.filter(t,I),e.allNotFilteredClasses=t,e.selectedClasses=void 0,angular.isUndefined(e.selectedClasses)&&(e.selectedClasses=t.slice(0,10)),C(e.selectedClasses),207===r&&l.warning(m.instant("graphexplore.update.diagram"),m.instant("graphexplore.repository.data.changed"))}))),0===e.status.indexOf("ERROR;")&&(e.status=i,l.error(m.instant("graphexplore.error.dependencies.calc",{error:e.status.substring("ERROR;".length)})))})).error((function(t){e.status=i,l.error(getError(t),m.instant("graphexplore.error.dependencies.count.status"))})))};e.allClasses={},e.allClasses.items=[],e.allNotFilteredClasses=[],e.direction="all";const w={};let E=0,R=0;function I(t){return-1!==t.name.toLowerCase().indexOf(e.classQuery.query.toLowerCase())}o.key="",w.get=function(t,r,n){return p.initLazyList(t,r,n,E,e.allClasses.items)},o.$watch((function(){return o.key}),(function(){E=0,_.each(e.allClasses.items,(function(e){o.key>e&&E++})),R++})),w.revision=function(){return R},e.datasource=w,e.adapterContainer={adapter:{remain:!0}},e.classQuery={},e.classQuery.query="",e.classFilterFunc=I,e.$watch("allClasses.items",(function(){e.allClasses.items.length>0&&u((function(){e.adapterContainer.adapter.reload()}),30)})),e.$watch("direction",(function(){!c.getActiveRepository()||e.isSystemRepository()||c.isActiveRepoFedXType()||x()})),e.$on("$destroy",(function(){u.cancel(y)})),e.isLoading=function(){return e.status===a||e.status===t},e.confirmCalculateDependencies=function(){h.openSimpleModal({title:m.instant("confirm.operation"),message:m.instant("graphexplore.calculating.relationships"),warning:!0}).result.then((function(){e.calculateDependencies()}))},e.calculateDependencies=function(){e.status=t,e.selectedClasses=void 0,d.calculateRelationships(v.contextID.uri).success((function(t){0===t.indexOf("ERROR;")?l.error(m.instant("graphexplore.error.dependencies.calc",{error:e.status.substring("ERROR;".length)})):b()})).error((function(e){l.error(m.instant("graphexplore.error.could.not.force.count",{error:getError(e)}))}))},e.addClass=function(t){e.selectedClasses.push(t),C(e.selectedClasses)},e.removeClass=function(t){_.remove(e.selectedClasses,(function(e){return e.name===t.name})),C(e.selectedClasses)},e.showClass=function(t){e.classToShow=t},e.isClassByNameShown=function(t){return void 0!==_.find(e.selectedClasses,{name:t})},e.addClassByName=function(t){e.selectedClasses.push(_.find(e.allClasses.items,{name:t})),C(e.selectedClasses)},e.removeClassByName=function(t){_.remove(e.selectedClasses,(function(e){return e.name===t})),C(e.selectedClasses)},e.removeAllClasses=function(){e.selectedClasses=[],C(e.selectedClasses)},e.isSystemRepository=function(){return"SYSTEM"===c.getActiveRepository()};const T=e.$on("repositoryIsSet",(function(){e.classQuery={},e.classQuery.query="",e.repositoryError=null,v=s,c.getActiveRepository()&&!c.isActiveRepoFedXType()?x():e.status=r}));window.addEventListener("beforeunload",(function e(){T(),window.removeEventListener("beforeunload",e)})),e.selectGraph=function(e){v=e,b(!0),f.set("dependencies-selectedGraph-"+c.getActiveRepository(),v)},e.getSelectedGraphValue=function(){return v.contextID.value},e.isAllGraphsSelected=function(){return"all.graphs.label"===e.getSelectedGraphValue()}}Object.defineProperty(e,"allGraphs",{get:()=>s}),angular.module("graphdb.framework.graphexplore.controllers.dependencies",["ui.scroll.jqlite","ui.scroll","toastr","ui.bootstrap","graphdb.framework.core.services.repositories","graphdb.framework.utils.localstorageadapter"]).controller("DependenciesChordCtrl",c).config(["$uibTooltipProvider",function(e){e.options({appendToBody:!0})}]).filter("humanize",(function(){return o})),c.$inject=["$scope","$rootScope","$repositories","toastr","$timeout","GraphDataRestService","UiScrollService","ModalService","LocalStorageAdapter","RDF4JRepositoriesRestService","$translate"]}).call(this,r(11))},157:function(e,t,r){"use strict";r.r(t);r(7);var n=r(400),a=r(402),i=(r(10),r(94)),s=r(102);function o(e,t,r,o,c,l,u,d,p,h,f,g,m,y,v,x,S,C,b,w,E,R,I){e.languageChanged=!1,e.propertiesObj={},e.propertiesObj.items=[],e.propertiesQueryObj={},e.propertiesQueryObj.query="",e.propertiesSearchPlaceholder=R.instant("visual.search.instance.placeholder"),e.propertiesNotFiltered=[],e.searchVisible=!1,e.nodeSelected=!1,e.queryResultsMode=!1,e.embedded=h.search().embedded,e.openedNodeInfoPanel=void 0,e.invalidLimit=!1,e.INVALID_LINKS_MSG=R.instant("sidepanel.invalid.limit.links.msg"),e.INVALID_LINKS_TOOLTIP=R.instant("sidepanel.invalid.limit.links.tooltip"),e.datasource=void 0,e.adapterContainer={adapter:{remain:!0}},e.hasInitedRepository=!1,e.defaultSettings={linksLimit:20,includeInferred:!0,sameAsState:!0,languages:["en"],showLinksText:!0,preferredTypes:[],rejectedTypes:[],preferredPredicates:[],rejectedPredicates:["http://dbpedia.org/property/logo","http://dbpedia.org/property/hasPhotoCollection","http://dbpedia.org/property/website","http://dbpedia.org/property/homepage","http://dbpedia.org/ontology/thumbnail","http://xmlns.com/foaf/0.1/depiction","http://xmlns.com/foaf/0.1/homepage","http://xmlns.com/foaf/0.1/mbox","http://dbpedia.org/ontology/wikiPage*","http://dbpedia.org/property/wikiPage*","http://factforge.net/*"],preferredTypesOnly:!1,preferredPredicatesOnly:!1,includeSchema:!0},e.saveSettings=_.cloneDeep(e.defaultSettings),e.defaultGraphConfig={id:"default",name:"Easy graph",startMode:"search"},t.key="",e.onopen=e.onclose=()=>angular.noop(),e.goToHome=()=>{L(),h.url("graphs-visualizations")},e.shouldShowSettings=()=>e.configLoaded&&e.configLoaded.id===e.defaultGraphConfig.id,e.shouldDisableSameAs=()=>{const t=$("#sameAsCheck");return e.settings&&!e.settings.includeInferred&&t.prop("checked")&&(t.prop("checked",!1),e.settings.sameAsState=!1),e.settings&&!e.settings.includeInferred},e.propertiesFilterFunc=t=>t.key.toLowerCase().indexOf(e.propertiesQueryObj.query.toLowerCase())>=0,e.toggleMoreInfo=e=>{angular.element(e.currentTarget).parent().next().toggle(200),angular.element(e.currentTarget).children("span").toggleClass("icon-caret-down").toggleClass("icon-caret-up")},e.copyToClipboard=e=>{m.openCopyToClipboardModal(e)},e.resetSettings=()=>{e.settings=_.cloneDeep(e.defaultSettings),e.validateLinksLimit(),O()},e.changeLimit=t=>{let r=e.settings.linksLimit+t;r<1&&(r=1),r>1e3&&(r=1e3),e.settings.linksLimit=r},e.validateLinksLimit=()=>{e.invalidLimit=!i.NUMBER_PATTERN.test(e.settings.linksLimit)},e.showSettings=()=>{e.showInfoPanel=!0,e.showFilter=!0,e.showNodeInfo=!1,e.showPredicates=!1,e.saveSettings?e.settings=_.cloneDeep(e.saveSettings):e.settings=_.cloneDeep(e.defaultSettings),O()},e.updateSettings=()=>{e.invalidLimit?c.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?P(e.rootNodeIri):e.queryResultsMode&&h.search().query?Q(h.search().query,h.search().sameAs,h.search().inference):"query"===e.configLoaded.startMode&&H(e.configLoaded),N(),e.showInfoPanel=!1,e.showFilter=!1,x.set(S.GRAPHS_VIZ,e.saveSettings))},e.getGraphConfigs=t=>{b.getGraphConfigs().success((function(r){e.graphConfigs=r,t&&t()})).error((function(e){c.error(getError(e),R.instant("graphexplore.error.graph.configs.short.msg"))}))},e.findConfigById=function(t){return t===e.defaultGraphConfig.id?e.defaultGraphConfig:$.grep(e.graphConfigs,(function(e){return e.id===t}))[0]},e.easyGraphSearch=t=>{e.configLoaded=e.defaultGraphConfig,e.openUri(t)},e.deleteConfig=t=>{m.openSimpleModal({title:R.instant("common.confirm"),message:R.instant("graphexplore.delete.graph",{configName:t.name}),warning:!0}).result.then((function(){b.deleteGraphConfig(t).success((function(){e.getGraphConfigs(),e.refreshSavedGraphs()})).error((function(e){c.error(getError(e),R.instant("graphexplore.error.cannot.delete.config"))}))}))},e.goToGraphConfig=e=>{A({config:e.id},{config:e}),L(),H(e)},e.replaceIRIWithPrefix=t=>{const r=e.namespaces,n=_.findLast(r,(function(e){return 0===t.indexOf(e.uri)}));return n?n.prefix+":"+t.substring(n.uri.length):t};const T=[];t.$on("$translateChangeSuccess",(function(){e.INVALID_LINKS_MSG=R.instant("sidepanel.invalid.limit.links.msg"),e.INVALID_LINKS_TOOLTIP=R.instant("sidepanel.invalid.limit.links.tooltip"),e.propertiesSearchPlaceholder=R.instant("visual.search.instance.placeholder")})),e.$on("autocompleteStatus",(function(){ce()})),e.$on("repositoryIsSet",(function(t,r){r.newRepo&&(e.hasInitedRepository=!1),oe(r.newRepo),r.newRepo&&(L(),$(".graph-visualization svg").empty(),h.search().query&&(e.goToHome(),D()))}));T.push(t.$watch(()=>t.key,()=>{z=0,_.each(e.propertiesObj.items,(function(e){t.key>e&&z++})),B++}));T.push(e.$watch("propertiesObj.items",()=>{angular.isDefined(e.propertiesObj.items)&&e.propertiesObj.items.length>0&&l((function(){e.adapterContainer.adapter.reload()}),500)}));e.$on("$destroy",()=>{T.forEach(e=>e())});const A=(t,r)=>{e.embedded&&(t.embedded=!0),h.search(t),h.state(r)},L=()=>{e.searchVisible=!1,e.nodeSelected=!1,e.configLoaded=null,e.queryResultsMode=!1,e.lastSavedGraphName=null,e.lastSavedGraphId=null,e.shared=!1,e.numberOfPinnedNodes=0,W={},V=0},k=()=>I.isActive()?e.defaultSettings:e.saveSettings,N=()=>{k().showLinksText?d3.selectAll("svg .link-wrapper text").style("display","block"):d3.selectAll("svg .link-wrapper text").style("display","none")},O=()=>{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}}))},P=()=>{e.rootNodeIri&&e.$broadcast("onRootNodeChange",e.rootNodeIri)},D=()=>{h.search().query?(e.searchVisible=!1,e.queryResultsMode=!0,Q(h.search().query,h.search().sameAs,h.search().inference)):e.$on("onRootNodeChange",(function(t,r){e.loading=!0;const n=k();angular.isDefined(r)&&(e.rootNodeIri=r,w.getInstanceNode({iri:r,config:e.configLoaded?e.configLoaded.id:e.defaultGraphConfig.id,languages:e.shouldShowSettings()?n.languages:[],includeInferred:n.includeInferred,sameAsState:n.sameAsState}).then((function(t){e.nodeSelected=!0,e.searchVisible=!1,null===t.data.types&&(t.data.types="greyColor"),se=new ie;const r=se.addNode(t.data,te/2,re/2);ee=Z,Re(r,!0)})).catch((function(t){e.loading=!1,c.error(getError(t),R.instant("graphexplore.error.could.not.load.graph"))})))})),h.search().uri&&e.openUri(h.search().uri,!0),h.search().saved&&C.getSavedGraph(h.search().saved).success((function(t){e.loadSavedGraph(t)})).error((function(e){const t=getError(e);c.error(t,R.instant("graphexplore.error.could.not.open"))}))},Q=(t,r,n)=>{const a=k(),i=void 0===r?a.sameAsState:!0===r,s=void 0===n?a.includeInferred:!0===n;e.loading=!0,w.updateGraph({query:t,linksLimit:a.linksLimit,languages:e.shouldShowSettings()?a.languages:[],includeInferred:s,sameAsState:i}).then((function(e){we(e)}),(function(t){e.loading=!1,c.error(getError(t.data),R.instant("graphexplore.error.cannot.load.graph"))}))},M=(e,t)=>{const r=e.split(" ");return t?[r[0],r[1],r[2]].join(">"):[r[0],r[2]].join(">")},j=e=>[e.source.iri,e.target.iri].join(">"),U=e=>{if(e.isTriple){const t=document.getElementById(Object(s.removeSpecialChars)(M(e.iri)));if(t&&void 0!==t.__data__.x)return t.__data__.x}return e.x},G=e=>{if(e.isTriple){const t=document.getElementById(Object(s.removeSpecialChars)(M(e.iri)));if(t&&void 0!==t.__data__.y)return t.__data__.y}return e.y},q=e=>{const t=e.trim().split(" ");return`<<<${t[0]}> <${t[1]}> <${t[2]}>>>`},F=e=>{const t=e.source.isTriple?M(e.source.iri,!0):e.source.iri,r=e.target.isTriple?M(e.target.iri,!0):e.target.iri;return Object(s.removeSpecialChars)(`${t}>${r}>marker`)},H=t=>{e.configLoaded=t,"search"===t.startMode?e.searchVisible=!0:"node"===t.startMode&&t.startIRI?l((function(){e.openUri(t.startIRI,!0)}),0):"query"===t.startMode&&t.startGraphQuery&&(e.loading=!0,b.loadGraphForConfig(t,t.startQueryIncludeInferred,k().linksLimit,t.startQuerySameAs).then((function(e){we(e)}),(function(t){e.loading=!1,c.error(getError(t),R.instant("graphexplore.error.graph.load"))})))},Y=function(){var t,r;h.search().config?(t=h.search().config,r=D,t===e.defaultGraphConfig.id?H(e.defaultGraphConfig):b.getConfig(t).then(e=>{H(e),r()}).catch(e=>{c.error(getError(e),R.instant("graphexplore.error.could.not.load.config",{configId:t}))})):h.search().query||h.search().uri?(H(e.defaultGraphConfig),D()):D()};v.onpopstate=function(t){L(),t.state&&(t.state.config?(H(t.state.config),t.state.uri&&e.openUri(t.state.uri,!0)):t.state.savedGraph&&e.loadSavedGraph(t.state.savedGraph,!0))},e.embedded&&(h.search().query||h.search().uri||h.search().config||h.search().saved)&&(e.noGoHome=!0);let z=0,B=0,W={},V=0;const X=16,K=d3.zoom().scaleExtent([.5,10]);let J;const Z=d3.zoomIdentity.translate(0,-70).scale(1);K.on("zoom",(function(e){I.isActive()||(ee=e.transform,J.attr("transform",ee))}));let ee=Z;const te=1e3,re=1e3;let ne,ae;function ie(){this.nodes=[],this.links=[],this.tripleNodes=new Map,this.tripleLinksCopy=new Map,this.addNode=function(e,t,r){return e.x=t,e.y=r,this.nodes.push(e),e},this.computeConnectedness=function(){const e={},t={};_.each(this.links,(function(r){const n=r.source.iri,a=r.target.iri,i=_.min([n,a])+"|"+_.max([n,a]);t[i]||(t[i]=1,e[n]=(e[n]||0)+1,e[a]=(e[a]||0)+1)})),_.each(this.links,(function(t){e[t.source.iri]>1&&e[t.target.iri]>1?t.connectedness=Math.min(5,Math.max(e[t.source.iri],e[t.target.iri])-1):t.connectedness=0}))},this.addAndMatchLinks=function(e){const t=this.nodes;Array.prototype.push.apply(this.links,function(e,t){return _.map(e,(function(e){let r,n;r=e.isTripleSource?ke(e.source):_.find(t,(function(t){return t.iri===e.source})),n=e.isTripleTarget?ke(e.target):_.find(t,(function(t){return t.iri===e.target}));let a={source:r,target:n,predicates:e.predicates};if(e.isTripleSource||e.isTripleTarget){let e=`${a.source.isTriple?M(a.source.iri):a.source.iri}>${a.target.isTriple?M(a.target.iri):a.target.iri}`;if(se.tripleLinksCopy.has(e)){let t=se.tripleLinksCopy.get(e);return t[0].predicates.push(...a.predicates),t.push(a),se.tripleLinksCopy.set(e,t),null}se.tripleLinksCopy.set(e,[a])}return a}))}(e,t));for(let e of se.tripleLinksCopy.keys())1===se.tripleLinksCopy.get(e).length&&se.tripleLinksCopy.delete(e);this.links=this.links.filter(e=>null!==e),this.computeConnectedness()};const t=function(e,t){return r(e,t).length};function r(e,t){return _.filter(t,(function(t){return t.source.iri===e.iri||t.target.iri===e.iri}))}this.countLinks=t,this.linksTypes=function(e,t){const n=r(e,t),a=_.map(n,(function(t){return t.source.iri===e.iri?t.target.types:t.source.types}));return _.uniq(_.flatten(a))},this.linksPredicates=function(e,t){const n=r(e,t),a=_.map(n,(function(e){return e.predicates}));return _.uniq(_.flatten(a))},this.removeTriples=function(e){let t=[];this.tripleNodes.size>0&&e.forEach(e=>{this.tripleNodes.has(e)&&(this.tripleNodes.delete(e),this.links=_.reject(this.links,(function(r){let n=e.split(">"),a=M(r.source.iri),i=M(r.target.iri);if(a===e&&se.tripleNodes.delete(i)){let e=i.split(">");t.push({source:e[0],target:e[1]})}let s=a===e||i===e||r.source.iri===n[0]&&r.target.iri===n[1];return s&&(se.tripleLinksCopy.delete(`${a}>${i}`),se.tripleLinksCopy.delete(`${i}>${a}`)),s})))}),t.forEach(e=>{this.links=_.reject(this.links,(function(t){return t.source.iri===e.source&&t.target.iri===e.target}))})},this.removeNode=function(r){let n=[];this.links=_.reject(this.links,(function(e){let t=e.source.iri===r.iri||e.target.iri===r.iri;return t&&(e.target.isTriple&&n.push(M(e.target.iri)),e.source.isTriple||e.target.isTriple||n.push([e.source.iri,e.target.iri].join(">"))),t})),this.removeTriples(n);const a=this.links;this.nodes=_.reject(this.nodes,(function(e){return 0===t(e,a)})),0===this.nodes.length&&(e.nodeSelected=!1),this.computeConnectedness()},this.removeNodeLeafLinks=function(e){let n=[],a=this.links;this.links=_.reject(this.links,(function(i){let s=i.source.iri===e.iri&&1===t(i.target,a)&&!i.target.isTriple||i.target.iri===e.iri&&1===t(i.source,a)&&!i.source.isTriple;if(!s){let n;if(i.source.iri!==e.iri||2!==t(i.target,a)||i.target.isTriple?i.target.iri!==e.iri||2!==t(i.source,a)||i.source.isTriple||(n=r(i.source,a)):n=r(i.target,a),!n)return!1;s=(n[0].source.iri===e.iri||n[0].target.iri)&&(n[1].source.iri===e.iri||n[1].target.iri)}return s&&(i.target.isTriple&&n.push(M(i.target.iri)),i.source.isTriple||i.target.isTriple||n.push([i.source.iri,i.target.iri].join(">"))),s})),this.removeTriples(n),a=this.links,this.nodes=_.reject(this.nodes,(function(r){return 0===t(r,a)&&r.iri!==e.iri})),this.computeConnectedness()},this.addTriple=function(e,t,r){e.x=t,e.y=r,e.weight=0;let n=M(e.iri);if(this.tripleNodes.has(n)){let t=this.tripleNodes.get(n);t.push(e),this.tripleNodes.set(n,t)}else e.weight=10,this.tripleNodes.set(n,[e])},this.copyState=function(){const e=_.map(this.nodes,(function(e){return{iri:e.iri,isTriple:e.isTriple,size:e.size,labels:_.cloneDeep(e.labels),types:_.cloneDeep(e.types),rdfRank:e.rdfRank,x:e.x,y:e.y,fixed:e.fixed}})),t=JSON.stringify(Array.from(this.tripleNodes.entries())),r=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:r,colorIndex:V,type2color:W,transform:ee}},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)&&(V=t.colorIndex,W=_.cloneDeep(t.type2color)),angular.isDefined(t.transform)&&(ee=d3.zoomIdentity.translate(t.transform.x,t.transform.y).scale(t.transform.k)),ve()}}e.datasource={get:function(t,r,n){return g.initLazyList(t,r,n,z,e.propertiesObj.items)},revision:function(){return B}},p.when(f.getPrincipal()).then(t=>(t=>{const r=t.appSettings;e.defaultSettings.includeInferred=r.DEFAULT_INFERENCE,e.defaultSettings.sameAsState=r.DEFAULT_INFERENCE&&r.DEFAULT_SAMEAS,e.defaultSettings.includeSchema=r.DEFAULT_VIS_GRAPH_SCHEMA;const n=x.get(S.GRAPHS_VIZ);if(n&&"object"==typeof n)try{e.saveSettings=n,void 0===e.saveSettings.includeSchema&&(e.saveSettings.includeSchema=e.defaultSettings.includeSchema,e.saveSettings.rejectedPredicates=[...e.saveSettings.rejectedPredicates,...e.defaultSettings.rejectedPredicates].unique())}catch(t){e.saveSettings=_.cloneDeep(e.defaultSettings),x.set(S.GRAPHS_VIZ,e.saveSettings)}else e.saveSettings=_.cloneDeep(e.defaultSettings)})(t)),e.showInfoPanel=!1;let se=new ie;function oe(t){!r.getActiveRepository()||e.hasInitedRepository&&!t||(e.hasInitedRepository=!0,t||e.getGraphConfigs(Y),e.getNamespacesPromise=E.getNamespaces(e.getActiveRepository()).success((function(t){const r=_.map(t.results.bindings,(function(e){return{uri:e.namespace.value,prefix:e.prefix.value}}));e.namespaces=_.sortBy(r,(function(e){return e.uri.length})),ce()})).error((function(e){c.error(getError(e),R.instant("graphexplore.error.view.will.not.work"))})))}function ce(){o.isLicenseValid()&&(e.getAutocompletePromise=d.checkAutocompleteStatus())}e.addedTag=function(t){return t.text.indexOf(":")<0?(c.warning(R.instant("graphexplore.absolute.prefixed.iri")),null):(t.text=function(e,t){if(!/^<?(http|urn).*>?/.test(e)){const r=e.split(":"),n=r[0],a=r[1];if(!angular.isUndefined(a)){const e=u.getNamespaceUriForPrefix(t,n);if(e)return e+a}}return e}(t.text,e.namespaces),e.pageslideExpanded=!0,t)},e.validateTag=function(e,t,r){if(e.text.indexOf(":")<0)return r?c.warning(R.instant("graphexplore.absolute.prefixed.iri.option"),t):c.warning(R.instant("graphexplore.absolute.prefixed.iri"),t),!1;const n=e.text.indexOf("*");if(n>=0){if(!r)return c.warning(R.instant("graphexplore.wildcards.not.allowed"),t),!1;if(n<e.text.length-1)return c.warning(R.instant("graphexplore.wildcards.last.char"),t),!1}return!0},e.getTagClass=function(e){return e.endsWith("*")?"tag-item-wildcard":null},e.getActiveRepository=function(){return r.getActiveRepository()},e.isLicenseValid=function(){return o.isLicenseValid()},oe();const le=d3.scaleLinear().domain([0,9]).range(["hsl(0, 100%, 75%)","hsl(360, 90%, 82%)"]).interpolate(d3.interpolateHslLong),ue=d3.scaleLinear().domain([0,9]).range(["hsl(180, 50%, 75%)","hsl(540, 40%, 82%)"]).interpolate(d3.interpolateHslLong);e.getColor=function(e){angular.isUndefined(W[e])&&(W[e]=V,V++);const t=W[e];return t>39?"#c2c2c2":t%2==0?le(t/2):ue(t/2)};const de=d3.forceX(te/2).strength(.005),pe=d3.forceY(re/2).strength(.005),he=d3.forceSimulation().force("x",de).force("y",pe),fe=d3.select(".main-container .graph-visualization").append("svg").attr("viewBox","0 0 "+te+" "+re).attr("preserveAspectRatio","xMidYMid meet");fe.append("rect").attr("width",10*te).attr("height",10*re).attr("x",-(10*te-te)/2).attr("y",-(10*re-re)/2).style("fill","none").style("pointer-events","all").call(K).on("click",(function(e){e.stopPropagation(),Ie(),he.stop()}));let ge=0,me=0;const ye=new function(){this.state=!1,this.setLoadingState=function(e){this.state=e},this.getLoadingState=function(){return this.state},this.init=function(e,t){d3.select(t).append("circle").attr("cx",(function(){return e.x})).attr("cy",(function(){return e.y})).attr("class","loader-container").attr("r",(function(){return e.size})).style("fill","fff").style("opacity","0.7"),d3.select(t).append("image").attr("xlink:href","js/angular/templates/loader/ot-loader.svg?v=2.6.1-RC1").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 ve(t){d3.selectAll("svg g").remove(),d3.selectAll(".d3-tip").remove(),d3.selectAll(".menu-events").remove(),J=fe.append("g").attr("class","nodes-container").attr("transform",(function(){return angular.isDefined(ee)&&!t?ee:""}));const r=Object(a.a)().attr("class","d3-tip").customPosition((function(){const e=ne.getBoundingClientRect();return{top:e.bottom+10+"px",left:e.left-30+"px"}})).html((function(t){let r="";return t.fixed&&(r+='<i class="icon-pin"></i>&nbsp;&nbsp;'),t.types.length>0?r+=_.join(_.map(t.types,(function(t){return e.replaceIRIWithPrefix(t)}))," · "):r+="<i>No types</i>",r})),i=function(e){let t="";return t+=_.join(_.map(e.predicates,(function(t,r){if(0===r)return Oe(t);if(r<10)return" · "+Oe(t);if(10===r){const t=function(e){return e.predicates.length-10}(e),r=t>1?t+" predicates":t+" predicate";return" · "+R.instant("graphexplore.tip.text",{textToShow:r})}})),""),t};let o;const u=Object(a.a)().attr("class","d3-tip").customPosition((function(e){const t=o.getBoundingClientRect(),r=function(e){const t=i(e),r=document.createElement("canvas").getContext("2d");return r.font="13px Arial",e.predicates.length<10?r.measureText(t).width:r.measureText(t).width/2}(e);return{top:t.top-30+"px",left:t.left-30+"px",width:r+"px"}})).html((function(e){return i(e)}));const d=function(){l.cancel(void 0),l.cancel(ge),ne=null,r.hide(),me=l((function(){Ie()}),500)};fe.call(r);fe.call(u);let p=fe.selectAll(".link"),h=fe.selectAll(".node");const f=d3.forceCollide(e=>e.size+5).strength(.5),g=d3.forceManyBody().strength(-300),m=d3.forceCenter(te/2,re/2);he.nodes(se.nodes).force("charge",g).force("collide",f).force("center",m).force("link",d3.forceLink(se.links).distance((function(e){return e.source.isTriple||e.target.isTriple?0:function(e){const t=$("<span></span>"),r=e.predicates[0].split("/"),n=r[r.length-1];t.addClass("predicate-text").text(n),$("body").append(t);const a=t.width()+2*e.source.size+2*e.target.size+50;return t.remove(),.75*a}(e)+30*e.connectedness}))),J.append("defs").selectAll("marker").data(se.links).enter().append("marker").attr("class","arrow-marker").attr("id",(function(e){return F(e)})).attr("viewBox","0 -5 10 10").attr("refX",(function(e){return e.target.isTriple?11:e.target.size+11})).attr("refY",0).attr("markerWidth",10).attr("markerHeight",10).attr("orient","auto").append("path").attr("d","M0,-5L10,0L0,5 L10,0 L0, -5"),p=J.selectAll(".link").data(se.links).enter().append("g").attr("class","link-wrapper").attr("id",(function(e){return Object(s.removeSpecialChars)(j(e))})).append("line").attr("class","link").style("stroke-width",1).style("fill","transparent").style("marker-end",(function(e){return`url(#${F(e)})`}));const y=J.selectAll(".link-wrapper").append("text").text((function(e){return Ne(e)})).attr("class",(function(e){return e.predicates.length>1||se.tripleNodes.has(j(e))?"predicates":"predicate"})).attr("dy","-0.5em").style("text-anchor","middle").style("display",k().showLinksText?"":"none").on("mouseover",(function(e,t){e.stopPropagation(),function(e,t){l.cancel(void 0);const r=o=e.target;l((function(){o===r&&t.predicates.length>1&&u.show(t,o)}),300)}(e,t)})).on("mouseout",(function(){l.cancel(void 0),o=null,u.hide()})).on("click",(function(t,r){t.stopPropagation(),function(t,r){Le();const n=j(r);if(1===r.predicates.length&&se.tripleNodes.has(n)){ae=null;const e=se.tripleNodes.get(n)[0];if(Ce(e,this,t.button)){const t={};t.iri=e.iri,t.pred=Oe(e.iri.split(" ")[1]),Te(t)}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){const r=function(e,t){const r=j(t);return se.tripleNodes.has(r)?se.tripleNodes.get(r).findIndex(t=>t.iri.indexOf(e)>=0):-1}(e,t),n=r>-1;return{value:Oe(e),partOfTriple:n,linkId:n?j(t):"",nodeIndex:r}})),e.showInfoPanel=!0)}(r)}(t,r)}));let v,x=0,S=null,C=null;const b=function(t,r,n){let a=n||this.parentNode;Array.isArray(n)&&(a=n[r]);se.countLinks(t,se.links)<=k().linksLimit?Re(t,!1,a):c.info(R.instant("graphexplore.increase.limit"),R.instant("graphexplore.node.at.max")),e.closeInfoPanel()};function w(e,t){let r,n,a,i,s=!0;if("down"===t)r=2*e.size,n=e.size/3,a=.8,i=.3;else if("down-fixed"===t)r=2*e.size,n=e.size,a=.8,i=.66;else if("up"===t)r=e.size/3,n=2*e.size,a=.3,i=.8;else{if("fixed"!==t)return;r=e.size,a=.66,s=!1}let o=J.selectAll(".node-wrapper").filter((function(t){return t===e})).append("text").text("").classed("icon-any pinned",!0).style("font-size",r+"px").attr("x",(function(e){return e.x})).attr("y",(function(e){return e.y})).attr("opacity",a);"fixed"!==t&&"down-fixed"!==t||(e.pin=o),s&&(o=o.transition().duration(1e3).style("font-size",(function(){return n+"px"})).attr("opacity",i),"down-fixed"!==t&&o.remove())}const E=d3.drag().subject((function(e){return e})).on("start",(function(e,t){if(I.isActive())return;0===e.sourceEvent.button&&(t.fixedBeforeDrag=t.fixed,t.isBeingDragged=!0,t.beginDragging=!0,Ie(),d3.select(this).classed("dragging",!0),he.alphaTarget(.3).restart())})).on("drag",(function(t,r){r.isBeingDragged&&(r.fx=t.x,r.fy=t.y,r.fixed?r.beginDragging&&w(r,"fixed"):(e.numberOfPinnedNodes++,r.fixed=!0,w(r,"down-fixed")),r.pinWasFixed=!0,r.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));he.alphaTarget(0)}));h=J.selectAll(".node").data(se.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){n.isBeingDragged||(l.cancel(me),ge=l(()=>{(function(t,r){if(e.showInfoPanel)return!1;(Se.closeIcon||Se.expandIcon||Se.focusIcon||Se.copyURIIcon)&&Se.removeIcons();if(he.alpha()<.1)return Se.initIcons(t,r.parentNode),he.stop(),xe(),!0;return!1})(n,this)&&function(e,t){l.cancel(void 0);const n=ne=t.target;l((function(){ne===n&&r.show(e,ne)}),300)}(n,t)},400))})).on("mouseout",d).on("click",(function(t,r){if(t.button&&0!==t.button)return;const n=this;if(S&&C===n)return l.cancel(S),S=null,void b(r,0,n.parentNode);C=n,d(),e.showPredicates=!1,I.isActive()||(l.cancel(S),S=l((function(){Ce(r,n,t),S=null}),540))})).on("touchstart",(e,t)=>function(e){x=0,v=l((function(){x<5&&be(e),v=null}),1e3)}(t)).on("touchmove",(function(){x++})).on("touchend",(function(){l.cancel(v),v=null})).on("contextmenu",(function(t,n){t.shiftKey||(t.preventDefault(),Ie(),e.closeInfoPanel(),n.fixed?(e.numberOfPinnedNodes--,n.fixed=!1,n.fx=null,n.fy=null,w(n,"up"),he.alpha(1).restart()):(e.numberOfPinnedNodes++,n.fixed=!0,w(n,"down")),function(e){ne&&r.show(e,ne)}(n))})).on("gdb-expand-node",(e,t)=>b(t,0,e.srcElement.parentNode)).on("gdb-show-node-info",(e,t)=>_e(t)).call(E);const T=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"),(e=>{e.each((function(e){e.fontSize=n.a.Text.calcFontSizeRaw(e.labels[0].label,e.size,X,!0)})).attr("height",(function(e){return 3*e.fontSize})).append("xhtml:div").attr("class","node-label-body").style("font-size",(function(e){return e.fontSize+"px"})).append("xhtml:div").text((function(e){return e.labels[0].label})),l((function(){$(".node-label-body div").each((function(e,t){let r=t.textContent.substring(0,t.textContent.length-1);let n=0;for(;n<200&&(t.scrollHeight>t.clientHeight||t.scrollWidth>t.clientWidth);)r=r.substring(0,r.length-1),t.textContent=r+"…",n++}))}),50)})(T),he.on("tick",(function(){p.attr("x1",(function(e){return U(e.source)})).attr("y1",(function(e){return G(e.source)})).attr("x2",(function(e){return U(e.target)})).attr("y2",(function(e){return G(e.target)})),y.attr("x",(function(e){let t=U(e.source),r=U(e.target);return e.x=.5*(t+r)})).attr("y",(function(e){let t=G(e.source),r=G(e.target);return e.y=.5*(t+r)})).attr("transform",(function(e){return"rotate("+function(e,t){const r={x:U(e.source),y:G(e.source)},n={x:U(e.target),y:G(e.target)};if(t)return 180*Math.atan2(n.y-r.y,n.x-r.x)/Math.PI;{const e=180*Math.atan2(n.y-r.y,n.x-r.x)/Math.PI;return e<=90&&e>=-90?e:(e>0?-1:1)*(180-Math.abs(e))}}(e,e.direction)+", "+e.x+", "+e.y+")"})),h.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})),T.attr("x",(function(e){return e.x-1.75*e.size})).attr("y",(function(e){return e.y-3*e.fontSize/2})),d3.select(".pinned").attr("x",(function(e){return e.x})).attr("y",(function(e){return e.y})),xe()})),angular.isDefined(ye)&&ye.setLoadingState(!1),e.loading&&(e.loading=!1),d3.selectAll(".link-wrapper").each((function(){const e=$(this).attr("id").split(">")[0],t=$(this).attr("id").split(">")[1];d3.selectAll(".link").each((function(r){const n=Object(s.removeSpecialChars)(r.source.iri),a=Object(s.removeSpecialChars)(r.target.iri);if(n===t&&a===e){let e=n;e+=">",e+=a;const t=document.createTextNode(" ⟶");document.getElementById(e).lastChild.appendChild(t),r.direction="double"}}))})),d3.selectAll(".d3-actions-tip").remove(),he.alpha(.3).restart()}function xe(){t.d3alpha=he.alpha()}const Se=new function(){function r(e,t){return"translate("+(t.x-14+(t.size+15)*Math.cos(e*Math.PI/180-Math.PI/2))+","+(t.y-14+(t.size+15)*Math.sin(e*Math.PI/180-Math.PI/2))+")"}this.closeIcon=void 0,this.expandIcon=void 0,this.collapseIcon=void 0,this.focusIcon=void 0,this.copyURIIcon=void 0,this.actionsTip=void 0,this.removeIcons=function(){this.closeIcon.remove("g"),this.expandIcon&&this.expandIcon.remove("g"),this.collapseIcon&&this.collapseIcon.remove("g"),this.focusIcon.remove("g"),this.copyURIIcon.remove("g"),this.closeIcon=void 0,this.expandIcon=void 0,this.collapseIcon=void 0,this.focusIcon=void 0,this.copyURIIcon=void 0,this.expandedState=!1},this.expandedState=!1,this.initIcons=function(n,i){const s=Object(a.a)().attr("class","d3-tip d3-actions-tip").customPosition((function(e,t){const r=t.target.getBoundingClientRect();return{top:r.top-20+"px",left:r.right+10+"px"}})).html((function(e){return e}));fe.call(s);n.isExpanded?(this.collapseIcon=d3.select(".menu-events").append("g").attr("class","collapse-icon").attr("name","collapse").attr("transform",(function(){return r(20,n)})),this.collapseIcon.append("circle").attr("cx",14).attr("cy",14).attr("r",13).style("fill","#eee"),this.collapseIcon.append("path").attr("d","M22.67,12a.59.59,0,0,1-.53.65l-6.88.72H15.2a.59.59,0,0,1-.59-.65l.72-6.88A.58.58,0,0,1,16,5.33a.59.59,0,0,1,.53.65L16,11.11,21.3,5.79a.64.64,0,0,1,.91.91L16.89,12,22,11.49A.59.59,0,0,1,22.67,12ZM12.59,14.75l-6.75.85a.59.59,0,0,0-.51.66.58.58,0,0,0,.66.51l4.95-.62-5.2,5.2a.64.64,0,1,0,.91.91l5.2-5.2L11.23,22a.59.59,0,0,0,.51.66h.07a.59.59,0,0,0,.59-.52l.85-6.75a.59.59,0,0,0-.17-.49A.58.58,0,0,0,12.59,14.75Z").style("fill","var(--primary-color)"),this.collapseIcon.on("click",(function(){var e;(e=n).isExpanded=!1,se.removeNodeLeafLinks(e),ve()})).on("mouseover",(function(e){s.show(this.getAttribute("name"),e),l.cancel(ge),l.cancel(me)})).on("mouseout",(function(){s.hide(),me=l((function(){Ie()}),500)}))):(this.expandIcon=d3.select(".menu-events").append("g").attr("class","expand-icon").attr("name","expand").attr("transform",(function(){return r(20,n)})),this.expandIcon.append("circle").attr("cx",14).attr("cy",14).attr("r",13).style("fill","#eee"),this.expandIcon.append("path").attr("d","M22.37,6.28l-.72,6.88a.59.59,0,0,1-.59.53H21a.59.59,0,0,1-.53-.65L21,7.9l-5.32,5.32a.64.64,0,0,1-.91-.91L20.1,7,15,7.53a.59.59,0,0,1-.12-1.18l6.88-.72a.59.59,0,0,1,.65.65ZM12.89,20.34,7.95,21l5.2-5.2a.64.64,0,0,0-.91-.91L7,20.05l.62-4.95A.59.59,0,0,0,6.48,15l-.85,6.75a.59.59,0,0,0,.59.67h.07L13,21.52a.59.59,0,1,0-.15-1.18Z").style("fill","var(--primary-color)"),this.expandIcon.on("click",(function(){Re(n,!1,i)})).on("mouseover",(function(e){s.show(this.getAttribute("name"),e),l.cancel(me),l.cancel(ge)})).on("mouseout",(function(){s.hide(),me=l((function(){Ie()}),500)}))),this.focusIcon=d3.select(".menu-events").append("g").attr("class","focus-icon").attr("name","focus").attr("transform",(function(){return r(20,n)})),this.focusIcon.append("circle").attr("cx",14).attr("cy",14).attr("r",13).style("fill","#eee"),this.focusIcon.append("path").attr("d","M14.2,23.81a9.8,9.8,0,1,1,6.93-2.87h0A9.74,9.74,0,0,1,14.2,23.81Zm0-18.17a8.37,8.37,0,1,0,5.92,14.29h0A8.37,8.37,0,0,0,14.2,5.64Zm1.42,6.95a2,2,0,1,0,0,2.85A2,2,0,0,0,15.62,12.59Z").style("fill","var(--primary-color)"),this.focusIcon.on("click",(function(){t.$broadcast("onRootNodeChange",n.iri)})).on("mouseover",(function(e){s.show(this.getAttribute("name"),e),l.cancel(me),l.cancel(ge)})).on("mouseout",(function(){s.hide(),me=l((function(){Ie()}),500)})),this.copyURIIcon=d3.select(".menu-events").append("g").attr("class","icon-link").attr("name","link").attr("transform",(function(){return r(20,n)})),this.copyURIIcon.append("circle").attr("cx",14).attr("cy",14).attr("r",13).style("fill","#eee"),this.copyURIIcon.append("path").attr("d","M 13.457031 10.164062 C 13.648438 10.164062 13.820312 10.242188 13.941406 10.363281 L 15.492188 11.859375 C 15.984375 12.332031 16.292969 12.992188 16.292969 13.714844 C 16.292969 14.441406 15.984375 15.097656 15.492188 15.574219 L 10.394531 20.496094 C 9.902344 20.972656 9.222656 21.265625 8.472656 21.265625 C 7.71875 21.265625 7.039062 20.972656 6.546875 20.496094 L 4.996094 19 C 4.507812 18.523438 4.203125 17.867188 4.203125 17.144531 C 4.203125 16.421875 4.507812 15.765625 4.996094 15.289062 L 7.542969 12.824219 C 7.667969 12.707031 7.84375 12.628906 8.035156 12.628906 C 8.417969 12.628906 8.726562 12.929688 8.726562 13.300781 C 8.726562 13.484375 8.648438 13.652344 8.523438 13.773438 L 5.976562 16.234375 C 5.738281 16.46875 5.589844 16.792969 5.589844 17.148438 C 5.589844 17.503906 5.738281 17.824219 5.976562 18.058594 L 7.527344 19.566406 C 7.773438 19.792969 8.105469 19.929688 8.472656 19.929688 C 8.835938 19.929688 9.167969 19.792969 9.414062 19.566406 L 14.511719 14.644531 C 14.753906 14.410156 14.90625 14.089844 14.90625 13.730469 C 14.90625 13.375 14.753906 13.054688 14.511719 12.820312 L 12.964844 11.324219 C 12.839844 11.203125 12.761719 11.039062 12.761719 10.855469 C 12.761719 10.488281 13.070312 10.1875 13.449219 10.1875 Z M 17.082031 3.976562 C 17.082031 3.976562 17.085938 3.976562 17.085938 3.976562 C 17.824219 3.976562 18.492188 4.261719 18.980469 4.722656 L 20.535156 6.203125 C 21.042969 6.679688 21.355469 7.34375 21.355469 8.082031 C 21.355469 8.792969 21.058594 9.441406 20.582031 9.914062 L 18.0625 12.402344 C 17.9375 12.527344 17.761719 12.605469 17.566406 12.605469 C 17.183594 12.605469 16.875 12.304688 16.875 11.9375 C 16.875 11.753906 16.949219 11.589844 17.070312 11.46875 L 19.605469 8.984375 C 19.847656 8.75 19.996094 8.429688 19.996094 8.070312 C 19.996094 7.714844 19.847656 7.394531 19.605469 7.160156 L 18.019531 5.667969 C 17.773438 5.445312 17.4375 5.304688 17.070312 5.300781 C 16.703125 5.304688 16.367188 5.453125 16.128906 5.691406 L 11.085938 10.667969 C 10.84375 10.898438 10.695312 11.222656 10.695312 11.578125 C 10.695312 11.933594 10.84375 12.257812 11.085938 12.488281 L 12.675781 13.980469 C 12.804688 14.101562 12.882812 14.273438 12.882812 14.457031 C 12.882812 14.828125 12.574219 15.128906 12.191406 15.128906 C 12.003906 15.128906 11.832031 15.054688 11.707031 14.9375 L 10.140625 13.457031 C 9.636719 12.980469 9.324219 12.316406 9.324219 11.582031 C 9.324219 10.863281 9.621094 10.214844 10.101562 9.742188 L 15.140625 4.765625 C 15.625 4.285156 16.304688 3.980469 17.054688 3.976562 Z M 17.082031 3.976562").style("fill","var(--primary-color)"),this.copyURIIcon.on("click",(function(){e.copyToClipboard(n.iri),Ie(),s.hide()})).on("mouseover",(function(e){s.show("<div style='text-align: center;'><b>Copy to ClipBoard</b><br>"+n.iri+"</div>",e),l.cancel(me),l.cancel(ge)})).on("mouseout",(function(){s.hide(),me=l((function(){Ie()}),500)})),this.closeIcon=d3.select(".menu-events").append("g").attr("class","close-icon").attr("name","remove").attr("transform",(function(){return r(20,n)})),this.closeIcon.append("circle").attr("cx",14).attr("cy",14).attr("r",13).style("fill","#eee"),this.closeIcon.append("path").attr("d","M14.94,14l5.87-5.87a.66.66,0,1,0-.94-.94L14,13.06,8.13,7.19a.66.66,0,0,0-.94.94L13.06,14,7.19,19.87a.66.66,0,1,0,.94.94L14,14.94l5.87,5.87a.66.66,0,1,0,.94-.94Z").style("fill","var(--primary-color)"),this.closeIcon.on("click",(function(){be(n)})).on("mouseover",(function(e){s.show(this.getAttribute("name"),e),l.cancel(me),l.cancel(ge)})).on("mouseout",(function(){s.hide(),me=l((function(){Ie()}),500)})),this.animateMenu(n)},this.animateMenu=function(e){const t=d3.easeSin;let n=0;let a=20;this.expandIcon&&this.expandIcon.transition().duration(100).style("opacity",1).ease(t).attr("transform",(function(){return r(a,e)})).delay(n+=35),this.collapseIcon&&this.collapseIcon.transition().duration(100).style("opacity",1).ease(t).attr("transform",(function(){return r(a,e)})).delay(n+=35),this.copyURIIcon.transition().duration(100).style("opacity",1).ease(t).attr("transform",(function(){return a+=30,r(a,e)})).delay(n+=35),this.focusIcon.transition().duration(100).style("opacity",1).ease(t).attr("transform",(function(){return a+=30,r(a,e)})).delay(n+=35),this.closeIcon.transition().duration(100).style("opacity",1).ease(t).attr("transform",(function(){return a+=30,r(a,e)})).delay(n+=35),this.expandedState=!0}};function Ce(r,n,a){return e.showInfoPanel=!1,e.showPredicates=!1,e.showNodeInfo=!1,a.shiftKey&&(a.ctrlKey||a.metaKey)?(t.$broadcast("onRootNodeChange",r.iri),!1):a.ctrlKey||a.metaKey?(be(r),!1):void 0!==e.openedNodeInfoPanel&&e.openedNodeInfoPanel===r?(e.pageslideExpanded=!1,e.openedNodeInfoPanel=void 0,!1):(_e(r),!0)}function be(e){se.removeNode(e),ve()}function we(t){!function(t){e.nodeSelected=!0,null===t.data.types&&(t.data.types="greyColor"),se=new ie,ee=Z}(t),Ee(t)}function Ee(t,r,n){let a=t.data;a=_.filter(a,(function(e){return-1===_.findIndex(se.links,(function(t){return e.source===t.source.iri&&e.target===t.target.iri}))}));const i=[],s=se.tripleLinksCopy.values();for(let e=0;e<se.tripleLinksCopy.size;e++){s.next().value.forEach(e=>{i.push(e)})}a=_.filter(a,(function(e){return-1===_.findIndex(i,(function(t){return e.source===t.source.iri&&e.target===t.target.iri}))})),a=_.filter(a,(function(e){return e.source!==e.target}));const o=((e,t)=>{const r=t.map(t=>t[e]);return t.filter((t,n)=>r.indexOf(t[e])===n)})("iri",_.union(_.flatten(_.map(t.data,(function(e){return[{iri:e.source,isTriple:e.isTripleSource},{iri:e.target,isTriple:e.isTripleTarget}]}))))),l=_.map(se.nodes,(function(e){return{iri:e.iri,isTriple:Boolean(e.isTriple)}})),u=se.tripleNodes.values();for(let e=0;e<se.tripleNodes.size;e++){u.next().value.forEach(e=>{l.push({iri:e.iri,isTriple:e.isTriple})})}const d=_.reject(o,(function(e){return _.some(l,e)}));if(0===d.length)(n||0===a.length)&&c.info(R.instant("graphexplore.error.node.connections")),se.addAndMatchLinks(a),ve();else{const t=[],n=[],i=k();_.forEach(d,(function(r,a){t.push(w.getInstanceNode({iri:r.isTriple?q(r.iri):r.iri,config:e.configLoaded.id,languages:e.shouldShowSettings()?i.languages:[],includeInferred:i.includeInferred,sameAsState:i.sameAsState}).then((function(e){n[a]=e.data})))})),p.all(t).then((function(){_.forEach(n,(function(e,t){const a=2*Math.PI*t/n.length,i=(r?r.x:0)+Math.cos(a)*re/3,s=(r?r.y:0)+Math.sin(a)*re/3;e.isTriple?se.addTriple(e,i,s):se.addNode(e,i,s)})),se.addAndMatchLinks(a),r&&(r.isExpanded=!0),ve()}))}}function Re(t,r,n){if(ye.getLoadingState())return;ye.init(t,n);const a=k(),i=t.iri;w.getInstanceNodeLinks({iri:i,linksLimit:a.linksLimit,includeInferred:a.includeInferred,config:e.configLoaded.id,preferredTypes:e.shouldShowSettings()?a.preferredTypes:[],rejectedTypes:e.shouldShowSettings()?a.rejectedTypes:[],preferredPredicates:e.shouldShowSettings()?a.preferredPredicates:[],rejectedPredicates:e.shouldShowSettings()?a.rejectedPredicates:[],preferredTypesOnly:e.shouldShowSettings()?a.preferredTypesOnly:[],preferredPredicatesOnly:e.shouldShowSettings()?a.preferredPredicatesOnly:[],languages:e.shouldShowSettings()?a.languages:[],sameAsState:a.sameAsState,includeSchema:a.includeSchema}).then((function(e){Ee(e,t,r)}),(function(t){const r=getError(t.data);c.error(r,R.instant("graphexplore.error.exploring.node")),e.loading=!1,ye.setLoadingState(!1)}))}function Ie(){angular.isDefined(Se)&&Se.expandedState&&Se.removeIcons()}function _e(t){he.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(q(t.iri)):encodeURIComponent(t.iri),e.showInfoPanel=!0,e.rdfsLabel=t.labels[0].label,e.rdfsComment=t.comment,e.expanded=!1,e.propertiesQueryObj.query="",e.dataNodeKeysQuery="";const r=k();w.getProperties({iri:t.isTriple?q(t.iri):t.iri,config:e.configLoaded.id,languages:e.shouldShowSettings()?r.languages:[],includeInferred:r.includeInferred,sameAsState:r.sameAsState,rejectedPredicates:e.shouldShowSettings()?r.rejectedPredicates:[]}).then((function(t){e.data=_.mapKeys(t.data,(function(t,r){return e.replaceIRIWithPrefix(r)})),e.propertiesObj.items=[],_.forEach(e.data,(function(t,r){e.propertiesObj.items.push({key:r,value:t})})),e.nodeImage=void 0,e.propertiesNotFiltered=e.propertiesObj.items;const r=_.find(e.propertiesObj.items,(function(e){return"image"===e.key}));r&&(e.nodeImage=r.value[0].v),e.propertiesObj.items=_.reject(e.propertiesObj.items,(function(e){return"image"===e.key})),e.propertiesNotFiltered=e.propertiesObj.items}),(function(e){c.warning(getError(e.data),"Error")}))}function Te(e){Ae("predicate","var(--primary-color-dark)",e),Ae("predicates","var(--primary-color-dark)",e);const t=document.getElementsByClassName("link");t&&_.each(t,(function(t){const r=t.__data__;(r.source.iri.indexOf(e.iri)>=0||r.target.iri.indexOf(e.iri)>=0)&&(t.style.stroke="var(--primary-color-dark)",t.style.strokeWidth=4)}));const r=document.getElementsByClassName("arrow-marker");r&&_.each(r,(function(t){const r=t.__data__;(r.source.iri.indexOf(e.iri)>=0||r.target.iri.indexOf(e.iri)>=0)&&(t.style.stroke="var(--primary-color-dark)",t.__data__.target.isTriple||t.setAttribute("refX","23"))}))}function Ae(e,t,r){const n=document.getElementsByClassName(e);n&&_.each(n,(function(e){const n=e.__data__;r?((n.source.iri.indexOf(r.iri)>=0||n.target.iri.indexOf(r.iri)>=0)&&(e.style.fill=t),M(r.iri)===j(n)&&(e.textContent=r.pred,e.style.fill=t),r.oppLinkIRI&&r.oppLinkIRI===j(n)&&(e.textContent=r.oppTriplePred,e.style.fill=t)):(e.style.fill=t,e.textContent=Ne(n))}))}function Le(){_.each(e.predicates,(function(e){const t=document.getElementById(e.linkId+e.nodeIndex);t&&(t.style.fontWeight="normal")}));const t=document.getElementsByClassName("link");t&&_.each(t,(function(e){e.style.stroke="#999",e.style.strokeWidth=1})),Ae("predicate",""),Ae("predicates","");const r=document.getElementsByClassName("arrow-marker");r&&_.each(r,(function(e){e.style.stroke="#999",e.__data__.target.isTriple||e.setAttribute("refX","59")}))}function ke(e){const t=M(e);if(se.tripleNodes.has(t))return se.tripleNodes.get(t).find(t=>t.iri===e)}function Ne(e){return e.predicates.length>1?e.predicates.length+" predicates":Oe(e.predicates[0])}function Oe(t){const r=e.replaceIRIWithPrefix(t);return r.length===t.length?t.split("/")[t.split("/").length-1]:r}e.toggleSidePanel=function(){e.pageslideExpanded=!e.pageslideExpanded},e.closeInfoPanel=function(){e.pageslideExpanded=!1,e.openedNodeInfoPanel=void 0,e.predicates=[],ae=null,l((function(){e.showInfoPanel=!1}))},e.clickLink=function(t){if(se.tripleNodes.has(t.linkId)){Le();const r=se.tripleNodes.get(t.linkId)[t.nodeIndex];_e(r),e.showPredicates=!0;const n=document.getElementById(t.linkId+t.nodeIndex);n&&(n.style.fontWeight="bold");const a={},i=se.tripleLinksCopy.values();for(let e=0;e<se.tripleLinksCopy.size;e++){const e=i.next().value;e.length>1&&e.every(t=>t.source.iri===r.iri?(a.iri=e[0].source.iri,t.target.isTriple&&(a.oppLinkIRI=M(t.target.iri),a.oppTriplePred=Oe(t.target.iri.split(" ")[1])),a.pred=Oe(r.iri.split(" ")[1]),1===t.predicates.length&&(a.linkPred=t.predicates[0]),!1):t.target.iri!==r.iri||(a.iri=e[0].target.iri,t.source.isTriple&&(a.oppLinkIRI=M(t.source.iri),a.oppTriplePred=Oe(t.source.iri.split(" ")[1])),a.pred=Oe(r.iri.split(" ")[1]),1===t.predicates.length&&(a.linkPred=t.predicates[0]),!1))}a.iri||(a.iri=r.iri,a.pred=Oe(r.iri.split(" ")[1])),Te(a)}},e.splitPredicate=function(e){return e.split("/")[e.split("/").length-1]},e.getActiveRepository=function(){return r.getActiveRepository()},e.isLoadingLocation=function(){return r.isLoadingLocation()},e.hasActiveLocation=function(){return r.hasActiveLocation()},e.rotate=function(e){Ie();const t=10*(e?1:-1)*Math.PI/180,r=Math.cos(t),n=Math.sin(t),a=te/2,i=re/2;d3.selectAll(".node-wrapper").each((function(e){e.x=a+(r*(e.x-a)+n*(e.y-i)),e.y=i+(-n*(e.x-a)+r*(e.y-i)),e.fixed&&(e.fx=e.x,e.fy=e.y)})),he.alpha(1).restart()},e.openUri=function(t,r){if(!r){const r={};e.configLoaded.id!==e.defaultGraphConfig.id&&(r.config=e.configLoaded.id),r.uri=t,A(r,{uri:t,config:e.configLoaded})}e.$broadcast("onRootNodeChange",t)},e.saveOrUpdateGraph=function(){const t=JSON.stringify(se.copyState()),r={id:e.lastSavedGraphId,name:e.lastSavedGraphName,data:t,shared:e.shared};r.id?e.saveGraphModal("update",r):e.saveGraphModal("new",r)},e.renameSavedGraph=function(t){e.saveGraphModal("rename",{id:t.id,name:t.name,config:t.config,shared:t.shared})};const Pe=function(t){C.editSavedGraph(t).success((function(){e.lastSavedGraphName=t.name,e.shared=t.shared,e.refreshSavedGraphs(),c.success(R.instant("graphexplore.saved.graph.was.edited",{name:t.name}))})).error((function(e){const t=getError(e);c.error(t,R.instant("graphexplore.error.cannot.edit"))}))};e.saveGraphModal=function(t,r,n){y.open({templateUrl:"js/angular/graphexplore/templates/modal/save-graph.html",controller:"SaveGraphModalCtrl",resolve:{data:function(){return{mode:t,graph:r,graphExists:n,shared:r.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),C.addNewSavedGraph(t).success((function(r,n,a){e.lastSavedGraphName=t.name,e.lastSavedGraphId=a()["x-saved-graph-id"],e.shared=t.shared,e.refreshSavedGraphs(),c.success(R.instant("graphexplore.saved.graph",{name:t.name}))})).error((function(r,n){if(422===n)e.saveGraphModal("new",t,!0);else{const e=getError(r);c.error(e,R.instant("graphexplore.error.cannot.create.graph"))}}))}(t.graph);break;case"update":case"rename":Pe(t.graph)}}))},e.refreshSavedGraphs=function(){C.getSavedGraphs().success((function(t){e.savedGraphs=t})).error((function(e){const t=getError(e);c.error(t,R.instant("graphexplore.error.getting.saved.graphs"))}))},e.loadSavedGraph=function(t,r){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),h.url("?saved="+t.id),se.restoreState(JSON.parse(t.data)),r||A({saved:t.id},{savedGraph:t})},e.copyToClipboardSavedGraph=function(t){const r=[location.protocol,"//",location.host,location.pathname,"?saved=",t.id].join("");e.copyToClipboard(r)},e.deleteSavedGraph=function(t){m.openSimpleModal({title:R.instant("common.confirm"),message:R.instant("graphexplore.confirm.delete.graph",{graphName:t.name}),warning:!0}).result.then((function(){!function(t){C.deleteSavedGraph(t).success((function(){e.refreshSavedGraphs(),c.success(R.instant("graphexplore.saved.graph.was.deleted",{name:t.name}))})).error((function(e){const t=getError(e);c.error(t,R.instant("graphexplore.error.cannot.delete"))}))}(t)}))},e.openIRI=function(t,r){return r.shiftKey?e.$broadcast("onRootNodeChange",t):window.open(t,"_blank"),!1},e.togglePinAllNodes=function(){Ie();const t=angular.isUndefined(e.numberOfPinnedNodes)||e.numberOfPinnedNodes<=0;e.numberOfPinnedNodes=0,d3.selectAll(".node").each((function(r){r.fixed=t,t?(e.numberOfPinnedNodes++,r.fx=r.x,r.fy=r.y):(r.fx=null,r.fy=null)})),he.alpha(1).restart()},$("body").on("keydown",(function(t){!I.isActive()&&"input"!==t.target.nodeName&&e.nodeSelected&&(37===t.keyCode?e.rotate(!0):39===t.keyCode&&e.rotate(!1))})),e.getLiteralFromPropValue=function(e){return e.substring(e.indexOf(":")+1)}}function c(e,t,r,n){switch(e.mode=r.mode,e.graph=_.cloneDeep(r.graph),e.graphExists=r.graphExists,e.mode){case"new":e.title=n.instant("graphexplore.create.new.graph"),e.okButtonText=n.instant("common.create.btn");break;case"update":e.title=n.instant("graphexplore.update"),e.okButtonText=n.instant("common.save.btn");break;case"rename":e.title=n.instant("graphexplore.rename"),e.okButtonText=n.instant("common.save.btn")}e.ok=function(){e.form.$valid&&t.close({graph:e.graph,mode:e.mode})},e.saveNew=function(){e.graph.name=e.graph.name+" (new)",t.close({graph:e.graph,mode:"new",restart:!0})},e.cancel=function(){t.dismiss("cancel")}}angular.module("graphdb.framework.graphexplore.controllers.graphviz",["ui.scroll.jqlite","ui.scroll","toastr","ui.bootstrap","ngTagsInput","graphdb.framework.utils.localstorageadapter"]).controller("GraphsVisualizationsCtrl",o).controller("SaveGraphModalCtrl",c).config(["$uibTooltipProvider",function(e){e.options({appendToBody:!0})}]),o.$inject=["$scope","$rootScope","$repositories","$licenseService","toastr","$timeout","ClassInstanceDetailsService","AutocompleteRestService","$q","$location","$jwtAuth","UiScrollService","ModalService","$uibModal","$window","LocalStorageAdapter","LSKeys","SavedGraphsRestService","GraphConfigRestService","GraphDataRestService","RDF4JRepositoriesRestService","$translate","GuidesService"],c.$inject=["$scope","$uibModalInstance","data","$translate"]},158:function(e,t,r){"use strict";r.r(t);r(64),r(10);var n=r(62),a=r(61),i=r(14),s=r(73),o=r(93);function c(e,t,r,c,l,u,d,p,h,f,g,m,y,v,x,S){let C;e.newConfig=new s.GraphsConfig,e.revertConfig=void 0,e.page=1,e.totalPages=5,e.helpHidden=1===y.get(v.HIDE_GRAPH_CONFIG_HELP),e.isUpdate=!1,e.shared=!1,e.canEditActiveRepo=e.canWriteActiveRepo(),e.samples=[],e.tabConfig={inference:e.newConfig.startQueryIncludeInferred,sameAs:e.newConfig.startQuerySameAs},e.getAutocompletePromise=void 0,e.getNamespacesPromise=void 0,e.tabsViewModel=[{page:1,label:x.instant("starting.point.label"),type:"startGraphQuery"},{page:2,label:x.instant("graph.expansion"),type:"expandQuery"},{page:3,label:x.instant("node.basics"),type:"resourceQuery"},{page:4,label:x.instant("edge.basics"),type:"predicateLabelQuery"},{page:5,label:x.instant("node.extra"),type:"resourcePropertiesQuery"}];const b=f.configName,w=l.getActiveRepository();e.toggleHelp=t=>{void 0===t&&(t=y.get(v.HIDE_GRAPH_CONFIG_HELP)),1!==t?(y.set(v.HIDE_GRAPH_CONFIG_HELP,1),e.helpHidden=!0):(y.set(v.HIDE_GRAPH_CONFIG_HELP,0),e.helpHidden=!1)},e.fixedVisualCallback=(t,r)=>{e.newConfig.startIRI=t,e.newConfig.startIRILabel=r,C=!0},e.isDefaultGraph=e=>e.isDefaultGraph(),e.isUserGraph=e=>!e.isDefaultGraph(),e.getSampleName=(e,t)=>{if(!e)return"";const r=e.getPropertyDescription(t);return r||(e.id?"Copy of "+e.name:e.name)},e.createGraphConfig=e=>{p.createGraphConfig(e).success((async function(){await g.showToastMessageWithDelay("graphexplore.saved.new.config"),r.url("graphs-visualizations")})).error((function(e){c.error(getError(e),x.instant("graphexplore.error.could.not.create"))}))},e.updateGraphConfig=e=>{p.updateGraphConfig(e).success((async function(){await g.showToastMessageWithDelay("graphexplore.saved.config"),r.url("graphs-visualizations")})).error((function(e){c.error(getError(e),x.instant("graphexplore.error.could.not.save"))}))},e.goToPage=t=>{e.page!==t&&L(()=>{e.showEditor(),e.page=t})},e.goToPreviousPage=()=>{e.page>1&&e.goToPage(e.page-1),Q()&&(C=!1)},e.goToNextPage=()=>{D(),e.newConfig.isStartMode(s.StartMode.NODE)&&!C||e.goToPage(e.page+1)},e.saveGraphConfig=()=>{D(),Q()&&!C||(e.newConfig.startQueryIncludeInferred=e.tabConfig.inference,e.newConfig.startQuerySameAs=e.tabConfig.sameAs,L(()=>{e.newConfig.name?(e.queryEditorIsDirty=!1,e.isUpdate?e.updateGraphConfig(e.newConfig.toSavePayload()):e.createGraphConfig(e.newConfig.toSavePayload())):N(x.instant("graphexplore.provide.config.name"))}))},e.setQuery=async t=>{const r=t||" ";(await E()).setQuery(r),e.markDirty()},e.markDirty=async()=>{if(e.revertConfig){const t=e.revertConfig.getQueryType(e.page),r=await T();e.queryEditorIsDirty=t!==r}},e.showEditor=()=>{e.viewMode="yasr",A(),_()},e.showPreview=()=>{e.viewMode="editor",R()},e.revertEditor=()=>{e.setQuery(e.revertConfig.getQueryType(e.page)),e.queryEditorIsDirty=!1};const E=()=>i.YasguiComponentDirectiveUtil.getOntotextYasguiElementAsync("#query-editor"),R=async(t,r)=>{const n=await E(),a=await n.getQueryType();if(r&&"SELECT"!==a&&"CONSTRUCT"!==a&&"DESCRIBE"!==a)return void c.warning(x.instant("query.editor.warning.msg"));"update"!==await n.getQueryMode()?e.queryIsRunning||(e.viewMode="editor",I()):c.warning(x.instant("cannot.execute.update.error"))},I=async()=>{(await E()).query(a.RenderingMode.YASR)},_=async()=>(await E()).changeRenderMode(a.RenderingMode.YASQE),T=async()=>(await E()).getQuery(),A=async()=>(await E()).abortQuery(),L=async t=>{const r=await(async()=>{const t=await E();let r=await t.getQuery();return r=r.trim(),e.newConfig.updateModel(r,e.page)})();1===e.page?r.isStartMode(s.StartMode.NODE)&&!r.startIRI?N(x.instant("graphexplore.select.start.node")):r.isStartMode(s.StartMode.QUERY)&&!r.startGraphQuery?N(x.instant("graphexplore.provide.query")):r.isStartMode(s.StartMode.QUERY)?P(t,r.startGraphQuery,"graph"):t():2===e.page?P(t,r.expandQuery,"construct",["node"]):3===e.page?P(t,r.resourceQuery,"tuple",["node"],[],["type","label","comment","rank"]):4===e.page?P(t,r.predicateLabelQuery,"tuple",["edge"],["label"]):5===e.page&&P(t,r.resourcePropertiesQuery,"tuple",["node"],["property","value"])},k=()=>{e.tabConfig.inference=e.newConfig.startQueryIncludeInferred,e.tabConfig.sameAs=e.newConfig.startQuerySameAs,e.setQuery(e.newConfig.getQueryType(e.page))},N=e=>{c.warning(e)},O=()=>{e.getAutocompletePromise=h.checkAutocompleteStatus()},P=(e,t,r,n,a,i)=>{t?p.validateQuery(t,r,n,a,i).success(()=>{e()}).error(e=>{N(getError(e))}):e()},D=()=>{Q()&&e.$broadcast("addStartFixedNodeAutomatically",{startIRI:e.newConfig.startIRI})},Q=()=>1===e.page&&e.newConfig.isStartMode(s.StartMode.NODE),M=()=>{p.getGraphConfigSamples().success((function(t){e.samples=Object(o.mapGraphConfigSamplesToGraphConfigs)(t).filter(t=>!t.id||e.newConfig.id!==t.id||(e.revertConfig=t,!1))})).error((function(e){c.error(getError(e),x.instant("graphexplore.error.graph.configs"))})),O(),e.getNamespacesPromise=m.getNamespaces(e.getActiveRepository())},$={endpoint:()=>"/repositories/"+l.getActiveRepository(),showEditorTabs:!1,showToolbar:!1,showResultTabs:!1,showYasqeActionButtons:!1,yasqeActionButtons:i.INFERRED_AND_SAME_AS_BUTTONS_CONFIGURATION,showQueryButton:!1,initialQuery:" ",componentId:"graphs-config",render:a.RenderingMode.YASQE,maxPersistentResponseSize:0,yasqeMode:n.YasqeMode.PROTECTED,infer:e.newConfig.startQueryIncludeInferred,sameAs:e.newConfig.startQuerySameAs},j=(t,r,n)=>{e.queryIsRunning=t},U=()=>{window.removeEventListener("beforeunload",G),q.forEach(e=>e())},G=t=>{e.queryEditorIsDirty&&(t.returnValue=!0)},q=[];q.push(e.$on("autocompleteStatus",O)),q.push(e.$on("$locationChangeStart",(t,n)=>{if(e.queryEditorIsDirty){t.preventDefault();((e,t,r,n)=>{S.openSimpleModal({title:e,message:t,warning:!0}).result.then((function(){angular.isFunction(r)&&r()}),(function(){angular.isFunction(n)&&n()}))})(x.instant("common.confirm"),x.instant("visual.config.warning.unsaved.changes"),()=>{U();const e=r.absUrl().length-r.url().length,t=n.substring(e);r.path(t)})}else U()})),q.push(e.$on("$destroy",U)),q.push(e.$watch(e.getActiveRepositoryObject,()=>{(e.newConfig.isStartMode(s.StartMode.QUERY)||e.page>1)&&(e.viewMode="yasr",A().then(_))})),window.addEventListener("beforeunload",G),e.$watch("newConfig.startMode",e=>{e===s.StartMode.QUERY&&k()}),e.$watch("page",t=>{(e.newConfig.isStartMode(s.StartMode.QUERY)||t>1)&&(e.showEditor(),k())}),l.getPrefixes(w).then(t=>(t=>{const r=e.$watch((function(){return e.getActiveRepositoryObject()}),(function(a){if(a){e.canEditActiveRepo=e.canWriteActiveRepo();const a=angular.extend({},$,{prefixes:t,yasqeMode:e.canWriteActiveRepo()?n.YasqeMode.WRITE:n.YasqeMode.PROTECTED});e.yasguiConfig=a,r()}}))})(t)).finally(()=>j(!1)),b?(e.isUpdate=!0,p.getConfig(b).then((function(t){e.newConfig=t,M()})).catch(e=>{c.error(getError(e),x.instant("created.connector",{name:b}))})):(e.isUpdate=!1,M()),e.getActiveRepository()&&(j(!0,x.instant("common.refreshing.namespaces"),x.instant("common.extra.message")),l.getPrefixes(l.getActiveRepository()).then(t=>{e.namespaces=t}).catch((function(t){e.repositoryError=getError(t)})).finally((function(){j(!1)})))}angular.module("graphdb.framework.graphexplore.controllers.graphviz.config",["graphdb.framework.utils.notifications","graphdb.framework.utils.localstorageadapter"]).controller("GraphConfigCtrl",c),c.$inject=["$scope","$timeout","$location","toastr","$repositories","SparqlRestService","$filter","GraphConfigRestService","AutocompleteRestService","$routeParams","Notifications","RDF4JRepositoriesRestService","LocalStorageAdapter","LSKeys","$translate","ModalService"]},159:function(e,t,r){"use strict";r.r(t);var n=r(402),a=r(432),i=r(400),s=r(401);r(10);function o(e,t,r,o,c,l,u,d,p,h,f,g,m){return{restrict:"AE",template:'<div id="classChart"></div>',scope:{classHierarchyData:"=",flattenedClassNames:"=",selectedClass:"=",currentSliderValue:"=",showClassInfoPanel:"=",showExternalElements:"=",hidePrefixes:"=",currentBrowserLimit:"="},link:function(u,y,v){!function(u,y){var v,x,S=d3.pack().size([780,780]),C=d3.scaleLinear().domain([0,4]).range(["hsl(19, 70%, 90%)","hsl(19, 70%, 50%)"]).interpolate(d3.interpolateHcl),b=d3.select("#classChart").insert("svg:svg","h2").attr("viewBox","0 0 800 800").attr("preserveAspectRatio","xMidYMid meet").on("dblclick.zoom",null);function w(){return b.append("svg:g").attrs({id:"main-group",transform:"translate(400,400)"})}function E(){return"true"===f.get(g.CLASS_HIERARCHY_HIDE_PREFIXES)}function R(){var e=s.a.Export.getCSSRules("css/rdf-class-hierarchy-labels.css?v=2.6.1-RC1");d3.selectAll("#main-group").append("defs"),$("defs").append('<style type="text/css"><![CDATA['+e+"]]></style>"),d3.selectAll("g").style("opacity",1);var t=s.a.Export.generateBase64ImageSource("#classChart svg");d3.select(this).attrs({href:t,download:"class-hierarchy-"+l.getActiveRepository()+".svg"})}u.hidePrefixes=E();var I,T,A=w();if(!u.classHierarchyData.classCount&&l.getActiveRepository()&&!l.isSystemRepository()){e.loader=!0,e.hierarchyError=!1;const t=f.get("classHierarchy-selectedGraph-"+l.getActiveRepository());r.getClassHierarchyData(null!==t?t.contextID.uri:"").success((function(t,r,n){e.loader=!1,207===r&&d.warning(m.instant("graphexplore.update.diagram"),m.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),d.error(m.instant("graphexplore.error.request.failed",{name:h,error:getError(t)}))}))}var L,k,N,O,P,D,Q,M={};function j(r,s,l,d){k&&k(),N&&N(),d3.selectAll("#main-group").remove(),A=w(),a.a.SingleChild.addPlaceholders(r,!0),(x=d3.hierarchy(r)).sum((function(e){return e.size})),L=l||x,S(x);var f,g=x.descendants();L.isInFocusTransitive=!0,a.a.SingleChild.removePlaceholders(g),a.a.SingleChild.centerNodes(g),a.a.SingleChild.makePositionsRelativeToZero(g),v||(v=Object(n.a)().attr("class","d3-tip").customPosition((function(e,t){return{top:"inherit",bottom:o.innerHeight-t.clientY+"px",right:o.innerWidth-t.clientX+"px"}})).html((function(e){return e.data.name})),b.call(v));var m=A.selectAll("circle").data(g).enter().append("g");s.doFade&&m.each((function(e){i.a.Transition.fadeIn(d3.select(this),550)}));var y,E=[],R=m.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!==h){var t=e.data.name;E.push({name:t}),M[[t]]=e,e.circle.classed("rdf-class",!0),e.circle.on("mouseover",(function(t){s.noPrefixes||e.textHidden?v.show(e,t):v.hide(e)})),e.circle.on("mouseout",v.hide)}})).on("gdb-focus",(e,t)=>T(t)).on("gdb-zoom",(e,t)=>H(t));function O(e){d3.selectAll(".selected").classed("selected",e.selected=!1),e.circle.classed("selected",e.selected=!0),y=e}function P(){u.showClassInfoPanel=!1}E&&(E=_.uniqBy(E,"name"),u.flattenedClassNames=E);var D=i.a.Click.delayDblClick();d3.selectAll(".parent, .topLevelParent, .child, .root").call(D),T=function(e){H(e),e.data.name===h?(P(),d3.selectAll(".selected").classed("selected",!1)):(O(e),u.selectedClass=y,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&&o.history.pushState({id:t.data.id},"classHierarchyPage"+t.data.id,"hierarchy#"+t.data.id),v.hide(),T(t)})),D.on("dblclick",(function(t,n){n!==r&&(v.hide(),O(n),e.$broadcast("goToDomainRangeGraphView",y,L),t.stopPropagation())}));var Q=0;b.on("wheel",(function(e){v.hide(),e.preventDefault(),e.stopPropagation();var t=(new Date).getTime();if(t-Q>100){Q=t;var r="";e.deltaY<=-1?r="in":e.deltaY>=1&&(r="out");var n=e.target.__data__;if(n||(n=L),"in"===r){if(n!==L){for(;n.parent&&!n.parent.isInFocusTransitive;)n=n.parent;n.depth<L.depth&&(n=L)}if(n===L&&n.children){for(var a=n.children[0],i=1;i<n.children.length;i++)n.children[i].sortingRank>a.sortingRank&&(a=n.children[i]);a.children&&(n=a)}else n.children||(n=n.parent);H(n,!0)}else"out"===r&&(n=L.parent)&&H(n,!0);L.data.name===h&&o.history.replaceState({id:1},"classHierarchyPage1","hierarchy#1"),U()}}));var $=A.selectAll("text").data(g).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)}));s.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===L.data?(e.textHidden=this.textContent.indexOf("...")+3===this.textContent.length,null):(e.textHidden=!0,"none")})),s.doFade&&!s.keepPrevState&&$.each((function(e){i.a.Transition.fadeIn(d3.select(this),550)})),I=function(){function e(e){e&&R.each((function(t){+e===t.data.id&&T(t)}))}var r=t.hash();o.onpopstate=function(t){t.state&&e(t.state.id)},e(r)};var j=A.selectAll("circle, text");function G(e,t){var r=800/e[2];f=e,j.attr("transform",(function(t){return"translate("+(t.x-e[0])*r+","+(t.y-e[1])*r+")"})),R.attr("r",(function(e){return e.r*r})),t&&$.each((function(e){e.data.fullName!==L.data.topLevelParentUri&&L.data.topLevelParentUri!==h||(e.textSel.style("display","none"),L.children&&L.children.length?_.each(L.children,(function(e){e.textSel.style("display","inline")})):L.textSel.style("display","inline"),L.parent&&_.each(L.parent.children,(function(e){e.data.name!==L.data.name&&e.textSel.style("display","inline")})))})),$.style("font-size",(function(e){return s.noPrefixes?i.a.Text.calcFontSize(e.noPrefixName,e.r*r):i.a.Text.calcFontSize(e.data.name,e.r*r)})).text((function(e){return s.noPrefixes?i.a.Text.getTextWithElipsisIfNeeded(e.noPrefixName,e.r*r/3):i.a.Text.getTextWithElipsisIfNeeded(e.data.name,e.r*r/3)}))}function q(e){var t=2*e+20;return 2*e/t<.3&&(t=2*e+2),t}function F(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 H(e,t){if(c((function(){u.showExternalElements=e.data.name===h})),L!==e&&(e.data.id&&o.history.replaceState({id:e.data.id},"classHierarchyPage"+e.data.id,"hierarchy#"+e.data.id),e.children||(e=e.parent,L!==e))){if(t&&(P(),d3.selectAll(".selected").classed("selected",!1)),L.parent)for(var r=L;r;)r.isInFocusTransitive=!1,r=r.parent;for(r=e;r;)r.isInFocusTransitive=!!r.children,r=r.parent;if(2*(L=e).r/(2*L.r+20)<.3||u.currentSliderValue>u.currentBrowserLimit)G([L.x,L.y,q(L.r)]),$.each((function(e){F.call(this,e)}));else d3.transition().duration(p).tween("zoom",(function(e){var t=d3.interpolateZoom(f,[L.x,L.y,q(L.r)]);return function(e){G(t(e))}})).selectAll("text").each(F)}}G([L.x,L.y,q(L.r)],d),k=u.$on("rootFocus",(function(){o.history.pushState({id:1},"classHierarchyPage1","hierarchy#1"),T(x)})),N=u.$on("classSearch",(function(e){T(e)}))}function U(){const t=u.classHierarchyData.classCount;let r=f.get(g.CLASS_HIERARCHY_CURRENT_SLIDER_VALUE);(!r||r>t)&&(r=t,f.set(g.CLASS_HIERARCHY_CURRENT_SLIDER_VALUE,r)),e.$broadcast("classCount",t,r)}window.addEventListener("resize",U),window.addEventListener("beforeunload",(function e(){window.removeEventListener("resize",U),window.removeEventListener("beforeunload",e)})),u.$watch("classHierarchyData",(function(){O&&O(),P&&P(),D&&D(),Q&&Q();var e=E();if(u.classHierarchyData.classCount){U();var t=_.cloneDeep(u.classHierarchyData);var r,n,a=function(e){return e.descendants().sort((function(e,t){return e.data.sortingRank>t.data.sortingRank?-1:e.data.sortingRank<t.data.sortingRank||e.data.depth>t.data.depth?1:e.data.depth<t.data.depth?-1:0}))}(d3.hierarchy(t));function i(e,t){const a={keepPrevState:!0,noPrefixes:E()};n=a.noPrefixes,j(r||e,a,L,!0),c((function(){f.set(g.CLASS_HIERARCHY_SWITCH_PREFIXES,t),I()}),70)}function s(e,a,s){if(!e)return;f.set(g.CLASS_HIERARCHY_CURRENT_SLIDER_VALUE,e),r={name:h,children:[]};const o=new Set;for(let t=1;t<=e;t++)o.add(a[t].data.id),a[t].parent===a[0]&&r.children.push(a[t].data);if(function e(t){if(!t.children)return;const r=[];for(const e of t.children)o.has(e.id)&&r.push($.extend({},e));t.children=r;for(const r of t.children)e(r)}(r),s){n=angular.isUndefined(n)?E():n;j(r,{noPrefixes:n})}else i(t)}var o,l=f.get(g.CLASS_HIERARCHY_CURRENT_SLIDER_VALUE);if(l)s(l,a);else{var d={doFade:!0,keepPrevState:!0,noPrefixes:E()};j(t,d),I()}O=u.$watch("hidePrefixes",(function(r){angular.isUndefined(r)||e?e=void 0:c((function(){!function(e){angular.isUndefined(e)||f.set(g.CLASS_HIERARCHY_HIDE_PREFIXES,e)}(r),i(t,!0)}),50)}),!0),P=u.$watch("currentSliderValue",(function(e){s(e,a,!0)}),!0),Q=u.$on("onEnterKeypressSearchAction",(function(e){o&&T(o)})),D=u.$on("searchedClass",(function(e,t){(o=M[t.name])&&T(o)}))}}),!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",o),o.$inject=["$rootScope","$location","GraphDataRestService","$window","$timeout","$repositories","$licenseService","toastr","ZOOM_DURATION","ROOT_OBJ_NAME","LocalStorageAdapter","LSKeys","$translate"]},160:function(e,t,r){"use strict";r.r(t);var n=r(401),a=r(400);r(10);function i(e,t,r,i,s,o,c,l,u,d,p,h,f){return{restrict:"AE",template:'<div id="domain-range"></div>',scope:{showPredicatesInfoPanel:"=",selectedPredicate:"=",collapseEdges:"="},link:function(d){const p=l((function(){!function(d){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(),m=d3.drag().subject((function(e){return e})).on("start",(function(e,t){g.stop(),t.fx=e.x,t.fy=e.y,d3.select(this).classed("selected",!0)})).on("end",(function(e,t){t.fx=null,t.fy=null,d3.select(this).classed("selected",!1),C?(g.alpha(.2).restart(),C=!1):g.restart()})).on("drag",(function(e,t){C=!0,g.alphaTarget(0).restart(),t.fx=e.x,t.fy=e.y})),y=p.append("defs");y.append("marker").attrs({id:"arrow",viewBox:"0 -5 10 10",refX:10,refY:0,markerUnits:"strokeWidth",markerWidth:5,markerHeight:5,orient:"auto",fill:h}).append("path").attrs({d:"M0,-5L10,0L0,5",class:"arrowHead"}),y.append("marker").attrs({id:"collapsed-arrow",viewBox:"0 -5 10 10",refX:9,refY:0,markerUnits:"strokeWidth",markerWidth:4,markerHeight:4,orient:"auto",fill:h}).append("path").attrs({d:"M0,-5L10,0L0,5",class:"arrowHead"}),y.append("marker").attrs({id:"arrow-loop",viewBox:"0 -5 10 10",refX:7,refY:0,markerUnits:"strokeWidth",markerWidth:5,markerHeight:5,orient:"auto",fill:h}).append("path").attrs({d:"M0,-5L10,0L0,5",class:"arrowHead"}),d3.select("#download-svg").on("mouseover",(function(){var e=n.a.Export.getCSSRules("css/domain-range-graph.css?v=2.6.1-RC1");$("defs").append('<style type="text/css"><![CDATA['+e+"]]></style>");var t=n.a.Export.generateBase64ImageSource("#domain-range svg");d3.select(this).attrs({href:t,download:"domain-range-graph-"+r.getActiveRepository()+".svg"})})),function(){var e=d3.select(".legend-container").append("svg").attr("viewBox","0 0 "+1200/7+" "+1200/7*1.2).attr("preserveAspectRatio","xMidYMid meet");e.append("rect").attrs({width:1200/7,height:1200/7*1.2}).style("fill","rgba(235, 235, 235, 0.9)");var t=16+1200/18/2.5,r=t+1200/90;e.append("circle").attrs({class:"legend-class-node",cx:(16+t)/2,cy:30,r:1200/18/4.5}),e.append("text").attrs({x:r,y:30+1200/370}).style("font-size",1200/90/1.1+"px").text("main class node"),e.append("circle").attrs({class:"legend-object-node",cx:(16+t)/2,cy:70,r:1200/110/1.25}),e.append("text").attrs({x:r,y:30+1200/370+40}).style("font-size",1200/90/1.1+"px").text("class node"),e.append("circle").attrs({class:"legend-datatype-node",cx:(16+t)/2,cy:70+1200/45,r:1200/110/2}),e.append("text").attrs({x:r,y:99.90990990990991}).style("font-size",1200/90/1.1+"px").text("datatype node"),e.append("line").attrs({class:"property-arrow",x1:16,y1:123.33333333333334,x2:t,y2:123.33333333333334}).style("stroke-width",1.2).attr("marker-end","url("+s.absUrl()+"#arrow)"),e.append("text").attrs({x:r,y:126.57657657657658}).style("font-size",1200/90/1.1+"px").text("explicit property"),e.append("line").attrs({class:"implicit-property-arrow",x1:16,y1:150,x2:t,y2:150}).style("stroke-width",1.2).attr("marker-end","url("+s.absUrl()+"#arrow)"),e.append("text").attrs({x:r,y:150+1200/370}).style("font-size",1200/90/1.1+"px").text("implicit property"),e.append("line").attrs({class:"collapsed-property-arrow",x1:16,y1:150+1200/45,x2:t,y2:150+1200/45}).style("stroke-width",2).attr("marker-end","url("+s.absUrl()+"#collapsed-arrow)"),e.append("text").attrs({x:r,y:179.9099099099099}).style("font-size",1200/90/1.1+"px").text("collapsed property")}();var v=s.search().uri,x=s.search().name;const S=s.search().collapsed;(function(e,t){i.getDomainRangeData(e,t).success((function(e,t,r){d.domainRangeGraphData=e})).error((function(e){u.error("Request for "+x+" failed!")}))})(v,S),$(window).on("popstate",(function(){o.set(c.DOMAIN_RANGE_WENT_BACK,!0)})),t.onpopstate=function(t){t.state&&e.$broadcast("changeCollapsedEdgesState",t.state.collapsed)},d.$watch("collapseEdges",(function(){angular.isUndefined(d.collapseEdges)||(o.set(c.DOMAIN_RANGE_COLLAPSE_EDGES,d.collapseEdges),"true"!==o.get(c.DOMAIN_RANGE_WENT_BACK)&&function(t){e.$broadcast("switchEdgeMode",{uri:v,name:x,collapsed:t})}(d.collapseEdges),o.remove(c.DOMAIN_RANGE_WENT_BACK))})),d.$watch("domainRangeGraphData",(function(){if(d.domainRangeGraphData){var r=_.cloneDeep(d.domainRangeGraphData);const O=r.nodes,P=r.links;g.nodes(O).force("x",d3.forceX(600)).force("y",d3.forceY(300)).force("charge",d3.forceManyBody().strength(-800)).force("link",d3.forceLink(P).distance(1200/3.5));var n=p.selectAll(".link").data(P).enter().append("g");function i(e){e.style("stroke",h),e.style("stroke-width",2),e.attr("marker-end","url("+s.absUrl()+"#collapsed-arrow)")}var o,c,u=0;n.each((function(e){if(e.objectPropNodeClassUri!==v)o=n.append("line").attrs({class:"link","marker-end":"url("+s.absUrl()+"#arrow)"}).style("stroke-width",1.2).each((function(e){switch(e.propertyType){case"objectLeft":e.targetRadius=1200/18;break;case"objectRight":e.targetRadius=1200/110;break;case"datatype":e.targetRadius=1200/110/2;break;default:e.targetRadius=0}var t=d3.select(this);e.targetNodeEdgeCount>1?i(t):e.implicit&&t.style("stroke-dasharray","3, 3")}));else{if(angular.isUndefined(c)){c=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)}(u+=e.targetNodeEdgeCount)>1&&i(d3.select(".loop-link"))}}));var y={};function S(){$.isEmptyObject(y)||(y.text.style("fill","black"),y.background.style("fill","#f0f0f0"))}function C(e,t){S(),y.text=d3.select(this),y.background=d3.select(this.previousSibling),y.text.style("fill","white"),y.background.style("fill",h),l((function(){d.showPredicatesInfoPanel=!0,d.selectedPredicate=t})),e.stopPropagation()}$("document").ready((function(){$("#domain-range").bind("click",S)}));var b=n.append("text").attr("class",(function(e){return e.objectPropNodeClassUri===v?"loop-link-property-name":"property-name"})).attr("dx",(function(e){return 1200/18/2*("objectLeft"===e.propertyType?1:-1)})).style("text-anchor",(function(e){return"objectLeft"===e.propertyType?"end":"start"})).style("font-size",1200/90).text((function(e){return e.targetNodeEdgeCount>1?e.targetNodeEdgeCount+" predicates":e.name}));b.each((function(e){var r=d3.select(this);/\d\spredicates/.test(r.text())?r.style("font-weight","bold").on("click",C):r.on("click",(function(e,r){t.open("resource?uri="+encodeURIComponent(r.uri),"_blank")}))}));var w=n.append("rect").attr("class",(function(e){return e.objectPropNodeClassUri!==v?"link-background":"loop-link-background"})).attr("width",(function(e){return e.calculatedWidth=this.previousSibling.getBBox().width,e.calculatedWidth+4})).attr("height",(function(e){return e.calculatedHeight=this.previousSibling.getBBox().height,e.calculatedHeight+2})).attr("transform",(function(e){var t=2-1200/18/2*("objectLeft"===e.propertyType?1:-1);return"objectLeft"===e.propertyType&&(t+=e.calculatedWidth),"translate(-"+t+",-"+(2+e.calculatedHeight/2)+")"})).on("click",(function(e){e.stopPropagation()})),E=p.selectAll(".node").data(O).enter().append("g"),R=E.filter((function(e){return e.objectPropClassUri!==v})).append("circle").each((function(e){var t=d3.select(this);"main"===e.classPosition?t.attrs({class:"class-node",r:1200/18}).attr("marker-end","url("+s.absUrl()+"#loop-link)"):null===e.objectPropClassName?t.attrs({class:"datatype-node",r:1200/110/2}):t.attrs({class:"object-prop-node",r:1200/110})})).call(m);d3.selectAll(".object-prop-node").on("dblclick",(function(t,r,n){d.$apply((function(){e.$broadcast("reloadDomainRangeGraphView",r,n)}))})),E.filter((function(e){return e.objectPropClassName&&e.objectPropClassUri!==v})).append("text").attr("class",(function(e){return e.classPosition+"-class-label"})).style("font-size",1200/90).text((function(e){return e.objectPropClassName})).on("click",(function(e,r){t.open("resource?uri="+encodeURIComponent(r.objectPropClassUri),"_blank")}));var I=E.select("text");p.select(".class-node").each((function(){d3.select(this.parentNode).append("text").attr("class","rdf-class-label").style("font-size",(function(e){return a.a.Text.calcFontSize(x,1200/18)})).text(x).on("click",(function(){t.open("resource?uri="+encodeURIComponent(v),"_blank")}))}));var T=p.select(".class-node + text"),A=d3.select(".class-node"),L=d3.selectAll(".loop-link-background"),k=d3.selectAll(".loop-link-property-name");if(b=d3.selectAll(".property-name"),!angular.isUndefined(c)){var N=[];L.each((function(e,t){d3.select(this);N.push({idx:t,width:e.calculatedWidth,height:e.calculatedHeight})}))}g.on("tick",(function(e){var t=8*g.alpha();function r(e){var t=e.x+1200/18*2,r=e.y-1200/18/1.9;var n=[];L.each((function(a,i){n.push(a),i<f?function(n,a){var i=$.grep(N,(function(e){return e.idx==a}));a>0&&(t+=parseFloat(a*(i[0].height/(a/1.4)))),n.attrs({transform:"rotate(270, "+e.x+","+e.y+") translate("+t+","+r+")",width:i[0].height,height:i[0].width})}(d3.select(this),i):d3.select(this).remove()})),function(e){var t;d3.select(".view-more-preds-label").style("font-weight","bold").each((function(r){r.target.allEdges=e,t=this.getComputedTextLength()})).on("click",C),d3.select(".view-more-preds-rect").attr("height",t+4)}(n)}o.filter((function(e){return e.objectPropNodeClassUri!==v})).attr("x1",(function(e){return e.source.x})).attr("y1",(function(e){return e.source.y})).attr("x2",(function(e){return e.targetX})).attr("y2",(function(e){return e.targetY})).each((function(e){!function(e){"objectLeft"===e.propertyType?(e.source.x-=8*t,e.source.y-=t/9):(e.target.x+=8*t,e.target.y-=t/9)}(e);var r=Math.atan2(e.target.y-e.source.y,e.target.x-e.source.x);e.targetX=e.target.x-Math.cos(r)*e.targetRadius,e.targetY=e.target.y-Math.sin(r)*e.targetRadius})),R.each((function(e){"main"!==e.classPosition||angular.isUndefined(c)||(!function(e){var t=e.x+64,r=e.y-1200/18/5.7-5;c.attr("transform","rotate(270, "+e.x+","+e.y+") translate("+t+","+r+")")}(e),function(e){function t(t,r){var n=$.grep(N,(function(e){return e.idx==r})),a=0;r>0&&(a=parseFloat(2*r*(n[0].height/1.4)));var i=e.x,s=e.y-1200/18*2.1-a;t.attrs({x:i,y:s}).moveToFront()}k.each((function(e,r){var n=d3.select(this),a=k.size()-f;a<0?t(n,r):(0==r&&!d.collapseEdges&&a>1&&(!function(e,t,r){e.classed("view-more-preds-label",!0).text(r+" predicates more ..."),null!==this.nextSibling&&t.classed("view-more-preds-rect",!0)}(n,d3.select(this.nextSibling),a),t(n,r)),r<f?t(n,r):n.remove())}))}(e),r(e)),e.objectPropClassUri!==v&&d3.select(this).attr("cx",(function(e){return"main"===e.classPosition?function(e){!window.ActiveXObject&&"ActiveXObject"in window&&(Math.log10=function(e){return Math.log(e)/Math.LN10});var t=A.attr("cx")-600,r=.5*Math.log10(Math.abs(t));return e.x+=t>0?-r:r,e.x}(e):e.x})).attr("cy",(function(e){return e.y}))})),T.attr("x",(function(e){return e.x})).attr("y",(function(e){return e.y})).moveToFront(),w.filter((function(e){return e.objectPropNodeClassUri!==v})).attr("x",(function(e){return e.target.x>e.source.x?e.source.x+(e.target.x-e.source.x)/2:e.target.x+(e.source.x-e.target.x)/2})).attr("y",(function(e){return e.target.y>e.source.y?e.source.y+(e.target.y-e.source.y)/2:e.target.y+(e.source.y-e.target.y)/2})).moveToFront(),b.attr("x",(function(e){return e.target.x>e.source.x?e.source.x+(e.target.x-e.source.x)/2:e.target.x+(e.source.x-e.target.x)/2})).attr("y",(function(e){return e.target.y>e.source.y?e.source.y+(e.target.y-e.source.y)/2:e.target.y+(e.source.y-e.target.y)/2})).moveToFront(),I.attr("x",(function(e){return"right"===e.classPosition?e.x+1200/110*1.2:e.x-1200/110*1.2})).attr("y",(function(e){return e.y})).moveToFront()}))}}));let C=!1}(d)}),50);d.$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",i),i.$inject=["$rootScope","$window","$repositories","GraphDataRestService","$location","LocalStorageAdapter","LSKeys","$timeout","toastr","ONTO_RED","ONTO_GREEN","ONTO_BLUE","NON_COLLAPSED_REFLEXIVE_LINK_LIMIT"]},161:function(e,t){function r(e,t){return{restrict:"A",scope:{},templateUrl:"js/angular/graphexplore/templates/systemRepoWarningTemplate.html",link:function(r){r.isSystemRepository=function(){return"SYSTEM"===e.getActiveRepository()},r.hasPermission=function(){return t.hasPermission()}}}}angular.module("graphdb.framework.graphexplore.directives.sysrepo",["graphdb.framework.graphexplore.controllers.class"]).directive("systemRepoWarning",r),r.$inject=["$repositories","$rootScope"]},162:function(e,t){function r(e){return{restrict:"AE",scope:{rdfsLabel:"=",rdfsComment:"=",expanded:"=",alwaysExpanded:"="},templateUrl:"js/angular/graphexplore/templates/rdfsCommentLabelTemplate.html",link:function(t,r){t.stringLimit=e,t.scrollToTop=function(){r[0].getElementsByClassName("rdfs-comment")[0].scrollTop=0},t.checkCommentLength=function(){return r[0].getElementsByClassName("rdfs-comment-text")[0].innerText.length<e},t.equalHeights=function(){const e=r[0].getElementsByClassName("rdfs-comment-text")[0].innerHeight;e<250&&t.expanded&&(r[0].getElementsByClassName("rdfs-comment")[0].innerHeight=e)},t.toggleFullComment=function(){t.expanded=!t.expanded},t.$watch("expanded || alwaysExpanded",(function(r){t.stringLimit=r?t.rdfsComment.length:e}))}}}angular.module("graphdb.framework.graphexplore.directives.rdfsdetails",[]).directive("rdfsCommentLabel",r).constant("SHORT_COMMENT_LENGTH",100),r.$inject=["SHORT_COMMENT_LENGTH"]},163:function(e,t,r){"use strict";r.r(t);var n=r(401);r(105);function a(e,t){return{restrict:"A",template:'<div id="dependencies-chord"></div>',scope:{dependenciesData:"="},link:function(r){r.$watch("dependenciesData",(function(){if(r.dependenciesData){const a=r.dependenciesData;!function(a,i){if(function(){let e=!0;for(const t of a){if(t.some(e=>0!==e)){e=!1;break}}return e}())return;const s=d3.scaleOrdinal(d3.schemeCategory10),o=d3.select("body").append("div").attr("class","tooltip").style("opacity",0);d3.select("body").on("click",(function(){o.style("opacity",0)}));const c=Math.min(800,800)/2.8,l=c-24,u=d3.arc().innerRadius(l).outerRadius(c),d=d3.chord().padAngle(.04).sortSubgroups(d3.descending).sortChords(d3.ascending),p=d3.ribbon().radius(l),h=d3.select("#dependencies-chord").append("svg").attr("viewBox","0 0 800 800").attr("preserveAspectRatio","xMidYMid meet").style("font","10px sans-serif").append("g").attr("id","circle").attr("transform","translate(400,400)");h.append("circle").attr("r",c).style("fill","none");const f=d(a),g=h.selectAll(".group").data(f.groups).enter().append("g").attr("class","group").on("mouseover",(function(){const e=g.nodes().indexOf(this);m.classed("fade",(function(t){return t.source.index!==e&&t.target.index!==e}))}));g.append("title").text((function(e,t){return i[t]})),g.append("path").attr("id",(function(e,t){return"group"+t})).attr("d",u).style("fill",(function(e,t){return s(t)})),g.append("text").each((function(e){e.angle=(e.startAngle+e.endAngle)/2})).attr("dy",".35em").attr("transform",(function(e){return"rotate("+(180*e.angle/Math.PI-90)+")translate("+(l+26)+")"+(e.angle>Math.PI?"rotate(180)":"")})).style("text-anchor",(function(e){return e.angle>Math.PI?"end":null})).text((function(e){return i[e.index]}));const m=h.selectAll(".chord").data(f).enter().append("path").attr("class","chord").style("fill",(function(e){return s(e.target.index)})).style("fill-opacity",".67").style("stroke","#000").style("stroke-width",".25px").style("cursor","pointer").attr("d",p);m.on("mouseover",(function(){d3.select(this).style("fill-opacity","1")})),m.on("mouseout",(function(){d3.select(this).style("fill-opacity",".67")})),m.on("click",(function(e,n){const a=i[n.source.index],s=i[n.target.index],c=e.pageX,l=e.pageY;t.getPredicates(a,s,r.selectedGraph&&r.selectedGraph.contextID.uri).success((function(e){let t="<div class='dependencies-tooltip'>"+("<div class='row'>"+a+" <i class='fa fa-exchange'></i> "+s+"</div>")+_.map(e.slice(0,10),(function(e){const t=" <i class='fa fa-long-arrow-"+("out"===e.direction?"right":"left")+"'></i>";return"<div class='row'>"+e.predicate+" : "+e.weight+t+" </div>"})).join("");e.length>10?t=t+"<div class='pull-right'>And "+(e.length-10).toString()+" more...</div></div>":t+="</div>",o.html(t).style("left",c+"px").style("top",l+"px")})),o.transition().duration(200).style("opacity",1)})),d3.select("#circle").on("mouseleave",(function(){h.selectAll(".chord").classed("fade",!1)})),d3.select("#download-svg").on("mouseover",(function(){const t=n.a.Export.generateBase64ImageSource(".dependencies-chord svg");d3.select(this).attrs({href:t,download:"dependencies-"+e.getActiveRepository()+".svg"})}))}(a.matrix,a.nodes,a.direction)}}))}}}angular.module("graphdb.framework.graphexplore.directives.dependencies",["graphdb.framework.graphexplore.controllers.dependencies","graphdb.framework.rest.graphexplore.data.service"]).directive("dependenciesChord",a),a.$inject=["$repositories","GraphDataRestService"]},164:function(e,t){function r(){return{restrict:"AE",scope:{filterQueryObj:"=",filterFunction:"&",listItemsObj:"=",listItemsNotFiltered:"=",searchPlaceholder:"@"},templateUrl:"js/angular/graphexplore/templates/listItemsSearchFilterTemplate.html",link:function(e){e.filterFunction=e.filterFunction(),e.$watch("filterQueryObj.query",(function(){var t,r,n,a;e.listItemsObj.items=(t=e.filterQueryObj.query,r=e.listItemsObj.items,n=e.listItemsNotFiltered,a=e.filterFunction,t.length>0?_.filter(n,a):r.length!==n.length?n:r)}))}}}angular.module("graphdb.framework.graphexplore.directives.searchfilter",[]).directive("listItemsSearchFilter",r),r.$inject=[]},165:function(e,t){function r(e,t){return{restrict:"AE",scope:{searchData:"=",searchFields:"@",titleField:"@",searchPlaceholder:"@",initialValue:"=",searchedObjCallback:"&"},templateUrl:"js/angular/graphexplore/templates/searchIconInputTemplate.html",link:function(r,n){r.searchedObjCallback=r.searchedObjCallback(),r.performSearchActionOnEnter=function(){e.$broadcast("onEnterKeypressSearchAction")},r.showInput=function(){$("#selectGraphDropdown").hide(),n.find("#search_input #search_input_value")[0].value="",n.find(".search-icon").addClass("animated bounceOut").css("z-index","-1"),n.find("#search_input .angucomplete-holder").css("display","block"),t((function(){n.find("#search_input .angucomplete-holder").css("width","250px").css("left","-215px"),t((function(){n.find(".close-icon").css("display","block").addClass("animated bounceIn").css("z-index","3"),n.find("#search_input #search_input_value").focus()}),200)}),1)},r.hideInput=function(){n.find("#search_input #search_input_value")[0].value="",n.find("#search_input .angucomplete-holder").css("width","0px").css("left","35px"),t((function(){n.find("#search_input .angucomplete-holder").css("display","none"),$("#selectGraphDropdown").show()}),250),n.find(".close-icon").addClass("animated bounceOut").removeClass("bounceOut").css("z-index","-1").css("display","none").click((function(){$(".tooltip").hide()})),t((function(){n.find(".search-icon").css("display","inline-block").removeClass("bounceOut").addClass("bounceIn").css("z-index","3")}),200)}}}}angular.module("graphdb.framework.graphexplore.directives.searchcontrols",[]).directive("searchIconInput",r),r.$inject=["$rootScope","$timeout"]},223:function(e,t,r){"use strict";r.r(t);r(7),r(30),r(25),r(24),r(610),r(611),r(393),r(402),r(449),r(612),r(613),r(418),r(400),r(432),r(401),r(105),r(150),r(151),r(152),r(153),r(154),r(155),r(156),r(157),r(158),r(159),r(160),r(161),r(162),r(163),r(164),r(165),r(78);angular.module("graphdb.framework.graphexplore",["graphdb.framework.core.controllers","graphdb.framework.core.directives","graphdb.framework.rest.graphexplore.data.service","graphdb.framework.graphexplore.services.uiscroll","graphdb.framework.graphexplore.services.rdfsdetails","graphdb.framework.rest.graphexplore.savedgraphs.service","graphdb.framework.rest.graphconfig.service","graphdb.framework.graphexplore.controllers.class","graphdb.framework.graphexplore.controllers.domainrange","graphdb.framework.graphexplore.controllers.dependencies","graphdb.framework.graphexplore.controllers.graphviz","graphdb.framework.graphexplore.controllers.graphviz.config","graphdb.framework.graphexplore.directives.sysrepo","graphdb.framework.graphexplore.directives.rdfsdetails","graphdb.framework.graphexplore.directives.searchfilter","graphdb.framework.graphexplore.directives.class","graphdb.framework.graphexplore.directives.domainrange","graphdb.framework.graphexplore.directives.dependencies","graphdb.framework.graphexplore.directives.searchcontrols","graphdb.framework.core.directives.yasgui-component"])},393:function(e,t,r){var n,a;n=[r(398)],void 0===(a=function(){function e(e,t){return e.each((function(){var e=t.apply(this,arguments),r=select(this);for(var n in e)r.attr(n,e[n])}))}function t(e,t){for(var r in t)e.attr(r,t[r]);return e}return"undefined"==typeof d3&&(d3=r(398)),d3.selection.prototype.attrs=function(r){return("function"==typeof r?e:t)(this,r)},d3.selection.prototype.moveToFront=function(){return this.each((function(){d3.select(this.parentNode.appendChild(this))}))},d3.selection.prototype.moveToBack=function(){return this.each((function(){const e=this.parentNode.firstChild;e&&this.parentNode.insertBefore(this,e)}))},d3}.apply(t,n))||(e.exports=a)},400:function(e,t,r){"use strict";r(393);var n=n||{};n.Text=function(){function e(e,t,r,n){r=r||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<r&&(a=r),Math.round(a)):(a<r&&(a=r),Math.round(a))}return{calcFontSizeRaw:e,calcFontSize:function(t,r,n,a){return e(t,r,n)+"px"},getTextWithElipsisIfNeeded:function(e,t){return"string"==typeof e&&e.length>t?e.substring(0,t-3)+"...":e}}}(),n.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)}},n.Click=function(){const e=function(e,r){let n,a=1,i=arguments.length;for(;++a<i;)n=arguments[a],e[n]=t(e,r,r[n]);return e};function t(e,t,r){return function(){var n=r.apply(t,arguments);return n===t?e:n}}return{delayDblClick:function(){var t=d3.dispatch("click","dblclick");return e((function(e){var r,n=null;e.on("mousedown",(function(){r=d3.pointer(document.body),+new Date})),e.on("mouseup",(function(e,a){var i,s,o;(s=r,o=d3.pointer(document.body),Math.sqrt(Math.pow(s[0]-o[0],2),Math.pow(s[1]-o[1],2))>5)||(n?(window.clearTimeout(n),n=null,t.call("dblclick",e,e,a)):n=window.setTimeout((i=e,function(){t.call("click",i,i,a),n=null}),250))}))}),t,"on")}}}(),t.a=n},401:function(e,t,r){"use strict";r(393);var n=n||{};n.Export={getCSSRules:function(e){const t=$('link[href="'+e+'"]')[0].sheet.rules;let r="";return _.each(t,(function(e){r+=e.cssText})),r},generateBase64ImageSource:function(e){e||(e="svg");const t=d3.selectAll(e).attr("version","1.1").attr("xmlns","http://www.w3.org/2000/svg").node().parentNode.innerHTML;return"data:image/svg+xml;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(t)))}},t.a=n},402:function(e,t,r){"use strict";t.a=function(){var e=function(){return"n"},t=function(){return[0,0]},r=function(){return" "},n=d(),a=null,i=null,s=null,o=null;function c(e){var t;a="svg"===(t=(t=e).node()).tagName.toLowerCase()?t:t.ownerSVGElement,i=a.createSVGPoint(),document.body.appendChild(n)}c.show=function(){var n=Array.prototype.slice.call(arguments);n[n.length-1]instanceof SVGElement&&(s=n.pop());var a,i=r.apply(this,n),d=t.apply(this,n),h=e.apply(this,n),f=p(),g=u.length,m=document.documentElement.scrollTop||document.body.scrollTop,y=document.documentElement.scrollLeft||document.body.scrollLeft,v=o.apply(this,n);for(f.html(i).style("opacity",1).style("pointer-events","all");g--;)f.classed(u[g],!1);const x=n.filter(e=>e instanceof Event);return a=l.get(h).apply(this,x),v?Object.keys(v).forEach((function(e){f.style(e,v[e])})):f.classed(h,!0).style("top",a.top+d[0]+m+"px").style("left",a.left+d[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 r=Array.prototype.slice.call(arguments);return d3.selection.prototype.attr.apply(p(),r),c},c.style=function(e,t){if(arguments.length<2&&"string"==typeof e)return p().style(e);var r=Array.prototype.slice.call(arguments);return d3.selection.prototype.style.apply(p(),r),c},c.direction=function(t){return arguments.length?(e=null==t?t:f(t),c):e},c.offset=function(e){return arguments.length?(t=null==e?e:f(e),c):t},c.html=function(e){return arguments.length?(r=null==e?e:f(e),c):r},c.customPosition=function(e){return arguments.length?(o=null==e?e:f(e),c):o},c.destroy=function(){return n&&(p().remove(),n=null),c};var l=new Map(Object.entries({n:function(e){var t=h(e);return{top:t.n.y-n.offsetHeight,left:t.n.x-n.offsetWidth/2}},s:function(e){var t=h(e);return{top:t.s.y,left:t.s.x-n.offsetWidth/2}},e:function(e){var t=h(e);return{top:t.e.y-n.offsetHeight/2,left:t.e.x}},w:function(e){var t=h(e);return{top:t.w.y-n.offsetHeight/2,left:t.w.x-n.offsetWidth}},nw:function(e){var t=h(e);return{top:t.nw.y-n.offsetHeight,left:t.nw.x-n.offsetWidth}},ne:function(e){var t=h(e);return{top:t.ne.y-n.offsetHeight,left:t.ne.x}},sw:function(e){var t=h(e);return{top:t.sw.y,left:t.sw.x-n.offsetWidth}},se:function(e){var t=h(e);return{top:t.se.y,left:t.e.x}}})),u=l.keys();function d(){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===n&&(n=d(),document.body.appendChild(n)),d3.select(n)}function h(e){for(var t=s||e.target;void 0===t.getScreenCTM&&"undefined"===t.parentNode;)t=t.parentNode;var r={},n=t.getScreenCTM(),a=t.getBBox(),o=a.width,c=a.height,l=a.x,u=a.y;return i.x=l,i.y=u,r.nw=i.matrixTransform(n),i.x+=o,r.ne=i.matrixTransform(n),i.y+=c,r.se=i.matrixTransform(n),i.x-=o,r.sw=i.matrixTransform(n),i.y-=c/2,r.w=i.matrixTransform(n),i.x+=o,r.e=i.matrixTransform(n),i.x-=o/2,i.y-=c/2,r.n=i.matrixTransform(n),i.y+=c,r.s=i.matrixTransform(n),r}function f(e){return"function"==typeof e?e:function(){return e}}return c}},432:function(e,t,r){"use strict";var n=n||{};n.SingleChild={addPlaceholders:function e(t,r){if(t.children){for(var n=0;n<t.children.length;n++)e(t.children[n]);if(1===t.children.length){var a=1.2*t.size;r&&(a=.1*t.children[0].size),t.children.push({name:"placeholder",size:a})}}},removePlaceholders:function e(t){for(var r=t.length-1;r>=0;r--){var n=t[r];"placeholder"===n.data.name?t.splice(r,1):n.children&&e(n.children)}},centerNodes:function(e){for(var t=0;t<e.length;t++){var r=e[t];if(r.children&&1===r.children.length){var n=r.x-r.children[0].x;r.children[0].x+=n,a(r.children[0],n)}}function a(e,t){if(e.children)for(var r=0;r<e.children.length;r++)e.children[r].x+=t,a(e.children[r],t)}},makePositionsRelativeToZero:function(e){for(var t=e[0].x,r=e[0].y,n=0;n<e.length;n++){var a=e[n];a.x-=t,a.y-=r}}},t.a=n},61:function(e,t,r){"use strict";r.r(t),r.d(t,"RenderingMode",(function(){return n}));const n={YASGUI:"mode-yasgui",YASQE:"mode-yasqe",YASR:"mode-yasr"}},613:function(e,t){
2
2
  /*! Copyright (c) 2014 Hidenari Nozaki and contributors | Licensed under the MIT license */
3
3
  !function(e,t){"use strict";!function(e){e.module("angucomplete-alt",[]).directive("angucompleteAlt",["$q","$parse","$http","$sce","$timeout","$templateCache","$interpolate",function(e,t,r,n,a,i,s){function o(t,i,s,o){var c,l,u,d,p,h,f=i.find("input"),g=3,m=null,y="autocomplete-required",v=null,x=null,S=i[0].querySelector(".angucomplete-dropdown"),C=!1,b=null;function w(e,r){e&&("object"==typeof e?(t.searchStr=_(e),I({originalObject:e})):"string"==typeof e&&e.length>0?t.searchStr=e:console&&console.error&&console.error("Tried to set "+(r?"initial":"")+" value of angucomplete to",e,"which is an invalid value"),L(!0))}function E(e){b=null,t.hideResults(e),document.body.removeEventListener("click",E)}function R(e){return e.which?e.which:e.keyCode}function I(e){"function"==typeof t.selectedObject?t.selectedObject(e,t.selectedObjectData):t.selectedObject=e,L(!!e)}function _(e){return t.titleField.split(",").map((function(t){return T(e,t)})).join(" ")}function T(e,t){var r,n;if(t){r=t.split("."),n=e;for(var a=0;a<r.length;a++)n=n[r[a]]}else n=e;return n}function A(e,r){var a,i,s;if(s=new RegExp(r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"i"),e)return e.match&&e.replace||(e=e.toString()),a=(i=e.match(s))?e.replace(s,'<span class="'+t.matchClass+'">'+i[0]+"</span>"):e,n.trustAsHtml(a)}function L(e){t.notEmpty=e,v=t.searchStr,t.fieldRequired&&o&&t.inputName&&o[t.inputName].$setValidity(y,e)}function k(e){!t.overrideSuggestions||t.selectedObject&&t.selectedObject.originalObject===t.searchStr||(e&&e.preventDefault(),a.cancel(m),M(),I({originalObject:t.searchStr}),t.clearSelected&&(t.searchStr=null),U())}function N(){return i[0].querySelectorAll(".angucomplete-row")[t.currentIndex]}function O(e){S.scrollTop=S.scrollTop+e}function P(){var e=t.results[t.currentIndex];t.matchClass?f.val(_(e.originalObject)):f.val(e.title)}function D(e){return function(r,n,a,i){n||a||i||!r.data||(r=r.data),t.searching=!1,F(T(l(r),t.remoteUrlDataField),e)}}function Q(e,r,n,a){t.searching=!1,0!==r&&-1!==r&&(r||n||a||(r=e.status),t.remoteUrlErrorCallback?t.remoteUrlErrorCallback(e,r,n,a):console&&console.error&&console.error("http error"))}function M(){x&&x.resolve()}function $(n){var a={},i=t.remoteUrl+encodeURIComponent(n);t.remoteUrlRequestFormatter&&(a={params:t.remoteUrlRequestFormatter(n)},i=t.remoteUrl),t.remoteUrlRequestWithCredentials&&(a.withCredentials=!0),M(),x=e.defer(),a.timeout=x.promise,r.get(i,a).success(D(n)).error(Q)}function j(r){M(),x=e.defer(),t.remoteApiHandler(r,x.promise).then(D(r)).catch(Q)}function U(){t.showDropdown=!1,t.results=[],S&&(S.scrollTop=0)}function G(){t.showDropdown=d,t.currentIndex=t.focusFirst?0:-1,t.results=[]}function q(e){!e||e.length<g||(t.localData?t.$apply((function(){var r;r=void 0!==t.localSearch()?t.localSearch()(e,t.localData):function(e){var r,n,a,i,s=t.searchFields.split(","),o=[];for(void 0!==t.parseInput()&&(e=t.parseInput()(e)),r=0;r<t.localData.length;r++){for(n=!1,a=0;a<s.length;a++)i=T(t.localData[r],s[a])||"",n=n||i.toString().toLowerCase().indexOf(e.toString().toLowerCase())>=0;n&&(o[o.length]=t.localData[r])}return o}(e),t.searching=!1,F(r,e)})):t.remoteApiHandler?j(e):$(e))}function F(e,r){var n,a,i,s,o,c;if(e&&e.length>0)for(t.results=[],n=0;n<e.length;n++)t.titleField&&""!==t.titleField&&(s=o=_(e[n])),a="",t.descriptionField&&(a=c=T(e[n],t.descriptionField)),i="",t.imageField&&(i=T(e[n],t.imageField)),t.matchClass&&(o=A(s,r),c=A(a,r)),t.results[t.results.length]={title:o,description:c,image:i,originalObject:e[n]};else t.results=[];t.autoMatch&&1===t.results.length&&function(e,r,n){if(!n)return!1;for(var a in r)if(r[a].toLowerCase()===n.toLowerCase())return t.selectResult(e),!0;return!1}(t.results[0],{title:s,desc:a||""},t.searchStr)?t.showDropdown=!1:0!==t.results.length||p?t.showDropdown=!0:t.showDropdown=!1}function H(){t.localData?F(t.localData,""):t.remoteApiHandler?j(""):$("")}i.on("mousedown",(function(e){e.target.id?(b=e.target.id)===t.id+"_dropdown"&&document.body.addEventListener("click",E):b=e.target.className})),t.currentIndex=t.focusFirst?0:null,t.searching=!1,u=t.$watch("initialValue",(function(e){e&&(u(),w(e,!0))})),t.$watch("fieldRequired",(function(e,r){e!==r&&(e?v&&-1!==t.currentIndex?L(!0):L(!1):o[t.inputName].$setValidity(y,!0))})),t.$on("angucomplete-alt:clearInput",(function(e,r){r&&r!==t.id||(t.searchStr=null,I(),L(!1),U())})),t.$on("angucomplete-alt:changeInput",(function(e,r,n){r&&r===t.id&&w(n)})),t.onFocusHandler=function(){t.focusIn&&t.focusIn(),0!==g||t.searchStr&&0!==t.searchStr.length||(t.currentIndex=t.focusFirst?0:t.currentIndex,t.showDropdown=!0,H())},t.hideResults=function(){b&&(b===t.id+"_dropdown"||b.indexOf("angucomplete")>=0)?b=null:(c=a((function(){U(),t.$apply((function(){t.searchStr&&t.searchStr.length>0&&f.val(t.searchStr)}))}),200),M(),t.focusOut&&t.focusOut(),t.overrideSuggestions&&t.searchStr&&t.searchStr.length>0&&-1===t.currentIndex&&k())},t.resetHideResults=function(){c&&a.cancel(c)},t.hoverRow=function(e){t.currentIndex=e},t.selectResult=function(e){t.matchClass&&(e.title=_(e.originalObject),e.description=T(e.originalObject,t.descriptionField)),t.clearSelected?t.searchStr=null:t.searchStr=e.title,I(e),U()},t.inputChangeHandler=function(e){return e.length<g?(M(),U()):0===e.length&&0===g&&(t.searching=!1,H()),t.inputChanged&&(e=t.inputChanged(e)),e},t.fieldRequiredClass&&""!==t.fieldRequiredClass&&(y=t.fieldRequiredClass),t.minlength&&""!==t.minlength&&(g=parseInt(t.minlength,10)),t.pause||(t.pause=500),t.clearSelected||(t.clearSelected=!1),t.overrideSuggestions||(t.overrideSuggestions=!1),t.fieldRequired&&o&&(t.initialValue?L(!0):L(!1)),t.inputType=s.type?s.type:"text",t.textSearching=s.textSearching?s.textSearching:"Searching...",t.textNoResults=s.textNoResults?s.textNoResults:"No results found",d="false"!==t.textSearching,p="false"!==t.textNoResults,t.maxlength=s.maxlength?s.maxlength:524288,f.on("keydown",(function(e){var r=R(e),n=null,a=null;13===r&&t.results?(t.currentIndex>=0&&t.currentIndex<t.results.length?(e.preventDefault(),t.selectResult(t.results[t.currentIndex])):(k(e),U()),t.$apply()):40===r&&t.results?(e.preventDefault(),t.currentIndex+1<t.results.length&&t.showDropdown&&(t.$apply((function(){t.currentIndex++,P()})),C&&(n=N(),S.getBoundingClientRect().top+parseInt(getComputedStyle(S).maxHeight,10)<n.getBoundingClientRect().bottom&&O(function(e){var t=getComputedStyle(e);return e.offsetHeight+parseInt(t.marginTop,10)+parseInt(t.marginBottom,10)}(n))))):38===r&&t.results?(e.preventDefault(),t.currentIndex>=1?(t.$apply((function(){t.currentIndex--,P()})),C&&(a=N().getBoundingClientRect().top-(S.getBoundingClientRect().top+parseInt(getComputedStyle(S).paddingTop,10)))<0&&O(a-1)):0===t.currentIndex&&t.$apply((function(){t.currentIndex=-1,f.val(t.searchStr)}))):9===r?t.results&&t.results.length>0&&t.showDropdown?-1===t.currentIndex&&t.overrideSuggestions?k():(-1===t.currentIndex&&(t.currentIndex=0),t.selectResult(t.results[t.currentIndex]),t.$digest()):t.searchStr&&t.searchStr.length>0&&k():27===r&&e.preventDefault()})),f.on("keyup",(function(e){var r=R(e);if(37!==r&&39!==r)if(38===r||13===r)e.preventDefault();else if(40===r)e.preventDefault(),!t.showDropdown&&t.searchStr&&t.searchStr.length>=g&&(G(),t.searching=!0,q(t.searchStr));else if(27===r)U(),t.$apply((function(){f.val(t.searchStr)}));else{if(0===g&&!t.searchStr)return;t.searchStr&&""!==t.searchStr?t.searchStr.length>=g&&(G(),m&&a.cancel(m),t.searching=!0,m=a((function(){q(t.searchStr)}),t.pause)):t.showDropdown=!1,v&&v!==t.searchStr&&!t.clearSelected&&t.$apply((function(){I()}))}})),h="remoteUrlResponseFormatter",l=function(e){return t[h]?t[h](e):e},a((function(){var e=getComputedStyle(S);C=e.maxHeight&&"auto"===e.overflowY}))}return i.put("/angucomplete-alt/index.html",'<div class="angucomplete-holder" ng-class="{\'angucomplete-dropdown-visible\': showDropdown}"> <input id="{{id}}_value" name="{{inputName}}" tabindex="{{fieldTabindex}}" ng-class="{\'angucomplete-input-not-empty\': notEmpty}" ng-model="searchStr" ng-disabled="disableInput" type="{{inputType}}" placeholder="{{placeholder}}" maxlength="{{maxlength}}" ng-focus="onFocusHandler()" class="{{inputClass}}" ng-focus="resetHideResults()" ng-blur="hideResults($event)" autocapitalize="off" autocorrect="off" autocomplete="off" ng-change="inputChangeHandler(searchStr)"/> <div id="{{id}}_dropdown" class="angucomplete-dropdown" ng-show="showDropdown"> <div class="angucomplete-searching" ng-show="searching" ng-bind="textSearching"></div> <div class="angucomplete-searching" ng-show="!searching && (!results || results.length == 0)" ng-bind="textNoResults"></div> <div class="angucomplete-row" ng-repeat="result in results" ng-click="selectResult(result)" ng-mouseenter="hoverRow($index)" ng-class="{\'angucomplete-selected-row\': $index == currentIndex}"> <div ng-if="imageField" class="angucomplete-image-holder"> <img ng-if="result.image && result.image != \'\'" ng-src="{{result.image}}" class="angucomplete-image"/> <div ng-if="!result.image && result.image != \'\'" class="angucomplete-image-default"></div> </div> <div class="angucomplete-title" ng-if="matchClass" ng-bind-html="result.title"></div> <div class="angucomplete-title" ng-if="!matchClass">{{ result.title }}</div> <div ng-if="matchClass && result.description && result.description != \'\'" class="angucomplete-description" ng-bind-html="result.description"></div> <div ng-if="!matchClass && result.description && result.description != \'\'" class="angucomplete-description">{{result.description}}</div> </div> </div></div>'),{restrict:"EA",require:"^?form",scope:{selectedObject:"=",selectedObjectData:"=",disableInput:"=",initialValue:"=",localData:"=",localSearch:"&",remoteUrlRequestFormatter:"=",remoteUrlRequestWithCredentials:"@",remoteUrlResponseFormatter:"=",remoteUrlErrorCallback:"=",remoteApiHandler:"=",id:"@",type:"@",placeholder:"@",textSearching:"@",textNoResults:"@",remoteUrl:"@",remoteUrlDataField:"@",titleField:"@",descriptionField:"@",imageField:"@",inputClass:"@",pause:"@",searchFields:"@",minlength:"@",matchClass:"@",clearSelected:"@",overrideSuggestions:"@",fieldRequired:"=",fieldRequiredClass:"@",inputChanged:"=",autoMatch:"@",focusOut:"&",focusIn:"&",fieldTabindex:"@",inputName:"@",focusFirst:"@",parseInput:"&"},templateUrl:function(e,t){return t.templateUrl||"/angucomplete-alt/index.html"},compile:function(e){var t=s.startSymbol(),r=s.endSymbol();if("{{"!==t||"}}"!==r){var n=e.html().replace(/\{\{/g,t).replace(/\}\}/g,r);e.html(n)}return o}}}])}(window.angular)}()},62:function(e,t,r){"use strict";r.r(t),r.d(t,"YasqeMode",(function(){return n}));const n={WRITE:"WRITE",READ:"READ",PROTECTED:"PROTECTED"}},64:function(e,t){function r(e,t){return{showToastMessageWithDelay:function(r){return new Promise(n=>{e.success(t.instant(r)),setTimeout(n,200)})}}}angular.module("graphdb.framework.utils.notifications",[]).factory("Notifications",r),r.$inject=["toastr","$translate"]},66:function(e,t,r){"use strict";r.r(t),r.d(t,"EventDataType",(function(){return n}));const n={DOWNLOAD_AS:"downloadAs",NOTIFICATION_MESSAGE:"notificationMessage",QUERY:"query",COUNT_QUERY:"countQuery",COUNT_QUERY_RESPONSE:"countQueryResponse",COUNT_QUERY_ABORTED:"countQueryAborted",QUERY_EXECUTED:"queryExecuted",SAVE_QUERY_OPENED:"saveQueryOpened"}},69:function(e,t,r){"use strict";r.r(t),r.d(t,"RouteConstants",(function(){return n}));const n={savedQueryName:"savedQueryName",savedQueryOwner:"owner",query:"query",name:"name",owner:"owner"}},70:function(e,t,r){"use strict";r.r(t),r.d(t,"TabQueryModel",(function(){return n}));class n{constructor(e,t,r,n=!0){this.queryName=e,this.query=t,this.owner=r,this.isPublic=n}}},71:function(e,t,r){"use strict";r.r(t),r.d(t,"QueryType",(function(){return n}));const n={SELECT:"SELECT",CONSTRUCT:"CONSTRUCT",ASK:"ASK",DESCRIBE:"DESCRIBE",INSERT:"INSERT",DELETE:"DELETE",LOAD:"LOAD",CLEAR:"CLEAR",CREATE:"CREATE",DROP:"DROP",COPY:"COPY",MOVE:"MOVE",ADD:"ADD"}},72:function(e,t,r){"use strict";r.r(t),r.d(t,"VIEW_SPARQL_EDITOR",(function(){return n}));const n="graphdb-workbench-sparql-editor"},73:function(e,t,r){"use strict";r.r(t),r.d(t,"StartMode",(function(){return n})),r.d(t,"GraphsConfig",(function(){return a}));const n={QUERY:"query",NODE:"node",SEARCH:"search"};class a{constructor(e,t,r=n.SEARCH,a,i=!0,s=!0,o,c,l,u,d,p,h,f,g,m,y,v,x,S,C){this._id=e,this._name=t,this._startMode=r,this._owner=a,this._startQueryIncludeInferred=i,this._startQuerySameAs=s,this._startGraphQuery=o,this._startIRI=c,this._startIRILabel=l,this._expandQuery=u,this._resourceQuery=d,this._predicateLabelQuery=p,this._resourcePropertiesQuery=h,this._shared=f,this._description=g,this._hint=m,this._startGraphQueryDescription=y,this._expandQueryDescription=v,this._resourceQueryDescription=x,this._predicateLabelQueryDescription=S,this._resourcePropertiesQueryDescription=C}isStartMode(e){return this.startMode===e}isDefaultGraph(){return"Minimal"===this.name||"Advanced"===this.name}getPropertyDescription(e){return this[e+"Description"]}getQueryType(e){let t;return this.isStartMode(n.QUERY)&&1===e?t=this.startGraphQuery:2===e?t=this.expandQuery:3===e?t=this.resourceQuery:4===e?t=this.predicateLabelQuery:5===e&&(t=this.resourcePropertiesQuery),t||""}updateModel(e,t){return this.isStartMode(n.QUERY)&&1===t?this.startGraphQuery=e:2===t?this.expandQuery=e:3===t?this.resourceQuery=e:4===t?this.predicateLabelQuery=e:5===t&&(this.resourcePropertiesQuery=e),this}toSavePayload(){return{id:this.id,name:this.name,startMode:this.startMode,owner:this.owner,startQueryIncludeInferred:this.startQueryIncludeInferred,startQuerySameAs:this.startQuerySameAs,startGraphQuery:this.startGraphQuery,startIRI:this.startIRI,startIRILabel:this.startIRILabel,expandQuery:this.expandQuery,resourceQuery:this.resourceQuery,predicateLabelQuery:this.predicateLabelQuery,resourcePropertiesQuery:this.resourcePropertiesQuery,shared:this.shared,description:this.description,hint:this.hint}}get id(){return this._id}set id(e){this._id=e}get name(){return this._name}set name(e){this._name=e}get startMode(){return this._startMode}set startMode(e){this._startMode=e}get owner(){return this._owner}set owner(e){this._owner=e}get startQueryIncludeInferred(){return this._startQueryIncludeInferred}set startQueryIncludeInferred(e){this._startQueryIncludeInferred=e}get startQuerySameAs(){return this._startQuerySameAs}set startQuerySameAs(e){this._startQuerySameAs=e}get startGraphQuery(){return this._startGraphQuery}set startGraphQuery(e){this._startGraphQuery=e}get startIRI(){return this._startIRI}set startIRI(e){this._startIRI=e}get startIRILabel(){return this._startIRILabel}set startIRILabel(e){this._startIRILabel=e}get expandQuery(){return this._expandQuery}set expandQuery(e){this._expandQuery=e}get resourceQuery(){return this._resourceQuery}set resourceQuery(e){this._resourceQuery=e}get predicateLabelQuery(){return this._predicateLabelQuery}set predicateLabelQuery(e){this._predicateLabelQuery=e}get resourcePropertiesQuery(){return this._resourcePropertiesQuery}set resourcePropertiesQuery(e){this._resourcePropertiesQuery=e}get shared(){return this._shared}set shared(e){this._shared=e}get description(){return this._description}set description(e){this._description=e}get hint(){return this._hint}set hint(e){this._hint=e}get startGraphQueryDescription(){return this._startGraphQueryDescription}set startGraphQueryDescription(e){this._startGraphQueryDescription=e}get expandQueryDescription(){return this._expandQueryDescription}set expandQueryDescription(e){this._expandQueryDescription=e}get resourceQueryDescription(){return this._resourceQueryDescription}set resourceQueryDescription(e){this._resourceQueryDescription=e}get predicateLabelQueryDescription(){return this._predicateLabelQueryDescription}set predicateLabelQueryDescription(e){this._predicateLabelQueryDescription=e}get resourcePropertiesQueryDescription(){return this._resourcePropertiesQueryDescription}set resourcePropertiesQueryDescription(e){this._resourcePropertiesQueryDescription=e}}},78:function(e,t,r){"use strict";r.r(t);r(95),r(96);var n=r(79),a=r(63),i=r(97),s=r(66),o=r(12),c=r(89),l=r(435),u=r(71),d=r(98),p=r(14),h=r(99),f=r(100);function g(e,t,r,g,m,y,v,x,S,C,b,w,E,R,I){return{restrict:"E",templateUrl:"js/angular/core/directives/yasgui-component/templates/yasgui-component.html",scope:{yasguiConfig:"=",afterInit:"&",queryChanged:"&"},link:(g,I,_)=>{g.classToApply=_.class||"";const T=new Map,A=g.yasguiConfig&&g.yasguiConfig.outputHandlers?new Map(g.yasguiConfig.outputHandlers):new Map;let L=void 0;g.getOntotextYasguiElements=()=>I.find("ontotext-yasgui"),g.getOntotextYasguiElement=()=>new d.YasguiComponent(g.getOntotextYasguiElements()[0]),g.createSavedQuery=e=>{const t=Object(n.queryPayloadFromEvent)(e);E.addNewSavedQuery(t).then(()=>H(t)).catch(q)},g.updateSavedQuery=e=>{const t=Object(n.queryPayloadFromEvent)(e);E.editSavedQuery(t).then(()=>F(t)).catch(q)},g.deleteSavedQuery=e=>{const t=Object(n.queryPayloadFromEvent)(e);E.deleteSavedQuery(t.name).then(()=>{x.success(r.instant("query.editor.delete.saved.query.success.msg",{savedQueryName:t.name}))}).catch(e=>{const t=getError(e);x.error(t,r.instant("query.editor.delete.saved.query.error"))})},g.shareSavedQuery=e=>{const t=Object(n.queryPayloadFromEvent)(e);g.savedQueryConfig={shareQueryLink:R.createShareSavedQueryLink(t.name,t.owner)}},g.shareQuery=e=>{const t=Object(n.queryPayloadFromEvent)(e);g.savedQueryConfig={shareQueryLink:R.createShareQueryLink(t)}},g.queryShareLinkCopied=()=>{x.success(r.instant("modal.ctr.copy.url.success"))},g.loadSavedQueries=()=>{E.getSavedQueries().then(e=>{const t=Object(n.savedQueriesResponseMapper)(e);g.savedQueryConfig={savedQueries:t}}).catch(e=>{const t=getError(e);x.error(t,r.instant("query.editor.get.saved.queries.error"))})},g.saveQueryOpened=e=>{p.YasguiComponentDirectiveUtil.highlightTabName(Object(i.toYasguiOutputModel)(e).getTab())},g.output=e=>{const t=Object(i.toYasguiOutputModel)(e);A.has(t.TYPE)&&A.get(t.TYPE)(t)};A.set(s.EventDataType.QUERY,e=>{const t=e.getPageNumber(),r=e.getPageSize();r&&t&&(e.setOffset((t-1)*(r-1)),e.setLimit(r)),e.setPageNumber(void 0),e.setPageSize(void 0)});A.set(s.EventDataType.COUNT_QUERY,e=>{e.setPageSize(void 0),e.setPageNumber(void 0),e.setCount(1)});A.set(s.EventDataType.COUNT_QUERY_RESPONSE,e=>{e.setTotalElements(j(e))});A.set(s.EventDataType.DOWNLOAD_AS,e=>{const t=T.get(e.pluginName);t&&t(e)});A.set(s.EventDataType.NOTIFICATION_MESSAGE,e=>{const t=x[e.messageType];Object(a.isFunction)(t)&&t(e.message)});T.set("extended_response",e=>{"application/sparql-results+json"===e.contentType?g.getOntotextYasguiElement().getEmbeddedResultAsJson().then(t=>{const r=JSON.stringify(t,null,"\t");Object(i.downloadAsFile)(M()+"_queryResults.json",e.contentType,r)}):"text/csv"===e.contentType&&g.getOntotextYasguiElement().getEmbeddedResultAsCSV().then(t=>{Object(i.downloadAsFile)(M()+"_queryResults.csv",e.contentType,t)})});T.set(c.YasrPluginName.EXTENDED_TABLE,e=>{const r=e.query,n=e.infer,a=e.sameAs,i=e.contentType,s=y.getAuthToken()||"";p.YasguiComponentDirectiveUtil.getOntotextYasguiElementAsync("#query-editor").then(e=>e.getQueryMode()).then(e=>{const o=t.resolveSparqlEndpoint(e),c=$("#wb-download");c.attr("action",o),$("#wb-download-query").val(r),$("#wb-download-infer").val(n),$("#wb-download-sameAs").val(a),$("#wb-auth-token").val(s),$("#wb-download-accept").val(i),c.submit()})});const k=[],N=()=>g.getOntotextYasguiElement().getQuery().then(e=>{L=JSON.stringify(e)});k.push(g.$watch("yasguiConfig",(n,a)=>{if(!g.ontotextYasguiConfig&&n||n&&!Object(l.isEqual)(n,a)){const a=t.isActiveRepoOntopType(),i={isVirtualRepository:a,infer:a||n.infer,immutableInfer:a,sameAs:a||n.sameAs,immutableSameAs:a,yasqeAutocomplete:{LocalNamesAutocompleter:t=>{const r=e.defer();return z(t,r)}},language:m.getLanguage(),i18n:S.getTranslations(),getRepositoryStatementsCount:B,onQueryAborted:W};if(angular.extend(i,G(),g.yasguiConfig),void 0===i.showQueryButton||i.showQueryButton){const e=i.keyboardShortcutConfiguration||{};e[h.KeyboardShortcutName.EXECUTE_EXPLAIN_PLAN_FOR_QUERY]=!0,e[h.KeyboardShortcutName.EXECUTE_CHAT_GPT_EXPLAIN_PLAN_FOR_QUERY]=!0,i.keyboardShortcutConfiguration=e}else{const e=i.keyboardShortcutConfiguration||{};e[h.KeyboardShortcutName.EXECUTE_QUERY_OR_UPDATE]=!1,e[h.KeyboardShortcutName.EXECUTE_EXPLAIN_PLAN_FOR_QUERY]=!1,e[h.KeyboardShortcutName.EXECUTE_CHAT_GPT_EXPLAIN_PLAN_FOR_QUERY]=!1,e[h.KeyboardShortcutName.CREATE_TAB]=!1,e[h.KeyboardShortcutName.CREATE_SAVE_QUERY]=!1,e[h.KeyboardShortcutName.SWITCH_NEXT_TAB]=!1,e[h.KeyboardShortcutName.SWITCH_PREVIOUS_TAB]=!1,e[h.KeyboardShortcutName.CLOSES_ALL_TABS]=!1,i.keyboardShortcutConfiguration=e}f.YasguiPersistenceMigrationService.isMigrationNeeded()&&f.YasguiPersistenceMigrationService.migrateYasguiPersistence(r.instant("sparql.tab.directive.unnamed.tab.title")),g.ontotextYasguiConfig=i,P(),N().then(()=>{angular.isFunction(g.afterInit)&&g.afterInit()})}}));const O=()=>{let e;const t=g.getOntotextYasguiElement();t.getQuery().then(t=>(e=JSON.stringify(t),e)).then(E.addKnownPrefixes).then(r=>{e=r.data,t.setQuery(e)}).then(()=>{Q(JSON.stringify(e))}).catch(e=>{const t=getError(e);x.error(t,r.instant("common.add.known.prefixes.error"))})},P=()=>{const e=v((function(){const t=g.getOntotextYasguiElements();t&&(t.on("paste.sparqlQuery",".CodeMirror",O),t.on("keyup.sparqlQuery",".CodeMirror textarea",D),v.cancel(e))}))},D=e=>{g.getOntotextYasguiElement().getQuery().then(e=>{Q(JSON.stringify(e))})},Q=e=>{g.queryChanged(e),g.$emit("queryChanged",{dirty:L!==e})};k.push(g.$on("language-changed",(function(e,t){g.language=t.locale})));g.$on("$destroy",()=>{k.forEach(e=>e());const e=g.getOntotextYasguiElements();e.off("paste.sparqlQuery"),e.off("keyup.sparqlQuery")});const M=()=>{const e=new Date;return`${e.toLocaleDateString(g.language)}_${e.toLocaleTimeString(g.language)}`},j=e=>{if(e.isResponseNumber())return e.getResponseBody();if(e.isResponseArray()){const t=e.getResponseBody();if(t["http://www.ontotext.com/"])return t["http://www.ontotext.com/"]["http://www.ontotext.com/"][0].value}if(e.hasBindingResponse()){const t=e.getResponseBody();if(t){const e=t.results.bindings[0],r=t.head.vars,n=Object.keys(e).find((function(t){return r.indexOf(t)>-1&&!isNaN(e[t].value)}));if(n.length>0)return e[n].value}}},U=e=>{const r=e.getTab().getYasqe(),n={"Content-Type":"application/x-www-form-urlencoded","X-GraphDB-Local-Consistency":"updating","X-GraphDB-Catch":r.getPageSize()+"; throw","X-GraphDB-Track-Alias":`yasgui-component-${performance.now()}-${Date.now()}`,"X-GraphDB-Repository-Location":t.getActiveRepositoryObject().location,"X-Requested-With":"XMLHttpRequest"},a=y.getAuthToken();a&&(n.Authorization=a);const i=r.getQueryType();return o.QueryMode.UPDATE===r.getQueryMode()?n.Accept="text/plain,/;q=0.9":u.QueryType.CONSTRUCT===i||u.QueryType.DESCRIBE===i?n.Accept="application/x-graphdb-table-results+json, application/rdf+json;q=0.9, */*;q=0.8":n.Accept="application/x-sparqlstar-results+json, application/sparql-results+json;q=0.9, */*;q=0.8",n},G=()=>({showEditorTabs:!0,showToolbar:!0,componentId:"yasgui-component",headers:U,pageSize:1e3,maxPersistentResponseSize:5e5,showResultTabs:!0}),q=e=>{const t=getError(e),n=r.instant("query.editor.create.saved.query.error");x.error(t,n),g.savedQueryConfig=Object(a.merge)({},g.savedQueryConfig,{saveSuccess:!1,errorMessage:[n]})},F=e=>Y(r.instant("query.editor.edit.saved.query.success.msg",{name:e.name})),H=e=>Y(r.instant("query.editor.save.saved.query.success.msg",{name:e.name})),Y=e=>{x.success(e),g.savedQueryConfig=Object(a.merge)({},g.savedQueryConfig,{saveSuccess:!0})},z=(e,t)=>C.getAutocompleteSuggestions(e,t.promise).then((function(e){return t=null,e.data})),B=()=>b.getRepositorySize(t.getActiveRepository()).then(e=>parseInt(e.data)).catch((function(e){const n={repo:t.getActiveRepository(),error:getError(e)};x.warning(r.instant("query.editor.repo.size.error",n))})),W=e=>{if(e){const t=e.url.substring(e.url.lastIndexOf("/")+1),r=e.header["X-GraphDB-Track-Alias"];return w.deleteQuery(r,t)}}}}}angular.module("graphdb.framework.core.directives.yasgui-component",["graphdb.framework.core.services.translation-service","graphdb.framework.sparql-editor.share-query.service"]).directive("yasguiComponent",g),g.$inject=["$q","$repositories","$translate","$location","$languageService","AuthTokenService","$interval","toastr","TranslationService","AutocompleteRestService","RDF4JRepositoriesRestService","MonitoringRestService","SparqlRestService","ShareQueryLinkService","ModalService"]},79:function(e,t,r){"use strict";r.r(t),r.d(t,"buildQueryModel",(function(){return a})),r.d(t,"savedQueriesResponseMapper",(function(){return i})),r.d(t,"savedQueryResponseMapper",(function(){return s})),r.d(t,"queryPayloadFromEvent",(function(){return o}));var n=r(70);const a=(e,t,r,a)=>new n.TabQueryModel(t,e,r,a),i=e=>e&&e.data?e.data.map?e.data.map(e=>a(e.body,e.name,e.owner,e.shared)):[a(e.data.body,e.data.name,e.data.owner,e.data.shared)]:[],s=e=>{const t=i(e);return t.length?t[0]:null},o=e=>({name:e.detail.queryName,body:e.detail.query,shared:e.detail.isPublic})},80:function(e,t,r){"use strict";r.r(t),r.d(t,"EventData",(function(){return n}));class n{constructor(e,t){this.TYPE=e,this.payload=t}}},81:function(e,t,r){"use strict";r.r(t),r.d(t,"QueryRequestEvent",(function(){return n}));class n{constructor(e){this.TYPE=e.TYPE,this.query=e.payload.query,this.queryMode=e.payload.queryMode,this.queryType=e.payload.queryType,this.pageSize=e.payload.pageSize,this.request=e.payload.request}setPageSize(e){this.request._data.pageSize=e}getPageSize(){return this.request._data.pageSize?parseInt(this.request._data.pageSize):void 0}setPageNumber(e){this.request._data.pageNumber=e}getPageNumber(){return this.request._data.pageNumber?parseInt(this.request._data.pageNumber):void 0}setOffset(e){this.request._data.offset=e}setLimit(e){this.request._data.limit=e}}},82:function(e,t,r){"use strict";r.r(t),r.d(t,"CountQueryResponseEvent",(function(){return a}));var n=r(63);class a{constructor(e){this.TYPE=e.TYPE,this.response=e.payload.response}hasResponse(){return this.response&&this.response.body}getResponseBody(){if(this.hasResponse())return this.response.body}isResponseNumber(){return!!this.hasResponse()&&Object(n.isNumber)(this.response.body)}isResponseArray(){return!!this.hasResponse()&&Array.isArray(this.response.body)}getBindings(){if(this.hasResponse())return this.response.body.results.bindings}hasBindingResponse(){return!!this.hasResponse()&&this.response.body.results.bindings[0]}setTotalElements(e){this.response.body.totalElements=e}}},83:function(e,t,r){"use strict";r.r(t),r.d(t,"CountQueryRequestEvent",(function(){return n}));class n{constructor(e){this.TYPE=e.TYPE,this.query=e.payload.query,this.queryMode=e.payload.queryMode,this.queryType=e.payload.queryType,this.pageSize=e.payload.pageSize,this.request=e.payload.request}setPageSize(e){this.request._data.pageSize=e}setPageNumber(e){this.request._data.pageNumber=e}setCount(e){this.request._data.count=e}}},84:function(e,t,r){"use strict";r.r(t),r.d(t,"DownloadAsEvent",(function(){return n}));class n{constructor(e){this.TYPE=e.TYPE,this.contentType=e.payload.value,this.pluginName=e.payload.pluginName,this.query=e.payload.query,this.infer=e.payload.infer,this.sameAs=e.payload.sameAs}}},85:function(e,t,r){"use strict";r.r(t),r.d(t,"NotificationMessageEvent",(function(){return n}));class n{constructor(e){this.TYPE=e.TYPE,this.message=e.payload.message,this.code=e.payload.code,this.messageType=e.payload.messageType}}},86:function(e,t,r){"use strict";r.r(t),r.d(t,"QueryExecutedEvent",(function(){return n}));class n{constructor(e){this.TYPE=e.TYPE,this.duration=e.payload.duration,this.tabId=e.payload.tabId}}},87:function(e,t,r){"use strict";r.r(t),r.d(t,"SaveQueryOpened",(function(){return n}));class n{constructor(e){this.tab=e.payload.tab}getTab(){return this.tab}}},88:function(e,t,r){"use strict";r.r(t),r.d(t,"CountQueryAbortedEvent",(function(){return n}));class n{constructor(e){this.TYPE=e.TYPE,this.request=e.payload}getQueryTrackAlias(){if(this.request&&this.request.response)return this.request.response.header["X-GraphDB-Track-Alias"]}getRepository(){if(this.request&&this.request.response){const e=this.request.response.url;return e.substring(e.lastIndexOf("/")+1)}}}},89:function(e,t,r){"use strict";r.r(t),r.d(t,"YasrPluginName",(function(){return n}));const n={EXTENDED_TABLE:"extended_table",RAW_RESPONSE:"response",TABLE:"table"}},93:function(e,t,r){"use strict";r.r(t),r.d(t,"mapGraphsConfigResponseToModel",(function(){return a})),r.d(t,"mapGraphConfigSampleToGraphConfig",(function(){return i})),r.d(t,"mapGraphConfigSamplesToGraphConfigs",(function(){return s}));var n=r(73);const a=e=>new n.GraphsConfig(e.id,e.name,e.startMode,e.owner,e.startQueryIncludeInferred,e.startQuerySameAs,e.startGraphQuery,e.startIRI,e.startIRILabel,e.expandQuery,e.resourceQuery,e.predicateLabelQuery,e.resourcePropertiesQuery,e.shared,e.description,e.hint),i=e=>new n.GraphsConfig(e.id,e.name,e.startMode,e.owner,e.startQueryIncludeInferred,e.startQuerySameAs,e.startGraphQuery,e.startIRI,e.startIRILabel,e.expandQuery,e.resourceQuery,e.predicateLabelQuery,e.resourcePropertiesQuery,e.shared,e.description,e.hint,e.startGraphQueryDescription,e.expandQueryDescription,e.resourceQueryDescription,e.predicateLabelQueryDescription,e.resourcePropertiesQueryDescription),s=e=>e.map(e=>i(e))},94:function(e,t,r){"use strict";r.r(t),r.d(t,"STATIC_RULESETS",(function(){return n})),r.d(t,"REPOSITORY_TYPES",(function(){return a})),r.d(t,"FILENAME_PATTERN",(function(){return i})),r.d(t,"NUMBER_PATTERN",(function(){return s}));const n=[{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"}],a={graphdbRepo:"graphdb",free:"free",eeWorker:"worker",eeMaster:"master",ontop:"ontop",se:"se",fedx:"fedx"},i=new RegExp("^[a-zA-Z0-9-_]+$"),s=new RegExp("^[0-9]+$")},95:function(e,t){function r(e){const t=["en","fr"];let r;return{getTranslations:()=>(r||(r={},t.forEach(t=>r[t]=e.getTranslationTable(t))),r)}}angular.module("graphdb.framework.core.services.translation-service",[]).service("TranslationService",r),r.$inject=["$translate"]},96:function(e,t,r){"use strict";r.r(t);var n=r(69);angular.module("graphdb.framework.sparql-editor.share-query.service",[]).factory("ShareQueryLinkService",(function(){return{createShareSavedQueryLink:function(t,r){let a=`${e()}?${n.RouteConstants.savedQueryName}=${encodeURIComponent(t)}`;null!=r&&(a+=`&${n.RouteConstants.savedQueryOwner}=${encodeURIComponent(r)}`);return a},createShareQueryLink:function(t){return e()+"?"+$.param({name:t.name,query:t.body,infer:t.inference||!0,sameAs:t.sameAs||!0})}};function e(){return[location.protocol,"//",location.host,location.pathname].join("")}}))},97:function(e,t,r){"use strict";r.r(t),r.d(t,"toEventData",(function(){return h})),r.d(t,"toYasguiOutputModel",(function(){return f})),r.d(t,"downloadAsFile",(function(){return g}));var n=r(80),a=r(66),i=r(81),s=r(82),o=r(83),c=r(84),l=r(85),u=r(86),d=r(87),p=r(88);const h=e=>new n.EventData(e.detail.TYPE,e.detail.payload),f=e=>{const t=h(e);switch(t.TYPE){case a.EventDataType.DOWNLOAD_AS:return new c.DownloadAsEvent(t);case a.EventDataType.NOTIFICATION_MESSAGE:return new l.NotificationMessageEvent(t);case a.EventDataType.COUNT_QUERY:return new o.CountQueryRequestEvent(t);case a.EventDataType.COUNT_QUERY_RESPONSE:return new s.CountQueryResponseEvent(t);case a.EventDataType.QUERY:return new i.QueryRequestEvent(t);case a.EventDataType.QUERY_EXECUTED:return new u.QueryExecutedEvent(t);case a.EventDataType.SAVE_QUERY_OPENED:return new d.SaveQueryOpened(t);case a.EventDataType.COUNT_QUERY_ABORTED:return new p.CountQueryAbortedEvent(t);default:return t}},g=(e,t,r)=>{const n=document.createElement("a");n.setAttribute("href",`data:${t};charset=utf-8, + ${encodeURIComponent(r)}`),n.setAttribute("download",e),n.style.display="none",document.body.appendChild(n),n.click(),document.body.removeChild(n)}},98:function(e,t,r){"use strict";r.r(t),r.d(t,"YasguiComponent",(function(){return a}));var n=r(14);r(61);class a{constructor(e=n.YasguiComponentDirectiveUtil.getOntotextYasguiElement("#query-editor")){this.yasguiComponent=e}changeRenderMode(e){return this.yasguiComponent.changeRenderMode(e)}setQuery(e){return this.yasguiComponent.setQuery(e)}query(e){return this.yasguiComponent.query(e)}getQuery(){return this.yasguiComponent.getQuery()}isQueryValid(){return this.yasguiComponent.isQueryValid()}openTab(e){return this.yasguiComponent.openTab(e)}getQueryMode(){return this.yasguiComponent.getQueryMode()}getQueryType(){return this.yasguiComponent.getQueryType()}getEmbeddedResultAsJson(){return this.yasguiComponent.getEmbeddedResultAsJson()}getEmbeddedResultAsCSV(){return this.yasguiComponent.getEmbeddedResultAsCSV()}hideYasqeActionButton(e){return this.yasguiComponent.hideYasqeActionButton(e)}showYasqeActionButton(e){return this.yasguiComponent.showYasqeActionButton(e)}abortQuery(){return this.yasguiComponent.abortQuery()}abortAllCountQuery(){return this.yasguiComponent.abortAllCountQuery()}resetYasrResults(){return this.yasguiComponent.resetResults()}}},99:function(e,t,r){"use strict";r.r(t),r.d(t,"KeyboardShortcutName",(function(){return n}));const n={TRIGGER_AUTOCOMPLETION:"trigger_autocompletion",DELETE_CURRENT_LINE:"delete_current_line",COMMENT_SELECTED_LINE:"comment_selected_line",COPY_LINE_DOWN:"copy_line_down",COPY_LINE_UP:"copy_line_up",AUTO_FORMAT_SELECTED_LINE:"auto_format_selected_line",INDENT_CURRENT_LINE_MORE:"indent_current_line_more",INDENT_CURRENT_LINE_LESS:"indent_current_line_less",EXECUTE_QUERY_OR_UPDATE:"execute_query_or_update",EXECUTE_EXPLAIN_PLAN_FOR_QUERY:"execute_explain_plan_for_query",EXECUTE_CHAT_GPT_EXPLAIN_PLAN_FOR_QUERY:"execute_chat_gpt_explain_plan_for_query",CREATE_TAB:"create_tab",CREATE_SAVE_QUERY:"create_save_query",SWITCH_NEXT_TAB:"switch_next_tab",SWITCH_PREVIOUS_TAB:"switch_previous_tab",CLOSES_ALL_TABS:"closes_all_tabs",FULL_SCREEN:"full_screen",ESC:"esc"}}}]);