Old SDK removed
New dotnet SDK added - Release
diff --git a/sdks/dotnet/basyx-core/.gitattributes b/sdks/dotnet/basyx-core/.gitattributes
new file mode 100644
index 0000000..1ff0c42
--- /dev/null
+++ b/sdks/dotnet/basyx-core/.gitattributes
@@ -0,0 +1,63 @@
+###############################################################################
+# Set default behavior to automatically normalize line endings.
+###############################################################################
+* text=auto
+
+###############################################################################
+# Set default behavior for command prompt diff.
+#
+# This is need for earlier builds of msysgit that does not have it on by
+# default for csharp files.
+# Note: This is only used by command line
+###############################################################################
+#*.cs diff=csharp
+
+###############################################################################
+# Set the merge driver for project and solution files
+#
+# Merging from the command prompt will add diff markers to the files if there
+# are conflicts (Merging from VS is not affected by the settings below, in VS
+# the diff markers are never inserted). Diff markers may cause the following
+# file extensions to fail to load in VS. An alternative would be to treat
+# these files as binary and thus will always conflict and require user
+# intervention with every merge. To do so, just uncomment the entries below
+###############################################################################
+#*.sln merge=binary
+#*.csproj merge=binary
+#*.vbproj merge=binary
+#*.vcxproj merge=binary
+#*.vcproj merge=binary
+#*.dbproj merge=binary
+#*.fsproj merge=binary
+#*.lsproj merge=binary
+#*.wixproj merge=binary
+#*.modelproj merge=binary
+#*.sqlproj merge=binary
+#*.wwaproj merge=binary
+
+###############################################################################
+# behavior for image files
+#
+# image files are treated as binary by default.
+###############################################################################
+#*.jpg binary
+#*.png binary
+#*.gif binary
+
+###############################################################################
+# diff behavior for common document formats
+#
+# Convert binary document formats to text before diffing them. This feature
+# is only available from the command line. Turn it on by uncommenting the
+# entries below.
+###############################################################################
+#*.doc diff=astextplain
+#*.DOC diff=astextplain
+#*.docx diff=astextplain
+#*.DOCX diff=astextplain
+#*.dot diff=astextplain
+#*.DOT diff=astextplain
+#*.pdf diff=astextplain
+#*.PDF diff=astextplain
+#*.rtf diff=astextplain
+#*.RTF diff=astextplain
diff --git a/sdks/dotnet/basyx-core/.gitignore b/sdks/dotnet/basyx-core/.gitignore
new file mode 100644
index 0000000..7c9c062
--- /dev/null
+++ b/sdks/dotnet/basyx-core/.gitignore
@@ -0,0 +1,263 @@
+## Ignore Visual Studio temporary files, build results, and
+## files generated by popular Visual Studio add-ons.
+
+# User-specific files
+*.suo
+*.user
+*.userosscache
+*.sln.docstates
+
+# User-specific files (MonoDevelop/Xamarin Studio)
+*.userprefs
+
+# Build results
+[Dd]ebug/
+[Dd]ebugPublic/
+[Rr]elease/
+[Rr]eleases/
+x64/
+x86/
+bld/
+[Bb]in/
+[Oo]bj/
+[Ll]og/
+
+# Visual Studio 2015 cache/options directory
+.vs/
+# Uncomment if you have tasks that create the project's static files in wwwroot
+#wwwroot/
+
+# MSTest test Results
+[Tt]est[Rr]esult*/
+[Bb]uild[Ll]og.*
+
+# NUNIT
+*.VisualState.xml
+TestResult.xml
+
+# Build Results of an ATL Project
+[Dd]ebugPS/
+[Rr]eleasePS/
+dlldata.c
+
+# DNX
+project.lock.json
+project.fragment.lock.json
+artifacts/
+
+*_i.c
+*_p.c
+*_i.h
+*.ilk
+*.meta
+*.obj
+*.pch
+*.pdb
+*.pgc
+*.pgd
+*.rsp
+*.sbr
+*.tlb
+*.tli
+*.tlh
+*.tmp
+*.tmp_proj
+*.log
+*.vspscc
+*.vssscc
+.builds
+*.pidb
+*.svclog
+*.scc
+
+# Chutzpah Test files
+_Chutzpah*
+
+# Visual C++ cache files
+ipch/
+*.aps
+*.ncb
+*.opendb
+*.opensdf
+*.sdf
+*.cachefile
+*.VC.db
+*.VC.VC.opendb
+
+# Visual Studio profiler
+*.psess
+*.vsp
+*.vspx
+*.sap
+
+# TFS 2012 Local Workspace
+$tf/
+
+# Guidance Automation Toolkit
+*.gpState
+
+# ReSharper is a .NET coding add-in
+_ReSharper*/
+*.[Rr]e[Ss]harper
+*.DotSettings.user
+
+# JustCode is a .NET coding add-in
+.JustCode
+
+# TeamCity is a build add-in
+_TeamCity*
+
+# DotCover is a Code Coverage Tool
+*.dotCover
+
+# NCrunch
+_NCrunch_*
+.*crunch*.local.xml
+nCrunchTemp_*
+
+# MightyMoose
+*.mm.*
+AutoTest.Net/
+
+# Web workbench (sass)
+.sass-cache/
+
+# Installshield output folder
+[Ee]xpress/
+
+# DocProject is a documentation generator add-in
+DocProject/buildhelp/
+DocProject/Help/*.HxT
+DocProject/Help/*.HxC
+DocProject/Help/*.hhc
+DocProject/Help/*.hhk
+DocProject/Help/*.hhp
+DocProject/Help/Html2
+DocProject/Help/html
+
+# Click-Once directory
+publish/
+
+# Publish Web Output
+*.[Pp]ublish.xml
+*.azurePubxml
+# TODO: Comment the next line if you want to checkin your web deploy settings
+# but database connection strings (with potential passwords) will be unencrypted
+#*.pubxml
+*.publishproj
+
+# Microsoft Azure Web App publish settings. Comment the next line if you want to
+# checkin your Azure Web App publish settings, but sensitive information contained
+# in these scripts will be unencrypted
+PublishScripts/
+
+# NuGet Packages
+*.nupkg
+# The packages folder can be ignored because of Package Restore
+**/packages/*
+# except build/, which is used as an MSBuild target.
+!**/packages/build/
+# Uncomment if necessary however generally it will be regenerated when needed
+#!**/packages/repositories.config
+# NuGet v3's project.json files produces more ignoreable files
+*.nuget.props
+*.nuget.targets
+
+# Microsoft Azure Build Output
+csx/
+*.build.csdef
+
+# Microsoft Azure Emulator
+ecf/
+rcf/
+
+# Windows Store app package directories and files
+AppPackages/
+BundleArtifacts/
+Package.StoreAssociation.xml
+_pkginfo.txt
+
+# Visual Studio cache files
+# files ending in .cache can be ignored
+*.[Cc]ache
+# but keep track of directories ending in .cache
+!*.[Cc]ache/
+
+# Others
+ClientBin/
+~$*
+*~
+*.dbmdl
+*.dbproj.schemaview
+*.jfm
+*.pfx
+*.publishsettings
+node_modules/
+orleans.codegen.cs
+
+# Since there are multiple workflows, uncomment next line to ignore bower_components
+# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
+#bower_components/
+
+# RIA/Silverlight projects
+Generated_Code/
+
+# Backup & report files from converting an old project file
+# to a newer Visual Studio version. Backup files are not needed,
+# because we have git ;-)
+_UpgradeReport_Files/
+Backup*/
+UpgradeLog*.XML
+UpgradeLog*.htm
+
+# SQL Server files
+*.mdf
+*.ldf
+
+# Business Intelligence projects
+*.rdl.data
+*.bim.layout
+*.bim_*.settings
+
+# Microsoft Fakes
+FakesAssemblies/
+
+# GhostDoc plugin setting file
+*.GhostDoc.xml
+
+# Node.js Tools for Visual Studio
+.ntvs_analysis.dat
+
+# Visual Studio 6 build log
+*.plg
+
+# Visual Studio 6 workspace options file
+*.opt
+
+# Visual Studio LightSwitch build output
+**/*.HTMLClient/GeneratedArtifacts
+**/*.DesktopClient/GeneratedArtifacts
+**/*.DesktopClient/ModelManifest.xml
+**/*.Server/GeneratedArtifacts
+**/*.Server/ModelManifest.xml
+_Pvt_Extensions
+
+# Paket dependency manager
+.paket/paket.exe
+paket-files/
+
+# FAKE - F# Make
+.fake/
+
+# JetBrains Rider
+.idea/
+*.sln.iml
+
+# CodeRush
+.cr/
+
+# Python Tools for Visual Studio (PTVS)
+__pycache__/
+*.pyc
+/.svn
+TestProject
diff --git a/sdks/dotnet/basyx-core/BaSyx.API.Http.Controllers/AssetAdministrationShell/AssetAdministrationShellAggregatorServices.cs b/sdks/dotnet/basyx-core/BaSyx.API.Http.Controllers/AssetAdministrationShell/AssetAdministrationShellAggregatorServices.cs
new file mode 100644
index 0000000..797d5c9
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.API.Http.Controllers/AssetAdministrationShell/AssetAdministrationShellAggregatorServices.cs
@@ -0,0 +1,204 @@
+/*******************************************************************************
+* Copyright (c) 2020 Robert Bosch GmbH
+* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
+*
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License 2.0 which is available at
+* http://www.eclipse.org/legal/epl-2.0
+*
+* SPDX-License-Identifier: EPL-2.0
+*******************************************************************************/
+using System.Collections.Generic;
+using Microsoft.AspNetCore.Mvc;
+using BaSyx.Models.Core.AssetAdministrationShell.Generics;
+using BaSyx.Utils.ResultHandling;
+using static BaSyx.Utils.ResultHandling.Utils;
+using BaSyx.API.Components;
+using BaSyx.Models.Connectivity.Descriptors;
+using BaSyx.Models.Core.Common;
+
+namespace BaSyx.API.Http.Controllers
+{
+ /// <summary>
+ /// The Asset Administration Shell Aggregator Controller
+ /// </summary>
+ public class AssetAdministrationShellAggregatorServices : Controller, IAssetAdministrationShellAggregatorServiceProvider
+ {
+
+ private readonly IAssetAdministrationShellAggregatorServiceProvider aggregator;
+
+ public IEnumerable<IAssetAdministrationShell> AssetAdministrationShells => aggregator.AssetAdministrationShells;
+ public IAssetAdministrationShellAggregatorDescriptor ServiceDescriptor { get; }
+
+
+ public AssetAdministrationShellAggregatorServices(IAssetAdministrationShellAggregatorServiceProvider assetAdministrationShellAggregatorServiceProvider)
+ {
+ aggregator = assetAdministrationShellAggregatorServiceProvider;
+ ServiceDescriptor = assetAdministrationShellAggregatorServiceProvider.ServiceDescriptor;
+ }
+
+ #region REST-Interface AssetAdministrationShellAggregator
+
+ /// <summary>
+ /// Retrieves all Asset Administration Shells from the aggregator service endpoint
+ /// </summary>
+ /// <returns></returns>
+ /// <response code="200">Returns a list of found Asset Administration Shells</response>
+ /// <response code="404">No Asset Administration Shells found</response>
+ /// <response code="400">Bad Request</response>
+ /// <response code="502">Bad Gateway</response>
+ [HttpGet("shells", Name = "RetrieveAllAssetAdministrationShells")]
+ [ProducesResponseType(typeof(IResult<List<IAssetAdministrationShell>>), 200)]
+ public IActionResult RetrieveAllAssetAdministrationShells()
+ {
+ var result = RetrieveAssetAdministrationShells();
+ return EvaluateResult(result, CrudOperation.Retrieve);
+ }
+ /// <summary>
+ /// Retrieves a specific Asset Administration Shell from the aggregator service endpint
+ /// </summary>
+ /// <param name="aasId">The Asset Administration Shell's short id</param>
+ /// <returns></returns>
+ /// <response code="200">Returns the requested Asset Administration Shell</response>
+ /// <response code="404">No Asset Administration Shell found</response>
+ /// <response code="400">Bad Request</response>
+ /// <response code="502">Bad Gateway</response>
+ [HttpGet("shells/{aasId}", Name = "RetrieveAssetAdministrationShellByIdShort")]
+ [ProducesResponseType(typeof(IResult<IAssetAdministrationShell>), 200)]
+ public IActionResult RetrieveAssetAdministrationShellByIdShort(string aasId)
+ {
+ var result = RetrieveAssetAdministrationShell(aasId);
+ return EvaluateResult(result, CrudOperation.Retrieve);
+ }
+ /// <summary>
+ /// Updates a specific Asset Administration Shell at the aggregator service endpint
+ /// </summary>
+ /// <param name="aasId">The Asset Administration Shell's unique id</param>
+ /// <param name="aas">The updated Asset Administration Shell</param>
+ /// <returns></returns>
+ /// <response code="200">Asset Administration Shell updated successfully</response>
+ /// <response code="400">Bad Request</response>
+ /// <response code="502">Bad Gateway</response>
+ [HttpPut("shells/{aasId}", Name = "UpdateAssetAdministrationShellByIdShort")]
+ [ProducesResponseType(typeof(IResult), 200)]
+ public IActionResult UpdateAssetAdministrationShellByIdShort(string aasId, [FromBody] IAssetAdministrationShell aas)
+ {
+ var result = UpdateAssetAdministrationShell(aasId, aas);
+ return EvaluateResult(result, CrudOperation.Update);
+ }
+ /// <summary>
+ /// Creates a new Asset Administration Shell at the aggregator service endpoint
+ /// </summary>
+ /// <param name="aas">The serialized Asset Administration Shell object</param>
+ /// <returns></returns>
+ /// <response code="201">Asset Administration Shell created successfully</response>
+ /// <response code="400">Bad Request</response>
+ /// <response code="502">Bad Gateway</response>
+ [HttpPost("shells", Name = "CreateNewAssetAdministrationShell")]
+ [ProducesResponseType(typeof(IResult<IAssetAdministrationShell>), 201)]
+ public IActionResult CreateNewAssetAdministrationShell([FromBody] IAssetAdministrationShell aas)
+ {
+ var result = CreateAssetAdministrationShell(aas);
+ return EvaluateResult(result, CrudOperation.Create);
+ }
+ /// <summary>
+ /// Deletes a specific Asset Administration Shell at the aggregator service endpoint
+ /// </summary>
+ /// <param name="aasId">The Asset Administration Shell's unique id</param>
+ /// <returns></returns>
+ /// <response code="200">Asset Administration Shell deleted successfully</response>
+ /// <response code="400">Bad Request</response>
+ /// <response code="502">Bad Gateway</response>
+ [HttpDelete("shells/{aasId}", Name = "DeleteAssetAdministrationShellByIdShort")]
+ [ProducesResponseType(typeof(IResult), 200)]
+ public IActionResult DeleteAssetAdministrationShellByIdShort(string aasId)
+ {
+ var result = DeleteAssetAdministrationShell(aasId);
+ return EvaluateResult(result, CrudOperation.Delete);
+ }
+
+ #endregion
+
+ #region Helper Methods
+
+ private static IActionResult AggregateResultHandling(IResult result)
+ {
+ if (result != null)
+ {
+ var objResult = new ObjectResult(result);
+
+ if (result.Success)
+ {
+ if (result.Entity == null)
+ objResult.StatusCode = 404;
+ else
+ objResult.StatusCode = 200;
+ }
+ else if (Utils.ResultHandling.Utils.TryParseStatusCode(result, out int httpStatusCode))
+ objResult.StatusCode = httpStatusCode;
+ else
+ objResult.StatusCode = 502;
+
+ return objResult;
+ }
+ return new BadRequestResult();
+ }
+ #endregion
+
+ #region Interface Implementation AssetAdministrationShellAggregator
+ public void RegisterAssetAdministrationShellServiceProvider(string id, IAssetAdministrationShellServiceProvider assetAdministrationShellServiceProvider)
+ {
+ aggregator.RegisterAssetAdministrationShellServiceProvider(id, assetAdministrationShellServiceProvider);
+ }
+
+ public IAssetAdministrationShellServiceProvider GetAssetAdministrationShellServiceProvider(string id)
+ {
+ return aggregator.GetAssetAdministrationShellServiceProvider(id);
+ }
+
+ public IEnumerable<IAssetAdministrationShellServiceProvider> GetAssetAdministrationShellServiceProviders()
+ {
+ return aggregator.GetAssetAdministrationShellServiceProviders();
+ }
+
+ public void BindTo(IEnumerable<IAssetAdministrationShell> element)
+ {
+ aggregator.BindTo(element);
+ }
+
+ public IEnumerable<IAssetAdministrationShell> GetBinding()
+ {
+ return aggregator.GetBinding();
+ }
+
+ public IResult<IAssetAdministrationShell> CreateAssetAdministrationShell(IAssetAdministrationShell aas)
+ {
+ return aggregator.CreateAssetAdministrationShell(aas);
+ }
+
+ public IResult<IAssetAdministrationShell> RetrieveAssetAdministrationShell(string aasId)
+ {
+ return aggregator.RetrieveAssetAdministrationShell(aasId);
+ }
+
+ public IResult<IElementContainer<IAssetAdministrationShell>> RetrieveAssetAdministrationShells()
+ {
+ return aggregator.RetrieveAssetAdministrationShells();
+ }
+
+ public IResult UpdateAssetAdministrationShell(string aasId, IAssetAdministrationShell aas)
+ {
+ return aggregator.UpdateAssetAdministrationShell(aasId, aas);
+ }
+
+ public IResult DeleteAssetAdministrationShell(string aasId)
+ {
+ return aggregator.DeleteAssetAdministrationShell(aasId);
+ }
+
+
+
+
+ #endregion
+ }
+}
diff --git a/sdks/dotnet/basyx-core/BaSyx.API.Http.Controllers/AssetAdministrationShell/AssetAdministrationShellServices.cs b/sdks/dotnet/basyx-core/BaSyx.API.Http.Controllers/AssetAdministrationShell/AssetAdministrationShellServices.cs
new file mode 100644
index 0000000..b3b794d
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.API.Http.Controllers/AssetAdministrationShell/AssetAdministrationShellServices.cs
@@ -0,0 +1,456 @@
+/*******************************************************************************
+* Copyright (c) 2020 Robert Bosch GmbH
+* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
+*
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License 2.0 which is available at
+* http://www.eclipse.org/legal/epl-2.0
+*
+* SPDX-License-Identifier: EPL-2.0
+*******************************************************************************/
+using System.Collections.Generic;
+using Microsoft.AspNetCore.Mvc;
+using BaSyx.Models.Core.AssetAdministrationShell.Generics;
+using BaSyx.Utils.ResultHandling;
+using BaSyx.API.Components;
+using BaSyx.Models.Connectivity;
+using static BaSyx.Utils.ResultHandling.Utils;
+using System.Linq;
+using BaSyx.Models.Core.AssetAdministrationShell.Implementations;
+using Microsoft.Extensions.DependencyInjection;
+using BaSyx.Models.Connectivity.Descriptors;
+using BaSyx.Models.Core.Common;
+using BaSyx.Models.Core.AssetAdministrationShell.Implementations.SubmodelElementTypes;
+using BaSyx.Models.Core.AssetAdministrationShell.Generics.SubmodelElementTypes;
+
+namespace BaSyx.API.Http.Controllers
+{
+ /// <summary>
+ /// All Asset Administration Shell Services provided by the component
+ /// </summary>
+ public class AssetAdministrationShellServices : Controller, IAssetAdministrationShellServiceProvider
+ {
+ private readonly IAssetAdministrationShellServiceProvider assetAdministrationShellServiceProvider;
+
+ public IAssetAdministrationShellDescriptor ServiceDescriptor { get; }
+
+ public IAssetAdministrationShell AssetAdministrationShell => assetAdministrationShellServiceProvider.GetBinding();
+
+ public ISubmodelServiceProviderRegistry SubmodelRegistry => assetAdministrationShellServiceProvider.SubmodelRegistry;
+
+ public AssetAdministrationShellServices(IAssetAdministrationShellServiceProvider assetAdministrationShellServiceProvider)
+ {
+ this.assetAdministrationShellServiceProvider = assetAdministrationShellServiceProvider;
+ ServiceDescriptor = assetAdministrationShellServiceProvider.ServiceDescriptor;
+ }
+
+ public void BindTo(IAssetAdministrationShell element)
+ {
+ assetAdministrationShellServiceProvider.BindTo(element);
+ }
+ public IAssetAdministrationShell GetBinding()
+ {
+ return assetAdministrationShellServiceProvider.GetBinding();
+ }
+
+
+ #region REST-Interface AssetAdministrationShell
+
+ /// <summary>
+ /// Retrieves the Asset Administration Shell
+ /// </summary>
+ /// <returns></returns>
+ /// <response code="200">Success</response>
+ /// <response code="502">Bad Gateway - Asset Administration Shell not available</response>
+ [HttpGet("aas", Name = "GetAAS")]
+ [ProducesResponseType(typeof(AssetAdministrationShellDescriptor), 200)]
+ [ProducesResponseType(typeof(Result), 502)]
+ public IActionResult GetAAS()
+ {
+ var serviceDescriptor = assetAdministrationShellServiceProvider?.ServiceDescriptor;
+
+ if(serviceDescriptor == null)
+ return StatusCode(502);
+ else
+ return new OkObjectResult(assetAdministrationShellServiceProvider.ServiceDescriptor);
+ }
+
+ #region Submodel - REST-Calls
+ /// <summary>
+ /// Adds a new Submodel to an existing Asset Administration Shell
+ /// </summary>
+ /// <param name="submodel">The Submodel's description object</param>
+ /// <returns></returns>
+ /// <response code="201">Submodel created successfully</response>
+ /// <response code="400">Bad Request</response>
+ [HttpPost("aas/submodels", Name = "PostSubmodel")]
+ [ProducesResponseType(typeof(BaSyx.Models.Core.AssetAdministrationShell.Implementations.Submodel), 201)]
+ [ProducesResponseType(typeof(Result), 400)]
+ public IActionResult PostSubmodel([FromBody] ISubmodel submodel)
+ {
+ var result = CreateSubmodel(submodel);
+ if(result.Success && result.Entity != null)
+ {
+ var spEndpoints = ServiceDescriptor.Endpoints.ToList().ConvertAll(c => new HttpEndpoint(DefaultEndpointRegistration.GetSubmodelEndpoint(c, submodel.IdShort)));
+ ISubmodelDescriptor descriptor = new SubmodelDescriptor(submodel, spEndpoints);
+
+ SubmodelServiceProvider cssp = new SubmodelServiceProvider(submodel, descriptor);
+ assetAdministrationShellServiceProvider.SubmodelRegistry.RegisterSubmodelServiceProvider(submodel.IdShort, cssp);
+ }
+ return EvaluateResult(result, CrudOperation.Create, "aas/submodels/" + submodel.IdShort);
+ }
+ /// <summary>
+ /// Retrieves the Submodel from the Asset Administration Shell
+ /// </summary>
+ /// <param name="submodelId">The Submodel's unique id</param>
+ /// <returns></returns>
+ /// <response code="200">Submodel retrieved successfully</response>
+ /// <response code="404">No Submodel Service Provider found</response>
+ [HttpGet("aas/submodels/{submodelId}", Name = "GetSubmodelById")]
+ [ProducesResponseType(typeof(BaSyx.Models.Core.AssetAdministrationShell.Implementations.Submodel), 200)]
+ [ProducesResponseType(typeof(Result), 404)]
+ public IActionResult GetSubmodelById(string submodelId)
+ {
+ var submodelProvider = GetSubmodelServiceProvider(submodelId);
+
+ if (!submodelProvider.Success || submodelProvider?.Entity == null)
+ return NotFound(new Result(false, new NotFoundMessage("Submodel")));
+
+ return new OkObjectResult(submodelProvider.Entity.GetBinding());
+ }
+ /// <summary>
+ /// Deletes a specific Submodel from the Asset Administration Shell
+ /// </summary>
+ /// <param name="submodelId">The Submodel's idShort</param>
+ /// <returns></returns>
+ /// <response code="204">Submodel deleted successfully</response>
+ /// <response code="400">Bad Request</response>
+ [HttpDelete("aas/submodels/{submodelId}", Name = "DeleteSubmodelById")]
+ [ProducesResponseType(typeof(Result), 400)]
+ public IActionResult DeleteSubmodelById(string submodelId)
+ {
+ var result = DeleteSubmodel(submodelId);
+ return EvaluateResult(result, CrudOperation.Delete);
+ }
+ /// <summary>
+ /// Retrieves all Submodels from the Asset Administration Shell
+ /// </summary>
+ /// <returns></returns>
+ /// <response code="200">Returns a list of found Submodels</response>
+ /// <response code="404">No Submodel Service Providers found</response>
+ [HttpGet("aas/submodels", Name = "GetSubmodels")]
+ [ProducesResponseType(typeof(BaSyx.Models.Core.AssetAdministrationShell.Implementations.Submodel[]), 200)]
+ [ProducesResponseType(typeof(Result), 404)]
+ public IActionResult GetSubmodels()
+ {
+ var submodelProviders = GetSubmodelServiceProviders();
+
+ if (!submodelProviders.Success || submodelProviders.Entity?.Count() == 0)
+ return NotFound(new Result(false, new NotFoundMessage("Submodels")));
+
+ var submodelBindings = submodelProviders.Entity.Select(s => s.GetBinding()).ToArray();
+
+ return new OkObjectResult(submodelBindings);
+ }
+
+ #endregion
+
+ #endregion
+
+ #region REST-Interface Submodel
+
+ /// <summary>
+ /// Retrieves all Properties from the current Submodel
+ /// </summary>
+ /// <returns></returns>
+ /// <response code="200">Returns a list of found Properties</response>
+ /// <response code="404">Submodel not found / No Properties found</response>
+ [HttpGet("aas/submodels/{submodelId}/submodel/properties", Name = "RoutedGetProperties")]
+ [ProducesResponseType(typeof(Property[]), 200)]
+ [ProducesResponseType(typeof(Result), 404)]
+ public IActionResult RoutedGetProperties()
+ {
+ var controller = HttpContext.RequestServices.GetService<SubmodelServices>();
+ return controller.GetProperties();
+ }
+
+ /// <summary>
+ /// Retrieves all Operations from the current Submodel
+ /// </summary>
+ /// <returns></returns>
+ /// <response code="200">Success</response>
+ /// <response code="404">Submodel not found / No Operations found</response>
+ [HttpGet("aas/submodels/{submodelId}/submodel/operations", Name = "RoutedGetOperations")]
+ [ProducesResponseType(typeof(Operation[]), 200)]
+ [ProducesResponseType(typeof(Result), 404)]
+ public IActionResult RoutedGetOperations()
+ {
+ var controller = HttpContext.RequestServices.GetService<SubmodelServices>();
+ return controller.GetOperations();
+ }
+
+ /// <summary>
+ /// Retrieves all Events from the current Submodel
+ /// </summary>
+ /// <returns></returns>
+ /// <response code="200">Success</response>
+ /// <response code="404">Submodel not found / No Events found</response>
+ [HttpGet("aas/submodels/{submodelId}/submodel/events", Name = "RoutedGetEvents")]
+ [ProducesResponseType(typeof(Event[]), 200)]
+ [ProducesResponseType(typeof(Result), 404)]
+ public IActionResult RoutedGetEvents()
+ {
+ var controller = HttpContext.RequestServices.GetService<SubmodelServices>();
+ return controller.GetEvents();
+ }
+
+ #region Property - REST-Calls
+ /// <summary>
+ /// Adds a new Property to the Asset Administration Shell's Submodel
+ /// </summary>
+ /// <param name="property">The Property's description object</param>
+ /// <returns></returns>
+ /// <response code="201">DataElement created successfully</response>
+ /// <response code="400">Bad Request</response>
+ /// <response code="404">Submodel not found</response>
+ [HttpPost("aas/submodels/{submodelId}/submodel/properties", Name = "RoutedPostProperty")]
+ [ProducesResponseType(typeof(Property), 201)]
+ [ProducesResponseType(typeof(Result), 400)]
+ [ProducesResponseType(typeof(Result), 404)]
+ public IActionResult RoutedPostDataElement([FromBody] IProperty property)
+ {
+ var controller = HttpContext.RequestServices.GetService<SubmodelServices>();
+ return controller.PostProperty(property);
+ }
+ /// <summary>
+ /// Retrieves a specific Property from the Asset Administrations's Submodel
+ /// </summary>
+ /// <param name="propertyId">The Property's short id</param>
+ /// <returns></returns>
+ /// <response code="200">Returns the requested Property</response>
+ /// <response code="404">Submodel/Property not found</response>
+ [HttpGet("aas/submodels/{submodelId}/submodel/properties/{propertyId}", Name = "RoutedGetProperty")]
+ [ProducesResponseType(typeof(Property), 200)]
+ [ProducesResponseType(typeof(Result), 404)]
+ public IActionResult RoutedGetDataElement(string propertyId)
+ {
+ var controller = HttpContext.RequestServices.GetService<SubmodelServices>();
+ return controller.GetProperty(propertyId);
+ }
+
+ /// <summary>
+ /// Retrieves the value of a specific Property from the Asset Administrations Shell's Submodel
+ /// </summary>
+ /// <param name="propertyId">The Property's short id</param>
+ /// <returns></returns>
+ /// <response code="200">Returns the requested Property's value</response>
+ /// <response code="404">Submodel/Property not found</response>
+ [HttpGet("aas/submodels/{submodelId}/submodel/properties/{propertyId}/value", Name = "RoutedGetPropertyValue")]
+ [ProducesResponseType(typeof(ElementValue), 200)]
+ [ProducesResponseType(typeof(Result), 404)]
+ public IActionResult RoutedGetPropertyValue(string propertyId)
+ {
+ var controller = HttpContext.RequestServices.GetService<SubmodelServices>();
+ return controller.GetPropertyValue(propertyId);
+ }
+
+ /// <summary>
+ /// Updates the Asset Administration Shell's Submodel's Property
+ /// </summary>
+ /// <param name="propertyId">The Property's short id</param>
+ /// <param name="value">The new value</param>
+ /// <returns></returns>
+ /// <response code="200">Property's value changed successfully</response>
+ /// <response code="404">Submodel/Property not found</response>
+ [HttpPut("aas/submodels/{submodelId}/submodel/properties/{propertyId}/value", Name = "RoutedPutPropertyValue")]
+ [ProducesResponseType(typeof(ElementValue), 200)]
+ [ProducesResponseType(typeof(Result), 404)]
+ public IActionResult RoutedPutPropertyValue(string propertyId, [FromBody] IValue value)
+ {
+ var controller = HttpContext.RequestServices.GetService<SubmodelServices>();
+ return controller.PutPropertyValue(propertyId, value);
+ }
+ /// <summary>
+ /// Deletes a specific Property from the Asset Administration Shell's Submodel
+ /// </summary>
+ /// <param name="propertyId">The Property's short id</param>
+ /// <returns></returns>
+ /// <response code="204">Property deleted successfully</response>
+ /// <response code="404">Submodel not found</response>
+ [HttpDelete("aas/submodels/{submodelId}/submodel/properties/{propertyId}", Name = "RoutedDelProperty")]
+ [ProducesResponseType(typeof(IResult), 200)]
+ public IActionResult RoutedDelProperty(string propertyId)
+ {
+ var controller = HttpContext.RequestServices.GetService<SubmodelServices>();
+ return controller.DelProperty(propertyId);
+ }
+ #endregion
+ #region Operation - REST-Calls
+ /// <summary>
+ /// Adds a new operation to the Asset Administraiton Shell's Submodel
+ /// </summary>
+ /// <param name="operation">The operation description object</param>
+ /// <returns></returns>
+ /// <response code="201">Operation created successfully</response>
+ /// <response code="400">Bad Request</response>
+ /// <response code="404">Submodel not found</response>
+ [HttpPost("aas/submodels/{submodelId}/submodel/operations", Name = "RoutedPostOperation")]
+ [ProducesResponseType(typeof(Operation), 201)]
+ [ProducesResponseType(typeof(Result), 400)]
+ [ProducesResponseType(typeof(Result), 404)]
+ public IActionResult RoutedPostOperation([FromBody] IOperation operation)
+ {
+ var controller = HttpContext.RequestServices.GetService<SubmodelServices>();
+ return controller.PostOperation(operation);
+ }
+ /// <summary>
+ /// Retrieves a specific Operation from the Asset Administration Shell's Submodel
+ /// </summary>
+ /// <param name="operationId">The Operation's short id</param>
+ /// <returns></returns>
+ /// <response code="200">Success</response>
+ /// <response code="404">Submodel/Operation not found</response>
+ [HttpGet("aas/submodels/{submodelId}/submodel/operations/{operationId}", Name = "RoutedGetOperation")]
+ [ProducesResponseType(typeof(Operation), 200)]
+ [ProducesResponseType(typeof(Result), 404)]
+ public IActionResult RoutedGetOperation(string operationId)
+ {
+ var controller = HttpContext.RequestServices.GetService<SubmodelServices>();
+ return controller.GetOperation(operationId);
+ }
+ /// <summary>
+ /// Deletes a specific Operation from the Asset Administration Shell's Submodel
+ /// </summary>
+ /// <param name="operationId">The Operation's short id</param>
+ /// <returns></returns>
+ /// <response code="204">Operation deleted successfully</response>
+ /// <response code="404">Submodel not found</response>
+ [HttpDelete("aas/submodels/{submodelId}/submodel/operations/{operationId}", Name = "RoutedDelOperation")]
+ [ProducesResponseType(typeof(Result), 404)]
+ public IActionResult RoutedDelOperation(string operationId)
+ {
+ var controller = HttpContext.RequestServices.GetService<SubmodelServices>();
+ return controller.DelOperation(operationId);
+ }
+ /// <summary>
+ /// Invokes a specific operation from the Asset Administration Shell' Submodel with a list of input parameters
+ /// </summary>
+ /// <param name="operationId">The operation's short id</param>
+ /// <param name="timeout">Timeout for the operation to finish</param>
+ /// <param name="inputArguments">List of input arguments</param>
+ /// <returns></returns>
+ /// <response code="200">Operation invoked successfully</response>
+ /// <response code="400">Bad Request</response>
+ /// <response code="404">Submodel not found</response>
+ [HttpPost("aas/submodels/{submodelId}/submodel/operations/{operationId}", Name = "RoutedInvokeOperationRest")]
+ [ProducesResponseType(typeof(SubmodelElement[]), 200)]
+ [ProducesResponseType(typeof(Result), 400)]
+ [ProducesResponseType(typeof(Result), 404)]
+ public IActionResult RoutedInvokeOperationRest(string operationId, [FromQuery] int timeout, [FromBody] OperationVariableSet inputArguments)
+ {
+ var controller = HttpContext.RequestServices.GetService<SubmodelServices>();
+ return controller.InvokeOperationRest(operationId, timeout, inputArguments);
+ }
+
+ #endregion
+ #region Event - REST-Calls
+ /// <summary>
+ /// Adds a new event to the Asset Administration Shell's Submodel
+ /// </summary>
+ /// <param name="eventable">The Event description object</param>
+ /// <returns></returns>
+ /// <response code="201">Event created successfully</response>
+ /// <response code="400">Bad Request</response>
+ /// <response code="404">Submodel not found</response>
+ [HttpPost("aas/submodels/{submodelId}/submodel/events", Name = "RoutedPostEvent")]
+ [ProducesResponseType(typeof(Event), 201)]
+ [ProducesResponseType(typeof(Result), 400)]
+ [ProducesResponseType(typeof(Result), 404)]
+ public IActionResult RoutedPostEvent([FromBody] IEvent eventable)
+ {
+ var controller = HttpContext.RequestServices.GetService<SubmodelServices>();
+ return controller.PostEvent(eventable);
+ }
+ /// <summary>
+ /// Retrieves a specific event from the Asset Administration Shell's Submodel
+ /// </summary>
+ /// <param name="eventId">The Event's short id</param>
+ /// <returns></returns>
+ /// <response code="200">Success</response>
+ /// <response code="404">Submodel/Event not found</response>
+ [HttpGet("aas/submodels/{submodelId}/submodel/events/{eventId}", Name = "RoutedGetEvent")]
+ [ProducesResponseType(typeof(Event), 200)]
+ [ProducesResponseType(typeof(Result), 404)]
+ public IActionResult RoutedGetEvent(string eventId)
+ {
+ var controller = HttpContext.RequestServices.GetService<SubmodelServices>();
+ return controller.GetEvent(eventId);
+ }
+ /// <summary>
+ /// Deletes a specific event from the Asset Administration Shell's Submodel
+ /// </summary>
+ /// <param name="eventId">The Event's short id</param>
+ /// <returns></returns>
+ /// <response code="204">Event deleted successfully</response>
+ /// <response code="404">Submodel not found</response>
+ [HttpDelete("aas/submodels/{submodelId}/submodel/events/{eventId}", Name = "RoutedDelEvent")]
+ [ProducesResponseType(typeof(Result), 404)]
+ public IActionResult RoutedDelEvent(string eventId)
+ {
+ var controller = HttpContext.RequestServices.GetService<SubmodelServices>();
+ return controller.DelEvent(eventId);
+ }
+
+ #endregion
+ #endregion
+
+ #region Interface Implementation AssetAdministrationShellServiceProvider
+
+ public void RegisterSubmodelServiceProvider(string id, ISubmodelServiceProvider submodelServiceProvider)
+ {
+ assetAdministrationShellServiceProvider.SubmodelRegistry.RegisterSubmodelServiceProvider(id, submodelServiceProvider);
+ }
+
+ public IResult<ISubmodelServiceProvider> GetSubmodelServiceProvider(string id)
+ {
+ return assetAdministrationShellServiceProvider.SubmodelRegistry.GetSubmodelServiceProvider(id);
+ }
+
+ public IResult<ISubmodel> CreateSubmodel(ISubmodel submodel)
+ {
+ return assetAdministrationShellServiceProvider.CreateSubmodel(submodel);
+ }
+
+ public IResult<ISubmodel> RetrieveSubmodel(string submodelId)
+ {
+ return assetAdministrationShellServiceProvider.RetrieveSubmodel(submodelId);
+ }
+
+ public IResult<IElementContainer<ISubmodel>> RetrieveSubmodels()
+ {
+ return assetAdministrationShellServiceProvider.RetrieveSubmodels();
+ }
+
+ public IResult DeleteSubmodel(string submodelId)
+ {
+ return assetAdministrationShellServiceProvider.DeleteSubmodel(submodelId);
+ }
+
+ public IResult<IEnumerable<ISubmodelServiceProvider>> GetSubmodelServiceProviders()
+ {
+ return assetAdministrationShellServiceProvider.SubmodelRegistry.GetSubmodelServiceProviders();
+ }
+
+ public IResult<IAssetAdministrationShell> RetrieveAssetAdministrationShell()
+ {
+ return assetAdministrationShellServiceProvider.RetrieveAssetAdministrationShell();
+ }
+
+ #endregion
+
+ #region Helper Methods
+
+
+ #endregion
+ }
+}
diff --git a/sdks/dotnet/basyx-core/BaSyx.API.Http.Controllers/AssetAdministrationShell/SubmodelServices.cs b/sdks/dotnet/basyx-core/BaSyx.API.Http.Controllers/AssetAdministrationShell/SubmodelServices.cs
new file mode 100644
index 0000000..be23350
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.API.Http.Controllers/AssetAdministrationShell/SubmodelServices.cs
@@ -0,0 +1,555 @@
+/*******************************************************************************
+* Copyright (c) 2020 Robert Bosch GmbH
+* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
+*
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License 2.0 which is available at
+* http://www.eclipse.org/legal/epl-2.0
+*
+* SPDX-License-Identifier: EPL-2.0
+*******************************************************************************/
+using System.Collections.Generic;
+using Microsoft.AspNetCore.Mvc;
+using BaSyx.Models.Core.AssetAdministrationShell.Generics;
+using BaSyx.Utils.ResultHandling;
+using BaSyx.API.Components;
+using static BaSyx.Utils.ResultHandling.Utils;
+using BaSyx.Utils.Client;
+using System;
+using BaSyx.API.AssetAdministrationShell;
+using BaSyx.Models.Core;
+using Newtonsoft.Json.Linq;
+using BaSyx.Models.Extensions;
+using BaSyx.Models.Core.AssetAdministrationShell.Implementations;
+using BaSyx.Models.Core.AssetAdministrationShell.Generics.SubmodelElementTypes;
+using BaSyx.Models.Core.AssetAdministrationShell.Implementations.SubmodelElementTypes;
+using BaSyx.Models.Connectivity.Descriptors;
+using BaSyx.Models.Core.Common;
+
+namespace BaSyx.API.Http.Controllers
+{
+ /// <summary>
+ /// All Asset Administration Shell Services provided by the component
+ /// </summary>
+ public class SubmodelServices : Controller, ISubmodelServiceProvider
+ {
+ private readonly ISubmodelServiceProvider submodelServiceProvider;
+
+ public ISubmodel Submodel => submodelServiceProvider?.GetBinding();
+ public ISubmodelDescriptor ServiceDescriptor { get; }
+
+ public SubmodelServices(ISubmodelServiceProvider submodelServiceProvider)
+ {
+ this.submodelServiceProvider = submodelServiceProvider;
+ ServiceDescriptor = submodelServiceProvider?.ServiceDescriptor;
+ }
+
+ public void BindTo(ISubmodel element)
+ {
+ submodelServiceProvider.BindTo(element);
+ }
+ public ISubmodel GetBinding()
+ {
+ return submodelServiceProvider.GetBinding();
+ }
+
+
+ #region REST-Interface Submodel
+
+ /// <summary>
+ /// Retrieves a customizable table version of a Submodel
+ /// </summary>
+ /// <returns></returns>
+ /// <response code="200">Success</response>
+ /// <response code="404">Submodel not found</response>
+ [HttpGet("submodel/table", Name = "GetSubmodelAsTable")]
+ [ProducesResponseType(typeof(Result), 404)]
+ public IActionResult GetSubmodelAsTable([FromQuery] string columns)
+ {
+ var result = RetrieveSubmodel();
+
+ if (result != null && result.Entity != null)
+ {
+ string[] columnNames = columns.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries);
+ JToken customizedSubmodel = result.Entity.CustomizeSubmodel(columnNames);
+ return new JsonResult(customizedSubmodel);
+ }
+
+ return EvaluateResult(result, CrudOperation.Retrieve);
+ }
+
+
+ /// <summary>
+ /// Retrieves the minimized version of a Submodel
+ /// </summary>
+ /// <returns></returns>
+ /// <response code="200">Success</response>
+ /// <response code="404">Submodel not found</response>
+ [HttpGet("submodel/values", Name = "GetSubmodelValues")]
+ [ProducesResponseType(typeof(Result), 404)]
+ public IActionResult GetMinimizedSubmodel()
+ {
+ var result = RetrieveSubmodel();
+
+ if (result != null && result.Entity != null)
+ {
+ JObject minimizedSubmodel = result.Entity.MinimizeSubmodel();
+ return new JsonResult(minimizedSubmodel);
+ }
+
+ return EvaluateResult(result, CrudOperation.Retrieve);
+ }
+
+ /// <summary>
+ /// Retrieves the Submodel
+ /// </summary>
+ /// <returns></returns>
+ /// <response code="200">Success</response>
+ /// <response code="404">Submodel not found</response>
+ [HttpGet("submodel", Name = "GetSubmodel")]
+ [ProducesResponseType(typeof(BaSyx.Models.Core.AssetAdministrationShell.Implementations.Submodel), 200)]
+ [ProducesResponseType(typeof(Result), 404)]
+ public IActionResult GetSubmodel()
+ {
+ var result = RetrieveSubmodel();
+ return EvaluateResult(result, CrudOperation.Retrieve);
+ }
+
+ /// <summary>
+ /// Retrieves all SubmodelElements from the current Submodel
+ /// </summary>
+ /// <returns></returns>
+ /// <response code="200">Returns a list of found SubmodelElements</response>
+ /// <response code="404">Submodel not found / No SubmodelElements found</response>
+ [HttpGet("submodel/submodelElements", Name = "GetSubmodelElements")]
+ [ProducesResponseType(typeof(Property[]), 200)]
+ [ProducesResponseType(typeof(Result), 404)]
+ public IActionResult GetSubmodelElements()
+ {
+ var result = RetrieveSubmodelElements();
+ return EvaluateResult(result, CrudOperation.Retrieve);
+ }
+
+ /// <summary>
+ /// Retrieves all Properties from the current Submodel
+ /// </summary>
+ /// <returns></returns>
+ /// <response code="200">Returns a list of found Properties</response>
+ /// <response code="404">Submodel not found / No Properties found</response>
+ [HttpGet("submodel/properties", Name = "GetProperties")]
+ [ProducesResponseType(typeof(Property[]), 200)]
+ [ProducesResponseType(typeof(Result), 404)]
+ public IActionResult GetProperties()
+ {
+ var result = RetrieveProperties();
+ return EvaluateResult(result, CrudOperation.Retrieve);
+ }
+
+ /// <summary>
+ /// Retrieves all Operations from the current Submodel
+ /// </summary>
+ /// <returns></returns>
+ /// <response code="200">Success</response>
+ /// <response code="404">Submodel not found / No Operations found</response>
+ [HttpGet("submodel/operations", Name = "GetOperations")]
+ [ProducesResponseType(typeof(Operation[]), 200)]
+ [ProducesResponseType(typeof(Result), 404)]
+ public IActionResult GetOperations()
+ {
+ var result = RetrieveOperations();
+ return EvaluateResult(result, CrudOperation.Retrieve);
+ }
+
+ /// <summary>
+ /// Retrieves all Events from the current Submodel
+ /// </summary>
+ /// <returns></returns>
+ /// <response code="200">Success</response>
+ /// <response code="404">Submodel not found / No Events found</response>
+ [HttpGet("submodel/events", Name = "GetEvents")]
+ [ProducesResponseType(typeof(Event[]), 200)]
+ [ProducesResponseType(typeof(Result), 404)]
+ public IActionResult GetEvents()
+ {
+ var result = RetrieveEvents();
+ return EvaluateResult(result, CrudOperation.Retrieve);
+ }
+
+
+
+ #region Property - REST-Calls
+ /// <summary>
+ /// Adds a new Property to the Asset Administration Shell's Submodel
+ /// </summary>
+ /// <param name="property">The Property's description object</param>
+ /// <returns></returns>
+ /// <response code="201">Property created successfully</response>
+ /// <response code="400">Bad Request</response>
+ /// <response code="404">Submodel not found</response>
+ [HttpPost("submodel/properties", Name = "PostProperty")]
+ [ProducesResponseType(typeof(Property), 201)]
+ [ProducesResponseType(typeof(Result), 400)]
+ [ProducesResponseType(typeof(Result), 404)]
+ public IActionResult PostProperty([FromBody] IProperty property)
+ {
+ var result = CreateProperty(property);
+ return EvaluateResult(result, CrudOperation.Create, "submodel/properties/" + property.IdShort);
+ }
+ /// <summary>
+ /// Retrieves a specific Property from the Asset Administrations's Submodel
+ /// </summary>
+ /// <param name="propertyId">The Property's short id</param>
+ /// <returns></returns>
+ /// <response code="200">Returns the requested Property</response>
+ /// <response code="404">Submodel/Property not found</response>
+ [HttpGet("submodel/properties/{propertyId}", Name = "GetProperty")]
+ [ProducesResponseType(typeof(Property), 200)]
+ [ProducesResponseType(typeof(Result), 404)]
+ public IActionResult GetProperty(string propertyId)
+ {
+ var result = RetrieveProperty(propertyId);
+ return EvaluateResult(result, CrudOperation.Retrieve);
+ }
+
+ /// <summary>
+ /// Retrieves the value of a specific Property from the Asset Administrations Shell's Submodel
+ /// </summary>
+ /// <param name="propertyId">The Property's short id</param>
+ /// <returns></returns>
+ /// <response code="200">Returns the requested Property's value</response>
+ /// <response code="404">Submodel/Property not found</response>
+ [HttpGet("submodel/properties/{propertyId}/value", Name = "GetPropertyValue")]
+ [ProducesResponseType(typeof(ElementValue), 200)]
+ [ProducesResponseType(typeof(Result), 404)]
+ public IActionResult GetPropertyValue(string propertyId)
+ {
+ var result = RetrievePropertyValue(propertyId);
+ return EvaluateResult(result, CrudOperation.Retrieve);
+ }
+
+ /// <summary>
+ /// Updates the Asset Administration Shell's Submodel's Property
+ /// </summary>
+ /// <param name="propertyId">The Property's short id</param>
+ /// <param name="value">The new value</param>
+ /// <returns></returns>
+ /// <response code="200">Property's value changed successfully</response>
+ /// <response code="404">Submodel/Property not found</response>
+ [HttpPut("submodel/properties/{propertyId}/value", Name = "PutPropertyValue")]
+ [ProducesResponseType(typeof(ElementValue), 200)]
+ [ProducesResponseType(typeof(Result), 404)]
+ public IActionResult PutPropertyValue(string propertyId, [FromBody] IValue value)
+ {
+ var result = UpdatePropertyValue(propertyId, value);
+ return EvaluateResult(result, CrudOperation.Update);
+ }
+ /// <summary>
+ /// Deletes a specific Property from the Asset Administration Shell's Submodel
+ /// </summary>
+ /// <param name="propertyId">The Property's short id</param>
+ /// <returns></returns>
+ /// <response code="204">Property deleted successfully</response>
+ /// <response code="404">Submodel not found</response>
+ [HttpDelete("submodel/properties/{propertyId}", Name = "DelProperty")]
+ [ProducesResponseType(typeof(IResult), 200)]
+ public IActionResult DelProperty(string propertyId)
+ {
+ var result = DeleteProperty(propertyId);
+ return EvaluateResult(result, CrudOperation.Delete);
+ }
+ #endregion
+ #region Operation - REST-Calls
+ /// <summary>
+ /// Adds a new operation to the Asset Administraiton Shell's Submodel
+ /// </summary>
+ /// <param name="operation">The operation description object</param>
+ /// <returns></returns>
+ /// <response code="201">Operation created successfully</response>
+ /// <response code="400">Bad Request</response>
+ /// <response code="404">Submodel not found</response>
+ [HttpPost("submodel/operations", Name = "PostOperation")]
+ [ProducesResponseType(typeof(Operation), 201)]
+ [ProducesResponseType(typeof(Result), 400)]
+ [ProducesResponseType(typeof(Result), 404)]
+ public IActionResult PostOperation([FromBody] IOperation operation)
+ {
+ var result = CreateOperation(operation);
+ return EvaluateResult(result, CrudOperation.Create, "submodel/operations/" + operation.IdShort);
+ }
+ /// <summary>
+ /// Retrieves a specific Operation from the Asset Administration Shell's Submodel
+ /// </summary>
+ /// <param name="operationId">The Operation's short id</param>
+ /// <returns></returns>
+ /// <response code="200">Success</response>
+ /// <response code="404">Submodel/Operation not found</response>
+ [HttpGet("submodel/operations/{operationId}", Name = "GetOperation")]
+ [ProducesResponseType(typeof(Operation), 200)]
+ [ProducesResponseType(typeof(Result), 404)]
+ public IActionResult GetOperation(string operationId)
+ {
+ var result = RetrieveOperation(operationId);
+ return EvaluateResult(result, CrudOperation.Retrieve);
+ }
+ /// <summary>
+ /// Deletes a specific Operation from the Asset Administration Shell's Submodel
+ /// </summary>
+ /// <param name="operationId">The Operation's short id</param>
+ /// <returns></returns>
+ /// <response code="204">Operation deleted successfully</response>
+ /// <response code="404">Submodel not found</response>
+ [HttpDelete("submodel/operations/{operationId}", Name = "DelOperation")]
+ [ProducesResponseType(typeof(Result), 404)]
+ public IActionResult DelOperation(string operationId)
+ {
+ var result = DeleteOperation(operationId);
+ return EvaluateResult(result, CrudOperation.Delete);
+ }
+ /// <summary>
+ /// Invokes a specific operation from the Asset Administration Shell' Submodel with a list of input parameters
+ /// </summary>
+ /// <param name="operationId">The operation's short id</param>
+ /// <param name="timeout">Timeout for the operation to finish</param>
+ /// <param name="inputArguments">List of input arguments</param>
+ /// <returns></returns>
+ /// <response code="200">Operation invoked successfully</response>
+ /// <response code="400">Bad Request</response>
+ /// <response code="404">Submodel not found</response>
+ [HttpPost("submodel/operations/{operationId}", Name = "InvokeOperationRest")]
+ [ProducesResponseType(typeof(SubmodelElement[]), 200)]
+ [ProducesResponseType(typeof(Result), 400)]
+ [ProducesResponseType(typeof(Result), 404)]
+ public IActionResult InvokeOperationRest(string operationId, [FromQuery] int timeout, [FromBody] OperationVariableSet inputArguments)
+ {
+ OperationVariableSet outputArguments = new OperationVariableSet();
+ IResult result = InvokeOperation(operationId, inputArguments, outputArguments, timeout);
+
+ if (result != null)
+ {
+ if (result.Success)
+ return new OkObjectResult(outputArguments);
+ else
+ return new BadRequestObjectResult(result);
+ }
+ return StatusCode(502);
+ }
+
+ #endregion
+ #region Event - REST-Calls
+ /// <summary>
+ /// Adds a new event to the Asset Administration Shell's Submodel
+ /// </summary>
+ /// <param name="eventable">The Event description object</param>
+ /// <returns></returns>
+ /// <response code="201">Event created successfully</response>
+ /// <response code="400">Bad Request</response>
+ /// <response code="404">Submodel not found</response>
+ [HttpPost("submodel/events", Name = "PostEvent")]
+ [ProducesResponseType(typeof(Event), 201)]
+ [ProducesResponseType(typeof(Result), 400)]
+ [ProducesResponseType(typeof(Result), 404)]
+ public IActionResult PostEvent([FromBody] IEvent eventable)
+ {
+ var result = CreateEvent(eventable);
+ return EvaluateResult(result, CrudOperation.Create, "submodel/events/" + eventable.IdShort);
+ }
+ /// <summary>
+ /// Retrieves a specific event from the Asset Administration Shell's Submodel
+ /// </summary>
+ /// <param name="eventId">The Event's short id</param>
+ /// <returns></returns>
+ /// <response code="200">Success</response>
+ /// <response code="404">Submodel/Event not found</response>
+ [HttpGet("submodel/events/{eventId}", Name = "GetEvent")]
+ [ProducesResponseType(typeof(Event), 200)]
+ [ProducesResponseType(typeof(Result), 404)]
+ public IActionResult GetEvent(string eventId)
+ {
+ var result = RetrieveEvent(eventId);
+ return EvaluateResult(result, CrudOperation.Retrieve);
+ }
+ /// <summary>
+ /// Deletes a specific event from the Asset Administration Shell's Submodel
+ /// </summary>
+ /// <param name="eventId">The Event's short id</param>
+ /// <returns></returns>
+ /// <response code="204">Event deleted successfully</response>
+ /// <response code="404">Submodel not found</response>
+ [HttpDelete("submodel/events/{eventId}", Name = "DelEvent")]
+ [ProducesResponseType(typeof(Result), 404)]
+ public IActionResult DelEvent(string eventId)
+ {
+ var result = DeleteEvent(eventId);
+ return EvaluateResult(result, CrudOperation.Delete);
+ }
+
+
+ #endregion
+
+ #endregion
+
+ #region Interface Implementation SubmodelServiceProvider
+
+ public IResult<IOperation> CreateOperation(IOperation operation)
+ {
+ return submodelServiceProvider.CreateOperation(operation);
+ }
+
+ public IResult<IElementContainer<IOperation>> RetrieveOperations()
+ {
+ return submodelServiceProvider.RetrieveOperations();
+ }
+
+ public IResult<IOperation> RetrieveOperation(string operationId)
+ {
+ return submodelServiceProvider.RetrieveOperation(operationId);
+ }
+
+ public IResult DeleteOperation(string operationId)
+ {
+ return submodelServiceProvider.DeleteOperation(operationId);
+ }
+
+ public IResult InvokeOperation(string operationId, IOperationVariableSet inputArguments, IOperationVariableSet outputArguments, int timeout)
+ {
+ return submodelServiceProvider.InvokeOperation(operationId, inputArguments, outputArguments, timeout);
+ }
+
+ public IResult<IProperty> CreateProperty(IProperty dataElement)
+ {
+ return submodelServiceProvider.CreateProperty(dataElement);
+ }
+
+ public IResult<IElementContainer<IProperty>> RetrieveProperties()
+ {
+ return submodelServiceProvider.RetrieveProperties();
+ }
+
+ public IResult<IProperty> RetrieveProperty(string propertyId)
+ {
+ return submodelServiceProvider.RetrieveProperty(propertyId);
+ }
+
+ public IResult UpdatePropertyValue(string propertyId, IValue propertyValue)
+ {
+ return submodelServiceProvider.UpdatePropertyValue(propertyId, propertyValue);
+ }
+
+ public IResult DeleteProperty(string propertyId)
+ {
+ return submodelServiceProvider.DeleteProperty(propertyId);
+ }
+
+ public IResult<IEvent> CreateEvent(IEvent eventable)
+ {
+ return submodelServiceProvider.CreateEvent(eventable);
+ }
+
+ public IResult<IElementContainer<IEvent>> RetrieveEvents()
+ {
+ return submodelServiceProvider.RetrieveEvents();
+ }
+
+ public IResult<IEvent> RetrieveEvent(string eventId)
+ {
+ return submodelServiceProvider.RetrieveEvent(eventId);
+ }
+
+ public IResult ThrowEvent(IPublishableEvent publishableEvent, string topic, Action<IMessagePublishedEventArgs> MessagePublished, byte qosLevel, bool retain)
+ {
+ return submodelServiceProvider.ThrowEvent(publishableEvent, topic, MessagePublished, qosLevel, retain);
+ }
+
+ public IResult DeleteEvent(string eventId)
+ {
+ return submodelServiceProvider.DeleteEvent(eventId);
+ }
+
+ public Delegate RetrieveMethodDelegate(string operationId)
+ {
+ return submodelServiceProvider.RetrieveMethodDelegate(operationId);
+ }
+
+ public void RegisterMethodCalledHandler(string operationId, Delegate handler)
+ {
+ submodelServiceProvider.RegisterMethodCalledHandler(operationId, handler);
+ }
+
+ public void ConfigureEventHandler(IMessageClient messageClient)
+ {
+ submodelServiceProvider.ConfigureEventHandler(messageClient);
+ }
+
+ public IResult<IValue> RetrievePropertyValue(string propertyId)
+ {
+ return submodelServiceProvider.RetrievePropertyValue(propertyId);
+ }
+
+ public PropertyHandler RetrievePropertyHandler(string propertyId)
+ {
+ return submodelServiceProvider.RetrievePropertyHandler(propertyId);
+ }
+
+ public void RegisterPropertyHandler(string propertyId, PropertyHandler handler)
+ {
+ submodelServiceProvider.RegisterPropertyHandler(propertyId, handler);
+ }
+
+ public void SubscribeUpdates(string propertyId, Action<IValue> updateFunction)
+ {
+ submodelServiceProvider.SubscribeUpdates(propertyId, updateFunction);
+ }
+
+ public void PublishUpdate(string propertyId, IValue propertyValue)
+ {
+ submodelServiceProvider.PublishUpdate(propertyId, propertyValue);
+ }
+
+ public IResult<ISubmodel> RetrieveSubmodel()
+ {
+ return submodelServiceProvider.RetrieveSubmodel();
+ }
+
+ public void RegisterEventDelegate(string eventId, EventDelegate eventDelegate)
+ {
+ submodelServiceProvider.RegisterEventDelegate(eventId, eventDelegate);
+ }
+
+ public IResult<ISubmodelElement> CreateSubmodelElement(ISubmodelElement submodelElement)
+ {
+ return submodelServiceProvider.CreateSubmodelElement(submodelElement);
+ }
+
+ public IResult<IElementContainer<ISubmodelElement>> RetrieveSubmodelElements()
+ {
+ return submodelServiceProvider.RetrieveSubmodelElements();
+ }
+
+ public IResult<ISubmodelElement> RetrieveSubmodelElement(string submodelElementId)
+ {
+ return submodelServiceProvider.RetrieveSubmodelElement(submodelElementId);
+ }
+
+ public IResult<IValue> RetrieveSubmodelElementValue(string submodelElementId)
+ {
+ return submodelServiceProvider.RetrieveSubmodelElementValue(submodelElementId);
+ }
+
+ public IResult UpdateSubmodelElement(string submodelElementId, ISubmodelElement submodelElement)
+ {
+ return submodelServiceProvider.UpdateSubmodelElement(submodelElementId, submodelElement);
+ }
+
+ public IResult DeleteSubmodelElement(string submodelElementId)
+ {
+ return submodelServiceProvider.DeleteSubmodelElement(submodelElementId);
+ }
+
+ #endregion
+
+ #region Helper Methods
+
+
+ #endregion
+ }
+}
diff --git a/sdks/dotnet/basyx-core/BaSyx.API.Http.Controllers/BaSyx.API.Http.Controllers.csproj b/sdks/dotnet/basyx-core/BaSyx.API.Http.Controllers/BaSyx.API.Http.Controllers.csproj
new file mode 100644
index 0000000..c1ce478
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.API.Http.Controllers/BaSyx.API.Http.Controllers.csproj
@@ -0,0 +1,52 @@
+<Project Sdk="Microsoft.NET.Sdk">
+
+ <PropertyGroup>
+ <TargetFramework>netstandard2.0</TargetFramework>
+ <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
+ <Authors>Constantin Ziesche</Authors>
+ <Copyright>Copyright 2019 - Robert Bosch GmbH</Copyright>
+ <PackageProjectUrl>https://wiki.eclipse.org/BaSyx</PackageProjectUrl>
+ <RepositoryUrl>https://git.eclipse.org/r/plugins/gitiles/basyx/basyx/+/master/sdks/csnet/</RepositoryUrl>
+ <PackageLicenseUrl></PackageLicenseUrl>
+ <Description>The official BaSyx HTTP Controller Collection</Description>
+ <Company>Robert Bosch GmbH</Company>
+ <PackageTags>BaSys BaSyx HTTP API Controllers</PackageTags>
+ <PackageLicenseExpression>EPL-2.0</PackageLicenseExpression>
+ <RunPostBuildEvent>OnOutputUpdated</RunPostBuildEvent>
+ <PackageIcon>basyxlogo.png</PackageIcon>
+ </PropertyGroup>
+
+ <ItemGroup>
+ <None Include="basyxlogo.png" Pack="true" PackagePath="\" />
+ </ItemGroup>
+
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
+ <DocumentationFile>bin\Debug\netstandard2.0\BaSyx.API.Http.Controllers.xml</DocumentationFile>
+ <OutputPath>bin\Debug\</OutputPath>
+ </PropertyGroup>
+
+ <ItemGroup>
+ <None Remove="BaSyx.API.Http.Controllers.xml" />
+ </ItemGroup>
+
+ <ItemGroup>
+ <EmbeddedResource Include="BaSyx.API.Http.Controllers.xml">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </EmbeddedResource>
+ </ItemGroup>
+
+ <ItemGroup>
+ <PackageReference Include="Microsoft.AspNetCore.Mvc" Version="2.2.0" />
+ <PackageReference Include="NLog.Web.AspNetCore" Version="4.9.0" />
+ </ItemGroup>
+
+ <ItemGroup>
+ <ProjectReference Include="..\BaSyx.API\BaSyx.API.csproj" />
+ <ProjectReference Include="..\BaSyx.Submodel.ServiceProvider.Distributed\BaSyx.Submodel.ServiceProvider.Distributed.csproj" />
+ </ItemGroup>
+
+ <Target Name="PostBuild" AfterTargets="PostBuildEvent">
+ <Exec Command="IF EXIST %25BASYX_REPO%25 ( dotnet pack "$(ProjectPath)" --no-build --include-source --include-symbols --output "%25BASYX_REPO%25" ) ELSE ( ECHO BASYX_REPO Environment Variable not found)" />
+ </Target>
+
+</Project>
diff --git a/sdks/dotnet/basyx-core/BaSyx.API.Http.Controllers/BaSyx.API.Http.Controllers.xml b/sdks/dotnet/basyx-core/BaSyx.API.Http.Controllers/BaSyx.API.Http.Controllers.xml
new file mode 100644
index 0000000..c9cbfec
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.API.Http.Controllers/BaSyx.API.Http.Controllers.xml
@@ -0,0 +1,565 @@
+<?xml version="1.0"?>
+<doc>
+ <assembly>
+ <name>BaSyx.API.Http.Controllers</name>
+ </assembly>
+ <members>
+ <member name="T:BaSyx.API.Http.Controllers.AssetAdministrationShellAggregatorServices">
+ <summary>
+ All Asset Administration Shell Services provided by the component
+ </summary>
+ </member>
+ <member name="M:BaSyx.API.Http.Controllers.AssetAdministrationShellAggregatorServices.RetrieveAASList">
+ <summary>
+ Retrieves all Asset Administration Shells from the endpoint
+ </summary>
+ <returns></returns>
+ <response code="200">Returns a list of found Asset Administration Shells</response>
+ <response code="404">No Asset Administration Shells found</response>
+ <response code="400">Bad Request</response>
+ <response code="502">Bad Gateway</response>
+ </member>
+ <member name="M:BaSyx.API.Http.Controllers.AssetAdministrationShellAggregatorServices.RetrieveAAS(System.String)">
+ <summary>
+ Retrieves a specific Asset Administration Shell
+ </summary>
+ <param name="aasId">The AAS's unique id</param>
+ <returns></returns>
+ <response code="200">Returns the requested Asset Administration Shell</response>
+ <response code="404">No Asset Administration Shell found</response>
+ <response code="400">Bad Request</response>
+ <response code="502">Bad Gateway</response>
+ </member>
+ <member name="M:BaSyx.API.Http.Controllers.AssetAdministrationShellAggregatorServices.UpdateAAS(System.String,BaSyx.Models.Core.AssetAdministrationShell.Generics.IAssetAdministrationShell)">
+ <summary>
+ Updates a specific Asset Administration Shell
+ </summary>
+ <param name="aasId">The AAS's unique id</param>
+ <param name="aas">The updated AAS</param>
+ <returns></returns>
+ <response code="200">Asset Administration Shell updated successfully</response>
+ <response code="400">Bad Request</response>
+ <response code="502">Bad Gateway</response>
+ </member>
+ <member name="M:BaSyx.API.Http.Controllers.AssetAdministrationShellAggregatorServices.CreateAAS(BaSyx.Models.Core.AssetAdministrationShell.Generics.IAssetAdministrationShell)">
+ <summary>
+ Creates a new Asset Administration Shell at the endpoint
+ </summary>
+ <param name="aas">The AAS's description object</param>
+ <returns></returns>
+ <response code="201">Asset Administration Shell created successfully</response>
+ <response code="400">Bad Request</response>
+ <response code="502">Bad Gateway</response>
+ </member>
+ <member name="M:BaSyx.API.Http.Controllers.AssetAdministrationShellAggregatorServices.DeleteAAS(System.String)">
+ <summary>
+ Deletes a specific Asset Administration Shell
+ </summary>
+ <param name="aasId">The AAS's unique id</param>
+ <returns></returns>
+ <response code="200">Asset Administration Shell deleted successfully</response>
+ <response code="400">Bad Request</response>
+ <response code="502">Bad Gateway</response>
+ </member>
+ <member name="T:BaSyx.API.Http.Controllers.AssetAdministrationShellServices">
+ <summary>
+ All Asset Administration Shell Services provided by the component
+ </summary>
+ </member>
+ <member name="M:BaSyx.API.Http.Controllers.AssetAdministrationShellServices.GetAAS">
+ <summary>
+ Retrieves the Asset Administration Shell
+ </summary>
+ <returns></returns>
+ <response code="200">Success</response>
+ <response code="502">Bad Gateway - Asset Administration Shell not available</response>
+ </member>
+ <member name="M:BaSyx.API.Http.Controllers.AssetAdministrationShellServices.PostSubmodel(BaSyx.Models.Core.AssetAdministrationShell.Generics.ISubmodel)">
+ <summary>
+ Adds a new Submodel to an existing Asset Administration Shell
+ </summary>
+ <param name="submodel">The Submodel's description object</param>
+ <returns></returns>
+ <response code="201">Submodel created successfully</response>
+ <response code="400">Bad Request</response>
+ </member>
+ <member name="M:BaSyx.API.Http.Controllers.AssetAdministrationShellServices.GetSubmodelById(System.String)">
+ <summary>
+ Retrieves the Submodel from the Asset Administration Shell
+ </summary>
+ <param name="submodelId">The Submodel's unique id</param>
+ <returns></returns>
+ <response code="200">Submodel retrieved successfully</response>
+ <response code="404">No Submodel Service Provider found</response>
+ </member>
+ <member name="M:BaSyx.API.Http.Controllers.AssetAdministrationShellServices.DeleteSubmodelById(System.String)">
+ <summary>
+ Deletes a specific Submodel from the Asset Administration Shell
+ </summary>
+ <param name="submodelId">The Submodel's idShort</param>
+ <returns></returns>
+ <response code="204">Submodel deleted successfully</response>
+ <response code="400">Bad Request</response>
+ </member>
+ <member name="M:BaSyx.API.Http.Controllers.AssetAdministrationShellServices.GetSubmodels">
+ <summary>
+ Retrieves all Submodels from the Asset Administration Shell
+ </summary>
+ <returns></returns>
+ <response code="200">Returns a list of found Submodels</response>
+ <response code="404">No Submodel Service Providers found</response>
+ </member>
+ <member name="M:BaSyx.API.Http.Controllers.AssetAdministrationShellServices.RoutedGetDataElements">
+ <summary>
+ Retrieves all DataElements from the current Submodel
+ </summary>
+ <returns></returns>
+ <response code="200">Returns a list of found DataElements</response>
+ <response code="404">Submodel not found / No DataElements found</response>
+ </member>
+ <member name="M:BaSyx.API.Http.Controllers.AssetAdministrationShellServices.RoutedGetOperations">
+ <summary>
+ Retrieves all Operations from the current Submodel
+ </summary>
+ <returns></returns>
+ <response code="200">Success</response>
+ <response code="404">Submodel not found / No Operations found</response>
+ </member>
+ <member name="M:BaSyx.API.Http.Controllers.AssetAdministrationShellServices.RoutedGetEvents">
+ <summary>
+ Retrieves all Events from the current Submodel
+ </summary>
+ <returns></returns>
+ <response code="200">Success</response>
+ <response code="404">Submodel not found / No Events found</response>
+ </member>
+ <member name="M:BaSyx.API.Http.Controllers.AssetAdministrationShellServices.RoutedPostDataElement(BaSyx.Models.Core.AssetAdministrationShell.Generics.IDataElement)">
+ <summary>
+ Adds a new DataElement to the Asset Administration Shell's Submodel
+ </summary>
+ <param name="dataElement">The DataElement's description object</param>
+ <returns></returns>
+ <response code="201">DataElement created successfully</response>
+ <response code="400">Bad Request</response>
+ <response code="404">Submodel not found</response>
+ </member>
+ <member name="M:BaSyx.API.Http.Controllers.AssetAdministrationShellServices.RoutedGetDataElement(System.String)">
+ <summary>
+ Retrieves a specific DataElement from the Asset Administrations's Submodel
+ </summary>
+ <param name="propertyId">The DataElement's short id</param>
+ <returns></returns>
+ <response code="200">Returns the requested DataElement</response>
+ <response code="404">Submodel/DataElement not found</response>
+ </member>
+ <member name="M:BaSyx.API.Http.Controllers.AssetAdministrationShellServices.RoutedGetDataElementValue(System.String)">
+ <summary>
+ Retrieves the value of a specific DataElement from the Asset Administrations Shell's Submodel
+ </summary>
+ <param name="propertyId">The DataElement's short id</param>
+ <returns></returns>
+ <response code="200">Returns the requested DataElement's value</response>
+ <response code="404">Submodel/DataElement not found</response>
+ </member>
+ <member name="M:BaSyx.API.Http.Controllers.AssetAdministrationShellServices.RoutedPutDataElementValue(System.String,BaSyx.Models.Core.AssetAdministrationShell.Generics.IValue)">
+ <summary>
+ Updates the Asset Administration Shell's Submodel's DataElement
+ </summary>
+ <param name="propertyId">The DataElement's short id</param>
+ <param name="value">The new value</param>
+ <returns></returns>
+ <response code="200">DataElement's value changed successfully</response>
+ <response code="404">Submodel/DataElement not found</response>
+ </member>
+ <member name="M:BaSyx.API.Http.Controllers.AssetAdministrationShellServices.RoutedDelDataElement(System.String)">
+ <summary>
+ Deletes a specific DataElement from the Asset Administration Shell's Submodel
+ </summary>
+ <param name="propertyId">The DataElement's short id</param>
+ <returns></returns>
+ <response code="204">DataElement deleted successfully</response>
+ <response code="404">Submodel not found</response>
+ </member>
+ <member name="M:BaSyx.API.Http.Controllers.AssetAdministrationShellServices.RoutedPostOperation(BaSyx.Models.Core.AssetAdministrationShell.Generics.IOperation)">
+ <summary>
+ Adds a new operation to the Asset Administraiton Shell's Submodel
+ </summary>
+ <param name="operation">The operation description object</param>
+ <returns></returns>
+ <response code="201">Operation created successfully</response>
+ <response code="400">Bad Request</response>
+ <response code="404">Submodel not found</response>
+ </member>
+ <member name="M:BaSyx.API.Http.Controllers.AssetAdministrationShellServices.RoutedGetOperation(System.String)">
+ <summary>
+ Retrieves a specific Operation from the Asset Administration Shell's Submodel
+ </summary>
+ <param name="operationId">The Operation's short id</param>
+ <returns></returns>
+ <response code="200">Success</response>
+ <response code="404">Submodel/Operation not found</response>
+ </member>
+ <member name="M:BaSyx.API.Http.Controllers.AssetAdministrationShellServices.RoutedDelOperation(System.String)">
+ <summary>
+ Deletes a specific Operation from the Asset Administration Shell's Submodel
+ </summary>
+ <param name="operationId">The Operation's short id</param>
+ <returns></returns>
+ <response code="204">Operation deleted successfully</response>
+ <response code="404">Submodel not found</response>
+ </member>
+ <member name="M:BaSyx.API.Http.Controllers.AssetAdministrationShellServices.RoutedInvokeOperationRest(System.String,System.Int32,System.Collections.Generic.List{BaSyx.Models.Core.AssetAdministrationShell.Generics.IArgument})">
+ <summary>
+ Invokes a specific operation from the Asset Administration Shell' Submodel with a list of input parameters
+ </summary>
+ <param name="operationId">The operation's short id</param>
+ <param name="timeout">Timeout for the operation to finish</param>
+ <param name="inputArguments">List of input arguments</param>
+ <returns></returns>
+ <response code="200">Operation invoked successfully</response>
+ <response code="400">Bad Request</response>
+ <response code="404">Submodel not found</response>
+ </member>
+ <member name="M:BaSyx.API.Http.Controllers.AssetAdministrationShellServices.RoutedPostEvent(BaSyx.Models.Core.AssetAdministrationShell.Generics.IEvent)">
+ <summary>
+ Adds a new event to the Asset Administration Shell's Submodel
+ </summary>
+ <param name="eventable">The Event description object</param>
+ <returns></returns>
+ <response code="201">Event created successfully</response>
+ <response code="400">Bad Request</response>
+ <response code="404">Submodel not found</response>
+ </member>
+ <member name="M:BaSyx.API.Http.Controllers.AssetAdministrationShellServices.RoutedGetEvent(System.String)">
+ <summary>
+ Retrieves a specific event from the Asset Administration Shell's Submodel
+ </summary>
+ <param name="eventId">The Event's short id</param>
+ <returns></returns>
+ <response code="200">Success</response>
+ <response code="404">Submodel/Event not found</response>
+ </member>
+ <member name="M:BaSyx.API.Http.Controllers.AssetAdministrationShellServices.RoutedDelEvent(System.String)">
+ <summary>
+ Deletes a specific event from the Asset Administration Shell's Submodel
+ </summary>
+ <param name="eventId">The Event's short id</param>
+ <returns></returns>
+ <response code="204">Event deleted successfully</response>
+ <response code="404">Submodel not found</response>
+ </member>
+ <member name="T:BaSyx.API.Http.Controllers.SubmodelBinding">
+ <summary>
+ Registry for distributed Submodel-Service-Provider
+ </summary>
+ </member>
+ <member name="M:BaSyx.API.Http.Controllers.SubmodelBinding.RetrieveSubmodelServiceProviders">
+ <summary>
+ Retrieves all registered Submodel Service Providers within an Asset Administation Shell Service Provider
+ </summary>
+ <returns></returns>
+ <response code="200">Returns the all registered Submodel Service Provider</response>
+ <response code="404">No Submodel Service Provider found</response>
+ <response code="400">Bad Request</response>
+ <response code="502">Bad Gateway</response>
+ </member>
+ <member name="M:BaSyx.API.Http.Controllers.SubmodelBinding.RetrieveSubmodelServiceProvider(System.String)">
+ <summary>
+ Retrieves a specific Submodel Service Provider from its containing Asset Administration Shell Service Provider
+ </summary>
+ <returns></returns>
+ <response code="200">Returns the requested Submodel Service Provider</response>
+ <response code="404">No Submodel Service Provider found</response>
+ <response code="400">Bad Request</response>
+ <response code="502">Bad Gateway</response>
+ </member>
+ <member name="M:BaSyx.API.Http.Controllers.SubmodelBinding.RegisterSubmodelServiceProvider(BaSyx.Models.Core.AssetAdministrationShell.Generics.ISubmodelDescriptor)">
+ <summary>
+ Registers a new Distributed Submodel Service Provider at the Asset Administration Shell Service Provider
+ </summary>
+ <param name="serviceDescriptor">The Submodel Service Provider' service descriptor object</param>
+ <returns></returns>
+ <response code="201">Submodel Service Provider registered successfully</response>
+ <response code="400">Bad Request</response>
+ <response code="502">Bad Gateway</response>
+ </member>
+ <member name="M:BaSyx.API.Http.Controllers.SubmodelBinding.UnregisterSubmodelServiceProvider(System.String)">
+ <summary>
+ Unregisters a specific Submodel Service Provider from its containing Asset Administration Shell Service Provider
+ </summary>
+ <returns></returns>
+ <response code="200">Submodel Service Provider unregistered successfully</response>
+ <response code="400">Bad Request</response>
+ <response code="502">Bad Gateway</response>
+ </member>
+ <member name="T:BaSyx.API.Http.Controllers.SubmodelServices">
+ <summary>
+ All Asset Administration Shell Services provided by the component
+ </summary>
+ </member>
+ <member name="M:BaSyx.API.Http.Controllers.SubmodelServices.GetSubmodelAsTable(System.String)">
+ <summary>
+ Retrieves a customizable table version of a Submodel
+ </summary>
+ <returns></returns>
+ <response code="200">Success</response>
+ <response code="404">Submodel not found</response>
+ </member>
+ <member name="M:BaSyx.API.Http.Controllers.SubmodelServices.GetMinimizedSubmodel">
+ <summary>
+ Retrieves the minimized version of a Submodel
+ </summary>
+ <returns></returns>
+ <response code="200">Success</response>
+ <response code="404">Submodel not found</response>
+ </member>
+ <member name="M:BaSyx.API.Http.Controllers.SubmodelServices.GetSubmodel">
+ <summary>
+ Retrieves the Submodel
+ </summary>
+ <returns></returns>
+ <response code="200">Success</response>
+ <response code="404">Submodel not found</response>
+ </member>
+ <member name="M:BaSyx.API.Http.Controllers.SubmodelServices.GetDataElements">
+ <summary>
+ Retrieves all DataElements from the current Submodel
+ </summary>
+ <returns></returns>
+ <response code="200">Returns a list of found DataElements</response>
+ <response code="404">Submodel not found / No DataElements found</response>
+ </member>
+ <member name="M:BaSyx.API.Http.Controllers.SubmodelServices.GetOperations">
+ <summary>
+ Retrieves all Operations from the current Submodel
+ </summary>
+ <returns></returns>
+ <response code="200">Success</response>
+ <response code="404">Submodel not found / No Operations found</response>
+ </member>
+ <member name="M:BaSyx.API.Http.Controllers.SubmodelServices.GetEvents">
+ <summary>
+ Retrieves all Events from the current Submodel
+ </summary>
+ <returns></returns>
+ <response code="200">Success</response>
+ <response code="404">Submodel not found / No Events found</response>
+ </member>
+ <member name="M:BaSyx.API.Http.Controllers.SubmodelServices.PostDataElement(BaSyx.Models.Core.AssetAdministrationShell.Generics.IDataElement)">
+ <summary>
+ Adds a new DataElement to the Asset Administration Shell's Submodel
+ </summary>
+ <param name="dataElement">The DataElement's description object</param>
+ <returns></returns>
+ <response code="201">DataElement created successfully</response>
+ <response code="400">Bad Request</response>
+ <response code="404">Submodel not found</response>
+ </member>
+ <member name="M:BaSyx.API.Http.Controllers.SubmodelServices.GetDataElement(System.String)">
+ <summary>
+ Retrieves a specific DataElement from the Asset Administrations's Submodel
+ </summary>
+ <param name="propertyId">The DataElement's short id</param>
+ <returns></returns>
+ <response code="200">Returns the requested DataElement</response>
+ <response code="404">Submodel/DataElement not found</response>
+ </member>
+ <member name="M:BaSyx.API.Http.Controllers.SubmodelServices.GetDataElementValue(System.String)">
+ <summary>
+ Retrieves the value of a specific DataElement from the Asset Administrations Shell's Submodel
+ </summary>
+ <param name="propertyId">The DataElement's short id</param>
+ <returns></returns>
+ <response code="200">Returns the requested DataElement's value</response>
+ <response code="404">Submodel/DataElement not found</response>
+ </member>
+ <member name="M:BaSyx.API.Http.Controllers.SubmodelServices.PutDataElementValue(System.String,BaSyx.Models.Core.AssetAdministrationShell.Generics.IValue)">
+ <summary>
+ Updates the Asset Administration Shell's Submodel's DataElement
+ </summary>
+ <param name="propertyId">The DataElement's short id</param>
+ <param name="value">The new value</param>
+ <returns></returns>
+ <response code="200">DataElement's value changed successfully</response>
+ <response code="404">Submodel/DataElement not found</response>
+ </member>
+ <member name="M:BaSyx.API.Http.Controllers.SubmodelServices.DelDataElement(System.String)">
+ <summary>
+ Deletes a specific DataElement from the Asset Administration Shell's Submodel
+ </summary>
+ <param name="propertyId">The DataElement's short id</param>
+ <returns></returns>
+ <response code="204">DataElement deleted successfully</response>
+ <response code="404">Submodel not found</response>
+ </member>
+ <member name="M:BaSyx.API.Http.Controllers.SubmodelServices.PostOperation(BaSyx.Models.Core.AssetAdministrationShell.Generics.IOperation)">
+ <summary>
+ Adds a new operation to the Asset Administraiton Shell's Submodel
+ </summary>
+ <param name="operation">The operation description object</param>
+ <returns></returns>
+ <response code="201">Operation created successfully</response>
+ <response code="400">Bad Request</response>
+ <response code="404">Submodel not found</response>
+ </member>
+ <member name="M:BaSyx.API.Http.Controllers.SubmodelServices.GetOperation(System.String)">
+ <summary>
+ Retrieves a specific Operation from the Asset Administration Shell's Submodel
+ </summary>
+ <param name="operationId">The Operation's short id</param>
+ <returns></returns>
+ <response code="200">Success</response>
+ <response code="404">Submodel/Operation not found</response>
+ </member>
+ <member name="M:BaSyx.API.Http.Controllers.SubmodelServices.DelOperation(System.String)">
+ <summary>
+ Deletes a specific Operation from the Asset Administration Shell's Submodel
+ </summary>
+ <param name="operationId">The Operation's short id</param>
+ <returns></returns>
+ <response code="204">Operation deleted successfully</response>
+ <response code="404">Submodel not found</response>
+ </member>
+ <member name="M:BaSyx.API.Http.Controllers.SubmodelServices.InvokeOperationRest(System.String,System.Int32,System.Collections.Generic.List{BaSyx.Models.Core.AssetAdministrationShell.Generics.IArgument})">
+ <summary>
+ Invokes a specific operation from the Asset Administration Shell' Submodel with a list of input parameters
+ </summary>
+ <param name="operationId">The operation's short id</param>
+ <param name="timeout">Timeout for the operation to finish</param>
+ <param name="inputArguments">List of input arguments</param>
+ <returns></returns>
+ <response code="200">Operation invoked successfully</response>
+ <response code="400">Bad Request</response>
+ <response code="404">Submodel not found</response>
+ </member>
+ <member name="M:BaSyx.API.Http.Controllers.SubmodelServices.PostEvent(BaSyx.Models.Core.AssetAdministrationShell.Generics.IEvent)">
+ <summary>
+ Adds a new event to the Asset Administration Shell's Submodel
+ </summary>
+ <param name="eventable">The Event description object</param>
+ <returns></returns>
+ <response code="201">Event created successfully</response>
+ <response code="400">Bad Request</response>
+ <response code="404">Submodel not found</response>
+ </member>
+ <member name="M:BaSyx.API.Http.Controllers.SubmodelServices.GetEvent(System.String)">
+ <summary>
+ Retrieves a specific event from the Asset Administration Shell's Submodel
+ </summary>
+ <param name="eventId">The Event's short id</param>
+ <returns></returns>
+ <response code="200">Success</response>
+ <response code="404">Submodel/Event not found</response>
+ </member>
+ <member name="M:BaSyx.API.Http.Controllers.SubmodelServices.DelEvent(System.String)">
+ <summary>
+ Deletes a specific event from the Asset Administration Shell's Submodel
+ </summary>
+ <param name="eventId">The Event's short id</param>
+ <returns></returns>
+ <response code="204">Event deleted successfully</response>
+ <response code="404">Submodel not found</response>
+ </member>
+ <member name="M:BaSyx.API.Http.Controllers.AssetAdministrationShellRegistry.GetAssetAdministrationShells">
+ <summary>
+ Retrieves all registered Asset Administration Shells within a defined system (e.g. site, area, production line, station)
+ </summary>
+ <returns></returns>
+ <response code="200">Returns a list of found Asset Administration Shells</response>
+ <response code="400">Bad Request</response>
+ <response code="502">Bad Gateway</response>
+ </member>
+ <member name="M:BaSyx.API.Http.Controllers.AssetAdministrationShellRegistry.GetAssetAdministrationShell(System.String)">
+ <summary>
+ Retrieves a specific Asset Administration Shell
+ </summary>
+ <param name="aasId">The Asset Administration Shell's unique id</param>
+ <returns></returns>
+ <response code="200">Returns the requested Asset Administration Shell</response>
+ <response code="400">Bad Request</response>
+ <response code="404">No Asset Administration Shell with passed id found</response>
+ <response code="502">Bad Gateway</response>
+ </member>
+ <member name="M:BaSyx.API.Http.Controllers.AssetAdministrationShellRegistry.PutAssetAdministrationShell(System.String)">
+ <summary>
+ Renews a specific Asset Administration Shell's registration
+ </summary>
+ <param name="aasId">The Asset Administration Shell's unique id</param>
+ <returns></returns>
+ <response code="200">The Asset Administration Shell's registration was successfully renewed</response>
+ <response code="400">The syntax of the passed Asset Administration Shell is not valid or malformed request</response>
+ <response code="404">No Asset Administration Shell with passed id found</response>
+ <response code="502">Bad Gateway</response>
+ </member>
+ <member name="M:BaSyx.API.Http.Controllers.AssetAdministrationShellRegistry.PostAssetAdministrationShell(BaSyx.Models.Core.AssetAdministrationShell.Generics.IAssetAdministrationShellDescriptor)">
+ <summary>
+ Registers a new Asset Administration Shell
+ </summary>
+ <param name="aas">The Asset Administration Shell descriptor object</param>
+ <returns></returns>
+ <response code="201">The Asset Administration Shell was created successfully</response>
+ <response code="400">The syntax of the passed Asset Administration Shell is not valid or malformed request</response>
+ <response code="422">The passed Asset Administration Shell conflicts with already registered Asset Administration Shells</response>
+ <response code="502">Bad Gateway</response>
+ </member>
+ <member name="M:BaSyx.API.Http.Controllers.AssetAdministrationShellRegistry.DeleteAssetAdministrationShell_(System.String)">
+ <summary>
+ Deletes a specific Asset Administration Shell
+ </summary>
+ <param name="aasId">The Asset Administration Shell's unique id</param>
+ <returns></returns>
+ <response code="200">The Asset Administration Shell was deleted successfully</response>
+ <response code="400">Bad Request</response>
+ <response code="404">No Asset Administration Shell with passed id found</response>
+ <response code="502">Bad Gateway</response>
+ </member>
+ <member name="M:BaSyx.API.Http.Controllers.AssetAdministrationShellRegistry.PostSubmodel(System.String,BaSyx.Models.Core.AssetAdministrationShell.Generics.ISubmodelDescriptor)">
+ <summary>
+ Adds a new Submodel to an existing resp. registered Asset Administration Shell
+ </summary>
+ <param name="aasId">The Asset Administration Shell's unique id</param>
+ <param name="submodel">The Submodel descriptor object</param>
+ <returns></returns>
+ <response code="201">The Submodel was created successfully</response>
+ <response code="400">The syntax of the passed Submodel is not valid or malformed request</response>
+ <response code="404">No Asset Administration Shell with passed id found</response>
+ <response code="422">The passed Submodel conflicts with already registered Submodels</response>
+ <response code="502">Bad Gateway</response>
+ </member>
+ <member name="M:BaSyx.API.Http.Controllers.AssetAdministrationShellRegistry.GetSubmodel(System.String,System.String)">
+ <summary>
+ Retrieves a specific Submodel from a specific Asset Administration Shell
+ </summary>
+ <param name="aasId">The Asset Administration Shell's unique id</param>
+ <param name="submodelIdShort">The Submodel's short id (idShort)</param>
+ <returns></returns>
+ <response code="200">Returns the requested Submodels</response>
+ <response code="400">Bad Request</response>
+ <response code="404">No Asset Administration Shell / Submodel with passed id found</response>
+ <response code="502">Bad Gateway</response>
+ </member>
+ <member name="M:BaSyx.API.Http.Controllers.AssetAdministrationShellRegistry.DeleteSubmodel_(System.String,System.String)">
+ <summary>
+ Deletes a specific Submodel from a specific Asset Administration Shell
+ </summary>
+ <param name="aasId">The Asset Administration Shell's unique id</param>
+ <param name="submodelIdShort">The Submodel's short id (idShort)</param>
+ <returns></returns>
+ <response code="200">The Submodel was deleted successfully</response>
+ <response code="400">Bad Request</response>
+ <response code="404">No Asset Administration Shell / Submodel with passed id found</response>
+ <response code="502">Bad Gateway</response>
+ </member>
+ <member name="M:BaSyx.API.Http.Controllers.AssetAdministrationShellRegistry.GetSubmodels(System.String)">
+ <summary>
+ Retrieves all Submodels from a specific Asset Administration Shell
+ </summary>
+ <param name="aasId">The Asset Administration Shell's unique id</param>
+ <returns></returns>
+ <response code="200">Returns a list of found Submodels</response>
+ <response code="400">Bad Request</response>
+ <response code="404">No Asset Administration Shell with passed id found</response>
+ <response code="502">Bad Gateway</response>
+ </member>
+ </members>
+</doc>
diff --git a/sdks/dotnet/basyx-core/BaSyx.API.Http.Controllers/Infrastructure/Registry/AssetAdministrationShellRegistry.cs b/sdks/dotnet/basyx-core/BaSyx.API.Http.Controllers/Infrastructure/Registry/AssetAdministrationShellRegistry.cs
new file mode 100644
index 0000000..5ad2131
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.API.Http.Controllers/Infrastructure/Registry/AssetAdministrationShellRegistry.cs
@@ -0,0 +1,261 @@
+/*******************************************************************************
+* Copyright (c) 2020 Robert Bosch GmbH
+* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
+*
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License 2.0 which is available at
+* http://www.eclipse.org/legal/epl-2.0
+*
+* SPDX-License-Identifier: EPL-2.0
+*******************************************************************************/
+using System.Collections.Generic;
+using Microsoft.AspNetCore.Mvc;
+using BaSyx.API.Components;
+using BaSyx.Utils.ResultHandling;
+using Newtonsoft.Json;
+using static BaSyx.Utils.ResultHandling.Utils;
+using BaSyx.Models.Extensions;
+using System.Web;
+using BaSyx.Models.Connectivity.Descriptors;
+using BaSyx.Models.Core.Common;
+
+namespace BaSyx.API.Http.Controllers
+{
+ public class AssetAdministrationShellRegistry : Controller, IAssetAdministrationShellRegistry
+ {
+ private static JsonSerializerSettings jsonSerializerSettings;
+ static AssetAdministrationShellRegistry()
+ {
+ jsonSerializerSettings = new JsonStandardSettings();
+ }
+ private readonly IAssetAdministrationShellRegistry aasRegistryImpl;
+
+
+ public AssetAdministrationShellRegistry(IAssetAdministrationShellRegistry aasRegistry)
+ {
+ aasRegistryImpl = aasRegistry;
+ }
+
+ #region REST-Interface
+ /// <summary>
+ /// Retrieves all registered Asset Administration Shells within a defined system (e.g. site, area, production line, station)
+ /// </summary>
+ /// <returns></returns>
+ /// <response code="200">Returns a list of found Asset Administration Shells</response>
+ /// <response code="400">Bad Request</response>
+ /// <response code="502">Bad Gateway</response>
+ [HttpGet("api/v1/registry", Name = "GetAssetAdministrationShells")]
+ [ProducesResponseType(typeof(IResult<List<IAssetAdministrationShellDescriptor>>), 200)]
+ public IActionResult GetAssetAdministrationShells()
+ {
+ var result = RetrieveAssetAdministrationShells();
+ return EvaluateResult(result, CrudOperation.Retrieve);
+ }
+ /// <summary>
+ /// Retrieves a specific Asset Administration Shell
+ /// </summary>
+ /// <param name="aasId">The Asset Administration Shell's unique id</param>
+ /// <returns></returns>
+ /// <response code="200">Returns the requested Asset Administration Shell</response>
+ /// <response code="400">Bad Request</response>
+ /// <response code="404">No Asset Administration Shell with passed id found</response>
+ /// <response code="502">Bad Gateway</response>
+ [HttpGet("api/v1/registry/{*aasId}", Name = "GetAssetAdministrationShell")]
+ [ProducesResponseType(typeof(IResult<IAssetAdministrationShellDescriptor>), 200)]
+ public IActionResult GetAssetAdministrationShell(string aasId)
+ {
+ aasId = HttpUtility.UrlDecode(aasId);
+ var result = RetrieveAssetAdministrationShell(aasId);
+ return EvaluateResult(result, CrudOperation.Retrieve);
+ }
+ /// <summary>
+ /// Renews a specific Asset Administration Shell's registration
+ /// </summary>
+ /// <param name="aasId">The Asset Administration Shell's unique id</param>
+ /// <returns></returns>
+ /// <response code="200">The Asset Administration Shell's registration was successfully renewed</response>
+ /// <response code="400">The syntax of the passed Asset Administration Shell is not valid or malformed request</response>
+ /// <response code="404">No Asset Administration Shell with passed id found</response>
+ /// <response code="502">Bad Gateway</response>
+ [HttpPut("api/v1/registry/{*aasId}", Name = "PutAssetAdministrationShell")]
+ [ProducesResponseType(typeof(IResult), 204)]
+ public IActionResult PutAssetAdministrationShell(string aasId)
+ {
+ aasId = HttpUtility.UrlDecode(aasId);
+ Dictionary<string, string> keyValues = null;
+ if (Request.Query?.Count > 0)
+ {
+ keyValues = new Dictionary<string, string>();
+ foreach (string key in Request.Query.Keys)
+ {
+ keyValues.Add(key, Request.Query[key].ToString());
+ }
+ }
+ var result = UpdateAssetAdministrationShell(aasId, keyValues);
+ return EvaluateResult(result, CrudOperation.Update);
+ }
+ /// <summary>
+ /// Registers a new Asset Administration Shell
+ /// </summary>
+ /// <param name="aas">The Asset Administration Shell descriptor object</param>
+ /// <returns></returns>
+ /// <response code="201">The Asset Administration Shell was created successfully</response>
+ /// <response code="400">The syntax of the passed Asset Administration Shell is not valid or malformed request</response>
+ /// <response code="422">The passed Asset Administration Shell conflicts with already registered Asset Administration Shells</response>
+ /// <response code="502">Bad Gateway</response>
+ [HttpPost("api/v1/registry", Name = "PostAssetAdministrationShell")]
+ [ProducesResponseType(typeof(IResult<IAssetAdministrationShellDescriptor>), 201)]
+ public IActionResult PostAssetAdministrationShell([FromBody] IAssetAdministrationShellDescriptor aas)
+ {
+ var result = CreateAssetAdministrationShell(aas);
+ return EvaluateResult(result, CrudOperation.Create, "api/v1/registry/"+ HttpUtility.UrlEncode(aas.Identification.Id));
+ }
+ /// <summary>
+ /// Deletes a specific Asset Administration Shell
+ /// </summary>
+ /// <param name="aasId">The Asset Administration Shell's unique id</param>
+ /// <returns></returns>
+ /// <response code="200">The Asset Administration Shell was deleted successfully</response>
+ /// <response code="400">Bad Request</response>
+ /// <response code="404">No Asset Administration Shell with passed id found</response>
+ /// <response code="502">Bad Gateway</response>
+ [HttpDelete("api/v1/registry/{*aasId}", Name = "DeleteAssetAdministrationShell_")]
+ [ProducesResponseType(typeof(IResult), 204)]
+ public IActionResult DeleteAssetAdministrationShell_(string aasId)
+ {
+ aasId = HttpUtility.UrlDecode(aasId);
+ var result = DeleteAssetAdministrationShell(aasId);
+ return EvaluateResult(result, CrudOperation.Delete);
+ }
+
+
+ /// <summary>
+ /// Adds a new Submodel to an existing resp. registered Asset Administration Shell
+ /// </summary>
+ /// <param name="aasId">The Asset Administration Shell's unique id</param>
+ /// <param name="submodel">The Submodel descriptor object</param>
+ /// <returns></returns>
+ /// <response code="201">The Submodel was created successfully</response>
+ /// <response code="400">The syntax of the passed Submodel is not valid or malformed request</response>
+ /// <response code="404">No Asset Administration Shell with passed id found</response>
+ /// <response code="422">The passed Submodel conflicts with already registered Submodels</response>
+ /// <response code="502">Bad Gateway</response>
+ [HttpPost("api/v1/registry/{aasId}/submodels", Name = "PostSubmodelToRegistry")]
+ [ProducesResponseType(typeof(IResult<ISubmodelDescriptor>), 201)]
+ public IActionResult PostSubmodelToRegistry(string aasId, [FromBody] ISubmodelDescriptor submodel)
+ {
+ aasId = HttpUtility.UrlDecode(aasId);
+ var result = CreateSubmodel(aasId, submodel);
+ return EvaluateResult(result, CrudOperation.Create, "api/v1/registry/" + aasId + "/submodels/" + submodel.IdShort);
+ }
+
+ /// <summary>
+ /// Retrieves a specific Submodel from a specific Asset Administration Shell
+ /// </summary>
+ /// <param name="aasId">The Asset Administration Shell's unique id</param>
+ /// <param name="submodelIdShort">The Submodel's short id (idShort)</param>
+ /// <returns></returns>
+ /// <response code="200">Returns the requested Submodels</response>
+ /// <response code="400">Bad Request</response>
+ /// <response code="404">No Asset Administration Shell / Submodel with passed id found</response>
+ /// <response code="502">Bad Gateway</response>
+ [HttpGet("api/v1/registry/{aasId}/submodels/{submodelIdShort}", Name = "GetSubmodelFromRegistry")]
+ [ProducesResponseType(typeof(IResult<ISubmodelDescriptor>), 200)]
+ public IActionResult GetSubmodelFromRegistry(string aasId, string submodelIdShort)
+ {
+ aasId = HttpUtility.UrlDecode(aasId);
+ var result = RetrieveSubmodel(aasId, submodelIdShort);
+ return EvaluateResult(result, CrudOperation.Retrieve);
+ }
+ /// <summary>
+ /// Deletes a specific Submodel from a specific Asset Administration Shell
+ /// </summary>
+ /// <param name="aasId">The Asset Administration Shell's unique id</param>
+ /// <param name="submodelIdShort">The Submodel's short id (idShort)</param>
+ /// <returns></returns>
+ /// <response code="200">The Submodel was deleted successfully</response>
+ /// <response code="400">Bad Request</response>
+ /// <response code="404">No Asset Administration Shell / Submodel with passed id found</response>
+ /// <response code="502">Bad Gateway</response>
+ [HttpDelete("api/v1/registry/{aasId}/submodels/{submodelIdShort}", Name = "DeleteSubmodelFromRegistry")]
+ [ProducesResponseType(typeof(IResult), 204)]
+ public IActionResult DeleteSubmodelFromRegistry(string aasId, string submodelIdShort)
+ {
+ aasId = HttpUtility.UrlDecode(aasId);
+ var result = DeleteSubmodel(aasId, submodelIdShort);
+ return EvaluateResult(result, CrudOperation.Delete);
+ }
+ /// <summary>
+ /// Retrieves all Submodels from a specific Asset Administration Shell
+ /// </summary>
+ /// <param name="aasId">The Asset Administration Shell's unique id</param>
+ /// <returns></returns>
+ /// <response code="200">Returns a list of found Submodels</response>
+ /// <response code="400">Bad Request</response>
+ /// <response code="404">No Asset Administration Shell with passed id found</response>
+ /// <response code="502">Bad Gateway</response>
+ [HttpGet("api/v1/registry/{aasId}/submodels", Name = "GetSubmodelsFromRegistry")]
+ [ProducesResponseType(typeof(IResult<List<ISubmodelDescriptor>>), 200)]
+ public IActionResult GetSubmodelsFromRegistry(string aasId)
+ {
+ aasId = HttpUtility.UrlDecode(aasId);
+ var result = RetrieveSubmodels(aasId);
+ return EvaluateResult(result, CrudOperation.Retrieve);
+ }
+ #endregion
+
+ #region InterfaceImplementation
+ public IResult<IAssetAdministrationShellDescriptor> CreateAssetAdministrationShell(IAssetAdministrationShellDescriptor aas)
+ {
+ return aasRegistryImpl.CreateAssetAdministrationShell(aas);
+ }
+
+ public IResult DeleteAssetAdministrationShell(string aasId)
+ {
+ return aasRegistryImpl.DeleteAssetAdministrationShell(aasId);
+ }
+
+ public IResult<IAssetAdministrationShellDescriptor> RetrieveAssetAdministrationShell(string aasId)
+ {
+ return aasRegistryImpl.RetrieveAssetAdministrationShell(aasId);
+ }
+
+ public IResult<IElementContainer<IAssetAdministrationShellDescriptor>> RetrieveAssetAdministrationShells()
+ {
+ return aasRegistryImpl.RetrieveAssetAdministrationShells();
+ }
+
+ public IResult UpdateAssetAdministrationShell(string aasId, Dictionary<string, string> metaData)
+ {
+ return aasRegistryImpl.UpdateAssetAdministrationShell(aasId, metaData);
+ }
+
+ public IResult<ISubmodelDescriptor> CreateSubmodel(string aasId, ISubmodelDescriptor submodel)
+ {
+ return aasRegistryImpl.CreateSubmodel(aasId, submodel);
+ }
+
+ public IResult<IElementContainer<ISubmodelDescriptor>> RetrieveSubmodels(string aasId)
+ {
+ return aasRegistryImpl.RetrieveSubmodels(aasId);
+ }
+
+ public IResult<ISubmodelDescriptor> RetrieveSubmodel(string aasId, string submodelIdShort)
+ {
+ return aasRegistryImpl.RetrieveSubmodel(aasId, submodelIdShort);
+ }
+
+ public IResult DeleteSubmodel(string aasId, string submodelIdShort)
+ {
+ return aasRegistryImpl.DeleteSubmodel(aasId, submodelIdShort);
+ }
+
+
+ #endregion
+
+ #region Helper Methods
+
+
+ #endregion
+ }
+}
diff --git a/sdks/dotnet/basyx-core/BaSyx.API.Http.Controllers/basyxlogo.png b/sdks/dotnet/basyx-core/BaSyx.API.Http.Controllers/basyxlogo.png
new file mode 100644
index 0000000..226a4ff
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.API.Http.Controllers/basyxlogo.png
Binary files differ
diff --git a/sdks/dotnet/basyx-core/BaSyx.API/AssetAdministrationShell/EventHandler.cs b/sdks/dotnet/basyx-core/BaSyx.API/AssetAdministrationShell/EventHandler.cs
new file mode 100644
index 0000000..a4e2f4a
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.API/AssetAdministrationShell/EventHandler.cs
@@ -0,0 +1,17 @@
+/*******************************************************************************
+* Copyright (c) 2020 Robert Bosch GmbH
+* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
+*
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License 2.0 which is available at
+* http://www.eclipse.org/legal/epl-2.0
+*
+* SPDX-License-Identifier: EPL-2.0
+*******************************************************************************/
+using BaSyx.API.Components;
+using BaSyx.Models.Core.AssetAdministrationShell.Generics.SubmodelElementTypes;
+
+namespace BaSyx.API.AssetAdministrationShell
+{
+ public delegate void EventDelegate(ISubmodelServiceProvider submodelServiceProvider, IPublishableEvent publishableEvent);
+}
diff --git a/sdks/dotnet/basyx-core/BaSyx.API/AssetAdministrationShell/Extensions/AssetAdministrationShellExtensions.cs b/sdks/dotnet/basyx-core/BaSyx.API/AssetAdministrationShell/Extensions/AssetAdministrationShellExtensions.cs
new file mode 100644
index 0000000..7c043f8
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.API/AssetAdministrationShell/Extensions/AssetAdministrationShellExtensions.cs
@@ -0,0 +1,32 @@
+/*******************************************************************************
+* Copyright (c) 2020 Robert Bosch GmbH
+* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
+*
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License 2.0 which is available at
+* http://www.eclipse.org/legal/epl-2.0
+*
+* SPDX-License-Identifier: EPL-2.0
+*******************************************************************************/
+using BaSyx.API.Components;
+using BaSyx.Models.Core.AssetAdministrationShell.Generics;
+
+namespace BaSyx.API.AssetAdministrationShell.Extensions
+{
+ public static class AssetAdministrationShellExtensions
+ {
+ public static IAssetAdministrationShellServiceProvider CreateServiceProvider(this IAssetAdministrationShell aas, bool includeSubmodels)
+ {
+ InternalAssetAdministationShellServiceProvider sp = new InternalAssetAdministationShellServiceProvider(aas);
+
+ if(includeSubmodels && aas.Submodels?.Count > 0)
+ foreach (var submodel in aas.Submodels)
+ {
+ var submodelSp = submodel.CreateServiceProvider();
+ sp.RegisterSubmodelServiceProvider(submodel.IdShort, submodelSp);
+ }
+
+ return sp;
+ }
+ }
+}
diff --git a/sdks/dotnet/basyx-core/BaSyx.API/AssetAdministrationShell/Extensions/SubmodelExtensions.cs b/sdks/dotnet/basyx-core/BaSyx.API/AssetAdministrationShell/Extensions/SubmodelExtensions.cs
new file mode 100644
index 0000000..b3e2353
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.API/AssetAdministrationShell/Extensions/SubmodelExtensions.cs
@@ -0,0 +1,25 @@
+/*******************************************************************************
+* Copyright (c) 2020 Robert Bosch GmbH
+* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
+*
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License 2.0 which is available at
+* http://www.eclipse.org/legal/epl-2.0
+*
+* SPDX-License-Identifier: EPL-2.0
+*******************************************************************************/
+using BaSyx.API.Components;
+using BaSyx.Models.Core.AssetAdministrationShell.Generics;
+
+namespace BaSyx.API.AssetAdministrationShell.Extensions
+{
+ public static class SubmodelExtensions
+ {
+ public static ISubmodelServiceProvider CreateServiceProvider(this ISubmodel submodel)
+ {
+ InternalSubmodelServiceProvider sp = new InternalSubmodelServiceProvider(submodel);
+
+ return sp;
+ }
+ }
+}
diff --git a/sdks/dotnet/basyx-core/BaSyx.API/AssetAdministrationShell/PropertyHandler.cs b/sdks/dotnet/basyx-core/BaSyx.API/AssetAdministrationShell/PropertyHandler.cs
new file mode 100644
index 0000000..a704a95
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.API/AssetAdministrationShell/PropertyHandler.cs
@@ -0,0 +1,35 @@
+/*******************************************************************************
+* Copyright (c) 2020 Robert Bosch GmbH
+* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
+*
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License 2.0 which is available at
+* http://www.eclipse.org/legal/epl-2.0
+*
+* SPDX-License-Identifier: EPL-2.0
+*******************************************************************************/
+using BaSyx.Models.Core.AssetAdministrationShell.Generics.SubmodelElementTypes;
+using System.Reflection;
+
+namespace BaSyx.API.AssetAdministrationShell
+{
+ public class PropertyHandler
+ {
+ public GetPropertyValueHandler GetHandler { get; }
+ public SetPropertyValueHandler SetHandler { get; private set; }
+ public PropertyHandler(GetPropertyValueHandler getHandler, SetPropertyValueHandler setHandler)
+ {
+ GetHandler = getHandler;
+ SetHandler = setHandler;
+ }
+
+ public PropertyHandler(MethodInfo getMethodInfo, MethodInfo setMethodInfo, object target)
+ {
+ if(getMethodInfo != null)
+ GetHandler = (GetPropertyValueHandler)getMethodInfo.CreateDelegate(typeof(GetPropertyValueHandler), target);
+ if(setMethodInfo != null)
+ SetHandler = (SetPropertyValueHandler)setMethodInfo.CreateDelegate(typeof(SetPropertyValueHandler), target);
+ }
+ }
+
+}
diff --git a/sdks/dotnet/basyx-core/BaSyx.API/BaSyx.API.csproj b/sdks/dotnet/basyx-core/BaSyx.API/BaSyx.API.csproj
new file mode 100644
index 0000000..35442e1
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.API/BaSyx.API.csproj
@@ -0,0 +1,37 @@
+<Project Sdk="Microsoft.NET.Sdk">
+ <PropertyGroup>
+ <TargetFramework>netstandard2.0</TargetFramework>
+ <Configurations>Debug;Release</Configurations>
+ <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
+ <Authors>Constantin Ziesche</Authors>
+ <Copyright>Copyright 2019 - Robert Bosch GmbH</Copyright>
+ <PackageProjectUrl>https://wiki.eclipse.org/BaSyx</PackageProjectUrl>
+ <RepositoryUrl>https://git.eclipse.org/r/plugins/gitiles/basyx/basyx/+/master/sdks/csnet/</RepositoryUrl>
+ <PackageLicenseUrl></PackageLicenseUrl>
+ <Description>The official BaSyx Collection of APIs</Description>
+ <Company>Robert Bosch GmbH</Company>
+ <PackageTags>BaSys BaSyx API</PackageTags>
+ <PackageLicenseExpression>EPL-2.0</PackageLicenseExpression>
+ <RunPostBuildEvent>OnOutputUpdated</RunPostBuildEvent>
+ <PackageIcon>basyxlogo.png</PackageIcon>
+ <AssemblyVersion>1.0.0.0</AssemblyVersion>
+ <Version>1.0.0</Version>
+ </PropertyGroup>
+
+ <ItemGroup>
+ <None Include="basyxlogo.png" Pack="true" PackagePath="\" />
+ </ItemGroup>
+
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugType>Full</DebugType>
+ </PropertyGroup>
+
+ <ItemGroup>
+ <ProjectReference Include="..\BaSyx.Models\BaSyx.Models.csproj" />
+ </ItemGroup>
+
+ <Target Name="PostBuild" AfterTargets="PostBuildEvent">
+ <Exec Command="IF EXIST %25BASYX_REPO%25 ( dotnet pack "$(ProjectPath)" --no-build --include-source --include-symbols --output "%25BASYX_REPO%25" ) ELSE ( ECHO BASYX_REPO Environment Variable not found)" />
+ </Target>
+
+</Project>
diff --git a/sdks/dotnet/basyx-core/BaSyx.API/Clients/IAssetAdministrationShellClient.cs b/sdks/dotnet/basyx-core/BaSyx.API/Clients/IAssetAdministrationShellClient.cs
new file mode 100644
index 0000000..943d7fe
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.API/Clients/IAssetAdministrationShellClient.cs
@@ -0,0 +1,33 @@
+/*******************************************************************************
+* Copyright (c) 2020 Robert Bosch GmbH
+* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
+*
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License 2.0 which is available at
+* http://www.eclipse.org/legal/epl-2.0
+*
+* SPDX-License-Identifier: EPL-2.0
+*******************************************************************************/
+using BaSyx.Models.Core.AssetAdministrationShell.Generics;
+using BaSyx.Models.Core.Common;
+using BaSyx.Utils.ResultHandling;
+
+namespace BaSyx.API.Clients
+{
+ public interface IAssetAdministrationShellClient
+ {
+ IResult<IAssetAdministrationShell> RetrieveAssetAdministrationShell();
+
+ #region Submodel - CRUD-Operations
+
+ IResult<ISubmodel> CreateSubmodel(ISubmodel submodel);
+
+ IResult<IElementContainer<ISubmodel>> RetrieveSubmodels();
+
+ IResult<ISubmodel> RetrieveSubmodel(string submodelId);
+
+ IResult DeleteSubmodel(string submodelId);
+
+ #endregion
+ }
+}
diff --git a/sdks/dotnet/basyx-core/BaSyx.API/Clients/ISubmodelClient.cs b/sdks/dotnet/basyx-core/BaSyx.API/Clients/ISubmodelClient.cs
new file mode 100644
index 0000000..abe559f
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.API/Clients/ISubmodelClient.cs
@@ -0,0 +1,72 @@
+/*******************************************************************************
+* Copyright (c) 2020 Robert Bosch GmbH
+* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
+*
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License 2.0 which is available at
+* http://www.eclipse.org/legal/epl-2.0
+*
+* SPDX-License-Identifier: EPL-2.0
+*******************************************************************************/
+using BaSyx.Models.Core.AssetAdministrationShell.Generics;
+using BaSyx.Utils.ResultHandling;
+using BaSyx.Models.Core.Common;
+using BaSyx.Models.Core.AssetAdministrationShell.Generics.SubmodelElementTypes;
+
+namespace BaSyx.API.Clients
+{
+ public interface ISubmodelClient
+ {
+ IResult<ISubmodel> RetrieveSubmodel();
+
+ #region SubmodelElement - CRUD-Operations
+ IResult<ISubmodelElement> CreateSubmodelElement(ISubmodelElement submodelElement);
+
+ IResult<IElementContainer<ISubmodelElement>> RetrieveSubmodelElements();
+
+ IResult<ISubmodelElement> RetrieveSubmodelElement(string submodelElementId);
+
+ IResult<IValue> RetrieveSubmodelElementValue(string submodelElementId);
+
+ IResult UpdateSubmodelElement(string submodelElementId, ISubmodelElement submodelElement);
+
+ IResult DeleteSubmodelElement(string submodelElementId);
+ #endregion
+
+ #region Operation - CRUD-Operations
+ IResult<IOperation> CreateOperation(IOperation operation);
+
+ IResult<IElementContainer<IOperation>> RetrieveOperations();
+
+ IResult<IOperation> RetrieveOperation(string operationId);
+
+ IResult DeleteOperation(string operationId);
+
+ IResult InvokeOperation(string operationId, IOperationVariableSet inputArguments, IOperationVariableSet outputArguments, int timeout);
+ #endregion
+
+ #region Property - CRUD-Operations
+ IResult<IProperty> CreateProperty(IProperty property);
+
+ IResult<IElementContainer<IProperty>> RetrieveProperties();
+
+ IResult<IProperty> RetrieveProperty(string propertyId);
+
+ IResult<IValue> RetrievePropertyValue(string propertyId);
+
+ IResult UpdatePropertyValue(string propertyId, IValue propertyValue);
+
+ IResult DeleteProperty(string propertyId);
+ #endregion
+
+ #region Event - CRUD-Operations
+ IResult<IEvent> CreateEvent(IEvent eventable);
+
+ IResult<IElementContainer<IEvent>> RetrieveEvents();
+
+ IResult<IEvent> RetrieveEvent(string eventId);
+
+ IResult DeleteEvent(string eventId);
+ #endregion
+ }
+}
diff --git a/sdks/dotnet/basyx-core/BaSyx.API/Clients/ISubmodelClientFactory.cs b/sdks/dotnet/basyx-core/BaSyx.API/Clients/ISubmodelClientFactory.cs
new file mode 100644
index 0000000..e6ef675
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.API/Clients/ISubmodelClientFactory.cs
@@ -0,0 +1,19 @@
+/*******************************************************************************
+* Copyright (c) 2020 Robert Bosch GmbH
+* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
+*
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License 2.0 which is available at
+* http://www.eclipse.org/legal/epl-2.0
+*
+* SPDX-License-Identifier: EPL-2.0
+*******************************************************************************/
+using BaSyx.Models.Connectivity.Descriptors;
+
+namespace BaSyx.API.Clients
+{
+ public interface ISubmodelClientFactory
+ {
+ ISubmodelClient CreateSubmodelClient(ISubmodelDescriptor serviceDescriptor);
+ }
+}
diff --git a/sdks/dotnet/basyx-core/BaSyx.API/Components/AssetAdministrationShellAggregatorServiceProvider.cs b/sdks/dotnet/basyx-core/BaSyx.API/Components/AssetAdministrationShellAggregatorServiceProvider.cs
new file mode 100644
index 0000000..4df0ab8
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.API/Components/AssetAdministrationShellAggregatorServiceProvider.cs
@@ -0,0 +1,144 @@
+/*******************************************************************************
+* Copyright (c) 2020 Robert Bosch GmbH
+* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
+*
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License 2.0 which is available at
+* http://www.eclipse.org/legal/epl-2.0
+*
+* SPDX-License-Identifier: EPL-2.0
+*******************************************************************************/
+using BaSyx.API.AssetAdministrationShell.Extensions;
+using BaSyx.Models.Connectivity.Descriptors;
+using BaSyx.Models.Core.AssetAdministrationShell.Generics;
+using BaSyx.Models.Core.Common;
+using BaSyx.Utils.ResultHandling;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+
+namespace BaSyx.API.Components
+{
+ public class AssetAdministrationShellAggregatorServiceProvider : IAssetAdministrationShellAggregatorServiceProvider
+ {
+ public IEnumerable<IAssetAdministrationShell> AssetAdministrationShells => GetBinding();
+
+ private Dictionary<string, IAssetAdministrationShellServiceProvider> AssetAdministrationShellServiceProviders { get; }
+
+ private IAssetAdministrationShellAggregatorDescriptor _serviceDescriptor;
+ public IAssetAdministrationShellAggregatorDescriptor ServiceDescriptor
+ {
+ get
+ {
+ if (_serviceDescriptor == null)
+ _serviceDescriptor = new AssetAdministrationShellAggregatorDescriptor(AssetAdministrationShells, null);
+
+ return _serviceDescriptor;
+ }
+ private set
+ {
+ _serviceDescriptor = value;
+ }
+ }
+ public AssetAdministrationShellAggregatorServiceProvider(IAssetAdministrationShellAggregatorDescriptor descriptor) : this()
+ {
+ ServiceDescriptor = descriptor;
+ }
+
+ public AssetAdministrationShellAggregatorServiceProvider()
+ {
+ AssetAdministrationShellServiceProviders = new Dictionary<string, IAssetAdministrationShellServiceProvider>();
+ }
+
+ public void BindTo(IEnumerable<IAssetAdministrationShell> assetAdministrationShells)
+ {
+ foreach (var assetAdministrationShell in assetAdministrationShells)
+ {
+ RegisterAssetAdministrationShellServiceProvider(assetAdministrationShell.IdShort, assetAdministrationShell.CreateServiceProvider(true));
+ }
+ ServiceDescriptor = ServiceDescriptor ?? new AssetAdministrationShellAggregatorDescriptor(assetAdministrationShells, null);
+ }
+ public IEnumerable<IAssetAdministrationShell> GetBinding()
+ {
+ IEnumerable<IAssetAdministrationShellServiceProvider> serviceProviders = GetAssetAdministrationShellServiceProviders();
+ List<IAssetAdministrationShell> assetAdministrationShells = new List<IAssetAdministrationShell>();
+ foreach (var serviceProvider in serviceProviders)
+ {
+ IAssetAdministrationShell binding = serviceProvider.GetBinding();
+ assetAdministrationShells.Add(binding);
+ }
+ return assetAdministrationShells;
+ }
+
+ public IResult<IAssetAdministrationShell> CreateAssetAdministrationShell(IAssetAdministrationShell aas)
+ {
+ if (aas == null)
+ return new Result<IAssetAdministrationShell>(new ArgumentNullException(nameof(aas)));
+ RegisterAssetAdministrationShellServiceProvider(aas.IdShort, aas.CreateServiceProvider(true));
+
+ IAssetAdministrationShellServiceProvider serviceProvider = GetAssetAdministrationShellServiceProvider(aas.IdShort);
+ if (serviceProvider != null && serviceProvider.GetBinding() != null)
+ return new Result<IAssetAdministrationShell>(true, serviceProvider.GetBinding());
+ else
+ return new Result<IAssetAdministrationShell>(false, new Message(MessageType.Error, "Could not retrieve Asset Administration Shell Service Provider"));
+ }
+
+ public IResult DeleteAssetAdministrationShell(string aasId)
+ {
+ if (string.IsNullOrEmpty(aasId))
+ return new Result<IAssetAdministrationShell>(new ArgumentNullException(nameof(aasId)));
+ UnregisterAssetAdministrationShellServiceProvider(aasId);
+ return new Result(true);
+ }
+
+ public IAssetAdministrationShellServiceProvider GetAssetAdministrationShellServiceProvider(string id)
+ {
+ if (AssetAdministrationShellServiceProviders.TryGetValue(id, out IAssetAdministrationShellServiceProvider assetAdministrationShellServiceProvider))
+ return assetAdministrationShellServiceProvider;
+ else
+ return null;
+ }
+
+ public IEnumerable<IAssetAdministrationShellServiceProvider> GetAssetAdministrationShellServiceProviders()
+ {
+ return AssetAdministrationShellServiceProviders?.Values.ToList();
+ }
+
+ public void RegisterAssetAdministrationShellServiceProvider(string id, IAssetAdministrationShellServiceProvider assetAdministrationShellServiceProvider)
+ {
+ if (!AssetAdministrationShellServiceProviders.ContainsKey(id))
+ AssetAdministrationShellServiceProviders.Add(id, assetAdministrationShellServiceProvider);
+ }
+
+ public void UnregisterAssetAdministrationShellServiceProvider(string id)
+ {
+ if (!AssetAdministrationShellServiceProviders.ContainsKey(id))
+ AssetAdministrationShellServiceProviders.Remove(id);
+ }
+
+ public IResult<IAssetAdministrationShell> RetrieveAssetAdministrationShell(string aasId)
+ {
+ IAssetAdministrationShellServiceProvider serviceProvider = GetAssetAdministrationShellServiceProvider(aasId);
+ if(serviceProvider != null && serviceProvider.GetBinding() != null)
+ {
+ IAssetAdministrationShell binding = serviceProvider.GetBinding();
+ return new Result<IAssetAdministrationShell>(true, binding);
+ }
+ return new Result<IAssetAdministrationShell>(false, new NotFoundMessage("Asset Administration Shell Service Provider"));
+ }
+
+ public IResult<IElementContainer<IAssetAdministrationShell>> RetrieveAssetAdministrationShells()
+ {
+ return new Result<IElementContainer<IAssetAdministrationShell>>(true, new ElementContainer<IAssetAdministrationShell>(AssetAdministrationShells));
+ }
+
+ public IResult UpdateAssetAdministrationShell(string aasId, IAssetAdministrationShell aas)
+ {
+ if (string.IsNullOrEmpty(aasId))
+ return new Result<IAssetAdministrationShell>(new ArgumentNullException(nameof(aasId)));
+ if (aas == null)
+ return new Result<IAssetAdministrationShell>(new ArgumentNullException(nameof(aas)));
+ return CreateAssetAdministrationShell(aas);
+ }
+ }
+}
diff --git a/sdks/dotnet/basyx-core/BaSyx.API/Components/AssetAdministrationShellServiceProvider.cs b/sdks/dotnet/basyx-core/BaSyx.API/Components/AssetAdministrationShellServiceProvider.cs
new file mode 100644
index 0000000..56e218c
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.API/Components/AssetAdministrationShellServiceProvider.cs
@@ -0,0 +1,156 @@
+/*******************************************************************************
+* Copyright (c) 2020 Robert Bosch GmbH
+* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
+*
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License 2.0 which is available at
+* http://www.eclipse.org/legal/epl-2.0
+*
+* SPDX-License-Identifier: EPL-2.0
+*******************************************************************************/
+using BaSyx.Models.Core.AssetAdministrationShell.Generics;
+using BaSyx.Utils.ResultHandling;
+using System.Collections.Generic;
+using System.Linq;
+using BaSyx.API.AssetAdministrationShell.Extensions;
+using BaSyx.Models.Connectivity.Descriptors;
+using BaSyx.Models.Core.Common;
+
+namespace BaSyx.API.Components
+{
+ public abstract class AssetAdministrationShellServiceProvider : IAssetAdministrationShellServiceProvider, ISubmodelServiceProviderRegistry
+ {
+ public abstract IAssetAdministrationShell AssetAdministrationShell { get; protected set; }
+
+ private IAssetAdministrationShellDescriptor _serviceDescriptor;
+ public IAssetAdministrationShellDescriptor ServiceDescriptor
+ {
+ get
+ {
+ if (_serviceDescriptor == null)
+ _serviceDescriptor = new AssetAdministrationShellDescriptor(AssetAdministrationShell, null);
+
+ if (_serviceDescriptor.SubmodelDescriptors?.Count == 0 && SubmodelServiceProviders != null)
+ foreach (var submodelServiceProvider in SubmodelServiceProviders)
+ {
+ if (submodelServiceProvider.Value?.ServiceDescriptor != null)
+ _serviceDescriptor.SubmodelDescriptors.Create(submodelServiceProvider.Value.ServiceDescriptor);
+ }
+
+ return _serviceDescriptor;
+ }
+ private set
+ {
+ _serviceDescriptor = value;
+ }
+ }
+ public ISubmodelServiceProviderRegistry SubmodelRegistry => this;
+ private Dictionary<string, ISubmodelServiceProvider> SubmodelServiceProviders { get; } = new Dictionary<string, ISubmodelServiceProvider>();
+
+ public AssetAdministrationShellServiceProvider(IAssetAdministrationShellDescriptor assetAdministrationShellDescriptor) : this()
+ {
+ ServiceDescriptor = assetAdministrationShellDescriptor;
+ }
+ public AssetAdministrationShellServiceProvider(IAssetAdministrationShell assetAdministrationShell)
+ {
+ BindTo(assetAdministrationShell);
+ }
+
+ public AssetAdministrationShellServiceProvider()
+ {
+ AssetAdministrationShell = GenerateAssetAdministrationShell();
+ BindTo(AssetAdministrationShell);
+ }
+
+ public virtual void UseDefaultSubmodelServiceProvider()
+ {
+ foreach (var submodel in AssetAdministrationShell.Submodels)
+ {
+ var submodelServiceProvider = submodel.CreateServiceProvider();
+ RegisterSubmodelServiceProvider(submodel.IdShort, submodelServiceProvider);
+ }
+ }
+
+ public virtual IResult<ISubmodelDescriptor> RegisterSubmodelServiceProvider(string submodelId, ISubmodelServiceProvider submodelServiceProvider)
+ {
+ if (SubmodelServiceProviders.ContainsKey(submodelId))
+ SubmodelServiceProviders[submodelId] = submodelServiceProvider;
+ else
+ SubmodelServiceProviders.Add(submodelId, submodelServiceProvider);
+
+ return new Result<ISubmodelDescriptor>(true, submodelServiceProvider.ServiceDescriptor);
+ }
+ public virtual IResult<ISubmodelServiceProvider> GetSubmodelServiceProvider(string submodelId)
+ {
+ if (SubmodelServiceProviders.TryGetValue(submodelId, out ISubmodelServiceProvider submodelServiceProvider))
+ return new Result<ISubmodelServiceProvider>(true, submodelServiceProvider);
+ else
+ return new Result<ISubmodelServiceProvider>(false, new NotFoundMessage());
+ }
+
+ public virtual IResult UnregisterSubmodelServiceProvider(string submodelId)
+ {
+ if (SubmodelServiceProviders.TryGetValue(submodelId, out ISubmodelServiceProvider submodelServiceProvider))
+ {
+ SubmodelServiceProviders.Remove(submodelId);
+ return new Result<ISubmodelServiceProvider>(true);
+ }
+ else
+ return new Result<ISubmodelServiceProvider>(false, new NotFoundMessage());
+ }
+
+ public abstract IAssetAdministrationShell GenerateAssetAdministrationShell();
+
+ public virtual void BindTo(IAssetAdministrationShell element)
+ {
+ AssetAdministrationShell = element;
+ ServiceDescriptor = ServiceDescriptor ?? new AssetAdministrationShellDescriptor(element, null);
+ }
+ public virtual IAssetAdministrationShell GetBinding()
+ {
+ return AssetAdministrationShell;
+ }
+
+ public virtual IResult<ISubmodel> CreateSubmodel(ISubmodel submodel)
+ {
+ if (AssetAdministrationShell.Submodels == null)
+ AssetAdministrationShell.Submodels = new ElementContainer<ISubmodel>();
+ return AssetAdministrationShell.Submodels.Create(submodel);
+ }
+
+ public virtual IResult DeleteSubmodel(string submodelId)
+ {
+ if (AssetAdministrationShell.Submodels == null)
+ return new Result(false, new NotFoundMessage(submodelId));
+ return AssetAdministrationShell.Submodels.Delete(submodelId);
+ }
+
+ public virtual IResult<ISubmodel> RetrieveSubmodel(string submodelId)
+ {
+ if (AssetAdministrationShell.Submodels == null)
+ return new Result<ISubmodel>(false, new NotFoundMessage(submodelId));
+ return AssetAdministrationShell.Submodels.Retrieve(submodelId);
+ }
+
+ public virtual IResult<IElementContainer<ISubmodel>> RetrieveSubmodels()
+ {
+ if (AssetAdministrationShell.Submodels == null)
+ return new Result<ElementContainer<ISubmodel>>(false, new NotFoundMessage("Submodels"));
+ return AssetAdministrationShell.Submodels.RetrieveAll();
+ }
+
+ public virtual IResult<IEnumerable<ISubmodelServiceProvider>> GetSubmodelServiceProviders()
+ {
+ if (SubmodelServiceProviders.Values == null)
+ return new Result<IEnumerable<ISubmodelServiceProvider>>(false, new NotFoundMessage("Submodel Service Providers"));
+
+ return new Result<IEnumerable<ISubmodelServiceProvider>>(true, SubmodelServiceProviders.Values?.ToList());
+ }
+
+ public IResult<IAssetAdministrationShell> RetrieveAssetAdministrationShell()
+ {
+ var binding = GetBinding();
+ return new Result<IAssetAdministrationShell>(binding == null, binding);
+ }
+ }
+}
diff --git a/sdks/dotnet/basyx-core/BaSyx.API/Components/DefaultEndpointRegistration.cs b/sdks/dotnet/basyx-core/BaSyx.API/Components/DefaultEndpointRegistration.cs
new file mode 100644
index 0000000..d9317f4
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.API/Components/DefaultEndpointRegistration.cs
@@ -0,0 +1,115 @@
+/*******************************************************************************
+* Copyright (c) 2020 Robert Bosch GmbH
+* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
+*
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License 2.0 which is available at
+* http://www.eclipse.org/legal/epl-2.0
+*
+* SPDX-License-Identifier: EPL-2.0
+*******************************************************************************/
+using BaSyx.Models.Connectivity;
+using System;
+using System.Collections.Generic;
+
+namespace BaSyx.API.Components
+{
+ public static class DefaultEndpointRegistration
+ {
+ public static void UseDefaultEndpointRegistration(this IAssetAdministrationShellAggregatorServiceProvider serviceProvider, IEnumerable<IEndpoint> endpoints)
+ {
+ List<IEndpoint> aggregatorEndpoints = new List<IEndpoint>();
+ foreach (var endpoint in endpoints)
+ {
+ string epAddress = endpoint.Address;
+ if (!epAddress.EndsWith("/shells"))
+ epAddress = epAddress + (epAddress.EndsWith("/") ? "" : "/") + "shells";
+
+ aggregatorEndpoints.Add(EndpointFactory.CreateEndpoint(endpoint.Type, epAddress, endpoint.Security));
+ }
+
+ serviceProvider.ServiceDescriptor.AddEndpoints(aggregatorEndpoints);
+ var aasAggregatorDescriptor = serviceProvider.ServiceDescriptor;
+ foreach (var aasDescriptor in aasAggregatorDescriptor.AssetAdministrationShellDescriptors)
+ {
+ List<IEndpoint> aasEndpoints = new List<IEndpoint>();
+ foreach (var endpoint in aggregatorEndpoints)
+ {
+ var ep = EndpointFactory.CreateEndpoint(endpoint.Type, GetAssetAdministrationShellEndpoint(endpoint, aasDescriptor.IdShort), endpoint.Security);
+ aasEndpoints.Add(ep);
+ }
+ aasDescriptor.AddEndpoints(aasEndpoints);
+
+ foreach (var submodelDescriptor in aasDescriptor.SubmodelDescriptors)
+ {
+ List<IEndpoint> submodelEndpoints = new List<IEndpoint>();
+ foreach (var endpoint in aasEndpoints)
+ {
+ var ep = EndpointFactory.CreateEndpoint(endpoint.Type, GetSubmodelEndpoint(endpoint, submodelDescriptor.IdShort), endpoint.Security);
+ submodelEndpoints.Add(ep);
+ }
+ submodelDescriptor.AddEndpoints(submodelEndpoints);
+ }
+ }
+ }
+
+ public static void UseDefaultEndpointRegistration(this IAssetAdministrationShellServiceProvider serviceProvider, IEnumerable<IEndpoint> endpoints)
+ {
+ List<IEndpoint> aasEndpoints = new List<IEndpoint>();
+ foreach (var endpoint in endpoints)
+ {
+ string epAddress = endpoint.Address;
+ if (!epAddress.EndsWith("/aas"))
+ epAddress = epAddress + (epAddress.EndsWith("/") ? "" : "/") + "aas";
+
+ aasEndpoints.Add(EndpointFactory.CreateEndpoint(endpoint.Type, epAddress, endpoint.Security));
+ }
+
+ serviceProvider.ServiceDescriptor.AddEndpoints(aasEndpoints);
+ var aasDescriptor = serviceProvider.ServiceDescriptor;
+ foreach (var submodel in aasDescriptor.SubmodelDescriptors)
+ {
+ List<IEndpoint> spEndpoints = new List<IEndpoint>();
+ foreach (var endpoint in aasEndpoints)
+ {
+ var ep = EndpointFactory.CreateEndpoint(endpoint.Type, GetSubmodelEndpoint(endpoint, submodel.IdShort), endpoint.Security);
+ spEndpoints.Add(ep);
+ }
+ submodel.AddEndpoints(spEndpoints);
+ }
+ }
+
+ public static void UseDefaultEndpointRegistration(this ISubmodelServiceProvider serviceProvider, IEnumerable<IEndpoint> endpoints)
+ {
+ List<IEndpoint> submodelEndpoints = new List<IEndpoint>();
+ foreach (var endpoint in endpoints)
+ {
+ string epAddress = endpoint.Address;
+ if (!epAddress.EndsWith("/submodel"))
+ epAddress = epAddress + (epAddress.EndsWith("/") ? "" : "/") + "submodel";
+
+ submodelEndpoints.Add(EndpointFactory.CreateEndpoint(endpoint.Type, epAddress, endpoint.Security));
+ }
+
+ serviceProvider.ServiceDescriptor.AddEndpoints(submodelEndpoints);
+ }
+
+ public static string GetSubmodelEndpoint(IEndpoint endpoint, string submodelId)
+ {
+ string epAddress = endpoint.Address;
+ if (!epAddress.EndsWith("/aas"))
+ epAddress = epAddress + (epAddress.EndsWith("/") ? "" : "/") + "aas";
+
+ return epAddress + "/submodels/" + submodelId + "/submodel";
+ }
+
+ public static string GetAssetAdministrationShellEndpoint(IEndpoint endpoint, string aasId)
+ {
+ string epAddress = endpoint.Address;
+ if (!epAddress.EndsWith("/shells"))
+ epAddress = epAddress + (epAddress.EndsWith("/") ? "" : "/") + "shells";
+
+ return epAddress + "/" + aasId + "/aas";
+ }
+ }
+}
diff --git a/sdks/dotnet/basyx-core/BaSyx.API/Components/IAssetAdministrationShellAggregator.cs b/sdks/dotnet/basyx-core/BaSyx.API/Components/IAssetAdministrationShellAggregator.cs
new file mode 100644
index 0000000..001e7fb
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.API/Components/IAssetAdministrationShellAggregator.cs
@@ -0,0 +1,29 @@
+/*******************************************************************************
+* Copyright (c) 2020 Robert Bosch GmbH
+* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
+*
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License 2.0 which is available at
+* http://www.eclipse.org/legal/epl-2.0
+*
+* SPDX-License-Identifier: EPL-2.0
+*******************************************************************************/
+using BaSyx.Models.Core.AssetAdministrationShell.Generics;
+using BaSyx.Models.Core.Common;
+using BaSyx.Utils.ResultHandling;
+
+namespace BaSyx.API.Components
+{
+ public interface IAssetAdministrationShellAggregator
+ {
+ IResult<IAssetAdministrationShell> CreateAssetAdministrationShell(IAssetAdministrationShell aas);
+
+ IResult<IAssetAdministrationShell> RetrieveAssetAdministrationShell(string aasId);
+
+ IResult<IElementContainer<IAssetAdministrationShell>> RetrieveAssetAdministrationShells();
+
+ IResult UpdateAssetAdministrationShell(string aasId, IAssetAdministrationShell aas);
+
+ IResult DeleteAssetAdministrationShell(string aasId);
+ }
+}
diff --git a/sdks/dotnet/basyx-core/BaSyx.API/Components/IAssetAdministrationShellAggregatorServiceProvider.cs b/sdks/dotnet/basyx-core/BaSyx.API/Components/IAssetAdministrationShellAggregatorServiceProvider.cs
new file mode 100644
index 0000000..6e89fdb
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.API/Components/IAssetAdministrationShellAggregatorServiceProvider.cs
@@ -0,0 +1,24 @@
+/*******************************************************************************
+* Copyright (c) 2020 Robert Bosch GmbH
+* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
+*
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License 2.0 which is available at
+* http://www.eclipse.org/legal/epl-2.0
+*
+* SPDX-License-Identifier: EPL-2.0
+*******************************************************************************/
+using BaSyx.Models.Connectivity.Descriptors;
+using BaSyx.Models.Core.AssetAdministrationShell.Generics;
+using System.Collections.Generic;
+
+namespace BaSyx.API.Components
+{
+ public interface IAssetAdministrationShellAggregatorServiceProvider : IServiceProvider<IEnumerable<IAssetAdministrationShell>, IAssetAdministrationShellAggregatorDescriptor>, IAssetAdministrationShellAggregator
+ {
+ IEnumerable<IAssetAdministrationShell> AssetAdministrationShells { get; }
+ void RegisterAssetAdministrationShellServiceProvider(string id, IAssetAdministrationShellServiceProvider assetAdministrationShellServiceProvider);
+ IAssetAdministrationShellServiceProvider GetAssetAdministrationShellServiceProvider(string id);
+ IEnumerable<IAssetAdministrationShellServiceProvider> GetAssetAdministrationShellServiceProviders();
+ }
+}
diff --git a/sdks/dotnet/basyx-core/BaSyx.API/Components/IAssetAdministrationShellRegistry.cs b/sdks/dotnet/basyx-core/BaSyx.API/Components/IAssetAdministrationShellRegistry.cs
new file mode 100644
index 0000000..56fb2d7
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.API/Components/IAssetAdministrationShellRegistry.cs
@@ -0,0 +1,26 @@
+/*******************************************************************************
+* Copyright (c) 2020 Robert Bosch GmbH
+* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
+*
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License 2.0 which is available at
+* http://www.eclipse.org/legal/epl-2.0
+*
+* SPDX-License-Identifier: EPL-2.0
+*******************************************************************************/
+using BaSyx.Models.Connectivity.Descriptors;
+using BaSyx.Models.Core.Common;
+using BaSyx.Utils.ResultHandling;
+using System.Collections.Generic;
+
+namespace BaSyx.API.Components
+{
+ public interface IAssetAdministrationShellRegistry : ISubmodelRegistry
+ {
+ IResult<IAssetAdministrationShellDescriptor> CreateAssetAdministrationShell(IAssetAdministrationShellDescriptor aas);
+ IResult<IAssetAdministrationShellDescriptor> RetrieveAssetAdministrationShell(string aasId);
+ IResult<IElementContainer<IAssetAdministrationShellDescriptor>> RetrieveAssetAdministrationShells();
+ IResult UpdateAssetAdministrationShell(string aasId, Dictionary<string, string> metaData);
+ IResult DeleteAssetAdministrationShell(string aasId);
+ }
+}
diff --git a/sdks/dotnet/basyx-core/BaSyx.API/Components/IAssetAdministrationShellServiceProvider.cs b/sdks/dotnet/basyx-core/BaSyx.API/Components/IAssetAdministrationShellServiceProvider.cs
new file mode 100644
index 0000000..be5f059
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.API/Components/IAssetAdministrationShellServiceProvider.cs
@@ -0,0 +1,22 @@
+/*******************************************************************************
+* Copyright (c) 2020 Robert Bosch GmbH
+* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
+*
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License 2.0 which is available at
+* http://www.eclipse.org/legal/epl-2.0
+*
+* SPDX-License-Identifier: EPL-2.0
+*******************************************************************************/
+using BaSyx.API.Clients;
+using BaSyx.Models.Connectivity.Descriptors;
+using BaSyx.Models.Core.AssetAdministrationShell.Generics;
+
+namespace BaSyx.API.Components
+{
+ public interface IAssetAdministrationShellServiceProvider : IServiceProvider<IAssetAdministrationShell, IAssetAdministrationShellDescriptor>, IAssetAdministrationShellClient
+ {
+ IAssetAdministrationShell AssetAdministrationShell { get; }
+ ISubmodelServiceProviderRegistry SubmodelRegistry { get; }
+ }
+}
diff --git a/sdks/dotnet/basyx-core/BaSyx.API/Components/IServiceProvider.cs b/sdks/dotnet/basyx-core/BaSyx.API/Components/IServiceProvider.cs
new file mode 100644
index 0000000..e960d13
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.API/Components/IServiceProvider.cs
@@ -0,0 +1,22 @@
+/*******************************************************************************
+* Copyright (c) 2020 Robert Bosch GmbH
+* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
+*
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License 2.0 which is available at
+* http://www.eclipse.org/legal/epl-2.0
+*
+* SPDX-License-Identifier: EPL-2.0
+*******************************************************************************/
+using BaSyx.Models.Connectivity;
+
+namespace BaSyx.API.Components
+{
+ public interface IServiceProvider<TModelElement, TServiceDescriptor>
+ where TServiceDescriptor : IServiceDescriptor
+ {
+ TServiceDescriptor ServiceDescriptor { get; }
+ void BindTo(TModelElement element);
+ TModelElement GetBinding();
+ }
+}
diff --git a/sdks/dotnet/basyx-core/BaSyx.API/Components/ISubmodelRegistry.cs b/sdks/dotnet/basyx-core/BaSyx.API/Components/ISubmodelRegistry.cs
new file mode 100644
index 0000000..f772e56
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.API/Components/ISubmodelRegistry.cs
@@ -0,0 +1,24 @@
+/*******************************************************************************
+* Copyright (c) 2020 Robert Bosch GmbH
+* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
+*
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License 2.0 which is available at
+* http://www.eclipse.org/legal/epl-2.0
+*
+* SPDX-License-Identifier: EPL-2.0
+*******************************************************************************/
+using BaSyx.Models.Connectivity.Descriptors;
+using BaSyx.Models.Core.Common;
+using BaSyx.Utils.ResultHandling;
+
+namespace BaSyx.API.Components
+{
+ public interface ISubmodelRegistry
+ {
+ IResult<ISubmodelDescriptor> CreateSubmodel(string aasId, ISubmodelDescriptor submodel);
+ IResult<IElementContainer<ISubmodelDescriptor>> RetrieveSubmodels(string aasId);
+ IResult<ISubmodelDescriptor> RetrieveSubmodel(string aasId, string submodelId);
+ IResult DeleteSubmodel(string aasId, string submodelId);
+ }
+}
diff --git a/sdks/dotnet/basyx-core/BaSyx.API/Components/ISubmodelServiceProvider.cs b/sdks/dotnet/basyx-core/BaSyx.API/Components/ISubmodelServiceProvider.cs
new file mode 100644
index 0000000..b9aea39
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.API/Components/ISubmodelServiceProvider.cs
@@ -0,0 +1,39 @@
+/*******************************************************************************
+* Copyright (c) 2020 Robert Bosch GmbH
+* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
+*
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License 2.0 which is available at
+* http://www.eclipse.org/legal/epl-2.0
+*
+* SPDX-License-Identifier: EPL-2.0
+*******************************************************************************/
+using BaSyx.Utils.Client;
+using BaSyx.Models.Core.AssetAdministrationShell.Generics;
+using BaSyx.Utils.ResultHandling;
+using System;
+using BaSyx.API.AssetAdministrationShell;
+using BaSyx.API.Clients;
+using BaSyx.Models.Connectivity.Descriptors;
+using BaSyx.Models.Core.AssetAdministrationShell.Generics.SubmodelElementTypes;
+using BaSyx.Models.Core.Common;
+
+namespace BaSyx.API.Components
+{
+ public interface ISubmodelServiceProvider : IServiceProvider<ISubmodel, ISubmodelDescriptor>, ISubmodelClient
+ {
+ ISubmodel Submodel { get; }
+
+ void SubscribeUpdates(string propertyId, Action<IValue> updateFunction);
+ void PublishUpdate(string propertyId, IValue value);
+ IResult ThrowEvent(IPublishableEvent publishableEvent, string topic, Action<IMessagePublishedEventArgs> MessagePublished, byte qosLevel, bool retain);
+
+
+ PropertyHandler RetrievePropertyHandler(string propertyId);
+ void RegisterPropertyHandler(string propertyId, PropertyHandler handler);
+ Delegate RetrieveMethodDelegate(string operationId);
+ void RegisterMethodCalledHandler(string operationId, Delegate handler);
+ void RegisterEventDelegate(string eventId, EventDelegate handler);
+ void ConfigureEventHandler(IMessageClient messageClient);
+ }
+}
diff --git a/sdks/dotnet/basyx-core/BaSyx.API/Components/ISubmodelServiceProviderRegistry.cs b/sdks/dotnet/basyx-core/BaSyx.API/Components/ISubmodelServiceProviderRegistry.cs
new file mode 100644
index 0000000..ff839ec
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.API/Components/ISubmodelServiceProviderRegistry.cs
@@ -0,0 +1,24 @@
+/*******************************************************************************
+* Copyright (c) 2020 Robert Bosch GmbH
+* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
+*
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License 2.0 which is available at
+* http://www.eclipse.org/legal/epl-2.0
+*
+* SPDX-License-Identifier: EPL-2.0
+*******************************************************************************/
+using BaSyx.Models.Connectivity.Descriptors;
+using BaSyx.Utils.ResultHandling;
+using System.Collections.Generic;
+
+namespace BaSyx.API.Components
+{
+ public interface ISubmodelServiceProviderRegistry
+ {
+ IResult<ISubmodelDescriptor> RegisterSubmodelServiceProvider(string id, ISubmodelServiceProvider submodelServiceProvider);
+ IResult UnregisterSubmodelServiceProvider(string id);
+ IResult<ISubmodelServiceProvider> GetSubmodelServiceProvider(string id);
+ IResult<IEnumerable<ISubmodelServiceProvider>> GetSubmodelServiceProviders();
+ }
+}
diff --git a/sdks/dotnet/basyx-core/BaSyx.API/Components/InternalAssetAdministationShellServiceProvider.cs b/sdks/dotnet/basyx-core/BaSyx.API/Components/InternalAssetAdministationShellServiceProvider.cs
new file mode 100644
index 0000000..a5f960b
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.API/Components/InternalAssetAdministationShellServiceProvider.cs
@@ -0,0 +1,30 @@
+/*******************************************************************************
+* Copyright (c) 2020 Robert Bosch GmbH
+* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
+*
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License 2.0 which is available at
+* http://www.eclipse.org/legal/epl-2.0
+*
+* SPDX-License-Identifier: EPL-2.0
+*******************************************************************************/
+using BaSyx.Models.Core.AssetAdministrationShell.Generics;
+
+namespace BaSyx.API.Components
+{
+ internal sealed class InternalAssetAdministationShellServiceProvider : AssetAdministrationShellServiceProvider
+ {
+
+ internal InternalAssetAdministationShellServiceProvider(IAssetAdministrationShell aas) : base(aas)
+ {
+ AssetAdministrationShell = aas;
+ }
+
+ public override IAssetAdministrationShell AssetAdministrationShell { get; protected set; }
+
+ public override IAssetAdministrationShell GenerateAssetAdministrationShell()
+ {
+ return AssetAdministrationShell;
+ }
+ }
+}
diff --git a/sdks/dotnet/basyx-core/BaSyx.API/Components/InternalSubmodelServiceProvider.cs b/sdks/dotnet/basyx-core/BaSyx.API/Components/InternalSubmodelServiceProvider.cs
new file mode 100644
index 0000000..9443034
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.API/Components/InternalSubmodelServiceProvider.cs
@@ -0,0 +1,22 @@
+/*******************************************************************************
+* Copyright (c) 2020 Robert Bosch GmbH
+* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
+*
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License 2.0 which is available at
+* http://www.eclipse.org/legal/epl-2.0
+*
+* SPDX-License-Identifier: EPL-2.0
+*******************************************************************************/
+using BaSyx.Models.Core.AssetAdministrationShell.Generics;
+
+namespace BaSyx.API.Components
+{
+ internal sealed class InternalSubmodelServiceProvider : SubmodelServiceProvider
+ {
+ internal InternalSubmodelServiceProvider(ISubmodel submodel) : base(submodel)
+ {
+ UseInMemoryPropertyHandler();
+ }
+ }
+}
diff --git a/sdks/dotnet/basyx-core/BaSyx.API/Components/SubmodelServiceProvider.cs b/sdks/dotnet/basyx-core/BaSyx.API/Components/SubmodelServiceProvider.cs
new file mode 100644
index 0000000..9b2543b
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.API/Components/SubmodelServiceProvider.cs
@@ -0,0 +1,452 @@
+/*******************************************************************************
+* Copyright (c) 2020 Robert Bosch GmbH
+* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
+*
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License 2.0 which is available at
+* http://www.eclipse.org/legal/epl-2.0
+*
+* SPDX-License-Identifier: EPL-2.0
+*******************************************************************************/
+using BaSyx.API.AssetAdministrationShell;
+using BaSyx.Models.Core.AssetAdministrationShell.Generics;
+using BaSyx.Models.Core.AssetAdministrationShell.Implementations;
+using BaSyx.Utils.ResultHandling;
+using BaSyx.Utils.Client;
+using System.Collections.Generic;
+using System;
+using Newtonsoft.Json;
+using System.Reflection;
+using System.Linq.Expressions;
+using System.Linq;
+using BaSyx.Models.Extensions;
+using BaSyx.Models.Connectivity.Descriptors;
+using BaSyx.Models.Core.Common;
+using BaSyx.Models.Core.AssetAdministrationShell.Generics.SubmodelElementTypes;
+
+namespace BaSyx.API.Components
+{
+ public class SubmodelServiceProvider : ISubmodelServiceProvider
+ {
+ public static JsonSerializerSettings JsonSerializerSettings { get; set; }
+ static SubmodelServiceProvider()
+ {
+ JsonSerializerSettings = new JsonStandardSettings();
+ }
+
+ public ISubmodel Submodel { get; protected set; }
+ public ISubmodelDescriptor ServiceDescriptor { get; internal set; }
+
+ private Dictionary<string, Delegate> methodCalledHandler;
+ private Dictionary<string, PropertyHandler> propertyHandler;
+ private Dictionary<string, Action<IValue>> updateFunctions;
+ private Dictionary<string, EventDelegate> eventDelegates;
+
+ private IMessageClient messageClient;
+
+ private readonly GetPropertyValueHandler GenericPropertyGetHandler = de => { return new ElementValue(de.Value, de.ValueType); };
+ private readonly SetPropertyValueHandler GenericPropertySetHandler = (de, val) => { de.Value = val.Value; };
+
+ public SubmodelServiceProvider()
+ {
+ methodCalledHandler = new Dictionary<string, Delegate>();
+ propertyHandler = new Dictionary<string, PropertyHandler>();
+ updateFunctions = new Dictionary<string, Action<IValue>>();
+ eventDelegates = new Dictionary<string, EventDelegate>();
+ }
+
+ public SubmodelServiceProvider(ISubmodel submodel) : this()
+ {
+ BindTo(submodel);
+ }
+ public SubmodelServiceProvider(ISubmodel submodel, ISubmodelDescriptor submodelDescriptor) : this()
+ {
+ Submodel = submodel;
+ ServiceDescriptor = submodelDescriptor;
+ }
+
+ public void BindTo(ISubmodel element)
+ {
+ Submodel = element;
+ ServiceDescriptor = new SubmodelDescriptor(element, null);
+ }
+ public ISubmodel GetBinding()
+ {
+ return Submodel;
+ }
+
+ public void UseInMemoryPropertyHandler()
+ {
+ if(Submodel.Properties?.Count() > 0)
+ foreach (var property in Submodel.Properties)
+ {
+ RegisterPropertyHandler(property.IdShort,
+ new PropertyHandler(property.Get ?? GenericPropertyGetHandler, property.Set ?? GenericPropertySetHandler));
+ }
+ }
+
+ public void UsePropertyHandler(PropertyHandler propertyHandler)
+ {
+ if (Submodel.Properties?.Count() > 0)
+ foreach (var property in Submodel.Properties)
+ RegisterPropertyHandler(property.IdShort, propertyHandler);
+ }
+
+ public void UseOperationHandler(MethodCalledHandler methodCalledHandler)
+ {
+ if (Submodel.Operations?.Count() > 0)
+ foreach (var operation in Submodel.Operations)
+ RegisterMethodCalledHandler(operation.IdShort, methodCalledHandler);
+ }
+
+ public IResult<IEvent> CreateEvent(IEvent eventable)
+ {
+ if (Submodel == null)
+ return new Result<IEvent>(false, new NotFoundMessage("Submodel"));
+
+ return Submodel.SubmodelElements.Create(eventable);
+ }
+
+ public IResult<IOperation> CreateOperation(IOperation operation)
+ {
+ if (Submodel == null)
+ return new Result<IOperation>(false, new NotFoundMessage("Submodel"));
+
+ return Submodel.SubmodelElements.Create(operation);
+ }
+
+ public IResult<IProperty> CreateProperty(IProperty property)
+ {
+ if (Submodel == null)
+ return new Result<IProperty>(false, new NotFoundMessage("Submodel"));
+
+ RegisterPropertyHandler(property.IdShort,
+ new PropertyHandler(property.Get ?? GenericPropertyGetHandler, property.Set ?? GenericPropertySetHandler));
+
+ return Submodel.SubmodelElements.Create(property);
+ }
+
+ public IResult DeleteEvent(string eventId)
+ {
+ if (Submodel == null)
+ return new Result(false, new NotFoundMessage("Submodel"));
+
+ if (Submodel.Events == null)
+ return new Result(false, new NotFoundMessage(eventId));
+ return Submodel.SubmodelElements.Delete(eventId);
+ }
+
+ public IResult DeleteOperation(string operationId)
+ {
+ if (Submodel == null)
+ return new Result(false, new NotFoundMessage("Submodel"));
+
+ if (Submodel.Operations == null)
+ return new Result(false, new NotFoundMessage(operationId));
+ return Submodel.SubmodelElements.Delete(operationId);
+ }
+
+ public IResult DeleteProperty(string propertyId)
+ {
+ if (Submodel == null)
+ return new Result(false, new NotFoundMessage("Submodel"));
+
+ if (Submodel.Properties == null)
+ return new Result(false, new NotFoundMessage(propertyId));
+
+ if (propertyHandler.ContainsKey(propertyId))
+ propertyHandler.Remove(propertyId);
+
+ return Submodel.SubmodelElements.Delete(propertyId);
+ }
+
+ public MethodCalledHandler RetrieveMethodCalledHandler(string operationId)
+ {
+ if (methodCalledHandler.TryGetValue(operationId, out Delegate handler))
+ return (MethodCalledHandler)handler;
+ else
+ return null;
+ }
+
+ public Delegate RetrieveMethodDelegate(string operationId)
+ {
+ if (methodCalledHandler.TryGetValue(operationId, out Delegate handler))
+ return handler;
+ else
+ return null;
+ }
+
+ public PropertyHandler RetrievePropertyHandler(string propertyId)
+ {
+ if (propertyHandler.TryGetValue(propertyId, out PropertyHandler handler))
+ return handler;
+ else
+ return null;
+ }
+
+ public void RegisterPropertyHandler(string propertyId, PropertyHandler handler)
+ {
+ if (!propertyHandler.ContainsKey(propertyId))
+ propertyHandler.Add(propertyId, handler);
+ else
+ propertyHandler[propertyId] = handler;
+ }
+
+ public void RegisterMethodCalledHandler(string operationId, MethodCalledHandler handler)
+ {
+ if (!methodCalledHandler.ContainsKey(operationId))
+ methodCalledHandler.Add(operationId, handler);
+ else
+ methodCalledHandler[operationId] = handler;
+ }
+
+ public void RegisterMethodCalledHandler(string operationId, Delegate handler)
+ {
+ if (!methodCalledHandler.ContainsKey(operationId))
+ methodCalledHandler.Add(operationId, handler);
+ else
+ methodCalledHandler[operationId] = handler;
+ }
+
+ public void RegisterEventDelegate(string eventId, EventDelegate eventDelegate)
+ {
+ if (!eventDelegates.ContainsKey(eventId))
+ eventDelegates.Add(eventId, eventDelegate);
+ else
+ eventDelegates[eventId] = eventDelegate;
+ }
+
+ public void RegisterMethodCalledHandler(string operationId, MethodInfo methodInfo, object target)
+ {
+ var parameters = from parameter in methodInfo.GetParameters() select parameter.ParameterType;
+ Delegate del = methodInfo.CreateDelegate(Expression.GetDelegateType(parameters.Concat(new[] { methodInfo.ReturnType }).ToArray()), target);
+ RegisterMethodCalledHandler(operationId, del);
+ }
+
+ public IResult InvokeOperation(string operationId, IOperationVariableSet inputArguments, IOperationVariableSet outputArguments, int timeout)
+ {
+ if (Submodel == null)
+ return new Result(false, new NotFoundMessage("Submodel"));
+
+ var operation_Retrieved = RetrieveOperation(operationId);
+ if (operation_Retrieved.Success && operation_Retrieved.Entity != null)
+ {
+ if (operation_Retrieved.Entity.OnMethodCalled != null)
+ {
+ var result = operation_Retrieved.Entity.OnMethodCalled.Invoke(operation_Retrieved.Entity, inputArguments, outputArguments);
+ return result;
+ }
+ else if (methodCalledHandler.TryGetValue(operationId, out Delegate handler))
+ {
+ var result = (IResult)handler.DynamicInvoke(operation_Retrieved.Entity, inputArguments, outputArguments);
+ return result;
+ }
+ }
+ outputArguments = null;
+ return operation_Retrieved;
+ }
+
+ public IResult ThrowEvent(IPublishableEvent publishableEvent, string topic = "/", Action<IMessagePublishedEventArgs> MessagePublished = null, byte qosLevel = 2, bool retain = false)
+ {
+ if (messageClient == null || !messageClient.IsConnected)
+ return new Result(false, new Message(MessageType.Warning, "MessageClient is not initialized or not connected"));
+
+ if (publishableEvent == null)
+ return new Result(new ArgumentNullException("publishableEvent"));
+
+ if (eventDelegates.TryGetValue(publishableEvent.Name, out EventDelegate eventDelegate))
+ eventDelegate.Invoke(this, publishableEvent);
+
+ string message = JsonConvert.SerializeObject(publishableEvent, JsonSerializerSettings);
+ return messageClient.Publish(topic, message, MessagePublished, qosLevel, retain);
+ }
+
+ public IResult<IEvent> RetrieveEvent(string eventId)
+ {
+ if (Submodel == null)
+ return new Result<IEvent>(false, new NotFoundMessage("Submodel"));
+
+ if (Submodel.Events == null)
+ return new Result<IEvent>(false, new NotFoundMessage(eventId));
+ return Submodel.SubmodelElements.Retrieve<IEvent>(eventId);
+ }
+
+ public IResult<IElementContainer<IEvent>> RetrieveEvents()
+ {
+ if (Submodel == null)
+ return new Result<ElementContainer<IEvent>>(false, new NotFoundMessage("Submodel"));
+
+ if(Submodel.Events == null)
+ return new Result<ElementContainer<IEvent>>(false, new NotFoundMessage("Events"));
+ return Submodel.SubmodelElements.RetrieveAll<IEvent>();
+ }
+
+ public IResult<IOperation> RetrieveOperation(string operationId)
+ {
+ if (Submodel == null)
+ return new Result<IOperation>(false, new NotFoundMessage("Submodel"));
+
+ if (Submodel.Operations == null)
+ return new Result<IOperation>(false, new NotFoundMessage(operationId));
+ return Submodel.SubmodelElements.Retrieve<IOperation>(operationId);
+ }
+
+ public IResult<IElementContainer<IOperation>> RetrieveOperations()
+ {
+ if (Submodel == null)
+ return new Result<ElementContainer<IOperation>>(false, new NotFoundMessage("Submodel"));
+
+ if (Submodel.Operations == null)
+ return new Result<ElementContainer<IOperation>>(false, new NotFoundMessage("Operations"));
+ return Submodel.SubmodelElements.RetrieveAll<IOperation>();
+ }
+
+ public IResult<IElementContainer<IProperty>> RetrieveProperties()
+ {
+ if (Submodel == null)
+ return new Result<ElementContainer<IProperty>>(false, new NotFoundMessage("Submodel"));
+
+ if (Submodel.Properties == null)
+ return new Result<ElementContainer<IProperty>>(false, new NotFoundMessage("Properties"));
+ return Submodel.SubmodelElements.RetrieveAll<IProperty>();
+ }
+
+ public IResult<IProperty> RetrieveProperty(string propertyId)
+ {
+ if (Submodel == null)
+ return new Result<IProperty>(false, new NotFoundMessage("Submodel"));
+
+ if (Submodel.Properties == null)
+ return new Result<IProperty>(false, new NotFoundMessage(propertyId));
+ return Submodel.SubmodelElements.Retrieve<IProperty>(propertyId);
+ }
+
+ public IResult<IValue> RetrievePropertyValue(string propertyId)
+ {
+ if (Submodel == null)
+ return new Result<IValue>(false, new NotFoundMessage("Submodel"));
+
+ if (propertyHandler.TryGetValue(propertyId, out PropertyHandler handler) && handler.GetHandler != null)
+ {
+ var property = RetrieveProperty(propertyId);
+ if(property.Success && property.Entity != null)
+ return new Result<IValue>(true, handler.GetHandler.Invoke(property.Entity));
+ else
+ return new Result<IValue>(false, new Message(MessageType.Error, "property not found"));
+ }
+ else
+ return new Result<IValue>(false, new Message(MessageType.Error, "propertyHandler or GetHandler not found"));
+ }
+
+
+ public IResult UpdatePropertyValue(string propertyId, IValue value)
+ {
+ if (Submodel == null)
+ return new Result(false, new NotFoundMessage("Submodel"));
+
+ if (propertyHandler.TryGetValue(propertyId, out PropertyHandler handler) && handler.SetHandler != null)
+ {
+ var property = RetrieveProperty(propertyId);
+ if (property.Success && property.Entity != null)
+ {
+ handler.SetHandler.Invoke(property.Entity, value);
+ return new Result(true);
+ }
+ else
+ return new Result<IValue>(false, new Message(MessageType.Error, "property not found"));
+ }
+ else
+ return new Result<IValue>(false, new Message(MessageType.Error, "propertyHandler or SetHandler not found"));
+ }
+
+ public virtual void ConfigureEventHandler(IMessageClient messageClient)
+ {
+ this.messageClient = messageClient;
+ }
+
+ public virtual void SubscribeUpdates(string propertyId, Action<IValue> updateFunction)
+ {
+ if (!updateFunctions.ContainsKey(propertyId))
+ updateFunctions.Add(propertyId, updateFunction);
+ else
+ updateFunctions[propertyId] = updateFunction;
+ }
+
+ public virtual void PublishUpdate(string propertyId, IValue value)
+ {
+ if (updateFunctions.TryGetValue(propertyId, out Action<IValue> updateFunction))
+ updateFunction.Invoke(value);
+
+ }
+
+ public IResult<ISubmodel> RetrieveSubmodel()
+ {
+ var submodel = GetBinding();
+ return new Result<ISubmodel>(submodel != null, submodel);
+ }
+
+ public IResult<ISubmodelElement> CreateSubmodelElement(ISubmodelElement submodelElement)
+ {
+ if (Submodel == null)
+ return new Result<ISubmodelElement>(false, new NotFoundMessage("Submodel"));
+
+ return Submodel.SubmodelElements.Create(submodelElement);
+ }
+
+ public IResult<IElementContainer<ISubmodelElement>> RetrieveSubmodelElements()
+ {
+ if (Submodel == null)
+ return new Result<ElementContainer<ISubmodelElement>>(false, new NotFoundMessage("Submodel"));
+
+ if (Submodel.SubmodelElements == null)
+ return new Result<ElementContainer<ISubmodelElement>>(false, new NotFoundMessage("SubmodelElements"));
+ return Submodel.SubmodelElements.RetrieveAll();
+ }
+
+ public IResult<ISubmodelElement> RetrieveSubmodelElement(string submodelElementId)
+ {
+ if (Submodel == null)
+ return new Result<ISubmodelElement>(false, new NotFoundMessage("Submodel"));
+
+ if (Submodel.SubmodelElements == null)
+ return new Result<ISubmodelElement>(false, new NotFoundMessage(submodelElementId));
+ return Submodel.SubmodelElements.Retrieve(submodelElementId);
+ }
+
+ public IResult<IValue> RetrieveSubmodelElementValue(string submodelElementId)
+ {
+ if (Submodel == null)
+ return new Result<IValue>(false, new NotFoundMessage("Submodel"));
+
+ if (Submodel.SubmodelElements == null)
+ return new Result<IValue>(false, new NotFoundMessage(submodelElementId));
+
+ return new Result<IValue>(true,
+ new ElementValue(
+ (Submodel.SubmodelElements[submodelElementId] as dynamic).Value,
+ (Submodel.SubmodelElements[submodelElementId] as dynamic).ValueType as DataType));
+ }
+
+ public IResult UpdateSubmodelElement(string submodelElementId, ISubmodelElement submodelElement)
+ {
+ if (Submodel == null)
+ return new Result(false, new NotFoundMessage("Submodel"));
+
+ if (Submodel.SubmodelElements == null)
+ return new Result(false, new NotFoundMessage(submodelElementId));
+
+ return Submodel.SubmodelElements.Update(submodelElementId, submodelElement);
+ }
+
+ public IResult DeleteSubmodelElement(string submodelElementId)
+ {
+ if (Submodel == null)
+ return new Result(false, new NotFoundMessage("Submodel"));
+
+ if (Submodel.SubmodelElements == null)
+ return new Result(false, new NotFoundMessage(submodelElementId));
+
+ return Submodel.SubmodelElements.Delete(submodelElementId);
+ }
+ }
+}
diff --git a/sdks/dotnet/basyx-core/BaSyx.API/basyxlogo.png b/sdks/dotnet/basyx-core/BaSyx.API/basyxlogo.png
new file mode 100644
index 0000000..226a4ff
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.API/basyxlogo.png
Binary files differ
diff --git a/sdks/dotnet/basyx-core/BaSyx.Core.sln b/sdks/dotnet/basyx-core/BaSyx.Core.sln
new file mode 100644
index 0000000..a71d516
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.Core.sln
@@ -0,0 +1,82 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 16
+VisualStudioVersion = 16.0.29418.71
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BaSyx.API", "BaSyx.API\BaSyx.API.csproj", "{87045925-FD2C-4BC9-BA55-8B4080BBA49C}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BaSyx.Utils", "BaSyx.Utils\BaSyx.Utils.csproj", "{87783EE4-52CD-4B54-B278-B61A7B9E226A}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BaSyx.Models", "BaSyx.Models\BaSyx.Models.csproj", "{BDC1FBE1-5F0F-4AEB-B8B0-D10A0922A3C1}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Core", "Core", "{7789655B-5AB4-4FA7-87F5-CC75DA047427}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BaSyx.API.Http.Controllers", "BaSyx.API.Http.Controllers\BaSyx.API.Http.Controllers.csproj", "{EC5C4CF5-86D6-48D6-A149-42C7F0FC1B3A}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Extended", "Extended", "{FC87953C-EE11-45AE-B74A-C477C1AAA40E}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BaSyx.Submodel.ServiceProvider.Distributed", "BaSyx.Submodel.ServiceProvider.Distributed\BaSyx.Submodel.ServiceProvider.Distributed.csproj", "{260092F5-D130-4A31-B3F9-230F08796142}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ServiceProvider", "ServiceProvider", "{11D38513-B474-4AC0-8383-1E47E250F95E}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BaSyx.Models.Export", "BaSyx.Models.Export\BaSyx.Models.Export.csproj", "{47F87FC5-0CA9-4C4E-83DB-F886E7CDB543}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ RemoteDebug|Any CPU = RemoteDebug|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {87045925-FD2C-4BC9-BA55-8B4080BBA49C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {87045925-FD2C-4BC9-BA55-8B4080BBA49C}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {87045925-FD2C-4BC9-BA55-8B4080BBA49C}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {87045925-FD2C-4BC9-BA55-8B4080BBA49C}.Release|Any CPU.Build.0 = Release|Any CPU
+ {87045925-FD2C-4BC9-BA55-8B4080BBA49C}.RemoteDebug|Any CPU.ActiveCfg = Debug|Any CPU
+ {87045925-FD2C-4BC9-BA55-8B4080BBA49C}.RemoteDebug|Any CPU.Build.0 = Debug|Any CPU
+ {87783EE4-52CD-4B54-B278-B61A7B9E226A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {87783EE4-52CD-4B54-B278-B61A7B9E226A}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {87783EE4-52CD-4B54-B278-B61A7B9E226A}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {87783EE4-52CD-4B54-B278-B61A7B9E226A}.Release|Any CPU.Build.0 = Release|Any CPU
+ {87783EE4-52CD-4B54-B278-B61A7B9E226A}.RemoteDebug|Any CPU.ActiveCfg = Debug|Any CPU
+ {87783EE4-52CD-4B54-B278-B61A7B9E226A}.RemoteDebug|Any CPU.Build.0 = Debug|Any CPU
+ {BDC1FBE1-5F0F-4AEB-B8B0-D10A0922A3C1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {BDC1FBE1-5F0F-4AEB-B8B0-D10A0922A3C1}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {BDC1FBE1-5F0F-4AEB-B8B0-D10A0922A3C1}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {BDC1FBE1-5F0F-4AEB-B8B0-D10A0922A3C1}.Release|Any CPU.Build.0 = Release|Any CPU
+ {BDC1FBE1-5F0F-4AEB-B8B0-D10A0922A3C1}.RemoteDebug|Any CPU.ActiveCfg = Debug|Any CPU
+ {BDC1FBE1-5F0F-4AEB-B8B0-D10A0922A3C1}.RemoteDebug|Any CPU.Build.0 = Debug|Any CPU
+ {EC5C4CF5-86D6-48D6-A149-42C7F0FC1B3A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {EC5C4CF5-86D6-48D6-A149-42C7F0FC1B3A}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {EC5C4CF5-86D6-48D6-A149-42C7F0FC1B3A}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {EC5C4CF5-86D6-48D6-A149-42C7F0FC1B3A}.Release|Any CPU.Build.0 = Release|Any CPU
+ {EC5C4CF5-86D6-48D6-A149-42C7F0FC1B3A}.RemoteDebug|Any CPU.ActiveCfg = Debug|Any CPU
+ {EC5C4CF5-86D6-48D6-A149-42C7F0FC1B3A}.RemoteDebug|Any CPU.Build.0 = Debug|Any CPU
+ {260092F5-D130-4A31-B3F9-230F08796142}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {260092F5-D130-4A31-B3F9-230F08796142}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {260092F5-D130-4A31-B3F9-230F08796142}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {260092F5-D130-4A31-B3F9-230F08796142}.Release|Any CPU.Build.0 = Release|Any CPU
+ {260092F5-D130-4A31-B3F9-230F08796142}.RemoteDebug|Any CPU.ActiveCfg = Debug|Any CPU
+ {260092F5-D130-4A31-B3F9-230F08796142}.RemoteDebug|Any CPU.Build.0 = Debug|Any CPU
+ {47F87FC5-0CA9-4C4E-83DB-F886E7CDB543}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {47F87FC5-0CA9-4C4E-83DB-F886E7CDB543}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {47F87FC5-0CA9-4C4E-83DB-F886E7CDB543}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {47F87FC5-0CA9-4C4E-83DB-F886E7CDB543}.Release|Any CPU.Build.0 = Release|Any CPU
+ {47F87FC5-0CA9-4C4E-83DB-F886E7CDB543}.RemoteDebug|Any CPU.ActiveCfg = Debug|Any CPU
+ {47F87FC5-0CA9-4C4E-83DB-F886E7CDB543}.RemoteDebug|Any CPU.Build.0 = Debug|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+ GlobalSection(NestedProjects) = preSolution
+ {87045925-FD2C-4BC9-BA55-8B4080BBA49C} = {7789655B-5AB4-4FA7-87F5-CC75DA047427}
+ {87783EE4-52CD-4B54-B278-B61A7B9E226A} = {7789655B-5AB4-4FA7-87F5-CC75DA047427}
+ {BDC1FBE1-5F0F-4AEB-B8B0-D10A0922A3C1} = {7789655B-5AB4-4FA7-87F5-CC75DA047427}
+ {EC5C4CF5-86D6-48D6-A149-42C7F0FC1B3A} = {FC87953C-EE11-45AE-B74A-C477C1AAA40E}
+ {260092F5-D130-4A31-B3F9-230F08796142} = {11D38513-B474-4AC0-8383-1E47E250F95E}
+ {47F87FC5-0CA9-4C4E-83DB-F886E7CDB543} = {7789655B-5AB4-4FA7-87F5-CC75DA047427}
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ SolutionGuid = {B028A9A2-E37C-44AF-8032-C8F0492BDB00}
+ EndGlobalSection
+EndGlobal
diff --git a/sdks/dotnet/basyx-core/BaSyx.Models.Export/AAS-v1.0.xsd b/sdks/dotnet/basyx-core/BaSyx.Models.Export/AAS-v1.0.xsd
new file mode 100644
index 0000000..afa3883
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.Models.Export/AAS-v1.0.xsd
@@ -0,0 +1,441 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<schema targetNamespace="http://www.admin-shell.io/aas/1/0" elementFormDefault="qualified" xmlns="http://www.w3.org/2001/XMLSchema" xmlns:aas="http://www.admin-shell.io/aas/1/0" xmlns:IEC61360="http://www.admin-shell.io/IEC61360/1/0">
+ <import schemaLocation="IEC61360-v1.0.xsd" namespace="http://www.admin-shell.io/IEC61360/1/0"/>
+ <element name="aasenv" type="aas:aasenv_t"/>
+ <complexType name="aasenv_t">
+ <sequence>
+ <element name="assetAdministrationShells" type="aas:assetAdministrationShells_t" minOccurs="0" maxOccurs="1"/>
+ <element name="assets" type="aas:assets_t" minOccurs="0" maxOccurs="1"/>
+ <element name="submodels" type="aas:submodels_t" minOccurs="0" maxOccurs="1"/>
+ <element name="conceptDescriptions" type="aas:conceptDescriptions_t" minOccurs="0" maxOccurs="1"/>
+ </sequence>
+ </complexType>
+ <complexType name="assetAdministrationShells_t">
+ <sequence>
+ <element name="assetAdministrationShell" type="aas:assetAdministrationShell_t" minOccurs="0" maxOccurs="unbounded"/>
+ </sequence>
+ </complexType>
+ <complexType name="assets_t">
+ <sequence>
+ <element name="asset" type="aas:asset_t" minOccurs="0" maxOccurs="unbounded"/>
+ </sequence>
+ </complexType>
+ <complexType name="asset_t">
+ <sequence>
+ <group ref="aas:identifiable"/>
+ <group ref="aas:hasDataSpecifications"/>
+ <group ref="aas:hasKind"/>
+ <element name="assetIdentificationModelRef" type="aas:reference_t" minOccurs="0" maxOccurs="1"/>
+ </sequence>
+ </complexType>
+ <complexType name="assetAdministrationShell_t">
+ <sequence>
+ <group ref="aas:identifiable"/>
+ <group ref="aas:hasDataSpecifications"/>
+ <element name="derivedFrom" type="aas:reference_t" minOccurs="0" maxOccurs="1"/>
+ <element name="assetRef" type="aas:reference_t" minOccurs="1" maxOccurs="1"/>
+ <element name="submodelRefs" type="aas:submodelRefs_t" minOccurs="0" maxOccurs="1"/>
+ <element name="views" type="aas:views_t" minOccurs="0" maxOccurs="1"/>
+ <element name="conceptDictionaries" type="aas:conceptDictionaries_t" minOccurs="0" maxOccurs="1"/>
+ </sequence>
+ </complexType>
+ <complexType name="submodel_t">
+ <sequence>
+ <group ref="aas:identifiable"/>
+ <group ref="aas:hasDataSpecifications"/>
+ <group ref="aas:hasSemantics"/>
+ <group ref="aas:hasKind"/>
+ <group ref="aas:qualifiable"/>
+ <element name="submodelElements" type="aas:submodelElements_t"/>
+ </sequence>
+ </complexType>
+ <complexType name="conceptDescription_t">
+ <sequence>
+ <group ref="aas:identifiable"/>
+ <group ref="aas:hasDataSpecifications"/>
+ <element name="isCaseOf" type="aas:reference_t" maxOccurs="unbounded" minOccurs="0"/>
+ </sequence>
+ </complexType>
+ <complexType name="view_t">
+ <sequence>
+ <group ref="aas:referable"/>
+ <group ref="aas:hasSemantics"/>
+ <group ref="aas:hasDataSpecifications"/>
+ <element name="containedElements" type="aas:containedElements_t"/>
+ </sequence>
+ </complexType>
+ <complexType name="submodelElements_t">
+ <sequence>
+ <element name="submodelElement" type="aas:submodelElement_t" minOccurs="0" maxOccurs="unbounded"/>
+ </sequence>
+ </complexType>
+ <complexType name="submodelElementAbstract_t">
+ <sequence>
+ <group ref="aas:referable"/>
+ <group ref="aas:hasSemantics"/>
+ <group ref="aas:hasDataSpecifications"/>
+ <group ref="aas:hasKind"/>
+ <group ref="aas:qualifiable"/>
+ </sequence>
+ </complexType>
+ <complexType name="submodelRefs_t">
+ <sequence>
+ <element name="submodelRef" type="aas:reference_t" minOccurs="0" maxOccurs="unbounded"/>
+ </sequence>
+ </complexType>
+ <complexType name="views_t">
+ <sequence>
+ <element name="view" type="aas:view_t" minOccurs="0" maxOccurs="unbounded"/>
+ </sequence>
+ </complexType>
+ <complexType name="conceptDictionary_t">
+ <sequence>
+ <group ref="aas:referable"/>
+ <element name="conceptDescriptionRefs" type="aas:conceptDescriptionsRef_t" minOccurs="0" maxOccurs="1"/>
+ </sequence>
+ </complexType>
+ <complexType name="conceptDescriptions_t">
+ <sequence>
+ <element name="conceptDescription" type="aas:conceptDescription_t" minOccurs="0" maxOccurs="unbounded"/>
+ </sequence>
+ </complexType>
+ <complexType name="conceptDictionaries_t">
+ <sequence>
+ <element name="conceptDictionary" type="aas:conceptDictionary_t" minOccurs="0" maxOccurs="unbounded"/>
+ </sequence>
+ </complexType>
+ <complexType name="submodels_t">
+ <sequence>
+ <element name="submodel" type="aas:submodel_t" minOccurs="0" maxOccurs="unbounded"/>
+ </sequence>
+ </complexType>
+ <complexType name="containedElements_t">
+ <sequence>
+ <element name="containedElementRef" type="aas:reference_t"/>
+ </sequence>
+ </complexType>
+ <complexType name="submodelElement_t">
+ <choice>
+ <element name="property" type="aas:property_t"/>
+ <element name="file" type="aas:file_t"/>
+ <element name="blob" type="aas:blob_t"/>
+ <element name="referenceElement" type="aas:referenceElement_t"/>
+ <element name="submodelElementCollection" type="aas:submodelElementCollection_t"/>
+ <element name="relationshipElement" type="aas:relationshipElement_t"/>
+ <element name="operation" type="aas:operation_t"/>
+ <element name="operationVariable" type="aas:operationVariable_t"/>
+ <element name="event" type="aas:event_t"/>
+ </choice>
+ </complexType>
+ <complexType name="property_t">
+ <complexContent>
+ <extension base="aas:submodelElementAbstract_t">
+ <sequence>
+ <element name="valueType" type="string"/>
+ <element name="value" type="aas:propertyValueType_t" maxOccurs="1" minOccurs="0"/>
+ <element name="valueId" type="aas:reference_t" maxOccurs="1" minOccurs="0"/>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+ <complexType name="file_t">
+ <complexContent>
+ <extension base="aas:submodelElementAbstract_t">
+ <sequence>
+ <element name="mimeType" type="string"/>
+ <element name="value" type="aas:pathType_t"/>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+ <complexType name="blob_t">
+ <complexContent>
+ <extension base="aas:submodelElementAbstract_t">
+ <sequence>
+ <element name="mimeType" type="string"/>
+ <element name="value" type="aas:blobType_t"/>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+ <complexType name="referenceElement_t">
+ <complexContent>
+ <extension base="aas:submodelElementAbstract_t">
+ <sequence>
+ <element name="value" type="aas:reference_t"/>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+ <complexType name="submodelElementCollection_t">
+ <complexContent>
+ <extension base="aas:submodelElementAbstract_t">
+ <sequence>
+ <element name="value" type="aas:submodelElements_t"/>
+ <element name="ordered" type="boolean"/>
+ <element name="allowDuplicates" type="boolean"/>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+ <complexType name="relationshipElement_t">
+ <complexContent>
+ <extension base="aas:submodelElementAbstract_t">
+ <sequence>
+ <element name="first" type="aas:reference_t"/>
+ <element name="second" type="aas:reference_t"/>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+ <complexType name="operation_t">
+ <complexContent>
+ <extension base="aas:submodelElementAbstract_t">
+ <sequence>
+ <element name="in" type="aas:operationVariable_t"/>
+ <element name="out" type="aas:operationVariable_t"/>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+ <complexType name="operationVariable_t">
+ <complexContent>
+ <extension base="aas:submodelElementAbstract_t">
+ <sequence>
+ <element name="value" type="aas:submodelElement_t"/>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+ <complexType name="event_t">
+ <complexContent>
+ <extension base="aas:submodelElementAbstract_t">
+ <sequence/>
+ </extension>
+ </complexContent>
+ </complexType>
+ <complexType name="dataSpecificationContent_t">
+ <choice>
+ <element name="dataSpecificationIEC61360" type="IEC61360:dataSpecificationIEC61630_t"/>
+ </choice>
+ </complexType>
+ <complexType name="conceptDescriptionsRef_t">
+ <sequence>
+ <element name="conceptDescriptionRef" type="aas:reference_t" minOccurs="0" maxOccurs="unbounded"/>
+ </sequence>
+ </complexType>
+ <complexType name="pathType_t">
+ <simpleContent>
+ <extension base="string"/>
+ </simpleContent>
+ </complexType>
+ <complexType name="blobType_t">
+ <simpleContent>
+ <extension base="base64Binary"/>
+ </simpleContent>
+ </complexType>
+ <complexType name="idPropertyDefinition_t">
+ <simpleContent>
+ <extension base="string">
+ <attribute name="idType" type="string" />
+ </extension>
+ </simpleContent>
+ </complexType>
+ <complexType name="idShort_t">
+ <simpleContent>
+ <extension base="string"/>
+ </simpleContent>
+ </complexType>
+ <complexType name="administration_t">
+ <sequence>
+ <element name="version" type="string" minOccurs="0" maxOccurs="1" />
+ <element name="revision" type="string" minOccurs="0" maxOccurs="1" />
+ </sequence>
+ </complexType>
+ <complexType name="identification_t">
+ <simpleContent>
+ <extension base="string">
+ <attribute name="idType" use="optional">
+ <simpleType>
+ <restriction base="string">
+ <enumeration value="URI"/>
+ <enumeration value="IRDI"/>
+ <enumeration value="Custom"/>
+ </restriction>
+ </simpleType>
+ </attribute>
+ </extension>
+ </simpleContent>
+ </complexType>
+ <group name="identifiable">
+ <sequence>
+ <group ref="aas:referable"/>
+ <element name="identification" type="aas:identification_t" minOccurs="0" maxOccurs="1"/>
+ <element name="administration" type="aas:administration_t" minOccurs="0" maxOccurs="1"/>
+ </sequence>
+ </group>
+ <group name="referable">
+ <sequence>
+ <element name="idShort" type="aas:idShort_t" minOccurs="0" maxOccurs="1"/>
+ <element name="category" type="string" minOccurs="0" maxOccurs="1"/>
+ <element name="description" type="aas:langStrings_t" minOccurs="0" maxOccurs="1"/>
+ <element name="parent" type="string" minOccurs="0" maxOccurs="1"/>
+ </sequence>
+ </group>
+ <complexType name="qualifiers_t">
+ <sequence>
+ <element name="qualifier" type="string" minOccurs="0" maxOccurs="unbounded"/>
+ </sequence>
+ </complexType>
+ <group name="qualifiable">
+ <sequence>
+ <element name="qualifier" type="aas:constraint_t" minOccurs="0" maxOccurs="1"/>
+ </sequence>
+ </group>
+ <group name="hasDataSpecifications">
+ <sequence>
+ <element name="embeddedDataSpecification" type="aas:embeddedDataSpecification_t" maxOccurs="unbounded" minOccurs="0"/>
+ </sequence>
+ </group>
+ <group name="hasSemantics">
+ <sequence>
+ <element name="semanticId" type="aas:semanticId_t" minOccurs="0"/>
+ </sequence>
+ </group>
+ <complexType name="semanticId_t">
+ <complexContent>
+ <extension base="aas:reference_t"/>
+ </complexContent>
+ </complexType>
+ <complexType name="reference_t">
+ <sequence>
+ <element name="keys" type="aas:keys_t"/>
+ </sequence>
+ </complexType>
+ <complexType name="qualifier_t">
+ <sequence>
+ <group ref="aas:hasSemantics"/>
+ <element name="qualifierType" type="string"/>
+ <element name="qualifierValue" type="string" maxOccurs="1" minOccurs="0"/>
+ <element name="qualifierValueId" type="aas:reference_t" maxOccurs="1" minOccurs="0"/>
+ </sequence>
+ </complexType>
+ <complexType name="formula_t">
+ <sequence>
+ <element name="dependsOn" type="aas:references_t"/>
+ </sequence>
+ </complexType>
+ <complexType name="constraint_t">
+ <choice>
+ <element name="qualifier" type="aas:qualifier_t"/>
+ <element name="formula" type="aas:formula_t"/>
+ </choice>
+ </complexType>
+ <complexType name="references_t">
+ <sequence>
+ <element name="reference" type="aas:reference_t" minOccurs="0" maxOccurs="unbounded"/>
+ </sequence>
+ </complexType>
+ <group name="hasKind">
+ <sequence>
+ <element name="kind" minOccurs="0" maxOccurs="1">
+ <simpleType>
+ <restriction base="string">
+ <enumeration value="Type"/>
+ <enumeration value="Instance"/>
+ </restriction>
+ </simpleType>
+ </element>
+ </sequence>
+ </group>
+ <complexType name="keys_t">
+ <sequence>
+ <element ref="aas:key" minOccurs="0" maxOccurs="unbounded"/>
+ </sequence>
+ </complexType>
+ <element name="key" type="aas:key_t"/>
+ <attributeGroup name="keyTypes">
+ <attribute name="localKeyType" use="optional">
+ <simpleType>
+ <restriction base="string">
+ <enumeration value="idShort"/>
+ </restriction>
+ </simpleType>
+ </attribute>
+ <attribute name="identifierType" use="optional">
+ <simpleType>
+ <restriction base="string">
+ <enumeration value="IRDI"/>
+ <enumeration value="URI"/>
+ <enumeration value="Custom"/>
+ </restriction>
+ </simpleType>
+ </attribute>
+ </attributeGroup>
+ <complexType name="key_t">
+ <simpleContent>
+ <extension base="string">
+ <attribute name="type">
+ <simpleType>
+ <restriction base="string">
+ <enumeration value="GlobalReference"/>
+ <enumeration value="ConceptDictionary"/>
+ <enumeration value="AccessPermissionRule"/>
+ <enumeration value="DataElement"/>
+ <enumeration value="View"/>
+ <enumeration value="Property"/>
+ <enumeration value="SubmodelElement"/>
+ <enumeration value="File"/>
+ <enumeration value="Blob"/>
+ <enumeration value="ReferenceElement"/>
+ <enumeration value="SubmodelElementCollection"/>
+ <enumeration value="RelationShipElement"/>
+ <enumeration value="Event"/>
+ <enumeration value="Operation"/>
+ <enumeration value="OperationVariable"/>
+ <enumeration value="AssetAdministrationShell"/>
+ <enumeration value="Submodel"/>
+ <enumeration value="ConceptDescription"/>
+ <enumeration value="Asset"/>
+ </restriction>
+ </simpleType>
+ </attribute>
+ <attribute name="idType">
+ <simpleType>
+ <restriction base="string">
+ <enumeration value="idShort"/>
+ <enumeration value="IRDI"/>
+ <enumeration value="URI"/>
+ <enumeration value="Custom"/>
+ </restriction>
+ </simpleType>
+ </attribute>
+ <attribute name="local" type="boolean"/>
+ </extension>
+ </simpleContent>
+ </complexType>
+ <complexType name="langString_t">
+ <simpleContent>
+ <extension base="string">
+ <attribute name="lang" type="string" />
+ </extension>
+ </simpleContent>
+ </complexType>
+ <complexType name="langStrings_t">
+ <sequence>
+ <element name="langString" type="aas:langString_t" minOccurs="0" maxOccurs="unbounded"/>
+ </sequence>
+ </complexType>
+ <complexType name="embeddedDataSpecification_t">
+ <sequence>
+ <element name="hasDataSpecification" type="aas:reference_t" maxOccurs="1" minOccurs="0"/>
+ <element name="dataSpecificationContent" type="aas:dataSpecificationContent_t" maxOccurs="1" minOccurs="0"/>
+ </sequence>
+ </complexType>
+ <complexType name="prvalueType_t"/>
+ <complexType name="propertyValueType_t">
+ <simpleContent>
+ <extension base="string"/>
+ </simpleContent>
+ </complexType>
+</schema>
\ No newline at end of file
diff --git a/sdks/dotnet/basyx-core/BaSyx.Models.Export/AAS-v2.0.xsd b/sdks/dotnet/basyx-core/BaSyx.Models.Export/AAS-v2.0.xsd
new file mode 100644
index 0000000..ad9ef37
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.Models.Export/AAS-v2.0.xsd
Binary files differ
diff --git a/sdks/dotnet/basyx-core/BaSyx.Models.Export/AASX.cs b/sdks/dotnet/basyx-core/BaSyx.Models.Export/AASX.cs
new file mode 100644
index 0000000..56b2521
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.Models.Export/AASX.cs
@@ -0,0 +1,300 @@
+/*******************************************************************************
+* Copyright (c) 2020 Robert Bosch GmbH
+* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
+*
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License 2.0 which is available at
+* http://www.eclipse.org/legal/epl-2.0
+*
+* SPDX-License-Identifier: EPL-2.0
+*******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.IO.Packaging;
+using System.Linq;
+using BaSyx.Models.Core.AssetAdministrationShell.Identification;
+using BaSyx.Models.Core.AssetAdministrationShell.Generics.SubmodelElementTypes;
+using NLog;
+using Microsoft.AspNetCore.StaticFiles;
+
+namespace BaSyx.Models.Export
+{
+ public sealed class AASX : IDisposable
+ {
+ public const string ROOT_FOLDER = "/";
+ public const string AASX_FOLDER = "/aasx";
+
+ public const string ORIGIN_RELATIONSHIP_TYPE = "http://www.admin-shell.io/aasx/relationships/aasx-origin";
+ public const string SPEC_RELATIONSHIP_TYPE = "http://www.admin-shell.io/aasx/relationships/aas-spec";
+ public const string SUPPLEMENTAL_RELATIONSHIP_TYPE = "http://www.admin-shell.io/aasx/relationships/aas-suppl";
+ public const string THUMBNAIL_RELATIONSHIP_TYPE = "http://schemas.openxmlformats.org/package/2006/relationships/metadata/thumbnail";
+
+ public static readonly Uri ORIGIN_URI = new Uri("/aasx/aasx-origin", UriKind.RelativeOrAbsolute);
+ private static readonly Logger logger = LogManager.GetCurrentClassLogger();
+
+ public List<PackagePart> SupplementaryFiles { get; } = new List<PackagePart>();
+
+ private Package aasxPackage;
+ private PackagePart originPart;
+ private PackagePart specPart;
+
+ public AASX(Package package)
+ {
+ aasxPackage = package;
+
+ LoadOrCreateOrigin();
+ LoadSpec();
+ }
+
+ public AASX(string aasxFilePath)
+ {
+ aasxPackage = Package.Open(aasxFilePath, FileMode.OpenOrCreate, FileAccess.ReadWrite, FileShare.Read);
+
+ LoadOrCreateOrigin();
+ LoadSpec();
+ LoadSupplementaryFiles();
+ }
+
+ private void LoadSupplementaryFiles()
+ {
+ if (specPart != null)
+ {
+ PackageRelationshipCollection relationships = specPart.GetRelationshipsByType("http://www.admin-shell.io/aasx/relationships/aas-suppl");
+ foreach (var relationship in relationships)
+ {
+ try
+ {
+ PackagePart file = aasxPackage.GetPart(relationship.TargetUri);
+ SupplementaryFiles.Add(file);
+ }
+ catch(Exception e)
+ {
+ logger.Warn(e, "Relationsship " + relationship.TargetUri + "does not exist in the package - Exception: " + e.Message);
+ continue;
+ }
+
+ }
+ }
+ }
+
+ private void LoadOrCreateOrigin()
+ {
+ PackageRelationshipCollection relationships = aasxPackage.GetRelationshipsByType(ORIGIN_RELATIONSHIP_TYPE);
+ originPart = relationships?.Where(r => r.TargetUri == ORIGIN_URI)?.Select(p => aasxPackage.GetPart(p.TargetUri))?.FirstOrDefault();
+ if(originPart == null)
+ {
+ originPart = aasxPackage.CreatePart(ORIGIN_URI, System.Net.Mime.MediaTypeNames.Text.Plain, CompressionOption.Maximum);
+ originPart.GetStream(FileMode.Create).Dispose();
+ aasxPackage.CreateRelationship(originPart.Uri, TargetMode.Internal, ORIGIN_RELATIONSHIP_TYPE);
+ }
+ }
+
+ private void LoadSpec()
+ {
+ if(originPart != null)
+ {
+ PackageRelationshipCollection relationships = originPart.GetRelationshipsByType(SPEC_RELATIONSHIP_TYPE);
+ specPart = relationships?.Select(s => aasxPackage.GetPart(s.TargetUri))?.FirstOrDefault();
+ }
+ }
+
+ private void ClearRelationshipAndPartFromPackagePart(PackagePart sourcePackagePart, string relationshipType, Uri targetUri)
+ {
+ PackageRelationshipCollection relationships = sourcePackagePart.GetRelationshipsByType(relationshipType);
+ foreach (var relationship in relationships.ToList())
+ if (relationship.TargetUri == targetUri)
+ sourcePackagePart.DeleteRelationship(relationship.Id);
+
+ if (aasxPackage.PartExists(targetUri))
+ aasxPackage.DeletePart(targetUri);
+ }
+ private void ClearRelationshipAndPartFromPackage(string relationshipType, Uri targetUri)
+ {
+ PackageRelationshipCollection relationships = aasxPackage.GetRelationshipsByType(relationshipType);
+ foreach (var relationship in relationships.ToList())
+ if (relationship.TargetUri == targetUri)
+ aasxPackage.DeleteRelationship(relationship.Id);
+
+ if (aasxPackage.PartExists(targetUri))
+ aasxPackage.DeletePart(targetUri);
+ }
+
+
+ private void ClearRelationshipsAndPartFromPackage(string relationshipType)
+ {
+ PackageRelationshipCollection relationships = aasxPackage.GetRelationshipsByType(relationshipType);
+ foreach (var relationship in relationships.ToList())
+ {
+ aasxPackage.DeleteRelationship(relationship.Id);
+
+ if(aasxPackage.PartExists(relationship.TargetUri))
+ aasxPackage.DeletePart(relationship.TargetUri);
+ }
+ }
+
+ private void ClearRelationshipsAndPartFromPackagePart(PackagePart sourcePackagePart, string relationshipType)
+ {
+ PackageRelationshipCollection relationships = sourcePackagePart.GetRelationshipsByType(relationshipType);
+ foreach (var relationship in relationships.ToList())
+ {
+ sourcePackagePart.DeleteRelationship(relationship.Id);
+
+ if (aasxPackage.PartExists(relationship.TargetUri))
+ aasxPackage.DeletePart(relationship.TargetUri);
+ }
+ }
+
+ public void AddThumbnail(string thumbnailPath)
+ {
+ ClearRelationshipsAndPartFromPackage(THUMBNAIL_RELATIONSHIP_TYPE);
+
+ string thumbnailUriPath = ROOT_FOLDER + Path.GetFileName(thumbnailPath);
+
+ Uri partUri = PackUriHelper.CreatePartUri(new Uri(thumbnailUriPath, UriKind.RelativeOrAbsolute));
+ PackagePart thumbnailPart = aasxPackage.CreatePart(partUri, GetContentType(thumbnailPath), CompressionOption.Maximum);
+ aasxPackage.CreateRelationship(thumbnailPart.Uri, TargetMode.Internal, THUMBNAIL_RELATIONSHIP_TYPE);
+ CopyFileToPackagePart(thumbnailPart, thumbnailPath);
+ }
+
+ public void AddEnvironment(Identifier aasId, string aasEnvPath)
+ {
+ if (aasId == null)
+ throw new ArgumentNullException("aasId");
+ if (string.IsNullOrEmpty(aasEnvPath))
+ throw new ArgumentNullException("aasEnvPath");
+ if(!System.IO.File.Exists(aasEnvPath))
+ throw new InvalidOperationException(aasEnvPath + " does not exist");
+
+ string aasIdName = aasId.Id;
+ foreach (char invalidChar in Path.GetInvalidFileNameChars())
+ aasIdName = aasIdName.Replace(invalidChar, '_');
+
+ string aasFilePath = "/aasx/" + aasIdName + "/" + aasIdName + ".aas" + Path.GetExtension(aasEnvPath);
+
+ Uri partUri = PackUriHelper.CreatePartUri(new Uri(aasFilePath, UriKind.RelativeOrAbsolute));
+ ClearRelationshipAndPartFromPackagePart(originPart, SPEC_RELATIONSHIP_TYPE, partUri);
+
+ specPart = aasxPackage.CreatePart(partUri, GetContentType(aasEnvPath), CompressionOption.Maximum);
+ originPart.CreateRelationship(specPart.Uri, TargetMode.Internal, SPEC_RELATIONSHIP_TYPE);
+
+ CopyFileToPackagePart(specPart, aasEnvPath);
+ }
+
+ public AssetAdministrationShellEnvironment_V1_0 GetEnvironment_V1_0()
+ {
+ if(specPart?.Uri != null)
+ {
+ string specFilePath = specPart.Uri.ToString();
+ string extension = Path.GetExtension(specFilePath)?.ToLower();
+ AssetAdministrationShellEnvironment_V1_0 environment;
+ switch (extension)
+ {
+ case ".json":
+ {
+ using (Stream file = specPart.GetStream(FileMode.Open, FileAccess.Read))
+ environment = AssetAdministrationShellEnvironment_V1_0.ReadEnvironment_V1_0(file, ExportType.Json);
+ }
+ break;
+ case ".xml":
+ {
+ using (Stream file = specPart.GetStream(FileMode.Open, FileAccess.Read))
+ environment = AssetAdministrationShellEnvironment_V1_0.ReadEnvironment_V1_0(file, ExportType.Xml);
+ }
+ break;
+ default:
+ logger.Error("Not supported file format: " + extension);
+ environment = null;
+ break;
+ }
+ return environment;
+ }
+ return null;
+ }
+
+ public AssetAdministrationShellEnvironment_V2_0 GetEnvironment_V2_0()
+ {
+ if (specPart?.Uri != null)
+ {
+ string specFilePath = specPart.Uri.ToString();
+ string extension = Path.GetExtension(specFilePath)?.ToLower();
+ AssetAdministrationShellEnvironment_V2_0 environment;
+ switch (extension)
+ {
+ case ".json":
+ {
+ using (Stream file = specPart.GetStream(FileMode.Open, FileAccess.Read))
+ environment = AssetAdministrationShellEnvironment_V2_0.ReadEnvironment_V2_0(file, ExportType.Json);
+ }
+ break;
+ case ".xml":
+ {
+ using (Stream file = specPart.GetStream(FileMode.Open, FileAccess.Read))
+ environment = AssetAdministrationShellEnvironment_V2_0.ReadEnvironment_V2_0(file, ExportType.Xml);
+ }
+ break;
+ default:
+ logger.Error("Not supported file format: " + extension);
+ environment = null;
+ break;
+ }
+ return environment;
+ }
+ return null;
+ }
+
+ public void AddFilesToAASX(Dictionary<string, IFile> fileDestinationMapping, CompressionOption compressionOption = CompressionOption.Maximum)
+ {
+ for (int i = 0; i < fileDestinationMapping.Count; i++)
+ {
+ string filePath = fileDestinationMapping.ElementAt(i).Key;
+ IFile file = fileDestinationMapping.ElementAt(i).Value;
+
+ string relativeDestination;
+ if (!file.Value.StartsWith(AASX_FOLDER))
+ relativeDestination = AASX_FOLDER + file.Value;
+ else
+ relativeDestination = file.Value;
+
+ Uri uri = PackUriHelper.CreatePartUri(new Uri(relativeDestination, UriKind.Relative));
+
+ ClearRelationshipAndPartFromPackagePart(specPart, SUPPLEMENTAL_RELATIONSHIP_TYPE, uri);
+
+ string contentType;
+ if (!string.IsNullOrEmpty(file.MimeType))
+ contentType = file.MimeType;
+ else
+ contentType = GetContentType(filePath);
+
+ PackagePart packagePart = aasxPackage.CreatePart(uri, contentType, compressionOption);
+ specPart.CreateRelationship(packagePart.Uri, TargetMode.Internal, SUPPLEMENTAL_RELATIONSHIP_TYPE);
+
+ CopyFileToPackagePart(packagePart, filePath);
+ }
+ }
+
+ private void CopyFileToPackagePart(PackagePart packagePart, string filePath)
+ {
+ using (FileStream fileStream = new FileStream(filePath, FileMode.Open, FileAccess.Read))
+ {
+ using (Stream destination = packagePart.GetStream())
+ {
+ fileStream.CopyTo(destination);
+ }
+ }
+ }
+
+ private static string GetContentType(string filePath)
+ {
+ if (!new FileExtensionContentTypeProvider().TryGetContentType(filePath, out string contentType))
+ contentType = null;
+
+ return contentType;
+ }
+
+ public void Dispose()
+ {
+ aasxPackage.Close();
+ }
+ }
+}
diff --git a/sdks/dotnet/basyx-core/BaSyx.Models.Export/AAS_ABAC-v2.0.xsd b/sdks/dotnet/basyx-core/BaSyx.Models.Export/AAS_ABAC-v2.0.xsd
new file mode 100644
index 0000000..4048a57
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.Models.Export/AAS_ABAC-v2.0.xsd
@@ -0,0 +1,171 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<schema xmlns="http://www.w3.org/2001/XMLSchema"
+ targetNamespace="http://www.admin-shell.io/aas/abac/2/0"
+ elementFormDefault="qualified"
+ xmlns:aas="http://www.admin-shell.io/aas/2/0"
+ xmlns:abac="http://www.admin-shell.io/aas/abac/2/0">
+
+ <import schemaLocation="AAS.xsd" namespace="http://www.admin-shell.io/aas/2/0"></import>
+
+ <complexType name="security_t">
+ <sequence>
+ <element name="accessControlPolicyPoints"
+ type="abac:accessControlPolicyPoints_t" minOccurs="1"
+ maxOccurs="1">
+ </element>
+ <element name="certificates" type="abac:certificates_t"
+ minOccurs="0" maxOccurs="1">
+ </element>
+ <element name="requiredCertificateExtensions" minOccurs="0" maxOccurs="1" type="aas:references_t"></element>
+ </sequence>
+ </complexType>
+
+
+ <complexType name="accessControlPolicyPoints_t">
+ <sequence>
+ <element name="policyAdministrationPoint" minOccurs="1" maxOccurs="1" type="abac:policyAdministrationPoint_t"></element>
+ <element name="policyDecisionPoint" type="abac:policyDecisionPoint_t" minOccurs="1" maxOccurs="1"></element>
+ <element name="policyEnforcementPoint" type="abac:policyEnforcementPoint_t" minOccurs="1" maxOccurs="1"></element>
+ <element name="policyInformationPoints" type="abac:policyInformationPoints_t" minOccurs="0" maxOccurs="1"></element>
+ </sequence>
+ </complexType>
+
+ <complexType name="policyAdministrationPoint_t">
+ <sequence>
+ <element name="localAccessControl"
+ type="abac:accessControl_t" minOccurs="0" maxOccurs="1">
+ </element>
+ <element name="externalAccessControl" type="boolean" minOccurs="0" maxOccurs="1"></element>
+ </sequence>
+ </complexType>
+
+ <complexType name="policyDecisionPoint_t">
+ <sequence>
+ <element name="externalPolicyDecisionPoint" type="boolean" minOccurs="1" maxOccurs="1"></element>
+ </sequence>
+ </complexType>
+
+ <complexType name="policyEnforcementPoint_t">
+ <sequence>
+ <element name="externalPolicyEnforcementPoint" type="boolean" minOccurs="1" maxOccurs="1"></element>
+ </sequence>
+ </complexType>
+
+ <complexType name="policyInformationPoints_t">
+ <sequence>
+ <element name="externalInformationPoints"
+ type="boolean" minOccurs="1" maxOccurs="1">
+ </element>
+ <element name="internalInformationPoints" type="abac:internalInformationPoints" minOccurs="0" maxOccurs="1"></element>
+ </sequence>
+ </complexType>
+
+ <complexType name="internalInformationPoints">
+ <sequence>
+ <element name="internalInformationPoint" type="aas:submodelRefs_t" minOccurs="0" maxOccurs="unbounded"></element>
+ </sequence>
+ </complexType>
+
+ <complexType name="accessControl_t">
+ <sequence>
+ <element name="selectableSubjectAttributes" type="aas:reference_t" minOccurs="0" maxOccurs="1"></element>
+ <element name="defaultSubjectAttributes" type="aas:reference_t" minOccurs="1" maxOccurs="1"></element>
+ <element name="selectablePermissions" type="aas:reference_t" minOccurs="0" maxOccurs="1"></element>
+ <element name="defaultPermissions" type="aas:reference_t" minOccurs="1" maxOccurs="1"> </element>
+ <element name="selectableEnvironmentAttributes" type="aas:reference_t" minOccurs="0" maxOccurs="1"></element>
+ <element name="defaultEnvironmentAttributes" type="aas:reference_t" minOccurs="0" maxOccurs="1"></element>
+ <element name="accessPermissionRules" type="abac:accessPermissionRules_t" minOccurs="0" maxOccurs="1"></element>
+ </sequence>
+ </complexType>
+
+ <complexType name="permissionPerObject_t">
+ <sequence>
+ <element name="object" type="aas:reference_t"></element>
+ <element name="targetObjectAttributes" type="abac:objectAttributes_t" minOccurs="0" maxOccurs="1"></element>
+ <element name="permissions" type="abac:permissions_t" minOccurs="0" maxOccurs="1"></element>
+ </sequence>
+ </complexType>
+
+ <complexType name="objectAttributes_t">
+ <sequence>
+ <element name="objectAttribute" type="aas:property_t" minOccurs="1" maxOccurs="unbounded"></element>
+ </sequence>
+ </complexType>
+
+ <complexType name="permissions_t">
+ <sequence>
+ <element name="permission" type="aas:property_t" minOccurs="1" maxOccurs="1"></element>
+ <element name="kindOfPermission" type="abac:permissionKind"></element>
+ </sequence>
+ </complexType>
+
+ <simpleType name="permissionKind">
+ <restriction base="string">
+ <enumeration value="Allow"></enumeration>
+ <enumeration value="Deny"></enumeration>
+ <enumeration value="NotApplicable"></enumeration>
+ <enumeration value="Undefined"></enumeration>
+ </restriction>
+ </simpleType>
+
+ <complexType name="accessPermissionRule_t">
+ <sequence>
+ <group ref="aas:qualifiable"></group>
+ <group ref="aas:referable"></group>
+ <element name="targetSubjectAttributes" type="abac:subjectAttributes_t" minOccurs="1" maxOccurs="unbounded"></element>
+ <element name="permissionsPerObject" type="abac:permissionPerObject_t" minOccurs="0" maxOccurs="unbounded"></element>
+ </sequence>
+ </complexType>
+
+ <complexType name="subjectAttributes_t">
+ <sequence>
+ <element name="subjectAttribute" type="aas:property_t" minOccurs="1" maxOccurs="unbounded"></element>
+ </sequence>
+ </complexType>
+
+ <complexType name="certificates_t">
+ <sequence>
+ <element name="certificate" type="abac:certificate_t" minOccurs="1" maxOccurs="unbounded"></element>
+ </sequence>
+ </complexType>
+
+ <complexType name="certificate_t">
+ <choice>
+ <element name="blobCertificate" type="abac:blobCertificate_t"></element>
+ </choice>
+ </complexType>
+
+
+ <element name="internalInformationPoints" type="aas:submodelRefs_t" />
+
+
+ <complexType name="accessPermissionRules_t">
+ <sequence>
+ <element name="accessPermissionRule" type="abac:accessPermissionRule_t" minOccurs="0" maxOccurs="unbounded"></element>
+ </sequence>
+ </complexType>
+
+
+ <complexType name="certificateAbstract_t">
+ </complexType>
+
+ <complexType name="blobCertificate_t">
+ <complexContent>
+ <extension base="abac:certificateAbstract_t">
+ <sequence>
+ <element name="blobCertificate" type="aas:blob_t"></element>
+ <element name="containedExtensions"
+ type="abac:containedExtensions_t" minOccurs="0" maxOccurs="1">
+ </element>
+ <element name="lastCertificate" type="boolean"></element>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+
+ <complexType name="containedExtensions_t">
+ <sequence>
+ <element name="containedExtension" type="aas:reference_t" minOccurs="0" maxOccurs="unbounded"></element>
+ </sequence>
+ </complexType>
+</schema>
\ No newline at end of file
diff --git a/sdks/dotnet/basyx-core/BaSyx.Models.Export/BaSyx.Models.Export.csproj b/sdks/dotnet/basyx-core/BaSyx.Models.Export/BaSyx.Models.Export.csproj
new file mode 100644
index 0000000..83f145a
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.Models.Export/BaSyx.Models.Export.csproj
@@ -0,0 +1,64 @@
+<Project Sdk="Microsoft.NET.Sdk">
+
+ <PropertyGroup>
+ <TargetFramework>netstandard2.0</TargetFramework>
+ <Authors>Constantin Ziesche</Authors>
+ <Company>Robert Bosch GmbH</Company>
+ <Description>The official BaSyx Collection of Information Model Classes for Export</Description>
+ <Copyright>Copyright 2019 - Robert Bosch GmbH</Copyright>
+ <PackageLicenseExpression>EPL-2.0</PackageLicenseExpression>
+ <PackageProjectUrl>https://wiki.eclipse.org/BaSyx</PackageProjectUrl>
+ <RepositoryUrl>https://git.eclipse.org/r/plugins/gitiles/basyx/basyx/+/master/sdks/csnet/</RepositoryUrl>
+ <PackageIcon>basyxlogo.png</PackageIcon>
+ <PackageIconUrl />
+ <PackageTags>BaSys BaSyx Models Export</PackageTags>
+ <AssemblyVersion>1.0.0.1</AssemblyVersion>
+ <Deterministic>false</Deterministic>
+ <Version>1.0.0</Version>
+ </PropertyGroup>
+
+ <ItemGroup>
+ <None Remove="AAS-v1.0.xsd" />
+ <None Remove="AAS-v2.0.xsd" />
+ <None Remove="AAS_ABAC-v2.0.xsd" />
+ <None Remove="IEC61360-v1.0.xsd" />
+ <None Remove="IEC61360-v2.0.xsd" />
+ <None Include="basyxlogo.png">
+ <Pack>True</Pack>
+ <PackagePath></PackagePath>
+ </None>
+ </ItemGroup>
+
+ <ItemGroup>
+ <Content Include="AAS-v1.0.xsd">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </Content>
+ <Content Include="AAS-v2.0.xsd">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </Content>
+ <Content Include="AAS_ABAC-v2.0.xsd">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </Content>
+ <Content Include="IEC61360-v1.0.xsd">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </Content>
+ <Content Include="IEC61360-v2.0.xsd">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </Content>
+ </ItemGroup>
+
+ <ItemGroup>
+ <PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="2.2.0" />
+ <PackageReference Include="NLog" Version="4.6.8" />
+ <PackageReference Include="System.IO.Packaging" Version="4.7.0" />
+ </ItemGroup>
+
+ <ItemGroup>
+ <ProjectReference Include="..\BaSyx.Models\BaSyx.Models.csproj" />
+ </ItemGroup>
+
+ <Target Name="PostBuild" AfterTargets="PostBuildEvent">
+ <Exec Command="IF EXIST %25BASYX_REPO%25 ( dotnet pack "$(ProjectPath)" --no-build --include-source --include-symbols --output "%25BASYX_REPO%25" ) ELSE ( ECHO BASYX_REPO Environment Variable not found)" />
+ </Target>
+
+</Project>
diff --git a/sdks/dotnet/basyx-core/BaSyx.Models.Export/ExportType.cs b/sdks/dotnet/basyx-core/BaSyx.Models.Export/ExportType.cs
new file mode 100644
index 0000000..00cdf77
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.Models.Export/ExportType.cs
@@ -0,0 +1,19 @@
+/*******************************************************************************
+* Copyright (c) 2020 Robert Bosch GmbH
+* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
+*
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License 2.0 which is available at
+* http://www.eclipse.org/legal/epl-2.0
+*
+* SPDX-License-Identifier: EPL-2.0
+*******************************************************************************/
+
+namespace BaSyx.Models.Export
+{
+ public enum ExportType
+ {
+ Json,
+ Xml
+ }
+}
diff --git a/sdks/dotnet/basyx-core/BaSyx.Models.Export/IEC61360-v1.0.xsd b/sdks/dotnet/basyx-core/BaSyx.Models.Export/IEC61360-v1.0.xsd
new file mode 100644
index 0000000..edfa025
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.Models.Export/IEC61360-v1.0.xsd
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.admin-shell.io/IEC61360/1/0" xmlns:IEC61360="http://www.admin-shell.io/IEC61360/1/0" xmlns:aas="http://www.admin-shell.io/aas/1/0" xmlns:Q1="aas">
+ <xsd:import schemaLocation="AAS-v1.0.xsd" namespace="http://www.admin-shell.io/aas/1/0"/>
+ <xsd:complexType name="dataSpecificationIEC61630_t">
+ <xsd:sequence>
+ <xsd:element ref="IEC61360:preferredName" maxOccurs="1" minOccurs="1"/>
+ <xsd:element ref="IEC61360:shortName" maxOccurs="1" minOccurs="0"/>
+ <xsd:element ref="IEC61360:unit" maxOccurs="1" minOccurs="0"/>
+ <xsd:element ref="IEC61360:unitId" maxOccurs="1" minOccurs="0"/>
+ <xsd:element ref="IEC61360:valueFormat" maxOccurs="1" minOccurs="0"/>
+ <xsd:element ref="IEC61360:sourceOfDefinition" maxOccurs="1" minOccurs="0"/>
+ <xsd:element ref="IEC61360:symbol" maxOccurs="1" minOccurs="0"/>
+ <xsd:element ref="IEC61360:dataType" maxOccurs="1" minOccurs="0"/>
+ <xsd:element ref="IEC61360:definition" maxOccurs="1" minOccurs="0"/>
+ <xsd:element ref="IEC61360:valueList" maxOccurs="1" minOccurs="0"/>
+ <xsd:element ref="IEC61360:code" maxOccurs="1" minOccurs="0"/>
+ </xsd:sequence>
+ </xsd:complexType>
+ <xsd:complexType name="definition_t">
+ <xsd:simpleContent>
+ <xsd:extension base="xsd:string">
+ <xsd:attribute name="lang" type="xsd:string" />
+ </xsd:extension>
+ </xsd:simpleContent>
+ </xsd:complexType>
+ <xsd:complexType name="valueList_t"/>
+ <xsd:complexType name="code_t"/>
+ <xsd:element name="preferredName" type="aas:langStrings_t"/>
+ <xsd:element name="shortName" type="xsd:string"/>
+ <xsd:element name="unit" type="xsd:string"/>
+ <xsd:element name="unitId" type="aas:reference_t"/>
+ <xsd:element name="valueFormat" type="xsd:string"/>
+ <xsd:element name="sourceOfDefinition" type="aas:langStrings_t"/>
+ <xsd:element name="symbol" type="xsd:string"/>
+ <xsd:element name="dataType" type="xsd:string"/>
+ <xsd:element name="definition" type="aas:langStrings_t"/> <!-- changed to langStrings_t-->
+ <xsd:element name="valueType" type="IEC61360:valueList_t"/>
+ <xsd:element name="code" type="IEC61360:code_t"/>
+ <xsd:element name="valueList" type="IEC61360:valueList_t"/>
+</xsd:schema>
\ No newline at end of file
diff --git a/sdks/dotnet/basyx-core/BaSyx.Models.Export/IEC61360-v2.0.xsd b/sdks/dotnet/basyx-core/BaSyx.Models.Export/IEC61360-v2.0.xsd
new file mode 100644
index 0000000..bcbeae5
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.Models.Export/IEC61360-v2.0.xsd
Binary files differ
diff --git a/sdks/dotnet/basyx-core/BaSyx.Models.Export/IModelType.cs b/sdks/dotnet/basyx-core/BaSyx.Models.Export/IModelType.cs
new file mode 100644
index 0000000..e76f585
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.Models.Export/IModelType.cs
@@ -0,0 +1,23 @@
+/*******************************************************************************
+* Copyright (c) 2020 Robert Bosch GmbH
+* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
+*
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License 2.0 which is available at
+* http://www.eclipse.org/legal/epl-2.0
+*
+* SPDX-License-Identifier: EPL-2.0
+*******************************************************************************/
+using BaSyx.Models.Core.Common;
+using Newtonsoft.Json;
+using System.Runtime.Serialization;
+using System.Xml.Serialization;
+
+namespace BaSyx.Models.Export
+{
+ public interface IModelType
+ {
+ [DataMember(Name = "modelType"), JsonProperty("modelType"), XmlIgnore]
+ ModelType ModelType { get; }
+ }
+}
diff --git a/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v1.0/AssetAdministrationShellEnvironment_V1_0.cs b/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v1.0/AssetAdministrationShellEnvironment_V1_0.cs
new file mode 100644
index 0000000..8da69d1
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v1.0/AssetAdministrationShellEnvironment_V1_0.cs
@@ -0,0 +1,512 @@
+/*******************************************************************************
+* Copyright (c) 2020 Robert Bosch GmbH
+* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
+*
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License 2.0 which is available at
+* http://www.eclipse.org/legal/epl-2.0
+*
+* SPDX-License-Identifier: EPL-2.0
+*******************************************************************************/
+using BaSyx.Models.Core.AssetAdministrationShell.Generics;
+using BaSyx.Models.Core.AssetAdministrationShell.Generics.SubmodelElementTypes;
+using BaSyx.Models.Core.AssetAdministrationShell.Implementations;
+using BaSyx.Models.Core.AssetAdministrationShell.Implementations.SubmodelElementTypes;
+using BaSyx.Models.Core.AssetAdministrationShell.References;
+using BaSyx.Models.Core.AssetAdministrationShell.Semantics;
+using BaSyx.Models.Core.Common;
+using BaSyx.Models.Export.Converter;
+using BaSyx.Models.Export.EnvironmentDataSpecifications;
+using BaSyx.Models.Export.EnvironmentSubmodelElements;
+using BaSyx.Models.Extensions;
+using BaSyx.Models.Extensions.Semantics.DataSpecifications;
+using BaSyx.Utils.DIExtensions;
+using Microsoft.Extensions.DependencyInjection;
+using Newtonsoft.Json;
+using Newtonsoft.Json.Converters;
+using NLog;
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Reflection;
+using System.Runtime.Serialization;
+using System.Xml;
+using System.Xml.Schema;
+using System.Xml.Serialization;
+using File = BaSyx.Models.Core.AssetAdministrationShell.Implementations.SubmodelElementTypes.File;
+
+namespace BaSyx.Models.Export
+{
+ [DataContract]
+ [XmlType(AnonymousType = true, Namespace = AAS_NAMESPACE)]
+ [XmlRoot(ElementName = "aasenv", Namespace = AAS_NAMESPACE, IsNullable = false)]
+ public class AssetAdministrationShellEnvironment_V1_0
+ {
+ public static IDIExtension DIExtension { get; }
+
+ public const string AAS_NAMESPACE = "http://www.admin-shell.io/aas/1/0";
+ public const string IEC61360_NAMESPACE = "http://www.admin-shell.io/IEC61360/1/0";
+ public const string AAS_XSD_FILENAME = "AAS-v1.0.xsd";
+ public const string IEC61360_XSD_FILENAME = "IEC61360-v1.0.xsd";
+
+ [DataMember(EmitDefaultValue = false, IsRequired = true, Name = "assetAdministrationShells", Order = 0)]
+ [XmlIgnore, JsonIgnore]
+ public List<IAssetAdministrationShell> AssetAdministrationShells { get; }
+
+ [DataMember(EmitDefaultValue = false, IsRequired = true, Name = "assets", Order = 1)]
+ [XmlIgnore, JsonIgnore]
+ public List<IAsset> Assets { get; }
+
+ [DataMember(EmitDefaultValue = false, IsRequired = true, Name = "submodels", Order = 2)]
+ [XmlIgnore, JsonIgnore]
+ public List<ISubmodel> Submodels { get; }
+
+ [DataMember(EmitDefaultValue = false, IsRequired = true, Name = "conceptDescriptions", Order = 3)]
+ [XmlIgnore, JsonIgnore]
+ public List<IConceptDescription> ConceptDescriptions { get; }
+
+ [JsonProperty("assetAdministrationShells")]
+ [XmlArray("assetAdministrationShells")]
+ [XmlArrayItem("assetAdministrationShell")]
+ public List<EnvironmentAssetAdministationShell_V1_0> EnvironmentAssetAdministationShells { get; set; }
+
+ [JsonProperty("assets")]
+ [XmlArray("assets")]
+ [XmlArrayItem("asset")]
+ public List<EnvironmentAsset_V1_0> EnvironmentAssets { get; set; }
+
+ [JsonProperty("submodels")]
+ [XmlArray("submodels")]
+ [XmlArrayItem("submodel")]
+ public List<EnvironmentSubmodel_V1_0> EnvironmentSubmodels { get; set; }
+
+ [JsonProperty("conceptDescriptions")]
+ [XmlArray("conceptDescriptions")]
+ [XmlArrayItem("conceptDescription")]
+ public List<EnvironmentConceptDescription_V1_0> EnvironmentConceptDescriptions { get; set; }
+
+ [IgnoreDataMember]
+ [XmlIgnore]
+ public Dictionary<string, IFile> SupplementalFiles;
+
+ private string ContentRoot = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
+
+ public static JsonSerializerSettings JsonSettings;
+ private static Logger logger = LogManager.GetCurrentClassLogger();
+
+ public static XmlReaderSettings XmlSettings;
+
+ static AssetAdministrationShellEnvironment_V1_0()
+ {
+ JsonSettings = new JsonSerializerSettings()
+ {
+ Formatting = Newtonsoft.Json.Formatting.Indented,
+ DefaultValueHandling = DefaultValueHandling.Include,
+ NullValueHandling = NullValueHandling.Ignore
+ };
+ JsonSettings.Converters.Add(new StringEnumConverter());
+
+ XmlSettings = new XmlReaderSettings();
+ XmlSettings.ValidationType = ValidationType.Schema;
+ XmlSettings.ValidationFlags |= XmlSchemaValidationFlags.ProcessInlineSchema;
+ XmlSettings.ValidationFlags |= XmlSchemaValidationFlags.ProcessSchemaLocation;
+ XmlSettings.ValidationFlags |= XmlSchemaValidationFlags.ReportValidationWarnings;
+ XmlSettings.ValidationEventHandler += new ValidationEventHandler(ValidationCallBack);
+ XmlSettings.Schemas.Add(AAS_NAMESPACE, AAS_XSD_FILENAME);
+ XmlSettings.Schemas.Add(IEC61360_NAMESPACE, IEC61360_XSD_FILENAME);
+
+ var services = new ServiceCollection();
+ services.UseStandardImplementation();
+
+ DIExtension = new DIExtension(services);
+ }
+
+ [JsonConstructor]
+ protected AssetAdministrationShellEnvironment_V1_0()
+ {
+ AssetAdministrationShells = new List<IAssetAdministrationShell>();
+ Submodels = new List<ISubmodel>();
+ Assets = new List<IAsset>();
+ ConceptDescriptions = new List<IConceptDescription>();
+ SupplementalFiles = new Dictionary<string, IFile>();
+
+ EnvironmentAssetAdministationShells = new List<EnvironmentAssetAdministationShell_V1_0>();
+ EnvironmentAssets = new List<EnvironmentAsset_V1_0>();
+ EnvironmentSubmodels = new List<EnvironmentSubmodel_V1_0>();
+ EnvironmentConceptDescriptions = new List<EnvironmentConceptDescription_V1_0>();
+ }
+
+ public AssetAdministrationShellEnvironment_V1_0(params IAssetAdministrationShell[] assetAdministrationShells) : this()
+ {
+ foreach (var aas in assetAdministrationShells)
+ AddAssetAdministationShell(aas);
+
+ ConvertToEnvironment();
+ }
+
+ public void AddAssetAdministationShell(IAssetAdministrationShell aas)
+ {
+ AssetAdministrationShells.Add(aas);
+ Assets.Add(aas.Asset);
+ if (aas.Submodels?.Count > 0)
+ {
+ Submodels.AddRange(aas.Submodels);
+ foreach (var submodel in aas.Submodels)
+ {
+ ExtractAndClearConceptDescriptions(submodel.SubmodelElements);
+ ExtractSupplementalFiles(submodel.SubmodelElements);
+ ResetConstraints(submodel.SubmodelElements);
+ }
+ }
+ }
+
+ private void ConvertToEnvironment()
+ {
+ foreach (var asset in Assets)
+ {
+ EnvironmentAsset_V1_0 envAsset = new EnvironmentAsset_V1_0()
+ {
+ Administration = asset.Administration,
+ AssetIdentificationModelReference = asset.AssetIdentificationModel?.ToEnvironmentReference_V1_0(),
+ Category = asset.Category,
+ Description = asset.Description,
+ Identification = asset.Identification,
+ IdShort = asset.IdShort,
+ Kind = asset.Kind
+ };
+ EnvironmentAssets.Add(envAsset);
+ }
+ foreach (var conceptDescription in ConceptDescriptions)
+ {
+ EmbeddedDataSpecification_V1_0 embeddedDataSpecification = null;
+ var dataSpecification = conceptDescription.EmbeddedDataSpecifications?.FirstOrDefault();
+ if(dataSpecification != null && dataSpecification.DataSpecificationContent is DataSpecificationIEC61360Content dataSpecificationContent)
+ {
+ embeddedDataSpecification = new EmbeddedDataSpecification_V1_0()
+ {
+ HasDataSpecification = dataSpecification.HasDataSpecification?.ToEnvironmentReference_V1_0(),
+ DataSpecificationContent = new DataSpecificationContent_V1_0()
+ {
+ DataSpecificationIEC61360 = dataSpecificationContent.ToEnvironmentDataSpecificationIEC61360_V1_0()
+ }
+ };
+ }
+
+ EnvironmentConceptDescription_V1_0 environmentConceptDescription = new EnvironmentConceptDescription_V1_0()
+ {
+ Administration = conceptDescription.Administration,
+ Category = conceptDescription.Category,
+ Description = conceptDescription.Description,
+ Identification = conceptDescription.Identification,
+ IdShort = conceptDescription.IdShort,
+ Parent = conceptDescription.Parent?.First?.Value,
+ IsCaseOf = conceptDescription.IsCaseOf?.ToList()?.ConvertAll(c => c.ToEnvironmentReference_V1_0()),
+ EmbeddedDataSpecification = embeddedDataSpecification
+ };
+
+ EnvironmentConceptDescriptions.Add(environmentConceptDescription);
+ }
+ foreach (var assetAdministrationShell in AssetAdministrationShells)
+ {
+ EnvironmentAssetAdministationShell_V1_0 environmentAssetAdministationShell = new EnvironmentAssetAdministationShell_V1_0()
+ {
+ Administration = assetAdministrationShell.Administration,
+ Category = assetAdministrationShell.Category,
+ Description = assetAdministrationShell.Description,
+ IdShort = assetAdministrationShell.IdShort,
+ Identification = assetAdministrationShell.Identification,
+ AssetReference = assetAdministrationShell.Asset?.ToEnvironmentReference_V1_0(),
+ SubmodelReferences = assetAdministrationShell.Submodels?.ToList().ConvertAll(c => c.ToEnvironmentReference_V1_0()),
+ Views = null,
+ ConceptDictionaries = null
+ };
+ EnvironmentAssetAdministationShells.Add(environmentAssetAdministationShell);
+ }
+ foreach (var submodel in Submodels)
+ {
+ EnvironmentSubmodel_V1_0 environmentSubmodel = new EnvironmentSubmodel_V1_0()
+ {
+ Administration = submodel.Administration,
+ Category = submodel.Category,
+ Description = submodel.Description,
+ Identification = submodel.Identification,
+ IdShort = submodel.IdShort,
+ Kind = submodel.Kind,
+ Parent = submodel.Parent?.First?.Value,
+ Qualifier = null,
+ SemanticId = submodel.SemanticId?.ToEnvironmentReference_V1_0(),
+ SubmodelElements = submodel.SubmodelElements.ToList().ConvertAll(c => c.ToEnvironmentSubmodelElement_V1_0())
+ };
+ EnvironmentSubmodels.Add(environmentSubmodel);
+ }
+ }
+
+
+ private void ExtractSupplementalFiles(IElementContainer<ISubmodelElement> submodelElements)
+ {
+ foreach (var smElement in submodelElements)
+ {
+ if (smElement is File file)
+ {
+ string filePath = ContentRoot + file.Value.Replace(Path.AltDirectorySeparatorChar, Path.DirectorySeparatorChar);
+ if (System.IO.File.Exists(filePath))
+ {
+ string destinationPath = file.Value;
+ if (!destinationPath.StartsWith(AASX.AASX_FOLDER))
+ destinationPath = AASX.AASX_FOLDER + destinationPath;
+
+ file.Value = destinationPath;
+ SupplementalFiles.Add(filePath, file);
+ }
+ }
+ else if (smElement.ModelType == ModelType.SubmodelElementCollection)
+ ExtractSupplementalFiles((smElement as SubmodelElementCollection).Value);
+ }
+ }
+
+ private void ExtractAndClearConceptDescriptions(IElementContainer<ISubmodelElement> submodelElements)
+ {
+ foreach (var smElement in submodelElements)
+ {
+ if (smElement.ConceptDescription != null)
+ {
+ ConceptDescriptions.Add(smElement.ConceptDescription);
+ (smElement as SubmodelElement).SemanticId = new Reference(new Key(KeyElements.ConceptDescription, smElement.ConceptDescription.Identification.IdType, smElement.ConceptDescription.Identification.Id, true));
+ (smElement as SubmodelElement).ConceptDescription = null;
+ (smElement as SubmodelElement).EmbeddedDataSpecifications = null;
+ }
+ else if (smElement.ModelType == ModelType.SubmodelElementCollection)
+ ExtractAndClearConceptDescriptions((smElement as SubmodelElementCollection).Value);
+ }
+ }
+
+ public void SetContentRoot(string contentRoot) => ContentRoot = contentRoot;
+
+ private void ResetConstraints(IElementContainer<ISubmodelElement> submodelElements)
+ {
+ foreach (var smElement in submodelElements)
+ {
+ if(smElement.Constraints?.Count > 0)
+ (smElement as SubmodelElement).Constraints = null;
+ if(smElement is IOperation operation)
+ {
+ if(operation.InputVariables?.Count > 0)
+ ResetConstraints((smElement as IOperation).InputVariables.ToElementContainer());
+ if (operation.OutputVariables?.Count > 0)
+ ResetConstraints((smElement as IOperation).OutputVariables.ToElementContainer());
+ }
+ else if (smElement.ModelType == ModelType.SubmodelElementCollection)
+ ResetConstraints((smElement as SubmodelElementCollection).Value);
+ }
+ }
+
+ public void WriteEnvironment_V1_0(ExportType exportType, string filePath) => WriteEnvironment_V1_0(this, exportType, filePath);
+
+ public static void WriteEnvironment_V1_0(AssetAdministrationShellEnvironment_V1_0 environment, ExportType exportType, string filePath)
+ {
+ if (environment == null)
+ return;
+
+ switch (exportType)
+ {
+ case ExportType.Json:
+ try
+ {
+ string serialized = JsonConvert.SerializeObject(environment, JsonSettings);
+ System.IO.File.WriteAllText(filePath, serialized);
+ }
+ catch (Exception e)
+ {
+ logger.Error(e);
+ }
+ break;
+ case ExportType.Xml:
+ try
+ {
+ using (StreamWriter writer = new StreamWriter(filePath))
+ {
+ XmlSerializer serializer = new XmlSerializer(typeof(AssetAdministrationShellEnvironment_V1_0), AAS_NAMESPACE);
+ XmlSerializerNamespaces namespaces = new XmlSerializerNamespaces();
+ namespaces.Add("xsi", XmlSchema.InstanceNamespace);
+ namespaces.Add("aas", AAS_NAMESPACE);
+ namespaces.Add("IEC61360", IEC61360_NAMESPACE);
+ serializer.Serialize(writer, environment, namespaces);
+ }
+
+ }
+ catch (Exception e)
+ {
+ logger.Error(e);
+ }
+ break;
+ default:
+ break;
+ }
+ }
+
+
+ public static AssetAdministrationShellEnvironment_V1_0 ReadEnvironment_V1_0(Stream stream, ExportType exportType)
+ {
+ AssetAdministrationShellEnvironment_V1_0 env = null;
+
+ try
+ {
+ switch (exportType)
+ {
+ case ExportType.Xml:
+ {
+ XmlSerializer serializer = new XmlSerializer(typeof(AssetAdministrationShellEnvironment_V1_0), AAS_NAMESPACE);
+
+ using (XmlReader reader = XmlReader.Create(stream, XmlSettings))
+ env = (AssetAdministrationShellEnvironment_V1_0)serializer.Deserialize(reader);
+ }
+ break;
+ case ExportType.Json:
+ {
+ using (StreamReader reader = new StreamReader(stream))
+ env = JsonConvert.DeserializeObject<AssetAdministrationShellEnvironment_V1_0>(reader.ReadToEnd(), JsonSettings);
+ }
+ break;
+ default:
+ throw new InvalidOperationException(exportType + " not supported");
+ }
+
+ ConvertToAssetAdministrationShell(env);
+ return env;
+ }
+ catch (Exception e)
+ {
+ logger.Error(e, "Failed to read environment - Exception: " + e.Message);
+ return null;
+ }
+ }
+
+
+ public static AssetAdministrationShellEnvironment_V1_0 ReadEnvironment_V1_0(string filePath)
+ {
+ if (string.IsNullOrEmpty(filePath))
+ throw new ArgumentNullException(filePath);
+ if (!System.IO.File.Exists(filePath))
+ throw new ArgumentException(filePath + " does not exist");
+
+ AssetAdministrationShellEnvironment_V1_0 env = null;
+
+ string fileExtension = Path.GetExtension(filePath);
+ ExportType exportType;
+ switch (fileExtension)
+ {
+ case ".xml":
+ exportType = ExportType.Xml;
+ break;
+ case ".json":
+ exportType = ExportType.Json;
+ break;
+ default:
+ throw new InvalidOperationException(fileExtension + " not supported");
+ }
+
+ using (FileStream file = new FileStream(filePath, FileMode.Open, FileAccess.Read))
+ env = ReadEnvironment_V1_0(file, exportType);
+
+ if (env == null)
+ return null;
+
+ ConvertToAssetAdministrationShell(env);
+
+ return env;
+ }
+
+ private static void ConvertToAssetAdministrationShell(AssetAdministrationShellEnvironment_V1_0 environment)
+ {
+ foreach (var envAsset in environment.EnvironmentAssets)
+ {
+ Asset asset = new Asset
+ {
+ Administration = envAsset.Administration,
+ Category = envAsset.Category,
+ Description = envAsset.Description,
+ Identification = envAsset.Identification,
+ IdShort = envAsset.IdShort,
+ Kind = envAsset.Kind,
+ AssetIdentificationModel = envAsset.AssetIdentificationModelReference?.ToReference_V1_0<ISubmodel>()
+ };
+ environment.Assets.Add(asset);
+ }
+ foreach (var envConceptDescription in environment.EnvironmentConceptDescriptions)
+ {
+ ConceptDescription conceptDescription = new ConceptDescription()
+ {
+ Administration = envConceptDescription.Administration,
+ Category = envConceptDescription.Category,
+ Description = envConceptDescription.Description,
+ Identification = envConceptDescription.Identification,
+ IdShort = envConceptDescription.IdShort,
+ IsCaseOf = envConceptDescription.IsCaseOf?.ConvertAll(c => c.ToReference_V1_0()),
+ EmbeddedDataSpecifications = (envConceptDescription.EmbeddedDataSpecification?.DataSpecificationContent?.DataSpecificationIEC61360 != null) ? new List<DataSpecificationIEC61360>() : null
+ };
+ if(conceptDescription.EmbeddedDataSpecifications != null)
+ {
+ DataSpecificationIEC61360 dataSpecification = envConceptDescription
+ .EmbeddedDataSpecification
+ .DataSpecificationContent
+ .DataSpecificationIEC61360
+ .ToDataSpecificationIEC61360();
+
+ (conceptDescription.EmbeddedDataSpecifications as List<DataSpecificationIEC61360>).Add(dataSpecification);
+ }
+ environment.ConceptDescriptions.Add(conceptDescription);
+ }
+ foreach (var envSubmodel in environment.EnvironmentSubmodels)
+ {
+ Submodel submodel = new Submodel()
+ {
+ Administration = envSubmodel.Administration,
+ Category = envSubmodel.Category,
+ Description = envSubmodel.Description,
+ Identification = envSubmodel.Identification,
+ IdShort = envSubmodel.IdShort,
+ Kind = envSubmodel.Kind,
+ SemanticId = envSubmodel.SemanticId?.ToReference_V1_0(),
+ ConceptDescription = null,
+ };
+ submodel.SubmodelElements.AddRange(envSubmodel.SubmodelElements.ConvertAll(c => c.submodelElement?.ToSubmodelElement(environment.ConceptDescriptions)));
+
+ environment.Submodels.Add(submodel);
+ }
+ foreach (var envAssetAdministrationShell in environment.EnvironmentAssetAdministationShells)
+ {
+ AssetAdministrationShell assetAdministrationShell = new AssetAdministrationShell()
+ {
+ Administration = envAssetAdministrationShell.Administration,
+ Category = envAssetAdministrationShell.Category,
+ DerivedFrom = envAssetAdministrationShell.DerivedFrom?.ToReference_V1_0<IAssetAdministrationShell>(),
+ Description = envAssetAdministrationShell.Description,
+ Identification = envAssetAdministrationShell.Identification,
+ IdShort = envAssetAdministrationShell.IdShort
+ };
+
+ IAsset asset = environment.Assets.Find(a => a.Identification.Id == envAssetAdministrationShell.AssetReference?.Keys?.FirstOrDefault()?.Value);
+ assetAdministrationShell.Asset = asset;
+
+ foreach (var envSubmodelRef in envAssetAdministrationShell.SubmodelReferences)
+ {
+ ISubmodel submodel = environment.Submodels.Find(s => s.Identification.Id == envSubmodelRef.Keys?.FirstOrDefault()?.Value);
+ if (submodel != null)
+ assetAdministrationShell.Submodels.Add(submodel);
+ }
+
+ environment.AssetAdministrationShells.Add(assetAdministrationShell);
+ }
+ }
+
+ private static void ValidationCallBack(object sender, ValidationEventArgs args)
+ {
+ if (args.Severity == XmlSeverityType.Warning)
+ logger.Warn("Validation warning: " + args.Message);
+ else
+ logger.Error("Validation error: " + args.Message + " | LineNumber: " + args.Exception.LineNumber + " | LinePosition: " + args.Exception.LinePosition);
+
+ }
+ }
+}
diff --git a/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v1.0/Converter/ConceptDescriptionConverter_V1_0.cs b/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v1.0/Converter/ConceptDescriptionConverter_V1_0.cs
new file mode 100644
index 0000000..8d04a72
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v1.0/Converter/ConceptDescriptionConverter_V1_0.cs
@@ -0,0 +1,69 @@
+/*******************************************************************************
+* Copyright (c) 2020 Robert Bosch GmbH
+* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
+*
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License 2.0 which is available at
+* http://www.eclipse.org/legal/epl-2.0
+*
+* SPDX-License-Identifier: EPL-2.0
+*******************************************************************************/
+using BaSyx.Models.Extensions.Semantics.DataSpecifications;
+using BaSyx.Models.Export.EnvironmentDataSpecifications;
+using BaSyx.Models.Core.Common;
+using System;
+
+namespace BaSyx.Models.Export.Converter
+{
+ public static class ConceptDescriptionConverter_V1_0
+ {
+ public static DataSpecificationIEC61360 ToDataSpecificationIEC61360(this EnvironmentDataSpecificationIEC61360_V1_0 environmentDataSpecification)
+ {
+ if (environmentDataSpecification == null)
+ return null;
+
+ DataSpecificationIEC61360 dataSpecification = new DataSpecificationIEC61360(new DataSpecificationIEC61360Content()
+ {
+ Definition = environmentDataSpecification.Definition,
+ PreferredName = environmentDataSpecification.PreferredName,
+ ShortName = string.IsNullOrEmpty(environmentDataSpecification.ShortName) ? null :
+ new LangStringSet() { new LangString("Undefined", environmentDataSpecification.ShortName) },
+ SourceOfDefinition = environmentDataSpecification.SourceOfDefinition?["EN"],
+ Symbol = environmentDataSpecification.Symbol,
+ Unit = environmentDataSpecification.Unit,
+ UnitId = environmentDataSpecification.UnitId?.ToReference_V1_0(),
+ Value = null,
+ ValueFormat = environmentDataSpecification.ValueFormat,
+ ValueId = null,
+ ValueList = null
+ });
+
+ if (!string.IsNullOrEmpty(environmentDataSpecification.DataType))
+ (dataSpecification.DataSpecificationContent as DataSpecificationIEC61360Content).DataType =
+ (DataTypeIEC61360)Enum.Parse(typeof(DataTypeIEC61360), environmentDataSpecification.DataType);
+
+ return dataSpecification;
+ }
+
+ public static EnvironmentDataSpecificationIEC61360_V1_0 ToEnvironmentDataSpecificationIEC61360_V1_0(this DataSpecificationIEC61360Content dataSpecificationContent)
+ {
+ if (dataSpecificationContent == null)
+ return null;
+
+ EnvironmentDataSpecificationIEC61360_V1_0 environmentDataSpecification = new EnvironmentDataSpecificationIEC61360_V1_0()
+ {
+ DataType = dataSpecificationContent.DataType.ToString(),
+ Definition = dataSpecificationContent.Definition,
+ PreferredName = dataSpecificationContent.PreferredName,
+ ShortName = dataSpecificationContent.ShortName?["EN"],
+ SourceOfDefinition = new LangStringSet() { new LangString("Undefined", dataSpecificationContent.SourceOfDefinition) },
+ Symbol = dataSpecificationContent.Symbol,
+ Unit = dataSpecificationContent.Unit,
+ UnitId = dataSpecificationContent.UnitId?.ToEnvironmentReference_V1_0(),
+ ValueFormat = dataSpecificationContent.ValueFormat
+ };
+
+ return environmentDataSpecification;
+ }
+ }
+}
diff --git a/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v1.0/Converter/JsonOperationVariableConverter_V1_0.cs b/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v1.0/Converter/JsonOperationVariableConverter_V1_0.cs
new file mode 100644
index 0000000..4799b2f
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v1.0/Converter/JsonOperationVariableConverter_V1_0.cs
@@ -0,0 +1,103 @@
+/*******************************************************************************
+* Copyright (c) 2020 Robert Bosch GmbH
+* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
+*
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License 2.0 which is available at
+* http://www.eclipse.org/legal/epl-2.0
+*
+* SPDX-License-Identifier: EPL-2.0
+*******************************************************************************/
+using BaSyx.Models.Core.Common;
+using Newtonsoft.Json;
+using Newtonsoft.Json.Linq;
+using NLog;
+using System;
+using System.Collections.Generic;
+
+namespace BaSyx.Models.Export.Converter
+{
+ public class JsonOperationVariableConverter_V1_0 : JsonConverter<List<OperationVariable_V1_0>>
+ {
+ private static Logger logger = LogManager.GetCurrentClassLogger();
+
+ public override List<OperationVariable_V1_0> ReadJson(JsonReader reader, Type objectType, List<OperationVariable_V1_0> existingValue, bool hasExistingValue, JsonSerializer serializer)
+ {
+ JArray jArray = null;
+
+ try
+ {
+ jArray = JArray.Load(reader);
+ }
+ catch (Exception e)
+ {
+ logger.Error(e);
+ }
+
+ if (jArray == null || jArray.Count == 0)
+ return null;
+
+ List<OperationVariable_V1_0> operationVariables = new List<OperationVariable_V1_0>();
+ foreach (var element in jArray)
+ {
+ ModelType modelType = element.SelectToken("modelType")?.ToObject<ModelType>(serializer);
+ SubmodelElementType_V1_0 submodelElementType = CreateSubmodelElement(modelType);
+ if (submodelElementType != null)
+ {
+ serializer.Populate(element.CreateReader(), submodelElementType);
+ operationVariables.Add(new OperationVariable_V1_0()
+ {
+ Value = new EnvironmentSubmodelElement_V1_0() { submodelElement = submodelElementType }
+ });
+ }
+ }
+ return operationVariables;
+ }
+
+ public override void WriteJson(JsonWriter writer, List<OperationVariable_V1_0> value, JsonSerializer serializer)
+ {
+ if (value == null || value.Count == 0)
+ return;
+ JArray jArray = new JArray();
+
+ foreach (var val in value)
+ {
+ JObject jObj = JObject.FromObject(val.Value.submodelElement, serializer);
+ jArray.Add(jObj);
+ }
+
+ jArray.WriteTo(writer);
+ }
+
+ public static SubmodelElementType_V1_0 CreateSubmodelElement(ModelType modelType)
+ {
+ if(modelType == null)
+ {
+ logger.Warn("ModelType is null");
+ return null;
+ }
+
+ if (modelType == ModelType.Property)
+ return new Property_V1_0();
+ if (modelType == ModelType.Operation)
+ return new Operation_V1_0();
+ if (modelType == ModelType.Event)
+ return new Event_V1_0();
+ else if (modelType == ModelType.Blob)
+ return new Blob_V1_0();
+ else if (modelType == ModelType.File)
+ return new File_V1_0();
+ else if (modelType == ModelType.ReferenceElement)
+ return new ReferenceElement_V1_0();
+ else if (modelType == ModelType.RelationshipElement)
+ return new RelationshipElement_V1_0();
+ else if (modelType == ModelType.SubmodelElementCollection)
+ return new SubmodelElementCollection_V1_0();
+ else
+ {
+ logger.Warn("ModelType is unknown: " + modelType.Name);
+ return null;
+ }
+ }
+ }
+}
diff --git a/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v1.0/Converter/JsonSubmodelElementConverter_V1_0.cs b/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v1.0/Converter/JsonSubmodelElementConverter_V1_0.cs
new file mode 100644
index 0000000..6c9d4a5
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v1.0/Converter/JsonSubmodelElementConverter_V1_0.cs
@@ -0,0 +1,103 @@
+/*******************************************************************************
+* Copyright (c) 2020 Robert Bosch GmbH
+* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
+*
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License 2.0 which is available at
+* http://www.eclipse.org/legal/epl-2.0
+*
+* SPDX-License-Identifier: EPL-2.0
+*******************************************************************************/
+using BaSyx.Models.Core.Common;
+using Newtonsoft.Json;
+using Newtonsoft.Json.Linq;
+using NLog;
+using System;
+using System.Collections.Generic;
+
+namespace BaSyx.Models.Export.Converter
+{
+ public class JsonSubmodelElementConverter_V1_0 : JsonConverter<List<EnvironmentSubmodelElement_V1_0>>
+ {
+ private static Logger logger = LogManager.GetCurrentClassLogger();
+
+ public override List<EnvironmentSubmodelElement_V1_0> ReadJson(JsonReader reader, Type objectType, List<EnvironmentSubmodelElement_V1_0> existingValue, bool hasExistingValue, JsonSerializer serializer)
+ {
+ JArray jArray = null;
+
+ try
+ {
+ jArray = JArray.Load(reader);
+ }
+ catch (Exception e)
+ {
+ logger.Error(e);
+ }
+
+ if (jArray == null || jArray.Count == 0)
+ return null;
+
+ List<EnvironmentSubmodelElement_V1_0> submodelElements = new List<EnvironmentSubmodelElement_V1_0>();
+ foreach (var element in jArray)
+ {
+ ModelType modelType = element.SelectToken("modelType")?.ToObject<ModelType>(serializer);
+ SubmodelElementType_V1_0 submodelElementType = CreateSubmodelElement(modelType);
+ if (submodelElementType != null)
+ {
+ serializer.Populate(element.CreateReader(), submodelElementType);
+ submodelElements.Add(new EnvironmentSubmodelElement_V1_0()
+ {
+ submodelElement = submodelElementType
+ });
+ }
+ }
+ return submodelElements;
+ }
+
+ public override void WriteJson(JsonWriter writer, List<EnvironmentSubmodelElement_V1_0> value, JsonSerializer serializer)
+ {
+ if (value == null || value.Count == 0)
+ return;
+ JArray jArray = new JArray();
+
+ foreach (var val in value)
+ {
+ JObject jObj = JObject.FromObject(val.submodelElement, serializer);
+ jArray.Add(jObj);
+ }
+
+ jArray.WriteTo(writer);
+ }
+
+ public static SubmodelElementType_V1_0 CreateSubmodelElement(ModelType modelType)
+ {
+ if(modelType == null)
+ {
+ logger.Warn("ModelType is null");
+ return null;
+ }
+
+ if (modelType == ModelType.Property)
+ return new Property_V1_0();
+ if (modelType == ModelType.Operation)
+ return new Operation_V1_0();
+ if (modelType == ModelType.Event)
+ return new Event_V1_0();
+ else if (modelType == ModelType.Blob)
+ return new Blob_V1_0();
+ else if (modelType == ModelType.File)
+ return new File_V1_0();
+ else if (modelType == ModelType.ReferenceElement)
+ return new ReferenceElement_V1_0();
+ else if (modelType == ModelType.RelationshipElement)
+ return new RelationshipElement_V1_0();
+ else if (modelType == ModelType.SubmodelElementCollection)
+ return new SubmodelElementCollection_V1_0();
+ else
+ {
+ logger.Warn("ModelType is unknown: " + modelType.Name);
+ return null;
+ }
+ }
+ }
+}
diff --git a/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v1.0/Converter/TypeConverterExtensions_V1_0.cs b/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v1.0/Converter/TypeConverterExtensions_V1_0.cs
new file mode 100644
index 0000000..b570e2e
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v1.0/Converter/TypeConverterExtensions_V1_0.cs
@@ -0,0 +1,118 @@
+/*******************************************************************************
+* Copyright (c) 2020 Robert Bosch GmbH
+* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
+*
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License 2.0 which is available at
+* http://www.eclipse.org/legal/epl-2.0
+*
+* SPDX-License-Identifier: EPL-2.0
+*******************************************************************************/
+using BaSyx.Models.Core.AssetAdministrationShell.Generics;
+using BaSyx.Models.Core.AssetAdministrationShell.References;
+using BaSyx.Models.Core.AssetAdministrationShell.Identification;
+using System.Collections.Generic;
+using BaSyx.Models.Core.AssetAdministrationShell.Semantics;
+using System;
+
+namespace BaSyx.Models.Export.Converter
+{
+ public static class TypeConverterExtensions_V1_0
+ {
+ public static EnvironmentReference_V1_0 ToEnvironmentReference_V1_0(this IReference reference)
+ {
+ if (reference?.Keys?.Count == 0)
+ return null;
+
+ List<EnvironmentKey_V1_0> keys = reference?.Keys?.ConvertAll(c => c.ToEnvironmentKey_V1_0());
+ if (keys?.Count > 0)
+ return new EnvironmentReference_V1_0()
+ {
+ Keys = keys
+ };
+ return null;
+ }
+
+ public static Reference ToReference_V1_0(this EnvironmentReference_V1_0 environmentReference)
+ {
+ if (environmentReference == null)
+ return null;
+
+ if (environmentReference?.Keys?.Count > 0)
+ return new Reference(environmentReference.Keys.ConvertAll(c => c.ToKey()).ToArray());
+ return null;
+ }
+
+ public static Reference<T> ToReference_V1_0<T>(this EnvironmentReference_V1_0 environmentReference) where T : IReferable
+ {
+ if (environmentReference == null)
+ return null;
+
+ if (environmentReference?.Keys?.Count > 0)
+ return new Reference<T>(environmentReference.Keys.ConvertAll(c => c.ToKey()).ToArray());
+ return null;
+ }
+
+ public static Key ToKey(this EnvironmentKey_V1_0 environmentKey)
+ {
+ if (environmentKey == null)
+ return null;
+
+ Key key = new Key(
+ (KeyElements)Enum.Parse(typeof(KeyElements), environmentKey.Type.ToString()),
+ (KeyType)Enum.Parse(typeof(KeyType), environmentKey.IdType.ToString()),
+ environmentKey.Value,
+ environmentKey.Local);
+
+ return key;
+ }
+
+ public static EnvironmentKey_V1_0 ToEnvironmentKey_V1_0(this IKey key)
+ {
+ if (key == null)
+ return null;
+
+ EnvironmentKey_V1_0 environmentKey = new EnvironmentKey_V1_0();
+ environmentKey.IdType = (KeyType_V1_0)Enum.Parse(typeof(KeyType_V1_0), key.IdType.ToString());
+ environmentKey.Type = (KeyElements_V1_0)Enum.Parse(typeof(KeyElements_V1_0), key.Type.ToString());
+ environmentKey.Local = key.Local;
+ environmentKey.Value = key.Value;
+
+ return environmentKey;
+ }
+
+ public static EnvironmentReference_V1_0 ToEnvironmentReference_V1_0(this IIdentifiable identifiable)
+ {
+ if (identifiable.Identification == null)
+ return null;
+
+ KeyElements_V1_0 type;
+
+ if (identifiable is IAsset)
+ type = KeyElements_V1_0.Asset;
+ else if (identifiable is IAssetAdministrationShell)
+ type = KeyElements_V1_0.AssetAdministrationShell;
+ else if (identifiable is IConceptDescription)
+ type = KeyElements_V1_0.ConceptDescription;
+ else if (identifiable is ISubmodel)
+ type = KeyElements_V1_0.Submodel;
+ else
+ return null;
+
+ EnvironmentReference_V1_0 reference = new EnvironmentReference_V1_0()
+ {
+ Keys = new List<EnvironmentKey_V1_0>()
+ {
+ new EnvironmentKey_V1_0()
+ {
+ IdType = (KeyType_V1_0)Enum.Parse(typeof(KeyType_V1_0), identifiable.Identification.IdType.ToString()),
+ Local = true,
+ Value = identifiable.Identification.Id,
+ Type = type
+ }
+ }
+ };
+ return reference;
+ }
+ }
+}
diff --git a/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v1.0/EnvironmentAssetAdministationShell_V1_0.cs b/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v1.0/EnvironmentAssetAdministationShell_V1_0.cs
new file mode 100644
index 0000000..68d99dd
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v1.0/EnvironmentAssetAdministationShell_V1_0.cs
@@ -0,0 +1,70 @@
+/*******************************************************************************
+* Copyright (c) 2020 Robert Bosch GmbH
+* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
+*
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License 2.0 which is available at
+* http://www.eclipse.org/legal/epl-2.0
+*
+* SPDX-License-Identifier: EPL-2.0
+*******************************************************************************/
+using BaSyx.Models.Core.Common;
+using Newtonsoft.Json;
+using System.Collections.Generic;
+using System.Xml.Serialization;
+
+namespace BaSyx.Models.Export
+{
+
+ public class EnvironmentAssetAdministationShell_V1_0 : EnvironmentIdentifiable_V1_0, IModelType
+ {
+ [JsonProperty("asset")]
+ [XmlElement("assetRef")]
+ public EnvironmentReference_V1_0 AssetReference { get; set; }
+
+ [JsonProperty("submodels")]
+ [XmlArray("submodelRefs")]
+ [XmlArrayItem("submodelRef")]
+ public List<EnvironmentReference_V1_0> SubmodelReferences { get; set; }
+
+ [JsonProperty("conceptDictionaries")]
+ [XmlElement("conceptDictionaries")]
+ public List<ConceptDictionary_V1_0> ConceptDictionaries { get; set; }
+
+ [JsonProperty("derivedFrom")]
+ [XmlElement("derivedFrom")]
+ public EnvironmentReference_V1_0 DerivedFrom { get; set; }
+
+ [JsonProperty("views")]
+ [XmlArray("views")]
+ [XmlArrayItem("view")]
+ public List<View_V1_0> Views { get; set; }
+
+ [JsonProperty("modelType")]
+ [XmlIgnore]
+ public ModelType ModelType => ModelType.AssetAdministationShell;
+ }
+
+ public class ConceptDictionary_V1_0 : EnvironmentReferable_V1_0
+ {
+ [JsonProperty("conceptDescriptions")]
+ [XmlArray("conceptDescriptions")]
+ [XmlArrayItem("conceptDescriptionRefs")]
+ public List<EnvironmentReference_V1_0> ConceptDescriptionsRefs {get; set; }
+ }
+
+ public class View_V1_0 : EnvironmentReferable_V1_0, IModelType
+ {
+ [JsonProperty("semanticId")]
+ [XmlElement(ElementName = "semanticId")]
+ public EnvironmentReference_V1_0 SemanticId { get; set; }
+
+ [JsonProperty("containedElements")]
+ [XmlArray("containedElements")]
+ [XmlArrayItem(ElementName = "containedElementRef")]
+ public List<EnvironmentReference_V1_0> ContainedElements { get; set; }
+
+ [XmlIgnore]
+ public ModelType ModelType => ModelType.View;
+ }
+}
diff --git a/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v1.0/EnvironmentAsset_V1_0.cs b/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v1.0/EnvironmentAsset_V1_0.cs
new file mode 100644
index 0000000..9cb3fe1
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v1.0/EnvironmentAsset_V1_0.cs
@@ -0,0 +1,51 @@
+/*******************************************************************************
+* Copyright (c) 2020 Robert Bosch GmbH
+* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
+*
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License 2.0 which is available at
+* http://www.eclipse.org/legal/epl-2.0
+*
+* SPDX-License-Identifier: EPL-2.0
+*******************************************************************************/
+using BaSyx.Models.Core.AssetAdministrationShell.Enums;
+using BaSyx.Models.Core.AssetAdministrationShell.Generics;
+using BaSyx.Models.Core.AssetAdministrationShell.Identification;
+using BaSyx.Models.Core.AssetAdministrationShell.References;
+using BaSyx.Models.Core.AssetAdministrationShell.Semantics;
+using BaSyx.Models.Core.Common;
+using BaSyx.Models.Export.Converter;
+using Newtonsoft.Json;
+using System.Collections.Generic;
+using System.Xml.Serialization;
+
+namespace BaSyx.Models.Export
+{
+ public class EnvironmentAsset_V1_0 : EnvironmentIdentifiable_V1_0, IModelType, IAsset
+ {
+ [JsonProperty("kind")]
+ [XmlElement("kind")]
+ public AssetKind Kind { get; set; }
+
+ [JsonProperty("assetIdentificationModel")]
+ [XmlElement("assetIdentificationModelRef")]
+ public EnvironmentReference_V1_0 AssetIdentificationModelReference { get; set; }
+
+ [JsonProperty("modelType")]
+ [XmlIgnore]
+ public ModelType ModelType => ModelType.Asset;
+
+ [XmlIgnore]
+ public IReference<ISubmodel> AssetIdentificationModel => AssetIdentificationModelReference.ToReference_V1_0<ISubmodel>();
+
+ [XmlIgnore]
+ public IConceptDescription ConceptDescription => throw new System.NotImplementedException();
+ [XmlIgnore]
+ public IEnumerable<IEmbeddedDataSpecification> EmbeddedDataSpecifications => throw new System.NotImplementedException();
+ [XmlIgnore]
+ public IReference<ISubmodel> BillOfMaterial => throw new System.NotImplementedException();
+
+ [XmlIgnore]
+ IReference IReferable.Parent => null;
+ }
+}
\ No newline at end of file
diff --git a/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v1.0/EnvironmentConceptDescription_V1_0.cs b/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v1.0/EnvironmentConceptDescription_V1_0.cs
new file mode 100644
index 0000000..abdd017
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v1.0/EnvironmentConceptDescription_V1_0.cs
@@ -0,0 +1,64 @@
+/*******************************************************************************
+* Copyright (c) 2020 Robert Bosch GmbH
+* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
+*
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License 2.0 which is available at
+* http://www.eclipse.org/legal/epl-2.0
+*
+* SPDX-License-Identifier: EPL-2.0
+*******************************************************************************/
+using BaSyx.Models.Core.Common;
+using BaSyx.Models.Export.EnvironmentDataSpecifications;
+using Newtonsoft.Json;
+using System.Collections.Generic;
+using System.Linq;
+using System.Xml.Serialization;
+
+namespace BaSyx.Models.Export
+{
+ public class EnvironmentConceptDescription_V1_0 : EnvironmentIdentifiable_V1_0, IModelType
+ {
+ [JsonIgnore]
+ [XmlElement("embeddedDataSpecification")]
+ public EmbeddedDataSpecification_V1_0 EmbeddedDataSpecification
+ {
+ get => EmbeddedDataSpecifications?.FirstOrDefault();
+ set
+ {
+ if (EmbeddedDataSpecifications == null)
+ EmbeddedDataSpecifications = new List<EmbeddedDataSpecification_V1_0>();
+ EmbeddedDataSpecifications.Insert(0, value);
+ }
+ }
+
+ [JsonProperty("embeddedDataSpecifications")]
+ [XmlIgnore]
+ public List<EmbeddedDataSpecification_V1_0> EmbeddedDataSpecifications { get; set; } = new List<EmbeddedDataSpecification_V1_0>();
+
+ [JsonProperty("isCaseOf")]
+ [XmlElement("isCaseOf")]
+ public List<EnvironmentReference_V1_0> IsCaseOf { get; set; }
+
+ [JsonProperty("modelType")]
+ [XmlIgnore]
+ public ModelType ModelType => ModelType.ConceptDescription;
+ }
+
+ public class EmbeddedDataSpecification_V1_0
+ {
+ [JsonProperty("hasDataSpecification")]
+ [XmlElement("hasDataSpecification")]
+ public EnvironmentReference_V1_0 HasDataSpecification { get; set; }
+
+ [JsonProperty("dataSpecificationContent")]
+ [XmlElement("dataSpecificationContent")]
+ public DataSpecificationContent_V1_0 DataSpecificationContent { get; set; }
+ }
+
+ public class DataSpecificationContent_V1_0
+ {
+ [XmlElement("dataSpecificationIEC61360")]
+ public EnvironmentDataSpecificationIEC61360_V1_0 DataSpecificationIEC61360 { get; set; }
+ }
+}
\ No newline at end of file
diff --git a/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v1.0/EnvironmentDataSpecifications/EnvironmentDataSpecificationIEC61360_V1_0.cs b/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v1.0/EnvironmentDataSpecifications/EnvironmentDataSpecificationIEC61360_V1_0.cs
new file mode 100644
index 0000000..464990c
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v1.0/EnvironmentDataSpecifications/EnvironmentDataSpecificationIEC61360_V1_0.cs
@@ -0,0 +1,59 @@
+/*******************************************************************************
+* Copyright (c) 2020 Robert Bosch GmbH
+* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
+*
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License 2.0 which is available at
+* http://www.eclipse.org/legal/epl-2.0
+*
+* SPDX-License-Identifier: EPL-2.0
+*******************************************************************************/
+using BaSyx.Models.Core.Common;
+using Newtonsoft.Json;
+using System.Xml.Serialization;
+
+namespace BaSyx.Models.Export.EnvironmentDataSpecifications
+{
+ [XmlType("dataSpecificationIEC61360", Namespace = AssetAdministrationShellEnvironment_V1_0.IEC61360_NAMESPACE)]
+ public class EnvironmentDataSpecificationIEC61360_V1_0
+ {
+ [JsonProperty("preferredName")]
+ [XmlArray("preferredName")]
+ [XmlArrayItem("langString", Namespace = AssetAdministrationShellEnvironment_V1_0.AAS_NAMESPACE)]
+ public LangStringSet PreferredName { get; set; }
+
+ [JsonProperty("shortName")]
+ [XmlElement("shortName")]
+ public string ShortName { get; set; }
+
+ [JsonProperty("unit")]
+ [XmlElement("unit")]
+ public string Unit { get; set; }
+
+ [JsonProperty("unitId")]
+ [XmlElement("unitId")]
+ public EnvironmentReference_V1_0 UnitId { get; set; }
+
+ [JsonProperty("valueFormat")]
+ [XmlElement("valueFormat")]
+ public string ValueFormat { get; set; }
+
+ [JsonProperty("sourceOfDefinition")]
+ [XmlArray("sourceOfDefinition")]
+ [XmlArrayItem("langString", Namespace = AssetAdministrationShellEnvironment_V1_0.AAS_NAMESPACE)]
+ public LangStringSet SourceOfDefinition { get; set; }
+
+ [JsonProperty("symbol")]
+ [XmlElement("symbol")]
+ public string Symbol { get; set; }
+
+ [JsonProperty("dataType")]
+ [XmlElement("dataType")]
+ public string DataType { get; set; }
+
+ [JsonProperty("definition")]
+ [XmlArray("definition")]
+ [XmlArrayItem("langString", Namespace = AssetAdministrationShellEnvironment_V1_0.AAS_NAMESPACE)]
+ public LangStringSet Definition { get; set; }
+ }
+}
diff --git a/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v1.0/EnvironmentIdentifiable_V1_0.cs b/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v1.0/EnvironmentIdentifiable_V1_0.cs
new file mode 100644
index 0000000..0efef02
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v1.0/EnvironmentIdentifiable_V1_0.cs
@@ -0,0 +1,27 @@
+/*******************************************************************************
+* Copyright (c) 2020 Robert Bosch GmbH
+* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
+*
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License 2.0 which is available at
+* http://www.eclipse.org/legal/epl-2.0
+*
+* SPDX-License-Identifier: EPL-2.0
+*******************************************************************************/
+using BaSyx.Models.Core.AssetAdministrationShell.Identification;
+using Newtonsoft.Json;
+using System.Xml.Serialization;
+
+namespace BaSyx.Models.Export
+{
+ public class EnvironmentIdentifiable_V1_0 : EnvironmentReferable_V1_0
+ {
+ [JsonProperty("identification", Order = -2)]
+ [XmlElement("identification")]
+ public Identifier Identification { get; set; }
+
+ [JsonProperty("administration", Order = -1)]
+ [XmlElement("administration")]
+ public AdministrativeInformation Administration { get; set; }
+ }
+}
diff --git a/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v1.0/EnvironmentKey_V1_0.cs b/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v1.0/EnvironmentKey_V1_0.cs
new file mode 100644
index 0000000..ebf2d00
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v1.0/EnvironmentKey_V1_0.cs
@@ -0,0 +1,72 @@
+using Newtonsoft.Json;
+using System.Runtime.Serialization;
+using System.Xml.Serialization;
+
+namespace BaSyx.Models.Export
+{
+ [XmlType("key")]
+ public class EnvironmentKey_V1_0
+ {
+ [JsonProperty(Required = Required.Always, DefaultValueHandling = DefaultValueHandling.Include)]
+ [XmlAttribute("type")]
+ public KeyElements_V1_0 Type { get; set; }
+
+ [JsonProperty(Required = Required.Always, DefaultValueHandling = DefaultValueHandling.Include)]
+ [XmlAttribute("idType")]
+ public KeyType_V1_0 IdType { get; set; }
+
+ [JsonProperty(Required = Required.Always, DefaultValueHandling = DefaultValueHandling.Include)]
+ [XmlText]
+ public string Value { get; set; }
+
+ [JsonProperty(Required = Required.Always, DefaultValueHandling = DefaultValueHandling.Include)]
+ [XmlAttribute("local")]
+ public bool Local { get; set; }
+ }
+
+ public enum KeyType_V1_0
+ {
+ [EnumMember(Value = "Custom")]
+ Custom,
+ [EnumMember(Value = "URI")]
+ URI,
+ [EnumMember(Value = "IRDI")]
+ IRDI,
+ [EnumMember(Value = "IdShort")]
+ IdShort,
+ [EnumMember(Value = "FragmentId")]
+ FragmentId
+ }
+
+ public enum KeyElements_V1_0
+ {
+ GlobalReference,
+ FragmentReference,
+
+ AccessPermissionRule,
+ AnnotatedRelationshipElement,
+ BasicEvent,
+ Blob,
+ Capability,
+ ConceptDictionary,
+ DataElement,
+ File,
+ Entity,
+ Event,
+ MultiLanguageProperty,
+ Operation,
+ Property,
+ Range,
+ ReferenceElement,
+ RelationshipElement,
+ SubmodelElement,
+ SubmodelElementCollection,
+ View,
+
+ Asset,
+ AssetAdministrationShell,
+ ConceptDescription,
+ Submodel
+
+ }
+}
diff --git a/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v1.0/EnvironmentQualifier_V1_0.cs b/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v1.0/EnvironmentQualifier_V1_0.cs
new file mode 100644
index 0000000..af51902
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v1.0/EnvironmentQualifier_V1_0.cs
@@ -0,0 +1,36 @@
+/*******************************************************************************
+* Copyright (c) 2020 Robert Bosch GmbH
+* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
+*
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License 2.0 which is available at
+* http://www.eclipse.org/legal/epl-2.0
+*
+* SPDX-License-Identifier: EPL-2.0
+*******************************************************************************/
+using BaSyx.Models.Core.Common;
+using Newtonsoft.Json;
+using System.Xml.Serialization;
+
+namespace BaSyx.Models.Export
+{
+ public class EnvironmentQualifier_V1_0
+ {
+ [JsonProperty("qualifierType")]
+ [XmlElement("qualifierType")]
+ public string QualifierType { get; set; }
+
+ [JsonProperty("qualifierValue")]
+ [XmlElement("qualifierValue")]
+ public string QualifierValue { get; set; }
+
+ [JsonProperty("qualifierValueId")]
+ [XmlElement("qualifierValueId")]
+ public EnvironmentReference_V1_0 QualifierValueId { get; set; }
+
+ [JsonProperty("modelType")]
+ [XmlIgnore]
+ public ModelType ModelType => ModelType.Qualifier;
+
+ }
+}
\ No newline at end of file
diff --git a/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v1.0/EnvironmentReferable_V1_0.cs b/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v1.0/EnvironmentReferable_V1_0.cs
new file mode 100644
index 0000000..bf90629
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v1.0/EnvironmentReferable_V1_0.cs
@@ -0,0 +1,37 @@
+/*******************************************************************************
+* Copyright (c) 2020 Robert Bosch GmbH
+* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
+*
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License 2.0 which is available at
+* http://www.eclipse.org/legal/epl-2.0
+*
+* SPDX-License-Identifier: EPL-2.0
+*******************************************************************************/
+using BaSyx.Models.Core.Common;
+using Newtonsoft.Json;
+using System.Xml.Serialization;
+
+namespace BaSyx.Models.Export
+{
+
+ public class EnvironmentReferable_V1_0
+ {
+ [JsonProperty("idShort", Order = -6)]
+ [XmlElement("idShort")]
+ public string IdShort { get; set; }
+
+ [JsonProperty("category", Order = -5)]
+ [XmlElement("category")]
+ public string Category { get; set; }
+
+ [JsonProperty("description", Order = -4)]
+ [XmlArray("description")]
+ [XmlArrayItem("langString")]
+ public LangStringSet Description { get; set; }
+
+ [JsonProperty("parent", Order = -3)]
+ [XmlElement("parent")]
+ public string Parent { get; set; }
+ }
+}
diff --git a/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v1.0/EnvironmentReference_V1_0.cs b/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v1.0/EnvironmentReference_V1_0.cs
new file mode 100644
index 0000000..2a2eb0b
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v1.0/EnvironmentReference_V1_0.cs
@@ -0,0 +1,25 @@
+/*******************************************************************************
+* Copyright (c) 2020 Robert Bosch GmbH
+* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
+*
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License 2.0 which is available at
+* http://www.eclipse.org/legal/epl-2.0
+*
+* SPDX-License-Identifier: EPL-2.0
+*******************************************************************************/
+using Newtonsoft.Json;
+using System.Collections.Generic;
+using System.Xml.Serialization;
+
+namespace BaSyx.Models.Export
+{
+
+ public class EnvironmentReference_V1_0
+ {
+ [JsonProperty("keys")]
+ [XmlArray("keys")]
+ [XmlArrayItem("key")]
+ public List<EnvironmentKey_V1_0> Keys { get; set; }
+ }
+}
diff --git a/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v1.0/EnvironmentSubmodelElement_V1_0.cs b/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v1.0/EnvironmentSubmodelElement_V1_0.cs
new file mode 100644
index 0000000..51d5f7e
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v1.0/EnvironmentSubmodelElement_V1_0.cs
@@ -0,0 +1,64 @@
+/*******************************************************************************
+* Copyright (c) 2020 Robert Bosch GmbH
+* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
+*
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License 2.0 which is available at
+* http://www.eclipse.org/legal/epl-2.0
+*
+* SPDX-License-Identifier: EPL-2.0
+*******************************************************************************/
+using BaSyx.Models.Core.AssetAdministrationShell.Enums;
+using BaSyx.Models.Core.Common;
+using Newtonsoft.Json;
+using System.Collections.Generic;
+using System.Xml.Serialization;
+
+namespace BaSyx.Models.Export
+{
+ [XmlType(TypeName = "submodelElement")]
+ public class EnvironmentSubmodelElement_V1_0
+ {
+ [XmlElement(ElementName = "property", Type = typeof(Property_V1_0))]
+ [XmlElement(ElementName = "file", Type = typeof(File_V1_0))]
+ [XmlElement(ElementName = "blob", Type = typeof(Blob_V1_0))]
+ [XmlElement(ElementName = "event", Type = typeof(Event_V1_0))]
+ [XmlElement(ElementName = "referenceElement", Type = typeof(ReferenceElement_V1_0))]
+ [XmlElement(ElementName = "relationshipElement", Type = typeof(RelationshipElement_V1_0))]
+ [XmlElement(ElementName = "submodelElementCollection", Type = typeof(SubmodelElementCollection_V1_0))]
+ [XmlElement(ElementName = "operation", Type = typeof(Operation_V1_0))]
+ public SubmodelElementType_V1_0 submodelElement;
+ }
+
+ public class SubmodelElementType_V1_0 : EnvironmentReferable_V1_0, IModelType
+ {
+ [JsonProperty("semanticId")]
+ [XmlElement("semanticId")]
+ public EnvironmentReference_V1_0 SemanticId { get; set; }
+
+ [JsonProperty("kind")]
+ [XmlElement("kind")]
+ public ModelingKind Kind { get; set; }
+
+ [JsonProperty("constraints")]
+ [XmlArray("qualifier")]
+ [XmlArrayItem("qualifier")]
+ public List<EnvironmentQualifier_V1_0> Qualifier { get; set; } = new List<EnvironmentQualifier_V1_0>();
+
+ [XmlIgnore]
+ public virtual ModelType ModelType { get; }
+
+ public SubmodelElementType_V1_0() { }
+ public SubmodelElementType_V1_0(SubmodelElementType_V1_0 submodelElementType)
+ {
+ this.Category = submodelElementType.Category;
+ this.Description = submodelElementType.Description;
+ this.IdShort = submodelElementType.IdShort;
+ this.Kind = submodelElementType.Kind;
+ this.Parent = submodelElementType.Parent;
+ this.Qualifier = submodelElementType.Qualifier;
+ this.SemanticId = submodelElementType.SemanticId;
+ }
+
+ }
+}
\ No newline at end of file
diff --git a/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v1.0/EnvironmentSubmodelElements/Blob_V1_0.cs b/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v1.0/EnvironmentSubmodelElements/Blob_V1_0.cs
new file mode 100644
index 0000000..300e08d
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v1.0/EnvironmentSubmodelElements/Blob_V1_0.cs
@@ -0,0 +1,34 @@
+/*******************************************************************************
+* Copyright (c) 2020 Robert Bosch GmbH
+* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
+*
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License 2.0 which is available at
+* http://www.eclipse.org/legal/epl-2.0
+*
+* SPDX-License-Identifier: EPL-2.0
+*******************************************************************************/
+using BaSyx.Models.Core.Common;
+using Newtonsoft.Json;
+using System.Xml.Serialization;
+
+namespace BaSyx.Models.Export
+{
+ public class Blob_V1_0 : SubmodelElementType_V1_0
+ {
+ [JsonProperty("mimeType")]
+ [XmlElement("mimeType")]
+ public string MimeType { get; set; }
+
+ [JsonProperty("value")]
+ [XmlElement("value")]
+ public string Value { get; set; }
+
+ [JsonProperty("modelType")]
+ [XmlIgnore]
+ public override ModelType ModelType => ModelType.Blob;
+
+ public Blob_V1_0() { }
+ public Blob_V1_0(SubmodelElementType_V1_0 submodelElementType) : base(submodelElementType) { }
+ }
+}
\ No newline at end of file
diff --git a/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v1.0/EnvironmentSubmodelElements/EnvironmentSubmodelElementFactory_V1_0.cs b/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v1.0/EnvironmentSubmodelElements/EnvironmentSubmodelElementFactory_V1_0.cs
new file mode 100644
index 0000000..de16a87
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v1.0/EnvironmentSubmodelElements/EnvironmentSubmodelElementFactory_V1_0.cs
@@ -0,0 +1,254 @@
+/*******************************************************************************
+* Copyright (c) 2020 Robert Bosch GmbH
+* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
+*
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License 2.0 which is available at
+* http://www.eclipse.org/legal/epl-2.0
+*
+* SPDX-License-Identifier: EPL-2.0
+*******************************************************************************/
+using BaSyx.Models.Core.AssetAdministrationShell.Generics;
+using BaSyx.Models.Core.AssetAdministrationShell.Generics.SubmodelElementTypes;
+using BaSyx.Models.Core.AssetAdministrationShell.Implementations;
+using BaSyx.Models.Core.AssetAdministrationShell.Identification;
+using BaSyx.Models.Export.Converter;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using BaSyx.Models.Core.AssetAdministrationShell.Semantics;
+using BaSyx.Models.Core.Common;
+using NLog;
+using BaSyx.Models.Core.AssetAdministrationShell.Implementations.SubmodelElementTypes;
+
+namespace BaSyx.Models.Export.EnvironmentSubmodelElements
+{
+ public static class EnvironmentSubmodelElementFactory_V1_0
+ {
+ public static readonly ILogger logger = LogManager.GetCurrentClassLogger();
+
+ public static ISubmodelElement ToSubmodelElement(this SubmodelElementType_V1_0 envSubmodelElement, List<IConceptDescription> conceptDescriptions)
+ {
+ if (envSubmodelElement == null)
+ {
+ logger.Warn("EnvironmentSubmodelElement is null");
+ return null;
+ }
+
+ ModelType modelType = envSubmodelElement.ModelType;
+ if (modelType == null)
+ {
+ logger.Warn("ModelType of Element " + envSubmodelElement.IdShort + " is null");
+ return null;
+ }
+ SubmodelElement submodelElement = null;
+
+ if (modelType == ModelType.Property && envSubmodelElement is Property_V1_0 castedProperty)
+ {
+ Property property;
+ if (DataObjectType.TryParse(castedProperty.ValueType, out DataObjectType dataObjectType))
+ {
+ property = new Property(new DataType(dataObjectType));
+ }
+ else
+ {
+ logger.Warn("Unable to parse ValueType of Property " + castedProperty.IdShort + " - ValueType: " + castedProperty.ValueType);
+ property = new Property();
+ }
+
+ property.Value = castedProperty.Value;
+ property.ValueId = castedProperty.ValueId?.ToReference_V1_0();
+
+ submodelElement = property;
+ }
+ else if (modelType == ModelType.File && envSubmodelElement is File_V1_0 castedFile)
+ {
+ File file = new File
+ {
+ MimeType = castedFile.MimeType,
+ Value = castedFile.Value
+ };
+
+ submodelElement = file;
+ }
+ else if (modelType == ModelType.Blob && envSubmodelElement is Blob_V1_0 castedBlob)
+ {
+ Blob blob = new Blob
+ {
+ MimeType = castedBlob.MimeType,
+ Value = Convert.FromBase64String(castedBlob.Value)
+ };
+
+ submodelElement = blob;
+ }
+ else if (modelType == ModelType.RelationshipElement && envSubmodelElement is RelationshipElement_V1_0 castedRelationshipElement)
+ {
+ RelationshipElement relationshipElement = new RelationshipElement
+ {
+ First = castedRelationshipElement.First?.ToReference_V1_0<IReferable>(),
+ Second = castedRelationshipElement.Second?.ToReference_V1_0<IReferable>()
+ };
+
+ submodelElement = relationshipElement;
+ }
+ else if (modelType == ModelType.ReferenceElement && envSubmodelElement is ReferenceElement_V1_0 castedReferenceElement)
+ {
+ ReferenceElement referenceElement = new ReferenceElement
+ {
+ Value = castedReferenceElement.Value?.ToReference_V1_0()
+ };
+
+ submodelElement = referenceElement;
+ }
+ else if (modelType == ModelType.Event && envSubmodelElement is Event_V1_0 castedEvent)
+ {
+ Event eventable = new Event();
+
+ submodelElement = eventable;
+ }
+ else if (modelType == ModelType.Operation && envSubmodelElement is Operation_V1_0 castedOperation)
+ {
+ Operation operation = new Operation
+ {
+ InputVariables = new OperationVariableSet(),
+ OutputVariables = new OperationVariableSet()
+ };
+
+ var operationInElements = castedOperation.In?.ConvertAll(c => c.Value?.submodelElement?.ToSubmodelElement(conceptDescriptions));
+ if(operationInElements?.Count > 0)
+ foreach (var element in operationInElements)
+ operation.InputVariables.Add(element);
+
+ var operationOutElements = castedOperation.Out?.ConvertAll(c => c.Value?.submodelElement?.ToSubmodelElement(conceptDescriptions));
+ if (operationOutElements?.Count > 0)
+ foreach (var element in operationOutElements)
+ operation.OutputVariables.Add(element);
+
+ submodelElement = operation;
+ }
+ else if (modelType == ModelType.SubmodelElementCollection && envSubmodelElement is SubmodelElementCollection_V1_0 castedSubmodelElementCollection)
+ {
+ SubmodelElementCollection submodelElementCollection = new SubmodelElementCollection();
+
+ if (castedSubmodelElementCollection.Value?.Count > 0)
+ {
+ submodelElementCollection.Value = new ElementContainer<ISubmodelElement>();
+ List<ISubmodelElement> smElements = castedSubmodelElementCollection.Value?.ConvertAll(c => c.submodelElement?.ToSubmodelElement(conceptDescriptions));
+ foreach (var smElement in smElements)
+ submodelElementCollection.Value.Add(smElement);
+ }
+
+ submodelElement = submodelElementCollection;
+ }
+
+
+ if (submodelElement == null)
+ {
+ logger.Warn("SubmodelElement " + envSubmodelElement.IdShort + " is still null");
+ return null;
+ }
+
+ submodelElement.Category = envSubmodelElement.Category;
+ submodelElement.Description = envSubmodelElement.Description;
+ submodelElement.IdShort = envSubmodelElement.IdShort;
+ submodelElement.Kind = envSubmodelElement.Kind;
+ submodelElement.SemanticId = envSubmodelElement.SemanticId?.ToReference_V1_0();
+ submodelElement.Constraints = null;
+
+ string semanticId = envSubmodelElement.SemanticId?.Keys?.FirstOrDefault()?.Value;
+ if (!string.IsNullOrEmpty(semanticId))
+ {
+ submodelElement.ConceptDescription =
+ conceptDescriptions.Find(f => f.Identification.Id == semanticId);
+ submodelElement.EmbeddedDataSpecifications = submodelElement.ConceptDescription?.EmbeddedDataSpecifications;
+ }
+
+ return submodelElement;
+ }
+
+ public static EnvironmentSubmodelElement_V1_0 ToEnvironmentSubmodelElement_V1_0(this ISubmodelElement element)
+ {
+ if (element == null)
+ return null;
+ ModelType modelType = element.ModelType;
+
+ if (modelType == null)
+ return null;
+
+ EnvironmentSubmodelElement_V1_0 environmentSubmodelElement = new EnvironmentSubmodelElement_V1_0();
+
+ SubmodelElementType_V1_0 submodelElementType = new SubmodelElementType_V1_0()
+ {
+ Category = element.Category,
+ Description = element.Description,
+ IdShort = element.IdShort,
+ Kind = element.Kind,
+ Parent = element.Parent?.First?.Value,
+ Qualifier = null,
+ SemanticId = element.SemanticId?.ToEnvironmentReference_V1_0(),
+ };
+
+ if (modelType == ModelType.Property && element is IProperty castedProperty)
+ environmentSubmodelElement.submodelElement = new Property_V1_0(submodelElementType)
+ {
+ Value = castedProperty.Value?.ToString(),
+ ValueId = castedProperty.ValueId?.ToEnvironmentReference_V1_0(),
+ ValueType = castedProperty.ValueType?.ToString()
+ };
+ else if (modelType == ModelType.Operation && element is IOperation castedOperation)
+ {
+ environmentSubmodelElement.submodelElement = new Operation_V1_0(submodelElementType);
+ List<OperationVariable_V1_0> inputs = new List<OperationVariable_V1_0>();
+ List<OperationVariable_V1_0> outputs = new List<OperationVariable_V1_0>();
+
+ if (castedOperation.InputVariables?.Count > 0)
+ foreach (var inputVar in castedOperation.InputVariables)
+ inputs.Add(new OperationVariable_V1_0() { Value = inputVar.Value.ToEnvironmentSubmodelElement_V1_0() });
+ if (castedOperation.OutputVariables?.Count > 0)
+ foreach (var outputVar in castedOperation.OutputVariables)
+ outputs.Add(new OperationVariable_V1_0() { Value = outputVar.Value.ToEnvironmentSubmodelElement_V1_0() });
+
+ (environmentSubmodelElement.submodelElement as Operation_V1_0).In = inputs;
+ (environmentSubmodelElement.submodelElement as Operation_V1_0).Out = outputs;
+ }
+ else if (modelType == ModelType.Event && element is IEvent castedEvent)
+ environmentSubmodelElement.submodelElement = new Event_V1_0(submodelElementType) { };
+ else if (modelType == ModelType.Blob && element is IBlob castedBlob)
+ environmentSubmodelElement.submodelElement = new Blob_V1_0(submodelElementType)
+ {
+ Value = Convert.ToBase64String(castedBlob.Value),
+ MimeType = castedBlob.MimeType
+ };
+ else if (modelType == ModelType.File && element is IFile castedFile)
+ environmentSubmodelElement.submodelElement = new File_V1_0(submodelElementType)
+ {
+ MimeType = castedFile.MimeType,
+ Value = castedFile.Value
+ };
+ else if (modelType == ModelType.ReferenceElement && element is IReferenceElement castedReferenceElement)
+ environmentSubmodelElement.submodelElement = new ReferenceElement_V1_0(submodelElementType)
+ {
+ Value = castedReferenceElement.Value?.ToEnvironmentReference_V1_0()
+ };
+ else if (modelType == ModelType.RelationshipElement && element is IRelationshipElement castedRelationshipElement)
+ environmentSubmodelElement.submodelElement = new RelationshipElement_V1_0(submodelElementType)
+ {
+ First = castedRelationshipElement.First?.ToEnvironmentReference_V1_0(),
+ Second = castedRelationshipElement.Second?.ToEnvironmentReference_V1_0()
+ };
+ else if (modelType == ModelType.SubmodelElementCollection && element is ISubmodelElementCollection castedSubmodelElementCollection)
+ {
+ environmentSubmodelElement.submodelElement = new SubmodelElementCollection_V1_0(submodelElementType);
+ List<EnvironmentSubmodelElement_V1_0> environmentSubmodelElements = new List<EnvironmentSubmodelElement_V1_0>();
+ if (castedSubmodelElementCollection.Value?.Count > 0)
+ foreach (var smElement in castedSubmodelElementCollection.Value)
+ environmentSubmodelElements.Add(smElement.ToEnvironmentSubmodelElement_V1_0());
+ (environmentSubmodelElement.submodelElement as SubmodelElementCollection_V1_0).Value = environmentSubmodelElements;
+ }
+ else
+ return null;
+
+ return environmentSubmodelElement;
+ }
+ }
+}
diff --git a/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v1.0/EnvironmentSubmodelElements/Event_V1_0.cs b/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v1.0/EnvironmentSubmodelElements/Event_V1_0.cs
new file mode 100644
index 0000000..d7b33a3
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v1.0/EnvironmentSubmodelElements/Event_V1_0.cs
@@ -0,0 +1,26 @@
+/*******************************************************************************
+* Copyright (c) 2020 Robert Bosch GmbH
+* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
+*
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License 2.0 which is available at
+* http://www.eclipse.org/legal/epl-2.0
+*
+* SPDX-License-Identifier: EPL-2.0
+*******************************************************************************/
+using BaSyx.Models.Core.Common;
+using Newtonsoft.Json;
+using System.Xml.Serialization;
+
+namespace BaSyx.Models.Export
+{
+ public class Event_V1_0 : SubmodelElementType_V1_0
+ {
+ [JsonProperty("modelType")]
+ [XmlIgnore]
+ public override ModelType ModelType => ModelType.Event;
+
+ public Event_V1_0() { }
+ public Event_V1_0(SubmodelElementType_V1_0 submodelElementType) : base(submodelElementType) { }
+ }
+}
\ No newline at end of file
diff --git a/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v1.0/EnvironmentSubmodelElements/File_V1_0.cs b/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v1.0/EnvironmentSubmodelElements/File_V1_0.cs
new file mode 100644
index 0000000..9c824a5
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v1.0/EnvironmentSubmodelElements/File_V1_0.cs
@@ -0,0 +1,34 @@
+/*******************************************************************************
+* Copyright (c) 2020 Robert Bosch GmbH
+* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
+*
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License 2.0 which is available at
+* http://www.eclipse.org/legal/epl-2.0
+*
+* SPDX-License-Identifier: EPL-2.0
+*******************************************************************************/
+using BaSyx.Models.Core.Common;
+using Newtonsoft.Json;
+using System.Xml.Serialization;
+
+namespace BaSyx.Models.Export
+{
+ public class File_V1_0 : SubmodelElementType_V1_0
+ {
+ [JsonProperty("mimeType")]
+ [XmlElement("mimeType")]
+ public string MimeType { get; set; }
+
+ [JsonProperty("value")]
+ [XmlElement("value")]
+ public string Value { get; set; }
+
+ [JsonProperty("modelType")]
+ [XmlIgnore]
+ public override ModelType ModelType => ModelType.File;
+
+ public File_V1_0() { }
+ public File_V1_0(SubmodelElementType_V1_0 submodelElementType) : base(submodelElementType) { }
+ }
+}
\ No newline at end of file
diff --git a/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v1.0/EnvironmentSubmodelElements/OperationVariable_V1_0.cs b/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v1.0/EnvironmentSubmodelElements/OperationVariable_V1_0.cs
new file mode 100644
index 0000000..61bf81f
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v1.0/EnvironmentSubmodelElements/OperationVariable_V1_0.cs
@@ -0,0 +1,22 @@
+/*******************************************************************************
+* Copyright (c) 2020 Robert Bosch GmbH
+* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
+*
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License 2.0 which is available at
+* http://www.eclipse.org/legal/epl-2.0
+*
+* SPDX-License-Identifier: EPL-2.0
+*******************************************************************************/
+using Newtonsoft.Json;
+using System.Xml.Serialization;
+
+namespace BaSyx.Models.Export
+{
+ public class OperationVariable_V1_0
+ {
+ [JsonProperty("value")]
+ [XmlElement("value")]
+ public EnvironmentSubmodelElement_V1_0 Value { get; set; }
+ }
+}
\ No newline at end of file
diff --git a/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v1.0/EnvironmentSubmodelElements/Operation_V1_0.cs b/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v1.0/EnvironmentSubmodelElements/Operation_V1_0.cs
new file mode 100644
index 0000000..180fcd6
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v1.0/EnvironmentSubmodelElements/Operation_V1_0.cs
@@ -0,0 +1,36 @@
+/*******************************************************************************
+* Copyright (c) 2020 Robert Bosch GmbH
+* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
+*
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License 2.0 which is available at
+* http://www.eclipse.org/legal/epl-2.0
+*
+* SPDX-License-Identifier: EPL-2.0
+*******************************************************************************/
+using BaSyx.Models.Core.Common;
+using BaSyx.Models.Export.Converter;
+using Newtonsoft.Json;
+using System.Collections.Generic;
+using System.Xml.Serialization;
+
+namespace BaSyx.Models.Export
+{
+ public class Operation_V1_0 : SubmodelElementType_V1_0
+ {
+ [JsonProperty("in"), JsonConverter(typeof(JsonOperationVariableConverter_V1_0))]
+ [XmlElement(ElementName = "in")]
+ public List<OperationVariable_V1_0> In { get; set; }
+
+ [JsonProperty("out")]
+ [XmlElement(ElementName = "out"), JsonConverter(typeof(JsonOperationVariableConverter_V1_0))]
+ public List<OperationVariable_V1_0> Out { get; set; }
+
+ [JsonProperty("modelType")]
+ [XmlIgnore]
+ public override ModelType ModelType => ModelType.Operation;
+
+ public Operation_V1_0() { }
+ public Operation_V1_0(SubmodelElementType_V1_0 submodelElementType) : base(submodelElementType) { }
+ }
+}
\ No newline at end of file
diff --git a/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v1.0/EnvironmentSubmodelElements/Property_V1_0.cs b/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v1.0/EnvironmentSubmodelElements/Property_V1_0.cs
new file mode 100644
index 0000000..9470358
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v1.0/EnvironmentSubmodelElements/Property_V1_0.cs
@@ -0,0 +1,38 @@
+/*******************************************************************************
+* Copyright (c) 2020 Robert Bosch GmbH
+* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
+*
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License 2.0 which is available at
+* http://www.eclipse.org/legal/epl-2.0
+*
+* SPDX-License-Identifier: EPL-2.0
+*******************************************************************************/
+using BaSyx.Models.Core.Common;
+using Newtonsoft.Json;
+using System.Xml.Serialization;
+
+namespace BaSyx.Models.Export
+{
+ public class Property_V1_0 : SubmodelElementType_V1_0
+ {
+ [JsonProperty("valueType")]
+ [XmlElement("valueType")]
+ public string ValueType { get; set; }
+
+ [JsonProperty("value")]
+ [XmlElement("value")]
+ public string Value { get; set; }
+
+ [JsonProperty("valueId")]
+ [XmlElement("valueId")]
+ public EnvironmentReference_V1_0 ValueId { get; set; }
+
+ [JsonProperty("modelType")]
+ [XmlIgnore]
+ public override ModelType ModelType => ModelType.Property;
+
+ public Property_V1_0() { }
+ public Property_V1_0(SubmodelElementType_V1_0 submodelElementType) : base(submodelElementType) { }
+ }
+}
\ No newline at end of file
diff --git a/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v1.0/EnvironmentSubmodelElements/ReferenceElement_V1_0.cs b/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v1.0/EnvironmentSubmodelElements/ReferenceElement_V1_0.cs
new file mode 100644
index 0000000..5e714dc
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v1.0/EnvironmentSubmodelElements/ReferenceElement_V1_0.cs
@@ -0,0 +1,30 @@
+/*******************************************************************************
+* Copyright (c) 2020 Robert Bosch GmbH
+* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
+*
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License 2.0 which is available at
+* http://www.eclipse.org/legal/epl-2.0
+*
+* SPDX-License-Identifier: EPL-2.0
+*******************************************************************************/
+using BaSyx.Models.Core.Common;
+using Newtonsoft.Json;
+using System.Xml.Serialization;
+
+namespace BaSyx.Models.Export
+{
+ public class ReferenceElement_V1_0 : SubmodelElementType_V1_0
+ {
+ [JsonProperty("value")]
+ [XmlElement("value")]
+ public EnvironmentReference_V1_0 Value { get; set; }
+
+ [JsonProperty("modelType")]
+ [XmlIgnore]
+ public override ModelType ModelType => ModelType.ReferenceElement;
+
+ public ReferenceElement_V1_0() { }
+ public ReferenceElement_V1_0(SubmodelElementType_V1_0 submodelElementType) : base(submodelElementType) { }
+ }
+}
\ No newline at end of file
diff --git a/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v1.0/EnvironmentSubmodelElements/RelationshipElement_V1_0.cs b/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v1.0/EnvironmentSubmodelElements/RelationshipElement_V1_0.cs
new file mode 100644
index 0000000..8ab4b3e
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v1.0/EnvironmentSubmodelElements/RelationshipElement_V1_0.cs
@@ -0,0 +1,34 @@
+/*******************************************************************************
+* Copyright (c) 2020 Robert Bosch GmbH
+* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
+*
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License 2.0 which is available at
+* http://www.eclipse.org/legal/epl-2.0
+*
+* SPDX-License-Identifier: EPL-2.0
+*******************************************************************************/
+using BaSyx.Models.Core.Common;
+using Newtonsoft.Json;
+using System.Xml.Serialization;
+
+namespace BaSyx.Models.Export
+{
+ public class RelationshipElement_V1_0 : SubmodelElementType_V1_0
+ {
+ [JsonProperty("first")]
+ [XmlElement("first")]
+ public EnvironmentReference_V1_0 First { get; set; }
+
+ [JsonProperty("second")]
+ [XmlElement("second")]
+ public EnvironmentReference_V1_0 Second { get; set; }
+
+ [JsonProperty("modelType")]
+ [XmlIgnore]
+ public override ModelType ModelType => ModelType.RelationshipElement;
+
+ public RelationshipElement_V1_0() { }
+ public RelationshipElement_V1_0(SubmodelElementType_V1_0 submodelElementType) : base(submodelElementType) { }
+ }
+}
\ No newline at end of file
diff --git a/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v1.0/EnvironmentSubmodelElements/SubmodelElementCollection_V1_0.cs b/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v1.0/EnvironmentSubmodelElements/SubmodelElementCollection_V1_0.cs
new file mode 100644
index 0000000..e7090c4
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v1.0/EnvironmentSubmodelElements/SubmodelElementCollection_V1_0.cs
@@ -0,0 +1,41 @@
+/*******************************************************************************
+* Copyright (c) 2020 Robert Bosch GmbH
+* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
+*
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License 2.0 which is available at
+* http://www.eclipse.org/legal/epl-2.0
+*
+* SPDX-License-Identifier: EPL-2.0
+*******************************************************************************/
+using BaSyx.Models.Core.Common;
+using BaSyx.Models.Export.Converter;
+using Newtonsoft.Json;
+using System.Collections.Generic;
+using System.Xml.Serialization;
+
+namespace BaSyx.Models.Export
+{
+ public class SubmodelElementCollection_V1_0 : SubmodelElementType_V1_0, IModelType
+ {
+ [JsonProperty("value"), JsonConverter(typeof(JsonSubmodelElementConverter_V1_0))]
+ [XmlArray("value")]
+ [XmlArrayItem("submodelElement")]
+ public List<EnvironmentSubmodelElement_V1_0> Value { get; set; }
+
+ [JsonProperty("ordered")]
+ [XmlElement("ordered")]
+ public bool Ordered { get; set; }
+
+ [JsonProperty("allowDuplicates")]
+ [XmlElement("allowDuplicates")]
+ public bool AllowDuplicates { get; set; }
+
+ [JsonProperty("modelType")]
+ [XmlIgnore]
+ public override ModelType ModelType => ModelType.SubmodelElementCollection;
+
+ public SubmodelElementCollection_V1_0() { }
+ public SubmodelElementCollection_V1_0(SubmodelElementType_V1_0 submodelElementType) : base(submodelElementType) { }
+ }
+}
\ No newline at end of file
diff --git a/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v1.0/EnvironmentSubmodel_V1_0.cs b/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v1.0/EnvironmentSubmodel_V1_0.cs
new file mode 100644
index 0000000..52dad0a
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v1.0/EnvironmentSubmodel_V1_0.cs
@@ -0,0 +1,44 @@
+/*******************************************************************************
+* Copyright (c) 2020 Robert Bosch GmbH
+* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
+*
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License 2.0 which is available at
+* http://www.eclipse.org/legal/epl-2.0
+*
+* SPDX-License-Identifier: EPL-2.0
+*******************************************************************************/
+using BaSyx.Models.Core.AssetAdministrationShell.Enums;
+using BaSyx.Models.Core.Common;
+using BaSyx.Models.Export.Converter;
+using Newtonsoft.Json;
+using System.Collections.Generic;
+using System.Xml.Serialization;
+
+namespace BaSyx.Models.Export
+{
+ public class EnvironmentSubmodel_V1_0 : EnvironmentIdentifiable_V1_0, IModelType
+ {
+ [JsonProperty("semanticId")]
+ [XmlElement("semanticId")]
+ public EnvironmentReference_V1_0 SemanticId { get; set; }
+
+ [JsonProperty("kind")]
+ [XmlElement("kind")]
+ public ModelingKind Kind { get; set; }
+
+ [JsonProperty("constraints")]
+ [XmlArray("qualifier")]
+ [XmlArrayItem("qualifier")]
+ public List<EnvironmentQualifier_V1_0> Qualifier { get; set; }
+
+ [JsonProperty("submodelElements"), JsonConverter(typeof(JsonSubmodelElementConverter_V1_0))]
+ [XmlArray("submodelElements")]
+ [XmlArrayItem("submodelElement")]
+ public List<EnvironmentSubmodelElement_V1_0> SubmodelElements { get; set; }
+
+ [JsonProperty("modelType")]
+ [XmlIgnore]
+ public ModelType ModelType => ModelType.Submodel;
+ }
+}
\ No newline at end of file
diff --git a/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v2.0/AssetAdministrationShellEnvironment_V2_0.cs b/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v2.0/AssetAdministrationShellEnvironment_V2_0.cs
new file mode 100644
index 0000000..0847b0e
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v2.0/AssetAdministrationShellEnvironment_V2_0.cs
@@ -0,0 +1,529 @@
+/*******************************************************************************
+* Copyright (c) 2020 Robert Bosch GmbH
+* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
+*
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License 2.0 which is available at
+* http://www.eclipse.org/legal/epl-2.0
+*
+* SPDX-License-Identifier: EPL-2.0
+*******************************************************************************/
+using BaSyx.Models.Core.AssetAdministrationShell.Generics;
+using BaSyx.Models.Core.AssetAdministrationShell.Generics.SubmodelElementTypes;
+using BaSyx.Models.Core.AssetAdministrationShell.Implementations;
+using BaSyx.Models.Core.AssetAdministrationShell.References;
+using BaSyx.Models.Core.AssetAdministrationShell.Semantics;
+using BaSyx.Models.Core.Common;
+using BaSyx.Models.Export.Converter;
+using BaSyx.Models.Export.EnvironmentDataSpecifications;
+using BaSyx.Models.Export.EnvironmentSubmodelElements;
+using BaSyx.Models.Extensions;
+using BaSyx.Models.Extensions.Semantics.DataSpecifications;
+using BaSyx.Utils.DIExtensions;
+using Microsoft.Extensions.DependencyInjection;
+using Newtonsoft.Json;
+using Newtonsoft.Json.Converters;
+using Newtonsoft.Json.Linq;
+using NLog;
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Reflection;
+using System.Runtime.Serialization;
+using System.Xml;
+using System.Xml.Schema;
+using System.Xml.Serialization;
+
+namespace BaSyx.Models.Export
+{
+ [DataContract]
+ [XmlType(AnonymousType = true, Namespace = AAS_NAMESPACE)]
+ [XmlRoot(ElementName = "aasenv", Namespace = AAS_NAMESPACE, IsNullable = false)]
+ public class AssetAdministrationShellEnvironment_V2_0
+ {
+ public static IDIExtension DIExtension { get; }
+
+ public const string AAS_NAMESPACE = "http://www.admin-shell.io/aas/2/0";
+ public const string IEC61360_NAMESPACE = "http://www.admin-shell.io/IEC61360/2/0";
+ public const string ABAC_NAMESPACE = "http://www.admin-shell.io/aas/abac/2/0";
+ public const string AAS_XSD_FILENAME = "AAS-v2.0.xsd";
+ public const string IEC61360_XSD_FILENAME = "IEC61360-v2.0.xsd";
+ public const string ABAC_XSD_FILENAME = "AAS_ABAC-v2.0.xsd";
+
+ [DataMember(EmitDefaultValue = false, IsRequired = true, Name = "assetAdministrationShells", Order = 0)]
+ [XmlIgnore, JsonIgnore]
+ public List<IAssetAdministrationShell> AssetAdministrationShells { get; }
+
+ [DataMember(EmitDefaultValue = false, IsRequired = true, Name = "assets", Order = 1)]
+ [XmlIgnore, JsonIgnore]
+ public List<IAsset> Assets { get; }
+
+ [DataMember(EmitDefaultValue = false, IsRequired = true, Name = "submodels", Order = 2)]
+ [XmlIgnore, JsonIgnore]
+ public List<ISubmodel> Submodels { get; }
+
+ [DataMember(EmitDefaultValue = false, IsRequired = true, Name = "conceptDescriptions", Order = 3)]
+ [XmlIgnore, JsonIgnore]
+ public List<IConceptDescription> ConceptDescriptions { get; }
+
+ [JsonProperty("assetAdministrationShells")]
+ [XmlArray("assetAdministrationShells")]
+ [XmlArrayItem("assetAdministrationShell")]
+ public List<EnvironmentAssetAdministationShell_V2_0> EnvironmentAssetAdministationShells { get; set; }
+
+ [JsonProperty("assets")]
+ [XmlArray("assets")]
+ [XmlArrayItem("asset")]
+ public List<EnvironmentAsset_V2_0> EnvironmentAssets { get; set; }
+
+ [JsonProperty("submodels")]
+ [XmlArray("submodels")]
+ [XmlArrayItem("submodel")]
+ public List<EnvironmentSubmodel_V2_0> EnvironmentSubmodels { get; set; }
+
+ [JsonProperty("conceptDescriptions")]
+ [XmlArray("conceptDescriptions")]
+ [XmlArrayItem("conceptDescription")]
+ public List<EnvironmentConceptDescription_V2_0> EnvironmentConceptDescriptions { get; set; }
+
+ [IgnoreDataMember]
+ [XmlIgnore]
+ public Dictionary<string, IFile> SupplementalFiles;
+
+ private string ContentRoot = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
+
+ public static JsonSerializerSettings JsonSettings;
+ private static Logger logger = LogManager.GetCurrentClassLogger();
+
+ public static XmlReaderSettings XmlSettings;
+
+ static AssetAdministrationShellEnvironment_V2_0()
+ {
+ JsonSettings = new JsonSerializerSettings()
+ {
+ Formatting = Newtonsoft.Json.Formatting.Indented,
+ DefaultValueHandling = DefaultValueHandling.Include,
+ NullValueHandling = NullValueHandling.Ignore
+ };
+ JsonSettings.Converters.Add(new StringEnumConverter());
+
+ XmlSettings = new XmlReaderSettings();
+ XmlSettings.ValidationType = ValidationType.Schema;
+ XmlSettings.ValidationFlags |= XmlSchemaValidationFlags.ProcessInlineSchema;
+ XmlSettings.ValidationFlags |= XmlSchemaValidationFlags.ProcessSchemaLocation;
+ XmlSettings.ValidationFlags |= XmlSchemaValidationFlags.ReportValidationWarnings;
+ XmlSettings.ValidationEventHandler += new ValidationEventHandler(ValidationCallBack);
+ XmlSettings.Schemas.Add(AAS_NAMESPACE, AAS_XSD_FILENAME);
+ XmlSettings.Schemas.Add(IEC61360_NAMESPACE, IEC61360_XSD_FILENAME);
+ XmlSettings.Schemas.Add(ABAC_NAMESPACE, ABAC_XSD_FILENAME);
+
+ var services = new ServiceCollection();
+ services.UseStandardImplementation();
+
+ DIExtension = new DIExtension(services);
+ }
+
+ [JsonConstructor]
+ protected AssetAdministrationShellEnvironment_V2_0()
+ {
+ AssetAdministrationShells = new List<IAssetAdministrationShell>();
+ Submodels = new List<ISubmodel>();
+ Assets = new List<IAsset>();
+ ConceptDescriptions = new List<IConceptDescription>();
+ SupplementalFiles = new Dictionary<string, IFile>();
+
+ EnvironmentAssetAdministationShells = new List<EnvironmentAssetAdministationShell_V2_0>();
+ EnvironmentAssets = new List<EnvironmentAsset_V2_0>();
+ EnvironmentSubmodels = new List<EnvironmentSubmodel_V2_0>();
+ EnvironmentConceptDescriptions = new List<EnvironmentConceptDescription_V2_0>();
+ }
+
+ public AssetAdministrationShellEnvironment_V2_0(params IAssetAdministrationShell[] assetAdministrationShells) : this()
+ {
+ foreach (var aas in assetAdministrationShells)
+ AddAssetAdministationShell(aas);
+
+ ConvertToEnvironment();
+ }
+
+ public void AddAssetAdministationShell(IAssetAdministrationShell aas)
+ {
+ AssetAdministrationShells.Add(aas);
+ Assets.Add(aas.Asset);
+ if (aas.Submodels?.Count > 0)
+ {
+ Submodels.AddRange(aas.Submodels);
+ foreach (var submodel in aas.Submodels)
+ {
+ ExtractAndClearConceptDescriptions(submodel.SubmodelElements);
+ ExtractSupplementalFiles(submodel.SubmodelElements);
+ ResetConstraints(submodel.SubmodelElements);
+ }
+ }
+ }
+
+ private void ConvertToEnvironment()
+ {
+ foreach (var asset in Assets)
+ {
+ EnvironmentAsset_V2_0 envAsset = new EnvironmentAsset_V2_0()
+ {
+ Administration = asset.Administration,
+ AssetIdentificationModelReference = asset.AssetIdentificationModel?.ToEnvironmentReference_V2_0(),
+ Category = asset.Category,
+ Description = asset.Description,
+ Identification = asset.Identification,
+ IdShort = asset.IdShort,
+ Kind = asset.Kind,
+ Parent = asset.Parent?.First?.Value
+ };
+ EnvironmentAssets.Add(envAsset);
+ }
+ foreach (var conceptDescription in ConceptDescriptions)
+ {
+ EmbeddedDataSpecification_V2_0 embeddedDataSpecification = null;
+ var dataSpecification = conceptDescription.EmbeddedDataSpecifications?.FirstOrDefault();
+ if (dataSpecification != null && dataSpecification.DataSpecificationContent is DataSpecificationIEC61360Content dataSpecificationContent)
+ {
+ embeddedDataSpecification = new EmbeddedDataSpecification_V2_0()
+ {
+ HasDataSpecification = dataSpecification.HasDataSpecification?.ToEnvironmentReference_V2_0(),
+ DataSpecificationContent = new DataSpecificationContent_V2_0()
+ {
+ DataSpecificationIEC61360 = dataSpecificationContent.ToEnvironmentDataSpecificationIEC61360_V2_0()
+ }
+ };
+ }
+
+ EnvironmentConceptDescription_V2_0 environmentConceptDescription = new EnvironmentConceptDescription_V2_0()
+ {
+ Administration = conceptDescription.Administration,
+ Category = conceptDescription.Category,
+ Description = conceptDescription.Description,
+ Identification = conceptDescription.Identification,
+ IdShort = conceptDescription.IdShort,
+ Parent = conceptDescription.Parent?.First?.Value,
+ IsCaseOf = conceptDescription.IsCaseOf?.ToList()?.ConvertAll(c => c.ToEnvironmentReference_V2_0()),
+ EmbeddedDataSpecification = embeddedDataSpecification
+ };
+
+ EnvironmentConceptDescriptions.Add(environmentConceptDescription);
+ }
+ foreach (var assetAdministrationShell in AssetAdministrationShells)
+ {
+ EnvironmentAssetAdministationShell_V2_0 environmentAssetAdministationShell = new EnvironmentAssetAdministationShell_V2_0()
+ {
+ Administration = assetAdministrationShell.Administration,
+ Category = assetAdministrationShell.Category,
+ Description = assetAdministrationShell.Description,
+ IdShort = assetAdministrationShell.IdShort,
+ Identification = assetAdministrationShell.Identification,
+ Parent = assetAdministrationShell.Parent?.First?.Value,
+ AssetReference = assetAdministrationShell.Asset?.ToEnvironmentReference_V2_0(),
+ Views = null,
+ ConceptDictionaries = null
+ };
+ environmentAssetAdministationShell.SubmodelReferences = new List<EnvironmentReference_V2_0>();
+ foreach (var submodel in assetAdministrationShell.Submodels)
+ environmentAssetAdministationShell.SubmodelReferences.Add(submodel.ToEnvironmentReference_V2_0());
+
+ EnvironmentAssetAdministationShells.Add(environmentAssetAdministationShell);
+ }
+ foreach (var submodel in Submodels)
+ {
+ EnvironmentSubmodel_V2_0 environmentSubmodel = new EnvironmentSubmodel_V2_0()
+ {
+ Administration = submodel.Administration,
+ Category = submodel.Category,
+ Description = submodel.Description,
+ Identification = submodel.Identification,
+ IdShort = submodel.IdShort,
+ Kind = submodel.Kind,
+ Parent = submodel.Parent?.First?.Value,
+ Qualifier = null,
+ SemanticId = submodel.SemanticId?.ToEnvironmentReference_V2_0()
+ };
+
+ environmentSubmodel.SubmodelElements = new List<EnvironmentSubmodelElement_V2_0>();
+ foreach (var submodelElement in submodel.SubmodelElements)
+ environmentSubmodel.SubmodelElements.Add(submodelElement.ToEnvironmentSubmodelElement_V2_0());
+
+
+ EnvironmentSubmodels.Add(environmentSubmodel);
+ }
+ }
+
+
+ private void ExtractSupplementalFiles(IEnumerable<ISubmodelElement> submodelElements)
+ {
+ foreach (var smElement in submodelElements)
+ {
+ if (smElement is Core.AssetAdministrationShell.Implementations.SubmodelElementTypes.File file)
+ {
+ string filePath = ContentRoot + file.Value.Replace(Path.AltDirectorySeparatorChar, Path.DirectorySeparatorChar);
+ if (System.IO.File.Exists(filePath))
+ {
+ string destinationPath = file.Value;
+ if (!destinationPath.StartsWith(AASX.AASX_FOLDER))
+ destinationPath = AASX.AASX_FOLDER + destinationPath;
+
+ file.Value = destinationPath;
+ SupplementalFiles.Add(filePath, file);
+ }
+ }
+ else if (smElement.ModelType == ModelType.SubmodelElementCollection)
+ ExtractSupplementalFiles((smElement as Core.AssetAdministrationShell.Implementations.SubmodelElementTypes.SubmodelElementCollection).Value);
+ }
+ }
+
+ private void ExtractAndClearConceptDescriptions(IEnumerable<ISubmodelElement> submodelElements)
+ {
+ foreach (var smElement in submodelElements)
+ {
+ if (smElement.ConceptDescription != null)
+ {
+ ConceptDescriptions.Add(smElement.ConceptDescription);
+ (smElement as SubmodelElement).SemanticId = new Reference(new Key(KeyElements.ConceptDescription, smElement.ConceptDescription.Identification.IdType, smElement.ConceptDescription.Identification.Id, true));
+ (smElement as SubmodelElement).ConceptDescription = null;
+ (smElement as SubmodelElement).EmbeddedDataSpecifications = null;
+ }
+ else if (smElement.ModelType == ModelType.SubmodelElementCollection)
+ ExtractAndClearConceptDescriptions((smElement as Core.AssetAdministrationShell.Implementations.SubmodelElementTypes.SubmodelElementCollection).Value);
+ }
+ }
+
+ public void SetContentRoot(string contentRoot) => ContentRoot = contentRoot;
+
+ private void ResetConstraints(IEnumerable<ISubmodelElement> submodelElements)
+ {
+ foreach (var smElement in submodelElements)
+ {
+ if (smElement.Constraints?.Count > 0)
+ (smElement as SubmodelElement).Constraints = null;
+ if (smElement is IOperation operation)
+ {
+ if (operation.InputVariables?.Count > 0)
+ ResetConstraints((smElement as IOperation).InputVariables.ToElementContainer());
+ if (operation.OutputVariables?.Count > 0)
+ ResetConstraints((smElement as IOperation).OutputVariables.ToElementContainer());
+ }
+ else if (smElement.ModelType == ModelType.SubmodelElementCollection)
+ ResetConstraints((smElement as Core.AssetAdministrationShell.Implementations.SubmodelElementTypes.SubmodelElementCollection).Value);
+ }
+ }
+
+ public void WriteEnvironment_V2_0(ExportType exportType, string filePath) => WriteEnvironment_V2_0(this, exportType, filePath);
+
+ public static void WriteEnvironment_V2_0(AssetAdministrationShellEnvironment_V2_0 environment, ExportType exportType, string filePath)
+ {
+ if (environment == null)
+ return;
+
+ switch (exportType)
+ {
+ case ExportType.Json:
+ try
+ {
+ string serialized = JsonConvert.SerializeObject(environment, JsonSettings);
+ System.IO.File.WriteAllText(filePath, serialized);
+ }
+ catch (Exception e)
+ {
+ logger.Error(e);
+ }
+ break;
+ case ExportType.Xml:
+ try
+ {
+ using (StreamWriter writer = new StreamWriter(filePath))
+ {
+ XmlSerializer serializer = new XmlSerializer(typeof(AssetAdministrationShellEnvironment_V2_0), AAS_NAMESPACE);
+ XmlSerializerNamespaces namespaces = new XmlSerializerNamespaces();
+ namespaces.Add("xsi", XmlSchema.InstanceNamespace);
+ namespaces.Add("aas", AAS_NAMESPACE);
+ namespaces.Add("IEC61360", IEC61360_NAMESPACE);
+ serializer.Serialize(writer, environment, namespaces);
+ }
+
+ }
+ catch (Exception e)
+ {
+ logger.Error(e);
+ }
+ break;
+ default:
+ break;
+ }
+ }
+
+
+ public static AssetAdministrationShellEnvironment_V2_0 ReadEnvironment_V2_0(Stream stream, ExportType exportType)
+ {
+ AssetAdministrationShellEnvironment_V2_0 env = null;
+
+ try
+ {
+ switch (exportType)
+ {
+ case ExportType.Xml:
+ {
+ XmlSerializer serializer = new XmlSerializer(typeof(AssetAdministrationShellEnvironment_V2_0), AAS_NAMESPACE);
+
+ using (XmlReader reader = XmlReader.Create(stream, XmlSettings))
+ env = (AssetAdministrationShellEnvironment_V2_0)serializer.Deserialize(reader);
+ }
+ break;
+ case ExportType.Json:
+ {
+ using (StreamReader reader = new StreamReader(stream))
+ env = JsonConvert.DeserializeObject<AssetAdministrationShellEnvironment_V2_0>(reader.ReadToEnd(), JsonSettings);
+ }
+ break;
+ default:
+ throw new InvalidOperationException(exportType + " not supported");
+ }
+
+ ConvertToAssetAdministrationShell(env);
+ return env;
+ }
+ catch (Exception e)
+ {
+ logger.Error(e, "Failed to read environment - Exception: " + e.Message);
+ return null;
+ }
+ }
+
+
+ public static AssetAdministrationShellEnvironment_V2_0 ReadEnvironment_V2_0(string filePath)
+ {
+ if (string.IsNullOrEmpty(filePath))
+ throw new ArgumentNullException(filePath);
+ if (!System.IO.File.Exists(filePath))
+ throw new ArgumentException(filePath + " does not exist");
+
+ AssetAdministrationShellEnvironment_V2_0 env = null;
+
+ string fileExtension = Path.GetExtension(filePath);
+ ExportType exportType;
+ switch (fileExtension)
+ {
+ case ".xml":
+ exportType = ExportType.Xml;
+ break;
+ case ".json":
+ exportType = ExportType.Json;
+ break;
+ default:
+ throw new InvalidOperationException(fileExtension + " not supported");
+ }
+
+ using (FileStream file = new FileStream(filePath, FileMode.Open, FileAccess.Read))
+ env = ReadEnvironment_V2_0(file, exportType);
+
+ if (env == null)
+ return null;
+
+ ConvertToAssetAdministrationShell(env);
+
+ return env;
+ }
+
+ private static void ConvertToAssetAdministrationShell(AssetAdministrationShellEnvironment_V2_0 environment)
+ {
+ foreach (var envAsset in environment.EnvironmentAssets)
+ {
+ Asset asset = new Asset
+ {
+ Administration = envAsset.Administration,
+ Category = envAsset.Category,
+ Description = envAsset.Description,
+ Identification = envAsset.Identification,
+ IdShort = envAsset.IdShort,
+ Kind = envAsset.Kind,
+ AssetIdentificationModel = envAsset.AssetIdentificationModelReference?.ToReference_V2_0<ISubmodel>()
+ };
+ environment.Assets.Add(asset);
+ }
+ foreach (var envConceptDescription in environment.EnvironmentConceptDescriptions)
+ {
+ ConceptDescription conceptDescription = new ConceptDescription()
+ {
+ Administration = envConceptDescription.Administration,
+ Category = envConceptDescription.Category,
+ Description = envConceptDescription.Description,
+ Identification = envConceptDescription.Identification,
+ IdShort = envConceptDescription.IdShort,
+ IsCaseOf = envConceptDescription.IsCaseOf?.ConvertAll(c => c.ToReference_V2_0()),
+ EmbeddedDataSpecifications = (envConceptDescription.EmbeddedDataSpecification?.DataSpecificationContent?.DataSpecificationIEC61360 != null) ? new List<DataSpecificationIEC61360>() : null
+ };
+ if (conceptDescription.EmbeddedDataSpecifications != null)
+ {
+ DataSpecificationIEC61360 dataSpecification = envConceptDescription
+ .EmbeddedDataSpecification
+ .DataSpecificationContent
+ .DataSpecificationIEC61360
+ .ToDataSpecificationIEC61360();
+
+ (conceptDescription.EmbeddedDataSpecifications as List<DataSpecificationIEC61360>).Add(dataSpecification);
+ }
+ environment.ConceptDescriptions.Add(conceptDescription);
+ }
+ foreach (var envSubmodel in environment.EnvironmentSubmodels)
+ {
+ Submodel submodel = new Submodel()
+ {
+ Administration = envSubmodel.Administration,
+ Category = envSubmodel.Category,
+ Description = envSubmodel.Description,
+ Identification = envSubmodel.Identification,
+ IdShort = envSubmodel.IdShort,
+ Kind = envSubmodel.Kind,
+ Parent = string.IsNullOrEmpty(envSubmodel.Parent) ? null :
+ new Reference(
+ new Key(KeyElements.AssetAdministrationShell, KeyType.IRI, envSubmodel.Parent, true)),
+ SemanticId = envSubmodel.SemanticId?.ToReference_V2_0(),
+ ConceptDescription = null,
+ };
+ List<ISubmodelElement> smElements = envSubmodel.SubmodelElements.ConvertAll(c => c.submodelElement?.ToSubmodelElement(environment.ConceptDescriptions));
+ foreach (var smElement in smElements)
+ submodel.SubmodelElements.Add(smElement);
+
+ environment.Submodels.Add(submodel);
+ }
+ foreach (var envAssetAdministrationShell in environment.EnvironmentAssetAdministationShells)
+ {
+ AssetAdministrationShell assetAdministrationShell = new AssetAdministrationShell()
+ {
+ Administration = envAssetAdministrationShell.Administration,
+ Category = envAssetAdministrationShell.Category,
+ DerivedFrom = envAssetAdministrationShell.DerivedFrom?.ToReference_V2_0<IAssetAdministrationShell>(),
+ Description = envAssetAdministrationShell.Description,
+ Identification = envAssetAdministrationShell.Identification,
+ IdShort = envAssetAdministrationShell.IdShort
+ };
+
+ IAsset asset = environment.Assets.Find(a => a.Identification.Id == envAssetAdministrationShell.AssetReference?.Keys?.FirstOrDefault()?.Value);
+ assetAdministrationShell.Asset = asset;
+
+ foreach (var envSubmodelRef in envAssetAdministrationShell.SubmodelReferences)
+ {
+ ISubmodel submodel = environment.Submodels.Find(s => s.Identification.Id == envSubmodelRef.Keys?.FirstOrDefault()?.Value);
+ if (submodel != null)
+ assetAdministrationShell.Submodels.Add(submodel);
+ }
+
+ environment.AssetAdministrationShells.Add(assetAdministrationShell);
+ }
+ }
+
+ private static void ValidationCallBack(object sender, ValidationEventArgs args)
+ {
+ if (args.Severity == XmlSeverityType.Warning)
+ logger.Warn("Validation warning: " + args.Message);
+ else
+ logger.Error("Validation error: " + args.Message + " | LineNumber: " + args.Exception.LineNumber + " | LinePosition: " + args.Exception.LinePosition);
+
+ }
+ }
+}
diff --git a/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v2.0/Converter/ConceptDescriptionConverter_V2_0.cs b/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v2.0/Converter/ConceptDescriptionConverter_V2_0.cs
new file mode 100644
index 0000000..9970961
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v2.0/Converter/ConceptDescriptionConverter_V2_0.cs
@@ -0,0 +1,77 @@
+/*******************************************************************************
+* Copyright (c) 2020 Robert Bosch GmbH
+* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
+*
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License 2.0 which is available at
+* http://www.eclipse.org/legal/epl-2.0
+*
+* SPDX-License-Identifier: EPL-2.0
+*******************************************************************************/
+using BaSyx.Models.Extensions.Semantics.DataSpecifications;
+using BaSyx.Models.Export.EnvironmentDataSpecifications;
+using System;
+
+namespace BaSyx.Models.Export.Converter
+{
+ public static class ConceptDescriptionConverter_V2_0
+ {
+ public static DataSpecificationIEC61360 ToDataSpecificationIEC61360(this EnvironmentDataSpecificationIEC61360_V2_0 environmentDataSpecification)
+ {
+ if (environmentDataSpecification == null)
+ return null;
+
+ DataSpecificationIEC61360 dataSpecification = new DataSpecificationIEC61360(new DataSpecificationIEC61360Content()
+ {
+ DataType = (DataTypeIEC61360)Enum.Parse(typeof(DataTypeIEC61360), environmentDataSpecification.DataType.ToString()),
+ Definition = environmentDataSpecification.Definition,
+ PreferredName = environmentDataSpecification.PreferredName,
+ ShortName = environmentDataSpecification.ShortName,
+ SourceOfDefinition = environmentDataSpecification.SourceOfDefinition,
+ Symbol = environmentDataSpecification.Symbol,
+ Unit = environmentDataSpecification.Unit,
+ UnitId = environmentDataSpecification.UnitId?.ToReference_V2_0(),
+ Value = environmentDataSpecification.Value,
+ ValueFormat = environmentDataSpecification.ValueFormat,
+ ValueId = environmentDataSpecification.ValueId?.ToReference_V2_0(),
+ ValueList = environmentDataSpecification.ValueList.ConvertAll(c => new Extensions.Semantics.DataSpecifications.ValueReferencePair()
+ {
+ Value = c.Value,
+ ValueId = c.ValueId.ToReference_V2_0()
+ }),
+ LevelTypes = environmentDataSpecification.LevelTypes.ConvertAll(c => (LevelType)Enum.Parse(typeof(LevelType), c.ToString()))
+ });
+
+ return dataSpecification;
+ }
+
+ public static EnvironmentDataSpecificationIEC61360_V2_0 ToEnvironmentDataSpecificationIEC61360_V2_0(this DataSpecificationIEC61360Content dataSpecificationContent)
+ {
+ if (dataSpecificationContent == null)
+ return null;
+
+ EnvironmentDataSpecificationIEC61360_V2_0 environmentDataSpecification = new EnvironmentDataSpecificationIEC61360_V2_0()
+ {
+ DataType = (EnvironmentDataTypeIEC61360)Enum.Parse(typeof(EnvironmentDataTypeIEC61360), dataSpecificationContent.DataType.ToString()),
+ Definition = dataSpecificationContent.Definition,
+ PreferredName = dataSpecificationContent.PreferredName,
+ ShortName = dataSpecificationContent.ShortName,
+ SourceOfDefinition = dataSpecificationContent.SourceOfDefinition,
+ Symbol = dataSpecificationContent.Symbol,
+ Unit = dataSpecificationContent.Unit,
+ UnitId = dataSpecificationContent.UnitId?.ToEnvironmentReference_V2_0(),
+ Value = dataSpecificationContent.Value,
+ ValueFormat = dataSpecificationContent.ValueFormat,
+ ValueId = dataSpecificationContent.ValueId?.ToEnvironmentReference_V2_0(),
+ ValueList = dataSpecificationContent.ValueList.ConvertAll(c => new EnvironmentDataSpecifications.ValueReferencePair()
+ {
+ Value = c.Value,
+ ValueId = c.ValueId.ToEnvironmentReference_V2_0()
+ }),
+ LevelTypes = dataSpecificationContent.LevelTypes.ConvertAll(c => (EnvironmentLevelType)Enum.Parse(typeof(EnvironmentLevelType), c.ToString()))
+ };
+
+ return environmentDataSpecification;
+ }
+ }
+}
diff --git a/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v2.0/Converter/JsonOperationVariableConverter_V2_0.cs b/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v2.0/Converter/JsonOperationVariableConverter_V2_0.cs
new file mode 100644
index 0000000..41733b2
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v2.0/Converter/JsonOperationVariableConverter_V2_0.cs
@@ -0,0 +1,103 @@
+/*******************************************************************************
+* Copyright (c) 2020 Robert Bosch GmbH
+* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
+*
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License 2.0 which is available at
+* http://www.eclipse.org/legal/epl-2.0
+*
+* SPDX-License-Identifier: EPL-2.0
+*******************************************************************************/
+using BaSyx.Models.Core.Common;
+using Newtonsoft.Json;
+using Newtonsoft.Json.Linq;
+using NLog;
+using System;
+using System.Collections.Generic;
+
+namespace BaSyx.Models.Export.Converter
+{
+ public class JsonOperationVariableConverter_V2_0 : JsonConverter<List<OperationVariable_V2_0>>
+ {
+ private static Logger logger = LogManager.GetCurrentClassLogger();
+
+ public override List<OperationVariable_V2_0> ReadJson(JsonReader reader, Type objectType, List<OperationVariable_V2_0> existingValue, bool hasExistingValue, JsonSerializer serializer)
+ {
+ JArray jArray = null;
+
+ try
+ {
+ jArray = JArray.Load(reader);
+ }
+ catch (Exception e)
+ {
+ logger.Error(e);
+ }
+
+ if (jArray == null || jArray.Count == 0)
+ return null;
+
+ List<OperationVariable_V2_0> operationVariables = new List<OperationVariable_V2_0>();
+ foreach (var element in jArray)
+ {
+ ModelType modelType = element.SelectToken("modelType")?.ToObject<ModelType>(serializer);
+ SubmodelElementType_V2_0 submodelElementType = CreateSubmodelElement(modelType);
+ if (submodelElementType != null)
+ {
+ serializer.Populate(element.CreateReader(), submodelElementType);
+ operationVariables.Add(new OperationVariable_V2_0()
+ {
+ Value = new EnvironmentSubmodelElement_V2_0() { submodelElement = submodelElementType }
+ });
+ }
+ }
+ return operationVariables;
+ }
+
+ public override void WriteJson(JsonWriter writer, List<OperationVariable_V2_0> value, JsonSerializer serializer)
+ {
+ if (value == null || value.Count == 0)
+ return;
+ JArray jArray = new JArray();
+
+ foreach (var val in value)
+ {
+ JObject jObj = JObject.FromObject(val.Value.submodelElement, serializer);
+ jArray.Add(jObj);
+ }
+
+ jArray.WriteTo(writer);
+ }
+
+ public static SubmodelElementType_V2_0 CreateSubmodelElement(ModelType modelType)
+ {
+ if (modelType == null)
+ {
+ logger.Warn("ModelType is null");
+ return null;
+ }
+
+ if (modelType == ModelType.Property)
+ return new Property_V2_0();
+ if (modelType == ModelType.Operation)
+ return new Operation_V2_0();
+ if (modelType == ModelType.Event)
+ return new Event_V2_0();
+ else if (modelType == ModelType.Blob)
+ return new Blob_V2_0();
+ else if (modelType == ModelType.File)
+ return new File_V2_0();
+ else if (modelType == ModelType.ReferenceElement)
+ return new ReferenceElement_V2_0();
+ else if (modelType == ModelType.RelationshipElement)
+ return new RelationshipElement_V2_0();
+ else if (modelType == ModelType.SubmodelElementCollection)
+ return new SubmodelElementCollection_V2_0();
+ else
+ {
+ logger.Warn("ModelType is unknown: " + modelType.Name);
+ return null;
+ }
+ }
+ }
+}
diff --git a/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v2.0/Converter/JsonSubmodelElementConverter_V2_0.cs b/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v2.0/Converter/JsonSubmodelElementConverter_V2_0.cs
new file mode 100644
index 0000000..dd0175e
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v2.0/Converter/JsonSubmodelElementConverter_V2_0.cs
@@ -0,0 +1,103 @@
+/*******************************************************************************
+* Copyright (c) 2020 Robert Bosch GmbH
+* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
+*
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License 2.0 which is available at
+* http://www.eclipse.org/legal/epl-2.0
+*
+* SPDX-License-Identifier: EPL-2.0
+*******************************************************************************/
+using BaSyx.Models.Core.Common;
+using Newtonsoft.Json;
+using Newtonsoft.Json.Linq;
+using NLog;
+using System;
+using System.Collections.Generic;
+
+namespace BaSyx.Models.Export.Converter
+{
+ public class JsonSubmodelElementConverter_V2_0 : JsonConverter<List<EnvironmentSubmodelElement_V2_0>>
+ {
+ private static Logger logger = LogManager.GetCurrentClassLogger();
+
+ public override List<EnvironmentSubmodelElement_V2_0> ReadJson(JsonReader reader, Type objectType, List<EnvironmentSubmodelElement_V2_0> existingValue, bool hasExistingValue, JsonSerializer serializer)
+ {
+ JArray jArray = null;
+
+ try
+ {
+ jArray = JArray.Load(reader);
+ }
+ catch (Exception e)
+ {
+ logger.Error(e);
+ }
+
+ if (jArray == null || jArray.Count == 0)
+ return null;
+
+ List<EnvironmentSubmodelElement_V2_0> submodelElements = new List<EnvironmentSubmodelElement_V2_0>();
+ foreach (var element in jArray)
+ {
+ ModelType modelType = element.SelectToken("modelType")?.ToObject<ModelType>(serializer);
+ SubmodelElementType_V2_0 submodelElementType = CreateSubmodelElement(modelType);
+ if (submodelElementType != null)
+ {
+ serializer.Populate(element.CreateReader(), submodelElementType);
+ submodelElements.Add(new EnvironmentSubmodelElement_V2_0()
+ {
+ submodelElement = submodelElementType
+ });
+ }
+ }
+ return submodelElements;
+ }
+
+ public override void WriteJson(JsonWriter writer, List<EnvironmentSubmodelElement_V2_0> value, JsonSerializer serializer)
+ {
+ if (value == null || value.Count == 0)
+ return;
+ JArray jArray = new JArray();
+
+ foreach (var val in value)
+ {
+ JObject jObj = JObject.FromObject(val.submodelElement, serializer);
+ jArray.Add(jObj);
+ }
+
+ jArray.WriteTo(writer);
+ }
+
+ public static SubmodelElementType_V2_0 CreateSubmodelElement(ModelType modelType)
+ {
+ if(modelType == null)
+ {
+ logger.Warn("ModelType is null");
+ return null;
+ }
+
+ if (modelType == ModelType.Property)
+ return new Property_V2_0();
+ if (modelType == ModelType.Operation)
+ return new Operation_V2_0();
+ if (modelType == ModelType.Event)
+ return new Event_V2_0();
+ else if (modelType == ModelType.Blob)
+ return new Blob_V2_0();
+ else if (modelType == ModelType.File)
+ return new File_V2_0();
+ else if (modelType == ModelType.ReferenceElement)
+ return new ReferenceElement_V2_0();
+ else if (modelType == ModelType.RelationshipElement)
+ return new RelationshipElement_V2_0();
+ else if (modelType == ModelType.SubmodelElementCollection)
+ return new SubmodelElementCollection_V2_0();
+ else
+ {
+ logger.Warn("ModelType is unknown: " + modelType.Name);
+ return null;
+ }
+ }
+ }
+}
diff --git a/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v2.0/Converter/TypeConverterExtensions_V2_0.cs b/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v2.0/Converter/TypeConverterExtensions_V2_0.cs
new file mode 100644
index 0000000..a062eda
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v2.0/Converter/TypeConverterExtensions_V2_0.cs
@@ -0,0 +1,118 @@
+/*******************************************************************************
+* Copyright (c) 2020 Robert Bosch GmbH
+* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
+*
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License 2.0 which is available at
+* http://www.eclipse.org/legal/epl-2.0
+*
+* SPDX-License-Identifier: EPL-2.0
+*******************************************************************************/
+using BaSyx.Models.Core.AssetAdministrationShell.Generics;
+using BaSyx.Models.Core.AssetAdministrationShell.References;
+using BaSyx.Models.Core.AssetAdministrationShell.Identification;
+using System.Collections.Generic;
+using BaSyx.Models.Core.AssetAdministrationShell.Semantics;
+using System;
+
+namespace BaSyx.Models.Export.Converter
+{
+ public static class TypeConverterExtensions_V2_0
+ {
+ public static EnvironmentReference_V2_0 ToEnvironmentReference_V2_0(this IReference reference)
+ {
+ if (reference?.Keys?.Count == 0)
+ return null;
+
+ List<EnvironmentKey_V2_0> keys = reference?.Keys?.ConvertAll(c => c.ToEnvironmentKey_V2_0());
+ if (keys?.Count > 0)
+ return new EnvironmentReference_V2_0()
+ {
+ Keys = keys
+ };
+ return null;
+ }
+
+ public static Reference ToReference_V2_0(this EnvironmentReference_V2_0 environmentReference)
+ {
+ if (environmentReference == null)
+ return null;
+
+ if (environmentReference?.Keys?.Count > 0)
+ return new Reference(environmentReference.Keys.ConvertAll(c => c.ToKey()).ToArray());
+ return null;
+ }
+
+ public static Reference<T> ToReference_V2_0<T>(this EnvironmentReference_V2_0 environmentReference) where T : IReferable
+ {
+ if (environmentReference == null)
+ return null;
+
+ if (environmentReference?.Keys?.Count > 0)
+ return new Reference<T>(environmentReference.Keys.ConvertAll(c => c.ToKey()).ToArray());
+ return null;
+ }
+
+ public static Key ToKey(this EnvironmentKey_V2_0 environmentKey)
+ {
+ if (environmentKey == null)
+ return null;
+
+ Key key = new Key(
+ (KeyElements)Enum.Parse(typeof(KeyElements), environmentKey.Type.ToString()),
+ (KeyType)Enum.Parse(typeof(KeyType), environmentKey.IdType.ToString()),
+ environmentKey.Value,
+ environmentKey.Local);
+
+ return key;
+ }
+
+ public static EnvironmentKey_V2_0 ToEnvironmentKey_V2_0(this IKey key)
+ {
+ if (key == null)
+ return null;
+
+ EnvironmentKey_V2_0 environmentKey = new EnvironmentKey_V2_0();
+ environmentKey.IdType = (KeyType_V2_0)Enum.Parse(typeof(KeyType_V2_0), key.IdType.ToString());
+ environmentKey.Type = (KeyElements_V2_0)Enum.Parse(typeof(KeyElements_V2_0), key.Type.ToString());
+ environmentKey.Local = key.Local;
+ environmentKey.Value = key.Value;
+
+ return environmentKey;
+ }
+
+ public static EnvironmentReference_V2_0 ToEnvironmentReference_V2_0(this IIdentifiable identifiable)
+ {
+ if (identifiable.Identification == null)
+ return null;
+
+ KeyElements_V2_0 type;
+
+ if (identifiable is IAsset)
+ type = KeyElements_V2_0.Asset;
+ else if (identifiable is IAssetAdministrationShell)
+ type = KeyElements_V2_0.AssetAdministrationShell;
+ else if (identifiable is IConceptDescription)
+ type = KeyElements_V2_0.ConceptDescription;
+ else if (identifiable is ISubmodel)
+ type = KeyElements_V2_0.Submodel;
+ else
+ return null;
+
+ EnvironmentReference_V2_0 reference = new EnvironmentReference_V2_0()
+ {
+ Keys = new List<EnvironmentKey_V2_0>()
+ {
+ new EnvironmentKey_V2_0()
+ {
+ IdType = (KeyType_V2_0)Enum.Parse(typeof(KeyType_V2_0), identifiable.Identification.IdType.ToString()),
+ Local = true,
+ Value = identifiable.Identification.Id,
+ Type = type
+ }
+ }
+ };
+ return reference;
+ }
+ }
+}
diff --git a/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v2.0/EnvironmentAssetAdministationShell_V2_0.cs b/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v2.0/EnvironmentAssetAdministationShell_V2_0.cs
new file mode 100644
index 0000000..35632f5
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v2.0/EnvironmentAssetAdministationShell_V2_0.cs
@@ -0,0 +1,69 @@
+/*******************************************************************************
+* Copyright (c) 2020 Robert Bosch GmbH
+* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
+*
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License 2.0 which is available at
+* http://www.eclipse.org/legal/epl-2.0
+*
+* SPDX-License-Identifier: EPL-2.0
+*******************************************************************************/
+using BaSyx.Models.Core.Common;
+using Newtonsoft.Json;
+using System.Collections.Generic;
+using System.Xml.Serialization;
+
+namespace BaSyx.Models.Export
+{
+ public class EnvironmentAssetAdministationShell_V2_0 : EnvironmentIdentifiable_V2_0, IModelType
+ {
+ [JsonProperty("asset")]
+ [XmlElement("assetRef")]
+ public EnvironmentReference_V2_0 AssetReference { get; set; }
+
+ [JsonProperty("submodels")]
+ [XmlArray("submodelRefs")]
+ [XmlArrayItem("submodelRef")]
+ public List<EnvironmentReference_V2_0> SubmodelReferences { get; set; }
+
+ [JsonProperty("conceptDictionaries")]
+ [XmlElement("conceptDictionaries")]
+ public List<ConceptDictionary_V2_0> ConceptDictionaries { get; set; }
+
+ [JsonProperty("derivedFrom")]
+ [XmlElement("derivedFrom")]
+ public EnvironmentReference_V2_0 DerivedFrom { get; set; }
+
+ [JsonProperty("views")]
+ [XmlArray("views")]
+ [XmlArrayItem("view")]
+ public List<View_V2_0> Views { get; set; }
+
+ [JsonProperty("modelType")]
+ [XmlIgnore]
+ public ModelType ModelType => ModelType.AssetAdministationShell;
+ }
+
+ public class ConceptDictionary_V2_0 : EnvironmentReferable_V2_0
+ {
+ [JsonProperty("conceptDescriptions")]
+ [XmlArray("conceptDescriptions")]
+ [XmlArrayItem("conceptDescriptionRefs")]
+ public List<EnvironmentReference_V2_0> ConceptDescriptionsRefs {get; set; }
+ }
+
+ public class View_V2_0 : EnvironmentReferable_V2_0, IModelType
+ {
+ [JsonProperty("semanticId")]
+ [XmlElement(ElementName = "semanticId")]
+ public EnvironmentReference_V2_0 SemanticId { get; set; }
+
+ [JsonProperty("containedElements")]
+ [XmlArray("containedElements")]
+ [XmlArrayItem(ElementName = "containedElementRef")]
+ public List<EnvironmentReference_V2_0> ContainedElements { get; set; }
+
+ [XmlIgnore]
+ public ModelType ModelType => ModelType.View;
+ }
+}
diff --git a/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v2.0/EnvironmentAsset_V2_0.cs b/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v2.0/EnvironmentAsset_V2_0.cs
new file mode 100644
index 0000000..26e4511
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v2.0/EnvironmentAsset_V2_0.cs
@@ -0,0 +1,36 @@
+/*******************************************************************************
+* Copyright (c) 2020 Robert Bosch GmbH
+* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
+*
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License 2.0 which is available at
+* http://www.eclipse.org/legal/epl-2.0
+*
+* SPDX-License-Identifier: EPL-2.0
+*******************************************************************************/
+using BaSyx.Models.Core.AssetAdministrationShell.Enums;
+using BaSyx.Models.Core.Common;
+using Newtonsoft.Json;
+using System.Xml.Serialization;
+
+namespace BaSyx.Models.Export
+{
+ public class EnvironmentAsset_V2_0 : EnvironmentIdentifiable_V2_0, IModelType
+ {
+ [JsonProperty("kind")]
+ [XmlElement("kind")]
+ public AssetKind Kind { get; set; }
+
+ [JsonProperty("assetIdentificationModel")]
+ [XmlElement("assetIdentificationModelRef")]
+ public EnvironmentReference_V2_0 AssetIdentificationModelReference { get; set; }
+
+ [JsonProperty("billOfMaterial")]
+ [XmlElement("billOfMaterialRef")]
+ public EnvironmentReference_V2_0 BillOfMaterial { get; set; }
+
+ [JsonProperty("modelType")]
+ [XmlIgnore]
+ public ModelType ModelType => ModelType.Asset;
+ }
+}
diff --git a/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v2.0/EnvironmentConceptDescription_V2_0.cs b/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v2.0/EnvironmentConceptDescription_V2_0.cs
new file mode 100644
index 0000000..d2045a6
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v2.0/EnvironmentConceptDescription_V2_0.cs
@@ -0,0 +1,64 @@
+/*******************************************************************************
+* Copyright (c) 2020 Robert Bosch GmbH
+* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
+*
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License 2.0 which is available at
+* http://www.eclipse.org/legal/epl-2.0
+*
+* SPDX-License-Identifier: EPL-2.0
+*******************************************************************************/
+using BaSyx.Models.Core.Common;
+using BaSyx.Models.Export.EnvironmentDataSpecifications;
+using Newtonsoft.Json;
+using System.Collections.Generic;
+using System.Linq;
+using System.Xml.Serialization;
+
+namespace BaSyx.Models.Export
+{
+ public class EnvironmentConceptDescription_V2_0 : EnvironmentIdentifiable_V2_0, IModelType
+ {
+ [JsonIgnore]
+ [XmlElement("embeddedDataSpecification")]
+ public EmbeddedDataSpecification_V2_0 EmbeddedDataSpecification
+ {
+ get => EmbeddedDataSpecifications?.FirstOrDefault();
+ set
+ {
+ if (EmbeddedDataSpecifications == null)
+ EmbeddedDataSpecifications = new List<EmbeddedDataSpecification_V2_0>();
+ EmbeddedDataSpecifications.Insert(0, value);
+ }
+ }
+
+ [JsonProperty("embeddedDataSpecifications")]
+ [XmlIgnore]
+ public List<EmbeddedDataSpecification_V2_0> EmbeddedDataSpecifications { get; set; } = new List<EmbeddedDataSpecification_V2_0>();
+
+ [JsonProperty("isCaseOf")]
+ [XmlElement("isCaseOf")]
+ public List<EnvironmentReference_V2_0> IsCaseOf { get; set; }
+
+ [JsonProperty("modelType")]
+ [XmlIgnore]
+ public ModelType ModelType => ModelType.ConceptDescription;
+ }
+
+ public class EmbeddedDataSpecification_V2_0
+ {
+ [JsonProperty("hasDataSpecification")]
+ [XmlElement("hasDataSpecification")]
+ public EnvironmentReference_V2_0 HasDataSpecification { get; set; }
+
+ [JsonProperty("dataSpecificationContent")]
+ [XmlElement("dataSpecificationContent")]
+ public DataSpecificationContent_V2_0 DataSpecificationContent { get; set; }
+ }
+
+ public class DataSpecificationContent_V2_0
+ {
+ [XmlElement("dataSpecificationIEC61360")]
+ public EnvironmentDataSpecificationIEC61360_V2_0 DataSpecificationIEC61360 { get; set; }
+ }
+}
diff --git a/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v2.0/EnvironmentDataSpecifications/EnvironmentDataSpecificationIEC61360_V2_0.cs b/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v2.0/EnvironmentDataSpecifications/EnvironmentDataSpecificationIEC61360_V2_0.cs
new file mode 100644
index 0000000..4b17411
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v2.0/EnvironmentDataSpecifications/EnvironmentDataSpecificationIEC61360_V2_0.cs
@@ -0,0 +1,129 @@
+/*******************************************************************************
+* Copyright (c) 2020 Robert Bosch GmbH
+* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
+*
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License 2.0 which is available at
+* http://www.eclipse.org/legal/epl-2.0
+*
+* SPDX-License-Identifier: EPL-2.0
+*******************************************************************************/
+using BaSyx.Models.Core.Common;
+using Newtonsoft.Json;
+using System.Collections.Generic;
+using System.Runtime.Serialization;
+using System.Xml.Serialization;
+
+namespace BaSyx.Models.Export.EnvironmentDataSpecifications
+{
+ [XmlType("dataSpecificationIEC61360", Namespace = AssetAdministrationShellEnvironment_V2_0.IEC61360_NAMESPACE)]
+ public class EnvironmentDataSpecificationIEC61360_V2_0
+ {
+ [JsonProperty("preferredName")]
+ [XmlArray("preferredName")]
+ [XmlArrayItem("langString", Namespace = AssetAdministrationShellEnvironment_V2_0.IEC61360_NAMESPACE)]
+ public LangStringSet PreferredName { get; set; }
+
+ [JsonProperty("shortName")]
+ [XmlArray("shortName")]
+ [XmlArrayItem("langString", Namespace = AssetAdministrationShellEnvironment_V2_0.IEC61360_NAMESPACE)]
+ public LangStringSet ShortName { get; set; }
+
+ [JsonProperty("unit")]
+ [XmlElement("unit", Namespace = AssetAdministrationShellEnvironment_V2_0.IEC61360_NAMESPACE)]
+ public string Unit { get; set; }
+
+ [JsonProperty("unitId")]
+ [XmlElement("unitId", Namespace = AssetAdministrationShellEnvironment_V2_0.IEC61360_NAMESPACE)]
+ public EnvironmentReference_V2_0 UnitId { get; set; }
+
+ [JsonProperty("sourceOfDefinition")]
+ [XmlElement("sourceOfDefinition", Namespace = AssetAdministrationShellEnvironment_V2_0.IEC61360_NAMESPACE)]
+ public string SourceOfDefinition { get; set; }
+
+ [JsonProperty("symbol")]
+ [XmlElement("symbol", Namespace = AssetAdministrationShellEnvironment_V2_0.IEC61360_NAMESPACE)]
+ public string Symbol { get; set; }
+
+ [JsonProperty("dataType")]
+ [XmlElement("dataType", Namespace = AssetAdministrationShellEnvironment_V2_0.IEC61360_NAMESPACE)]
+ public EnvironmentDataTypeIEC61360 DataType { get; set; }
+
+ [JsonProperty("definition")]
+ [XmlArray("definition")]
+ [XmlArrayItem("langString", Namespace = AssetAdministrationShellEnvironment_V2_0.AAS_NAMESPACE)]
+ public LangStringSet Definition { get; set; }
+
+ [JsonProperty("valueFormat")]
+ [XmlElement("valueFormat", Namespace = AssetAdministrationShellEnvironment_V2_0.IEC61360_NAMESPACE)]
+ public string ValueFormat { get; set; }
+
+ [JsonProperty("valueList")]
+ [XmlArray("valueList")]
+ [XmlArrayItem("valueReferencePair", Namespace = AssetAdministrationShellEnvironment_V2_0.IEC61360_NAMESPACE)]
+ public List<ValueReferencePair> ValueList { get; set; }
+
+ [JsonProperty("value")]
+ [XmlElement("value", Namespace = AssetAdministrationShellEnvironment_V2_0.IEC61360_NAMESPACE)]
+ public object Value { get; set; }
+
+ [JsonProperty("valueId")]
+ [XmlElement("valueId", Namespace = AssetAdministrationShellEnvironment_V2_0.IEC61360_NAMESPACE)]
+ public EnvironmentReference_V2_0 ValueId { get; set; }
+
+ [JsonProperty("levelType")]
+ [XmlElement("levelType", Namespace = AssetAdministrationShellEnvironment_V2_0.IEC61360_NAMESPACE)]
+ public List<EnvironmentLevelType> LevelTypes { get; set; }
+ }
+
+ public class ValueReferencePair
+ {
+ [JsonProperty("value")]
+ [XmlElement("value", Namespace = AssetAdministrationShellEnvironment_V2_0.IEC61360_NAMESPACE)]
+ public object Value { get; set; }
+
+ [JsonProperty("valueId")]
+ [XmlElement("valueId", Namespace = AssetAdministrationShellEnvironment_V2_0.IEC61360_NAMESPACE)]
+ public EnvironmentReference_V2_0 ValueId { get; set; }
+ }
+
+ public enum EnvironmentLevelType
+ {
+ [EnumMember(Value = "Min")]
+ Min,
+ [EnumMember(Value = "Max")]
+ Max,
+ [EnumMember(Value = "Nom")]
+ Nom,
+ [EnumMember(Value = "Typ")]
+ Typ
+ }
+
+ public enum EnvironmentDataTypeIEC61360
+ {
+ [EnumMember(Value = "DATE")]
+ DATE,
+ [EnumMember(Value = "STRING")]
+ STRING,
+ [EnumMember(Value = "STRING_TRANSLATABLE")]
+ STRING_TRANSLATABLE,
+ [EnumMember(Value = "REAL_MEASURE")]
+ REAL_MEASURE,
+ [EnumMember(Value = "REAL_COUNT")]
+ REAL_COUNT,
+ [EnumMember(Value = "REAL_CURRENCY")]
+ REAL_CURRENCY,
+ [EnumMember(Value = "BOOLEAN")]
+ BOOLEAN,
+ [EnumMember(Value = "URL")]
+ URL,
+ [EnumMember(Value = "RATIONAL")]
+ RATIONAL,
+ [EnumMember(Value = "RATIONAL_MEASURE")]
+ RATIONAL_MEASURE,
+ [EnumMember(Value = "TIME")]
+ TIME,
+ [EnumMember(Value = "TIME_STAMP")]
+ TIME_STAMP
+ }
+}
diff --git a/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v2.0/EnvironmentIdentifiable_V2_0.cs b/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v2.0/EnvironmentIdentifiable_V2_0.cs
new file mode 100644
index 0000000..22e6649
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v2.0/EnvironmentIdentifiable_V2_0.cs
@@ -0,0 +1,27 @@
+/*******************************************************************************
+* Copyright (c) 2020 Robert Bosch GmbH
+* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
+*
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License 2.0 which is available at
+* http://www.eclipse.org/legal/epl-2.0
+*
+* SPDX-License-Identifier: EPL-2.0
+*******************************************************************************/
+using BaSyx.Models.Core.AssetAdministrationShell.Identification;
+using Newtonsoft.Json;
+using System.Xml.Serialization;
+
+namespace BaSyx.Models.Export
+{
+ public class EnvironmentIdentifiable_V2_0 : EnvironmentReferable_V2_0
+ {
+ [JsonProperty("identification", Order = -2)]
+ [XmlElement("identification")]
+ public Identifier Identification { get; set; }
+
+ [JsonProperty("administration", Order = -1)]
+ [XmlElement("administration")]
+ public AdministrativeInformation Administration { get; set; }
+ }
+}
diff --git a/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v2.0/EnvironmentKey_V2_0.cs b/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v2.0/EnvironmentKey_V2_0.cs
new file mode 100644
index 0000000..5081aa0
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v2.0/EnvironmentKey_V2_0.cs
@@ -0,0 +1,72 @@
+using Newtonsoft.Json;
+using System.Runtime.Serialization;
+using System.Xml.Serialization;
+
+namespace BaSyx.Models.Export
+{
+ [XmlType("key")]
+ public class EnvironmentKey_V2_0
+ {
+ [JsonProperty(Required = Required.Always, DefaultValueHandling = DefaultValueHandling.Include)]
+ [XmlAttribute("type")]
+ public KeyElements_V2_0 Type { get; set; }
+
+ [JsonProperty(Required = Required.Always, DefaultValueHandling = DefaultValueHandling.Include)]
+ [XmlAttribute("idType")]
+ public KeyType_V2_0 IdType { get; set; }
+
+ [JsonProperty(Required = Required.Always, DefaultValueHandling = DefaultValueHandling.Include)]
+ [XmlText]
+ public string Value { get; set; }
+
+ [JsonProperty(Required = Required.Always, DefaultValueHandling = DefaultValueHandling.Include)]
+ [XmlAttribute("local")]
+ public bool Local { get; set; }
+ }
+
+ public enum KeyType_V2_0
+ {
+ [EnumMember(Value = "Custom")]
+ Custom,
+ [EnumMember(Value = "IRI")]
+ IRI,
+ [EnumMember(Value = "IRDI")]
+ IRDI,
+ [EnumMember(Value = "IdShort")]
+ IdShort,
+ [EnumMember(Value = "FragmentId")]
+ FragmentId
+ }
+
+ public enum KeyElements_V2_0
+ {
+ GlobalReference,
+ FragmentReference,
+
+ AccessPermissionRule,
+ AnnotatedRelationshipElement,
+ BasicEvent,
+ Blob,
+ Capability,
+ ConceptDictionary,
+ DataElement,
+ File,
+ Entity,
+ Event,
+ MultiLanguageProperty,
+ Operation,
+ Property,
+ Range,
+ ReferenceElement,
+ RelationshipElement,
+ SubmodelElement,
+ SubmodelElementCollection,
+ View,
+
+ Asset,
+ AssetAdministrationShell,
+ ConceptDescription,
+ Submodel
+
+ }
+}
diff --git a/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v2.0/EnvironmentQualifier_V2_0.cs b/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v2.0/EnvironmentQualifier_V2_0.cs
new file mode 100644
index 0000000..2fbb236
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v2.0/EnvironmentQualifier_V2_0.cs
@@ -0,0 +1,39 @@
+/*******************************************************************************
+* Copyright (c) 2020 Robert Bosch GmbH
+* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
+*
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License 2.0 which is available at
+* http://www.eclipse.org/legal/epl-2.0
+*
+* SPDX-License-Identifier: EPL-2.0
+*******************************************************************************/
+using BaSyx.Models.Core.Common;
+using Newtonsoft.Json;
+using System.Xml.Serialization;
+
+namespace BaSyx.Models.Export
+{
+ public class EnvironmentQualifier_V2_0
+ {
+ [JsonProperty("type")]
+ [XmlElement("type")]
+ public string Type { get; set; }
+
+ [JsonProperty("value")]
+ [XmlElement("value")]
+ public string Value { get; set; }
+
+ [JsonProperty("valueType")]
+ [XmlElement("valueType")]
+ public string ValueType { get; set; }
+
+ [JsonProperty("valueId")]
+ [XmlElement("valueId")]
+ public EnvironmentReference_V2_0 ValueId { get; set; }
+
+ [JsonProperty("modelType")]
+ [XmlIgnore]
+ public ModelType ModelType => ModelType.Qualifier;
+ }
+}
diff --git a/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v2.0/EnvironmentReferable_V2_0.cs b/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v2.0/EnvironmentReferable_V2_0.cs
new file mode 100644
index 0000000..fcd56bb
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v2.0/EnvironmentReferable_V2_0.cs
@@ -0,0 +1,39 @@
+/*******************************************************************************
+* Copyright (c) 2020 Robert Bosch GmbH
+* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
+*
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License 2.0 which is available at
+* http://www.eclipse.org/legal/epl-2.0
+*
+* SPDX-License-Identifier: EPL-2.0
+*******************************************************************************/
+using BaSyx.Models.Core.Common;
+using Newtonsoft.Json;
+using System.Xml.Serialization;
+
+namespace BaSyx.Models.Export
+{
+
+ public class EnvironmentReferable_V2_0
+ {
+ [JsonProperty("idShort", Order = -6)]
+ [XmlElement("idShort")]
+ public string IdShort { get; set; }
+
+ [JsonProperty("category", Order = -5)]
+ [XmlElement("category")]
+ public string Category { get; set; }
+
+ [JsonProperty("description", Order = -4)]
+ [XmlArray("description")]
+ [XmlArrayItem("langString")]
+ public LangStringSet Description { get; set; }
+
+ [JsonProperty("parent", Order = -3)]
+ [XmlElement("parent")]
+ public string Parent { get; set; }
+
+
+ }
+}
diff --git a/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v2.0/EnvironmentReference_V2_0.cs b/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v2.0/EnvironmentReference_V2_0.cs
new file mode 100644
index 0000000..d0736e1
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v2.0/EnvironmentReference_V2_0.cs
@@ -0,0 +1,25 @@
+/*******************************************************************************
+* Copyright (c) 2020 Robert Bosch GmbH
+* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
+*
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License 2.0 which is available at
+* http://www.eclipse.org/legal/epl-2.0
+*
+* SPDX-License-Identifier: EPL-2.0
+*******************************************************************************/
+using Newtonsoft.Json;
+using System.Collections.Generic;
+using System.Xml.Serialization;
+
+namespace BaSyx.Models.Export
+{
+
+ public class EnvironmentReference_V2_0
+ {
+ [JsonProperty("keys")]
+ [XmlArray("keys")]
+ [XmlArrayItem("key")]
+ public List<EnvironmentKey_V2_0> Keys { get; set; }
+ }
+}
diff --git a/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v2.0/EnvironmentSubmodelElement_V2_0.cs b/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v2.0/EnvironmentSubmodelElement_V2_0.cs
new file mode 100644
index 0000000..bcb0c98
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v2.0/EnvironmentSubmodelElement_V2_0.cs
@@ -0,0 +1,64 @@
+/*******************************************************************************
+* Copyright (c) 2020 Robert Bosch GmbH
+* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
+*
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License 2.0 which is available at
+* http://www.eclipse.org/legal/epl-2.0
+*
+* SPDX-License-Identifier: EPL-2.0
+*******************************************************************************/
+using BaSyx.Models.Core.AssetAdministrationShell.Enums;
+using BaSyx.Models.Core.Common;
+using Newtonsoft.Json;
+using System.Collections.Generic;
+using System.Xml.Serialization;
+
+namespace BaSyx.Models.Export
+{
+ [XmlType(TypeName = "submodelElement")]
+ public class EnvironmentSubmodelElement_V2_0
+ {
+ [XmlElement(ElementName = "property", Type = typeof(Property_V2_0))]
+ [XmlElement(ElementName = "file", Type = typeof(File_V2_0))]
+ [XmlElement(ElementName = "blob", Type = typeof(Blob_V2_0))]
+ [XmlElement(ElementName = "event", Type = typeof(Event_V2_0))]
+ [XmlElement(ElementName = "referenceElement", Type = typeof(ReferenceElement_V2_0))]
+ [XmlElement(ElementName = "relationshipElement", Type = typeof(RelationshipElement_V2_0))]
+ [XmlElement(ElementName = "submodelElementCollection", Type = typeof(SubmodelElementCollection_V2_0))]
+ [XmlElement(ElementName = "operation", Type = typeof(Operation_V2_0))]
+ public SubmodelElementType_V2_0 submodelElement;
+ }
+
+ public class SubmodelElementType_V2_0 : EnvironmentReferable_V2_0, IModelType
+ {
+ [JsonProperty("semanticId")]
+ [XmlElement("semanticId")]
+ public EnvironmentReference_V2_0 SemanticId { get; set; }
+
+ [JsonProperty("kind")]
+ [XmlElement("kind")]
+ public ModelingKind Kind { get; set; }
+
+ [JsonProperty("constraints")]
+ [XmlArray("qualifier")]
+ [XmlArrayItem("qualifier")]
+ public List<EnvironmentQualifier_V2_0> Qualifier { get; set; } = new List<EnvironmentQualifier_V2_0>();
+
+ [XmlIgnore]
+ public virtual ModelType ModelType { get; }
+
+ public SubmodelElementType_V2_0() { }
+ public SubmodelElementType_V2_0(SubmodelElementType_V2_0 submodelElementType)
+ {
+ this.Category = submodelElementType.Category;
+ this.Description = submodelElementType.Description;
+ this.IdShort = submodelElementType.IdShort;
+ this.Kind = submodelElementType.Kind;
+ this.Parent = submodelElementType.Parent;
+ this.Qualifier = submodelElementType.Qualifier;
+ this.SemanticId = submodelElementType.SemanticId;
+ }
+
+ }
+}
diff --git a/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v2.0/EnvironmentSubmodelElements/AnnotatedRelationshipElement_V2_0.cs b/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v2.0/EnvironmentSubmodelElements/AnnotatedRelationshipElement_V2_0.cs
new file mode 100644
index 0000000..799d696
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v2.0/EnvironmentSubmodelElements/AnnotatedRelationshipElement_V2_0.cs
@@ -0,0 +1,30 @@
+/*******************************************************************************
+* Copyright (c) 2020 Robert Bosch GmbH
+* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
+*
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License 2.0 which is available at
+* http://www.eclipse.org/legal/epl-2.0
+*
+* SPDX-License-Identifier: EPL-2.0
+*******************************************************************************/
+using BaSyx.Models.Core.Common;
+using Newtonsoft.Json;
+using System.Xml.Serialization;
+
+namespace BaSyx.Models.Export
+{
+ public class AnnotatedRelationshipElement_V2_0 : RelationshipElement_V2_0
+ {
+ [JsonProperty("annotation")]
+ [XmlElement("annotation")]
+ public EnvironmentReference_V2_0 Annotation { get; set; }
+
+ [JsonProperty("modelType")]
+ [XmlIgnore]
+ public override ModelType ModelType => ModelType.AnnotatedRelationshipElement;
+
+ public AnnotatedRelationshipElement_V2_0() { }
+ public AnnotatedRelationshipElement_V2_0(SubmodelElementType_V2_0 submodelElementType) : base(submodelElementType) { }
+ }
+}
diff --git a/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v2.0/EnvironmentSubmodelElements/BasicEvent_V2_0.cs b/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v2.0/EnvironmentSubmodelElements/BasicEvent_V2_0.cs
new file mode 100644
index 0000000..cfbb8db
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v2.0/EnvironmentSubmodelElements/BasicEvent_V2_0.cs
@@ -0,0 +1,30 @@
+/*******************************************************************************
+* Copyright (c) 2020 Robert Bosch GmbH
+* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
+*
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License 2.0 which is available at
+* http://www.eclipse.org/legal/epl-2.0
+*
+* SPDX-License-Identifier: EPL-2.0
+*******************************************************************************/
+using BaSyx.Models.Core.Common;
+using Newtonsoft.Json;
+using System.Xml.Serialization;
+
+namespace BaSyx.Models.Export
+{
+ public class BasicEvent_V2_0 : Event_V2_0
+ {
+ [JsonProperty("observed")]
+ [XmlElement("observed")]
+ public EnvironmentReference_V2_0 Observed { get; set; }
+
+ [JsonProperty("modelType")]
+ [XmlIgnore]
+ public override ModelType ModelType => ModelType.BasicEvent;
+
+ public BasicEvent_V2_0() { }
+ public BasicEvent_V2_0(SubmodelElementType_V2_0 submodelElementType) : base(submodelElementType) { }
+ }
+}
diff --git a/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v2.0/EnvironmentSubmodelElements/Blob_V2_0.cs b/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v2.0/EnvironmentSubmodelElements/Blob_V2_0.cs
new file mode 100644
index 0000000..bbc1961
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v2.0/EnvironmentSubmodelElements/Blob_V2_0.cs
@@ -0,0 +1,34 @@
+/*******************************************************************************
+* Copyright (c) 2020 Robert Bosch GmbH
+* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
+*
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License 2.0 which is available at
+* http://www.eclipse.org/legal/epl-2.0
+*
+* SPDX-License-Identifier: EPL-2.0
+*******************************************************************************/
+using BaSyx.Models.Core.Common;
+using Newtonsoft.Json;
+using System.Xml.Serialization;
+
+namespace BaSyx.Models.Export
+{
+ public class Blob_V2_0 : SubmodelElementType_V2_0
+ {
+ [JsonProperty("mimeType")]
+ [XmlElement("mimeType")]
+ public string MimeType { get; set; }
+
+ [JsonProperty("value")]
+ [XmlElement("value")]
+ public string Value { get; set; }
+
+ [JsonProperty("modelType")]
+ [XmlIgnore]
+ public override ModelType ModelType => ModelType.Blob;
+
+ public Blob_V2_0() { }
+ public Blob_V2_0(SubmodelElementType_V2_0 submodelElementType) : base(submodelElementType) { }
+ }
+}
diff --git a/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v2.0/EnvironmentSubmodelElements/Entity_V2_0.cs b/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v2.0/EnvironmentSubmodelElements/Entity_V2_0.cs
new file mode 100644
index 0000000..355388c
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v2.0/EnvironmentSubmodelElements/Entity_V2_0.cs
@@ -0,0 +1,48 @@
+/*******************************************************************************
+* Copyright (c) 2020 Robert Bosch GmbH
+* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
+*
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License 2.0 which is available at
+* http://www.eclipse.org/legal/epl-2.0
+*
+* SPDX-License-Identifier: EPL-2.0
+*******************************************************************************/
+using BaSyx.Models.Core.Common;
+using Newtonsoft.Json;
+using System.Collections.Generic;
+using System.Runtime.Serialization;
+using System.Xml.Serialization;
+
+namespace BaSyx.Models.Export
+{
+ public class Entity_V2_0 : SubmodelElementType_V2_0
+ {
+ [JsonProperty("entityType")]
+ [XmlElement("entityType")]
+ public EnvironmentEntityType EntityType { get; set; }
+
+ [JsonProperty("statements")]
+ [XmlElement("statement")]
+ public List<EnvironmentSubmodelElement_V2_0> Statements { get; set; }
+
+ [JsonProperty("asset")]
+ [XmlElement("assetRef")]
+ public EnvironmentReference_V2_0 AssetReference { get; set; }
+
+ [JsonProperty("modelType")]
+ [XmlIgnore]
+ public override ModelType ModelType => ModelType.Entity;
+
+ public Entity_V2_0() { }
+ public Entity_V2_0(SubmodelElementType_V2_0 submodelElementType) : base(submodelElementType) { }
+ }
+
+ public enum EnvironmentEntityType
+ {
+ [EnumMember(Value = "CoManagedEntity")]
+ CoManagedEntity,
+ [EnumMember(Value = "SelfManagedEntity")]
+ SelfManagedEntity
+ }
+}
diff --git a/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v2.0/EnvironmentSubmodelElements/EnvironmentSubmodelElementFactory_V2_0.cs b/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v2.0/EnvironmentSubmodelElements/EnvironmentSubmodelElementFactory_V2_0.cs
new file mode 100644
index 0000000..3ec1b73
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v2.0/EnvironmentSubmodelElements/EnvironmentSubmodelElementFactory_V2_0.cs
@@ -0,0 +1,360 @@
+/*******************************************************************************
+* Copyright (c) 2020 Robert Bosch GmbH
+* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
+*
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License 2.0 which is available at
+* http://www.eclipse.org/legal/epl-2.0
+*
+* SPDX-License-Identifier: EPL-2.0
+*******************************************************************************/
+using BaSyx.Models.Core.AssetAdministrationShell.Generics;
+using BaSyx.Models.Core.AssetAdministrationShell.Generics.SubmodelElementTypes;
+using BaSyx.Models.Core.AssetAdministrationShell.Implementations;
+using BaSyx.Models.Core.AssetAdministrationShell.References;
+using BaSyx.Models.Core.AssetAdministrationShell.Identification;
+using BaSyx.Models.Export.Converter;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using BaSyx.Models.Core.AssetAdministrationShell.Semantics;
+using BaSyx.Models.Core.Common;
+using BaSyx.Models.Core.AssetAdministrationShell.Implementations.SubmodelElementTypes;
+
+namespace BaSyx.Models.Export.EnvironmentSubmodelElements
+{
+ public static class EnvironmentSubmodelElementFactory_V2_0
+ {
+ public static ISubmodelElement ToSubmodelElement(this SubmodelElementType_V2_0 envSubmodelElement, List<IConceptDescription> conceptDescriptions)
+ {
+ if (envSubmodelElement == null)
+ return null;
+
+ ModelType modelType = envSubmodelElement.ModelType;
+
+ if (modelType == null)
+ return null;
+
+ SubmodelElement submodelElement = null;
+
+ if (modelType == ModelType.Property && envSubmodelElement is Property_V2_0 castedProperty)
+ {
+ if (!DataObjectType.TryParse(castedProperty.ValueType, out DataObjectType dataObjectType))
+ return null;
+
+ Property property = new Property(new DataType(dataObjectType))
+ {
+ Value = castedProperty.Value,
+ ValueId = castedProperty.ValueId?.ToReference_V2_0()
+ };
+
+ submodelElement = property;
+ }
+ else if (modelType == ModelType.MultiLanguageProperty && envSubmodelElement is MultiLanguageProperty_V2_0 castedMultiLanguageProperty)
+ {
+ MultiLanguageProperty multiLanguageProperty = new MultiLanguageProperty
+ {
+ Value = castedMultiLanguageProperty.Value,
+ ValueId = castedMultiLanguageProperty.ValueId?.ToReference_V2_0()
+ };
+
+ submodelElement = multiLanguageProperty;
+ }
+ else if (modelType == ModelType.Range && envSubmodelElement is Range_V2_0 castedRange)
+ {
+ if (!DataObjectType.TryParse(castedRange.ValueType, out DataObjectType dataObjectType))
+ return null;
+
+ Range range = new Range()
+ {
+ Min = new ElementValue(castedRange.Min, new DataType(dataObjectType)),
+ Max = new ElementValue(castedRange.Max, new DataType(dataObjectType)),
+ ValueType = new DataType(dataObjectType)
+ };
+
+ submodelElement = range;
+ }
+ else if (modelType == ModelType.File && envSubmodelElement is File_V2_0 castedFile)
+ {
+ File file = new File
+ {
+ MimeType = castedFile.MimeType,
+ Value = castedFile.Value
+ };
+
+ submodelElement = file;
+ }
+ else if (modelType == ModelType.Blob && envSubmodelElement is Blob_V2_0 castedBlob)
+ {
+ Blob blob = new Blob
+ {
+ MimeType = castedBlob.MimeType,
+ Value = Convert.FromBase64String(castedBlob.Value)
+ };
+
+ submodelElement = blob;
+ }
+ else if (modelType == ModelType.RelationshipElement && envSubmodelElement is RelationshipElement_V2_0 castedRelationshipElement)
+ {
+ RelationshipElement relationshipElement = new RelationshipElement
+ {
+ First = castedRelationshipElement.First?.ToReference_V2_0<IReferable>(),
+ Second = castedRelationshipElement.Second?.ToReference_V2_0<IReferable>()
+ };
+
+ submodelElement = relationshipElement;
+ }
+ else if (modelType == ModelType.AnnotatedRelationshipElement && envSubmodelElement is AnnotatedRelationshipElement_V2_0 castedAnnotatedRelationshipElement)
+ {
+ AnnotatedRelationshipElement annotatedRelationshipElement = new AnnotatedRelationshipElement()
+ {
+ First = castedAnnotatedRelationshipElement.First?.ToReference_V2_0<IReferable>(),
+ Second = castedAnnotatedRelationshipElement.Second?.ToReference_V2_0<IReferable>(),
+ Annotation = castedAnnotatedRelationshipElement.Annotation?.ToReference_V2_0<ISubmodelElement>()
+ };
+
+ submodelElement = annotatedRelationshipElement;
+ }
+ else if (modelType == ModelType.ReferenceElement && envSubmodelElement is ReferenceElement_V2_0 castedReferenceElement)
+ {
+ ReferenceElement referenceElement = new ReferenceElement
+ {
+ Value = castedReferenceElement.Value?.ToReference_V2_0()
+ };
+
+ submodelElement = referenceElement;
+ }
+ else if (modelType == ModelType.Event && envSubmodelElement is Event_V2_0 castedEvent)
+ {
+ Event eventable = new Event();
+
+ submodelElement = eventable;
+ }
+ else if (modelType == ModelType.BasicEvent && envSubmodelElement is BasicEvent_V2_0 castedBasicEvent)
+ {
+ BasicEvent basicEvent = new BasicEvent()
+ {
+ Observed = castedBasicEvent.Observed.ToReference_V2_0<IReferable>()
+ };
+
+ submodelElement = basicEvent;
+ }
+ else if (modelType == ModelType.Entity && envSubmodelElement is Entity_V2_0 castedEntity)
+ {
+ Entity entity = new Entity()
+ {
+ EntityType = (EntityType)Enum.Parse(typeof(EntityType), castedEntity.EntityType.ToString()),
+ Asset = castedEntity.AssetReference.ToReference_V2_0<IAsset>()
+ };
+
+ var statements = castedEntity.Statements?.ConvertAll(c => c.submodelElement.ToSubmodelElement(conceptDescriptions));
+ if (statements?.Count > 0)
+ foreach (var element in statements)
+ entity.Statements.Add(element);
+
+ submodelElement = entity;
+ }
+ else if (modelType == ModelType.Operation && envSubmodelElement is Operation_V2_0 castedOperation)
+ {
+ Operation operation = new Operation
+ {
+ InputVariables = new OperationVariableSet(),
+ OutputVariables = new OperationVariableSet(),
+ InOutputVariables = new OperationVariableSet()
+ };
+
+ var operationInElements = castedOperation.InputVariables?.ConvertAll(c => c.Value?.submodelElement?.ToSubmodelElement(conceptDescriptions));
+ if(operationInElements?.Count > 0)
+ foreach (var element in operationInElements)
+ operation.InputVariables.Add(element);
+
+ var operationOutElements = castedOperation.OutputVariables?.ConvertAll(c => c.Value?.submodelElement?.ToSubmodelElement(conceptDescriptions));
+ if (operationOutElements?.Count > 0)
+ foreach (var element in operationOutElements)
+ operation.OutputVariables.Add(element);
+
+ var operationInOutElements = castedOperation.InOutputVariables?.ConvertAll(c => c.Value?.submodelElement?.ToSubmodelElement(conceptDescriptions));
+ if (operationInOutElements?.Count > 0)
+ foreach (var element in operationInOutElements)
+ operation.InOutputVariables.Add(element);
+
+ submodelElement = operation;
+ }
+ else if (modelType == ModelType.SubmodelElementCollection && envSubmodelElement is SubmodelElementCollection_V2_0 castedSubmodelElementCollection)
+ {
+ SubmodelElementCollection submodelElementCollection = new SubmodelElementCollection();
+
+ if (castedSubmodelElementCollection.Value?.Count > 0)
+ {
+ submodelElementCollection.Value = new ElementContainer<ISubmodelElement>();
+ List<ISubmodelElement> smElements = castedSubmodelElementCollection.Value?.ConvertAll(c => c.submodelElement?.ToSubmodelElement(conceptDescriptions));
+ foreach (var smElement in smElements)
+ submodelElementCollection.Value.Add(smElement);
+ }
+
+ submodelElement = submodelElementCollection;
+ }
+
+
+ if (submodelElement == null)
+ return null;
+
+ submodelElement.Category = envSubmodelElement.Category;
+ submodelElement.Description = envSubmodelElement.Description;
+ submodelElement.IdShort = envSubmodelElement.IdShort;
+ submodelElement.Kind = envSubmodelElement.Kind;
+ submodelElement.SemanticId = envSubmodelElement.SemanticId?.ToReference_V2_0();
+ submodelElement.Parent = string.IsNullOrEmpty(envSubmodelElement.Parent) ? null :
+ new Reference(
+ new Key(KeyElements.AssetAdministrationShell, KeyType.IRI, envSubmodelElement.Parent, true));
+ submodelElement.Constraints = null;
+
+ string semanticId = envSubmodelElement.SemanticId?.Keys?.FirstOrDefault()?.Value;
+ if (!string.IsNullOrEmpty(semanticId))
+ {
+ submodelElement.ConceptDescription =
+ conceptDescriptions.Find(f => f.Identification.Id == semanticId);
+ submodelElement.EmbeddedDataSpecifications = submodelElement.ConceptDescription?.EmbeddedDataSpecifications;
+ }
+
+ return submodelElement;
+ }
+
+ public static EnvironmentSubmodelElement_V2_0 ToEnvironmentSubmodelElement_V2_0(this ISubmodelElement element)
+ {
+ if (element == null)
+ return null;
+ ModelType modelType = element.ModelType;
+
+ if (modelType == null)
+ return null;
+
+ EnvironmentSubmodelElement_V2_0 environmentSubmodelElement = new EnvironmentSubmodelElement_V2_0();
+
+ SubmodelElementType_V2_0 submodelElementType = new SubmodelElementType_V2_0()
+ {
+ Category = element.Category,
+ Description = element.Description,
+ IdShort = element.IdShort,
+ Kind = element.Kind,
+ Parent = element.Parent?.First?.Value,
+ Qualifier = null,
+ SemanticId = element.SemanticId?.ToEnvironmentReference_V2_0(),
+ };
+
+ if (modelType == ModelType.Property && element is IProperty castedProperty)
+ environmentSubmodelElement.submodelElement = new Property_V2_0(submodelElementType)
+ {
+ Value = castedProperty.Value?.ToString(),
+ ValueId = castedProperty.ValueId?.ToEnvironmentReference_V2_0(),
+ ValueType = castedProperty.ValueType?.ToString()
+ };
+ else if (modelType == ModelType.MultiLanguageProperty && element is IMultiLanguageProperty castedMultiLanguageProperty)
+ {
+ environmentSubmodelElement.submodelElement = new MultiLanguageProperty_V2_0(submodelElementType)
+ {
+ Value = castedMultiLanguageProperty.Value,
+ ValueId = castedMultiLanguageProperty.ValueId?.ToEnvironmentReference_V2_0()
+ };
+ }
+ else if (modelType == ModelType.Range && element is IRange castedRange)
+ {
+ environmentSubmodelElement.submodelElement = new Range_V2_0(submodelElementType)
+ {
+ Min = castedRange.Min.ToString(),
+ Max = castedRange.Max.ToString(),
+ ValueType = castedRange.ValueType?.DataObjectType?.Name
+ };
+ }
+ else if (modelType == ModelType.Operation && element is IOperation castedOperation)
+ {
+ environmentSubmodelElement.submodelElement = new Operation_V2_0(submodelElementType);
+ List<OperationVariable_V2_0> inputs = new List<OperationVariable_V2_0>();
+ List<OperationVariable_V2_0> outputs = new List<OperationVariable_V2_0>();
+ List<OperationVariable_V2_0> inoutputs = new List<OperationVariable_V2_0>();
+
+ if (castedOperation.InputVariables?.Count > 0)
+ foreach (var inputVar in castedOperation.InputVariables)
+ inputs.Add(new OperationVariable_V2_0() { Value = inputVar.Value.ToEnvironmentSubmodelElement_V2_0() });
+ if (castedOperation.OutputVariables?.Count > 0)
+ foreach (var outputVar in castedOperation.OutputVariables)
+ outputs.Add(new OperationVariable_V2_0() { Value = outputVar.Value.ToEnvironmentSubmodelElement_V2_0() });
+ if (castedOperation.InOutputVariables?.Count > 0)
+ foreach (var inoutputVar in castedOperation.InOutputVariables)
+ inoutputs.Add(new OperationVariable_V2_0() { Value = inoutputVar.Value.ToEnvironmentSubmodelElement_V2_0() });
+
+ (environmentSubmodelElement.submodelElement as Operation_V2_0).InputVariables = inputs;
+ (environmentSubmodelElement.submodelElement as Operation_V2_0).OutputVariables = outputs;
+ (environmentSubmodelElement.submodelElement as Operation_V2_0).InOutputVariables = inoutputs;
+ }
+ else if (modelType == ModelType.Event && element is IEvent castedEvent)
+ environmentSubmodelElement.submodelElement = new Event_V2_0(submodelElementType) { };
+ else if (modelType == ModelType.BasicEvent && element is IBasicEvent castedBasicEvent)
+ {
+ environmentSubmodelElement.submodelElement = new BasicEvent_V2_0(submodelElementType)
+ {
+ Observed = castedBasicEvent.Observed.ToEnvironmentReference_V2_0()
+ };
+ }
+ else if (modelType == ModelType.Entity && element is IEntity castedEntity)
+ {
+ environmentSubmodelElement.submodelElement = new Entity_V2_0(submodelElementType)
+ {
+ EntityType = (EnvironmentEntityType)Enum.Parse(typeof(EnvironmentEntityType), castedEntity.EntityType.ToString()),
+ AssetReference = castedEntity.Asset.ToEnvironmentReference_V2_0()
+ };
+
+ List<EnvironmentSubmodelElement_V2_0> statements = new List<EnvironmentSubmodelElement_V2_0>();
+ if (castedEntity.Statements?.Count > 0)
+ foreach (var smElement in castedEntity.Statements)
+ statements.Add(smElement.ToEnvironmentSubmodelElement_V2_0());
+ (environmentSubmodelElement.submodelElement as Entity_V2_0).Statements = statements;
+ }
+ else if (modelType == ModelType.Blob && element is IBlob castedBlob)
+ environmentSubmodelElement.submodelElement = new Blob_V2_0(submodelElementType)
+ {
+ Value = Convert.ToBase64String(castedBlob.Value),
+ MimeType = castedBlob.MimeType
+ };
+ else if (modelType == ModelType.File && element is IFile castedFile)
+ environmentSubmodelElement.submodelElement = new File_V2_0(submodelElementType)
+ {
+ MimeType = castedFile.MimeType,
+ Value = castedFile.Value
+ };
+ else if (modelType == ModelType.ReferenceElement && element is IReferenceElement castedReferenceElement)
+ environmentSubmodelElement.submodelElement = new ReferenceElement_V2_0(submodelElementType)
+ {
+ Value = castedReferenceElement.Value?.ToEnvironmentReference_V2_0()
+ };
+ else if (modelType == ModelType.RelationshipElement && element is IRelationshipElement castedRelationshipElement)
+ environmentSubmodelElement.submodelElement = new RelationshipElement_V2_0(submodelElementType)
+ {
+ First = castedRelationshipElement.First?.ToEnvironmentReference_V2_0(),
+ Second = castedRelationshipElement.Second?.ToEnvironmentReference_V2_0()
+ };
+ else if (modelType == ModelType.AnnotatedRelationshipElement && element is IAnnotatedRelationshipElement castedAnnotatedRelationshipElement)
+ {
+ environmentSubmodelElement.submodelElement = new AnnotatedRelationshipElement_V2_0(submodelElementType)
+ {
+ First = castedAnnotatedRelationshipElement.First?.ToEnvironmentReference_V2_0(),
+ Second = castedAnnotatedRelationshipElement.Second?.ToEnvironmentReference_V2_0(),
+ Annotation = castedAnnotatedRelationshipElement.Annotation?.ToEnvironmentReference_V2_0()
+ };
+ }
+ else if (modelType == ModelType.SubmodelElementCollection && element is ISubmodelElementCollection castedSubmodelElementCollection)
+ {
+ environmentSubmodelElement.submodelElement = new SubmodelElementCollection_V2_0(submodelElementType);
+ List<EnvironmentSubmodelElement_V2_0> environmentSubmodelElements = new List<EnvironmentSubmodelElement_V2_0>();
+ if (castedSubmodelElementCollection.Value?.Count > 0)
+ foreach (var smElement in castedSubmodelElementCollection.Value)
+ environmentSubmodelElements.Add(smElement.ToEnvironmentSubmodelElement_V2_0());
+ (environmentSubmodelElement.submodelElement as SubmodelElementCollection_V2_0).Value = environmentSubmodelElements;
+ }
+ else
+ return null;
+
+ return environmentSubmodelElement;
+ }
+ }
+}
diff --git a/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v2.0/EnvironmentSubmodelElements/Event_V2_0.cs b/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v2.0/EnvironmentSubmodelElements/Event_V2_0.cs
new file mode 100644
index 0000000..be7ad50
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v2.0/EnvironmentSubmodelElements/Event_V2_0.cs
@@ -0,0 +1,26 @@
+/*******************************************************************************
+* Copyright (c) 2020 Robert Bosch GmbH
+* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
+*
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License 2.0 which is available at
+* http://www.eclipse.org/legal/epl-2.0
+*
+* SPDX-License-Identifier: EPL-2.0
+*******************************************************************************/
+using BaSyx.Models.Core.Common;
+using Newtonsoft.Json;
+using System.Xml.Serialization;
+
+namespace BaSyx.Models.Export
+{
+ public class Event_V2_0 : SubmodelElementType_V2_0
+ {
+ [JsonProperty("modelType")]
+ [XmlIgnore]
+ public override ModelType ModelType => ModelType.Event;
+
+ public Event_V2_0() { }
+ public Event_V2_0(SubmodelElementType_V2_0 submodelElementType) : base(submodelElementType) { }
+ }
+}
diff --git a/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v2.0/EnvironmentSubmodelElements/File_V2_0.cs b/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v2.0/EnvironmentSubmodelElements/File_V2_0.cs
new file mode 100644
index 0000000..0339358
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v2.0/EnvironmentSubmodelElements/File_V2_0.cs
@@ -0,0 +1,34 @@
+/*******************************************************************************
+* Copyright (c) 2020 Robert Bosch GmbH
+* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
+*
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License 2.0 which is available at
+* http://www.eclipse.org/legal/epl-2.0
+*
+* SPDX-License-Identifier: EPL-2.0
+*******************************************************************************/
+using BaSyx.Models.Core.Common;
+using Newtonsoft.Json;
+using System.Xml.Serialization;
+
+namespace BaSyx.Models.Export
+{
+ public class File_V2_0 : SubmodelElementType_V2_0
+ {
+ [JsonProperty("mimeType")]
+ [XmlElement("mimeType")]
+ public string MimeType { get; set; }
+
+ [JsonProperty("value")]
+ [XmlElement("value")]
+ public string Value { get; set; }
+
+ [JsonProperty("modelType")]
+ [XmlIgnore]
+ public override ModelType ModelType => ModelType.File;
+
+ public File_V2_0() { }
+ public File_V2_0(SubmodelElementType_V2_0 submodelElementType) : base(submodelElementType) { }
+ }
+}
diff --git a/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v2.0/EnvironmentSubmodelElements/MultiLanguageProperty_V2_0.cs b/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v2.0/EnvironmentSubmodelElements/MultiLanguageProperty_V2_0.cs
new file mode 100644
index 0000000..49cbd42
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v2.0/EnvironmentSubmodelElements/MultiLanguageProperty_V2_0.cs
@@ -0,0 +1,34 @@
+/*******************************************************************************
+* Copyright (c) 2020 Robert Bosch GmbH
+* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
+*
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License 2.0 which is available at
+* http://www.eclipse.org/legal/epl-2.0
+*
+* SPDX-License-Identifier: EPL-2.0
+*******************************************************************************/
+using BaSyx.Models.Core.Common;
+using Newtonsoft.Json;
+using System.Xml.Serialization;
+
+namespace BaSyx.Models.Export
+{
+ public class MultiLanguageProperty_V2_0 : SubmodelElementType_V2_0
+ {
+ [JsonProperty("value")]
+ [XmlElement("value")]
+ public LangStringSet Value { get; set; }
+
+ [JsonProperty("valueId")]
+ [XmlElement("valueId")]
+ public EnvironmentReference_V2_0 ValueId { get; set; }
+
+ [JsonProperty("modelType")]
+ [XmlIgnore]
+ public override ModelType ModelType => ModelType.MultiLanguageProperty;
+
+ public MultiLanguageProperty_V2_0() { }
+ public MultiLanguageProperty_V2_0(SubmodelElementType_V2_0 submodelElementType) : base(submodelElementType) { }
+ }
+}
diff --git a/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v2.0/EnvironmentSubmodelElements/OperationVariable_V2_0.cs b/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v2.0/EnvironmentSubmodelElements/OperationVariable_V2_0.cs
new file mode 100644
index 0000000..575bacf
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v2.0/EnvironmentSubmodelElements/OperationVariable_V2_0.cs
@@ -0,0 +1,22 @@
+/*******************************************************************************
+* Copyright (c) 2020 Robert Bosch GmbH
+* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
+*
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License 2.0 which is available at
+* http://www.eclipse.org/legal/epl-2.0
+*
+* SPDX-License-Identifier: EPL-2.0
+*******************************************************************************/
+using Newtonsoft.Json;
+using System.Xml.Serialization;
+
+namespace BaSyx.Models.Export
+{
+ public class OperationVariable_V2_0
+ {
+ [JsonProperty("value")]
+ [XmlElement("value")]
+ public EnvironmentSubmodelElement_V2_0 Value { get; set; }
+ }
+}
diff --git a/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v2.0/EnvironmentSubmodelElements/Operation_V2_0.cs b/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v2.0/EnvironmentSubmodelElements/Operation_V2_0.cs
new file mode 100644
index 0000000..500b0b5
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v2.0/EnvironmentSubmodelElements/Operation_V2_0.cs
@@ -0,0 +1,40 @@
+/*******************************************************************************
+* Copyright (c) 2020 Robert Bosch GmbH
+* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
+*
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License 2.0 which is available at
+* http://www.eclipse.org/legal/epl-2.0
+*
+* SPDX-License-Identifier: EPL-2.0
+*******************************************************************************/
+using BaSyx.Models.Core.Common;
+using BaSyx.Models.Export.Converter;
+using Newtonsoft.Json;
+using System.Collections.Generic;
+using System.Xml.Serialization;
+
+namespace BaSyx.Models.Export
+{
+ public class Operation_V2_0 : SubmodelElementType_V2_0
+ {
+ [JsonProperty("inputVariables"), JsonConverter(typeof(JsonOperationVariableConverter_V2_0))]
+ [XmlElement(ElementName = "inputVariable")]
+ public List<OperationVariable_V2_0> InputVariables { get; set; }
+
+ [JsonProperty("outputVariables")]
+ [XmlElement(ElementName = "inputVariable"), JsonConverter(typeof(JsonOperationVariableConverter_V2_0))]
+ public List<OperationVariable_V2_0> OutputVariables { get; set; }
+
+ [JsonProperty("inoutputVariables")]
+ [XmlElement(ElementName = "inoutputVariable"), JsonConverter(typeof(JsonOperationVariableConverter_V2_0))]
+ public List<OperationVariable_V2_0> InOutputVariables { get; set; }
+
+ [JsonProperty("modelType")]
+ [XmlIgnore]
+ public override ModelType ModelType => ModelType.Operation;
+
+ public Operation_V2_0() { }
+ public Operation_V2_0(SubmodelElementType_V2_0 submodelElementType) : base(submodelElementType) { }
+ }
+}
diff --git a/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v2.0/EnvironmentSubmodelElements/Property_V2_0.cs b/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v2.0/EnvironmentSubmodelElements/Property_V2_0.cs
new file mode 100644
index 0000000..4ccbb3a
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v2.0/EnvironmentSubmodelElements/Property_V2_0.cs
@@ -0,0 +1,38 @@
+/*******************************************************************************
+* Copyright (c) 2020 Robert Bosch GmbH
+* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
+*
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License 2.0 which is available at
+* http://www.eclipse.org/legal/epl-2.0
+*
+* SPDX-License-Identifier: EPL-2.0
+*******************************************************************************/
+using BaSyx.Models.Core.Common;
+using Newtonsoft.Json;
+using System.Xml.Serialization;
+
+namespace BaSyx.Models.Export
+{
+ public class Property_V2_0 : SubmodelElementType_V2_0
+ {
+ [JsonProperty("valueType")]
+ [XmlElement("valueType")]
+ public string ValueType { get; set; }
+
+ [JsonProperty("value")]
+ [XmlElement("value")]
+ public string Value { get; set; }
+
+ [JsonProperty("valueId")]
+ [XmlElement("valueId")]
+ public EnvironmentReference_V2_0 ValueId { get; set; }
+
+ [JsonProperty("modelType")]
+ [XmlIgnore]
+ public override ModelType ModelType => ModelType.Property;
+
+ public Property_V2_0() { }
+ public Property_V2_0(SubmodelElementType_V2_0 submodelElementType) : base(submodelElementType) { }
+ }
+}
diff --git a/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v2.0/EnvironmentSubmodelElements/Range_V2_0.cs b/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v2.0/EnvironmentSubmodelElements/Range_V2_0.cs
new file mode 100644
index 0000000..6159d35
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v2.0/EnvironmentSubmodelElements/Range_V2_0.cs
@@ -0,0 +1,38 @@
+/*******************************************************************************
+* Copyright (c) 2020 Robert Bosch GmbH
+* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
+*
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License 2.0 which is available at
+* http://www.eclipse.org/legal/epl-2.0
+*
+* SPDX-License-Identifier: EPL-2.0
+*******************************************************************************/
+using BaSyx.Models.Core.Common;
+using Newtonsoft.Json;
+using System.Xml.Serialization;
+
+namespace BaSyx.Models.Export
+{
+ public class Range_V2_0 : SubmodelElementType_V2_0
+ {
+ [JsonProperty("min")]
+ [XmlElement("min")]
+ public string Min { get; set; }
+
+ [JsonProperty("max")]
+ [XmlElement("max")]
+ public string Max { get; set; }
+
+ [JsonProperty("valueType")]
+ [XmlElement("valueType")]
+ public string ValueType { get; set; }
+
+ [JsonProperty("modelType")]
+ [XmlIgnore]
+ public override ModelType ModelType => ModelType.Range;
+
+ public Range_V2_0() { }
+ public Range_V2_0(SubmodelElementType_V2_0 submodelElementType) : base(submodelElementType) { }
+ }
+}
diff --git a/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v2.0/EnvironmentSubmodelElements/ReferenceElement_V2_0.cs b/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v2.0/EnvironmentSubmodelElements/ReferenceElement_V2_0.cs
new file mode 100644
index 0000000..23f7b8a
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v2.0/EnvironmentSubmodelElements/ReferenceElement_V2_0.cs
@@ -0,0 +1,30 @@
+/*******************************************************************************
+* Copyright (c) 2020 Robert Bosch GmbH
+* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
+*
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License 2.0 which is available at
+* http://www.eclipse.org/legal/epl-2.0
+*
+* SPDX-License-Identifier: EPL-2.0
+*******************************************************************************/
+using BaSyx.Models.Core.Common;
+using Newtonsoft.Json;
+using System.Xml.Serialization;
+
+namespace BaSyx.Models.Export
+{
+ public class ReferenceElement_V2_0 : SubmodelElementType_V2_0
+ {
+ [JsonProperty("value")]
+ [XmlElement("value")]
+ public EnvironmentReference_V2_0 Value { get; set; }
+
+ [JsonProperty("modelType")]
+ [XmlIgnore]
+ public override ModelType ModelType => ModelType.ReferenceElement;
+
+ public ReferenceElement_V2_0() { }
+ public ReferenceElement_V2_0(SubmodelElementType_V2_0 submodelElementType) : base(submodelElementType) { }
+ }
+}
diff --git a/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v2.0/EnvironmentSubmodelElements/RelationshipElement_V2_0.cs b/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v2.0/EnvironmentSubmodelElements/RelationshipElement_V2_0.cs
new file mode 100644
index 0000000..b5c4dfd
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v2.0/EnvironmentSubmodelElements/RelationshipElement_V2_0.cs
@@ -0,0 +1,34 @@
+/*******************************************************************************
+* Copyright (c) 2020 Robert Bosch GmbH
+* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
+*
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License 2.0 which is available at
+* http://www.eclipse.org/legal/epl-2.0
+*
+* SPDX-License-Identifier: EPL-2.0
+*******************************************************************************/
+using BaSyx.Models.Core.Common;
+using Newtonsoft.Json;
+using System.Xml.Serialization;
+
+namespace BaSyx.Models.Export
+{
+ public class RelationshipElement_V2_0 : SubmodelElementType_V2_0
+ {
+ [JsonProperty("first")]
+ [XmlElement("first")]
+ public EnvironmentReference_V2_0 First { get; set; }
+
+ [JsonProperty("second")]
+ [XmlElement("second")]
+ public EnvironmentReference_V2_0 Second { get; set; }
+
+ [JsonProperty("modelType")]
+ [XmlIgnore]
+ public override ModelType ModelType => ModelType.RelationshipElement;
+
+ public RelationshipElement_V2_0() { }
+ public RelationshipElement_V2_0(SubmodelElementType_V2_0 submodelElementType) : base(submodelElementType) { }
+ }
+}
diff --git a/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v2.0/EnvironmentSubmodelElements/SubmodelElementCollection_V2_0.cs b/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v2.0/EnvironmentSubmodelElements/SubmodelElementCollection_V2_0.cs
new file mode 100644
index 0000000..a5020ac
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v2.0/EnvironmentSubmodelElements/SubmodelElementCollection_V2_0.cs
@@ -0,0 +1,41 @@
+/*******************************************************************************
+* Copyright (c) 2020 Robert Bosch GmbH
+* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
+*
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License 2.0 which is available at
+* http://www.eclipse.org/legal/epl-2.0
+*
+* SPDX-License-Identifier: EPL-2.0
+*******************************************************************************/
+using BaSyx.Models.Core.Common;
+using BaSyx.Models.Export.Converter;
+using Newtonsoft.Json;
+using System.Collections.Generic;
+using System.Xml.Serialization;
+
+namespace BaSyx.Models.Export
+{
+ public class SubmodelElementCollection_V2_0 : SubmodelElementType_V2_0, IModelType
+ {
+ [JsonProperty("value"), JsonConverter(typeof(JsonSubmodelElementConverter_V1_0))]
+ [XmlArray("value")]
+ [XmlArrayItem("submodelElement")]
+ public List<EnvironmentSubmodelElement_V2_0> Value { get; set; }
+
+ [JsonProperty("ordered")]
+ [XmlElement("ordered")]
+ public bool Ordered { get; set; }
+
+ [JsonProperty("allowDuplicates")]
+ [XmlElement("allowDuplicates")]
+ public bool AllowDuplicates { get; set; }
+
+ [JsonProperty("modelType")]
+ [XmlIgnore]
+ public override ModelType ModelType => ModelType.SubmodelElementCollection;
+
+ public SubmodelElementCollection_V2_0() { }
+ public SubmodelElementCollection_V2_0(SubmodelElementType_V2_0 submodelElementType) : base(submodelElementType) { }
+ }
+}
diff --git a/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v2.0/EnvironmentSubmodel_V2_0.cs b/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v2.0/EnvironmentSubmodel_V2_0.cs
new file mode 100644
index 0000000..3427a75
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.Models.Export/aas-spec-v2.0/EnvironmentSubmodel_V2_0.cs
@@ -0,0 +1,44 @@
+/*******************************************************************************
+* Copyright (c) 2020 Robert Bosch GmbH
+* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
+*
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License 2.0 which is available at
+* http://www.eclipse.org/legal/epl-2.0
+*
+* SPDX-License-Identifier: EPL-2.0
+*******************************************************************************/
+using BaSyx.Models.Core.AssetAdministrationShell.Enums;
+using BaSyx.Models.Core.Common;
+using BaSyx.Models.Export.Converter;
+using Newtonsoft.Json;
+using System.Collections.Generic;
+using System.Xml.Serialization;
+
+namespace BaSyx.Models.Export
+{
+ public class EnvironmentSubmodel_V2_0 : EnvironmentIdentifiable_V2_0, IModelType
+ {
+ [JsonProperty("semanticId")]
+ [XmlElement("semanticId")]
+ public EnvironmentReference_V2_0 SemanticId { get; set; }
+
+ [JsonProperty("kind")]
+ [XmlElement("kind")]
+ public ModelingKind Kind { get; set; }
+
+ [JsonProperty("constraints")]
+ [XmlArray("qualifier")]
+ [XmlArrayItem("qualifier")]
+ public List<EnvironmentQualifier_V2_0> Qualifier { get; set; }
+
+ [JsonProperty("submodelElements"), JsonConverter(typeof(JsonSubmodelElementConverter_V2_0))]
+ [XmlArray("submodelElements")]
+ [XmlArrayItem("submodelElement")]
+ public List<EnvironmentSubmodelElement_V2_0> SubmodelElements { get; set; }
+
+ [JsonProperty("modelType")]
+ [XmlIgnore]
+ public ModelType ModelType => ModelType.Submodel;
+ }
+}
diff --git a/sdks/dotnet/basyx-core/BaSyx.Models.Export/basyxlogo.png b/sdks/dotnet/basyx-core/BaSyx.Models.Export/basyxlogo.png
new file mode 100644
index 0000000..226a4ff
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.Models.Export/basyxlogo.png
Binary files differ
diff --git a/sdks/dotnet/basyx-core/BaSyx.Models/BaSyx.Models.csproj b/sdks/dotnet/basyx-core/BaSyx.Models/BaSyx.Models.csproj
new file mode 100644
index 0000000..aedc699
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.Models/BaSyx.Models.csproj
@@ -0,0 +1,48 @@
+<Project Sdk="Microsoft.NET.Sdk">
+
+ <PropertyGroup>
+ <TargetFramework>netstandard2.0</TargetFramework>
+ <OutputType>Library</OutputType>
+ <Configurations>Debug;Release</Configurations>
+ <RunPostBuildEvent>OnOutputUpdated</RunPostBuildEvent>
+ <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
+ <Authors>Constantin Ziesche</Authors>
+ <Copyright>Copyright 2019 - Robert Bosch GmbH</Copyright>
+ <PackageProjectUrl>https://wiki.eclipse.org/BaSyx</PackageProjectUrl>
+ <RepositoryUrl>https://git.eclipse.org/r/plugins/gitiles/basyx/basyx/+/master/sdks/csnet/</RepositoryUrl>
+ <PackageLicenseUrl></PackageLicenseUrl>
+ <Description>The official BaSyx Collection of Information Model Classes</Description>
+ <Company>Robert Bosch GmbH</Company>
+ <PackageTags>BaSys BaSyx Models</PackageTags>
+ <PackageLicenseExpression>EPL-2.0</PackageLicenseExpression>
+ <PackageIcon>basyxlogo.png</PackageIcon>
+ </PropertyGroup>
+
+ <ItemGroup>
+ <None Remove="AAS.xsd" />
+ <None Remove="AAS_ABAC.xsd" />
+ <None Remove="IEC61360.xsd" />
+ </ItemGroup>
+
+ <ItemGroup>
+ <None Include="basyxlogo.png" Pack="true" PackagePath="\" />
+ </ItemGroup>
+
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugType>Full</DebugType>
+ </PropertyGroup>
+
+ <ItemGroup>
+ <PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="2.2.0" />
+ <PackageReference Include="System.IO.Packaging" Version="4.7.0" />
+ </ItemGroup>
+
+ <ItemGroup>
+ <ProjectReference Include="..\BaSyx.Utils\BaSyx.Utils.csproj" />
+ </ItemGroup>
+
+ <Target Name="PostBuild" AfterTargets="PostBuildEvent">
+ <Exec Command="IF EXIST %25BASYX_REPO%25 ( dotnet pack "$(ProjectPath)" --no-build --include-source --include-symbols --output "%25BASYX_REPO%25" ) ELSE ( ECHO BASYX_REPO Environment Variable not found)" />
+ </Target>
+
+</Project>
diff --git a/sdks/dotnet/basyx-core/BaSyx.Models/Connectivity/Descriptors/AssetAdministrationShellAggregatorDescriptor.cs b/sdks/dotnet/basyx-core/BaSyx.Models/Connectivity/Descriptors/AssetAdministrationShellAggregatorDescriptor.cs
new file mode 100644
index 0000000..e08b6c5
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.Models/Connectivity/Descriptors/AssetAdministrationShellAggregatorDescriptor.cs
@@ -0,0 +1,81 @@
+/*******************************************************************************
+* Copyright (c) 2020 Robert Bosch GmbH
+* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
+*
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License 2.0 which is available at
+* http://www.eclipse.org/legal/epl-2.0
+*
+* SPDX-License-Identifier: EPL-2.0
+*******************************************************************************/
+using BaSyx.Models.Core.AssetAdministrationShell.Generics;
+using BaSyx.Models.Core.AssetAdministrationShell.References;
+using BaSyx.Models.Core.AssetAdministrationShell.Identification;
+using Newtonsoft.Json;
+using System.Collections.Generic;
+using System.Runtime.Serialization;
+using BaSyx.Models.Core.Common;
+using System.Linq;
+using System.Collections;
+
+namespace BaSyx.Models.Connectivity.Descriptors
+{
+ [DataContract]
+ public class AssetAdministrationShellAggregatorDescriptor : IAssetAdministrationShellAggregatorDescriptor
+ {
+ [IgnoreDataMember]
+ public Identifier Identification { get; set; }
+ [IgnoreDataMember]
+ public AdministrativeInformation Administration { get; set; }
+ [IgnoreDataMember]
+ public string IdShort { get; set; }
+ [IgnoreDataMember]
+ public LangStringSet Description { get; set; }
+ public IEnumerable<IEndpoint> Endpoints { get; internal set; }
+
+ [IgnoreDataMember]
+ public IReference Parent => null;
+ [IgnoreDataMember]
+ public string Category => null;
+
+ public ModelType ModelType => ModelType.AssetAdministrationShellAggregatorDescriptor;
+
+ public IElementContainer<IAssetAdministrationShellDescriptor> AssetAdministrationShellDescriptors { get; set; }
+
+ public AssetAdministrationShellAggregatorDescriptor(IEnumerable<IEndpoint> endpoints)
+ {
+ Endpoints = endpoints ?? new List<IEndpoint>();
+ AssetAdministrationShellDescriptors = new ElementContainer<IAssetAdministrationShellDescriptor>();
+ }
+
+ [JsonConstructor]
+ public AssetAdministrationShellAggregatorDescriptor(IEnumerable<IAssetAdministrationShell> shells, IEnumerable<IEndpoint> endpoints) : this(endpoints)
+ {
+ if (shells?.Count() > 0)
+ foreach (var shell in shells)
+ {
+ AddAssetAdministrationShell(shell);
+ }
+ }
+
+ public void AddAssetAdministrationShell(IAssetAdministrationShell aas)
+ {
+ AssetAdministrationShellDescriptor assetAdministrationShellDescriptor = new AssetAdministrationShellDescriptor(aas, Endpoints.ToList());
+ if (aas.Submodels?.Count > 0)
+ foreach (var submodel in aas.Submodels)
+ {
+ assetAdministrationShellDescriptor.SubmodelDescriptors.Create(new SubmodelDescriptor(submodel, Endpoints.ToList()));
+ }
+
+ AssetAdministrationShellDescriptors.Create(assetAdministrationShellDescriptor);
+ }
+
+ public void AddEndpoints(IEnumerable<IEndpoint> endpoints)
+ {
+ foreach (var endpoint in endpoints)
+ {
+ (Endpoints as IList).Add(endpoint);
+ }
+ }
+ }
+}
diff --git a/sdks/dotnet/basyx-core/BaSyx.Models/Connectivity/Descriptors/AssetAdministrationShellDescriptor.cs b/sdks/dotnet/basyx-core/BaSyx.Models/Connectivity/Descriptors/AssetAdministrationShellDescriptor.cs
new file mode 100644
index 0000000..faaa8fd
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.Models/Connectivity/Descriptors/AssetAdministrationShellDescriptor.cs
@@ -0,0 +1,72 @@
+/*******************************************************************************
+* Copyright (c) 2020 Robert Bosch GmbH
+* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
+*
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License 2.0 which is available at
+* http://www.eclipse.org/legal/epl-2.0
+*
+* SPDX-License-Identifier: EPL-2.0
+*******************************************************************************/
+using BaSyx.Models.Core.AssetAdministrationShell.Generics;
+using BaSyx.Models.Core.AssetAdministrationShell.References;
+using BaSyx.Models.Core.AssetAdministrationShell.Identification;
+using Newtonsoft.Json;
+using System.Collections.Generic;
+using System.Runtime.Serialization;
+using BaSyx.Models.Core.Common;
+using System.Collections;
+using System.Linq;
+
+namespace BaSyx.Models.Connectivity.Descriptors
+{
+ [DataContract]
+ public class AssetAdministrationShellDescriptor : IAssetAdministrationShellDescriptor
+ {
+ public Identifier Identification { get; set; }
+ public AdministrativeInformation Administration { get; set; }
+ public string IdShort { get; set; }
+ public LangStringSet Description { get; set; }
+ public IEnumerable<IEndpoint> Endpoints { get; internal set; }
+
+ [IgnoreDataMember]
+ public IReference Parent => null;
+ [IgnoreDataMember]
+ public string Category => null;
+
+ public ModelType ModelType => ModelType.AssetAdministrationShellDescriptor;
+
+ public IAsset Asset { get; set; }
+ public IElementContainer<ISubmodelDescriptor> SubmodelDescriptors { get; set; }
+
+ [JsonConstructor]
+ public AssetAdministrationShellDescriptor(IEnumerable<IEndpoint> endpoints)
+ {
+ Endpoints = endpoints ?? new List<IEndpoint>();
+ SubmodelDescriptors = new ElementContainer<ISubmodelDescriptor>();
+ }
+
+ public AssetAdministrationShellDescriptor(IAssetAdministrationShell aas, IEnumerable<IEndpoint> endpoints) : this(endpoints)
+ {
+ this.Identification = aas.Identification;
+ this.Administration = aas.Administration;
+ this.IdShort = aas.IdShort;
+ this.Description = aas.Description;
+ this.Asset = aas.Asset;
+ }
+
+ public void AddSubmodel(ISubmodel submodel)
+ {
+ SubmodelDescriptors.Create(
+ new SubmodelDescriptor(submodel, Endpoints.ToList()));
+ }
+
+ public void AddEndpoints(IEnumerable<IEndpoint> endpoints)
+ {
+ foreach (var endpoint in endpoints)
+ {
+ (Endpoints as IList).Add(endpoint);
+ }
+ }
+ }
+}
diff --git a/sdks/dotnet/basyx-core/BaSyx.Models/Connectivity/Descriptors/IAssetAdministrationShellAggregatorDescriptor.cs b/sdks/dotnet/basyx-core/BaSyx.Models/Connectivity/Descriptors/IAssetAdministrationShellAggregatorDescriptor.cs
new file mode 100644
index 0000000..995c13d
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.Models/Connectivity/Descriptors/IAssetAdministrationShellAggregatorDescriptor.cs
@@ -0,0 +1,21 @@
+/*******************************************************************************
+* Copyright (c) 2020 Robert Bosch GmbH
+* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
+*
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License 2.0 which is available at
+* http://www.eclipse.org/legal/epl-2.0
+*
+* SPDX-License-Identifier: EPL-2.0
+*******************************************************************************/
+using BaSyx.Models.Core.Common;
+using System.Runtime.Serialization;
+
+namespace BaSyx.Models.Connectivity.Descriptors
+{
+ public interface IAssetAdministrationShellAggregatorDescriptor : IServiceDescriptor, IModelElement
+ {
+ [DataMember(EmitDefaultValue = false, IsRequired = false, Name = "assetAdministrationShellDescriptors")]
+ IElementContainer<IAssetAdministrationShellDescriptor> AssetAdministrationShellDescriptors { get; set; }
+ }
+}
diff --git a/sdks/dotnet/basyx-core/BaSyx.Models/Connectivity/Descriptors/IAssetAdministrationShellDescriptor.cs b/sdks/dotnet/basyx-core/BaSyx.Models/Connectivity/Descriptors/IAssetAdministrationShellDescriptor.cs
new file mode 100644
index 0000000..ce70dce
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.Models/Connectivity/Descriptors/IAssetAdministrationShellDescriptor.cs
@@ -0,0 +1,24 @@
+/*******************************************************************************
+* Copyright (c) 2020 Robert Bosch GmbH
+* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
+*
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License 2.0 which is available at
+* http://www.eclipse.org/legal/epl-2.0
+*
+* SPDX-License-Identifier: EPL-2.0
+*******************************************************************************/
+using BaSyx.Models.Core.AssetAdministrationShell.Generics;
+using BaSyx.Models.Core.Common;
+using System.Runtime.Serialization;
+
+namespace BaSyx.Models.Connectivity.Descriptors
+{
+ public interface IAssetAdministrationShellDescriptor : IServiceDescriptor, IModelElement
+ {
+ [DataMember(EmitDefaultValue = false, IsRequired = false, Name = "asset")]
+ IAsset Asset { get; set; }
+ [DataMember(EmitDefaultValue = false, IsRequired = false, Name = "submodels")]
+ IElementContainer<ISubmodelDescriptor> SubmodelDescriptors { get; set; }
+ }
+}
diff --git a/sdks/dotnet/basyx-core/BaSyx.Models/Connectivity/Descriptors/ISubmodelDescriptor.cs b/sdks/dotnet/basyx-core/BaSyx.Models/Connectivity/Descriptors/ISubmodelDescriptor.cs
new file mode 100644
index 0000000..9b333ec
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.Models/Connectivity/Descriptors/ISubmodelDescriptor.cs
@@ -0,0 +1,18 @@
+/*******************************************************************************
+* Copyright (c) 2020 Robert Bosch GmbH
+* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
+*
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License 2.0 which is available at
+* http://www.eclipse.org/legal/epl-2.0
+*
+* SPDX-License-Identifier: EPL-2.0
+*******************************************************************************/
+using BaSyx.Models.Core.AssetAdministrationShell.Semantics;
+using BaSyx.Models.Core.Common;
+
+namespace BaSyx.Models.Connectivity.Descriptors
+{
+ public interface ISubmodelDescriptor : IServiceDescriptor, IHasSemantics, IModelElement
+ { }
+}
diff --git a/sdks/dotnet/basyx-core/BaSyx.Models/Connectivity/Descriptors/SubmodelDescriptor.cs b/sdks/dotnet/basyx-core/BaSyx.Models/Connectivity/Descriptors/SubmodelDescriptor.cs
new file mode 100644
index 0000000..5572862
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.Models/Connectivity/Descriptors/SubmodelDescriptor.cs
@@ -0,0 +1,68 @@
+/*******************************************************************************
+* Copyright (c) 2020 Robert Bosch GmbH
+* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
+*
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License 2.0 which is available at
+* http://www.eclipse.org/legal/epl-2.0
+*
+* SPDX-License-Identifier: EPL-2.0
+*******************************************************************************/
+using BaSyx.Models.Core.AssetAdministrationShell.Generics;
+using BaSyx.Models.Core.AssetAdministrationShell.References;
+using BaSyx.Models.Core.AssetAdministrationShell.Identification;
+using Newtonsoft.Json;
+using System.Collections;
+using System.Collections.Generic;
+using System.Runtime.Serialization;
+using BaSyx.Models.Core.Common;
+
+namespace BaSyx.Models.Connectivity.Descriptors
+{
+
+ [DataContract]
+ public class SubmodelDescriptor : ISubmodelDescriptor
+ {
+ public Identifier Identification { get; set; }
+ public AdministrativeInformation Administration { get; set; }
+ public string IdShort { get; set; }
+
+ public LangStringSet Description { get; set; }
+ public IReference SemanticId { get; set; }
+ public IEnumerable<IEndpoint> Endpoints { get; private set; }
+
+ [IgnoreDataMember]
+ public IReference Parent => null;
+ [IgnoreDataMember]
+ public string Category => null;
+
+ public ModelType ModelType => ModelType.SubmodelDescriptor;
+
+ [JsonConstructor]
+ public SubmodelDescriptor(string idShort, IEnumerable<IEndpoint> endpoints)
+ {
+ IdShort = idShort;
+ Endpoints = endpoints ?? new List<IEndpoint>();
+ }
+
+ public SubmodelDescriptor(ISubmodel submodel, IEnumerable<IEndpoint> endpoints) : this(submodel.IdShort, endpoints)
+ {
+ if (submodel == null)
+ return;
+
+ Identification = submodel.Identification;
+ Administration = submodel.Administration;
+ IdShort = submodel.IdShort;
+ Description = submodel.Description;
+ SemanticId = submodel.SemanticId;
+ }
+
+ public void AddEndpoints(IEnumerable<IEndpoint> endpoints)
+ {
+ foreach (var endpoint in endpoints)
+ {
+ (Endpoints as IList).Add(endpoint);
+ }
+ }
+ }
+}
diff --git a/sdks/dotnet/basyx-core/BaSyx.Models/Connectivity/Endpoints/EndpointConverter.cs b/sdks/dotnet/basyx-core/BaSyx.Models/Connectivity/Endpoints/EndpointConverter.cs
new file mode 100644
index 0000000..83b0163
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.Models/Connectivity/Endpoints/EndpointConverter.cs
@@ -0,0 +1,54 @@
+/*******************************************************************************
+* Copyright (c) 2020 Robert Bosch GmbH
+* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
+*
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License 2.0 which is available at
+* http://www.eclipse.org/legal/epl-2.0
+*
+* SPDX-License-Identifier: EPL-2.0
+*******************************************************************************/
+using Newtonsoft.Json;
+using Newtonsoft.Json.Linq;
+using System;
+
+namespace BaSyx.Models.Connectivity
+{
+ public class EndpointConverter : JsonConverter<IEndpoint>
+ {
+ public override bool CanWrite => false;
+ public override bool CanRead => true;
+
+ public override IEndpoint ReadJson(JsonReader reader, Type objectType, IEndpoint existingValue, bool hasExistingValue, JsonSerializer serializer)
+ {
+ JObject jObject;
+
+ try
+ {
+ jObject = JObject.Load(reader);
+ }
+ catch (Exception)
+ {
+ return null;
+ }
+
+ var endpointType = jObject.SelectToken("type")?.ToObject<string>();
+ var address = jObject.SelectToken("address")?.ToObject<string>();
+
+
+ IEndpoint endpoint = null;
+ if (!string.IsNullOrEmpty(endpointType) && !string.IsNullOrEmpty(address))
+ {
+ endpoint = EndpointFactory.CreateEndpoint(endpointType, address, null);
+ serializer.Populate(jObject.CreateReader(), endpoint);
+ }
+
+ return endpoint;
+ }
+
+ public override void WriteJson(JsonWriter writer, IEndpoint value, JsonSerializer serializer)
+ {
+ throw new NotImplementedException();
+ }
+ }
+}
diff --git a/sdks/dotnet/basyx-core/BaSyx.Models/Connectivity/Endpoints/EndpointFactory.cs b/sdks/dotnet/basyx-core/BaSyx.Models/Connectivity/Endpoints/EndpointFactory.cs
new file mode 100644
index 0000000..a1b73d8
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.Models/Connectivity/Endpoints/EndpointFactory.cs
@@ -0,0 +1,36 @@
+/*******************************************************************************
+* Copyright (c) 2020 Robert Bosch GmbH
+* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
+*
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License 2.0 which is available at
+* http://www.eclipse.org/legal/epl-2.0
+*
+* SPDX-License-Identifier: EPL-2.0
+*******************************************************************************/
+using System;
+
+namespace BaSyx.Models.Connectivity
+{
+ public static partial class EndpointFactory
+ {
+ public static IEndpoint CreateEndpoint(string endpointType, string address, IEndpointSecurity security)
+ {
+ switch (endpointType.ToLower())
+ {
+ case EndpointType.HTTP: return new HttpEndpoint(address);
+ case EndpointType.MQTT:
+ {
+ Uri uri = new Uri(address);
+ var brokerUri = uri.AbsoluteUri;
+ var topic = uri.AbsolutePath;
+
+ return new MqttEndpoint(brokerUri, topic);
+ }
+ case EndpointType.OPC_UA: return new OpcUaEndpoint(address);
+ default:
+ return null;
+ }
+ }
+ }
+}
diff --git a/sdks/dotnet/basyx-core/BaSyx.Models/Connectivity/Endpoints/EndpointType.cs b/sdks/dotnet/basyx-core/BaSyx.Models/Connectivity/Endpoints/EndpointType.cs
new file mode 100644
index 0000000..7c85742
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.Models/Connectivity/Endpoints/EndpointType.cs
@@ -0,0 +1,23 @@
+/*******************************************************************************
+* Copyright (c) 2020 Robert Bosch GmbH
+* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
+*
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License 2.0 which is available at
+* http://www.eclipse.org/legal/epl-2.0
+*
+* SPDX-License-Identifier: EPL-2.0
+*******************************************************************************/
+namespace BaSyx.Models.Connectivity
+{
+ public static class EndpointType
+ {
+ public const string HTTP = "http";
+ public const string TCP = "tcp";
+ public const string MQTT = "mqtt";
+ public const string OPC_UA = "opc-ua";
+ public const string COAP = "coap";
+ public const string WEBSOCKET = "websocket";
+ }
+}
+
diff --git a/sdks/dotnet/basyx-core/BaSyx.Models/Connectivity/Endpoints/HttpEndpoint.cs b/sdks/dotnet/basyx-core/BaSyx.Models/Connectivity/Endpoints/HttpEndpoint.cs
new file mode 100644
index 0000000..9ec3903
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.Models/Connectivity/Endpoints/HttpEndpoint.cs
@@ -0,0 +1,38 @@
+/*******************************************************************************
+* Copyright (c) 2020 Robert Bosch GmbH
+* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
+*
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License 2.0 which is available at
+* http://www.eclipse.org/legal/epl-2.0
+*
+* SPDX-License-Identifier: EPL-2.0
+*******************************************************************************/
+using Newtonsoft.Json;
+using System;
+using System.Runtime.Serialization;
+
+namespace BaSyx.Models.Connectivity
+{
+ public class HttpEndpoint : IEndpoint
+ {
+ public string Address { get; }
+
+ [IgnoreDataMember]
+ public Uri Url { get; }
+
+ public string Type => EndpointType.HTTP;
+
+ public IEndpointSecurity Security { get; set;}
+
+ [JsonConstructor]
+ public HttpEndpoint(string address)
+ {
+ address = address ?? throw new ArgumentNullException("url");
+ Url = new Uri(address);
+ Address = Url.ToString();
+ }
+
+
+ }
+}
diff --git a/sdks/dotnet/basyx-core/BaSyx.Models/Connectivity/Endpoints/IAddressable.cs b/sdks/dotnet/basyx-core/BaSyx.Models/Connectivity/Endpoints/IAddressable.cs
new file mode 100644
index 0000000..f333fa7
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.Models/Connectivity/Endpoints/IAddressable.cs
@@ -0,0 +1,22 @@
+/*******************************************************************************
+* Copyright (c) 2020 Robert Bosch GmbH
+* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
+*
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License 2.0 which is available at
+* http://www.eclipse.org/legal/epl-2.0
+*
+* SPDX-License-Identifier: EPL-2.0
+*******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Runtime.Serialization;
+
+namespace BaSyx.Models.Connectivity
+{
+ public interface IAddressable
+ {
+ [DataMember(EmitDefaultValue = false, IsRequired = false, Name = "endpoints")]
+ IEnumerable<IEndpoint> Endpoints { get; }
+ }
+}
diff --git a/sdks/dotnet/basyx-core/BaSyx.Models/Connectivity/Endpoints/IEndpoint.cs b/sdks/dotnet/basyx-core/BaSyx.Models/Connectivity/Endpoints/IEndpoint.cs
new file mode 100644
index 0000000..68d92b2
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.Models/Connectivity/Endpoints/IEndpoint.cs
@@ -0,0 +1,26 @@
+/*******************************************************************************
+* Copyright (c) 2020 Robert Bosch GmbH
+* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
+*
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License 2.0 which is available at
+* http://www.eclipse.org/legal/epl-2.0
+*
+* SPDX-License-Identifier: EPL-2.0
+*******************************************************************************/
+using Newtonsoft.Json;
+using System.Runtime.Serialization;
+
+namespace BaSyx.Models.Connectivity
+{
+ [JsonConverter(typeof(EndpointConverter))]
+ public interface IEndpoint
+ {
+ [DataMember(EmitDefaultValue = false, IsRequired = false, Name = "address")]
+ string Address { get; }
+ [DataMember(EmitDefaultValue = false, IsRequired = false, Name = "type")]
+ string Type { get; }
+ [DataMember(EmitDefaultValue = false, IsRequired = false, Name = "security")]
+ IEndpointSecurity Security { get; }
+ }
+}
diff --git a/sdks/dotnet/basyx-core/BaSyx.Models/Connectivity/Endpoints/IEndpointSecurity.cs b/sdks/dotnet/basyx-core/BaSyx.Models/Connectivity/Endpoints/IEndpointSecurity.cs
new file mode 100644
index 0000000..3583b1f
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.Models/Connectivity/Endpoints/IEndpointSecurity.cs
@@ -0,0 +1,17 @@
+/*******************************************************************************
+* Copyright (c) 2020 Robert Bosch GmbH
+* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
+*
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License 2.0 which is available at
+* http://www.eclipse.org/legal/epl-2.0
+*
+* SPDX-License-Identifier: EPL-2.0
+*******************************************************************************/
+namespace BaSyx.Models.Connectivity
+{
+ public interface IEndpointSecurity
+ {
+
+ }
+}
diff --git a/sdks/dotnet/basyx-core/BaSyx.Models/Connectivity/Endpoints/IServiceDescriptor.cs b/sdks/dotnet/basyx-core/BaSyx.Models/Connectivity/Endpoints/IServiceDescriptor.cs
new file mode 100644
index 0000000..fd8470b
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.Models/Connectivity/Endpoints/IServiceDescriptor.cs
@@ -0,0 +1,20 @@
+/*******************************************************************************
+* Copyright (c) 2020 Robert Bosch GmbH
+* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
+*
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License 2.0 which is available at
+* http://www.eclipse.org/legal/epl-2.0
+*
+* SPDX-License-Identifier: EPL-2.0
+*******************************************************************************/
+using BaSyx.Models.Core.AssetAdministrationShell.Identification;
+using System.Collections.Generic;
+
+namespace BaSyx.Models.Connectivity
+{
+ public interface IServiceDescriptor : IAddressable, IIdentifiable
+ {
+ void AddEndpoints(IEnumerable<IEndpoint> endpoints);
+ }
+}
diff --git a/sdks/dotnet/basyx-core/BaSyx.Models/Connectivity/Endpoints/MqttEndpoint.cs b/sdks/dotnet/basyx-core/BaSyx.Models/Connectivity/Endpoints/MqttEndpoint.cs
new file mode 100644
index 0000000..5b53169
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.Models/Connectivity/Endpoints/MqttEndpoint.cs
@@ -0,0 +1,35 @@
+/*******************************************************************************
+* Copyright (c) 2020 Robert Bosch GmbH
+* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
+*
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License 2.0 which is available at
+* http://www.eclipse.org/legal/epl-2.0
+*
+* SPDX-License-Identifier: EPL-2.0
+*******************************************************************************/
+using System;
+
+namespace BaSyx.Models.Connectivity
+{
+ public class MqttEndpoint : IEndpoint
+ {
+ public string Address { get; }
+
+ public Uri BrokerUri { get; }
+
+ public string Topic { get; }
+
+ public string Type => EndpointType.MQTT;
+
+ public IEndpointSecurity Security { get; set; }
+
+ public MqttEndpoint(string brokerUri, string topic)
+ {
+ brokerUri = brokerUri ?? throw new ArgumentNullException("url");
+ BrokerUri = new Uri(brokerUri);
+ Topic = topic ?? "/";
+ Address = brokerUri + topic;
+ }
+ }
+}
diff --git a/sdks/dotnet/basyx-core/BaSyx.Models/Connectivity/Endpoints/OpcUaEndpoint.cs b/sdks/dotnet/basyx-core/BaSyx.Models/Connectivity/Endpoints/OpcUaEndpoint.cs
new file mode 100644
index 0000000..1ce277a
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.Models/Connectivity/Endpoints/OpcUaEndpoint.cs
@@ -0,0 +1,41 @@
+/*******************************************************************************
+* Copyright (c) 2020 Robert Bosch GmbH
+* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
+*
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License 2.0 which is available at
+* http://www.eclipse.org/legal/epl-2.0
+*
+* SPDX-License-Identifier: EPL-2.0
+*******************************************************************************/
+using Newtonsoft.Json;
+using System;
+using System.Collections.Generic;
+using System.Runtime.Serialization;
+using System.Text;
+
+namespace BaSyx.Models.Connectivity
+{
+ public class OpcUaEndpoint : IEndpoint
+ {
+ public string Address { get; }
+
+ [IgnoreDataMember]
+ public string BrowsePath { get; }
+ [IgnoreDataMember]
+ public string Authority { get; }
+ public string Type => EndpointType.OPC_UA;
+
+ public IEndpointSecurity Security { get; set; }
+
+ [JsonConstructor]
+ public OpcUaEndpoint(string address)
+ {
+ Address = address ?? throw new ArgumentNullException("address");
+ var uri = new Uri(address);
+ BrowsePath = uri.AbsolutePath;
+ Authority = uri.Authority;
+ }
+
+ }
+}
diff --git a/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Constraints/Constraint.cs b/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Constraints/Constraint.cs
new file mode 100644
index 0000000..9c97791
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Constraints/Constraint.cs
@@ -0,0 +1,25 @@
+/*******************************************************************************
+* Copyright (c) 2020 Robert Bosch GmbH
+* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
+*
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License 2.0 which is available at
+* http://www.eclipse.org/legal/epl-2.0
+*
+* SPDX-License-Identifier: EPL-2.0
+*******************************************************************************/
+using BaSyx.Models.Core.AssetAdministrationShell.Identification;
+using BaSyx.Models.Core.Common;
+using Newtonsoft.Json;
+
+namespace BaSyx.Models.Core.AssetAdministrationShell.Constraints
+{
+ [JsonConverter(typeof(ConstraintConverter))]
+ public interface IConstraint : IModelElement
+ { }
+
+ public abstract class Constraint : IConstraint
+ {
+ public abstract ModelType ModelType { get; }
+ }
+}
diff --git a/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Constraints/ConstraintConverter.cs b/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Constraints/ConstraintConverter.cs
new file mode 100644
index 0000000..0e3262b
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Constraints/ConstraintConverter.cs
@@ -0,0 +1,62 @@
+/*******************************************************************************
+* Copyright (c) 2020 Robert Bosch GmbH
+* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
+*
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License 2.0 which is available at
+* http://www.eclipse.org/legal/epl-2.0
+*
+* SPDX-License-Identifier: EPL-2.0
+*******************************************************************************/
+using BaSyx.Models.Core.Common;
+using Newtonsoft.Json;
+using Newtonsoft.Json.Linq;
+using System;
+
+namespace BaSyx.Models.Core.AssetAdministrationShell.Constraints
+{
+ public class ConstraintConverter : JsonConverter<IConstraint>
+ {
+ public override bool CanWrite => false;
+ public override bool CanRead => true;
+
+ public override IConstraint ReadJson(JsonReader reader, Type objectType, IConstraint existingValue, bool hasExistingValue, JsonSerializer serializer)
+ {
+ JObject jObject;
+
+ try
+ {
+ jObject = JObject.Load(reader);
+ }
+ catch (Exception)
+ {
+ return null;
+ }
+
+ var modelTypeToken = jObject.SelectToken("modelType")?.ToObject<ModelType>();
+
+ IConstraint constraint;
+
+ if (modelTypeToken != null)
+ {
+ if (modelTypeToken == ModelType.Qualifier)
+ constraint = new Qualifier();
+ else if (modelTypeToken == ModelType.Formula)
+ constraint = new Formula();
+ else
+ return null;
+ }
+ else
+ return null;
+
+ serializer.Populate(jObject.CreateReader(), constraint);
+
+ return constraint;
+ }
+
+ public override void WriteJson(JsonWriter writer, IConstraint value, JsonSerializer serializer)
+ {
+ throw new NotImplementedException();
+ }
+ }
+}
diff --git a/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Constraints/ExpressionLogic.cs b/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Constraints/ExpressionLogic.cs
new file mode 100644
index 0000000..b40add1
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Constraints/ExpressionLogic.cs
@@ -0,0 +1,26 @@
+/*******************************************************************************
+* Copyright (c) 2020 Robert Bosch GmbH
+* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
+*
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License 2.0 which is available at
+* http://www.eclipse.org/legal/epl-2.0
+*
+* SPDX-License-Identifier: EPL-2.0
+*******************************************************************************/
+using System.Runtime.Serialization;
+
+namespace BaSyx.Models.Core.AssetAdministrationShell.Constraints
+{
+ [DataContract]
+ public enum ExpressionLogic : int
+ {
+ None = 0,
+ Equal = 1,
+ NotEqual = 2,
+ GreaterThan = 3,
+ GreaterEqual = 4,
+ Less = 5,
+ LessEqual = 6
+ }
+}
diff --git a/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Constraints/ExpressionSemantic.cs b/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Constraints/ExpressionSemantic.cs
new file mode 100644
index 0000000..a626245
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Constraints/ExpressionSemantic.cs
@@ -0,0 +1,25 @@
+/*******************************************************************************
+* Copyright (c) 2020 Robert Bosch GmbH
+* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
+*
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License 2.0 which is available at
+* http://www.eclipse.org/legal/epl-2.0
+*
+* SPDX-License-Identifier: EPL-2.0
+*******************************************************************************/
+using System.Runtime.Serialization;
+
+namespace BaSyx.Models.Core.AssetAdministrationShell.Constraints
+{
+ [DataContract]
+ public enum ExpressionSemantic : int
+ {
+ None = 0,
+ Requirement = 1,
+ Assurance = 2,
+ Confirmation = 3,
+ Measurement = 4,
+ Setting = 5
+ }
+}
diff --git a/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Constraints/Formula.cs b/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Constraints/Formula.cs
new file mode 100644
index 0000000..1381f2a
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Constraints/Formula.cs
@@ -0,0 +1,30 @@
+/*******************************************************************************
+* Copyright (c) 2020 Robert Bosch GmbH
+* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
+*
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License 2.0 which is available at
+* http://www.eclipse.org/legal/epl-2.0
+*
+* SPDX-License-Identifier: EPL-2.0
+*******************************************************************************/
+using BaSyx.Models.Core.AssetAdministrationShell.Identification;
+using BaSyx.Models.Core.AssetAdministrationShell.References;
+using BaSyx.Models.Core.Common;
+using Newtonsoft.Json;
+using System.Collections.Generic;
+
+namespace BaSyx.Models.Core.AssetAdministrationShell.Constraints
+{
+ public class Formula : Constraint, IFormula
+ {
+ public List<IReference> DependsOn { get; set; }
+ public override ModelType ModelType => ModelType.Formula;
+
+ [JsonConstructor]
+ public Formula()
+ {
+ DependsOn = new List<IReference>();
+ }
+ }
+}
diff --git a/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Constraints/IFormula.cs b/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Constraints/IFormula.cs
new file mode 100644
index 0000000..bb09d00
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Constraints/IFormula.cs
@@ -0,0 +1,22 @@
+/*******************************************************************************
+* Copyright (c) 2020 Robert Bosch GmbH
+* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
+*
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License 2.0 which is available at
+* http://www.eclipse.org/legal/epl-2.0
+*
+* SPDX-License-Identifier: EPL-2.0
+*******************************************************************************/
+using BaSyx.Models.Core.AssetAdministrationShell.References;
+using System.Collections.Generic;
+using System.Runtime.Serialization;
+
+namespace BaSyx.Models.Core.AssetAdministrationShell.Constraints
+{
+ public interface IFormula : IConstraint
+ {
+ [DataMember(EmitDefaultValue = false, IsRequired = false, Name = "dependsOn")]
+ List<IReference> DependsOn { get; }
+ }
+}
diff --git a/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Constraints/IQualifiable.cs b/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Constraints/IQualifiable.cs
new file mode 100644
index 0000000..a0a975c
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Constraints/IQualifiable.cs
@@ -0,0 +1,21 @@
+/*******************************************************************************
+* Copyright (c) 2020 Robert Bosch GmbH
+* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
+*
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License 2.0 which is available at
+* http://www.eclipse.org/legal/epl-2.0
+*
+* SPDX-License-Identifier: EPL-2.0
+*******************************************************************************/
+using System.Collections.Generic;
+using System.Runtime.Serialization;
+
+namespace BaSyx.Models.Core.AssetAdministrationShell.Constraints
+{
+ public interface IQualifiable
+ {
+ [DataMember(EmitDefaultValue = false, IsRequired = false, Name = "qualifiers")]
+ List<IConstraint> Constraints { get; }
+ }
+}
diff --git a/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Constraints/IQualifier.cs b/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Constraints/IQualifier.cs
new file mode 100644
index 0000000..155edd7
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Constraints/IQualifier.cs
@@ -0,0 +1,26 @@
+/*******************************************************************************
+* Copyright (c) 2020 Robert Bosch GmbH
+* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
+*
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License 2.0 which is available at
+* http://www.eclipse.org/legal/epl-2.0
+*
+* SPDX-License-Identifier: EPL-2.0
+*******************************************************************************/
+using BaSyx.Models.Core.AssetAdministrationShell.References;
+using BaSyx.Models.Core.AssetAdministrationShell.Semantics;
+using System.Runtime.Serialization;
+
+namespace BaSyx.Models.Core.AssetAdministrationShell.Constraints
+{
+ public interface IQualifier : IConstraint, IHasSemantics
+ {
+ [DataMember(EmitDefaultValue = false, IsRequired = false, Name = "type")]
+ string Type { get; }
+ [DataMember(EmitDefaultValue = false, IsRequired = false, Name = "value")]
+ object Value { get; }
+ [DataMember(EmitDefaultValue = false, IsRequired = false, Name = "valueId")]
+ IReference ValueId { get; }
+ }
+}
diff --git a/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Constraints/Qualifier.cs b/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Constraints/Qualifier.cs
new file mode 100644
index 0000000..991cf2a
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Constraints/Qualifier.cs
@@ -0,0 +1,26 @@
+/*******************************************************************************
+* Copyright (c) 2020 Robert Bosch GmbH
+* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
+*
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License 2.0 which is available at
+* http://www.eclipse.org/legal/epl-2.0
+*
+* SPDX-License-Identifier: EPL-2.0
+*******************************************************************************/
+using BaSyx.Models.Core.AssetAdministrationShell.References;
+using BaSyx.Models.Core.Common;
+using System.Runtime.Serialization;
+
+namespace BaSyx.Models.Core.AssetAdministrationShell.Constraints
+{
+ [DataContract]
+ public class Qualifier : Constraint, IQualifier
+ {
+ public string Type { get; set; }
+ public object Value { get; set; }
+ public IReference SemanticId { get; set; }
+ public override ModelType ModelType => ModelType.Qualifier;
+ public IReference ValueId { get; set; }
+ }
+}
diff --git a/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Constraints/QualifierType.cs b/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Constraints/QualifierType.cs
new file mode 100644
index 0000000..b9706eb
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Constraints/QualifierType.cs
@@ -0,0 +1,29 @@
+/*******************************************************************************
+* Copyright (c) 2020 Robert Bosch GmbH
+* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
+*
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License 2.0 which is available at
+* http://www.eclipse.org/legal/epl-2.0
+*
+* SPDX-License-Identifier: EPL-2.0
+*******************************************************************************/
+using System.Runtime.Serialization;
+
+namespace BaSyx.Models.Core.AssetAdministrationShell.Constraints
+{
+ [DataContract]
+ public static class QualifierType
+ {
+ public const string ExpressionLogic = "ExpressionLogic";
+ public const string ExpressionSemantic = "ExpressionSemantic";
+ public const string Enumeration = "Enumeration";
+ public const string Owner = "Owner";
+ public const string Min = "Min";
+ public const string Max = "Max";
+ public const string StrLen = "StrLen";
+ public const string MimeType = "MimeType";
+ public const string RegEx = "RegEx";
+ public const string Existence = "Existence";
+ }
+}
diff --git a/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Enums/AssetKind.cs b/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Enums/AssetKind.cs
new file mode 100644
index 0000000..efbe8c1
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Enums/AssetKind.cs
@@ -0,0 +1,24 @@
+/*******************************************************************************
+* Copyright (c) 2020 Robert Bosch GmbH
+* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
+*
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License 2.0 which is available at
+* http://www.eclipse.org/legal/epl-2.0
+*
+* SPDX-License-Identifier: EPL-2.0
+*******************************************************************************/
+using System.Runtime.Serialization;
+using System.Xml.Serialization;
+
+namespace BaSyx.Models.Core.AssetAdministrationShell.Enums
+{
+ [DataContract]
+ public enum AssetKind : int
+ {
+ [XmlEnum("Type")]
+ Type = 0,
+ [XmlEnum("Instance")]
+ Instance = 1
+ }
+}
diff --git a/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Enums/ModelingKind.cs b/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Enums/ModelingKind.cs
new file mode 100644
index 0000000..9efcf9a
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Enums/ModelingKind.cs
@@ -0,0 +1,24 @@
+/*******************************************************************************
+* Copyright (c) 2020 Robert Bosch GmbH
+* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
+*
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License 2.0 which is available at
+* http://www.eclipse.org/legal/epl-2.0
+*
+* SPDX-License-Identifier: EPL-2.0
+*******************************************************************************/
+using System.Runtime.Serialization;
+using System.Xml.Serialization;
+
+namespace BaSyx.Models.Core.AssetAdministrationShell.Enums
+{
+ [DataContract]
+ public enum ModelingKind : int
+ {
+ [XmlEnum("Instance")]
+ Instance = 0,
+ [XmlEnum("Template")]
+ Template = 1,
+ }
+}
diff --git a/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Enums/SchemaType.cs b/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Enums/SchemaType.cs
new file mode 100644
index 0000000..6eaf1f4
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Enums/SchemaType.cs
@@ -0,0 +1,23 @@
+/*******************************************************************************
+* Copyright (c) 2020 Robert Bosch GmbH
+* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
+*
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License 2.0 which is available at
+* http://www.eclipse.org/legal/epl-2.0
+*
+* SPDX-License-Identifier: EPL-2.0
+*******************************************************************************/
+using System.Runtime.Serialization;
+
+namespace BaSyx.Models.Core.AssetAdministrationShell.Enums
+{
+ [DataContract]
+ public enum SchemaType : int
+ {
+ None = 0,
+ XSD = 1,
+ RDFS = 2,
+ JSchema = 3
+ }
+}
diff --git a/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Generics/IAsset.cs b/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Generics/IAsset.cs
new file mode 100644
index 0000000..496b193
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Generics/IAsset.cs
@@ -0,0 +1,31 @@
+/*******************************************************************************
+* Copyright (c) 2020 Robert Bosch GmbH
+* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
+*
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License 2.0 which is available at
+* http://www.eclipse.org/legal/epl-2.0
+*
+* SPDX-License-Identifier: EPL-2.0
+*******************************************************************************/
+using BaSyx.Models.Core.AssetAdministrationShell.References;
+using BaSyx.Models.Core.AssetAdministrationShell.Identification;
+using System.Runtime.Serialization;
+using BaSyx.Models.Core.AssetAdministrationShell.Semantics;
+using BaSyx.Models.Core.AssetAdministrationShell.Enums;
+using BaSyx.Models.Core.Common;
+
+namespace BaSyx.Models.Core.AssetAdministrationShell.Generics
+{
+ public interface IAsset : IIdentifiable, IModelElement, IHasDataSpecification
+ {
+ [DataMember(EmitDefaultValue = false, IsRequired = false, Name = "assetIdentificationModel")]
+ IReference<ISubmodel> AssetIdentificationModel { get; }
+
+ [DataMember(EmitDefaultValue = false, IsRequired = false, Name = "billOfMaterial")]
+ IReference<ISubmodel> BillOfMaterial { get; }
+
+ [DataMember(EmitDefaultValue = false, IsRequired = false, Name = "kind")]
+ AssetKind Kind { get; }
+ }
+}
diff --git a/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Generics/IAssetAdministrationShell.cs b/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Generics/IAssetAdministrationShell.cs
new file mode 100644
index 0000000..07e7a49
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Generics/IAssetAdministrationShell.cs
@@ -0,0 +1,39 @@
+/*******************************************************************************
+* Copyright (c) 2020 Robert Bosch GmbH
+* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
+*
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License 2.0 which is available at
+* http://www.eclipse.org/legal/epl-2.0
+*
+* SPDX-License-Identifier: EPL-2.0
+*******************************************************************************/
+using BaSyx.Models.Core.AssetAdministrationShell.References;
+using BaSyx.Models.Core.AssetAdministrationShell.Identification;
+using BaSyx.Models.Core.AssetAdministrationShell.Semantics;
+using Newtonsoft.Json;
+using System.Runtime.Serialization;
+using BaSyx.Models.Core.AssetAdministrationShell.Views;
+using BaSyx.Models.Core.Common;
+
+namespace BaSyx.Models.Core.AssetAdministrationShell.Generics
+{
+
+ public interface IAssetAdministrationShell : IIdentifiable, IModelElement, IHasDataSpecification
+ {
+ [JsonProperty, DataMember(EmitDefaultValue = false, IsRequired = false, Name = "derivedFrom")]
+ IReference<IAssetAdministrationShell> DerivedFrom { get; }
+
+ [DataMember(EmitDefaultValue = false, IsRequired = false, Name = "asset")]
+ IAsset Asset { get; }
+
+ [DataMember(EmitDefaultValue = false, IsRequired = false, Name = "submodels")]
+ IElementContainer<ISubmodel> Submodels { get; set; }
+
+ [DataMember(EmitDefaultValue = false, IsRequired = false, Name = "views")]
+ IElementContainer<IView> Views { get; }
+
+ [DataMember(EmitDefaultValue = false, IsRequired = false, Name = "conceptDictionaries")]
+ IElementContainer<IConceptDictionary> ConceptDictionaries { get; }
+ }
+}
diff --git a/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Generics/IOperationVariable.cs b/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Generics/IOperationVariable.cs
new file mode 100644
index 0000000..c146af5
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Generics/IOperationVariable.cs
@@ -0,0 +1,21 @@
+/*******************************************************************************
+* Copyright (c) 2020 Robert Bosch GmbH
+* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
+*
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License 2.0 which is available at
+* http://www.eclipse.org/legal/epl-2.0
+*
+* SPDX-License-Identifier: EPL-2.0
+*******************************************************************************/
+using BaSyx.Models.Core.Common;
+using System.Runtime.Serialization;
+
+namespace BaSyx.Models.Core.AssetAdministrationShell.Generics
+{
+ public interface IOperationVariable : IModelElement
+ {
+ [DataMember(EmitDefaultValue = false, IsRequired = false, Name = "value")]
+ ISubmodelElement Value { get; }
+ }
+}
diff --git a/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Generics/ISubmodel.cs b/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Generics/ISubmodel.cs
new file mode 100644
index 0000000..5387693
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Generics/ISubmodel.cs
@@ -0,0 +1,35 @@
+/*******************************************************************************
+* Copyright (c) 2020 Robert Bosch GmbH
+* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
+*
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License 2.0 which is available at
+* http://www.eclipse.org/legal/epl-2.0
+*
+* SPDX-License-Identifier: EPL-2.0
+*******************************************************************************/
+using BaSyx.Models.Core.AssetAdministrationShell.Constraints;
+using BaSyx.Models.Core.AssetAdministrationShell.Generics.SubmodelElementTypes;
+using BaSyx.Models.Core.AssetAdministrationShell.Identification;
+using BaSyx.Models.Core.AssetAdministrationShell.Semantics;
+using BaSyx.Models.Core.Common;
+using System.Collections.Generic;
+using System.Runtime.Serialization;
+
+namespace BaSyx.Models.Core.AssetAdministrationShell.Generics
+{
+ public interface ISubmodel : IIdentifiable, IHasKind, IHasSemantics, IModelElement, IHasDataSpecification, IQualifiable
+ {
+ [IgnoreDataMember]
+ IEnumerable<IProperty> Properties { get; }
+
+ [IgnoreDataMember]
+ IEnumerable<IOperation> Operations { get; }
+
+ [IgnoreDataMember]
+ IEnumerable<IEvent> Events { get; }
+
+ [DataMember(EmitDefaultValue = false, IsRequired = false, Name = "submodelElements")]
+ IElementContainer<ISubmodelElement> SubmodelElements { get; }
+ }
+}
diff --git a/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Generics/ISubmodelElement.cs b/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Generics/ISubmodelElement.cs
new file mode 100644
index 0000000..c9ab57e
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Generics/ISubmodelElement.cs
@@ -0,0 +1,23 @@
+/*******************************************************************************
+* Copyright (c) 2020 Robert Bosch GmbH
+* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
+*
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License 2.0 which is available at
+* http://www.eclipse.org/legal/epl-2.0
+*
+* SPDX-License-Identifier: EPL-2.0
+*******************************************************************************/
+using BaSyx.Models.Core.AssetAdministrationShell.Identification;
+using BaSyx.Models.Core.AssetAdministrationShell.Constraints;
+using Newtonsoft.Json;
+using BaSyx.Models.Extensions;
+using BaSyx.Models.Core.AssetAdministrationShell.Semantics;
+using BaSyx.Models.Core.Common;
+
+namespace BaSyx.Models.Core.AssetAdministrationShell.Generics
+{
+ [JsonConverter(typeof(SubmodelElementConverter))]
+ public interface ISubmodelElement : IHasSemantics, IQualifiable, IReferable, IHasKind, IModelElement, IHasDataSpecification
+ { }
+}
diff --git a/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Generics/SubmodelElementTypes/IAnnotatedRelationshipElement.cs b/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Generics/SubmodelElementTypes/IAnnotatedRelationshipElement.cs
new file mode 100644
index 0000000..98b800c
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Generics/SubmodelElementTypes/IAnnotatedRelationshipElement.cs
@@ -0,0 +1,21 @@
+/*******************************************************************************
+* Copyright (c) 2020 Robert Bosch GmbH
+* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
+*
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License 2.0 which is available at
+* http://www.eclipse.org/legal/epl-2.0
+*
+* SPDX-License-Identifier: EPL-2.0
+*******************************************************************************/
+using BaSyx.Models.Core.AssetAdministrationShell.References;
+using System.Runtime.Serialization;
+
+namespace BaSyx.Models.Core.AssetAdministrationShell.Generics.SubmodelElementTypes
+{
+ public interface IAnnotatedRelationshipElement : IRelationshipElement
+ {
+ [DataMember(EmitDefaultValue = false, IsRequired = false, Name = "annotation")]
+ IReference<ISubmodelElement> Annotation { get; set; }
+ }
+}
diff --git a/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Generics/SubmodelElementTypes/IBasicEvent.cs b/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Generics/SubmodelElementTypes/IBasicEvent.cs
new file mode 100644
index 0000000..a43e024
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Generics/SubmodelElementTypes/IBasicEvent.cs
@@ -0,0 +1,22 @@
+/*******************************************************************************
+* Copyright (c) 2020 Robert Bosch GmbH
+* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
+*
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License 2.0 which is available at
+* http://www.eclipse.org/legal/epl-2.0
+*
+* SPDX-License-Identifier: EPL-2.0
+*******************************************************************************/
+using BaSyx.Models.Core.AssetAdministrationShell.Identification;
+using BaSyx.Models.Core.AssetAdministrationShell.References;
+using System.Runtime.Serialization;
+
+namespace BaSyx.Models.Core.AssetAdministrationShell.Generics.SubmodelElementTypes
+{
+ public interface IBasicEvent : IEvent
+ {
+ [DataMember(EmitDefaultValue = false, IsRequired = false, Name = "observed")]
+ IReference<IReferable> Observed { get; set; }
+ }
+}
diff --git a/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Generics/SubmodelElementTypes/IBlob.cs b/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Generics/SubmodelElementTypes/IBlob.cs
new file mode 100644
index 0000000..1999a79
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Generics/SubmodelElementTypes/IBlob.cs
@@ -0,0 +1,23 @@
+/*******************************************************************************
+* Copyright (c) 2020 Robert Bosch GmbH
+* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
+*
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License 2.0 which is available at
+* http://www.eclipse.org/legal/epl-2.0
+*
+* SPDX-License-Identifier: EPL-2.0
+*******************************************************************************/
+using BaSyx.Models.Core.Common;
+using System.Runtime.Serialization;
+
+namespace BaSyx.Models.Core.AssetAdministrationShell.Generics.SubmodelElementTypes
+{
+ public interface IBlob : ISubmodelElement
+ {
+ [DataMember(EmitDefaultValue = false, IsRequired = false, Name = "mimeType")]
+ string MimeType { get; }
+ [DataMember(EmitDefaultValue = false, IsRequired = false, Name = "value")]
+ byte[] Value { get; }
+ }
+}
diff --git a/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Generics/SubmodelElementTypes/ICapability.cs b/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Generics/SubmodelElementTypes/ICapability.cs
new file mode 100644
index 0000000..50a5fd5
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Generics/SubmodelElementTypes/ICapability.cs
@@ -0,0 +1,15 @@
+/*******************************************************************************
+* Copyright (c) 2020 Robert Bosch GmbH
+* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
+*
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License 2.0 which is available at
+* http://www.eclipse.org/legal/epl-2.0
+*
+* SPDX-License-Identifier: EPL-2.0
+*******************************************************************************/
+namespace BaSyx.Models.Core.AssetAdministrationShell.Generics.SubmodelElementTypes
+{
+ public interface ICapability : ISubmodelElement
+ { }
+}
diff --git a/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Generics/SubmodelElementTypes/IEntity.cs b/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Generics/SubmodelElementTypes/IEntity.cs
new file mode 100644
index 0000000..2549c19
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Generics/SubmodelElementTypes/IEntity.cs
@@ -0,0 +1,34 @@
+/*******************************************************************************
+* Copyright (c) 2020 Robert Bosch GmbH
+* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
+*
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License 2.0 which is available at
+* http://www.eclipse.org/legal/epl-2.0
+*
+* SPDX-License-Identifier: EPL-2.0
+*******************************************************************************/
+using BaSyx.Models.Core.AssetAdministrationShell.References;
+using BaSyx.Models.Core.Common;
+using System.Runtime.Serialization;
+
+namespace BaSyx.Models.Core.AssetAdministrationShell.Generics.SubmodelElementTypes
+{
+ public interface IEntity : ISubmodelElement
+ {
+ [DataMember(EmitDefaultValue = false, IsRequired = false, Name = "statements")]
+ IElementContainer<ISubmodelElement> Statements { get; }
+ [DataMember(EmitDefaultValue = false, IsRequired = false, Name = "entityType")]
+ EntityType EntityType { get; }
+ [DataMember(EmitDefaultValue = false, IsRequired = false, Name = "asset")]
+ IReference<IAsset> Asset { get; }
+ }
+ [DataContract]
+ public enum EntityType
+ {
+ [EnumMember(Value = "CoManagedEntity")]
+ CoManagedEntity,
+ [EnumMember(Value = "SelfManagedEntity")]
+ SelfManagedEntity
+ }
+}
diff --git a/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Generics/SubmodelElementTypes/IEvent.cs b/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Generics/SubmodelElementTypes/IEvent.cs
new file mode 100644
index 0000000..c84c753
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Generics/SubmodelElementTypes/IEvent.cs
@@ -0,0 +1,21 @@
+/*******************************************************************************
+* Copyright (c) 2020 Robert Bosch GmbH
+* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
+*
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License 2.0 which is available at
+* http://www.eclipse.org/legal/epl-2.0
+*
+* SPDX-License-Identifier: EPL-2.0
+*******************************************************************************/
+using BaSyx.Models.Core.Common;
+using System.Runtime.Serialization;
+
+namespace BaSyx.Models.Core.AssetAdministrationShell.Generics.SubmodelElementTypes
+{
+ public interface IEvent : ISubmodelElement
+ {
+ [IgnoreDataMember]
+ IElementContainer<ISubmodelElement> DataElements { get; }
+ }
+}
diff --git a/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Generics/SubmodelElementTypes/IFile.cs b/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Generics/SubmodelElementTypes/IFile.cs
new file mode 100644
index 0000000..bc34944
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Generics/SubmodelElementTypes/IFile.cs
@@ -0,0 +1,22 @@
+/*******************************************************************************
+* Copyright (c) 2020 Robert Bosch GmbH
+* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
+*
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License 2.0 which is available at
+* http://www.eclipse.org/legal/epl-2.0
+*
+* SPDX-License-Identifier: EPL-2.0
+*******************************************************************************/
+using System.Runtime.Serialization;
+
+namespace BaSyx.Models.Core.AssetAdministrationShell.Generics.SubmodelElementTypes
+{
+ public interface IFile : ISubmodelElement
+ {
+ [DataMember(EmitDefaultValue = false, IsRequired = false, Name = "mimeType")]
+ string MimeType { get; }
+ [DataMember(EmitDefaultValue = false, IsRequired = false, Name = "value")]
+ string Value { get; }
+ }
+}
diff --git a/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Generics/SubmodelElementTypes/IMultiLanguageProperty.cs b/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Generics/SubmodelElementTypes/IMultiLanguageProperty.cs
new file mode 100644
index 0000000..af699f7
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Generics/SubmodelElementTypes/IMultiLanguageProperty.cs
@@ -0,0 +1,24 @@
+/*******************************************************************************
+* Copyright (c) 2020 Robert Bosch GmbH
+* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
+*
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License 2.0 which is available at
+* http://www.eclipse.org/legal/epl-2.0
+*
+* SPDX-License-Identifier: EPL-2.0
+*******************************************************************************/
+using BaSyx.Models.Core.AssetAdministrationShell.References;
+using BaSyx.Models.Core.Common;
+using System.Runtime.Serialization;
+
+namespace BaSyx.Models.Core.AssetAdministrationShell.Generics.SubmodelElementTypes
+{
+ public interface IMultiLanguageProperty : ISubmodelElement
+ {
+ [DataMember(EmitDefaultValue = false, IsRequired = false, Name = "valueId")]
+ LangStringSet Value { get; }
+ [DataMember(EmitDefaultValue = false, IsRequired = false, Name = "valueId")]
+ IReference ValueId { get; }
+ }
+}
diff --git a/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Generics/SubmodelElementTypes/IOperation.cs b/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Generics/SubmodelElementTypes/IOperation.cs
new file mode 100644
index 0000000..ccb6f98
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Generics/SubmodelElementTypes/IOperation.cs
@@ -0,0 +1,32 @@
+/*******************************************************************************
+* Copyright (c) 2020 Robert Bosch GmbH
+* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
+*
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License 2.0 which is available at
+* http://www.eclipse.org/legal/epl-2.0
+*
+* SPDX-License-Identifier: EPL-2.0
+*******************************************************************************/
+using BaSyx.Models.Core.Common;
+using BaSyx.Utils.ResultHandling.ResultTypes;
+using System.Runtime.Serialization;
+
+namespace BaSyx.Models.Core.AssetAdministrationShell.Generics.SubmodelElementTypes
+{
+ public delegate OperationResult MethodCalledHandler(IOperation operation, IOperationVariableSet inputArguments, IOperationVariableSet outputArguments);
+
+ public interface IOperation : ISubmodelElement
+ {
+ [DataMember(EmitDefaultValue = false, IsRequired = false, Name = "inputVariables")]
+ IOperationVariableSet InputVariables { get; set; }
+ [DataMember(EmitDefaultValue = false, IsRequired = false, Name = "outputVariables")]
+ IOperationVariableSet OutputVariables { get; set; }
+ [DataMember(EmitDefaultValue = false, IsRequired = false, Name = "inoutputVariables")]
+ IOperationVariableSet InOutputVariables { get; set; }
+
+
+ [IgnoreDataMember]
+ MethodCalledHandler OnMethodCalled { get; }
+ }
+}
diff --git a/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Generics/SubmodelElementTypes/IProperty.cs b/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Generics/SubmodelElementTypes/IProperty.cs
new file mode 100644
index 0000000..44c9557
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Generics/SubmodelElementTypes/IProperty.cs
@@ -0,0 +1,41 @@
+/*******************************************************************************
+* Copyright (c) 2020 Robert Bosch GmbH
+* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
+*
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License 2.0 which is available at
+* http://www.eclipse.org/legal/epl-2.0
+*
+* SPDX-License-Identifier: EPL-2.0
+*******************************************************************************/
+using BaSyx.Models.Core.AssetAdministrationShell.References;
+using BaSyx.Models.Core.Common;
+using System.Runtime.Serialization;
+
+namespace BaSyx.Models.Core.AssetAdministrationShell.Generics.SubmodelElementTypes
+{
+ public delegate IValue GetPropertyValueHandler(IProperty property);
+ public delegate void SetPropertyValueHandler(IProperty property, IValue value);
+
+ public delegate TValue GetPropertyValueHandler<TValue>(IProperty property);
+ public delegate void SetPropertyValueHandler<TValue>(IProperty property, TValue value);
+
+ public interface IProperty : ISubmodelElement, IValue
+ {
+ [IgnoreDataMember]
+ GetPropertyValueHandler Get { get; }
+ [IgnoreDataMember]
+ SetPropertyValueHandler Set { get; }
+
+ [DataMember(EmitDefaultValue = false, IsRequired = false, Name = "valueId")]
+ IReference ValueId { get; set; }
+ }
+
+ public interface IProperty<TValue> : IProperty, IValue<TValue>
+ {
+ [IgnoreDataMember]
+ new GetPropertyValueHandler<TValue> Get { get; }
+ [IgnoreDataMember]
+ new SetPropertyValueHandler<TValue> Set { get; }
+ }
+}
diff --git a/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Generics/SubmodelElementTypes/IPublishableEvent.cs b/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Generics/SubmodelElementTypes/IPublishableEvent.cs
new file mode 100644
index 0000000..15a667c
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Generics/SubmodelElementTypes/IPublishableEvent.cs
@@ -0,0 +1,37 @@
+/*******************************************************************************
+* Copyright (c) 2020 Robert Bosch GmbH
+* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
+*
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License 2.0 which is available at
+* http://www.eclipse.org/legal/epl-2.0
+*
+* SPDX-License-Identifier: EPL-2.0
+*******************************************************************************/
+using System.Runtime.Serialization;
+using BaSyx.Models.Core.AssetAdministrationShell.References;
+
+namespace BaSyx.Models.Core.AssetAdministrationShell.Generics.SubmodelElementTypes
+{
+ public interface IPublishableEvent
+ {
+ [DataMember(EmitDefaultValue = false, IsRequired = false, Name = "originator")]
+ string Originator { get; }
+
+ [DataMember(EmitDefaultValue = false, IsRequired = false, Name = "eventReference")]
+ IReference<IEvent> EventReference { get; }
+
+ [DataMember(EmitDefaultValue = false, IsRequired = false, Name = "timestamp")]
+ string Timestamp { get; }
+
+ [DataMember(EmitDefaultValue = false, IsRequired = false, Name = "message")]
+ string Message { get; set; }
+
+ [DataMember(EmitDefaultValue = false, IsRequired = false, Name = "messageId")]
+ string MessageId { get; set; }
+
+ [DataMember(EmitDefaultValue = false, IsRequired = false, Name = "name")]
+ string Name { get; set; }
+
+ }
+}
diff --git a/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Generics/SubmodelElementTypes/IRange.cs b/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Generics/SubmodelElementTypes/IRange.cs
new file mode 100644
index 0000000..6238522
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Generics/SubmodelElementTypes/IRange.cs
@@ -0,0 +1,26 @@
+/*******************************************************************************
+* Copyright (c) 2020 Robert Bosch GmbH
+* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
+*
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License 2.0 which is available at
+* http://www.eclipse.org/legal/epl-2.0
+*
+* SPDX-License-Identifier: EPL-2.0
+*******************************************************************************/
+using BaSyx.Models.Core.Common;
+using System.Runtime.Serialization;
+
+namespace BaSyx.Models.Core.AssetAdministrationShell.Generics.SubmodelElementTypes
+{
+ public interface IRange : ISubmodelElement
+ {
+ [DataMember(EmitDefaultValue = false, IsRequired = false, Name = "min")]
+ IValue Min { get; }
+ [DataMember(EmitDefaultValue = false, IsRequired = false, Name = "max")]
+ IValue Max { get; }
+
+ [DataMember(EmitDefaultValue = false, IsRequired = false, Name = "valueType")]
+ DataType ValueType { get; set; }
+ }
+}
diff --git a/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Generics/SubmodelElementTypes/IReferenceElement.cs b/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Generics/SubmodelElementTypes/IReferenceElement.cs
new file mode 100644
index 0000000..56977f0
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Generics/SubmodelElementTypes/IReferenceElement.cs
@@ -0,0 +1,30 @@
+/*******************************************************************************
+* Copyright (c) 2020 Robert Bosch GmbH
+* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
+*
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License 2.0 which is available at
+* http://www.eclipse.org/legal/epl-2.0
+*
+* SPDX-License-Identifier: EPL-2.0
+*******************************************************************************/
+using BaSyx.Models.Core.AssetAdministrationShell.Identification;
+using BaSyx.Models.Core.AssetAdministrationShell.References;
+using BaSyx.Models.Core.Common;
+using System.Runtime.Serialization;
+
+namespace BaSyx.Models.Core.AssetAdministrationShell.Generics.SubmodelElementTypes
+{
+ public interface IReferenceElement : ISubmodelElement
+ {
+ [DataMember(EmitDefaultValue = false, IsRequired = false, Name = "value")]
+ IReference Value { get; set; }
+ }
+
+ public interface IReferenceElement<T> where T : IReferable
+ {
+ [DataMember(EmitDefaultValue = false, IsRequired = false, Name = "value")]
+ IReference<T> Value { get; set; }
+ }
+}
+
diff --git a/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Generics/SubmodelElementTypes/IRelationshipElement.cs b/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Generics/SubmodelElementTypes/IRelationshipElement.cs
new file mode 100644
index 0000000..db12673
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Generics/SubmodelElementTypes/IRelationshipElement.cs
@@ -0,0 +1,24 @@
+/*******************************************************************************
+* Copyright (c) 2020 Robert Bosch GmbH
+* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
+*
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License 2.0 which is available at
+* http://www.eclipse.org/legal/epl-2.0
+*
+* SPDX-License-Identifier: EPL-2.0
+*******************************************************************************/
+using BaSyx.Models.Core.AssetAdministrationShell.References;
+using BaSyx.Models.Core.AssetAdministrationShell.Identification;
+using System.Runtime.Serialization;
+
+namespace BaSyx.Models.Core.AssetAdministrationShell.Generics.SubmodelElementTypes
+{
+ public interface IRelationshipElement : ISubmodelElement
+ {
+ [DataMember(EmitDefaultValue = false, IsRequired = false, Name = "first")]
+ IReference<IReferable> First { get; }
+ [DataMember(EmitDefaultValue = false, IsRequired = false, Name = "second")]
+ IReference<IReferable> Second { get; }
+ }
+}
diff --git a/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Generics/SubmodelElementTypes/ISubmodelElementCollection.cs b/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Generics/SubmodelElementTypes/ISubmodelElementCollection.cs
new file mode 100644
index 0000000..8dab744
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Generics/SubmodelElementTypes/ISubmodelElementCollection.cs
@@ -0,0 +1,27 @@
+/*******************************************************************************
+* Copyright (c) 2020 Robert Bosch GmbH
+* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
+*
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License 2.0 which is available at
+* http://www.eclipse.org/legal/epl-2.0
+*
+* SPDX-License-Identifier: EPL-2.0
+*******************************************************************************/
+using BaSyx.Models.Core.Common;
+using System.Runtime.Serialization;
+
+namespace BaSyx.Models.Core.AssetAdministrationShell.Generics.SubmodelElementTypes
+{
+ public interface ISubmodelElementCollection : ISubmodelElement
+ {
+ [DataMember(EmitDefaultValue = false, IsRequired = false, Name = "allowDuplicates")]
+ bool AllowDuplicates { get; set; }
+
+ [DataMember(EmitDefaultValue = false, IsRequired = false, Name = "ordered")]
+ bool Ordered { get; set; }
+
+ [DataMember(EmitDefaultValue = false, IsRequired = false, Name = "value")]
+ IElementContainer<ISubmodelElement> Value { get; set; }
+ }
+}
diff --git a/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Identification/AdministrativeInformation.cs b/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Identification/AdministrativeInformation.cs
new file mode 100644
index 0000000..ae2ab4e
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Identification/AdministrativeInformation.cs
@@ -0,0 +1,27 @@
+/*******************************************************************************
+* Copyright (c) 2020 Robert Bosch GmbH
+* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
+*
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License 2.0 which is available at
+* http://www.eclipse.org/legal/epl-2.0
+*
+* SPDX-License-Identifier: EPL-2.0
+*******************************************************************************/
+using System.Runtime.Serialization;
+using System.Xml.Serialization;
+
+namespace BaSyx.Models.Core.AssetAdministrationShell.Identification
+{
+ [DataContract]
+ public class AdministrativeInformation
+ {
+ [DataMember(Name = "version")]
+ [XmlElement("version")]
+ public string Version { get; set; }
+
+ [DataMember(Name = "revision")]
+ [XmlElement("revision")]
+ public string Revision { get; set; }
+ }
+}
diff --git a/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Identification/IHasKind.cs b/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Identification/IHasKind.cs
new file mode 100644
index 0000000..406ddce
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Identification/IHasKind.cs
@@ -0,0 +1,21 @@
+/*******************************************************************************
+* Copyright (c) 2020 Robert Bosch GmbH
+* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
+*
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License 2.0 which is available at
+* http://www.eclipse.org/legal/epl-2.0
+*
+* SPDX-License-Identifier: EPL-2.0
+*******************************************************************************/
+using BaSyx.Models.Core.AssetAdministrationShell.Enums;
+using System.Runtime.Serialization;
+
+namespace BaSyx.Models.Core.AssetAdministrationShell.Identification
+{
+ public interface IHasKind
+ {
+ [DataMember(EmitDefaultValue = false, IsRequired = false, Name = "kind")]
+ ModelingKind Kind { get; }
+ }
+}
diff --git a/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Identification/IIdentifiable.cs b/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Identification/IIdentifiable.cs
new file mode 100644
index 0000000..b2003e0
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Identification/IIdentifiable.cs
@@ -0,0 +1,23 @@
+/*******************************************************************************
+* Copyright (c) 2020 Robert Bosch GmbH
+* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
+*
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License 2.0 which is available at
+* http://www.eclipse.org/legal/epl-2.0
+*
+* SPDX-License-Identifier: EPL-2.0
+*******************************************************************************/
+using Newtonsoft.Json;
+using System.Runtime.Serialization;
+
+namespace BaSyx.Models.Core.AssetAdministrationShell.Identification
+{
+ public interface IIdentifiable : IReferable
+ {
+ [JsonProperty(Order = -1), DataMember(Order = 1, EmitDefaultValue = false, IsRequired = false, Name = "identification")]
+ Identifier Identification { get; }
+ [DataMember(EmitDefaultValue = false, IsRequired = false, Name = "administration")]
+ AdministrativeInformation Administration { get; }
+ }
+}
diff --git a/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Identification/IReferable.cs b/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Identification/IReferable.cs
new file mode 100644
index 0000000..5071722
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Identification/IReferable.cs
@@ -0,0 +1,29 @@
+/*******************************************************************************
+* Copyright (c) 2020 Robert Bosch GmbH
+* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
+*
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License 2.0 which is available at
+* http://www.eclipse.org/legal/epl-2.0
+*
+* SPDX-License-Identifier: EPL-2.0
+*******************************************************************************/
+using BaSyx.Models.Core.AssetAdministrationShell.References;
+using Newtonsoft.Json;
+using System.Runtime.Serialization;
+using BaSyx.Models.Core.Common;
+
+namespace BaSyx.Models.Core.AssetAdministrationShell.Identification
+{
+ public interface IReferable
+ {
+ [JsonProperty(Order = -2), DataMember(Order = 0, EmitDefaultValue = false, IsRequired = false, Name = "idShort")]
+ string IdShort { get; }
+ [DataMember(EmitDefaultValue = false, IsRequired = false, Name = "category")]
+ string Category { get; }
+ [DataMember(EmitDefaultValue = false, IsRequired = false, Name = "description")]
+ LangStringSet Description { get; }
+ [DataMember(EmitDefaultValue = false, IsRequired = false, Name = "parent")]
+ IReference Parent { get; }
+ }
+}
diff --git a/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Identification/Identifier.cs b/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Identification/Identifier.cs
new file mode 100644
index 0000000..1246e16
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Identification/Identifier.cs
@@ -0,0 +1,117 @@
+/*******************************************************************************
+* Copyright (c) 2020 Robert Bosch GmbH
+* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
+*
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License 2.0 which is available at
+* http://www.eclipse.org/legal/epl-2.0
+*
+* SPDX-License-Identifier: EPL-2.0
+*******************************************************************************/
+using BaSyx.Models.Core.AssetAdministrationShell.References;
+using Newtonsoft.Json;
+using System.Runtime.Serialization;
+using System.Xml.Serialization;
+
+namespace BaSyx.Models.Core.AssetAdministrationShell.Identification
+{
+ [DataContract]
+ public class Identifier
+ {
+ [DataMember(EmitDefaultValue = false, IsRequired = true, Name = "id")]
+ [JsonProperty(Required = Required.Always, DefaultValueHandling = DefaultValueHandling.Include)]
+ [XmlText]
+ public string Id { get; set; }
+
+ [DataMember(EmitDefaultValue = false, IsRequired = true, Name = "idType")]
+ [JsonProperty(Required = Required.Always, DefaultValueHandling = DefaultValueHandling.Include)]
+ [XmlAttribute("idType")]
+ public KeyType IdType { get; set; }
+
+ internal Identifier() { }
+
+ public Identifier(string id, KeyType idType)
+ {
+ Id = id;
+ IdType = idType;
+ }
+
+
+ public class UniformResourceIdentifier : Identifier
+ {
+ public string Organisation { get; internal set; }
+ public string SubUnit { get; internal set; }
+ public string DomainId { get; internal set; }
+ public string Version { get; internal set; }
+ public string Revision { get; internal set; }
+ public string ElementId { get; internal set; }
+ public string InstanceNumber { get; internal set; }
+
+ public UniformResourceIdentifier(string organisation, string subUnit, string domainId, string version, string revision, string elementId, string instanceNumber)
+ : base(ToUrn(organisation, subUnit, domainId, version, revision, elementId, instanceNumber), KeyType.IRI)
+ {
+ Organisation = organisation;
+ SubUnit = subUnit;
+ DomainId = domainId;
+ Version = version;
+ Revision = revision;
+ ElementId = elementId;
+ InstanceNumber = instanceNumber;
+ }
+
+ public string ToUri() => ToUri(Organisation, SubUnit, DomainId, Version, Revision, ElementId, InstanceNumber);
+ public string ToUrn() => ToUrn(Organisation, SubUnit, DomainId, Version, Revision, ElementId, InstanceNumber);
+
+ public static string ToUri(string organisation, string subUnit, string domainId, string version, string revision, string elementId, string instanceNumber)
+ {
+ string uri = "http://";
+
+ uri += organisation + "/";
+
+ if (!string.IsNullOrEmpty(subUnit))
+ uri += subUnit + "/";
+ if (!string.IsNullOrEmpty(domainId))
+ uri += domainId + "/";
+ if (!string.IsNullOrEmpty(version))
+ uri += version + "/";
+ if (!string.IsNullOrEmpty(revision))
+ uri += revision + "/";
+ if (!string.IsNullOrEmpty(elementId))
+ uri += elementId + "/";
+
+ if (!string.IsNullOrEmpty(instanceNumber))
+ {
+ uri = uri.Substring(0, uri.Length - 2);
+ uri += "#" + instanceNumber;
+ }
+ return uri;
+ }
+ public static string ToUrn(string organisation, string subUnit, string domainId, string version, string revision, string elementId, string instanceNumber)
+ {
+ string urn = "urn:";
+
+ urn += organisation + ":";
+
+ if (!string.IsNullOrEmpty(subUnit))
+ urn += subUnit + ":";
+ if (!string.IsNullOrEmpty(domainId))
+ urn += domainId + ":";
+ if (!string.IsNullOrEmpty(version))
+ urn += version + ":";
+ if (!string.IsNullOrEmpty(revision))
+ urn += revision + ":";
+ if (!string.IsNullOrEmpty(elementId))
+ urn += elementId + ":";
+
+ if (!string.IsNullOrEmpty(instanceNumber))
+ {
+ urn = urn.Substring(0, urn.Length - 2);
+ urn += "#" + instanceNumber;
+ }
+ return urn;
+ }
+ }
+
+ }
+
+}
diff --git a/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Implementations/Asset.cs b/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Implementations/Asset.cs
new file mode 100644
index 0000000..53bc189
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Implementations/Asset.cs
@@ -0,0 +1,47 @@
+/*******************************************************************************
+* Copyright (c) 2020 Robert Bosch GmbH
+* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
+*
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License 2.0 which is available at
+* http://www.eclipse.org/legal/epl-2.0
+*
+* SPDX-License-Identifier: EPL-2.0
+*******************************************************************************/
+using BaSyx.Models.Core.AssetAdministrationShell.Enums;
+using BaSyx.Models.Core.AssetAdministrationShell.Generics;
+using BaSyx.Models.Core.AssetAdministrationShell.References;
+using BaSyx.Models.Core.AssetAdministrationShell.Identification;
+using Newtonsoft.Json;
+using System.Collections.Generic;
+using System.Runtime.Serialization;
+using BaSyx.Models.Core.Common;
+using BaSyx.Models.Core.AssetAdministrationShell.Semantics;
+
+namespace BaSyx.Models.Core.AssetAdministrationShell.Implementations
+{
+ [DataContract]
+ public class Asset : IAsset
+ {
+ public string IdShort { get; set; }
+ public Identifier Identification { get; set; }
+ public AssetKind Kind { get; set; } = AssetKind.Instance;
+ public LangStringSet Description { get; set; }
+ public IReference Parent { get; set; }
+ public Dictionary<string, string> MetaData { get; set; }
+ public IReference<ISubmodel> AssetIdentificationModel { get; set; }
+ public IReference<ISubmodel> BillOfMaterial { get; set; }
+ public AdministrativeInformation Administration { get; set; }
+ public string Category { get; set; }
+ public IReference SemanticId { get; set; }
+ public IEnumerable<IEmbeddedDataSpecification> EmbeddedDataSpecifications { get; }
+ public IConceptDescription ConceptDescription { get; set; }
+ public ModelType ModelType => ModelType.Asset;
+
+ [JsonConstructor]
+ public Asset()
+ {
+ EmbeddedDataSpecifications = new List<IEmbeddedDataSpecification>();
+ }
+ }
+}
diff --git a/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Implementations/AssetAdministrationShell.cs b/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Implementations/AssetAdministrationShell.cs
new file mode 100644
index 0000000..1382569
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Implementations/AssetAdministrationShell.cs
@@ -0,0 +1,55 @@
+/*******************************************************************************
+* Copyright (c) 2020 Robert Bosch GmbH
+* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
+*
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License 2.0 which is available at
+* http://www.eclipse.org/legal/epl-2.0
+*
+* SPDX-License-Identifier: EPL-2.0
+*******************************************************************************/
+using BaSyx.Models.Core.AssetAdministrationShell.Generics;
+using BaSyx.Models.Core.AssetAdministrationShell.References;
+using BaSyx.Models.Core.AssetAdministrationShell.Identification;
+using Newtonsoft.Json;
+using System.Collections.Generic;
+using System.Runtime.Serialization;
+using System.Xml.Serialization;
+using BaSyx.Models.Core.Common;
+using BaSyx.Models.Core.AssetAdministrationShell.Views;
+using BaSyx.Models.Core.AssetAdministrationShell.Semantics;
+
+namespace BaSyx.Models.Core.AssetAdministrationShell.Implementations
+{
+ [DataContract, XmlType]
+ public class AssetAdministrationShell : IAssetAdministrationShell
+ {
+ [XmlElement]
+ public string IdShort { get; set; }
+ [XmlElement]
+ public Identifier Identification { get; set; }
+ public IAsset Asset { get; set; }
+ public IElementContainer<ISubmodel> Submodels { get; set; }
+ public IReference Parent { get; set; }
+ public LangStringSet Description { get; set; }
+ public Dictionary<string, string> MetaData { get; set; }
+ public IReference<IAssetAdministrationShell> DerivedFrom { get; set; }
+ public IElementContainer<IView> Views { get; set; }
+ public AdministrativeInformation Administration { get; set; }
+ public string Category { get; set; }
+ public ModelType ModelType => ModelType.AssetAdministationShell;
+ public IEnumerable<IEmbeddedDataSpecification> EmbeddedDataSpecifications { get; }
+ public IElementContainer<IConceptDictionary> ConceptDictionaries { get; set; }
+ public IConceptDescription ConceptDescription { get; set; }
+
+ [JsonConstructor]
+ public AssetAdministrationShell()
+ {
+ Submodels = new ElementContainer<ISubmodel>();
+ Views = new ElementContainer<IView>();
+ MetaData = new Dictionary<string, string>();
+ ConceptDictionaries = new ElementContainer<IConceptDictionary>();
+ EmbeddedDataSpecifications = new List<IEmbeddedDataSpecification>();
+ }
+ }
+}
diff --git a/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Implementations/OperationVariable.cs b/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Implementations/OperationVariable.cs
new file mode 100644
index 0000000..9504135
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Implementations/OperationVariable.cs
@@ -0,0 +1,21 @@
+/*******************************************************************************
+* Copyright (c) 2020 Robert Bosch GmbH
+* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
+*
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License 2.0 which is available at
+* http://www.eclipse.org/legal/epl-2.0
+*
+* SPDX-License-Identifier: EPL-2.0
+*******************************************************************************/
+using BaSyx.Models.Core.AssetAdministrationShell.Generics;
+using BaSyx.Models.Core.Common;
+
+namespace BaSyx.Models.Core.AssetAdministrationShell.Implementations
+{
+ public class OperationVariable : IOperationVariable
+ {
+ public ModelType ModelType => ModelType.OperationVariable;
+ public ISubmodelElement Value { get; set; }
+ }
+}
diff --git a/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Implementations/Submodel.cs b/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Implementations/Submodel.cs
new file mode 100644
index 0000000..1f09e71
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Implementations/Submodel.cs
@@ -0,0 +1,56 @@
+/*******************************************************************************
+* Copyright (c) 2020 Robert Bosch GmbH
+* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
+*
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License 2.0 which is available at
+* http://www.eclipse.org/legal/epl-2.0
+*
+* SPDX-License-Identifier: EPL-2.0
+*******************************************************************************/
+using BaSyx.Models.Core.AssetAdministrationShell.Enums;
+using BaSyx.Models.Core.AssetAdministrationShell.Generics;
+using BaSyx.Models.Core.AssetAdministrationShell.Constraints;
+using BaSyx.Models.Core.AssetAdministrationShell.References;
+using BaSyx.Models.Core.AssetAdministrationShell.Identification;
+using Newtonsoft.Json;
+using System.Collections.Generic;
+using System.Runtime.Serialization;
+using BaSyx.Models.Core.AssetAdministrationShell.Semantics;
+using BaSyx.Models.Core.Common;
+using BaSyx.Models.Core.AssetAdministrationShell.Generics.SubmodelElementTypes;
+
+namespace BaSyx.Models.Core.AssetAdministrationShell.Implementations
+{
+ [DataContract]
+ public class Submodel : ISubmodel
+ {
+ public string IdShort { get; set; }
+ public Identifier Identification { get; set; }
+ public IReference Parent { get; set; }
+ public ModelingKind Kind { get; set; }
+ public IReference SemanticId { get; set; }
+ public LangStringSet Description { get; set; }
+ public IEnumerable<IProperty> Properties => SubmodelElements.FilterAsReference<IProperty>(ModelType.Property);
+ public IEnumerable<IOperation> Operations => SubmodelElements.FilterAsReference<IOperation>(ModelType.Operation);
+ public IEnumerable<IEvent> Events => SubmodelElements.FilterAsReference<IEvent>(ModelType.Event);
+ public IElementContainer<ISubmodelElement> SubmodelElements { get; set; }
+ public Dictionary<string, string> MetaData { get; set; }
+ public AdministrativeInformation Administration { get; set; }
+ public string Category { get; set; }
+ public ModelType ModelType => ModelType.Submodel;
+ public IEnumerable<IEmbeddedDataSpecification> EmbeddedDataSpecifications { get; set; }
+ public IConceptDescription ConceptDescription { get; set; }
+ public List<IConstraint> Constraints { get; set; }
+
+ [JsonConstructor]
+ public Submodel()
+ {
+ SubmodelElements = new ElementContainer<ISubmodelElement>();
+ MetaData = new Dictionary<string, string>();
+ EmbeddedDataSpecifications = new List<IEmbeddedDataSpecification>();
+ Constraints = new List<IConstraint>();
+ }
+
+ }
+}
diff --git a/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Implementations/SubmodelElement.cs b/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Implementations/SubmodelElement.cs
new file mode 100644
index 0000000..042f30e
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Implementations/SubmodelElement.cs
@@ -0,0 +1,72 @@
+/*******************************************************************************
+* Copyright (c) 2020 Robert Bosch GmbH
+* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
+*
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License 2.0 which is available at
+* http://www.eclipse.org/legal/epl-2.0
+*
+* SPDX-License-Identifier: EPL-2.0
+*******************************************************************************/
+using BaSyx.Models.Core.AssetAdministrationShell.Enums;
+using BaSyx.Models.Core.AssetAdministrationShell.Generics;
+using BaSyx.Models.Core.AssetAdministrationShell.Constraints;
+using BaSyx.Models.Core.AssetAdministrationShell.References;
+using Newtonsoft.Json;
+using System.Collections.Generic;
+using System.Linq;
+using System.Runtime.Serialization;
+using BaSyx.Models.Core.AssetAdministrationShell.Semantics;
+using BaSyx.Models.Core.Common;
+using BaSyx.Models.Core.AssetAdministrationShell.Identification;
+
+namespace BaSyx.Models.Core.AssetAdministrationShell.Implementations
+{
+ [DataContract]
+ public abstract class SubmodelElement : ISubmodelElement
+ {
+ public IReference SemanticId { get; set; }
+
+ public List<IConstraint> Constraints { get; set; }
+
+ public string IdShort { get; set; }
+
+ public string Category { get; set; }
+
+ public LangStringSet Description { get; set; }
+
+ public IReference Parent { get; set; }
+
+ public Dictionary<string, string> MetaData { get; set; }
+
+ public ModelingKind Kind { get; set; }
+
+ public abstract ModelType ModelType { get; }
+
+ public IEnumerable<IEmbeddedDataSpecification> EmbeddedDataSpecifications { get; set; }
+
+ private IConceptDescription conceptDescription;
+ public IConceptDescription ConceptDescription
+ {
+ get => conceptDescription;
+ set
+ {
+ if(value != null && value.EmbeddedDataSpecifications?.Count() > 0)
+ {
+ conceptDescription = value;
+
+ (EmbeddedDataSpecifications as List<IEmbeddedDataSpecification>)?.AddRange(value.EmbeddedDataSpecifications);
+ if (value.Identification?.Id != null && SemanticId == null)
+ SemanticId = new Reference(new Key(KeyElements.ConceptDescription, value.Identification.IdType, value.Identification.Id, true));
+ }
+ }
+ }
+ [JsonConstructor]
+ public SubmodelElement()
+ {
+ Constraints = new List<IConstraint>();
+ MetaData = new Dictionary<string, string>();
+ EmbeddedDataSpecifications = new List<IEmbeddedDataSpecification>();
+ }
+ }
+}
diff --git a/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Implementations/SubmodelElementFactory.cs b/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Implementations/SubmodelElementFactory.cs
new file mode 100644
index 0000000..f002505
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Implementations/SubmodelElementFactory.cs
@@ -0,0 +1,42 @@
+/*******************************************************************************
+* Copyright (c) 2020 Robert Bosch GmbH
+* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
+*
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License 2.0 which is available at
+* http://www.eclipse.org/legal/epl-2.0
+*
+* SPDX-License-Identifier: EPL-2.0
+*******************************************************************************/
+using BaSyx.Models.Core.AssetAdministrationShell.Implementations.SubmodelElementTypes;
+using BaSyx.Models.Core.Common;
+
+namespace BaSyx.Models.Core.AssetAdministrationShell.Implementations
+{
+ public static class SubmodelElementFactory
+ {
+ public static SubmodelElement CreateSubmodelElement(DataObjectType modelType, DataType valueType = null)
+ {
+ if (modelType == ModelType.Property || modelType == DataObjectType.DateTime)
+ return new Property(valueType);
+ if (modelType == ModelType.Operation)
+ return new Operation();
+ if (modelType == ModelType.Event)
+ return new Event();
+ else if (modelType == ModelType.Blob)
+ return new Blob();
+ else if (modelType == ModelType.File)
+ return new File();
+ else if (modelType == ModelType.MultiLanguageProperty)
+ return new MultiLanguageProperty();
+ else if (modelType == ModelType.ReferenceElement)
+ return new ReferenceElement();
+ else if (modelType == ModelType.RelationshipElement)
+ return new RelationshipElement();
+ else if (modelType == ModelType.SubmodelElementCollection)
+ return new SubmodelElementCollection();
+ else
+ return null;
+ }
+ }
+}
diff --git a/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Implementations/SubmodelElementTypes/AnnotatedRelationshipElement.cs b/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Implementations/SubmodelElementTypes/AnnotatedRelationshipElement.cs
new file mode 100644
index 0000000..0f66c2b
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Implementations/SubmodelElementTypes/AnnotatedRelationshipElement.cs
@@ -0,0 +1,26 @@
+/*******************************************************************************
+* Copyright (c) 2020 Robert Bosch GmbH
+* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
+*
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License 2.0 which is available at
+* http://www.eclipse.org/legal/epl-2.0
+*
+* SPDX-License-Identifier: EPL-2.0
+*******************************************************************************/
+using BaSyx.Models.Core.AssetAdministrationShell.References;
+using BaSyx.Models.Core.Common;
+using BaSyx.Models.Core.AssetAdministrationShell.Generics.SubmodelElementTypes;
+using BaSyx.Models.Core.AssetAdministrationShell.Generics;
+
+namespace BaSyx.Models.Core.AssetAdministrationShell.Implementations.SubmodelElementTypes
+{
+ public class AnnotatedRelationshipElement : RelationshipElement, IAnnotatedRelationshipElement
+ {
+ public override ModelType ModelType => ModelType.AnnotatedRelationshipElement;
+
+ public IReference<ISubmodelElement> Annotation { get; set; }
+
+ public AnnotatedRelationshipElement() : base() { }
+ }
+}
diff --git a/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Implementations/SubmodelElementTypes/BasicEvent.cs b/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Implementations/SubmodelElementTypes/BasicEvent.cs
new file mode 100644
index 0000000..455c97a
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Implementations/SubmodelElementTypes/BasicEvent.cs
@@ -0,0 +1,29 @@
+/*******************************************************************************
+* Copyright (c) 2020 Robert Bosch GmbH
+* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
+*
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License 2.0 which is available at
+* http://www.eclipse.org/legal/epl-2.0
+*
+* SPDX-License-Identifier: EPL-2.0
+*******************************************************************************/
+using BaSyx.Models.Core.AssetAdministrationShell.Generics.SubmodelElementTypes;
+using BaSyx.Models.Core.AssetAdministrationShell.Identification;
+using BaSyx.Models.Core.AssetAdministrationShell.References;
+using BaSyx.Models.Core.Common;
+using System.Runtime.Serialization;
+
+namespace BaSyx.Models.Core.AssetAdministrationShell.Implementations.SubmodelElementTypes
+{
+ [DataContract]
+ public class BasicEvent : Event, IBasicEvent
+ {
+ public override ModelType ModelType => ModelType.BasicEvent;
+
+ public IReference<IReferable> Observed { get; set; }
+
+ public BasicEvent() : base()
+ { }
+ }
+}
diff --git a/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Implementations/SubmodelElementTypes/Blob.cs b/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Implementations/SubmodelElementTypes/Blob.cs
new file mode 100644
index 0000000..b38788a
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Implementations/SubmodelElementTypes/Blob.cs
@@ -0,0 +1,26 @@
+/*******************************************************************************
+* Copyright (c) 2020 Robert Bosch GmbH
+* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
+*
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License 2.0 which is available at
+* http://www.eclipse.org/legal/epl-2.0
+*
+* SPDX-License-Identifier: EPL-2.0
+*******************************************************************************/
+using BaSyx.Models.Core.AssetAdministrationShell.Generics.SubmodelElementTypes;
+using BaSyx.Models.Core.Common;
+using System.Runtime.Serialization;
+
+namespace BaSyx.Models.Core.AssetAdministrationShell.Implementations.SubmodelElementTypes
+{
+ [DataContract]
+ public class Blob : SubmodelElement, IBlob
+ {
+ public override ModelType ModelType => ModelType.Blob;
+ public string MimeType { get; set; }
+ public byte[] Value { get; set; }
+
+ public Blob() : base() { }
+ }
+}
diff --git a/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Implementations/SubmodelElementTypes/Entity.cs b/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Implementations/SubmodelElementTypes/Entity.cs
new file mode 100644
index 0000000..b693343
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Implementations/SubmodelElementTypes/Entity.cs
@@ -0,0 +1,35 @@
+/*******************************************************************************
+* Copyright (c) 2020 Robert Bosch GmbH
+* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
+*
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License 2.0 which is available at
+* http://www.eclipse.org/legal/epl-2.0
+*
+* SPDX-License-Identifier: EPL-2.0
+*******************************************************************************/
+using BaSyx.Models.Core.AssetAdministrationShell.Generics;
+using BaSyx.Models.Core.AssetAdministrationShell.Generics.SubmodelElementTypes;
+using BaSyx.Models.Core.AssetAdministrationShell.References;
+using BaSyx.Models.Core.Common;
+using System.Runtime.Serialization;
+
+namespace BaSyx.Models.Core.AssetAdministrationShell.Implementations.SubmodelElementTypes
+{
+ [DataContract]
+ public class Entity : SubmodelElement, IEntity
+ {
+ public override ModelType ModelType => ModelType.Entity;
+
+ public IElementContainer<ISubmodelElement> Statements { get; set; }
+
+ public EntityType EntityType { get; set; }
+
+ public IReference<IAsset> Asset { get; set; }
+
+ public Entity() : base()
+ {
+ Statements = new ElementContainer<ISubmodelElement>();
+ }
+ }
+}
diff --git a/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Implementations/SubmodelElementTypes/Event.cs b/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Implementations/SubmodelElementTypes/Event.cs
new file mode 100644
index 0000000..2b76262
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Implementations/SubmodelElementTypes/Event.cs
@@ -0,0 +1,30 @@
+/*******************************************************************************
+* Copyright (c) 2020 Robert Bosch GmbH
+* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
+*
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License 2.0 which is available at
+* http://www.eclipse.org/legal/epl-2.0
+*
+* SPDX-License-Identifier: EPL-2.0
+*******************************************************************************/
+using BaSyx.Models.Core.AssetAdministrationShell.Generics;
+using BaSyx.Models.Core.AssetAdministrationShell.Generics.SubmodelElementTypes;
+using BaSyx.Models.Core.Common;
+using System.Runtime.Serialization;
+
+namespace BaSyx.Models.Core.AssetAdministrationShell.Implementations.SubmodelElementTypes
+{
+ [DataContract]
+ public class Event : SubmodelElement, IEvent
+ {
+ public override ModelType ModelType => ModelType.Event;
+
+ public IElementContainer<ISubmodelElement> DataElements { get; set; }
+
+ public Event() : base()
+ {
+ DataElements = new ElementContainer<ISubmodelElement>();
+ }
+ }
+}
diff --git a/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Implementations/SubmodelElementTypes/File.cs b/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Implementations/SubmodelElementTypes/File.cs
new file mode 100644
index 0000000..8632a45
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Implementations/SubmodelElementTypes/File.cs
@@ -0,0 +1,26 @@
+/*******************************************************************************
+* Copyright (c) 2020 Robert Bosch GmbH
+* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
+*
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License 2.0 which is available at
+* http://www.eclipse.org/legal/epl-2.0
+*
+* SPDX-License-Identifier: EPL-2.0
+*******************************************************************************/
+using BaSyx.Models.Core.AssetAdministrationShell.Generics.SubmodelElementTypes;
+using BaSyx.Models.Core.Common;
+using System.Runtime.Serialization;
+
+namespace BaSyx.Models.Core.AssetAdministrationShell.Implementations.SubmodelElementTypes
+{
+ [DataContract]
+ public class File : SubmodelElement, IFile
+ {
+ public override ModelType ModelType => ModelType.File;
+ public string MimeType { get; set; }
+ public string Value { get; set; }
+
+ public File() : base() { }
+ }
+}
diff --git a/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Implementations/SubmodelElementTypes/MultiLanguageProperty.cs b/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Implementations/SubmodelElementTypes/MultiLanguageProperty.cs
new file mode 100644
index 0000000..e4bdfe3
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Implementations/SubmodelElementTypes/MultiLanguageProperty.cs
@@ -0,0 +1,27 @@
+/*******************************************************************************
+* Copyright (c) 2020 Robert Bosch GmbH
+* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
+*
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License 2.0 which is available at
+* http://www.eclipse.org/legal/epl-2.0
+*
+* SPDX-License-Identifier: EPL-2.0
+*******************************************************************************/
+using BaSyx.Models.Core.AssetAdministrationShell.Generics.SubmodelElementTypes;
+using BaSyx.Models.Core.AssetAdministrationShell.References;
+using BaSyx.Models.Core.Common;
+using System.Runtime.Serialization;
+
+namespace BaSyx.Models.Core.AssetAdministrationShell.Implementations.SubmodelElementTypes
+{
+ [DataContract]
+ public class MultiLanguageProperty : SubmodelElement, IMultiLanguageProperty
+ {
+ public override ModelType ModelType => ModelType.MultiLanguageProperty;
+ public IReference ValueId { get; set; }
+ public LangStringSet Value { get; set; }
+
+ public MultiLanguageProperty() : base() { }
+ }
+}
diff --git a/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Implementations/SubmodelElementTypes/Operation.cs b/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Implementations/SubmodelElementTypes/Operation.cs
new file mode 100644
index 0000000..8425e0e
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Implementations/SubmodelElementTypes/Operation.cs
@@ -0,0 +1,35 @@
+/*******************************************************************************
+* Copyright (c) 2020 Robert Bosch GmbH
+* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
+*
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License 2.0 which is available at
+* http://www.eclipse.org/legal/epl-2.0
+*
+* SPDX-License-Identifier: EPL-2.0
+*******************************************************************************/
+using System.Runtime.Serialization;
+using BaSyx.Models.Core.Common;
+using BaSyx.Models.Core.AssetAdministrationShell.Generics.SubmodelElementTypes;
+
+namespace BaSyx.Models.Core.AssetAdministrationShell.Implementations.SubmodelElementTypes
+{
+ [DataContract]
+ public class Operation : SubmodelElement, IOperation
+ {
+ public IOperationVariableSet InputVariables { get; set; }
+ public IOperationVariableSet OutputVariables { get; set; }
+ public IOperationVariableSet InOutputVariables { get; set; }
+ [IgnoreDataMember]
+ public MethodCalledHandler OnMethodCalled { get; set; }
+
+ public override ModelType ModelType => ModelType.Operation;
+
+ public Operation() : base()
+ {
+ InputVariables = new OperationVariableSet();
+ OutputVariables = new OperationVariableSet();
+ InOutputVariables = new OperationVariableSet();
+ }
+ }
+}
diff --git a/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Implementations/SubmodelElementTypes/Property.cs b/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Implementations/SubmodelElementTypes/Property.cs
new file mode 100644
index 0000000..5bea7c0
--- /dev/null
+++ b/sdks/dotnet/basyx-core/BaSyx.Models/Core/AssetAdministrationShell/Implementations/SubmodelElementTypes/Property.cs
@@ -0,0 +1,112 @@
+/*******************************************************************************
+* Copyright (c) 2020 Robert Bosch GmbH
+* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
+*
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License 2.0 which is available at
+* http://www.eclipse.org/legal/epl-2.0
+*