Skip to content

Latest commit

 

History

History
56 lines (47 loc) · 2.86 KB

File metadata and controls

56 lines (47 loc) · 2.86 KB

Ontology attestation and verification module for WebProtégé

A module for WebProtégé, implementing an approach for ontology attestation. See also the usage guide.

Development requirements

Building the module

The module can be compiled and installed locally with mvn clean install. The smart contracts need to be compiled and deployed separately.

Compiling and deploying the smart contracts

The scripts folder contains utilities for compiling and deploying the contracts.

  1. Compile solidity contracts (requires solc):

    sh ./compile-contracts.sh
    
  2. Generate Java contract interfaces and wrappers (only needed for development purposes, requires web3j-cli and solc):

    sh ./generate-contract-wrappers.sh
    
  3. 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
    
  4. 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").

  5. Deploy contracts (execute from the scripts folder, requires node and npm): The connection to the chain is confiigured in the .env file in the same folder and is pre-configured for Ganache as started by docker-compose.yml.

    npm install
    npm run deploy
    

Configuration

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>  

Dataset & Running the tests

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.