-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
VSS profile #440
base: master
Are you sure you want to change the base?
VSS profile #440
Conversation
Signed-off-by: Erik Jaegervall <erik.jaegervall@se.bosch.com>
I think the idea is valid. source:
scope:
- "*"
mandatory: true
schema:
type: object
required:
- xpos
- ypos
properties:
xpos:
type: array
items:
type: object
properties:
a:
type: number
b:
type: number
ypos:
type: number ExplanationHaving the element name itself as a key would be fine for me.
|
I want to suggest to take the chance to define profiles in a "existing" language instead of rolling our own. GraphQL interfaces come to mind, they even seem to be composable interface QualityProfile {
quality: Int! //maybe uint16!....
qualityDescription: String
} interface DBCProfile {
DBCSignal: String
DBCtransform: DBCTransform
DBCdescription: String
} type DBCTransform {
transform: String
mapping: ...
} The advantage being: It seems a simple way to specify what a metadata you want, it IS defined, so in case of corner cases (what are the rules when field names collide?), we can look them up instead of making new ones. While this would of course fit with somebody using GraphQL, I think it is not contingent on that: This works fine with VSS as is, and I think it is not harder to parse than the custom format suggested in the PR. Taking the example from the PR source:
mandatory: true
description: "Gives some info"
xpos:
list: True # Indicates that children may be in a list
a:
datatype: uint8
description "A value"
b:
datatype: uint8
description "B value"
ypos:
datatype: uint8
description "Y value"
quality:
datatype: uint8
description "Q value" Might translate to sth like interface QualityProfile {
Quality: uint16!
source: QualitySource!
}
type QualitySource {
xpos: [Int2Tuple!]!
ypos: uint8!
}
type Int2Tuple {
a: Int!
b: Int!
} As I am not an expert in this technology I'd like an opinion @jdacoello , whether this is feasible or should be considered "misuse". |
JSON Schema would be an "existing language". |
".
Agreed on JsonSchema. For bindng/limiting GraphQL Types: Basically I would only allow „primitive VSS“ Types as member datatypes. So the „Int“ in the tuple toy example was probably not good, should have been one of the VSS types (similar lije in JSONSchema you would likely not limit yourself to native JSON datatypes only. Nesting of Types (if we allow it) woul easily transfer to the vspec yaml view, similar to how in current VSS vanilla overlay for DBC everything is grouped under dbc2vss or vss2dbc |
I fully agree that an established language with enough community tools should be the way to go instead of implementing this feature with yet another extension to the proprietary @SebastianSchildt: the purpose of an As @sschleemilch said, json schema is another valid alternative (for a language with standard syntax) that has plenty of open-source tools. It is actually more expressive and powerful than GraphQL. However, json is verbose while GraphQL SDL is simple and compact (i.e., friendly for non-experts). So, standard and well adopted languages exist. The question is how to keep the link between current At least we are agreeing that the language must be anything but a proprietary custom extension. |
In the end I am also fine with GraphQL also regarding the possible future of VSPEC being modelled completely using GraphQL... |
I agree that if we want to define a syntax for defining profiles. it should better be something that would work in GraphQL, as that seems to be the language that most are interested in for "VSS next gen". For now there anyway does not seem to be anyone that has interest in developing a profile validator for vss-tools, it rather seems that the validation (if any) will happen in the tool using the info (Kuksa, VISSR, ....) The new PRs that recently has been submitted focus on vspec/json examples and informal definition of the profiles, so that is maybe a sufficient scope for now. |
Re the CAN mapping I can think of a few projects defining something in that regard:
I wonder also if there is something useful to be taken from the upstream CAN eco-systems? Projects such as Kayak and CANMatrix and the SocketCAN family, or groups such as CANopen |
Related to #436
This is an example on how VSS-tools possible could define a profile syntax and collect contributed profiles. Published as an example to be discussed at VSS meeting March 4th