neo4j-documentation's Issues
String passed to `newEmbeddedDatabase` in example and JavaDoc
The embedded tutorial and the GraphDatabaseService
JavaDoc both claim that GraphDatabaseFactory.newEmbeddedDatabase()
accepts a path, but it seems to expect a File
.
graphDb = new GraphDatabaseFactory().newEmbeddedDatabase( DB_PATH );
registerShutdownHook( graphDb );
DB_PATH
is indeed updated to File
in the source, but the JavaDoc linked above actually uses a string literal:
GraphDatabaseService graphDb = new GraphDatabaseFactory().newEmbeddedDatabase( "var/graphDb" );
/ ... use Neo4j
raphDb.shutdown();
suggestion, add list of known Cypher parsers at https://neo4j.com/docs/cypher-manual/current/ and merge documentation
showing a brief list of known parser is very useful for user to test.
be it a web service by neo4j or third party or neo4j official cli parser.Its will help newbie to try out.
merging.
https://neo4j.com/docs/cypher-manual/current/syntax/
https://neo4j.com/docs/cypher-refcard/current/
or maybe change>
Cypher syntax basics
to
Cypher Quick Cheat sheet
UNWIND formatting is missing whitespaces
I noticed some minor formatting irregularities:
UNWIND[1,2,3] AS x
RETURN x
- There is a space missing between
UNWIND
and[1,2,3]
.
WITH [1,1,2,2] AS coll UNWIND coll AS x
WITH DISTINCT x
RETURN collect(x) AS SET
- There is a newline missing before
UNWIND
.
I cloned the repository and tried to fix the queries in UnwindTest.scala
, but it seems that the Cypher code snippets are autoformatted and the issue is caused by the formatter.
Can you please give me a pointer to where the formatting happens?
Issue while connecting NEO4J to JASPERSOFT
I am trying to connect NEO4J to JASPER SOFT. I referred below link for connection process.
http://neo4j-contrib.github.io/neo4j-jdbc/#_jdbc_compatibility
STEP 1 "Creating new Data Adapters" is successful and Database is successfully connected to JDBC.
But in STEP 2 "Retrieve Columns from Database" , i am facing an issue while fetching data from NEO4J database which is a part of creating JASPER report.
I am getting an error like "GETTING METADATA FOR NEO4J.....PLEASE WAIT...".
I am not sure whether this issue is regarding driver problem or URL problem.
Please provide me a solution for this.
property-container input is deprecated
According to the documentation, the keys()
and the id()
functions expect a property-container
as their inputs, while the properties()
function expects an expression
, which is "an expression that returns a node, a relationship, or a map".
Of these, only the latter is precise - both keys()
and properties()
accept expressions as their inputs (tested with 3.0.7 and 3.1.1).
Using this dataset,
CREATE ()-[r:REL {name: "x", value: 1}]->()
running this query,
MATCH ()-[r*]->()
RETURN properties(r[0]), keys(r[0]), id(r[0])
results in:
╒════════════════════════╤════════════════╤══════════╕
│"properties(r[0])" │"keys(r[0])" │"id(r[0])"│
╞════════════════════════╪════════════════╪══════════╡
│{"name":"x","value":"1"}│["name","value"]│"85" │
└────────────────────────┴────────────────┴──────────┘
I think the property-container
input (used in the documentation) is no longer valid - all of these functions allow the user to specify an expression returning the appropriate elements (nodes/relationships and for the property()
function, maps).
Docker documentation listing non-existing environment variables
Hey,
the operations manual for Docker installation section 2.5.3 mentions the environment variables NEO4J_CACHE_MEMORY
and NEO4J_HEAP_MEMORY
(as used in Neo4j 2.3) which have since been replaced.
Could you update that part of the operations manual please?
Heavy CPU usage of Documentation Website
I'm not exactly sure where to report this, so I apologize if this is the wrong place to do so.
When working w/ Neo4j, I usually keep a Neo4j documentation tab open in my (Chrome) browser. Quite frequently I will notice my laptop's fans going crazy, and check Chrome's Task Manager.
9 times out of 10 it's the the Neo4j documentation page, consuming 100% CPU. It doesn't appear to matter which doc page I'm on, or how much I've interacted w/ the page. Over time it's pretty much guaranteed to eventually consume the entirety of CPU resources available.
In general I love working w/ Neo4j, but this isn't the most pleasant part.
The import org.neo4j.dbms.api.DatabaseManagementServiceBuilder cannot be resolved
The class DatabaseManagementServiceBuilder seems missing from neo4j 5.
Is there any alternative way like DatabaseManagementServiceImpl ? any example?
Query example error
In "3.2.5.2. General operators", the query example for DISTINCT is shown as:
CREATE (a:Person { name: 'Anne', eyeColor: 'blue' }),(b:Person { name: 'Bill', eyeColor: 'brown' }),(c:Person { name: 'Carol', eyeColor: 'blue' })
WITH a, b, c
MATCH (p:Person)
RETURN DISTINCT p.eyeColor
Basically, the "WITH" operator isn't doing anything here and if there are other Person nodes in the database the result set is not what is expected. The query should be:
CREATE (a:Person { name: 'Anne', eyeColor: 'blue' }),(b:Person { name: 'Bill', eyeColor: 'red' }),(c:Person { name: 'Carol', eyeColor: 'blue' })
WITH [a, b, c] AS ps
UNWIND ps AS p
RETURN DISTINCT p.eyeColor
Minor auto-correct issues and typos
I have come across a few minor typos in the documentation.
- In "3.2.2.1. Expressions in general", "myFancyVariable, A name with weird stuff in it[]!" should have a box around the two together, not a box around each.
- In "3.2.2.1. Expressions in general", the path pattern "(a)-→()←-(b)" has what looks like auto-corrected arrows rather than "-->" and "<--".
- In "3.2.5.1. Operators at a glance", the "<=" operator has been auto-corrected to "⇐".
CREATE ALIAS in deprecation should be IF NOT EXIST
Java embedded graph visualization in Neo4j community 4.1.1
Product version: Neo4j community 4.1.1
Language: Java
Operating system: Linux
Hi all ! I trying to visualize a java embedded graph, generated with your code.
There is the code to generate the database "new.db":
/*
* Licensed to Neo4j under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Neo4j licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
import java.io.File;
import java.io.IOException;
import org.neo4j.dbms.api.DatabaseManagementService;
import org.neo4j.dbms.api.DatabaseManagementServiceBuilder;
import org.neo4j.graphdb.GraphDatabaseService;
import org.neo4j.graphdb.Node;
import org.neo4j.graphdb.Relationship;
import org.neo4j.graphdb.RelationshipType;
import org.neo4j.graphdb.Transaction;
public class Embedded3 {
private static final File databaseDirectory = new File(
"/home/nicolas/neo4j-community-4.1.1/data/databases/new.db");
public String greeting;
// tag::vars[]
GraphDatabaseService graphDb;
Node firstNode;
Node secondNode;
Relationship relationship;
private DatabaseManagementService managementService;
// end::vars[]
// tag::createReltype[]
private enum RelTypes implements RelationshipType {
KNOWS
}
// end::createReltype[]
public static void main(final String[] args) throws IOException {
Embedded3 hello = new Embedded3();
hello.createDb();
// hello.removeData();
hello.shutDown();
}
void createDb() throws IOException {
// tag::startDb[]
managementService = new DatabaseManagementServiceBuilder(databaseDirectory).build();
graphDb = managementService.database("neo4j");
registerShutdownHook(managementService);
try (Transaction tx = graphDb.beginTx()) {
// Database operations go here
firstNode = tx.createNode();
firstNode.setProperty("message", "Hello, ");
secondNode = tx.createNode();
secondNode.setProperty("message", "World!");
relationship = firstNode.createRelationshipTo(secondNode, RelTypes.KNOWS);
relationship.setProperty("message", "brave Neo4j ");
// end::addData[]
greeting = ((String) firstNode.getProperty("message")) + ((String) relationship.getProperty("message"))
+ ((String) secondNode.getProperty("message"));
// tag::transaction[]
tx.commit();
}
}
void shutDown() {
System.out.println();
System.out.println("Shutting down database ...");
// tag::shutdownServer[]
managementService.shutdown();
// end::shutdownServer[]
}
// tag::shutdownHook[]
private static void registerShutdownHook(final DatabaseManagementService managementService) {
// Registers a shutdown hook for the Neo4j instance so that it
// shuts down nicely when the VM exits (even if you "Ctrl-C" the
// running application).
Runtime.getRuntime().addShutdownHook(new Thread() {
@Override
public void run() {
managementService.shutdown();
}
});
}
// end::shutdownHook[]
}
After, I have changed the value of dbms.default_database
to dbms.default_database=new.db
in neo4j.conf.
When I start neo4j, the database is well implemented:
But when I run a simple query MATCH (n) return n
there is no record in the database to show.
Then I successfully created some nodes from the neo4j browser. But it's impossible to read them with my Java code, the database looks empty.
There must be an error in my code but I am really stucked right now.
Can you give me more explanation for this line please ? : graphDb = managementService.database("neo4j");
Why do I have an error if I change "neo4" with an other string ?
I double checked and "new.db" is created whereas I set graphDb = managementService.database("neo4j");
I have a DatabaseNotFoundException if not.
Thanks for your help.
Nicolas.
Procedure documentation error in Operations Manual
In the Operations Manual, in appendix A.2. Built-in procedures, the signature of the AwaitIndex()
procedure is incorrectly documented.
It currently reads:
CALL db.awaitIndex(label, property, timeout)
but that should be:
CALL db.awaitIndex(":Label(property)", timeoutSeconds)
3.5.2. Constraints - Unable to ASSERT exists(book.isbn)
I'm unable to successfully run the ASSERT exists(book.isbn)
command listed in http://neo4j.com/docs/developer-manual/current/cypher/schema/constraints/
Neo4j version: 3.1.0 community Dockerfile
Operating system: Ubuntu 16.10
API/Driver: Kubernetes/Cypher
CREATE CONSTRAINT ON (book:Book) ASSERT book.isbn IS UNIQUE
Added 1 constraint, statement completed in 111 ms.
CREATE (book:Book { isbn: '1449356265', title: 'Graph Databases' })
Added 1 label, created 1 node, set 2 properties, statement completed in 16 ms.
CREATE CONSTRAINT ON (book:Book) ASSERT exists(book.isbn)
Unable to create CONSTRAINT ON ( book:Book ) ASSERT exists(book.isbn)
Error Response Data:
{
"signature": 127,
"fields": [
{
"code": "Neo.DatabaseError.Schema.ConstraintCreationFailed",
"message": "Unable to create CONSTRAINT ON ( book:Book ) ASSERT exists(book.isbn)"
}
],
"timings": {
"type": "client"
}
}
mvn error
CSV import tool: file groups are not required to be enclosed in quotation marks
The documentation states "note how the file groups are enclosed in quotation marks in the command" but the command does not use quotation marks. In fact, quotation marks are not required for the loader to work correctly.
A potential fix would be adding quotation marks in the code or removing the note from the documentation.
Location in the source code:
Value of the list type cannot be stored as properties
The documentation(values and types) says that value of the list type
cannot be stored as properties, but this is inconsistent with my tests.
my test:
neo4j@neo4j> create (:lable{prop:[2,3,4]});
0 rows available after 39 ms, consumed after another 0 ms
Added 1 nodes, Set 1 properties, Added 1 labels
Documentation mistake
In the documentation is a small mistake:
add play command as setting in neo4j.conf
browser.post_connect_cmd=play <guide url or name>
browser.post_connect_cmd=play http://guides.neo4j.com/apoc
# or
browser.post_connect_cmd=play intro
result in a "command not found" due to a missing colon (:
). Instead it should say:
add play command as setting in neo4j.conf
browser.post_connect_cmd=:play <guide url or name>
browser.post_connect_cmd=:play http://guides.neo4j.com/apoc
# or
browser.post_connect_cmd=:play intro
Funny enough, the method via the url parameter works fine:
http://localhost:7474/browser?cmd=play&arg=northwind%20graph
Visiting this url will properly start the northwind-guide after pressing enter.
Broken link in 3.3.13. CREATE UNIQUE
The link to MERGE seems to be broken in 3.3.13. CREATE UNIQUE
I'm not familiar enough with Asciidoc to figure out why it's not working, but the problem appears to lie in this file.
Too many mandatory fields for relationships in the import tool's doc
While working on neo4j-contrib/neo4j-apoc-procedures#489, I stumbled upon an inaccuracy in the import tool's documentation. In particular, it states that there are three mandatory fields for relationships, including :TYPE
:
For relationship data sources, there are three mandatory fields:
TYPE::
The relationship type to use for the relationship.
START_ID::
The id of the start node of the relationship to create.
END_ID::
The id of the end node of the relationship to create.
However, this is not the case: the :START_ID
and :END_ID
fields are indeed mandatory, but :TYPE
is not as it can be (and usually is) specified with the --relationships:RelType filename.csv
switch.
Here are two working examples that load relationships files that do not contain the :TYPE
field:
- The Train Benchmark's Neo4j driver uses the
neo4j-admin import
command: https://github.com/FTSRG/trainbenchmark/blob/1bc29cb878d59b67d59a3367c8a96c873b75ff4b/trainbenchmark-tool-neo4j/src/main/java/hu/bme/mit/trainbenchmark/benchmark/neo4j/driver/Neo4jDriver.java#L144-L161 - The LDBC Social Network Benchmark's load script uses the
neo4j-import
command: https://github.com/ldbc/ldbc_snb_implementations/blob/e7aff8b6403db4412ce849369d0b6be9dc9d7338/cypher/load-scripts/import-to-neo4j.sh
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.