Skip to content

Commit

Permalink
[6zK6lL5F] Update to use new descriptions for new Cypher Types
Browse files Browse the repository at this point in the history
  • Loading branch information
gem-neo4j committed Sep 20, 2023
1 parent 8e24d7d commit df0fcda
Show file tree
Hide file tree
Showing 54 changed files with 342 additions and 340 deletions.
2 changes: 1 addition & 1 deletion core/src/main/java/apoc/agg/Graph.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
*/
public class Graph {
@UserAggregationFunction("apoc.agg.graph")
@Description("Returns all distinct nodes and relationships collected into a map with the keys `nodes` and `relationships`.")
@Description("Returns all distinct `NODE` and `RELATIONSHIP` values collected into a `MAP` with the keys `nodes` and `relationships`.")
public GraphAggregation graph() {
return new GraphAggregation();
}
Expand Down
4 changes: 2 additions & 2 deletions core/src/main/java/apoc/agg/MaxAndMinItems.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,13 @@ WITH min(born) as minBorn, collect({born:born, persons:persons}) as bornInfoList
public class MaxAndMinItems {

@UserAggregationFunction("apoc.agg.maxItems")
@Description("Returns a map {items:[], value:n} where the `value` key is the maximum value present, and `items` represent all items with the same value.")
@Description("Returns a `MAP` `{items: LIST<ANY>, value: ANY}` where the `value` key is the maximum value present, and `items` represent all items with the same value. The size of the list of items can be limited to a given max size.")
public MaxOrMinItemsFunction maxItems() {
return new MaxOrMinItemsFunction(true);
}

@UserAggregationFunction("apoc.agg.minItems")
@Description("Returns a map {items:[], value:n} where the `value` key is the minimum value present, and `items` represent all items with the same value.")
@Description("Returns a `MAP` `{items: LIST<ANY>, value: ANY}` where the `value` key is the minimum value present, and `items` represent all items with the same value. The size of the list of items can be limited to a given max size.")
public MaxOrMinItemsFunction minItems() {
return new MaxOrMinItemsFunction(false);
}
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/java/apoc/agg/Median.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
*/
public class Median {
@UserAggregationFunction("apoc.agg.median")
@Description("Returns the mathematical median for all non-null numeric values.")
@Description("Returns the mathematical median for all non-null `INTEGER` and `FLOAT` values.")
public MedianFunction median() {
return new MedianFunction();
}
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/java/apoc/agg/Product.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
*/
public class Product {
@UserAggregationFunction("apoc.agg.product")
@Description("Returns the product of all non-null numerical values in the collection.")
@Description("Returns the product of all non-null `INTEGER` and `FLOAT` values in the collection.")
public ProductFunction product() {
return new ProductFunction();
}
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/java/apoc/agg/Statistics.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
*/
public class Statistics {
@UserAggregationFunction("apoc.agg.statistics")
@Description("Returns the following statistics on the numerical values in the given collection: percentiles, min, minNonZero, max, total, mean, stdev.")
@Description("Returns the following statistics on the `INTEGER` and `FLOAT` values in the given collection: percentiles, min, minNonZero, max, total, mean, stdev.")
public StatisticsFunction statistics() {
return new StatisticsFunction();
}
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/java/apoc/algo/Cover.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public class Cover {
public Transaction tx;

@Procedure("apoc.algo.cover")
@Description("Returns all relationships between a given set of nodes.")
@Description("Returns all `RELATIONSHIP` values connecting the given set of `NODE` values.")
public Stream<RelationshipResult> cover(@Name("nodes") Object nodes) {
Set<Node> nodeSet = Util.nodeStream(tx, nodes).collect(Collectors.toSet());
return coverNodes(nodeSet).map(RelationshipResult::new);
Expand Down
12 changes: 5 additions & 7 deletions core/src/main/java/apoc/algo/PathFinding.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,7 @@ public class PathFinding {
public Transaction tx;

@Procedure("apoc.algo.aStar")
@Description("Runs the A* search algorithm to find the optimal path between two nodes, using the given " +
"relationship property name for the cost function.")
@Description("Runs the A* search algorithm to find the optimal path between two `NODE` values, using the given `RELATIONSHIP` property name for the cost function.")
public Stream<WeightedPathResult> aStar(
@Name("startNode") Node startNode,
@Name("endNode") Node endNode,
Expand All @@ -63,8 +62,7 @@ public Stream<WeightedPathResult> aStar(
}

@Procedure("apoc.algo.aStarConfig")
@Description("Runs the A* search algorithm to find the optimal path between two nodes, using the given " +
"relationship property name for the cost function.\n" +
@Description("Runs the A* search algorithm to find the optimal path between two `NODE` values, using the given `RELATIONSHIP` property name for the cost function.\n" +
"This procedure looks for weight, latitude and longitude properties in the config.")
public Stream<WeightedPathResult> aStarConfig(
@Name("startNode") Node startNode,
Expand Down Expand Up @@ -93,7 +91,7 @@ public Stream<WeightedPathResult> aStarConfig(
}

@Procedure("apoc.algo.dijkstra")
@Description("Runs Dijkstra's algorithm using the given relationship property as the cost function.")
@Description("Runs Dijkstra's algorithm using the given `RELATIONSHIP` property as the cost function.")
public Stream<WeightedPathResult> dijkstra(
@Name("startNode") Node startNode,
@Name("endNode") Node endNode,
Expand All @@ -112,8 +110,8 @@ public Stream<WeightedPathResult> dijkstra(

@NotThreadSafe
@Procedure("apoc.algo.allSimplePaths")
@Description("Runs a search algorithm to find all of the simple paths between the given relationships, " +
"up to a max depth described by maxNodes.")
@Description("Runs a search algorithm to find all of the simple paths between the given `RELATIONSHIP` values, up to a max depth described by `maxNodes`.\n" +
"The returned paths will not contain loops.")
public Stream<PathResult> allSimplePaths(
@Name("startNode") Node startNode,
@Name("endNode") Node endNode,
Expand Down
14 changes: 7 additions & 7 deletions core/src/main/java/apoc/atomic/Atomic.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public class Atomic {
* increment a property's value
*/
@Procedure(name= "apoc.atomic.add", mode = Mode.WRITE)
@Description("Sets the given property to the sum of itself and the number value.\n" +
@Description("Sets the given property to the sum of itself and the given `INTEGER` or `FLOAT` value.\n" +
"The procedure then sets the property to the returned sum.")
public Stream<AtomicResults> add(@Name("container") Object container, @Name("propertyName") String property, @Name("number") Number number, @Name(value = "retryAttempts", defaultValue = "5") Long retryAttempts) {
checkIsEntity(container);
Expand All @@ -73,7 +73,7 @@ public Stream<AtomicResults> add(@Name("container") Object container, @Name("pro
* decrement a property's value
*/
@Procedure(name = "apoc.atomic.subtract", mode = Mode.WRITE)
@Description("Sets the property of a value to itself minus the given number value.\n" +
@Description("Sets the property of a value to itself minus the given `INTEGER` or `FLOAT` value.\n" +
"The procedure then sets the property to the returned sum.")
public Stream<AtomicResults> subtract(@Name("container") Object container, @Name("propertyName") String property, @Name("number") Number number, @Name(value = "retryAttempts", defaultValue = "5") Long retryAttempts) {
checkIsEntity(container);
Expand All @@ -96,8 +96,8 @@ public Stream<AtomicResults> subtract(@Name("container") Object container, @Name
* concat a property's value
*/
@Procedure(name = "apoc.atomic.concat", mode = Mode.WRITE)
@Description("Sets the given property to the concatenation of itself and the string value.\n" +
"The procedure then sets the property to the returned string.")
@Description("Sets the given property to the concatenation of itself and the `STRING` value.\n" +
"The procedure then sets the property to the returned `STRING`.")
public Stream<AtomicResults> concat(@Name("container") Object container, @Name("propertyName") String property, @Name("string") String string, @Name(value = "retryAttempts", defaultValue = "5") Long retryAttempts) {
checkIsEntity(container);
Entity entity = Util.rebind(tx, (Entity) container);
Expand All @@ -120,7 +120,7 @@ public Stream<AtomicResults> concat(@Name("container") Object container, @Name("
* insert a value into an array property value
*/
@Procedure(name = "apoc.atomic.insert", mode = Mode.WRITE)
@Description("Inserts a value at position into the array value of a property.\n" +
@Description("Inserts a value at position into the `LIST<ANY>` value of a property.\n" +
"The procedure then sets the result back on the property.")
public Stream<AtomicResults> insert(@Name("container") Object container, @Name("propertyName") String property, @Name("position") Long position, @Name("value") Object value, @Name(value = "retryAttempts", defaultValue = "5") Long retryAttempts) {
checkIsEntity(container);
Expand Down Expand Up @@ -156,8 +156,8 @@ public Stream<AtomicResults> insert(@Name("container") Object container, @Name("
* remove a value into an array property value
*/
@Procedure(name = "apoc.atomic.remove", mode = Mode.WRITE)
@Description("Removes the element at position from the array value of a property.\n" +
"The procedure then sets the property to the resulting array value.")
@Description("Removes the element at position from the `LIST<ANY>` value of a property.\n" +
"The procedure then sets the property to the resulting `LIST<ANY>` value.")
public Stream<AtomicResults> remove(@Name("container") Object container, @Name("propertyName") String property, @Name("position") Long position, @Name(value = "retryAttempts", defaultValue = "5") Long retryAttempts) {
checkIsEntity(container);
Entity entity = Util.rebind(tx, (Entity) container);
Expand Down
Loading

0 comments on commit df0fcda

Please sign in to comment.