CimBios.Core.CimModel.DataModel
1.0.0
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package CimBios.Core.CimModel.DataModel --version 1.0.0
NuGet\Install-Package CimBios.Core.CimModel.DataModel -Version 1.0.0
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="CimBios.Core.CimModel.DataModel" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="CimBios.Core.CimModel.DataModel" Version="1.0.0" />
<PackageReference Include="CimBios.Core.CimModel.DataModel" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add CimBios.Core.CimModel.DataModel --version 1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: CimBios.Core.CimModel.DataModel, 1.0.0"
#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.
#:package CimBios.Core.CimModel.DataModel@1.0.0
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=CimBios.Core.CimModel.DataModel&version=1.0.0
#tool nuget:?package=CimBios.Core.CimModel.DataModel&version=1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
CimBios.Core.CimModel.DataModel
CimBios.Core - a swiss army knife 🛠 in the world of CIM (IEC61970) models
Check out general feautures:
CIM FullModelserializing/deserializing toolsSupports custom data schemas - information model profilesCIM difference modelutilities support- Applying difference to model
- Compare models
- Track model changes
- (De)serializing
Metamodelsystem based onCIM UMLstandards description- Classes, inheritance
- Properties (attributes, associations, compounds, enums)
- Datatypes
- Stereotypes
- Packages
- Extensions and splitted namespaces
Validationfeatures- Flexible core architecture
You can design your own type libs, schemas, serializers, validation rules
Getting Started
1. Create a New DotNET Project
If you don't already have a dotnet project, create one in Visual Studio.
2. Install NuGet Package
Inatall CimBios.Core.CimModel.DataModel NuGet package to your app with your preferred method. Here is the one using NuGet Package Manager:
Install-Package CimBios.Core.CimModel.DataModel
3. Usage example
- 🆕 Create new FullModel
using CimBios.Core.CimModel.DataModel.Document;
// 💡 Load RDF schema - IM profile
var schema = new CimRdfSchemaXmlFactory().CreateSchema();
schema.Load(new StreamReader($"{path}"));
// 💡 Create type lib instance
// Schema is used to check registering assembly types
var typeLib = new CimDatatypeLib(schema);
// 💡 Create OID descriptor factory - CIM objects identifiers factory. Uuid for example.
var oidDescriptorFactory = new UuidDescriptorFactory();
// 💡 Create CIM FullModel document
var document = new CimDocument(schema, typeLib, oidDescriptorFactory);
// 💡 Set FullModel header
var fullModel = document.CreateObject<FullModel>(new UuidDescriptor());
fullModel.created = DateTime.Now;
fullModel.description = "Hello CIM!";
- 📦 Model storage accessing
// 💡 Create new object
var geoRegion = document.CreateObject<GeographicalRegion>(new UuidDescriptor()); // via typelib
var geoMetaClass = schema.TryGetResource<ICimMetaClass>(new
Uri("http://iec.ch/TC57/CIM100#GeographicalRegion"));
var geoRegion2 = document.CreateObject(new UuidDescriptor(), geoMetaClass!); // via metamodel
// Create object w/ concrete identifier
var baseVoltage115 = document.CreateObject<BaseVoltage>(
new UuidDescriptor(new Guid("3f3ac268-6c9f-44a6-98b8-c3e53ee42f1a")));
// 💡 Remove object
document.RemoveObject(geoRegion2);
document.RemoveObject(new UuidDescriptor(new Guid("3f3ac268-6c9f-44a6-98b8-c3e53ee42f1a")));
// 💡 Get objects
var all = document.GetAllObjects(); // all
// All objects of concrete class
var allGeoRegions = document.GetObjects<GeographicalRegion>(); // via typelib
var allGeoRegions2 = document.GetObjects(geoMetaClass); // via metamodel
// Get concrete object
var modelObject = document.GetObject("3f3ac268-6c9f-44a6-98b8-c3e53ee42f1a");
var typedObject = document.GetObject<IdentifiedObject>("3f3ac268-6c9f-44a6-98b8-c3e53ee42f1a");
- 💾 Load and save FullModel
// ⚠ schema, typeLib, oidDescriptorFactory definition described in `Create new FullModel` example
// 💡 Create CIM FullModel document
var document = new CimDocument(schema, typeLib, oidDescriptorFactory);
// 💡 Create RDF serializer factory dependant on CIM model format
var serializerFactory = new RdfXmlSerializerFactory();
document.Load($"{model}", serializerFactory);
- ➡ Import another FullModel
// 💡 Import other model objects
document1.ImportModelObjects(document2);
- 💾 Load and save DifferenceModel
⚠ Insure CimBios.Core.CimModel.DataModel refence added to project explicitly!
var coreLib = new CoreDatatypeLibFactory().Create(); // core typelib, which contains all necessary classes
var diffModel = new CimDifferenceModel(coreLib.Schema, coreLib, oidDescriptorFactory);
// manage default schema w/ needed namespaces and prefix
coreLib.Schema.Namespaces.Add("cim", new Uri("http://iec.ch/TC57/CIM100#"));
diffModel.Load($"{diffmodel}", new RdfXmlSerializerFactory());
diffModel.Save($"{diffmodel}", new RdfXmlSerializerFactory());
- ➡ Apply DifferenceModel to FullModel
// 💡 Apply DifferenceModel
document.ApplyDifferenceModel(diffModel);
- 🔥 Subscribe DifferenceModel on model changes
// 💡 Subscribe DifferenceModel
diffModel.SubscribeToDataModelChanges(document);
⚡ To get more usage details check out .NET demo console app in GitHub repository ⚡
4. Diagnostics logging
Base type lib class supports logging via Serilog ILogger interface:
// Pass ILogger instance to CimDocumentBase constructor:
var logger = new LoggerConfiguration()
.WriteTo.Console()
.CreateLogger();
var document = new CimDocument(schema, typeLib, oidDescriptorFactory)
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. 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. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net8.0
- CimBios.Core.CimModel.RdfSerializer (>= 1.0.0)
- CimBios.Core.CimModel.Schema (>= 1.0.0)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on CimBios.Core.CimModel.DataModel:
| Package | Downloads |
|---|---|
|
CimBios.Core.CimModel.Validation
Core data model library. Provides base classes and rules to validating CIM model. |
GitHub repositories
This package is not used by any popular GitHub repositories.