Skip to content
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

Restrictions on datatype/unit #13

Open
danielwilms opened this issue Jun 1, 2021 · 8 comments
Open

Restrictions on datatype/unit #13

danielwilms opened this issue Jun 1, 2021 · 8 comments

Comments

@danielwilms
Copy link
Contributor

First idea was using schema:rangeIncludes. Other ideas from @felix-loesch

  • Option A: create OWL restrictions to store that information at the class level or solution
  • option B: create master instances to store that information.
danielwilms added a commit to danielwilms/vss-tools that referenced this issue Jun 1, 2021
Has to be solved OWL compliant.
Raised as issue in:
w3c/vsso#13

Signed-off-by: Daniel Wilms <Daniel.DW.Wilms@bmw.de>
@felix-loesch
Copy link

I strongly suggest that we move the concrete VSS definitions (e.g. signals, branches) to OWL instances.
This makes defining the restrictions much easier than leaving them at the class level.

@danielwilms
Copy link
Contributor Author

danielwilms commented Feb 28, 2022

issue is related to #22 and should be discussed after #22 is decided.

@danielwilms
Copy link
Contributor Author

danielwilms commented Mar 14, 2022

Possible tooling extension for:
arrays: COVESA/vss-tools@4fc8709
units: COVESA/vss-tools@8065958
enumerations: COVESA/vss-tools@417db9b

@danielwilms
Copy link
Contributor Author

@jdacoello will create proposal until 2022/05/30 for discussion

@jdacoello
Copy link

Here is a proposal to handle values and units.

Current problem/drawback

To give some context, as of today, a VehicleProperty can have a value and its associated datetime via direct data properties as shown below:

image

PROS:

  • Simple structures and queries

CONS:

  • To overwrite (i.e., update) the value, one must delete and then insert a new one
  • The intention of this approach only focuses to answer: what is the current value?
  • Any other information needed (e.g., unit) requires a new data property. Although possible and valid, this approach would prevent in practice having values in other units at the same time.
  • As it was resolved in the VSS Ontology Workshop on 14.03, Specific DynamicVehicleProperty coming from VSS are now implemented as instances.
  • Let's visualise the implications of the current status:
    image

You can see in the figure how multiple values coming from different vehicles are linked to the same instance of a DynamicVehicleProperty, in this case Speed. So, the membership of these literals become unclear when multiple vehicles are instantiated and using the same instance of a DynamicVehicleProperty.

Proposal

I propose to have the following structure:
image
Here, the class VehiclePropertyValue (in orange) is introduced. In practice, this means that a specific vehicle will have specific values of the properties linked to it. If the concept is used to assign the type to a blank node, we could arbitrarily add any other metadata that might be needed (e.g., unit).

If the unit is fixed, make it part of the model

image

If the unit is not fixed, introduce quantity kind for correctness

image

Adopt an existing ontology for units and quantity kinds (e.g., QUDT)

VSS has the specification for the unit and the dimension to which it relates. We can use it to map into concrete instances of unit and quantity kind. Taking the extensive QUDT ontology as the reference:

