├── .github └── ISSUE_TEMPLATE │ └── bug_report.md ├── .gitignore ├── LICENSE ├── Neo4jDataConnectorForPowerBI.sln ├── Neo4jPowerBiConnector ├── .vscode │ └── settings.json ├── Neo4j.pq ├── Neo4j.proj ├── Neo4j.query.pq ├── Neo4j16.png ├── Neo4j20.png ├── Neo4j24.png ├── Neo4j32.png ├── Neo4j40.png ├── Neo4j48.png ├── Neo4j64.png ├── Neo4j80.png ├── Neo4jDataConnectorForPowerBi.mproj └── resources.resx └── README.md /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Describe the bug** 11 | A clear and concise description of what the bug is. 12 | 13 | **To Reproduce** 14 | Steps to reproduce the behavior: 15 | 1. Go to '...' 16 | 2. Click on '....' 17 | 3. Scroll down to '....' 18 | 4. See error 19 | 20 | **Expected behavior** 21 | A clear and concise description of what you expected to happen. 22 | 23 | **Screenshots** 24 | If applicable, add screenshots to help explain your problem. 25 | 26 | **Desktop (please complete the following information):** 27 | - Connector Version: [e.g. 1.4.0] 28 | - Power BI Version: [e.g. 2.90.782.0 (February 2021)] 29 | 30 | **Additional context** 31 | Add any other context about the problem here. 32 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | ## 4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore 5 | 6 | # User-specific files 7 | *.suo 8 | *.user 9 | *.userosscache 10 | *.sln.docstates 11 | 12 | # User-specific files (MonoDevelop/Xamarin Studio) 13 | *.userprefs 14 | 15 | # Build results 16 | [Dd]ebug/ 17 | [Dd]ebugPublic/ 18 | [Rr]elease/ 19 | [Rr]eleases/ 20 | x64/ 21 | x86/ 22 | bld/ 23 | [Bb]in/ 24 | [Oo]bj/ 25 | [Ll]og/ 26 | 27 | # Visual Studio 2015/2017 cache/options directory 28 | .vs/ 29 | # Uncomment if you have tasks that create the project's static files in wwwroot 30 | #wwwroot/ 31 | 32 | # Visual Studio 2017 auto generated files 33 | Generated\ Files/ 34 | 35 | # MSTest test Results 36 | [Tt]est[Rr]esult*/ 37 | [Bb]uild[Ll]og.* 38 | 39 | # NUNIT 40 | *.VisualState.xml 41 | TestResult.xml 42 | 43 | # Build Results of an ATL Project 44 | [Dd]ebugPS/ 45 | [Rr]eleasePS/ 46 | dlldata.c 47 | 48 | # Benchmark Results 49 | BenchmarkDotNet.Artifacts/ 50 | 51 | # .NET Core 52 | project.lock.json 53 | project.fragment.lock.json 54 | artifacts/ 55 | **/Properties/launchSettings.json 56 | 57 | # StyleCop 58 | StyleCopReport.xml 59 | 60 | # Files built by Visual Studio 61 | *_i.c 62 | *_p.c 63 | *_i.h 64 | *.ilk 65 | *.meta 66 | *.obj 67 | *.iobj 68 | *.pch 69 | *.pdb 70 | *.ipdb 71 | *.pgc 72 | *.pgd 73 | *.rsp 74 | *.sbr 75 | *.tlb 76 | *.tli 77 | *.tlh 78 | *.tmp 79 | *.tmp_proj 80 | *.log 81 | *.vspscc 82 | *.vssscc 83 | .builds 84 | *.pidb 85 | *.svclog 86 | *.scc 87 | 88 | # Chutzpah Test files 89 | _Chutzpah* 90 | 91 | # Visual C++ cache files 92 | ipch/ 93 | *.aps 94 | *.ncb 95 | *.opendb 96 | *.opensdf 97 | *.sdf 98 | *.cachefile 99 | *.VC.db 100 | *.VC.VC.opendb 101 | 102 | # Visual Studio profiler 103 | *.psess 104 | *.vsp 105 | *.vspx 106 | *.sap 107 | 108 | # Visual Studio Trace Files 109 | *.e2e 110 | 111 | # TFS 2012 Local Workspace 112 | $tf/ 113 | 114 | # Guidance Automation Toolkit 115 | *.gpState 116 | 117 | # ReSharper is a .NET coding add-in 118 | _ReSharper*/ 119 | *.[Rr]e[Ss]harper 120 | *.DotSettings.user 121 | 122 | # JustCode is a .NET coding add-in 123 | .JustCode 124 | 125 | # TeamCity is a build add-in 126 | _TeamCity* 127 | 128 | # DotCover is a Code Coverage Tool 129 | *.dotCover 130 | 131 | # AxoCover is a Code Coverage Tool 132 | .axoCover/* 133 | !.axoCover/settings.json 134 | 135 | # Visual Studio code coverage results 136 | *.coverage 137 | *.coveragexml 138 | 139 | # NCrunch 140 | _NCrunch_* 141 | .*crunch*.local.xml 142 | nCrunchTemp_* 143 | 144 | # MightyMoose 145 | *.mm.* 146 | AutoTest.Net/ 147 | 148 | # Web workbench (sass) 149 | .sass-cache/ 150 | 151 | # Installshield output folder 152 | [Ee]xpress/ 153 | 154 | # DocProject is a documentation generator add-in 155 | DocProject/buildhelp/ 156 | DocProject/Help/*.HxT 157 | DocProject/Help/*.HxC 158 | DocProject/Help/*.hhc 159 | DocProject/Help/*.hhk 160 | DocProject/Help/*.hhp 161 | DocProject/Help/Html2 162 | DocProject/Help/html 163 | 164 | # Click-Once directory 165 | publish/ 166 | 167 | # Publish Web Output 168 | *.[Pp]ublish.xml 169 | *.azurePubxml 170 | # Note: Comment the next line if you want to checkin your web deploy settings, 171 | # but database connection strings (with potential passwords) will be unencrypted 172 | *.pubxml 173 | *.publishproj 174 | 175 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 176 | # checkin your Azure Web App publish settings, but sensitive information contained 177 | # in these scripts will be unencrypted 178 | PublishScripts/ 179 | 180 | # NuGet Packages 181 | *.nupkg 182 | # The packages folder can be ignored because of Package Restore 183 | **/[Pp]ackages/* 184 | # except build/, which is used as an MSBuild target. 185 | !**/[Pp]ackages/build/ 186 | # Uncomment if necessary however generally it will be regenerated when needed 187 | #!**/[Pp]ackages/repositories.config 188 | # NuGet v3's project.json files produces more ignorable files 189 | *.nuget.props 190 | *.nuget.targets 191 | 192 | # Microsoft Azure Build Output 193 | csx/ 194 | *.build.csdef 195 | 196 | # Microsoft Azure Emulator 197 | ecf/ 198 | rcf/ 199 | 200 | # Windows Store app package directories and files 201 | AppPackages/ 202 | BundleArtifacts/ 203 | Package.StoreAssociation.xml 204 | _pkginfo.txt 205 | *.appx 206 | 207 | # Visual Studio cache files 208 | # files ending in .cache can be ignored 209 | *.[Cc]ache 210 | # but keep track of directories ending in .cache 211 | !*.[Cc]ache/ 212 | 213 | # Others 214 | ClientBin/ 215 | ~$* 216 | *~ 217 | *.dbmdl 218 | *.dbproj.schemaview 219 | *.jfm 220 | *.pfx 221 | *.publishsettings 222 | orleans.codegen.cs 223 | 224 | # Including strong name files can present a security risk 225 | # (https://github.com/github/gitignore/pull/2483#issue-259490424) 226 | #*.snk 227 | 228 | # Since there are multiple workflows, uncomment next line to ignore bower_components 229 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 230 | #bower_components/ 231 | 232 | # RIA/Silverlight projects 233 | Generated_Code/ 234 | 235 | # Backup & report files from converting an old project file 236 | # to a newer Visual Studio version. Backup files are not needed, 237 | # because we have git ;-) 238 | _UpgradeReport_Files/ 239 | Backup*/ 240 | UpgradeLog*.XML 241 | UpgradeLog*.htm 242 | ServiceFabricBackup/ 243 | *.rptproj.bak 244 | 245 | # SQL Server files 246 | *.mdf 247 | *.ldf 248 | *.ndf 249 | 250 | # Business Intelligence projects 251 | *.rdl.data 252 | *.bim.layout 253 | *.bim_*.settings 254 | *.rptproj.rsuser 255 | 256 | # Microsoft Fakes 257 | FakesAssemblies/ 258 | 259 | # GhostDoc plugin setting file 260 | *.GhostDoc.xml 261 | 262 | # Node.js Tools for Visual Studio 263 | .ntvs_analysis.dat 264 | node_modules/ 265 | 266 | # Visual Studio 6 build log 267 | *.plg 268 | 269 | # Visual Studio 6 workspace options file 270 | *.opt 271 | 272 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.) 273 | *.vbw 274 | 275 | # Visual Studio LightSwitch build output 276 | **/*.HTMLClient/GeneratedArtifacts 277 | **/*.DesktopClient/GeneratedArtifacts 278 | **/*.DesktopClient/ModelManifest.xml 279 | **/*.Server/GeneratedArtifacts 280 | **/*.Server/ModelManifest.xml 281 | _Pvt_Extensions 282 | 283 | # Paket dependency manager 284 | .paket/paket.exe 285 | paket-files/ 286 | 287 | # FAKE - F# Make 288 | .fake/ 289 | 290 | # JetBrains Rider 291 | .idea/ 292 | *.sln.iml 293 | 294 | # CodeRush 295 | .cr/ 296 | 297 | # Python Tools for Visual Studio (PTVS) 298 | __pycache__/ 299 | *.pyc 300 | 301 | # Cake - Uncomment if you are using it 302 | # tools/** 303 | # !tools/packages.config 304 | 305 | # Tabs Studio 306 | *.tss 307 | 308 | # Telerik's JustMock configuration file 309 | *.jmconfig 310 | 311 | # BizTalk build output 312 | *.btp.cs 313 | *.btm.cs 314 | *.odx.cs 315 | *.xsd.cs 316 | 317 | # OpenCover UI analysis results 318 | OpenCover/ 319 | 320 | # Azure Stream Analytics local run output 321 | ASALocalRun/ 322 | 323 | # MSBuild Binary and Structured Log 324 | *.binlog 325 | 326 | # NVidia Nsight GPU debugger configuration file 327 | *.nvuser 328 | 329 | # MFractors (Xamarin productivity tool) working folder 330 | .mfractor/ 331 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Chris Skardon 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Neo4jDataConnectorForPowerBI.sln: -------------------------------------------------------------------------------- 1 | Microsoft Visual Studio Solution File, Format Version 12.00 2 | # Visual Studio Version 16 3 | VisualStudioVersion = 16.0.31409.214 4 | MinimumVisualStudioVersion = 10.0.40219.1 5 | Project("{4DF76451-A46A-4C0B-BE03-459FAAFA07E6}") = "Neo4jDataConnectorForPowerBi", "Neo4jPowerBiConnector\Neo4jDataConnectorForPowerBi.mproj", "{E33D6246-3EFD-4548-9863-AA105E9990E4}" 6 | EndProject 7 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{A8216F12-8D75-4779-9C5A-214CC6D53FFD}" 8 | ProjectSection(SolutionItems) = preProject 9 | .gitignore = .gitignore 10 | LICENSE = LICENSE 11 | README.md = README.md 12 | EndProjectSection 13 | EndProject 14 | Global 15 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 16 | Debug|x86 = Debug|x86 17 | Release|x86 = Release|x86 18 | EndGlobalSection 19 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 20 | {E33D6246-3EFD-4548-9863-AA105E9990E4}.Debug|x86.ActiveCfg = Debug|x86 21 | {E33D6246-3EFD-4548-9863-AA105E9990E4}.Debug|x86.Build.0 = Debug|x86 22 | {E33D6246-3EFD-4548-9863-AA105E9990E4}.Release|x86.ActiveCfg = Release|x86 23 | {E33D6246-3EFD-4548-9863-AA105E9990E4}.Release|x86.Build.0 = Release|x86 24 | EndGlobalSection 25 | GlobalSection(SolutionProperties) = preSolution 26 | HideSolutionNode = FALSE 27 | EndGlobalSection 28 | GlobalSection(ExtensibilityGlobals) = postSolution 29 | SolutionGuid = {CC72FF03-C55F-406D-8A6A-750CBA8B15CB} 30 | EndGlobalSection 31 | EndGlobal 32 | -------------------------------------------------------------------------------- /Neo4jPowerBiConnector/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "powerquery.sdk.defaultQueryFile": "${workspaceFolder}\\${workspaceFolderBasename}.query.pq", 3 | "powerquery.sdk.defaultExtension": "${workspaceFolder}\\bin\\AnyCPU\\Debug\\${workspaceFolderBasename}.mez", 4 | "powerquery.general.mode": "SDK", 5 | "powerquery.sdk.externals.nugetFeed": "https://api.nuget.org/v3/index.json", 6 | "powerquery.sdk.tools.location": "D:\\Dev Tools\\microsoft.powerquery.sdktools.2.127.3\\tools" 7 | } 8 | -------------------------------------------------------------------------------- /Neo4jPowerBiConnector/Neo4j.pq: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////////////////////////// 2 | // Neo4j Connector for Power BI 3 | // From: https://github.com/cskardon/Neo4jDataConnectorForPowerBi 4 | // License details all at the github page, but if you don't want to browse - it's MIT 5 | section Neo4j; 6 | 7 | ////////////////////////////////////////////////////////////////////////////////////////////// 8 | // Public Functions 9 | // This is badly titled, as technically, only the 'shared' function is public, but the other 10 | // 2 are in this section as they are the 'meat' of the data connector. 11 | 12 | // 13 | // This is the _shared_ definition which exports the function to be visible to PowerBI 14 | // NB. The `Value.ReplaceType` call is there to allow the UI to render the 'help' text defined in the `ExecuteCypherType` 15 | // 16 | [DataSource.Kind="Neo4j", Publish="Neo4j.Publish"] 17 | shared Neo4j.ExecuteCypher = Value.ReplaceType(ExecuteCypherImpl, ExecuteCypherType); 18 | 19 | // 20 | // This is the type definition - providing hints on the PowerBI UI 21 | // 22 | ExecuteCypherType = type function ( 23 | cypher as (type text meta [ 24 | Documentation.FieldCaption = Extension.LoadString("CypherCaption"), 25 | Documentation.FieldDescription = Extension.LoadString("CypherDescription"), 26 | Formatting.IsMultiLine = true, 27 | Formatting.IsCode = true, 28 | Documentation.SampleValues = {"MATCH (n) RETURN n", "MATCH (n) RETURN COUNT(n)"} 29 | ]), 30 | scheme as (type text meta [ 31 | Documentation.FieldCaption = Extension.LoadString("SchemeCaption"), 32 | Documentation.FieldDescription = "The scheme to connect to your Neo4j instance", 33 | Documentation.SampleValues = {"http", "https"}//, 34 | //Documentation.AllowedValues = { "http", "https" } 35 | ]), 36 | address as (type text meta [ 37 | Documentation.FieldCaption = Extension.LoadString("AddressCaption"), 38 | Documentation.FieldDescription = Extension.LoadString("AddressDescription"), 39 | Documentation.SampleValues = {"localhost.", "127.0.0.1"} 40 | ]), 41 | port as (type number meta [ 42 | Documentation.FieldCaption = Extension.LoadString("PortCaption"), 43 | Documentation.FieldDescription = Extension.LoadString("PortDescription"), 44 | Documentation.SampleValues = {"7474"} 45 | ]), 46 | neo4jVersion as (type number meta [ 47 | Documentation.FieldCaption = Extension.LoadString("Neo4jVersionCaption"), 48 | Documentation.FieldDescription = Extension.LoadString("Neo4jVersionDescription"), 49 | Documentation.SampleValues = {3.5, 4.2}//, 50 | //Documentation.AllowedValues = {3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 4.0, 4.1, 4.2, 4.3} 51 | ]), 52 | databaseName as (type text meta [ 53 | Documentation.FieldCaption = Extension.LoadString("DatabaseNameCaption"), 54 | Documentation.FieldDescription = Extension.LoadString("DatabaseNameDescription"), 55 | Documentation.SampleValues = {"neo4j", "hr"} 56 | ]), 57 | timeout as (type number meta [ 58 | Documentation.FieldCaption = Extension.LoadString("TimeoutCaption"), 59 | Documentation.FieldDescription = Extension.LoadString("TimeoutDescription"), 60 | Documentation.SampleValues = {30} 61 | ]) 62 | ) as table meta [ 63 | Documentation.Name = Extension.LoadString("ConnectorName"), 64 | Documentation.LongDescription = Extension.LoadString("ConnectorDescription") 65 | ]; 66 | 67 | /// 68 | /// This is based on the blog post at: http://xclave.co.uk/2017/06/22/using-powerbi-with-neo4j/ 69 | /// taking into account the comments from 'Will' - to get the column output using the names returned from the query 70 | /// 71 | ExecuteCypherImpl = ( 72 | cypher as text, 73 | scheme as text, 74 | address as text, 75 | port as number, 76 | neo4jVersion as number, 77 | databaseName as text, 78 | timeout as number) as table => 79 | let 80 | _source = Neo4j.ExecuteRestCall(cypher, scheme, address, port, neo4jVersion, databaseName, timeout), 81 | _json = Json.Document(_source), 82 | _results = _json[results], 83 | _results1 = _results{0}, 84 | _data = _results1[data], 85 | _columns = _results1[columns], 86 | _tabledResults = Table.FromList(_data, Splitter.SplitByNothing(), null, null, ExtraValues.Error), 87 | _rows = Table.ExpandRecordColumn(_tabledResults, "Column1", {"row"}, {"Column1.row"}), 88 | _column1Row = _rows[Column1.row], 89 | table = Table.FromRows(_column1Row, _columns) 90 | in 91 | table; 92 | 93 | 94 | ////////////////////////////////////////////////////////////////////////////////////////////// 95 | // Private Functions 96 | 97 | Neo4j.ExecuteRestCall = ( 98 | cypher as text, 99 | scheme as nullable text, 100 | address as nullable text, 101 | port as nullable number, 102 | neo4jVersion as nullable number, 103 | databaseName as nullable text, 104 | timeout as nullable number) as binary => 105 | try 106 | let 107 | content = Web.Contents(Neo4j.DefaultUri(scheme, address, port, neo4jVersion, databaseName), [ 108 | Headers = if Extension.CurrentCredential()[AuthenticationKind] = "Implicit" then ImplicitRequestHeaders else DefaultRequestHeaders, 109 | Content = Neo4j.CypherToM(cypher), 110 | Timeout=#duration(0,0,0,Neo4j.GetTimeout(timeout)) 111 | ]) 112 | in 113 | content 114 | otherwise 115 | let 116 | message = Text.Format("Error executing the call against the database.#(cr)#(lf)Cypher was: '#[cypher]'#(cr)#(lf)NB. Cypher shown is how it was formatted to send to Neo4j.", [cypher=Neo4j.CleanCyper(cypher)]) 117 | in 118 | Diagnostics.Trace(TraceLevel.Error, message, () => error message, true); 119 | 120 | 121 | // 122 | // Generates the default request headers needed for Neo4j to work 123 | // 124 | DefaultRequestHeaders = [ 125 | #"Authorization" = "Basic " & Neo4j.Encode(Extension.CurrentCredential()[Username], Extension.CurrentCredential()[Password]), 126 | #"Content-Type"="application/json" 127 | ]; 128 | 129 | ImplicitRequestHeaders = [ 130 | #"Content-Type"="application/json" 131 | ]; 132 | 133 | // 134 | // Generates the URI to connect to, taking the scheme, address and port - if these aren't supplied, defaults will be used. 135 | // scheme: 'http' 136 | // address: 'localhost' 137 | // port: 7474 138 | // version: 3.5 139 | // databaseName: neo4j 140 | // 141 | Neo4j.DefaultUri = (optional scheme as nullable text, optional address as nullable text, optional port as nullable number, optional neo4jVersion as nullable number, optional databaseName as nullable text) => 142 | let 143 | _version = if(neo4jVersion) is null then 4.2 else neo4jVersion, 144 | _databaseName = if(databaseName) is null then "neo4j" else databaseName, 145 | _transactionEndPoint = if(_version) < 4.0 then "db/data/transaction/commit" else "db/" & _databaseName & "/tx", 146 | _port = if (port) is null then 7474 else port, 147 | _address = if address is null then "localhost." else address, 148 | _scheme = if scheme is null then "http" else scheme, 149 | uri = _scheme & "://" & _address & ":" & Text.From(_port) & "/" & _transactionEndPoint 150 | in 151 | uri; 152 | 153 | // 154 | // Encodes a username/password into a combined base64 string of {user}:{password} 155 | // 156 | Neo4j.Encode = (user as text, password as text) => 157 | let 158 | encoded = Binary.ToText(Text.ToBinary(user & ":" & password), 0) 159 | in 160 | encoded; 161 | 162 | // 163 | // Takes the cypher given and converts it into a structure Neo4j expects at the Transaction Endpoint 164 | // 165 | Neo4j.CypherToM = (cypher as text) => 166 | let 167 | cleanCypher = Neo4j.CleanCyper(cypher), 168 | binary = Text.ToBinary("{ 169 | ""statements"" : [ { 170 | ""statement"" : "" " & cleanCypher & " ""} ] 171 | }") 172 | in 173 | binary; 174 | 175 | // 176 | // Clean the Cypher - removing CRLF characters 177 | // 178 | Neo4j.CleanCyper = (cypher as text) => 179 | let 180 | cleanCypher = Text.Replace(Text.Replace(Text.Replace(Text.Replace(Text.Replace(cypher, "#(cr)", " "), "#(lf)", " "), "\u000d", " "), "\u000a", " "), Character.FromNumber(34), "\""") 181 | in 182 | cleanCypher; 183 | 184 | // 185 | // Gets the default timeout (30s) or the value set. 186 | // 187 | Neo4j.GetTimeout = (timeout as nullable number) => 188 | let 189 | _timeout = if(timeout) is null then 30 else timeout 190 | in 191 | _timeout; 192 | 193 | ////////////////////////////////////////////////////////////////////////////////////////////// 194 | // Connector Definitions 195 | 196 | // 197 | // Connector definition, allows access via User/Password combinations and Anonymous (Implicit) 198 | // 199 | Neo4j = [ 200 | TestConnection = (datasourcePath) => 201 | let 202 | json = Json.Document(datasourcePath), 203 | cypher = json[cypher], 204 | scheme = json[scheme], 205 | address = json[address], 206 | port = json[port], 207 | neo4jVersion = json[neo4jVersion], 208 | databaseName = json[databaseName], 209 | timeout = json[timeout] 210 | in 211 | {"Neo4j.ExecuteCypher", cypher, scheme, address, port, neo4jVersion, databaseName, timeout }, 212 | Authentication = [ 213 | UsernamePassword = [ 214 | Label = "Neo4j Authentication", 215 | UsernameLabel = "Username", 216 | PasswordLabel = "Password" 217 | ], 218 | Anonymous = [] 219 | ], 220 | Label = Extension.LoadString("DataSourceLabel") 221 | ]; 222 | 223 | // 224 | // The UI Publishing definition, i.e. where it shows in the UI, whether it's beta etc 225 | // 226 | Neo4j.Publish = [ 227 | Beta = true, 228 | Category = "Database", 229 | ButtonText = { Extension.LoadString("ButtonTitle"), Extension.LoadString("ButtonHelp") }, 230 | LearnMoreUrl = "https://github.com/cskardon/Neo4jDataConnectorForPowerBi/", 231 | SourceImage = Neo4j.Icons, 232 | SourceTypeImage = Neo4j.Icons 233 | ]; 234 | 235 | // 236 | // Various sized icons for UI display 237 | // 238 | Neo4j.Icons = [ 239 | Icon16 = { Extension.Contents("Neo4j16.png"), Extension.Contents("Neo4j20.png"), Extension.Contents("Neo4j24.png"), Extension.Contents("Neo4j32.png") }, 240 | Icon32 = { Extension.Contents("Neo4j32.png"), Extension.Contents("Neo4j40.png"), Extension.Contents("Neo4j48.png"), Extension.Contents("Neo4j64.png") } 241 | ]; -------------------------------------------------------------------------------- /Neo4jPowerBiConnector/Neo4j.proj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | $(MSBuildProjectDirectory)\bin\AnyCPU\Debug\ 5 | $(MSBuildProjectDirectory)\obj\ 6 | $(IntermediateOutputPath)MEZ\ 7 | $(OutputPath)$(MsBuildProjectName).mez 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /Neo4jPowerBiConnector/Neo4j.query.pq: -------------------------------------------------------------------------------- 1 | // Use this file to write queries to test your data connector 2 | /* 3 | let 4 | result = Neo4j.Count() 5 | in 6 | result 7 | */ 8 | /* 9 | let 10 | result = Neo4j.GetCountOfNodes() 11 | in 12 | result 13 | */ 14 | 15 | 16 | let 17 | result = Neo4j.ExecuteCypher("MATCH (n:Movie) WHERE n.title = ""The Matrix"" RETURN n.title", "http", "localhost.", 7474, 4.4, "neo4j", 30) 18 | in 19 | result 20 | 21 | /* 22 | let 23 | result = Neo4j.ExecuteCypher("MATCH (n) RETURN COUNT(n)", "http", "Server2019Blog", 7474, 4.2, "neo4j", 30) 24 | in 25 | result 26 | */ 27 | 28 | /* 29 | let 30 | result = Neo4j.ExecuteCypher("MATCH (n) RETURN COUNT(n)", "http", "localhost", 7474, 4.1, "neo4j", 30) 31 | in 32 | result 33 | */ -------------------------------------------------------------------------------- /Neo4jPowerBiConnector/Neo4j16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cskardon/Neo4jDataConnectorForPowerBi/5b56518014e1b704dfd883fc3ba88eead7516b8b/Neo4jPowerBiConnector/Neo4j16.png -------------------------------------------------------------------------------- /Neo4jPowerBiConnector/Neo4j20.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cskardon/Neo4jDataConnectorForPowerBi/5b56518014e1b704dfd883fc3ba88eead7516b8b/Neo4jPowerBiConnector/Neo4j20.png -------------------------------------------------------------------------------- /Neo4jPowerBiConnector/Neo4j24.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cskardon/Neo4jDataConnectorForPowerBi/5b56518014e1b704dfd883fc3ba88eead7516b8b/Neo4jPowerBiConnector/Neo4j24.png -------------------------------------------------------------------------------- /Neo4jPowerBiConnector/Neo4j32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cskardon/Neo4jDataConnectorForPowerBi/5b56518014e1b704dfd883fc3ba88eead7516b8b/Neo4jPowerBiConnector/Neo4j32.png -------------------------------------------------------------------------------- /Neo4jPowerBiConnector/Neo4j40.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cskardon/Neo4jDataConnectorForPowerBi/5b56518014e1b704dfd883fc3ba88eead7516b8b/Neo4jPowerBiConnector/Neo4j40.png -------------------------------------------------------------------------------- /Neo4jPowerBiConnector/Neo4j48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cskardon/Neo4jDataConnectorForPowerBi/5b56518014e1b704dfd883fc3ba88eead7516b8b/Neo4jPowerBiConnector/Neo4j48.png -------------------------------------------------------------------------------- /Neo4jPowerBiConnector/Neo4j64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cskardon/Neo4jDataConnectorForPowerBi/5b56518014e1b704dfd883fc3ba88eead7516b8b/Neo4jPowerBiConnector/Neo4j64.png -------------------------------------------------------------------------------- /Neo4jPowerBiConnector/Neo4j80.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cskardon/Neo4jDataConnectorForPowerBi/5b56518014e1b704dfd883fc3ba88eead7516b8b/Neo4jPowerBiConnector/Neo4j80.png -------------------------------------------------------------------------------- /Neo4jPowerBiConnector/Neo4jDataConnectorForPowerBi.mproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | Debug 4 | 2.0 5 | 6 | 7 | Exe 8 | MyRootNamespace 9 | MyAssemblyName 10 | False 11 | False 12 | False 13 | False 14 | True 15 | False 16 | True 17 | False 18 | False 19 | False 20 | 1000 21 | Yes 22 | Neo4jDataConnectorForPowerBi 23 | False 24 | 25 | 26 | false 27 | 28 | bin\Debug\ 29 | 30 | 31 | false 32 | bin\Release\ 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | Code 43 | 44 | 45 | Code 46 | 47 | 48 | Code 49 | 50 | 51 | Code 52 | 53 | 54 | Code 55 | 56 | 57 | Code 58 | 59 | 60 | Code 61 | 62 | 63 | Code 64 | 65 | 66 | Code 67 | 68 | 69 | Code 70 | 71 | 72 | Code 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | -------------------------------------------------------------------------------- /Neo4jPowerBiConnector/resources.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | 121 | Address 122 | 123 | 124 | The address for your Neo4j instance 125 | 126 | 127 | Connect to Neo4j 128 | 129 | 130 | Neo4j (Connector v.2.1) 131 | 132 | 133 | Provides the response of the query in a Json document 134 | 135 | 136 | Execute Cypher - Output 137 | 138 | 139 | Cypher 140 | 141 | 142 | Enter your Cypher query here 143 | 144 | 145 | Database Name 146 | 147 | 148 | The name of your database (only used for a 4.x DB, if unsure, use neo4j) 149 | 150 | 151 | Neo4j 152 | 153 | 154 | Neo4j Version 155 | 156 | 157 | The version of the server you are connecting to (default is 4.2) 158 | 159 | 160 | Port 161 | 162 | 163 | The port of the Neo4j instance 164 | 165 | 166 | Scheme 167 | 168 | 169 | The scheme to connect to your Neo4j instance 170 | 171 | 172 | Timeout for queries in seconds 173 | 174 | 175 | If you're running a long query you might want to set this high 176 | 177 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Neo4j DataConnector For Power BI 2 | 3 | Pretty much what it says on the tin. 4 | 5 | Please use **[Version 2.0](https://github.com/cskardon/Neo4jDataConnectorForPowerBi/releases/tag/2.0.0)** 6 | 7 | ## How do I try it? 8 | 9 | 1. Put it into your PowerBI extensions folder 10 | (which appears to be: `/Documents/Power BI Desktop/Custom Connectors`) 11 | 2. Allow Power BI to use beta connectors: 12 | Goto 'Options' in Power BI 13 | Select 'Security' 14 | Under the 'Data Extensions' heading select the radio option of: 15 | > (Not Recommended) Allow any extension to load without validation or warning 16 | 17 | ## Releases 18 | 19 | All releases are available on the [Releases](https://github.com/cskardon/Neo4jDataConnectorForPowerBi/releases) page. 20 | 21 | ## Versions 22 | 23 | * [1.0](https://github.com/cskardon/Neo4jDataConnectorForPowerBi/releases/tag/1.0.0) = Initial release 24 | * [1.1](https://github.com/cskardon/Neo4jDataConnectorForPowerBi/releases/tag/1.1.0) = Bug fix to get it working with Neo4j 4.0 MR2 (and probably onwards) 25 | * [1.2](https://github.com/cskardon/Neo4jDataConnectorForPowerBi/releases/tag/1.2.0) = Neo4j `4.0` release - should work with `3.x` and `4.x` 26 | * [1.3](https://github.com/cskardon/Neo4jDataConnectorForPowerBi/releases/tag/1.3.0) = Adding `Timeout` settings for longer running queries 27 | * [1.4](https://github.com/cskardon/Neo4jDataConnectorForPowerBi/releases/tag/1.4.0) = Making the 'cypher' entry field bigger 28 | * [2.0](https://github.com/cskardon/Neo4jDataConnectorForPowerBi/releases/tag/2.0.0) = Adding auto-refresh for personal gateways, and all fields are _required_ now 29 | 30 | ## Beta Versions 31 | 32 | * None at the moment --------------------------------------------------------------------------------