- Install .NET: Download and install from the .NET official website.
- Install Pre-Commit: Pre-commit is now managed by Poetry. It will be installed automatically when you run
poetry install. - Activate Hooks: Run
pre-commit installin your repository to activate the git hooks.
- Install Python: Download and install Python from the Python official website.
- Install Poetry: Follow the instructions on the Poetry website.
- Install Dependencies: Inside your project directory, run
poetry installto install all required Python dependencies in a virtual environment managed by Poetry. - Activate Poetry Virtual Environment: Execute
poetry shellin the project directory to start the virtual environment.
- Add your manual mappings to the
./datadirectory, which is the central location for all manual mapping files.
-
Generate Inferred Mappings:
- Before running the tests, it's important to generate the inferred mappings. This can be done by executing the following Python script:
poetry run python ./scripts/generate_mappings.py - This script will create the inferred mappings and place them in the appropriate directory.
- Before running the tests, it's important to generate the inferred mappings. This can be done by executing the following Python script:
-
Build the Project:
- Once the inferred mappings are generated, the next step is to build the dotnet project. This prepares the project for running tests. Use the command:
dotnet build
- Once the inferred mappings are generated, the next step is to build the dotnet project. This prepares the project for running tests. Use the command:
-
Run the Tests:
- After building the project, run the tests to check the integrity and functionality of your code. Execute:
dotnet test Ontologies.Mappings/test/Ontologies.Mappings.Test.csproj
- After building the project, run the tests to check the integrity and functionality of your code. Execute:
By following these steps, you can perform local testing, ensuring that both the inferred mappings work correctly.
- Before committing your code, ensure you have set up pre-commit hooks as described in the environment setup section.
- The pre-commit hooks will automatically:
- Sort the manual mapping files in
data/Mapped2Willow.jsonanddata/Willow2Mapped.json - Format JSON files (excluding the manual mapping files)
- Sort the manual mapping files in
- If pre-commit modifies any files, you'll need to stage those changes and commit again.