Giter Club home page Giter Club logo

neo4j-documentation's Introduction

About Neo4j documentation

This repository contains tools and tests for proving and generating documentation for Neo4j.

All docs sources are maintained in AsciiDoc format. The primary output of building the projects kept here are artifacts (JARs) containing docs sources, code examples, and some scripts and images. These are processed downstream with custom tools, Asciidoctor and XSLT to produce the library of documentation available at https://neo4j.com/docs/.

neo4j-documentation's People

Contributors

apcj avatar benbc avatar boggle avatar chrisvest avatar cleishm avatar craigtaverner avatar davidegrohmann avatar davidoliversp2 avatar digitalstain avatar henriknyman avatar jakewins avatar jexp avatar jimwebber avatar jjaderberg avatar johan-neo avatar lassewesth avatar lutovich avatar martinfurmanski avatar mats-sx avatar mishademianenko avatar nawroth avatar oskarhane avatar pontusmelke avatar rickardoberg avatar spacecowboy avatar srbaker avatar systay avatar tbaum avatar thobe avatar tinwelint avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

neo4j-documentation's Issues

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.

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.

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:

https://github.com/neo4j/neo4j-documentation/blob/a5ea8152c40fa5359278ea61a86935b2d63afc29/import-tool/src/docs/ops/import-tool.asciidoc#relationships

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:

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:
image

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.

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.

image

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

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"
  }
}

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

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)

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();

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.

image

Location in the source code:

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 "⇐".

UNWIND formatting is missing whitespaces

I noticed some minor formatting irregularities:

Unwind a list:

UNWIND[1,2,3] AS x
RETURN x
  1. There is a space missing between UNWIND and [1,2,3].

Create a distinct list:

WITH [1,1,2,2] AS coll UNWIND coll AS x
WITH DISTINCT x
RETURN collect(x) AS SET
  1. 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?

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.

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).

mvn error

I try to build this project by : mvn clean install, but I got the following error:
image
how should I solve this problem?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.