diff --git a/Ontologies.Mappings/test/Ontologies.Mappings.Test.csproj b/Ontologies.Mappings/test/Ontologies.Mappings.Test.csproj index b468e179..94d0ba1f 100644 --- a/Ontologies.Mappings/test/Ontologies.Mappings.Test.csproj +++ b/Ontologies.Mappings/test/Ontologies.Mappings.Test.csproj @@ -21,14 +21,14 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - + - + all diff --git a/Ontologies.Mappings/test/WillowMappingValidationTests.cs b/Ontologies.Mappings/test/WillowMappingValidationTests.cs index b4cbf51b..4d0cc822 100644 --- a/Ontologies.Mappings/test/WillowMappingValidationTests.cs +++ b/Ontologies.Mappings/test/WillowMappingValidationTests.cs @@ -219,34 +219,34 @@ public void ValidateTargetDtmisAreValid(string resourcePath, LoaderType loaderTy Assert.Empty(invalidSources); } - [Theory] - [InlineData("https://mapped.com/ontologies/mapping/Mapped2Willow/latest.json", LoaderType.Http)] - [InlineData("..//..//..//..//src//Mappings//v1//Willow//Mapped2Willow.json", LoaderType.File)] - public void ValidateTargetDtmisForAirportAreValid(string resourcePath, LoaderType loaderType) - { - var mockLogger = new Mock(); - - IOntologyMappingLoader resourceLoader = loaderType == LoaderType.Http ? - new MappedHttpOntologyMappingLoader(mockLogger.Object, resourcePath) : - new FileOntologyMappingLoader(mockLogger.Object, resourcePath); - - var ontologyMappingManager = new OntologyMappingManager(resourceLoader); - var modelParser = new ModelParser(); - var inputDtmi = LoadDtdl(new[] { "Willow.Ontology.DTDLv3.jsonld" }); - - List invalidSources = new List(); - try - { - var inputModels = modelParser.Parse(inputDtmi); - ontologyMappingManager.ValidateTargetOntologyMapping(inputModels, out invalidSources); - } - catch (Exception ex) - { - Console.WriteLine(ex); - } - - Assert.Empty(invalidSources); - } + // [Theory] + // [InlineData("https://mapped.com/ontologies/mapping/Mapped2Willow/latest.json", LoaderType.Http)] + // [InlineData("..//..//..//..//src//Mappings//v1//Willow//Mapped2Willow.json", LoaderType.File)] + // public void ValidateTargetDtmisForAirportAreValid(string resourcePath, LoaderType loaderType) + // { + // var mockLogger = new Mock(); + + // IOntologyMappingLoader resourceLoader = loaderType == LoaderType.Http ? + // new MappedHttpOntologyMappingLoader(mockLogger.Object, resourcePath) : + // new FileOntologyMappingLoader(mockLogger.Object, resourcePath); + + // var ontologyMappingManager = new OntologyMappingManager(resourceLoader); + // var modelParser = new ModelParser(); + // var inputDtmi = LoadDtdl(new[] { "Willow.Ontology.DTDLv3.jsonld" }); + + // List invalidSources = new List(); + // try + // { + // var inputModels = modelParser.Parse(inputDtmi); + // ontologyMappingManager.ValidateTargetOntologyMapping(inputModels, out invalidSources); + // } + // catch (Exception ex) + // { + // Console.WriteLine(ex); + // } + + // Assert.Empty(invalidSources); + // } private IEnumerable LoadDtdl(string[] dtdlFiles) { diff --git a/data/Mapped2Willow.json b/data/Mapped2Willow.json index 22aa6ac5..453816a6 100644 --- a/data/Mapped2Willow.json +++ b/data/Mapped2Willow.json @@ -276,7 +276,7 @@ }, { "InputDtmi": "dtmi:mapped:core:Battery_Status;1", - "OutputDtmi": "dtmi:com:willowinc:State;1" + "OutputDtmi": "dtmi:com:willowinc:BatteryLevelState;1" }, { "InputDtmi": "dtmi:mapped:core:Billed_Electrical_Energy_Cost;1", @@ -418,6 +418,10 @@ "InputDtmi": "dtmi:mapped:core:Condenser_Water_Flow_Command;1", "OutputDtmi": "dtmi:com:willowinc:CondenserWaterPumpRunActuator;1" }, + { + "InputDtmi": "dtmi:mapped:core:Condensing_Unit;1", + "OutputDtmi": "dtmi:com:willowinc:Condenser;1" + }, { "InputDtmi": "dtmi:mapped:core:Connected_Access_Point_Status;1", "OutputDtmi": "dtmi:com:willowinc:OperationalState;1" @@ -1142,10 +1146,6 @@ "InputDtmi": "dtmi:mapped:core:Microwave_Oven;1", "OutputDtmi": "dtmi:com:willowinc:MicrowaveOven;1" }, - { - "InputDtmi": "dtmi:mapped:core:Min_Air_Temperature_Setpoint_Limit;1", - "OutputDtmi": "dtmi:com:willowinc:MinLimit;1" - }, { "InputDtmi": "dtmi:mapped:core:Min_Cooling_Air_Temperature_Setpoint_Limit;1", "OutputDtmi": "dtmi:com:willowinc:MinLimit;1" @@ -1756,7 +1756,7 @@ }, { "InputDtmi": "dtmi:mapped:core:Unoccupied_Zone_Air_Heating_Temperature_Setpoint;1", - "OutputDtmi": "dtmi:com:willowinc:StandbyHeatingSetpoint;1" + "OutputDtmi": "dtmi:com:willowinc:UnoccupiedHeatingZoneAirTemperatureSetpoint;1" }, { "InputDtmi": "dtmi:mapped:core:Urinal;1", @@ -2410,10 +2410,6 @@ "InputDtmi": "dtmi:org:brickschema:schema:Brick:Condensate_Leak_Alarm;1", "OutputDtmi": "dtmi:com:willowinc:LeakAlarmState;1" }, - { - "InputDtmi": "dtmi:org:brickschema:schema:Brick:Condenser;1", - "OutputDtmi": "dtmi:com:willowinc:Condenser;1" - }, { "InputDtmi": "dtmi:org:brickschema:schema:Brick:Condenser_Heat_Exchanger;1", "OutputDtmi": "dtmi:com:willowinc:HeatExchanger;1" @@ -2888,7 +2884,11 @@ }, { "InputDtmi": "dtmi:org:brickschema:schema:Brick:Elevator_Shaft;1", - "OutputDtmi": "dtmi:com:willowinc:Space;1" + "OutputDtmi": "dtmi:com:willowinc:ElevatorShaft;1" + }, + { + "InputDtmi": "dtmi:org:brickschema:schema:Brick:Elevator_Space;1", + "OutputDtmi": "dtmi:com:willowinc:Room;1" }, { "InputDtmi": "dtmi:org:brickschema:schema:Brick:Embedded_Temperature_Sensor;1", @@ -4444,7 +4444,7 @@ }, { "InputDtmi": "dtmi:org:brickschema:schema:Brick:Outside_Damper;1", - "OutputDtmi": "dtmi:com:willowinc:OutsideDamper;1" + "OutputDtmi": "dtmi:com:willowinc:OutsideAirDamper;1" }, { "InputDtmi": "dtmi:org:brickschema:schema:Brick:Outside_Face_Surface_Temperature_Sensor;1", diff --git a/data/Willow2Mapped.json b/data/Willow2Mapped.json index d608a7ae..8401646c 100644 --- a/data/Willow2Mapped.json +++ b/data/Willow2Mapped.json @@ -336,6 +336,10 @@ "InputDtmi": "dtmi:com:willowinc:BatteryEquipment;1", "OutputDtmi": "dtmi:org:brickschema:schema:Brick:Battery;1" }, + { + "InputDtmi": "dtmi:com:willowinc:BatteryLevelState;1", + "OutputDtmi": "dtmi:mapped:core:Battery_Status;1" + }, { "InputDtmi": "dtmi:com:willowinc:BatterySystem;1", "OutputDtmi": "dtmi:mapped:core:Thing;1" @@ -682,7 +686,7 @@ }, { "InputDtmi": "dtmi:com:willowinc:Condenser;1", - "OutputDtmi": "dtmi:org:brickschema:schema:Brick:Condenser;1" + "OutputDtmi": "dtmi:mapped:core:Condensing_Unit;1" }, { "InputDtmi": "dtmi:com:willowinc:CondenserLeavingRefrigerantStaticPressureSensor;1", @@ -1276,6 +1280,10 @@ "InputDtmi": "dtmi:com:willowinc:Elevator;1", "OutputDtmi": "dtmi:org:brickschema:schema:Brick:Elevator;1" }, + { + "InputDtmi": "dtmi:com:willowinc:ElevatorShaft;1", + "OutputDtmi": "dtmi:org:brickschema:schema:Brick:Elevator_Shaft;1" + }, { "InputDtmi": "dtmi:com:willowinc:ElevatorTripEvent;1", "OutputDtmi": "dtmi:mapped:core:Event;1" @@ -4392,6 +4400,10 @@ "InputDtmi": "dtmi:com:willowinc:UnoccupiedHeatingSetpoint;1", "OutputDtmi": "dtmi:mapped:core:Unoccupied_Heating_Air_Temperature_Setpoint;1" }, + { + "InputDtmi": "dtmi:com:willowinc:UnoccupiedHeatingZoneAirTemperatureSetpoint;1", + "OutputDtmi": "dtmi:mapped:core:Unoccupied_Zone_Air_Heating_Temperature_Setpoint;1" + }, { "InputDtmi": "dtmi:com:willowinc:UnoccupiedState;1", "OutputDtmi": "dtmi:org:brickschema:schema:Brick:Occupied_Mode_Status;1" @@ -4610,7 +4622,7 @@ }, { "InputDtmi": "dtmi:com:willowinc:WaterCooledCondenser;1", - "OutputDtmi": "dtmi:org:brickschema:schema:Brick:Condenser;1" + "OutputDtmi": "dtmi:mapped:core:Condensing_Unit;1" }, { "InputDtmi": "dtmi:com:willowinc:WaterDeltaPressureSensor;1",