A module for WebProtégé, implementing an approach for ontology attestation. See also the usage guide.
- solc 7.1.0+
- web3j-cli
- Node and NPM
- Ganache / Ganache CLI
- Metamask (or other wallet plugin) for client blockchain interaction
- Java 8 + Maven
The module can be compiled and installed locally with mvn clean install
. The smart contracts need to be compiled and deployed separately.
The scripts
folder contains utilities for compiling and deploying the contracts.
-
Compile solidity contracts (requires
solc
):sh ./compile-contracts.sh
-
Generate Java contract interfaces and wrappers (only needed for development purposes, requires
web3j-cli
andsolc
):sh ./generate-contract-wrappers.sh
-
Start a local Ganache test blockchain with the docker-compose file in the parent directory (execute from the project root).
docker-compose up -d ganache
-
The seed is fixed, use the mnemonic indicated in the docker-compose file to access the test accounts (in Metamask this is the "Secret Recovery Phrase").
-
Deploy contracts (execute from the
scripts
folder, requiresnode
andnpm
): The connection to the chain is confiigured in the.env
file in the same folder and is pre-configured for Ganache as started bydocker-compose.yml
.npm install npm run deploy
The contract address must be made available to the application server. To do this, configure the address in src/main/java/resources/configuration/config.properties
.
Alternatively, the address may be set n the environment with the key ADDRESS_ATTESTATION
, the RPC provider host and port by PROVIDER_HOST
and PROVIDER_PORT
respectively. These can also be set inside the docker-compose.yml
file as follows in the service definition of webprotege-attestation
.
environment:
- webprotege.mongodb.host=wpmongo
- ADDRESS_ATTESTATION=<the smart contract address>
- PROVIDER_HOST=<host name of the RPC endpoint provider>
- PROVIDER_PORT=<port of the RPC endpoint provider>
The evaluation dataset and test results can be found in the folder dataset/
.
The tests require the ontologies to be placed in src/test/resources/ontologies
.
Configuration of the test blockchain provider are located in src/test/resources/configuration
. The tests use the JUnit
framework and can thus be run manually by an appropriate runner, e.g., through Intellij.