Skip to content

Commit

Permalink
Removed DTDL Parser
Browse files Browse the repository at this point in the history
  • Loading branch information
ashbeitz committed Oct 9, 2023
1 parent 7e3fe74 commit 48b7f2b
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 8 deletions.
5 changes: 0 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
- [Cloning the Repo](#cloning-the-repo)
- [Developer Notes](#developer-notes)
- [JSON-LD Crate](#json-ld-crate)
- [DTDL Parser](#dtdl-parser)
- [Building](#building)
- [Running the Tests](#running-the-tests)
- [Running the Samples](#running-the-samples)
Expand Down Expand Up @@ -96,10 +95,6 @@ However, it currently has a build issue that is discussed [here](https://github.
To work around this issue you will need to use git clone to obtain the source from [here](https://github.com/blast-hardcheese/json-ld)
and checkout its "resolve-issue-40" branch. It should be cloned to a directory that is a sibling to ibeji.

### <a name="dtdl-parser">DTDL Parser</a>

There is no existing DTDL Parser for Rust, so we have provided a minimalistic one for DTDL v2 that is based on the [JavaScript DTDL Parser](https://github.com/Azure/azure-sdk-for-js/tree/%40azure/dtdl-parser_1.0.0-beta.2/sdk/digitaltwins/dtdl-parser).

## <a name="building">Building</a>

Once you have installed the prerequisites, go to your enlistment's root directory and run:
Expand Down
16 changes: 16 additions & 0 deletions dtdl-tools/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# DTDL Tools

DTDL is fundamental to Ibeji. These tools will help devleopers to use DTDL to build their own in-vehicle digital twin model.

## DTDL Validator

DTDL Validator is an application that validates DTDL files. It uses the .Net DTDLParser.

The application is built by Cargo. It can be found here: ibeji/target/debug/dtdl-validator/bin/Debug/net7.0/dtdl-validator.
It takes two command line arguments:
* -d <directory name> - The directory that contains the DTDL files.
* -e <file extension> - The file extension used by the DTDL files. The default is "json".

The CI/CD pipeline automatically validates DTDL files found under the ibeji/digital-twin-model/dtdl directory via dtdl-tools
test suite. Additonal directories containing DTDL files can also be checked by addining new test cases based on the one for
the ibeji/digital-twin-model/dtdl directory.
2 changes: 1 addition & 1 deletion dtdl-tools/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use std::process::Command;

// This build script builds all the .NET projects in this digital_twins_connector folder.
// This build script builds all the .NET projects in this dtdl-tools folder.
// Running 'cargo build' will build the .NET projects and the Rust crates.
fn main() {
const DOTNET_COMMAND: &str = "dotnet";
Expand Down
4 changes: 2 additions & 2 deletions dtdl-tools/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
// Licensed under the MIT license.
// SPDX-License-Identifier: MIT

// This lib.rs is for running the .NET unit tests in this digital_twins_connector folder.
// This lib.rs is for running the .NET unit tests in this dtdl-tools folder.
// Running 'cargo test' will run all the .NET unit tests and the Rust unit tests.
#[cfg(test)]
mod digital_twins_connector_dotnet_tests {
mod dtdl_tools_tests {
use std::io::{self, Write};
use std::path::Path;
use std::process::Command;
Expand Down

0 comments on commit 48b7f2b

Please sign in to comment.