graphdb-workbench
Version:
The web application for GraphDB APIs
1 lines • 60.3 kB
JavaScript
(window.webpackJsonp=window.webpackJsonp||[]).push([[27,81],{206:function(e,t,n){"use strict";var i=i||{};i.Text=function(){function e(e,t,n,i){n=n||10;var r=t/3;return"string"==typeof e?(r*=10/(e.substring(0,t/3).length+1.5),r+=1,e.match(/[\u0900-\u0DFF\u1100-\u11FF\u2E80-\u2EFF\u3000-\u9FFF]/)&&(r*=.6),r<n&&(r=n),Math.round(r)):(r<n&&(r=n),Math.round(r))}return{calcFontSizeRaw:e,calcFontSize:function(t,n,i,r){return e(t,n,i)+"px"},getTextWithElipsisIfNeeded:function(e,t){return"string"==typeof e&&e.length>t?e.substring(0,t-3)+"...":e}}}(),i.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)}},i.Click={delayDblClick:function(){var e=d3.dispatch("click","dblclick");return d3.rebind((function(t){var n,i=null;t.on("mousedown",(function(){n=d3.mouse(document.body),new Date})),t.on("mouseup",(function(t){var r,o;r=n,o=d3.mouse(document.body),Math.sqrt(Math.pow(r[0]-o[0],2),Math.pow(r[1]-o[1],2))>5||(i?(window.clearTimeout(i),i=null,e.dblclick(t)):i=window.setTimeout((d3.event,function(){e.click(t),i=null}),250))}))}),e,"on")}},t.a=i},209:function(e,t,n){var i,r,o;r=[],void 0===(o="function"==typeof(i=function(){return function(){var e=function(){return"n"},t=function(){return[0,0]},n=function(){return" "},i=u(),r=null,o=null,a=null,s=null;function l(e){var t;r="svg"===(t=(t=e).node()).tagName.toLowerCase()?t:t.ownerSVGElement,o=r.createSVGPoint(),document.body.appendChild(i)}l.show=function(){var i=Array.prototype.slice.call(arguments);i[i.length-1]instanceof SVGElement&&(a=i.pop());var r,o=n.apply(this,i),u=t.apply(this,i),f=e.apply(this,i),h=p(),g=d.length,m=document.documentElement.scrollTop||document.body.scrollTop,y=document.documentElement.scrollLeft||document.body.scrollLeft,v=s.apply(this,i);for(h.html(o).style({opacity:1,"pointer-events":"all"});g--;)h.classed(d[g],!1);return r=c.get(f).apply(this),v?h.style(v):h.classed(f,!0).style({top:r.top+u[0]+m+"px",left:r.left+u[1]+y+"px"}),l},l.hide=function(){return p().style({opacity:0,"pointer-events":"none"}),l},l.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),l},l.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),l},l.direction=function(t){return arguments.length?(e=null==t?t:d3.functor(t),l):e},l.offset=function(e){return arguments.length?(t=null==e?e:d3.functor(e),l):t},l.html=function(e){return arguments.length?(n=null==e?e:d3.functor(e),l):n},l.customPosition=function(e){return arguments.length?(s=null==e?e:d3.functor(e),l):s},l.destroy=function(){return i&&(p().remove(),i=null),l};var c=d3.map({n:function(){var e=f();return{top:e.n.y-i.offsetHeight,left:e.n.x-i.offsetWidth/2}},s:function(){var e=f();return{top:e.s.y,left:e.s.x-i.offsetWidth/2}},e:function(){var e=f();return{top:e.e.y-i.offsetHeight/2,left:e.e.x}},w:function(){var e=f();return{top:e.w.y-i.offsetHeight/2,left:e.w.x-i.offsetWidth}},nw:function(){var e=f();return{top:e.nw.y-i.offsetHeight,left:e.nw.x-i.offsetWidth}},ne:function(){var e=f();return{top:e.ne.y-i.offsetHeight,left:e.ne.x}},sw:function(){var e=f();return{top:e.sw.y,left:e.sw.x-i.offsetWidth}},se:function(){var e=f();return{top:e.se.y,left:e.e.x}}}),d=c.keys();function u(){var e=d3.select(document.createElement("div"));return e.style({position:"absolute",top:0,opacity:0,"pointer-events":"none","box-sizing":"border-box"}),e.node()}function p(){return null===i&&(i=u(),document.body.appendChild(i)),d3.select(i)}function f(){for(var e=a||d3.event.target;void 0===e.getScreenCTM&&"undefined"===e.parentNode;)e=e.parentNode;var t={},n=e.getScreenCTM(),i=e.getBBox(),r=i.width,s=i.height,l=i.x,c=i.y;return o.x=l,o.y=c,t.nw=o.matrixTransform(n),o.x+=r,t.ne=o.matrixTransform(n),o.y+=s,t.se=o.matrixTransform(n),o.x-=r,t.sw=o.matrixTransform(n),o.y-=s/2,t.w=o.matrixTransform(n),o.x+=r,t.e=o.matrixTransform(n),o.x-=r/2,o.y-=s/2,t.n=o.matrixTransform(n),o.y+=s,t.s=o.matrixTransform(n),t}return l}})?i.apply(t,r):i)||(e.exports=o)},37:function(e,t,n){"use strict";n.r(t),n.d(t,"STATIC_RULESETS",(function(){return i})),n.d(t,"REPOSITORY_TYPES",(function(){return r})),n.d(t,"FILENAME_PATTERN",(function(){return o})),n.d(t,"NUMBER_PATTERN",(function(){return a})),n.d(t,"REPO_TOOLTIPS",(function(){return s}));const i=[{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"}],r={free:"free",eeWorker:"worker",eeMaster:"master",ontop:"ontop",se:"se",fedx:"fedx"},o=new RegExp("^[a-zA-Z0-9-_]+$"),a=new RegExp("^[0-9]+$"),s={id:"Unique identifier for the repository. The ID must contain only letters (a-z, A-Z), numbers (0-9), '-' and '_'.",title:"Human readable description of the repository.",readOnly:"Protects the repository against any changes.",ruleset:"Sets of axiomatic triples, consistency checks and entailment rules, which determine the applied semantics with a PIE file.",rulesetWarnings:{needsSameAs:"Disabling owl:sameAs for this ruleset may cause incomplete inference with owl:sameAs statements.",doesntNeedSameAs:"This ruleset does not need owl:sameAs, consider disabling it.",customRuleset:"If the custom ruleset does not use owl:sameAs, consider disabling it. <br>If the ruleset uses owl:sameAs, disabling it may cause incomplete inference with owl:sameAs statements."},disableSameAs:"GraphDB uses a non-rule implementation of owl:sameAs, which can be enabled or disabled independently of the ruleset.",checkForInconsistencies:"Enables the consistency checks from the ruleset.",isShacl:"Enables support for SHACL validation.",shaclOptions:{cacheSelectNodes:"The SHACL implementation retrieves a lot of its relevant data through running SPARQL Select queries against the repository and against the changes in the transaction. This is usually good for performance, but while validating large amounts of data disabling this cache will use less memory.",undefinedTargetValidatesAllSubjects:"If no target is defined for a NodeShape, that NodeShape will be ignored. Enabling this will make such NodeShapes wildcard shapes and validate all subjects. Equivalent to setting sh:targetClass to owl:Thing or rdfs:Resource in an environment with a reasoner.",logValidationPlans:"Log (INFO) the executed validation plans as GraphViz DOT. It is recommended to disable parallel validation when this is enabled.",logValidationViolations:"Log (INFO) a list of violations and the triples that caused the violations. It is recommended to disable parallel validation when this is enabled.",parallelValidation:"Run SHACL validation in parallel.",globalLogValidationExecution:"Log (INFO) every execution step of the SHACL validation. This is fairly costly and should not be used in production. It is recommended to disable parallel validation when this is enabled.",performanceLogging:"Log (INFO) the execution time per shape. It is recommended to disable parallel validation and caching of select nodes when this is enabled.",eclipseRdf4jShaclExtensions:"Activates RDF4J's SHACL extensions that provide additional functionality (experimental).",dashDataShapes:"Activates DASH Data Shapes extensions that provide additional functionality (experimental)."},entityIdSize:"Defines the bit size of internal IDs used to index entities (URIs, blank nodes, literals, and RDF* embedded triples).<br>Use 40 bit ID only if you expect more than 2 billion unique RDF values.",enableContextIndex:"Builds an additional Context-Predicate-Subject-Object index to boost the SPARQL query performance of queries with GRAPH/FROM/FROM NAMED clauses.",enablePredicateList:"Enables the mappings from an entity (subject or object) to its predicates; enabling it can significantly speed up queries that use wildcard predicate patterns.",queryTimeout:"Sets the number of seconds after which the evaluation of a query will be terminated; values less than or equal to zero mean no limit.",throwQueryEvaluationExceptionOnTimeout:"Repository throws QueryEvaluationException when the duration of a query execution exceeds the timeout parameter.",queryLimitResults:"Sets the maximum number of results returned from a query after which the evaluation of a query will be terminated; values less than or equal to zero mean no limit.",nonInterpretablePredicates:"Semicolon-delimited list of predicates (full URIs) that GraphDB will not try to process with the registered GraphDB plugins.",ontop:{driverType:"Determines the type of SQL database to connect to.",propertiesFile:"Describes the JDBC configuration such as hostname and database name to connect to.",hostName:"The JDBC hostname to connect to.",port:"The JDBC port to connect to if different from the default for the chosen JDBC driver.",portIfRequired:"The JDBC port to connect to.",databaseName:"The database name to connect to.",userName:"The username to use for the JDBC connection.",password:"The password to use for the JDBC connection.",driverClass:"Classname of the chosen JDBC driver. It must be on the classpath (in the lib directory).",driverClassWarning:"JDBC driver not found in the classpath, please save it in the lib directory and restart GraphDB",url:"The JDBC URL that will be used. It is constructed using the supplied hostname, port and database name.",obdaFile:"Describes the mapping from SQL to RDF in either the OBDA or the R2RML format.",owlFile:"Specifies relations between the classes and properties in the cosntructed RDF graph. It can be in any supported RDF format.",constraintFile:"Specifies override of SQL primary and foreign keys.",dbMetadataFile:"Specifies metadata for the SQL database.",testConn:"Attempts to establish a connection to the SQL database to test if the supplied configuration is correct."},fedx:{repositoryNotExistWarning:"The repository member has been removed from the local repositories",localReposInstructions:"Click on a repo to add a local repository as a member",withLogQueries:"Set whether to log queries",withDebugQueryPlan:"Whether to print the optimized query execution plan to stdout",enforceMaxQueryTime:"Max query time in seconds, 0 to disable",withIncludeInferredDefault:"Set whether to include inferred statements or not",withBoundJoinBlockSize:"Set the block size for bound joins",withJoinWorkerThreads:"Set the number of join worker threads for parallelization",withLeftJoinWorkerThreads:"Set the number of left join worker threads",unionWorkerThreads:"Set the number of union worker threads for parallelization",withLogQueryPlan:"Whether to log the query plan",withEnableServiceAsBoundJoin:"Whether external SERVICE clauses are evaluated using bound join",withSourceSelectionCacheSpec:"The cache specification for the SourceSelectionMemoryCache",removeMember:"Remove repository as a FedX member",editRepository:"Edit repository",setAsWritable:"Set repository as writable"}}},57:function(e,t,n){"use strict";n.r(t);n(2);var i=n(206),r=n(209),o=n.n(r),a=(n(4),n(37));function s(e,t,n,r,s,l,c,d,u,p,f,h,g,m,y,v,S,x,I,w){e.languageChanged=!1,e.propertiesObj={},e.propertiesQueryObj={},e.propertiesObj.items=[],e.propertiesNotFiltered=[],e.searchVisible=!1,e.nodeSelected=!1,e.queryResultsMode=!1,e.embedded=p.search().embedded,e.openedNodeInfoPanel=void 0,e.invalidLimit=!1,e.INVALID_LINKS_MSG="Invalid links limit",e.INVALID_LINKS_TOOLTIP="The valid limit range is 1-1000",e.onopen=e.onclose=()=>angular.noop(),e.embedded&&(p.search().query||p.search().uri||p.search().config||p.search().saved)&&(e.noGoHome=!0);const b={};let C=0,k=0,L={},T=0;const N=16,A=d3.behavior.zoom().scaleExtent([.5,10]);let P;const E=1e3,R=1e3;let M,O;function G(e){g.openCopyToClipboardModal(e)}function D(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 i=v.get(S.GRAPHS_VIZ);if(i&&"object"==typeof i)try{e.saveSettings=i,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=angular.copy(e.defaultSettings),v.set(S.GRAPHS_VIZ,e.saveSettings)}else e.saveSettings=angular.copy(e.defaultSettings)}t.key="",b.get=function(t,n,i){return h.initLazyList(t,n,i,C,e.propertiesObj.items)},t.$watch((function(){return t.key}),(function(){C=0,_.each(e.propertiesObj.items,(function(e){t.key>e&&C++})),k++})),b.revision=function(){return k},e.datasource=b,e.adapterContainer={adapter:{remain:!0}},e.propertiesQueryObj.query="",e.propertiesSearchPlaceholder="Search instance properties",e.propertiesFilterFunc=function(t){return t.key.toLowerCase().indexOf(e.propertiesQueryObj.query.toLowerCase())>=0},e.resetState=function(){e.searchVisible=!1,e.nodeSelected=!1,e.configLoaded=null,e.queryResultsMode=!1,e.lastSavedGraphName=null,e.lastSavedGraphId=null,e.shared=!1,e.numberOfPinnedNodes=0,L={},T=0},e.pushHistory=function(t,n){e.embedded&&(t.embedded=!0),p.search(t),p.state(n)},e.goToHome=function(){e.resetState(),p.url("graphs-visualizations")},e.shouldShowSettings=function(){return e.configLoaded&&e.configLoaded.id===e.defaultGraphConfig.id},e.shouldDisableSameAs=function(){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.$watch("propertiesObj.items",(function(){angular.isDefined(e.propertiesObj.items)&&e.propertiesObj.items.length>0&&s((function(){e.adapterContainer.adapter.reload()}),500)})),e.toggleMoreInfo=function(e){angular.element(e.currentTarget).parent().next().toggle(200),angular.element(e.currentTarget).children("span").toggleClass("icon-caret-down").toggleClass("icon-caret-up")},e.copyToClipboard=G,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=angular.copy(e.defaultSettings);const j=f.getPrincipal();function z(){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}}))}j?D(j):e.$on("securityInit",(function(){D(f.getPrincipal())})),e.resetSettings=function(){e.settings=angular.copy(e.defaultSettings),e.validateLinksLimit(),z()},e.changeLimit=function(t){let n=e.settings.linksLimit+t;n<1&&(n=1),n>1e3&&(n=1e3),e.settings.linksLimit=n},e.validateLinksLimit=function(){e.invalidLimit=!a.NUMBER_PATTERN.test(e.settings.linksLimit)},e.showSettings=function(){e.showInfoPanel=!0,e.showFilter=!0,e.showNodeInfo=!1,e.showPredicates=!1,e.saveSettings?e.settings=angular.copy(e.saveSettings):e.settings=angular.copy(e.defaultSettings),z()},e.reExpandNode=function(){e.rootNodeIri&&e.$broadcast("onRootNodeChange",e.rootNodeIri)};const F=function(t,n,i){const o=void 0===n?e.saveSettings.sameAsState:!0===n,a=void 0===i?e.saveSettings.includeInferred:!0===i;e.loading=!0,l({url:"rest/explore-graph/graph",method:"POST",headers:{"Content-Type":"application/json"},data:{query:t,linksLimit:e.saveSettings.linksLimit,languages:e.shouldShowSettings()?e.saveSettings.languages:[],includeInferred:a,sameAsState:o}}).then((function(e){he(e)}),(function(t){e.loading=!1,r.error(getError(t.data),"Cannot load visual graph!")}))};function B(e){return e.replace(/[()']/g,"")}function q(e,t){let n=e.split(" ");return t?[n[0],n[1],n[2]].join(">"):[n[0],n[2]].join(">")}function W(e){return[e.source.iri,e.target.iri].join(">")}function U(e){if(e.isTriple){let t=document.getElementById(B(q(e.iri)));if(t&&void 0!==t.__data__.x)return t.__data__.x}return e.x}function H(e){if(e.isTriple){let t=document.getElementById(B(q(e.iri)));if(t&&void 0!==t.__data__.y)return t.__data__.y}return e.y}function V(e){let t=e.trim().split(" ");return`<<<${t[0]}> <${t[1]}> <${t[2]}>>>`}function J(e){return B(`${e.source.isTriple?q(e.source.iri,!0):e.source.iri}>${e.target.isTriple?q(e.target.iri,!0):e.target.iri}>marker`)}function Q(){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 i=n.source.iri,r=n.target.iri,o=_.min([i,r])+"|"+_.max([i,r]);t[o]||(t[o]=1,e[i]=(e[i]||0)+1,e[r]=(e[r]||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,i;n=e.isTripleSource?we(e.source):_.find(t,(function(t){return t.iri===e.source})),i=e.isTripleTarget?we(e.target):_.find(t,(function(t){return t.iri===e.target}));let r={source:n,target:i,predicates:e.predicates};if(e.isTripleSource||e.isTripleTarget){let e=`${r.source.isTriple?q(r.source.iri):r.source.iri}>${r.target.isTriple?q(r.target.iri):r.target.iri}`;if(Z.tripleLinksCopy.has(e)){let t=Z.tripleLinksCopy.get(e);return t[0].predicates.push(...r.predicates),t.push(r),Z.tripleLinksCopy.set(e,t),null}Z.tripleLinksCopy.set(e,[r])}return r}))}(e,t));for(let e of Z.tripleLinksCopy.keys())1===Z.tripleLinksCopy.get(e).length&&Z.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 i=n(e,t),r=_.map(i,(function(t){return t.source.iri===e.iri?t.target.types:t.source.types}));return _.uniq(_.flatten(r))},this.linksPredicates=function(e,t){const i=n(e,t),r=_.map(i,(function(e){return e.predicates}));return _.uniq(_.flatten(r))},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 i=e.split(">"),r=q(n.source.iri),o=q(n.target.iri);if(r===e&&Z.tripleNodes.delete(o)){let e=o.split(">");t.push({source:e[0],target:e[1]})}let a=r===e||o===e||n.source.iri===i[0]&&n.target.iri===i[1];return a&&(Z.tripleLinksCopy.delete(`${r}>${o}`),Z.tripleLinksCopy.delete(`${o}>${r}`)),a})))}),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 i=[];this.links=_.reject(this.links,(function(e){let t=e.source.iri===n.iri||e.target.iri===n.iri;return t&&(e.target.isTriple&&i.push(q(e.target.iri)),e.source.isTriple||e.target.isTriple||i.push([e.source.iri,e.target.iri].join(">"))),t})),this.removeTriples(i);const r=this.links;this.nodes=_.reject(this.nodes,(function(e){return 0===t(e,r)})),0===this.nodes.length&&(e.nodeSelected=!1),this.computeConnectedness()},this.removeNodeLeafLinks=function(e){let i=[],r=this.links;this.links=_.reject(this.links,(function(o){let a=o.source.iri===e.iri&&1===t(o.target,r)&&!o.target.isTriple||o.target.iri===e.iri&&1===t(o.source,r)&&!o.source.isTriple;if(!a){let i;if(o.source.iri!==e.iri||2!==t(o.target,r)||o.target.isTriple?o.target.iri!==e.iri||2!==t(o.source,r)||o.source.isTriple||(i=n(o.source,r)):i=n(o.target,r),!i)return!1;a=(i[0].source.iri===e.iri||i[0].target.iri)&&(i[1].source.iri===e.iri||i[1].target.iri)}return a&&(o.target.isTriple&&i.push(q(o.target.iri)),o.source.isTriple||o.target.isTriple||i.push([o.source.iri,o.target.iri].join(">"))),a})),this.removeTriples(i),r=this.links,this.nodes=_.reject(this.nodes,(function(n){return 0===t(n,r)&&n.iri!==e.iri})),this.computeConnectedness()},this.addTriple=function(e,t,n){e.x=t,e.y=n,e.weight=0;let i=q(e.iri);if(this.tripleNodes.has(i)){let t=this.tripleNodes.get(i);t.push(e),this.tripleNodes.set(i,t)}else e.weight=10,this.tripleNodes.set(i,[e])},this.copyState=function(){const e=_.map(this.nodes,(function(e){return{iri:e.iri,isTriple:e.isTriple,size:e.size,labels:angular.copy(e.labels),types:angular.copy(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:T,type2color:L,scale:A.scale(),translate:A.translate()}},this.restoreState=function(t){e.nodeSelected=!0,e.searchVisible=!1,this.nodes=angular.copy(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)&&(T=t.colorIndex,L=angular.copy(t.type2color)),angular.isDefined(t.translate)&&angular.isDefined(t.scale)&&(P="translate("+t.translate[0]+", "+t.translate[1]+") scale("+t.scale+")",A.translate(t.translate),A.scale(t.scale)),de()}}e.updateSettings=function(){e.invalidLimit?r.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.reExpandNode(e.rootNodeIri):e.queryResultsMode&&p.search().query?F(p.search().query,p.search().sameAs,p.search().inference):"query"===e.configLoaded.startMode&&e.loadGraphConfig(e.configLoaded),e.saveSettings.showLinksText?d3.selectAll("svg .link-wrapper text").style("display","block"):d3.selectAll("svg .link-wrapper text").style("display","none"),e.showInfoPanel=!1,e.showFilter=!1,v.set(S.GRAPHS_VIZ,e.saveSettings))},e.showInfoPanel=!1;let Z=new Q;e.defaultGraphConfig={id:"default",name:"Easy graph",startMode:"search"},e.getGraphConfigs=function(t){I.getGraphConfigs().success((function(n){e.graphConfigs=n,t&&t()})).error((function(e){r.error(getError(e),"Could not get graph configs")}))},e.loadConfigForId=function(t,n){t===e.defaultGraphConfig.id?e.loadGraphConfig(e.defaultGraphConfig):I.getConfig(t).success((function(t){e.loadGraphConfig(t),n()})).error((function(e){r.error(getError(e),"Could not load config "+t)}))},e.findConfigById=function(t){return t===e.defaultGraphConfig.id?e.defaultGraphConfig:$.grep(e.graphConfigs,(function(e){return e.id===t}))[0]},e.easyGraphSearch=function(t){e.configLoaded=e.defaultGraphConfig,e.openUri(t)},e.loadGraphConfig=function(t){e.configLoaded=t,"search"===t.startMode?e.searchVisible=!0:"node"===t.startMode&&t.startIRI?s((function(){e.openUri(t.startIRI,!0)}),0):"query"===t.startMode&&t.startGraphQuery&&(e.loading=!0,I.loadGraphForConfig(t,t.startQueryIncludeInferred,e.saveSettings.linksLimit,t.startQuerySameAs).then((function(e){he(e)}),(function(t){e.loading=!1,r.error(getError(t),"Could not load graph from config")})))},e.deleteConfig=function(t){g.openSimpleModal({title:"Confirm",message:"Are you sure you want to delete the graph config '"+t.name+"'?",warning:!0}).result.then((function(){I.deleteGraphConfig(t).success((function(){e.getGraphConfigs(),e.refreshSavedGraphs()})).error((function(e){r.error(getError(e),"Could not delete graph config")}))}))},e.goToGraphConfig=function(t){e.pushHistory({config:t.id},{config:t}),e.resetState(),e.loadGraphConfig(t)},y.onpopstate=function(t){e.resetState(),t.state&&(t.state.config?(e.loadGraphConfig(t.state.config),t.state.uri&&e.openUri(t.state.uri,!0)):t.state.savedGraph&&e.loadSavedGraph(t.state.savedGraph,!0))};const K=function(){p.search().query?(e.searchVisible=!1,e.queryResultsMode=!0,F(p.search().query,p.search().sameAs,p.search().inference)):e.$on("onRootNodeChange",(function(t,n){e.loading=!0,angular.isDefined(n)&&(e.rootNodeIri=n,l({url:"rest/explore-graph/node",method:"GET",params:{iri:n,config:e.configLoaded?e.configLoaded.id:e.defaultGraphConfig.id,languages:e.shouldShowSettings()?e.saveSettings.languages:[],includeInferred:e.saveSettings.includeInferred,sameAsState:e.saveSettings.sameAsState}}).then((function(t){e.nodeSelected=!0,e.searchVisible=!1,null===t.data.types&&(t.data.types="greyColor"),Z=new Q;const n=Z.addNode(t.data,E/2,R/2);P="translate(0, -70) scale(1)",A.translate([0,-70]),A.scale(1),me(n,!0)})).catch((function(t){e.loading=!1,r.error(getError(t),"Could not load visual graph")})))})),p.search().uri&&e.openUri(p.search().uri),p.search().saved&&x.getSavedGraph(p.search().saved).success((function(t){e.loadSavedGraph(t)})).error((function(e){const t=getError(e);r.error(t,"Error! Could not open saved graph")}))},X=function(){p.search().config?e.loadConfigForId(p.search().config,K):p.search().query||p.search().uri?(e.loadGraphConfig(e.defaultGraphConfig),K()):K()};function Y(t){!n.getActiveRepository()||e.hasInitedRepository&&!t||(e.hasInitedRepository=!0,t||e.getGraphConfigs(X),e.getNamespacesPromise=w.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})),ee()})).error((function(e){r.error(getError(e),"Cannot get namespaces for repository. View will not work properly!")})))}function ee(){e.getAutocompletePromise=d.checkAutocompleteStatus()}e.replaceIRIWithPrefix=function(t){const n=e.namespaces,i=_.findLast(n,(function(e){return 0===t.indexOf(e.uri)}));return i?i.prefix+":"+t.substring(i.uri.length):t},e.addedTag=function(t){return t.text.indexOf(":")<0?(r.warning("Enter an absolute full or prefixed IRI"),null):(t.text=function(e,t){if(!/^<?(http|urn).*>?/.test(e)){const n=e.split(":"),i=n[0],r=n[1];if(!angular.isUndefined(r)){const e=c.getNamespaceUriForPrefix(t,i);if(e)return e+r}}return e}(t.text,e.namespaces),e.pageslideExpanded=!0,t)},e.validateTag=function(e,t,n){if(e.text.indexOf(":")<0)return n?r.warning("Enter an absolute full or prefixed IRI, optionally ending in *",t):r.warning("Enter an absolute full or prefixed IRI",t),!1;const i=e.text.indexOf("*");if(i>=0){if(!n)return r.warning("Wildcards not allowed here",t),!1;if(i<e.text.length-1)return r.warning("Wildcard allowed only as the last character",t),!1}return!0},e.getTagClass=function(e){return e.endsWith("*")?"tag-item-wildcard":null},e.getActiveRepository=function(){return n.getActiveRepository()},e.hasInitedRepository=!1,e.$on("autocompleteStatus",(function(){ee()})),e.$on("repositoryIsSet",(function(t,n){n.newRepo&&(e.hasInitedRepository=!1),Y(n.newRepo),n.newRepo&&(e.resetState(),$(".graph-visualization svg").empty(),p.search().query&&(e.goToHome(),K()))})),Y();const te=500,ne=1.75,ie=d3.scale.linear().domain([0,9]).range(["hsl(0, 100%, 75%)","hsl(360, 90%, 82%)"]).interpolate(d3.interpolateHslLong),re=d3.scale.linear().domain([0,9]).range(["hsl(180, 50%, 75%)","hsl(540, 40%, 82%)"]).interpolate(d3.interpolateHslLong);e.getColor=function(e){angular.isUndefined(L[e])&&(L[e]=T,T++);const t=L[e];return t>39?"#c2c2c2":t%2==0?ie(t/2):re(t/2)};const oe=d3.layout.force().gravity(.07).size([E,R]),ae=d3.select(".main-container .graph-visualization").append("svg").attr("viewBox","0 0 "+E+" "+R).attr("preserveAspectRatio","xMidYMid meet");let se=0,le=0;const ce=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=1.11.3-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 de(t){d3.selectAll("svg g").remove(),d3.selectAll("svg rect").remove(),d3.selectAll(".d3-tip").remove(),d3.selectAll(".menu-events").remove(),A.on("zoom",(function(){P="translate("+d3.event.translate+") scale("+d3.event.scale+")",n.attr("transform",P)})),ae.append("rect").attr("width",10*E).attr("height",10*R).attr("x",-(10*E-E)/2).attr("y",-(10*R-R)/2).style("fill","none").style("pointer-events","all").call(A).on("click",(function(){d3.event.stopPropagation(),ye(),oe.stop()}));const n=ae.append("g").attr("class","nodes-container").attr("transform",(function(){return angular.isDefined(P)&&!t?P:""})),a=o()().attr("class","d3-tip").customPosition((function(){const e=M.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> '),t.types.length>0?n+=_.join(_.map(t.types,(function(t){return e.replaceIRIWithPrefix(t)}))," · "):n+="<i>No types</i>",n})),l=function(e){let t="";return t+=_.join(_.map(e.predicates,(function(t,n){if(0===n)return Ce(t);if(n<10)return" · "+Ce(t);if(10===n){const t=function(e){return e.predicates.length-10}(e);return" · more "+(t>1?t+" predicates":t+" predicate")+" to show"}})),""),t};let c;const d=o()().attr("class","d3-tip").customPosition((function(e){const t=c.getBoundingClientRect(),n=function(e){const t=l(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 l(e)}));const u=function(){s.cancel(void 0),s.cancel(se),M=null,a.hide(),le=s((function(){ye()}),500)};ae.call(a);ae.call(d);let p=ae.selectAll(".link"),f=ae.selectAll(".node");oe.nodes(Z.nodes).charge(-3e3),oe.links(Z.links).linkDistance((function(e){return e.source.isTriple||e.target.isTriple?0:function(e){const t=$("<span></span>"),n=e.predicates[0].split("/"),i=n[n.length-1];t.addClass("predicate-text").text(i),$("body").append(t);const r=t.width()+2*e.source.size+2*e.target.size+50;return t.remove(),.75*r}(e)+30*e.connectedness})),n.append("defs").selectAll("marker").data(oe.links()).enter().append("marker").attr("class","arrow-marker").attr("id",(function(e){return J(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=n.selectAll(".link").data(Z.links).enter().append("g").attr("class","link-wrapper").attr("id",(function(e){return B(W(e))})).append("line").attr("class","link").style("stroke-width",1).style("fill","transparent").style("marker-end",(function(e){return`url(#${J(e)})`}));const h=n.selectAll(".link-wrapper").append("text").text((function(e){return be(e)})).attr("class",(function(e){return e.predicates.length>1||Z.tripleNodes.has(W(e))?"predicates":"predicate"})).attr("dy","-0.5em").style("text-anchor","middle").style("display",e.saveSettings.showLinksText?"":"none").on("mouseover",(function(e){d3.event.stopPropagation(),function(e){s.cancel(void 0);const t=c=d3.event.target;s((function(){c===t&&e.predicates.length>1&&d.show(e,c)}),300)}(e)})).on("mouseout",(function(){s.cancel(void 0),c=null,d.hide()})).on("click",(function(t){d3.event.stopPropagation(),function(t){Ie();let n=W(t);if(1===t.predicates.length&&Z.tripleNodes.has(n)){O=null;let e=Z.tripleNodes.get(n)[0];if(pe(e,this,d3.event.button)){let t={};t.iri=e.iri,t.pred=Ce(e.iri.split(" ")[1]),Se(t)}return}!function(t){if(e.showNodeInfo=!1,e.showPredicates=t.predicates.length>1,e.showFilter=!1,e.showInfoPanel=!1,O===t)return e.showNodeInfo=!1,e.showInfoPanel=!1,void(O=null);O=t,e.showPredicates&&(e.predicates=_.map(t.predicates,(function(e){let n=function(e,t){let n=W(t);return Z.tripleNodes.has(n)?Z.tripleNodes.get(n).findIndex(t=>t.iri.indexOf(e)>=0):-1}(e,t),i=n>-1;return{value:Ce(e),partOfTriple:i,linkId:i?W(t):"",nodeIndex:n}})),e.showInfoPanel=!0)}(t)}(t)}));let g,m=0,y=0,v=0;const S=function(){d3.event.button&&0!==d3.event.button||(u(),s.cancel(g),e.showPredicates=!1,d3.event.timeStamp-m<te?y++:y=1,m=d3.event.timeStamp,d3.event.preventDefault())},x=function(t){if(d3.event.button&&0!==d3.event.button)return;s.cancel(g);const n=d3.event,i=this;if(d3.event.timeStamp-m<te)if(1===y)g=s((function(){pe(t,i,n)}),40+te-(d3.event.timeStamp-m));else if(2===y){Z.countLinks(t,Z.links)<=e.saveSettings.linksLimit?me(t,!1,i.parentNode):r.info("Increase limit to see more connections and try again","Node already expanded to predefined maximum links to show."),e.closeInfoPanel()}d3.event.preventDefault()};function I(e,t){let i,r,o,a,s=!0;if("down"===t)i=2*e.size,r=e.size/3,o=.8,a=.3;else if("down-fixed"===t)i=2*e.size,r=e.size,o=.8,a=.66;else if("up"===t)i=e.size/3,r=2*e.size,o=.3,a=.8;else{if("fixed"!==t)return;i=e.size,o=.66,s=!1}let l=n.selectAll(".node-wrapper").filter((function(t){return t===e})).append("text").text("").classed("icon-any pinned",!0).style("font-size",i+"px").attr("x",(function(e){return e.x})).attr("y",(function(e){return e.y})).attr("opacity",o);"fixed"!==t&&"down-fixed"!==t||(e.pin=l),s&&(l=l.transition().duration(1e3).style("font-size",(function(){return r+"px"})).attr("opacity",a),"down-fixed"!==t&&l.remove())}const w=d3.behavior.drag().origin((function(e){return e})).on("dragstart",(function(e){0===d3.event.sourceEvent.button&&(e.fixedBeforeDrag=e.fixed,e.isBeingDragged=!0,e.beginDragging=!0,ye(),d3.event.sourceEvent.stopPropagation(),d3.select(this).classed("dragging",!0))})).on("drag",(function(t){t.isBeingDragged&&(y=0,t.px=d3.event.x,t.py=d3.event.y,t.fixed?t.beginDragging&&I(t,"fixed"):(e.numberOfPinnedNodes++,t.fixed=!0,I(t,"down-fixed")),t.pinWasFixed=!0,t.beginDragging=null,oe.resume())})).on("dragend",(function(e){e.isBeingDragged&&(e.pinWasFixed&&(e.pinWasFixed=null,d3.select(".pinned").remove()),e.isBeingDragged=!1,d3.select(this).classed("dragging",!1))}));f=n.selectAll(".node").data(Z.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])})).call(w).on("mouseover",(function(t){if(!t.isBeingDragged){const n=d3.event;s.cancel(le),se=s(()=>{(function(t,n){if(e.showInfoPanel)return!1;(ue.closeIcon||ue.expandIcon||ue.focusIcon||ue.copyURIIcon)&&ue.removeIcons();if(oe.alpha()<.05)return ue.initIcons(t,n.parentNode),oe.stop(),!0;return!1})(t,this)&&function(e,t){s.cancel(void 0);const n=M=t.target;s((function(){M===n&&a.show(e,M)}),300)}(t,n)},400)}})).on("mouseout",u).on("mousedown",S).on("touchstart",(function(e){S(),v=0,g=s((function(){v<5&&fe(e),g=null,y=0}),1e3)})).on("touchmove",(function(){v++})).on("mouseup",x).on("touchend",x).on("contextmenu",(function(t){d3.event.shiftKey||(d3.event.preventDefault(),ye(),e.closeInfoPanel(),t.fixed?(e.numberOfPinnedNodes--,t.fixed=!1,I(t,"up"),oe.resume()):(e.numberOfPinnedNodes++,t.fixed=!0,I(t,"down")),function(e){M&&a.show(e,M)}(t))}));const b=n.selectAll(".node-wrapper").append("foreignObject").style("pointer-events","none").attr("width",(function(e){return 2*e.size*ne}));n.insert("g").attr("class","menu-events"),function(e){e.each((function(e){e.fontSize=i.a.Text.calcFontSizeRaw(e.labels[0].label,e.size,N,!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})),s((function(){$(".node-label-body div").each((function(e,t){let n=t.textContent.substring(0,t.textContent.length-1);let i=0;for(;i<200&&(t.scrollHeight>t.clientHeight||t.scrollWidth>t.clientWidth);)n=n.substring(0,n.length-1),t.textContent=n+"…",i++}))}),50)}(b),oe.on("tick",(function(){d3.geom.quadtree(Z.nodes);Z.nodes.length;p.attr("x1",(function(e){return U(e.source)})).attr("y1",(function(e){return H(e.source)})).attr("x2",(function(e){return U(e.target)})).attr("y2",(function(e){return H(e.target)})),h.attr("x",(function(e){let t=U(e.source),n=U(e.target);return e.x=.5*(t+n)})).attr("y",(function(e){let t=H(e.source),n=H(e.target);return e.y=.5*(t+n)})).attr("transform",(function(e){return"rotate("+function(e,t){e.source,e.target;const n={x:U(e.source),y:H(e.source)},i={x:U(e.target),y:H(e.target)};if(t)return 180*Math.atan2(i.y-n.y,i.x-n.x)/Math.PI;{const e=180*Math.atan2(i.y-n.y,i.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})),n.select(".node-loader").attr("x",(function(e){return e.x-e.size+3})).attr("y",(function(e){return e.y-e.size})),n.select(".loader-container").attr("cx",(function(e){return e.x})).attr("cy",(function(e){return e.y})),b.attr("x",(function(e){return e.x-e.size*ne})).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}))})),angular.isDefined(ce)&&ce.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){let i=B(n.source.iri),r=B(n.target.iri);if(i===t&&r===e){let e=i;e+=">",e+=r;const t=document.createTextNode(" ⟶");document.getElementById(e).lastChild.appendChild(t),n.direction="double"}}))})),d3.selectAll(".d3-actions-tip").remove(),oe.start()}de();const ue=new function(){function e(e,t){return"translate("+(t.x-14+(t.size+15)*Math.cos(e*Math.PI/180-Math.PI/2))+","+(t.y-14+(t.size+15)*Math.sin(e*Math.PI/180-Math.PI/2))+")"}this.closeIcon=void 0,this.expandIcon=void 0,this.collapseIcon=void 0,this.focusIcon=void 0,this.copyURIIcon=void 0,this.actionsTip=void 0,this.removeIcons=function(){this.closeIcon.remove("g"),this.expandIcon&&this.expandIcon.remove("g"),this.collapseIcon&&this.collapseIcon.remove("g"),this.focusIcon.remove("g"),this.copyURIIcon.remove("g"),this.closeIcon=void 0,this.expandIcon=void 0,this.collapseIcon=void 0,this.focusIcon=void 0,this.copyURIIcon=void 0,this.expandedState=!1},this.expandedState=!1,this.initIcons=function(n,i){const r=o()().attr("class","d3-tip d3-actions-tip").customPosition((function(){const e=d3.event.target.getBoundingClientRect();return{top:e.top-20+"px",left:e.right+10+"px"}})).html((function(e){return e}));ae.call(r);n.isExpanded?(this.collapseIcon=d3.select(".menu-events").append("g").attr("class","collapse-icon").attr("name","collapse").attr("transform",(function(){return e(20,n)})),this.collapseIcon.append("circle").attr("cx",14).attr("cy",14).attr("r",13).style("fill","#eee"),this.collapseIcon.append("path").attr("d","M22.67,12a.59.59,0,0,1-.53.65l-6.88.72H15.2a.59.59,0,0,1-.59-.65l.72-6.88A.58.58,0,0,1,16,5.33a.59.59,0,0,1,.53.65L16,11.11,21.3,5.79a.64.64,0,0,1,.91.91L16.89,12,22,11.49A.59.59,0,0,1,22.67,12ZM12.59,14.75l-6.75.85a.59.59,0,0,0-.51.66.58.58,0,0,0,.66.51l4.95-.62-5.2,5.2a.64.64,0,1,0,.91.91l5.2-5.2L11.23,22a.59.59,0,0,0,.51.66h.07a.59.59,0,0,0,.59-.52l.85-6.75a.59.59,0,0,0-.17-.49A.58.58,0,0,0,12.59,14.75Z").style("fill","#ed4f2f"),this.collapseIcon.on("click",(function(){var e;(e=n).isExpanded=!1,Z.removeNodeLeafLinks(e),de()})).on("mouseover",(function(){r.show(this.getAttribute("name")),s.cancel(se),s.cancel(le)})).on("mouseout",(function(){r.hide(),le=s((function(){ye()}),500)}))):(this.expandIcon=d3.select(".menu-events").append("g").attr("class","expand-icon").attr("name","expand").attr("transform",(function(){return e(20,n)})),this.expandIcon.append("circle").attr("cx",14).attr("cy",14).attr("r",13).style("fill","#eee"),this.expandIcon.append("path").attr("d","M22.37,6.28l-.72,6.88a.59.59,0,0,1-.59.53H21a.59.59,0,0,1-.53-.65L21,7.9l-5.32,5.32a.64.64,0,0,1-.91-.91L20.1,7,15,7.53a.59.59,0,0,1-.12-1.18l6.88-.72a.59.59,0,0,1,.65.65ZM12.89,20.34,7.95,21l5.2-5.2a.64.64,0,0,0-.91-.91L7,20.05l.62-4.95A.59.59,0,0,0,6.48,15l-.85,6.75a.59.59,0,0,0,.59.67h.07L13,21.52a.59.59,0,1,0-.15-1.18Z").style("fill","#ed4f2f"),this.expandIcon.on("click",(function(){me(n,!1,i)})).on("mouseover",(function(){r.show(this.getAttribute("name")),s.cancel(le),s.cancel(se)})).on("mouseout",(function(){r.hide(),le=s((function(){ye()}),500)}))),this.focusIcon=d3.select(".menu-events").append("g").attr("class","focus-icon").attr("name","focus").attr("transform",(function(){return e(20,n)})),this.focusIcon.append("circle").attr("cx",14).attr("cy",14).attr("r",13).style("fill","#eee"),this.focusIcon.append("path").attr("d","M14.2,23.81a9.8,9.8,0,1,1,6.93-2.87h0A9.74,9.74,0,0,1,14.2,23.81Zm0-18.17a8.37,8.37,0,1,0,5.92,14.29h0A8.37,8.37,0,0,0,14.2,5.64Zm1.42,6.95a2,2,0,1,0,0,2.85A2,2,0,0,0,15.62,12.59Z").style("fill","#ed4f2f"),this.focusIcon.on("click",(function(){t.$broadcast("onRootNodeChange",n.iri)})).on("mouseover",(function(){r.show(this.getAttribute("name")),s.cancel(le),s.cancel(se)})).on("mouseout",(function(){r.hide(),le=s((function(){ye()}),500)})),this.copyURIIcon=d3.select(".menu-events").append("g").attr("class","icon-link").attr("name","link").attr("transform",(function(){return e(20,n)})),this.copyURIIcon.append("circle").attr("cx",14).attr("cy",14).attr("r",13).style("fill","#eee"),this.copyURIIcon.append("path").attr("d","M 13.457031 10.164062 C 13.648438 10.164062 13.820312 10.242188 13.941406 10.363281 L 15.492188 11.859375 C 15.984375 12.332031 16.292969 12.992188 16.292969 13.714844 C 16.292969 14.441406 15.984375 15.097656 15.492188 15.574219 L 10.394531 20.496094 C 9.902344 20.972656 9.222656 21.265625 8.472656 21.265625 C 7.71875 21.265625 7.039062 20.972656 6.546875 20.496094 L 4.996094 19 C 4.507812 18.523438 4.203125 17.867188 4.203125 17.144531 C 4.203125 16.421875 4.507812 15.765625 4.996094 15.289062 L 7.542969 12.824219 C 7.667969 12.707031 7.84375 12.628906 8.035156 12.628906 C 8.417969 12.628906 8.726562 12.929688 8.726562 13.300781 C 8.726562 13.484375 8.648438 13.652344 8.523438 13.773438 L 5.976562 16.234375 C 5.738281 16.46875 5.589844 16.792969 5.589844 17.148438 C 5.589844 17.503906 5.738281 17.824219 5.976562 18.058594 L 7.527344 19.566406 C 7.773438 19.792969 8.105469 19.929688 8.472656 19.929688 C 8.835938 19.929688 9.167969 19.792969 9.414062 19.566406 L 14.511719 14.644531 C 14.753906 14.410156 14.90625 14.089844 14.90625 13.730469 C 14.90625 13.375 14.753906 13.054688 14.511719 12.820312 L 12.964844 11.324219 C 12.839844 11.203125 12.761719 11.039062 12.761719 10.855469 C 12.761719 10.488281 13.070312 10.1875 13.449219 10.1875 Z M 17.082031 3.976562 C 17.082031 3.976562 17.085938 3.976562 17.085938 3.976562 C 17.824219 3.976562 18.492188 4.261719 18.980469 4.722656 L 20.535156 6.203125 C 21.042969 6.679688 21.355469 7.34375 21.355469 8.082031 C 21.355469 8.792969 21.058594 9.441406 20.582031 9.914062 L 18.0625 12.402344 C 17.9375 12.527344 17.761719 12.605469 17.566406 12.605469 C 17.183594 12.605469 16.875 12.304688 16.875 11.9375 C 16.875 11.753906 16.949219 11.589844 17.070312 11.46875 L 19.605469 8.984375 C 19.847656 8.75 19.996094 8.429688 19.996094 8.070312 C 19.996094 7.714844 19.847656 7.394531 19.605469 7.160156 L 18.019531 5.667969 C 17.773438 5.445312 17.4375 5.304688 17.070312 5.300781 C 16.703125 5.304688 16.367188 5.453125 16.128906 5.691406 L 11.085938 10.667969 C 10.84375 10.898438 10.695312 11.222656 10.695312 11.578125 C 10.695312 11.933594 10.84375 12.257812 11.085938 12.488281 L 12.675781 13.980469 C 12.804688 14.101562 12.882812 14.273438 12.882812 14.457031 C 12.882812 14.828125 12.574219 15.128906 12.191406 15.128906 C 12.003906 15.128906 11.832031 15.054688 11.707031 14.9375 L 10.140625 13.457031 C 9.636719 12.980469 9.324219 12.316406 9.324219 11.582031 C 9.324219 10.863281 9.621094 10.214844 10.101562 9.742188 L 15.140625 4.765625 C 15.625 4.285156 16.304688 3.980469 17.054688 3.976562 Z M 17.082031 3.976562").style("fill","#ed4f2f"),this.copyURIIcon.on("click",(function(){G(n.iri),ye(),r.hide()})).on("mouseover",(function(){r.show("<div style='text-align: center;'><b>Copy to ClipBoard</b><br>"+n.iri+"</div>"),s.cancel(le),s.cancel(se)})).on("mouseout",(function(){r.hide(),le=s((function(){ye()}),500)})),this.closeIcon=d3.select(".menu-events").append("g").attr("class","close-icon").attr("name","remove").attr("transform",(function(){return e(20,n)})),this.closeIcon.append("circle").attr("cx",14).attr("cy",14).attr("r",13).style("fill","#eee"),this.closeIcon.append("path").attr("d","M14.94,14l5.87-5.87a.66.66,0,1,0-.94-.94L14,13.06,8.13,7.19a.66.66,0,0,0-.94.94L13.06,14,7.19,19.87a.66.66,0,1,0,.94.94L14,14.94l5.87,5.87a.66.66,0,1,0,.94-.94Z").style("fill","#ed4f2f"),this.closeIcon.on("click",(function(){fe(n)})).on("mouseover",(function(){r.show(this.getAttribute("name")),s.cancel(le),s.cancel(se)})).on("mouseout",(function(){r.hide(),le=s((function(){ye()}),500)})),this.animateMenu(n)},this.animateMenu=function(t){let n=0;let i=20;this.expandIcon&&this.expandIcon.transition().duration(100).style("opacity",1).ease("sin").attr("transform",(function(){return e(i,t)})).delay(n+=35),this.collapseIcon&&this.collapseIcon.transition().duration(100).style("opacity",1).ease("sin").attr("transform",(function(){return e(i,t)})).delay(n+=35),this.copyURIIcon.transition().duration(100).style("opacity",1).ease("sin").attr("transform",(function(){return i+=30,e(i,t)})).delay(n+=35),this.focusIcon.transition().duration(100).style("opacity",1).ease("sin").attr("transform",(function(){return i+=30,e(i,t)})).delay(n+=35),this.closeIcon.transition().duration(100).style("opacity",1).ease("sin").attr("transform",(function(){return i+=30,e(i,t)})).delay(n+=35),this.expandedState=!0}};function pe(n,i,r){return e.showInfoPanel=!1,e.showPredicates=!1,e.showNodeInfo=!1,r.shiftKey&&(r.ctrlKey||r.metaKey)?(t.$broadcast("onRootNodeChange",n.iri),!1):r.ctrlKey||r.metaKey?(fe(n),!1):void 0!==e.openedNodeInfoPanel&&e.openedNodeInfoPanel===n?(e.pageslideExpanded=!1,e.openedNodeInfoPanel=void 0,!1):(ve(n),!0)}function fe(e){Z.removeNode(e),de()}function he(t){!function(t){e.nodeSelected=!0,null===t.data.types&&(t.data.types="greyColor"),Z=new Q,P="translate(0, -70) scale(1)",A.translate([0,-70]),A.scale(1)}(t),ge(t)}function ge(t,n,i){let o=t.data;o=_.filter(o,(function(e){return-1===_.findIndex(Z.links,(function(t){return e.source===t.source.iri&&e.target===t.target.iri}))}));let a=[];const s=Z.tripleLinksCopy.values();for(let e=0;e<Z.tripleLinksCopy.size;e++){s.next().value.forEach(e=>{a.push(e)})}o=_.filter(o,(function(e){return-1===_.findIndex(a,(function(t){return e.source===t.source.iri&&e.target===t.target.iri}))})),o=_.filter(o,(function(e){return e.source!==e.target}));const c=function(e,t){let n=t.map((function(t){return t[e]}));return t.filter((function(t,i){return n.indexOf(t[e])===i}))}("iri",_.union(_.flatten(_.map(t.data,(function(e){return[{iri:e.source,isTriple:e.isTripleSource},{iri:e.target,isTriple:e.isTripleTarget}]}))))),d=_.map(Z.nodes,(function(e){return{iri:e.iri,isTriple:Boolean(e.isTriple)}})),p=Z.tripleNodes.values();for(let e=0;e<Z.tripleNodes.size;e++){p.next().value.forEach(e=>{d.push({iri:e.iri,isTriple:e.isTriple})})}const f=_.reject(c,(function(e){return _.some(d,e)}));if(0===f.length)i?r.info("This node either does not exist or has no visible connections. Check your Graph Settings if you expect such."):0===o.length&&r.info("This node either does not exist or has no visible connections. Check your Graph Settings if you expect such."),Z.addAndMatchLinks(o),de();else{const t=[],i=[];_.forEach(f,(function(n,r){t.push(l({url:"rest/explore-graph/node",method:"GET",params:{iri:n.isTriple?V(n.iri):n.iri,config:e.configLoaded.id,languages:e.shouldShowSettings()?e.saveSettings.languages:[],includeInferred:e.saveSettings.includeInferred,sameAsState:e.saveSettings.sameAsState}}).then((function(e){i[r]=e.data})))})),u.all(t).then((function(){_.forEach(i,(function(e,t){const r=2*Math.PI*t/i.length,o=(n?n.x:0)+Math.cos(r)*R/