Unit type Unit (QUDT) Domain QuantityKind (QUDT) Description
cm/s^2 http://qudt.org/vocab/unit/CentiM-PER-SEC2 Acceleration http://qudt.org/vocab/quantitykind/Acceleration Acceleration measured in centimeters per second squared
m/s^2 http://qudt.org/vocab/unit/M-PER-SEC2 Acceleration http://qudt.org/vocab/quantitykind/Acceleration Acceleration measured in meters per second squared
degrees http://qudt.org/vocab/unit/DEG Angle http://qudt.org/vocab/quantitykind/Angle Angle measured in degrees
degrees/s http://qudt.org/vocab/unit/DEG-PER-SEC Angular Speed http://qudt.org/vocab/quantitykind/AngularVelocity Angular speed measured in degrees per second
rpm http://qudt.org/vocab/unit/REV-PER-MIN Rotational Speed http://qudt.org/vocab/quantitykind/AngularVelocity Rotational speed measured in revolutions per minute
percent http://qudt.org/vocab/unit/PERCENT Relation http://qudt.org/vocab/quantitykind/DimensionlessRatio Relation measured in percent
ratio http://qudt.org/vocab/unit/UNITLESS Relation http://qudt.org/vocab/quantitykind/DimensionlessRatio Relation measured as ratio
A http://qudt.org/vocab/unit/A Electric Current http://qudt.org/vocab/quantitykind/ElectricCurrent Electric current measured in amperes
V http://qudt.org/vocab/unit/V Electric Potential http://qudt.org/vocab/quantitykind/ElectricPotential Electric potential measured in volts
kWh http://qudt.org/vocab/unit/KiloW-HR Energy Consumption http://qudt.org/vocab/quantitykind/Energy Energy consumption measured in kilowatt hours
N http://qudt.org/vocab/unit/N Force http://qudt.org/vocab/quantitykind/Force Force measured in newton
kPa http://qudt.org/vocab/unit/KiloPA Pressure http://qudt.org/vocab/quantitykind/ForcePerArea Pressure measured in kilopascal
mbar http://qudt.org/vocab/unit/MilliBAR Pressure http://qudt.org/vocab/quantitykind/ForcePerArea Pressure measured in millibars
Pa http://qudt.org/vocab/unit/PA Pressure http://qudt.org/vocab/quantitykind/ForcePerArea Pressure measured in pascal
Hz http://qudt.org/vocab/unit/HZ Frequency http://qudt.org/vocab/quantitykind/Frequency Frequency measured in hertz
cm http://qudt.org/vocab/unit/CentiM Distance http://qudt.org/vocab/quantitykind/Length Distance measured in centimeters
inch http://qudt.org/vocab/unit/IN Distance http://qudt.org/vocab/quantitykind/Length Distance measured in inches
km http://qudt.org/vocab/unit/KiloM Distance http://qudt.org/vocab/quantitykind/Length Distance measured in kilometers
m http://qudt.org/vocab/unit/M Distance http://qudt.org/vocab/quantitykind/Length Distance measured in meters
mm http://qudt.org/vocab/unit/MilliM Distance http://qudt.org/vocab/quantitykind/Length Distance measured in millimeters
g http://qudt.org/vocab/unit/GM Weight http://qudt.org/vocab/quantitykind/Mass Mass measured in grams
kg http://qudt.org/vocab/unit/KiloGM Weight http://qudt.org/vocab/quantitykind/Mass Mass measured in kilograms
lbs http://qudt.org/vocab/unit/LB Weight http://qudt.org/vocab/quantitykind/Mass Mass measured in pounds
g/s http://qudt.org/vocab/unit/GM-PER-SEC Mass per time http://qudt.org/vocab/quantitykind/MassFlowRate Mass per time measured in grams per second
g/km http://qudt.org/vocab/unit/GM-PER-KiloM Mass per distance http://qudt.org/vocab/quantitykind/MassPerLength Mass per distance measured in grams per kilometers
PS http://qudt.org/vocab/unit/HP_Metric Power http://qudt.org/vocab/quantitykind/Power Power measured in horsepower
kW http://qudt.org/vocab/unit/KiloW Power http://qudt.org/vocab/quantitykind/Power Power measured in kilowatts
W http://qudt.org/vocab/unit/W Power http://qudt.org/vocab/quantitykind/Power Power measured in watts
celsius http://qudt.org/vocab/unit/DEG_C Temperature http://qudt.org/vocab/quantitykind/Temperature Temperature measured in degree celsius
day http://qudt.org/vocab/unit/DAY Time http://qudt.org/vocab/quantitykind/Time Time measured in days
h http://qudt.org/vocab/unit/HR Time http://qudt.org/vocab/quantitykind/Time Time measured in hours
ms http://qudt.org/vocab/unit/MilliSEC Time http://qudt.org/vocab/quantitykind/Time Time measured in milliseconds
min http://qudt.org/vocab/unit/MIN Time http://qudt.org/vocab/quantitykind/Time Time measured in minutes
months http://qudt.org/vocab/unit/MO Time http://qudt.org/vocab/quantitykind/Time Time measured in months
s http://qudt.org/vocab/unit/SEC Time http://qudt.org/vocab/quantitykind/Time Time measured in seconds
weeks http://qudt.org/vocab/unit/WK Time http://qudt.org/vocab/quantitykind/Time Time measured in weeks
years http://qudt.org/vocab/unit/YR Time http://qudt.org/vocab/quantitykind/Time Time measured in years
Nm http://qudt.org/vocab/unit/N-M Torque http://qudt.org/vocab/quantitykind/Torque Torque measured in newton meters
km/h http://qudt.org/vocab/unit/KiloM-PER-HR Speed http://qudt.org/vocab/quantitykind/Velocity Speed measured in kilometers per hours
m/s http://qudt.org/vocab/unit/M-PER-SEC Speed http://qudt.org/vocab/quantitykind/Velocity Speed measured in meters per second
cm^3 http://qudt.org/vocab/unit/CentiM3 Volume http://qudt.org/vocab/quantitykind/Volume Volume measured in cubic centimeters
l http://qudt.org/vocab/unit/L Volume http://qudt.org/vocab/quantitykind/Volume Volume measured in liters
ml http://qudt.org/vocab/unit/MilliL Volume http://qudt.org/vocab/quantitykind/Volume Volume measured in milliliters
l/h http://qudt.org/vocab/unit/L-PER-HR Flow http://qudt.org/vocab/quantitykind/VolumeFlowRate Flow measured in liters per hour
kWh/100km NA Energy Consumption per distance NA Energy consumption per distance measured in kilowatt hours per 100 kilometers
l/100km NA Volume per distance NA Volume per distance measured in liters per 100 kilometers
ml/100km NA Volume per distance NA Volume per distance measured in milliliters per 100 kilometers
mpg NA Distance per Volume NA Distance per volume measured in miles per gallon
stars Not used Rating Not used Rating measured in stars
UNIX Timestamp Not used Time Not used Unix time is a system for describing a point in time. It is the number of seconds that have elapsed since the Unix epoch, excluding leap seconds.

@danielwilms
Copy link
Contributor Author

Meeting 2022/06/27:

  1. We go with a new property called vsso-core:VehiclePropertyValue instead of previous solution (maybe use for SVP) (used in OMP as well as pattern)
  2. Rather use concrete units instead of QuantityKind

@danielwilms
Copy link
Contributor Author

jdacoello added a commit to jdacoello/vsso that referenced this issue Jun 30, 2022
Related to issue w3c#13. Class VehiclePropertyState was introduced to handle the values and metadata of a DynamicVehicleProperty.

Changes were:

Create a new class VehiclePropertyState
Create a new object property hasVehiclePropertyState
  Domain: Vehicle
  Range: VehiclePropertyState
Change domain of vsso-core:propertyValueUpdatedAt
  Domain: VehiclePropertyState
Change domain and range of vsso-core:vehiclePropertyValue
  Domain: VehiclePropertyState
  Range: Literal
@jdacoello
Copy link

@rtroncy will provide a counter proposal that is based on cudt.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants