graphdb-workbench 2.7.4-RC2 → 2.7.5-TR1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (73) hide show
  1. package/dist/121.a9905fd2f001942970c3.bundle.js +1 -0
  2. package/dist/123.537690673829efc8d449.bundle.js +1 -0
  3. package/dist/148.254a642917f6b6c15d61.bundle.js +1 -1
  4. package/dist/17.3d7eaaad411633e6bcac.bundle.js +3 -0
  5. package/dist/{18.5ec8d8bedc5900dd9987.bundle.js → 18.d9d99950a0c1da7f12c6.bundle.js} +2 -2
  6. package/dist/{19.8c07889227bc39cae000.bundle.js → 19.b4244c289c3dfc3c09ec.bundle.js} +1 -1
  7. package/dist/28.c11269f1bfdea632cc8c.bundle.js +1 -1
  8. package/dist/29.9e82fddb3191a1d492ef.bundle.js +1 -1
  9. package/dist/299.6bc38539ac3a1f688515.bundle.js +1 -1
  10. package/dist/301.311927a5091e698dcfed.bundle.js +1 -1
  11. package/dist/302.07e63f56f579a56c5ea0.bundle.js +1 -1
  12. package/dist/303.0cc447af82c7337dc639.bundle.js +1 -1
  13. package/dist/332.218235e77c873ac2a107.bundle.js +1 -1
  14. package/dist/42.c1055d3f77e831a0feee.bundle.js +1 -1
  15. package/dist/51.5f93e26d33e6f8276243.bundle.js +1 -1
  16. package/dist/{bundle.b2cc5d5363ad5d9e12ec.bundle.js → bundle.3850162bec7f31d85e64.bundle.js} +2 -2
  17. package/dist/css/dependencies.css +5 -4
  18. package/dist/css/import.css +4 -0
  19. package/dist/i18n/locale-en.json +1 -0
  20. package/dist/i18n/locale-fr.json +1 -0
  21. package/dist/index.html +3 -3
  22. package/dist/js/angular/core/directives/autocomplete/templates/autocomplete.html +1 -1
  23. package/dist/js/angular/core/directives/operations-statuses-monitor/templates/operations-statuses-monitor.html +1 -1
  24. package/dist/js/angular/core/directives/rdfresourcesearch/templates/rdfResourceSearchTemplate.html +1 -1
  25. package/dist/js/angular/core/directives/yasgui-component/templates/yasgui-component.html +1 -1
  26. package/dist/js/angular/security/templates/user.html +1 -1
  27. package/dist/license-checker.json +2 -2
  28. package/dist/pages/aclmanagement.html +2 -2
  29. package/dist/pages/autocomplete.html +1 -1
  30. package/dist/pages/choose-repository-type.html +1 -1
  31. package/dist/pages/cluster-management/clusterInfo.html +3 -3
  32. package/dist/pages/create-index.html +1 -1
  33. package/dist/pages/dependencies.html +10 -6
  34. package/dist/pages/domainRangeInfo.html +2 -2
  35. package/dist/pages/edit.html +3 -3
  36. package/dist/pages/explore.html +1 -1
  37. package/dist/pages/export.html +1 -1
  38. package/dist/pages/find.html +1 -1
  39. package/dist/pages/graph-config/saveGraphConfig.html +8 -8
  40. package/dist/pages/graphs-visualizations.html +7 -7
  41. package/dist/pages/guides.html +1 -1
  42. package/dist/pages/import.html +2 -2
  43. package/dist/pages/jdbc-create.html +1 -1
  44. package/dist/pages/monitor/backup-and-restore.html +1 -1
  45. package/dist/pages/monitor/queries.html +1 -1
  46. package/dist/pages/monitor/resources.html +1 -1
  47. package/dist/pages/namespaces.html +2 -2
  48. package/dist/pages/plugins.html +1 -1
  49. package/dist/pages/rdfClassHierarchyInfo.html +9 -8
  50. package/dist/pages/rdfrank.html +2 -2
  51. package/dist/pages/repositories.html +1 -1
  52. package/dist/pages/repository.html +1 -1
  53. package/dist/pages/similarity-indexes.html +1 -1
  54. package/dist/pages/sparql-editor.html +1 -1
  55. package/dist/pages/sparql-template-create.html +1 -1
  56. package/dist/pages/ux-test1.html +2 -2
  57. package/dist/pages/webapi.html +2 -2
  58. package/dist/res/swagger5/README.md +1 -1
  59. package/dist/res/swagger5/index.css +1 -1
  60. package/dist/res/swagger5/index.html +12 -12
  61. package/dist/res/swagger5/oauth2-redirect.html +6 -6
  62. package/dist/res/swagger5/swagger-initializer.js +5 -0
  63. package/dist/res/swagger5/swagger-ui-bundle.js +1 -1
  64. package/dist/res/swagger5/swagger-ui-es-bundle-core.js +1 -1
  65. package/dist/res/swagger5/swagger-ui-es-bundle-core.js.map +1 -1
  66. package/dist/res/swagger5/swagger-ui-es-bundle.js +1 -1
  67. package/dist/res/swagger5/swagger-ui-standalone-preset.js +1 -1
  68. package/dist/res/swagger5/swagger-ui.js +1 -1
  69. package/dist/res/swagger5/swagger-ui.js.map +1 -1
  70. package/package.json +1 -1
  71. package/dist/121.5cfe2a629531fff5f8bb.bundle.js +0 -1
  72. package/dist/123.e47b9543e88b7a66d926.bundle.js +0 -1
  73. package/dist/17.0b74a9a8282301a807bb.bundle.js +0 -3
