├── .gitattributes
├── .github
└── pull_request_template.md
├── .vscode
├── extensions.json
├── launch.json
├── tasks.json
└── settings.json
├── ADTTools
├── RecreateAdtInstance
│ ├── requirements.txt
│ ├── Makefile
│ ├── README.md
│ ├── jlog.py
│ └── main.py
├── ADTToolsLibrary
│ ├── ADTToolsLibrary.csproj
│ └── Log.cs
├── UploadModels
│ ├── OrderedHashSet.cs
│ ├── UploadModels.csproj
│ ├── DTInterfaceInfoEqualityComparer.cs
│ ├── Options.cs
│ └── Program.cs
├── DeleteModels
│ ├── DeleteModels.csproj
│ ├── Options.cs
│ └── Program.cs
├── ADTTools.sln
└── Readme.md
├── DTDLValidator
├── global.json
├── DTDLValidator
│ ├── Interactive
│ │ ├── ExitCommand.cs
│ │ ├── ListCommand.cs
│ │ ├── ShowCommand.cs
│ │ ├── DTDLParser.cs
│ │ ├── ShowInfoCommand.cs
│ │ ├── Interactive.cs
│ │ ├── LoadCommand.cs
│ │ └── CompareCommand.cs
│ ├── DTDLValidator.csproj
│ ├── Log.cs
│ └── Program.cs
├── DTDLValidator.sln
├── .vscode
│ ├── launch.json
│ └── tasks.json
└── .gitignore
├── OWL2DTDL
├── Properties
│ └── launchSettings.json
├── Log.cs
├── OWL2DTDL.sln
├── OWL2DTDL.csproj
├── .vscode
│ ├── launch.json
│ └── tasks.json
├── RecIgnoredNames.csv
├── OntologyRestriction.cs
├── .gitignore
├── Relationship.cs
├── VocabularyHelper.cs
├── README.md
└── DotNetRdfExtensions.cs
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.md
├── LICENSE
├── .devcontainer
├── scripts
│ └── azure-cli.sh
├── devcontainer.json
└── Dockerfile
├── README.md
├── SECURITY.md
└── .gitignore
/.gitattributes:
--------------------------------------------------------------------------------
1 | # Normalize line endings
2 | *.sh text eol=lf
3 |
--------------------------------------------------------------------------------
/.github/pull_request_template.md:
--------------------------------------------------------------------------------
1 | ### What
2 |
3 |
4 | ### Why
5 |
6 |
7 | ### Tested
8 |
--------------------------------------------------------------------------------
/.vscode/extensions.json:
--------------------------------------------------------------------------------
1 | {
2 | "recommendations": ["streetsidesoftware.code-spell-checker"]
3 | }
4 |
--------------------------------------------------------------------------------
/ADTTools/RecreateAdtInstance/requirements.txt:
--------------------------------------------------------------------------------
1 | azure-mgmt-digitaltwins>=6.2.0
2 | azure-identity>=1.11.0
3 | tqdm>=4.64.1
4 | halo>=0.0.31
--------------------------------------------------------------------------------
/DTDLValidator/global.json:
--------------------------------------------------------------------------------
1 | {
2 | "sdk": {
3 | "version": "7.0.102",
4 | "rollForward": "feature"
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/ADTTools/ADTToolsLibrary/ADTToolsLibrary.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | net5.0
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/DTDLValidator/DTDLValidator/Interactive/ExitCommand.cs:
--------------------------------------------------------------------------------
1 | namespace DTDLValidator.Interactive
2 | {
3 | using CommandLine;
4 |
5 | [Verb("exit", HelpText = "Exit CLI.")]
6 | internal class ExitCommand
7 | {
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/ADTTools/RecreateAdtInstance/Makefile:
--------------------------------------------------------------------------------
1 | ##
2 | # Recreate ADT Instance
3 | #
4 | # @file
5 | # @version 1.0
6 | makeFileDir := $(dir $(abspath $(lastword $(MAKEFILE_LIST))))
7 |
8 | init:
9 | pip install -r requirements.txt
10 | clean:
11 | rm -r $(makeFileDir)__pycache__
12 | # end
13 |
--------------------------------------------------------------------------------
/OWL2DTDL/Properties/launchSettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "profiles": {
3 | "OWL2DTDL": {
4 | "commandName": "Project",
5 | "commandLineArgs": "-u https://w3id.org/rec/full/3.3/ -i ./RecIgnoredNames.csv -o C:\\Users\\karlh\\Scratch\\Git\\opendigitaltwins-building\\Ontology"
6 | }
7 | }
8 | }
--------------------------------------------------------------------------------
/CODE_OF_CONDUCT.md:
--------------------------------------------------------------------------------
1 | # Microsoft Open Source Code of Conduct
2 |
3 | This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
4 |
5 | Resources:
6 |
7 | - [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/)
8 | - [Microsoft Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/)
9 | - Contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with questions or concerns
10 |
--------------------------------------------------------------------------------
/ADTTools/UploadModels/OrderedHashSet.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using System.Collections.ObjectModel;
3 |
4 | namespace UploadModels
5 | {
6 | internal class OrderedHashSet : KeyedCollection
7 | {
8 | public OrderedHashSet()
9 | {
10 | }
11 |
12 | public OrderedHashSet(IEqualityComparer comparer)
13 | : base(comparer)
14 | {
15 | }
16 |
17 | protected override T GetKeyForItem(T item)
18 | {
19 | return item;
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/ADTTools/DeleteModels/DeleteModels.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Exe
5 | net5.0
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/ADTTools/DeleteModels/Options.cs:
--------------------------------------------------------------------------------
1 | using CommandLine;
2 |
3 | namespace DeleteModels
4 | {
5 | internal class Options
6 | {
7 | [Option('t', "tenantId", Required = true, HelpText = "The application's tenant id for connecting to Azure Digital Twins.")]
8 | public string TenantId { get; set; }
9 |
10 | [Option('c', "clientId", Required = true, HelpText = "The application's client id for connecting to Azure Digital Twins.")]
11 | public string ClientId { get; set; }
12 |
13 | [Option('h', "hostName", Required = true, HelpText = "The host name of your Azure Digital Twins instance.")]
14 | public string HostName { get; set; }
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/OWL2DTDL/Log.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace OWL2DTDL
4 | {
5 | public static class Log
6 | {
7 | static public void Out(string s, ConsoleColor col = ConsoleColor.White)
8 | {
9 | Console.ForegroundColor = col;
10 | Console.WriteLine(s);
11 | Console.ForegroundColor = ConsoleColor.White;
12 | }
13 |
14 | static public void Error(string s)
15 | {
16 | Out(s, ConsoleColor.DarkRed);
17 | }
18 |
19 | static public void Alert(string s)
20 | {
21 | Out(s, ConsoleColor.DarkYellow);
22 | }
23 |
24 | static public void Ok(string s)
25 | {
26 | Out(s, ConsoleColor.DarkGreen);
27 | }
28 |
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/DTDLValidator/DTDLValidator/DTDLValidator.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Exe
5 | net7.0
6 | true
7 | dtdl-validator
8 | ./nupkg
9 | true
10 | win-x64
11 | true
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/ADTTools/ADTToolsLibrary/Log.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace ADTToolsLibrary
4 | {
5 | public static class Log
6 | {
7 | static public void Write(string s, ConsoleColor col = ConsoleColor.White)
8 | {
9 | Console.ForegroundColor = col;
10 | Console.WriteLine(s);
11 | Console.ResetColor();
12 | }
13 |
14 | static public void Error(string s)
15 | {
16 | Write(s, ConsoleColor.DarkRed);
17 | }
18 |
19 | static public void Warning(string s)
20 | {
21 | Write(s, ConsoleColor.DarkYellow);
22 | }
23 |
24 | static public void Ok(string s)
25 | {
26 | Write(s, ConsoleColor.DarkGreen);
27 | }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/ADTTools/UploadModels/UploadModels.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Exe
5 | net6.0
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | # Contributing
2 |
3 | This project welcomes contributions and suggestions. Most contributions require you to
4 | agree to a Contributor License Agreement (CLA) declaring that you have the right to,
5 | and actually do, grant us the rights to use your contribution. For details, visit
6 | https://cla.microsoft.com.
7 |
8 | When you submit a pull request, a CLA-bot will automatically determine whether you need
9 | to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the
10 | instructions provided by the bot. You will only need to do this once across all repositories using our CLA.
11 |
12 | This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
13 | For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/)
14 | or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.
15 |
--------------------------------------------------------------------------------
/DTDLValidator/DTDLValidator/Interactive/ListCommand.cs:
--------------------------------------------------------------------------------
1 | namespace DTDLValidator.Interactive
2 | {
3 | using CommandLine;
4 | using Microsoft.Azure.DigitalTwins.Parser.Models;
5 | using System;
6 | using System.Threading.Tasks;
7 |
8 | [Verb("list", HelpText = "List models.")]
9 | internal class ListCommand
10 | {
11 | public Task Run(Interactive p)
12 | {
13 | Console.WriteLine(listFormat, "Interface Id", "Display Name");
14 | Console.WriteLine(listFormat, "------------", "------------");
15 | foreach (DTInterfaceInfo @interface in p.Models.Values)
16 | {
17 | @interface.DisplayName.TryGetValue("en", out string displayName);
18 | Console.WriteLine(listFormat, @interface.Id.AbsoluteUri, displayName ?? "");
19 | }
20 |
21 | return Task.FromResult