batterypass / BatteryPassDataModel

Battery Passport Data Model repository from the Battery Pass Project
https://batterypass.github.io/BatteryPassDataModel/
18 stars 1 forks source link

Is "unit" is missing in the json sample output? #4

Open miwamasa opened 2 weeks ago

miwamasa commented 2 weeks ago

For Carbonfootprint. sample json is

image

where in ttl file, unit seems to be defined with its textual appearance;

image

image

miwamasa commented 2 weeks ago

looking at the catena-x version of BatteryPass.ttl and DigitalProductPassport.ttl, following might work.

:CarbonFootprintPerLifecycleStageEntity a samm:Entity ;
   samm:description "The carbon footprint of the battery as share of total Battery Carbon Footprint, differentiated per life cycle stage"@en ;
   samm:properties ( :lifecycleStage :carbonFootprint  [ samm:property :footprintUnit; samm:payloadName "unit" ]) .

and then put footprintUnit

:footprintUnit a samm:Property ;
   samm:preferredName "Footprint Unit"@en ;
   samm:description "The unit of measurement of the environmental impact category. For each impact category a specific unit is used. If an aggregation is used, utilize the normalization and weighting methods used in the referenced rulebook."@en ;
   samm:characteristic samm-c:Text ;
   samm:exampleValue "kg CO2 / kWh" .
miwamasa commented 2 weeks ago

The result is..

{
  "carbonFootprintPerLifecycleStage" : [ {
    "lifecycleStage" : "RawMaterialExtraction",
    "carbonFootprint" : -1.7976931348623157E308,
    "unit" : "kg CO2 / kWh"
  } ],
  "carbonFootprintStudy" : "telnet://192.0.2.16:80/",
  "batteryCarbonFootprint" : -1.7976931348623157E308,
  "carbonFootprintPerformanceClass" : "eOMtThyhVNLWUZNRcBaQKxI"
}
miwamasa commented 2 weeks ago

above is just a walkaround. in "CarbonFootprint-aas.xml", unit is expanded.

So the possibility is the original ttl is right; It seems "sam-c:unit" is not properly expanded for json/jsonschema with samm-cli with respect to its definition.

I have tried with samm-cli-2.9.5.jar

:CarbonFootprintValue a samm-c:Measurement ;
   samm:dataType xsd:double ;
   samm-c:unit :kilogramperkilowatthour .