graphdb-workbench 3.0.2-TR2 → 3.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/231.909faa919088245e9988.bundle.js +1 -1
- package/dist/31.7452fe0f096c31a9a1f1.bundle.js +1 -1
- package/dist/410.b74d59055b7cf830abe5.bundle.js +1 -1
- package/dist/416.68f6286f80654cdbe4e4.bundle.js +1 -1
- package/dist/417.70adf0a6f0571c394764.bundle.js +1 -1
- package/dist/42.baaa159c3b1e81422600.bundle.js +1 -1
- package/dist/423.6edb13ec0cf08388c947.bundle.js +1 -1
- package/dist/424.725b821051516e73783a.bundle.js +1 -1
- package/dist/425.03fcf969da1a4e92fec3.bundle.js +1 -1
- package/dist/426.aa6924f6f1192d037009.bundle.js +1 -1
- package/dist/427.5c7b72141707b841e8a3.bundle.js +1 -1
- package/dist/428.0d471ce7c68654947c04.bundle.js +1 -1
- package/dist/443.969280af4067a22d1a8b.bundle.js +1 -1
- package/dist/444.a5971579184b091ed392.bundle.js +1 -1
- package/dist/445.2b20cb9e68a11879f6c4.bundle.js +1 -1
- package/dist/446.fe3cf3d6e288c8c4444b.bundle.js +1 -1
- package/dist/447.d1d078921f6f28e2fa38.bundle.js +1 -1
- package/dist/448.d6c9bed6d99b8b23619f.bundle.js +1 -1
- package/dist/468.8e259940c62a68ef3055.bundle.js +1 -1
- package/dist/480.379bf3b338e0a3224a1f.bundle.js +1 -1
- package/dist/481.0387239b174f787e70ea.bundle.js +1 -1
- package/dist/483.c81275cb05dd78ce389f.bundle.js +1 -1
- package/dist/484.25a82c267c3a705d2a65.bundle.js +1 -1
- package/dist/485.91cbfbfd37eccde375c9.bundle.js +1 -1
- package/dist/488.a69dcce23066c0dafdf7.bundle.js +1 -1
- package/dist/489.a976085b601cccf438d4.bundle.js +1 -1
- package/dist/49.ec8921fc54aaae50ca52.bundle.js +1 -1
- package/dist/490.d3e0f3e499b5a24f6808.bundle.js +1 -1
- package/dist/491.62c185868f9d99dd5713.bundle.js +1 -1
- package/dist/50.4886e820614f9dadb147.bundle.js +1 -1
- package/dist/76.fc1058890354a7ee6abe.bundle.js +1 -1
- package/dist/{bundle.31413cc7737cbad7f78d.bundle.js → bundle.fc37b3e514d7594f55be.bundle.js} +3 -3
- package/dist/index.html +3 -3
- package/dist/js/angular/clustermanagement/templates/cluster-nodes-configuration.html +1 -1
- package/dist/js/angular/core/directives/autocomplete/templates/autocomplete.html +1 -1
- package/dist/js/angular/core/directives/dynamic-form/templates/dynamic-form.html +1 -1
- package/dist/js/angular/core/directives/operations-statuses-monitor/templates/operations-statuses-monitor.html +1 -1
- package/dist/js/angular/core/directives/rdfresourcesearch/templates/rdfResourceSearchTemplate.html +1 -1
- package/dist/js/angular/core/directives/shuttle-multiselect/templates/shuttle-multiselect.html +1 -1
- package/dist/js/angular/core/directives/yasgui-component/templates/yasgui-component.html +1 -1
- package/dist/js/angular/core/templates/cookie-policy/cookie-consent.html +1 -1
- package/dist/js/angular/core/templates/cookie-policy/cookie-policy.html +1 -1
- package/dist/js/angular/graphql/templates/create-graphql-endpoint.html +2 -2
- package/dist/js/angular/graphql/templates/graphql-endpoint-management.html +1 -1
- package/dist/js/angular/graphql/templates/graphql-playground.html +1 -1
- package/dist/js/angular/graphql/templates/modal/endpoint-configuration-modal.html +1 -1
- package/dist/js/angular/graphql/templates/modal/endpoint-generation-failure-result-modal.html +1 -1
- package/dist/js/angular/graphql/templates/modal/import-endpoint-definition-modal.html +1 -1
- package/dist/js/angular/security/templates/user.html +2 -2
- package/dist/js/angular/ttyg/templates/agent-list.html +1 -1
- package/dist/js/angular/ttyg/templates/agent-select-menu.html +1 -1
- package/dist/js/angular/ttyg/templates/chat-item-detail.html +1 -1
- package/dist/js/angular/ttyg/templates/chat-list.html +1 -1
- package/dist/js/angular/ttyg/templates/chat-panel.html +1 -1
- package/dist/js/angular/ttyg/templates/modal/agent-instructions-explain-modal.html +1 -1
- package/dist/js/angular/ttyg/templates/modal/agent-settings-modal.html +2 -2
- package/dist/js/angular/ttyg/templates/no-agents-view.html +1 -1
- package/dist/js/angular/ttyg/templates/ttyg.html +1 -1
- package/dist/license-checker.json +2 -2
- package/dist/pages/aclmanagement.html +2 -2
- package/dist/pages/autocomplete.html +1 -1
- package/dist/pages/choose-repository-type.html +1 -1
- package/dist/pages/cluster-management/clusterInfo.html +3 -3
- package/dist/pages/create-index.html +1 -1
- package/dist/pages/dependencies.html +1 -1
- package/dist/pages/domainRangeInfo.html +2 -2
- package/dist/pages/edit.html +1 -1
- package/dist/pages/explore.html +1 -1
- package/dist/pages/export.html +1 -1
- package/dist/pages/find.html +1 -1
- package/dist/pages/graph-config/saveGraphConfig.html +8 -8
- package/dist/pages/graphs-visualizations.html +7 -7
- package/dist/pages/guides.html +1 -1
- package/dist/pages/import.html +2 -2
- package/dist/pages/jdbc-create.html +1 -1
- package/dist/pages/monitor/backup-and-restore.html +1 -1
- package/dist/pages/monitor/queries.html +1 -1
- package/dist/pages/monitor/resources.html +1 -1
- package/dist/pages/namespaces.html +2 -2
- package/dist/pages/plugins.html +1 -1
- package/dist/pages/rdfClassHierarchyInfo.html +7 -7
- package/dist/pages/rdfrank.html +2 -2
- package/dist/pages/repositories.html +1 -1
- package/dist/pages/repository.html +1 -1
- package/dist/pages/similarity-indexes.html +1 -1
- package/dist/pages/sparql-editor.html +1 -1
- package/dist/pages/sparql-template-create.html +1 -1
- package/dist/pages/ux-test1.html +2 -2
- package/dist/pages/webapi.html +2 -2
- package/dist/res/swagger5/index.html +12 -12
- package/package.json +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
(window.webpackJsonp=window.webpackJsonp||[]).push([[31,48,49,50,75,76,94,125,188,189,190,191,192,193,194,196,197,258,297,305,348,357,362,388,391],{104:function(e,t,r){"use strict";r.r(t),r.d(t,"RenderingMode",(function(){return n}));var n={YASGUI:"mode-yasgui",YASQE:"mode-yasqe",YASR:"mode-yasr"}},115:function(e,t,r){"use strict";r.r(t),r.d(t,"YasqeMode",(function(){return n}));var n={WRITE:"WRITE",READ:"READ",PROTECTED:"PROTECTED"}},118:function(e,t){function r(e,t){return{showToastMessageWithDelay:function(r){return new Promise((function(n){e.success(t.instant(r)),setTimeout(n,300)}))}}}angular.module("graphdb.framework.utils.notifications",[]).factory("Notifications",r),r.$inject=["toastr","$translate"]},120:function(e,t,r){"use strict";r.r(t),r.d(t,"removeSpecialChars",(function(){return a})),r.d(t,"toBoolean",(function(){return i})),r.d(t,"toTitleCase",(function(){return o}));var n=r(24),a=function(e){return e.replace(/[()']/g,"")},i=function(e){return"string"==typeof e?"true"===e:Boolean(e)},o=function(e){return e?Object(n.upperFirst)(e.toLowerCase()):e}},138:function(e,t,r){"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,o(n.key),n)}}function o(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var a=r.call(e,t||"default");if("object"!=n(a))return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==n(t)?t:t+""}r.r(t),r.d(t,"StartMode",(function(){return s})),r.d(t,"GraphsConfig",(function(){return c}));var s={QUERY:"query",NODE:"node",SEARCH:"search"},c=function(){return e=function e(t,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:s.SEARCH,i=arguments.length>3?arguments[3]:void 0,o=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],c=!(arguments.length>5&&void 0!==arguments[5])||arguments[5],l=arguments.length>6?arguments[6]:void 0,u=arguments.length>7?arguments[7]:void 0,d=arguments.length>8?arguments[8]:void 0,p=arguments.length>9?arguments[9]:void 0,f=arguments.length>10?arguments[10]:void 0,h=arguments.length>11?arguments[11]:void 0,g=arguments.length>12?arguments[12]:void 0,m=arguments.length>13?arguments[13]:void 0,y=arguments.length>14?arguments[14]:void 0,v=arguments.length>15?arguments[15]:void 0,x=arguments.length>16?arguments[16]:void 0,w=arguments.length>17?arguments[17]:void 0,b=arguments.length>18?arguments[18]:void 0,S=arguments.length>19?arguments[19]:void 0,C=arguments.length>20?arguments[20]:void 0;a(this,e),this._id=t,this._name=r,this._startMode=n,this._owner=i,this._startQueryIncludeInferred=o,this._startQuerySameAs=c,this._startGraphQuery=l,this._startIRI=u,this._startIRILabel=d,this._expandQuery=p,this._resourceQuery=f,this._predicateLabelQuery=h,this._resourcePropertiesQuery=g,this._shared=m,this._description=y,this._hint=v,this._startGraphQueryDescription=x,this._expandQueryDescription=w,this._resourceQueryDescription=b,this._predicateLabelQueryDescription=S,this._resourcePropertiesQueryDescription=C},(t=[{key:"isStartMode",value:function(e){return this.startMode===e}},{key:"isDefaultGraph",value:function(){return"Minimal"===this.name||"Advanced"===this.name}},{key:"getPropertyDescription",value:function(e){return this["".concat(e,"Description")]}},{key:"getQueryType",value:function(e){var t;return this.isStartMode(s.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||""}},{key:"updateModel",value:function(e,t){return this.isStartMode(s.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}},{key:"toSavePayload",value:function(){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}}},{key:"id",get:function(){return this._id},set:function(e){this._id=e}},{key:"name",get:function(){return this._name},set:function(e){this._name=e}},{key:"startMode",get:function(){return this._startMode},set:function(e){this._startMode=e}},{key:"owner",get:function(){return this._owner},set:function(e){this._owner=e}},{key:"startQueryIncludeInferred",get:function(){return this._startQueryIncludeInferred},set:function(e){this._startQueryIncludeInferred=e}},{key:"startQuerySameAs",get:function(){return this._startQuerySameAs},set:function(e){this._startQuerySameAs=e}},{key:"startGraphQuery",get:function(){return this._startGraphQuery},set:function(e){this._startGraphQuery=e}},{key:"startIRI",get:function(){return this._startIRI},set:function(e){this._startIRI=e}},{key:"startIRILabel",get:function(){return this._startIRILabel},set:function(e){this._startIRILabel=e}},{key:"expandQuery",get:function(){return this._expandQuery},set:function(e){this._expandQuery=e}},{key:"resourceQuery",get:function(){return this._resourceQuery},set:function(e){this._resourceQuery=e}},{key:"predicateLabelQuery",get:function(){return this._predicateLabelQuery},set:function(e){this._predicateLabelQuery=e}},{key:"resourcePropertiesQuery",get:function(){return this._resourcePropertiesQuery},set:function(e){this._resourcePropertiesQuery=e}},{key:"shared",get:function(){return this._shared},set:function(e){this._shared=e}},{key:"description",get:function(){return this._description},set:function(e){this._description=e}},{key:"hint",get:function(){return this._hint},set:function(e){this._hint=e}},{key:"startGraphQueryDescription",get:function(){return this._startGraphQueryDescription},set:function(e){this._startGraphQueryDescription=e}},{key:"expandQueryDescription",get:function(){return this._expandQueryDescription},set:function(e){this._expandQueryDescription=e}},{key:"resourceQueryDescription",get:function(){return this._resourceQueryDescription},set:function(e){this._resourceQueryDescription=e}},{key:"predicateLabelQueryDescription",get:function(){return this._predicateLabelQueryDescription},set:function(e){this._predicateLabelQueryDescription=e}},{key:"resourcePropertiesQueryDescription",get:function(){return this._resourcePropertiesQueryDescription},set:function(e){this._resourcePropertiesQueryDescription=e}}])&&i(e.prototype,t),r&&i(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,r}()},159: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 o}));var n=r(138),a=function(e){return 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=function(e){return 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)},o=function(e){return e.map((function(e){return i(e)}))}},160: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 o}));var 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-_]+$"),o=new RegExp("^[0-9]+$")},185: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("".concat("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("".concat("rest/dependencies","/matrix"),{params:{mode:r,classes:_.map(t,(function(e){return e.name})),graphURI:n}})},getRelationshipsClasses:function(t,r){return e.get("".concat("rest/dependencies","/classes"),{params:{mode:t,graphURI:r}})},getRelationshipsStatus:function(t){return e.get("".concat("rest/dependencies","/status"),{params:{graphURI:t}})},calculateRelationships:function(t){return e.get("".concat("rest/dependencies","/update"),{params:{graphURI:t}})},getPredicates:function(t,r,n){return e.get("".concat("rest/dependencies","/predicates"),{params:{from:t,to:r,mode:"all",graphURI:n}})},getInstanceNode:function(t){return e.get("".concat("rest/explore-graph","/node"),{params:t})},getInstanceNodeLinks:function(t){return e.get("".concat("rest/explore-graph","/links"),{params:t})},getProperties:function(t){return e.get("".concat("rest/explore-graph","/properties"),{params:t})},updateGraph:function(t){var r={headers:{"Content-Type":"application/json"}};return r=Object.assign(r,t),e.post("".concat("rest/explore-graph","/graph"),r)},getRdfsLabelAndComment:function(t,r,n){var a=n||{};return e({url:"rest/explore/details",method:"GET",params:_.extend(a,{uri:t,languages:r}),headers:{Accept:"application/json"}})}}}},295:function(e,t){function r(e){return{initLazyList:function(t,r,n,a,i){return e((function(){var e=t+a-1,o=Math.max(0-a,e),s=Math.min(e+r-1,i.length);o>s?n([]):$.isArray(i)&&n(i.slice(o,s+1))}),100,!0)}}}angular.module("graphdb.framework.graphexplore.services.uiscroll",[]).factory("UiScrollService",r),r.$inject=["$timeout"]},296:function(e,t){angular.module("graphdb.framework.graphexplore.services.rdfsdetails",[]).factory("RdfsLabelCommentService",(function(){return{processAndFilterLabelAndComment:function(e){function t(e){var t={};for(var r in e)if(e.hasOwnProperty(r)){var n=r;r.indexOf(":")>-1&&(n=r,r=r.split(":")[1].toLowerCase()),t[r]=e[n]}return t}var r=e.results.bindings,n=[],a=[];_.each(r,(function(e){var r;angular.isUndefined(e.label)||(r=t(e.label),n.push(r)),angular.isUndefined(e.comment)||(r=t(e.comment),a.push(r))}));var i=function(e){return"en"===e.lang||"de"===e.lang},o=$.grep(n,i)[0],s=$.grep(a,i)[0],c=angular.isUndefined(o)?n.length>0?n[0].value:void 0:o.value,l=angular.isUndefined(s)?a.length>0?a[0].value:void 0:s.value;return{rdfsLabel:c,rdfsComment:l}}}}))},297: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("".concat("rest/explore-graph/saved","/").concat(encodeURIComponent(t)))},editSavedGraph:function(t){return e.put("".concat("rest/explore-graph/saved","/").concat(encodeURIComponent(t.id)),t)},deleteSavedGraph:function(t){return e.delete("".concat("rest/explore-graph/saved","/").concat(encodeURIComponent(t.id)))},addNewSavedGraph:function(t){return e.post("rest/explore-graph/saved",t)}}}},298:function(e,t,r){"use strict";r.r(t);var n=r(159);angular.module("graphdb.framework.rest.graphconfig.service",[]).factory("GraphConfigRestService",i);var a="".concat("rest/explore-graph","/config");function i(e){return{getGraphConfigs:function(){return e.get(a)},getGraphConfigSamples:function(){return e.get("".concat("rest/explore-graph","/samples"))},loadGraphForConfig:function(t,r,n,i){return e.get("".concat(a,"/graph/").concat(encodeURIComponent(t.id),"?includeInferred=").concat(r,"&linksLimit=").concat(n,"&sameAsState=").concat(i))},getConfig:function(t){return e.get("".concat(a,"/").concat(encodeURIComponent(t))).then((function(e){return Object(n.mapGraphsConfigResponseToModel)(e.data)}))},createGraphConfig:function(t){return e.post(a,t)},updateGraphConfig:function(t){return e.put("".concat(a,"/").concat(encodeURIComponent(t.id)),t)},deleteGraphConfig:function(t){return e.delete("".concat(a,"/").concat(encodeURIComponent(t.id)))},validateQuery:function(t,r,n,a,i){return e({method:"POST",url:"".concat("rest/explore-graph","/validate"),data:{query:t,queryType:r,params:n,all:a,oneOf:i}})}}}i.$inject=["$http"]},299:function(e,t,r){"use strict";r.r(t);r(15);var n=r(33);function a(e,t,r,a,i,o,s,c,l,u,d,p,f,h,g,m,y){e.hasMoreGraphs=!1,e.classHierarchyData={},e.instancesObj={},e.instancesQueryObj={},e.instancesObj.items=[],e.instancesNotFiltered=[],e.isWarningShowed=!1,e.onopen=e.onclose=function(){return angular.noop()},e.currentBrowserLimit=2e3,f.firefox?e.currentBrowserLimit=50:(f.safari||f.msie||f.msedge)&&(e.currentBrowserLimit=400),e.graphsDropdownToggled=function(t){e.hasMoreGraphs&&t&&s.warning(y.instant("dependencies.graphs.too.many.warning",{graphsLimit:n.NumberUtils.formatNumberToLocaleString(1e3,y.use())}))};var v={},x=0,w=0;t.key="",v.get=function(t,r,n){return l.initLazyList(t,r,n,x,e.instancesObj.items)};var b=allGraphs,S=function(){if(e.getActiveRepository())return m.resolveGraphs(a.getActiveRepository(),1001).success((function(t){e.graphsInRepo=t.results.bindings,e.hasMoreGraphs=e.graphsInRepo.length>1002,C()})).error((function(t){e.repositoryError=getError(t),s.error(getError(t),y.instant("graphexplore.error.getting.graphs"))}))},C=function(){var t=h.get("classHierarchy-selectedGraph-".concat(a.getActiveRepository()));null!==t&&e.graphsInRepo.some((function(e){return e.contextID.uri===t.contextID.uri}))?b=t:h.set("classHierarchy-selectedGraph-".concat(a.getActiveRepository()),b)},I=function(){return e.instancesObj.items.length<1e3?y.instant("graphexplore.search.class.instances"):y.instant("graphexplore.search.first.class.instances")};t.$watch((function(){return t.key}),(function(){x=0,_.each(e.instancesObj.items,(function(e){t.key>e&&x++})),w++})),v.revision=function(){return w},e.adapterContainer={adapter:{remain:!0}};var R=[];R.push(e.$on("goToDomainRangeGraphView",(function(e,t){L(t)}))),R.push(e.$on("classCount",k)),R.push(e.$on("repositoryIsSet",(function(){if(!i.isLicenseValid())return;if(N===a.getActiveRepository())return;N=a.getActiveRepository();if(e.repositoryError=null,!N)return;b=allGraphs,S().then(P)}))),R.push(t.$on("$translateChangeSuccess",(function(){e.instancesSearchPlaceholder=I()})));function k(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(){d(E,100,!0)}}},null===h.get(g.CLASS_HIERARCHY_CURRENT_SLIDER_VALUE)&&r>e.currentBrowserLimit&&(a=e.currentBrowserLimit,f.chrome?s.warning(y.instant("graphexplore.disabling.animations",{classLimit:a}),y.instant("graphexplore.reducing.visual.effects")):s.warning(y.instant("graphexplore.browser.performance",{browser:f.name,classLimit:a}),y.instant("graphexplore.reducing.visual.effects"))));var i=h.get(g.CLASS_HIERARCHY_SWITCH_PREFIXES);null!=i&&"true"!==i&&(e.showExternalElements=!0),n?e.classCountSlider.value=n:r>=1500&&(e.classCountSlider.value=1500,s.warning(y.instant("graphexplore.class.count.slider",{count:1500}),y.instant("graphexplore.reducing.class.count"))),r>=25&&!window.ActiveXObject&&"ActiveXObject"in window&&!e.isWarningShowed&&(e.classCountSlider.value=25,e.isWarningShowed=!0,s.warning(y.instant("graphexplore.class.count.browser",{count:25}),y.instant("graphexplore.reducing.class.count"))),d((function(){e.$broadcast("reCalcViewDimensions");var t=document.getElementById("rzslider"),r=0;t.addEventListener("wheel",(function(t){t.preventDefault(),t.stopPropagation();var n=(new Date).getTime();if(n-r>100){r=n;var a=e.classCountSlider.value,i=e.classCountSlider.options.step||1;t.deltaY<=-1?a+=i:t.deltaY>=1&&(a-=i),(a=Math.max(e.classCountSlider.options.floor,Math.min(e.classCountSlider.options.ceil,a)))!==e.classCountSlider.value&&e.$apply((function(){e.classCountSlider.value=a,d(E,100,!0)}))}}))}),200),E()}function E(){e.currentSliderValue=e.classCountSlider.value}function L(e){var t=e.data.fullName,n=e.data.name;c.checkDomainRangeData(t).success((function(e,a){204===a?s.warning(y.instant("graphexplore.no.domain.range",{name:n})):(h.set(g.CLASS_HIERARCHY_LAST_SELECTED_CLASS,r.hash()),r.hash("").path("domain-range-graph").search("uri",t).search("name",n))})).error((function(){s.error(y.instant("graphexplore.error.request.failed",{name:n}))}))}function A(){r.replace().hash("1"),e.instancesObj.items=[],e.showExternalElements=!1,e.showClassInfoPanel=!1,h.clearClassHieararchyState(),e.hidePrefixes="true"===h.get(g.CLASS_HIERARCHY_HIDE_PREFIXES),e.currentSliderValue=void 0,e.classHierarchyData={},t.$broadcast("angucomplete-alt:clearInput")}function T(){e.hasClassHierarchy()&&d((function(){$("#toolbar").removeClass("ng-hide")}),0)}R.push(e.$on("$destroy",(function(){R.forEach((function(e){return e()}))}))),e.datasource=v,e.goToDomainRangeGraphView=L,e.toggleClassInfoSidePanel=function(){e.showClassInfoPanel=!e.showClassInfoPanel,t.$broadcast("sidePanelClosed")},e.toggleHidePrefixes=function(){e.hidePrefixes=!e.hidePrefixes},e.getActiveRepositoryNoError=function(){if(!e.repositoryError)return a.getActiveRepository()},e.isSystemRepository=function(){return a.isSystemRepository()},e.confirmReloadClassHierarchy=function(){p.openSimpleModal({title:y.instant("confirm.operation"),message:y.instant("graphexplore.calculating.hierarchy"),warning:!0}).result.then((function(){A(),e.loader=!0,e.hierarchyError=!1,c.reloadClassHierarchy(b.contextID.uri).success((function(t){e.loader=!1,e.classHierarchyData=t,T(),k()})).error((function(t){e.loader=!1,e.hierarchyError=getError(t),s.error(getError(t),y.instant("graphexplore.error.rdf.class.request"))}))}))},e.focusOnRoot=function(){e.$broadcast("rootFocus")},e.copyToClipboard=function(e){p.openCopyToClipboardModal(e)},e.searchedClassCallback=function(e){if(e){var 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},S(),e.$watch("instancesObj.items",(function(){e.instancesObj.items.length>0&&d((function(){e.adapterContainer.adapter.reload()}),30)})),e.$watch("selectedClass",(function(){e.showClassInfoPanel&&function(t){var r=t.data.fullName,n=t.data.name;if(n===r){var a=n.lastIndexOf("#");n=n.substring(a+1)}e.encodedUri=encodeURIComponent(r);var i=encodeURIComponent("prefix onto:<http://www.ontotext.com/>\nselect ?s {\n ?s a <"+r+"> .\n}");e.viewInstancesUri="sparql?name="+n+"&infer=true&sameAs=false&query="+i+"&execute=true",c.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,c.getClassInstances(r).success((function(t){e.instancesObj.items=[],_.each(t,(function(t,r){var 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=I(),e.instancesNotFiltered=e.instancesObj.items})).error((function(){s.error(y.instant("graphexplore.error.instances.request"))}))}(e.selectedClass)})),$(document).ready((function(){$(".prefix-toggle").click((function(){$(".tooltip").hide()}))}));var N=a.getActiveRepository();function P(){A(),!e.isSystemRepository()&&e.isLicenseValid()&&(e.hierarchyError=!1,e.loader=!0,c.getClassHierarchyData(b.contextID.uri).success((function(t,r){e.showExternalElements=!0,e.loader=!1,e.classHierarchyData=t,207===r&&s.warning(y.instant("graphexplore.update.diagram"),y.instant("graphexplore.repository.data.changed")),T()})).error((function(t){e.loader=!1,e.hierarchyError=getError(t),s.error(getError(t),y.instant("graphexplore.error.rdf.class.request"))})))}e.hasClassHierarchy=function(){return e.classHierarchyData.classCount&&e.getActiveRepositoryNoError()&&!e.isSystemRepository()},e.isLicenseValid=function(){return i.isLicenseValid()},e.chosenGraph=function(e){b=e,P(),h.set("classHierarchy-selectedGraph-".concat(a.getActiveRepository()),b)},e.getSelGraphValue=function(){return b.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",a),a.$inject=["$scope","$rootScope","$location","$repositories","$licenseService","$window","toastr","GraphDataRestService","UiScrollService","RdfsLabelCommentService","$timeout","ModalService","bowser","LocalStorageAdapter","LSKeys","RDF4JRepositoriesRestService","$translate"]},300:function(e,t,r){"use strict";r.r(t);r(15);function n(e,t,r,n,a,i,o,s,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=function(){return angular.noop()};var f={},h=0,g=0;r.key="",f.get=function(t,r,n){return l.initLazyList(t,r,n,h,e.predicatesObj.items)},r.$watch((function(){return r.key}),(function(){h=0,_.each(e.predicatesObj.items,(function(e){r.key>e&&h++})),g++})),f.revision=function(){return g},e.adapterContainer={adapter:{remain:!0}};var m=o.get(s.DOMAIN_RANGE_COLLAPSE_EDGES);function y(){var e=o.get(s.CLASS_HIERARCHY_LAST_SELECTED_CLASS);t.search("").hash(e).path("hierarchy")}e.collapseEdges=null===m||"true"===m,e.datasource=f,e.$on("reloadDomainRangeGraphView",(function(e,r){var 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,o.set(s.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){var 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="";var a=r.allEdges?r.allEdges:n.allEdges;_.each(a,(function(t){var 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()}))}));var 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"]},301:function(e,t,r){"use strict";r.r(t),function(e){var t=r(33),n="WAIT",a="NO_REPO",i="READY",o="IN_PROGRESS",s="ERROR",c={contextID:{type:"all",value:"all.graphs.label",uri:""}};function l(e){if(e<1e3)return e;var t=Math.floor(Math.log(e)/Math.log(1e3)),r=e/Math.pow(1e3,t);return(r=r%1>1/Math.pow(1e3,t-1)?r.toFixed(2):r.toFixed(0))+["K","M","G","T","P","H"][t-1]}function u(e,r,l,u,d,p,f,h,g,m,y){var v=null;e.hasMoreGraphs=!1,e.status=l.getActiveRepository()?n:a,e.graphsDropdownToggled=function(r){e.hasMoreGraphs&&r&&u.warning(y.instant("dependencies.graphs.too.many.warning",{graphsLimit:t.NumberUtils.formatNumberToLocaleString(1e3,y.use())}))};var x=c,w=function(){m.resolveGraphs(l.getActiveRepository(),1001).success((function(t){e.graphsInRepo=t.results.bindings,e.hasMoreGraphs=e.graphsInRepo.length>1002,b(),e.isSystemRepository()?"READY"!==e.status&&C():(e.status="WAIT",C(!0))})).error((function(t){e.repositoryError=getError(t),u.error(getError(t),y.instant("graphexplore.error.getting.graph"))}))},b=function(){var t=g.get("dependencies-selectedGraph-".concat(l.getActiveRepository()));null!==t&&e.graphsInRepo.some((function(e){return e.contextID.uri===t.contextID.uri}))?x=t:g.set("dependencies-selectedGraph-".concat(l.getActiveRepository()),x)},S=function(t){d3.select("#dependencies-chord").html(""),e.status=n,p.getRelationshipsData(t,e.direction,x.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=i})).error((function(t){e.status=i,u.error(getError(t),y.instant("graphexplore.error.dependencies.count"))}))},C=function(t){(e.status!==i||t)&&(e.status=n,p.getRelationshipsStatus(x.contextID.uri).success((function(t){if(e.status=t,e.status===o){if(null!==v)return;v=d(C,2e3)}e.status===i&&(null!==v&&(d.cancel(v),v=null),p.getRelationshipsClasses(e.direction,x.contextID.uri).success((function(t,r){e.allClasses.items=_.filter(t,E),e.allNotFilteredClasses=t,e.selectedClasses=void 0,angular.isUndefined(e.selectedClasses)&&(e.selectedClasses=t.slice(0,10)),S(e.selectedClasses),207===r&&u.warning(y.instant("graphexplore.update.diagram"),y.instant("graphexplore.repository.data.changed"))}))),0===e.status.indexOf("ERROR;")&&(e.status=s,u.error(y.instant("graphexplore.error.dependencies.calc",{error:e.status.substring("ERROR;".length)})))})).error((function(t){e.status=s,u.error(getError(t),y.instant("graphexplore.error.dependencies.count.status"))})))};e.allClasses={},e.allClasses.items=[],e.allNotFilteredClasses=[],e.direction="all";var I={},R=0,k=0;function E(t){return-1!==t.name.toLowerCase().indexOf(e.classQuery.query.toLowerCase())}r.key="",I.get=function(t,r,n){f.initLazyList(t,r,n,R,e.allClasses.items)},r.$watch((function(){return r.key}),(function(){R=0,_.each(e.allClasses.items,(function(e){r.key>e&&R++})),k++})),I.revision=function(){return k},e.datasource=I,e.adapterContainer={adapter:{remain:!0}},e.classQuery={},e.classQuery.query="",e.classFilterFunc=E,e.$watch("allClasses.items",(function(){e.allClasses.items.length>0&&d((function(){e.adapterContainer.adapter.reload()}),30)})),e.$watch("direction",(function(){!l.getActiveRepository()||e.isSystemRepository()||l.isActiveRepoFedXType()||w()})),e.$on("$destroy",(function(){d.cancel(v)})),e.isLoading=function(){return e.status===o||e.status===n},e.confirmCalculateDependencies=function(){h.openSimpleModal({title:y.instant("confirm.operation"),message:y.instant("graphexplore.calculating.relationships"),warning:!0}).result.then((function(){e.calculateDependencies()}))},e.calculateDependencies=function(){e.status=n,e.selectedClasses=void 0,p.calculateRelationships(x.contextID.uri).success((function(t){0===t.indexOf("ERROR;")?u.error(y.instant("graphexplore.error.dependencies.calc",{error:e.status.substring("ERROR;".length)})):C()})).error((function(e){u.error(y.instant("graphexplore.error.could.not.force.count",{error:getError(e)}))}))},e.addClass=function(t){e.selectedClasses.push(t),S(e.selectedClasses)},e.removeClass=function(t){_.remove(e.selectedClasses,(function(e){return e.name===t.name})),S(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})),S(e.selectedClasses)},e.removeClassByName=function(t){_.remove(e.selectedClasses,(function(e){return e.name===t})),S(e.selectedClasses)},e.removeAllClasses=function(){e.selectedClasses=[],S(e.selectedClasses)},e.isSystemRepository=function(){return"SYSTEM"===l.getActiveRepository()};var L=e.$on("repositoryIsSet",(function(){e.classQuery={},e.classQuery.query="",e.repositoryError=null,x=c,l.getActiveRepository()&&!l.isActiveRepoFedXType()?w():e.status=a}));window.addEventListener("beforeunload",(function e(){L(),window.removeEventListener("beforeunload",e)})),e.selectGraph=function(e){x=e,C(!0),g.set("dependencies-selectedGraph-".concat(l.getActiveRepository()),x)},e.getSelectedGraphValue=function(){return x.contextID.value},e.isAllGraphsSelected=function(){return"all.graphs.label"===e.getSelectedGraphValue()}}Object.defineProperty(e,"allGraphs",{get:function(){return c}}),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",u).config(["$uibTooltipProvider",function(e){e.options({appendToBody:!0})}]).filter("humanize",(function(){return l})),u.$inject=["$scope","$rootScope","$repositories","toastr","$timeout","GraphDataRestService","UiScrollService","ModalService","LocalStorageAdapter","RDF4JRepositoriesRestService","$translate"]}.call(this,r(18))},302:function(e,t,r){"use strict";r.r(t);r(10),r(29),r(60);var n=r(647),a=r(658),i=(r(15),r(160)),o=r(120),s=r(11),c=r(42);function l(e){return function(e){if(Array.isArray(e))return d(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||u(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function u(e,t){if(e){if("string"==typeof e)return d(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?d(e,t):void 0}}function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function p(e){return(p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function f(e,t,r,d,f,h,g,m,y,v,x,w,b,S,C,I,R,k,E,L,A,T,N){e.languageChanged=!1,e.propertiesObj={},e.propertiesObj.items=[],e.propertiesQueryObj={},e.propertiesQueryObj.query="",e.propertiesSearchPlaceholder=L.instant("visual.search.instance.placeholder"),e.propertiesNotFiltered=[],e.searchVisible=!1,e.nodeSelected=!1,e.queryResultsMode=!1,e.embedded=y.search().embedded,e.openedNodeInfoPanel=void 0,e.invalidLimit=!1,e.INVALID_LINKS_MSG=L.instant("sidepanel.invalid.limit.links.msg"),e.INVALID_LINKS_TOOLTIP=L.instant("sidepanel.invalid.limit.links.tooltip"),e.datasource=void 0,e.adapterContainer={adapter:{remain:!0}},e.hasInitedRepository=!1,e.defaultSettings={linksLimit:20,includeInferred:!0,sameAsState:!0,languages:["en"],showLinksText:!0,preferredTypes:[],rejectedTypes:[],preferredPredicates:[],rejectedPredicates:["http://dbpedia.org/property/logo","http://dbpedia.org/property/hasPhotoCollection","http://dbpedia.org/property/website","http://dbpedia.org/property/homepage","http://dbpedia.org/ontology/thumbnail","http://xmlns.com/foaf/0.1/depiction","http://xmlns.com/foaf/0.1/homepage","http://xmlns.com/foaf/0.1/mbox","http://dbpedia.org/ontology/wikiPage*","http://dbpedia.org/property/wikiPage*","http://factforge.net/*"],preferredTypesOnly:!1,preferredPredicatesOnly:!1,includeSchema:!0},e.saveSettings=_.cloneDeep(e.defaultSettings),e.defaultGraphConfig={id:"default",name:"Easy graph",startMode:"search"},t.key="",e.onopen=e.onclose=function(){return angular.noop()},e.goToHome=function(){G(),y.url("graphs-visualizations")},e.shouldShowSettings=function(){return e.configLoaded&&e.configLoaded.id===e.defaultGraphConfig.id},e.shouldDisableSameAs=function(){var t=$("#sameAsCheck");return e.settings&&!e.settings.includeInferred&&t.prop("checked")&&(t.prop("checked",!1),e.settings.sameAsState=!1),e.settings&&!e.settings.includeInferred},e.propertiesFilterFunc=function(t){return t.key.toLowerCase().indexOf(e.propertiesQueryObj.query.toLowerCase())>=0},e.toggleMoreInfo=function(e){angular.element(e.currentTarget).parent().next().toggle(200),angular.element(e.currentTarget).children("span").toggleClass("icon-caret-down").toggleClass("icon-caret-up")},e.copyToClipboard=function(e){w.openCopyToClipboardModal(e)},e.resetSettings=function(){e.settings=_.cloneDeep(e.defaultSettings),e.validateLinksLimit(),F()},e.changeLimit=function(t){var r=e.settings.linksLimit+t;r<1&&(r=1),r>1e3&&(r=1e3),e.settings.linksLimit=r},e.validateLinksLimit=function(){e.invalidLimit=!i.NUMBER_PATTERN.test(e.settings.linksLimit)},e.showSettings=function(){e.showInfoPanel=!0,e.showFilter=!0,e.showNodeInfo=!1,e.showPredicates=!1,e.saveSettings?e.settings=_.cloneDeep(e.saveSettings):e.settings=_.cloneDeep(e.defaultSettings),F()},e.updateSettings=function(){e.invalidLimit?f.error(e.INVALID_LINKS_TOOLTIP,e.INVALID_LINKS_MSG):(e.saveSettings=e.settings,e.saveSettings.languages=_.map(e.saveSettings.languagesMap,(function(e){return e.text})),e.saveSettings.preferredTypes=_.map(e.saveSettings.preferredTypesMap,(function(e){return e.text})),e.saveSettings.rejectedTypes=_.map(e.saveSettings.rejectedTypesMap,(function(e){return e.text})),e.saveSettings.preferredPredicates=_.map(e.saveSettings.preferredPredicatesMap,(function(e){return e.text})),e.saveSettings.rejectedPredicates=_.map(e.saveSettings.rejectedPredicatesMap,(function(e){return e.text})),e.rootNodeIri?H(e.rootNodeIri):e.queryResultsMode&&y.search().query?q(y.search().query,y.search().sameAs,y.search().inference):"query"===e.configLoaded.startMode&&Z(e.configLoaded),Q(),e.showInfoPanel=!1,e.showFilter=!1,C.set(I.GRAPHS_VIZ,e.saveSettings))},e.getGraphConfigs=function(t){k.getGraphConfigs().success((function(r){e.graphConfigs=r,t&&t()})).error((function(e){f.error(getError(e),L.instant("graphexplore.error.graph.configs.short.msg"))}))},e.findConfigById=function(t){return t===e.defaultGraphConfig.id?e.defaultGraphConfig:$.grep(e.graphConfigs,(function(e){return e.id===t}))[0]},e.easyGraphSearch=function(t){e.configLoaded=e.defaultGraphConfig,e.openUri(t)},e.deleteConfig=function(t){w.openSimpleModal({title:L.instant("common.confirm"),message:L.instant("graphexplore.delete.graph",{configName:t.name}),warning:!0}).result.then((function(){k.deleteGraphConfig(t).success((function(){e.getGraphConfigs(),e.refreshSavedGraphs()})).error((function(e){f.error(getError(e),L.instant("graphexplore.error.cannot.delete.config"))}))}))},e.goToGraphConfig=function(e){j({config:e.id},{config:e}),G(),Z(e)},e.replaceIRIWithPrefix=function(t){var r=e.namespaces,n=_.findLast(r,(function(e){return 0===t.indexOf(e.uri)}));return n?n.prefix+":"+t.substring(n.uri.length):t};var P=[];P.push(t.$on("$translateChangeSuccess",(function(){e.INVALID_LINKS_MSG=L.instant("sidepanel.invalid.limit.links.msg"),e.INVALID_LINKS_TOOLTIP=L.instant("sidepanel.invalid.limit.links.tooltip"),e.propertiesSearchPlaceholder=L.instant("visual.search.instance.placeholder")}))),P.push(T.onAutocompleteEnabledUpdated((function(t){e.isAutocompleteEnabled=t}))),P.push(T.onSelectedRepositoryIdUpdated((function(t){t?N.getNamespaces(t).then((function(t){e.repositoryNamespaces=t,e.namespaces=t.namespaces})).catch((function(e){var t=getError(e);f.error(t,L.instant("error.getting.namespaces.for.repo"))})):e.repositoryNamespaces=new s.NamespacesListModel}))),P.push(e.$on("repositoryIsSet",(function(t,r){r.newRepo&&(e.hasInitedRepository=!1),ge(r.newRepo),r.newRepo&&(G(),$(".graph-visualization svg").empty(),y.search().query&&(e.goToHome(),z()))})));P.push(t.$watch((function(){return t.key}),(function(){te=0,_.each(e.propertiesObj.items,(function(e){t.key>e&&te++})),re++})));P.push(e.$watch("propertiesObj.items",(function(){angular.isDefined(e.propertiesObj.items)&&e.propertiesObj.items.length>0&&h((function(){e.adapterContainer.adapter.reload()}),500)})));var O=!1,D=0;function M(e){O&&e.stopPropagation()}document.addEventListener("keydown",M,!0);e.$on("$destroy",(function(){P.forEach((function(e){return e()})),document.removeEventListener("keydown",M,!0)}));var j=function(t,r){e.embedded&&(t.embedded=!0),y.search(t),y.state(r)},G=function(){e.searchVisible=!1,e.nodeSelected=!1,e.configLoaded=null,e.queryResultsMode=!1,e.lastSavedGraphName=null,e.lastSavedGraphId=null,e.shared=!1,e.numberOfPinnedNodes=0,ne={},ae=0},U=function(){return A.isActive()?e.defaultSettings:e.saveSettings},Q=function(){U().showLinksText?d3.selectAll("svg .link-wrapper text").style("display","block"):d3.selectAll("svg .link-wrapper text").style("display","none")},F=function(){e.settings.languagesMap=_.map(e.settings.languages,(function(e){return{text:e}})),e.settings.preferredTypesMap=_.map(e.settings.preferredTypes,(function(e){return{text:e}})),e.settings.rejectedTypesMap=_.map(e.settings.rejectedTypes,(function(e){return{text:e}})),e.settings.preferredPredicatesMap=_.map(e.settings.preferredPredicates,(function(e){return{text:e}})),e.settings.rejectedPredicatesMap=_.map(e.settings.rejectedPredicates,(function(e){return{text:e}}))},H=function(){e.rootNodeIri&&e.$broadcast("onRootNodeChange",e.rootNodeIri)},z=function(){y.search().query?(e.searchVisible=!1,e.queryResultsMode=!0,q(y.search().query,y.search().sameAs,y.search().inference)):e.$on("onRootNodeChange",(function(t,r){e.loading=!0;var n=U();angular.isDefined(r)&&(e.rootNodeIri=r,E.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");var r=(he=new fe).addNode(t.data,de/2,pe/2);ue=se,Ne(r,!0)})).catch((function(t){e.loading=!1,f.error(getError(t),L.instant("graphexplore.error.could.not.load.graph"))})))})),y.search().uri&&e.openUri(y.search().uri,!0),y.search().saved&&R.getSavedGraph(y.search().saved).success((function(t){e.loadSavedGraph(t)})).error((function(e){var t=getError(e);f.error(t,L.instant("graphexplore.error.could.not.open"))}))},q=function(t,r,n){var a=U(),i=void 0===r?a.sameAsState:!0===r,o=void 0===n?a.includeInferred:!0===n;e.loading=!0,E.updateGraph({query:t,linksLimit:a.linksLimit,languages:e.shouldShowSettings()?a.languages:[],includeInferred:o,sameAsState:i}).then((function(e){Ae(e)}),(function(t){e.loading=!1,f.error(getError(t.data),L.instant("graphexplore.error.cannot.load.graph"))}))},B=function(e,t){var r=e.split(" ");return t?[r[0],r[1],r[2]].join(">"):[r[0],r[2]].join(">")},W=function(e){return[e.source.iri,e.target.iri].join(">")},V=function(e){if(e.isTriple){var t=document.getElementById(Object(o.removeSpecialChars)(B(e.iri)));if(t&&void 0!==t.__data__.x)return t.__data__.x}return e.x},Y=function(e){if(e.isTriple){var t=document.getElementById(Object(o.removeSpecialChars)(B(e.iri)));if(t&&void 0!==t.__data__.y)return t.__data__.y}return e.y},K=function(e){var t=e.trim().split(" ");return"<<<".concat(t[0],"> <").concat(t[1],"> <").concat(t[2],">>>")},X=function(e){var t=e.source.isTriple?B(e.source.iri,!0):e.source.iri,r=e.target.isTriple?B(e.target.iri,!0):e.target.iri;return Object(o.removeSpecialChars)("".concat(t,">").concat(r,">marker"))},Z=function(t){e.configLoaded=t,"search"===t.startMode?e.searchVisible=!0:"node"===t.startMode&&t.startIRI?h((function(){e.openUri(t.startIRI,!0)}),0):"query"===t.startMode&&t.startGraphQuery&&(e.loading=!0,k.loadGraphForConfig(t,t.startQueryIncludeInferred,U().linksLimit,t.startQuerySameAs).then((function(e){Ae(e)}),(function(t){e.loading=!1,f.error(getError(t),L.instant("graphexplore.error.graph.load"))})))},J=function(){var t,r;y.search().config?(t=y.search().config,r=z,t===e.defaultGraphConfig.id?Z(e.defaultGraphConfig):k.getConfig(t).then((function(e){Z(e),r()})).catch((function(e){f.error(getError(e),L.instant("graphexplore.error.could.not.load.config",{configId:t}))}))):y.search().query||y.search().uri?(Z(e.defaultGraphConfig),z()):z()};S.onpopstate=function(t){G(),t.state&&(t.state.config?(Z(t.state.config),t.state.uri&&e.openUri(t.state.uri,!0)):t.state.savedGraph&&e.loadSavedGraph(t.state.savedGraph,!0))},e.embedded&&(y.search().query||y.search().uri||y.search().config||y.search().saved)&&(e.noGoHome=!0);var ee,te=0,re=0,ne={},ae=0,ie=16,oe=d3.zoom().scaleExtent([.1,10]),se=d3.zoomIdentity.translate(0,-70).scale(1);oe.on("zoom",(function(e){A.isActive()||(ue=e.transform,ee.attr("transform",ue))}));var ce,le,ue=se,de=1e3,pe=1e3;function fe(){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(){var e={},t={};_.each(this.links,(function(r){var 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){var t=this.nodes;Array.prototype.push.apply(this.links,function(e,t){return _.map(e,(function(e){var r={source:e.isTripleSource?$e(e.source):_.find(t,(function(t){return t.iri===e.source})),target:e.isTripleTarget?$e(e.target):_.find(t,(function(t){return t.iri===e.target})),predicates:e.predicates};if(e.isTripleSource||e.isTripleTarget){var n=r.source.isTriple?B(r.source.iri):r.source.iri,a=r.target.isTriple?B(r.target.iri):r.target.iri,i="".concat(n,">").concat(a);if(he.tripleLinksCopy.has(i)){var o,s=he.tripleLinksCopy.get(i);return(o=s[0].predicates).push.apply(o,l(r.predicates)),s.push(r),he.tripleLinksCopy.set(i,s),null}he.tripleLinksCopy.set(i,[r])}return r}))}(e,t));var r,n=function(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=u(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,a=function(){};return{s:a,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,i=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw i}}}}(he.tripleLinksCopy.keys());try{for(n.s();!(r=n.n()).done;){var a=r.value;1===he.tripleLinksCopy.get(a).length&&he.tripleLinksCopy.delete(a)}}catch(e){n.e(e)}finally{n.f()}this.links=this.links.filter((function(e){return null!==e})),this.computeConnectedness()};var 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){var 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){var n=r(e,t),a=_.map(n,(function(e){return e.predicates}));return _.uniq(_.flatten(a))},this.removeTriples=function(e){var t=this,r=[];this.tripleNodes.size>0&&e.forEach((function(e){t.tripleNodes.has(e)&&(t.tripleNodes.delete(e),t.links=_.reject(t.links,(function(t){var n=e.split(">"),a=B(t.source.iri),i=B(t.target.iri);if(a===e&&he.tripleNodes.delete(i)){var o=i.split(">");r.push({source:o[0],target:o[1]})}var s=a===e||i===e||t.source.iri===n[0]&&t.target.iri===n[1];return s&&(he.tripleLinksCopy.delete("".concat(a,">").concat(i)),he.tripleLinksCopy.delete("".concat(i,">").concat(a))),s})))})),r.forEach((function(e){t.links=_.reject(t.links,(function(t){return t.source.iri===e.source&&t.target.iri===e.target}))}))},this.removeNode=function(r){var n=[];this.links=_.reject(this.links,(function(e){var t=e.source.iri===r.iri||e.target.iri===r.iri;return t&&(e.target.isTriple&&n.push(B(e.target.iri)),e.source.isTriple||e.target.isTriple||n.push([e.source.iri,e.target.iri].join(">"))),t})),this.removeTriples(n);var 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){var n=[],a=this.links;this.links=_.reject(this.links,(function(i){var o=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(!o){var s;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||(s=r(i.source,a)):s=r(i.target,a),!s)return!1;o=(s[0].source.iri===e.iri||s[0].target.iri)&&(s[1].source.iri===e.iri||s[1].target.iri)}return o&&(i.target.isTriple&&n.push(B(i.target.iri)),i.source.isTriple||i.target.isTriple||n.push([i.source.iri,i.target.iri].join(">"))),o})),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;var n=B(e.iri);if(this.tripleNodes.has(n)){var a=this.tripleNodes.get(n);a.push(e),this.tripleNodes.set(n,a)}else e.weight=10,this.tripleNodes.set(n,[e])},this.copyState=function(){var e=_.map(this.nodes,(function(e){return{iri:e.iri,isTriple:e.isTriple,size:e.size,labels:_.cloneDeep(e.labels),types:_.cloneDeep(e.types),rdfRank:e.rdfRank,x:e.x,y:e.y,fixed:e.fixed}})),t=JSON.stringify(Array.from(this.tripleNodes.entries())),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:ae,type2color:ne,transform:ue}},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)&&(ae=t.colorIndex,ne=_.cloneDeep(t.type2color)),angular.isDefined(t.transform)&&(ue=d3.zoomIdentity.translate(t.transform.x,t.transform.y).scale(t.transform.k)),Re()}}e.datasource={get:function(t,r,n){return x.initLazyList(t,r,n,te,e.propertiesObj.items)},revision:function(){return re}},m.when(v.getPrincipal()).then((function(t){return function(t){var 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;var n=C.get(I.GRAPHS_VIZ);if(n&&"object"===p(n))try{e.saveSettings=n,void 0===e.saveSettings.includeSchema&&(e.saveSettings.includeSchema=e.defaultSettings.includeSchema,e.saveSettings.rejectedPredicates=[].concat(l(e.saveSettings.rejectedPredicates),l(e.defaultSettings.rejectedPredicates)).unique())}catch(t){e.saveSettings=_.cloneDeep(e.defaultSettings),C.set(I.GRAPHS_VIZ,e.saveSettings)}else e.saveSettings=_.cloneDeep(e.defaultSettings)}(t)})),e.showInfoPanel=!1;var he=new fe;function ge(t){!r.getActiveRepository()||e.hasInitedRepository&&!t||(e.hasInitedRepository=!0,t||e.getGraphConfigs(J))}e.addedTag=function(t){return t.text.indexOf(":")<0?(f.warning(L.instant("graphexplore.absolute.prefixed.iri")),null):(t.text=function(e,t){if(!/^<?(http|urn).*>?/.test(e)){var r=e.split(":"),n=r[0],a=r[1];if(!angular.isUndefined(a)){var i=g.getNamespaceUriForPrefix(t,n);if(i)return i+a}}return e}(t.text,e.namespaces),e.pageslideExpanded=!0,t)},e.validateTag=function(e,t,r){if(e.text.indexOf(":")<0)return r?f.warning(L.instant("graphexplore.absolute.prefixed.iri.option"),t):f.warning(L.instant("graphexplore.absolute.prefixed.iri"),t),!1;var n=e.text.indexOf("*");if(n>=0){if(!r)return f.warning(L.instant("graphexplore.wildcards.not.allowed"),t),!1;if(n<e.text.length-1)return f.warning(L.instant("graphexplore.wildcards.last.char"),t),!1}return!0},e.getTagClass=function(e){return e.endsWith("*")?"tag-item-wildcard":null},e.getActiveRepository=function(){return r.getActiveRepository()},e.isLicenseValid=function(){return d.isLicenseValid()},ge();var me=d3.scaleLinear().domain([0,9]).range(["hsl(0, 100%, 75%)","hsl(360, 90%, 82%)"]).interpolate(d3.interpolateHslLong),ye=d3.scaleLinear().domain([0,9]).range(["hsl(180, 50%, 75%)","hsl(540, 40%, 82%)"]).interpolate(d3.interpolateHslLong);e.getColor=function(e){angular.isUndefined(ne[e])&&(ne[e]=ae,ae++);var t=ne[e];return t>39?"#c2c2c2":t%2==0?me(t/2):ye(t/2)};var ve=d3.forceX(de/2).strength(.005),xe=d3.forceY(pe/2).strength(.005),we=d3.forceSimulation().force("x",ve).force("y",xe),be=d3.select(".main-container .graph-visualization").append("svg").attr("viewBox","0 0 "+de+" "+pe).attr("preserveAspectRatio","xMidYMid meet");be.append("rect").attr("width",10*de).attr("height",10*pe).attr("x",-(10*de-de)/2).attr("y",-(10*pe-pe)/2).style("fill","none").style("pointer-events","all").call(oe).on("click",(function(e){e.stopPropagation(),Pe(),we.stop()}));var Se=0,Ce=0,Ie=new function(){this.state=!1,this.setLoadingState=function(e){this.state=e},this.getLoadingState=function(){return this.state},this.init=function(e,t){d3.select(t).append("circle").attr("cx",(function(){return e.x})).attr("cy",(function(){return e.y})).attr("class","loader-container").attr("r",(function(){return e.size})).style("fill","fff").style("opacity","0.7"),d3.select(t).append("image").attr("xlink:href","js/angular/templates/loader/ot-loader.svg?v=3.0.2-TR2").attr("x",(function(){return e.x-e.size+5})).attr("y",(function(){return e.y-e.size})).attr("width",(function(){return 2*e.size})).attr("height",(function(){return 2*e.size})).attr("class","node-loader")}};function Re(t){d3.selectAll("svg g").remove(),d3.selectAll(".d3-tip").remove(),d3.selectAll(".menu-events").remove(),ee=be.append("g").attr("class","nodes-container").attr("transform",(function(){return angular.isDefined(ue)&&!t?ue:""}));var r,i=Object(a.a)().attr("class","d3-tip").customPosition((function(){var e=ce.getBoundingClientRect();return{top:e.bottom+10+"px",left:e.left-30+"px"}})).html((function(t){var r="";return t.fixed&&(r+='<i class="icon-pin"></i> '),t.types.length>0?r+=t.types.map((function(t){return"<div> · ".concat(e.replaceIRIWithPrefix(t),"</div>")})).join(""):r+="<i>".concat(L.instant("visual.node.tooltip.no_types"),"</i>"),r})),s=function(e){var t="";return t+=_.join(_.map(e.predicates,(function(t,r){if(0===r)return Ue(t);if(r<10)return" · "+Ue(t);if(10===r){var n=function(e){return e.predicates.length-10}(e),a=n>1?n+" predicates":n+" predicate";return" · "+L.instant("graphexplore.tip.text",{textToShow:a})}})),"")},l=Object(a.a)().attr("class","d3-tip").customPosition((function(e){var t=r.getBoundingClientRect(),n=function(e){var t=s(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:n+"px"}})).html((function(e){return s(e)})),u=function(){h.cancel(void 0),h.cancel(Se),ce=null,i.hide(),Ce=h((function(){Pe()}),500)};be.call(i);be.call(l);var d=be.selectAll(".link"),p=be.selectAll(".node"),g=d3.forceCollide((function(e){return e.size+5})).strength(.5),m=d3.forceManyBody().strength(-300),y=d3.forceCenter(de/2,pe/2);we.nodes(he.nodes).force("charge",m).force("collide",g).force("center",y).force("link",d3.forceLink(he.links).distance((function(e){return e.source.isTriple||e.target.isTriple?0:function(e){var t=$("<span></span>"),r=e.predicates[0].split("/"),n=r[r.length-1];t.addClass("predicate-text").text(n),$("body").append(t);var a=t.width()+2*e.source.size+2*e.target.size+50;return t.remove(),.75*a}(e)+30*e.connectedness}))),ee.append("defs").selectAll("marker").data(he.links).enter().append("marker").attr("class","arrow-marker").attr("id",(function(e){return X(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"),d=ee.selectAll(".link").data(he.links).enter().append("g").attr("class","link-wrapper").attr("id",(function(e){return Object(o.removeSpecialChars)(W(e))})).append("line").attr("class","link").style("stroke-width",1).style("fill","transparent").style("marker-end",(function(e){var t=X(e);return"url(#".concat(t,")")}));var v,x=ee.selectAll(".link-wrapper").append("text").text((function(e){return Ge(e)})).attr("class",(function(e){return e.predicates.length>1||he.tripleNodes.has(W(e))?"predicates":"predicate"})).attr("dy","-0.5em").style("text-anchor","middle").style("display",U().showLinksText?"":"none").on("mouseover",(function(e,t){e.stopPropagation(),function(e,t){h.cancel(void 0);var n=r=e.target;h((function(){r===n&&t.predicates.length>1&&l.show(t,r)}),300)}(e,t)})).on("mouseout",(function(){h.cancel(void 0),r=null,l.hide()})).on("click",(function(t,r){t.stopPropagation(),function(t,r){je();var n=W(r);if(1===r.predicates.length&&he.tripleNodes.has(n)){le=null;var a=he.tripleNodes.get(n)[0];if(Le(a,this,t.button)){var i={};i.iri=a.iri,i.pred=Ue(a.iri.split(" ")[1]),De(i)}return}!function(t){if(e.showNodeInfo=!1,e.showPredicates=t.predicates.length>1,e.showFilter=!1,e.showInfoPanel=!1,le===t)return e.showNodeInfo=!1,e.showInfoPanel=!1,void(le=null);le=t,e.showPredicates&&(e.predicates=_.map(t.predicates,(function(e){var r=function(e,t){var r=W(t);return he.tripleNodes.has(r)?he.tripleNodes.get(r).findIndex((function(t){return t.iri.indexOf(e)>=0})):-1}(e,t),n=r>-1;return{value:Ue(e),partOfTriple:n,linkId:n?W(t):"",nodeIndex:r}})),e.showInfoPanel=!0)}(r)}(t,r)})),w=0,b=null,S=null,C=function(t,r,n){var a=n||this.parentNode;Array.isArray(n)&&(a=n[r]),he.countLinks(t,he.links)<=U().linksLimit?Ne(t,!1,a):f.info(L.instant("graphexplore.increase.limit"),L.instant("graphexplore.node.at.max")),e.closeInfoPanel()};function I(e,t){var r,n,a,i,o=!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,o=!1}var s=ee.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=s),o&&(s=s.transition().duration(1e3).style("font-size",(function(){return n+"px"})).attr("opacity",i),"down-fixed"!==t&&s.remove())}var R=d3.drag().subject((function(e){return e})).on("start",(function(e,t){if(A.isActive())return;0===e.sourceEvent.button&&(t.fixedBeforeDrag=t.fixed,t.isBeingDragged=!0,t.beginDragging=!0,Pe(),d3.select(this).classed("dragging",!0),we.alphaTarget(.3).restart())})).on("drag",(function(t,r){r.isBeingDragged&&(r.fx=t.x,r.fy=t.y,r.fixed?r.beginDragging&&I(r,"fixed"):(e.numberOfPinnedNodes++,r.fixed=!0,I(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));we.alphaTarget(0)}));p=ee.selectAll(".node").data(he.nodes).enter().append("g").attr("class","node-wrapper").attr("id",(function(e){return e.iri})).append("circle").attr("class","node").attr("r",(function(e){return e.size})).style("fill",(function(t){return"greyColor"===t.types?"c2c2c2":e.getColor(t.types[0])})).on("mouseover",(function(t,r){var n=this;r.isBeingDragged||(h.cancel(Ce),Se=h((function(){(function(t,r){if(e.showInfoPanel)return!1;(Ee.closeIcon||Ee.expandIcon||Ee.focusIcon||Ee.copyURIIcon)&&Ee.removeIcons();if(we.alpha()<.1)return Ee.initIcons(t,r.parentNode),we.stop(),ke(),!0;return!1})(r,n)&&function(e,t){h.cancel(void 0);var r=ce=t.target;h((function(){ce===r&&i.show(e,ce)}),300)}(r,t)}),400))})).on("mouseout",u).on("click",(function(t,r){if(!t.button||0===t.button){var n=this;if(b&&S===n)return h.cancel(b),b=null,void C(r,0,n.parentNode);S=n,u(),e.showPredicates=!1,A.isActive()||(h.cancel(b),b=h((function(){Le(r,n,t),b=null}),540))}})).on("touchstart",(function(e,t){return function(e){w=0,v=h((function(){w<5&&_e(e),v=null}),1e3)}(t)})).on("touchmove",(function(){w++})).on("touchend",(function(){h.cancel(v),v=null})).on("contextmenu",(function(t,r){t.shiftKey||(t.preventDefault(),Pe(),e.closeInfoPanel(),r.fixed?(e.numberOfPinnedNodes--,r.fixed=!1,r.fx=null,r.fy=null,I(r,"up"),we.alpha(1).restart()):(e.numberOfPinnedNodes++,r.fixed=!0,I(r,"down")),function(e){ce&&i.show(e,ce)}(r))})).on("gdb-expand-node",(function(e,t){return C(t,0,e.srcElement.parentNode)})).on("gdb-show-node-info",(function(e,t){return Oe(t)})).call(R);var k=ee.selectAll(".node-wrapper").append("foreignObject").style("pointer-events","none").attr("width",(function(e){return 2*e.size*1.75}));ee.insert("g").attr("class","menu-events"),function(e){e.each((function(e){e.fontSize=n.a.Text.calcFontSizeRaw(e.labels[0].label,e.size,ie,!0)})).attr("height",(function(e){return 3*e.fontSize})).append("xhtml:div").attr("class","node-label-body").style("font-size",(function(e){return e.fontSize+"px"})).append("xhtml:div").html((function(e){return c.HtmlUtil.getText(e.labels[0].label).replaceAll("\n","<br>")}))}(k),we.on("tick",(function(){d.attr("x1",(function(e){return V(e.source)})).attr("y1",(function(e){return Y(e.source)})).attr("x2",(function(e){return V(e.target)})).attr("y2",(function(e){return Y(e.target)})),x.attr("x",(function(e){var t=V(e.source),r=V(e.target);return e.x=.5*(t+r)})).attr("y",(function(e){var t=Y(e.source),r=Y(e.target);return e.y=.5*(t+r)})).attr("transform",(function(e){return"rotate("+function(e,t){var r={x:V(e.source),y:Y(e.source)},n={x:V(e.target),y:Y(e.target)};if(t)return 180*Math.atan2(n.y-r.y,n.x-r.x)/Math.PI;var a=180*Math.atan2(n.y-r.y,n.x-r.x)/Math.PI;return a<=90&&a>=-90?a:(a>0?-1:1)*(180-Math.abs(a))}(e,e.direction)+", "+e.x+", "+e.y+")"})),p.attr("cx",(function(e){return e.x})).attr("cy",(function(e){return e.y})),ee.select(".node-loader").attr("x",(function(e){return e.x-e.size+3})).attr("y",(function(e){return e.y-e.size})),ee.select(".loader-container").attr("cx",(function(e){return e.x})).attr("cy",(function(e){return e.y})),k.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})),ke()})),angular.isDefined(Ie)&&Ie.setLoadingState(!1),e.loading&&(e.loading=!1),d3.selectAll(".link-wrapper").each((function(){var e=$(this).attr("id").split(">")[0],t=$(this).attr("id").split(">")[1];d3.selectAll(".link").each((function(r){var n=Object(o.removeSpecialChars)(r.source.iri),a=Object(o.removeSpecialChars)(r.target.iri);if(n===t&&a===e){var i=n;i+=">",i+=a;var s=document.createTextNode(" ⟶");document.getElementById(i).lastChild.appendChild(s),r.direction="double"}}))})),d3.selectAll(".d3-actions-tip").remove(),we.alpha(.3).restart()}function ke(){t.d3alpha=we.alpha()}var Ee=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){var o=Object(a.a)().attr("class","d3-tip d3-actions-tip").customPosition((function(e,t){var r=t.target.getBoundingClientRect();return{top:r.top-20+"px",left:r.right+10+"px"}})).html((function(e){return e}));be.call(o);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,he.removeNodeLeafLinks(e),Re()})).on("mouseover",(function(e){o.show(this.getAttribute("name"),e),h.cancel(Se),h.cancel(Ce)})).on("mouseout",(function(){o.hide(),Ce=h((function(){Pe()}),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(){Ne(n,!1,i)})).on("mouseover",(function(e){o.show(this.getAttribute("name"),e),h.cancel(Ce),h.cancel(Se)})).on("mouseout",(function(){o.hide(),Ce=h((function(){Pe()}),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){o.show(this.getAttribute("name"),e),h.cancel(Ce),h.cancel(Se)})).on("mouseout",(function(){o.hide(),Ce=h((function(){Pe()}),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),Pe(),o.hide()})).on("mouseover",(function(e){o.show("<div style='text-align: center;'><b>Copy to ClipBoard</b><br>"+n.iri+"</div>",e),h.cancel(Ce),h.cancel(Se)})).on("mouseout",(function(){o.hide(),Ce=h((function(){Pe()}),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(){_e(n)})).on("mouseover",(function(e){o.show(this.getAttribute("name"),e),h.cancel(Ce),h.cancel(Se)})).on("mouseout",(function(){o.hide(),Ce=h((function(){Pe()}),500)})),this.animateMenu(n)},this.animateMenu=function(e){var t=d3.easeSin,n=0,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 r(a+=30,e)})).delay(n+=35),this.focusIcon.transition().duration(100).style("opacity",1).ease(t).attr("transform",(function(){return r(a+=30,e)})).delay(n+=35),this.closeIcon.transition().duration(100).style("opacity",1).ease(t).attr("transform",(function(){return r(a+=30,e)})).delay(n+=35),this.expandedState=!0}};function Le(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?(_e(r),!1):void 0!==e.openedNodeInfoPanel&&e.openedNodeInfoPanel===r?(e.pageslideExpanded=!1,e.openedNodeInfoPanel=void 0,!1):(Oe(r),!0)}function _e(e){he.removeNode(e),Re()}function Ae(t){!function(t){e.nodeSelected=!0,null===t.data.types&&(t.data.types="greyColor"),he=new fe,ue=se}(t),Te(t)}function Te(t,r,n){var a=t.data;a=_.filter(a,(function(e){return-1===_.findIndex(he.links,(function(t){return e.source===t.source.iri&&e.target===t.target.iri}))}));for(var i=[],o=he.tripleLinksCopy.values(),s=0;s<he.tripleLinksCopy.size;s++){o.next().value.forEach((function(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}));for(var c,l,u,d=(c="iri",l=_.union(_.flatten(_.map(t.data,(function(e){return[{iri:e.source,isTriple:e.isTripleSource},{iri:e.target,isTriple:e.isTripleTarget}]})))),u=l.map((function(e){return e[c]})),l.filter((function(e,t){return u.indexOf(e[c])===t}))),p=_.map(he.nodes,(function(e){return{iri:e.iri,isTriple:Boolean(e.isTriple)}})),h=he.tripleNodes.values(),g=0;g<he.tripleNodes.size;g++){h.next().value.forEach((function(e){p.push({iri:e.iri,isTriple:e.isTriple})}))}var y=_.reject(d,(function(e){return _.some(p,e)}));if(0===y.length)(n||0===a.length)&&f.info(L.instant("graphexplore.error.node.connections")),he.addAndMatchLinks(a),Re();else{var v=[],x=[],w=U();_.forEach(y,(function(t,r){v.push(E.getInstanceNode({iri:t.isTriple?K(t.iri):t.iri,config:e.configLoaded.id,languages:e.shouldShowSettings()?w.languages:[],includeInferred:w.includeInferred,sameAsState:w.sameAsState}).then((function(e){x[r]=e.data})))})),m.all(v).then((function(){_.forEach(x,(function(e,t){var n=2*Math.PI*t/x.length,a=(r?r.x:0)+Math.cos(n)*pe/3,i=(r?r.y:0)+Math.sin(n)*pe/3;e.isTriple?he.addTriple(e,a,i):he.addNode(e,a,i)})),he.addAndMatchLinks(a),r&&(r.isExpanded=!0),Re()}))}}function Ne(t,r,n){if(!Ie.getLoadingState()){Ie.init(t,n);var a=U(),i=t.iri;E.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){Te(e,t,r)}),(function(t){var r=getError(t.data);f.error(r,L.instant("graphexplore.error.exploring.node")),e.loading=!1,Ie.setLoadingState(!1)}))}}function Pe(){angular.isDefined(Ee)&&Ee.expandedState&&Ee.removeIcons()}function Oe(t){we.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(K(t.iri)):encodeURIComponent(t.iri),e.showInfoPanel=!0,e.rdfsLabel=t.labels[0].label,e.rdfsComment=t.comment,e.expanded=!1,e.propertiesQueryObj.query="",e.dataNodeKeysQuery="";var r=U();E.getProperties({iri:t.isTriple?K(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;var 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){f.warning(getError(e.data),"Error")}))}function De(e){Me("predicate","var(--primary-color-dark)",e),Me("predicates","var(--primary-color-dark)",e);var t=document.getElementsByClassName("link");t&&_.each(t,(function(t){var 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)}));var r=document.getElementsByClassName("arrow-marker");r&&_.each(r,(function(t){var 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 Me(e,t,r){var n=document.getElementsByClassName(e);n&&_.each(n,(function(e){var n=e.__data__;r?((n.source.iri.indexOf(r.iri)>=0||n.target.iri.indexOf(r.iri)>=0)&&(e.style.fill=t),B(r.iri)===W(n)&&(e.textContent=r.pred,e.style.fill=t),r.oppLinkIRI&&r.oppLinkIRI===W(n)&&(e.textContent=r.oppTriplePred,e.style.fill=t)):(e.style.fill=t,e.textContent=Ge(n))}))}function je(){_.each(e.predicates,(function(e){var t=document.getElementById(e.linkId+e.nodeIndex);t&&(t.style.fontWeight="normal")}));var t=document.getElementsByClassName("link");t&&_.each(t,(function(e){e.style.stroke="#999",e.style.strokeWidth=1})),Me("predicate",""),Me("predicates","");var r=document.getElementsByClassName("arrow-marker");r&&_.each(r,(function(e){e.style.stroke="#999",e.__data__.target.isTriple||e.setAttribute("refX","59")}))}function $e(e){var t=B(e);if(he.tripleNodes.has(t))return he.tripleNodes.get(t).find((function(t){return t.iri===e}))}function Ge(e){return e.predicates.length>1?e.predicates.length+" predicates":Ue(e.predicates[0])}function Ue(t){var 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=[],le=null,h((function(){e.showInfoPanel=!1}))},e.clickLink=function(t){if(he.tripleNodes.has(t.linkId)){je();var r=he.tripleNodes.get(t.linkId)[t.nodeIndex];Oe(r),e.showPredicates=!0;var n=document.getElementById(t.linkId+t.nodeIndex);n&&(n.style.fontWeight="bold");for(var a={},i=he.tripleLinksCopy.values(),o=function(){var e=i.next().value;e.length>1&&e.every((function(t){return t.source.iri===r.iri?(a.iri=e[0].source.iri,t.target.isTriple&&(a.oppLinkIRI=B(t.target.iri),a.oppTriplePred=Ue(t.target.iri.split(" ")[1])),a.pred=Ue(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=B(t.source.iri),a.oppTriplePred=Ue(t.source.iri.split(" ")[1])),a.pred=Ue(r.iri.split(" ")[1]),1===t.predicates.length&&(a.linkPred=t.predicates[0]),!1)}))},s=0;s<he.tripleLinksCopy.size;s++)o();a.iri||(a.iri=r.iri,a.pred=Ue(r.iri.split(" ")[1])),De(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){Pe();var t=10*(e?1:-1)*Math.PI/180,r=Math.cos(t),n=Math.sin(t),a=de/2,i=pe/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)})),we.alpha(1).restart()},e.openUri=function(t,r){if(!r){var n={};e.configLoaded.id!==e.defaultGraphConfig.id&&(n.config=e.configLoaded.id),n.uri=t,j(n,{uri:t,config:e.configLoaded})}e.$broadcast("onRootNodeChange",t)},e.saveOrUpdateGraph=function(){var t=JSON.stringify(he.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})};var Qe=function(t){R.editSavedGraph(t).success((function(){e.lastSavedGraphName=t.name,e.shared=t.shared,e.refreshSavedGraphs(),f.success(L.instant("graphexplore.saved.graph.was.edited",{name:t.name}))})).error((function(e){var t=getError(e);f.error(t,L.instant("graphexplore.error.cannot.edit"))}))};e.saveGraphModal=function(t,r,n){var a=b.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}}}});D++,O=!0,a.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),R.addNewSavedGraph(t).success((function(r,n,a){e.lastSavedGraphName=t.name,e.lastSavedGraphId=a()["x-saved-graph-id"],e.shared=t.shared,e.refreshSavedGraphs(),f.success(L.instant("graphexplore.saved.graph",{name:t.name}))})).error((function(r,n){if(422===n)e.saveGraphModal("new",t,!0);else{var a=getError(r);f.error(a,L.instant("graphexplore.error.cannot.create.graph"))}}))}(t.graph);break;case"update":case"rename":Qe(t.graph)}})).finally((function(){--D<=0&&(O=!1,D=0)}))},e.refreshSavedGraphs=function(){R.getSavedGraphs().success((function(t){e.savedGraphs=t})).error((function(e){var t=getError(e);f.error(t,L.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),y.url("?saved="+t.id),he.restoreState(JSON.parse(t.data)),r||j({saved:t.id},{savedGraph:t})},e.copyToClipboardSavedGraph=function(t){var r=[location.protocol,"//",location.host,location.pathname,"?saved=",t.id].join("");e.copyToClipboard(r)},e.deleteSavedGraph=function(t){w.openSimpleModal({title:L.instant("common.confirm"),message:L.instant("graphexplore.confirm.delete.graph",{graphName:t.name}),warning:!0}).result.then((function(){!function(t){R.deleteSavedGraph(t).success((function(){e.refreshSavedGraphs(),f.success(L.instant("graphexplore.saved.graph.was.deleted",{name:t.name}))})).error((function(e){var t=getError(e);f.error(t,L.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(){Pe();var 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)})),we.alpha(1).restart()},$("body").on("keydown",(function(t){!A.isActive()&&"input"!==t.target.nodeName&&e.nodeSelected&&(37===t.keyCode?e.rotate(!0):39===t.keyCode&&e.rotate(!1))})),e.getLiteralFromPropValue=function(e){return e.substring(e.indexOf(":")+1)}}function h(e,t,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&&(e.graph.name=a(e.graph.name),t.close({graph:e.graph,mode:e.mode}))},e.saveNew=function(){e.graph.name=a(e.graph.name)+" (new)",t.close({graph:e.graph,mode:"new",restart:!0})},e.cancel=function(){t.dismiss("cancel")};var a=function(e){return e.replace(/\s+/g," ").trim()}}angular.module("graphdb.framework.graphexplore.controllers.graphviz",["ui.scroll.jqlite","ui.scroll","toastr","ui.bootstrap","ngTagsInput","graphdb.framework.utils.localstorageadapter","graphdb.core.services.workbench-context","graphdb.framework.core.services.rdf4j.repositories"]).controller("GraphsVisualizationsCtrl",f).controller("SaveGraphModalCtrl",h).config(["$uibTooltipProvider",function(e){e.options({appendToBody:!0})}]),f.$inject=["$scope","$rootScope","$repositories","$licenseService","toastr","$timeout","ClassInstanceDetailsService","$q","$location","$jwtAuth","UiScrollService","ModalService","$uibModal","$window","LocalStorageAdapter","LSKeys","SavedGraphsRestService","GraphConfigRestService","GraphDataRestService","$translate","GuidesService","WorkbenchContextService","RDF4JRepositoriesService"],h.$inject=["$scope","$uibModalInstance","data","$translate"]},303:function(e,t,r){"use strict";r.r(t);r(118),r(15),r(29);var n=r(115),a=r(104),i=r(27),o=r(138),s=r(159),c=r(11);function l(e){return(l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function u(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */u=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,a=Object.defineProperty||function(e,t,r){e[t]=r.value},i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function d(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{d({},"")}catch(e){d=function(e,t,r){return e[t]=r}}function p(e,t,r,n){var i=t&&t.prototype instanceof v?t:v,o=Object.create(i.prototype),s=new T(n||[]);return a(o,"_invoke",{value:E(e,r,s)}),o}function f(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=p;var h="suspendedStart",g="executing",m="completed",y={};function v(){}function x(){}function w(){}var b={};d(b,o,(function(){return this}));var S=Object.getPrototypeOf,C=S&&S(S(N([])));C&&C!==r&&n.call(C,o)&&(b=C);var I=w.prototype=v.prototype=Object.create(b);function R(e){["next","throw","return"].forEach((function(t){d(e,t,(function(e){return this._invoke(t,e)}))}))}function k(e,t){function r(a,i,o,s){var c=f(e[a],e,i);if("throw"!==c.type){var u=c.arg,d=u.value;return d&&"object"==l(d)&&n.call(d,"__await")?t.resolve(d.__await).then((function(e){r("next",e,o,s)}),(function(e){r("throw",e,o,s)})):t.resolve(d).then((function(e){u.value=e,o(u)}),(function(e){return r("throw",e,o,s)}))}s(c.arg)}var i;a(this,"_invoke",{value:function(e,n){function a(){return new t((function(t,a){r(e,n,t,a)}))}return i=i?i.then(a,a):a()}})}function E(t,r,n){var a=h;return function(i,o){if(a===g)throw Error("Generator is already running");if(a===m){if("throw"===i)throw o;return{value:e,done:!0}}for(n.method=i,n.arg=o;;){var s=n.delegate;if(s){var c=L(s,n);if(c){if(c===y)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(a===h)throw a=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);a=g;var l=f(t,r,n);if("normal"===l.type){if(a=n.done?m:"suspendedYield",l.arg===y)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(a=m,n.method="throw",n.arg=l.arg)}}}function L(t,r){var n=r.method,a=t.iterator[n];if(a===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,L(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var i=f(a,t.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,y;var o=i.arg;return o?o.done?(r[t.resultName]=o.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,y):o:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}function _(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function A(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function T(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(_,this),this.reset(!0)}function N(t){if(t||""===t){var r=t[o];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var a=-1,i=function r(){for(;++a<t.length;)if(n.call(t,a))return r.value=t[a],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}throw new TypeError(l(t)+" is not iterable")}return x.prototype=w,a(I,"constructor",{value:w,configurable:!0}),a(w,"constructor",{value:x,configurable:!0}),x.displayName=d(w,c,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===x||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,w):(e.__proto__=w,d(e,c,"GeneratorFunction")),e.prototype=Object.create(I),e},t.awrap=function(e){return{__await:e}},R(k.prototype),d(k.prototype,s,(function(){return this})),t.AsyncIterator=k,t.async=function(e,r,n,a,i){void 0===i&&(i=Promise);var o=new k(p(e,r,n,a),i);return t.isGeneratorFunction(r)?o:o.next().then((function(e){return e.done?e.value:o.next()}))},R(I),d(I,c,"Generator"),d(I,o,(function(){return this})),d(I,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=N,T.prototype={constructor:T,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(A),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function a(n,a){return s.type="throw",s.arg=t,r.next=n,a&&(r.method="next",r.arg=e),!!a}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],s=o.completion;if("root"===o.tryLoc)return a("end");if(o.tryLoc<=this.prev){var c=n.call(o,"catchLoc"),l=n.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return a(o.catchLoc,!0);if(this.prev<o.finallyLoc)return a(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return a(o.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return a(o.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var a=this.tryEntries[r];if(a.tryLoc<=this.prev&&n.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var i=a;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var o=i?i.completion:{};return o.type=e,o.arg=t,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(o)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),y},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),A(r),y}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;A(r)}return a}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:N(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),y}},t}function d(e,t,r,n,a,i,o){try{var s=e[i](o),c=s.value}catch(e){return void r(e)}s.done?t(c):Promise.resolve(c).then(n,a)}function p(e){return function(){var t=this,r=arguments;return new Promise((function(n,a){var i=e.apply(t,r);function o(e){d(i,n,a,o,s,"next",e)}function s(e){d(i,n,a,o,s,"throw",e)}o(void 0)}))}}function f(e,t,r,l,d,f,h,g,m,y,v,x,w,b,S,C,I){var R;t.newConfig=new o.GraphsConfig,t.revertConfig=void 0,t.page=1,t.totalPages=5,t.helpHidden=1===x.get(w.HIDE_GRAPH_CONFIG_HELP),t.isUpdate=!1,t.shared=!1,t.canEditActiveRepo=t.canWriteActiveRepo(),t.samples=[],t.tabConfig={inference:t.newConfig.startQueryIncludeInferred,sameAs:t.newConfig.startQuerySameAs},t.isAutocompleteEnabled=void 0,t.repositoryNamespaces=void 0,t.tabsViewModel=[];var k=y.configName,E=f.getActiveRepository();t.toggleHelp=function(e){void 0===e&&(e=x.get(w.HIDE_GRAPH_CONFIG_HELP)),1!==e?(x.set(w.HIDE_GRAPH_CONFIG_HELP,1),t.helpHidden=!0):(x.set(w.HIDE_GRAPH_CONFIG_HELP,0),t.helpHidden=!1)},t.fixedVisualCallback=function(e,r){t.newConfig.startIRI=e,t.newConfig.startIRILabel=r,R=!0},t.isDefaultGraph=function(e){return e.isDefaultGraph()},t.isUserGraph=function(e){return!e.isDefaultGraph()},t.getSampleName=function(e,t){if(!e)return"";var r=e.getPropertyDescription(t);return r||(e.id?"Copy of "+e.name:e.name)},t.createGraphConfig=function(e){m.createGraphConfig(e).success(p(u().mark((function e(){return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,v.showToastMessageWithDelay("graphexplore.saved.new.config");case 2:l.url("graphs-visualizations");case 3:case"end":return e.stop()}}),e)})))).error((function(e){d.error(getError(e),b.instant("graphexplore.error.could.not.create"))}))},t.updateGraphConfig=function(e){m.updateGraphConfig(e).success(p(u().mark((function e(){return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,v.showToastMessageWithDelay("graphexplore.saved.config");case 2:l.url("graphs-visualizations");case 3:case"end":return e.stop()}}),e)})))).error((function(e){d.error(getError(e),b.instant("graphexplore.error.could.not.save"))}))},t.goToPage=function(e){t.page!==e&&D((function(){t.showEditor(),t.page=e}))},t.goToPreviousPage=function(){t.page>1&&t.goToPage(t.page-1),U()&&(R=!1)},t.goToNextPage=function(){G(),t.newConfig.isStartMode(o.StartMode.NODE)&&!R||t.goToPage(t.page+1)},t.saveGraphConfig=function(){G(),U()&&!R||(t.newConfig.startQueryIncludeInferred=t.tabConfig.inference,t.newConfig.startQuerySameAs=t.tabConfig.sameAs,t.newConfig.name&&(t.newConfig.name=t.newConfig.name.replace(/\s+/g," ").trim()),D((function(){t.newConfig.name?(t.queryEditorIsDirty=!1,t.isUpdate?t.updateGraphConfig(t.newConfig.toSavePayload()):t.createGraphConfig(t.newConfig.toSavePayload())):j(b.instant("graphexplore.provide.config.name"))})))},t.setQuery=function(){var e=p(u().mark((function e(r){var n;return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=r||" ",e.next=3,L();case 3:e.sent.setQuery(n),t.markDirty();case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),t.markDirty=p(u().mark((function e(){var r,n;return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t.revertConfig){e.next=6;break}return r=t.revertConfig.getQueryType(t.page),e.next=4,N();case 4:n=e.sent,t.queryEditorIsDirty=r!==n;case 6:case"end":return e.stop()}}),e)}))),t.showEditor=function(){t.viewMode="yasr",P(),T()},t.showPreview=function(){t.viewMode="editor",_()},t.revertEditor=function(){t.setQuery(t.revertConfig.getQueryType(t.page)),t.queryEditorIsDirty=!1};var L=function(){return i.YasguiComponentDirectiveUtil.getOntotextYasguiElementAsync("#query-editor")},_=function(){var e=p(u().mark((function e(r,n){var a,i;return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,L();case 2:return a=e.sent,e.next=5,a.getQueryType();case 5:if(i=e.sent,!n||"SELECT"===i||"CONSTRUCT"===i||"DESCRIBE"===i){e.next=9;break}return d.warning(b.instant("query.editor.warning.msg")),e.abrupt("return");case 9:return e.next=11,a.getQueryMode();case 11:if("update"!==e.sent){e.next=15;break}return d.warning(b.instant("cannot.execute.update.error")),e.abrupt("return");case 15:t.queryIsRunning||(t.viewMode="editor",A());case 16:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}(),A=function(){var e=p(u().mark((function e(){return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,L();case 2:e.sent.query(a.RenderingMode.YASR);case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),T=function(){var e=p(u().mark((function e(){var t;return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,L();case 2:return t=e.sent,e.abrupt("return",t.changeRenderMode(a.RenderingMode.YASQE));case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),N=function(){var e=p(u().mark((function e(){var t;return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,L();case 2:return t=e.sent,e.abrupt("return",t.getQuery());case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),P=function(){var e=p(u().mark((function e(){var t;return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,L();case 2:return t=e.sent,e.abrupt("return",t.abortQuery());case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),O=function(){var e=p(u().mark((function e(){var r,n;return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,L();case 2:return r=e.sent,e.next=5,r.getQuery();case 5:return n=(n=e.sent).trim(),e.abrupt("return",t.newConfig.updateModel(n,t.page));case 8:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),D=function(){var e=p(u().mark((function e(r){var n;return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,O();case 2:n=e.sent,1===t.page?n.isStartMode(o.StartMode.NODE)&&!n.startIRI?j(b.instant("graphexplore.select.start.node")):n.isStartMode(o.StartMode.QUERY)&&!n.startGraphQuery?j(b.instant("graphexplore.provide.query")):n.isStartMode(o.StartMode.QUERY)?$(r,n.startGraphQuery,"graph"):r():2===t.page?$(r,n.expandQuery,"construct",["node"]):3===t.page?$(r,n.resourceQuery,"tuple",["node"],[],["type","label","comment","rank"]):4===t.page?$(r,n.predicateLabelQuery,"tuple",["edge"],["label"]):5===t.page&&$(r,n.resourcePropertiesQuery,"tuple",["node"],["property","value"]);case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),M=function(){t.tabConfig.inference=t.newConfig.startQueryIncludeInferred,t.tabConfig.sameAs=t.newConfig.startQuerySameAs,t.setQuery(t.newConfig.getQueryType(t.page))},j=function(e){d.warning(e)},$=function(e,t,r,n,a,i){t?m.validateQuery(t,r,n,a,i).success((function(){e()})).error((function(e){j(getError(e))})):e()},G=function(){U()&&t.$broadcast("addStartFixedNodeAutomatically",{startIRI:t.newConfig.startIRI})},U=function(){return 1===t.page&&t.newConfig.isStartMode(o.StartMode.NODE)},Q=function(){m.getGraphConfigSamples().success((function(e){t.samples=Object(s.mapGraphConfigSamplesToGraphConfigs)(e).filter((function(e){return!e.id||t.newConfig.id!==e.id||(t.revertConfig=e,!1)}))})).error((function(e){d.error(getError(e),b.instant("graphexplore.error.graph.configs"))}))},F={endpoint:function(){return"repositories/".concat(f.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,showYasqeResizer:!1,yasqeMode:n.YasqeMode.READ,infer:t.newConfig.startQueryIncludeInferred,sameAs:t.newConfig.startQuerySameAs},H=function(e,r,n){t.queryIsRunning=e},z=function(){window.removeEventListener("beforeunload",q),W.forEach((function(e){return e()}))},q=function(e){t.queryEditorIsDirty&&(e.returnValue=!0)},B=function(){t.tabsViewModel=[{page:1,label:b.instant("starting.point.label"),type:"startGraphQuery"},{page:2,label:b.instant("graph.expansion"),type:"expandQuery"},{page:3,label:b.instant("node.basics"),type:"resourceQuery"},{page:4,label:b.instant("edge.basics"),type:"predicateLabelQuery"},{page:5,label:b.instant("node.extra"),type:"resourcePropertiesQuery"}]},W=[];W.push(C.onSelectedRepositoryIdUpdated((function(e){e?I.getNamespaces(e).then((function(e){t.repositoryNamespaces=e})).catch((function(e){var t=getError(e);d.error(t,b.instant("error.getting.namespaces.for.repo"))})):t.repositoryNamespaces=new c.NamespacesListModel}))),W.push(C.onAutocompleteEnabledUpdated((function(e){t.isAutocompleteEnabled=e}))),W.push(t.$on("$locationChangeStart",(function(e,r){if(t.queryEditorIsDirty){e.preventDefault();!function(e,t,r,n){S.openSimpleModal({title:e,message:t,warning:!0}).result.then((function(){angular.isFunction(r)&&r()}),(function(){angular.isFunction(n)&&n()}))}(b.instant("common.confirm"),b.instant("visual.config.warning.unsaved.changes"),(function(){z();var e=l.absUrl().length-l.url().length,t=r.substring(e);l.path(t)}))}else z()}))),W.push(t.$on("$destroy",z)),W.push(t.$watch(t.getActiveRepositoryObject,(function(){(t.newConfig.isStartMode(o.StartMode.QUERY)||t.page>1)&&(t.viewMode="yasr",P().then(T))}))),W.push(e.$on("$translateChangeSuccess",(function(){B()}))),window.addEventListener("beforeunload",q),t.$watch("newConfig.startMode",(function(e){e===o.StartMode.QUERY&&M()})),t.$watch("page",(function(e){(t.newConfig.isStartMode(o.StartMode.QUERY)||e>1)&&(t.showEditor(),M())})),B(),f.getPrefixes(E).then((function(e){return function(e){var r=t.$watch((function(){return t.getActiveRepositoryObject()}),(function(a){if(a){t.canEditActiveRepo=t.canWriteActiveRepo();var i=angular.extend({},F,{prefixes:e,yasqeMode:t.canWriteActiveRepo()?n.YasqeMode.WRITE:n.YasqeMode.READ});t.yasguiConfig=i,r()}}))}(e)})).finally((function(){return H(!1)})),k?(t.isUpdate=!0,m.getConfig(k).then((function(e){t.newConfig=e,Q()})).catch((function(e){d.error(getError(e),b.instant("created.connector",{name:k}))}))):(t.isUpdate=!1,Q()),t.getActiveRepository()&&(H(!0,b.instant("common.refreshing.namespaces"),b.instant("common.extra.message")),f.getPrefixes(f.getActiveRepository()).then((function(e){t.namespaces=e})).catch((function(e){t.repositoryError=getError(e)})).finally((function(){H(!1)})))}angular.module("graphdb.framework.graphexplore.controllers.graphviz.config",["graphdb.framework.utils.notifications","graphdb.framework.utils.localstorageadapter","graphdb.core.services.workbench-context","graphdb.framework.core.services.rdf4j.repositories"]).controller("GraphConfigCtrl",f),f.$inject=["$rootScope","$scope","$timeout","$location","toastr","$repositories","SparqlRestService","$filter","GraphConfigRestService","$routeParams","Notifications","LocalStorageAdapter","LSKeys","$translate","ModalService","WorkbenchContextService","RDF4JRepositoriesService"]},304:function(e,t,r){"use strict";r.r(t);var n=r(658),a=r(684),i=r(647),o=r(648);r(15);function s(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return c(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?c(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,a=function(){};return{s:a,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,i=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw i}}}}function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function l(e,t,r,c,l,u,d,p,f,h,g,m,y){return{restrict:"AE",template:'<div id="classChart"></div>',scope:{classHierarchyData:"=",flattenedClassNames:"=",selectedClass:"=",currentSliderValue:"=",showClassInfoPanel:"=",showExternalElements:"=",hidePrefixes:"=",currentBrowserLimit:"="},link:function(d,v,x){!function(d,v){var x,w,b=!1,S=d3.pack().size([780,780]),C=d3.scaleLinear().domain([0,4]).range(["hsl(19, 70%, 90%)","hsl(19, 70%, 50%)"]).interpolate(d3.interpolateHcl),I=d3.select("#classChart").insert("svg:svg","h2").attr("viewBox","0 0 800 800").attr("preserveAspectRatio","xMidYMid meet").on("dblclick.zoom",null);function R(){return I.append("svg:g").attrs({id:"main-group",transform:"translate(400,400)"})}function k(){return"true"===g.get(m.CLASS_HIERARCHY_HIDE_PREFIXES)}function E(){var e=o.a.Export.getCSSRules("css/rdf-class-hierarchy-labels.css?v=3.0.2-TR2");d3.selectAll("#main-group").append("defs"),$("defs").append('<style type="text/css"><![CDATA['+e+"]]></style>"),d3.selectAll("g").style("opacity",1);var t=o.a.Export.generateBase64ImageSource("#classChart svg");d3.select(this).attrs({href:t,download:"class-hierarchy-"+u.getActiveRepository()+".svg"})}d.hidePrefixes=k();var L,A,T=R();if(!d.classHierarchyData.classCount&&u.getActiveRepository()&&!u.isSystemRepository()){e.loader=!0,e.hierarchyError=!1;var N=g.get("classHierarchy-selectedGraph-".concat(u.getActiveRepository()));r.getClassHierarchyData(null!==N?N.contextID.uri:"").success((function(t,r,n){e.loader=!1,207===r&&p.warning(y.instant("graphexplore.update.diagram"),y.instant("graphexplore.repository.data.changed")),d.classHierarchyData=t,d3.select("#download-svg").on("mouseover",E)})).error((function(t){e.loader=!1,e.hierarchyError=getError(t),p.error(y.instant("graphexplore.error.request.failed",{name:h,error:getError(t)}))}))}var P,O,D,M,j,G,U,Q={};function F(r,o,s,u){O&&O(),D&&D(),d3.selectAll("#main-group").remove(),T=R(),a.a.SingleChild.addPlaceholders(r,!0),(w=d3.hierarchy(r)).sum((function(e){return e.size})),P=s||w,S(w);var p,g=w.descendants();P.isInFocusTransitive=!0,a.a.SingleChild.removePlaceholders(g),a.a.SingleChild.centerNodes(g),a.a.SingleChild.makePositionsRelativeToZero(g),x||(x=Object(n.a)().attr("class","d3-tip").customPosition((function(e,t){return{top:"inherit",bottom:c.innerHeight-t.clientY+"px",right:c.innerWidth-t.clientX+"px"}})).html((function(e){return e.data.name})),I.call(x));var m=T.selectAll("circle").data(g).enter().append("g");o.doFade&&m.each((function(e){i.a.Transition.fadeIn(d3.select(this),550)}));var y,v=[],k=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;v.push({name:t}),Q[[t]]=e,e.circle.classed("rdf-class",!0),e.circle.on("mouseover",(function(t){o.noPrefixes||e.textHidden?x.show(e,t):x.hide(e)})),e.circle.on("mouseout",x.hide)}})).on("gdb-focus",(function(e,t){return A(t)})).on("gdb-zoom",(function(e,t){return q(t)}));function E(e){d3.selectAll(".selected").classed("selected",e.selected=!1),e.circle.classed("selected",e.selected=!0),y=e}function N(){d.showClassInfoPanel=!1}v&&(v=_.uniqBy(v,"name"),d.flattenedClassNames=v);var M=i.a.Click.delayDblClick();d3.selectAll(".parent, .topLevelParent, .child, .root").call(M),A=function(e){q(e),e.data.name===h?(N(),d3.selectAll(".selected").classed("selected",!1)):(E(e),b||(d.selectedClass=y,d.showClassInfoPanel=!0),d.$on("sidePanelClosed",(function(t){d3.selectAll(".selected").classed("selected",e.selected=!1)})))},M.on("click",(function(e,t){t.data.id&&c.history.pushState({id:t.data.id},"classHierarchyPage"+t.data.id,"hierarchy#"+t.data.id),x.hide(),A(t)})),M.on("dblclick",(function(t,n){n!==r&&(x.hide(),E(n),e.$broadcast("goToDomainRangeGraphView",y,P),t.stopPropagation())}));var j=0;I.on("wheel",(function(e){x.hide(),e.preventDefault(),e.stopPropagation();var t=(new Date).getTime();if(t-j>100){j=t;var r="";e.deltaY<=-1?r="in":e.deltaY>=1&&(r="out");var n=e.target.__data__;if(n||(n=P),"in"===r){if(n!==P){for(;n.parent&&!n.parent.isInFocusTransitive;)n=n.parent;n.depth<P.depth&&(n=P)}if(n===P&&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);q(n,!0)}else"out"===r&&(n=P.parent)&&q(n,!0);P.data.name===h&&c.history.replaceState({id:1},"classHierarchyPage1","hierarchy#1"),H()}}));var $=T.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)}));o.noPrefixes?($.each((function(e){var t=e.data.name.indexOf(":");e.data.name.indexOf("http://")>-1?e.noPrefixName=e.data.name:t>-1&&(e.noPrefixName=e.data.name.substring(t+1))})),$.style("font-size",(function(e){return i.a.Text.calcFontSize(e.noPrefixName,e.r)})).text((function(e){return i.a.Text.getTextWithElipsisIfNeeded(e.noPrefixName,e.r/3)}))):$.style("font-size",(function(e){return i.a.Text.calcFontSize(e.data.name,e.r)})).text((function(e){return i.a.Text.getTextWithElipsisIfNeeded(e.data.name,e.r/3)})),$.style("display",(function(e){return e.parent&&e.parent.data===P.data?(e.textHidden=this.textContent.indexOf("...")+3===this.textContent.length,null):(e.textHidden=!0,"none")})),o.doFade&&!o.keepPrevState&&$.each((function(e){i.a.Transition.fadeIn(d3.select(this),550)})),L=function(){function e(e){e&&k.each((function(t){+e===t.data.id&&A(t)}))}var r=t.hash();c.onpopstate=function(t){t.state&&e(t.state.id)},e(r)};var G=T.selectAll("circle, text");function U(e,t){var r=800/e[2];p=e,G.attr("transform",(function(t){return"translate("+(t.x-e[0])*r+","+(t.y-e[1])*r+")"})),k.attr("r",(function(e){return e.r*r})),t&&$.each((function(e){e.data.fullName!==P.data.topLevelParentUri&&P.data.topLevelParentUri!==h||(e.textSel.style("display","none"),P.children&&P.children.length?_.each(P.children,(function(e){e.textSel.style("display","inline")})):P.textSel.style("display","inline"),P.parent&&_.each(P.parent.children,(function(e){e.data.name!==P.data.name&&e.textSel.style("display","inline")})))})),$.style("font-size",(function(e){return o.noPrefixes?i.a.Text.calcFontSize(e.noPrefixName,e.r*r):i.a.Text.calcFontSize(e.data.name,e.r*r)})).text((function(e){return o.noPrefixes?i.a.Text.getTextWithElipsisIfNeeded(e.noPrefixName,e.r*r/3):i.a.Text.getTextWithElipsisIfNeeded(e.data.name,e.r*r/3)}))}function F(e){var t=2*e+20;return 2*e/t<.3&&(t=2*e+2),t}function z(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 q(e,t){if(l((function(){d.showExternalElements=e.data.name===h})),P!==e&&(e.data.id&&c.history.replaceState({id:e.data.id},"classHierarchyPage"+e.data.id,"hierarchy#"+e.data.id),e.children||(e=e.parent,P!==e))){if(t&&(N(),d3.selectAll(".selected").classed("selected",!1)),P.parent)for(var r=P;r;)r.isInFocusTransitive=!1,r=r.parent;for(r=e;r;)r.isInFocusTransitive=!!r.children,r=r.parent;if(2*(P=e).r/(2*P.r+20)<.3||d.currentSliderValue>d.currentBrowserLimit)U([P.x,P.y,F(P.r)]),$.each((function(e){z.call(this,e)}));else d3.transition().duration(f).tween("zoom",(function(e){var t=d3.interpolateZoom(p,[P.x,P.y,F(P.r)]);return function(e){U(t(e))}})).selectAll("text").each(z)}}U([P.x,P.y,F(P.r)],u),O=d.$on("rootFocus",(function(){c.history.pushState({id:1},"classHierarchyPage1","hierarchy#1"),A(w)})),D=d.$on("classSearch",(function(e){A(e)}))}function H(){var t=d.classHierarchyData.classCount,r=g.get(m.CLASS_HIERARCHY_CURRENT_SLIDER_VALUE);(!r||r>t)&&(r=t,g.set(m.CLASS_HIERARCHY_CURRENT_SLIDER_VALUE,r)),e.$broadcast("classCount",t,r)}window.addEventListener("resize",H),window.addEventListener("beforeunload",(function e(){window.removeEventListener("resize",H),window.removeEventListener("beforeunload",e)})),d.$watch("classHierarchyData",(function(){M&&M(),j&&j(),G&&G(),U&&U();var e=k();if(d.classHierarchyData.classCount){var t=function(e,t){var r={keepPrevState:!0,noPrefixes:k()};a=r.noPrefixes,F(n||e,r,P,!0),l((function(){g.set(m.CLASS_HIERARCHY_SWITCH_PREFIXES,t),L(),b=!1}),70)},r=function(e,r,i){if(e){g.set(m.CLASS_HIERARCHY_CURRENT_SLIDER_VALUE,e),n={name:h,children:[]};for(var c=new Set,l=1;l<=e;l++)c.add(r[l].data.id),r[l].parent===r[0]&&n.children.push(r[l].data);if(function e(t){if(t.children){var r,n=[],a=s(t.children);try{for(a.s();!(r=a.n()).done;){var i=r.value;c.has(i.id)&&n.push($.extend({},i))}}catch(e){a.e(e)}finally{a.f()}t.children=n;var o,l=s(t.children);try{for(l.s();!(o=l.n()).done;){e(o.value)}}catch(e){l.e(e)}finally{l.f()}}}(n),i)a=angular.isUndefined(a)?k():a,F(n,{noPrefixes:a});else t(o)}};H();var n,a,i,o=_.cloneDeep(d.classHierarchyData),c=function(e){return e.descendants().sort((function(e,t){return e.data.sortingRank>t.data.sortingRank?-1:e.data.sortingRank<t.data.sortingRank||e.data.depth>t.data.depth?1:e.data.depth<t.data.depth?-1:0}))}(d3.hierarchy(o)),u=g.get(m.CLASS_HIERARCHY_CURRENT_SLIDER_VALUE);if(u)r(u,c);else{var p={doFade:!0,keepPrevState:!0,noPrefixes:k()};F(o,p),L()}M=d.$watch("hidePrefixes",(function(r){angular.isUndefined(r)||e?e=void 0:l((function(){b=!0,function(e){angular.isUndefined(e)||g.set(m.CLASS_HIERARCHY_HIDE_PREFIXES,e)}(r),t(o,!0)}),50)}),!0),j=d.$watch("currentSliderValue",(function(e){r(e,c,!0)}),!0),U=d.$on("onEnterKeypressSearchAction",(function(e){i&&A(i)})),G=d.$on("searchedClass",(function(e,t){(i=Q[t.name])&&A(i)}))}}),!0)}(d)}}}angular.module("graphdb.framework.graphexplore.directives.class",["graphdb.framework.graphexplore.controllers.class","graphdb.framework.utils.localstorageadapter"]).constant("ZOOM_DURATION",500).constant("ROOT_OBJ_NAME","RDF Class Hierarchy").directive("rdfClassHierarchy",l),l.$inject=["$rootScope","$location","GraphDataRestService","$window","$timeout","$repositories","$licenseService","toastr","ZOOM_DURATION","ROOT_OBJ_NAME","LocalStorageAdapter","LSKeys","$translate"]},305:function(e,t,r){"use strict";r.r(t);var n=r(648),a=r(647);r(15);function i(e,t,r,i,o,s,c,l,u,d,p,f,h){return{restrict:"AE",template:'<div id="domain-range"></div>',scope:{showPredicatesInfoPanel:"=",selectedPredicate:"=",collapseEdges:"="},link:function(d){var 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),b?(g.alpha(.2).restart(),b=!1):g.restart()})).on("drag",(function(e,t){b=!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:f}).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:f}).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:f}).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=3.0.2-TR2");$("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("+o.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("+o.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("+o.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=o.search().uri,x=o.search().name,w=o.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,w),$(window).on("popstate",(function(){s.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)||(s.set(c.DOMAIN_RANGE_COLLAPSE_EDGES,d.collapseEdges),"true"!==s.get(c.DOMAIN_RANGE_WENT_BACK)&&function(t){e.$broadcast("switchEdgeMode",{uri:v,name:x,collapsed:t})}(d.collapseEdges),s.remove(c.DOMAIN_RANGE_WENT_BACK))})),d.$watch("domainRangeGraphData",(function(){if(d.domainRangeGraphData){var r=function(e){e.style("stroke",f),e.style("stroke-width",2),e.attr("marker-end","url("+o.absUrl()+"#collapsed-arrow)")},n=function(){$.isEmptyObject(C)||(C.text.style("fill","black"),C.background.style("fill","#f0f0f0"))},i=function(e,t){n(),C.text=d3.select(this),C.background=d3.select(this.previousSibling),C.text.style("fill","white"),C.background.style("fill",f),l((function(){d.showPredicatesInfoPanel=!0,d.selectedPredicate=t})),e.stopPropagation()},s=_.cloneDeep(d.domainRangeGraphData),c=s.nodes,u=s.links;g.nodes(c).force("x",d3.forceX(600)).force("y",d3.forceY(300)).force("charge",d3.forceManyBody().strength(-800)).force("link",d3.forceLink(u).distance(1200/3.5));var y,w,b=p.selectAll(".link").data(u).enter().append("g"),S=0;b.each((function(e){if(e.objectPropNodeClassUri!==v)y=b.append("line").attrs({class:"link","marker-end":"url("+o.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?r(t):e.implicit&&t.style("stroke-dasharray","3, 3")}));else{if(angular.isUndefined(w)){w=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("+o.absUrl()+"#arrow-loop)"}).style("stroke-width",1.2)}(S+=e.targetNodeEdgeCount)>1&&r(d3.select(".loop-link"))}}));var C={};$("document").ready((function(){$("#domain-range").bind("click",n)}));var I=b.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}));I.each((function(e){var r=d3.select(this);/\d\spredicates/.test(r.text())?r.style("font-weight","bold").on("click",i):r.on("click",(function(e,r){t.open("resource?uri="+encodeURIComponent(r.uri),"_blank")}))}));var R=2,k=b.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+2*R})).attr("height",(function(e){return e.calculatedHeight=this.previousSibling.getBBox().height,e.calculatedHeight+R})).attr("transform",(function(e){var t=R-1200/18/2*("objectLeft"===e.propertyType?1:-1);return"objectLeft"===e.propertyType&&(t+=e.calculatedWidth),"translate(-"+t+",-"+(R+e.calculatedHeight/2)+")"})).on("click",(function(e){e.stopPropagation()})),E=p.selectAll(".node").data(c).enter().append("g"),L=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("+o.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 A=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"),N=d3.select(".class-node"),P=d3.selectAll(".loop-link-background"),O=d3.selectAll(".loop-link-property-name");if(I=d3.selectAll(".property-name"),!angular.isUndefined(w)){var D=[];P.each((function(e,t){d3.select(this);D.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=[];P.each((function(a,i){n.push(a),i<h?function(n,a){var i=$.grep(D,(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",i),d3.select(".view-more-preds-rect").attr("height",t+2*R)}(n)}y.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})),L.each((function(e){"main"!==e.classPosition||angular.isUndefined(w)||(!function(e){var t=e.x+64,r=e.y-1200/18/5.7-5;w.attr("transform","rotate(270, "+e.x+","+e.y+") translate("+t+","+r+")")}(e),function(e){function t(t,r){var n=$.grep(D,(function(e){return e.idx==r})),a=0;r>0&&(a=parseFloat(2*r*(n[0].height/1.4)));var i=e.x,o=e.y-1200/18*2.1-a;t.attrs({x:i,y:o}).moveToFront()}O.each((function(e,r){var n=d3.select(this),a=O.size()-h;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<h?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=N.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(),k.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(),I.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(),A.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()}))}}));var b=!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"]},306: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"]},307: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(){var 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"]},308:function(e,t,r){"use strict";r.r(t);var n=r(648);r(185);function a(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return i(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?i(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,a=function(){};return{s:a,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,c=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return s=e.done,e},e:function(e){c=!0,o=e},f:function(){try{s||null==r.return||r.return()}finally{if(c)throw o}}}}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function o(e,t){return{restrict:"A",template:'<div id="dependencies-chord"></div>',scope:{dependenciesData:"="},link:function(r){r.$watch("dependenciesData",(function(){if(r.dependenciesData){var i=r.dependenciesData;!function(i,o){if(!function(){var e,t=!0,r=a(i);try{for(r.s();!(e=r.n()).done;){if(e.value.some((function(e){return 0!==e}))){t=!1;break}}}catch(e){r.e(e)}finally{r.f()}return t}()){var s=d3.scaleOrdinal(d3.schemeCategory10),c=d3.select("body").append("div").attr("class","tooltip").style("opacity",0);d3.select("body").on("click",(function(){c.style("opacity",0)}));var l=Math.min(800,800)/2.8,u=l-24,d=d3.arc().innerRadius(u).outerRadius(l),p=d3.chord().padAngle(.04).sortSubgroups(d3.descending).sortChords(d3.ascending),f=d3.ribbon().radius(u),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",l).style("fill","none");var g=p(i),m=h.selectAll(".group").data(g.groups).enter().append("g").attr("class","group").on("mouseover",(function(){var e=m.nodes().indexOf(this);y.classed("fade",(function(t){return t.source.index!==e&&t.target.index!==e}))}));m.append("title").text((function(e,t){return o[t]})),m.append("path").attr("id",(function(e,t){return"group"+t})).attr("d",d).style("fill",(function(e,t){return s(t)})),m.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("+(u+26)+")"+(e.angle>Math.PI?"rotate(180)":"")})).style("text-anchor",(function(e){return e.angle>Math.PI?"end":null})).text((function(e){return o[e.index]}));var y=h.selectAll(".chord").data(g).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",f);y.on("mouseover",(function(){d3.select(this).style("fill-opacity","1")})),y.on("mouseout",(function(){d3.select(this).style("fill-opacity",".67")})),y.on("click",(function(e,n){var a=o[n.source.index],i=o[n.target.index],s=e.pageX,l=e.pageY;t.getPredicates(a,i,r.selectedGraph&&r.selectedGraph.contextID.uri).success((function(e){var t="<div class='dependencies-tooltip'>"+("<div class='row'>"+a+" <i class='fa fa-exchange'></i> "+i+"</div>")+_.map(e.slice(0,10),(function(e){var 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>",c.html(t).style("left",s+"px").style("top",l+"px")})),c.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(){var t=n.a.Export.generateBase64ImageSource(".dependencies-chord svg");d3.select(this).attrs({href:t,download:"dependencies-"+e.getActiveRepository()+".svg"})}))}}(i.matrix,i.nodes,i.direction)}}))}}}angular.module("graphdb.framework.graphexplore.directives.dependencies",["graphdb.framework.graphexplore.controllers.dependencies","graphdb.framework.rest.graphexplore.data.service"]).directive("dependenciesChord",o),o.$inject=["$repositories","GraphDataRestService"]},309: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=[]},310: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"]},399:function(e,t,r){"use strict";r.r(t);r(10),r(58),r(52),r(53),r(902),r(903),r(634),r(658),r(372),r(384),r(904),r(659),r(647),r(684),r(648),r(185),r(295),r(296),r(297),r(298),r(299),r(300),r(301),r(302),r(303),r(304),r(305),r(306),r(307),r(308),r(309),r(310),r(167);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"])},634:function(e,t,r){var n,a;n=[r(644)],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(644)),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(){var e=this.parentNode.firstChild;e&&this.parentNode.insertBefore(this,e)}))},d3}.apply(t,n))||(e.exports=a)},647:function(e,t,r){"use strict";r(634);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(){var e=function(e,r){for(var n,a=1,i=arguments.length;++a<i;)e[n=arguments[a]]=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,o,s;(o=r,s=d3.pointer(document.body),Math.sqrt(Math.pow(o[0]-s[0],2),Math.pow(o[1]-s[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},648:function(e,t,r){"use strict";r(634);var n=n||{};n.Export={getCSSRules:function(e){var t=$('link[href="'+e+'"]')[0].sheet.rules,r="";return _.each(t,(function(e){r+=e.cssText})),r},generateBase64ImageSource:function(e){e||(e="svg");var t=d3.selectAll(e).attr("version","1.1").attr("xmlns","http://www.w3.org/2000/svg").node().parentNode.innerHTML;return"data:image/svg+xml;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(t)))}},t.a=n},658: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,o=null,s=null;function c(e){var t;a="svg"===(t=(t=e).node()).tagName.toLowerCase()?t:t.ownerSVGElement,i=a.createSVGPoint(),document.body.appendChild(n)}c.show=function(){var n=Array.prototype.slice.call(arguments);n[n.length-1]instanceof SVGElement&&(o=n.pop());var a,i=r.apply(this,n),d=t.apply(this,n),f=e.apply(this,n),h=p(),g=u.length,m=document.documentElement.scrollTop||document.body.scrollTop,y=document.documentElement.scrollLeft||document.body.scrollLeft,v=s.apply(this,n);for(h.html(i).style("opacity",1).style("pointer-events","all");g--;)h.classed(u[g],!1);var x=n.filter((function(e){return e instanceof Event}));return a=l.get(f).apply(this,x),v?Object.keys(v).forEach((function(e){h.style(e,v[e])})):h.classed(f,!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:h(t),c):e},c.offset=function(e){return arguments.length?(t=null==e?e:h(e),c):t},c.html=function(e){return arguments.length?(r=null==e?e:h(e),c):r},c.customPosition=function(e){return arguments.length?(s=null==e?e:h(e),c):s},c.destroy=function(){return n&&(p().remove(),n=null),c};var l=new Map(Object.entries({n:function(e){var t=f(e);return{top:t.n.y-n.offsetHeight,left:t.n.x-n.offsetWidth/2}},s:function(e){var t=f(e);return{top:t.s.y,left:t.s.x-n.offsetWidth/2}},e:function(e){var t=f(e);return{top:t.e.y-n.offsetHeight/2,left:t.e.x}},w:function(e){var t=f(e);return{top:t.w.y-n.offsetHeight/2,left:t.w.x-n.offsetWidth}},nw:function(e){var t=f(e);return{top:t.nw.y-n.offsetHeight,left:t.nw.x-n.offsetWidth}},ne:function(e){var t=f(e);return{top:t.ne.y-n.offsetHeight,left:t.ne.x}},sw:function(e){var t=f(e);return{top:t.sw.y,left:t.sw.x-n.offsetWidth}},se:function(e){var t=f(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 f(e){for(var t=o||e.target;void 0===t.getScreenCTM&&"undefined"===t.parentNode;)t=t.parentNode;var r={},n=t.getScreenCTM(),a=t.getBBox(),s=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+=s,r.ne=i.matrixTransform(n),i.y+=c,r.se=i.matrixTransform(n),i.x-=s,r.sw=i.matrixTransform(n),i.y-=c/2,r.w=i.matrixTransform(n),i.x+=s,r.e=i.matrixTransform(n),i.x-=s/2,i.y-=c/2,r.n=i.matrixTransform(n),i.y+=c,r.s=i.matrixTransform(n),r}function h(e){return"function"==typeof e?e:function(){return e}}return c}},684: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},904:function(e,t){function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}
|
|
1
|
+
(window.webpackJsonp=window.webpackJsonp||[]).push([[31,48,49,50,75,76,94,125,188,189,190,191,192,193,194,196,197,258,297,305,348,357,362,388,391],{104:function(e,t,r){"use strict";r.r(t),r.d(t,"RenderingMode",(function(){return n}));var n={YASGUI:"mode-yasgui",YASQE:"mode-yasqe",YASR:"mode-yasr"}},115:function(e,t,r){"use strict";r.r(t),r.d(t,"YasqeMode",(function(){return n}));var n={WRITE:"WRITE",READ:"READ",PROTECTED:"PROTECTED"}},118:function(e,t){function r(e,t){return{showToastMessageWithDelay:function(r){return new Promise((function(n){e.success(t.instant(r)),setTimeout(n,300)}))}}}angular.module("graphdb.framework.utils.notifications",[]).factory("Notifications",r),r.$inject=["toastr","$translate"]},120:function(e,t,r){"use strict";r.r(t),r.d(t,"removeSpecialChars",(function(){return a})),r.d(t,"toBoolean",(function(){return i})),r.d(t,"toTitleCase",(function(){return o}));var n=r(24),a=function(e){return e.replace(/[()']/g,"")},i=function(e){return"string"==typeof e?"true"===e:Boolean(e)},o=function(e){return e?Object(n.upperFirst)(e.toLowerCase()):e}},138:function(e,t,r){"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,o(n.key),n)}}function o(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var a=r.call(e,t||"default");if("object"!=n(a))return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==n(t)?t:t+""}r.r(t),r.d(t,"StartMode",(function(){return s})),r.d(t,"GraphsConfig",(function(){return c}));var s={QUERY:"query",NODE:"node",SEARCH:"search"},c=function(){return e=function e(t,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:s.SEARCH,i=arguments.length>3?arguments[3]:void 0,o=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],c=!(arguments.length>5&&void 0!==arguments[5])||arguments[5],l=arguments.length>6?arguments[6]:void 0,u=arguments.length>7?arguments[7]:void 0,d=arguments.length>8?arguments[8]:void 0,p=arguments.length>9?arguments[9]:void 0,f=arguments.length>10?arguments[10]:void 0,h=arguments.length>11?arguments[11]:void 0,g=arguments.length>12?arguments[12]:void 0,m=arguments.length>13?arguments[13]:void 0,y=arguments.length>14?arguments[14]:void 0,v=arguments.length>15?arguments[15]:void 0,x=arguments.length>16?arguments[16]:void 0,w=arguments.length>17?arguments[17]:void 0,b=arguments.length>18?arguments[18]:void 0,S=arguments.length>19?arguments[19]:void 0,C=arguments.length>20?arguments[20]:void 0;a(this,e),this._id=t,this._name=r,this._startMode=n,this._owner=i,this._startQueryIncludeInferred=o,this._startQuerySameAs=c,this._startGraphQuery=l,this._startIRI=u,this._startIRILabel=d,this._expandQuery=p,this._resourceQuery=f,this._predicateLabelQuery=h,this._resourcePropertiesQuery=g,this._shared=m,this._description=y,this._hint=v,this._startGraphQueryDescription=x,this._expandQueryDescription=w,this._resourceQueryDescription=b,this._predicateLabelQueryDescription=S,this._resourcePropertiesQueryDescription=C},(t=[{key:"isStartMode",value:function(e){return this.startMode===e}},{key:"isDefaultGraph",value:function(){return"Minimal"===this.name||"Advanced"===this.name}},{key:"getPropertyDescription",value:function(e){return this["".concat(e,"Description")]}},{key:"getQueryType",value:function(e){var t;return this.isStartMode(s.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||""}},{key:"updateModel",value:function(e,t){return this.isStartMode(s.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}},{key:"toSavePayload",value:function(){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}}},{key:"id",get:function(){return this._id},set:function(e){this._id=e}},{key:"name",get:function(){return this._name},set:function(e){this._name=e}},{key:"startMode",get:function(){return this._startMode},set:function(e){this._startMode=e}},{key:"owner",get:function(){return this._owner},set:function(e){this._owner=e}},{key:"startQueryIncludeInferred",get:function(){return this._startQueryIncludeInferred},set:function(e){this._startQueryIncludeInferred=e}},{key:"startQuerySameAs",get:function(){return this._startQuerySameAs},set:function(e){this._startQuerySameAs=e}},{key:"startGraphQuery",get:function(){return this._startGraphQuery},set:function(e){this._startGraphQuery=e}},{key:"startIRI",get:function(){return this._startIRI},set:function(e){this._startIRI=e}},{key:"startIRILabel",get:function(){return this._startIRILabel},set:function(e){this._startIRILabel=e}},{key:"expandQuery",get:function(){return this._expandQuery},set:function(e){this._expandQuery=e}},{key:"resourceQuery",get:function(){return this._resourceQuery},set:function(e){this._resourceQuery=e}},{key:"predicateLabelQuery",get:function(){return this._predicateLabelQuery},set:function(e){this._predicateLabelQuery=e}},{key:"resourcePropertiesQuery",get:function(){return this._resourcePropertiesQuery},set:function(e){this._resourcePropertiesQuery=e}},{key:"shared",get:function(){return this._shared},set:function(e){this._shared=e}},{key:"description",get:function(){return this._description},set:function(e){this._description=e}},{key:"hint",get:function(){return this._hint},set:function(e){this._hint=e}},{key:"startGraphQueryDescription",get:function(){return this._startGraphQueryDescription},set:function(e){this._startGraphQueryDescription=e}},{key:"expandQueryDescription",get:function(){return this._expandQueryDescription},set:function(e){this._expandQueryDescription=e}},{key:"resourceQueryDescription",get:function(){return this._resourceQueryDescription},set:function(e){this._resourceQueryDescription=e}},{key:"predicateLabelQueryDescription",get:function(){return this._predicateLabelQueryDescription},set:function(e){this._predicateLabelQueryDescription=e}},{key:"resourcePropertiesQueryDescription",get:function(){return this._resourcePropertiesQueryDescription},set:function(e){this._resourcePropertiesQueryDescription=e}}])&&i(e.prototype,t),r&&i(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,r}()},159: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 o}));var n=r(138),a=function(e){return 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=function(e){return 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)},o=function(e){return e.map((function(e){return i(e)}))}},160: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 o}));var 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-_]+$"),o=new RegExp("^[0-9]+$")},185: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("".concat("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("".concat("rest/dependencies","/matrix"),{params:{mode:r,classes:_.map(t,(function(e){return e.name})),graphURI:n}})},getRelationshipsClasses:function(t,r){return e.get("".concat("rest/dependencies","/classes"),{params:{mode:t,graphURI:r}})},getRelationshipsStatus:function(t){return e.get("".concat("rest/dependencies","/status"),{params:{graphURI:t}})},calculateRelationships:function(t){return e.get("".concat("rest/dependencies","/update"),{params:{graphURI:t}})},getPredicates:function(t,r,n){return e.get("".concat("rest/dependencies","/predicates"),{params:{from:t,to:r,mode:"all",graphURI:n}})},getInstanceNode:function(t){return e.get("".concat("rest/explore-graph","/node"),{params:t})},getInstanceNodeLinks:function(t){return e.get("".concat("rest/explore-graph","/links"),{params:t})},getProperties:function(t){return e.get("".concat("rest/explore-graph","/properties"),{params:t})},updateGraph:function(t){var r={headers:{"Content-Type":"application/json"}};return r=Object.assign(r,t),e.post("".concat("rest/explore-graph","/graph"),r)},getRdfsLabelAndComment:function(t,r,n){var a=n||{};return e({url:"rest/explore/details",method:"GET",params:_.extend(a,{uri:t,languages:r}),headers:{Accept:"application/json"}})}}}},295:function(e,t){function r(e){return{initLazyList:function(t,r,n,a,i){return e((function(){var e=t+a-1,o=Math.max(0-a,e),s=Math.min(e+r-1,i.length);o>s?n([]):$.isArray(i)&&n(i.slice(o,s+1))}),100,!0)}}}angular.module("graphdb.framework.graphexplore.services.uiscroll",[]).factory("UiScrollService",r),r.$inject=["$timeout"]},296:function(e,t){angular.module("graphdb.framework.graphexplore.services.rdfsdetails",[]).factory("RdfsLabelCommentService",(function(){return{processAndFilterLabelAndComment:function(e){function t(e){var t={};for(var r in e)if(e.hasOwnProperty(r)){var n=r;r.indexOf(":")>-1&&(n=r,r=r.split(":")[1].toLowerCase()),t[r]=e[n]}return t}var r=e.results.bindings,n=[],a=[];_.each(r,(function(e){var r;angular.isUndefined(e.label)||(r=t(e.label),n.push(r)),angular.isUndefined(e.comment)||(r=t(e.comment),a.push(r))}));var i=function(e){return"en"===e.lang||"de"===e.lang},o=$.grep(n,i)[0],s=$.grep(a,i)[0],c=angular.isUndefined(o)?n.length>0?n[0].value:void 0:o.value,l=angular.isUndefined(s)?a.length>0?a[0].value:void 0:s.value;return{rdfsLabel:c,rdfsComment:l}}}}))},297: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("".concat("rest/explore-graph/saved","/").concat(encodeURIComponent(t)))},editSavedGraph:function(t){return e.put("".concat("rest/explore-graph/saved","/").concat(encodeURIComponent(t.id)),t)},deleteSavedGraph:function(t){return e.delete("".concat("rest/explore-graph/saved","/").concat(encodeURIComponent(t.id)))},addNewSavedGraph:function(t){return e.post("rest/explore-graph/saved",t)}}}},298:function(e,t,r){"use strict";r.r(t);var n=r(159);angular.module("graphdb.framework.rest.graphconfig.service",[]).factory("GraphConfigRestService",i);var a="".concat("rest/explore-graph","/config");function i(e){return{getGraphConfigs:function(){return e.get(a)},getGraphConfigSamples:function(){return e.get("".concat("rest/explore-graph","/samples"))},loadGraphForConfig:function(t,r,n,i){return e.get("".concat(a,"/graph/").concat(encodeURIComponent(t.id),"?includeInferred=").concat(r,"&linksLimit=").concat(n,"&sameAsState=").concat(i))},getConfig:function(t){return e.get("".concat(a,"/").concat(encodeURIComponent(t))).then((function(e){return Object(n.mapGraphsConfigResponseToModel)(e.data)}))},createGraphConfig:function(t){return e.post(a,t)},updateGraphConfig:function(t){return e.put("".concat(a,"/").concat(encodeURIComponent(t.id)),t)},deleteGraphConfig:function(t){return e.delete("".concat(a,"/").concat(encodeURIComponent(t.id)))},validateQuery:function(t,r,n,a,i){return e({method:"POST",url:"".concat("rest/explore-graph","/validate"),data:{query:t,queryType:r,params:n,all:a,oneOf:i}})}}}i.$inject=["$http"]},299:function(e,t,r){"use strict";r.r(t);r(15);var n=r(33);function a(e,t,r,a,i,o,s,c,l,u,d,p,f,h,g,m,y){e.hasMoreGraphs=!1,e.classHierarchyData={},e.instancesObj={},e.instancesQueryObj={},e.instancesObj.items=[],e.instancesNotFiltered=[],e.isWarningShowed=!1,e.onopen=e.onclose=function(){return angular.noop()},e.currentBrowserLimit=2e3,f.firefox?e.currentBrowserLimit=50:(f.safari||f.msie||f.msedge)&&(e.currentBrowserLimit=400),e.graphsDropdownToggled=function(t){e.hasMoreGraphs&&t&&s.warning(y.instant("dependencies.graphs.too.many.warning",{graphsLimit:n.NumberUtils.formatNumberToLocaleString(1e3,y.use())}))};var v={},x=0,w=0;t.key="",v.get=function(t,r,n){return l.initLazyList(t,r,n,x,e.instancesObj.items)};var b=allGraphs,S=function(){if(e.getActiveRepository())return m.resolveGraphs(a.getActiveRepository(),1001).success((function(t){e.graphsInRepo=t.results.bindings,e.hasMoreGraphs=e.graphsInRepo.length>1002,C()})).error((function(t){e.repositoryError=getError(t),s.error(getError(t),y.instant("graphexplore.error.getting.graphs"))}))},C=function(){var t=h.get("classHierarchy-selectedGraph-".concat(a.getActiveRepository()));null!==t&&e.graphsInRepo.some((function(e){return e.contextID.uri===t.contextID.uri}))?b=t:h.set("classHierarchy-selectedGraph-".concat(a.getActiveRepository()),b)},I=function(){return e.instancesObj.items.length<1e3?y.instant("graphexplore.search.class.instances"):y.instant("graphexplore.search.first.class.instances")};t.$watch((function(){return t.key}),(function(){x=0,_.each(e.instancesObj.items,(function(e){t.key>e&&x++})),w++})),v.revision=function(){return w},e.adapterContainer={adapter:{remain:!0}};var R=[];R.push(e.$on("goToDomainRangeGraphView",(function(e,t){L(t)}))),R.push(e.$on("classCount",k)),R.push(e.$on("repositoryIsSet",(function(){if(!i.isLicenseValid())return;if(N===a.getActiveRepository())return;N=a.getActiveRepository();if(e.repositoryError=null,!N)return;b=allGraphs,S().then(P)}))),R.push(t.$on("$translateChangeSuccess",(function(){e.instancesSearchPlaceholder=I()})));function k(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(){d(E,100,!0)}}},null===h.get(g.CLASS_HIERARCHY_CURRENT_SLIDER_VALUE)&&r>e.currentBrowserLimit&&(a=e.currentBrowserLimit,f.chrome?s.warning(y.instant("graphexplore.disabling.animations",{classLimit:a}),y.instant("graphexplore.reducing.visual.effects")):s.warning(y.instant("graphexplore.browser.performance",{browser:f.name,classLimit:a}),y.instant("graphexplore.reducing.visual.effects"))));var i=h.get(g.CLASS_HIERARCHY_SWITCH_PREFIXES);null!=i&&"true"!==i&&(e.showExternalElements=!0),n?e.classCountSlider.value=n:r>=1500&&(e.classCountSlider.value=1500,s.warning(y.instant("graphexplore.class.count.slider",{count:1500}),y.instant("graphexplore.reducing.class.count"))),r>=25&&!window.ActiveXObject&&"ActiveXObject"in window&&!e.isWarningShowed&&(e.classCountSlider.value=25,e.isWarningShowed=!0,s.warning(y.instant("graphexplore.class.count.browser",{count:25}),y.instant("graphexplore.reducing.class.count"))),d((function(){e.$broadcast("reCalcViewDimensions");var t=document.getElementById("rzslider"),r=0;t.addEventListener("wheel",(function(t){t.preventDefault(),t.stopPropagation();var n=(new Date).getTime();if(n-r>100){r=n;var a=e.classCountSlider.value,i=e.classCountSlider.options.step||1;t.deltaY<=-1?a+=i:t.deltaY>=1&&(a-=i),(a=Math.max(e.classCountSlider.options.floor,Math.min(e.classCountSlider.options.ceil,a)))!==e.classCountSlider.value&&e.$apply((function(){e.classCountSlider.value=a,d(E,100,!0)}))}}))}),200),E()}function E(){e.currentSliderValue=e.classCountSlider.value}function L(e){var t=e.data.fullName,n=e.data.name;c.checkDomainRangeData(t).success((function(e,a){204===a?s.warning(y.instant("graphexplore.no.domain.range",{name:n})):(h.set(g.CLASS_HIERARCHY_LAST_SELECTED_CLASS,r.hash()),r.hash("").path("domain-range-graph").search("uri",t).search("name",n))})).error((function(){s.error(y.instant("graphexplore.error.request.failed",{name:n}))}))}function A(){r.replace().hash("1"),e.instancesObj.items=[],e.showExternalElements=!1,e.showClassInfoPanel=!1,h.clearClassHieararchyState(),e.hidePrefixes="true"===h.get(g.CLASS_HIERARCHY_HIDE_PREFIXES),e.currentSliderValue=void 0,e.classHierarchyData={},t.$broadcast("angucomplete-alt:clearInput")}function T(){e.hasClassHierarchy()&&d((function(){$("#toolbar").removeClass("ng-hide")}),0)}R.push(e.$on("$destroy",(function(){R.forEach((function(e){return e()}))}))),e.datasource=v,e.goToDomainRangeGraphView=L,e.toggleClassInfoSidePanel=function(){e.showClassInfoPanel=!e.showClassInfoPanel,t.$broadcast("sidePanelClosed")},e.toggleHidePrefixes=function(){e.hidePrefixes=!e.hidePrefixes},e.getActiveRepositoryNoError=function(){if(!e.repositoryError)return a.getActiveRepository()},e.isSystemRepository=function(){return a.isSystemRepository()},e.confirmReloadClassHierarchy=function(){p.openSimpleModal({title:y.instant("confirm.operation"),message:y.instant("graphexplore.calculating.hierarchy"),warning:!0}).result.then((function(){A(),e.loader=!0,e.hierarchyError=!1,c.reloadClassHierarchy(b.contextID.uri).success((function(t){e.loader=!1,e.classHierarchyData=t,T(),k()})).error((function(t){e.loader=!1,e.hierarchyError=getError(t),s.error(getError(t),y.instant("graphexplore.error.rdf.class.request"))}))}))},e.focusOnRoot=function(){e.$broadcast("rootFocus")},e.copyToClipboard=function(e){p.openCopyToClipboardModal(e)},e.searchedClassCallback=function(e){if(e){var 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},S(),e.$watch("instancesObj.items",(function(){e.instancesObj.items.length>0&&d((function(){e.adapterContainer.adapter.reload()}),30)})),e.$watch("selectedClass",(function(){e.showClassInfoPanel&&function(t){var r=t.data.fullName,n=t.data.name;if(n===r){var a=n.lastIndexOf("#");n=n.substring(a+1)}e.encodedUri=encodeURIComponent(r);var i=encodeURIComponent("prefix onto:<http://www.ontotext.com/>\nselect ?s {\n ?s a <"+r+"> .\n}");e.viewInstancesUri="sparql?name="+n+"&infer=true&sameAs=false&query="+i+"&execute=true",c.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,c.getClassInstances(r).success((function(t){e.instancesObj.items=[],_.each(t,(function(t,r){var 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=I(),e.instancesNotFiltered=e.instancesObj.items})).error((function(){s.error(y.instant("graphexplore.error.instances.request"))}))}(e.selectedClass)})),$(document).ready((function(){$(".prefix-toggle").click((function(){$(".tooltip").hide()}))}));var N=a.getActiveRepository();function P(){A(),!e.isSystemRepository()&&e.isLicenseValid()&&(e.hierarchyError=!1,e.loader=!0,c.getClassHierarchyData(b.contextID.uri).success((function(t,r){e.showExternalElements=!0,e.loader=!1,e.classHierarchyData=t,207===r&&s.warning(y.instant("graphexplore.update.diagram"),y.instant("graphexplore.repository.data.changed")),T()})).error((function(t){e.loader=!1,e.hierarchyError=getError(t),s.error(getError(t),y.instant("graphexplore.error.rdf.class.request"))})))}e.hasClassHierarchy=function(){return e.classHierarchyData.classCount&&e.getActiveRepositoryNoError()&&!e.isSystemRepository()},e.isLicenseValid=function(){return i.isLicenseValid()},e.chosenGraph=function(e){b=e,P(),h.set("classHierarchy-selectedGraph-".concat(a.getActiveRepository()),b)},e.getSelGraphValue=function(){return b.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",a),a.$inject=["$scope","$rootScope","$location","$repositories","$licenseService","$window","toastr","GraphDataRestService","UiScrollService","RdfsLabelCommentService","$timeout","ModalService","bowser","LocalStorageAdapter","LSKeys","RDF4JRepositoriesRestService","$translate"]},300:function(e,t,r){"use strict";r.r(t);r(15);function n(e,t,r,n,a,i,o,s,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=function(){return angular.noop()};var f={},h=0,g=0;r.key="",f.get=function(t,r,n){return l.initLazyList(t,r,n,h,e.predicatesObj.items)},r.$watch((function(){return r.key}),(function(){h=0,_.each(e.predicatesObj.items,(function(e){r.key>e&&h++})),g++})),f.revision=function(){return g},e.adapterContainer={adapter:{remain:!0}};var m=o.get(s.DOMAIN_RANGE_COLLAPSE_EDGES);function y(){var e=o.get(s.CLASS_HIERARCHY_LAST_SELECTED_CLASS);t.search("").hash(e).path("hierarchy")}e.collapseEdges=null===m||"true"===m,e.datasource=f,e.$on("reloadDomainRangeGraphView",(function(e,r){var 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,o.set(s.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){var 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="";var a=r.allEdges?r.allEdges:n.allEdges;_.each(a,(function(t){var 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()}))}));var 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"]},301:function(e,t,r){"use strict";r.r(t),function(e){var t=r(33),n="WAIT",a="NO_REPO",i="READY",o="IN_PROGRESS",s="ERROR",c={contextID:{type:"all",value:"all.graphs.label",uri:""}};function l(e){if(e<1e3)return e;var t=Math.floor(Math.log(e)/Math.log(1e3)),r=e/Math.pow(1e3,t);return(r=r%1>1/Math.pow(1e3,t-1)?r.toFixed(2):r.toFixed(0))+["K","M","G","T","P","H"][t-1]}function u(e,r,l,u,d,p,f,h,g,m,y){var v=null;e.hasMoreGraphs=!1,e.status=l.getActiveRepository()?n:a,e.graphsDropdownToggled=function(r){e.hasMoreGraphs&&r&&u.warning(y.instant("dependencies.graphs.too.many.warning",{graphsLimit:t.NumberUtils.formatNumberToLocaleString(1e3,y.use())}))};var x=c,w=function(){m.resolveGraphs(l.getActiveRepository(),1001).success((function(t){e.graphsInRepo=t.results.bindings,e.hasMoreGraphs=e.graphsInRepo.length>1002,b(),e.isSystemRepository()?"READY"!==e.status&&C():(e.status="WAIT",C(!0))})).error((function(t){e.repositoryError=getError(t),u.error(getError(t),y.instant("graphexplore.error.getting.graph"))}))},b=function(){var t=g.get("dependencies-selectedGraph-".concat(l.getActiveRepository()));null!==t&&e.graphsInRepo.some((function(e){return e.contextID.uri===t.contextID.uri}))?x=t:g.set("dependencies-selectedGraph-".concat(l.getActiveRepository()),x)},S=function(t){d3.select("#dependencies-chord").html(""),e.status=n,p.getRelationshipsData(t,e.direction,x.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=i})).error((function(t){e.status=i,u.error(getError(t),y.instant("graphexplore.error.dependencies.count"))}))},C=function(t){(e.status!==i||t)&&(e.status=n,p.getRelationshipsStatus(x.contextID.uri).success((function(t){if(e.status=t,e.status===o){if(null!==v)return;v=d(C,2e3)}e.status===i&&(null!==v&&(d.cancel(v),v=null),p.getRelationshipsClasses(e.direction,x.contextID.uri).success((function(t,r){e.allClasses.items=_.filter(t,E),e.allNotFilteredClasses=t,e.selectedClasses=void 0,angular.isUndefined(e.selectedClasses)&&(e.selectedClasses=t.slice(0,10)),S(e.selectedClasses),207===r&&u.warning(y.instant("graphexplore.update.diagram"),y.instant("graphexplore.repository.data.changed"))}))),0===e.status.indexOf("ERROR;")&&(e.status=s,u.error(y.instant("graphexplore.error.dependencies.calc",{error:e.status.substring("ERROR;".length)})))})).error((function(t){e.status=s,u.error(getError(t),y.instant("graphexplore.error.dependencies.count.status"))})))};e.allClasses={},e.allClasses.items=[],e.allNotFilteredClasses=[],e.direction="all";var I={},R=0,k=0;function E(t){return-1!==t.name.toLowerCase().indexOf(e.classQuery.query.toLowerCase())}r.key="",I.get=function(t,r,n){f.initLazyList(t,r,n,R,e.allClasses.items)},r.$watch((function(){return r.key}),(function(){R=0,_.each(e.allClasses.items,(function(e){r.key>e&&R++})),k++})),I.revision=function(){return k},e.datasource=I,e.adapterContainer={adapter:{remain:!0}},e.classQuery={},e.classQuery.query="",e.classFilterFunc=E,e.$watch("allClasses.items",(function(){e.allClasses.items.length>0&&d((function(){e.adapterContainer.adapter.reload()}),30)})),e.$watch("direction",(function(){!l.getActiveRepository()||e.isSystemRepository()||l.isActiveRepoFedXType()||w()})),e.$on("$destroy",(function(){d.cancel(v)})),e.isLoading=function(){return e.status===o||e.status===n},e.confirmCalculateDependencies=function(){h.openSimpleModal({title:y.instant("confirm.operation"),message:y.instant("graphexplore.calculating.relationships"),warning:!0}).result.then((function(){e.calculateDependencies()}))},e.calculateDependencies=function(){e.status=n,e.selectedClasses=void 0,p.calculateRelationships(x.contextID.uri).success((function(t){0===t.indexOf("ERROR;")?u.error(y.instant("graphexplore.error.dependencies.calc",{error:e.status.substring("ERROR;".length)})):C()})).error((function(e){u.error(y.instant("graphexplore.error.could.not.force.count",{error:getError(e)}))}))},e.addClass=function(t){e.selectedClasses.push(t),S(e.selectedClasses)},e.removeClass=function(t){_.remove(e.selectedClasses,(function(e){return e.name===t.name})),S(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})),S(e.selectedClasses)},e.removeClassByName=function(t){_.remove(e.selectedClasses,(function(e){return e.name===t})),S(e.selectedClasses)},e.removeAllClasses=function(){e.selectedClasses=[],S(e.selectedClasses)},e.isSystemRepository=function(){return"SYSTEM"===l.getActiveRepository()};var L=e.$on("repositoryIsSet",(function(){e.classQuery={},e.classQuery.query="",e.repositoryError=null,x=c,l.getActiveRepository()&&!l.isActiveRepoFedXType()?w():e.status=a}));window.addEventListener("beforeunload",(function e(){L(),window.removeEventListener("beforeunload",e)})),e.selectGraph=function(e){x=e,C(!0),g.set("dependencies-selectedGraph-".concat(l.getActiveRepository()),x)},e.getSelectedGraphValue=function(){return x.contextID.value},e.isAllGraphsSelected=function(){return"all.graphs.label"===e.getSelectedGraphValue()}}Object.defineProperty(e,"allGraphs",{get:function(){return c}}),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",u).config(["$uibTooltipProvider",function(e){e.options({appendToBody:!0})}]).filter("humanize",(function(){return l})),u.$inject=["$scope","$rootScope","$repositories","toastr","$timeout","GraphDataRestService","UiScrollService","ModalService","LocalStorageAdapter","RDF4JRepositoriesRestService","$translate"]}.call(this,r(18))},302:function(e,t,r){"use strict";r.r(t);r(10),r(29),r(60);var n=r(647),a=r(658),i=(r(15),r(160)),o=r(120),s=r(11),c=r(42);function l(e){return function(e){if(Array.isArray(e))return d(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||u(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function u(e,t){if(e){if("string"==typeof e)return d(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?d(e,t):void 0}}function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function p(e){return(p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function f(e,t,r,d,f,h,g,m,y,v,x,w,b,S,C,I,R,k,E,L,A,T,N){e.languageChanged=!1,e.propertiesObj={},e.propertiesObj.items=[],e.propertiesQueryObj={},e.propertiesQueryObj.query="",e.propertiesSearchPlaceholder=L.instant("visual.search.instance.placeholder"),e.propertiesNotFiltered=[],e.searchVisible=!1,e.nodeSelected=!1,e.queryResultsMode=!1,e.embedded=y.search().embedded,e.openedNodeInfoPanel=void 0,e.invalidLimit=!1,e.INVALID_LINKS_MSG=L.instant("sidepanel.invalid.limit.links.msg"),e.INVALID_LINKS_TOOLTIP=L.instant("sidepanel.invalid.limit.links.tooltip"),e.datasource=void 0,e.adapterContainer={adapter:{remain:!0}},e.hasInitedRepository=!1,e.defaultSettings={linksLimit:20,includeInferred:!0,sameAsState:!0,languages:["en"],showLinksText:!0,preferredTypes:[],rejectedTypes:[],preferredPredicates:[],rejectedPredicates:["http://dbpedia.org/property/logo","http://dbpedia.org/property/hasPhotoCollection","http://dbpedia.org/property/website","http://dbpedia.org/property/homepage","http://dbpedia.org/ontology/thumbnail","http://xmlns.com/foaf/0.1/depiction","http://xmlns.com/foaf/0.1/homepage","http://xmlns.com/foaf/0.1/mbox","http://dbpedia.org/ontology/wikiPage*","http://dbpedia.org/property/wikiPage*","http://factforge.net/*"],preferredTypesOnly:!1,preferredPredicatesOnly:!1,includeSchema:!0},e.saveSettings=_.cloneDeep(e.defaultSettings),e.defaultGraphConfig={id:"default",name:"Easy graph",startMode:"search"},t.key="",e.onopen=e.onclose=function(){return angular.noop()},e.goToHome=function(){G(),y.url("graphs-visualizations")},e.shouldShowSettings=function(){return e.configLoaded&&e.configLoaded.id===e.defaultGraphConfig.id},e.shouldDisableSameAs=function(){var t=$("#sameAsCheck");return e.settings&&!e.settings.includeInferred&&t.prop("checked")&&(t.prop("checked",!1),e.settings.sameAsState=!1),e.settings&&!e.settings.includeInferred},e.propertiesFilterFunc=function(t){return t.key.toLowerCase().indexOf(e.propertiesQueryObj.query.toLowerCase())>=0},e.toggleMoreInfo=function(e){angular.element(e.currentTarget).parent().next().toggle(200),angular.element(e.currentTarget).children("span").toggleClass("icon-caret-down").toggleClass("icon-caret-up")},e.copyToClipboard=function(e){w.openCopyToClipboardModal(e)},e.resetSettings=function(){e.settings=_.cloneDeep(e.defaultSettings),e.validateLinksLimit(),F()},e.changeLimit=function(t){var r=e.settings.linksLimit+t;r<1&&(r=1),r>1e3&&(r=1e3),e.settings.linksLimit=r},e.validateLinksLimit=function(){e.invalidLimit=!i.NUMBER_PATTERN.test(e.settings.linksLimit)},e.showSettings=function(){e.showInfoPanel=!0,e.showFilter=!0,e.showNodeInfo=!1,e.showPredicates=!1,e.saveSettings?e.settings=_.cloneDeep(e.saveSettings):e.settings=_.cloneDeep(e.defaultSettings),F()},e.updateSettings=function(){e.invalidLimit?f.error(e.INVALID_LINKS_TOOLTIP,e.INVALID_LINKS_MSG):(e.saveSettings=e.settings,e.saveSettings.languages=_.map(e.saveSettings.languagesMap,(function(e){return e.text})),e.saveSettings.preferredTypes=_.map(e.saveSettings.preferredTypesMap,(function(e){return e.text})),e.saveSettings.rejectedTypes=_.map(e.saveSettings.rejectedTypesMap,(function(e){return e.text})),e.saveSettings.preferredPredicates=_.map(e.saveSettings.preferredPredicatesMap,(function(e){return e.text})),e.saveSettings.rejectedPredicates=_.map(e.saveSettings.rejectedPredicatesMap,(function(e){return e.text})),e.rootNodeIri?H(e.rootNodeIri):e.queryResultsMode&&y.search().query?q(y.search().query,y.search().sameAs,y.search().inference):"query"===e.configLoaded.startMode&&Z(e.configLoaded),Q(),e.showInfoPanel=!1,e.showFilter=!1,C.set(I.GRAPHS_VIZ,e.saveSettings))},e.getGraphConfigs=function(t){k.getGraphConfigs().success((function(r){e.graphConfigs=r,t&&t()})).error((function(e){f.error(getError(e),L.instant("graphexplore.error.graph.configs.short.msg"))}))},e.findConfigById=function(t){return t===e.defaultGraphConfig.id?e.defaultGraphConfig:$.grep(e.graphConfigs,(function(e){return e.id===t}))[0]},e.easyGraphSearch=function(t){e.configLoaded=e.defaultGraphConfig,e.openUri(t)},e.deleteConfig=function(t){w.openSimpleModal({title:L.instant("common.confirm"),message:L.instant("graphexplore.delete.graph",{configName:t.name}),warning:!0}).result.then((function(){k.deleteGraphConfig(t).success((function(){e.getGraphConfigs(),e.refreshSavedGraphs()})).error((function(e){f.error(getError(e),L.instant("graphexplore.error.cannot.delete.config"))}))}))},e.goToGraphConfig=function(e){j({config:e.id},{config:e}),G(),Z(e)},e.replaceIRIWithPrefix=function(t){var r=e.namespaces,n=_.findLast(r,(function(e){return 0===t.indexOf(e.uri)}));return n?n.prefix+":"+t.substring(n.uri.length):t};var P=[];P.push(t.$on("$translateChangeSuccess",(function(){e.INVALID_LINKS_MSG=L.instant("sidepanel.invalid.limit.links.msg"),e.INVALID_LINKS_TOOLTIP=L.instant("sidepanel.invalid.limit.links.tooltip"),e.propertiesSearchPlaceholder=L.instant("visual.search.instance.placeholder")}))),P.push(T.onAutocompleteEnabledUpdated((function(t){e.isAutocompleteEnabled=t}))),P.push(T.onSelectedRepositoryIdUpdated((function(t){t?N.getNamespaces(t).then((function(t){e.repositoryNamespaces=t,e.namespaces=t.namespaces})).catch((function(e){var t=getError(e);f.error(t,L.instant("error.getting.namespaces.for.repo"))})):e.repositoryNamespaces=new s.NamespacesListModel}))),P.push(e.$on("repositoryIsSet",(function(t,r){r.newRepo&&(e.hasInitedRepository=!1),ge(r.newRepo),r.newRepo&&(G(),$(".graph-visualization svg").empty(),y.search().query&&(e.goToHome(),z()))})));P.push(t.$watch((function(){return t.key}),(function(){te=0,_.each(e.propertiesObj.items,(function(e){t.key>e&&te++})),re++})));P.push(e.$watch("propertiesObj.items",(function(){angular.isDefined(e.propertiesObj.items)&&e.propertiesObj.items.length>0&&h((function(){e.adapterContainer.adapter.reload()}),500)})));var O=!1,D=0;function M(e){O&&e.stopPropagation()}document.addEventListener("keydown",M,!0);e.$on("$destroy",(function(){P.forEach((function(e){return e()})),document.removeEventListener("keydown",M,!0)}));var j=function(t,r){e.embedded&&(t.embedded=!0),y.search(t),y.state(r)},G=function(){e.searchVisible=!1,e.nodeSelected=!1,e.configLoaded=null,e.queryResultsMode=!1,e.lastSavedGraphName=null,e.lastSavedGraphId=null,e.shared=!1,e.numberOfPinnedNodes=0,ne={},ae=0},U=function(){return A.isActive()?e.defaultSettings:e.saveSettings},Q=function(){U().showLinksText?d3.selectAll("svg .link-wrapper text").style("display","block"):d3.selectAll("svg .link-wrapper text").style("display","none")},F=function(){e.settings.languagesMap=_.map(e.settings.languages,(function(e){return{text:e}})),e.settings.preferredTypesMap=_.map(e.settings.preferredTypes,(function(e){return{text:e}})),e.settings.rejectedTypesMap=_.map(e.settings.rejectedTypes,(function(e){return{text:e}})),e.settings.preferredPredicatesMap=_.map(e.settings.preferredPredicates,(function(e){return{text:e}})),e.settings.rejectedPredicatesMap=_.map(e.settings.rejectedPredicates,(function(e){return{text:e}}))},H=function(){e.rootNodeIri&&e.$broadcast("onRootNodeChange",e.rootNodeIri)},z=function(){y.search().query?(e.searchVisible=!1,e.queryResultsMode=!0,q(y.search().query,y.search().sameAs,y.search().inference)):e.$on("onRootNodeChange",(function(t,r){e.loading=!0;var n=U();angular.isDefined(r)&&(e.rootNodeIri=r,E.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");var r=(he=new fe).addNode(t.data,de/2,pe/2);ue=se,Ne(r,!0)})).catch((function(t){e.loading=!1,f.error(getError(t),L.instant("graphexplore.error.could.not.load.graph"))})))})),y.search().uri&&e.openUri(y.search().uri,!0),y.search().saved&&R.getSavedGraph(y.search().saved).success((function(t){e.loadSavedGraph(t)})).error((function(e){var t=getError(e);f.error(t,L.instant("graphexplore.error.could.not.open"))}))},q=function(t,r,n){var a=U(),i=void 0===r?a.sameAsState:!0===r,o=void 0===n?a.includeInferred:!0===n;e.loading=!0,E.updateGraph({query:t,linksLimit:a.linksLimit,languages:e.shouldShowSettings()?a.languages:[],includeInferred:o,sameAsState:i}).then((function(e){Ae(e)}),(function(t){e.loading=!1,f.error(getError(t.data),L.instant("graphexplore.error.cannot.load.graph"))}))},B=function(e,t){var r=e.split(" ");return t?[r[0],r[1],r[2]].join(">"):[r[0],r[2]].join(">")},W=function(e){return[e.source.iri,e.target.iri].join(">")},V=function(e){if(e.isTriple){var t=document.getElementById(Object(o.removeSpecialChars)(B(e.iri)));if(t&&void 0!==t.__data__.x)return t.__data__.x}return e.x},Y=function(e){if(e.isTriple){var t=document.getElementById(Object(o.removeSpecialChars)(B(e.iri)));if(t&&void 0!==t.__data__.y)return t.__data__.y}return e.y},K=function(e){var t=e.trim().split(" ");return"<<<".concat(t[0],"> <").concat(t[1],"> <").concat(t[2],">>>")},X=function(e){var t=e.source.isTriple?B(e.source.iri,!0):e.source.iri,r=e.target.isTriple?B(e.target.iri,!0):e.target.iri;return Object(o.removeSpecialChars)("".concat(t,">").concat(r,">marker"))},Z=function(t){e.configLoaded=t,"search"===t.startMode?e.searchVisible=!0:"node"===t.startMode&&t.startIRI?h((function(){e.openUri(t.startIRI,!0)}),0):"query"===t.startMode&&t.startGraphQuery&&(e.loading=!0,k.loadGraphForConfig(t,t.startQueryIncludeInferred,U().linksLimit,t.startQuerySameAs).then((function(e){Ae(e)}),(function(t){e.loading=!1,f.error(getError(t),L.instant("graphexplore.error.graph.load"))})))},J=function(){var t,r;y.search().config?(t=y.search().config,r=z,t===e.defaultGraphConfig.id?Z(e.defaultGraphConfig):k.getConfig(t).then((function(e){Z(e),r()})).catch((function(e){f.error(getError(e),L.instant("graphexplore.error.could.not.load.config",{configId:t}))}))):y.search().query||y.search().uri?(Z(e.defaultGraphConfig),z()):z()};S.onpopstate=function(t){G(),t.state&&(t.state.config?(Z(t.state.config),t.state.uri&&e.openUri(t.state.uri,!0)):t.state.savedGraph&&e.loadSavedGraph(t.state.savedGraph,!0))},e.embedded&&(y.search().query||y.search().uri||y.search().config||y.search().saved)&&(e.noGoHome=!0);var ee,te=0,re=0,ne={},ae=0,ie=16,oe=d3.zoom().scaleExtent([.1,10]),se=d3.zoomIdentity.translate(0,-70).scale(1);oe.on("zoom",(function(e){A.isActive()||(ue=e.transform,ee.attr("transform",ue))}));var ce,le,ue=se,de=1e3,pe=1e3;function fe(){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(){var e={},t={};_.each(this.links,(function(r){var 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){var t=this.nodes;Array.prototype.push.apply(this.links,function(e,t){return _.map(e,(function(e){var r={source:e.isTripleSource?$e(e.source):_.find(t,(function(t){return t.iri===e.source})),target:e.isTripleTarget?$e(e.target):_.find(t,(function(t){return t.iri===e.target})),predicates:e.predicates};if(e.isTripleSource||e.isTripleTarget){var n=r.source.isTriple?B(r.source.iri):r.source.iri,a=r.target.isTriple?B(r.target.iri):r.target.iri,i="".concat(n,">").concat(a);if(he.tripleLinksCopy.has(i)){var o,s=he.tripleLinksCopy.get(i);return(o=s[0].predicates).push.apply(o,l(r.predicates)),s.push(r),he.tripleLinksCopy.set(i,s),null}he.tripleLinksCopy.set(i,[r])}return r}))}(e,t));var r,n=function(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=u(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,a=function(){};return{s:a,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,i=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw i}}}}(he.tripleLinksCopy.keys());try{for(n.s();!(r=n.n()).done;){var a=r.value;1===he.tripleLinksCopy.get(a).length&&he.tripleLinksCopy.delete(a)}}catch(e){n.e(e)}finally{n.f()}this.links=this.links.filter((function(e){return null!==e})),this.computeConnectedness()};var 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){var 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){var n=r(e,t),a=_.map(n,(function(e){return e.predicates}));return _.uniq(_.flatten(a))},this.removeTriples=function(e){var t=this,r=[];this.tripleNodes.size>0&&e.forEach((function(e){t.tripleNodes.has(e)&&(t.tripleNodes.delete(e),t.links=_.reject(t.links,(function(t){var n=e.split(">"),a=B(t.source.iri),i=B(t.target.iri);if(a===e&&he.tripleNodes.delete(i)){var o=i.split(">");r.push({source:o[0],target:o[1]})}var s=a===e||i===e||t.source.iri===n[0]&&t.target.iri===n[1];return s&&(he.tripleLinksCopy.delete("".concat(a,">").concat(i)),he.tripleLinksCopy.delete("".concat(i,">").concat(a))),s})))})),r.forEach((function(e){t.links=_.reject(t.links,(function(t){return t.source.iri===e.source&&t.target.iri===e.target}))}))},this.removeNode=function(r){var n=[];this.links=_.reject(this.links,(function(e){var t=e.source.iri===r.iri||e.target.iri===r.iri;return t&&(e.target.isTriple&&n.push(B(e.target.iri)),e.source.isTriple||e.target.isTriple||n.push([e.source.iri,e.target.iri].join(">"))),t})),this.removeTriples(n);var 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){var n=[],a=this.links;this.links=_.reject(this.links,(function(i){var o=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(!o){var s;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||(s=r(i.source,a)):s=r(i.target,a),!s)return!1;o=(s[0].source.iri===e.iri||s[0].target.iri)&&(s[1].source.iri===e.iri||s[1].target.iri)}return o&&(i.target.isTriple&&n.push(B(i.target.iri)),i.source.isTriple||i.target.isTriple||n.push([i.source.iri,i.target.iri].join(">"))),o})),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;var n=B(e.iri);if(this.tripleNodes.has(n)){var a=this.tripleNodes.get(n);a.push(e),this.tripleNodes.set(n,a)}else e.weight=10,this.tripleNodes.set(n,[e])},this.copyState=function(){var e=_.map(this.nodes,(function(e){return{iri:e.iri,isTriple:e.isTriple,size:e.size,labels:_.cloneDeep(e.labels),types:_.cloneDeep(e.types),rdfRank:e.rdfRank,x:e.x,y:e.y,fixed:e.fixed}})),t=JSON.stringify(Array.from(this.tripleNodes.entries())),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:ae,type2color:ne,transform:ue}},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)&&(ae=t.colorIndex,ne=_.cloneDeep(t.type2color)),angular.isDefined(t.transform)&&(ue=d3.zoomIdentity.translate(t.transform.x,t.transform.y).scale(t.transform.k)),Re()}}e.datasource={get:function(t,r,n){return x.initLazyList(t,r,n,te,e.propertiesObj.items)},revision:function(){return re}},m.when(v.getPrincipal()).then((function(t){return function(t){var 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;var n=C.get(I.GRAPHS_VIZ);if(n&&"object"===p(n))try{e.saveSettings=n,void 0===e.saveSettings.includeSchema&&(e.saveSettings.includeSchema=e.defaultSettings.includeSchema,e.saveSettings.rejectedPredicates=[].concat(l(e.saveSettings.rejectedPredicates),l(e.defaultSettings.rejectedPredicates)).unique())}catch(t){e.saveSettings=_.cloneDeep(e.defaultSettings),C.set(I.GRAPHS_VIZ,e.saveSettings)}else e.saveSettings=_.cloneDeep(e.defaultSettings)}(t)})),e.showInfoPanel=!1;var he=new fe;function ge(t){!r.getActiveRepository()||e.hasInitedRepository&&!t||(e.hasInitedRepository=!0,t||e.getGraphConfigs(J))}e.addedTag=function(t){return t.text.indexOf(":")<0?(f.warning(L.instant("graphexplore.absolute.prefixed.iri")),null):(t.text=function(e,t){if(!/^<?(http|urn).*>?/.test(e)){var r=e.split(":"),n=r[0],a=r[1];if(!angular.isUndefined(a)){var i=g.getNamespaceUriForPrefix(t,n);if(i)return i+a}}return e}(t.text,e.namespaces),e.pageslideExpanded=!0,t)},e.validateTag=function(e,t,r){if(e.text.indexOf(":")<0)return r?f.warning(L.instant("graphexplore.absolute.prefixed.iri.option"),t):f.warning(L.instant("graphexplore.absolute.prefixed.iri"),t),!1;var n=e.text.indexOf("*");if(n>=0){if(!r)return f.warning(L.instant("graphexplore.wildcards.not.allowed"),t),!1;if(n<e.text.length-1)return f.warning(L.instant("graphexplore.wildcards.last.char"),t),!1}return!0},e.getTagClass=function(e){return e.endsWith("*")?"tag-item-wildcard":null},e.getActiveRepository=function(){return r.getActiveRepository()},e.isLicenseValid=function(){return d.isLicenseValid()},ge();var me=d3.scaleLinear().domain([0,9]).range(["hsl(0, 100%, 75%)","hsl(360, 90%, 82%)"]).interpolate(d3.interpolateHslLong),ye=d3.scaleLinear().domain([0,9]).range(["hsl(180, 50%, 75%)","hsl(540, 40%, 82%)"]).interpolate(d3.interpolateHslLong);e.getColor=function(e){angular.isUndefined(ne[e])&&(ne[e]=ae,ae++);var t=ne[e];return t>39?"#c2c2c2":t%2==0?me(t/2):ye(t/2)};var ve=d3.forceX(de/2).strength(.005),xe=d3.forceY(pe/2).strength(.005),we=d3.forceSimulation().force("x",ve).force("y",xe),be=d3.select(".main-container .graph-visualization").append("svg").attr("viewBox","0 0 "+de+" "+pe).attr("preserveAspectRatio","xMidYMid meet");be.append("rect").attr("width",10*de).attr("height",10*pe).attr("x",-(10*de-de)/2).attr("y",-(10*pe-pe)/2).style("fill","none").style("pointer-events","all").call(oe).on("click",(function(e){e.stopPropagation(),Pe(),we.stop()}));var Se=0,Ce=0,Ie=new function(){this.state=!1,this.setLoadingState=function(e){this.state=e},this.getLoadingState=function(){return this.state},this.init=function(e,t){d3.select(t).append("circle").attr("cx",(function(){return e.x})).attr("cy",(function(){return e.y})).attr("class","loader-container").attr("r",(function(){return e.size})).style("fill","fff").style("opacity","0.7"),d3.select(t).append("image").attr("xlink:href","js/angular/templates/loader/ot-loader.svg?v=3.0.2").attr("x",(function(){return e.x-e.size+5})).attr("y",(function(){return e.y-e.size})).attr("width",(function(){return 2*e.size})).attr("height",(function(){return 2*e.size})).attr("class","node-loader")}};function Re(t){d3.selectAll("svg g").remove(),d3.selectAll(".d3-tip").remove(),d3.selectAll(".menu-events").remove(),ee=be.append("g").attr("class","nodes-container").attr("transform",(function(){return angular.isDefined(ue)&&!t?ue:""}));var r,i=Object(a.a)().attr("class","d3-tip").customPosition((function(){var e=ce.getBoundingClientRect();return{top:e.bottom+10+"px",left:e.left-30+"px"}})).html((function(t){var r="";return t.fixed&&(r+='<i class="icon-pin"></i> '),t.types.length>0?r+=t.types.map((function(t){return"<div> · ".concat(e.replaceIRIWithPrefix(t),"</div>")})).join(""):r+="<i>".concat(L.instant("visual.node.tooltip.no_types"),"</i>"),r})),s=function(e){var t="";return t+=_.join(_.map(e.predicates,(function(t,r){if(0===r)return Ue(t);if(r<10)return" · "+Ue(t);if(10===r){var n=function(e){return e.predicates.length-10}(e),a=n>1?n+" predicates":n+" predicate";return" · "+L.instant("graphexplore.tip.text",{textToShow:a})}})),"")},l=Object(a.a)().attr("class","d3-tip").customPosition((function(e){var t=r.getBoundingClientRect(),n=function(e){var t=s(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:n+"px"}})).html((function(e){return s(e)})),u=function(){h.cancel(void 0),h.cancel(Se),ce=null,i.hide(),Ce=h((function(){Pe()}),500)};be.call(i);be.call(l);var d=be.selectAll(".link"),p=be.selectAll(".node"),g=d3.forceCollide((function(e){return e.size+5})).strength(.5),m=d3.forceManyBody().strength(-300),y=d3.forceCenter(de/2,pe/2);we.nodes(he.nodes).force("charge",m).force("collide",g).force("center",y).force("link",d3.forceLink(he.links).distance((function(e){return e.source.isTriple||e.target.isTriple?0:function(e){var t=$("<span></span>"),r=e.predicates[0].split("/"),n=r[r.length-1];t.addClass("predicate-text").text(n),$("body").append(t);var a=t.width()+2*e.source.size+2*e.target.size+50;return t.remove(),.75*a}(e)+30*e.connectedness}))),ee.append("defs").selectAll("marker").data(he.links).enter().append("marker").attr("class","arrow-marker").attr("id",(function(e){return X(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"),d=ee.selectAll(".link").data(he.links).enter().append("g").attr("class","link-wrapper").attr("id",(function(e){return Object(o.removeSpecialChars)(W(e))})).append("line").attr("class","link").style("stroke-width",1).style("fill","transparent").style("marker-end",(function(e){var t=X(e);return"url(#".concat(t,")")}));var v,x=ee.selectAll(".link-wrapper").append("text").text((function(e){return Ge(e)})).attr("class",(function(e){return e.predicates.length>1||he.tripleNodes.has(W(e))?"predicates":"predicate"})).attr("dy","-0.5em").style("text-anchor","middle").style("display",U().showLinksText?"":"none").on("mouseover",(function(e,t){e.stopPropagation(),function(e,t){h.cancel(void 0);var n=r=e.target;h((function(){r===n&&t.predicates.length>1&&l.show(t,r)}),300)}(e,t)})).on("mouseout",(function(){h.cancel(void 0),r=null,l.hide()})).on("click",(function(t,r){t.stopPropagation(),function(t,r){je();var n=W(r);if(1===r.predicates.length&&he.tripleNodes.has(n)){le=null;var a=he.tripleNodes.get(n)[0];if(Le(a,this,t.button)){var i={};i.iri=a.iri,i.pred=Ue(a.iri.split(" ")[1]),De(i)}return}!function(t){if(e.showNodeInfo=!1,e.showPredicates=t.predicates.length>1,e.showFilter=!1,e.showInfoPanel=!1,le===t)return e.showNodeInfo=!1,e.showInfoPanel=!1,void(le=null);le=t,e.showPredicates&&(e.predicates=_.map(t.predicates,(function(e){var r=function(e,t){var r=W(t);return he.tripleNodes.has(r)?he.tripleNodes.get(r).findIndex((function(t){return t.iri.indexOf(e)>=0})):-1}(e,t),n=r>-1;return{value:Ue(e),partOfTriple:n,linkId:n?W(t):"",nodeIndex:r}})),e.showInfoPanel=!0)}(r)}(t,r)})),w=0,b=null,S=null,C=function(t,r,n){var a=n||this.parentNode;Array.isArray(n)&&(a=n[r]),he.countLinks(t,he.links)<=U().linksLimit?Ne(t,!1,a):f.info(L.instant("graphexplore.increase.limit"),L.instant("graphexplore.node.at.max")),e.closeInfoPanel()};function I(e,t){var r,n,a,i,o=!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,o=!1}var s=ee.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=s),o&&(s=s.transition().duration(1e3).style("font-size",(function(){return n+"px"})).attr("opacity",i),"down-fixed"!==t&&s.remove())}var R=d3.drag().subject((function(e){return e})).on("start",(function(e,t){if(A.isActive())return;0===e.sourceEvent.button&&(t.fixedBeforeDrag=t.fixed,t.isBeingDragged=!0,t.beginDragging=!0,Pe(),d3.select(this).classed("dragging",!0),we.alphaTarget(.3).restart())})).on("drag",(function(t,r){r.isBeingDragged&&(r.fx=t.x,r.fy=t.y,r.fixed?r.beginDragging&&I(r,"fixed"):(e.numberOfPinnedNodes++,r.fixed=!0,I(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));we.alphaTarget(0)}));p=ee.selectAll(".node").data(he.nodes).enter().append("g").attr("class","node-wrapper").attr("id",(function(e){return e.iri})).append("circle").attr("class","node").attr("r",(function(e){return e.size})).style("fill",(function(t){return"greyColor"===t.types?"c2c2c2":e.getColor(t.types[0])})).on("mouseover",(function(t,r){var n=this;r.isBeingDragged||(h.cancel(Ce),Se=h((function(){(function(t,r){if(e.showInfoPanel)return!1;(Ee.closeIcon||Ee.expandIcon||Ee.focusIcon||Ee.copyURIIcon)&&Ee.removeIcons();if(we.alpha()<.1)return Ee.initIcons(t,r.parentNode),we.stop(),ke(),!0;return!1})(r,n)&&function(e,t){h.cancel(void 0);var r=ce=t.target;h((function(){ce===r&&i.show(e,ce)}),300)}(r,t)}),400))})).on("mouseout",u).on("click",(function(t,r){if(!t.button||0===t.button){var n=this;if(b&&S===n)return h.cancel(b),b=null,void C(r,0,n.parentNode);S=n,u(),e.showPredicates=!1,A.isActive()||(h.cancel(b),b=h((function(){Le(r,n,t),b=null}),540))}})).on("touchstart",(function(e,t){return function(e){w=0,v=h((function(){w<5&&_e(e),v=null}),1e3)}(t)})).on("touchmove",(function(){w++})).on("touchend",(function(){h.cancel(v),v=null})).on("contextmenu",(function(t,r){t.shiftKey||(t.preventDefault(),Pe(),e.closeInfoPanel(),r.fixed?(e.numberOfPinnedNodes--,r.fixed=!1,r.fx=null,r.fy=null,I(r,"up"),we.alpha(1).restart()):(e.numberOfPinnedNodes++,r.fixed=!0,I(r,"down")),function(e){ce&&i.show(e,ce)}(r))})).on("gdb-expand-node",(function(e,t){return C(t,0,e.srcElement.parentNode)})).on("gdb-show-node-info",(function(e,t){return Oe(t)})).call(R);var k=ee.selectAll(".node-wrapper").append("foreignObject").style("pointer-events","none").attr("width",(function(e){return 2*e.size*1.75}));ee.insert("g").attr("class","menu-events"),function(e){e.each((function(e){e.fontSize=n.a.Text.calcFontSizeRaw(e.labels[0].label,e.size,ie,!0)})).attr("height",(function(e){return 3*e.fontSize})).append("xhtml:div").attr("class","node-label-body").style("font-size",(function(e){return e.fontSize+"px"})).append("xhtml:div").html((function(e){return c.HtmlUtil.getText(e.labels[0].label).replaceAll("\n","<br>")}))}(k),we.on("tick",(function(){d.attr("x1",(function(e){return V(e.source)})).attr("y1",(function(e){return Y(e.source)})).attr("x2",(function(e){return V(e.target)})).attr("y2",(function(e){return Y(e.target)})),x.attr("x",(function(e){var t=V(e.source),r=V(e.target);return e.x=.5*(t+r)})).attr("y",(function(e){var t=Y(e.source),r=Y(e.target);return e.y=.5*(t+r)})).attr("transform",(function(e){return"rotate("+function(e,t){var r={x:V(e.source),y:Y(e.source)},n={x:V(e.target),y:Y(e.target)};if(t)return 180*Math.atan2(n.y-r.y,n.x-r.x)/Math.PI;var a=180*Math.atan2(n.y-r.y,n.x-r.x)/Math.PI;return a<=90&&a>=-90?a:(a>0?-1:1)*(180-Math.abs(a))}(e,e.direction)+", "+e.x+", "+e.y+")"})),p.attr("cx",(function(e){return e.x})).attr("cy",(function(e){return e.y})),ee.select(".node-loader").attr("x",(function(e){return e.x-e.size+3})).attr("y",(function(e){return e.y-e.size})),ee.select(".loader-container").attr("cx",(function(e){return e.x})).attr("cy",(function(e){return e.y})),k.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})),ke()})),angular.isDefined(Ie)&&Ie.setLoadingState(!1),e.loading&&(e.loading=!1),d3.selectAll(".link-wrapper").each((function(){var e=$(this).attr("id").split(">")[0],t=$(this).attr("id").split(">")[1];d3.selectAll(".link").each((function(r){var n=Object(o.removeSpecialChars)(r.source.iri),a=Object(o.removeSpecialChars)(r.target.iri);if(n===t&&a===e){var i=n;i+=">",i+=a;var s=document.createTextNode(" ⟶");document.getElementById(i).lastChild.appendChild(s),r.direction="double"}}))})),d3.selectAll(".d3-actions-tip").remove(),we.alpha(.3).restart()}function ke(){t.d3alpha=we.alpha()}var Ee=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){var o=Object(a.a)().attr("class","d3-tip d3-actions-tip").customPosition((function(e,t){var r=t.target.getBoundingClientRect();return{top:r.top-20+"px",left:r.right+10+"px"}})).html((function(e){return e}));be.call(o);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,he.removeNodeLeafLinks(e),Re()})).on("mouseover",(function(e){o.show(this.getAttribute("name"),e),h.cancel(Se),h.cancel(Ce)})).on("mouseout",(function(){o.hide(),Ce=h((function(){Pe()}),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(){Ne(n,!1,i)})).on("mouseover",(function(e){o.show(this.getAttribute("name"),e),h.cancel(Ce),h.cancel(Se)})).on("mouseout",(function(){o.hide(),Ce=h((function(){Pe()}),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){o.show(this.getAttribute("name"),e),h.cancel(Ce),h.cancel(Se)})).on("mouseout",(function(){o.hide(),Ce=h((function(){Pe()}),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),Pe(),o.hide()})).on("mouseover",(function(e){o.show("<div style='text-align: center;'><b>Copy to ClipBoard</b><br>"+n.iri+"</div>",e),h.cancel(Ce),h.cancel(Se)})).on("mouseout",(function(){o.hide(),Ce=h((function(){Pe()}),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(){_e(n)})).on("mouseover",(function(e){o.show(this.getAttribute("name"),e),h.cancel(Ce),h.cancel(Se)})).on("mouseout",(function(){o.hide(),Ce=h((function(){Pe()}),500)})),this.animateMenu(n)},this.animateMenu=function(e){var t=d3.easeSin,n=0,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 r(a+=30,e)})).delay(n+=35),this.focusIcon.transition().duration(100).style("opacity",1).ease(t).attr("transform",(function(){return r(a+=30,e)})).delay(n+=35),this.closeIcon.transition().duration(100).style("opacity",1).ease(t).attr("transform",(function(){return r(a+=30,e)})).delay(n+=35),this.expandedState=!0}};function Le(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?(_e(r),!1):void 0!==e.openedNodeInfoPanel&&e.openedNodeInfoPanel===r?(e.pageslideExpanded=!1,e.openedNodeInfoPanel=void 0,!1):(Oe(r),!0)}function _e(e){he.removeNode(e),Re()}function Ae(t){!function(t){e.nodeSelected=!0,null===t.data.types&&(t.data.types="greyColor"),he=new fe,ue=se}(t),Te(t)}function Te(t,r,n){var a=t.data;a=_.filter(a,(function(e){return-1===_.findIndex(he.links,(function(t){return e.source===t.source.iri&&e.target===t.target.iri}))}));for(var i=[],o=he.tripleLinksCopy.values(),s=0;s<he.tripleLinksCopy.size;s++){o.next().value.forEach((function(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}));for(var c,l,u,d=(c="iri",l=_.union(_.flatten(_.map(t.data,(function(e){return[{iri:e.source,isTriple:e.isTripleSource},{iri:e.target,isTriple:e.isTripleTarget}]})))),u=l.map((function(e){return e[c]})),l.filter((function(e,t){return u.indexOf(e[c])===t}))),p=_.map(he.nodes,(function(e){return{iri:e.iri,isTriple:Boolean(e.isTriple)}})),h=he.tripleNodes.values(),g=0;g<he.tripleNodes.size;g++){h.next().value.forEach((function(e){p.push({iri:e.iri,isTriple:e.isTriple})}))}var y=_.reject(d,(function(e){return _.some(p,e)}));if(0===y.length)(n||0===a.length)&&f.info(L.instant("graphexplore.error.node.connections")),he.addAndMatchLinks(a),Re();else{var v=[],x=[],w=U();_.forEach(y,(function(t,r){v.push(E.getInstanceNode({iri:t.isTriple?K(t.iri):t.iri,config:e.configLoaded.id,languages:e.shouldShowSettings()?w.languages:[],includeInferred:w.includeInferred,sameAsState:w.sameAsState}).then((function(e){x[r]=e.data})))})),m.all(v).then((function(){_.forEach(x,(function(e,t){var n=2*Math.PI*t/x.length,a=(r?r.x:0)+Math.cos(n)*pe/3,i=(r?r.y:0)+Math.sin(n)*pe/3;e.isTriple?he.addTriple(e,a,i):he.addNode(e,a,i)})),he.addAndMatchLinks(a),r&&(r.isExpanded=!0),Re()}))}}function Ne(t,r,n){if(!Ie.getLoadingState()){Ie.init(t,n);var a=U(),i=t.iri;E.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){Te(e,t,r)}),(function(t){var r=getError(t.data);f.error(r,L.instant("graphexplore.error.exploring.node")),e.loading=!1,Ie.setLoadingState(!1)}))}}function Pe(){angular.isDefined(Ee)&&Ee.expandedState&&Ee.removeIcons()}function Oe(t){we.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(K(t.iri)):encodeURIComponent(t.iri),e.showInfoPanel=!0,e.rdfsLabel=t.labels[0].label,e.rdfsComment=t.comment,e.expanded=!1,e.propertiesQueryObj.query="",e.dataNodeKeysQuery="";var r=U();E.getProperties({iri:t.isTriple?K(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;var 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){f.warning(getError(e.data),"Error")}))}function De(e){Me("predicate","var(--primary-color-dark)",e),Me("predicates","var(--primary-color-dark)",e);var t=document.getElementsByClassName("link");t&&_.each(t,(function(t){var 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)}));var r=document.getElementsByClassName("arrow-marker");r&&_.each(r,(function(t){var 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 Me(e,t,r){var n=document.getElementsByClassName(e);n&&_.each(n,(function(e){var n=e.__data__;r?((n.source.iri.indexOf(r.iri)>=0||n.target.iri.indexOf(r.iri)>=0)&&(e.style.fill=t),B(r.iri)===W(n)&&(e.textContent=r.pred,e.style.fill=t),r.oppLinkIRI&&r.oppLinkIRI===W(n)&&(e.textContent=r.oppTriplePred,e.style.fill=t)):(e.style.fill=t,e.textContent=Ge(n))}))}function je(){_.each(e.predicates,(function(e){var t=document.getElementById(e.linkId+e.nodeIndex);t&&(t.style.fontWeight="normal")}));var t=document.getElementsByClassName("link");t&&_.each(t,(function(e){e.style.stroke="#999",e.style.strokeWidth=1})),Me("predicate",""),Me("predicates","");var r=document.getElementsByClassName("arrow-marker");r&&_.each(r,(function(e){e.style.stroke="#999",e.__data__.target.isTriple||e.setAttribute("refX","59")}))}function $e(e){var t=B(e);if(he.tripleNodes.has(t))return he.tripleNodes.get(t).find((function(t){return t.iri===e}))}function Ge(e){return e.predicates.length>1?e.predicates.length+" predicates":Ue(e.predicates[0])}function Ue(t){var 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=[],le=null,h((function(){e.showInfoPanel=!1}))},e.clickLink=function(t){if(he.tripleNodes.has(t.linkId)){je();var r=he.tripleNodes.get(t.linkId)[t.nodeIndex];Oe(r),e.showPredicates=!0;var n=document.getElementById(t.linkId+t.nodeIndex);n&&(n.style.fontWeight="bold");for(var a={},i=he.tripleLinksCopy.values(),o=function(){var e=i.next().value;e.length>1&&e.every((function(t){return t.source.iri===r.iri?(a.iri=e[0].source.iri,t.target.isTriple&&(a.oppLinkIRI=B(t.target.iri),a.oppTriplePred=Ue(t.target.iri.split(" ")[1])),a.pred=Ue(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=B(t.source.iri),a.oppTriplePred=Ue(t.source.iri.split(" ")[1])),a.pred=Ue(r.iri.split(" ")[1]),1===t.predicates.length&&(a.linkPred=t.predicates[0]),!1)}))},s=0;s<he.tripleLinksCopy.size;s++)o();a.iri||(a.iri=r.iri,a.pred=Ue(r.iri.split(" ")[1])),De(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){Pe();var t=10*(e?1:-1)*Math.PI/180,r=Math.cos(t),n=Math.sin(t),a=de/2,i=pe/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)})),we.alpha(1).restart()},e.openUri=function(t,r){if(!r){var n={};e.configLoaded.id!==e.defaultGraphConfig.id&&(n.config=e.configLoaded.id),n.uri=t,j(n,{uri:t,config:e.configLoaded})}e.$broadcast("onRootNodeChange",t)},e.saveOrUpdateGraph=function(){var t=JSON.stringify(he.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})};var Qe=function(t){R.editSavedGraph(t).success((function(){e.lastSavedGraphName=t.name,e.shared=t.shared,e.refreshSavedGraphs(),f.success(L.instant("graphexplore.saved.graph.was.edited",{name:t.name}))})).error((function(e){var t=getError(e);f.error(t,L.instant("graphexplore.error.cannot.edit"))}))};e.saveGraphModal=function(t,r,n){var a=b.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}}}});D++,O=!0,a.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),R.addNewSavedGraph(t).success((function(r,n,a){e.lastSavedGraphName=t.name,e.lastSavedGraphId=a()["x-saved-graph-id"],e.shared=t.shared,e.refreshSavedGraphs(),f.success(L.instant("graphexplore.saved.graph",{name:t.name}))})).error((function(r,n){if(422===n)e.saveGraphModal("new",t,!0);else{var a=getError(r);f.error(a,L.instant("graphexplore.error.cannot.create.graph"))}}))}(t.graph);break;case"update":case"rename":Qe(t.graph)}})).finally((function(){--D<=0&&(O=!1,D=0)}))},e.refreshSavedGraphs=function(){R.getSavedGraphs().success((function(t){e.savedGraphs=t})).error((function(e){var t=getError(e);f.error(t,L.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),y.url("?saved="+t.id),he.restoreState(JSON.parse(t.data)),r||j({saved:t.id},{savedGraph:t})},e.copyToClipboardSavedGraph=function(t){var r=[location.protocol,"//",location.host,location.pathname,"?saved=",t.id].join("");e.copyToClipboard(r)},e.deleteSavedGraph=function(t){w.openSimpleModal({title:L.instant("common.confirm"),message:L.instant("graphexplore.confirm.delete.graph",{graphName:t.name}),warning:!0}).result.then((function(){!function(t){R.deleteSavedGraph(t).success((function(){e.refreshSavedGraphs(),f.success(L.instant("graphexplore.saved.graph.was.deleted",{name:t.name}))})).error((function(e){var t=getError(e);f.error(t,L.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(){Pe();var 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)})),we.alpha(1).restart()},$("body").on("keydown",(function(t){!A.isActive()&&"input"!==t.target.nodeName&&e.nodeSelected&&(37===t.keyCode?e.rotate(!0):39===t.keyCode&&e.rotate(!1))})),e.getLiteralFromPropValue=function(e){return e.substring(e.indexOf(":")+1)}}function h(e,t,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&&(e.graph.name=a(e.graph.name),t.close({graph:e.graph,mode:e.mode}))},e.saveNew=function(){e.graph.name=a(e.graph.name)+" (new)",t.close({graph:e.graph,mode:"new",restart:!0})},e.cancel=function(){t.dismiss("cancel")};var a=function(e){return e.replace(/\s+/g," ").trim()}}angular.module("graphdb.framework.graphexplore.controllers.graphviz",["ui.scroll.jqlite","ui.scroll","toastr","ui.bootstrap","ngTagsInput","graphdb.framework.utils.localstorageadapter","graphdb.core.services.workbench-context","graphdb.framework.core.services.rdf4j.repositories"]).controller("GraphsVisualizationsCtrl",f).controller("SaveGraphModalCtrl",h).config(["$uibTooltipProvider",function(e){e.options({appendToBody:!0})}]),f.$inject=["$scope","$rootScope","$repositories","$licenseService","toastr","$timeout","ClassInstanceDetailsService","$q","$location","$jwtAuth","UiScrollService","ModalService","$uibModal","$window","LocalStorageAdapter","LSKeys","SavedGraphsRestService","GraphConfigRestService","GraphDataRestService","$translate","GuidesService","WorkbenchContextService","RDF4JRepositoriesService"],h.$inject=["$scope","$uibModalInstance","data","$translate"]},303:function(e,t,r){"use strict";r.r(t);r(118),r(15),r(29);var n=r(115),a=r(104),i=r(27),o=r(138),s=r(159),c=r(11);function l(e){return(l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function u(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */u=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,a=Object.defineProperty||function(e,t,r){e[t]=r.value},i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function d(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{d({},"")}catch(e){d=function(e,t,r){return e[t]=r}}function p(e,t,r,n){var i=t&&t.prototype instanceof v?t:v,o=Object.create(i.prototype),s=new T(n||[]);return a(o,"_invoke",{value:E(e,r,s)}),o}function f(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=p;var h="suspendedStart",g="executing",m="completed",y={};function v(){}function x(){}function w(){}var b={};d(b,o,(function(){return this}));var S=Object.getPrototypeOf,C=S&&S(S(N([])));C&&C!==r&&n.call(C,o)&&(b=C);var I=w.prototype=v.prototype=Object.create(b);function R(e){["next","throw","return"].forEach((function(t){d(e,t,(function(e){return this._invoke(t,e)}))}))}function k(e,t){function r(a,i,o,s){var c=f(e[a],e,i);if("throw"!==c.type){var u=c.arg,d=u.value;return d&&"object"==l(d)&&n.call(d,"__await")?t.resolve(d.__await).then((function(e){r("next",e,o,s)}),(function(e){r("throw",e,o,s)})):t.resolve(d).then((function(e){u.value=e,o(u)}),(function(e){return r("throw",e,o,s)}))}s(c.arg)}var i;a(this,"_invoke",{value:function(e,n){function a(){return new t((function(t,a){r(e,n,t,a)}))}return i=i?i.then(a,a):a()}})}function E(t,r,n){var a=h;return function(i,o){if(a===g)throw Error("Generator is already running");if(a===m){if("throw"===i)throw o;return{value:e,done:!0}}for(n.method=i,n.arg=o;;){var s=n.delegate;if(s){var c=L(s,n);if(c){if(c===y)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(a===h)throw a=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);a=g;var l=f(t,r,n);if("normal"===l.type){if(a=n.done?m:"suspendedYield",l.arg===y)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(a=m,n.method="throw",n.arg=l.arg)}}}function L(t,r){var n=r.method,a=t.iterator[n];if(a===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,L(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var i=f(a,t.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,y;var o=i.arg;return o?o.done?(r[t.resultName]=o.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,y):o:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}function _(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function A(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function T(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(_,this),this.reset(!0)}function N(t){if(t||""===t){var r=t[o];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var a=-1,i=function r(){for(;++a<t.length;)if(n.call(t,a))return r.value=t[a],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}throw new TypeError(l(t)+" is not iterable")}return x.prototype=w,a(I,"constructor",{value:w,configurable:!0}),a(w,"constructor",{value:x,configurable:!0}),x.displayName=d(w,c,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===x||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,w):(e.__proto__=w,d(e,c,"GeneratorFunction")),e.prototype=Object.create(I),e},t.awrap=function(e){return{__await:e}},R(k.prototype),d(k.prototype,s,(function(){return this})),t.AsyncIterator=k,t.async=function(e,r,n,a,i){void 0===i&&(i=Promise);var o=new k(p(e,r,n,a),i);return t.isGeneratorFunction(r)?o:o.next().then((function(e){return e.done?e.value:o.next()}))},R(I),d(I,c,"Generator"),d(I,o,(function(){return this})),d(I,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=N,T.prototype={constructor:T,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(A),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function a(n,a){return s.type="throw",s.arg=t,r.next=n,a&&(r.method="next",r.arg=e),!!a}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],s=o.completion;if("root"===o.tryLoc)return a("end");if(o.tryLoc<=this.prev){var c=n.call(o,"catchLoc"),l=n.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return a(o.catchLoc,!0);if(this.prev<o.finallyLoc)return a(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return a(o.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return a(o.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var a=this.tryEntries[r];if(a.tryLoc<=this.prev&&n.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var i=a;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var o=i?i.completion:{};return o.type=e,o.arg=t,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(o)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),y},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),A(r),y}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;A(r)}return a}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:N(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),y}},t}function d(e,t,r,n,a,i,o){try{var s=e[i](o),c=s.value}catch(e){return void r(e)}s.done?t(c):Promise.resolve(c).then(n,a)}function p(e){return function(){var t=this,r=arguments;return new Promise((function(n,a){var i=e.apply(t,r);function o(e){d(i,n,a,o,s,"next",e)}function s(e){d(i,n,a,o,s,"throw",e)}o(void 0)}))}}function f(e,t,r,l,d,f,h,g,m,y,v,x,w,b,S,C,I){var R;t.newConfig=new o.GraphsConfig,t.revertConfig=void 0,t.page=1,t.totalPages=5,t.helpHidden=1===x.get(w.HIDE_GRAPH_CONFIG_HELP),t.isUpdate=!1,t.shared=!1,t.canEditActiveRepo=t.canWriteActiveRepo(),t.samples=[],t.tabConfig={inference:t.newConfig.startQueryIncludeInferred,sameAs:t.newConfig.startQuerySameAs},t.isAutocompleteEnabled=void 0,t.repositoryNamespaces=void 0,t.tabsViewModel=[];var k=y.configName,E=f.getActiveRepository();t.toggleHelp=function(e){void 0===e&&(e=x.get(w.HIDE_GRAPH_CONFIG_HELP)),1!==e?(x.set(w.HIDE_GRAPH_CONFIG_HELP,1),t.helpHidden=!0):(x.set(w.HIDE_GRAPH_CONFIG_HELP,0),t.helpHidden=!1)},t.fixedVisualCallback=function(e,r){t.newConfig.startIRI=e,t.newConfig.startIRILabel=r,R=!0},t.isDefaultGraph=function(e){return e.isDefaultGraph()},t.isUserGraph=function(e){return!e.isDefaultGraph()},t.getSampleName=function(e,t){if(!e)return"";var r=e.getPropertyDescription(t);return r||(e.id?"Copy of "+e.name:e.name)},t.createGraphConfig=function(e){m.createGraphConfig(e).success(p(u().mark((function e(){return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,v.showToastMessageWithDelay("graphexplore.saved.new.config");case 2:l.url("graphs-visualizations");case 3:case"end":return e.stop()}}),e)})))).error((function(e){d.error(getError(e),b.instant("graphexplore.error.could.not.create"))}))},t.updateGraphConfig=function(e){m.updateGraphConfig(e).success(p(u().mark((function e(){return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,v.showToastMessageWithDelay("graphexplore.saved.config");case 2:l.url("graphs-visualizations");case 3:case"end":return e.stop()}}),e)})))).error((function(e){d.error(getError(e),b.instant("graphexplore.error.could.not.save"))}))},t.goToPage=function(e){t.page!==e&&D((function(){t.showEditor(),t.page=e}))},t.goToPreviousPage=function(){t.page>1&&t.goToPage(t.page-1),U()&&(R=!1)},t.goToNextPage=function(){G(),t.newConfig.isStartMode(o.StartMode.NODE)&&!R||t.goToPage(t.page+1)},t.saveGraphConfig=function(){G(),U()&&!R||(t.newConfig.startQueryIncludeInferred=t.tabConfig.inference,t.newConfig.startQuerySameAs=t.tabConfig.sameAs,t.newConfig.name&&(t.newConfig.name=t.newConfig.name.replace(/\s+/g," ").trim()),D((function(){t.newConfig.name?(t.queryEditorIsDirty=!1,t.isUpdate?t.updateGraphConfig(t.newConfig.toSavePayload()):t.createGraphConfig(t.newConfig.toSavePayload())):j(b.instant("graphexplore.provide.config.name"))})))},t.setQuery=function(){var e=p(u().mark((function e(r){var n;return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=r||" ",e.next=3,L();case 3:e.sent.setQuery(n),t.markDirty();case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),t.markDirty=p(u().mark((function e(){var r,n;return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t.revertConfig){e.next=6;break}return r=t.revertConfig.getQueryType(t.page),e.next=4,N();case 4:n=e.sent,t.queryEditorIsDirty=r!==n;case 6:case"end":return e.stop()}}),e)}))),t.showEditor=function(){t.viewMode="yasr",P(),T()},t.showPreview=function(){t.viewMode="editor",_()},t.revertEditor=function(){t.setQuery(t.revertConfig.getQueryType(t.page)),t.queryEditorIsDirty=!1};var L=function(){return i.YasguiComponentDirectiveUtil.getOntotextYasguiElementAsync("#query-editor")},_=function(){var e=p(u().mark((function e(r,n){var a,i;return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,L();case 2:return a=e.sent,e.next=5,a.getQueryType();case 5:if(i=e.sent,!n||"SELECT"===i||"CONSTRUCT"===i||"DESCRIBE"===i){e.next=9;break}return d.warning(b.instant("query.editor.warning.msg")),e.abrupt("return");case 9:return e.next=11,a.getQueryMode();case 11:if("update"!==e.sent){e.next=15;break}return d.warning(b.instant("cannot.execute.update.error")),e.abrupt("return");case 15:t.queryIsRunning||(t.viewMode="editor",A());case 16:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}(),A=function(){var e=p(u().mark((function e(){return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,L();case 2:e.sent.query(a.RenderingMode.YASR);case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),T=function(){var e=p(u().mark((function e(){var t;return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,L();case 2:return t=e.sent,e.abrupt("return",t.changeRenderMode(a.RenderingMode.YASQE));case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),N=function(){var e=p(u().mark((function e(){var t;return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,L();case 2:return t=e.sent,e.abrupt("return",t.getQuery());case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),P=function(){var e=p(u().mark((function e(){var t;return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,L();case 2:return t=e.sent,e.abrupt("return",t.abortQuery());case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),O=function(){var e=p(u().mark((function e(){var r,n;return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,L();case 2:return r=e.sent,e.next=5,r.getQuery();case 5:return n=(n=e.sent).trim(),e.abrupt("return",t.newConfig.updateModel(n,t.page));case 8:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),D=function(){var e=p(u().mark((function e(r){var n;return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,O();case 2:n=e.sent,1===t.page?n.isStartMode(o.StartMode.NODE)&&!n.startIRI?j(b.instant("graphexplore.select.start.node")):n.isStartMode(o.StartMode.QUERY)&&!n.startGraphQuery?j(b.instant("graphexplore.provide.query")):n.isStartMode(o.StartMode.QUERY)?$(r,n.startGraphQuery,"graph"):r():2===t.page?$(r,n.expandQuery,"construct",["node"]):3===t.page?$(r,n.resourceQuery,"tuple",["node"],[],["type","label","comment","rank"]):4===t.page?$(r,n.predicateLabelQuery,"tuple",["edge"],["label"]):5===t.page&&$(r,n.resourcePropertiesQuery,"tuple",["node"],["property","value"]);case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),M=function(){t.tabConfig.inference=t.newConfig.startQueryIncludeInferred,t.tabConfig.sameAs=t.newConfig.startQuerySameAs,t.setQuery(t.newConfig.getQueryType(t.page))},j=function(e){d.warning(e)},$=function(e,t,r,n,a,i){t?m.validateQuery(t,r,n,a,i).success((function(){e()})).error((function(e){j(getError(e))})):e()},G=function(){U()&&t.$broadcast("addStartFixedNodeAutomatically",{startIRI:t.newConfig.startIRI})},U=function(){return 1===t.page&&t.newConfig.isStartMode(o.StartMode.NODE)},Q=function(){m.getGraphConfigSamples().success((function(e){t.samples=Object(s.mapGraphConfigSamplesToGraphConfigs)(e).filter((function(e){return!e.id||t.newConfig.id!==e.id||(t.revertConfig=e,!1)}))})).error((function(e){d.error(getError(e),b.instant("graphexplore.error.graph.configs"))}))},F={endpoint:function(){return"repositories/".concat(f.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,showYasqeResizer:!1,yasqeMode:n.YasqeMode.READ,infer:t.newConfig.startQueryIncludeInferred,sameAs:t.newConfig.startQuerySameAs},H=function(e,r,n){t.queryIsRunning=e},z=function(){window.removeEventListener("beforeunload",q),W.forEach((function(e){return e()}))},q=function(e){t.queryEditorIsDirty&&(e.returnValue=!0)},B=function(){t.tabsViewModel=[{page:1,label:b.instant("starting.point.label"),type:"startGraphQuery"},{page:2,label:b.instant("graph.expansion"),type:"expandQuery"},{page:3,label:b.instant("node.basics"),type:"resourceQuery"},{page:4,label:b.instant("edge.basics"),type:"predicateLabelQuery"},{page:5,label:b.instant("node.extra"),type:"resourcePropertiesQuery"}]},W=[];W.push(C.onSelectedRepositoryIdUpdated((function(e){e?I.getNamespaces(e).then((function(e){t.repositoryNamespaces=e})).catch((function(e){var t=getError(e);d.error(t,b.instant("error.getting.namespaces.for.repo"))})):t.repositoryNamespaces=new c.NamespacesListModel}))),W.push(C.onAutocompleteEnabledUpdated((function(e){t.isAutocompleteEnabled=e}))),W.push(t.$on("$locationChangeStart",(function(e,r){if(t.queryEditorIsDirty){e.preventDefault();!function(e,t,r,n){S.openSimpleModal({title:e,message:t,warning:!0}).result.then((function(){angular.isFunction(r)&&r()}),(function(){angular.isFunction(n)&&n()}))}(b.instant("common.confirm"),b.instant("visual.config.warning.unsaved.changes"),(function(){z();var e=l.absUrl().length-l.url().length,t=r.substring(e);l.path(t)}))}else z()}))),W.push(t.$on("$destroy",z)),W.push(t.$watch(t.getActiveRepositoryObject,(function(){(t.newConfig.isStartMode(o.StartMode.QUERY)||t.page>1)&&(t.viewMode="yasr",P().then(T))}))),W.push(e.$on("$translateChangeSuccess",(function(){B()}))),window.addEventListener("beforeunload",q),t.$watch("newConfig.startMode",(function(e){e===o.StartMode.QUERY&&M()})),t.$watch("page",(function(e){(t.newConfig.isStartMode(o.StartMode.QUERY)||e>1)&&(t.showEditor(),M())})),B(),f.getPrefixes(E).then((function(e){return function(e){var r=t.$watch((function(){return t.getActiveRepositoryObject()}),(function(a){if(a){t.canEditActiveRepo=t.canWriteActiveRepo();var i=angular.extend({},F,{prefixes:e,yasqeMode:t.canWriteActiveRepo()?n.YasqeMode.WRITE:n.YasqeMode.READ});t.yasguiConfig=i,r()}}))}(e)})).finally((function(){return H(!1)})),k?(t.isUpdate=!0,m.getConfig(k).then((function(e){t.newConfig=e,Q()})).catch((function(e){d.error(getError(e),b.instant("created.connector",{name:k}))}))):(t.isUpdate=!1,Q()),t.getActiveRepository()&&(H(!0,b.instant("common.refreshing.namespaces"),b.instant("common.extra.message")),f.getPrefixes(f.getActiveRepository()).then((function(e){t.namespaces=e})).catch((function(e){t.repositoryError=getError(e)})).finally((function(){H(!1)})))}angular.module("graphdb.framework.graphexplore.controllers.graphviz.config",["graphdb.framework.utils.notifications","graphdb.framework.utils.localstorageadapter","graphdb.core.services.workbench-context","graphdb.framework.core.services.rdf4j.repositories"]).controller("GraphConfigCtrl",f),f.$inject=["$rootScope","$scope","$timeout","$location","toastr","$repositories","SparqlRestService","$filter","GraphConfigRestService","$routeParams","Notifications","LocalStorageAdapter","LSKeys","$translate","ModalService","WorkbenchContextService","RDF4JRepositoriesService"]},304:function(e,t,r){"use strict";r.r(t);var n=r(658),a=r(684),i=r(647),o=r(648);r(15);function s(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return c(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?c(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,a=function(){};return{s:a,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,i=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw i}}}}function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function l(e,t,r,c,l,u,d,p,f,h,g,m,y){return{restrict:"AE",template:'<div id="classChart"></div>',scope:{classHierarchyData:"=",flattenedClassNames:"=",selectedClass:"=",currentSliderValue:"=",showClassInfoPanel:"=",showExternalElements:"=",hidePrefixes:"=",currentBrowserLimit:"="},link:function(d,v,x){!function(d,v){var x,w,b=!1,S=d3.pack().size([780,780]),C=d3.scaleLinear().domain([0,4]).range(["hsl(19, 70%, 90%)","hsl(19, 70%, 50%)"]).interpolate(d3.interpolateHcl),I=d3.select("#classChart").insert("svg:svg","h2").attr("viewBox","0 0 800 800").attr("preserveAspectRatio","xMidYMid meet").on("dblclick.zoom",null);function R(){return I.append("svg:g").attrs({id:"main-group",transform:"translate(400,400)"})}function k(){return"true"===g.get(m.CLASS_HIERARCHY_HIDE_PREFIXES)}function E(){var e=o.a.Export.getCSSRules("css/rdf-class-hierarchy-labels.css?v=3.0.2");d3.selectAll("#main-group").append("defs"),$("defs").append('<style type="text/css"><![CDATA['+e+"]]></style>"),d3.selectAll("g").style("opacity",1);var t=o.a.Export.generateBase64ImageSource("#classChart svg");d3.select(this).attrs({href:t,download:"class-hierarchy-"+u.getActiveRepository()+".svg"})}d.hidePrefixes=k();var L,A,T=R();if(!d.classHierarchyData.classCount&&u.getActiveRepository()&&!u.isSystemRepository()){e.loader=!0,e.hierarchyError=!1;var N=g.get("classHierarchy-selectedGraph-".concat(u.getActiveRepository()));r.getClassHierarchyData(null!==N?N.contextID.uri:"").success((function(t,r,n){e.loader=!1,207===r&&p.warning(y.instant("graphexplore.update.diagram"),y.instant("graphexplore.repository.data.changed")),d.classHierarchyData=t,d3.select("#download-svg").on("mouseover",E)})).error((function(t){e.loader=!1,e.hierarchyError=getError(t),p.error(y.instant("graphexplore.error.request.failed",{name:h,error:getError(t)}))}))}var P,O,D,M,j,G,U,Q={};function F(r,o,s,u){O&&O(),D&&D(),d3.selectAll("#main-group").remove(),T=R(),a.a.SingleChild.addPlaceholders(r,!0),(w=d3.hierarchy(r)).sum((function(e){return e.size})),P=s||w,S(w);var p,g=w.descendants();P.isInFocusTransitive=!0,a.a.SingleChild.removePlaceholders(g),a.a.SingleChild.centerNodes(g),a.a.SingleChild.makePositionsRelativeToZero(g),x||(x=Object(n.a)().attr("class","d3-tip").customPosition((function(e,t){return{top:"inherit",bottom:c.innerHeight-t.clientY+"px",right:c.innerWidth-t.clientX+"px"}})).html((function(e){return e.data.name})),I.call(x));var m=T.selectAll("circle").data(g).enter().append("g");o.doFade&&m.each((function(e){i.a.Transition.fadeIn(d3.select(this),550)}));var y,v=[],k=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;v.push({name:t}),Q[[t]]=e,e.circle.classed("rdf-class",!0),e.circle.on("mouseover",(function(t){o.noPrefixes||e.textHidden?x.show(e,t):x.hide(e)})),e.circle.on("mouseout",x.hide)}})).on("gdb-focus",(function(e,t){return A(t)})).on("gdb-zoom",(function(e,t){return q(t)}));function E(e){d3.selectAll(".selected").classed("selected",e.selected=!1),e.circle.classed("selected",e.selected=!0),y=e}function N(){d.showClassInfoPanel=!1}v&&(v=_.uniqBy(v,"name"),d.flattenedClassNames=v);var M=i.a.Click.delayDblClick();d3.selectAll(".parent, .topLevelParent, .child, .root").call(M),A=function(e){q(e),e.data.name===h?(N(),d3.selectAll(".selected").classed("selected",!1)):(E(e),b||(d.selectedClass=y,d.showClassInfoPanel=!0),d.$on("sidePanelClosed",(function(t){d3.selectAll(".selected").classed("selected",e.selected=!1)})))},M.on("click",(function(e,t){t.data.id&&c.history.pushState({id:t.data.id},"classHierarchyPage"+t.data.id,"hierarchy#"+t.data.id),x.hide(),A(t)})),M.on("dblclick",(function(t,n){n!==r&&(x.hide(),E(n),e.$broadcast("goToDomainRangeGraphView",y,P),t.stopPropagation())}));var j=0;I.on("wheel",(function(e){x.hide(),e.preventDefault(),e.stopPropagation();var t=(new Date).getTime();if(t-j>100){j=t;var r="";e.deltaY<=-1?r="in":e.deltaY>=1&&(r="out");var n=e.target.__data__;if(n||(n=P),"in"===r){if(n!==P){for(;n.parent&&!n.parent.isInFocusTransitive;)n=n.parent;n.depth<P.depth&&(n=P)}if(n===P&&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);q(n,!0)}else"out"===r&&(n=P.parent)&&q(n,!0);P.data.name===h&&c.history.replaceState({id:1},"classHierarchyPage1","hierarchy#1"),H()}}));var $=T.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)}));o.noPrefixes?($.each((function(e){var t=e.data.name.indexOf(":");e.data.name.indexOf("http://")>-1?e.noPrefixName=e.data.name:t>-1&&(e.noPrefixName=e.data.name.substring(t+1))})),$.style("font-size",(function(e){return i.a.Text.calcFontSize(e.noPrefixName,e.r)})).text((function(e){return i.a.Text.getTextWithElipsisIfNeeded(e.noPrefixName,e.r/3)}))):$.style("font-size",(function(e){return i.a.Text.calcFontSize(e.data.name,e.r)})).text((function(e){return i.a.Text.getTextWithElipsisIfNeeded(e.data.name,e.r/3)})),$.style("display",(function(e){return e.parent&&e.parent.data===P.data?(e.textHidden=this.textContent.indexOf("...")+3===this.textContent.length,null):(e.textHidden=!0,"none")})),o.doFade&&!o.keepPrevState&&$.each((function(e){i.a.Transition.fadeIn(d3.select(this),550)})),L=function(){function e(e){e&&k.each((function(t){+e===t.data.id&&A(t)}))}var r=t.hash();c.onpopstate=function(t){t.state&&e(t.state.id)},e(r)};var G=T.selectAll("circle, text");function U(e,t){var r=800/e[2];p=e,G.attr("transform",(function(t){return"translate("+(t.x-e[0])*r+","+(t.y-e[1])*r+")"})),k.attr("r",(function(e){return e.r*r})),t&&$.each((function(e){e.data.fullName!==P.data.topLevelParentUri&&P.data.topLevelParentUri!==h||(e.textSel.style("display","none"),P.children&&P.children.length?_.each(P.children,(function(e){e.textSel.style("display","inline")})):P.textSel.style("display","inline"),P.parent&&_.each(P.parent.children,(function(e){e.data.name!==P.data.name&&e.textSel.style("display","inline")})))})),$.style("font-size",(function(e){return o.noPrefixes?i.a.Text.calcFontSize(e.noPrefixName,e.r*r):i.a.Text.calcFontSize(e.data.name,e.r*r)})).text((function(e){return o.noPrefixes?i.a.Text.getTextWithElipsisIfNeeded(e.noPrefixName,e.r*r/3):i.a.Text.getTextWithElipsisIfNeeded(e.data.name,e.r*r/3)}))}function F(e){var t=2*e+20;return 2*e/t<.3&&(t=2*e+2),t}function z(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 q(e,t){if(l((function(){d.showExternalElements=e.data.name===h})),P!==e&&(e.data.id&&c.history.replaceState({id:e.data.id},"classHierarchyPage"+e.data.id,"hierarchy#"+e.data.id),e.children||(e=e.parent,P!==e))){if(t&&(N(),d3.selectAll(".selected").classed("selected",!1)),P.parent)for(var r=P;r;)r.isInFocusTransitive=!1,r=r.parent;for(r=e;r;)r.isInFocusTransitive=!!r.children,r=r.parent;if(2*(P=e).r/(2*P.r+20)<.3||d.currentSliderValue>d.currentBrowserLimit)U([P.x,P.y,F(P.r)]),$.each((function(e){z.call(this,e)}));else d3.transition().duration(f).tween("zoom",(function(e){var t=d3.interpolateZoom(p,[P.x,P.y,F(P.r)]);return function(e){U(t(e))}})).selectAll("text").each(z)}}U([P.x,P.y,F(P.r)],u),O=d.$on("rootFocus",(function(){c.history.pushState({id:1},"classHierarchyPage1","hierarchy#1"),A(w)})),D=d.$on("classSearch",(function(e){A(e)}))}function H(){var t=d.classHierarchyData.classCount,r=g.get(m.CLASS_HIERARCHY_CURRENT_SLIDER_VALUE);(!r||r>t)&&(r=t,g.set(m.CLASS_HIERARCHY_CURRENT_SLIDER_VALUE,r)),e.$broadcast("classCount",t,r)}window.addEventListener("resize",H),window.addEventListener("beforeunload",(function e(){window.removeEventListener("resize",H),window.removeEventListener("beforeunload",e)})),d.$watch("classHierarchyData",(function(){M&&M(),j&&j(),G&&G(),U&&U();var e=k();if(d.classHierarchyData.classCount){var t=function(e,t){var r={keepPrevState:!0,noPrefixes:k()};a=r.noPrefixes,F(n||e,r,P,!0),l((function(){g.set(m.CLASS_HIERARCHY_SWITCH_PREFIXES,t),L(),b=!1}),70)},r=function(e,r,i){if(e){g.set(m.CLASS_HIERARCHY_CURRENT_SLIDER_VALUE,e),n={name:h,children:[]};for(var c=new Set,l=1;l<=e;l++)c.add(r[l].data.id),r[l].parent===r[0]&&n.children.push(r[l].data);if(function e(t){if(t.children){var r,n=[],a=s(t.children);try{for(a.s();!(r=a.n()).done;){var i=r.value;c.has(i.id)&&n.push($.extend({},i))}}catch(e){a.e(e)}finally{a.f()}t.children=n;var o,l=s(t.children);try{for(l.s();!(o=l.n()).done;){e(o.value)}}catch(e){l.e(e)}finally{l.f()}}}(n),i)a=angular.isUndefined(a)?k():a,F(n,{noPrefixes:a});else t(o)}};H();var n,a,i,o=_.cloneDeep(d.classHierarchyData),c=function(e){return e.descendants().sort((function(e,t){return e.data.sortingRank>t.data.sortingRank?-1:e.data.sortingRank<t.data.sortingRank||e.data.depth>t.data.depth?1:e.data.depth<t.data.depth?-1:0}))}(d3.hierarchy(o)),u=g.get(m.CLASS_HIERARCHY_CURRENT_SLIDER_VALUE);if(u)r(u,c);else{var p={doFade:!0,keepPrevState:!0,noPrefixes:k()};F(o,p),L()}M=d.$watch("hidePrefixes",(function(r){angular.isUndefined(r)||e?e=void 0:l((function(){b=!0,function(e){angular.isUndefined(e)||g.set(m.CLASS_HIERARCHY_HIDE_PREFIXES,e)}(r),t(o,!0)}),50)}),!0),j=d.$watch("currentSliderValue",(function(e){r(e,c,!0)}),!0),U=d.$on("onEnterKeypressSearchAction",(function(e){i&&A(i)})),G=d.$on("searchedClass",(function(e,t){(i=Q[t.name])&&A(i)}))}}),!0)}(d)}}}angular.module("graphdb.framework.graphexplore.directives.class",["graphdb.framework.graphexplore.controllers.class","graphdb.framework.utils.localstorageadapter"]).constant("ZOOM_DURATION",500).constant("ROOT_OBJ_NAME","RDF Class Hierarchy").directive("rdfClassHierarchy",l),l.$inject=["$rootScope","$location","GraphDataRestService","$window","$timeout","$repositories","$licenseService","toastr","ZOOM_DURATION","ROOT_OBJ_NAME","LocalStorageAdapter","LSKeys","$translate"]},305:function(e,t,r){"use strict";r.r(t);var n=r(648),a=r(647);r(15);function i(e,t,r,i,o,s,c,l,u,d,p,f,h){return{restrict:"AE",template:'<div id="domain-range"></div>',scope:{showPredicatesInfoPanel:"=",selectedPredicate:"=",collapseEdges:"="},link:function(d){var 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),b?(g.alpha(.2).restart(),b=!1):g.restart()})).on("drag",(function(e,t){b=!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:f}).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:f}).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:f}).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=3.0.2");$("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("+o.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("+o.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("+o.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=o.search().uri,x=o.search().name,w=o.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,w),$(window).on("popstate",(function(){s.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)||(s.set(c.DOMAIN_RANGE_COLLAPSE_EDGES,d.collapseEdges),"true"!==s.get(c.DOMAIN_RANGE_WENT_BACK)&&function(t){e.$broadcast("switchEdgeMode",{uri:v,name:x,collapsed:t})}(d.collapseEdges),s.remove(c.DOMAIN_RANGE_WENT_BACK))})),d.$watch("domainRangeGraphData",(function(){if(d.domainRangeGraphData){var r=function(e){e.style("stroke",f),e.style("stroke-width",2),e.attr("marker-end","url("+o.absUrl()+"#collapsed-arrow)")},n=function(){$.isEmptyObject(C)||(C.text.style("fill","black"),C.background.style("fill","#f0f0f0"))},i=function(e,t){n(),C.text=d3.select(this),C.background=d3.select(this.previousSibling),C.text.style("fill","white"),C.background.style("fill",f),l((function(){d.showPredicatesInfoPanel=!0,d.selectedPredicate=t})),e.stopPropagation()},s=_.cloneDeep(d.domainRangeGraphData),c=s.nodes,u=s.links;g.nodes(c).force("x",d3.forceX(600)).force("y",d3.forceY(300)).force("charge",d3.forceManyBody().strength(-800)).force("link",d3.forceLink(u).distance(1200/3.5));var y,w,b=p.selectAll(".link").data(u).enter().append("g"),S=0;b.each((function(e){if(e.objectPropNodeClassUri!==v)y=b.append("line").attrs({class:"link","marker-end":"url("+o.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?r(t):e.implicit&&t.style("stroke-dasharray","3, 3")}));else{if(angular.isUndefined(w)){w=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("+o.absUrl()+"#arrow-loop)"}).style("stroke-width",1.2)}(S+=e.targetNodeEdgeCount)>1&&r(d3.select(".loop-link"))}}));var C={};$("document").ready((function(){$("#domain-range").bind("click",n)}));var I=b.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}));I.each((function(e){var r=d3.select(this);/\d\spredicates/.test(r.text())?r.style("font-weight","bold").on("click",i):r.on("click",(function(e,r){t.open("resource?uri="+encodeURIComponent(r.uri),"_blank")}))}));var R=2,k=b.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+2*R})).attr("height",(function(e){return e.calculatedHeight=this.previousSibling.getBBox().height,e.calculatedHeight+R})).attr("transform",(function(e){var t=R-1200/18/2*("objectLeft"===e.propertyType?1:-1);return"objectLeft"===e.propertyType&&(t+=e.calculatedWidth),"translate(-"+t+",-"+(R+e.calculatedHeight/2)+")"})).on("click",(function(e){e.stopPropagation()})),E=p.selectAll(".node").data(c).enter().append("g"),L=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("+o.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 A=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"),N=d3.select(".class-node"),P=d3.selectAll(".loop-link-background"),O=d3.selectAll(".loop-link-property-name");if(I=d3.selectAll(".property-name"),!angular.isUndefined(w)){var D=[];P.each((function(e,t){d3.select(this);D.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=[];P.each((function(a,i){n.push(a),i<h?function(n,a){var i=$.grep(D,(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",i),d3.select(".view-more-preds-rect").attr("height",t+2*R)}(n)}y.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})),L.each((function(e){"main"!==e.classPosition||angular.isUndefined(w)||(!function(e){var t=e.x+64,r=e.y-1200/18/5.7-5;w.attr("transform","rotate(270, "+e.x+","+e.y+") translate("+t+","+r+")")}(e),function(e){function t(t,r){var n=$.grep(D,(function(e){return e.idx==r})),a=0;r>0&&(a=parseFloat(2*r*(n[0].height/1.4)));var i=e.x,o=e.y-1200/18*2.1-a;t.attrs({x:i,y:o}).moveToFront()}O.each((function(e,r){var n=d3.select(this),a=O.size()-h;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<h?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=N.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(),k.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(),I.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(),A.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()}))}}));var b=!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"]},306: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"]},307: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(){var 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"]},308:function(e,t,r){"use strict";r.r(t);var n=r(648);r(185);function a(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return i(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?i(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,a=function(){};return{s:a,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,c=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return s=e.done,e},e:function(e){c=!0,o=e},f:function(){try{s||null==r.return||r.return()}finally{if(c)throw o}}}}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function o(e,t){return{restrict:"A",template:'<div id="dependencies-chord"></div>',scope:{dependenciesData:"="},link:function(r){r.$watch("dependenciesData",(function(){if(r.dependenciesData){var i=r.dependenciesData;!function(i,o){if(!function(){var e,t=!0,r=a(i);try{for(r.s();!(e=r.n()).done;){if(e.value.some((function(e){return 0!==e}))){t=!1;break}}}catch(e){r.e(e)}finally{r.f()}return t}()){var s=d3.scaleOrdinal(d3.schemeCategory10),c=d3.select("body").append("div").attr("class","tooltip").style("opacity",0);d3.select("body").on("click",(function(){c.style("opacity",0)}));var l=Math.min(800,800)/2.8,u=l-24,d=d3.arc().innerRadius(u).outerRadius(l),p=d3.chord().padAngle(.04).sortSubgroups(d3.descending).sortChords(d3.ascending),f=d3.ribbon().radius(u),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",l).style("fill","none");var g=p(i),m=h.selectAll(".group").data(g.groups).enter().append("g").attr("class","group").on("mouseover",(function(){var e=m.nodes().indexOf(this);y.classed("fade",(function(t){return t.source.index!==e&&t.target.index!==e}))}));m.append("title").text((function(e,t){return o[t]})),m.append("path").attr("id",(function(e,t){return"group"+t})).attr("d",d).style("fill",(function(e,t){return s(t)})),m.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("+(u+26)+")"+(e.angle>Math.PI?"rotate(180)":"")})).style("text-anchor",(function(e){return e.angle>Math.PI?"end":null})).text((function(e){return o[e.index]}));var y=h.selectAll(".chord").data(g).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",f);y.on("mouseover",(function(){d3.select(this).style("fill-opacity","1")})),y.on("mouseout",(function(){d3.select(this).style("fill-opacity",".67")})),y.on("click",(function(e,n){var a=o[n.source.index],i=o[n.target.index],s=e.pageX,l=e.pageY;t.getPredicates(a,i,r.selectedGraph&&r.selectedGraph.contextID.uri).success((function(e){var t="<div class='dependencies-tooltip'>"+("<div class='row'>"+a+" <i class='fa fa-exchange'></i> "+i+"</div>")+_.map(e.slice(0,10),(function(e){var 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>",c.html(t).style("left",s+"px").style("top",l+"px")})),c.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(){var t=n.a.Export.generateBase64ImageSource(".dependencies-chord svg");d3.select(this).attrs({href:t,download:"dependencies-"+e.getActiveRepository()+".svg"})}))}}(i.matrix,i.nodes,i.direction)}}))}}}angular.module("graphdb.framework.graphexplore.directives.dependencies",["graphdb.framework.graphexplore.controllers.dependencies","graphdb.framework.rest.graphexplore.data.service"]).directive("dependenciesChord",o),o.$inject=["$repositories","GraphDataRestService"]},309: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=[]},310: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"]},399:function(e,t,r){"use strict";r.r(t);r(10),r(58),r(52),r(53),r(902),r(903),r(634),r(658),r(372),r(384),r(904),r(659),r(647),r(684),r(648),r(185),r(295),r(296),r(297),r(298),r(299),r(300),r(301),r(302),r(303),r(304),r(305),r(306),r(307),r(308),r(309),r(310),r(167);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"])},634:function(e,t,r){var n,a;n=[r(644)],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(644)),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(){var e=this.parentNode.firstChild;e&&this.parentNode.insertBefore(this,e)}))},d3}.apply(t,n))||(e.exports=a)},647:function(e,t,r){"use strict";r(634);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(){var e=function(e,r){for(var n,a=1,i=arguments.length;++a<i;)e[n=arguments[a]]=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,o,s;(o=r,s=d3.pointer(document.body),Math.sqrt(Math.pow(o[0]-s[0],2),Math.pow(o[1]-s[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},648:function(e,t,r){"use strict";r(634);var n=n||{};n.Export={getCSSRules:function(e){var t=$('link[href="'+e+'"]')[0].sheet.rules,r="";return _.each(t,(function(e){r+=e.cssText})),r},generateBase64ImageSource:function(e){e||(e="svg");var t=d3.selectAll(e).attr("version","1.1").attr("xmlns","http://www.w3.org/2000/svg").node().parentNode.innerHTML;return"data:image/svg+xml;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(t)))}},t.a=n},658: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,o=null,s=null;function c(e){var t;a="svg"===(t=(t=e).node()).tagName.toLowerCase()?t:t.ownerSVGElement,i=a.createSVGPoint(),document.body.appendChild(n)}c.show=function(){var n=Array.prototype.slice.call(arguments);n[n.length-1]instanceof SVGElement&&(o=n.pop());var a,i=r.apply(this,n),d=t.apply(this,n),f=e.apply(this,n),h=p(),g=u.length,m=document.documentElement.scrollTop||document.body.scrollTop,y=document.documentElement.scrollLeft||document.body.scrollLeft,v=s.apply(this,n);for(h.html(i).style("opacity",1).style("pointer-events","all");g--;)h.classed(u[g],!1);var x=n.filter((function(e){return e instanceof Event}));return a=l.get(f).apply(this,x),v?Object.keys(v).forEach((function(e){h.style(e,v[e])})):h.classed(f,!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:h(t),c):e},c.offset=function(e){return arguments.length?(t=null==e?e:h(e),c):t},c.html=function(e){return arguments.length?(r=null==e?e:h(e),c):r},c.customPosition=function(e){return arguments.length?(s=null==e?e:h(e),c):s},c.destroy=function(){return n&&(p().remove(),n=null),c};var l=new Map(Object.entries({n:function(e){var t=f(e);return{top:t.n.y-n.offsetHeight,left:t.n.x-n.offsetWidth/2}},s:function(e){var t=f(e);return{top:t.s.y,left:t.s.x-n.offsetWidth/2}},e:function(e){var t=f(e);return{top:t.e.y-n.offsetHeight/2,left:t.e.x}},w:function(e){var t=f(e);return{top:t.w.y-n.offsetHeight/2,left:t.w.x-n.offsetWidth}},nw:function(e){var t=f(e);return{top:t.nw.y-n.offsetHeight,left:t.nw.x-n.offsetWidth}},ne:function(e){var t=f(e);return{top:t.ne.y-n.offsetHeight,left:t.ne.x}},sw:function(e){var t=f(e);return{top:t.sw.y,left:t.sw.x-n.offsetWidth}},se:function(e){var t=f(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 f(e){for(var t=o||e.target;void 0===t.getScreenCTM&&"undefined"===t.parentNode;)t=t.parentNode;var r={},n=t.getScreenCTM(),a=t.getBBox(),s=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+=s,r.ne=i.matrixTransform(n),i.y+=c,r.se=i.matrixTransform(n),i.x-=s,r.sw=i.matrixTransform(n),i.y-=c/2,r.w=i.matrixTransform(n),i.x+=s,r.e=i.matrixTransform(n),i.x-=s/2,i.y-=c/2,r.n=i.matrixTransform(n),i.y+=c,r.s=i.matrixTransform(n),r}function h(e){return"function"==typeof e?e:function(){return e}}return c}},684: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},904:function(e,t){function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}
|
|
2
2
|
/*! Copyright (c) 2014 Hidenari Nozaki and contributors | Licensed under the MIT license */!function(e,t){"use strict";!function(e){e.module("angucomplete-alt",[]).directive("angucompleteAlt",["$q","$parse","$http","$sce","$timeout","$templateCache","$interpolate",function(e,t,n,a,i,o,s){function c(t,o,s,c){var l,u,d,p,f,h,g=o.find("input"),m=3,y=null,v="autocomplete-required",x=null,w=null,b=o[0].querySelector(".angucomplete-dropdown"),S=!1,C=null;function I(e,n){e&&("object"===r(e)?(t.searchStr=L(e),E({originalObject:e})):"string"==typeof e&&e.length>0?t.searchStr=e:console&&console.error&&console.error("Tried to set "+(n?"initial":"")+" value of angucomplete to",e,"which is an invalid value"),T(!0))}function R(e){C=null,t.hideResults(e),document.body.removeEventListener("click",R)}function k(e){return e.which?e.which:e.keyCode}function E(e){"function"==typeof t.selectedObject?t.selectedObject(e,t.selectedObjectData):t.selectedObject=e,T(!!e)}function L(e){return t.titleField.split(",").map((function(t){return _(e,t)})).join(" ")}function _(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 n,i,o;if(o=new RegExp(r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"i"),e)return e.match&&e.replace||(e=e.toString()),n=(i=e.match(o))?e.replace(o,'<span class="'+t.matchClass+'">'+i[0]+"</span>"):e,a.trustAsHtml(n)}function T(e){t.notEmpty=e,x=t.searchStr,t.fieldRequired&&c&&t.inputName&&c[t.inputName].$setValidity(v,e)}function N(e){!t.overrideSuggestions||t.selectedObject&&t.selectedObject.originalObject===t.searchStr||(e&&e.preventDefault(),i.cancel(y),$(),E({originalObject:t.searchStr}),t.clearSelected&&(t.searchStr=null),Q())}function P(){return o[0].querySelectorAll(".angucomplete-row")[t.currentIndex]}function O(e){b.scrollTop=b.scrollTop+e}function D(){var e=t.results[t.currentIndex];t.matchClass?g.val(L(e.originalObject)):g.val(e.title)}function M(e){return function(r,n,a,i){n||a||i||!r.data||(r=r.data),t.searching=!1,z(_(u(r),t.remoteUrlDataField),e)}}function j(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 $(){w&&w.resolve()}function G(r){var a={},i=t.remoteUrl+encodeURIComponent(r);t.remoteUrlRequestFormatter&&(a={params:t.remoteUrlRequestFormatter(r)},i=t.remoteUrl),t.remoteUrlRequestWithCredentials&&(a.withCredentials=!0),$(),w=e.defer(),a.timeout=w.promise,n.get(i,a).success(M(r)).error(j)}function U(r){$(),w=e.defer(),t.remoteApiHandler(r,w.promise).then(M(r)).catch(j)}function Q(){t.showDropdown=!1,t.results=[],b&&(b.scrollTop=0)}function F(){t.showDropdown=p,t.currentIndex=t.focusFirst?0:-1,t.results=[]}function H(e){!e||e.length<m||(t.localData?t.$apply((function(){var r;r=void 0!==t.localSearch()?t.localSearch()(e,t.localData):function(e){var r,n,a,i,o=t.searchFields.split(","),s=[];for(void 0!==t.parseInput()&&(e=t.parseInput()(e)),r=0;r<t.localData.length;r++){for(n=!1,a=0;a<o.length;a++)i=_(t.localData[r],o[a])||"",n=n||i.toString().toLowerCase().indexOf(e.toString().toLowerCase())>=0;n&&(s[s.length]=t.localData[r])}return s}(e),t.searching=!1,z(r,e)})):t.remoteApiHandler?U(e):G(e))}function z(e,r){var n,a,i,o,s,c;if(e&&e.length>0)for(t.results=[],n=0;n<e.length;n++)t.titleField&&""!==t.titleField&&(o=s=L(e[n])),a="",t.descriptionField&&(a=c=_(e[n],t.descriptionField)),i="",t.imageField&&(i=_(e[n],t.imageField)),t.matchClass&&(s=A(o,r),c=A(a,r)),t.results[t.results.length]={title:s,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:o,desc:a||""},t.searchStr)?t.showDropdown=!1:0!==t.results.length||f?t.showDropdown=!0:t.showDropdown=!1}function q(){t.localData?z(t.localData,""):t.remoteApiHandler?U(""):G("")}o.on("mousedown",(function(e){e.target.id?(C=e.target.id)===t.id+"_dropdown"&&document.body.addEventListener("click",R):C=e.target.className})),t.currentIndex=t.focusFirst?0:null,t.searching=!1,d=t.$watch("initialValue",(function(e){e&&(d(),I(e,!0))})),t.$watch("fieldRequired",(function(e,r){e!==r&&(e?x&&-1!==t.currentIndex?T(!0):T(!1):c[t.inputName].$setValidity(v,!0))})),t.$on("angucomplete-alt:clearInput",(function(e,r){r&&r!==t.id||(t.searchStr=null,E(),T(!1),Q())})),t.$on("angucomplete-alt:changeInput",(function(e,r,n){r&&r===t.id&&I(n)})),t.onFocusHandler=function(){t.focusIn&&t.focusIn(),0!==m||t.searchStr&&0!==t.searchStr.length||(t.currentIndex=t.focusFirst?0:t.currentIndex,t.showDropdown=!0,q())},t.hideResults=function(){C&&(C===t.id+"_dropdown"||C.indexOf("angucomplete")>=0)?C=null:(l=i((function(){Q(),t.$apply((function(){t.searchStr&&t.searchStr.length>0&&g.val(t.searchStr)}))}),200),$(),t.focusOut&&t.focusOut(),t.overrideSuggestions&&t.searchStr&&t.searchStr.length>0&&-1===t.currentIndex&&N())},t.resetHideResults=function(){l&&i.cancel(l)},t.hoverRow=function(e){t.currentIndex=e},t.selectResult=function(e){t.matchClass&&(e.title=L(e.originalObject),e.description=_(e.originalObject,t.descriptionField)),t.clearSelected?t.searchStr=null:t.searchStr=e.title,E(e),Q()},t.inputChangeHandler=function(e){return e.length<m?($(),Q()):0===e.length&&0===m&&(t.searching=!1,q()),t.inputChanged&&(e=t.inputChanged(e)),e},t.fieldRequiredClass&&""!==t.fieldRequiredClass&&(v=t.fieldRequiredClass),t.minlength&&""!==t.minlength&&(m=parseInt(t.minlength,10)),t.pause||(t.pause=500),t.clearSelected||(t.clearSelected=!1),t.overrideSuggestions||(t.overrideSuggestions=!1),t.fieldRequired&&c&&(t.initialValue?T(!0):T(!1)),t.inputType=s.type?s.type:"text",t.textSearching=s.textSearching?s.textSearching:"Searching...",t.textNoResults=s.textNoResults?s.textNoResults:"No results found",p="false"!==t.textSearching,f="false"!==t.textNoResults,t.maxlength=s.maxlength?s.maxlength:524288,g.on("keydown",(function(e){var r=k(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])):(N(e),Q()),t.$apply()):40===r&&t.results?(e.preventDefault(),t.currentIndex+1<t.results.length&&t.showDropdown&&(t.$apply((function(){t.currentIndex++,D()})),S&&(n=P(),b.getBoundingClientRect().top+parseInt(getComputedStyle(b).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--,D()})),S&&(a=P().getBoundingClientRect().top-(b.getBoundingClientRect().top+parseInt(getComputedStyle(b).paddingTop,10)))<0&&O(a-1)):0===t.currentIndex&&t.$apply((function(){t.currentIndex=-1,g.val(t.searchStr)}))):9===r?t.results&&t.results.length>0&&t.showDropdown?-1===t.currentIndex&&t.overrideSuggestions?N():(-1===t.currentIndex&&(t.currentIndex=0),t.selectResult(t.results[t.currentIndex]),t.$digest()):t.searchStr&&t.searchStr.length>0&&N():27===r&&e.preventDefault()})),g.on("keyup",(function(e){var r=k(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>=m&&(F(),t.searching=!0,H(t.searchStr));else if(27===r)Q(),t.$apply((function(){g.val(t.searchStr)}));else{if(0===m&&!t.searchStr)return;t.searchStr&&""!==t.searchStr?t.searchStr.length>=m&&(F(),y&&i.cancel(y),t.searching=!0,y=i((function(){H(t.searchStr)}),t.pause)):t.showDropdown=!1,x&&x!==t.searchStr&&!t.clearSelected&&t.$apply((function(){E()}))}})),h="remoteUrlResponseFormatter",u=function(e){return t[h]?t[h](e):e},i((function(){var e=getComputedStyle(b);S=e.maxHeight&&"auto"===e.overflowY}))}return o.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 c}}}])}(window.angular)}()}}]);
|