├── .gitignore
├── CHANGES.txt
├── LICENSE.txt
├── LICENSES.txt
├── Makefile
├── NOTICE.txt
├── README.rst
├── pom.xml
└── src
├── bin
└── classpath
├── docs
├── conf
│ ├── asciidoc.local.conf
│ ├── upload.sh
│ └── version
├── dev
│ ├── index.asciidoc
│ ├── installation.asciidoc
│ ├── reference
│ │ ├── core-getting-started.asciidoc
│ │ ├── core-nodes.asciidoc
│ │ ├── core-paths.asciidoc
│ │ ├── core-properties.asciidoc
│ │ ├── core-relationships.asciidoc
│ │ ├── core-transactions.asciidoc
│ │ ├── core.asciidoc
│ │ ├── cypher.asciidoc
│ │ ├── indexes.asciidoc
│ │ └── traversal.asciidoc
│ ├── tutorial.asciidoc
│ └── tutorial
│ │ ├── helloworld.asciidoc
│ │ ├── index.asciidoc
│ │ └── invoiceapp.asciidoc
├── docinfo.html
└── manual.asciidoc
├── main
├── assembly
│ └── python-distribution.xml
├── java
│ └── org
│ │ └── neo4j
│ │ └── cypher
│ │ └── pycompat
│ │ ├── ExecutionEngine.java
│ │ ├── ExecutionResult.java
│ │ ├── ScalaToPythonWrapper.java
│ │ ├── WrappedCollection.java
│ │ ├── WrappedIterable.java
│ │ ├── WrappedIterator.java
│ │ ├── WrappedMap.java
│ │ └── WrappedPath.java
└── python
│ ├── README.txt
│ ├── neo4j
│ ├── __init__.py
│ ├── __main__.py
│ ├── _backend.py
│ ├── core.py
│ ├── cypher.py
│ ├── index.py
│ ├── javalib
│ │ └── __init__.py
│ ├── traversal.py
│ └── util.py
│ └── setup.py
├── site
├── apt
│ └── index.apt
└── site.xml
└── test
├── format
└── junit-noframes.xsl
└── python
├── core.py
├── cypher.py
├── examples.py
├── index.py
├── junit_xml.py
├── threads.py
├── traversal.py
└── unit_tests.py
/.gitignore:
--------------------------------------------------------------------------------
1 | *~
2 | /target/
3 | *.pyc
4 | *.class
5 | /ENV
6 | .classpath
7 | .project
8 | .settings/
9 | .pydevproject
10 | *.iml
11 |
--------------------------------------------------------------------------------
/CHANGES.txt:
--------------------------------------------------------------------------------
1 | 1.6.M02 (2011-12-16)
2 | --------------------
3 | o Fix for broken cypher tests
4 | o Added get and set methods to nodes and relationships
5 |
--------------------------------------------------------------------------------
/Makefile:
--------------------------------------------------------------------------------
1 | # Makefile for the Embedded Neo4j Python bindings documentation.
2 | #
3 |
4 | # Project Configuration
5 | project_name = manual
6 | language = en
7 |
8 | # Minimal setup
9 | target = target
10 | build_dir = $(CURDIR)/$(target)
11 | config_dir = $(CURDIR)/docs/conf
12 | tools_dir = $(build_dir)/tools
13 | make_dir = $(tools_dir)/make
14 |
15 | include $(make_dir)/context-manual.make
16 |
17 | main_source = docs
18 |
--------------------------------------------------------------------------------
/NOTICE.txt:
--------------------------------------------------------------------------------
1 | Neo4j
2 | Copyright © 2002-2011 Network Engine for Objects in Lund AB (referred to
3 | in this notice as “Neo Technology”)
4 | [http://neotechnology.com]
5 |
6 | This product includes software ("Software") developed by Neo Technology.
7 |
8 | The copyright in the bundled Neo4j graph database (including the
9 | Software) is owned by Neo Technology. The Software developed and owned
10 | by Neo Technology is licensed under the GNU GENERAL PUBLIC LICENSE
11 | Version 3 (http://www.fsf.org/licensing/licenses/gpl-3.0.html) ("GPL")
12 | to all third parties and that license, as required by the GPL, is
13 | included in the LICENSE.txt file.
14 |
15 | However, if you have executed an End User Software License and Services
16 | Agreement or an OEM Software License and Support Services Agreement, or
17 | another commercial license agreement with Neo Technology or one of its
18 | affiliates (each, a "Commercial Agreement"), the terms of the license in
19 | such Commercial Agreement will supersede the GPL and you may use the
20 | software solely pursuant to the terms of the relevant Commercial
21 | Agreement.
22 |
23 |
24 | Third party libraries
25 | ---------------------
26 |
27 | Full license texts are found in LICENSES.txt.
28 |
29 | The Apache Software License, Version 2.0:
30 | Apache ServiceMix :: Bundles :: lucene,
31 | Apache Commons:
32 | Commons BeanUtils, Commons BeanUtils Core, Commons Collections, Commons IO,
33 | Commons Configuration, Commons Digester, Commons Lang, Commons Logging,
34 | Apache Log4j,
35 | Apache Felix: Felix FileInstall, Felix Framework, Felix Main,
36 | Geronimo Java Transaction API,
37 | Jansi,
38 |
39 | MIT License:
40 | SLF4J API Module, SLF4J Log4j-12 Binding, SLF4J JDK1.4 Logging Binding,
41 | SLF4J Jakarta Commons Logging Binding,
42 |
43 | BSD licence:
44 | ASM: ASM Core, ASM Tree, ASM Commons, ASM Util, ASM Analysis,
45 | Blueprints: Data Models and their Implementations,
46 | Gremlin: A Graph-Based Programming Language,
47 | Pipes: A Data Flow Framework using Process Graphs,
48 | JLine, Scala library
49 |
50 | Public domain:
51 | Dough Lea's util.concurrent package,
52 | ANTLR 2.7.7,
53 |
--------------------------------------------------------------------------------
/README.rst:
--------------------------------------------------------------------------------
1 | Python bindings for embedded Neo4j
2 | ==================================
3 |
4 | **Note**: This project is no longer maintained. The approach with JPype was not workable. Please have a look at some of the alternatives available at http://neo4j.com/developer/python/
5 |
6 | These are Python bindings for the embedded Neo4j Graph Database.
7 |
8 | Prerequisites
9 | -------------
10 |
11 | The neo4j embedded database is a java application, which means you have to provide an interface to communicate with java-land. You need:
12 |
13 | - CPython with JPype installed http://jpype.sourceforge.net/
14 |
15 | Documentation
16 | -------------
17 |
18 | The documentation contains more detailed help with installation, as well as examples and reference documentation.
19 |
20 | See http://docs.neo4j.org/
21 |
22 | Installation
23 | ------------
24 |
25 | ::
26 |
27 | pip install neo4j-embedded
28 |
29 | Installation from source
30 | ------------------------
31 |
32 | To install neo4j-embedded from this source tree, use the maven build tool to produce the python distribution, then install the distribution normally:
33 |
34 | ::
35 |
36 | mvn package
37 | unzip target/neo4j-python-embedded-[VERSION]-python-dist.zip
38 | cd neo4j-embedded
39 | python setup.py install
40 |
41 | Releasing
42 | ------------------------
43 |
44 | Make sure you have a .pypirc file in your home folder with correct login information for the neo4j-embedded package on pypi.python.org. The release builds windows installers, so it needs to run on a windows machine.
45 |
46 | ::
47 |
48 | python release.py
49 |
50 |
--------------------------------------------------------------------------------
/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 | 4.0.0
5 |
6 | org.neo4j.build
7 | parent-central
8 | 36
9 |
10 |
11 |
12 | org.neo4j.drivers
13 | neo4j-python-embedded
14 |
15 | 1.9-SNAPSHOT
16 | Embedded Neo4j Python bindings
17 | jar
18 |
19 | Python bindings for the embedded Neo4j graph database.
20 |
21 |
22 |
23 | scm:git:git://github.com/neo4j-contrib/python-embedded.git
24 | scm:git:git@github.com:neo4j-contrib/python-embedded.git
25 | https://github.com/neo4j-contrib/python-embedded
26 |
27 |
28 |
29 | GPL-3-header.txt
30 | python
31 |
32 |
33 | ../../main/python:$PYTHONPATH
34 | ../../main/python:$JYTHONPATH
35 | 0
36 |
37 | 1.9-SNAPSHOT
38 | 1.2
39 | http://docs.neo4j.org/python-embedded/${project.version}/index.html
40 |
41 |
42 |
43 |
44 | GNU General Public License, Version 3
45 | http://www.gnu.org/licenses/gpl-3.0-standalone.html
46 | The software ("Software") developed and owned by Network Engine for
47 | Objects in Lund AB (referred to in this notice as "Neo Technology") is
48 | licensed under the GNU GENERAL PUBLIC LICENSE Version 3 to all third
49 | parties and that license is included below.
50 |
51 | However, if you have executed an End User Software License and Services
52 | Agreement or an OEM Software License and Support Services Agreement, or
53 | another commercial license agreement with Neo Technology or one of its
54 | affiliates (each, a "Commercial Agreement"), the terms of the license in
55 | such Commercial Agreement will supersede the GNU GENERAL PUBLIC LICENSE
56 | Version 3 and you may use the Software solely pursuant to the terms of
57 | the relevant Commercial Agreement.
58 |
59 |
60 |
61 |
62 |
63 |
64 | org.neo4j
65 | neo4j
66 | ${neo4j.version}
67 |
68 |
69 |
70 | org.neo4j
71 | neo4j-cypher
72 | ${neo4j.version}
73 |
74 |
75 |
76 |
77 |
78 |
79 | neo4j-dev
80 | Neo4j Developer Repository
81 | http://m2.neo4j.org/content/groups/everything/
82 |
83 |
84 |
85 |
86 | src/main/java
87 | src/test/python
88 |
89 |
90 |
91 |
92 | org.codehaus.gmaven
93 | gmaven-plugin
94 | 1.3
95 |
96 |
97 | pythonificate-version-number
98 | generate-resources
99 |
100 | execute
101 |
102 |
103 |
104 | def version = project.version
105 |
106 | // 1.5-SNAPSHOT -> 1.5.dev1
107 | version = version.replace("-SNAPSHOT", ".dev" + project.properties['build.number'])
108 |
109 | // 1.5.RC1 -> 1.5.c1
110 | version = version.replace("RC","c")
111 |
112 | // 1.5.M01 -> 1.5.b1
113 | version = version.replace("M0","b")
114 | version = version.replace("M","b")
115 | project.properties['pythonic_version'] = version
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 | maven-assembly-plugin
125 |
126 |
127 | python-distribution
128 | package
129 |
130 | false
131 | true
132 |
133 | src/main/assembly/python-distribution.xml
134 |
135 |
136 |
137 | single
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 |
147 |
148 | org.eclipse.m2e
149 | lifecycle-mapping
150 | 1.0.0
151 |
152 |
153 |
154 |
155 |
156 |
157 | org.codehaus.gmaven
158 |
159 |
160 | gmaven-plugin
161 |
162 |
163 | [1.3,)
164 |
165 |
166 | execute
167 |
168 |
169 |
170 |
171 |
172 |
173 |
174 |
175 |
176 |
177 |
178 |
179 |
180 |
181 |
182 |
183 | cpython-test
184 |
185 | python
186 |
187 |
188 |
189 | jython-test
190 |
191 | jython
192 |
193 |
194 |
195 | windows
196 |
197 |
198 | windows
199 |
200 |
201 |
202 | ../../main/python
203 | ../../main/python
204 |
205 |
206 |
207 |
208 | run-tests
209 |
210 |
211 | !skipTests
212 |
213 |
214 |
215 |
216 |
217 |
218 | org.codehaus.mojo
219 | exec-maven-plugin
220 |
221 |
222 |
223 | ${python}
224 | src/test/python
225 |
226 |
227 |
228 | unit_tests.py
229 | --classpath
230 |
231 | --junit
232 | ${basedir}/target/surefire-reports
233 |
234 |
235 | ${pythonpath}
236 | ${jythonpath}
237 |
238 |
239 | python-test
240 | test
241 |
242 | exec
243 |
244 |
245 |
246 |
247 |
248 |
249 |
250 |
251 |
252 |
253 | performance-test
254 |
255 |
256 |
257 | org.codehaus.mojo
258 | exec-maven-plugin
259 |
260 |
261 | python-performance-test
262 | test
263 |
264 | exec
265 |
266 |
267 | pdb
268 |
269 | src/perftest/python
270 |
271 | performance_tests.py
272 | --classpath
273 |
274 |
275 |
276 | ${pythonpath}
277 | ${jythonpath}
278 |
279 |
280 |
281 |
282 |
283 |
284 |
285 |
286 |
287 |
288 |
290 |
291 | pypi
292 |
293 |
294 |
295 | maven-antrun-plugin
296 |
297 |
298 | pypi-deploy
299 | install
300 |
301 | run
302 |
303 |
304 |
305 |
307 |
308 |
309 |
310 |
311 |
312 |
313 |
314 |
315 |
316 |
317 |
318 |
319 |
320 |
321 |
322 |
323 |
324 |
325 |
326 |
327 |
328 |
329 |
330 |
331 |
332 |
333 |
334 |
335 |
336 |
337 |
338 |
339 |
340 |
341 |
342 | neo-docs-build
343 |
344 | false
345 |
346 | docsBuild
347 |
348 |
349 |
350 |
351 | org.neo4j.build.plugins
352 | neo4j-doctools
353 | 1
354 | provided
355 |
356 |
357 |
358 |
359 |
360 | maven-dependency-plugin
361 |
362 |
363 | unpack-doctools
364 | generate-sources
365 |
366 | unpack-dependencies
367 |
368 |
369 | jar
370 | neo4j-doctools
371 | ${docs.tools}
372 |
373 |
374 |
375 |
376 |
377 | maven-resources-plugin
378 |
379 |
380 | copy-docs
381 | process-resources
382 |
383 | copy-resources
384 |
385 |
386 | ${project.build.directory}/docs
387 |
388 |
389 | src/docs
390 |
391 |
392 |
393 |
394 |
395 | copy-configuration
396 | process-resources
397 |
398 | copy-resources
399 |
400 |
401 | ${project.build.directory}/conf
402 |
403 |
404 | src/docs/conf
405 |
406 | version
407 |
408 |
409 |
410 |
411 |
412 |
413 | copy-version
414 | process-resources
415 |
416 | copy-resources
417 |
418 |
419 | ${project.build.directory}/conf
420 |
421 |
422 | src/docs/conf
423 | true
424 |
425 | version
426 |
427 |
428 |
429 |
430 |
431 |
432 | copy-test-sources
433 | process-resources
434 |
435 | copy-resources
436 |
437 |
438 | ${project.build.directory}/test-sources/neo4j-python-embedded-test-sources-jar
439 |
440 |
441 | src/test/python
442 |
443 |
444 |
445 |
446 |
447 |
448 |
449 | org.codehaus.mojo
450 | exec-maven-plugin
451 |
452 |
453 | execute-asciidoc
454 | compile
455 |
456 | exec
457 |
458 |
459 | make
460 |
461 | init
462 | preview
463 | VERSION=${project.version}
464 |
465 |
466 |
467 |
468 |
469 |
470 |
471 |
472 | ${project.build.directory}/tools
473 | none
474 |
475 |
476 |
477 | publish-manual
478 |
479 | false
480 |
481 | publish-manual
482 |
483 |
484 |
485 |
486 |
487 | org.codehaus.mojo
488 | exec-maven-plugin
489 |
490 |
491 | upload-to-servers
492 | deploy
493 |
494 | exec
495 |
496 |
497 | ${project.build.directory}/../src/docs/conf/upload.sh
498 |
499 |
500 |
501 |
502 |
503 |
504 |
505 |
506 |
507 |
508 |
509 | neo4j-site
510 | scpexe://static.neo4j.org/var/www/components.neo4j.org/${project.artifactId}/${project.version}
511 |
512 |
513 |
514 |
515 |
--------------------------------------------------------------------------------
/src/bin/classpath:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | # Copyright (c) 2002-2013 "Neo Technology,"
4 | # Network Engine for Objects in Lund AB [http://neotechnology.com]
5 | #
6 | # This file is part of Neo4j.
7 | #
8 | # Neo4j is free software: you can redistribute it and/or modify
9 | # it under the terms of the GNU General Public License as published by
10 | # the Free Software Foundation, either version 3 of the License, or
11 | # (at your option) any later version.
12 | #
13 | # This program is distributed in the hope that it will be useful,
14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 | # GNU General Public License for more details.
17 | #
18 | # You should have received a copy of the GNU General Public License
19 | # along with this program. If not, see .
20 |
21 | if [ -n "$(which mvn)" ]; then
22 | cd $(dirname $0)/../..
23 | if ! mvn dependency:copy-dependencies &> /dev/null; then
24 | echo failed to copy dependencies >2
25 | exit -1
26 | fi
27 | ls target/dependency/*.jar | tr "\\n" ":" | sed 's/:$//'
28 | else
29 | echo need mvn to build classpath >2
30 | exit -1
31 | fi
32 |
--------------------------------------------------------------------------------
/src/docs/conf/asciidoc.local.conf:
--------------------------------------------------------------------------------
1 | [attributes]
2 | imagesdir=images
3 | iconsdir=images/icons
4 | imagestargetdir=target/src/images
5 | fontsdir=target/tools/bin/fonts
6 |
7 |
--------------------------------------------------------------------------------
/src/docs/conf/upload.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | set -e
3 | set -x
4 |
5 | DIR=$(cd `dirname $0` && cd ../../../ && pwd)
6 |
7 | # Uploads the manual to a public server.
8 |
9 |
10 | # Which version the documentation is now.
11 | VERSION=$(cat $DIR/target/conf/version)
12 | if [ -z "$VERSION" ]; then
13 | exit 1;
14 | fi
15 |
16 | # Name of the symlink created on the docs server, pointing to this version.
17 | if [[ $VERSION == *SNAPSHOT* ]]
18 | then
19 | SYMLINKVERSION=snapshot
20 | else
21 | if [[ $VERSION == *M* ]]
22 | then
23 | SYMLINKVERSION=milestone
24 | else
25 | SYMLINKVERSION=stable
26 | fi
27 | fi
28 | DOCS_SERVER='neo@static.neo4j.org'
29 | ROOTPATHDOCS='/var/www/docs.neo4j.org/drivers/python-embedded'
30 |
31 | echo "VERSION = $VERSION"
32 | echo "SYMLINKVERSION = $SYMLINKVERSION"
33 |
34 | # Create initial directories
35 | ssh $DOCS_SERVER mkdir -p $ROOTPATHDOCS/$VERSION
36 |
37 | # Copy artifacts
38 | rsync -r --delete $DIR/target/html5/ $DOCS_SERVER:$ROOTPATHDOCS/$VERSION/
39 | # Symlink this version to a generic url
40 | ssh $DOCS_SERVER "cd $ROOTPATHDOCS/ && (rm $SYMLINKVERSION || true); ln -s $VERSION $SYMLINKVERSION"
41 |
42 | echo Apparently, successfully published to $DOCS_SERVER.
43 |
44 |
45 |
--------------------------------------------------------------------------------
/src/docs/conf/version:
--------------------------------------------------------------------------------
1 | ${neo4j.version}
2 |
--------------------------------------------------------------------------------
/src/docs/dev/index.asciidoc:
--------------------------------------------------------------------------------
1 | [[python-embedded]]
2 | = Reference Documentation =
3 |
4 | The source code for this project lives on GitHub: https://github.com/neo4j-contrib/python-embedded
5 |
6 | :leveloffset: 2
7 |
8 | include::installation.asciidoc[]
9 |
10 | include::reference/core.asciidoc[]
11 |
12 | include::reference/indexes.asciidoc[]
13 |
14 | include::reference/cypher.asciidoc[]
15 |
16 | include::reference/traversal.asciidoc[]
17 |
18 |
--------------------------------------------------------------------------------
/src/docs/dev/installation.asciidoc:
--------------------------------------------------------------------------------
1 | [[python-embedded-installation]]
2 | = Installation =
3 |
4 | NOTE: The Neo4j database itself (from the http://docs.neo4j.org/chunked/{neo4j-version}/deployment-installation.html#editions[Community Edition]) is included in the neo4j-embedded distribution.
5 |
6 | == Installation on OSX/Linux ==
7 |
8 |
9 | === Prerequisites ===
10 |
11 | CAUTION: Make sure that the entire stack used is either 64bit or 32bit (no mixing, that is). That means the JVM, Python and JPype.
12 |
13 | First, install JPype:
14 |
15 | . Download the latest version of JPype from http://sourceforge.net/projects/jpype/files/JPype/.
16 | . Unzip the file.
17 | . Open a console and navigate into the unzipped folder.
18 | . Run `sudo python setup.py install`
19 |
20 | JPype is also available in the Debian repos:
21 |
22 | [source, shell]
23 | ----
24 | sudo apt-get install python-jpype
25 | ----
26 |
27 | Then, make sure the +JAVA_HOME+ environment variable is set to your 'jre' or 'jdk' folder, so that JPype can find the JVM.
28 |
29 | NOTE: Installation can be problematic on OSX. See the following Stack Overflow discussion for help: http://stackoverflow.com/questions/8525193/cannot-install-jpype-on-os-x-lion-to-use-with-neo4j and this blog post may be of help as well: http://blog.y3xz.com/blog/2011/04/29/installing-jpype-on-mac-os-x/
30 |
31 |
32 | === Installing neo4j-embedded ===
33 |
34 | You can install neo4j-embedded with your python package manager of choice:
35 |
36 | [source, shell]
37 | ----
38 | sudo pip install neo4j-embedded
39 | ----
40 |
41 | [source, shell]
42 | ----
43 | sudo easy_install neo4j-embedded
44 | ----
45 |
46 | Or install manually:
47 |
48 | . Download the latest appropriate version of JPype from http://sourceforge.net/projects/jpype/files/JPype/ for 32bit or from http://www.lfd.uci.edu/~gohlke/pythonlibs/ for 64bit.
49 | . Unzip the file.
50 | . Open a console and navigate into the unzipped folder.
51 | . Run `sudo python setup.py install`
52 |
53 | == Installation on Windows ==
54 |
55 | === Prerequisites ===
56 |
57 | WARNING: It is _imperative_ that the entire stack used is either 64bit or 32bit (no mixing, that is).
58 | That means the JVM, Python, JPype and all extra DLLs (see below).
59 |
60 | First, install JPype:
61 |
62 | [NOTE]
63 | Notice that JPype only works with Python 2.6 and 2.7.
64 | Also note that there are different downloads depending on which version you use.
65 |
66 | . Download the latest appropriate version of JPype from http://sourceforge.net/projects/jpype/files/JPype/ for 32bit or from http://www.lfd.uci.edu/~gohlke/pythonlibs/ for 64bit.
67 | . Run the installer.
68 |
69 | Then, make sure the +JAVA_HOME+ environment variable is set to your 'jre' or 'jdk' folder.
70 | There is a description of how to set environment variables in <>.
71 |
72 | NOTE: There may be DLL files missing from your system that are required by JPype.
73 | See <> for instructions for how to fix this.
74 |
75 | === Installing neo4j-embedded ===
76 |
77 | . Download the latest version from http://pypi.python.org/pypi/neo4j-embedded/.
78 | . Run the installer.
79 |
80 | [[python-embedded-installation-windows-dlls]]
81 | === Solving problems with missing DLL files ===
82 |
83 | Certain versions of Windows ship without DLL files needed to programmatically launch a JVM.
84 | You will need to make +IEShims.dll+ and certain debugging dlls available on Windows.
85 |
86 | +IEShims.dll+ is normally included with Internet Explorer installs.
87 | To make windows find this file globally, you need to add the IE install folder to your +PATH+.
88 |
89 | . Right click on "My Computer" or "Computer".
90 | . Select "Properties".
91 | . Click on "Advanced" or "Advanced system settings".
92 | . Click the "Environment variables" button.
93 | . Find the path varible, and add 'C:\Program Files\Internet Explorer' to it (or the install location of IE, if you have installed it somewhere else).
94 |
95 | Required debugging dlls are bundled with Microsoft Visual C++ Redistributable libraries.
96 |
97 | - 32bit Windows: http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=5555
98 | - 64bit Windows: http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=14632
99 |
100 | If you are still getting errors about missing DLL files, you can use http://www.dependencywalker.com/ to open your +jvm.dll+ (located in 'JAVA_HOME/bin/client/' or 'JAVA_HOME/bin/server/'), and it will tell you if there are other missing dlls.
101 |
102 |
--------------------------------------------------------------------------------
/src/docs/dev/reference/core-getting-started.asciidoc:
--------------------------------------------------------------------------------
1 | == Getting started ==
2 |
3 | === Creating a database ===
4 |
5 | [snippet,python]
6 | ----
7 | component=neo4j-python-embedded
8 | source=core.py
9 | tag=creatingDatabase
10 | classifier=test-sources
11 | ----
12 |
13 | === Creating a database, with configuration ===
14 |
15 | Please see http://docs.neo4j.org/chunked/{neo4j-version}/embedded-configuration.html[Neo4j Configuration] for what options you can use here.
16 |
17 | [snippet,python]
18 | ----
19 | component=neo4j-python-embedded
20 | source=core.py
21 | tag=creatingConfiguredDatabase
22 | classifier=test-sources
23 | ----
24 |
25 | === JPype JVM configuration ===
26 |
27 | You can set extra arguments to be passed to the JVM using the +NEO4J_PYTHON_JVMARGS+ environment variable.
28 | This can be used to, for instance, increase the max memory for the database.
29 |
30 | Note that you must set this before you import the neo4j package, either by setting it before you start python, or by setting it programatically in your app.
31 |
32 | [source,python]
33 | ----
34 | import os
35 | os.environ['NEO4J_PYTHON_JVMARGS'] = '-Xms128M -Xmx512M'
36 | import neo4j
37 | ----
38 |
39 | You can also override the classpath used by neo4j-embedded, by setting the +NEO4J_PYTHON_CLASSPATH+ environment variable.
40 |
41 |
--------------------------------------------------------------------------------
/src/docs/dev/reference/core-nodes.asciidoc:
--------------------------------------------------------------------------------
1 | [[python-embedded-core-nodes]]
2 | == Nodes ==
3 |
4 | This describes operations that are specific to node objects.
5 | For documentation on how to handle properties on both relationships and nodes, see <>.
6 |
7 | === Creating a node ===
8 |
9 | [snippet,python]
10 | ----
11 | component=neo4j-python-embedded
12 | source=core.py
13 | tag=createNode
14 | classifier=test-sources
15 | ----
16 |
17 | === Fetching a node by id ===
18 |
19 | [snippet,python]
20 | ----
21 | component=neo4j-python-embedded
22 | source=core.py
23 | tag=getNodeById
24 | classifier=test-sources
25 | ----
26 |
27 | === Fetching the reference node ===
28 |
29 | [snippet,python]
30 | ----
31 | component=neo4j-python-embedded
32 | source=core.py
33 | tag=getReferenceNode
34 | classifier=test-sources
35 | ----
36 |
37 | === Removing a node ===
38 |
39 | [snippet,python]
40 | ----
41 | component=neo4j-python-embedded
42 | source=core.py
43 | tag=deleteNode
44 | classifier=test-sources
45 | ----
46 |
47 | TIP: See also http://docs.neo4j.org/chunked/{neo4j-version}/transactions-delete.html[Neo4j Delete Semantics].
48 |
49 | === Removing a node by id ===
50 |
51 | [snippet,python]
52 | ----
53 | component=neo4j-python-embedded
54 | source=core.py
55 | tag=deleteByIdNode
56 | classifier=test-sources
57 | ----
58 |
59 | === Accessing relationships from a node ===
60 |
61 | For details on what you can do with the relationship objects, see <>.
62 |
63 | [snippet,python]
64 | ----
65 | component=neo4j-python-embedded
66 | source=core.py
67 | tag=accessingRelationships
68 | classifier=test-sources
69 | ----
70 |
71 | === Getting and/or counting all nodes ===
72 |
73 | Use this with care, it will become extremely slow in large datasets.
74 |
75 | [snippet,python]
76 | ----
77 | component=neo4j-python-embedded
78 | source=core.py
79 | tag=getAllNodes
80 | classifier=test-sources
81 | ----
82 |
83 |
--------------------------------------------------------------------------------
/src/docs/dev/reference/core-paths.asciidoc:
--------------------------------------------------------------------------------
1 | [[python-embedded-core-paths]]
2 | == Paths ==
3 |
4 | A path object represents a path between two nodes in the graph.
5 | Paths thus contain at least two nodes and one relationship, but can reach arbitrary length.
6 | It is used in various parts of the API, most notably in <>.
7 |
8 | === Accessing the start and end nodes ===
9 |
10 | [snippet,python]
11 | ----
12 | component=neo4j-python-embedded
13 | source=traversal.py
14 | tag=accessPathStartAndEndNode
15 | classifier=test-sources
16 | ----
17 |
18 | === Accessing the last relationship ===
19 |
20 | [snippet,python]
21 | ----
22 | component=neo4j-python-embedded
23 | source=traversal.py
24 | tag=accessPathLastRelationship
25 | classifier=test-sources
26 | ----
27 |
28 | === Looping through the entire path ===
29 |
30 | You can loop through all elements of a path directly, or you can choose to only loop through nodes or relationships.
31 | When you loop through all elements, the first item will be the start node, the second will be the first relationship, the third the node that the relationship led to and so on.
32 |
33 | [snippet,python]
34 | ----
35 | component=neo4j-python-embedded
36 | source=traversal.py
37 | tag=loopThroughPath
38 | classifier=test-sources
39 | ----
40 |
41 |
--------------------------------------------------------------------------------
/src/docs/dev/reference/core-properties.asciidoc:
--------------------------------------------------------------------------------
1 | [[python-embedded-core-properties]]
2 | == Properties ==
3 |
4 | Both nodes and relationships can have properties, so this section applies equally to both node and relationship objects.
5 | Allowed property values include strings, numbers, booleans, as well as arrays of those primitives.
6 | Within each array, all values must be of the same type.
7 |
8 | === Setting properties ===
9 |
10 | [snippet,python]
11 | ----
12 | component=neo4j-python-embedded
13 | source=core.py
14 | tag=setProperties
15 | classifier=test-sources
16 | ----
17 |
18 | === Getting properties ===
19 |
20 | [snippet,python]
21 | ----
22 | component=neo4j-python-embedded
23 | source=core.py
24 | tag=getProperties
25 | classifier=test-sources
26 | ----
27 |
28 | === Removing properties ===
29 |
30 | [snippet,python]
31 | ----
32 | component=neo4j-python-embedded
33 | source=core.py
34 | tag=deleteProperties
35 | classifier=test-sources
36 | ----
37 |
38 | === Looping through properties ===
39 |
40 | [snippet,python]
41 | ----
42 | component=neo4j-python-embedded
43 | source=core.py
44 | tag=loopProperties
45 | classifier=test-sources
46 | ----
47 |
48 |
--------------------------------------------------------------------------------
/src/docs/dev/reference/core-relationships.asciidoc:
--------------------------------------------------------------------------------
1 | [[python-embedded-core-relationships]]
2 | == Relationships ==
3 |
4 | This describes operations that are specific to relationship objects.
5 | For documentation on how to handle properties on both relationships and nodes, see <>.
6 |
7 | === Creating a relationship ===
8 |
9 | [snippet,python]
10 | ----
11 | component=neo4j-python-embedded
12 | source=core.py
13 | tag=createRelationship
14 | classifier=test-sources
15 | ----
16 |
17 | === Fetching a relationship by id ===
18 |
19 | [snippet,python]
20 | ----
21 | component=neo4j-python-embedded
22 | source=core.py
23 | tag=getRelationshipById
24 | classifier=test-sources
25 | ----
26 |
27 | === Removing a relationship ===
28 |
29 | [snippet,python]
30 | ----
31 | component=neo4j-python-embedded
32 | source=core.py
33 | tag=deleteRelationship
34 | classifier=test-sources
35 | ----
36 |
37 | TIP: See also http://docs.neo4j.org/chunked/{neo4j-version}/transactions-delete.html[Neo4j Delete Semantics].
38 |
39 | === Removing a relationship by id ===
40 |
41 | [snippet,python]
42 | ----
43 | component=neo4j-python-embedded
44 | source=core.py
45 | tag=deleteByIdRelationship
46 | classifier=test-sources
47 | ----
48 |
49 | === Relationship start node, end node and type ===
50 |
51 | [snippet,python]
52 | ----
53 | component=neo4j-python-embedded
54 | source=core.py
55 | tag=relationshipAttributes
56 | classifier=test-sources
57 | ----
58 |
59 | === Getting and/or counting all relationships ===
60 |
61 | Use this with care, it will become extremely slow in large datasets.
62 |
63 | [snippet,python]
64 | ----
65 | component=neo4j-python-embedded
66 | source=core.py
67 | tag=getAllRelationships
68 | classifier=test-sources
69 | ----
70 |
71 |
--------------------------------------------------------------------------------
/src/docs/dev/reference/core-transactions.asciidoc:
--------------------------------------------------------------------------------
1 | == Transactions ==
2 |
3 | All write operations to the database need to be performed from within transactions.
4 | This ensures that your database never ends up in an inconsistent state.
5 |
6 | See http://docs.neo4j.org/chunked/{neo4j-version}/transactions.html[Neo4j Transactions] for details on how Neo4j handles transactions.
7 |
8 | We use the python +with+ statement to define a transaction context.
9 | If you are using an older version of Python, you may have to import the +with+ statement:
10 |
11 | [source, python]
12 | ----
13 | from __future__ import with_statement
14 | ----
15 |
16 | Either way, this is how you get into a transaction:
17 |
18 | [snippet,python]
19 | ----
20 | component=neo4j-python-embedded
21 | source=core.py
22 | tag=withBasedTransactions
23 | classifier=test-sources
24 | ----
25 |
26 |
--------------------------------------------------------------------------------
/src/docs/dev/reference/core.asciidoc:
--------------------------------------------------------------------------------
1 | [[python-embedded-reference-core]]
2 | = Core API =
3 |
4 | This section describes how get get up and running, and how to do basic operations.
5 |
6 | include::core-getting-started.asciidoc[]
7 |
8 | include::core-transactions.asciidoc[]
9 |
10 | include::core-nodes.asciidoc[]
11 |
12 | include::core-relationships.asciidoc[]
13 |
14 | include::core-properties.asciidoc[]
15 |
16 | include::core-paths.asciidoc[]
17 |
18 |
--------------------------------------------------------------------------------
/src/docs/dev/reference/cypher.asciidoc:
--------------------------------------------------------------------------------
1 | [[python-embedded-reference-cypher]]
2 | = Cypher Queries =
3 |
4 | You can use the Cypher query language from neo4j-embedded.
5 | Read more about cypher syntax and cool stuff you can with it here: http://docs.neo4j.org/chunked/{neo4j-version}/cypher-query-lang.html[Cypher Reference].
6 |
7 | == Querying and reading the result ==
8 |
9 | === Basic query ===
10 |
11 | To execute a plain text cypher query, do this:
12 |
13 | [snippet,python]
14 | ----
15 | component=neo4j-python-embedded
16 | source=cypher.py
17 | tag=basicCypherQuery
18 | classifier=test-sources
19 | ----
20 |
21 | === Retrieve query result ===
22 |
23 | Cypher returns a tabular result.
24 | You can either loop through the table row-by-row, or you can loop through the values in a given column.
25 | Here is how to loop row-by-row:
26 |
27 | [snippet,python]
28 | ----
29 | component=neo4j-python-embedded
30 | source=cypher.py
31 | tag=iterateCypherResult
32 | classifier=test-sources
33 | ----
34 |
35 | Here is how to loop through the values of a given column:
36 |
37 | [snippet,python]
38 | ----
39 | component=neo4j-python-embedded
40 | source=cypher.py
41 | tag=getCypherResultColumn
42 | classifier=test-sources
43 | ----
44 |
45 | === List the result columns ===
46 |
47 | You can get a list of the column names in the result like this:
48 |
49 | [snippet,python]
50 | ----
51 | component=neo4j-python-embedded
52 | source=cypher.py
53 | tag=listCypherResultColumns
54 | classifier=test-sources
55 | ----
56 |
57 | == Parameterized and prepared queries ==
58 |
59 | === Parameterized queries ===
60 |
61 | Cypher supports parameterized queries, see http://docs.neo4j.org/chunked/{neo4j-version}/cypher-parameters.html[Cypher Parameters].
62 | This is how you use them in neo4j-embedded.
63 |
64 | [snippet,python]
65 | ----
66 | component=neo4j-python-embedded
67 | source=cypher.py
68 | tag=parameterizedCypherQuery
69 | classifier=test-sources
70 | ----
71 |
72 | === Prepared queries ===
73 |
74 | Prepared queries, where you could retrieve a pre-parsed version of a cypher query to be used later,
75 | is deprecated. Cypher will recognize if it has previously parsed a given query, and won't parse the
76 | same string twice.
77 |
78 | So, in effect, all cypher queries are prepared queries, if you use them more than once. Use parameterized
79 | queries to gain the full power of this - then a generic query can be pre-parsed, and modified with parameters
80 | each time it is executed.
81 |
82 |
--------------------------------------------------------------------------------
/src/docs/dev/reference/indexes.asciidoc:
--------------------------------------------------------------------------------
1 | [[python-embedded-reference-indexes]]
2 | = Indexes =
3 |
4 | In order to rapidly find nodes or relationship based on properties, Neo4j supports indexing.
5 | This is commonly used to find start nodes for <>.
6 |
7 | By default, the underlying index is powered by http://lucene.apache.org/java/docs/index.html[Apache Lucene], but it is also possible to use Neo4j with other index implementations.
8 |
9 | You can create an arbitrary number of named indexes.
10 | Each index handles either nodes or relationships, and each index works by indexing key/value/object triplets, object being either a node or a relationship, depending on the index type.
11 |
12 | == Index management ==
13 |
14 | Just like the rest of the API, all write operations to the index must be performed from within a transaction.
15 |
16 | === Creating an index ===
17 |
18 | Create a new index, with optional configuration.
19 |
20 | [snippet,python]
21 | ----
22 | component=neo4j-python-embedded
23 | source=index.py
24 | tag=createIndex
25 | classifier=test-sources
26 | ----
27 |
28 | === Retrieving a pre-existing index ===
29 |
30 | [snippet,python]
31 | ----
32 | component=neo4j-python-embedded
33 | source=index.py
34 | tag=getIndex
35 | classifier=test-sources
36 | ----
37 |
38 | === Deleting indexes ===
39 |
40 | [snippet,python]
41 | ----
42 | component=neo4j-python-embedded
43 | source=index.py
44 | tag=deleteIndex
45 | classifier=test-sources
46 | ----
47 |
48 | === Checking if an index exists ===
49 |
50 | [snippet,python]
51 | ----
52 | component=neo4j-python-embedded
53 | source=index.py
54 | tag=checkIfIndexExists
55 | classifier=test-sources
56 | ----
57 |
58 | == Indexing things ==
59 |
60 | === Adding nodes or relationships to an index ===
61 |
62 | [snippet,python]
63 | ----
64 | component=neo4j-python-embedded
65 | source=index.py
66 | tag=addToIndex
67 | classifier=test-sources
68 | ----
69 |
70 | === Removing indexed items ===
71 |
72 | Removing items from an index can be done at several levels of granularity.
73 | See the example below.
74 |
75 | [snippet,python]
76 | ----
77 | component=neo4j-python-embedded
78 | source=index.py
79 | tag=removeFromIndex
80 | classifier=test-sources
81 | ----
82 |
83 | == Searching the index ==
84 |
85 | You can retrieve indexed items in two ways.
86 | Either you do a direct lookup, or you perform a query.
87 | The direct lookup is the same across different index providers while the query syntax depends on what index provider you use.
88 | As mentioned previously, Lucene is the default and by far most common index provider.
89 | For querying Lucene you will want to use the http://lucene.apache.org/java/{lucene-version}/queryparsersyntax.html[Lucene query language].
90 |
91 | There is a python library for programatically generating Lucene queries, available at https://github.com/scholrly/lucene-querybuilder[GitHub].
92 |
93 | [IMPORTANT]
94 | Unless you loop through the entire index result, you have to close the result when you are done with it.
95 | If you do not, the database does not know when it can release the resources the result is taking up.
96 |
97 | === Direct lookups ===
98 |
99 | [snippet,python]
100 | ----
101 | component=neo4j-python-embedded
102 | source=index.py
103 | tag=directLookup
104 | classifier=test-sources
105 | ----
106 |
107 | === Querying ===
108 |
109 | [snippet,python]
110 | ----
111 | component=neo4j-python-embedded
112 | source=index.py
113 | tag=query
114 | classifier=test-sources
115 | ----
116 |
117 |
--------------------------------------------------------------------------------
/src/docs/dev/reference/traversal.asciidoc:
--------------------------------------------------------------------------------
1 | [[python-embedded-reference-traversal]]
2 | = Traversals =
3 |
4 | [WARNING]
5 | Traversal support in neo4j-embedded for python is _deprecated_ as of Neo4j 1.7 GA.
6 | Please see <> or the core API instead.
7 | This is done because the traversal framework requires a very tight coupling between the JVM and python.
8 | To keep improving performance, we need to break that coupling.
9 |
10 | The below documentation will be removed in neo4j-embedded 1.8, and support for traversals will be dropped in neo4j-embedded 1.9.
11 |
12 | The traversal API used here is essentially the same as the one used in the Java API, with a few modifications.
13 |
14 | Traversals start at a given node and uses a set of rules to move through the graph and to decide what parts of the graph to return.
15 |
16 | == Basic traversals ==
17 |
18 | === Following a relationship ===
19 |
20 | The most basic traversals simply follow certain relationship types, and return everything they encounter.
21 | By default, each node is visited only once, so there is no risk of infinite loops.
22 |
23 | [snippet,python]
24 | ----
25 | component=neo4j-python-embedded
26 | source=traversal.py
27 | tag=basicTraversal
28 | classifier=test-sources
29 | ----
30 |
31 | === Following a relationship in a specific direction ===
32 |
33 | You can tell the traverser to only follow relationships in some specific direction.
34 |
35 | [snippet,python]
36 | ----
37 | component=neo4j-python-embedded
38 | source=traversal.py
39 | tag=directedTraversal
40 | classifier=test-sources
41 | ----
42 |
43 | === Following multiple relationship types ===
44 |
45 | You can specify an arbitrary number of relationship types and directions to follow.
46 |
47 | [snippet,python]
48 | ----
49 | component=neo4j-python-embedded
50 | source=traversal.py
51 | tag=multiRelationshipTraversal
52 | classifier=test-sources
53 | ----
54 |
55 | == Traversal results ==
56 |
57 | A traversal can give you one of three different result types: <>, <> or <>.
58 |
59 | Traversals are performed lazily, which means that the graph is traversed as you loop through the result.
60 |
61 | [snippet,python]
62 | ----
63 | component=neo4j-python-embedded
64 | source=traversal.py
65 | tag=traversalResults
66 | classifier=test-sources
67 | ----
68 |
69 | == Uniqueness ==
70 |
71 | To avoid infinite loops, it's important to define what parts of the graph can be re-visited during a traversal.
72 | By default, uniqueness is set to +NODE_GLOBAL+, which means that each node is only visited once.
73 |
74 | Here are the other options that are available.
75 |
76 | [snippet,python]
77 | ----
78 | component=neo4j-python-embedded
79 | source=traversal.py
80 | tag=uniqueness
81 | classifier=test-sources
82 | ----
83 |
84 | == Ordering ==
85 |
86 | You can traverse either depth first, or breadth first. Depth first is the default, because it has lower memory overhead.
87 |
88 | [snippet,python]
89 | ----
90 | component=neo4j-python-embedded
91 | source=traversal.py
92 | tag=ordering
93 | classifier=test-sources
94 | ----
95 |
96 | == Evaluators - advanced filtering ==
97 |
98 | In order to traverse based on other critera, such as node properties, or more complex things like neighboring nodes or patterns, we use evaluators.
99 | An evaluator is a normal Python method that takes a path as an argument, and returns a description of what to do next.
100 |
101 | The path argument is the current position the traverser is at, and the description of what to do can be one of four things, as seen in the example below.
102 |
103 | [snippet,python]
104 | ----
105 | component=neo4j-python-embedded
106 | source=traversal.py
107 | tag=evaluators
108 | classifier=test-sources
109 | ----
110 |
111 |
--------------------------------------------------------------------------------
/src/docs/dev/tutorial.asciidoc:
--------------------------------------------------------------------------------
1 | [[python-embedded-tutorial]]
2 | = Tutorials =
3 |
4 | This describes how to get started with Neo4j embedded in python.
5 | See <> for the full reference documentation.
6 |
7 | You have to have installed the neo4j-embedded python library to try these examples, see <>.
8 |
9 | :leveloffset: 2
10 |
11 | include::tutorial/helloworld.asciidoc[]
12 |
13 | include::tutorial/invoiceapp.asciidoc[]
14 |
--------------------------------------------------------------------------------
/src/docs/dev/tutorial/helloworld.asciidoc:
--------------------------------------------------------------------------------
1 | [[python-embedded-tutorial-helloworld]]
2 | = Hello, world! =
3 |
4 | Here is a simple example to get you started.
5 |
6 | [snippet,python]
7 | ----
8 | component=neo4j-python-embedded
9 | source=examples.py
10 | tag=helloworld
11 | classifier=test-sources
12 | ----
13 |
14 |
--------------------------------------------------------------------------------
/src/docs/dev/tutorial/index.asciidoc:
--------------------------------------------------------------------------------
1 | [[tutorials-python-embedded]]
2 | = Using Neo4j embedded in Python applications =
3 |
4 | For instructions on how to install the Python Neo4j driver, see <>.
5 |
6 | For general information on the Python language binding, see <>.
7 |
8 | :leveloffset: 2
9 |
10 | include::helloworld.asciidoc[]
11 |
12 | :leveloffset: 2
13 |
14 | include::invoiceapp.asciidoc[]
15 |
16 |
17 |
--------------------------------------------------------------------------------
/src/docs/dev/tutorial/invoiceapp.asciidoc:
--------------------------------------------------------------------------------
1 | [[python-embedded-tutorial-invoiceapp]]
2 | = A sample app using cypher and indexes =
3 |
4 | For detailed documentation on the concepts used here, see <> and <>.
5 |
6 | This example shows you how to get started building something like a simple invoice tracking application with Neo4j.
7 |
8 | We start out by importing Neo4j, and creating some meta data that we will use to organize our actual data with.
9 |
10 | [snippet,python]
11 | ----
12 | component=neo4j-python-embedded
13 | source=examples.py
14 | tag=invoiceapp-setup
15 | classifier=test-sources
16 | ----
17 |
18 | == Domain logic ==
19 |
20 | Then we define some domain logic that we want our application to be able to perform. Our application has two domain objects, Customers and Invoices. Let's create methods to add new customers and invoices.
21 |
22 | [snippet,python]
23 | ----
24 | component=neo4j-python-embedded
25 | source=examples.py
26 | tag=invoiceapp-domainlogic-create
27 | classifier=test-sources
28 | ----
29 |
30 | In the customer case, we create a new node to represent the customer and connect it to the _customers node_. This helps us find customers later on, as well as determine if a given node is a customer.
31 |
32 | We also index the name of the customer, to allow for quickly finding customers by name.
33 |
34 | In the invoice case, we do the same, except no indexing. We also connect each new invoice to the customer it was sent to, using a relationship of type +SENT_TO+.
35 |
36 | Next, we want to be able to retrieve customers and invoices that we have added. Because we are indexing customer names, finding them is quite simple.
37 |
38 | [snippet,python]
39 | ----
40 | component=neo4j-python-embedded
41 | source=examples.py
42 | tag=invoiceapp-domainlogic-get-by-idx
43 | classifier=test-sources
44 | ----
45 |
46 | Lets say we also like to do something like finding all invoices for a given customer that are above some given amount. This could be done by writing a cypher query, like this:
47 |
48 | [snippet,python]
49 | ----
50 | component=neo4j-python-embedded
51 | source=examples.py
52 | tag=invoiceapp-domainlogic-get-by-cypher
53 | classifier=test-sources
54 | ----
55 |
56 | == Creating data and getting it back ==
57 |
58 | Putting it all together, we can create customers and invoices, and use the search methods we wrote to find them.
59 |
60 | [snippet,python]
61 | ----
62 | component=neo4j-python-embedded
63 | source=examples.py
64 | tag=invoiceapp-create-and-search
65 | classifier=test-sources
66 | ----
67 |
68 |
--------------------------------------------------------------------------------
/src/docs/docinfo.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
34 |
35 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
--------------------------------------------------------------------------------
/src/docs/manual.asciidoc:
--------------------------------------------------------------------------------
1 | = Embedded Neo4j Python Bindings Documentation v{neo4j-version} =
2 |
3 | This describes _neo4j-embedded_, a Python library that lets you use the embedded Neo4j database in Python.
4 |
5 | NOTE: The version found at PyPI might not be updated. To get a fresh version, you can build it yourself.
6 |
7 | :leveloffset: 1
8 |
9 | include::dev/tutorial.asciidoc[]
10 |
11 | :leveloffset: 1
12 |
13 | include::dev/index.asciidoc[]
14 |
15 |
--------------------------------------------------------------------------------
/src/main/assembly/python-distribution.xml:
--------------------------------------------------------------------------------
1 |
22 |
23 | python-dist
24 | neo4j-embedded
25 |
26 | zip
27 |
28 |
29 |
30 |
31 | **/*.py
32 | README*
33 |
34 |
35 |
38 | setup.py
39 | README.txt
40 | neo4j/__init__.py
41 |
42 | /
43 | src/main/python
44 |
45 |
46 | true
47 |
48 | neo4j/__init__.py
49 | setup.py
50 | README.txt
51 |
52 | /
53 | src/main/python
54 |
55 |
56 |
57 | **/*.py
58 |
59 | src/test/python
60 | /tests
61 |
62 |
63 |
64 | LICENSE*
65 | NOTICE*
66 |
67 |
68 |
69 |
70 |
71 | /neo4j/javalib
72 |
73 |
74 |
75 |
--------------------------------------------------------------------------------
/src/main/java/org/neo4j/cypher/pycompat/ExecutionEngine.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2002-2013 "Neo Technology,"
3 | * Network Engine for Objects in Lund AB [http://neotechnology.com]
4 | *
5 | * This file is part of Neo4j.
6 | *
7 | * Neo4j is free software: you can redistribute it and/or modify
8 | * it under the terms of the GNU General Public License as published by
9 | * the Free Software Foundation, either version 3 of the License, or
10 | * (at your option) any later version.
11 | *
12 | * This program is distributed in the hope that it will be useful,
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | * GNU General Public License for more details.
16 | *
17 | * You should have received a copy of the GNU General Public License
18 | * along with this program. If not, see .
19 | */
20 | package org.neo4j.cypher.pycompat;
21 |
22 | import java.util.Map;
23 |
24 | import org.neo4j.cypher.SyntaxException;
25 | import org.neo4j.graphdb.GraphDatabaseService;
26 | import org.neo4j.kernel.impl.util.StringLogger;
27 |
28 | /**
29 | * A special execution engine for JPype, hiding scala
30 | * classes deeper down in the result set.
31 | */
32 | public class ExecutionEngine
33 | {
34 |
35 | private org.neo4j.cypher.ExecutionEngine inner;
36 |
37 | /**
38 | * Creates an execution engine around the give graph database
39 | * @param database The database to wrap
40 | */
41 | public ExecutionEngine( GraphDatabaseService database )
42 | {
43 | inner = new org.neo4j.cypher.ExecutionEngine( database, StringLogger.DEV_NULL );
44 | }
45 |
46 | /**
47 | * Executes a query and returns an iterable that contains the result set
48 | * @param query The query to execute
49 | * @return A ExecutionResult that contains the result set
50 | * @throws org.neo4j.cypher.SyntaxException If the Query contains errors,
51 | * a SyntaxException exception might be thrown
52 | */
53 | public ExecutionResult execute( String query ) throws SyntaxException
54 | {
55 | return new ExecutionResult(inner.execute( query ));
56 | }
57 |
58 | /**
59 | * Executes a {@link org.neo4j.cypher.internal.commands.Query} and returns an iterable that contains the result set
60 | * @param query The query to execute
61 | * @param params Parameters for the query
62 | * @return A ExecutionResult that contains the result set
63 | * @throws org.neo4j.cypher.SyntaxException If the Query contains errors,
64 | * a SyntaxException exception might be thrown
65 | */
66 | public ExecutionResult execute( String query, Map params) throws SyntaxException
67 | {
68 | return new ExecutionResult(inner.execute(query, params));
69 | }
70 |
71 | }
72 |
--------------------------------------------------------------------------------
/src/main/java/org/neo4j/cypher/pycompat/ExecutionResult.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2002-2013 "Neo Technology,"
3 | * Network Engine for Objects in Lund AB [http://neotechnology.com]
4 | *
5 | * This file is part of Neo4j.
6 | *
7 | * Neo4j is free software: you can redistribute it and/or modify
8 | * it under the terms of the GNU General Public License as published by
9 | * the Free Software Foundation, either version 3 of the License, or
10 | * (at your option) any later version.
11 | *
12 | * This program is distributed in the hope that it will be useful,
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | * GNU General Public License for more details.
16 | *
17 | * You should have received a copy of the GNU General Public License
18 | * along with this program. If not, see .
19 | */
20 | package org.neo4j.cypher.pycompat;
21 |
22 | import java.io.PrintWriter;
23 | import java.util.Iterator;
24 | import java.util.List;
25 | import java.util.Map;
26 |
27 | public class ExecutionResult implements Iterable