@@ -1,3 +1,3 @@
1
- (window.webpackJsonp=window.webpackJsonp||[]).push([[18,55,111,115,117,193,208,209,211,247,269],{122:function(e,t){angular.module("graphdb.framework.rest.explore.rest.service",[]).factory("ExploreRestService",n),n.$inject=["$http"];function n(e){return{getResourceDetails:(t,n,r,o)=>e.get("rest/explore/details",{params:{uri:t,triple:n,context:r},headers:{Accept:o||"application/json"}}),getGraph:(t,n,r)=>e.get("rest/explore/graph",{params:{uri:t.uri,triple:t.triple,inference:t.contextType.id,role:t.role,bnodes:t.blanks,sameAs:t.sameAs,context:t.context},headers:{Accept:n||"application/x-graphdb-table-results+json",Link:r?"<"+r+">":""}}).then(e=>e.data)}}},123:function(e,t,n){"use strict";n.r(t),n.d(t,"ResourceInfo",(function(){return i}));var r=n(99),o=n(84);class i{constructor(){this.role="subject",this.uri=void 0,this.triple=void 0,this.context=void 0,this.contextType=o.ContextTypes.EXPLICIT,this.sameAs=!0,this.details=new r.ResourceDetails,this.blanks=!0}}},124:function(e,t,n){"use strict";n.r(t),n.d(t,"RoleType",(function(){return r}));const r={SUBJECT:"subject",PREDICATE:"predicate",OBJECT:"object",CONTEXT:"context",ALL:"all"}},161:function(e,t){function n(e){return{restrict:"A",scope:{min:"=",max:"="},link:function(t,n,r){const o={debounce:_.debounce,delay:100,loadDelay:10,compressor:1,min:r.fitTextMin||"inherit",max:r.fitTextMax||"inherit",calcSize:10,lines:1},i=n.parent(),a=n[0],s=a.style,l=window.getComputedStyle(n[0],null),c=n.children().length||o.lines,u="inherit"===o.min?l["font-size"]:o.min,d="inherit"===o.max?l["font-size"]:o.max,p=l["line-height"],g=l.display;let f;function m(){const e=o.calcSize*c/a.offsetWidth/c;return Math.max(Math.min(function(e){const t=parseFloat(getComputedStyle(i[0]).paddingLeft),n=parseFloat(getComputedStyle(i[0]).paddingRight);return(i[0].offsetWidth-(t+n))*e*o.compressor}(e),parseFloat(d)),parseFloat(u))}function h(){f&&e.cancel(f),f=e((function(){a.offsetHeight*a.offsetWidth!=0&&(s.fontSize=o.calcSize+"px",s.lineHeight="1",s.display="inline-block",s.fontSize=m()+"px",s.lineHeight=p,s.display=g)}),o.loadDelay)}t.$watch((function(){return[i[0].offsetWidth,n[0].offsetWidth].join("_")}),(function(){h()})),$(window).on("resize",o.debounce((function(){t.$apply(h)}),o.delay)),t.$on("$destroy",(function(){f&&e.cancel(f),$(window).off("resize")}))}}}angular.module("graphdb.framework.core.directives.fittext",[]).directive("fitText",n),n.$inject=["$timeout"]},168:function(e,t){function n(){return{transformToTrig:function(e){let t="";const n={};for(let t=0;t<e.length;t++){const r=e[t];if(void 0===r.context?r.context="":r.context=_.trim(r.context),angular.isUndefined(n[r.context])){const e=[];e.push(r),n[r.context]=e}else n[r.context].push(r)}const r=Object.keys(n);for(let e=0;e<r.length;e++){const o=r[e];t+=""===o?"\n{":"\n<"+o+"> {";const i=n[o];for(let e=0;e<i.length;e++){const n=i[e];t+="\n\t<"+n.subject+"> <"+n.predicate+"> ";let r=n.object.value;"uri"===n.object.type?t+="<"+r+"> .":r.toString().includes('"')?("'"===r[0]&&(r='"'+r.slice(1,r.length)),r[r.length-1]&&(r=r.slice(0,-1)+'"'),t+="'''"+r+"'''"+(n.object.datatype?"^^<"+n.object.datatype+">":n.object.lang?"@"+n.object.lang:"")+" ."):t+='"""'+r+'"""'+(n.object.datatype?"^^<"+n.object.datatype+">":n.object.lang?"@"+n.object.lang:"")+" ."}t+="\n}"}return t},buildStatements:function(e,t){const n=[];if(!_.isEmpty(e.data)){const r=e.data[t],o=Object.keys(r);for(let e=0;e<o.length;e++){const i=o[e],a=r[i];for(let e=0;e<a.length;e++){const r=a[e];for(let e=0;e<r.graphs.length;e++){let o=r.graphs[e];"http://www.ontotext.com/explicit"===o&&(o=""),r.lang&&(r.datatype=""),r.datatype||(r.datatype=""),n.push({subject:t,predicate:i,object:{value:r.value,type:r.type,datatype:r.datatype,lang:r.lang},context:o})}}}}return n},getDatatypeOptions:function(){return[{value:"",label:"string"},{value:"http://www.w3.org/2001/XMLSchema#boolean",label:"boolean"},{value:"http://www.w3.org/2001/XMLSchema#decimal",label:"decimal"},{value:"http://www.w3.org/2001/XMLSchema#integer",label:"integer"},{value:"http://www.w3.org/2001/XMLSchema#double",label:"double"},{value:"http://www.w3.org/2001/XMLSchema#float",label:"float"},{value:"http://www.w3.org/2001/XMLSchema#date",label:"date"},{value:"http://www.w3.org/2001/XMLSchema#time",label:"time"},{value:"http://www.w3.org/2001/XMLSchema#dateTime",label:"date time"},{value:"http://www.w3.org/2001/XMLSchema#byte",label:"byte"},{value:"http://www.w3.org/2001/XMLSchema#short",label:"short"},{value:"http://www.w3.org/2001/XMLSchema#int",label:"int"},{value:"http://www.w3.org/2001/XMLSchema#long",label:"long"},{value:"http://www.w3.org/2001/XMLSchema#unsignedByte",label:"unsigned byte"},{value:"http://www.w3.org/2001/XMLSchema#unsignedShort",label:"unsigned short"},{value:"http://www.w3.org/2001/XMLSchema#unsignedInt",label:"unsigned int"},{value:"http://www.w3.org/2001/XMLSchema#unsignedLong",label:"unsigned long"},{value:"http://www.w3.org/2001/XMLSchema#positoveInteger",label:"positive integer"},{value:"http://www.w3.org/2001/XMLSchema#nonNegativeInteger",label:"non-negative integer"},{value:"http://www.w3.org/2001/XMLSchema#negativeInteger",label:"negative integer"},{value:"http://www.w3.org/2001/XMLSchema#nonPositiveInteger",label:"non-positive integer"},{value:"http://www.w3.org/2001/XMLSchema#gYear",label:"gYear"},{value:"http://www.w3.org/2001/XMLSchema#gMonth",label:"gMonth"},{value:"http://www.w3.org/2001/XMLSchema#gDay",label:"gDay"},{value:"http://www.w3.org/2001/XMLSchema#gYearMonth",label:"gYearMonth"},{value:"http://www.w3.org/2001/XMLSchema#gMonthDay",label:"gMonthDay"},{value:"http://www.w3.org/2001/XMLSchema#duration",label:"duration"},{value:"http://www.w3.org/2001/XMLSchema#hexBinary",label:"hex binary"},{value:"http://www.w3.org/2001/XMLSchema#base64Binary",label:"base64 binary"}]}}}angular.module("graphdb.framework.explore.services",[]).factory("StatementsService",n),n.$inject=[]},169:function(e,t,n){"use strict";n.r(t);n(98),n(122);var r=n(465),o=n(0),i=n(123),a=n(84),s=n(124),l=n(67),c=n(14),u=n(545),d=n(88);function p(e,t,n,o,p,g,f,m,h,w,x,v,y,b){let S;e.ContextTypes=a.ContextTypes,e.contextTypes=a.ContextType.getAllType(),e.currentContextTypeId=a.ContextTypes.EXPLICIT.id,e.roles=[s.RoleType.SUBJECT,s.RoleType.PREDICATE,s.RoleType.OBJECT,s.RoleType.CONTEXT,s.RoleType.ALL],e.resourceInfo=void 0,e.isLoading=!1,e.fileTypes=w,e.toggleSameAs=()=>{e.resourceInfo.sameAs=!e.resourceInfo.sameAs,e.exploreResource()},e.getActiveRepository=()=>p.getActiveRepository(),e.isTripleResource=()=>!!e.resourceInfo.triple,e.encodeURIComponent=e=>encodeURIComponent(e),e.getRdfStarLocalNames=e=>{let t=e.slice();return e.replace(/[<>]+/g,"").split(" ").forEach(e=>{t=t.replace(e,f.getLocalName(e))}),t},e.getLocalName=e=>f.getLocalName(e);e.loadResource=()=>{b.getResourceDetails(e.resourceInfo.uri,e.resourceInfo.triple,e.resourceInfo.context).success(t=>{e.resourceInfo.details=t,e.resourceInfo.context=e.resourceInfo.details.context,"object"!==e.resourceInfo.uri&&(e.resourceInfo.details.encodeURI=encodeURIComponent(e.resourceInfo.details.uri))}).error(e=>n.error(v.instant("explore.error.resource.details",{data:getError(e)}))),e.exploreResource()},e.isContextAvailable=()=>null!==e.resourceInfo.context&&"http://rdf4j.org/schema/rdf4j#SHACLShapeGraph"===e.resourceInfo.context,e.goToGraphsViz=()=>{t.path("graphs-visualizations").search("uri",e.resourceInfo.uri)},e.exploreResource=()=>{I(!0),null!=o.context&&(e.resourceInfo.context=o.context),t.search("role",e.resourceInfo.role),t.replace(),T()},e.downloadExport=t=>{b.getGraph(e.resourceInfo,t.type).then(e=>{t.type.indexOf("json")>-1&&(e=JSON.stringify(e));const n=navigator.userAgent.toLowerCase();if(-1!==n.indexOf("safari")&&-1===n.indexOf("chrome"))window.open('data:attachment/csv;filename="statements.'+t.extension+'",'+encodeURIComponent(e),"statements."+t.extension);else{const n=new Blob([e],{type:t.type});Object(r.saveAs)(n,"statements"+t.extension)}}).catch(e=>{n.error(getError(e),v.instant("common.error"))}).finally(()=>{I(!1)})},e.openJSONLDExportSettings=function(t){g.open({templateUrl:"js/angular/core/components/export-settings-modal/exportSettingsModal.html",controller:d.ExportSettingsCtrl,size:"lg",scope:e,resolve:{format:function(){return t.name}}}).result.then((function(n){e.downloadJSONLDExport(t,n.link,n.currentMode)}))},e.downloadJSONLDExport=function(t,o,i){b.getGraph(e.resourceInfo,t.type,o).then((async function(e){if("JSON"===t.name&&(e=JSON.stringify(e)),"JSON-LD"===t.name)switch(i.name){case"expanded":e=await u.expand(e),e=JSON.stringify(e);break;case"flattened":e=await u.flatten(e,o),e=JSON.stringify(e);break;case"compacted":e=await u.compact(e,o),e=JSON.stringify(e);break;case"context":e=await u.context(e,o),e=JSON.stringify(e);break;case"frame":e=await u.frame(e,o),e=JSON.stringify(e);break;case"framed":e=await u.compact(e,o),e=JSON.stringify(e)}const n=navigator.userAgent.toLowerCase();if(-1!==n.indexOf("safari")&&-1===n.indexOf("chrome"))window.open('data:attachment/csv;filename="statements.'+t.extension+'",'+encodeURIComponent(e),"statements."+t.extension);else{const n=new Blob([e],{type:t.type});Object(r.saveAs)(n,"statements"+t.extension)}})).catch((function(e){const t=getError(e);n.error(t,v.instant("common.error"))}))},e.changeRole=t=>{e.resourceInfo.role=t,e.resourceInfo.role===s.RoleType.CONTEXT&&(e.resourceInfo.contextType=a.ContextTypes.EXPLICIT),e.exploreResource()},e.changeInference=t=>{e.resourceInfo.contextType=a.ContextType.getContextType(t),e.exploreResource()},e.copyToClipboardResult=e=>{m.openCopyToClipboardModal(e)};const R=()=>{var n;e.resourceInfo||(e.resourceInfo=new i.ResourceInfo,n=e.resourceInfo,o.prefix&&o.localName&&S[o.prefix]?n.uri=S[o.prefix]+o.localName:t.search().uri?n.uri=t.search().uri+(t.hash()?"#"+t.hash():""):t.search().triple?n.triple=t.search().triple+(t.hash()?"#"+t.hash():""):n.uri=t.absUrl(),n.uri=n.uri&&n.uri.replace(/<|>/g,""),null!=o.context&&(e.resourceInfo.context=o.context),e.resourceInfo.role=t.search().role?t.search().role:s.RoleType.SUBJECT)},I=t=>{e.isLoading=!!t},C=()=>({showEditorTabs:!1,showToolbar:!1,showResultTabs:!1,showResultInfo:!0,downloadAsOn:!1,showQueryButton:!1,componentId:"resource-view-component",prefixes:S,maxPersistentResponseSize:0,render:l.RenderingMode.YASR,showYasqeActionButtons:!1,yasqeActionButtons:c.DISABLE_YASQE_BUTTONS_CONFIGURATION}),T=()=>{b.getGraph(e.resourceInfo).then(t=>{((t={})=>{const n={};angular.extend(n,e.yasguiConfig||C(),t),e.yasguiConfig=n})({sparqlResponse:t})}).catch(e=>{n.error(v.instant("explore.error.resource",{data:getError(e)}))}).finally(()=>{I(!1)})},$=t=>{e.resourceInfo.contextType=t.appSettings.DEFAULT_INFERENCE&&!e.resourceInfo.role===s.RoleType.CONTEXT?a.ContextTypes.ALL:a.ContextTypes.EXPLICIT,e.resourceInfo.sameAs=t.appSettings.DEFAULT_INFERENCE&&t.appSettings.DEFAULT_SAMEAS};e.$on("$destroy",()=>{L.forEach(e=>e())});const L=[];L.push(e.$watch((function(){return e.getActiveRepositoryObject()}),(function(t){t&&Promise.all([x.getPrincipal(),p.getPrefixes(p.getActiveRepository())]).then(([t,n])=>{R(),$(t),S=n,e.loadResource()}).catch(e=>{n.error(v.instant("get.namespaces.error.msg",{error:getError(e)}))})})))}function g(e,t,n,r,i,a,s,l,c,u,d,p){function g(){l.checkAutocompleteStatus().success((function(t){if(!t){const e=Object(o.decodeHTML)(p.instant("explore.autocomplete.warning.msg"));s.warning("",`<div class="autocomplete-toast"><a href="autocomplete">${e}</a></div>`,{allowHtml:!0})}e.autocompleteEnabled=t})).error((function(){s.error(p.instant("explore.error.autocomplete"))}))}function f(){d.getNamespaces(r.getActiveRepository()).success((function(t){e.namespaces=t.results.bindings.map((function(e){return{prefix:e.prefix.value,uri:e.namespace.value}})),e.loader=!1})).error((function(t){const n=getError(t);s.error(n,p.instant("common.error")),e.loader=!1}))}function m(e){const t=e.indexOf("<")>=0&&e.lastIndexOf(">")===e.length-1,n=-1===e.indexOf("<")&&-1===e.lastIndexOf(">"),r=/^<?[http|urn].*>?$/.test(e)&&(t||n);let o=!1;if(r)if(e.indexOf("http")>=0){const t=e.indexOf("//");o=t>4&&e.substring(t+2).length>0}else e.indexOf("urn")>=0&&(o=e.substring(4).length>0);return r&&o}let h,w;function x(t){function r(t){a((function(){e.form&&(e.form.$dirty=t)}))}t||(t=document.getElementById("resources_finder_value").value),t&&m(t)?(r(!1),n.path("resource").search("uri",t)):(r(!0),t&&s.error(p.instant("explore.error.invalid.input")))}e.submit=x,e.getAutocompleteSuggestions=function(t){if(!/<|>/.test(t)&&":"===t.slice(-1)){const n=c.getNamespaceUriForPrefix(e.namespaces,t.slice(0,-1));w=n!==w?n:w,w&&$("#resources_finder_value").val(w)}let n;if(e.autocompleteEnabled){const e=t.replace(w,w+";");n=l.getAutocompleteSuggestions(e)}else n=i.when(e.autocompleteEnabled);return n},e.inputChangedFn=function(){h=document.getElementById("resources_finder_value").value,e.form.$dirty=!(h&&m(h))},e.selectedUriCallback=function(t){e.selectedUri={name:t.title},x(e.selectedUri.name)},e.selectedUri={name:""},e.autocompleteEnabled=!1,angular.isDefined(u.search)&&a((function(){$("#resources_finder_value").val(u.search),$(".search-button").click()}),500),e.getActiveRepository()&&(g(),f()),e.$on("repositoryIsSet",(function(){g(),f()}))}function f(e,t,n,r,o,i,a,s,l,c,u){e.uriParam=n.search().uri,e.newRow={subject:e.uriParam,object:{type:"uri",datatype:""}},e.newResource=!1,e.datatypeOptions=l.getDatatypeOptions(),e.activeRepository=function(){return o.getActiveRepository()},e.getClassInstancesDetails=function(){c.getNamespaces(e.activeRepository()).success((function(t){e.namespaces=t.results.bindings.map((function(e){return{prefix:e.prefix.value,uri:e.namespace.value}})),e.loader=!1})).error((function(t){const n=getError(t);r.error(n,u.instant("common.error")),e.loader=!1})),s.getDetails(e.uriParam).success((function(t){e.details=t,e.details.encodeURI=encodeURIComponent(e.details.uri)})).error((function(e){r.error(u.instant("explore.error.resource.details",{data:getError(e)}))})),s.getGraph(e.uriParam).then((function(t){const n=l.buildStatements(t,e.uriParam);e.statements=n,e.newResource=!n.length}))},e.addStatement=function(){e.newRowPredicate.$setSubmitted(),e.newRowObject.$setSubmitted(),e.newRowContext.$setSubmitted(),e.newRowPredicate.$valid&&e.newRowObject.$valid&&e.newRowContext.$valid&&(e.statements.push(_.cloneDeep(e.newRow)),e.newRow={subject:e.uriParam,object:{type:"uri",datatype:""}},e.newRowPredicate.$setPristine(),e.newRowPredicate.$setUntouched(),e.newRowObject.$setPristine(),e.newRowObject.$setUntouched(),e.newRowContext.$setPristine(),e.newRowContext.$setUntouched())},e.removeStatement=function(t){e.statements.splice(t,1)},e.getLocalName=function(e){return s.getLocalName(e)},e.checkValid=function(e){if(!angular.isUndefined(e))return!0;return u.instant("explore.validation")},e.validEditRow=function(){return e.rowform.$valid},e.viewTrig=function(){i.open({templateUrl:"js/angular/explore/templates/viewTrig.html",controller:"ViewTrigCtrl",size:"lg",resolve:{data:function(){return l.transformToTrig(e.statements)}}})},e.save=function(){const o=e.newResource?"POST":"PUT";t({method:o,url:"rest/resource?uri="+encodeURIComponent(e.uriParam),headers:{"Content-Type":"application/x-trig"},data:l.transformToTrig(e.statements)}).success((function(){r.success(u.instant("explore.resource.saved"));const t=a((function(){n.path("resource").search("uri",e.uriParam)}),500);e.$on("$destroy",(function(){a.cancel(t)}))})).error((function(e){r.error(getError(e))}))},e.$watch((function(){return o.getActiveRepository()}),(function(){e.activeRepository()&&e.getClassInstancesDetails()})),e.validateUri=function(t){let n=!0;const r=t||"";if(-1===r.indexOf(":"))n=!1;else{const t=r.substring(0,r.indexOf(":"));if(""===s.getNamespaceUriForPrefix(e.namespaces,t)){!1===/^(http:\/\/www\.|https:\/\/www\.|http:\/\/|https:\/\/)[a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,5}(:[0-9]{1,5})?(\/.*)?$/.test(r)&&(n=!1);const e=r.match(/\//g);(void 0===e||e.length<3)&&(n=!1)}else{r.substring(r.indexOf(":")+1).trim().length<1&&(n=!1)}}return n}}function m(e,t,n){e.trig=n,e.cancel=function(){t.dismiss("cancel")}}angular.module("graphdb.framework.explore.controllers",["ngCookies","ngRoute","ui.bootstrap","toastr","graphdb.framework.core","graphdb.framework.core.services.repositories","graphdb.framework.explore.services","graphdb.workbench.utils.filetypes","graphdb.framework.rest.explore.rest.service"]).controller("FindResourceCtrl",g).controller("ExploreCtrl",p).controller("EditResourceCtrl",f).controller("ViewTrigCtrl",m),p.$inject=["$scope","$location","toastr","$routeParams","$repositories","$uibModal","ClassInstanceDetailsService","ModalService","RDF4JRepositoriesRestService","FileTypes","$jwtAuth","$translate","$q","ExploreRestService"],g.$inject=["$scope","$http","$location","$repositories","$q","$timeout","toastr","AutocompleteRestService","ClassInstanceDetailsService","$routeParams","RDF4JRepositoriesRestService","$translate"],f.$inject=["$scope","$http","$location","toastr","$repositories","$uibModal","$timeout","ClassInstanceDetailsService","StatementsService","RDF4JRepositoriesRestService","$translate"],m.$inject=["$scope","$uibModalInstance","data"]},170:function(e,t,n){"use strict";n.r(t);n(32);angular.module("graphdb.framework.explore.directives",["graphdb.framework.utils.uriutils"]).directive("uri",["UriUtils",function(e){return{require:"ngModel",link:function(t,n,r,o){o.$parsers.unshift((function(t){if(!angular.isUndefined(t)&&t.length>0){const n=e.validateRdfUri(t);return o.$setValidity("searchStr",n),n?t:void 0}return o.$setValidity("searchStr",!0),t})),o.$formatters.unshift((function(t){return angular.isUndefined(t)||o.$setValidity("searchStr",e.validateRdfUri),t}))}}}])},259:function(e,t,n){"use strict";n.r(t);n(7),n(28),n(168),n(169),n(170),n(553),n(700),n(161),n(93);angular.module("graphdb.framework.explore",["ngRoute","toastr","xeditable","angucomplete-alt-onto","graphdb.framework.explore.services","graphdb.framework.explore.controllers","graphdb.framework.explore.directives","graphdb.framework.core.directives.fittext","graphdb.framework.core.directives.yasgui-component"])},550:function(e,t){},67:function(e,t,n){"use strict";n.r(t),n.d(t,"RenderingMode",(function(){return r}));const r={YASGUI:"mode-yasgui",YASQE:"mode-yasqe",YASR:"mode-yasr"}},700:function(e,t){
1
+ (window.webpackJsonp=window.webpackJsonp||[]).push([[18,55,111,115,117,193,208,209,211,247,269],{122:function(e,t){angular.module("graphdb.framework.rest.explore.rest.service",[]).factory("ExploreRestService",n),n.$inject=["$http"];function n(e){return{getResourceDetails:(t,n,r,o)=>e.get("rest/explore/details",{params:{uri:t,triple:n,context:r},headers:{Accept:o||"application/json"}}),getGraph:(t,n,r)=>e.get("rest/explore/graph",{params:{uri:t.uri,triple:t.triple,inference:t.contextType.id,role:t.role,bnodes:t.blanks,sameAs:t.sameAs,context:t.context},headers:{Accept:n||"application/x-graphdb-table-results+json",Link:r?"<"+r+">":""}}).then(e=>e.data)}}},123:function(e,t,n){"use strict";n.r(t),n.d(t,"ResourceInfo",(function(){return i}));var r=n(99),o=n(84);class i{constructor(){this.role="subject",this.uri=void 0,this.triple=void 0,this.context=void 0,this.contextType=o.ContextTypes.EXPLICIT,this.sameAs=!0,this.details=new r.ResourceDetails,this.blanks=!0}}},124:function(e,t,n){"use strict";n.r(t),n.d(t,"RoleType",(function(){return r}));const r={SUBJECT:"subject",PREDICATE:"predicate",OBJECT:"object",CONTEXT:"context",ALL:"all"}},161:function(e,t){function n(e){return{restrict:"A",scope:{min:"=",max:"="},link:function(t,n,r){const o={debounce:_.debounce,delay:100,loadDelay:10,compressor:1,min:r.fitTextMin||"inherit",max:r.fitTextMax||"inherit",calcSize:10,lines:1},i=n.parent(),a=n[0],s=a.style,l=window.getComputedStyle(n[0],null),c=n.children().length||o.lines,u="inherit"===o.min?l["font-size"]:o.min,d="inherit"===o.max?l["font-size"]:o.max,p=l["line-height"],g=l.display;let f;function m(){const e=o.calcSize*c/a.offsetWidth/c;return Math.max(Math.min(function(e){const t=parseFloat(getComputedStyle(i[0]).paddingLeft),n=parseFloat(getComputedStyle(i[0]).paddingRight);return(i[0].offsetWidth-(t+n))*e*o.compressor}(e),parseFloat(d)),parseFloat(u))}function h(){f&&e.cancel(f),f=e((function(){a.offsetHeight*a.offsetWidth!=0&&(s.fontSize=o.calcSize+"px",s.lineHeight="1",s.display="inline-block",s.fontSize=m()+"px",s.lineHeight=p,s.display=g)}),o.loadDelay)}t.$watch((function(){return[i[0].offsetWidth,n[0].offsetWidth].join("_")}),(function(){h()})),$(window).on("resize",o.debounce((function(){t.$apply(h)}),o.delay)),t.$on("$destroy",(function(){f&&e.cancel(f),$(window).off("resize")}))}}}angular.module("graphdb.framework.core.directives.fittext",[]).directive("fitText",n),n.$inject=["$timeout"]},168:function(e,t){function n(){return{transformToTrig:function(e){let t="";const n={};for(let t=0;t<e.length;t++){const r=e[t];if(void 0===r.context?r.context="":r.context=_.trim(r.context),angular.isUndefined(n[r.context])){const e=[];e.push(r),n[r.context]=e}else n[r.context].push(r)}const r=Object.keys(n);for(let e=0;e<r.length;e++){const o=r[e];t+=""===o?"\n{":"\n<"+o+"> {";const i=n[o];for(let e=0;e<i.length;e++){const n=i[e];t+="\n\t<"+n.subject+"> <"+n.predicate+"> ";let r=n.object.value;"uri"===n.object.type?t+="<"+r+"> .":r.toString().includes('"')?("'"===r[0]&&(r='"'+r.slice(1,r.length)),r[r.length-1]&&(r=r.slice(0,-1)+'"'),t+="'''"+r+"'''"+(n.object.datatype?"^^<"+n.object.datatype+">":n.object.lang?"@"+n.object.lang:"")+" ."):t+='"""'+r+'"""'+(n.object.datatype?"^^<"+n.object.datatype+">":n.object.lang?"@"+n.object.lang:"")+" ."}t+="\n}"}return t},buildStatements:function(e,t){const n=[];if(!_.isEmpty(e.data)){const r=e.data[t],o=Object.keys(r);for(let e=0;e<o.length;e++){const i=o[e],a=r[i];for(let e=0;e<a.length;e++){const r=a[e];for(let e=0;e<r.graphs.length;e++){let o=r.graphs[e];"http://www.ontotext.com/explicit"===o&&(o=""),r.lang&&(r.datatype=""),r.datatype||(r.datatype=""),n.push({subject:t,predicate:i,object:{value:r.value,type:r.type,datatype:r.datatype,lang:r.lang},context:o})}}}}return n},getDatatypeOptions:function(){return[{value:"",label:"string"},{value:"http://www.w3.org/2001/XMLSchema#boolean",label:"boolean"},{value:"http://www.w3.org/2001/XMLSchema#decimal",label:"decimal"},{value:"http://www.w3.org/2001/XMLSchema#integer",label:"integer"},{value:"http://www.w3.org/2001/XMLSchema#double",label:"double"},{value:"http://www.w3.org/2001/XMLSchema#float",label:"float"},{value:"http://www.w3.org/2001/XMLSchema#date",label:"date"},{value:"http://www.w3.org/2001/XMLSchema#time",label:"time"},{value:"http://www.w3.org/2001/XMLSchema#dateTime",label:"date time"},{value:"http://www.w3.org/2001/XMLSchema#byte",label:"byte"},{value:"http://www.w3.org/2001/XMLSchema#short",label:"short"},{value:"http://www.w3.org/2001/XMLSchema#int",label:"int"},{value:"http://www.w3.org/2001/XMLSchema#long",label:"long"},{value:"http://www.w3.org/2001/XMLSchema#unsignedByte",label:"unsigned byte"},{value:"http://www.w3.org/2001/XMLSchema#unsignedShort",label:"unsigned short"},{value:"http://www.w3.org/2001/XMLSchema#unsignedInt",label:"unsigned int"},{value:"http://www.w3.org/2001/XMLSchema#unsignedLong",label:"unsigned long"},{value:"http://www.w3.org/2001/XMLSchema#positoveInteger",label:"positive integer"},{value:"http://www.w3.org/2001/XMLSchema#nonNegativeInteger",label:"non-negative integer"},{value:"http://www.w3.org/2001/XMLSchema#negativeInteger",label:"negative integer"},{value:"http://www.w3.org/2001/XMLSchema#nonPositiveInteger",label:"non-positive integer"},{value:"http://www.w3.org/2001/XMLSchema#gYear",label:"gYear"},{value:"http://www.w3.org/2001/XMLSchema#gMonth",label:"gMonth"},{value:"http://www.w3.org/2001/XMLSchema#gDay",label:"gDay"},{value:"http://www.w3.org/2001/XMLSchema#gYearMonth",label:"gYearMonth"},{value:"http://www.w3.org/2001/XMLSchema#gMonthDay",label:"gMonthDay"},{value:"http://www.w3.org/2001/XMLSchema#duration",label:"duration"},{value:"http://www.w3.org/2001/XMLSchema#hexBinary",label:"hex binary"},{value:"http://www.w3.org/2001/XMLSchema#base64Binary",label:"base64 binary"}]}}}angular.module("graphdb.framework.explore.services",[]).factory("StatementsService",n),n.$inject=[]},169:function(e,t,n){"use strict";n.r(t);n(98),n(122);var r=n(465),o=n(0),i=n(123),a=n(84),s=n(124),l=n(67),c=n(14),u=n(545),d=n(88);function p(e,t,n,o,p,g,f,m,h,w,x,v,y,b){let S;e.ContextTypes=a.ContextTypes,e.contextTypes=a.ContextType.getAllType(),e.currentContextTypeId=a.ContextTypes.EXPLICIT.id,e.roles=[s.RoleType.SUBJECT,s.RoleType.PREDICATE,s.RoleType.OBJECT,s.RoleType.CONTEXT,s.RoleType.ALL],e.resourceInfo=void 0,e.isLoading=!1,e.fileTypes=w,e.toggleSameAs=()=>{e.resourceInfo.sameAs=!e.resourceInfo.sameAs,e.exploreResource()},e.getActiveRepository=()=>p.getActiveRepository(),e.isTripleResource=()=>!!e.resourceInfo.triple,e.encodeURIComponent=e=>encodeURIComponent(e),e.getRdfStarLocalNames=e=>{let t=e.slice();return e.replace(/[<>]+/g,"").split(" ").forEach(e=>{t=t.replace(e,f.getLocalName(e))}),t},e.getLocalName=e=>f.getLocalName(e);e.loadResource=()=>{b.getResourceDetails(e.resourceInfo.uri,e.resourceInfo.triple,e.resourceInfo.context).success(t=>{e.resourceInfo.details=t,e.resourceInfo.context=e.resourceInfo.details.context,"object"!==e.resourceInfo.uri&&(e.resourceInfo.details.encodeURI=encodeURIComponent(e.resourceInfo.details.uri))}).error(e=>n.error(v.instant("explore.error.resource.details",{data:getError(e)}))),e.exploreResource()},e.isContextAvailable=()=>null!==e.resourceInfo.context&&"http://rdf4j.org/schema/rdf4j#SHACLShapeGraph"===e.resourceInfo.context,e.goToGraphsViz=()=>{t.path("graphs-visualizations").search("uri",e.resourceInfo.uri)},e.exploreResource=()=>{I(!0),null!=o.context&&(e.resourceInfo.context=o.context),t.search("role",e.resourceInfo.role),t.replace(),T()},e.downloadExport=t=>{b.getGraph(e.resourceInfo,t.type).then(e=>{t.type.indexOf("json")>-1&&(e=JSON.stringify(e));const n=navigator.userAgent.toLowerCase();if(-1!==n.indexOf("safari")&&-1===n.indexOf("chrome"))window.open('data:attachment/csv;filename="statements.'+t.extension+'",'+encodeURIComponent(e),"statements."+t.extension);else{const n=new Blob([e],{type:t.type});Object(r.saveAs)(n,"statements"+t.extension)}}).catch(e=>{n.error(getError(e),v.instant("common.error"))}).finally(()=>{I(!1)})},e.openJSONLDExportSettings=function(t){g.open({templateUrl:"js/angular/core/components/export-settings-modal/exportSettingsModal.html",controller:d.ExportSettingsCtrl,size:"lg",scope:e,resolve:{format:function(){return t.name}}}).result.then((function(n){e.downloadJSONLDExport(t,n.link,n.currentMode)}))},e.downloadJSONLDExport=function(t,o,i){b.getGraph(e.resourceInfo,t.type,o).then((async function(e){if("JSON"===t.name&&(e=JSON.stringify(e)),"JSON-LD"===t.name)switch(i.name){case"expanded":e=await u.expand(e),e=JSON.stringify(e);break;case"flattened":e=await u.flatten(e,o),e=JSON.stringify(e);break;case"compacted":e=await u.compact(e,o),e=JSON.stringify(e);break;case"context":e=await u.context(e,o),e=JSON.stringify(e);break;case"frame":e=await u.frame(e,o),e=JSON.stringify(e);break;case"framed":e=await u.compact(e,o),e=JSON.stringify(e)}const n=navigator.userAgent.toLowerCase();if(-1!==n.indexOf("safari")&&-1===n.indexOf("chrome"))window.open('data:attachment/csv;filename="statements.'+t.extension+'",'+encodeURIComponent(e),"statements."+t.extension);else{const n=new Blob([e],{type:t.type});Object(r.saveAs)(n,"statements"+t.extension)}})).catch((function(e){const t=getError(e);n.error(t,v.instant("common.error"))}))},e.changeRole=t=>{e.resourceInfo.role=t,e.resourceInfo.role===s.RoleType.CONTEXT&&(e.resourceInfo.contextType=a.ContextTypes.EXPLICIT),e.exploreResource()},e.changeInference=t=>{e.resourceInfo.contextType=a.ContextType.getContextType(t),e.exploreResource()},e.copyToClipboardResult=e=>{m.openCopyToClipboardModal(e)};const R=()=>{var n;e.resourceInfo||(e.resourceInfo=new i.ResourceInfo,n=e.resourceInfo,o.prefix&&o.localName&&S[o.prefix]?n.uri=S[o.prefix]+o.localName:t.search().uri?n.uri=t.search().uri+(t.hash()?"#"+t.hash():""):t.search().triple?n.triple=t.search().triple+(t.hash()?"#"+t.hash():""):n.uri=t.absUrl(),n.uri=n.uri&&n.uri.replace(/<|>/g,""),null!=o.context&&(e.resourceInfo.context=o.context),e.resourceInfo.role=t.search().role?t.search().role:s.RoleType.SUBJECT)},I=t=>{e.isLoading=!!t},C=()=>({showEditorTabs:!1,showToolbar:!1,showResultTabs:!1,showResultInfo:!0,downloadAsOn:!1,showQueryButton:!1,componentId:"resource-view-component",prefixes:S,maxPersistentResponseSize:0,render:l.RenderingMode.YASR,showYasqeActionButtons:!1,yasqeActionButtons:c.DISABLE_YASQE_BUTTONS_CONFIGURATION}),T=()=>{b.getGraph(e.resourceInfo).then(t=>{((t={})=>{const n={};angular.extend(n,e.yasguiConfig||C(),t),e.yasguiConfig=n})({sparqlResponse:t})}).catch(e=>{n.error(v.instant("explore.error.resource",{data:getError(e)}))}).finally(()=>{I(!1)})},$=t=>{e.resourceInfo.contextType=t.appSettings.DEFAULT_INFERENCE&&!e.resourceInfo.role===s.RoleType.CONTEXT?a.ContextTypes.ALL:a.ContextTypes.EXPLICIT,e.resourceInfo.sameAs=t.appSettings.DEFAULT_INFERENCE&&t.appSettings.DEFAULT_SAMEAS};e.$on("$destroy",()=>{L.forEach(e=>e())});const L=[];L.push(e.$watch((function(){return e.getActiveRepositoryObject()}),(function(t){t&&Promise.all([x.getPrincipal(),p.getPrefixes(p.getActiveRepository())]).then(([t,n])=>{R(),$(t),S=n,e.loadResource()}).catch(e=>{n.error(v.instant("get.namespaces.error.msg",{error:getError(e)}))})})))}function g(e,t,n,r,i,a,s,l,c,u,d,p){function g(){l.checkAutocompleteStatus().success((function(t){if(!t){const e=Object(o.decodeHTML)(p.instant("explore.autocomplete.warning.msg"));s.warning("",`<div class="autocomplete-toast"><a href="autocomplete">${e}</a></div>`,{allowHtml:!0})}e.autocompleteEnabled=t})).error((function(){s.error(p.instant("explore.error.autocomplete"))}))}function f(){d.getNamespaces(r.getActiveRepository()).success((function(t){e.namespaces=t.results.bindings.map((function(e){return{prefix:e.prefix.value,uri:e.namespace.value}})),e.loader=!1})).error((function(t){const n=getError(t);s.error(n,p.instant("common.error")),e.loader=!1}))}function m(e){const t=e.indexOf("<")>=0&&e.lastIndexOf(">")===e.length-1,n=-1===e.indexOf("<")&&-1===e.lastIndexOf(">"),r=/^<?[http|urn].*>?$/.test(e)&&(t||n);let o=!1;if(r)if(e.indexOf("http")>=0){const t=e.indexOf("//");o=t>4&&e.substring(t+2).length>0}else e.indexOf("urn")>=0&&(o=e.substring(4).length>0);return r&&o}let h,w;function x(t){function r(t){a((function(){e.form&&(e.form.$dirty=t)}))}t||(t=document.getElementById("resources_finder_value").value),t&&m(t)?(r(!1),n.path("resource").search("uri",t)):(r(!0),t&&s.error(p.instant("explore.error.invalid.input")))}e.submit=x,e.getAutocompleteSuggestions=function(t){if(!/<|>/.test(t)&&":"===t.slice(-1)){const n=c.getNamespaceUriForPrefix(e.namespaces,t.slice(0,-1));w=n!==w?n:w,w&&$("#resources_finder_value").val(w)}let n;if(e.autocompleteEnabled){const e=t.replace(w,w+";");n=l.getAutocompleteSuggestions(e)}else n=i.when(e.autocompleteEnabled);return n},e.inputChangedFn=function(){h=document.getElementById("resources_finder_value").value,e.form.$dirty=!(h&&m(h))},e.selectedUriCallback=function(t){e.selectedUri={name:t.title},x(e.selectedUri.name)},e.selectedUri={name:""},e.autocompleteEnabled=!1,angular.isDefined(u.search)&&a((function(){$("#resources_finder_value").val(u.search),$(".search-button").click()}),500),e.getActiveRepository()&&(g(),f()),e.$on("repositoryIsSet",(function(){g(),f()}))}function f(e,t,n,r,o,i,a,s,l,c,u,d){e.uriParam=n.search().uri,e.newRow={subject:e.uriParam,object:{type:"uri",datatype:""}},e.newResource=!1,e.datatypeOptions=l.getDatatypeOptions(),e.activeRepository=function(){return o.getActiveRepository()},e.getClassInstancesDetails=function(){c.getNamespaces(e.activeRepository()).success((function(t){e.namespaces=t.results.bindings.map((function(e){return{prefix:e.prefix.value,uri:e.namespace.value}})),e.loader=!1})).error((function(t){const n=getError(t);r.error(n,u.instant("common.error")),e.loader=!1})),s.getDetails(e.uriParam).success((function(t){e.details=t,e.details.encodeURI=encodeURIComponent(e.details.uri)})).error((function(e){r.error(u.instant("explore.error.resource.details",{data:getError(e)}))})),s.getGraph(e.uriParam).then((function(t){const n=l.buildStatements(t,e.uriParam);e.statements=n,e.newResource=!n.length}))},e.addStatement=function(){e.newRowPredicate.$setSubmitted(),e.newRowObject.$setSubmitted(),e.newRowContext.$setSubmitted(),e.newRowPredicate.$valid&&e.newRowObject.$valid&&e.newRowContext.$valid&&(e.statements.push(_.cloneDeep(e.newRow)),e.newRow={subject:e.uriParam,object:{type:"uri",datatype:""}},e.newRowPredicate.$setPristine(),e.newRowPredicate.$setUntouched(),e.newRowObject.$setPristine(),e.newRowObject.$setUntouched(),e.newRowContext.$setPristine(),e.newRowContext.$setUntouched())},e.removeStatement=function(t){e.statements.splice(t,1)},e.getLocalName=function(e){return s.getLocalName(e)},e.checkValid=function(e){if(!angular.isUndefined(e))return!0;return u.instant("explore.validation")},e.validEditRow=function(){return e.rowform.$valid},e.viewTrig=function(){i.open({templateUrl:"js/angular/explore/templates/viewTrig.html",controller:"ViewTrigCtrl",size:"lg",resolve:{data:function(){return l.transformToTrig(e.statements)}}})},e.save=function(){const o=e.newResource?"POST":"PUT";t({method:o,url:"rest/resource?uri="+encodeURIComponent(e.uriParam),headers:{"Content-Type":"application/x-trig"},data:l.transformToTrig(e.statements)}).success((function(){r.success(u.instant("explore.resource.saved"));const t=a((function(){n.path("resource").search("uri",e.uriParam)}),500);e.$on("$destroy",(function(){a.cancel(t)}))})).error((function(e){r.error(getError(e))}))},e.$watch((function(){return o.getActiveRepository()}),(function(){e.activeRepository()&&e.getClassInstancesDetails()})),e.hasAdminRole=()=>d.isAuthenticated()&&d.hasAdminRole(),e.validateUri=function(t){let n=!0;const r=t||"";if(-1===r.indexOf(":"))n=!1;else{const t=r.substring(0,r.indexOf(":"));if(""===s.getNamespaceUriForPrefix(e.namespaces,t)){!1===/^(http:\/\/www\.|https:\/\/www\.|http:\/\/|https:\/\/)[a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,5}(:[0-9]{1,5})?(\/.*)?$/.test(r)&&(n=!1);const e=r.match(/\//g);(void 0===e||e.length<3)&&(n=!1)}else{r.substring(r.indexOf(":")+1).trim().length<1&&(n=!1)}}return n}}function m(e,t,n){e.trig=n,e.cancel=function(){t.dismiss("cancel")}}angular.module("graphdb.framework.explore.controllers",["ngCookies","ngRoute","ui.bootstrap","toastr","graphdb.framework.core","graphdb.framework.core.services.repositories","graphdb.framework.explore.services","graphdb.workbench.utils.filetypes","graphdb.framework.rest.explore.rest.service"]).controller("FindResourceCtrl",g).controller("ExploreCtrl",p).controller("EditResourceCtrl",f).controller("ViewTrigCtrl",m),p.$inject=["$scope","$location","toastr","$routeParams","$repositories","$uibModal","ClassInstanceDetailsService","ModalService","RDF4JRepositoriesRestService","FileTypes","$jwtAuth","$translate","$q","ExploreRestService"],g.$inject=["$scope","$http","$location","$repositories","$q","$timeout","toastr","AutocompleteRestService","ClassInstanceDetailsService","$routeParams","RDF4JRepositoriesRestService","$translate"],f.$inject=["$scope","$http","$location","toastr","$repositories","$uibModal","$timeout","ClassInstanceDetailsService","StatementsService","RDF4JRepositoriesRestService","$translate","$jwtAuth"],m.$inject=["$scope","$uibModalInstance","data"]},170:function(e,t,n){"use strict";n.r(t);n(32);angular.module("graphdb.framework.explore.directives",["graphdb.framework.utils.uriutils"]).directive("uri",["UriUtils",function(e){return{require:"ngModel",link:function(t,n,r,o){o.$parsers.unshift((function(t){if(!angular.isUndefined(t)&&t.length>0){const n=e.validateRdfUri(t);return o.$setValidity("searchStr",n),n?t:void 0}return o.$setValidity("searchStr",!0),t})),o.$formatters.unshift((function(t){return angular.isUndefined(t)||o.$setValidity("searchStr",e.validateRdfUri),t}))}}}])},259:function(e,t,n){"use strict";n.r(t);n(7),n(28),n(168),n(169),n(170),n(553),n(700),n(161),n(93);angular.module("graphdb.framework.explore",["ngRoute","toastr","xeditable","angucomplete-alt-onto","graphdb.framework.explore.services","graphdb.framework.explore.controllers","graphdb.framework.explore.directives","graphdb.framework.core.directives.fittext","graphdb.framework.core.directives.yasgui-component"])},550:function(e,t){},67:function(e,t,n){"use strict";n.r(t),n.d(t,"RenderingMode",(function(){return r}));const r={YASGUI:"mode-yasgui",YASQE:"mode-yasqe",YASR:"mode-yasr"}},700:function(e,t){
2
2
  /*! Copyright (c) 2014 Hidenari Nozaki and contributors | Licensed under the MIT license */
3
- !function(e,t){"use strict";!function(e){e.module("angucomplete-alt-onto",[]).directive("angucompleteAltOnto",["$q","$parse","$http","$sce","$timeout","$templateCache","$interpolate","$rootScope",function(e,t,n,r,o,i,a,s){function l(t,i,a,s){var l,c,u,d,p,g,f=i.find("input"),m=3,h=null,w="autocomplete-required",x=null,v=null,y=i[0].querySelector(".angucomplete-dropdown"),b=!1,S=null;function R(e,n){e&&("object"==typeof e?(t.uri=$(e),T({originalObject:e})):"string"==typeof e&&e.length>0?t.uri=e:console&&console.error&&console.error("Tried to set "+(n?"initial":"")+" value of angucomplete to",e,"which is an invalid value"),j(!0))}function I(e){S=null,t.hideResults(e),document.body.removeEventListener("click",I)}function C(e){return e.which?e.which:e.keyCode}function T(e){"function"==typeof t.selectedObject?t.selectedObject(e):t.selectedObject=e,j(!!e)}function $(e){return t.titleField.split(",").map((function(t){return L(e,t)})).join(" ")}function L(e,t){var n,r;if(t){n=t.split("."),r=e;for(var o=0;o<n.length;o++)r=r[n[o]]}else r=e;return r}function O(e,n){var o,i,a;if(a=new RegExp(n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"i"),e)return e.match&&e.replace||(e=e.toString()),o=(i=e.match(a))?e.replace(a,'<span class="'+t.matchClass+'">'+i[0]+"</span>"):e,r.trustAsHtml(o)}function j(e){t.notEmpty=e,x=t.uri,t.fieldRequired&&s&&t.inputName&&s[t.inputName].$setValidity(w,e)}function E(e){!t.overrideSuggestions||t.selectedObject&&t.selectedObject.originalObject===t.uri||(e&&e.preventDefault(),o.cancel(h),k(),T({originalObject:t.uri}),t.clearSelected&&(t.uri=null),P())}function D(){return i[0].querySelectorAll(".angucomplete-row")[t.currentIndex]}function A(e){y.scrollTop=y.scrollTop+e}function U(){var e=t.results[t.currentIndex];if(t.matchClass){var n=$(e.originalObject);n=n.replace(/<b>|<\/b>/g,""),f.val(n)}else f.val(e.title)}function N(e){return function(n,r,o,i){r||o||i||!n.data||(n=n.data),t.searching=!1,B(L(c(n),t.remoteUrlDataField),e)}}function M(e,n,r,o){0!==n&&-1!==n&&(n||r||o||(n=e.status),t.remoteUrlErrorCallback?t.remoteUrlErrorCallback(e,n,r,o):console&&console.error&&console.error("http error"))}function k(){v&&v.resolve()}function F(r){var o={},i=t.remoteUrl+encodeuriComponent(r);t.remoteUrlRequestFormatter&&(o={params:t.remoteUrlRequestFormatter(r)},i=t.remoteUrl),t.remoteUrlRequestWithCredentials&&(o.withCredentials=!0),k(),v=e.defer(),o.timeout=v.promise,n.get(i,o).success(N(r)).error(M)}function X(n){k(),v=e.defer(),t.remoteApiHandler(n,v.promise).then(N(n)).catch(M)}function P(){t.showDropdown=!1,t.results=[],y&&(y.scrollTop=0)}function q(){t.showDropdown=d,t.currentIndex=t.focusFirst?0:-1,t.results=[]}function J(e){!e||e.length<m||(t.localData?t.$apply((function(){var n;n=void 0!==t.localSearch()?t.localSearch()(e):function(e){var n,r,o,i,a=t.searchFields.split(","),s=[];for(void 0!==t.parseInput()&&(e=t.parseInput()(e)),n=0;n<t.localData.length;n++){for(r=!1,o=0;o<a.length;o++)i=L(t.localData[n],a[o])||"",r=r||i.toString().toLowerCase().indexOf(e.toString().toLowerCase())>=0;r&&(s[s.length]=t.localData[n])}return s}(e),t.searching=!1,B(n,e)})):t.remoteApiHandler?X(e):F(e))}function B(e,n){var r,o,i,a,s,l;if(e&&e.length>0)for(t.results=[],r=0;r<e.length;r++)t.titleField&&""!==t.titleField&&(a=s=$(e[r])),o="",t.descriptionField&&(o=l=L(e[r],t.descriptionField)),i="",t.imageField&&(i=L(e[r],t.imageField)),t.matchClass&&(s=O(a,n),l=O(o,n)),t.results[t.results.length]={title:s,description:l,image:i,originalObject:e[r]};else t.results=[];t.autoMatch&&1===t.results.length&&function(e,n,r){if(!r)return!1;for(var o in n)if(n[o].toLowerCase()===r.toLowerCase())return t.selectResult(e),!0;return!1}(t.results[0],{title:a,desc:o||""},t.uri)?t.showDropdown=!1:0!==t.results.length||p?t.showDropdown=!0:t.showDropdown=!1}function _(){t.localData?B(t.localData,""):t.remoteApiHandler?X(""):F("")}i.on("mousedown",(function(e){e.target.id?(S=e.target.id)===t.id+"_dropdown"&&document.body.addEventListener("click",I):S=e.target.className})),t.currentIndex=t.focusFirst?0:null,t.searching=!1,u=t.$watch("initialValue",(function(e){e&&(u(),R(e,!0))})),t.$watch("fieldRequired",(function(e,n){e!==n&&(e?x&&-1!==t.currentIndex?j(!0):j(!1):s[t.inputName].$setValidity(w,!0))})),t.$on("angucomplete-alt:clearInput",(function(e,n){n&&n!==t.id||(t.uri=null,T(),j(!1),P())})),t.$on("angucomplete-alt:changeInput",(function(e,n,r){n&&n===t.id&&R(r)})),t.onFocusHandler=function(){t.focusIn&&t.focusIn(),0!==m||t.uri&&0!==t.uri.length||(t.currentIndex=t.focusFirst?0:t.currentIndex,t.showDropdown=!0,_())},t.hideResults=function(){S&&(S===t.id+"_dropdown"||S.indexOf("angucomplete")>=0)?S=null:(l=o((function(){P(),t.$apply((function(){t.uri&&t.uri.length>0&&f.val(t.uri)}))}),200),k(),t.focusOut&&t.focusOut(),t.overrideSuggestions&&t.uri&&t.uri.length>0&&-1===t.currentIndex&&E())},t.resetHideResults=function(){l&&o.cancel(l)},t.hoverRow=function(e){t.currentIndex=e},t.selectResult=function(e){t.matchClass&&(e.title=$(e.originalObject),"string"==typeof e.title&&(e.title=e.title.replace(/<b>|<\/b>/g,"")),e.description=L(e.originalObject,t.descriptionField)),t.clearSelected?t.uri=null:t.uri=e.title,T(e),P()},t.inputChangeHandler=function(e){return e.length<m?(k(),P()):0===e.length&&0===m&&(t.searching=!1,_()),t.inputChanged&&(e=t.inputChanged(e)),e},t.fieldRequiredClass&&""!==t.fieldRequiredClass&&(w=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&&s&&(t.initialValue?j(!0):j(!1)),t.inputType=a.type?a.type:"text",t.textSearching=a.textSearching?a.textSearching:"Searching...",t.textNoResults=a.textNoResults?a.textNoResults:"No results found",d="false"!==t.textSearching,p="false"!==t.textNoResults,t.maxlength=a.maxlength?a.maxlength:524288,f.on("keydown",(function(e){var n=C(e),r=null,o=null;13===n&&t.results?(t.currentIndex>=0&&t.currentIndex<t.results.length?(e.preventDefault(),t.selectResult(t.results[t.currentIndex])):(E(e),P()),t.$apply()):40===n&&t.results?(e.preventDefault(),t.currentIndex+1<t.results.length&&t.showDropdown&&(t.$apply((function(){t.currentIndex++,U()})),b&&(r=D(),y.getBoundingClientRect().top+parseInt(getComputedStyle(y).maxHeight,10)<r.getBoundingClientRect().bottom&&A(function(e){var t=getComputedStyle(e);return e.offsetHeight+parseInt(t.marginTop,10)+parseInt(t.marginBottom,10)}(r))))):38===n&&t.results?(e.preventDefault(),t.currentIndex>=1?(t.$apply((function(){t.currentIndex--,U()})),b&&(o=D().getBoundingClientRect().top-(y.getBoundingClientRect().top+parseInt(getComputedStyle(y).paddingTop,10)))<0&&A(o-1)):0===t.currentIndex&&t.$apply((function(){t.currentIndex=-1,f.val(t.uri)}))):9===n?t.results&&t.results.length>0&&t.showDropdown?-1===t.currentIndex&&t.overrideSuggestions?E():(-1===t.currentIndex&&(t.currentIndex=0),t.selectResult(t.results[t.currentIndex]),t.$digest()):t.uri&&t.uri.length>0&&E():27===n&&e.preventDefault()})),f.on("keyup",(function(e){var n=C(e);if(37!==n&&39!==n)if(38===n||13===n)e.preventDefault();else if(40===n)e.preventDefault(),!t.showDropdown&&t.uri&&t.uri.length>=m&&(q(),t.searching=!0,J(t.uri));else if(27===n)P(),t.$apply((function(){f.val(t.uri)}));else{if(0===m&&!t.uri)return;t.uri&&""!==t.uri?t.uri.length>=m&&(q(),h&&o.cancel(h),t.searching=!0,h=o((function(){J(t.uri)}),t.pause)):t.showDropdown=!1,x&&x!==t.uri&&!t.clearSelected&&t.$apply((function(){T()}))}})),g="remoteUrlResponseFormatter",c=function(e){return t[g]?t[g](e):e},o((function(){var e=getComputedStyle(y);b=e.maxHeight&&"auto"===e.overflowY}))}return i.put("/angucomplete-alt/index.html",'<div class="angucomplete-holder" ng-class="{\'angucomplete-dropdown-visible\': showDropdown}"> <input id="{{id}}_value" name="{{inputName}}" tabindex="{{fieldTabindex}}" ng-class="{\'angucomplete-input-not-empty\': notEmpty}" ng-model="uri" 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(uri)" style="overflow: hidden; padding-right: .5em;"/> <div id="{{id}}_dropdown" class="angucomplete-dropdown" ng-show="disableSuggestions && 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:"=",disableInput:"=",disableSuggestions:"=",initialValue:"=",localData:"=",localSearch:"&",remoteUrlRequestFormatter:"=",remoteUrlRequestWithCredentials:"@",remoteUrlResponseFormatter:"=",remoteUrlErrorCallback:"=",remoteApiHandler:"=",id:"@",type:"@",placeholder:"@",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=a.startSymbol(),n=a.endSymbol();if("{{"!==t||"}}"!==n){var r=e.html().replace(/\{\{/g,t).replace(/\}\}/g,n);e.html(r)}return l}}}])}(window.angular)}()},84:function(e,t,n){"use strict";n.r(t),n.d(t,"ContextType",(function(){return r})),n.d(t,"ContextTypes",(function(){return o}));class r{constructor(e,t){this.id=e,this.labelKey=t}static getAllType(){return[o.ALL,o.EXPLICIT,o.IMPLICIT]}static getContextType(e){return this.getAllType().find(t=>t.id===e)}}const o={ALL:new r("all","explore.explicit.implicit"),EXPLICIT:new r("explicit","explore.explicit"),IMPLICIT:new r("implicit","explore.implicit")}},98:function(e,t){angular.module("graphdb.workbench.utils.filetypes",[]).value("FileTypes",[{name:"JSON",translateKey:"download.as.json",type:"application/rdf+json",extension:".json"},{name:"JSON-LD",translateKey:"download.as.jsonld",type:"application/ld+json",extension:".jsonld"},{name:"NDJSON-LD",translateKey:"download.as.ndjsonld",type:"application/x-ld+ndjson",extension:".ndjsonld"},{name:"RDF-XML",translateKey:"download.as.rdfxml",type:"application/rdf+xml",extension:".rdf"},{name:"N3",translateKey:"download.as.n3",type:"text/rdf+n3",extension:".n3"},{name:"N-Triples",translateKey:"download.as.ntriples",type:"text/plain",extension:".nt"},{name:"N-Quads",translateKey:"download.as.nquads",type:"text/x-nquads",extension:".nq"},{name:"Turtle",translateKey:"download.as.turtle",type:"text/turtle",extension:".ttl"},{name:"Turtle*",translateKey:"download.as.turtlestar",type:"application/x-turtlestar",extension:".ttls"},{name:"TriX",translateKey:"download.as.trix",type:"application/trix",extension:".trix"},{name:"TriG",translateKey:"download.as.trig",type:"application/x-trig",extension:".trig"},{name:"TriG*",translateKey:"download.as.trigstar",type:"application/x-trigstar",extension:".trigs"},{name:"Binary RDF",translateKey:"download.as.binaryrdf",type:"application/x-binary-rdf",extension:".brf"}])},99:function(e,t,n){"use strict";n.r(t),n.d(t,"ResourceDetails",(function(){return r}));class r{constructor(){this.image=void 0,this.uri=void 0,this.label=void 0,this.encodeURI=void 0,this.comment=void 0,this.context=void 0}}}}]);
3
+ !function(e,t){"use strict";!function(e){e.module("angucomplete-alt-onto",[]).directive("angucompleteAltOnto",["$q","$parse","$http","$sce","$timeout","$templateCache","$interpolate","$rootScope",function(e,t,n,r,o,i,a,s){function l(t,i,a,s){var l,c,u,d,p,g,f=i.find("input"),m=3,h=null,w="autocomplete-required",x=null,v=null,y=i[0].querySelector(".angucomplete-dropdown"),b=!1,S=null;function R(e,n){e&&("object"==typeof e?(t.uri=$(e),T({originalObject:e})):"string"==typeof e&&e.length>0?t.uri=e:console&&console.error&&console.error("Tried to set "+(n?"initial":"")+" value of angucomplete to",e,"which is an invalid value"),j(!0))}function I(e){S=null,t.hideResults(e),document.body.removeEventListener("click",I)}function C(e){return e.which?e.which:e.keyCode}function T(e){"function"==typeof t.selectedObject?t.selectedObject(e):t.selectedObject=e,j(!!e)}function $(e){return t.titleField.split(",").map((function(t){return L(e,t)})).join(" ")}function L(e,t){var n,r;if(t){n=t.split("."),r=e;for(var o=0;o<n.length;o++)r=r[n[o]]}else r=e;return r}function O(e,n){var o,i,a;if(a=new RegExp(n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"i"),e)return e.match&&e.replace||(e=e.toString()),o=(i=e.match(a))?e.replace(a,'<span class="'+t.matchClass+'">'+i[0]+"</span>"):e,r.trustAsHtml(o)}function j(e){t.notEmpty=e,x=t.uri,t.fieldRequired&&s&&t.inputName&&s[t.inputName].$setValidity(w,e)}function E(e){!t.overrideSuggestions||t.selectedObject&&t.selectedObject.originalObject===t.uri||(e&&e.preventDefault(),o.cancel(h),k(),T({originalObject:t.uri}),t.clearSelected&&(t.uri=null),P())}function A(){return i[0].querySelectorAll(".angucomplete-row")[t.currentIndex]}function D(e){y.scrollTop=y.scrollTop+e}function U(){var e=t.results[t.currentIndex];if(t.matchClass){var n=$(e.originalObject);n=n.replace(/<b>|<\/b>/g,""),f.val(n)}else f.val(e.title)}function N(e){return function(n,r,o,i){r||o||i||!n.data||(n=n.data),t.searching=!1,B(L(c(n),t.remoteUrlDataField),e)}}function M(e,n,r,o){0!==n&&-1!==n&&(n||r||o||(n=e.status),t.remoteUrlErrorCallback?t.remoteUrlErrorCallback(e,n,r,o):console&&console.error&&console.error("http error"))}function k(){v&&v.resolve()}function F(r){var o={},i=t.remoteUrl+encodeuriComponent(r);t.remoteUrlRequestFormatter&&(o={params:t.remoteUrlRequestFormatter(r)},i=t.remoteUrl),t.remoteUrlRequestWithCredentials&&(o.withCredentials=!0),k(),v=e.defer(),o.timeout=v.promise,n.get(i,o).success(N(r)).error(M)}function X(n){k(),v=e.defer(),t.remoteApiHandler(n,v.promise).then(N(n)).catch(M)}function P(){t.showDropdown=!1,t.results=[],y&&(y.scrollTop=0)}function q(){t.showDropdown=d,t.currentIndex=t.focusFirst?0:-1,t.results=[]}function J(e){!e||e.length<m||(t.localData?t.$apply((function(){var n;n=void 0!==t.localSearch()?t.localSearch()(e):function(e){var n,r,o,i,a=t.searchFields.split(","),s=[];for(void 0!==t.parseInput()&&(e=t.parseInput()(e)),n=0;n<t.localData.length;n++){for(r=!1,o=0;o<a.length;o++)i=L(t.localData[n],a[o])||"",r=r||i.toString().toLowerCase().indexOf(e.toString().toLowerCase())>=0;r&&(s[s.length]=t.localData[n])}return s}(e),t.searching=!1,B(n,e)})):t.remoteApiHandler?X(e):F(e))}function B(e,n){var r,o,i,a,s,l;if(e&&e.length>0)for(t.results=[],r=0;r<e.length;r++)t.titleField&&""!==t.titleField&&(a=s=$(e[r])),o="",t.descriptionField&&(o=l=L(e[r],t.descriptionField)),i="",t.imageField&&(i=L(e[r],t.imageField)),t.matchClass&&(s=O(a,n),l=O(o,n)),t.results[t.results.length]={title:s,description:l,image:i,originalObject:e[r]};else t.results=[];t.autoMatch&&1===t.results.length&&function(e,n,r){if(!r)return!1;for(var o in n)if(n[o].toLowerCase()===r.toLowerCase())return t.selectResult(e),!0;return!1}(t.results[0],{title:a,desc:o||""},t.uri)?t.showDropdown=!1:0!==t.results.length||p?t.showDropdown=!0:t.showDropdown=!1}function _(){t.localData?B(t.localData,""):t.remoteApiHandler?X(""):F("")}i.on("mousedown",(function(e){e.target.id?(S=e.target.id)===t.id+"_dropdown"&&document.body.addEventListener("click",I):S=e.target.className})),t.currentIndex=t.focusFirst?0:null,t.searching=!1,u=t.$watch("initialValue",(function(e){e&&(u(),R(e,!0))})),t.$watch("fieldRequired",(function(e,n){e!==n&&(e?x&&-1!==t.currentIndex?j(!0):j(!1):s[t.inputName].$setValidity(w,!0))})),t.$on("angucomplete-alt:clearInput",(function(e,n){n&&n!==t.id||(t.uri=null,T(),j(!1),P())})),t.$on("angucomplete-alt:changeInput",(function(e,n,r){n&&n===t.id&&R(r)})),t.onFocusHandler=function(){t.focusIn&&t.focusIn(),0!==m||t.uri&&0!==t.uri.length||(t.currentIndex=t.focusFirst?0:t.currentIndex,t.showDropdown=!0,_())},t.hideResults=function(){S&&(S===t.id+"_dropdown"||S.indexOf("angucomplete")>=0)?S=null:(l=o((function(){P(),t.$apply((function(){t.uri&&t.uri.length>0&&f.val(t.uri)}))}),200),k(),t.focusOut&&t.focusOut(),t.overrideSuggestions&&t.uri&&t.uri.length>0&&-1===t.currentIndex&&E())},t.resetHideResults=function(){l&&o.cancel(l)},t.hoverRow=function(e){t.currentIndex=e},t.selectResult=function(e){t.matchClass&&(e.title=$(e.originalObject),"string"==typeof e.title&&(e.title=e.title.replace(/<b>|<\/b>/g,"")),e.description=L(e.originalObject,t.descriptionField)),t.clearSelected?t.uri=null:t.uri=e.title,T(e),P()},t.inputChangeHandler=function(e){return e.length<m?(k(),P()):0===e.length&&0===m&&(t.searching=!1,_()),t.inputChanged&&(e=t.inputChanged(e)),e},t.fieldRequiredClass&&""!==t.fieldRequiredClass&&(w=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&&s&&(t.initialValue?j(!0):j(!1)),t.inputType=a.type?a.type:"text",t.textSearching=a.textSearching?a.textSearching:"Searching...",t.textNoResults=a.textNoResults?a.textNoResults:"No results found",d="false"!==t.textSearching,p="false"!==t.textNoResults,t.maxlength=a.maxlength?a.maxlength:524288,f.on("keydown",(function(e){var n=C(e),r=null,o=null;13===n&&t.results?(t.currentIndex>=0&&t.currentIndex<t.results.length?(e.preventDefault(),t.selectResult(t.results[t.currentIndex])):(E(e),P()),t.$apply()):40===n&&t.results?(e.preventDefault(),t.currentIndex+1<t.results.length&&t.showDropdown&&(t.$apply((function(){t.currentIndex++,U()})),b&&(r=A(),y.getBoundingClientRect().top+parseInt(getComputedStyle(y).maxHeight,10)<r.getBoundingClientRect().bottom&&D(function(e){var t=getComputedStyle(e);return e.offsetHeight+parseInt(t.marginTop,10)+parseInt(t.marginBottom,10)}(r))))):38===n&&t.results?(e.preventDefault(),t.currentIndex>=1?(t.$apply((function(){t.currentIndex--,U()})),b&&(o=A().getBoundingClientRect().top-(y.getBoundingClientRect().top+parseInt(getComputedStyle(y).paddingTop,10)))<0&&D(o-1)):0===t.currentIndex&&t.$apply((function(){t.currentIndex=-1,f.val(t.uri)}))):9===n?t.results&&t.results.length>0&&t.showDropdown?-1===t.currentIndex&&t.overrideSuggestions?E():(-1===t.currentIndex&&(t.currentIndex=0),t.selectResult(t.results[t.currentIndex]),t.$digest()):t.uri&&t.uri.length>0&&E():27===n&&e.preventDefault()})),f.on("keyup",(function(e){var n=C(e);if(37!==n&&39!==n)if(38===n||13===n)e.preventDefault();else if(40===n)e.preventDefault(),!t.showDropdown&&t.uri&&t.uri.length>=m&&(q(),t.searching=!0,J(t.uri));else if(27===n)P(),t.$apply((function(){f.val(t.uri)}));else{if(0===m&&!t.uri)return;t.uri&&""!==t.uri?t.uri.length>=m&&(q(),h&&o.cancel(h),t.searching=!0,h=o((function(){J(t.uri)}),t.pause)):t.showDropdown=!1,x&&x!==t.uri&&!t.clearSelected&&t.$apply((function(){T()}))}})),g="remoteUrlResponseFormatter",c=function(e){return t[g]?t[g](e):e},o((function(){var e=getComputedStyle(y);b=e.maxHeight&&"auto"===e.overflowY}))}return i.put("/angucomplete-alt/index.html",'<div class="angucomplete-holder" ng-class="{\'angucomplete-dropdown-visible\': showDropdown}"> <input id="{{id}}_value" name="{{inputName}}" tabindex="{{fieldTabindex}}" ng-class="{\'angucomplete-input-not-empty\': notEmpty}" ng-model="uri" 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(uri)" style="overflow: hidden; padding-right: .5em;"/> <div id="{{id}}_dropdown" class="angucomplete-dropdown" ng-show="disableSuggestions && 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:"=",disableInput:"=",disableSuggestions:"=",initialValue:"=",localData:"=",localSearch:"&",remoteUrlRequestFormatter:"=",remoteUrlRequestWithCredentials:"@",remoteUrlResponseFormatter:"=",remoteUrlErrorCallback:"=",remoteApiHandler:"=",id:"@",type:"@",placeholder:"@",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=a.startSymbol(),n=a.endSymbol();if("{{"!==t||"}}"!==n){var r=e.html().replace(/\{\{/g,t).replace(/\}\}/g,n);e.html(r)}return l}}}])}(window.angular)}()},84:function(e,t,n){"use strict";n.r(t),n.d(t,"ContextType",(function(){return r})),n.d(t,"ContextTypes",(function(){return o}));class r{constructor(e,t){this.id=e,this.labelKey=t}static getAllType(){return[o.ALL,o.EXPLICIT,o.IMPLICIT]}static getContextType(e){return this.getAllType().find(t=>t.id===e)}}const o={ALL:new r("all","explore.explicit.implicit"),EXPLICIT:new r("explicit","explore.explicit"),IMPLICIT:new r("implicit","explore.implicit")}},98:function(e,t){angular.module("graphdb.workbench.utils.filetypes",[]).value("FileTypes",[{name:"JSON",translateKey:"download.as.json",type:"application/rdf+json",extension:".json"},{name:"JSON-LD",translateKey:"download.as.jsonld",type:"application/ld+json",extension:".jsonld"},{name:"NDJSON-LD",translateKey:"download.as.ndjsonld",type:"application/x-ld+ndjson",extension:".ndjsonld"},{name:"RDF-XML",translateKey:"download.as.rdfxml",type:"application/rdf+xml",extension:".rdf"},{name:"N3",translateKey:"download.as.n3",type:"text/rdf+n3",extension:".n3"},{name:"N-Triples",translateKey:"download.as.ntriples",type:"text/plain",extension:".nt"},{name:"N-Quads",translateKey:"download.as.nquads",type:"text/x-nquads",extension:".nq"},{name:"Turtle",translateKey:"download.as.turtle",type:"text/turtle",extension:".ttl"},{name:"Turtle*",translateKey:"download.as.turtlestar",type:"application/x-turtlestar",extension:".ttls"},{name:"TriX",translateKey:"download.as.trix",type:"application/trix",extension:".trix"},{name:"TriG",translateKey:"download.as.trig",type:"application/x-trig",extension:".trig"},{name:"TriG*",translateKey:"download.as.trigstar",type:"application/x-trigstar",extension:".trigs"},{name:"Binary RDF",translateKey:"download.as.binaryrdf",type:"application/x-binary-rdf",extension:".brf"}])},99:function(e,t,n){"use strict";n.r(t),n.d(t,"ResourceDetails",(function(){return r}));class r{constructor(){this.image=void 0,this.uri=void 0,this.label=void 0,this.encodeURI=void 0,this.comment=void 0,this.context=void 0}}}}]);
@@ -1,2 +1,2 @@
1
- (window.webpackJsonp=window.webpackJsonp||[]).push([[19,55,110,193,208,209,211,247,269],{122:function(e,t){angular.module("graphdb.framework.rest.explore.rest.service",[]).factory("ExploreRestService",n),n.$inject=["$http"];function n(e){return{getResourceDetails:(t,n,o,r)=>e.get("rest/explore/details",{params:{uri:t,triple:n,context:o},headers:{Accept:r||"application/json"}}),getGraph:(t,n,o)=>e.get("rest/explore/graph",{params:{uri:t.uri,triple:t.triple,inference:t.contextType.id,role:t.role,bnodes:t.blanks,sameAs:t.sameAs,context:t.context},headers:{Accept:n||"application/x-graphdb-table-results+json",Link:o?"<"+o+">":""}}).then(e=>e.data)}}},123:function(e,t,n){"use strict";n.r(t),n.d(t,"ResourceInfo",(function(){return s}));var o=n(99),r=n(84);class s{constructor(){this.role="subject",this.uri=void 0,this.triple=void 0,this.context=void 0,this.contextType=r.ContextTypes.EXPLICIT,this.sameAs=!0,this.details=new o.ResourceDetails,this.blanks=!0}}},124:function(e,t,n){"use strict";n.r(t),n.d(t,"RoleType",(function(){return o}));const o={SUBJECT:"subject",PREDICATE:"predicate",OBJECT:"object",CONTEXT:"context",ALL:"all"}},169:function(e,t,n){"use strict";n.r(t);n(98),n(122);var o=n(465),r=n(0),s=n(123),a=n(84),i=n(124),c=n(67),l=n(14),u=n(545),p=n(88);function d(e,t,n,r,d,f,m,g,x,w,h,y,R,S){let T;e.ContextTypes=a.ContextTypes,e.contextTypes=a.ContextType.getAllType(),e.currentContextTypeId=a.ContextTypes.EXPLICIT.id,e.roles=[i.RoleType.SUBJECT,i.RoleType.PREDICATE,i.RoleType.OBJECT,i.RoleType.CONTEXT,i.RoleType.ALL],e.resourceInfo=void 0,e.isLoading=!1,e.fileTypes=w,e.toggleSameAs=()=>{e.resourceInfo.sameAs=!e.resourceInfo.sameAs,e.exploreResource()},e.getActiveRepository=()=>d.getActiveRepository(),e.isTripleResource=()=>!!e.resourceInfo.triple,e.encodeURIComponent=e=>encodeURIComponent(e),e.getRdfStarLocalNames=e=>{let t=e.slice();return e.replace(/[<>]+/g,"").split(" ").forEach(e=>{t=t.replace(e,m.getLocalName(e))}),t},e.getLocalName=e=>m.getLocalName(e);e.loadResource=()=>{S.getResourceDetails(e.resourceInfo.uri,e.resourceInfo.triple,e.resourceInfo.context).success(t=>{e.resourceInfo.details=t,e.resourceInfo.context=e.resourceInfo.details.context,"object"!==e.resourceInfo.uri&&(e.resourceInfo.details.encodeURI=encodeURIComponent(e.resourceInfo.details.uri))}).error(e=>n.error(y.instant("explore.error.resource.details",{data:getError(e)}))),e.exploreResource()},e.isContextAvailable=()=>null!==e.resourceInfo.context&&"http://rdf4j.org/schema/rdf4j#SHACLShapeGraph"===e.resourceInfo.context,e.goToGraphsViz=()=>{t.path("graphs-visualizations").search("uri",e.resourceInfo.uri)},e.exploreResource=()=>{I(!0),null!=r.context&&(e.resourceInfo.context=r.context),t.search("role",e.resourceInfo.role),t.replace(),O()},e.downloadExport=t=>{S.getGraph(e.resourceInfo,t.type).then(e=>{t.type.indexOf("json")>-1&&(e=JSON.stringify(e));const n=navigator.userAgent.toLowerCase();if(-1!==n.indexOf("safari")&&-1===n.indexOf("chrome"))window.open('data:attachment/csv;filename="statements.'+t.extension+'",'+encodeURIComponent(e),"statements."+t.extension);else{const n=new Blob([e],{type:t.type});Object(o.saveAs)(n,"statements"+t.extension)}}).catch(e=>{n.error(getError(e),y.instant("common.error"))}).finally(()=>{I(!1)})},e.openJSONLDExportSettings=function(t){f.open({templateUrl:"js/angular/core/components/export-settings-modal/exportSettingsModal.html",controller:p.ExportSettingsCtrl,size:"lg",scope:e,resolve:{format:function(){return t.name}}}).result.then((function(n){e.downloadJSONLDExport(t,n.link,n.currentMode)}))},e.downloadJSONLDExport=function(t,r,s){S.getGraph(e.resourceInfo,t.type,r).then((async function(e){if("JSON"===t.name&&(e=JSON.stringify(e)),"JSON-LD"===t.name)switch(s.name){case"expanded":e=await u.expand(e),e=JSON.stringify(e);break;case"flattened":e=await u.flatten(e,r),e=JSON.stringify(e);break;case"compacted":e=await u.compact(e,r),e=JSON.stringify(e);break;case"context":e=await u.context(e,r),e=JSON.stringify(e);break;case"frame":e=await u.frame(e,r),e=JSON.stringify(e);break;case"framed":e=await u.compact(e,r),e=JSON.stringify(e)}const n=navigator.userAgent.toLowerCase();if(-1!==n.indexOf("safari")&&-1===n.indexOf("chrome"))window.open('data:attachment/csv;filename="statements.'+t.extension+'",'+encodeURIComponent(e),"statements."+t.extension);else{const n=new Blob([e],{type:t.type});Object(o.saveAs)(n,"statements"+t.extension)}})).catch((function(e){const t=getError(e);n.error(t,y.instant("common.error"))}))},e.changeRole=t=>{e.resourceInfo.role=t,e.resourceInfo.role===i.RoleType.CONTEXT&&(e.resourceInfo.contextType=a.ContextTypes.EXPLICIT),e.exploreResource()},e.changeInference=t=>{e.resourceInfo.contextType=a.ContextType.getContextType(t),e.exploreResource()},e.copyToClipboardResult=e=>{g.openCopyToClipboardModal(e)};const v=()=>{var n;e.resourceInfo||(e.resourceInfo=new s.ResourceInfo,n=e.resourceInfo,r.prefix&&r.localName&&T[r.prefix]?n.uri=T[r.prefix]+r.localName:t.search().uri?n.uri=t.search().uri+(t.hash()?"#"+t.hash():""):t.search().triple?n.triple=t.search().triple+(t.hash()?"#"+t.hash():""):n.uri=t.absUrl(),n.uri=n.uri&&n.uri.replace(/<|>/g,""),null!=r.context&&(e.resourceInfo.context=r.context),e.resourceInfo.role=t.search().role?t.search().role:i.RoleType.SUBJECT)},I=t=>{e.isLoading=!!t},b=()=>({showEditorTabs:!1,showToolbar:!1,showResultTabs:!1,showResultInfo:!0,downloadAsOn:!1,showQueryButton:!1,componentId:"resource-view-component",prefixes:T,maxPersistentResponseSize:0,render:c.RenderingMode.YASR,showYasqeActionButtons:!1,yasqeActionButtons:l.DISABLE_YASQE_BUTTONS_CONFIGURATION}),O=()=>{S.getGraph(e.resourceInfo).then(t=>{((t={})=>{const n={};angular.extend(n,e.yasguiConfig||b(),t),e.yasguiConfig=n})({sparqlResponse:t})}).catch(e=>{n.error(y.instant("explore.error.resource",{data:getError(e)}))}).finally(()=>{I(!1)})},E=t=>{e.resourceInfo.contextType=t.appSettings.DEFAULT_INFERENCE&&!e.resourceInfo.role===i.RoleType.CONTEXT?a.ContextTypes.ALL:a.ContextTypes.EXPLICIT,e.resourceInfo.sameAs=t.appSettings.DEFAULT_INFERENCE&&t.appSettings.DEFAULT_SAMEAS};e.$on("$destroy",()=>{N.forEach(e=>e())});const N=[];N.push(e.$watch((function(){return e.getActiveRepositoryObject()}),(function(t){t&&Promise.all([h.getPrincipal(),d.getPrefixes(d.getActiveRepository())]).then(([t,n])=>{v(),E(t),T=n,e.loadResource()}).catch(e=>{n.error(y.instant("get.namespaces.error.msg",{error:getError(e)}))})})))}function f(e,t,n,o,s,a,i,c,l,u,p,d){function f(){c.checkAutocompleteStatus().success((function(t){if(!t){const e=Object(r.decodeHTML)(d.instant("explore.autocomplete.warning.msg"));i.warning("",`<div class="autocomplete-toast"><a href="autocomplete">${e}</a></div>`,{allowHtml:!0})}e.autocompleteEnabled=t})).error((function(){i.error(d.instant("explore.error.autocomplete"))}))}function m(){p.getNamespaces(o.getActiveRepository()).success((function(t){e.namespaces=t.results.bindings.map((function(e){return{prefix:e.prefix.value,uri:e.namespace.value}})),e.loader=!1})).error((function(t){const n=getError(t);i.error(n,d.instant("common.error")),e.loader=!1}))}function g(e){const t=e.indexOf("<")>=0&&e.lastIndexOf(">")===e.length-1,n=-1===e.indexOf("<")&&-1===e.lastIndexOf(">"),o=/^<?[http|urn].*>?$/.test(e)&&(t||n);let r=!1;if(o)if(e.indexOf("http")>=0){const t=e.indexOf("//");r=t>4&&e.substring(t+2).length>0}else e.indexOf("urn")>=0&&(r=e.substring(4).length>0);return o&&r}let x,w;function h(t){function o(t){a((function(){e.form&&(e.form.$dirty=t)}))}t||(t=document.getElementById("resources_finder_value").value),t&&g(t)?(o(!1),n.path("resource").search("uri",t)):(o(!0),t&&i.error(d.instant("explore.error.invalid.input")))}e.submit=h,e.getAutocompleteSuggestions=function(t){if(!/<|>/.test(t)&&":"===t.slice(-1)){const n=l.getNamespaceUriForPrefix(e.namespaces,t.slice(0,-1));w=n!==w?n:w,w&&$("#resources_finder_value").val(w)}let n;if(e.autocompleteEnabled){const e=t.replace(w,w+";");n=c.getAutocompleteSuggestions(e)}else n=s.when(e.autocompleteEnabled);return n},e.inputChangedFn=function(){x=document.getElementById("resources_finder_value").value,e.form.$dirty=!(x&&g(x))},e.selectedUriCallback=function(t){e.selectedUri={name:t.title},h(e.selectedUri.name)},e.selectedUri={name:""},e.autocompleteEnabled=!1,angular.isDefined(u.search)&&a((function(){$("#resources_finder_value").val(u.search),$(".search-button").click()}),500),e.getActiveRepository()&&(f(),m()),e.$on("repositoryIsSet",(function(){f(),m()}))}function m(e,t,n,o,r,s,a,i,c,l,u){e.uriParam=n.search().uri,e.newRow={subject:e.uriParam,object:{type:"uri",datatype:""}},e.newResource=!1,e.datatypeOptions=c.getDatatypeOptions(),e.activeRepository=function(){return r.getActiveRepository()},e.getClassInstancesDetails=function(){l.getNamespaces(e.activeRepository()).success((function(t){e.namespaces=t.results.bindings.map((function(e){return{prefix:e.prefix.value,uri:e.namespace.value}})),e.loader=!1})).error((function(t){const n=getError(t);o.error(n,u.instant("common.error")),e.loader=!1})),i.getDetails(e.uriParam).success((function(t){e.details=t,e.details.encodeURI=encodeURIComponent(e.details.uri)})).error((function(e){o.error(u.instant("explore.error.resource.details",{data:getError(e)}))})),i.getGraph(e.uriParam).then((function(t){const n=c.buildStatements(t,e.uriParam);e.statements=n,e.newResource=!n.length}))},e.addStatement=function(){e.newRowPredicate.$setSubmitted(),e.newRowObject.$setSubmitted(),e.newRowContext.$setSubmitted(),e.newRowPredicate.$valid&&e.newRowObject.$valid&&e.newRowContext.$valid&&(e.statements.push(_.cloneDeep(e.newRow)),e.newRow={subject:e.uriParam,object:{type:"uri",datatype:""}},e.newRowPredicate.$setPristine(),e.newRowPredicate.$setUntouched(),e.newRowObject.$setPristine(),e.newRowObject.$setUntouched(),e.newRowContext.$setPristine(),e.newRowContext.$setUntouched())},e.removeStatement=function(t){e.statements.splice(t,1)},e.getLocalName=function(e){return i.getLocalName(e)},e.checkValid=function(e){if(!angular.isUndefined(e))return!0;return u.instant("explore.validation")},e.validEditRow=function(){return e.rowform.$valid},e.viewTrig=function(){s.open({templateUrl:"js/angular/explore/templates/viewTrig.html",controller:"ViewTrigCtrl",size:"lg",resolve:{data:function(){return c.transformToTrig(e.statements)}}})},e.save=function(){const r=e.newResource?"POST":"PUT";t({method:r,url:"rest/resource?uri="+encodeURIComponent(e.uriParam),headers:{"Content-Type":"application/x-trig"},data:c.transformToTrig(e.statements)}).success((function(){o.success(u.instant("explore.resource.saved"));const t=a((function(){n.path("resource").search("uri",e.uriParam)}),500);e.$on("$destroy",(function(){a.cancel(t)}))})).error((function(e){o.error(getError(e))}))},e.$watch((function(){return r.getActiveRepository()}),(function(){e.activeRepository()&&e.getClassInstancesDetails()})),e.validateUri=function(t){let n=!0;const o=t||"";if(-1===o.indexOf(":"))n=!1;else{const t=o.substring(0,o.indexOf(":"));if(""===i.getNamespaceUriForPrefix(e.namespaces,t)){!1===/^(http:\/\/www\.|https:\/\/www\.|http:\/\/|https:\/\/)[a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,5}(:[0-9]{1,5})?(\/.*)?$/.test(o)&&(n=!1);const e=o.match(/\//g);(void 0===e||e.length<3)&&(n=!1)}else{o.substring(o.indexOf(":")+1).trim().length<1&&(n=!1)}}return n}}function g(e,t,n){e.trig=n,e.cancel=function(){t.dismiss("cancel")}}angular.module("graphdb.framework.explore.controllers",["ngCookies","ngRoute","ui.bootstrap","toastr","graphdb.framework.core","graphdb.framework.core.services.repositories","graphdb.framework.explore.services","graphdb.workbench.utils.filetypes","graphdb.framework.rest.explore.rest.service"]).controller("FindResourceCtrl",f).controller("ExploreCtrl",d).controller("EditResourceCtrl",m).controller("ViewTrigCtrl",g),d.$inject=["$scope","$location","toastr","$routeParams","$repositories","$uibModal","ClassInstanceDetailsService","ModalService","RDF4JRepositoriesRestService","FileTypes","$jwtAuth","$translate","$q","ExploreRestService"],f.$inject=["$scope","$http","$location","$repositories","$q","$timeout","toastr","AutocompleteRestService","ClassInstanceDetailsService","$routeParams","RDF4JRepositoriesRestService","$translate"],m.$inject=["$scope","$http","$location","toastr","$repositories","$uibModal","$timeout","ClassInstanceDetailsService","StatementsService","RDF4JRepositoriesRestService","$translate"],g.$inject=["$scope","$uibModalInstance","data"]},464:function(e,t){(function(t){e.exports=t}).call(this,{})},465:function(e,t,n){var o,r=r||function(e){"use strict";if("undefined"==typeof navigator||!/MSIE [1-9]\./.test(navigator.userAgent)){var t=e.document,n=function(){return e.URL||e.webkitURL||e},o=t.createElementNS("http://www.w3.org/1999/xhtml","a"),r=e.webkitRequestFileSystem,s=e.requestFileSystem||r||e.mozRequestFileSystem,a=function(t){(e.setImmediate||e.setTimeout)((function(){throw t}),0)},i=0,c=function(t){var o=function(){"string"==typeof t?n().revokeObjectURL(t):t.remove()};e.chrome?o():setTimeout(o,500)},l=function(e,t,n){for(var o=(t=[].concat(t)).length;o--;){var r=e["on"+t[o]];if("function"==typeof r)try{r.call(e,n||e)}catch(e){a(e)}}},u=function(e){return/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob(["\ufeff",e],{type:e.type}):e},p=function(t,a){t=u(t);var p,d,f,m=this,g=t.type,x=!1,w=function(){l(m,"writestart progress write writeend".split(" "))},h=function(){(!x&&p||(p=n().createObjectURL(t)),d)?d.location.href=p:null==e.open(p,"_blank")&&"undefined"!=typeof safari&&(e.location.href=p);m.readyState=m.DONE,w(),c(p)},y=function(e){return function(){if(m.readyState!==m.DONE)return e.apply(this,arguments)}},R={create:!0,exclusive:!1};if(m.readyState=m.INIT,a||(a="download"),o)return p=n().createObjectURL(t),o.href=p,o.download=a,void setTimeout((function(){var e,t;e=o,t=new MouseEvent("click"),e.dispatchEvent(t),w(),c(p),m.readyState=m.DONE}));e.chrome&&g&&"application/octet-stream"!==g&&(f=t.slice||t.webkitSlice,t=f.call(t,0,t.size,"application/octet-stream"),x=!0),r&&"download"!==a&&(a+=".download"),("application/octet-stream"===g||r)&&(d=e),s?(i+=t.size,s(e.TEMPORARY,i,y((function(e){e.root.getDirectory("saved",R,y((function(e){var n=function(){e.getFile(a,R,y((function(e){e.createWriter(y((function(n){n.onwriteend=function(t){d.location.href=e.toURL(),m.readyState=m.DONE,l(m,"writeend",t),c(e)},n.onerror=function(){var e=n.error;e.code!==e.ABORT_ERR&&h()},"writestart progress write abort".split(" ").forEach((function(e){n["on"+e]=m["on"+e]})),n.write(t),m.abort=function(){n.abort(),m.readyState=m.DONE},m.readyState=m.WRITING})),h)})),h)};e.getFile(a,{create:!1},y((function(e){e.remove(),n()})),y((function(e){e.code===e.NOT_FOUND_ERR?n():h()})))})),h)})),h)):h()},d=p.prototype;return"undefined"!=typeof navigator&&navigator.msSaveOrOpenBlob?function(e,t){return navigator.msSaveOrOpenBlob(u(e),t)}:(d.abort=function(){this.readyState=this.DONE,l(this,"abort")},d.readyState=d.INIT=0,d.WRITING=1,d.DONE=2,d.error=d.onwritestart=d.onprogress=d.onwrite=d.onabort=d.onerror=d.onwriteend=null,function(e,t){return new p(e,t)})}}("undefined"!=typeof self&&self||"undefined"!=typeof window&&window||this.content);
1
+ (window.webpackJsonp=window.webpackJsonp||[]).push([[19,55,110,193,208,209,211,247,269],{122:function(e,t){angular.module("graphdb.framework.rest.explore.rest.service",[]).factory("ExploreRestService",n),n.$inject=["$http"];function n(e){return{getResourceDetails:(t,n,o,r)=>e.get("rest/explore/details",{params:{uri:t,triple:n,context:o},headers:{Accept:r||"application/json"}}),getGraph:(t,n,o)=>e.get("rest/explore/graph",{params:{uri:t.uri,triple:t.triple,inference:t.contextType.id,role:t.role,bnodes:t.blanks,sameAs:t.sameAs,context:t.context},headers:{Accept:n||"application/x-graphdb-table-results+json",Link:o?"<"+o+">":""}}).then(e=>e.data)}}},123:function(e,t,n){"use strict";n.r(t),n.d(t,"ResourceInfo",(function(){return s}));var o=n(99),r=n(84);class s{constructor(){this.role="subject",this.uri=void 0,this.triple=void 0,this.context=void 0,this.contextType=r.ContextTypes.EXPLICIT,this.sameAs=!0,this.details=new o.ResourceDetails,this.blanks=!0}}},124:function(e,t,n){"use strict";n.r(t),n.d(t,"RoleType",(function(){return o}));const o={SUBJECT:"subject",PREDICATE:"predicate",OBJECT:"object",CONTEXT:"context",ALL:"all"}},169:function(e,t,n){"use strict";n.r(t);n(98),n(122);var o=n(465),r=n(0),s=n(123),a=n(84),i=n(124),c=n(67),l=n(14),u=n(545),p=n(88);function d(e,t,n,r,d,f,m,g,x,w,h,y,R,S){let T;e.ContextTypes=a.ContextTypes,e.contextTypes=a.ContextType.getAllType(),e.currentContextTypeId=a.ContextTypes.EXPLICIT.id,e.roles=[i.RoleType.SUBJECT,i.RoleType.PREDICATE,i.RoleType.OBJECT,i.RoleType.CONTEXT,i.RoleType.ALL],e.resourceInfo=void 0,e.isLoading=!1,e.fileTypes=w,e.toggleSameAs=()=>{e.resourceInfo.sameAs=!e.resourceInfo.sameAs,e.exploreResource()},e.getActiveRepository=()=>d.getActiveRepository(),e.isTripleResource=()=>!!e.resourceInfo.triple,e.encodeURIComponent=e=>encodeURIComponent(e),e.getRdfStarLocalNames=e=>{let t=e.slice();return e.replace(/[<>]+/g,"").split(" ").forEach(e=>{t=t.replace(e,m.getLocalName(e))}),t},e.getLocalName=e=>m.getLocalName(e);e.loadResource=()=>{S.getResourceDetails(e.resourceInfo.uri,e.resourceInfo.triple,e.resourceInfo.context).success(t=>{e.resourceInfo.details=t,e.resourceInfo.context=e.resourceInfo.details.context,"object"!==e.resourceInfo.uri&&(e.resourceInfo.details.encodeURI=encodeURIComponent(e.resourceInfo.details.uri))}).error(e=>n.error(y.instant("explore.error.resource.details",{data:getError(e)}))),e.exploreResource()},e.isContextAvailable=()=>null!==e.resourceInfo.context&&"http://rdf4j.org/schema/rdf4j#SHACLShapeGraph"===e.resourceInfo.context,e.goToGraphsViz=()=>{t.path("graphs-visualizations").search("uri",e.resourceInfo.uri)},e.exploreResource=()=>{I(!0),null!=r.context&&(e.resourceInfo.context=r.context),t.search("role",e.resourceInfo.role),t.replace(),O()},e.downloadExport=t=>{S.getGraph(e.resourceInfo,t.type).then(e=>{t.type.indexOf("json")>-1&&(e=JSON.stringify(e));const n=navigator.userAgent.toLowerCase();if(-1!==n.indexOf("safari")&&-1===n.indexOf("chrome"))window.open('data:attachment/csv;filename="statements.'+t.extension+'",'+encodeURIComponent(e),"statements."+t.extension);else{const n=new Blob([e],{type:t.type});Object(o.saveAs)(n,"statements"+t.extension)}}).catch(e=>{n.error(getError(e),y.instant("common.error"))}).finally(()=>{I(!1)})},e.openJSONLDExportSettings=function(t){f.open({templateUrl:"js/angular/core/components/export-settings-modal/exportSettingsModal.html",controller:p.ExportSettingsCtrl,size:"lg",scope:e,resolve:{format:function(){return t.name}}}).result.then((function(n){e.downloadJSONLDExport(t,n.link,n.currentMode)}))},e.downloadJSONLDExport=function(t,r,s){S.getGraph(e.resourceInfo,t.type,r).then((async function(e){if("JSON"===t.name&&(e=JSON.stringify(e)),"JSON-LD"===t.name)switch(s.name){case"expanded":e=await u.expand(e),e=JSON.stringify(e);break;case"flattened":e=await u.flatten(e,r),e=JSON.stringify(e);break;case"compacted":e=await u.compact(e,r),e=JSON.stringify(e);break;case"context":e=await u.context(e,r),e=JSON.stringify(e);break;case"frame":e=await u.frame(e,r),e=JSON.stringify(e);break;case"framed":e=await u.compact(e,r),e=JSON.stringify(e)}const n=navigator.userAgent.toLowerCase();if(-1!==n.indexOf("safari")&&-1===n.indexOf("chrome"))window.open('data:attachment/csv;filename="statements.'+t.extension+'",'+encodeURIComponent(e),"statements."+t.extension);else{const n=new Blob([e],{type:t.type});Object(o.saveAs)(n,"statements"+t.extension)}})).catch((function(e){const t=getError(e);n.error(t,y.instant("common.error"))}))},e.changeRole=t=>{e.resourceInfo.role=t,e.resourceInfo.role===i.RoleType.CONTEXT&&(e.resourceInfo.contextType=a.ContextTypes.EXPLICIT),e.exploreResource()},e.changeInference=t=>{e.resourceInfo.contextType=a.ContextType.getContextType(t),e.exploreResource()},e.copyToClipboardResult=e=>{g.openCopyToClipboardModal(e)};const v=()=>{var n;e.resourceInfo||(e.resourceInfo=new s.ResourceInfo,n=e.resourceInfo,r.prefix&&r.localName&&T[r.prefix]?n.uri=T[r.prefix]+r.localName:t.search().uri?n.uri=t.search().uri+(t.hash()?"#"+t.hash():""):t.search().triple?n.triple=t.search().triple+(t.hash()?"#"+t.hash():""):n.uri=t.absUrl(),n.uri=n.uri&&n.uri.replace(/<|>/g,""),null!=r.context&&(e.resourceInfo.context=r.context),e.resourceInfo.role=t.search().role?t.search().role:i.RoleType.SUBJECT)},I=t=>{e.isLoading=!!t},b=()=>({showEditorTabs:!1,showToolbar:!1,showResultTabs:!1,showResultInfo:!0,downloadAsOn:!1,showQueryButton:!1,componentId:"resource-view-component",prefixes:T,maxPersistentResponseSize:0,render:c.RenderingMode.YASR,showYasqeActionButtons:!1,yasqeActionButtons:l.DISABLE_YASQE_BUTTONS_CONFIGURATION}),O=()=>{S.getGraph(e.resourceInfo).then(t=>{((t={})=>{const n={};angular.extend(n,e.yasguiConfig||b(),t),e.yasguiConfig=n})({sparqlResponse:t})}).catch(e=>{n.error(y.instant("explore.error.resource",{data:getError(e)}))}).finally(()=>{I(!1)})},E=t=>{e.resourceInfo.contextType=t.appSettings.DEFAULT_INFERENCE&&!e.resourceInfo.role===i.RoleType.CONTEXT?a.ContextTypes.ALL:a.ContextTypes.EXPLICIT,e.resourceInfo.sameAs=t.appSettings.DEFAULT_INFERENCE&&t.appSettings.DEFAULT_SAMEAS};e.$on("$destroy",()=>{N.forEach(e=>e())});const N=[];N.push(e.$watch((function(){return e.getActiveRepositoryObject()}),(function(t){t&&Promise.all([h.getPrincipal(),d.getPrefixes(d.getActiveRepository())]).then(([t,n])=>{v(),E(t),T=n,e.loadResource()}).catch(e=>{n.error(y.instant("get.namespaces.error.msg",{error:getError(e)}))})})))}function f(e,t,n,o,s,a,i,c,l,u,p,d){function f(){c.checkAutocompleteStatus().success((function(t){if(!t){const e=Object(r.decodeHTML)(d.instant("explore.autocomplete.warning.msg"));i.warning("",`<div class="autocomplete-toast"><a href="autocomplete">${e}</a></div>`,{allowHtml:!0})}e.autocompleteEnabled=t})).error((function(){i.error(d.instant("explore.error.autocomplete"))}))}function m(){p.getNamespaces(o.getActiveRepository()).success((function(t){e.namespaces=t.results.bindings.map((function(e){return{prefix:e.prefix.value,uri:e.namespace.value}})),e.loader=!1})).error((function(t){const n=getError(t);i.error(n,d.instant("common.error")),e.loader=!1}))}function g(e){const t=e.indexOf("<")>=0&&e.lastIndexOf(">")===e.length-1,n=-1===e.indexOf("<")&&-1===e.lastIndexOf(">"),o=/^<?[http|urn].*>?$/.test(e)&&(t||n);let r=!1;if(o)if(e.indexOf("http")>=0){const t=e.indexOf("//");r=t>4&&e.substring(t+2).length>0}else e.indexOf("urn")>=0&&(r=e.substring(4).length>0);return o&&r}let x,w;function h(t){function o(t){a((function(){e.form&&(e.form.$dirty=t)}))}t||(t=document.getElementById("resources_finder_value").value),t&&g(t)?(o(!1),n.path("resource").search("uri",t)):(o(!0),t&&i.error(d.instant("explore.error.invalid.input")))}e.submit=h,e.getAutocompleteSuggestions=function(t){if(!/<|>/.test(t)&&":"===t.slice(-1)){const n=l.getNamespaceUriForPrefix(e.namespaces,t.slice(0,-1));w=n!==w?n:w,w&&$("#resources_finder_value").val(w)}let n;if(e.autocompleteEnabled){const e=t.replace(w,w+";");n=c.getAutocompleteSuggestions(e)}else n=s.when(e.autocompleteEnabled);return n},e.inputChangedFn=function(){x=document.getElementById("resources_finder_value").value,e.form.$dirty=!(x&&g(x))},e.selectedUriCallback=function(t){e.selectedUri={name:t.title},h(e.selectedUri.name)},e.selectedUri={name:""},e.autocompleteEnabled=!1,angular.isDefined(u.search)&&a((function(){$("#resources_finder_value").val(u.search),$(".search-button").click()}),500),e.getActiveRepository()&&(f(),m()),e.$on("repositoryIsSet",(function(){f(),m()}))}function m(e,t,n,o,r,s,a,i,c,l,u,p){e.uriParam=n.search().uri,e.newRow={subject:e.uriParam,object:{type:"uri",datatype:""}},e.newResource=!1,e.datatypeOptions=c.getDatatypeOptions(),e.activeRepository=function(){return r.getActiveRepository()},e.getClassInstancesDetails=function(){l.getNamespaces(e.activeRepository()).success((function(t){e.namespaces=t.results.bindings.map((function(e){return{prefix:e.prefix.value,uri:e.namespace.value}})),e.loader=!1})).error((function(t){const n=getError(t);o.error(n,u.instant("common.error")),e.loader=!1})),i.getDetails(e.uriParam).success((function(t){e.details=t,e.details.encodeURI=encodeURIComponent(e.details.uri)})).error((function(e){o.error(u.instant("explore.error.resource.details",{data:getError(e)}))})),i.getGraph(e.uriParam).then((function(t){const n=c.buildStatements(t,e.uriParam);e.statements=n,e.newResource=!n.length}))},e.addStatement=function(){e.newRowPredicate.$setSubmitted(),e.newRowObject.$setSubmitted(),e.newRowContext.$setSubmitted(),e.newRowPredicate.$valid&&e.newRowObject.$valid&&e.newRowContext.$valid&&(e.statements.push(_.cloneDeep(e.newRow)),e.newRow={subject:e.uriParam,object:{type:"uri",datatype:""}},e.newRowPredicate.$setPristine(),e.newRowPredicate.$setUntouched(),e.newRowObject.$setPristine(),e.newRowObject.$setUntouched(),e.newRowContext.$setPristine(),e.newRowContext.$setUntouched())},e.removeStatement=function(t){e.statements.splice(t,1)},e.getLocalName=function(e){return i.getLocalName(e)},e.checkValid=function(e){if(!angular.isUndefined(e))return!0;return u.instant("explore.validation")},e.validEditRow=function(){return e.rowform.$valid},e.viewTrig=function(){s.open({templateUrl:"js/angular/explore/templates/viewTrig.html",controller:"ViewTrigCtrl",size:"lg",resolve:{data:function(){return c.transformToTrig(e.statements)}}})},e.save=function(){const r=e.newResource?"POST":"PUT";t({method:r,url:"rest/resource?uri="+encodeURIComponent(e.uriParam),headers:{"Content-Type":"application/x-trig"},data:c.transformToTrig(e.statements)}).success((function(){o.success(u.instant("explore.resource.saved"));const t=a((function(){n.path("resource").search("uri",e.uriParam)}),500);e.$on("$destroy",(function(){a.cancel(t)}))})).error((function(e){o.error(getError(e))}))},e.$watch((function(){return r.getActiveRepository()}),(function(){e.activeRepository()&&e.getClassInstancesDetails()})),e.hasAdminRole=()=>p.isAuthenticated()&&p.hasAdminRole(),e.validateUri=function(t){let n=!0;const o=t||"";if(-1===o.indexOf(":"))n=!1;else{const t=o.substring(0,o.indexOf(":"));if(""===i.getNamespaceUriForPrefix(e.namespaces,t)){!1===/^(http:\/\/www\.|https:\/\/www\.|http:\/\/|https:\/\/)[a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,5}(:[0-9]{1,5})?(\/.*)?$/.test(o)&&(n=!1);const e=o.match(/\//g);(void 0===e||e.length<3)&&(n=!1)}else{o.substring(o.indexOf(":")+1).trim().length<1&&(n=!1)}}return n}}function g(e,t,n){e.trig=n,e.cancel=function(){t.dismiss("cancel")}}angular.module("graphdb.framework.explore.controllers",["ngCookies","ngRoute","ui.bootstrap","toastr","graphdb.framework.core","graphdb.framework.core.services.repositories","graphdb.framework.explore.services","graphdb.workbench.utils.filetypes","graphdb.framework.rest.explore.rest.service"]).controller("FindResourceCtrl",f).controller("ExploreCtrl",d).controller("EditResourceCtrl",m).controller("ViewTrigCtrl",g),d.$inject=["$scope","$location","toastr","$routeParams","$repositories","$uibModal","ClassInstanceDetailsService","ModalService","RDF4JRepositoriesRestService","FileTypes","$jwtAuth","$translate","$q","ExploreRestService"],f.$inject=["$scope","$http","$location","$repositories","$q","$timeout","toastr","AutocompleteRestService","ClassInstanceDetailsService","$routeParams","RDF4JRepositoriesRestService","$translate"],m.$inject=["$scope","$http","$location","toastr","$repositories","$uibModal","$timeout","ClassInstanceDetailsService","StatementsService","RDF4JRepositoriesRestService","$translate","$jwtAuth"],g.$inject=["$scope","$uibModalInstance","data"]},464:function(e,t){(function(t){e.exports=t}).call(this,{})},465:function(e,t,n){var o,r=r||function(e){"use strict";if("undefined"==typeof navigator||!/MSIE [1-9]\./.test(navigator.userAgent)){var t=e.document,n=function(){return e.URL||e.webkitURL||e},o=t.createElementNS("http://www.w3.org/1999/xhtml","a"),r=e.webkitRequestFileSystem,s=e.requestFileSystem||r||e.mozRequestFileSystem,a=function(t){(e.setImmediate||e.setTimeout)((function(){throw t}),0)},i=0,c=function(t){var o=function(){"string"==typeof t?n().revokeObjectURL(t):t.remove()};e.chrome?o():setTimeout(o,500)},l=function(e,t,n){for(var o=(t=[].concat(t)).length;o--;){var r=e["on"+t[o]];if("function"==typeof r)try{r.call(e,n||e)}catch(e){a(e)}}},u=function(e){return/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob(["\ufeff",e],{type:e.type}):e},p=function(t,a){t=u(t);var p,d,f,m=this,g=t.type,x=!1,w=function(){l(m,"writestart progress write writeend".split(" "))},h=function(){(!x&&p||(p=n().createObjectURL(t)),d)?d.location.href=p:null==e.open(p,"_blank")&&"undefined"!=typeof safari&&(e.location.href=p);m.readyState=m.DONE,w(),c(p)},y=function(e){return function(){if(m.readyState!==m.DONE)return e.apply(this,arguments)}},R={create:!0,exclusive:!1};if(m.readyState=m.INIT,a||(a="download"),o)return p=n().createObjectURL(t),o.href=p,o.download=a,void setTimeout((function(){var e,t;e=o,t=new MouseEvent("click"),e.dispatchEvent(t),w(),c(p),m.readyState=m.DONE}));e.chrome&&g&&"application/octet-stream"!==g&&(f=t.slice||t.webkitSlice,t=f.call(t,0,t.size,"application/octet-stream"),x=!0),r&&"download"!==a&&(a+=".download"),("application/octet-stream"===g||r)&&(d=e),s?(i+=t.size,s(e.TEMPORARY,i,y((function(e){e.root.getDirectory("saved",R,y((function(e){var n=function(){e.getFile(a,R,y((function(e){e.createWriter(y((function(n){n.onwriteend=function(t){d.location.href=e.toURL(),m.readyState=m.DONE,l(m,"writeend",t),c(e)},n.onerror=function(){var e=n.error;e.code!==e.ABORT_ERR&&h()},"writestart progress write abort".split(" ").forEach((function(e){n["on"+e]=m["on"+e]})),n.write(t),m.abort=function(){n.abort(),m.readyState=m.DONE},m.readyState=m.WRITING})),h)})),h)};e.getFile(a,{create:!1},y((function(e){e.remove(),n()})),y((function(e){e.code===e.NOT_FOUND_ERR?n():h()})))})),h)})),h)):h()},d=p.prototype;return"undefined"!=typeof navigator&&navigator.msSaveOrOpenBlob?function(e,t){return navigator.msSaveOrOpenBlob(u(e),t)}:(d.abort=function(){this.readyState=this.DONE,l(this,"abort")},d.readyState=d.INIT=0,d.WRITING=1,d.DONE=2,d.error=d.onwritestart=d.onprogress=d.onwrite=d.onabort=d.onerror=d.onwriteend=null,function(e,t){return new p(e,t)})}}("undefined"!=typeof self&&self||"undefined"!=typeof window&&window||this.content);
2
2
  /*! @source http://purl.eligrey.com/github/FileSaver.js/blob/master/FileSaver.js */e.exports?e.exports.saveAs=r:null!==n(476)&&null!=n(464)&&(void 0===(o=function(){return r}.apply(t,[]))||(e.exports=o))},476:function(e,t){e.exports=function(){throw new Error("define cannot be used indirect")}},550:function(e,t){},67:function(e,t,n){"use strict";n.r(t),n.d(t,"RenderingMode",(function(){return o}));const o={YASGUI:"mode-yasgui",YASQE:"mode-yasqe",YASR:"mode-yasr"}},84:function(e,t,n){"use strict";n.r(t),n.d(t,"ContextType",(function(){return o})),n.d(t,"ContextTypes",(function(){return r}));class o{constructor(e,t){this.id=e,this.labelKey=t}static getAllType(){return[r.ALL,r.EXPLICIT,r.IMPLICIT]}static getContextType(e){return this.getAllType().find(t=>t.id===e)}}const r={ALL:new o("all","explore.explicit.implicit"),EXPLICIT:new o("explicit","explore.explicit"),IMPLICIT:new o("implicit","explore.implicit")}},88:function(e,t,n){"use strict";function o(e,t,n,o,r){e.JSONLDModes=[{name:"framed",link:"http://www.w3.org/ns/json-ld#framed"},{name:"expanded",link:"http://www.w3.org/ns/json-ld#expanded"},{name:"flattened",link:"http://www.w3.org/ns/json-ld#flattened"},{name:"compacted",link:"http://www.w3.org/ns/json-ld#compacted"}],e.JSONLDModesNames=e.JSONLDModes.reduce((function(e,t){return e[t.name]=t.name,e}),{}),e.JSONLDFramedModes=[e.JSONLDModesNames.framed],e.JSONLDContextModes=[e.JSONLDModesNames.compacted,e.JSONLDModesNames.flattened],e.defaultMode=e.JSONLDModes.find(e=>"expanded"===e.name),e.currentMode=e.defaultMode,e.link=null,e.fileFormat=r.toLowerCase(),e.setJSONLDSettingsToLocalStorage=function(e,t,r){n.set(o.JSONLD_EXPORT_SETTINGS,JSON.stringify({jsonldFormName:e,jsonldFormLink:t,jsonldLink:r}))},e.cancel=function(){t.dismiss()},e.reset=function(){e.currentMode=e.defaultMode,e.link="",e.setJSONLDSettingsToLocalStorage(e.currentMode.name,e.currentMode.link,e.link)},e.clearLinkInput=function(){e.link="",e.setJSONLDSettingsToLocalStorage(e.currentMode.name,e.currentMode.link,e.link)},e.exportJsonLD=function(){e.setJSONLDSettingsToLocalStorage(e.currentMode.name,e.currentMode.link,e.link),t.close({currentMode:e.currentMode,link:e.link})};!function(){const t=n.get(o.JSONLD_EXPORT_SETTINGS);t&&(e.currentMode=e.JSONLDModes.find(e=>e.name===t.jsonldFormName),e.link=t.jsonldLink)}()}n.r(t),n.d(t,"ExportSettingsCtrl",(function(){return o})),angular.module("graphdb.framework.core.components.export-settings-modal",["graphdb.framework.utils.localstorageadapter"]).controller("ExportSettingsCtrl",o),o.$inject=["$scope","$uibModalInstance","LocalStorageAdapter","LSKeys","format"]},98:function(e,t){angular.module("graphdb.workbench.utils.filetypes",[]).value("FileTypes",[{name:"JSON",translateKey:"download.as.json",type:"application/rdf+json",extension:".json"},{name:"JSON-LD",translateKey:"download.as.jsonld",type:"application/ld+json",extension:".jsonld"},{name:"NDJSON-LD",translateKey:"download.as.ndjsonld",type:"application/x-ld+ndjson",extension:".ndjsonld"},{name:"RDF-XML",translateKey:"download.as.rdfxml",type:"application/rdf+xml",extension:".rdf"},{name:"N3",translateKey:"download.as.n3",type:"text/rdf+n3",extension:".n3"},{name:"N-Triples",translateKey:"download.as.ntriples",type:"text/plain",extension:".nt"},{name:"N-Quads",translateKey:"download.as.nquads",type:"text/x-nquads",extension:".nq"},{name:"Turtle",translateKey:"download.as.turtle",type:"text/turtle",extension:".ttl"},{name:"Turtle*",translateKey:"download.as.turtlestar",type:"application/x-turtlestar",extension:".ttls"},{name:"TriX",translateKey:"download.as.trix",type:"application/trix",extension:".trix"},{name:"TriG",translateKey:"download.as.trig",type:"application/x-trig",extension:".trig"},{name:"TriG*",translateKey:"download.as.trigstar",type:"application/x-trigstar",extension:".trigs"},{name:"Binary RDF",translateKey:"download.as.binaryrdf",type:"application/x-binary-rdf",extension:".brf"}])},99:function(e,t,n){"use strict";n.r(t),n.d(t,"ResourceDetails",(function(){return o}));class o{constructor(){this.image=void 0,this.uri=void 0,this.label=void 0,this.encodeURI=void 0,this.comment=void 0,this.context=void 0}}}}]);
@@ -1 +1 @@
1
- (window.webpackJsonp=window.webpackJsonp||[]).push([[28,240,274],{180:function(e,t,n){"use strict";n.r(t);n(7);var r=n(456),i=n(469),o=(n(10),n(92)),s=n(73);function a(e,t,n,a,c,l,d,u,p,f,h,g,m,y,x,v,I,S,w,k,L,C,b){e.languageChanged=!1,e.propertiesObj={},e.propertiesObj.items=[],e.propertiesQueryObj={},e.propertiesQueryObj.query="",e.propertiesSearchPlaceholder=C.instant("visual.search.instance.placeholder"),e.propertiesNotFiltered=[],e.searchVisible=!1,e.nodeSelected=!1,e.queryResultsMode=!1,e.embedded=f.search().embedded,e.openedNodeInfoPanel=void 0,e.invalidLimit=!1,e.INVALID_LINKS_MSG=C.instant("sidepanel.invalid.limit.links.msg"),e.INVALID_LINKS_TOOLTIP=C.instant("sidepanel.invalid.limit.links.tooltip"),e.datasource=void 0,e.adapterContainer={adapter:{remain:!0}},e.hasInitedRepository=!1,e.defaultSettings={linksLimit:20,includeInferred:!0,sameAsState:!0,languages:["en"],showLinksText:!0,preferredTypes:[],rejectedTypes:[],preferredPredicates:[],rejectedPredicates:["http://dbpedia.org/property/logo","http://dbpedia.org/property/hasPhotoCollection","http://dbpedia.org/property/website","http://dbpedia.org/property/homepage","http://dbpedia.org/ontology/thumbnail","http://xmlns.com/foaf/0.1/depiction","http://xmlns.com/foaf/0.1/homepage","http://xmlns.com/foaf/0.1/mbox","http://dbpedia.org/ontology/wikiPage*","http://dbpedia.org/property/wikiPage*","http://factforge.net/*"],preferredTypesOnly:!1,preferredPredicatesOnly:!1,includeSchema:!0},e.saveSettings=_.cloneDeep(e.defaultSettings),e.defaultGraphConfig={id:"default",name:"Easy graph",startMode:"search"},t.key="",e.onopen=e.onclose=()=>angular.noop(),e.goToHome=()=>{P(),f.url("graphs-visualizations")},e.shouldShowSettings=()=>e.configLoaded&&e.configLoaded.id===e.defaultGraphConfig.id,e.shouldDisableSameAs=()=>{const t=$("#sameAsCheck");return e.settings&&!e.settings.includeInferred&&t.prop("checked")&&(t.prop("checked",!1),e.settings.sameAsState=!1),e.settings&&!e.settings.includeInferred},e.propertiesFilterFunc=t=>t.key.toLowerCase().indexOf(e.propertiesQueryObj.query.toLowerCase())>=0,e.toggleMoreInfo=e=>{angular.element(e.currentTarget).parent().next().toggle(200),angular.element(e.currentTarget).children("span").toggleClass("icon-caret-down").toggleClass("icon-caret-up")},e.copyToClipboard=e=>{m.openCopyToClipboardModal(e)},e.resetSettings=()=>{e.settings=_.cloneDeep(e.defaultSettings),e.validateLinksLimit(),O()},e.changeLimit=t=>{let n=e.settings.linksLimit+t;n<1&&(n=1),n>1e3&&(n=1e3),e.settings.linksLimit=n},e.validateLinksLimit=()=>{e.invalidLimit=!o.NUMBER_PATTERN.test(e.settings.linksLimit)},e.showSettings=()=>{e.showInfoPanel=!0,e.showFilter=!0,e.showNodeInfo=!1,e.showPredicates=!1,e.saveSettings?e.settings=_.cloneDeep(e.saveSettings):e.settings=_.cloneDeep(e.defaultSettings),O()},e.updateSettings=()=>{e.invalidLimit?c.error(e.INVALID_LINKS_TOOLTIP,e.INVALID_LINKS_MSG):(e.saveSettings=e.settings,e.saveSettings.languages=_.map(e.saveSettings.languagesMap,(function(e){return e.text})),e.saveSettings.preferredTypes=_.map(e.saveSettings.preferredTypesMap,(function(e){return e.text})),e.saveSettings.rejectedTypes=_.map(e.saveSettings.rejectedTypesMap,(function(e){return e.text})),e.saveSettings.preferredPredicates=_.map(e.saveSettings.preferredPredicatesMap,(function(e){return e.text})),e.saveSettings.rejectedPredicates=_.map(e.saveSettings.rejectedPredicatesMap,(function(e){return e.text})),e.rootNodeIri?E(e.rootNodeIri):e.queryResultsMode&&f.search().query?G(f.search().query,f.search().sameAs,f.search().inference):"query"===e.configLoaded.startMode&&W(e.configLoaded),M(),e.showInfoPanel=!1,e.showFilter=!1,v.set(I.GRAPHS_VIZ,e.saveSettings))},e.getGraphConfigs=t=>{w.getGraphConfigs().success((function(n){e.graphConfigs=n,t&&t()})).error((function(e){c.error(getError(e),C.instant("graphexplore.error.graph.configs.short.msg"))}))},e.findConfigById=function(t){return t===e.defaultGraphConfig.id?e.defaultGraphConfig:$.grep(e.graphConfigs,(function(e){return e.id===t}))[0]},e.easyGraphSearch=t=>{e.configLoaded=e.defaultGraphConfig,e.openUri(t)},e.deleteConfig=t=>{m.openSimpleModal({title:C.instant("common.confirm"),message:C.instant("graphexplore.delete.graph",{configName:t.name}),warning:!0}).result.then((function(){w.deleteGraphConfig(t).success((function(){e.getGraphConfigs(),e.refreshSavedGraphs()})).error((function(e){c.error(getError(e),C.instant("graphexplore.error.cannot.delete.config"))}))}))},e.goToGraphConfig=e=>{N({config:e.id},{config:e}),P(),W(e)},e.replaceIRIWithPrefix=t=>{const n=e.namespaces,r=_.findLast(n,(function(e){return 0===t.indexOf(e.uri)}));return r?r.prefix+":"+t.substring(r.uri.length):t};const T=[];t.$on("$translateChangeSuccess",(function(){e.INVALID_LINKS_MSG=C.instant("sidepanel.invalid.limit.links.msg"),e.INVALID_LINKS_TOOLTIP=C.instant("sidepanel.invalid.limit.links.tooltip"),e.propertiesSearchPlaceholder=C.instant("visual.search.instance.placeholder")})),e.$on("autocompleteStatus",(function(){ce()})),e.$on("repositoryIsSet",(function(t,n){n.newRepo&&(e.hasInitedRepository=!1),ae(n.newRepo),n.newRepo&&(P(),$(".graph-visualization svg").empty(),f.search().query&&(e.goToHome(),R()))}));T.push(t.$watch(()=>t.key,()=>{q=0,_.each(e.propertiesObj.items,(function(e){t.key>e&&q++})),H++}));T.push(e.$watch("propertiesObj.items",()=>{angular.isDefined(e.propertiesObj.items)&&e.propertiesObj.items.length>0&&l((function(){e.adapterContainer.adapter.reload()}),500)}));e.$on("$destroy",()=>{T.forEach(e=>e())});const N=(t,n)=>{e.embedded&&(t.embedded=!0),f.search(t),f.state(n)},P=()=>{e.searchVisible=!1,e.nodeSelected=!1,e.configLoaded=null,e.queryResultsMode=!1,e.lastSavedGraphName=null,e.lastSavedGraphId=null,e.shared=!1,e.numberOfPinnedNodes=0,K={},Z=0},A=()=>b.isActive()?e.defaultSettings:e.saveSettings,M=()=>{A().showLinksText?d3.selectAll("svg .link-wrapper text").style("display","block"):d3.selectAll("svg .link-wrapper text").style("display","none")},O=()=>{e.settings.languagesMap=_.map(e.settings.languages,(function(e){return{text:e}})),e.settings.preferredTypesMap=_.map(e.settings.preferredTypes,(function(e){return{text:e}})),e.settings.rejectedTypesMap=_.map(e.settings.rejectedTypes,(function(e){return{text:e}})),e.settings.preferredPredicatesMap=_.map(e.settings.preferredPredicates,(function(e){return{text:e}})),e.settings.rejectedPredicatesMap=_.map(e.settings.rejectedPredicates,(function(e){return{text:e}}))},E=()=>{e.rootNodeIri&&e.$broadcast("onRootNodeChange",e.rootNodeIri)},R=()=>{f.search().query?(e.searchVisible=!1,e.queryResultsMode=!0,G(f.search().query,f.search().sameAs,f.search().inference)):e.$on("onRootNodeChange",(function(t,n){e.loading=!0;const r=A();angular.isDefined(n)&&(e.rootNodeIri=n,k.getInstanceNode({iri:n,config:e.configLoaded?e.configLoaded.id:e.defaultGraphConfig.id,languages:e.shouldShowSettings()?r.languages:[],includeInferred:r.includeInferred,sameAsState:r.sameAsState}).then((function(t){e.nodeSelected=!0,e.searchVisible=!1,null===t.data.types&&(t.data.types="greyColor"),se=new oe;const n=se.addNode(t.data,te/2,ne/2);ee=X,Ce(n,!0)})).catch((function(t){e.loading=!1,c.error(getError(t),C.instant("graphexplore.error.could.not.load.graph"))})))})),f.search().uri&&e.openUri(f.search().uri,!0),f.search().saved&&S.getSavedGraph(f.search().saved).success((function(t){e.loadSavedGraph(t)})).error((function(e){const t=getError(e);c.error(t,C.instant("graphexplore.error.could.not.open"))}))},G=(t,n,r)=>{const i=A(),o=void 0===n?i.sameAsState:!0===n,s=void 0===r?i.includeInferred:!0===r;e.loading=!0,k.updateGraph({query:t,linksLimit:i.linksLimit,languages:e.shouldShowSettings()?i.languages:[],includeInferred:s,sameAsState:o}).then((function(e){ke(e)}),(function(t){e.loading=!1,c.error(getError(t.data),C.instant("graphexplore.error.cannot.load.graph"))}))},j=(e,t)=>{const n=e.split(" ");return t?[n[0],n[1],n[2]].join(">"):[n[0],n[2]].join(">")},z=e=>[e.source.iri,e.target.iri].join(">"),D=e=>{if(e.isTriple){const t=document.getElementById(Object(s.removeSpecialChars)(j(e.iri)));if(t&&void 0!==t.__data__.x)return t.__data__.x}return e.x},F=e=>{if(e.isTriple){const t=document.getElementById(Object(s.removeSpecialChars)(j(e.iri)));if(t&&void 0!==t.__data__.y)return t.__data__.y}return e.y},B=e=>{const t=e.trim().split(" ");return`<<<${t[0]}> <${t[1]}> <${t[2]}>>>`},U=e=>{const t=e.source.isTriple?j(e.source.iri,!0):e.source.iri,n=e.target.isTriple?j(e.target.iri,!0):e.target.iri;return Object(s.removeSpecialChars)(`${t}>${n}>marker`)},W=t=>{e.configLoaded=t,"search"===t.startMode?e.searchVisible=!0:"node"===t.startMode&&t.startIRI?l((function(){e.openUri(t.startIRI,!0)}),0):"query"===t.startMode&&t.startGraphQuery&&(e.loading=!0,w.loadGraphForConfig(t,t.startQueryIncludeInferred,A().linksLimit,t.startQuerySameAs).then((function(e){ke(e)}),(function(t){e.loading=!1,c.error(getError(t),C.instant("graphexplore.error.graph.load"))})))},V=function(){var t,n;f.search().config?(t=f.search().config,n=R,t===e.defaultGraphConfig.id?W(e.defaultGraphConfig):w.getConfig(t).then(e=>{W(e),n()}).catch(e=>{c.error(getError(e),C.instant("graphexplore.error.could.not.load.config",{configId:t}))})):f.search().query||f.search().uri?(W(e.defaultGraphConfig),R()):R()};x.onpopstate=function(t){P(),t.state&&(t.state.config?(W(t.state.config),t.state.uri&&e.openUri(t.state.uri,!0)):t.state.savedGraph&&e.loadSavedGraph(t.state.savedGraph,!0))},e.embedded&&(f.search().query||f.search().uri||f.search().config||f.search().saved)&&(e.noGoHome=!0);let q=0,H=0,K={},Z=0;const Q=16,J=d3.zoom().scaleExtent([.1,10]);let Y;const X=d3.zoomIdentity.translate(0,-70).scale(1);J.on("zoom",(function(e){b.isActive()||(ee=e.transform,Y.attr("transform",ee))}));let ee=X;const te=1e3,ne=1e3;let re,ie;function oe(){this.nodes=[],this.links=[],this.tripleNodes=new Map,this.tripleLinksCopy=new Map,this.addNode=function(e,t,n){return e.x=t,e.y=n,this.nodes.push(e),e},this.computeConnectedness=function(){const e={},t={};_.each(this.links,(function(n){const r=n.source.iri,i=n.target.iri,o=_.min([r,i])+"|"+_.max([r,i]);t[o]||(t[o]=1,e[r]=(e[r]||0)+1,e[i]=(e[i]||0)+1)})),_.each(this.links,(function(t){e[t.source.iri]>1&&e[t.target.iri]>1?t.connectedness=Math.min(5,Math.max(e[t.source.iri],e[t.target.iri])-1):t.connectedness=0}))},this.addAndMatchLinks=function(e){const t=this.nodes;Array.prototype.push.apply(this.links,function(e,t){return _.map(e,(function(e){let n,r;n=e.isTripleSource?Ae(e.source):_.find(t,(function(t){return t.iri===e.source})),r=e.isTripleTarget?Ae(e.target):_.find(t,(function(t){return t.iri===e.target}));let i={source:n,target:r,predicates:e.predicates};if(e.isTripleSource||e.isTripleTarget){let e=`${i.source.isTriple?j(i.source.iri):i.source.iri}>${i.target.isTriple?j(i.target.iri):i.target.iri}`;if(se.tripleLinksCopy.has(e)){let t=se.tripleLinksCopy.get(e);return t[0].predicates.push(...i.predicates),t.push(i),se.tripleLinksCopy.set(e,t),null}se.tripleLinksCopy.set(e,[i])}return i}))}(e,t));for(let e of se.tripleLinksCopy.keys())1===se.tripleLinksCopy.get(e).length&&se.tripleLinksCopy.delete(e);this.links=this.links.filter(e=>null!==e),this.computeConnectedness()};const t=function(e,t){return n(e,t).length};function n(e,t){return _.filter(t,(function(t){return t.source.iri===e.iri||t.target.iri===e.iri}))}this.countLinks=t,this.linksTypes=function(e,t){const r=n(e,t),i=_.map(r,(function(t){return t.source.iri===e.iri?t.target.types:t.source.types}));return _.uniq(_.flatten(i))},this.linksPredicates=function(e,t){const r=n(e,t),i=_.map(r,(function(e){return e.predicates}));return _.uniq(_.flatten(i))},this.removeTriples=function(e){let t=[];this.tripleNodes.size>0&&e.forEach(e=>{this.tripleNodes.has(e)&&(this.tripleNodes.delete(e),this.links=_.reject(this.links,(function(n){let r=e.split(">"),i=j(n.source.iri),o=j(n.target.iri);if(i===e&&se.tripleNodes.delete(o)){let e=o.split(">");t.push({source:e[0],target:e[1]})}let s=i===e||o===e||n.source.iri===r[0]&&n.target.iri===r[1];return s&&(se.tripleLinksCopy.delete(`${i}>${o}`),se.tripleLinksCopy.delete(`${o}>${i}`)),s})))}),t.forEach(e=>{this.links=_.reject(this.links,(function(t){return t.source.iri===e.source&&t.target.iri===e.target}))})},this.removeNode=function(n){let r=[];this.links=_.reject(this.links,(function(e){let t=e.source.iri===n.iri||e.target.iri===n.iri;return t&&(e.target.isTriple&&r.push(j(e.target.iri)),e.source.isTriple||e.target.isTriple||r.push([e.source.iri,e.target.iri].join(">"))),t})),this.removeTriples(r);const i=this.links;this.nodes=_.reject(this.nodes,(function(e){return 0===t(e,i)})),0===this.nodes.length&&(e.nodeSelected=!1),this.computeConnectedness()},this.removeNodeLeafLinks=function(e){let r=[],i=this.links;this.links=_.reject(this.links,(function(o){let s=o.source.iri===e.iri&&1===t(o.target,i)&&!o.target.isTriple||o.target.iri===e.iri&&1===t(o.source,i)&&!o.source.isTriple;if(!s){let r;if(o.source.iri!==e.iri||2!==t(o.target,i)||o.target.isTriple?o.target.iri!==e.iri||2!==t(o.source,i)||o.source.isTriple||(r=n(o.source,i)):r=n(o.target,i),!r)return!1;s=(r[0].source.iri===e.iri||r[0].target.iri)&&(r[1].source.iri===e.iri||r[1].target.iri)}return s&&(o.target.isTriple&&r.push(j(o.target.iri)),o.source.isTriple||o.target.isTriple||r.push([o.source.iri,o.target.iri].join(">"))),s})),this.removeTriples(r),i=this.links,this.nodes=_.reject(this.nodes,(function(n){return 0===t(n,i)&&n.iri!==e.iri})),this.computeConnectedness()},this.addTriple=function(e,t,n){e.x=t,e.y=n,e.weight=0;let r=j(e.iri);if(this.tripleNodes.has(r)){let t=this.tripleNodes.get(r);t.push(e),this.tripleNodes.set(r,t)}else e.weight=10,this.tripleNodes.set(r,[e])},this.copyState=function(){const e=_.map(this.nodes,(function(e){return{iri:e.iri,isTriple:e.isTriple,size:e.size,labels:_.cloneDeep(e.labels),types:_.cloneDeep(e.types),rdfRank:e.rdfRank,x:e.x,y:e.y,fixed:e.fixed}})),t=JSON.stringify(Array.from(this.tripleNodes.entries())),n=JSON.stringify(Array.from(this.tripleLinksCopy.entries()));return{nodes:e,links:_.map(this.links,(function(e){return{source:e.source.iri,isTripleSource:e.source.isTriple,target:e.target.iri,isTripleTarget:e.target.isTriple,predicates:e.predicates}})),tripleNodes:t,tripleLinksCopy:n,colorIndex:Z,type2color:K,transform:ee}},this.restoreState=function(t){e.nodeSelected=!0,e.searchVisible=!1,this.nodes=_.cloneDeep(t.nodes),this.tripleNodes=t.tripleNodes?new Map(JSON.parse(t.tripleNodes)):new Map,this.links=[],this.addAndMatchLinks(t.links),this.tripleLinksCopy=t.tripleLinksCopy?new Map(JSON.parse(t.tripleLinksCopy)):new Map,_.each(this.nodes,(function(t){t.fixed&&e.numberOfPinnedNodes++})),angular.isDefined(t.colorIndex)&&angular.isDefined(t.type2color)&&(Z=t.colorIndex,K=_.cloneDeep(t.type2color)),angular.isDefined(t.transform)&&(ee=d3.zoomIdentity.translate(t.transform.x,t.transform.y).scale(t.transform.k)),xe()}}e.datasource={get:function(t,n,r){return g.initLazyList(t,n,r,q,e.propertiesObj.items)},revision:function(){return H}},p.when(h.getPrincipal()).then(t=>(t=>{const n=t.appSettings;e.defaultSettings.includeInferred=n.DEFAULT_INFERENCE,e.defaultSettings.sameAsState=n.DEFAULT_INFERENCE&&n.DEFAULT_SAMEAS,e.defaultSettings.includeSchema=n.DEFAULT_VIS_GRAPH_SCHEMA;const r=v.get(I.GRAPHS_VIZ);if(r&&"object"==typeof r)try{e.saveSettings=r,void 0===e.saveSettings.includeSchema&&(e.saveSettings.includeSchema=e.defaultSettings.includeSchema,e.saveSettings.rejectedPredicates=[...e.saveSettings.rejectedPredicates,...e.defaultSettings.rejectedPredicates].unique())}catch(t){e.saveSettings=_.cloneDeep(e.defaultSettings),v.set(I.GRAPHS_VIZ,e.saveSettings)}else e.saveSettings=_.cloneDeep(e.defaultSettings)})(t)),e.showInfoPanel=!1;let se=new oe;function ae(t){!n.getActiveRepository()||e.hasInitedRepository&&!t||(e.hasInitedRepository=!0,t||e.getGraphConfigs(V),e.getNamespacesPromise=L.getNamespaces(e.getActiveRepository()).success((function(t){const n=_.map(t.results.bindings,(function(e){return{uri:e.namespace.value,prefix:e.prefix.value}}));e.namespaces=_.sortBy(n,(function(e){return e.uri.length})),ce()})).error((function(e){c.error(getError(e),C.instant("graphexplore.error.view.will.not.work"))})))}function ce(){a.isLicenseValid()&&(e.getAutocompletePromise=u.checkAutocompleteStatus())}e.addedTag=function(t){return t.text.indexOf(":")<0?(c.warning(C.instant("graphexplore.absolute.prefixed.iri")),null):(t.text=function(e,t){if(!/^<?(http|urn).*>?/.test(e)){const n=e.split(":"),r=n[0],i=n[1];if(!angular.isUndefined(i)){const e=d.getNamespaceUriForPrefix(t,r);if(e)return e+i}}return e}(t.text,e.namespaces),e.pageslideExpanded=!0,t)},e.validateTag=function(e,t,n){if(e.text.indexOf(":")<0)return n?c.warning(C.instant("graphexplore.absolute.prefixed.iri.option"),t):c.warning(C.instant("graphexplore.absolute.prefixed.iri"),t),!1;const r=e.text.indexOf("*");if(r>=0){if(!n)return c.warning(C.instant("graphexplore.wildcards.not.allowed"),t),!1;if(r<e.text.length-1)return c.warning(C.instant("graphexplore.wildcards.last.char"),t),!1}return!0},e.getTagClass=function(e){return e.endsWith("*")?"tag-item-wildcard":null},e.getActiveRepository=function(){return n.getActiveRepository()},e.isLicenseValid=function(){return a.isLicenseValid()},ae();const le=d3.scaleLinear().domain([0,9]).range(["hsl(0, 100%, 75%)","hsl(360, 90%, 82%)"]).interpolate(d3.interpolateHslLong),de=d3.scaleLinear().domain([0,9]).range(["hsl(180, 50%, 75%)","hsl(540, 40%, 82%)"]).interpolate(d3.interpolateHslLong);e.getColor=function(e){angular.isUndefined(K[e])&&(K[e]=Z,Z++);const t=K[e];return t>39?"#c2c2c2":t%2==0?le(t/2):de(t/2)};const ue=d3.forceX(te/2).strength(.005),pe=d3.forceY(ne/2).strength(.005),fe=d3.forceSimulation().force("x",ue).force("y",pe),he=d3.select(".main-container .graph-visualization").append("svg").attr("viewBox","0 0 "+te+" "+ne).attr("preserveAspectRatio","xMidYMid meet");he.append("rect").attr("width",10*te).attr("height",10*ne).attr("x",-(10*te-te)/2).attr("y",-(10*ne-ne)/2).style("fill","none").style("pointer-events","all").call(J).on("click",(function(e){e.stopPropagation(),be(),fe.stop()}));let ge=0,me=0;const ye=new function(){this.state=!1,this.setLoadingState=function(e){this.state=e},this.getLoadingState=function(){return this.state},this.init=function(e,t){d3.select(t).append("circle").attr("cx",(function(){return e.x})).attr("cy",(function(){return e.y})).attr("class","loader-container").attr("r",(function(){return e.size})).style("fill","fff").style("opacity","0.7"),d3.select(t).append("image").attr("xlink:href","js/angular/templates/loader/ot-loader.svg?v=2.7.4-RC2").attr("x",(function(){return e.x-e.size+5})).attr("y",(function(){return e.y-e.size})).attr("width",(function(){return 2*e.size})).attr("height",(function(){return 2*e.size})).attr("class","node-loader")}};function xe(t){d3.selectAll("svg g").remove(),d3.selectAll(".d3-tip").remove(),d3.selectAll(".menu-events").remove(),Y=he.append("g").attr("class","nodes-container").attr("transform",(function(){return angular.isDefined(ee)&&!t?ee:""}));const n=Object(i.a)().attr("class","d3-tip").customPosition((function(){const e=re.getBoundingClientRect();return{top:e.bottom+10+"px",left:e.left-30+"px"}})).html((function(t){let n="";return t.fixed&&(n+='<i class="icon-pin"></i>&nbsp;&nbsp;'),t.types.length>0?n+=_.join(_.map(t.types,(function(t){return e.replaceIRIWithPrefix(t)}))," · "):n+="<i>No types</i>",n})),o=function(e){let t="";return t+=_.join(_.map(e.predicates,(function(t,n){if(0===n)return Oe(t);if(n<10)return" · "+Oe(t);if(10===n){const t=function(e){return e.predicates.length-10}(e),n=t>1?t+" predicates":t+" predicate";return" · "+C.instant("graphexplore.tip.text",{textToShow:n})}})),""),t};let a;const d=Object(i.a)().attr("class","d3-tip").customPosition((function(e){const t=a.getBoundingClientRect(),n=function(e){const t=o(e),n=document.createElement("canvas").getContext("2d");return n.font="13px Arial",e.predicates.length<10?n.measureText(t).width:n.measureText(t).width/2}(e);return{top:t.top-30+"px",left:t.left-30+"px",width:n+"px"}})).html((function(e){return o(e)}));const u=function(){l.cancel(void 0),l.cancel(ge),re=null,n.hide(),me=l((function(){be()}),500)};he.call(n);he.call(d);let p=he.selectAll(".link"),f=he.selectAll(".node");const h=d3.forceCollide(e=>e.size+5).strength(.5),g=d3.forceManyBody().strength(-300),m=d3.forceCenter(te/2,ne/2);fe.nodes(se.nodes).force("charge",g).force("collide",h).force("center",m).force("link",d3.forceLink(se.links).distance((function(e){return e.source.isTriple||e.target.isTriple?0:function(e){const t=$("<span></span>"),n=e.predicates[0].split("/"),r=n[n.length-1];t.addClass("predicate-text").text(r),$("body").append(t);const i=t.width()+2*e.source.size+2*e.target.size+50;return t.remove(),.75*i}(e)+30*e.connectedness}))),Y.append("defs").selectAll("marker").data(se.links).enter().append("marker").attr("class","arrow-marker").attr("id",(function(e){return U(e)})).attr("viewBox","0 -5 10 10").attr("refX",(function(e){return e.target.isTriple?11:e.target.size+11})).attr("refY",0).attr("markerWidth",10).attr("markerHeight",10).attr("orient","auto").append("path").attr("d","M0,-5L10,0L0,5 L10,0 L0, -5"),p=Y.selectAll(".link").data(se.links).enter().append("g").attr("class","link-wrapper").attr("id",(function(e){return Object(s.removeSpecialChars)(z(e))})).append("line").attr("class","link").style("stroke-width",1).style("fill","transparent").style("marker-end",(function(e){return`url(#${U(e)})`}));const y=Y.selectAll(".link-wrapper").append("text").text((function(e){return Me(e)})).attr("class",(function(e){return e.predicates.length>1||se.tripleNodes.has(z(e))?"predicates":"predicate"})).attr("dy","-0.5em").style("text-anchor","middle").style("display",A().showLinksText?"":"none").on("mouseover",(function(e,t){e.stopPropagation(),function(e,t){l.cancel(void 0);const n=a=e.target;l((function(){a===n&&t.predicates.length>1&&d.show(t,a)}),300)}(e,t)})).on("mouseout",(function(){l.cancel(void 0),a=null,d.hide()})).on("click",(function(t,n){t.stopPropagation(),function(t,n){Pe();const r=z(n);if(1===n.predicates.length&&se.tripleNodes.has(r)){ie=null;const e=se.tripleNodes.get(r)[0];if(Se(e,this,t.button)){const t={};t.iri=e.iri,t.pred=Oe(e.iri.split(" ")[1]),_e(t)}return}!function(t){if(e.showNodeInfo=!1,e.showPredicates=t.predicates.length>1,e.showFilter=!1,e.showInfoPanel=!1,ie===t)return e.showNodeInfo=!1,e.showInfoPanel=!1,void(ie=null);ie=t,e.showPredicates&&(e.predicates=_.map(t.predicates,(function(e){const n=function(e,t){const n=z(t);return se.tripleNodes.has(n)?se.tripleNodes.get(n).findIndex(t=>t.iri.indexOf(e)>=0):-1}(e,t),r=n>-1;return{value:Oe(e),partOfTriple:r,linkId:r?z(t):"",nodeIndex:n}})),e.showInfoPanel=!0)}(n)}(t,n)}));let x,v=0,I=null,S=null;const w=function(t,n,r){let i=r||this.parentNode;Array.isArray(r)&&(i=r[n]);se.countLinks(t,se.links)<=A().linksLimit?Ce(t,!1,i):c.info(C.instant("graphexplore.increase.limit"),C.instant("graphexplore.node.at.max")),e.closeInfoPanel()};function k(e,t){let n,r,i,o,s=!0;if("down"===t)n=2*e.size,r=e.size/3,i=.8,o=.3;else if("down-fixed"===t)n=2*e.size,r=e.size,i=.8,o=.66;else if("up"===t)n=e.size/3,r=2*e.size,i=.3,o=.8;else{if("fixed"!==t)return;n=e.size,i=.66,s=!1}let a=Y.selectAll(".node-wrapper").filter((function(t){return t===e})).append("text").text("").classed("icon-any pinned",!0).style("font-size",n+"px").attr("x",(function(e){return e.x})).attr("y",(function(e){return e.y})).attr("opacity",i);"fixed"!==t&&"down-fixed"!==t||(e.pin=a),s&&(a=a.transition().duration(1e3).style("font-size",(function(){return r+"px"})).attr("opacity",o),"down-fixed"!==t&&a.remove())}const L=d3.drag().subject((function(e){return e})).on("start",(function(e,t){if(b.isActive())return;0===e.sourceEvent.button&&(t.fixedBeforeDrag=t.fixed,t.isBeingDragged=!0,t.beginDragging=!0,be(),d3.select(this).classed("dragging",!0),fe.alphaTarget(.3).restart())})).on("drag",(function(t,n){n.isBeingDragged&&(n.fx=t.x,n.fy=t.y,n.fixed?n.beginDragging&&k(n,"fixed"):(e.numberOfPinnedNodes++,n.fixed=!0,k(n,"down-fixed")),n.pinWasFixed=!0,n.beginDragging=null)})).on("end",(function(e,t){t.isBeingDragged&&(t.pinWasFixed&&(t.pinWasFixed=null,d3.select(".pinned").remove()),t.isBeingDragged=!1,d3.select(this).classed("dragging",!1));fe.alphaTarget(0)}));f=Y.selectAll(".node").data(se.nodes).enter().append("g").attr("class","node-wrapper").attr("id",(function(e){return e.iri})).append("circle").attr("class","node").attr("r",(function(e){return e.size})).style("fill",(function(t){return"greyColor"===t.types?"c2c2c2":e.getColor(t.types[0])})).on("mouseover",(function(t,r){r.isBeingDragged||(l.cancel(me),ge=l(()=>{(function(t,n){if(e.showInfoPanel)return!1;(Ie.closeIcon||Ie.expandIcon||Ie.focusIcon||Ie.copyURIIcon)&&Ie.removeIcons();if(fe.alpha()<.1)return Ie.initIcons(t,n.parentNode),fe.stop(),ve(),!0;return!1})(r,this)&&function(e,t){l.cancel(void 0);const r=re=t.target;l((function(){re===r&&n.show(e,re)}),300)}(r,t)},400))})).on("mouseout",u).on("click",(function(t,n){if(t.button&&0!==t.button)return;const r=this;if(I&&S===r)return l.cancel(I),I=null,void w(n,0,r.parentNode);S=r,u(),e.showPredicates=!1,b.isActive()||(l.cancel(I),I=l((function(){Se(n,r,t),I=null}),540))})).on("touchstart",(e,t)=>function(e){v=0,x=l((function(){v<5&&we(e),x=null}),1e3)}(t)).on("touchmove",(function(){v++})).on("touchend",(function(){l.cancel(x),x=null})).on("contextmenu",(function(t,r){t.shiftKey||(t.preventDefault(),be(),e.closeInfoPanel(),r.fixed?(e.numberOfPinnedNodes--,r.fixed=!1,r.fx=null,r.fy=null,k(r,"up"),fe.alpha(1).restart()):(e.numberOfPinnedNodes++,r.fixed=!0,k(r,"down")),function(e){re&&n.show(e,re)}(r))})).on("gdb-expand-node",(e,t)=>w(t,0,e.srcElement.parentNode)).on("gdb-show-node-info",(e,t)=>Te(t)).call(L);const T=Y.selectAll(".node-wrapper").append("foreignObject").style("pointer-events","none").attr("width",(function(e){return 2*e.size*1.75}));Y.insert("g").attr("class","menu-events"),(e=>{e.each((function(e){e.fontSize=r.a.Text.calcFontSizeRaw(e.labels[0].label,e.size,Q,!0)})).attr("height",(function(e){return 3*e.fontSize})).append("xhtml:div").attr("class","node-label-body").style("font-size",(function(e){return e.fontSize+"px"})).append("xhtml:div").text((function(e){return e.labels[0].label})),l((function(){$(".node-label-body div").each((function(e,t){let n=t.textContent.substring(0,t.textContent.length-1);let r=0;for(;r<200&&(t.scrollHeight>t.clientHeight||t.scrollWidth>t.clientWidth);)n=n.substring(0,n.length-1),t.textContent=n+"…",r++}))}),50)})(T),fe.on("tick",(function(){p.attr("x1",(function(e){return D(e.source)})).attr("y1",(function(e){return F(e.source)})).attr("x2",(function(e){return D(e.target)})).attr("y2",(function(e){return F(e.target)})),y.attr("x",(function(e){let t=D(e.source),n=D(e.target);return e.x=.5*(t+n)})).attr("y",(function(e){let t=F(e.source),n=F(e.target);return e.y=.5*(t+n)})).attr("transform",(function(e){return"rotate("+function(e,t){const n={x:D(e.source),y:F(e.source)},r={x:D(e.target),y:F(e.target)};if(t)return 180*Math.atan2(r.y-n.y,r.x-n.x)/Math.PI;{const e=180*Math.atan2(r.y-n.y,r.x-n.x)/Math.PI;return e<=90&&e>=-90?e:(e>0?-1:1)*(180-Math.abs(e))}}(e,e.direction)+", "+e.x+", "+e.y+")"})),f.attr("cx",(function(e){return e.x})).attr("cy",(function(e){return e.y})),Y.select(".node-loader").attr("x",(function(e){return e.x-e.size+3})).attr("y",(function(e){return e.y-e.size})),Y.select(".loader-container").attr("cx",(function(e){return e.x})).attr("cy",(function(e){return e.y})),T.attr("x",(function(e){return e.x-1.75*e.size})).attr("y",(function(e){return e.y-3*e.fontSize/2})),d3.select(".pinned").attr("x",(function(e){return e.x})).attr("y",(function(e){return e.y})),ve()})),angular.isDefined(ye)&&ye.setLoadingState(!1),e.loading&&(e.loading=!1),d3.selectAll(".link-wrapper").each((function(){const e=$(this).attr("id").split(">")[0],t=$(this).attr("id").split(">")[1];d3.selectAll(".link").each((function(n){const r=Object(s.removeSpecialChars)(n.source.iri),i=Object(s.removeSpecialChars)(n.target.iri);if(r===t&&i===e){let e=r;e+=">",e+=i;const t=document.createTextNode(" ⟶");document.getElementById(e).lastChild.appendChild(t),n.direction="double"}}))})),d3.selectAll(".d3-actions-tip").remove(),fe.alpha(.3).restart()}function ve(){t.d3alpha=fe.alpha()}const Ie=new function(){function n(e,t){return"translate("+(t.x-14+(t.size+15)*Math.cos(e*Math.PI/180-Math.PI/2))+","+(t.y-14+(t.size+15)*Math.sin(e*Math.PI/180-Math.PI/2))+")"}this.closeIcon=void 0,this.expandIcon=void 0,this.collapseIcon=void 0,this.focusIcon=void 0,this.copyURIIcon=void 0,this.actionsTip=void 0,this.removeIcons=function(){this.closeIcon.remove("g"),this.expandIcon&&this.expandIcon.remove("g"),this.collapseIcon&&this.collapseIcon.remove("g"),this.focusIcon.remove("g"),this.copyURIIcon.remove("g"),this.closeIcon=void 0,this.expandIcon=void 0,this.collapseIcon=void 0,this.focusIcon=void 0,this.copyURIIcon=void 0,this.expandedState=!1},this.expandedState=!1,this.initIcons=function(r,o){const s=Object(i.a)().attr("class","d3-tip d3-actions-tip").customPosition((function(e,t){const n=t.target.getBoundingClientRect();return{top:n.top-20+"px",left:n.right+10+"px"}})).html((function(e){return e}));he.call(s);r.isExpanded?(this.collapseIcon=d3.select(".menu-events").append("g").attr("class","collapse-icon").attr("name","collapse").attr("transform",(function(){return n(20,r)})),this.collapseIcon.append("circle").attr("cx",14).attr("cy",14).attr("r",13).style("fill","#eee"),this.collapseIcon.append("path").attr("d","M22.67,12a.59.59,0,0,1-.53.65l-6.88.72H15.2a.59.59,0,0,1-.59-.65l.72-6.88A.58.58,0,0,1,16,5.33a.59.59,0,0,1,.53.65L16,11.11,21.3,5.79a.64.64,0,0,1,.91.91L16.89,12,22,11.49A.59.59,0,0,1,22.67,12ZM12.59,14.75l-6.75.85a.59.59,0,0,0-.51.66.58.58,0,0,0,.66.51l4.95-.62-5.2,5.2a.64.64,0,1,0,.91.91l5.2-5.2L11.23,22a.59.59,0,0,0,.51.66h.07a.59.59,0,0,0,.59-.52l.85-6.75a.59.59,0,0,0-.17-.49A.58.58,0,0,0,12.59,14.75Z").style("fill","var(--primary-color)"),this.collapseIcon.on("click",(function(){var e;(e=r).isExpanded=!1,se.removeNodeLeafLinks(e),xe()})).on("mouseover",(function(e){s.show(this.getAttribute("name"),e),l.cancel(ge),l.cancel(me)})).on("mouseout",(function(){s.hide(),me=l((function(){be()}),500)}))):(this.expandIcon=d3.select(".menu-events").append("g").attr("class","expand-icon").attr("name","expand").attr("transform",(function(){return n(20,r)})),this.expandIcon.append("circle").attr("cx",14).attr("cy",14).attr("r",13).style("fill","#eee"),this.expandIcon.append("path").attr("d","M22.37,6.28l-.72,6.88a.59.59,0,0,1-.59.53H21a.59.59,0,0,1-.53-.65L21,7.9l-5.32,5.32a.64.64,0,0,1-.91-.91L20.1,7,15,7.53a.59.59,0,0,1-.12-1.18l6.88-.72a.59.59,0,0,1,.65.65ZM12.89,20.34,7.95,21l5.2-5.2a.64.64,0,0,0-.91-.91L7,20.05l.62-4.95A.59.59,0,0,0,6.48,15l-.85,6.75a.59.59,0,0,0,.59.67h.07L13,21.52a.59.59,0,1,0-.15-1.18Z").style("fill","var(--primary-color)"),this.expandIcon.on("click",(function(){Ce(r,!1,o)})).on("mouseover",(function(e){s.show(this.getAttribute("name"),e),l.cancel(me),l.cancel(ge)})).on("mouseout",(function(){s.hide(),me=l((function(){be()}),500)}))),this.focusIcon=d3.select(".menu-events").append("g").attr("class","focus-icon").attr("name","focus").attr("transform",(function(){return n(20,r)})),this.focusIcon.append("circle").attr("cx",14).attr("cy",14).attr("r",13).style("fill","#eee"),this.focusIcon.append("path").attr("d","M14.2,23.81a9.8,9.8,0,1,1,6.93-2.87h0A9.74,9.74,0,0,1,14.2,23.81Zm0-18.17a8.37,8.37,0,1,0,5.92,14.29h0A8.37,8.37,0,0,0,14.2,5.64Zm1.42,6.95a2,2,0,1,0,0,2.85A2,2,0,0,0,15.62,12.59Z").style("fill","var(--primary-color)"),this.focusIcon.on("click",(function(){t.$broadcast("onRootNodeChange",r.iri)})).on("mouseover",(function(e){s.show(this.getAttribute("name"),e),l.cancel(me),l.cancel(ge)})).on("mouseout",(function(){s.hide(),me=l((function(){be()}),500)})),this.copyURIIcon=d3.select(".menu-events").append("g").attr("class","icon-link").attr("name","link").attr("transform",(function(){return n(20,r)})),this.copyURIIcon.append("circle").attr("cx",14).attr("cy",14).attr("r",13).style("fill","#eee"),this.copyURIIcon.append("path").attr("d","M 13.457031 10.164062 C 13.648438 10.164062 13.820312 10.242188 13.941406 10.363281 L 15.492188 11.859375 C 15.984375 12.332031 16.292969 12.992188 16.292969 13.714844 C 16.292969 14.441406 15.984375 15.097656 15.492188 15.574219 L 10.394531 20.496094 C 9.902344 20.972656 9.222656 21.265625 8.472656 21.265625 C 7.71875 21.265625 7.039062 20.972656 6.546875 20.496094 L 4.996094 19 C 4.507812 18.523438 4.203125 17.867188 4.203125 17.144531 C 4.203125 16.421875 4.507812 15.765625 4.996094 15.289062 L 7.542969 12.824219 C 7.667969 12.707031 7.84375 12.628906 8.035156 12.628906 C 8.417969 12.628906 8.726562 12.929688 8.726562 13.300781 C 8.726562 13.484375 8.648438 13.652344 8.523438 13.773438 L 5.976562 16.234375 C 5.738281 16.46875 5.589844 16.792969 5.589844 17.148438 C 5.589844 17.503906 5.738281 17.824219 5.976562 18.058594 L 7.527344 19.566406 C 7.773438 19.792969 8.105469 19.929688 8.472656 19.929688 C 8.835938 19.929688 9.167969 19.792969 9.414062 19.566406 L 14.511719 14.644531 C 14.753906 14.410156 14.90625 14.089844 14.90625 13.730469 C 14.90625 13.375 14.753906 13.054688 14.511719 12.820312 L 12.964844 11.324219 C 12.839844 11.203125 12.761719 11.039062 12.761719 10.855469 C 12.761719 10.488281 13.070312 10.1875 13.449219 10.1875 Z M 17.082031 3.976562 C 17.082031 3.976562 17.085938 3.976562 17.085938 3.976562 C 17.824219 3.976562 18.492188 4.261719 18.980469 4.722656 L 20.535156 6.203125 C 21.042969 6.679688 21.355469 7.34375 21.355469 8.082031 C 21.355469 8.792969 21.058594 9.441406 20.582031 9.914062 L 18.0625 12.402344 C 17.9375 12.527344 17.761719 12.605469 17.566406 12.605469 C 17.183594 12.605469 16.875 12.304688 16.875 11.9375 C 16.875 11.753906 16.949219 11.589844 17.070312 11.46875 L 19.605469 8.984375 C 19.847656 8.75 19.996094 8.429688 19.996094 8.070312 C 19.996094 7.714844 19.847656 7.394531 19.605469 7.160156 L 18.019531 5.667969 C 17.773438 5.445312 17.4375 5.304688 17.070312 5.300781 C 16.703125 5.304688 16.367188 5.453125 16.128906 5.691406 L 11.085938 10.667969 C 10.84375 10.898438 10.695312 11.222656 10.695312 11.578125 C 10.695312 11.933594 10.84375 12.257812 11.085938 12.488281 L 12.675781 13.980469 C 12.804688 14.101562 12.882812 14.273438 12.882812 14.457031 C 12.882812 14.828125 12.574219 15.128906 12.191406 15.128906 C 12.003906 15.128906 11.832031 15.054688 11.707031 14.9375 L 10.140625 13.457031 C 9.636719 12.980469 9.324219 12.316406 9.324219 11.582031 C 9.324219 10.863281 9.621094 10.214844 10.101562 9.742188 L 15.140625 4.765625 C 15.625 4.285156 16.304688 3.980469 17.054688 3.976562 Z M 17.082031 3.976562").style("fill","var(--primary-color)"),this.copyURIIcon.on("click",(function(){e.copyToClipboard(r.iri),be(),s.hide()})).on("mouseover",(function(e){s.show("<div style='text-align: center;'><b>Copy to ClipBoard</b><br>"+r.iri+"</div>",e),l.cancel(me),l.cancel(ge)})).on("mouseout",(function(){s.hide(),me=l((function(){be()}),500)})),this.closeIcon=d3.select(".menu-events").append("g").attr("class","close-icon").attr("name","remove").attr("transform",(function(){return n(20,r)})),this.closeIcon.append("circle").attr("cx",14).attr("cy",14).attr("r",13).style("fill","#eee"),this.closeIcon.append("path").attr("d","M14.94,14l5.87-5.87a.66.66,0,1,0-.94-.94L14,13.06,8.13,7.19a.66.66,0,0,0-.94.94L13.06,14,7.19,19.87a.66.66,0,1,0,.94.94L14,14.94l5.87,5.87a.66.66,0,1,0,.94-.94Z").style("fill","var(--primary-color)"),this.closeIcon.on("click",(function(){we(r)})).on("mouseover",(function(e){s.show(this.getAttribute("name"),e),l.cancel(me),l.cancel(ge)})).on("mouseout",(function(){s.hide(),me=l((function(){be()}),500)})),this.animateMenu(r)},this.animateMenu=function(e){const t=d3.easeSin;let r=0;let i=20;this.expandIcon&&this.expandIcon.transition().duration(100).style("opacity",1).ease(t).attr("transform",(function(){return n(i,e)})).delay(r+=35),this.collapseIcon&&this.collapseIcon.transition().duration(100).style("opacity",1).ease(t).attr("transform",(function(){return n(i,e)})).delay(r+=35),this.copyURIIcon.transition().duration(100).style("opacity",1).ease(t).attr("transform",(function(){return i+=30,n(i,e)})).delay(r+=35),this.focusIcon.transition().duration(100).style("opacity",1).ease(t).attr("transform",(function(){return i+=30,n(i,e)})).delay(r+=35),this.closeIcon.transition().duration(100).style("opacity",1).ease(t).attr("transform",(function(){return i+=30,n(i,e)})).delay(r+=35),this.expandedState=!0}};function Se(n,r,i){return e.showInfoPanel=!1,e.showPredicates=!1,e.showNodeInfo=!1,i.shiftKey&&(i.ctrlKey||i.metaKey)?(t.$broadcast("onRootNodeChange",n.iri),!1):i.ctrlKey||i.metaKey?(we(n),!1):void 0!==e.openedNodeInfoPanel&&e.openedNodeInfoPanel===n?(e.pageslideExpanded=!1,e.openedNodeInfoPanel=void 0,!1):(Te(n),!0)}function we(e){se.removeNode(e),xe()}function ke(t){!function(t){e.nodeSelected=!0,null===t.data.types&&(t.data.types="greyColor"),se=new oe,ee=X}(t),Le(t)}function Le(t,n,r){let i=t.data;i=_.filter(i,(function(e){return-1===_.findIndex(se.links,(function(t){return e.source===t.source.iri&&e.target===t.target.iri}))}));const o=[],s=se.tripleLinksCopy.values();for(let e=0;e<se.tripleLinksCopy.size;e++){s.next().value.forEach(e=>{o.push(e)})}i=_.filter(i,(function(e){return-1===_.findIndex(o,(function(t){return e.source===t.source.iri&&e.target===t.target.iri}))})),i=_.filter(i,(function(e){return e.source!==e.target}));const a=((e,t)=>{const n=t.map(t=>t[e]);return t.filter((t,r)=>n.indexOf(t[e])===r)})("iri",_.union(_.flatten(_.map(t.data,(function(e){return[{iri:e.source,isTriple:e.isTripleSource},{iri:e.target,isTriple:e.isTripleTarget}]}))))),l=_.map(se.nodes,(function(e){return{iri:e.iri,isTriple:Boolean(e.isTriple)}})),d=se.tripleNodes.values();for(let e=0;e<se.tripleNodes.size;e++){d.next().value.forEach(e=>{l.push({iri:e.iri,isTriple:e.isTriple})})}const u=_.reject(a,(function(e){return _.some(l,e)}));if(0===u.length)(r||0===i.length)&&c.info(C.instant("graphexplore.error.node.connections")),se.addAndMatchLinks(i),xe();else{const t=[],r=[],o=A();_.forEach(u,(function(n,i){t.push(k.getInstanceNode({iri:n.isTriple?B(n.iri):n.iri,config:e.configLoaded.id,languages:e.shouldShowSettings()?o.languages:[],includeInferred:o.includeInferred,sameAsState:o.sameAsState}).then((function(e){r[i]=e.data})))})),p.all(t).then((function(){_.forEach(r,(function(e,t){const i=2*Math.PI*t/r.length,o=(n?n.x:0)+Math.cos(i)*ne/3,s=(n?n.y:0)+Math.sin(i)*ne/3;e.isTriple?se.addTriple(e,o,s):se.addNode(e,o,s)})),se.addAndMatchLinks(i),n&&(n.isExpanded=!0),xe()}))}}function Ce(t,n,r){if(ye.getLoadingState())return;ye.init(t,r);const i=A(),o=t.iri;k.getInstanceNodeLinks({iri:o,linksLimit:i.linksLimit,includeInferred:i.includeInferred,config:e.configLoaded.id,preferredTypes:e.shouldShowSettings()?i.preferredTypes:[],rejectedTypes:e.shouldShowSettings()?i.rejectedTypes:[],preferredPredicates:e.shouldShowSettings()?i.preferredPredicates:[],rejectedPredicates:e.shouldShowSettings()?i.rejectedPredicates:[],preferredTypesOnly:e.shouldShowSettings()?i.preferredTypesOnly:[],preferredPredicatesOnly:e.shouldShowSettings()?i.preferredPredicatesOnly:[],languages:e.shouldShowSettings()?i.languages:[],sameAsState:i.sameAsState,includeSchema:i.includeSchema}).then((function(e){Le(e,t,n)}),(function(t){const n=getError(t.data);c.error(n,C.instant("graphexplore.error.exploring.node")),e.loading=!1,ye.setLoadingState(!1)}))}function be(){angular.isDefined(Ie)&&Ie.expandedState&&Ie.removeIcons()}function Te(t){fe.stop(),e.openedNodeInfoPanel=t,e.showNodeInfo=!0,e.showFilter=!1,e.showPredicates=!1,e.nodeLabels=t.labels,e.nodeTypes=t.types,e.rdfRank=t.rdfRank,e.nodeIri=t.iri,e.resourceType=t.isTriple?"triple":"uri",e.encodedIri=t.isTriple?encodeURIComponent(B(t.iri)):encodeURIComponent(t.iri),e.showInfoPanel=!0,e.rdfsLabel=t.labels[0].label,e.rdfsComment=t.comment,e.expanded=!1,e.propertiesQueryObj.query="",e.dataNodeKeysQuery="";const n=A();k.getProperties({iri:t.isTriple?B(t.iri):t.iri,config:e.configLoaded.id,languages:e.shouldShowSettings()?n.languages:[],includeInferred:n.includeInferred,sameAsState:n.sameAsState,rejectedPredicates:e.shouldShowSettings()?n.rejectedPredicates:[]}).then((function(t){e.data=_.mapKeys(t.data,(function(t,n){return e.replaceIRIWithPrefix(n)})),e.propertiesObj.items=[],_.forEach(e.data,(function(t,n){e.propertiesObj.items.push({key:n,value:t})})),e.nodeImage=void 0,e.propertiesNotFiltered=e.propertiesObj.items;const n=_.find(e.propertiesObj.items,(function(e){return"image"===e.key}));n&&(e.nodeImage=n.value[0].v),e.propertiesObj.items=_.reject(e.propertiesObj.items,(function(e){return"image"===e.key})),e.propertiesNotFiltered=e.propertiesObj.items}),(function(e){c.warning(getError(e.data),"Error")}))}function _e(e){Ne("predicate","var(--primary-color-dark)",e),Ne("predicates","var(--primary-color-dark)",e);const t=document.getElementsByClassName("link");t&&_.each(t,(function(t){const n=t.__data__;(n.source.iri.indexOf(e.iri)>=0||n.target.iri.indexOf(e.iri)>=0)&&(t.style.stroke="var(--primary-color-dark)",t.style.strokeWidth=4)}));const n=document.getElementsByClassName("arrow-marker");n&&_.each(n,(function(t){const n=t.__data__;(n.source.iri.indexOf(e.iri)>=0||n.target.iri.indexOf(e.iri)>=0)&&(t.style.stroke="var(--primary-color-dark)",t.__data__.target.isTriple||t.setAttribute("refX","23"))}))}function Ne(e,t,n){const r=document.getElementsByClassName(e);r&&_.each(r,(function(e){const r=e.__data__;n?((r.source.iri.indexOf(n.iri)>=0||r.target.iri.indexOf(n.iri)>=0)&&(e.style.fill=t),j(n.iri)===z(r)&&(e.textContent=n.pred,e.style.fill=t),n.oppLinkIRI&&n.oppLinkIRI===z(r)&&(e.textContent=n.oppTriplePred,e.style.fill=t)):(e.style.fill=t,e.textContent=Me(r))}))}function Pe(){_.each(e.predicates,(function(e){const t=document.getElementById(e.linkId+e.nodeIndex);t&&(t.style.fontWeight="normal")}));const t=document.getElementsByClassName("link");t&&_.each(t,(function(e){e.style.stroke="#999",e.style.strokeWidth=1})),Ne("predicate",""),Ne("predicates","");const n=document.getElementsByClassName("arrow-marker");n&&_.each(n,(function(e){e.style.stroke="#999",e.__data__.target.isTriple||e.setAttribute("refX","59")}))}function Ae(e){const t=j(e);if(se.tripleNodes.has(t))return se.tripleNodes.get(t).find(t=>t.iri===e)}function Me(e){return e.predicates.length>1?e.predicates.length+" predicates":Oe(e.predicates[0])}function Oe(t){const n=e.replaceIRIWithPrefix(t);return n.length===t.length?t.split("/")[t.split("/").length-1]:n}e.toggleSidePanel=function(){e.pageslideExpanded=!e.pageslideExpanded},e.closeInfoPanel=function(){e.pageslideExpanded=!1,e.openedNodeInfoPanel=void 0,e.predicates=[],ie=null,l((function(){e.showInfoPanel=!1}))},e.clickLink=function(t){if(se.tripleNodes.has(t.linkId)){Pe();const n=se.tripleNodes.get(t.linkId)[t.nodeIndex];Te(n),e.showPredicates=!0;const r=document.getElementById(t.linkId+t.nodeIndex);r&&(r.style.fontWeight="bold");const i={},o=se.tripleLinksCopy.values();for(let e=0;e<se.tripleLinksCopy.size;e++){const e=o.next().value;e.length>1&&e.every(t=>t.source.iri===n.iri?(i.iri=e[0].source.iri,t.target.isTriple&&(i.oppLinkIRI=j(t.target.iri),i.oppTriplePred=Oe(t.target.iri.split(" ")[1])),i.pred=Oe(n.iri.split(" ")[1]),1===t.predicates.length&&(i.linkPred=t.predicates[0]),!1):t.target.iri!==n.iri||(i.iri=e[0].target.iri,t.source.isTriple&&(i.oppLinkIRI=j(t.source.iri),i.oppTriplePred=Oe(t.source.iri.split(" ")[1])),i.pred=Oe(n.iri.split(" ")[1]),1===t.predicates.length&&(i.linkPred=t.predicates[0]),!1))}i.iri||(i.iri=n.iri,i.pred=Oe(n.iri.split(" ")[1])),_e(i)}},e.splitPredicate=function(e){return e.split("/")[e.split("/").length-1]},e.getActiveRepository=function(){return n.getActiveRepository()},e.isLoadingLocation=function(){return n.isLoadingLocation()},e.hasActiveLocation=function(){return n.hasActiveLocation()},e.rotate=function(e){be();const t=10*(e?1:-1)*Math.PI/180,n=Math.cos(t),r=Math.sin(t),i=te/2,o=ne/2;d3.selectAll(".node-wrapper").each((function(e){e.x=i+(n*(e.x-i)+r*(e.y-o)),e.y=o+(-r*(e.x-i)+n*(e.y-o)),e.fixed&&(e.fx=e.x,e.fy=e.y)})),fe.alpha(1).restart()},e.openUri=function(t,n){if(!n){const n={};e.configLoaded.id!==e.defaultGraphConfig.id&&(n.config=e.configLoaded.id),n.uri=t,N(n,{uri:t,config:e.configLoaded})}e.$broadcast("onRootNodeChange",t)},e.saveOrUpdateGraph=function(){const t=JSON.stringify(se.copyState()),n={id:e.lastSavedGraphId,name:e.lastSavedGraphName,data:t,shared:e.shared};n.id?e.saveGraphModal("update",n):e.saveGraphModal("new",n)},e.renameSavedGraph=function(t){e.saveGraphModal("rename",{id:t.id,name:t.name,config:t.config,shared:t.shared})};const Ee=function(t){S.editSavedGraph(t).success((function(){e.lastSavedGraphName=t.name,e.shared=t.shared,e.refreshSavedGraphs(),c.success(C.instant("graphexplore.saved.graph.was.edited",{name:t.name}))})).error((function(e){const t=getError(e);c.error(t,C.instant("graphexplore.error.cannot.edit"))}))};e.saveGraphModal=function(t,n,r){y.open({templateUrl:"js/angular/graphexplore/templates/modal/save-graph.html",controller:"SaveGraphModalCtrl",resolve:{data:function(){return{mode:t,graph:n,graphExists:r,shared:n.shared}}}}).result.then((function(t){if(t.restart)e.saveGraphModal(t.mode,t.graph,!1);else switch(t.mode){case"new":!function(t){e.configLoaded&&(t.config=e.configLoaded.id),S.addNewSavedGraph(t).success((function(n,r,i){e.lastSavedGraphName=t.name,e.lastSavedGraphId=i()["x-saved-graph-id"],e.shared=t.shared,e.refreshSavedGraphs(),c.success(C.instant("graphexplore.saved.graph",{name:t.name}))})).error((function(n,r){if(422===r)e.saveGraphModal("new",t,!0);else{const e=getError(n);c.error(e,C.instant("graphexplore.error.cannot.create.graph"))}}))}(t.graph);break;case"update":case"rename":Ee(t.graph)}}))},e.refreshSavedGraphs=function(){S.getSavedGraphs().success((function(t){e.savedGraphs=t})).error((function(e){const t=getError(e);c.error(t,C.instant("graphexplore.error.getting.saved.graphs"))}))},e.loadSavedGraph=function(t,n){t.owner?(e.lastSavedGraphName=t.name,e.lastSavedGraphId=t.id,e.shared=t.shared,e.configLoaded=e.findConfigById(t.config)):(e.lastSavedGraphName=null,e.lastSavedGraphId=null,e.shared=t.shared),e.configLoaded||(e.configLoaded=e.defaultGraphConfig),f.url("?saved="+t.id),se.restoreState(JSON.parse(t.data)),n||N({saved:t.id},{savedGraph:t})},e.copyToClipboardSavedGraph=function(t){const n=[location.protocol,"//",location.host,location.pathname,"?saved=",t.id].join("");e.copyToClipboard(n)},e.deleteSavedGraph=function(t){m.openSimpleModal({title:C.instant("common.confirm"),message:C.instant("graphexplore.confirm.delete.graph",{graphName:t.name}),warning:!0}).result.then((function(){!function(t){S.deleteSavedGraph(t).success((function(){e.refreshSavedGraphs(),c.success(C.instant("graphexplore.saved.graph.was.deleted",{name:t.name}))})).error((function(e){const t=getError(e);c.error(t,C.instant("graphexplore.error.cannot.delete"))}))}(t)}))},e.openIRI=function(t,n){return n.shiftKey?e.$broadcast("onRootNodeChange",t):window.open(t,"_blank"),!1},e.togglePinAllNodes=function(){be();const t=angular.isUndefined(e.numberOfPinnedNodes)||e.numberOfPinnedNodes<=0;e.numberOfPinnedNodes=0,d3.selectAll(".node").each((function(n){n.fixed=t,t?(e.numberOfPinnedNodes++,n.fx=n.x,n.fy=n.y):(n.fx=null,n.fy=null)})),fe.alpha(1).restart()},$("body").on("keydown",(function(t){!b.isActive()&&"input"!==t.target.nodeName&&e.nodeSelected&&(37===t.keyCode?e.rotate(!0):39===t.keyCode&&e.rotate(!1))})),e.getLiteralFromPropValue=function(e){return e.substring(e.indexOf(":")+1)}}function c(e,t,n,r){switch(e.mode=n.mode,e.graph=_.cloneDeep(n.graph),e.graphExists=n.graphExists,e.mode){case"new":e.title=r.instant("graphexplore.create.new.graph"),e.okButtonText=r.instant("common.create.btn");break;case"update":e.title=r.instant("graphexplore.update"),e.okButtonText=r.instant("common.save.btn");break;case"rename":e.title=r.instant("graphexplore.rename"),e.okButtonText=r.instant("common.save.btn")}e.ok=function(){e.form.$valid&&t.close({graph:e.graph,mode:e.mode})},e.saveNew=function(){e.graph.name=e.graph.name+" (new)",t.close({graph:e.graph,mode:"new",restart:!0})},e.cancel=function(){t.dismiss("cancel")}}angular.module("graphdb.framework.graphexplore.controllers.graphviz",["ui.scroll.jqlite","ui.scroll","toastr","ui.bootstrap","ngTagsInput","graphdb.framework.utils.localstorageadapter"]).controller("GraphsVisualizationsCtrl",a).controller("SaveGraphModalCtrl",c).config(["$uibTooltipProvider",function(e){e.options({appendToBody:!0})}]),a.$inject=["$scope","$rootScope","$repositories","$licenseService","toastr","$timeout","ClassInstanceDetailsService","AutocompleteRestService","$q","$location","$jwtAuth","UiScrollService","ModalService","$uibModal","$window","LocalStorageAdapter","LSKeys","SavedGraphsRestService","GraphConfigRestService","GraphDataRestService","RDF4JRepositoriesRestService","$translate","GuidesService"],c.$inject=["$scope","$uibModalInstance","data","$translate"]},446:function(e,t,n){var r,i;r=[n(454)],void 0===(i=function(){function e(e,t){return e.each((function(){var e=t.apply(this,arguments),n=select(this);for(var r in e)n.attr(r,e[r])}))}function t(e,t){for(var n in t)e.attr(n,t[n]);return e}return"undefined"==typeof d3&&(d3=n(454)),d3.selection.prototype.attrs=function(n){return("function"==typeof n?e:t)(this,n)},d3.selection.prototype.moveToFront=function(){return this.each((function(){d3.select(this.parentNode.appendChild(this))}))},d3.selection.prototype.moveToBack=function(){return this.each((function(){const e=this.parentNode.firstChild;e&&this.parentNode.insertBefore(this,e)}))},d3}.apply(t,r))||(e.exports=i)},456:function(e,t,n){"use strict";n(446);var r=r||{};r.Text=function(){function e(e,t,n,r){n=n||10;var i=t/3;return"string"==typeof e?(i*=10/(e.substring(0,t/3).length+1.5),i+=1,e.match(/[\u0900-\u0DFF\u1100-\u11FF\u2E80-\u2EFF\u3000-\u9FFF]/)&&(i*=.6),i<n&&(i=n),Math.round(i)):(i<n&&(i=n),Math.round(i))}return{calcFontSizeRaw:e,calcFontSize:function(t,n,r,i){return e(t,n,r)+"px"},getTextWithElipsisIfNeeded:function(e,t){return"string"==typeof e&&e.length>t?e.substring(0,t-3)+"...":e}}}(),r.Transition={fadeIn:function(e,t){e.style("opacity",0).transition().duration(t).style("opacity",1)},fadeOut:function(e,t){e.style("opacity",1).transition().duration(t).style("opacity",0)}},r.Click=function(){const e=function(e,n){let r,i=1,o=arguments.length;for(;++i<o;)r=arguments[i],e[r]=t(e,n,n[r]);return e};function t(e,t,n){return function(){var r=n.apply(t,arguments);return r===t?e:r}}return{delayDblClick:function(){var t=d3.dispatch("click","dblclick");return e((function(e){var n,r=null;e.on("mousedown",(function(){n=d3.pointer(document.body),+new Date})),e.on("mouseup",(function(e,i){var o,s,a;(s=n,a=d3.pointer(document.body),Math.sqrt(Math.pow(s[0]-a[0],2),Math.pow(s[1]-a[1],2))>5)||(r?(window.clearTimeout(r),r=null,t.call("dblclick",e,e,i)):r=window.setTimeout((o=e,function(){t.call("click",o,o,i),r=null}),250))}))}),t,"on")}}}(),t.a=r},469:function(e,t,n){"use strict";t.a=function(){var e=function(){return"n"},t=function(){return[0,0]},n=function(){return" "},r=u(),i=null,o=null,s=null,a=null;function c(e){var t;i="svg"===(t=(t=e).node()).tagName.toLowerCase()?t:t.ownerSVGElement,o=i.createSVGPoint(),document.body.appendChild(r)}c.show=function(){var r=Array.prototype.slice.call(arguments);r[r.length-1]instanceof SVGElement&&(s=r.pop());var i,o=n.apply(this,r),u=t.apply(this,r),f=e.apply(this,r),h=p(),g=d.length,m=document.documentElement.scrollTop||document.body.scrollTop,y=document.documentElement.scrollLeft||document.body.scrollLeft,x=a.apply(this,r);for(h.html(o).style("opacity",1).style("pointer-events","all");g--;)h.classed(d[g],!1);const v=r.filter(e=>e instanceof Event);return i=l.get(f).apply(this,v),x?Object.keys(x).forEach((function(e){h.style(e,x[e])})):h.classed(f,!0).style("top",i.top+u[0]+m+"px").style("left",i.left+u[1]+y+"px"),c},c.hide=function(){return p().style("opacity",0).style("pointer-events","none"),c},c.attr=function(e,t){if(arguments.length<2&&"string"==typeof e)return p().attr(e);var n=Array.prototype.slice.call(arguments);return d3.selection.prototype.attr.apply(p(),n),c},c.style=function(e,t){if(arguments.length<2&&"string"==typeof e)return p().style(e);var n=Array.prototype.slice.call(arguments);return d3.selection.prototype.style.apply(p(),n),c},c.direction=function(t){return arguments.length?(e=null==t?t:h(t),c):e},c.offset=function(e){return arguments.length?(t=null==e?e:h(e),c):t},c.html=function(e){return arguments.length?(n=null==e?e:h(e),c):n},c.customPosition=function(e){return arguments.length?(a=null==e?e:h(e),c):a},c.destroy=function(){return r&&(p().remove(),r=null),c};var l=new Map(Object.entries({n:function(e){var t=f(e);return{top:t.n.y-r.offsetHeight,left:t.n.x-r.offsetWidth/2}},s:function(e){var t=f(e);return{top:t.s.y,left:t.s.x-r.offsetWidth/2}},e:function(e){var t=f(e);return{top:t.e.y-r.offsetHeight/2,left:t.e.x}},w:function(e){var t=f(e);return{top:t.w.y-r.offsetHeight/2,left:t.w.x-r.offsetWidth}},nw:function(e){var t=f(e);return{top:t.nw.y-r.offsetHeight,left:t.nw.x-r.offsetWidth}},ne:function(e){var t=f(e);return{top:t.ne.y-r.offsetHeight,left:t.ne.x}},sw:function(e){var t=f(e);return{top:t.sw.y,left:t.sw.x-r.offsetWidth}},se:function(e){var t=f(e);return{top:t.se.y,left:t.e.x}}})),d=l.keys();function u(){var e=d3.select(document.createElement("div"));return e.style("position","absolute").style("top",0).style("opacity",0).style("pointer-events","none").style("box-sizing","border-box"),e.node()}function p(){return null===r&&(r=u(),document.body.appendChild(r)),d3.select(r)}function f(e){for(var t=s||e.target;void 0===t.getScreenCTM&&"undefined"===t.parentNode;)t=t.parentNode;var n={},r=t.getScreenCTM(),i=t.getBBox(),a=i.width,c=i.height,l=i.x,d=i.y;return o.x=l,o.y=d,n.nw=o.matrixTransform(r),o.x+=a,n.ne=o.matrixTransform(r),o.y+=c,n.se=o.matrixTransform(r),o.x-=a,n.sw=o.matrixTransform(r),o.y-=c/2,n.w=o.matrixTransform(r),o.x+=a,n.e=o.matrixTransform(r),o.x-=a/2,o.y-=c/2,n.n=o.matrixTransform(r),o.y+=c,n.s=o.matrixTransform(r),n}function h(e){return"function"==typeof e?e:function(){return e}}return c}},73:function(e,t,n){"use strict";n.r(t),n.d(t,"removeSpecialChars",(function(){return i})),n.d(t,"toBoolean",(function(){return o})),n.d(t,"toTitleCase",(function(){return s}));var r=n(27);const i=e=>e.replace(/[()']/g,""),o=e=>"string"==typeof e?"true"===e:Boolean(e),s=e=>e?Object(r.upperFirst)(e.toLowerCase()):e},92:function(e,t,n){"use strict";n.r(t),n.d(t,"STATIC_RULESETS",(function(){return r})),n.d(t,"REPOSITORY_TYPES",(function(){return i})),n.d(t,"FILENAME_PATTERN",(function(){return o})),n.d(t,"NUMBER_PATTERN",(function(){return s}));const r=[{id:"empty",name:"No inference"},{id:"rdfs-optimized",name:"RDFS (Optimized)"},{id:"rdfs",name:"RDFS"},{id:"rdfsplus-optimized",name:"RDFS-Plus (Optimized)"},{id:"owl-horst-optimized",name:"OWL-Horst (Optimized)"},{id:"owl-horst",name:"OWL-Horst"},{id:"owl2-ql-optimized",name:"OWL2-QL (Optimized)"},{id:"owl2-ql",name:"OWL2-QL"},{id:"owl-max-optimized",name:"OWL-Max (Optimized)"},{id:"owl-max",name:"OWL-Max"},{id:"owl2-rl-optimized",name:"OWL2-RL (Optimized)"},{id:"owl2-rl",name:"OWL2-RL"}],i={graphdbRepo:"graphdb",free:"free",eeWorker:"worker",eeMaster:"master",ontop:"ontop",se:"se",fedx:"fedx"},o=new RegExp("^[a-zA-Z0-9-_]+$"),s=new RegExp("^[0-9]+$")}}]);
1
+ (window.webpackJsonp=window.webpackJsonp||[]).push([[28,240,274],{180:function(e,t,n){"use strict";n.r(t);n(7);var r=n(456),i=n(469),o=(n(10),n(92)),s=n(73);function a(e,t,n,a,c,l,d,u,p,f,h,g,m,y,x,v,I,S,w,k,L,C,b){e.languageChanged=!1,e.propertiesObj={},e.propertiesObj.items=[],e.propertiesQueryObj={},e.propertiesQueryObj.query="",e.propertiesSearchPlaceholder=C.instant("visual.search.instance.placeholder"),e.propertiesNotFiltered=[],e.searchVisible=!1,e.nodeSelected=!1,e.queryResultsMode=!1,e.embedded=f.search().embedded,e.openedNodeInfoPanel=void 0,e.invalidLimit=!1,e.INVALID_LINKS_MSG=C.instant("sidepanel.invalid.limit.links.msg"),e.INVALID_LINKS_TOOLTIP=C.instant("sidepanel.invalid.limit.links.tooltip"),e.datasource=void 0,e.adapterContainer={adapter:{remain:!0}},e.hasInitedRepository=!1,e.defaultSettings={linksLimit:20,includeInferred:!0,sameAsState:!0,languages:["en"],showLinksText:!0,preferredTypes:[],rejectedTypes:[],preferredPredicates:[],rejectedPredicates:["http://dbpedia.org/property/logo","http://dbpedia.org/property/hasPhotoCollection","http://dbpedia.org/property/website","http://dbpedia.org/property/homepage","http://dbpedia.org/ontology/thumbnail","http://xmlns.com/foaf/0.1/depiction","http://xmlns.com/foaf/0.1/homepage","http://xmlns.com/foaf/0.1/mbox","http://dbpedia.org/ontology/wikiPage*","http://dbpedia.org/property/wikiPage*","http://factforge.net/*"],preferredTypesOnly:!1,preferredPredicatesOnly:!1,includeSchema:!0},e.saveSettings=_.cloneDeep(e.defaultSettings),e.defaultGraphConfig={id:"default",name:"Easy graph",startMode:"search"},t.key="",e.onopen=e.onclose=()=>angular.noop(),e.goToHome=()=>{P(),f.url("graphs-visualizations")},e.shouldShowSettings=()=>e.configLoaded&&e.configLoaded.id===e.defaultGraphConfig.id,e.shouldDisableSameAs=()=>{const t=$("#sameAsCheck");return e.settings&&!e.settings.includeInferred&&t.prop("checked")&&(t.prop("checked",!1),e.settings.sameAsState=!1),e.settings&&!e.settings.includeInferred},e.propertiesFilterFunc=t=>t.key.toLowerCase().indexOf(e.propertiesQueryObj.query.toLowerCase())>=0,e.toggleMoreInfo=e=>{angular.element(e.currentTarget).parent().next().toggle(200),angular.element(e.currentTarget).children("span").toggleClass("icon-caret-down").toggleClass("icon-caret-up")},e.copyToClipboard=e=>{m.openCopyToClipboardModal(e)},e.resetSettings=()=>{e.settings=_.cloneDeep(e.defaultSettings),e.validateLinksLimit(),O()},e.changeLimit=t=>{let n=e.settings.linksLimit+t;n<1&&(n=1),n>1e3&&(n=1e3),e.settings.linksLimit=n},e.validateLinksLimit=()=>{e.invalidLimit=!o.NUMBER_PATTERN.test(e.settings.linksLimit)},e.showSettings=()=>{e.showInfoPanel=!0,e.showFilter=!0,e.showNodeInfo=!1,e.showPredicates=!1,e.saveSettings?e.settings=_.cloneDeep(e.saveSettings):e.settings=_.cloneDeep(e.defaultSettings),O()},e.updateSettings=()=>{e.invalidLimit?c.error(e.INVALID_LINKS_TOOLTIP,e.INVALID_LINKS_MSG):(e.saveSettings=e.settings,e.saveSettings.languages=_.map(e.saveSettings.languagesMap,(function(e){return e.text})),e.saveSettings.preferredTypes=_.map(e.saveSettings.preferredTypesMap,(function(e){return e.text})),e.saveSettings.rejectedTypes=_.map(e.saveSettings.rejectedTypesMap,(function(e){return e.text})),e.saveSettings.preferredPredicates=_.map(e.saveSettings.preferredPredicatesMap,(function(e){return e.text})),e.saveSettings.rejectedPredicates=_.map(e.saveSettings.rejectedPredicatesMap,(function(e){return e.text})),e.rootNodeIri?E(e.rootNodeIri):e.queryResultsMode&&f.search().query?G(f.search().query,f.search().sameAs,f.search().inference):"query"===e.configLoaded.startMode&&W(e.configLoaded),M(),e.showInfoPanel=!1,e.showFilter=!1,v.set(I.GRAPHS_VIZ,e.saveSettings))},e.getGraphConfigs=t=>{w.getGraphConfigs().success((function(n){e.graphConfigs=n,t&&t()})).error((function(e){c.error(getError(e),C.instant("graphexplore.error.graph.configs.short.msg"))}))},e.findConfigById=function(t){return t===e.defaultGraphConfig.id?e.defaultGraphConfig:$.grep(e.graphConfigs,(function(e){return e.id===t}))[0]},e.easyGraphSearch=t=>{e.configLoaded=e.defaultGraphConfig,e.openUri(t)},e.deleteConfig=t=>{m.openSimpleModal({title:C.instant("common.confirm"),message:C.instant("graphexplore.delete.graph",{configName:t.name}),warning:!0}).result.then((function(){w.deleteGraphConfig(t).success((function(){e.getGraphConfigs(),e.refreshSavedGraphs()})).error((function(e){c.error(getError(e),C.instant("graphexplore.error.cannot.delete.config"))}))}))},e.goToGraphConfig=e=>{N({config:e.id},{config:e}),P(),W(e)},e.replaceIRIWithPrefix=t=>{const n=e.namespaces,r=_.findLast(n,(function(e){return 0===t.indexOf(e.uri)}));return r?r.prefix+":"+t.substring(r.uri.length):t};const T=[];t.$on("$translateChangeSuccess",(function(){e.INVALID_LINKS_MSG=C.instant("sidepanel.invalid.limit.links.msg"),e.INVALID_LINKS_TOOLTIP=C.instant("sidepanel.invalid.limit.links.tooltip"),e.propertiesSearchPlaceholder=C.instant("visual.search.instance.placeholder")})),e.$on("autocompleteStatus",(function(){ce()})),e.$on("repositoryIsSet",(function(t,n){n.newRepo&&(e.hasInitedRepository=!1),ae(n.newRepo),n.newRepo&&(P(),$(".graph-visualization svg").empty(),f.search().query&&(e.goToHome(),R()))}));T.push(t.$watch(()=>t.key,()=>{q=0,_.each(e.propertiesObj.items,(function(e){t.key>e&&q++})),H++}));T.push(e.$watch("propertiesObj.items",()=>{angular.isDefined(e.propertiesObj.items)&&e.propertiesObj.items.length>0&&l((function(){e.adapterContainer.adapter.reload()}),500)}));e.$on("$destroy",()=>{T.forEach(e=>e())});const N=(t,n)=>{e.embedded&&(t.embedded=!0),f.search(t),f.state(n)},P=()=>{e.searchVisible=!1,e.nodeSelected=!1,e.configLoaded=null,e.queryResultsMode=!1,e.lastSavedGraphName=null,e.lastSavedGraphId=null,e.shared=!1,e.numberOfPinnedNodes=0,K={},Z=0},A=()=>b.isActive()?e.defaultSettings:e.saveSettings,M=()=>{A().showLinksText?d3.selectAll("svg .link-wrapper text").style("display","block"):d3.selectAll("svg .link-wrapper text").style("display","none")},O=()=>{e.settings.languagesMap=_.map(e.settings.languages,(function(e){return{text:e}})),e.settings.preferredTypesMap=_.map(e.settings.preferredTypes,(function(e){return{text:e}})),e.settings.rejectedTypesMap=_.map(e.settings.rejectedTypes,(function(e){return{text:e}})),e.settings.preferredPredicatesMap=_.map(e.settings.preferredPredicates,(function(e){return{text:e}})),e.settings.rejectedPredicatesMap=_.map(e.settings.rejectedPredicates,(function(e){return{text:e}}))},E=()=>{e.rootNodeIri&&e.$broadcast("onRootNodeChange",e.rootNodeIri)},R=()=>{f.search().query?(e.searchVisible=!1,e.queryResultsMode=!0,G(f.search().query,f.search().sameAs,f.search().inference)):e.$on("onRootNodeChange",(function(t,n){e.loading=!0;const r=A();angular.isDefined(n)&&(e.rootNodeIri=n,k.getInstanceNode({iri:n,config:e.configLoaded?e.configLoaded.id:e.defaultGraphConfig.id,languages:e.shouldShowSettings()?r.languages:[],includeInferred:r.includeInferred,sameAsState:r.sameAsState}).then((function(t){e.nodeSelected=!0,e.searchVisible=!1,null===t.data.types&&(t.data.types="greyColor"),se=new oe;const n=se.addNode(t.data,te/2,ne/2);ee=X,Ce(n,!0)})).catch((function(t){e.loading=!1,c.error(getError(t),C.instant("graphexplore.error.could.not.load.graph"))})))})),f.search().uri&&e.openUri(f.search().uri,!0),f.search().saved&&S.getSavedGraph(f.search().saved).success((function(t){e.loadSavedGraph(t)})).error((function(e){const t=getError(e);c.error(t,C.instant("graphexplore.error.could.not.open"))}))},G=(t,n,r)=>{const i=A(),o=void 0===n?i.sameAsState:!0===n,s=void 0===r?i.includeInferred:!0===r;e.loading=!0,k.updateGraph({query:t,linksLimit:i.linksLimit,languages:e.shouldShowSettings()?i.languages:[],includeInferred:s,sameAsState:o}).then((function(e){ke(e)}),(function(t){e.loading=!1,c.error(getError(t.data),C.instant("graphexplore.error.cannot.load.graph"))}))},j=(e,t)=>{const n=e.split(" ");return t?[n[0],n[1],n[2]].join(">"):[n[0],n[2]].join(">")},z=e=>[e.source.iri,e.target.iri].join(">"),D=e=>{if(e.isTriple){const t=document.getElementById(Object(s.removeSpecialChars)(j(e.iri)));if(t&&void 0!==t.__data__.x)return t.__data__.x}return e.x},F=e=>{if(e.isTriple){const t=document.getElementById(Object(s.removeSpecialChars)(j(e.iri)));if(t&&void 0!==t.__data__.y)return t.__data__.y}return e.y},B=e=>{const t=e.trim().split(" ");return`<<<${t[0]}> <${t[1]}> <${t[2]}>>>`},U=e=>{const t=e.source.isTriple?j(e.source.iri,!0):e.source.iri,n=e.target.isTriple?j(e.target.iri,!0):e.target.iri;return Object(s.removeSpecialChars)(`${t}>${n}>marker`)},W=t=>{e.configLoaded=t,"search"===t.startMode?e.searchVisible=!0:"node"===t.startMode&&t.startIRI?l((function(){e.openUri(t.startIRI,!0)}),0):"query"===t.startMode&&t.startGraphQuery&&(e.loading=!0,w.loadGraphForConfig(t,t.startQueryIncludeInferred,A().linksLimit,t.startQuerySameAs).then((function(e){ke(e)}),(function(t){e.loading=!1,c.error(getError(t),C.instant("graphexplore.error.graph.load"))})))},V=function(){var t,n;f.search().config?(t=f.search().config,n=R,t===e.defaultGraphConfig.id?W(e.defaultGraphConfig):w.getConfig(t).then(e=>{W(e),n()}).catch(e=>{c.error(getError(e),C.instant("graphexplore.error.could.not.load.config",{configId:t}))})):f.search().query||f.search().uri?(W(e.defaultGraphConfig),R()):R()};x.onpopstate=function(t){P(),t.state&&(t.state.config?(W(t.state.config),t.state.uri&&e.openUri(t.state.uri,!0)):t.state.savedGraph&&e.loadSavedGraph(t.state.savedGraph,!0))},e.embedded&&(f.search().query||f.search().uri||f.search().config||f.search().saved)&&(e.noGoHome=!0);let q=0,H=0,K={},Z=0;const Q=16,J=d3.zoom().scaleExtent([.1,10]);let Y;const X=d3.zoomIdentity.translate(0,-70).scale(1);J.on("zoom",(function(e){b.isActive()||(ee=e.transform,Y.attr("transform",ee))}));let ee=X;const te=1e3,ne=1e3;let re,ie;function oe(){this.nodes=[],this.links=[],this.tripleNodes=new Map,this.tripleLinksCopy=new Map,this.addNode=function(e,t,n){return e.x=t,e.y=n,this.nodes.push(e),e},this.computeConnectedness=function(){const e={},t={};_.each(this.links,(function(n){const r=n.source.iri,i=n.target.iri,o=_.min([r,i])+"|"+_.max([r,i]);t[o]||(t[o]=1,e[r]=(e[r]||0)+1,e[i]=(e[i]||0)+1)})),_.each(this.links,(function(t){e[t.source.iri]>1&&e[t.target.iri]>1?t.connectedness=Math.min(5,Math.max(e[t.source.iri],e[t.target.iri])-1):t.connectedness=0}))},this.addAndMatchLinks=function(e){const t=this.nodes;Array.prototype.push.apply(this.links,function(e,t){return _.map(e,(function(e){let n,r;n=e.isTripleSource?Ae(e.source):_.find(t,(function(t){return t.iri===e.source})),r=e.isTripleTarget?Ae(e.target):_.find(t,(function(t){return t.iri===e.target}));let i={source:n,target:r,predicates:e.predicates};if(e.isTripleSource||e.isTripleTarget){let e=`${i.source.isTriple?j(i.source.iri):i.source.iri}>${i.target.isTriple?j(i.target.iri):i.target.iri}`;if(se.tripleLinksCopy.has(e)){let t=se.tripleLinksCopy.get(e);return t[0].predicates.push(...i.predicates),t.push(i),se.tripleLinksCopy.set(e,t),null}se.tripleLinksCopy.set(e,[i])}return i}))}(e,t));for(let e of se.tripleLinksCopy.keys())1===se.tripleLinksCopy.get(e).length&&se.tripleLinksCopy.delete(e);this.links=this.links.filter(e=>null!==e),this.computeConnectedness()};const t=function(e,t){return n(e,t).length};function n(e,t){return _.filter(t,(function(t){return t.source.iri===e.iri||t.target.iri===e.iri}))}this.countLinks=t,this.linksTypes=function(e,t){const r=n(e,t),i=_.map(r,(function(t){return t.source.iri===e.iri?t.target.types:t.source.types}));return _.uniq(_.flatten(i))},this.linksPredicates=function(e,t){const r=n(e,t),i=_.map(r,(function(e){return e.predicates}));return _.uniq(_.flatten(i))},this.removeTriples=function(e){let t=[];this.tripleNodes.size>0&&e.forEach(e=>{this.tripleNodes.has(e)&&(this.tripleNodes.delete(e),this.links=_.reject(this.links,(function(n){let r=e.split(">"),i=j(n.source.iri),o=j(n.target.iri);if(i===e&&se.tripleNodes.delete(o)){let e=o.split(">");t.push({source:e[0],target:e[1]})}let s=i===e||o===e||n.source.iri===r[0]&&n.target.iri===r[1];return s&&(se.tripleLinksCopy.delete(`${i}>${o}`),se.tripleLinksCopy.delete(`${o}>${i}`)),s})))}),t.forEach(e=>{this.links=_.reject(this.links,(function(t){return t.source.iri===e.source&&t.target.iri===e.target}))})},this.removeNode=function(n){let r=[];this.links=_.reject(this.links,(function(e){let t=e.source.iri===n.iri||e.target.iri===n.iri;return t&&(e.target.isTriple&&r.push(j(e.target.iri)),e.source.isTriple||e.target.isTriple||r.push([e.source.iri,e.target.iri].join(">"))),t})),this.removeTriples(r);const i=this.links;this.nodes=_.reject(this.nodes,(function(e){return 0===t(e,i)})),0===this.nodes.length&&(e.nodeSelected=!1),this.computeConnectedness()},this.removeNodeLeafLinks=function(e){let r=[],i=this.links;this.links=_.reject(this.links,(function(o){let s=o.source.iri===e.iri&&1===t(o.target,i)&&!o.target.isTriple||o.target.iri===e.iri&&1===t(o.source,i)&&!o.source.isTriple;if(!s){let r;if(o.source.iri!==e.iri||2!==t(o.target,i)||o.target.isTriple?o.target.iri!==e.iri||2!==t(o.source,i)||o.source.isTriple||(r=n(o.source,i)):r=n(o.target,i),!r)return!1;s=(r[0].source.iri===e.iri||r[0].target.iri)&&(r[1].source.iri===e.iri||r[1].target.iri)}return s&&(o.target.isTriple&&r.push(j(o.target.iri)),o.source.isTriple||o.target.isTriple||r.push([o.source.iri,o.target.iri].join(">"))),s})),this.removeTriples(r),i=this.links,this.nodes=_.reject(this.nodes,(function(n){return 0===t(n,i)&&n.iri!==e.iri})),this.computeConnectedness()},this.addTriple=function(e,t,n){e.x=t,e.y=n,e.weight=0;let r=j(e.iri);if(this.tripleNodes.has(r)){let t=this.tripleNodes.get(r);t.push(e),this.tripleNodes.set(r,t)}else e.weight=10,this.tripleNodes.set(r,[e])},this.copyState=function(){const e=_.map(this.nodes,(function(e){return{iri:e.iri,isTriple:e.isTriple,size:e.size,labels:_.cloneDeep(e.labels),types:_.cloneDeep(e.types),rdfRank:e.rdfRank,x:e.x,y:e.y,fixed:e.fixed}})),t=JSON.stringify(Array.from(this.tripleNodes.entries())),n=JSON.stringify(Array.from(this.tripleLinksCopy.entries()));return{nodes:e,links:_.map(this.links,(function(e){return{source:e.source.iri,isTripleSource:e.source.isTriple,target:e.target.iri,isTripleTarget:e.target.isTriple,predicates:e.predicates}})),tripleNodes:t,tripleLinksCopy:n,colorIndex:Z,type2color:K,transform:ee}},this.restoreState=function(t){e.nodeSelected=!0,e.searchVisible=!1,this.nodes=_.cloneDeep(t.nodes),this.tripleNodes=t.tripleNodes?new Map(JSON.parse(t.tripleNodes)):new Map,this.links=[],this.addAndMatchLinks(t.links),this.tripleLinksCopy=t.tripleLinksCopy?new Map(JSON.parse(t.tripleLinksCopy)):new Map,_.each(this.nodes,(function(t){t.fixed&&e.numberOfPinnedNodes++})),angular.isDefined(t.colorIndex)&&angular.isDefined(t.type2color)&&(Z=t.colorIndex,K=_.cloneDeep(t.type2color)),angular.isDefined(t.transform)&&(ee=d3.zoomIdentity.translate(t.transform.x,t.transform.y).scale(t.transform.k)),xe()}}e.datasource={get:function(t,n,r){return g.initLazyList(t,n,r,q,e.propertiesObj.items)},revision:function(){return H}},p.when(h.getPrincipal()).then(t=>(t=>{const n=t.appSettings;e.defaultSettings.includeInferred=n.DEFAULT_INFERENCE,e.defaultSettings.sameAsState=n.DEFAULT_INFERENCE&&n.DEFAULT_SAMEAS,e.defaultSettings.includeSchema=n.DEFAULT_VIS_GRAPH_SCHEMA;const r=v.get(I.GRAPHS_VIZ);if(r&&"object"==typeof r)try{e.saveSettings=r,void 0===e.saveSettings.includeSchema&&(e.saveSettings.includeSchema=e.defaultSettings.includeSchema,e.saveSettings.rejectedPredicates=[...e.saveSettings.rejectedPredicates,...e.defaultSettings.rejectedPredicates].unique())}catch(t){e.saveSettings=_.cloneDeep(e.defaultSettings),v.set(I.GRAPHS_VIZ,e.saveSettings)}else e.saveSettings=_.cloneDeep(e.defaultSettings)})(t)),e.showInfoPanel=!1;let se=new oe;function ae(t){!n.getActiveRepository()||e.hasInitedRepository&&!t||(e.hasInitedRepository=!0,t||e.getGraphConfigs(V),e.getNamespacesPromise=L.getNamespaces(e.getActiveRepository()).success((function(t){const n=_.map(t.results.bindings,(function(e){return{uri:e.namespace.value,prefix:e.prefix.value}}));e.namespaces=_.sortBy(n,(function(e){return e.uri.length})),ce()})).error((function(e){c.error(getError(e),C.instant("graphexplore.error.view.will.not.work"))})))}function ce(){a.isLicenseValid()&&(e.getAutocompletePromise=u.checkAutocompleteStatus())}e.addedTag=function(t){return t.text.indexOf(":")<0?(c.warning(C.instant("graphexplore.absolute.prefixed.iri")),null):(t.text=function(e,t){if(!/^<?(http|urn).*>?/.test(e)){const n=e.split(":"),r=n[0],i=n[1];if(!angular.isUndefined(i)){const e=d.getNamespaceUriForPrefix(t,r);if(e)return e+i}}return e}(t.text,e.namespaces),e.pageslideExpanded=!0,t)},e.validateTag=function(e,t,n){if(e.text.indexOf(":")<0)return n?c.warning(C.instant("graphexplore.absolute.prefixed.iri.option"),t):c.warning(C.instant("graphexplore.absolute.prefixed.iri"),t),!1;const r=e.text.indexOf("*");if(r>=0){if(!n)return c.warning(C.instant("graphexplore.wildcards.not.allowed"),t),!1;if(r<e.text.length-1)return c.warning(C.instant("graphexplore.wildcards.last.char"),t),!1}return!0},e.getTagClass=function(e){return e.endsWith("*")?"tag-item-wildcard":null},e.getActiveRepository=function(){return n.getActiveRepository()},e.isLicenseValid=function(){return a.isLicenseValid()},ae();const le=d3.scaleLinear().domain([0,9]).range(["hsl(0, 100%, 75%)","hsl(360, 90%, 82%)"]).interpolate(d3.interpolateHslLong),de=d3.scaleLinear().domain([0,9]).range(["hsl(180, 50%, 75%)","hsl(540, 40%, 82%)"]).interpolate(d3.interpolateHslLong);e.getColor=function(e){angular.isUndefined(K[e])&&(K[e]=Z,Z++);const t=K[e];return t>39?"#c2c2c2":t%2==0?le(t/2):de(t/2)};const ue=d3.forceX(te/2).strength(.005),pe=d3.forceY(ne/2).strength(.005),fe=d3.forceSimulation().force("x",ue).force("y",pe),he=d3.select(".main-container .graph-visualization").append("svg").attr("viewBox","0 0 "+te+" "+ne).attr("preserveAspectRatio","xMidYMid meet");he.append("rect").attr("width",10*te).attr("height",10*ne).attr("x",-(10*te-te)/2).attr("y",-(10*ne-ne)/2).style("fill","none").style("pointer-events","all").call(J).on("click",(function(e){e.stopPropagation(),be(),fe.stop()}));let ge=0,me=0;const ye=new function(){this.state=!1,this.setLoadingState=function(e){this.state=e},this.getLoadingState=function(){return this.state},this.init=function(e,t){d3.select(t).append("circle").attr("cx",(function(){return e.x})).attr("cy",(function(){return e.y})).attr("class","loader-container").attr("r",(function(){return e.size})).style("fill","fff").style("opacity","0.7"),d3.select(t).append("image").attr("xlink:href","js/angular/templates/loader/ot-loader.svg?v=2.7.5-TR1").attr("x",(function(){return e.x-e.size+5})).attr("y",(function(){return e.y-e.size})).attr("width",(function(){return 2*e.size})).attr("height",(function(){return 2*e.size})).attr("class","node-loader")}};function xe(t){d3.selectAll("svg g").remove(),d3.selectAll(".d3-tip").remove(),d3.selectAll(".menu-events").remove(),Y=he.append("g").attr("class","nodes-container").attr("transform",(function(){return angular.isDefined(ee)&&!t?ee:""}));const n=Object(i.a)().attr("class","d3-tip").customPosition((function(){const e=re.getBoundingClientRect();return{top:e.bottom+10+"px",left:e.left-30+"px"}})).html((function(t){let n="";return t.fixed&&(n+='<i class="icon-pin"></i>&nbsp;&nbsp;'),t.types.length>0?n+=_.join(_.map(t.types,(function(t){return e.replaceIRIWithPrefix(t)}))," · "):n+="<i>No types</i>",n})),o=function(e){let t="";return t+=_.join(_.map(e.predicates,(function(t,n){if(0===n)return Oe(t);if(n<10)return" · "+Oe(t);if(10===n){const t=function(e){return e.predicates.length-10}(e),n=t>1?t+" predicates":t+" predicate";return" · "+C.instant("graphexplore.tip.text",{textToShow:n})}})),""),t};let a;const d=Object(i.a)().attr("class","d3-tip").customPosition((function(e){const t=a.getBoundingClientRect(),n=function(e){const t=o(e),n=document.createElement("canvas").getContext("2d");return n.font="13px Arial",e.predicates.length<10?n.measureText(t).width:n.measureText(t).width/2}(e);return{top:t.top-30+"px",left:t.left-30+"px",width:n+"px"}})).html((function(e){return o(e)}));const u=function(){l.cancel(void 0),l.cancel(ge),re=null,n.hide(),me=l((function(){be()}),500)};he.call(n);he.call(d);let p=he.selectAll(".link"),f=he.selectAll(".node");const h=d3.forceCollide(e=>e.size+5).strength(.5),g=d3.forceManyBody().strength(-300),m=d3.forceCenter(te/2,ne/2);fe.nodes(se.nodes).force("charge",g).force("collide",h).force("center",m).force("link",d3.forceLink(se.links).distance((function(e){return e.source.isTriple||e.target.isTriple?0:function(e){const t=$("<span></span>"),n=e.predicates[0].split("/"),r=n[n.length-1];t.addClass("predicate-text").text(r),$("body").append(t);const i=t.width()+2*e.source.size+2*e.target.size+50;return t.remove(),.75*i}(e)+30*e.connectedness}))),Y.append("defs").selectAll("marker").data(se.links).enter().append("marker").attr("class","arrow-marker").attr("id",(function(e){return U(e)})).attr("viewBox","0 -5 10 10").attr("refX",(function(e){return e.target.isTriple?11:e.target.size+11})).attr("refY",0).attr("markerWidth",10).attr("markerHeight",10).attr("orient","auto").append("path").attr("d","M0,-5L10,0L0,5 L10,0 L0, -5"),p=Y.selectAll(".link").data(se.links).enter().append("g").attr("class","link-wrapper").attr("id",(function(e){return Object(s.removeSpecialChars)(z(e))})).append("line").attr("class","link").style("stroke-width",1).style("fill","transparent").style("marker-end",(function(e){return`url(#${U(e)})`}));const y=Y.selectAll(".link-wrapper").append("text").text((function(e){return Me(e)})).attr("class",(function(e){return e.predicates.length>1||se.tripleNodes.has(z(e))?"predicates":"predicate"})).attr("dy","-0.5em").style("text-anchor","middle").style("display",A().showLinksText?"":"none").on("mouseover",(function(e,t){e.stopPropagation(),function(e,t){l.cancel(void 0);const n=a=e.target;l((function(){a===n&&t.predicates.length>1&&d.show(t,a)}),300)}(e,t)})).on("mouseout",(function(){l.cancel(void 0),a=null,d.hide()})).on("click",(function(t,n){t.stopPropagation(),function(t,n){Pe();const r=z(n);if(1===n.predicates.length&&se.tripleNodes.has(r)){ie=null;const e=se.tripleNodes.get(r)[0];if(Se(e,this,t.button)){const t={};t.iri=e.iri,t.pred=Oe(e.iri.split(" ")[1]),_e(t)}return}!function(t){if(e.showNodeInfo=!1,e.showPredicates=t.predicates.length>1,e.showFilter=!1,e.showInfoPanel=!1,ie===t)return e.showNodeInfo=!1,e.showInfoPanel=!1,void(ie=null);ie=t,e.showPredicates&&(e.predicates=_.map(t.predicates,(function(e){const n=function(e,t){const n=z(t);return se.tripleNodes.has(n)?se.tripleNodes.get(n).findIndex(t=>t.iri.indexOf(e)>=0):-1}(e,t),r=n>-1;return{value:Oe(e),partOfTriple:r,linkId:r?z(t):"",nodeIndex:n}})),e.showInfoPanel=!0)}(n)}(t,n)}));let x,v=0,I=null,S=null;const w=function(t,n,r){let i=r||this.parentNode;Array.isArray(r)&&(i=r[n]);se.countLinks(t,se.links)<=A().linksLimit?Ce(t,!1,i):c.info(C.instant("graphexplore.increase.limit"),C.instant("graphexplore.node.at.max")),e.closeInfoPanel()};function k(e,t){let n,r,i,o,s=!0;if("down"===t)n=2*e.size,r=e.size/3,i=.8,o=.3;else if("down-fixed"===t)n=2*e.size,r=e.size,i=.8,o=.66;else if("up"===t)n=e.size/3,r=2*e.size,i=.3,o=.8;else{if("fixed"!==t)return;n=e.size,i=.66,s=!1}let a=Y.selectAll(".node-wrapper").filter((function(t){return t===e})).append("text").text("").classed("icon-any pinned",!0).style("font-size",n+"px").attr("x",(function(e){return e.x})).attr("y",(function(e){return e.y})).attr("opacity",i);"fixed"!==t&&"down-fixed"!==t||(e.pin=a),s&&(a=a.transition().duration(1e3).style("font-size",(function(){return r+"px"})).attr("opacity",o),"down-fixed"!==t&&a.remove())}const L=d3.drag().subject((function(e){return e})).on("start",(function(e,t){if(b.isActive())return;0===e.sourceEvent.button&&(t.fixedBeforeDrag=t.fixed,t.isBeingDragged=!0,t.beginDragging=!0,be(),d3.select(this).classed("dragging",!0),fe.alphaTarget(.3).restart())})).on("drag",(function(t,n){n.isBeingDragged&&(n.fx=t.x,n.fy=t.y,n.fixed?n.beginDragging&&k(n,"fixed"):(e.numberOfPinnedNodes++,n.fixed=!0,k(n,"down-fixed")),n.pinWasFixed=!0,n.beginDragging=null)})).on("end",(function(e,t){t.isBeingDragged&&(t.pinWasFixed&&(t.pinWasFixed=null,d3.select(".pinned").remove()),t.isBeingDragged=!1,d3.select(this).classed("dragging",!1));fe.alphaTarget(0)}));f=Y.selectAll(".node").data(se.nodes).enter().append("g").attr("class","node-wrapper").attr("id",(function(e){return e.iri})).append("circle").attr("class","node").attr("r",(function(e){return e.size})).style("fill",(function(t){return"greyColor"===t.types?"c2c2c2":e.getColor(t.types[0])})).on("mouseover",(function(t,r){r.isBeingDragged||(l.cancel(me),ge=l(()=>{(function(t,n){if(e.showInfoPanel)return!1;(Ie.closeIcon||Ie.expandIcon||Ie.focusIcon||Ie.copyURIIcon)&&Ie.removeIcons();if(fe.alpha()<.1)return Ie.initIcons(t,n.parentNode),fe.stop(),ve(),!0;return!1})(r,this)&&function(e,t){l.cancel(void 0);const r=re=t.target;l((function(){re===r&&n.show(e,re)}),300)}(r,t)},400))})).on("mouseout",u).on("click",(function(t,n){if(t.button&&0!==t.button)return;const r=this;if(I&&S===r)return l.cancel(I),I=null,void w(n,0,r.parentNode);S=r,u(),e.showPredicates=!1,b.isActive()||(l.cancel(I),I=l((function(){Se(n,r,t),I=null}),540))})).on("touchstart",(e,t)=>function(e){v=0,x=l((function(){v<5&&we(e),x=null}),1e3)}(t)).on("touchmove",(function(){v++})).on("touchend",(function(){l.cancel(x),x=null})).on("contextmenu",(function(t,r){t.shiftKey||(t.preventDefault(),be(),e.closeInfoPanel(),r.fixed?(e.numberOfPinnedNodes--,r.fixed=!1,r.fx=null,r.fy=null,k(r,"up"),fe.alpha(1).restart()):(e.numberOfPinnedNodes++,r.fixed=!0,k(r,"down")),function(e){re&&n.show(e,re)}(r))})).on("gdb-expand-node",(e,t)=>w(t,0,e.srcElement.parentNode)).on("gdb-show-node-info",(e,t)=>Te(t)).call(L);const T=Y.selectAll(".node-wrapper").append("foreignObject").style("pointer-events","none").attr("width",(function(e){return 2*e.size*1.75}));Y.insert("g").attr("class","menu-events"),(e=>{e.each((function(e){e.fontSize=r.a.Text.calcFontSizeRaw(e.labels[0].label,e.size,Q,!0)})).attr("height",(function(e){return 3*e.fontSize})).append("xhtml:div").attr("class","node-label-body").style("font-size",(function(e){return e.fontSize+"px"})).append("xhtml:div").text((function(e){return e.labels[0].label})),l((function(){$(".node-label-body div").each((function(e,t){let n=t.textContent.substring(0,t.textContent.length-1);let r=0;for(;r<200&&(t.scrollHeight>t.clientHeight||t.scrollWidth>t.clientWidth);)n=n.substring(0,n.length-1),t.textContent=n+"…",r++}))}),50)})(T),fe.on("tick",(function(){p.attr("x1",(function(e){return D(e.source)})).attr("y1",(function(e){return F(e.source)})).attr("x2",(function(e){return D(e.target)})).attr("y2",(function(e){return F(e.target)})),y.attr("x",(function(e){let t=D(e.source),n=D(e.target);return e.x=.5*(t+n)})).attr("y",(function(e){let t=F(e.source),n=F(e.target);return e.y=.5*(t+n)})).attr("transform",(function(e){return"rotate("+function(e,t){const n={x:D(e.source),y:F(e.source)},r={x:D(e.target),y:F(e.target)};if(t)return 180*Math.atan2(r.y-n.y,r.x-n.x)/Math.PI;{const e=180*Math.atan2(r.y-n.y,r.x-n.x)/Math.PI;return e<=90&&e>=-90?e:(e>0?-1:1)*(180-Math.abs(e))}}(e,e.direction)+", "+e.x+", "+e.y+")"})),f.attr("cx",(function(e){return e.x})).attr("cy",(function(e){return e.y})),Y.select(".node-loader").attr("x",(function(e){return e.x-e.size+3})).attr("y",(function(e){return e.y-e.size})),Y.select(".loader-container").attr("cx",(function(e){return e.x})).attr("cy",(function(e){return e.y})),T.attr("x",(function(e){return e.x-1.75*e.size})).attr("y",(function(e){return e.y-3*e.fontSize/2})),d3.select(".pinned").attr("x",(function(e){return e.x})).attr("y",(function(e){return e.y})),ve()})),angular.isDefined(ye)&&ye.setLoadingState(!1),e.loading&&(e.loading=!1),d3.selectAll(".link-wrapper").each((function(){const e=$(this).attr("id").split(">")[0],t=$(this).attr("id").split(">")[1];d3.selectAll(".link").each((function(n){const r=Object(s.removeSpecialChars)(n.source.iri),i=Object(s.removeSpecialChars)(n.target.iri);if(r===t&&i===e){let e=r;e+=">",e+=i;const t=document.createTextNode(" ⟶");document.getElementById(e).lastChild.appendChild(t),n.direction="double"}}))})),d3.selectAll(".d3-actions-tip").remove(),fe.alpha(.3).restart()}function ve(){t.d3alpha=fe.alpha()}const Ie=new function(){function n(e,t){return"translate("+(t.x-14+(t.size+15)*Math.cos(e*Math.PI/180-Math.PI/2))+","+(t.y-14+(t.size+15)*Math.sin(e*Math.PI/180-Math.PI/2))+")"}this.closeIcon=void 0,this.expandIcon=void 0,this.collapseIcon=void 0,this.focusIcon=void 0,this.copyURIIcon=void 0,this.actionsTip=void 0,this.removeIcons=function(){this.closeIcon.remove("g"),this.expandIcon&&this.expandIcon.remove("g"),this.collapseIcon&&this.collapseIcon.remove("g"),this.focusIcon.remove("g"),this.copyURIIcon.remove("g"),this.closeIcon=void 0,this.expandIcon=void 0,this.collapseIcon=void 0,this.focusIcon=void 0,this.copyURIIcon=void 0,this.expandedState=!1},this.expandedState=!1,this.initIcons=function(r,o){const s=Object(i.a)().attr("class","d3-tip d3-actions-tip").customPosition((function(e,t){const n=t.target.getBoundingClientRect();return{top:n.top-20+"px",left:n.right+10+"px"}})).html((function(e){return e}));he.call(s);r.isExpanded?(this.collapseIcon=d3.select(".menu-events").append("g").attr("class","collapse-icon").attr("name","collapse").attr("transform",(function(){return n(20,r)})),this.collapseIcon.append("circle").attr("cx",14).attr("cy",14).attr("r",13).style("fill","#eee"),this.collapseIcon.append("path").attr("d","M22.67,12a.59.59,0,0,1-.53.65l-6.88.72H15.2a.59.59,0,0,1-.59-.65l.72-6.88A.58.58,0,0,1,16,5.33a.59.59,0,0,1,.53.65L16,11.11,21.3,5.79a.64.64,0,0,1,.91.91L16.89,12,22,11.49A.59.59,0,0,1,22.67,12ZM12.59,14.75l-6.75.85a.59.59,0,0,0-.51.66.58.58,0,0,0,.66.51l4.95-.62-5.2,5.2a.64.64,0,1,0,.91.91l5.2-5.2L11.23,22a.59.59,0,0,0,.51.66h.07a.59.59,0,0,0,.59-.52l.85-6.75a.59.59,0,0,0-.17-.49A.58.58,0,0,0,12.59,14.75Z").style("fill","var(--primary-color)"),this.collapseIcon.on("click",(function(){var e;(e=r).isExpanded=!1,se.removeNodeLeafLinks(e),xe()})).on("mouseover",(function(e){s.show(this.getAttribute("name"),e),l.cancel(ge),l.cancel(me)})).on("mouseout",(function(){s.hide(),me=l((function(){be()}),500)}))):(this.expandIcon=d3.select(".menu-events").append("g").attr("class","expand-icon").attr("name","expand").attr("transform",(function(){return n(20,r)})),this.expandIcon.append("circle").attr("cx",14).attr("cy",14).attr("r",13).style("fill","#eee"),this.expandIcon.append("path").attr("d","M22.37,6.28l-.72,6.88a.59.59,0,0,1-.59.53H21a.59.59,0,0,1-.53-.65L21,7.9l-5.32,5.32a.64.64,0,0,1-.91-.91L20.1,7,15,7.53a.59.59,0,0,1-.12-1.18l6.88-.72a.59.59,0,0,1,.65.65ZM12.89,20.34,7.95,21l5.2-5.2a.64.64,0,0,0-.91-.91L7,20.05l.62-4.95A.59.59,0,0,0,6.48,15l-.85,6.75a.59.59,0,0,0,.59.67h.07L13,21.52a.59.59,0,1,0-.15-1.18Z").style("fill","var(--primary-color)"),this.expandIcon.on("click",(function(){Ce(r,!1,o)})).on("mouseover",(function(e){s.show(this.getAttribute("name"),e),l.cancel(me),l.cancel(ge)})).on("mouseout",(function(){s.hide(),me=l((function(){be()}),500)}))),this.focusIcon=d3.select(".menu-events").append("g").attr("class","focus-icon").attr("name","focus").attr("transform",(function(){return n(20,r)})),this.focusIcon.append("circle").attr("cx",14).attr("cy",14).attr("r",13).style("fill","#eee"),this.focusIcon.append("path").attr("d","M14.2,23.81a9.8,9.8,0,1,1,6.93-2.87h0A9.74,9.74,0,0,1,14.2,23.81Zm0-18.17a8.37,8.37,0,1,0,5.92,14.29h0A8.37,8.37,0,0,0,14.2,5.64Zm1.42,6.95a2,2,0,1,0,0,2.85A2,2,0,0,0,15.62,12.59Z").style("fill","var(--primary-color)"),this.focusIcon.on("click",(function(){t.$broadcast("onRootNodeChange",r.iri)})).on("mouseover",(function(e){s.show(this.getAttribute("name"),e),l.cancel(me),l.cancel(ge)})).on("mouseout",(function(){s.hide(),me=l((function(){be()}),500)})),this.copyURIIcon=d3.select(".menu-events").append("g").attr("class","icon-link").attr("name","link").attr("transform",(function(){return n(20,r)})),this.copyURIIcon.append("circle").attr("cx",14).attr("cy",14).attr("r",13).style("fill","#eee"),this.copyURIIcon.append("path").attr("d","M 13.457031 10.164062 C 13.648438 10.164062 13.820312 10.242188 13.941406 10.363281 L 15.492188 11.859375 C 15.984375 12.332031 16.292969 12.992188 16.292969 13.714844 C 16.292969 14.441406 15.984375 15.097656 15.492188 15.574219 L 10.394531 20.496094 C 9.902344 20.972656 9.222656 21.265625 8.472656 21.265625 C 7.71875 21.265625 7.039062 20.972656 6.546875 20.496094 L 4.996094 19 C 4.507812 18.523438 4.203125 17.867188 4.203125 17.144531 C 4.203125 16.421875 4.507812 15.765625 4.996094 15.289062 L 7.542969 12.824219 C 7.667969 12.707031 7.84375 12.628906 8.035156 12.628906 C 8.417969 12.628906 8.726562 12.929688 8.726562 13.300781 C 8.726562 13.484375 8.648438 13.652344 8.523438 13.773438 L 5.976562 16.234375 C 5.738281 16.46875 5.589844 16.792969 5.589844 17.148438 C 5.589844 17.503906 5.738281 17.824219 5.976562 18.058594 L 7.527344 19.566406 C 7.773438 19.792969 8.105469 19.929688 8.472656 19.929688 C 8.835938 19.929688 9.167969 19.792969 9.414062 19.566406 L 14.511719 14.644531 C 14.753906 14.410156 14.90625 14.089844 14.90625 13.730469 C 14.90625 13.375 14.753906 13.054688 14.511719 12.820312 L 12.964844 11.324219 C 12.839844 11.203125 12.761719 11.039062 12.761719 10.855469 C 12.761719 10.488281 13.070312 10.1875 13.449219 10.1875 Z M 17.082031 3.976562 C 17.082031 3.976562 17.085938 3.976562 17.085938 3.976562 C 17.824219 3.976562 18.492188 4.261719 18.980469 4.722656 L 20.535156 6.203125 C 21.042969 6.679688 21.355469 7.34375 21.355469 8.082031 C 21.355469 8.792969 21.058594 9.441406 20.582031 9.914062 L 18.0625 12.402344 C 17.9375 12.527344 17.761719 12.605469 17.566406 12.605469 C 17.183594 12.605469 16.875 12.304688 16.875 11.9375 C 16.875 11.753906 16.949219 11.589844 17.070312 11.46875 L 19.605469 8.984375 C 19.847656 8.75 19.996094 8.429688 19.996094 8.070312 C 19.996094 7.714844 19.847656 7.394531 19.605469 7.160156 L 18.019531 5.667969 C 17.773438 5.445312 17.4375 5.304688 17.070312 5.300781 C 16.703125 5.304688 16.367188 5.453125 16.128906 5.691406 L 11.085938 10.667969 C 10.84375 10.898438 10.695312 11.222656 10.695312 11.578125 C 10.695312 11.933594 10.84375 12.257812 11.085938 12.488281 L 12.675781 13.980469 C 12.804688 14.101562 12.882812 14.273438 12.882812 14.457031 C 12.882812 14.828125 12.574219 15.128906 12.191406 15.128906 C 12.003906 15.128906 11.832031 15.054688 11.707031 14.9375 L 10.140625 13.457031 C 9.636719 12.980469 9.324219 12.316406 9.324219 11.582031 C 9.324219 10.863281 9.621094 10.214844 10.101562 9.742188 L 15.140625 4.765625 C 15.625 4.285156 16.304688 3.980469 17.054688 3.976562 Z M 17.082031 3.976562").style("fill","var(--primary-color)"),this.copyURIIcon.on("click",(function(){e.copyToClipboard(r.iri),be(),s.hide()})).on("mouseover",(function(e){s.show("<div style='text-align: center;'><b>Copy to ClipBoard</b><br>"+r.iri+"</div>",e),l.cancel(me),l.cancel(ge)})).on("mouseout",(function(){s.hide(),me=l((function(){be()}),500)})),this.closeIcon=d3.select(".menu-events").append("g").attr("class","close-icon").attr("name","remove").attr("transform",(function(){return n(20,r)})),this.closeIcon.append("circle").attr("cx",14).attr("cy",14).attr("r",13).style("fill","#eee"),this.closeIcon.append("path").attr("d","M14.94,14l5.87-5.87a.66.66,0,1,0-.94-.94L14,13.06,8.13,7.19a.66.66,0,0,0-.94.94L13.06,14,7.19,19.87a.66.66,0,1,0,.94.94L14,14.94l5.87,5.87a.66.66,0,1,0,.94-.94Z").style("fill","var(--primary-color)"),this.closeIcon.on("click",(function(){we(r)})).on("mouseover",(function(e){s.show(this.getAttribute("name"),e),l.cancel(me),l.cancel(ge)})).on("mouseout",(function(){s.hide(),me=l((function(){be()}),500)})),this.animateMenu(r)},this.animateMenu=function(e){const t=d3.easeSin;let r=0;let i=20;this.expandIcon&&this.expandIcon.transition().duration(100).style("opacity",1).ease(t).attr("transform",(function(){return n(i,e)})).delay(r+=35),this.collapseIcon&&this.collapseIcon.transition().duration(100).style("opacity",1).ease(t).attr("transform",(function(){return n(i,e)})).delay(r+=35),this.copyURIIcon.transition().duration(100).style("opacity",1).ease(t).attr("transform",(function(){return i+=30,n(i,e)})).delay(r+=35),this.focusIcon.transition().duration(100).style("opacity",1).ease(t).attr("transform",(function(){return i+=30,n(i,e)})).delay(r+=35),this.closeIcon.transition().duration(100).style("opacity",1).ease(t).attr("transform",(function(){return i+=30,n(i,e)})).delay(r+=35),this.expandedState=!0}};function Se(n,r,i){return e.showInfoPanel=!1,e.showPredicates=!1,e.showNodeInfo=!1,i.shiftKey&&(i.ctrlKey||i.metaKey)?(t.$broadcast("onRootNodeChange",n.iri),!1):i.ctrlKey||i.metaKey?(we(n),!1):void 0!==e.openedNodeInfoPanel&&e.openedNodeInfoPanel===n?(e.pageslideExpanded=!1,e.openedNodeInfoPanel=void 0,!1):(Te(n),!0)}function we(e){se.removeNode(e),xe()}function ke(t){!function(t){e.nodeSelected=!0,null===t.data.types&&(t.data.types="greyColor"),se=new oe,ee=X}(t),Le(t)}function Le(t,n,r){let i=t.data;i=_.filter(i,(function(e){return-1===_.findIndex(se.links,(function(t){return e.source===t.source.iri&&e.target===t.target.iri}))}));const o=[],s=se.tripleLinksCopy.values();for(let e=0;e<se.tripleLinksCopy.size;e++){s.next().value.forEach(e=>{o.push(e)})}i=_.filter(i,(function(e){return-1===_.findIndex(o,(function(t){return e.source===t.source.iri&&e.target===t.target.iri}))})),i=_.filter(i,(function(e){return e.source!==e.target}));const a=((e,t)=>{const n=t.map(t=>t[e]);return t.filter((t,r)=>n.indexOf(t[e])===r)})("iri",_.union(_.flatten(_.map(t.data,(function(e){return[{iri:e.source,isTriple:e.isTripleSource},{iri:e.target,isTriple:e.isTripleTarget}]}))))),l=_.map(se.nodes,(function(e){return{iri:e.iri,isTriple:Boolean(e.isTriple)}})),d=se.tripleNodes.values();for(let e=0;e<se.tripleNodes.size;e++){d.next().value.forEach(e=>{l.push({iri:e.iri,isTriple:e.isTriple})})}const u=_.reject(a,(function(e){return _.some(l,e)}));if(0===u.length)(r||0===i.length)&&c.info(C.instant("graphexplore.error.node.connections")),se.addAndMatchLinks(i),xe();else{const t=[],r=[],o=A();_.forEach(u,(function(n,i){t.push(k.getInstanceNode({iri:n.isTriple?B(n.iri):n.iri,config:e.configLoaded.id,languages:e.shouldShowSettings()?o.languages:[],includeInferred:o.includeInferred,sameAsState:o.sameAsState}).then((function(e){r[i]=e.data})))})),p.all(t).then((function(){_.forEach(r,(function(e,t){const i=2*Math.PI*t/r.length,o=(n?n.x:0)+Math.cos(i)*ne/3,s=(n?n.y:0)+Math.sin(i)*ne/3;e.isTriple?se.addTriple(e,o,s):se.addNode(e,o,s)})),se.addAndMatchLinks(i),n&&(n.isExpanded=!0),xe()}))}}function Ce(t,n,r){if(ye.getLoadingState())return;ye.init(t,r);const i=A(),o=t.iri;k.getInstanceNodeLinks({iri:o,linksLimit:i.linksLimit,includeInferred:i.includeInferred,config:e.configLoaded.id,preferredTypes:e.shouldShowSettings()?i.preferredTypes:[],rejectedTypes:e.shouldShowSettings()?i.rejectedTypes:[],preferredPredicates:e.shouldShowSettings()?i.preferredPredicates:[],rejectedPredicates:e.shouldShowSettings()?i.rejectedPredicates:[],preferredTypesOnly:e.shouldShowSettings()?i.preferredTypesOnly:[],preferredPredicatesOnly:e.shouldShowSettings()?i.preferredPredicatesOnly:[],languages:e.shouldShowSettings()?i.languages:[],sameAsState:i.sameAsState,includeSchema:i.includeSchema}).then((function(e){Le(e,t,n)}),(function(t){const n=getError(t.data);c.error(n,C.instant("graphexplore.error.exploring.node")),e.loading=!1,ye.setLoadingState(!1)}))}function be(){angular.isDefined(Ie)&&Ie.expandedState&&Ie.removeIcons()}function Te(t){fe.stop(),e.openedNodeInfoPanel=t,e.showNodeInfo=!0,e.showFilter=!1,e.showPredicates=!1,e.nodeLabels=t.labels,e.nodeTypes=t.types,e.rdfRank=t.rdfRank,e.nodeIri=t.iri,e.resourceType=t.isTriple?"triple":"uri",e.encodedIri=t.isTriple?encodeURIComponent(B(t.iri)):encodeURIComponent(t.iri),e.showInfoPanel=!0,e.rdfsLabel=t.labels[0].label,e.rdfsComment=t.comment,e.expanded=!1,e.propertiesQueryObj.query="",e.dataNodeKeysQuery="";const n=A();k.getProperties({iri:t.isTriple?B(t.iri):t.iri,config:e.configLoaded.id,languages:e.shouldShowSettings()?n.languages:[],includeInferred:n.includeInferred,sameAsState:n.sameAsState,rejectedPredicates:e.shouldShowSettings()?n.rejectedPredicates:[]}).then((function(t){e.data=_.mapKeys(t.data,(function(t,n){return e.replaceIRIWithPrefix(n)})),e.propertiesObj.items=[],_.forEach(e.data,(function(t,n){e.propertiesObj.items.push({key:n,value:t})})),e.nodeImage=void 0,e.propertiesNotFiltered=e.propertiesObj.items;const n=_.find(e.propertiesObj.items,(function(e){return"image"===e.key}));n&&(e.nodeImage=n.value[0].v),e.propertiesObj.items=_.reject(e.propertiesObj.items,(function(e){return"image"===e.key})),e.propertiesNotFiltered=e.propertiesObj.items}),(function(e){c.warning(getError(e.data),"Error")}))}function _e(e){Ne("predicate","var(--primary-color-dark)",e),Ne("predicates","var(--primary-color-dark)",e);const t=document.getElementsByClassName("link");t&&_.each(t,(function(t){const n=t.__data__;(n.source.iri.indexOf(e.iri)>=0||n.target.iri.indexOf(e.iri)>=0)&&(t.style.stroke="var(--primary-color-dark)",t.style.strokeWidth=4)}));const n=document.getElementsByClassName("arrow-marker");n&&_.each(n,(function(t){const n=t.__data__;(n.source.iri.indexOf(e.iri)>=0||n.target.iri.indexOf(e.iri)>=0)&&(t.style.stroke="var(--primary-color-dark)",t.__data__.target.isTriple||t.setAttribute("refX","23"))}))}function Ne(e,t,n){const r=document.getElementsByClassName(e);r&&_.each(r,(function(e){const r=e.__data__;n?((r.source.iri.indexOf(n.iri)>=0||r.target.iri.indexOf(n.iri)>=0)&&(e.style.fill=t),j(n.iri)===z(r)&&(e.textContent=n.pred,e.style.fill=t),n.oppLinkIRI&&n.oppLinkIRI===z(r)&&(e.textContent=n.oppTriplePred,e.style.fill=t)):(e.style.fill=t,e.textContent=Me(r))}))}function Pe(){_.each(e.predicates,(function(e){const t=document.getElementById(e.linkId+e.nodeIndex);t&&(t.style.fontWeight="normal")}));const t=document.getElementsByClassName("link");t&&_.each(t,(function(e){e.style.stroke="#999",e.style.strokeWidth=1})),Ne("predicate",""),Ne("predicates","");const n=document.getElementsByClassName("arrow-marker");n&&_.each(n,(function(e){e.style.stroke="#999",e.__data__.target.isTriple||e.setAttribute("refX","59")}))}function Ae(e){const t=j(e);if(se.tripleNodes.has(t))return se.tripleNodes.get(t).find(t=>t.iri===e)}function Me(e){return e.predicates.length>1?e.predicates.length+" predicates":Oe(e.predicates[0])}function Oe(t){const n=e.replaceIRIWithPrefix(t);return n.length===t.length?t.split("/")[t.split("/").length-1]:n}e.toggleSidePanel=function(){e.pageslideExpanded=!e.pageslideExpanded},e.closeInfoPanel=function(){e.pageslideExpanded=!1,e.openedNodeInfoPanel=void 0,e.predicates=[],ie=null,l((function(){e.showInfoPanel=!1}))},e.clickLink=function(t){if(se.tripleNodes.has(t.linkId)){Pe();const n=se.tripleNodes.get(t.linkId)[t.nodeIndex];Te(n),e.showPredicates=!0;const r=document.getElementById(t.linkId+t.nodeIndex);r&&(r.style.fontWeight="bold");const i={},o=se.tripleLinksCopy.values();for(let e=0;e<se.tripleLinksCopy.size;e++){const e=o.next().value;e.length>1&&e.every(t=>t.source.iri===n.iri?(i.iri=e[0].source.iri,t.target.isTriple&&(i.oppLinkIRI=j(t.target.iri),i.oppTriplePred=Oe(t.target.iri.split(" ")[1])),i.pred=Oe(n.iri.split(" ")[1]),1===t.predicates.length&&(i.linkPred=t.predicates[0]),!1):t.target.iri!==n.iri||(i.iri=e[0].target.iri,t.source.isTriple&&(i.oppLinkIRI=j(t.source.iri),i.oppTriplePred=Oe(t.source.iri.split(" ")[1])),i.pred=Oe(n.iri.split(" ")[1]),1===t.predicates.length&&(i.linkPred=t.predicates[0]),!1))}i.iri||(i.iri=n.iri,i.pred=Oe(n.iri.split(" ")[1])),_e(i)}},e.splitPredicate=function(e){return e.split("/")[e.split("/").length-1]},e.getActiveRepository=function(){return n.getActiveRepository()},e.isLoadingLocation=function(){return n.isLoadingLocation()},e.hasActiveLocation=function(){return n.hasActiveLocation()},e.rotate=function(e){be();const t=10*(e?1:-1)*Math.PI/180,n=Math.cos(t),r=Math.sin(t),i=te/2,o=ne/2;d3.selectAll(".node-wrapper").each((function(e){e.x=i+(n*(e.x-i)+r*(e.y-o)),e.y=o+(-r*(e.x-i)+n*(e.y-o)),e.fixed&&(e.fx=e.x,e.fy=e.y)})),fe.alpha(1).restart()},e.openUri=function(t,n){if(!n){const n={};e.configLoaded.id!==e.defaultGraphConfig.id&&(n.config=e.configLoaded.id),n.uri=t,N(n,{uri:t,config:e.configLoaded})}e.$broadcast("onRootNodeChange",t)},e.saveOrUpdateGraph=function(){const t=JSON.stringify(se.copyState()),n={id:e.lastSavedGraphId,name:e.lastSavedGraphName,data:t,shared:e.shared};n.id?e.saveGraphModal("update",n):e.saveGraphModal("new",n)},e.renameSavedGraph=function(t){e.saveGraphModal("rename",{id:t.id,name:t.name,config:t.config,shared:t.shared})};const Ee=function(t){S.editSavedGraph(t).success((function(){e.lastSavedGraphName=t.name,e.shared=t.shared,e.refreshSavedGraphs(),c.success(C.instant("graphexplore.saved.graph.was.edited",{name:t.name}))})).error((function(e){const t=getError(e);c.error(t,C.instant("graphexplore.error.cannot.edit"))}))};e.saveGraphModal=function(t,n,r){y.open({templateUrl:"js/angular/graphexplore/templates/modal/save-graph.html",controller:"SaveGraphModalCtrl",resolve:{data:function(){return{mode:t,graph:n,graphExists:r,shared:n.shared}}}}).result.then((function(t){if(t.restart)e.saveGraphModal(t.mode,t.graph,!1);else switch(t.mode){case"new":!function(t){e.configLoaded&&(t.config=e.configLoaded.id),S.addNewSavedGraph(t).success((function(n,r,i){e.lastSavedGraphName=t.name,e.lastSavedGraphId=i()["x-saved-graph-id"],e.shared=t.shared,e.refreshSavedGraphs(),c.success(C.instant("graphexplore.saved.graph",{name:t.name}))})).error((function(n,r){if(422===r)e.saveGraphModal("new",t,!0);else{const e=getError(n);c.error(e,C.instant("graphexplore.error.cannot.create.graph"))}}))}(t.graph);break;case"update":case"rename":Ee(t.graph)}}))},e.refreshSavedGraphs=function(){S.getSavedGraphs().success((function(t){e.savedGraphs=t})).error((function(e){const t=getError(e);c.error(t,C.instant("graphexplore.error.getting.saved.graphs"))}))},e.loadSavedGraph=function(t,n){t.owner?(e.lastSavedGraphName=t.name,e.lastSavedGraphId=t.id,e.shared=t.shared,e.configLoaded=e.findConfigById(t.config)):(e.lastSavedGraphName=null,e.lastSavedGraphId=null,e.shared=t.shared),e.configLoaded||(e.configLoaded=e.defaultGraphConfig),f.url("?saved="+t.id),se.restoreState(JSON.parse(t.data)),n||N({saved:t.id},{savedGraph:t})},e.copyToClipboardSavedGraph=function(t){const n=[location.protocol,"//",location.host,location.pathname,"?saved=",t.id].join("");e.copyToClipboard(n)},e.deleteSavedGraph=function(t){m.openSimpleModal({title:C.instant("common.confirm"),message:C.instant("graphexplore.confirm.delete.graph",{graphName:t.name}),warning:!0}).result.then((function(){!function(t){S.deleteSavedGraph(t).success((function(){e.refreshSavedGraphs(),c.success(C.instant("graphexplore.saved.graph.was.deleted",{name:t.name}))})).error((function(e){const t=getError(e);c.error(t,C.instant("graphexplore.error.cannot.delete"))}))}(t)}))},e.openIRI=function(t,n){return n.shiftKey?e.$broadcast("onRootNodeChange",t):window.open(t,"_blank"),!1},e.togglePinAllNodes=function(){be();const t=angular.isUndefined(e.numberOfPinnedNodes)||e.numberOfPinnedNodes<=0;e.numberOfPinnedNodes=0,d3.selectAll(".node").each((function(n){n.fixed=t,t?(e.numberOfPinnedNodes++,n.fx=n.x,n.fy=n.y):(n.fx=null,n.fy=null)})),fe.alpha(1).restart()},$("body").on("keydown",(function(t){!b.isActive()&&"input"!==t.target.nodeName&&e.nodeSelected&&(37===t.keyCode?e.rotate(!0):39===t.keyCode&&e.rotate(!1))})),e.getLiteralFromPropValue=function(e){return e.substring(e.indexOf(":")+1)}}function c(e,t,n,r){switch(e.mode=n.mode,e.graph=_.cloneDeep(n.graph),e.graphExists=n.graphExists,e.mode){case"new":e.title=r.instant("graphexplore.create.new.graph"),e.okButtonText=r.instant("common.create.btn");break;case"update":e.title=r.instant("graphexplore.update"),e.okButtonText=r.instant("common.save.btn");break;case"rename":e.title=r.instant("graphexplore.rename"),e.okButtonText=r.instant("common.save.btn")}e.ok=function(){e.form.$valid&&t.close({graph:e.graph,mode:e.mode})},e.saveNew=function(){e.graph.name=e.graph.name+" (new)",t.close({graph:e.graph,mode:"new",restart:!0})},e.cancel=function(){t.dismiss("cancel")}}angular.module("graphdb.framework.graphexplore.controllers.graphviz",["ui.scroll.jqlite","ui.scroll","toastr","ui.bootstrap","ngTagsInput","graphdb.framework.utils.localstorageadapter"]).controller("GraphsVisualizationsCtrl",a).controller("SaveGraphModalCtrl",c).config(["$uibTooltipProvider",function(e){e.options({appendToBody:!0})}]),a.$inject=["$scope","$rootScope","$repositories","$licenseService","toastr","$timeout","ClassInstanceDetailsService","AutocompleteRestService","$q","$location","$jwtAuth","UiScrollService","ModalService","$uibModal","$window","LocalStorageAdapter","LSKeys","SavedGraphsRestService","GraphConfigRestService","GraphDataRestService","RDF4JRepositoriesRestService","$translate","GuidesService"],c.$inject=["$scope","$uibModalInstance","data","$translate"]},446:function(e,t,n){var r,i;r=[n(454)],void 0===(i=function(){function e(e,t){return e.each((function(){var e=t.apply(this,arguments),n=select(this);for(var r in e)n.attr(r,e[r])}))}function t(e,t){for(var n in t)e.attr(n,t[n]);return e}return"undefined"==typeof d3&&(d3=n(454)),d3.selection.prototype.attrs=function(n){return("function"==typeof n?e:t)(this,n)},d3.selection.prototype.moveToFront=function(){return this.each((function(){d3.select(this.parentNode.appendChild(this))}))},d3.selection.prototype.moveToBack=function(){return this.each((function(){const e=this.parentNode.firstChild;e&&this.parentNode.insertBefore(this,e)}))},d3}.apply(t,r))||(e.exports=i)},456:function(e,t,n){"use strict";n(446);var r=r||{};r.Text=function(){function e(e,t,n,r){n=n||10;var i=t/3;return"string"==typeof e?(i*=10/(e.substring(0,t/3).length+1.5),i+=1,e.match(/[\u0900-\u0DFF\u1100-\u11FF\u2E80-\u2EFF\u3000-\u9FFF]/)&&(i*=.6),i<n&&(i=n),Math.round(i)):(i<n&&(i=n),Math.round(i))}return{calcFontSizeRaw:e,calcFontSize:function(t,n,r,i){return e(t,n,r)+"px"},getTextWithElipsisIfNeeded:function(e,t){return"string"==typeof e&&e.length>t?e.substring(0,t-3)+"...":e}}}(),r.Transition={fadeIn:function(e,t){e.style("opacity",0).transition().duration(t).style("opacity",1)},fadeOut:function(e,t){e.style("opacity",1).transition().duration(t).style("opacity",0)}},r.Click=function(){const e=function(e,n){let r,i=1,o=arguments.length;for(;++i<o;)r=arguments[i],e[r]=t(e,n,n[r]);return e};function t(e,t,n){return function(){var r=n.apply(t,arguments);return r===t?e:r}}return{delayDblClick:function(){var t=d3.dispatch("click","dblclick");return e((function(e){var n,r=null;e.on("mousedown",(function(){n=d3.pointer(document.body),+new Date})),e.on("mouseup",(function(e,i){var o,s,a;(s=n,a=d3.pointer(document.body),Math.sqrt(Math.pow(s[0]-a[0],2),Math.pow(s[1]-a[1],2))>5)||(r?(window.clearTimeout(r),r=null,t.call("dblclick",e,e,i)):r=window.setTimeout((o=e,function(){t.call("click",o,o,i),r=null}),250))}))}),t,"on")}}}(),t.a=r},469:function(e,t,n){"use strict";t.a=function(){var e=function(){return"n"},t=function(){return[0,0]},n=function(){return" "},r=u(),i=null,o=null,s=null,a=null;function c(e){var t;i="svg"===(t=(t=e).node()).tagName.toLowerCase()?t:t.ownerSVGElement,o=i.createSVGPoint(),document.body.appendChild(r)}c.show=function(){var r=Array.prototype.slice.call(arguments);r[r.length-1]instanceof SVGElement&&(s=r.pop());var i,o=n.apply(this,r),u=t.apply(this,r),f=e.apply(this,r),h=p(),g=d.length,m=document.documentElement.scrollTop||document.body.scrollTop,y=document.documentElement.scrollLeft||document.body.scrollLeft,x=a.apply(this,r);for(h.html(o).style("opacity",1).style("pointer-events","all");g--;)h.classed(d[g],!1);const v=r.filter(e=>e instanceof Event);return i=l.get(f).apply(this,v),x?Object.keys(x).forEach((function(e){h.style(e,x[e])})):h.classed(f,!0).style("top",i.top+u[0]+m+"px").style("left",i.left+u[1]+y+"px"),c},c.hide=function(){return p().style("opacity",0).style("pointer-events","none"),c},c.attr=function(e,t){if(arguments.length<2&&"string"==typeof e)return p().attr(e);var n=Array.prototype.slice.call(arguments);return d3.selection.prototype.attr.apply(p(),n),c},c.style=function(e,t){if(arguments.length<2&&"string"==typeof e)return p().style(e);var n=Array.prototype.slice.call(arguments);return d3.selection.prototype.style.apply(p(),n),c},c.direction=function(t){return arguments.length?(e=null==t?t:h(t),c):e},c.offset=function(e){return arguments.length?(t=null==e?e:h(e),c):t},c.html=function(e){return arguments.length?(n=null==e?e:h(e),c):n},c.customPosition=function(e){return arguments.length?(a=null==e?e:h(e),c):a},c.destroy=function(){return r&&(p().remove(),r=null),c};var l=new Map(Object.entries({n:function(e){var t=f(e);return{top:t.n.y-r.offsetHeight,left:t.n.x-r.offsetWidth/2}},s:function(e){var t=f(e);return{top:t.s.y,left:t.s.x-r.offsetWidth/2}},e:function(e){var t=f(e);return{top:t.e.y-r.offsetHeight/2,left:t.e.x}},w:function(e){var t=f(e);return{top:t.w.y-r.offsetHeight/2,left:t.w.x-r.offsetWidth}},nw:function(e){var t=f(e);return{top:t.nw.y-r.offsetHeight,left:t.nw.x-r.offsetWidth}},ne:function(e){var t=f(e);return{top:t.ne.y-r.offsetHeight,left:t.ne.x}},sw:function(e){var t=f(e);return{top:t.sw.y,left:t.sw.x-r.offsetWidth}},se:function(e){var t=f(e);return{top:t.se.y,left:t.e.x}}})),d=l.keys();function u(){var e=d3.select(document.createElement("div"));return e.style("position","absolute").style("top",0).style("opacity",0).style("pointer-events","none").style("box-sizing","border-box"),e.node()}function p(){return null===r&&(r=u(),document.body.appendChild(r)),d3.select(r)}function f(e){for(var t=s||e.target;void 0===t.getScreenCTM&&"undefined"===t.parentNode;)t=t.parentNode;var n={},r=t.getScreenCTM(),i=t.getBBox(),a=i.width,c=i.height,l=i.x,d=i.y;return o.x=l,o.y=d,n.nw=o.matrixTransform(r),o.x+=a,n.ne=o.matrixTransform(r),o.y+=c,n.se=o.matrixTransform(r),o.x-=a,n.sw=o.matrixTransform(r),o.y-=c/2,n.w=o.matrixTransform(r),o.x+=a,n.e=o.matrixTransform(r),o.x-=a/2,o.y-=c/2,n.n=o.matrixTransform(r),o.y+=c,n.s=o.matrixTransform(r),n}function h(e){return"function"==typeof e?e:function(){return e}}return c}},73:function(e,t,n){"use strict";n.r(t),n.d(t,"removeSpecialChars",(function(){return i})),n.d(t,"toBoolean",(function(){return o})),n.d(t,"toTitleCase",(function(){return s}));var r=n(27);const i=e=>e.replace(/[()']/g,""),o=e=>"string"==typeof e?"true"===e:Boolean(e),s=e=>e?Object(r.upperFirst)(e.toLowerCase()):e},92:function(e,t,n){"use strict";n.r(t),n.d(t,"STATIC_RULESETS",(function(){return r})),n.d(t,"REPOSITORY_TYPES",(function(){return i})),n.d(t,"FILENAME_PATTERN",(function(){return o})),n.d(t,"NUMBER_PATTERN",(function(){return s}));const r=[{id:"empty",name:"No inference"},{id:"rdfs-optimized",name:"RDFS (Optimized)"},{id:"rdfs",name:"RDFS"},{id:"rdfsplus-optimized",name:"RDFS-Plus (Optimized)"},{id:"owl-horst-optimized",name:"OWL-Horst (Optimized)"},{id:"owl-horst",name:"OWL-Horst"},{id:"owl2-ql-optimized",name:"OWL2-QL (Optimized)"},{id:"owl2-ql",name:"OWL2-QL"},{id:"owl-max-optimized",name:"OWL-Max (Optimized)"},{id:"owl-max",name:"OWL-Max"},{id:"owl2-rl-optimized",name:"OWL2-RL (Optimized)"},{id:"owl2-rl",name:"OWL2-RL"}],i={graphdbRepo:"graphdb",free:"free",eeWorker:"worker",eeMaster:"master",ontop:"ontop",se:"se",fedx:"fedx"},o=new RegExp("^[a-zA-Z0-9-_]+$"),s=new RegExp("^[0-9]+$")}}]);