graphdb-workbench 2.0.0-TR7 → 2.0.0-TR8

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 (102) hide show
  1. package/dist/{0.21974a2453b9a92dec33.bundle.js → 0.965871b861f4dddbba56.bundle.js} +3 -3
  2. package/dist/0.965871b861f4dddbba56.bundle.js.map +1 -0
  3. package/dist/{112.b871480dd961ac3c18b6.bundle.js → 112.0c1bdd906ac321ffbf5f.bundle.js} +2 -2
  4. package/dist/{112.b871480dd961ac3c18b6.bundle.js.map → 112.0c1bdd906ac321ffbf5f.bundle.js.map} +1 -1
  5. package/dist/114.282a327015f8ae87918b.bundle.js +1 -1
  6. package/dist/114.282a327015f8ae87918b.bundle.js.map +1 -1
  7. package/dist/{12.449fb5148a68a44ba324.bundle.js → 12.60db051e76264d3f95b2.bundle.js} +2 -2
  8. package/dist/12.60db051e76264d3f95b2.bundle.js.map +1 -0
  9. package/dist/{13.3a06e05fd28f858e14cd.bundle.js → 13.1419a81a33174950a34c.bundle.js} +2 -2
  10. package/dist/13.1419a81a33174950a34c.bundle.js.map +1 -0
  11. package/dist/14.7e9059b5c9c57d952e47.bundle.js +2 -0
  12. package/dist/14.7e9059b5c9c57d952e47.bundle.js.map +1 -0
  13. package/dist/15.02ad5872995df6d6692a.bundle.js +2 -0
  14. package/dist/15.02ad5872995df6d6692a.bundle.js.map +1 -0
  15. package/dist/{17.4b048ae019a8d2fd5b46.bundle.js → 17.8bfbe7d08efa149bdb00.bundle.js} +2 -2
  16. package/dist/17.8bfbe7d08efa149bdb00.bundle.js.map +1 -0
  17. package/dist/21.e75213686a349ae7df89.bundle.js +1 -1
  18. package/dist/21.e75213686a349ae7df89.bundle.js.map +1 -1
  19. package/dist/25.cbe8e59c80330ff6e706.bundle.js +2 -0
  20. package/dist/25.cbe8e59c80330ff6e706.bundle.js.map +1 -0
  21. package/dist/26.67154910989ca1f563ec.bundle.js +2 -0
  22. package/dist/26.67154910989ca1f563ec.bundle.js.map +1 -0
  23. package/dist/27.61bd08d0e926fe471a91.bundle.js +2 -0
  24. package/dist/27.61bd08d0e926fe471a91.bundle.js.map +1 -0
  25. package/dist/29.66259b8a21bbb5431a06.bundle.js +1 -1
  26. package/dist/29.66259b8a21bbb5431a06.bundle.js.map +1 -1
  27. package/dist/{30.4d469715c2f2d1028b4b.bundle.js → 30.3592aaa1063719853218.bundle.js} +2 -2
  28. package/dist/30.3592aaa1063719853218.bundle.js.map +1 -0
  29. package/dist/{33.ea3b66016bbeff928fc3.bundle.js → 33.c670eeb3a325251e141f.bundle.js} +2 -2
  30. package/dist/33.c670eeb3a325251e141f.bundle.js.map +1 -0
  31. package/dist/34.22a096bd891109c927f5.bundle.js +2 -0
  32. package/dist/34.22a096bd891109c927f5.bundle.js.map +1 -0
  33. package/dist/36.d444f7ad7724d126da1c.bundle.js +1 -1
  34. package/dist/36.d444f7ad7724d126da1c.bundle.js.map +1 -1
  35. package/dist/37.e82ed70c9f1ccac1fa36.bundle.js +1 -1
  36. package/dist/37.e82ed70c9f1ccac1fa36.bundle.js.map +1 -1
  37. package/dist/49.80591a5efda019de6e4a.bundle.js +2 -0
  38. package/dist/49.80591a5efda019de6e4a.bundle.js.map +1 -0
  39. package/dist/7.0d2811d01a379d8b75fb.bundle.js +3 -0
  40. package/dist/7.0d2811d01a379d8b75fb.bundle.js.map +1 -0
  41. package/dist/8.66013fc0c58811b51903.bundle.js +2 -0
  42. package/dist/8.66013fc0c58811b51903.bundle.js.map +1 -0
  43. package/dist/{bundle.7c8c6b17e3aea0099e3e.bundle.js → bundle.e787556c9b592367c35c.bundle.js} +4 -4
  44. package/dist/bundle.e787556c9b592367c35c.bundle.js.map +1 -0
  45. package/dist/css/lib/yasr.css +1 -0
  46. package/dist/css/yasr.custom.css +9 -0
  47. package/dist/index.html +4 -4
  48. package/dist/js/angular/core/directives/queryeditor/templates/query-editor.html +1 -0
  49. package/dist/js/angular/core/directives/rdfresourcesearch/templates/rdfResourceSearchTemplate.html +1 -1
  50. package/dist/{main.ea86ac1b6d636ab25dc7.css → main.db108895fbac32ad7e7b.css} +1 -1
  51. package/dist/pages/autocomplete.html +1 -1
  52. package/dist/pages/choose-repository-type.html +1 -1
  53. package/dist/pages/clusterInfo.html +1 -1
  54. package/dist/pages/create-index.html +4 -4
  55. package/dist/pages/dependencies.html +1 -1
  56. package/dist/pages/domainRangeInfo.html +2 -2
  57. package/dist/pages/edit.html +1 -1
  58. package/dist/pages/explore.html +1 -1
  59. package/dist/pages/export.html +1 -1
  60. package/dist/pages/find.html +1 -1
  61. package/dist/pages/graph-config/saveGraphConfig.html +11 -11
  62. package/dist/pages/graphs-visualizations.html +7 -7
  63. package/dist/pages/import.html +1 -1
  64. package/dist/pages/jdbc-create.html +5 -5
  65. package/dist/pages/monitor/queries.html +1 -1
  66. package/dist/pages/monitor/resources.html +2 -2
  67. package/dist/pages/namespaces.html +2 -2
  68. package/dist/pages/rdfClassHierarchyInfo.html +7 -7
  69. package/dist/pages/rdfrank.html +2 -2
  70. package/dist/pages/repositories.html +2 -2
  71. package/dist/pages/repository.html +2 -2
  72. package/dist/pages/similarity-indexes.html +1 -1
  73. package/dist/pages/sparql-template-create.html +5 -5
  74. package/dist/pages/sparql.html +3 -3
  75. package/dist/pages/webapi.html +2 -2
  76. package/dist/res/swagger/index.html +25 -25
  77. package/package.json +1 -1
  78. package/dist/0.21974a2453b9a92dec33.bundle.js.map +0 -1
  79. package/dist/12.449fb5148a68a44ba324.bundle.js.map +0 -1
  80. package/dist/13.3a06e05fd28f858e14cd.bundle.js.map +0 -1
  81. package/dist/14.a1d84445382b665e13e0.bundle.js +0 -2
  82. package/dist/14.a1d84445382b665e13e0.bundle.js.map +0 -1
  83. package/dist/15.73ffeb044255abbac7bf.bundle.js +0 -2
  84. package/dist/15.73ffeb044255abbac7bf.bundle.js.map +0 -1
  85. package/dist/17.4b048ae019a8d2fd5b46.bundle.js.map +0 -1
  86. package/dist/25.34da4f496fc62f2dae9b.bundle.js +0 -2
  87. package/dist/25.34da4f496fc62f2dae9b.bundle.js.map +0 -1
  88. package/dist/26.02814d2ed726f5a71d4e.bundle.js +0 -2
  89. package/dist/26.02814d2ed726f5a71d4e.bundle.js.map +0 -1
  90. package/dist/27.44948497dc4fac6010a8.bundle.js +0 -2
  91. package/dist/27.44948497dc4fac6010a8.bundle.js.map +0 -1
  92. package/dist/30.4d469715c2f2d1028b4b.bundle.js.map +0 -1
  93. package/dist/33.ea3b66016bbeff928fc3.bundle.js.map +0 -1
  94. package/dist/34.620159c2b04af0a88d1b.bundle.js +0 -2
  95. package/dist/34.620159c2b04af0a88d1b.bundle.js.map +0 -1
  96. package/dist/49.71f6e0f6f3284bf63cab.bundle.js +0 -2
  97. package/dist/49.71f6e0f6f3284bf63cab.bundle.js.map +0 -1
  98. package/dist/7.036cd4322fa473fb187a.bundle.js +0 -3
  99. package/dist/7.036cd4322fa473fb187a.bundle.js.map +0 -1
  100. package/dist/8.46db359ed59a04d3799b.bundle.js +0 -2
  101. package/dist/8.46db359ed59a04d3799b.bundle.js.map +0 -1
  102. package/dist/bundle.7c8c6b17e3aea0099e3e.bundle.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"sources":["webpack:///./src/js/angular/rest/connectors.rest.service.js","webpack:///./src/js/angular/externalsync/controllers.js","webpack:///./src/js/angular/core/directives/queryeditor/query-editor.directive.js"],"names":["angular","module","factory","ConnectorsRestService","$inject","CONNECTORS_ENDPOINT","$http","getConnectors","get","initConnector","prefix","hasConnector","checkConnector","data","post","headers","jsonToFormData","str","Object","keys","forEach","key","push","encodeURIComponent","join","mapCreateValuesToUiValues","values","options","i","length","option","__type","__name","j","__childOptions","child","k","valueK","hasOwnProperty","isDefined","__defaultValue","optionEl","isUndefined","map","_","value","toJson","_evaluateSparqlQuery","http","repository","query","buildNamePrefix","substring","createConnectorQuery","name","fields","reportError","fcopy","sortObject","obj","newObject","each","childOption","copy","arrayMap","reduce","acc","Error","fromJson","e","__label","message","removeEmptyValues","Array","isArray","filter","item","trim","finalString","replace","ConnectorsCtrl","$scope","$repositories","$modal","toastr","ModalService","$q","RDF4JRepositoriesRestService","resetProgress","repair","beingBuiltConnector","percentDone","status","processedEntities","estimatedEntities","indexedEntities","entitiesPerSecond","actionName","waitOnRepairStartOnce","eta","inline","iri","openProgressModal","$","extend","doneCallback","modalInstance","dismiss","open","templateUrl","controller","size","backdrop","scope","executeCreate","connector","errorCallback","modal","addStatements","getActiveRepository","update","then","res","existing","success","err","error","getError","finally","loader","controllers","definitions","getLoaderMessage","timeSeconds","Date","now","loaderStartTime","timeHuman","getHumanReadableSeconds","progressMessage","extraMessage","setLoader","isRunning","isLicenseValid","canWriteActiveRepo","connectors","all","connectorIris","createStatusQueryForAny","evaluateSparqlQuery","results","bindings","statusObject","JSON","parse","console","parseFirstBuildingResult","d","split","catch","getOptions","isEmpty","isObject","toPrettyJson","$watch","getActiveLocation","copyConnector","newValues","resolve","result","skipConversion","newConnector","inst","type","openSimpleModal","title","warning","delete","isExternal","indexOf","force","namePrefix","deleteConnectorQuery","viewQuery","DeleteConnectorCtrl","$modalInstance","ok","close","cancel","ExtendNewConnectorCtrl","toQuery","label","addField","index","optionName","newField","defaultValues","splice","addOption","array","deleteOption","addMapOption","deleteMapOption","form","$valid","CreateConnectorCtrl","$controller","this","CreateProgressCtrl","$interval","initProgress","statusIri","createStatusQueryForIri","progressInterval","getFirstStatusFromResult","toFixed","etaSeconds","$on","input","Math","ceil","queryEditorDirective","$timeout","$location","SparqlRestService","$jwtAuth","LocalStorageAdapter","LSKeys","callbackOnChange","restrict","link","element","attrs","nostorage","notabs","notoolbar","notoolbarSaved","notoolbarCopy","notoolbarInference","notoolbarSameAs","nostatus","norun","runButtonName","nocount","callback","saveQueryAction","click","runQueryAction","runQuery","explainQueryAction","goToNextTabAction","tabs","currentQuery","id","isTabChangeOk","idx","findTabIndexByID","selectTab","goToPreviousTabAction","requestedTab","first","tab","changePagination","explainRequested","window","editor","fromTextArea","document","getElementById","persistent","indentUnit","createShareLink","cursorHeight","sparql","showQueryButton","acceptHeaderGraph","acceptHeaderSelect","extraKeys","addNewTab","toastBuildIndex","allowHtml","toastError","on","css","clearTimeout","changesTimeout","hasError","queryValid","setTimeout","toggleClass","attr","getValue","queryType","getQueryType","hide","afterCopy","event","target","removeClass","addClass","blur","onbeforeunload","set","TABS_STATE","saveTab","originalExecuteQuery","executeQuery","originalGetUrlArguments","getUrlArguments","createCustomError","statusText","responseText","connectorProgressModal","yasr","drawButtons","yasqe","buttons","config","qType","currentTabConfig","pageSize","offset","page","cm","resultsContainer","empty","currentTrackAlias","performance","countTimeouted","getQueryMode","endpoint","args","inference","sameAs","customUpdateMessage","thisTabConfig","thisTabId","executedQueryTab","handlers","countCallback","dataOrJqXhr","textStatus","jqXhrOrErrorString","setResultsCount","allResultsCount","allCount","allResultsCountExact","outputType","output","queryStartTime","getTime","setQueryLimit","isActiveRepoOntopType","getValueWithoutComments","doExecute","getRepositorySize","repoSize","parseInt","command","hasSupport","timeFinished","timeTook","customError","connectorName","pluginName","getException","setNewTabState","progressScope","$new","originalGetAjaxConfig","getAjaxConfig","getResponseHeader","contentType","response","executedQueryTabIdx","queryResultState","yasrData","resultsCount","sizeDelta","errorMessage","warningMessage","toBoolean","v","loadQueryIntoExistingOrNewTab","infer","tabId","getExistingTabId","onHandler","search","execute","highlightNextTabChange","body","addTabWithQueryIfNeeded","savedQueryName","owner","getSavedQuery","TABS_STATE_CURRENT_ID","updateRepositoryAndSecurity","getNamespaces","signal","getAuthToken","callbackOrConfig","copyToClipboardQuery","openCopyToClipboardModal","url","location","protocol","host","pathname","param","createQueryURL","copyToClipboardResult","resultURI","goToVisual","paramsToParse","path","addKnownPrefixes","getUsedPrefixes","persistency","getQueryResultsAsFormat","downloadFormat","$wbDownload","val","auth","localStorage","getItem","submit","complete","setNewTabStateForThis","setYasrResponse","updateResultsCallback","repoSizeDiff","undefined","Number","responseJSON","max","hasClass","resetResults","setResponse","namespaces","mouseup","container","is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D,QAArCnL,EAAM8M,iBAAiB3B,UAAqB,CACtG,MAAM/B,EAAMpJ,EAAM0I,KAAKK,EAAiB/I,EAAM2I,aAAaC,KAEvD7P,QAAQuC,UAAU8N,IAAQpJ,EAAM8M,iBAAiB3B,WAC7C/B,EAAIsF,aAAe9S,IACnBwN,EAAIsF,WAAa1O,EAAM2I,aAAa+F,WAAa9S,EACjDoE,EAAM+L,QAAQ3C,EAAIR,cAMlC5I,EAAMmD,OAAO,cAAc,WACnBnD,EAAMsU,aACF9H,GAAQA,EAAK9R,SAAWsF,EAAMsU,aAE9B9H,EAAK9R,QAAQsY,gBAAkBhT,EAAMsU,YAIzC,IAAMxC,OAAOvI,OAAOC,OAAQ,oBAAqBxJ,EAAMsU,gBAYnEhV,EAAEoK,UAAU6K,SAAQ,SAAUhJ,GAC1B,MAAMiJ,EAAYlV,EAAE,2BACfkV,EAAUC,GAAGlJ,EAAMC,SACsB,IAAvCgJ,EAAUE,IAAInJ,EAAMC,QAAQ5Q,QAC5BoF,EAAM2U,mBACT3U,EAAM4U,yBA8FV3W,EAAcqC,uBACdsR,IAIJ5R,EAAMwG,IAAI,mBAAmB,WACrBvI,EAAcqC,uBACdsR,OAMR/K,GAAS,WACL9N,QAAQuO,QAAQoC,UAAUmL,KAAK,oCAAoCC,UACpE,IA1yBCC,CAAgB/U,KACjB,OA7DXjH,QACKC,OAAO,4DAA6D,CACjE,YACA,6CACA,4CACA,gDAEHgc,UAAU,cAAepO,GAE9BA,EAAqBzN,QAAU,CAAC,WAAY,YAAa,SAAU,gBAAiB,oBAAqB,eAAgB,SAAU,WAAY,+BAAgC,wBAAyB,sBAAuB","file":"26.02814d2ed726f5a71d4e.bundle.js","sourcesContent":["angular\n .module('graphdb.framework.rest.connectors.service', [])\n .factory('ConnectorsRestService', ConnectorsRestService);\n\nConnectorsRestService.$inject = ['$http'];\n\nconst CONNECTORS_ENDPOINT = 'rest/connectors';\n\nfunction ConnectorsRestService($http) {\n\n return {\n getConnectors,\n initConnector,\n hasConnector,\n checkConnector\n };\n\n function getConnectors() {\n return $http.get(CONNECTORS_ENDPOINT);\n }\n\n function initConnector(prefix) {\n return $http.get(`${CONNECTORS_ENDPOINT}/options?prefix=${prefix}`);\n }\n\n function hasConnector(prefix) {\n return $http.get(`${CONNECTORS_ENDPOINT}/existing?prefix=${prefix}`);\n }\n\n function checkConnector(data) {\n return $http.post(`${CONNECTORS_ENDPOINT}/check`, data, {\n headers: {\n 'Content-Type': 'text/plain'\n }\n });\n }\n}\n","import 'angular/rest/rdf4j.repositories.rest.service';\nimport 'angular/rest/connectors.rest.service';\n\nconst modules = [\n 'graphdb.framework.rest.rdf4j.repositories.service',\n 'graphdb.framework.rest.connectors.service'\n];\n\nangular\n .module('graphdb.framework.externalsync.controllers', modules)\n .controller('ConnectorsCtrl', ConnectorsCtrl)\n .controller('ExtendNewConnectorCtrl', ExtendNewConnectorCtrl)\n .controller('CreateConnectorCtrl', CreateConnectorCtrl)\n .controller('CreateProgressCtrl', CreateProgressCtrl)\n .controller('DeleteConnectorCtrl', DeleteConnectorCtrl)\n .filter('ceil', ceil);\n\nfunction jsonToFormData(data) {\n const str = [];\n Object.keys(data).forEach(function (key) {\n str.push(encodeURIComponent(key) + '=' + encodeURIComponent(data[key]));\n });\n return str.join('&');\n}\n\nfunction toArrayMap(map) {\n return _.map(map, function (value, key) {\n return {key: key, value: value};\n });\n}\n\nfunction fromArrayMap(arrayMap) {\n return _.reduce(arrayMap, function (acc, value) {\n if (value.key === '' && value.value === '') {\n // empty pair, skip it\n } else if (value.key === '') {\n throw new Error('Key may not be empty with value \"' + value.value + '\"');\n } else if (acc.hasOwnProperty(value.key)) {\n throw new Error('Duplicate key ' + value.key);\n } else {\n acc[value.key] = value.value;\n }\n return acc;\n }, {});\n}\n\nfunction mapCreateValuesToUiValues(values, options) {\n for (let i = 0; i < options.length; i++) {\n const option = options[i];\n if (option.__type === 'StringArray') {\n if (!values[option.__name]) {\n values[option.__name] = [''];\n }\n } else if (option.__type === 'OptionArray') {\n if (!values[option.__name]) { // values has no entry for this option\n values[option.__name] = [];\n const optionEl = {};\n for (let j = 0; j < option.__childOptions.length; j++) {\n const child = option.__childOptions[j];\n if (child.__type === 'StringArray') {\n optionEl[child.__name] = [''];\n } else {\n optionEl[child.__name] = (!angular.isUndefined(child.__defaultValue) ? child.__defaultValue : '');\n }\n }\n values[option.__name].push(optionEl);\n } else { // values already has en entry for this option\n // Copies the default value for Boolean child options if no explicit value is set\n for (let j = 0; j < option.__childOptions.length; j++) {\n const child = option.__childOptions[j];\n if (child.__type === 'Boolean') {\n for (let k = 0; k < values[option.__name].length; k++) {\n const valueK = values[option.__name][k];\n if (!valueK.hasOwnProperty([child.__name]) && angular.isDefined(child.__defaultValue)) {\n valueK[child.__name] = child.__defaultValue;\n }\n }\n }\n }\n }\n } else if (option.__type === 'Map') {\n if (!values[option.__name]) {\n values[option.__name] = [];\n } else {\n values[option.__name] = toArrayMap(values[option.__name]);\n }\n } else if (option.__type === 'JsonString') {\n if (values[option.__name]) {\n values[option.__name] = angular.toJson(values[option.__name], 2);\n }\n } else {\n if (angular.isUndefined(values[option.__name])) {\n values[option.__name] = (!angular.isUndefined(option.__defaultValue) ? option.__defaultValue : '');\n }\n }\n }\n\n return values;\n}\n\nfunction _evaluateSparqlQuery(http, repository, query) {\n return http.post('repositories/' + repository, jsonToFormData({query: query}),\n {\n headers: {\n 'Content-Type': 'application/x-www-form-urlencoded',\n 'Accept': 'application/sparql-results+json',\n 'X-GraphDB-Local-Consistency': 'updating'\n }\n });\n}\n\nfunction buildNamePrefix(prefix) {\n return prefix.substring(0, prefix.length - 1) + '/instance#';\n}\n\nfunction createConnectorQuery(name, prefix, fields, options, reportError) {\n // Returns a copy of the parameter obj sorted according to the order in options\n function sortObject(obj, options) {\n const newObject = {};\n _.each(options, function (option) {\n if (angular.isDefined(obj[option.__name])) {\n if (option.__type === 'OptionArray') {\n newObject[option.__name] = [];\n _.each(obj[option.__name], function (childOption) {\n newObject[option.__name].push(sortObject(childOption, option.__childOptions));\n });\n } else {\n newObject[option.__name] = angular.copy(obj[option.__name]);\n }\n }\n });\n return newObject;\n }\n\n const fcopy = sortObject(fields, options);\n\n for (let i = 0; i < options.length; i++) {\n try {\n if (options[i].__type === 'Map') {\n fcopy[options[i].__name] = fromArrayMap(fcopy[options[i].__name]);\n } else if (options[i].__type === 'JsonString') {\n fcopy[options[i].__name] = angular.fromJson(fcopy[options[i].__name]);\n }\n } catch (e) {\n reportError(options[i].__label, e.message);\n return null;\n }\n }\n\n removeEmptyValues(fcopy);\n //escapeValues(fields);\n let finalString = '';\n finalString += 'PREFIX :<' + prefix + '>\\n';\n const namePrefix = buildNamePrefix(prefix);\n finalString += 'PREFIX inst:<' + namePrefix + '>\\n';\n finalString += 'INSERT DATA {\\n';\n finalString += \"\\tinst:\" + name + \" :createConnector '''\\n\"; // eslint-disable-line quotes\n finalString += angular.toJson(fcopy, 2);\n finalString += \"\\n''' .\\n}\\n\"; // eslint-disable-line quotes\n finalString = finalString.replace(/\\\\/g, '\\\\\\\\\\\\');\n return finalString;\n}\n\nfunction createStatusQueryForIri(iri) {\n const statusIri = iri.replace(/\\/instance#.+$/, '#connectorStatus');\n let finalString = '';\n finalString += 'SELECT ?status {\\n';\n finalString += '\\t<' + iri + '> <' + statusIri + '> ?status';\n finalString += '\\n}';\n return finalString;\n}\n\nfunction createStatusQueryForAny(connectors) {\n const connectorIris = _.map(connectors,\n function (k) {\n return '<' + k.value + 'connectorStatus' + '>';\n }).join('|');\n\n if (connectorIris) {\n return 'SELECT ?connector ?status { ?connector ' + connectorIris + ' ?status }';\n }\n\n return null;\n}\n\nfunction repairConnectorQuery(name, prefix) {\n const namePrefix = buildNamePrefix(prefix);\n return 'PREFIX prefix:<' + prefix + '>\\n' +\n 'INSERT DATA {\\n' +\n '\\t<' + namePrefix + name + '> prefix:repairConnector \"\"\\n' +\n '}';\n}\n\nfunction deleteConnectorQuery(name, prefix, force) {\n const namePrefix = prefix.substring(0, prefix.length - 1) + \"/instance#\";\n return 'PREFIX prefix:<' + prefix + '>\\n' +\n 'INSERT DATA {\\n' +\n '\\t<' + namePrefix + name + '> prefix:dropConnector \"' + (force ? \"force\" : \"\") + '\"\\n' +\n '}';\n}\n\nfunction removeEmptyValues(data) {\n // remove empty values from array\n if (Array.isArray(data)) {\n data = _.filter(data, function (item) {\n return item !== null && (!item.trim || item.trim() !== '');\n });\n }\n // remove empty values from object values\n Object.keys(data).forEach(function (key) {\n if ((data[key] === '' || data[key] == null) && data[key] !== false) {\n delete data[key];\n } else if (typeof data[key] === 'object') {\n data[key] = removeEmptyValues(data[key]);\n }\n });\n return data;\n}\n\nfunction parseFirstBuildingResult(results) {\n if (results.bindings) {\n for (let i = 0; i < results.bindings.length; i++) {\n try {\n const statusObject = JSON.parse(results.bindings[i].status.value);\n if (statusObject.status === 'BUILDING') {\n return {\n connector: results.bindings[i].connector.value,\n status: statusObject\n };\n }\n } catch (e) {\n console.error(e); // eslint-disable-line no-console\n }\n }\n }\n\n return {};\n}\n\nConnectorsCtrl.$inject = ['$scope', '$http', '$repositories', '$modal', 'toastr', 'ModalService', '$q', 'RDF4JRepositoriesRestService', 'ConnectorsRestService'];\n\nfunction ConnectorsCtrl($scope, $http, $repositories, $modal, toastr, ModalService, $q, RDF4JRepositoriesRestService, ConnectorsRestService) {\n $scope.loader = false;\n\n $scope.controllers = [];\n\n $scope.existing = {};\n\n $scope.definitions = {};\n\n $scope.getLoaderMessage = function () {\n const timeSeconds = (Date.now() - $scope.loaderStartTime) / 1000;\n const timeHuman = $scope.getHumanReadableSeconds(timeSeconds);\n let message = '';\n if ($scope.progressMessage) {\n message = $scope.progressMessage + '... ' + timeHuman;\n } else {\n message = 'Running operation...' + timeHuman;\n }\n if ($scope.extraMessage && timeSeconds > 10) {\n message += '\\n' + $scope.extraMessage;\n }\n\n return message;\n };\n\n $scope.setLoader = function (isRunning, progressMessage, extraMessage) {\n if (isRunning) {\n $scope.loader = true;\n $scope.loaderStartTime = Date.now();\n $scope.progressMessage = progressMessage;\n $scope.extraMessage = extraMessage;\n } else {\n $scope.loader = false;\n $scope.progressMessage = '';\n $scope.extraMessage = '';\n }\n };\n\n $scope.initConnector = function (connector) {\n return ConnectorsRestService.initConnector(encodeURIComponent(connector.value))\n .then(function (res) {\n $scope.definitions[connector.key] = res.data;\n\n return ConnectorsRestService.hasConnector(encodeURIComponent(connector.value))\n .then(function (res) {\n $scope.existing[connector.key] = res.data;\n\n });\n });\n };\n\n $scope.getConnectors = function () {\n if (!$scope.isLicenseValid()) {\n return;\n }\n if (!$scope.canWriteActiveRepo()) {\n return;\n }\n\n $scope.setLoader(true, 'Fetching connectors', 'Normally this is a fast operation but it may take longer if a bigger repository needs to be initialised first.');\n\n ConnectorsRestService.getConnectors()\n .then(function (res) {\n $scope.connectors = Object.keys(res.data).map(function (key) {\n return {key: key, value: res.data[key]};\n });\n\n $q.all(_.map($scope.connectors, function (connector) {\n return $scope.initConnector(connector);\n })).finally(function () {\n resetProgress();\n\n const query = createStatusQueryForAny($scope.connectors);\n\n if (query) {\n evaluateSparqlQuery(query)\n .then(function (res) {\n const status = parseFirstBuildingResult(res.data.results);\n if (status.connector) {\n // has a building connector, open progress indicator\n const d = status.connector.split(/#/);\n d[0] = d[0].replace(/\\/instance$/, '#');\n showProgress(d[0], d[1]);\n }\n })\n .finally(function () {\n $scope.setLoader(false);\n });\n } else {\n $scope.setLoader(false);\n }\n });\n }).catch(function (e) {\n $scope.setLoader(false);\n toastr.error(getError(e), 'Could not get connectors');\n });\n\n $scope.existing = {};\n };\n\n $scope.getOptions = function (connector) {\n return $scope.definitions[connector.key];\n };\n\n $scope.isEmpty = function (value) {\n return angular.isObject(value) && Object.keys(value).length === 0;\n };\n\n $scope.toPrettyJson = function (value) {\n return angular.toJson(value, 2);\n };\n\n $scope.$watch(function () {\n return $repositories.getActiveRepository();\n }, $scope.getConnectors);\n\n $scope.$watch(function () {\n return $repositories.getActiveLocation();\n }, $scope.getConnectors);\n\n function evaluateSparqlQuery(query) {\n return _evaluateSparqlQuery($http, $repositories.getActiveRepository(), query);\n }\n\n function resetProgress(repair) {\n $scope.beingBuiltConnector = {\n percentDone: 0,\n status: {\n processedEntities: 0,\n estimatedEntities: 0,\n indexedEntities: 0,\n entitiesPerSecond: 0\n },\n actionName: repair ? 'Repairing' : 'Creating',\n waitOnRepairStartOnce: !!repair,\n eta: '-',\n inline: false,\n iri: null\n };\n }\n\n function openProgressModal(prefix, name, repair) {\n resetProgress(repair);\n\n $.extend($scope.beingBuiltConnector, {\n iri: buildNamePrefix(prefix) + name,\n name: name,\n inline: false,\n doneCallback: function () {\n $scope.beingBuiltConnector.modalInstance.dismiss('cancel');\n }\n });\n\n $scope.beingBuiltConnector.modalInstance = $modal.open({\n templateUrl: 'pages/connectorProgress.html',\n controller: 'CreateProgressCtrl',\n size: 'lg',\n backdrop: 'static',\n scope: $scope\n });\n\n return $scope.beingBuiltConnector.modalInstance;\n }\n\n function showProgress(prefix, name) {\n resetProgress();\n\n $.extend($scope.beingBuiltConnector, {\n iri: buildNamePrefix(prefix) + name,\n name: name,\n inline: true,\n doneCallback: function () {\n $scope.beingBuiltConnector.inline = false;\n }\n });\n }\n\n function executeCreate(connector, obj, errorCallback) {\n const modal = openProgressModal(connector.value, obj.name, false);\n RDF4JRepositoriesRestService.addStatements($repositories.getActiveRepository(), jsonToFormData({update: obj.query}))\n .then(function () {\n ConnectorsRestService.getConnectors().then(function () {\n ConnectorsRestService.hasConnector(encodeURIComponent(connector.value)).then(function (res) {\n $scope.existing[connector.key] = res.data;\n });\n });\n toastr.success('Created connector ' + obj.name);\n }, function (err) {\n toastr.error(getError(err));\n errorCallback();\n }).finally(function () {\n modal.dismiss('cancel');\n });\n }\n\n $scope.copyConnector = function (connector, values) {\n let newValues;\n if (!angular.isUndefined(values)) {\n newValues = angular.copy(values);\n newValues.name = newValues.name + '-copy';\n }\n const modal = $modal.open({\n templateUrl: 'pages/createConnector.html',\n controller: 'CreateConnectorCtrl',\n size: 'lg',\n backdrop: 'static',\n resolve: {\n connector: function () {\n return connector;\n },\n values: function () {\n return angular.isUndefined(newValues) ? {name: '', values: {}} : newValues;\n },\n options: function () {\n return $scope.getOptions(connector);\n }\n }\n });\n\n modal.result.then(function (obj) {\n executeCreate(connector, obj, function () {\n obj.skipConversion = true;\n $scope.newConnector(connector, obj);\n });\n });\n };\n\n $scope.newConnector = function (connector, values) {\n const modal = $modal.open({\n templateUrl: 'pages/createConnector.html',\n controller: 'CreateConnectorCtrl',\n size: 'lg',\n backdrop: 'static',\n resolve: {\n connector: function () {\n return connector;\n },\n values: function () {\n return angular.isUndefined(values) ? {name: '', values: {}} : values;\n },\n options: function () {\n return $scope.getOptions(connector);\n }\n }\n });\n\n modal.result.then(function (obj) {\n executeCreate(connector, obj, function () {\n obj.skipConversion = true;\n $scope.newConnector(connector, obj);\n });\n });\n };\n\n $scope.repair = function (inst, type) {\n ModalService.openSimpleModal({\n title: 'Confirm repair',\n message: 'Are you sure you want to repair this connector?<br>Note that repair means delete + recreate with the same settings.',\n warning: true\n }).result\n .then(function () {\n const modal = openProgressModal(type.value, inst.name, true);\n\n const query = repairConnectorQuery(inst.name, type.value);\n\n RDF4JRepositoriesRestService.addStatements($repositories.getActiveRepository(), jsonToFormData({update: query}))\n .then(function () {\n ConnectorsRestService.getConnectors().then(function () {\n ConnectorsRestService.hasConnector(encodeURIComponent(type.value)).then(function (res) {\n $scope.existing[type.key] = res.data;\n });\n });\n toastr.success('Repaired connector ' + inst.name);\n }, function (err) {\n toastr.error(getError(err));\n }).finally(function () {\n modal.dismiss('cancel');\n });\n });\n };\n\n $scope.delete = function (inst, type) {\n const isExternal = type.key.indexOf(\"Elastic\") >= 0 || type.key.indexOf(\"Solr\") >= 0;\n\n $modal.open({\n templateUrl: 'js/angular/externalsync/templates/deleteConnector.html',\n controller: 'DeleteConnectorCtrl',\n resolve: {\n type: function () {\n return type.key;\n },\n isExternal: function () {\n return isExternal;\n }\n }\n }).result\n .then(function(force) {\n $scope.setLoader(true, 'Deleting connector ' + inst.name, 'This is usually a fast operation but it might take a while.');\n\n const query = deleteConnectorQuery(inst.name, type.value, force);\n RDF4JRepositoriesRestService.addStatements($repositories.getActiveRepository(), jsonToFormData({update: query}))\n .then(function () {\n ConnectorsRestService.getConnectors().then(function () {\n ConnectorsRestService.hasConnector(encodeURIComponent(type.value)).then(function (res) {\n $scope.existing[type.key] = res.data;\n });\n });\n if (force) {\n toastr.success(\"Deleted (with force) connector \" + inst.name);\n if (isExternal) {\n toastr.warning(\"You may have to remove the index manually from \" + type.key);\n }\n } else {\n toastr.success(\"Deleted connector \" + inst.name);\n }\n }, function (err) {\n toastr.error(getError(err));\n }).finally(function() {\n $scope.setLoader(false);\n });\n });\n };\n\n $scope.viewQuery = function (connector, inst) {\n $modal.open({\n templateUrl: 'pages/viewQuery.html',\n controller: 'ViewQueryCtrl',\n resolve: {\n query: function () {\n const options = $scope.getOptions(connector);\n return createConnectorQuery(inst.name, connector.value,\n mapCreateValuesToUiValues(inst.values, options), options);\n }\n }\n });\n };\n}\n\nDeleteConnectorCtrl.$inject = ['$scope', '$modalInstance', 'type', 'isExternal'];\nfunction DeleteConnectorCtrl($scope, $modalInstance, type, isExternal) {\n $scope.force = false;\n $scope.type = type;\n $scope.isExternal = isExternal;\n\n $scope.ok = function () {\n $modalInstance.close($scope.force);\n };\n\n $scope.cancel = function () {\n $modalInstance.dismiss();\n };\n}\n\nExtendNewConnectorCtrl.$inject = ['$scope', '$modalInstance', 'connector', '$modal', 'toastr'];\nfunction ExtendNewConnectorCtrl($scope, $modalInstance, connector, $modal, toastr) {\n\n $scope.connector = connector;\n\n $scope.addField = function (index, optionName) {\n const newField = angular.copy($scope.defaultValues[optionName][0]);\n $scope.values[optionName].splice(index + 1, 0, newField);\n };\n\n $scope.addOption = function (index, array) {\n array.splice(index + 1, 0, '');\n };\n\n $scope.deleteOption = function (index, array) {\n array.splice(index, 1);\n };\n\n $scope.addMapOption = function (index, array) {\n array.splice(index + 1, 0, {key: '', value: ''});\n };\n\n $scope.deleteMapOption = function (index, array) {\n array.splice(index, 1);\n };\n\n function toQuery() {\n return createConnectorQuery($scope.name, connector.value, $scope.values, $scope.options,\n function (label, error) {\n toastr.error(error, label);\n });\n }\n\n $scope.ok = function () {\n if ($scope.form.$valid) {\n const query = toQuery();\n\n if (query) {\n $modalInstance.close({name: $scope.name, values: $scope.values, options: $scope.options, query: query});\n }\n }\n };\n\n $scope.viewQuery = function () {\n const query = toQuery();\n\n if (query) {\n $modal.open({\n templateUrl: 'pages/viewQuery.html',\n controller: 'ViewQueryCtrl',\n resolve: {\n query: function () {\n return query;\n }\n }\n });\n }\n };\n\n $scope.cancel = function () {\n $modalInstance.dismiss('cancel');\n };\n}\n\nCreateConnectorCtrl.$inject = ['$scope', '$controller', '$http', '$modalInstance', 'connector', '$modal', 'values', 'options'];\n\nfunction CreateConnectorCtrl($scope, $controller, $http, $modalInstance, connector, $modal, values, options) {\n angular.extend(this, $controller('ExtendNewConnectorCtrl', {\n $scope: $scope,\n $modalInstance: $modalInstance,\n connector: connector,\n $modal: $modal\n }));\n $scope.values = values.values;\n $scope.options = options;\n $scope.name = values.name;\n if (!values.skipConversion) {\n $scope.values = mapCreateValuesToUiValues($scope.values, $scope.options);\n }\n $scope.defaultValues = angular.copy($scope.values);\n}\n\n// Note that this is a fancy controller: it's used both for a modal and for a directive.\n// This means you can't rely on custom injection through resolve in the modal and the scope\n// must be shared with the main connectors controller.\nCreateProgressCtrl.$inject = ['$scope', '$interval', '$http', '$repositories'];\n\nfunction CreateProgressCtrl($scope, $interval, $http, $repositories) {\n function evaluateSparqlQuery(query) {\n return _evaluateSparqlQuery($http, $repositories.getActiveRepository(), query);\n }\n\n function initProgress() {\n const query = createStatusQueryForIri($scope.beingBuiltConnector.iri);\n\n // reset iri value so that watch will fire again when we do something with the same connector\n $scope.beingBuiltConnector.iri = null;\n\n $scope.progressInterval = $interval(function () {\n function getFirstStatusFromResult(results) {\n if (results.bindings) {\n if (results.bindings.length > 0) {\n try {\n return JSON.parse(results.bindings[0].status.value);\n } catch (e) {\n console.error(e); // eslint-disable-line no-console\n }\n }\n }\n\n return {};\n }\n\n evaluateSparqlQuery(query)\n .then(function (res) {\n const status = getFirstStatusFromResult(res.data.results);\n if (status.status === 'BUILDING') {\n $scope.beingBuiltConnector.status = status;\n $scope.beingBuiltConnector.percentDone = (100 * status.processedEntities / status.estimatedEntities).toFixed(0);\n $scope.beingBuiltConnector.eta = $scope.getHumanReadableSeconds(status.etaSeconds);\n $scope.beingBuiltConnector.actionName = status.repair ? 'Repairing' : 'Creating';\n $scope.beingBuiltConnector.waitOnRepairStartOnce = false;\n } else if (status.status === 'BUILT' && !$scope.beingBuiltConnector.waitOnRepairStartOnce) {\n // done\n $interval.cancel($scope.progressInterval);\n if ($scope.beingBuiltConnector.doneCallback) {\n $scope.beingBuiltConnector.doneCallback();\n }\n }\n });\n }, 1000);\n\n $scope.$on('$destroy', function () {\n $interval.cancel($scope.progressInterval);\n });\n }\n\n $scope.beingBuiltConnector = $scope.beingBuiltConnector || {};\n\n // for modal instance we get the iri before hand and can start progress now\n if (!$scope.beingBuiltConnector.inline && $scope.beingBuiltConnector.iri) {\n initProgress();\n }\n\n // for inline progress we need to watch for the iri value\n $scope.$watch('beingBuiltConnector.iri', function (value) {\n if ($scope.beingBuiltConnector.inline && value) {\n initProgress();\n }\n });\n}\n\nfunction ceil() {\n return function (input) {\n return Math.ceil(input);\n };\n}\n","import 'angular/rest/connectors.rest.service';\nimport 'angular/utils/local-storage-adapter';\nimport 'angular/externalsync/controllers';\nimport YASQE from 'lib/yasqe.bundled';\nimport YASR from 'lib/yasr.bundled';\n\nangular\n .module('graphdb.framework.core.directives.queryeditor.queryeditor', [\n 'ngCookies',\n 'graphdb.framework.externalsync.controllers',\n 'graphdb.framework.rest.connectors.service',\n 'graphdb.framework.utils.localstorageadapter'\n ])\n .directive('queryEditor', queryEditorDirective);\n\nqueryEditorDirective.$inject = ['$timeout', '$location', 'toastr', '$repositories', 'SparqlRestService', 'ModalService', '$modal', '$jwtAuth', 'RDF4JRepositoriesRestService', 'ConnectorsRestService', 'LocalStorageAdapter', 'LSKeys'];\n\nfunction queryEditorDirective($timeout, $location, toastr, $repositories, SparqlRestService, ModalService, $modal, $jwtAuth, RDF4JRepositoriesRestService, ConnectorsRestService, LocalStorageAdapter, LSKeys) {\n\n let callbackOnChange;\n\n return {\n restrict: 'AE',\n scope: false,\n templateUrl: 'js/angular/core/directives/queryeditor/templates/query-editor.html',\n link: linkFunc\n };\n\n //function updateLineGutter() in Yasqe receive wrong data and line numbers div have width 100%\n // magic value 150 seems to work well (including Safari), smaller values work on other browsers but not always on Safari\n function linkFunc(scope, element, attrs) {\n // Doesn't store anything in local storage\n scope.nostorage = attrs.hasOwnProperty('nostorage');\n // Doesn't allow multiple tabs in the editor, only a single tab is active\n scope.notabs = attrs.hasOwnProperty('notabs');\n // Hides all the vertical toolbar inside the editor\n scope.notoolbar = attrs.hasOwnProperty('notoolbar');\n // Hides the saved queries icons in the toolbar\n scope.notoolbarSaved = attrs.hasOwnProperty('notoolbarSaved');\n // Hides the copy query link icon in the toolbar\n scope.notoolbarCopy = attrs.hasOwnProperty('notoolbarCopy');\n // Hides the inference icon in the toolbar\n scope.notoolbarInference = attrs.hasOwnProperty('notoolbarInference');\n // Hides the sameAs icon in the toolbar\n scope.notoolbarSameAs = attrs.hasOwnProperty('notoolbarSameAs');\n // Doesn't show any status messages in YASR (e.g. no results, query took that many seconds, etc)\n scope.nostatus = attrs.hasOwnProperty('nostatus');\n // Doesn't show the run button\n scope.norun = attrs.hasOwnProperty('norun');\n // Name of the Run button in the editor\n scope.runButtonName = \"Run\";\n if (attrs.runButtonName) {\n scope.runButtonName = attrs.runButtonName;\n }\n // Doesn't execute the count query\n scope.nocount = attrs.nocount === \"true\";\n\n // Custom callback to call when the content changes (fired within timeout of 200)\n if (attrs.callbackOnChange) {\n const callback = scope[attrs.callbackOnChange];\n if (typeof callback === 'function') {\n callbackOnChange = callback;\n }\n }\n\n $timeout(function () {\n drawQueryEditor(scope);\n }, 150);\n }\n\n function drawQueryEditor(scope) {\n scope.changePagination = changePagination;\n\n // start of keyboard shortcut actions\n function saveQueryAction() {\n angular.element('#wb-sparql-saveQuery')[0].click();\n }\n\n function runQueryAction() {\n scope.runQuery(false, false);\n }\n\n function explainQueryAction() {\n scope.runQuery(false, true);\n }\n\n function goToNextTabAction() {\n if (scope.tabs.length < 2 || !scope.currentQuery.id || !scope.isTabChangeOk(false)) {\n return;\n }\n let idx = findTabIndexByID(scope.currentQuery.id);\n idx = (idx + 1) % scope.tabs.length;\n const tab = scope.tabs[idx];\n selectTab(tab.id);\n }\n\n function goToPreviousTabAction() {\n if (scope.tabs.length < 2 || !scope.currentQuery.id || !scope.isTabChangeOk(false)) {\n return;\n }\n let idx = findTabIndexByID(scope.currentQuery.id);\n idx--;\n if (idx === -1) {\n idx = scope.tabs.length - 1;\n }\n const tab = scope.tabs[idx];\n selectTab(tab.id);\n }\n\n window.editor = YASQE.fromTextArea(\n document.getElementById(\"query\"), {\n persistent: null,\n value: \"\",\n indentUnit: 4,\n createShareLink: null,\n cursorHeight: 1.0,\n sparql: {\n showQueryButton: false,\n acceptHeaderGraph: \"application/x-graphdb-table-results+json, application/rdf+json;q=0.9, */*;q=0.8\",\n acceptHeaderSelect: \"application/x-sparqlstar-results+json, application/sparql-results+json;q=0.9, */*;q=0.8\"\n },\n // We provide a wrapper for executeQuery so we have to redefine those here\n extraKeys: {\n \"Ctrl-Enter\": runQueryAction,\n \"Cmd-Enter\": runQueryAction,\n \"Shift-Ctrl-Enter\": explainQueryAction,\n \"Shift-Cmd-Enter\": explainQueryAction,\n \"Ctrl-Alt-T\": scope.addNewTab,\n \"Cmd-Alt-T\": scope.addNewTab,\n \"Ctrl-S\": saveQueryAction,\n \"Cmd-S\": saveQueryAction,\n \"Ctrl-Alt-Left\": goToPreviousTabAction,\n \"Cmd-Alt-Left\": goToPreviousTabAction,\n \"Ctrl-Alt-Right\": goToNextTabAction,\n \"Cmd-Alt-Right\": goToNextTabAction\n }\n }\n );\n\n window.editor.toastBuildIndex = function () {\n toastr.warning('', '<div class=\"autocomplete-toast\"><a href=\"autocomplete\">Autocomplete is OFF<br>Go to Setup -> Autocomplete</a></div>',\n {allowHtml: true});\n };\n\n window.editor.toastError = function (data) {\n toastr.error('Cannot execute autocomplete query. ' + getError(data));\n };\n\n window.editor.on(\"changes\", function () {\n angular.element('.CodeMirror-linenumbers').css('width', '1px');\n angular.element('.CodeMirror-sizer').css('margin-left', '0px');\n clearTimeout(scope.changesTimeout);\n const hasError = !window.editor.queryValid;\n scope.changesTimeout = setTimeout(callbackOnChange ? callbackOnChange() : function () {\n const idx = findTabIndexByID(scope.currentQuery.id) + 1;\n $('a[data-id = \"' + idx + '\"]')\n .toggleClass('query-has-error', hasError)\n .attr('title', hasError ?\n 'Query contains a syntax error. See the relevant line for more information.' :\n '');\n }, 200);\n scope.currentQuery.query = window.editor.getValue();\n scope.currentQuery.queryType = window.editor.getQueryType();\n });\n\n\n function selectTab(id) {\n $timeout(function () {\n let requestedTab = $('a[data-id = \"' + id + '\"]');\n if (requestedTab.length === 0) {\n // tab has been deleted in another browser window or something else occurred,\n // select first tab instead\n requestedTab = $('a[data-id]').first();\n }\n requestedTab.tab('show');\n }, 0);\n }\n\n // hide unneeded yasqe fullscreen button\n $(\".fullscreenToggleBtns\").hide();\n\n const afterCopy = function (event) {\n $(event.target).removeClass('fa-link').addClass('fa-check').blur();\n setTimeout(function () {\n $(event.target).removeClass('fa-check').addClass('fa-link');\n }, 1000);\n };\n\n window.onbeforeunload = function () {\n if (!scope.nostorage) {\n LocalStorageAdapter.set(LSKeys.TABS_STATE, scope.tabs);\n }\n scope.saveTab(scope.currentQuery.id);\n };\n\n /*\n * Patch the execute query to take into account the inference\n * and the same as options\n */\n const originalExecuteQuery = YASQE.executeQuery;\n const originalGetUrlArguments = YASQE.getUrlArguments;\n\n scope.$on('$destroy', function () {\n if (!scope.nostorage) {\n LocalStorageAdapter.set(LSKeys.TABS_STATE, scope.tabs);\n }\n YASQE.executeQuery = originalExecuteQuery;\n YASQE.getUrlArguments = originalGetUrlArguments;\n scope.saveTab(scope.currentQuery.id);\n });\n\n /*\n * Add our own buttons\n */\n YASQE.drawButtons = function (yasqe) {\n // Define this property because otherwise there are errors in yasgui's code.\n yasqe.buttons = $(\"#yasqe_buttons_mocked\");\n };\n\n YASQE.getActiveRepository = function () {\n return $repositories.getActiveRepository();\n };\n\n YASQE.getUrlArguments = function (yasqe, config) {\n const data = originalGetUrlArguments(yasqe, config);\n const qType = window.editor.getQueryType();\n if ('SELECT' === qType || 'CONSTRUCT' === qType || 'DESCRIBE' === qType) {\n // We request pageSize + 1 to know if there are more pages when total count isn't known\n data.push({name: 'limit', value: scope.currentTabConfig.pageSize + 1});\n scope.currentTabConfig.offset = (scope.currentTabConfig.page - 1) * scope.currentTabConfig.pageSize + 1;\n data.push({name: 'offset', value: scope.currentTabConfig.offset - 1});\n }\n // even though we have explainRequested in our scope too it doesn't always contain a fresh value\n if (scope.explainRequested && ('SELECT' === qType || 'CONSTRUCT' === qType)) {\n data.push({name: 'explain', value: 'true'});\n }\n return data;\n };\n\n function createCustomError(status, statusText, responseText) {\n return {\n status: status,\n statusText: statusText,\n responseText: responseText\n };\n }\n\n // Generates a new tracking alias for queries based on time\n function newTrackAlias() {\n return \"query-editor-\" + performance.now() + \"-\" + Date.now();\n }\n\n let connectorProgressModal;\n let yasr;\n\n YASQE.executeQuery = function (cm) {\n if (yasr && $(yasr.resultsContainer).length) {\n $(yasr.resultsContainer).empty();\n }\n // Request extra error/warning handling\n cm.options.sparql.headers['X-GraphDB-Catch'] = scope.currentTabConfig.pageSize + '; throw';\n scope.currentTrackAlias = newTrackAlias();\n cm.options.sparql.headers['X-GraphDB-Track-Alias'] = scope.currentTrackAlias;\n scope.countTimeouted = false;\n if (cm.getQueryMode() === 'query') {\n cm.options.sparql.endpoint = 'repositories/' + $repositories.getActiveRepository();\n } else if (cm.getQueryMode() === 'update') {\n cm.options.sparql.endpoint = 'repositories/' + $repositories.getActiveRepository() + '/statements';\n }\n cm.options.sparql.args = [{\n name: 'infer',\n value: scope.currentQuery.inference\n },\n {\n name: 'sameAs',\n value: scope.currentQuery.sameAs\n }];\n\n scope.currentTabConfig.customUpdateMessage = \"\";\n\n if (window.editor.getQueryMode() === \"update\") {\n const doExecute = function () {\n scope.currentTabConfig.queryType = \"UPDATE\";\n\n RDF4JRepositoriesRestService.getRepositorySize()\n .success(function (data) {\n scope.repoSize = parseInt(data);\n scope.queryStartTime = new Date().getTime();\n return originalExecuteQuery(cm, {});\n })\n .error(function (data) {\n toastr.warning('Could not get repository size for: ' + $repositories.getActiveRepository() + '; ' + getError(data));\n scope.queryStartTime = new Date().getTime();\n return originalExecuteQuery(cm, {});\n });\n };\n\n ConnectorsRestService.checkConnector(window.editor.getValue())\n .then(function (res) {\n if (res.data.command && !res.data.hasSupport) {\n // it's a connector query but the relevant plugin isn't active, stop executing and warn the user\n scope.currentTabConfig.queryType = 'ERROR';\n scope.currentTabConfig.timeFinished = Date.now();\n scope.currentTabConfig.timeTook = (scope.currentTabConfig.timeFinished - scope.queryStartTime) / 1000;\n\n const customError = createCustomError(-1, 'No support for ' + res.data.connectorName, res.data.connectorName\n + ' connectors are not supported because the plugin ' + res.data.pluginName + ' is not active.');\n\n yasr.results = {\n getException: function () {\n return customError;\n }\n };\n\n scope.setLoader(false);\n\n setNewTabState({customError: customError}, '', null);\n\n return;\n }\n\n if (res.data.command === 'create' || res.data.command === 'repair') {\n const repair = res.data.command === 'repair';\n if (repair) {\n scope.setLoader(true, 'Repairing connector ' + res.data.name);\n scope.currentTabConfig.customUpdateMessage = 'Repaired connector ' + res.data.name + '.';\n } else {\n scope.setLoader(true, 'Creating connector ' + res.data.name);\n scope.currentTabConfig.customUpdateMessage = 'Created connector ' + res.data.name + '.';\n }\n\n const progressScope = scope.$new(true);\n\n // This duplicates code in the externalsync module but we can't get it from there\n progressScope.beingBuiltConnector = {\n percentDone: 0,\n status: {\n processedEntities: 0,\n estimatedEntities: 0,\n indexedEntities: 0,\n entitiesPerSecond: 0\n },\n actionName: repair ? 'Repairing' : 'Creating',\n eta: \"-\",\n inline: false,\n iri: res.data.iri,\n name: res.data.name,\n doneCallback: function () {\n connectorProgressModal.dismiss('cancel');\n }\n };\n progressScope.getHumanReadableSeconds = scope.getHumanReadableSeconds;\n\n connectorProgressModal = $modal.open({\n templateUrl: 'pages/connectorProgress.html',\n controller: 'CreateProgressCtrl',\n size: 'lg',\n backdrop: 'static',\n scope: progressScope\n });\n } else if (res.data.command === 'drop') {\n scope.setLoader(true, 'Deleting connector ' + res.data.name);\n scope.currentTabConfig.customUpdateMessage = 'Deleted connector ' + res.data.name + '.';\n }\n\n doExecute();\n }, function () {\n // for some reason we couldn't check if this is a connector update, so just execute it\n doExecute();\n });\n\n } else {\n const thisTabConfig = scope.currentTabConfig;\n const thisTabId = scope.executedQueryTab.id;\n\n // Assign a fresh callback function so that we can associate the count result\n // with the right tab (or lack of tab).\n window.editor.options.sparql.handlers.countCallback = function (dataOrJqXhr, textStatus, jqXhrOrErrorString) {\n if (dataOrJqXhr.status === 200) {\n const tab = scope.tabs[findTabIndexByID(thisTabId)];\n if (tab) {\n yasr.setResultsCount(dataOrJqXhr, textStatus, jqXhrOrErrorString);\n thisTabConfig.allResultsCount = yasr.allCount;\n tab.allResultsCount = yasr.allCount;\n thisTabConfig.allResultsCountExact = true;\n tab.allResultsCountExact = true;\n scope.saveTab(tab.id);\n } // Else tab was closed while we wait for the count, ignore result\n } else {\n // count query timed out or something else went wrong\n thisTabConfig.countTimeouted = true;\n }\n };\n\n // Tell YASR what format we want, or else it will mess it up when switching between tabs.\n if (scope.currentQuery.outputType != null) {\n yasr.options.output = scope.currentQuery.outputType;\n } else { // Default to table if no format has been configured yet.\n yasr.options.output = \"table\";\n }\n scope.currentTabConfig.queryType = window.editor.getQueryType();\n scope.queryStartTime = new Date().getTime();\n return originalExecuteQuery(cm, {\n setQueryLimit: function (query) {\n // Until weird conversion of CONSTRUCT queries is fixed\n // in Ontop project, comments should be removed from them\n // TODO: Remove this check when ${link https://github.com/ontop/ontop/issues/362} is fixed\n if (scope.currentTabConfig.queryType === 'CONSTRUCT' && $repositories.isActiveRepoOntopType()) {\n return window.editor.getValueWithoutComments();\n }\n // For all types of queries we handle limit/offset in our RepositoriesController.\n // TODO: Get rid of this method\n return query;\n }\n });\n }\n\n };\n\n // Override yasqe's getAjaxConfig() so we can inject our authorization header\n const originalGetAjaxConfig = YASQE.getAjaxConfig;\n YASQE.getAjaxConfig = function (yasqe, callbackOrConfig) {\n const config = originalGetAjaxConfig(yasqe, callbackOrConfig);\n\n _.extend(config.headers, {\n 'Authorization': $jwtAuth.getAuthToken()\n });\n\n return config;\n };\n\n function createQueryURL(savedQueryName, owner) {\n let url = [location.protocol, '//', location.host, location.pathname].join('');\n if (savedQueryName) {\n url = url + '?savedQueryName=' + encodeURIComponent(savedQueryName);\n if (owner != null) {\n url += '&owner=' + encodeURIComponent(owner);\n }\n } else {\n url = url + '?' + $.param({\n name: scope.currentQuery.name,\n infer: scope.currentQuery.inference,\n sameAs: scope.currentQuery.sameAs,\n query: window.editor.getValue()\n });\n }\n return url;\n }\n\n scope.copyToClipboardQuery = function (savedQueryName, owner) {\n ModalService.openCopyToClipboardModal(createQueryURL(savedQueryName, owner));\n };\n\n scope.copyToClipboardResult = function (resultURI) {\n ModalService.openCopyToClipboardModal(resultURI);\n };\n\n scope.goToVisual = function () {\n const paramsToParse = {\n query: window.editor.getValue(),\n sameAs: scope.currentQuery.sameAs,\n inference: scope.currentQuery.inference\n };\n\n $location.path('graphs-visualizations').search(paramsToParse);\n };\n\n // Adds prefixes when the user pastes a query. This was in the controller before and it stopped working\n // (needs to happen to after YASQE adds the textarea), see GDB-1936\n $('textarea').on('paste', function () {\n $timeout(function () {\n scope.addKnownPrefixes();\n }, 0);\n });\n\n function setNewTabState(dataOrJqXhr, textStatus, jqXhrOrErrorString) {\n // store explicitly the contentType\n if (dataOrJqXhr.getResponseHeader && dataOrJqXhr.getResponseHeader(\"content-type\")) {\n dataOrJqXhr.contentType = dataOrJqXhr.getResponseHeader(\"content-type\");\n }\n\n // We use this when we set YASR results to avoid double JSON parsing and to enforce\n // using the modified responseJSON. We'll save responseJSON instead (no need to save both).\n delete dataOrJqXhr.response;\n\n const executedQueryTabIdx = findTabIndexByID(scope.executedQueryTab.id);\n const executedQueryTab = scope.tabs[executedQueryTabIdx];\n const queryResultState = {\n queryType: scope.currentTabConfig.queryType,\n yasrData: dataOrJqXhr,\n textStatus: textStatus,\n jqXhrOrErrorString: jqXhrOrErrorString,\n page: scope.currentTabConfig.page,\n pageSize: scope.currentTabConfig.pageSize,\n allResultsCount: scope.currentTabConfig.allResultsCount,\n allResultsCountExact: scope.currentTabConfig.allResultsCountExact,\n resultsCount: scope.currentTabConfig.resultsCount,\n offset: scope.currentTabConfig.offset,\n timeTook: scope.currentTabConfig.timeTook,\n timeFinished: scope.currentTabConfig.timeFinished,\n sizeDelta: scope.currentTabConfig.sizeDelta,\n customUpdateMessage: scope.currentTabConfig.customUpdateMessage,\n errorMessage: scope.currentTabConfig.errorMessage,\n warningMessage: scope.currentTabConfig.warningMessage\n };\n\n // Save the output type only if it isn't an update or an ask query.\n // This way we preserve the existing output type when we execute an update and then\n // execute a non-ask query.\n if (scope.currentTabConfig.queryType !== \"ERROR\" && scope.currentTabConfig.queryType !== \"UPDATE\"\n && scope.currentTabConfig.queryType !== \"ASK\") {\n queryResultState.outputType = scope.yasr.options.output;\n }\n\n // merge query results state with the tab object\n angular.extend(scope.currentQuery, queryResultState);\n\n angular.extend(executedQueryTab, queryResultState);\n if (!scope.nostorage) {\n LocalStorageAdapter.set(LSKeys.TABS_STATE, scope.tabs);\n }\n $('a[data-id = \"' + scope.executedQueryTab.id + '\"]').tab('show');\n }\n\n function initYasr() {\n yasr = YASR(document.getElementById(\"yasr\"), { // eslint-disable-line new-cap\n getUsedPrefixes: {}, // initially blank, populated when we fetch the namespaces\n persistency: false\n });\n window.yasr = yasr;\n yasr.afterCopy = afterCopy;\n yasr.getQueryResultsAsFormat = function (downloadFormat) {\n // Simple cross-browser download with a form\n const $wbDownload = $('#wb-download');\n $wbDownload.attr('action', 'repositories/' + $repositories.getActiveRepository());\n $('#wb-download-query').val(scope.currentQuery.query);\n if (window.editor.getValue() !== scope.currentQuery.query) {\n toastr.warning('The query in your editor does not match the query results. Download will save the results from the last executed query.');\n }\n $('#wb-download-infer').val(scope.currentQuery.inference);\n $('#wb-download-sameAs').val(scope.currentQuery.sameAs);\n const auth = localStorage.getItem('com.ontotext.graphdb.auth');\n if (auth) {\n $('#wb-auth-token').val(auth);\n }\n $('#wb-download-accept').val(downloadFormat);\n $wbDownload.submit();\n };\n window.editor.options.sparql.handlers.complete = function (dataOrJqXhr, textStatus, jqXhrOrErrorString) {\n function setNewTabStateForThis() {\n setNewTabState(dataOrJqXhr, textStatus, jqXhrOrErrorString);\n }\n\n if (connectorProgressModal) {\n connectorProgressModal.dismiss('cancel');\n }\n\n // If yasqe was destroyed when scope was destroyed, do nothing\n if (null === window.editor) {\n scope.setLoader(false);\n\n return;\n }\n\n // Extra error/warning through headers\n scope.currentTabConfig.errorMessage = dataOrJqXhr.getResponseHeader('X-GraphDB-Error');\n scope.currentTabConfig.warningMessage = dataOrJqXhr.getResponseHeader('X-GraphDB-Warning');\n\n yasr.currentQuery = scope.currentQuery;\n\n scope.currentTabConfig.timeFinished = Date.now();\n scope.currentTabConfig.timeTook = (scope.currentTabConfig.timeFinished - scope.queryStartTime) / 1000;\n\n if (dataOrJqXhr.status >= 400) {\n // Removes useless com.blah.whatever.FooException: ... from the error message\n dataOrJqXhr.responseText = dataOrJqXhr.responseText.replace(/^([^: ]+: )+/, '');\n\n scope.currentTabConfig.queryType = 'ERROR';\n setNewTabStateForThis();\n scope.setYasrResponse(dataOrJqXhr, textStatus, jqXhrOrErrorString);\n\n scope.setLoader(false);\n\n return;\n }\n\n if (dataOrJqXhr.status === 0) {\n // Query was aborted, typically through window.editor.xhr.abort()\n\n scope.currentTabConfig.queryType = 'ERROR';\n\n const customError = createCustomError(-1, 'Request was aborted', 'The request has been aborted. There are no results to show.');\n\n yasr.results = {\n getException: function () {\n return customError;\n }\n };\n\n scope.setLoader(false);\n\n setNewTabState({customError: customError}, '', null);\n\n return;\n }\n\n scope.setLoader(false);\n\n let updateResultsCallback;\n\n if (window.editor.getQueryMode() === \"update\") {\n updateResultsCallback = function () {\n RDF4JRepositoriesRestService.getRepositorySize()\n .success(function (data) {\n let repoSizeDiff;\n if (scope.repoSize !== undefined) {\n repoSizeDiff = Number(data) - scope.repoSize;\n }\n scope.currentTabConfig.sizeDelta = repoSizeDiff;\n setNewTabStateForThis();\n }).error(function (data) {\n toastr.warning('Could not get repository size for: ' + scope.getActiveRepository() + '; ' + getError(data));\n scope.currentTabConfig.sizeDelta = undefined;\n setNewTabStateForThis();\n });\n };\n } else {\n if (dataOrJqXhr.status === 200) {\n const contentType = dataOrJqXhr.getResponseHeader('Content-Type');\n\n if (contentType.indexOf('application/sparql-results+json') === 0\n || contentType.indexOf('application/x-sparqlstar-results+json') === 0\n || contentType.indexOf('application/x-graphdb-table-results+json') === 0) {\n if (dataOrJqXhr.responseJSON.results) {\n // SELECT results in one of the standard formats or\n // CONSTRUCT or DESCRIBE results in our custom format that looks\n // like a SELECT result.\n scope.currentTabConfig.resultsCount = dataOrJqXhr.responseJSON.results.bindings.length;\n if (dataOrJqXhr.responseJSON.results.bindings.length > scope.currentTabConfig.pageSize) {\n // The results are more than the page size (because we request +1), truncate to page size\n // and raise flag to know we have at least one page more.\n dataOrJqXhr.responseJSON.results.bindings.length = scope.currentTabConfig.pageSize;\n }\n if (!scope.currentTabConfig.allResultsCountExact) {\n if (scope.nocount || scope.countTimeouted\n || scope.currentTabConfig.resultsCount <= scope.currentTabConfig.pageSize) {\n // No count requested or count timed out or the results are less than the pageSize + 1 buffer\n // In all of these cases it doesn't make sense to run\n // the counting query so we tweak the status to signal that to YASQE.\n dataOrJqXhr.status = 204; // 204 is no content, YASQE counts only if status is 200\n }\n\n // Calculate an \"at least\" all results count, i.e. at least what we have until now + 1.\n // The number will increase when we go to the next page eventually reaching the exact count.\n // A count query may also provide the exact count asynchronously.\n scope.currentTabConfig.allResultsCount = Math.max(scope.currentTabConfig.allResultsCount,\n scope.currentTabConfig.pageSize * (scope.currentTabConfig.page - 1) + scope.currentTabConfig.resultsCount);\n\n // We know we reached the end and the count is exact now.\n if (scope.currentTabConfig.resultsCount <= scope.currentTabConfig.pageSize) {\n scope.currentTabConfig.allResultsCountExact = true;\n }\n }\n }\n }\n }\n\n // The following long-running code needs to be in timeout to get the updated loader message\n scope.setLoader(true, 'Rendering results', null, true);\n\n updateResultsCallback = function () {\n scope.setYasrResponse(dataOrJqXhr, textStatus, jqXhrOrErrorString);\n\n setNewTabStateForThis();\n scope.setLoader(false);\n };\n }\n\n // By having this in timeout we manage to get the updated loader message\n $timeout(function () {\n updateResultsCallback();\n\n // Move disabled class to a, and clean from the li\n if (window.editor.getQueryType() !== \"CONSTRUCT\") {\n $('.yasr_btnGroup.nav.nav-tabs li a.disabled').removeClass('disabled').css('font-weight', '400');\n $('.yasr_btnGroup.nav.nav-tabs li.disabled a').addClass('disabled').css('font-weight', '200');\n if (window.editor.getQueryType() === \"DESCRIBE\") {\n $('.yasr_btnGroup.nav.nav-tabs li a').removeClass('disabled').css('font-weight', '400');\n }\n } else if (window.editor.getQueryType() === \"CONSTRUCT\") {\n $('.yasr_btnGroup.nav.nav-tabs li a.disabled').removeClass('disabled').css('font-weight', '400');\n }\n\n\n //Remove paddign of yasr so it will be aligned with sparql editor\n $('#yasr').css('padding', '0');\n\n if ($('.yasr_btnGroup li:nth-child(2)').hasClass(\"active\")) {\n $timeout(function () {\n $('.yasr_btnGroup li:nth-child(2) a').get(0).click();\n }, 100);\n }\n\n //\n $('#wb-sparql-addNewTab').click(function () {\n $('.dataTables_filter').hide();\n $('.resultsTable').hide();\n });\n }, 100);\n };\n\n window.editor.options.sparql.handlers.resetResults = function () {\n };\n\n scope.yasr = yasr;\n\n scope.setYasrResponse = function(dataOrJqXhr, textStatus, jqXhrOrErrorString) {\n // If YASR doesn't see a \"response\" property it will parse the textual JSON in \"responseText\".\n // This is both slow and interferes with the +1 result per page policy when we truncate responseJSON.\n if (dataOrJqXhr.responseJSON) {\n dataOrJqXhr.response = dataOrJqXhr.responseJSON;\n dataOrJqXhr.responseText = undefined;\n }\n yasr.setResponse(dataOrJqXhr, textStatus, jqXhrOrErrorString);\n };\n\n // Track changes in the output type (tab in yasr) so that we can save this together with\n // the rest of the tab's data.\n scope.$watch('yasr.options.output', function (value) {\n // Save the output type only if it isn't an update or an ask query (see comment where we save all properties).\n if (value && scope.currentTabConfig.queryType !== \"UPDATE\" && scope.currentTabConfig.queryType !== \"ASK\") {\n const tab = scope.tabs[findTabIndexByID(scope.currentQuery.id)];\n // Do not save tab on default yasr initalization since default table overrides saved value\n if (angular.isDefined(tab) && scope.currentTabConfig.queryType) {\n if (tab.outputType !== value) {\n tab.outputType = scope.currentQuery.outputType = value;\n scope.saveTab(tab.id);\n }\n }\n }\n });\n\n scope.$watch('namespaces', function () {\n if (scope.namespaces) {\n if (yasr && yasr.options && scope.namespaces) {\n // this way, the URLs in the results are prettified using the defined prefixes\n yasr.options.getUsedPrefixes = scope.namespaces;\n }\n\n // Notify YASQE about the new namespaces\n YASQE.signal(window.editor, 'namespacesChanged', scope.namespaces);\n }\n });\n }\n\n initYasr();\n\n function changePagination() {\n scope.runQuery(true, scope.explainRequested);\n }\n\n // Hide the sample queries when the user clicks somewhere else in the UI.\n $(document).mouseup(function (event) {\n const container = $('#sampleQueriesCollapse');\n if (!container.is(event.target) // if the target of the click isn't the container..\n && container.has(event.target).length === 0 //... nor a descendant of the container\n && scope.showSampleQueries) {\n scope.toggleSampleQueries();\n }\n });\n\n function findTabIndexByID(id) {\n for (let i = 0; i < scope.tabs.length; i++) {\n const tab = scope.tabs[i];\n if (tab.id === id) {\n return i;\n }\n }\n }\n\n // functions to load query param or saved queries\n function toBoolean(v) {\n return angular.isDefined(v) && v !== 'false';\n }\n\n function autoexecuteQueryIfRequested() {\n const isRequested = toBoolean($location.search().execute);\n\n if (isRequested) {\n if (window.editor.getQueryMode() === 'update') {\n ModalService.openSimpleModal({\n title: 'Confirm execute',\n message: 'This is an update and it may change the data in the repository.<br>Are you sure you want to execute it automatically?',\n warning: true\n }).result\n .then(function () {\n scope.runQuery(false);\n });\n } else {\n scope.runQuery(false);\n }\n }\n }\n\n function loadQueryIntoExistingOrNewTab(query, infer, sameAs) {\n const tabId = scope.getExistingTabId(query);\n // Ah, the joys of non-synchronous events\n const onHandler = scope.$on('tabLoaded', function () {\n if (angular.isDefined(infer)) {\n scope.currentQuery.inference = toBoolean(infer);\n }\n if (angular.isDefined(sameAs)) {\n scope.currentQuery.sameAs = toBoolean(sameAs);\n }\n autoexecuteQueryIfRequested();\n onHandler();\n });\n\n // See comment about this flag in controller. It's a good idea to be consistent and do this\n // every time a tab changes without the user clicking on it.\n scope.highlightNextTabChange = true;\n\n if (!angular.isDefined(tabId)) {\n scope.addNewTab(null, query.name, query.body);\n } else {\n selectTab(tabId);\n }\n }\n\n function loadSavedQueryIntoExistingOrNewTab(savedQueryName, owner, infer, sameAs) {\n SparqlRestService.getSavedQuery(savedQueryName, owner)\n .success(function (data) {\n loadQueryIntoExistingOrNewTab(data, infer, sameAs);\n })\n .error(function (data) {\n toastr.error('Could not get data for saved query: ' + savedQueryName + '; ' + getError(data));\n });\n }\n\n function addTabWithQueryIfNeeded() {\n if ($location.search().savedQueryName) {\n // new way\n loadSavedQueryIntoExistingOrNewTab($location.search().savedQueryName, $location.search().owner,\n $location.search().infer, $location.search().sameAs);\n } else if ($location.search().query) {\n const query = {name: $location.search().name, body: $location.search().query};\n loadQueryIntoExistingOrNewTab(query, $location.search().infer, $location.search().sameAs);\n } else {\n // Restore the previous tab after the dom has loaded\n const currentid = LocalStorageAdapter.get(LSKeys.TABS_STATE_CURRENT_ID);\n selectTab(currentid);\n }\n }\n\n function updateRepositoryAndSecurity() {\n scope.getNamespaces();\n YASQE.signal(window.editor, \"repositoryOrAuthorizationChanged\",\n $repositories.getActiveRepository(), $jwtAuth.getAuthToken());\n addTabWithQueryIfNeeded();\n }\n\n if ($repositories.getActiveRepository()) {\n updateRepositoryAndSecurity();\n }\n\n // When no repo is selected (editor hidden) and the user selects a repo the SPARQL params should be handled\n scope.$on('repositoryIsSet', function () {\n if ($repositories.getActiveRepository()) {\n updateRepositoryAndSecurity();\n }\n });\n // end of repository actions\n\n // focus the editor\n $timeout(function () {\n angular.element(document).find('.CodeMirror textarea:first-child').focus();\n }, 50);\n\n }\n}\n"],"sourceRoot":""}
