Misc user docs fixes.

Reviewers: buda, mislav.bradac, teon.banek, florijan

Reviewed By: buda

Differential Revision: https://phabricator.memgraph.io/D947
This commit is contained in:
Matej Ferencevic 2017-10-31 11:03:15 +01:00
parent f655725f5d
commit cfa21a2392
4 changed files with 61 additions and 76 deletions

View File

@ -30,7 +30,7 @@ types. Following is a table of supported data types.
-----------|------------
`Null` | Denotes that the property has no value. This is the same as if the property does not exist.
`String` | A character string, i.e. text.
`Boolean` | A Boolean value, either `true` or `false`.
`Boolean` | A boolean value, either `true` or `false`.
`Integer` | An integer number.
`Float` | A floating-point number, i.e. a real number.
`List` | A list containing any number of property values of any supported type. It can be used to store multiple values under a single property name.

View File

@ -7,7 +7,7 @@ install the Docker engine on the system. Instructions how to install Docker
can be found on the
[official Docker website](https://docs.docker.com/engine/installation).
Memgraph Docker image was built with Docker version `1.12` and should be
compatible with all latter versions.
compatible with all later versions.
### Docker Import
@ -124,7 +124,7 @@ All of the parameters can also be found in `/etc/memgraph/memgraph.conf`.
[^1]: Maximum number of concurrent executions on the current CPU.
To find more about how to execute queries on Memgraph please proceed to
[Quick Start](quick-start.md).
**Quick Start**.
### Cleanup

View File

@ -41,11 +41,11 @@ specifying node labels and properties. Similarly, edge types and properties
can also be specified. For example, finding each node labeled as `Person` and
with property `age` being 42, is done with the following query.
MATCH (n :Person {age: 42}) RETURN n.
MATCH (n :Person {age: 42}) RETURN n
While their friends can be found with the following.
MATCH (n :Person {age: 42}) -[:FriendOf]- (friend) RETURN friend.
MATCH (n :Person {age: 42})-[:FriendOf]-(friend) RETURN friend
There are cases when a user needs to find data which is connected by
traversing a path of connections, but the user doesn't know how many
@ -70,7 +70,6 @@ This is especially useful when matching variable length paths:
More details on how `MATCH` works can be found
[here](https://neo4j.com/docs/developer-manual/current/cypher/clauses/match/).
Note that *named paths* are not yet supported.
The `MATCH` clause can be modified by prepending the `OPTIONAL` keyword.
`OPTIONAL MATCH` clause behaves the same as a regular `MATCH`, but when it
@ -230,7 +229,7 @@ You can still use the `RETURN` clause to produce results after writing, but it
is not mandatory.
Details on which kind of data can be stored in *Memgraph* can be found in
[Storable Data Types](data-types.md) chapter.
**Storable Data Types** chapter.
#### CREATE
@ -409,22 +408,22 @@ a custom implementation, based on the edge expansion syntax.
Finding the shortest path between nodes can be done using breadth-first
expansion:
MATCH (a {id: 723})-[r:Type \*bfs..10]-(b {id : 882}) RETURN *
MATCH (a {id: 723})-[r:Type *bfs..10]-(b {id: 882}) RETURN *
The above query will find all paths of length up to 10 between nodes `a` and `b`.
The edge type and maximum path length are used in the same way like in variable
length expansion.
To find only the shortest path, simply append LIMIT 1 to the RETURN clause.
To find only the shortest path, simply append `LIMIT 1` to the `RETURN` clause.
MATCH (a {id: 723})-[r:Type \*bfs..10]-(b {id : 882}) RETURN * LIMIT 1
MATCH (a {id: 723})-[r:Type *bfs..10]-(b {id: 882}) RETURN * LIMIT 1
Breadth-fist expansion allows an arbitrary expression filter that determines
if an expansion is allowed. Following is an example in which expansion is
allowed only over edges whose `x` property is greater then `12` and nodes `y`
whose property is lesser then `3`:
MATCH (a {id: 723})-[\*bfs..10 (e, n | e.x > 12 and n.y < 3)]-() RETURN *
MATCH (a {id: 723})-[*bfs..10 (e, n | e.x > 12 and n.y < 3)]-() RETURN *
The filter is defined as a lambda function over `e` and `n`, which denote the edge
and node being expanded over in the breadth first search.
@ -510,10 +509,10 @@ Apart from comparison and concatenation operators openCypher provides special
string operators for easier matching of substrings:
Operator | Description
-----------------|------------
a STARTS WITH b | Returns true if prefix of string a is equal to string b.
a ENDS WITH b | Returns true if suffix of string a is equal to string b.
a CONTAINS b | Returns true if some substring of string a is equal to string b.
-------------------|------------
`a STARTS WITH b` | Returns true if prefix of string a is equal to string b.
`a ENDS WITH b` | Returns true if suffix of string a is equal to string b.
`a CONTAINS b` | Returns true if some substring of string a is equal to string b.
#### Parameters
@ -523,7 +522,7 @@ filtering results or similar, while the rest of the query remains the same.
Parameters allow reusing the same query, but with different parameter values.
The syntax uses the `$` symbol to designate a parameter name. We don't allow
old Cypher parameter syntax using curly brace. For example, you can parameterize
old Cypher parameter syntax using curly braces. For example, you can parameterize
filtering a node property:
MATCH (node1 {property: $propertyValue}) RETURN node1
@ -551,17 +550,17 @@ documentation.
#### CASE
Conditional expressions can be expressed in openCypher language by simple and
generic form of CASE expression. A simple form is used to compare an expression
generic form of `CASE` expression. A simple form is used to compare an expression
against multiple predicates. For the first matched predicate result of the
expression provided after the THEN keyword is returned. If no expression is
matched value following ELSE is returned is provided, or null if ELSE is not
expression provided after the `THEN` keyword is returned. If no expression is
matched value following `ELSE` is returned is provided, or `null` if `ELSE` is not
used:
MATCH (n)
RETURN CASE n.currency WHEN "DOLLAR" THEN "$" WHEN "EURO" THEN "€" ELSE "UNKNOWN" END
In generic form, you don't provided expression whose value is compared to
predicates, but you list multiple predicates and the first one that evaluates
In generic form, you don't need to provide an expression whose value is compared to
predicates, but you can list multiple predicates and the first one that evaluates
to true is matched:
MATCH (n)
@ -581,7 +580,7 @@ keywords (WHERE, MATCH, COUNT, SUM...).
#### Unicode Codepoints in String Literal
Use `\u` followed by 4 hex digits in string literal for UTF-16 codepoint and
'\U' with 8 hex digits for UTF-32 codepoint in Memgraph.
`\U` with 8 hex digits for UTF-32 codepoint in Memgraph.
### Difference from Neo4j's Cypher Implementation
@ -593,28 +592,20 @@ here (especially subtle semantic ones).
#### Unsupported Constructs
Data importing. Memgraph doesn't support Cypher's CSV importing capabilities.
The `UNION` keyword for merging query results.
The `FOREACH` language construct for performing an operation on every list element.
The `CALL` construct for a standalone function call. This can be expressed using
* Data importing. Memgraph doesn't support Cypher's CSV importing capabilities.
* The `UNION` keyword for merging query results.
* The `FOREACH` language construct for performing an operation on every list element.
* The `CALL` construct for a standalone function call. This can be expressed using
`RETURN functioncall()`. For example, with Memgraph you can get information about
the indexes present in the database using the `RETURN indexinfo()` openCypher query.
Stored procedures.
Regular expressions for string matching.
`shortestPath` and `allShortestPaths` functions. `shortestPath` can be expressed using
* Stored procedures.
* Regular expressions for string matching.
* `shortestPath` and `allShortestPaths` functions. `shortestPath` can be expressed using
Memgraph's breadth-first expansion syntax already described in this document.
Patterns in expressions. For example, Memgraph doesn't support `size((n)-->())`. Most of the time
* Patterns in expressions. For example, Memgraph doesn't support `size((n)-->())`. Most of the time
the same functionalities can be expressed differently in Memgraph using `OPTIONAL` expansions,
function calls etc.
Map projections such as `MATCH (n) RETURN n {.property1, .property2}`.
* Map projections such as `MATCH (n) RETURN n {.property1, .property2}`.
#### Unsupported Functions

View File

@ -10,6 +10,14 @@ Memgraph supports the openCypher query language which has been developed by
vendor-independent standardization process. It's a declarative language
developed specifically for interaction with graph databases.
### Multiple-Query Transactions
Memgraph supports transactions containing multiple queries. In other words,
one can set an explicit transaction start and stop. All of the queries inside
will be executed as a single transaction. This means that if a single query
execution fails, all of the executed queries will be reverted and the
transaction aborted.
### Bolt
Clients connect to Memgraph using the
@ -46,9 +54,9 @@ neo4j-client bolt://<IP_ADDRESS>:<PORT> --insecure --user u --pass p
Where `<IP_ADDRESS>` and `<PORT>` should be replaced with the network location
where Memgraph is reachable. The `--insecure` option specifies that SLL should
be disabled (Memgraph alpha does not support SSL). `--user` and `--pass`
parameter values are ignored by Memgraph (alpha is single-user), but need to
be provided for the client to connect automatically.
be disabled (Memgraph currently does not support SSL). `--user` and `--pass`
parameter values are ignored by Memgraph (currently the database is
single-user), but need to be provided for the client to connect automatically.
After the client has started it should present a command prompt similar to:
@ -217,23 +225,9 @@ run_query("MATCH (n) DETACH DELETE n", function (result) {
### Limitations
Memgraph is currently in alpha stage, and has a number of limitations we plan
Memgraph is currently in early stage, and has a number of limitations we plan
to remove in future versions.
#### Single query length
The maximum length of a query that can be sent from a driver in Python is
`16378` characters, from a driver in Java `8184` and from a driver in
JavaScript `1392` characters.
#### Multiple-Query Transactions
Even though Memgraph is a transactional database engine, transactions
containing multiple queries are not yet supported. In other words, explicit
transaction start and stop aren't yet supported. A transaction is created and
committed implicitly for each executed query. If query execution fails, the
transaction is aborted.
#### Multiple Users & Authorization
Memgraph is currently single-user only. There is no way to control user
@ -248,7 +242,7 @@ Memgraph processes.
#### Secure Sockets Layer (SSL)
Secure connections are not supported in alpha. For this reason each client
Secure connections are not supported. For this reason each client
driver needs to be configured not to use encryption. Consult driver-specific
guides for details.