Skip to content

Commit 6d1fe96

Browse files
committed
docs: update roadmap and value type documentation
1 parent 0cf634c commit 6d1fe96

File tree

3 files changed

+39
-26
lines changed

3 files changed

+39
-26
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,20 +18,20 @@ Data engineers can use Jayvee and its interpreter to clean and preprocess data f
1818

1919
Explore a glimpse of our upcoming features in the following list. This overview is broad and subject to evolution. We're excited to share our vision of the exciting journey ahead, and we invite you to accompany us on this adventure!
2020

21-
- ✅ Blocks and pipes
21+
- ✅ Blocks and pipes
2222
- ✅ Simple value types and constraints
2323
- ✅ Natively support table-based data
2424
- ✅ Column-based transformations
2525
- ✅ Describe blocks via builtin block types in Jayvee
2626
- ✅ Compose logic of multiple blocks via composite block types
2727
- ✅ Multi-file Jayvee to distribute programs over multiple files
2828
- ✅ Jayvee formatter
29-
- ⌛ Improve the syntax of value types (see [RFC 0014](https://github.com/jvalue/jayvee/pull/409))
29+
- ✅ Improve the syntax of value types (see [RFC 0014](https://github.com/jvalue/jayvee/pull/409))
30+
- ✅ Composite value types (with multiple fields)
3031
- ⌛ Reusable libraries (with a package manager)
3132
- ⌛ Further extractors and sinks
32-
- 🤔 Composite value types (with multiple fields)
33+
- ⌛ Valuetypes parsers (to read and write different formats)
3334
- 🤔 Natively support tree data (XML, JSON)
34-
- 🤔 Valuetypes parsers (to read and write different formats)
3535
- 🤔 Customizable invalid value handling (default value, average, median, interpolation, ...)
3636
- 🤔 VSCode Debugger
3737
- 🤔 Block types with multiple ports (e.g., for merging different data)

apps/docs/docs/user/core-concepts.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ We differentiate the following kinds of _value types_:
6767
- _Primitive value types_ can be defined by the user to model domain-specific data types and represent a single value.
6868
_Constraints_ can be added to a _primitive value types_.
6969
See [primitive value types](./value-types/primitive-value-types).
70-
- _Compound value types_: UPCOMING.
70+
- _Compound value types_: IN DEVELOPMENT.
7171

7272
```jayvee
7373
valuetype GasFillLevel {

apps/docs/docs/user/value-types/primitive-value-types.md

Lines changed: 34 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4,45 +4,58 @@ sidebar_position: 2
44

55
# Primitive Value Types
66

7-
_Primitive value types_ are based on _built-in value types_ and use a collection of _constraints_ to restrict the range of valid values.
8-
Such _constraints_ are implicitly connected via a logical `AND` relation.
9-
Note that the _constraints_ need to be applicable to the base-type of the _value type_ - indicated by the identifier after the keyword `oftype`:
7+
_Primitive value types_ are comprised of _properties_.
108

119
```jayvee
1210
valuetype GasFillLevel {
1311
property level oftype integer;
14-
constraint levelRange: GasFillLevelRange on level;
1512
}
1613
```
1714

18-
## Constraints
15+
A _Property_ is a named "part" with its own _value type_ (type cycles are
16+
forbidden). _Value types_ with multiple _properties_ are allowed in the
17+
language, but not yet supported by the interpreter.
1918

20-
_Constraints_ for _value types_ declare the validity criteria that each concrete value is checked against.
2119

22-
### Syntax 1: Expression syntax
20+
## Constraints
2321

24-
The syntax of expression-based _constraints_ uses an expression that evaluates to `true` or `false` for the given `value`. The type of the values the expression is working in is indicated ofter the keyword `on`:
22+
_Constraints_ restrict the range of valid values.
2523

2624
```jayvee
27-
constraint GasFillLevelRange on decimal:
28-
value >= 0 and value <= 100;
25+
valuetype GasFillLevel {
26+
property level oftype integer;
27+
constraint levelRange: level >= 0 and level <= 100;
28+
}
2929
```
3030

31-
Refer to the [expression documentation](../expressions.md) for further reading on expressions.
31+
A _value type_ can have zero or more _constraints_, which are implicitly
32+
connected via a logical `AND` operation.
33+
34+
_Constraints_ use an _expression_ that evaluates to `true` or `false` and can
35+
reference every _property_ of the _value type_.
36+
In the above example, `level >= 0 and level <= 100` is evaluated for each value
37+
of type `GasFillLevel`, `level` being replaced by that properties actual value.
3238

33-
### Syntax 2: Block-like syntax
39+
Refer to the [expression documentation](../expressions.md) for further reading
40+
on _expressions_.
3441

35-
The syntax of _constraints_ is similar to the syntax of _blocks_.
36-
The availability of property keys and their respective _value types_ is determined by the type of the _constraint_ - indicated by the identifier after the keyword `oftype`:
42+
### Outline definition.
43+
44+
_Constraints_ can also be defined outside of value types, allowing them to be
45+
reused.
3746

3847
```jayvee
39-
constraint GasFillLevelRange oftype RangeConstraint {
40-
lowerBound: 0;
41-
lowerBoundInclusive: true;
42-
upperBound: 100;
43-
upperBoundInclusive: true;
48+
valuetype GasFillLevel {
49+
property level oftype integer;
50+
constraint levelRange: GasFillLevelRange on level;
4451
}
52+
53+
constraint GasFillLevelRange on decimal:
54+
value >= 0 and value <= 100;
4555
```
4656

47-
Note that the type of _constraint_ also determines its applicability to _value types_.
48-
For instance, a `RangeConstraint` can only be applied to the numerical types `integer` and `decimal`.
57+
Since there are no _properties_ to reference from the _constraint_ definition,
58+
the special `value` keyword represents the tested value.
59+
Note that reusable _constraints_ need to be applied to exactly one _property_ of
60+
the _value type_ - indicated by the identifier after the keyword `on`.
61+

0 commit comments

Comments
 (0)