Microsoft.SmartPlaces.Facilities.IngestionManager.Mapped 0.4.13-preview

Prefix Reserved
This is a prerelease version of Microsoft.SmartPlaces.Facilities.IngestionManager.Mapped.
There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package Microsoft.SmartPlaces.Facilities.IngestionManager.Mapped --version 0.4.13-preview                
NuGet\Install-Package Microsoft.SmartPlaces.Facilities.IngestionManager.Mapped -Version 0.4.13-preview                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Microsoft.SmartPlaces.Facilities.IngestionManager.Mapped" Version="0.4.13-preview" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Microsoft.SmartPlaces.Facilities.IngestionManager.Mapped --version 0.4.13-preview                
#r "nuget: Microsoft.SmartPlaces.Facilities.IngestionManager.Mapped, 0.4.13-preview"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Microsoft.SmartPlaces.Facilities.IngestionManager.Mapped as a Cake Addin
#addin nuget:?package=Microsoft.SmartPlaces.Facilities.IngestionManager.Mapped&version=0.4.13-preview&prerelease

// Install Microsoft.SmartPlaces.Facilities.IngestionManager.Mapped as a Cake Tool
#tool nuget:?package=Microsoft.SmartPlaces.Facilities.IngestionManager.Mapped&version=0.4.13-preview&prerelease                

IngestionManager.Mapped

This library works in conjunction with and depends on the Microsoft.SmartPlaces.Facilities.IngestionManager library, that defines interfaces and a generic implementation for ingesting building data graphs into Azure Digital Twins.

Setup

This library provides IInputGraphManager and IGraphIngestionProcessor implementations and a subclass of IngestionManagerOptions that together allow solutions to ingest graphs from the Mapped API.

Those implementations are wired up using the .Net dependency injection framework, as per the common design pattern:

services.AddMappedIngestionManager(options =>
    {
        // Mapped Specific
        options.MappedToken = hostContext.Configuration["MappedToken"];
        options.MappedRootUrl = hostContext.Configuration["MappedRootUrl"];

        // Ingestion Manager
        options.AzureDigitalTwinsEndpoint = hostContext.Configuration["AzureDigitalTwinsEndpoint"];
    });

The above sets up singleton implementations such that any code depending on IInputGraphManager will call MappedGraphManager, and code depending on IGraphIngestionProcessor will call MappedGraphIngestionProcessor.

Note that for ontology mappings to be resolved correctly, you may also want to wire up an ontology mapper instance:

services.AddLogging();

services.AddSingleton<IOntologyMappingLoader>(sp =>
{
    var logger = sp.GetRequiredService<ILogger<MappedOntologyMappingLoader>>();
    return new MappedOntologyMappingLoader(logger, hostContext.Configuration["ontologyMappingFilename"]);
});

services.AddSingleton<IOntologyMappingManager, OntologyMappingManager>();

Usage

The entry point to using these libraries is the base class IngestionProcessorBase.IngestFromApiAsync() method; that method in turn calls the MappedGraphIngestionProcessor.ProcessSites() method, which initiates ingestion of all sites (e.g., campuses/buildings or other suitable starting nodes) from the input graph.

ProcessSites() calls out to an input graph manager to actually query the source graph for those starting nodes, and iterates over child nodes returned by said graph manager. As wired up above, that input graph manager will be our own MappedGraphManager, which knows how to talk to the Mapped API.

The MappedGraphManager is configured (e.g., for access credentials) using the options passed in to the services.AddMappedIngestionManager() call shown under Setup above.

So, assuming the Dependency Injection setup as given above, ingestion from Mapped to Azure Digital Twins is achieved in a class where the MappedGraphIngestionProcessor has been injected, as follows:

logger.LogInformation("Starting to ingest topology");
await mappedProcessor.IngestFromApiAsync(cancellationToken);
logger.LogInformation("Topology ingestion completed");
Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
0.7.2-preview 58 9/5/2024
0.7.1-preview 73 9/4/2024
0.7.0-preview 259 2/2/2024
0.6.14-preview 116 6/26/2023
0.6.13-preview 105 6/16/2023
0.6.12-preview 98 6/15/2023
0.6.3-preview 219 5/4/2023
0.5.0-preview 437 2/17/2023
0.4.15-preview 187 1/5/2023
0.4.14-preview 104 12/8/2022
0.4.13-preview 179 12/2/2022
0.4.12-preview 106 11/30/2022
0.4.11-preview 113 11/29/2022
0.4.2-preview 112 11/8/2022
0.4.1-preview 208 11/4/2022
0.4.0-preview 140 11/3/2022
0.3.8-preview 135 11/1/2022
0.3.7-preview 114 10/31/2022
0.3.6-preview 165 10/27/2022
0.3.5-preview 106 10/26/2022
0.3.1-preview 124 10/20/2022
0.3.0-preview 156 10/17/2022
0.2.0-preview 157 10/15/2022
0.1.1-preview 178 10/13/2022
0.1.0-preview 151 10/13/2022