@@ -1,2 +0,0 @@
1
- (window.webpackJsonp=window.webpackJsonp||[]).push([[27],{208:function(e,t,n){"use strict";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={delayDblClick:function(){var e=d3.dispatch("click","dblclick");return d3.rebind((function(t){var n,r=null;t.on("mousedown",(function(){n=d3.mouse(document.body),new Date})),t.on("mouseup",(function(t){var i,o;i=n,o=d3.mouse(document.body),Math.sqrt(Math.pow(i[0]-o[0],2),Math.pow(i[1]-o[1],2))>5||(r?(window.clearTimeout(r),r=null,e.dblclick(t)):r=window.setTimeout((d3.event,function(){e.click(t),r=null}),250))}))}),e,"on")}},t.a=r},211:function(e,t,n){var r,i,o;i=[],void 0===(o="function"==typeof(r=function(){return 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),g=p(),h=d.length,m=document.documentElement.scrollTop||document.body.scrollTop,y=document.documentElement.scrollLeft||document.body.scrollLeft,v=a.apply(this,r);for(g.html(o).style({opacity:1,"pointer-events":"all"});h--;)g.classed(d[h],!1);return i=l.get(f).apply(this),v?g.style(v):g.classed(f,!0).style({top:i.top+u[0]+m+"px",left:i.left+u[1]+y+"px"}),c},c.hide=function(){return p().style({opacity:0,"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:d3.functor(t),c):e},c.offset=function(e){return arguments.length?(t=null==e?e:d3.functor(e),c):t},c.html=function(e){return arguments.length?(n=null==e?e:d3.functor(e),c):n},c.customPosition=function(e){return arguments.length?(a=null==e?e:d3.functor(e),c):a},c.destroy=function(){return r&&(p().remove(),r=null),c};var l=d3.map({n:function(){var e=f();return{top:e.n.y-r.offsetHeight,left:e.n.x-r.offsetWidth/2}},s:function(){var e=f();return{top:e.s.y,left:e.s.x-r.offsetWidth/2}},e:function(){var e=f();return{top:e.e.y-r.offsetHeight/2,left:e.e.x}},w:function(){var e=f();return{top:e.w.y-r.offsetHeight/2,left:e.w.x-r.offsetWidth}},nw:function(){var e=f();return{top:e.nw.y-r.offsetHeight,left:e.nw.x-r.offsetWidth}},ne:function(){var e=f();return{top:e.ne.y-r.offsetHeight,left:e.ne.x}},sw:function(){var e=f();return{top:e.sw.y,left:e.sw.x-r.offsetWidth}},se:function(){var e=f();return{top:e.se.y,left:e.e.x}}}),d=l.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===r&&(r=u(),document.body.appendChild(r)),d3.select(r)}function f(){for(var e=s||d3.event.target;void 0===e.getScreenCTM&&"undefined"===e.parentNode;)e=e.parentNode;var t={},n=e.getScreenCTM(),r=e.getBBox(),i=r.width,a=r.height,c=r.x,l=r.y;return o.x=c,o.y=l,t.nw=o.matrixTransform(n),o.x+=i,t.ne=o.matrixTransform(n),o.y+=a,t.se=o.matrixTransform(n),o.x-=i,t.sw=o.matrixTransform(n),o.y-=a/2,t.w=o.matrixTransform(n),o.x+=i,t.e=o.matrixTransform(n),o.x-=i/2,o.y-=a/2,t.n=o.matrixTransform(n),o.y+=a,t.s=o.matrixTransform(n),t}return c}})?r.apply(t,i):r)||(e.exports=o)},56:function(e,t,n){"use strict";n.r(t);n(2);var r=n(208),i=n(211),o=n.n(i);n(4);function s(e,t,n,i,s,a,c,l,d,u,p,f,g,h,m,y,v,x,S,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.onopen=e.onclose=()=>angular.noop(),e.embedded&&(p.search().query||p.search().uri||p.search().config||p.search().saved)&&(e.noGoHome=!0);const C={};let k=0,b=0,T={},L=0;const N=16,P=d3.behavior.zoom().scaleExtent([.5,10]);let A;const M=1e3,G=1e3;let E,R;function j(e){h.openCopyToClipboardModal(e)}function O(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(x.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=angular.copy(e.defaultSettings),v.set(x.GRAPHS_VIZ,e.saveSettings)}else e.saveSettings=angular.copy(e.defaultSettings)}t.key="",C.get=function(t,n,r){return g.initLazyList(t,n,r,k,e.propertiesObj.items)},t.$watch((function(){return t.key}),(function(){k=0,_.each(e.propertiesObj.items,(function(e){t.key>e&&k++})),b++})),C.revision=function(){return b},e.datasource=C,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,T={},L=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&&a((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=j,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 z=f.getPrincipal();function F(){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}}))}z?O(z):e.$on("securityInit",(function(){O(f.getPrincipal())})),e.resetSettings=function(){e.settings=angular.copy(e.defaultSettings),F()},e.changeLimit=function(t){let n=e.settings.linksLimit+t;n<1&&(n=1),n>1e3&&(n=1e3),e.settings.linksLimit=n},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),F()},e.reExpandNode=function(){e.rootNodeIri&&e.$broadcast("onRootNodeChange",e.rootNodeIri)};const B=function(t,n,r){const i=void 0===n?e.saveSettings.sameAsState:!0===n,o=void 0===r?e.saveSettings.includeInferred:!0===r;e.loading=!0,c({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:o,sameAsState:i}}).then((function(e){fe(e)}),(function(t){e.loading=!1,s.error(getError(t.data),"Cannot load visual graph!")}))};function D(e,t){let n=e.split(" ");return t?[n[0],n[1],n[2]].join(">"):[n[0],n[2]].join(">")}function U(e){return[e.source.iri,e.target.iri].join(">")}function q(e){if(e.isTriple){let t=document.getElementById(D(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(D(e.iri));if(t&&void 0!==t.__data__.y)return t.__data__.y}return e.y}function W(e){let t=e.trim().split(" ");return`<<<${t[0]}> <${t[1]}> <${t[2]}>>>`}function V(e){return`${e.source.isTriple?D(e.source.iri,!0):e.source.iri}>${e.target.isTriple?D(e.target.iri,!0):e.target.iri}>marker`}function Z(){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?Ie(e.source):_.find(t,(function(t){return t.iri===e.source})),r=e.isTripleTarget?Ie(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?D(i.source.iri):i.source.iri}>${i.target.isTriple?D(i.target.iri):i.target.iri}`;if(K.tripleLinksCopy.has(e)){let t=K.tripleLinksCopy.get(e);return t[0].predicates.push(...i.predicates),t.push(i),K.tripleLinksCopy.set(e,t),null}K.tripleLinksCopy.set(e,[i])}return i}))}(e,t));for(let e of K.tripleLinksCopy.keys())1===K.tripleLinksCopy.get(e).length&&K.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=D(n.source.iri),o=D(n.target.iri);if(i===e&&K.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&&(K.tripleLinksCopy.delete(`${i}>${o}`),K.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(D(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(D(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=D(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: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:L,type2color:T,scale:P.scale(),translate:P.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)&&(L=t.colorIndex,T=angular.copy(t.type2color)),angular.isDefined(t.translate)&&angular.isDefined(t.scale)&&(A="translate("+t.translate[0]+", "+t.translate[1]+") scale("+t.scale+")",P.translate(t.translate),P.scale(t.scale)),le()}}e.updateSettings=function(){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?B(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(x.GRAPHS_VIZ,e.saveSettings)},e.showInfoPanel=!1;let K=new Z;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){s.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){s.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?a((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){fe(e)}),(function(t){e.loading=!1,s.error(getError(t),"Could not load graph from config")})))},e.deleteConfig=function(t){h.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){s.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 J=function(){p.search().query?(e.searchVisible=!1,e.queryResultsMode=!0,B(p.search().query,p.search().sameAs,p.search().inference)):e.$on("onRootNodeChange",(function(t,n){e.loading=!0,angular.isDefined(n)&&(e.rootNodeIri=n,c({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"),K=new Z;const n=K.addNode(t.data,M/2,G/2);A="translate(0, -70) scale(1)",P.translate([0,-70]),P.scale(1),he(n,!0)})).catch((function(t){e.loading=!1,s.error(getError(t),"Could not load visual graph")})))})),p.search().uri&&e.openUri(p.search().uri),p.search().saved&&S.getSavedGraph(p.search().saved).success((function(t){e.loadSavedGraph(t)})).error((function(e){const t=getError(e);s.error(t,"Error! Could not open saved graph")}))},Q=function(){p.search().config?e.loadConfigForId(p.search().config,J):p.search().query||p.search().uri?(e.loadGraphConfig(e.defaultGraphConfig),J()):J()};function X(t){!n.getActiveRepository()||e.hasInitedRepository&&!t||(e.hasInitedRepository=!0,t||e.getGraphConfigs(Q),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})),Y()})).error((function(e){s.error(getError(e),"Cannot get namespaces for repository. View will not work properly!")})))}function Y(){i.isLicenseValid()&&(e.getAutocompletePromise=d.checkAutocompleteStatus())}e.replaceIRIWithPrefix=function(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},e.addedTag=function(t){return t.text.indexOf(":")<0?(s.warning("Enter an absolute full or 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=l.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?s.warning("Enter an absolute full or prefixed IRI, optionally ending in *",t):s.warning("Enter an absolute full or prefixed IRI",t),!1;const r=e.text.indexOf("*");if(r>=0){if(!n)return s.warning("Wildcards not allowed here",t),!1;if(r<e.text.length-1)return s.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.isLicenseValid=function(){return i.isLicenseValid()},e.hasInitedRepository=!1,e.$on("autocompleteStatus",(function(){Y()})),e.$on("repositoryIsSet",(function(t,n){n.newRepo&&(e.hasInitedRepository=!1),X(n.newRepo),n.newRepo&&(e.resetState(),$(".graph-visualization svg").empty(),p.search().query&&(e.goToHome(),J()))})),X();const ee=500,te=1.75,ne=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(T[e])&&(T[e]=L,L++);const t=T[e];return t>39?"#c2c2c2":t%2==0?ne(t/2):re(t/2)};const ie=d3.layout.force().gravity(.07).size([M,G]),oe=d3.select(".main-container .graph-visualization").append("svg").attr("viewBox","0 0 "+M+" "+G).attr("preserveAspectRatio","xMidYMid meet");let se=0,ae=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=2.0.0-TR7").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 le(t){d3.selectAll("svg g").remove(),d3.selectAll("svg rect").remove(),d3.selectAll(".d3-tip").remove(),d3.selectAll(".menu-events").remove(),P.on("zoom",(function(){A="translate("+d3.event.translate+") scale("+d3.event.scale+")",n.attr("transform",A)})),oe.append("rect").attr("width",10*M).attr("height",10*G).attr("x",-(10*M-M)/2).attr("y",-(10*G-G)/2).style("fill","none").style("pointer-events","all").call(P).on("click",(function(){d3.event.stopPropagation(),me(),ie.stop()}));const n=oe.append("g").attr("class","nodes-container").attr("transform",(function(){return angular.isDefined(A)&&!t?A:""})),i=o()().attr("class","d3-tip").customPosition((function(){const e=E.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})),c=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 l;const d=o()().attr("class","d3-tip").customPosition((function(e){const t=l.getBoundingClientRect(),n=function(e){const t=c(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 c(e)}));const u=function(){a.cancel(void 0),a.cancel(se),E=null,i.hide(),ae=a((function(){me()}),500)};oe.call(i);oe.call(d);let f=oe.selectAll(".link"),g=oe.selectAll(".node");ie.nodes(K.nodes).charge(-3e3),ie.links(K.links).linkDistance((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})),n.append("defs").selectAll("marker").data(ie.links()).enter().append("marker").attr("class","arrow-marker").attr("id",(function(e){return V(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"),f=n.selectAll(".link").data(K.links).enter().append("g").attr("class","link-wrapper").attr("id",(function(e){return U(e)})).append("line").attr("class","link").style("stroke-width",1).style("fill","transparent").style("marker-end",(function(e){let t=V(e);return`url(${p.absUrl()}#${t})`}));const h=n.selectAll(".link-wrapper").append("text").text((function(e){return we(e)})).attr("class",(function(e){return e.predicates.length>1||K.tripleNodes.has(U(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){a.cancel(void 0);const t=l=d3.event.target;a((function(){l===t&&e.predicates.length>1&&d.show(e,l)}),300)}(e)})).on("mouseout",(function(){a.cancel(void 0),l=null,d.hide()})).on("click",(function(t){d3.event.stopPropagation(),function(t){Se();let n=U(t);if(1===t.predicates.length&&K.tripleNodes.has(n)){R=null;let e=K.tripleNodes.get(n)[0];if(ue(e,this,d3.event.button)){let t={};t.iri=e.iri,t.pred=Ce(e.iri.split(" ")[1]),ve(t)}return}!function(t){if(e.showNodeInfo=!1,e.showPredicates=t.predicates.length>1,e.showFilter=!1,e.showInfoPanel=!1,R===t)return e.showNodeInfo=!1,e.showInfoPanel=!1,void(R=null);R=t,e.showPredicates&&(e.predicates=_.map(t.predicates,(function(e){let n=function(e,t){let n=U(t);return K.tripleNodes.has(n)?K.tripleNodes.get(n).findIndex(t=>t.iri.indexOf(e)>=0):-1}(e,t),r=n>-1;return{value:Ce(e),partOfTriple:r,linkId:r?U(t):"",nodeIndex:n}})),e.showInfoPanel=!0)}(t)}(t)}));let m,y=0,v=0,x=0;const S=function(){d3.event.button&&0!==d3.event.button||(u(),a.cancel(m),e.showPredicates=!1,d3.event.timeStamp-y<ee?v++:v=1,y=d3.event.timeStamp,d3.event.preventDefault())},I=function(t){if(d3.event.button&&0!==d3.event.button)return;a.cancel(m);const n=d3.event,r=this;if(d3.event.timeStamp-y<ee)if(1===v)m=a((function(){ue(t,r,n)}),40+ee-(d3.event.timeStamp-y));else if(2===v){K.countLinks(t,K.links)<=e.saveSettings.linksLimit?he(t,!1,r.parentNode):s.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 w(e,t){let r,i,o,s,a=!0;if("down"===t)r=2*e.size,i=e.size/3,o=.8,s=.3;else if("down-fixed"===t)r=2*e.size,i=e.size,o=.8,s=.66;else if("up"===t)r=e.size/3,i=2*e.size,o=.3,s=.8;else{if("fixed"!==t)return;r=e.size,o=.66,a=!1}let c=n.selectAll(".node-wrapper").filter((function(t){return t===e})).append("text").text("").classed("icon-any pinned",!0).style("font-size",r+"px").attr("x",(function(e){return e.x})).attr("y",(function(e){return e.y})).attr("opacity",o);"fixed"!==t&&"down-fixed"!==t||(e.pin=c),a&&(c=c.transition().duration(1e3).style("font-size",(function(){return i+"px"})).attr("opacity",s),"down-fixed"!==t&&c.remove())}const C=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,me(),d3.event.sourceEvent.stopPropagation(),d3.select(this).classed("dragging",!0))})).on("drag",(function(t){t.isBeingDragged&&(v=0,t.px=d3.event.x,t.py=d3.event.y,t.fixed?t.beginDragging&&w(t,"fixed"):(e.numberOfPinnedNodes++,t.fixed=!0,w(t,"down-fixed")),t.pinWasFixed=!0,t.beginDragging=null,ie.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))}));g=n.selectAll(".node").data(K.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(C).on("mouseover",(function(t){if(!t.isBeingDragged){const n=d3.event;a.cancel(ae),se=a(()=>{(function(t,n){if(e.showInfoPanel)return!1;(de.closeIcon||de.expandIcon||de.focusIcon||de.copyURIIcon)&&de.removeIcons();if(ie.alpha()<.05)return de.initIcons(t,n.parentNode),ie.stop(),!0;return!1})(t,this)&&function(e,t){a.cancel(void 0);const n=E=t.target;a((function(){E===n&&i.show(e,E)}),300)}(t,n)},400)}})).on("mouseout",u).on("mousedown",S).on("touchstart",(function(e){S(),x=0,m=a((function(){x<5&&pe(e),m=null,v=0}),1e3)})).on("touchmove",(function(){x++})).on("mouseup",I).on("touchend",I).on("contextmenu",(function(t){d3.event.shiftKey||(d3.event.preventDefault(),me(),e.closeInfoPanel(),t.fixed?(e.numberOfPinnedNodes--,t.fixed=!1,w(t,"up"),ie.resume()):(e.numberOfPinnedNodes++,t.fixed=!0,w(t,"down")),function(e){E&&i.show(e,E)}(t))}));const k=n.selectAll(".node-wrapper").append("foreignObject").style("pointer-events","none").attr("width",(function(e){return 2*e.size*te}));n.insert("g").attr("class","menu-events"),function(e){e.each((function(e){e.fontSize=r.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})),a((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)}(k),ie.on("tick",(function(){d3.geom.quadtree(K.nodes);K.nodes.length;f.attr("x1",(function(e){return q(e.source)})).attr("y1",(function(e){return H(e.source)})).attr("x2",(function(e){return q(e.target)})).attr("y2",(function(e){return H(e.target)})),h.attr("x",(function(e){let t=q(e.source),n=q(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){const n={x:q(e.source),y:H(e.source)},r={x:q(e.target),y:H(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+")"})),g.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})),k.attr("x",(function(e){return e.x-e.size*te})).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){if(n.source.iri===t&&n.target.iri===e){let e=n.source.iri;e+=">",e+=n.target.iri;const t=document.createTextNode(" ⟶");document.getElementById(e).lastChild.appendChild(t),n.direction="double"}}))})),d3.selectAll(".d3-actions-tip").remove(),ie.start()}le();const de=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,r){const i=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}));oe.call(i);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,K.removeNodeLeafLinks(e),le()})).on("mouseover",(function(){i.show(this.getAttribute("name")),a.cancel(se),a.cancel(ae)})).on("mouseout",(function(){i.hide(),ae=a((function(){me()}),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(){he(n,!1,r)})).on("mouseover",(function(){i.show(this.getAttribute("name")),a.cancel(ae),a.cancel(se)})).on("mouseout",(function(){i.hide(),ae=a((function(){me()}),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(){i.show(this.getAttribute("name")),a.cancel(ae),a.cancel(se)})).on("mouseout",(function(){i.hide(),ae=a((function(){me()}),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(){j(n.iri),me(),i.hide()})).on("mouseover",(function(){i.show("<div style='text-align: center;'><b>Copy to ClipBoard</b><br>"+n.iri+"</div>"),a.cancel(ae),a.cancel(se)})).on("mouseout",(function(){i.hide(),ae=a((function(){me()}),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(){pe(n)})).on("mouseover",(function(){i.show(this.getAttribute("name")),a.cancel(ae),a.cancel(se)})).on("mouseout",(function(){i.hide(),ae=a((function(){me()}),500)})),this.animateMenu(n)},this.animateMenu=function(t){let n=0;let r=20;this.expandIcon&&this.expandIcon.transition().duration(100).style("opacity",1).ease("sin").attr("transform",(function(){return e(r,t)})).delay(n+=35),this.collapseIcon&&this.collapseIcon.transition().duration(100).style("opacity",1).ease("sin").attr("transform",(function(){return e(r,t)})).delay(n+=35),this.copyURIIcon.transition().duration(100).style("opacity",1).ease("sin").attr("transform",(function(){return r+=30,e(r,t)})).delay(n+=35),this.focusIcon.transition().duration(100).style("opacity",1).ease("sin").attr("transform",(function(){return r+=30,e(r,t)})).delay(n+=35),this.closeIcon.transition().duration(100).style("opacity",1).ease("sin").attr("transform",(function(){return r+=30,e(r,t)})).delay(n+=35),this.expandedState=!0}};function ue(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?(pe(n),!1):void 0!==e.openedNodeInfoPanel&&e.openedNodeInfoPanel===n?(e.pageslideExpanded=!1,e.openedNodeInfoPanel=void 0,!1):(ye(n),!0)}function pe(e){K.removeNode(e),le()}function fe(t){!function(t){e.nodeSelected=!0,null===t.data.types&&(t.data.types="greyColor"),K=new Z,A="translate(0, -70) scale(1)",P.translate([0,-70]),P.scale(1)}(t),ge(t)}function ge(t,n,r){let i=t.data;i=_.filter(i,(function(e){return-1===_.findIndex(K.links,(function(t){return e.source===t.source.iri&&e.target===t.target.iri}))}));let o=[];const a=K.tripleLinksCopy.values();for(let e=0;e<K.tripleLinksCopy.size;e++){a.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 l=function(e,t){let n=t.map((function(t){return t[e]}));return t.filter((function(t,r){return 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}]}))))),d=_.map(K.nodes,(function(e){return{iri:e.iri,isTriple:Boolean(e.isTriple)}})),p=K.tripleNodes.values();for(let e=0;e<K.tripleNodes.size;e++){p.next().value.forEach(e=>{d.push({iri:e.iri,isTriple:e.isTriple})})}const f=_.reject(l,(function(e){return _.some(d,e)}));if(0===f.length)r?s.info("This node has no visible connections. Check your Graph Settings if you expect such."):0===i.length&&s.info("This node has no other visible connections. Check your Graph Settings if you expect such."),K.addAndMatchLinks(i),le();else{const t=[],r=[];_.forEach(f,(function(n,i){t.push(c({url:"rest/explore-graph/node",method:"GET",params:{iri:n.isTriple?W(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){r[i]=e.data})))})),u.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)*G/3,s=(n?n.y:0)+Math.sin(i)*G/3;e.isTriple?K.addTriple(e,o,s):K.addNode(e,o,s)})),K.addAndMatchLinks(i),n&&(n.isExpanded=!0),le()}))}}function he(t,n,r){if(ce.getLoadingState())return;ce.init(t,r);const i=t.iri;c({url:"rest/explore-graph/links",method:"GET",params:{iri:i,linksLimit:e.saveSettings.linksLimit,includeInferred:e.saveSettings.includeInferred,config:e.configLoaded.id,preferredTypes:e.shouldShowSettings()?e.saveSettings.preferredTypes:[],rejectedTypes:e.shouldShowSettings()?e.saveSettings.rejectedTypes:[],preferredPredicates:e.shouldShowSettings()?e.saveSettings.preferredPredicates:[],rejectedPredicates:e.shouldShowSettings()?e.saveSettings.rejectedPredicates:[],preferredTypesOnly:e.shouldShowSettings()?e.saveSettings.preferredTypesOnly:[],preferredPredicatesOnly:e.shouldShowSettings()?e.saveSettings.preferredPredicatesOnly:[],languages:e.shouldShowSettings()?e.saveSettings.languages:[],sameAsState:e.saveSettings.sameAsState,includeSchema:e.saveSettings.includeSchema}}).then((function(e){ge(e,t,n)}),(function(t){const n=getError(t.data);s.error(n,"Error exploring node"),e.loading=!1,ce.setLoadingState(!1)}))}function me(){angular.isDefined(de)&&de.expandedState&&de.removeIcons()}function ye(t){ie.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?encodeURI(W(t.iri)):encodeURI(t.iri),e.showInfoPanel=!0,e.rdfsLabel=t.labels[0].label,e.rdfsComment=t.comment,e.expanded=!1,e.propertiesQueryObj.query="",e.dataNodeKeysQuery="",c.get("rest/explore-graph/properties",{params:{iri:t.isTriple?W(t.iri):t.iri,config:e.configLoaded.id,languages:e.shouldShowSettings()?e.saveSettings.languages:[],includeInferred:e.saveSettings.includeInferred,sameAsState:e.saveSettings.sameAsState,rejectedPredicates:e.shouldShowSettings()?e.saveSettings.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){s.warning(getError(e.data),"Error")}))}function ve(e){xe("predicate","#d54a33",e),xe("predicates","#d54a33",e);let t=document.getElementsByClassName("link");t&&_.each(t,(function(t){let n=t.__data__;(n.source.iri.indexOf(e.iri)>=0||n.target.iri.indexOf(e.iri)>=0)&&(t.style.stroke="#d54a33",t.style.strokeWidth=4)}));let n=document.getElementsByClassName("arrow-marker");n&&_.each(n,(function(t){let n=t.__data__;(n.source.iri.indexOf(e.iri)>=0||n.target.iri.indexOf(e.iri)>=0)&&(t.style.stroke="#d54a33",t.__data__.target.isTriple||t.setAttribute("refX","23"))}))}function xe(e,t,n){let r=document.getElementsByClassName(e);r&&_.each(r,(function(e){let r=e.__data__;n?((r.source.iri.indexOf(n.iri)>=0||r.target.iri.indexOf(n.iri)>=0)&&(e.style.fill=t),D(n.iri)===U(r)&&(e.textContent=n.pred,e.style.fill=t),n.oppLinkIRI&&n.oppLinkIRI===U(r)&&(e.textContent=n.oppTriplePred,e.style.fill=t)):(e.style.fill=t,e.textContent=we(r))}))}function Se(){_.each(e.predicates,(function(e){let t=document.getElementById(e.linkId+e.nodeIndex);t&&(t.style.fontWeight="normal")}));let t=document.getElementsByClassName("link");t&&_.each(t,(function(e){e.style.stroke="#999",e.style.strokeWidth=1})),xe("predicate",""),xe("predicates","");let n=document.getElementsByClassName("arrow-marker");n&&_.each(n,(function(e){e.style.stroke="#999",e.__data__.target.isTriple||e.setAttribute("refX","59")}))}function Ie(e){let t=D(e);if(K.tripleNodes.has(t))return K.tripleNodes.get(t).find(t=>t.iri===e)}function we(e){return e.predicates.length>1?e.predicates.length+" predicates":Ce(e.predicates[0])}function Ce(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=[],R=null,a((function(){e.showInfoPanel=!1}))},e.clickLink=function(t){if(K.tripleNodes.has(t.linkId)){Se();let n=K.tripleNodes.get(t.linkId)[t.nodeIndex];ye(n),e.showPredicates=!0;let r=document.getElementById(t.linkId+t.nodeIndex);r&&(r.style.fontWeight="bold");let i={};const o=K.tripleLinksCopy.values();for(let e=0;e<K.tripleLinksCopy.size;e++){let 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=D(t.target.iri),i.oppTriplePred=Ce(t.target.iri.split(" ")[1])),i.pred=Ce(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=D(t.source.iri),i.oppTriplePred=Ce(t.source.iri.split(" ")[1])),i.pred=Ce(n.iri.split(" ")[1]),1===t.predicates.length&&(i.linkPred=t.predicates[0]),!1))}i.iri||(i.iri=n.iri,i.pred=Ce(n.iri.split(" ")[1])),ve(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){me();const t=2*(e?1:-1)*Math.PI/180,n=Math.cos(t),r=Math.sin(t),i=M/2,o=G/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.px=e.x,e.py=e.y)})),ie.resume()},e.openUri=function(t,n){if(!n){const n={};e.configLoaded.id!==e.defaultGraphConfig.id&&(n.config=e.configLoaded.id),n.uri=t,e.pushHistory(n,{uri:t,config:e.configLoaded})}e.$broadcast("onRootNodeChange",t)},e.saveOrUpdateGraph=function(){const t=JSON.stringify(K.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 ke=function(t){S.editSavedGraph(t).success((function(){e.lastSavedGraphName=t.name,e.shared=t.shared,e.refreshSavedGraphs(),s.success("Saved graph "+t.name+" was edited.")})).error((function(e){const t=getError(e);s.error(t,"Error! Cannot edit saved graph")}))};e.saveGraphModal=function(t,n,r){m.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(),s.success("Saved graph "+t.name+" was saved.")})).error((function(n,r){if(422===r)e.saveGraphModal("new",t,!0);else{const e=getError(n);s.error(e,"Error! Cannot create saved graph")}}))}(t.graph);break;case"update":case"rename":ke(t.graph)}}))},e.refreshSavedGraphs=function(){S.getSavedGraphs().success((function(t){e.savedGraphs=t})).error((function(e){const t=getError(e);s.error(t,"Error! Could not get 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),p.url("?saved="+t.id),K.restoreState(JSON.parse(t.data)),n||e.pushHistory({saved:t.id},{savedGraph:t})},e.copyToClipboardSavedGraph=function(e){j([location.protocol,"//",location.host,location.pathname,"?saved=",e.id].join(""))},e.deleteSavedGraph=function(t){h.openSimpleModal({title:"Confirm",message:"Are you sure you want to delete the saved graph '"+t.name+"'?",warning:!0}).result.then((function(){!function(t){S.deleteSavedGraph(t).success((function(){e.refreshSavedGraphs(),s.success("Saved graph "+t.name+" was deleted.")})).error((function(e){const t=getError(e);s.error(t,"Error! Cannot delete saved graph")}))}(t)}))},e.openIRI=function(t,n){return n.shiftKey?e.$broadcast("onRootNodeChange",t):window.open(t,"_blank"),!1},e.togglePinAllNodes=function(){me();const t=e.numberOfPinnedNodes<=0;e.numberOfPinnedNodes=0,d3.selectAll(".node").each((function(n){n.fixed=t,t&&e.numberOfPinnedNodes++})),ie.resume()},$("body").on("keydown",(function(t){"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 a(e,t,n){switch(e.mode=n.mode,e.graph=angular.copy(n.graph),e.graphExists=n.graphExists,e.mode){case"new":e.title="Create new saved graph",e.okButtonText="Create";break;case"update":e.title="Update saved graph",e.okButtonText="Save";break;case"rename":e.title="Rename saved graph",e.okButtonText="Save"}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",s).controller("SaveGraphModalCtrl",a).config(["$tooltipProvider",function(e){e.options({appendToBody:!0})}]),s.$inject=["$scope","$rootScope","$repositories","$licenseService","toastr","$timeout","$http","ClassInstanceDetailsService","AutocompleteRestService","$q","$location","$jwtAuth","UiScrollService","ModalService","$modal","$window","LocalStorageAdapter","LSKeys","SavedGraphsRestService","GraphConfigRestService","RDF4JRepositoriesRestService"],a.$inject=["$scope","$modalInstance","data"]}}]);
2
- //# sourceMappingURL=27.44948497dc4fac6010a8.bundle.js.map