Skip to content

Commit

Permalink
fix type helpers and typos
Browse files Browse the repository at this point in the history
  • Loading branch information
cn337131 committed Nov 5, 2024
1 parent 0040521 commit e03cb9a
Show file tree
Hide file tree
Showing 9 changed files with 1,437 additions and 1,377 deletions.
24 changes: 18 additions & 6 deletions docs/administration-guide/delete-elements.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,14 @@ Operation Chain. This will take as its input the output of any operations run pr
g.OperationChain(
operations=[
g.GetElements(
input = [g.EdgeSeed(source="John", destination="2", directedType="Either")]
view = g.ElementDefinition(group = "created")
input = [g.EdgeSeed(source="John", destination="2", directedType="Either")],
view = g.View(
edges=[
g.ElementDefinition(
group="created"
)
]
)
),
g.DeleteElements()
]
Expand Down Expand Up @@ -159,8 +165,8 @@ querying for that entity with no filters.
Entity[vertex="2",group="software"]
```

If a user wishes to remove an entity but leave any associated, this is done by
querying for that entity with a filter.
If a user wishes to remove an entity but leave any edges associated with the entity's vertex,
this is done by querying for that entity with a filter.

!!! example ""
If a user gets the John entity in a query but uses a `View` that filters for just entities, then the
Expand Down Expand Up @@ -208,8 +214,14 @@ querying for that entity with a filter.
g.OperationChain(
operations=[
g.GetElements(
input = [g.EdgeSeed(source="John", destination="2", directedType="Either")]
view = g.ElementDefinition(group = "person")
input=[g.EntitySeed(vertex="John")],
view=g.View(
entities=[
g.ElementDefinition(
group="person"
)
]
)
),
g.DeleteElements()
]
Expand Down
4 changes: 2 additions & 2 deletions docs/administration-guide/named-views.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ graph LR
g.PredicateContext(
selection = ['weight'],
predicate = g.IsMoreThan(
value = {'java.lang.Float': 0.4},
value = g.float_(0.4),
or_equal_to = False
)
)
Expand Down Expand Up @@ -158,7 +158,7 @@ graph LR
=== "Python"

```python
g_connector.execute_operation(
gc.execute_operation(
operation = g.GetElements(
input = [g.EntitySeed(vertex = "John")]
view = g.View(
Expand Down
102 changes: 77 additions & 25 deletions docs/reference/binary-operators-guide/koryphe-operators.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,13 @@ Input type: `java.lang.Boolean`
"class" : "uk.gov.gchq.koryphe.impl.binaryoperator.And"
}
```


=== "Python"

``` python
g.bop.And()
```

Example inputs:

Input Type | Inputs | Result Type | Results
Expand All @@ -34,7 +40,7 @@ Input type: `java.lang.Boolean`
java.lang.Boolean | false and null | java.lang.Boolean | false
java.lang.Boolean | true and null | java.lang.Boolean | true
| null and null | | null

## Or

Applies the logical OR operation to 2 booleans. [Javadoc](https://gchq.github.io/koryphe/uk/gov/gchq/koryphe/impl/binaryoperator/Or.html)
Expand All @@ -56,7 +62,13 @@ Input type: `java.lang.Boolean`
"class" : "uk.gov.gchq.koryphe.impl.binaryoperator.Or"
}
```


=== "Python"

``` python
g.bop.Or()
```

Example inputs:

Input Type | Inputs | Result Type | Results
Expand All @@ -70,7 +82,7 @@ Input type: `java.lang.Boolean`
java.lang.String | test and 3 | | ClassCastException: java.lang.String cannot be cast to java.lang.Boolean
java.lang.Integer | 0 and 0 | | ClassCastException: java.lang.Integer cannot be cast to java.lang.Boolean
java.lang.Integer | 1 and 0 | | ClassCastException: java.lang.Integer cannot be cast to java.lang.Boolean

## First

Returns the first non-null value. [Javadoc](https://gchq.github.io/koryphe/uk/gov/gchq/koryphe/impl/binaryoperator/First.html)
Expand All @@ -92,7 +104,13 @@ Input type: `java.lang.Object`
"class" : "uk.gov.gchq.koryphe.impl.binaryoperator.First"
}
```


=== "Python"

``` python
g.First()
```

Example inputs:

Input Type | Inputs | Result Type | Results
Expand All @@ -101,7 +119,7 @@ Input type: `java.lang.Object`
java.lang.String | first and null | java.lang.String | first
| null and second | java.lang.String | second
| null and null | | null

## Min

Returns the min value. [Javadoc](https://gchq.github.io/koryphe/uk/gov/gchq/koryphe/impl/binaryoperator/Min.html)
Expand Down Expand Up @@ -129,15 +147,15 @@ Input type: `java.lang.Comparable`
``` python
g.Min()
```

Example inputs:

Input Type | Inputs | Result Type | Results
---------- | ------ | ----------- | -------
java.lang.Integer | 5 and 6 | java.lang.Integer | 5
java.lang.String | inputString and anotherInputString | java.lang.String | anotherInputString
| null and 1 | java.lang.Integer | 1

## Max

Returns the max value. [Javadoc](https://gchq.github.io/koryphe/uk/gov/gchq/koryphe/impl/binaryoperator/Max.html)
Expand Down Expand Up @@ -165,15 +183,15 @@ Input type: `java.lang.Comparable`
``` python
g.Max()
```

Example inputs:

Input Type | Inputs | Result Type | Results
---------- | ------ | ----------- | -------
java.lang.Integer | 5 and 6 | java.lang.Integer | 6
java.lang.String | inputString and anotherInputString | java.lang.String | inputString
| null and 1 | java.lang.Integer | 1

## Product

Calculates the product of 2 numbers. [Javadoc](https://gchq.github.io/koryphe/uk/gov/gchq/koryphe/impl/binaryoperator/Product.html)
Expand All @@ -195,7 +213,13 @@ Input type: `java.lang.Number`
"class" : "uk.gov.gchq.koryphe.impl.binaryoperator.Product"
}
```


=== "Python"

``` python
g.Product()
```

Example inputs:

Input Type | Inputs | Result Type | Results
Expand All @@ -207,7 +231,7 @@ Input type: `java.lang.Number`
java.lang.Short | 500 and 500 | java.lang.Short | 32767
java.lang.Integer | -5 and 5 | java.lang.Integer | -25
java.lang.Long | 20 and null | java.lang.Long | 20

## Sum

Calculates the sum of 2 numbers. [Javadoc](https://gchq.github.io/koryphe/uk/gov/gchq/koryphe/impl/binaryoperator/Sum.html)
Expand Down Expand Up @@ -235,7 +259,7 @@ Input type: `java.lang.Number`
``` python
g.Sum()
```

Example inputs:

Input Type | Inputs | Result Type | Results
Expand All @@ -247,7 +271,7 @@ Input type: `java.lang.Number`
java.lang.Short | 30000 and 10000 | java.lang.Short | 32767
java.lang.Integer | -5 and 5 | java.lang.Integer | 0
java.lang.Long | 20 and null | java.lang.Long | 20

## CollectionConcat

Concatenates two collections together. [Javadoc](https://gchq.github.io/koryphe/uk/gov/gchq/koryphe/impl/binaryoperator/CollectionConcat.html)
Expand Down Expand Up @@ -275,7 +299,7 @@ Input type: `java.util.Collection`
``` python
g.CollectionConcat()
```

Example inputs:

Input Type | Inputs | Result Type | Results
Expand All @@ -285,7 +309,7 @@ Input type: `java.util.Collection`
java.util.ArrayList | [] and [abc, cde] | java.util.ArrayList | [abc, cde]
java.util.ArrayList | [test1] and null | java.util.ArrayList | [test1]
java.util.HashSet | [a, b] and [b, c] | java.util.HashSet | [a, b, c]

## CollectionIntersect

Returns items common to two collections. [Javadoc](https://gchq.github.io/koryphe/uk/gov/gchq/koryphe/impl/binaryoperator/CollectionIntersect.html)
Expand Down Expand Up @@ -313,7 +337,7 @@ Input type: `java.util.Collection`
``` python
g.CollectionIntersect()
```

Example inputs:

Input Type | Inputs | Result Type | Results
Expand All @@ -323,7 +347,7 @@ Input type: `java.util.Collection`
java.util.ArrayList | [] and [abc, cde] | java.util.ArrayList | []
java.util.ArrayList | [test1] and null | java.util.ArrayList | [test1]
java.util.HashSet | [a, b] and [b, c] | java.util.HashSet | [b]

## StringConcat

Concatenates 2 strings. [Javadoc](https://gchq.github.io/koryphe/uk/gov/gchq/koryphe/impl/binaryoperator/StringConcat.html)
Expand All @@ -347,15 +371,23 @@ Input type: `java.lang.String`
"separator" : " "
}
```


=== "Python"

``` python
g.StringConcat(
separator=" "
)
```

Example inputs:

Input Type | Inputs | Result Type | Results
---------- | ------ | ----------- | -------
java.lang.String | hello and world | java.lang.String | hello world
java.lang.String | abc and null | java.lang.String | abc
| null and null | | null

??? example "Example StringConcat with default separator"

=== "Java"
Expand All @@ -372,15 +404,21 @@ Input type: `java.lang.String`
"separator" : ","
}
```


=== "Python"

``` python
g.StringConcat()
```

Example inputs:

Input Type | Inputs | Result Type | Results
---------- | ------ | ----------- | -------
java.lang.String | hello and world | java.lang.String | hello,world
java.lang.String | abc and null | java.lang.String | abc
| null and null | | null

## StringDeduplicateConcat

Concatenates 2 strings and omits duplicates. [Javadoc](https://gchq.github.io/koryphe/uk/gov/gchq/koryphe/impl/binaryoperator/StringDeduplicateConcat.html)
Expand All @@ -404,7 +442,15 @@ Input type: `type`
"separator" : " "
}
```


=== "Python"

``` python
g.StringDeduplicateConcat(
separator=" "
)
```

Example inputs:

Input Type | Inputs | Result Type | Results
Expand All @@ -413,7 +459,7 @@ Input type: `type`
java.lang.String | abc and null | java.lang.String | abc
| null and null | | null
java.lang.String | abc, and abc | java.lang.String | abc, abc

??? example "Example StringDeduplicateConcat with default separator"

=== "Java"
Expand All @@ -430,7 +476,13 @@ Input type: `type`
"separator" : ","
}
```


=== "Python"

``` python
g.StringDeduplicateConcat()
```

Example inputs:

Input Type | Inputs | Result Type | Results
Expand Down
Loading

0 comments on commit e03cb9a

Please sign in to comment.