diff --git a/modules/ROOT/images/graph_list_functions.svg b/modules/ROOT/images/graph_list_functions.svg index 88b6c8672..82ad32e38 100644 --- a/modules/ROOT/images/graph_list_functions.svg +++ b/modules/ROOT/images/graph_list_functions.svg @@ -1,91 +1 @@ - - - - - - -L - - - -N0 - -Person, Developer - -name = 'Alice' -age = 38 -eyes = 'brown' - - - -N2 - -name = 'Charlie' -age = 53 -eyes = 'green' - - - -N0->N2 - - -KNOWS - - - -N1 - -name = 'Bob' -age = 25 -eyes = 'blue' - - - -N0->N1 - - -KNOWS - - - -N3 - -name = 'Daniel' -age = 54 -eyes = 'brown' - - - -N2->N3 - - -KNOWS - - - -N1->N3 - - -KNOWS - - - -N4 - -eyes = 'blue' -array = ['one', 'two', 'three'] -name = 'Eskil' -age = 41 - - - -N1->N4 - - -MARRIED - - - +KNOWSKNOWSKNOWSKNOWSMARRIEDAdministratorname:'Charlie'age:53eyes:'Green'Administratorname:'Bob'age:25eyes:'Blue'Developername:'Alice'age:38eyes:'Brown'Administratorname:'Daniel'age:53eyes:'Brown'Designername:'Eskil'age:41eyes:'Blue'likedColors:['Pink', 'Yellow', 'Black'] \ No newline at end of file diff --git a/modules/ROOT/images/graph_numeric_functions.svg b/modules/ROOT/images/graph_numeric_functions.svg index 78b904b14..82ad32e38 100644 --- a/modules/ROOT/images/graph_numeric_functions.svg +++ b/modules/ROOT/images/graph_numeric_functions.svg @@ -1,99 +1 @@ - - - - - - -L - - - -N0 - -A - -name = 'Alice' -age = 38 -eyes = 'brown' - - - -N2 - -C - -name = 'Charlie' -age = 53 -eyes = 'green' - - - -N0->N2 - - -KNOWS - - - -N1 - -B - -name = 'Bob' -age = 25 -eyes = 'blue' - - - -N0->N1 - - -KNOWS - - - -N3 - -D - -name = 'Daniel' -age = 54 -eyes = 'brown' - - - -N2->N3 - - -KNOWS - - - -N1->N3 - - -KNOWS - - - -N4 - -E - -eyes = 'blue' -array = ['one', 'two', 'three'] -name = 'Eskil' -age = 41 - - - -N1->N4 - - -MARRIED - - - +KNOWSKNOWSKNOWSKNOWSMARRIEDAdministratorname:'Charlie'age:53eyes:'Green'Administratorname:'Bob'age:25eyes:'Blue'Developername:'Alice'age:38eyes:'Brown'Administratorname:'Daniel'age:53eyes:'Brown'Designername:'Eskil'age:41eyes:'Blue'likedColors:['Pink', 'Yellow', 'Black'] \ No newline at end of file diff --git a/modules/ROOT/images/graph_scalar_functions.svg b/modules/ROOT/images/graph_scalar_functions.svg index 549084a40..82ad32e38 100644 --- a/modules/ROOT/images/graph_scalar_functions.svg +++ b/modules/ROOT/images/graph_scalar_functions.svg @@ -1,91 +1 @@ - - - - - - -L - - - -N0 - -Developer - -name = 'Alice' -age = 38 -eyes = 'brown' - - - -N2 - -name = 'Charlie' -age = 53 -eyes = 'green' - - - -N0->N2 - - -KNOWS - - - -N1 - -name = 'Bob' -age = 25 -eyes = 'blue' - - - -N0->N1 - - -KNOWS - - - -N3 - -name = 'Daniel' -age = 54 -eyes = 'brown' - - - -N2->N3 - - -KNOWS - - - -N1->N3 - - -KNOWS - - - -N4 - -eyes = 'blue' -liked_colors = ['pink', 'yellow', 'black'] -name = 'Eskil' -age = 41 - - - -N1->N4 - - -MARRIED - - - +KNOWSKNOWSKNOWSKNOWSMARRIEDAdministratorname:'Charlie'age:53eyes:'Green'Administratorname:'Bob'age:25eyes:'Blue'Developername:'Alice'age:38eyes:'Brown'Administratorname:'Daniel'age:53eyes:'Brown'Designername:'Eskil'age:41eyes:'Blue'likedColors:['Pink', 'Yellow', 'Black'] \ No newline at end of file diff --git a/modules/ROOT/images/graph_spatial_functions.svg b/modules/ROOT/images/graph_spatial_functions.svg index b9d6b4db3..180186928 100644 --- a/modules/ROOT/images/graph_spatial_functions.svg +++ b/modules/ROOT/images/graph_spatial_functions.svg @@ -1,40 +1 @@ - - - - - - -L - - - -N0 - -TrainStation - -latitude = 55.672874 -longitude = 12.56459 -city = 'Copenhagen' - - - -N1 - -Office - -latitude = 55.611784 -longitude = 12.994341 -city = 'Malmo' - - - -N0->N1 - - -TRAVEL_ROUTE - - - +TRAVEL_ROUTETrainStationlatitude:55.672874longitude:12.564590city:'Copenhagen'Officelatitude:55.611784longitude:12.994341city:'Malmö' \ No newline at end of file diff --git a/modules/ROOT/pages/functions/aggregating.adoc b/modules/ROOT/pages/functions/aggregating.adoc index 238404787..2976c3666 100644 --- a/modules/ROOT/pages/functions/aggregating.adoc +++ b/modules/ROOT/pages/functions/aggregating.adoc @@ -17,7 +17,7 @@ To learn more about how Cypher handles aggregations performed on zero rows, refe The following graph is used for the examples below: -image::graph_aggregating_functions.svg[] +image::graph_aggregating_functions.svg[role="middle", width="700"] To recreate the graph, run the following query against an empty Neo4j database: diff --git a/modules/ROOT/pages/functions/list.adoc b/modules/ROOT/pages/functions/list.adoc index 2c16b1298..1ff0cd547 100644 --- a/modules/ROOT/pages/functions/list.adoc +++ b/modules/ROOT/pages/functions/list.adoc @@ -8,22 +8,23 @@ List functions return lists of different data entities. Further details and examples of lists may be found in xref::values-and-types/lists.adoc[Lists] and xref::syntax/operators.adoc#query-operators-list[List operators]. +[[example-graph]] == Example graph The following graph is used for the examples below: -image:graph_list_functions.svg[] +image::graph_list_functions.svg[role="middle", width="700"] -To recreate the graph, run the following query in an empty Neo4j database: +To recreate the graph, run the following query against an empty Neo4j database: [source, cypher, role=test-setup] ---- CREATE - (alice:Person:Developer {name:'Alice', age: 38, eyes: 'brown'}), - (bob {name: 'Bob', age: 25, eyes: 'blue'}), - (charlie {name: 'Charlie', age: 53, eyes: 'green'}), - (daniel {name: 'Daniel', age: 54, eyes: 'brown'}), - (eskil {name: 'Eskil', age: 41, eyes: 'blue', array: ['one', 'two', 'three']}), + (alice:Developer {name:'Alice', age: 38, eyes: 'Brown'}), + (bob:Administrator {name: 'Bob', age: 25, eyes: 'Blue'}), + (charlie:Administrator {name: 'Charlie', age: 53, eyes: 'Green'}), + (daniel:Adminstrator {name: 'Daniel', age: 54, eyes: 'Brown'}), + (eskil:Designer {name: 'Eskil', age: 41, eyes: 'blue', likedColors: ['Pink', 'Yellow', 'Black']}), (alice)-[:KNOWS]->(bob), (alice)-[:KNOWS]->(charlie), (bob)-[:KNOWS]->(daniel), @@ -68,7 +69,7 @@ A `LIST` containing the names of all the properties on the node bound to |=== | keys(a) -| ["eyes","name","age"] +| ["eyes", "name", "age"] 1+d|Rows: 1 |=== @@ -115,7 +116,7 @@ A `LIST` containing all the labels of the node bound to `a` is returned. |=== | labels(a) -| ["Person","Developer"] +| ["Developer"] 1+d|Rows: 1 |=== @@ -160,8 +161,8 @@ A `LIST` containing all the nodes in the path `p` is returned. [role="queryresult",options="header,footer",cols="1*` comprising all but the first element of the `array` property are returned. +The property named `likedColors` and a `LIST` comprising all but the first element of the `likedColors` property are returned. .Result [role="queryresult",options="header,footer",cols="2*(bob), (alice)-[:KNOWS]->(charlie), (bob)-[:KNOWS]->(daniel), (charlie)-[:KNOWS]->(daniel), (bob)-[:MARRIED]->(eskil) ---- -//// - [[functions-abs]] == abs() @@ -55,7 +57,8 @@ CREATE .Query [source, cypher, indent=0] ---- -MATCH (a), (e) WHERE a.name = 'Alice' AND e.name = 'Eskil' RETURN a.age, e.age, abs(a.age - e.age) +MATCH (a), (e) WHERE a.name = 'Alice' AND e.name = 'Eskil' +RETURN a.age, e.age, abs(a.age - e.age) ---- The absolute value of the age difference is returned. diff --git a/modules/ROOT/pages/functions/scalar.adoc b/modules/ROOT/pages/functions/scalar.adoc index 7a5c76fab..459102044 100644 --- a/modules/ROOT/pages/functions/scalar.adoc +++ b/modules/ROOT/pages/functions/scalar.adoc @@ -6,33 +6,29 @@ Scalar functions return a single value. -[IMPORTANT] -==== -The `length()` and `size()` functions are quite similar, and so it is important to take note of the difference. +[[example-graph]] +== Example graph -Function `length()`:: Only works for xref::functions/scalar.adoc#functions-length[paths]. -Function `size()`:: Only works for the three types: xref::functions/scalar.adoc#functions-size-of-string[`STRING` values], xref::functions/scalar.adoc#functions-size[lists], xref::functions/scalar.adoc#functions-size-of-pattern-comprehension[pattern comprehension]. -==== +The following graph is used for the examples below: -image:graph_scalar_functions.svg[] +image::graph_scalar_functions.svg[role="middle", width="700"] + +To recreate the graph, run the following query against an empty Neo4j database: -//// [source, cypher, role=test-setup] ---- CREATE - (alice:Developer {name:'Alice', age: 38, eyes: 'brown'}), - (bob {name: 'Bob', age: 25, eyes: 'blue'}), - (charlie {name: 'Charlie', age: 53, eyes: 'green'}), - (daniel {name: 'Daniel', age: 54, eyes: 'brown'}), - (eskil {name: 'Eskil', age: 41, eyes: 'blue', liked_colors: ['pink', 'yellow', 'black']}), + (alice:Developer {name:'Alice', age: 38, eyes: 'Brown'}), + (bob:Administrator {name: 'Bob', age: 25, eyes: 'Blue'}), + (charlie:Administrator {name: 'Charlie', age: 53, eyes: 'Green'}), + (daniel:Adminstrator {name: 'Daniel', age: 54, eyes: 'Brown'}), + (eskil:Designer {name: 'Eskil', age: 41, eyes: 'blue', likedColors: ['Pink', 'Yellow', 'Black']}), (alice)-[:KNOWS]->(bob), (alice)-[:KNOWS]->(charlie), (bob)-[:KNOWS]->(daniel), (charlie)-[:KNOWS]->(daniel), (bob)-[:MARRIED]->(eskil) ---- -//// - [role=label--new-5.13] [[functions-char_length]] @@ -162,7 +158,7 @@ RETURN coalesce(a.hairColor, a.eyes) |=== | coalesce(a.hairColor, a.eyes) -| "brown" +| "Brown" 1+d|Rows: 1 |=== @@ -282,8 +278,8 @@ RETURN endNode(r) [role="queryresult",options="header,footer",cols="1*(malmo) ---- @@ -88,8 +91,8 @@ A 2D `POINT` with a `longitude` of `56.7` and a `latitude` of `12.78` in the _WG [role="queryresult",options="header,footer",cols="1*+ +| p +| 1+d|Rows: 1 |===