WebProtégé Documentation

repository·master·Indexed 20 days ago

https://github.com/protegeproject/webprotege

An open-source, collaborative ontology development environment supporting OWL 2 and OBO ontologies. This documentation provides instructions for building from source using Maven, running in SuperDev Mode, and deploying via Docker Compose with MongoDB integration.

Tokens
1.5K
Snippets
6
Records
8
Agent score
23%

What's inside WebProtégé

  1. Run WebProtégé using Docker Compose

    master

    You can run WebProtégé and MongoDB using Docker containers. This method uses pre-built images from Docker Hub.

    Setup Steps:

    1. Start the containers in the background.
    2. Create an admin account using the CLI tool inside the container.
    3. Access the settings page to configure the system.

    Data Persistence: Data is persisted in the following local directories relative to your docker-compose.yml file:

    • WebProtégé data: ./.protegedata/protege
    • MongoDB data: ./.protegedata/mongodb

    Note: You can modify these paths in docker-compose.yml.

    ```bash
    # 1. Start containers
    docker-compose up -d
    
    # 2. Create admin user
    docker exec -it webprotege java -jar /webprotege-cli.jar create-admin-account

    After running these, navigate to http://localhost:5000/#application/settings to define the System notification email address and application host URL, and to enable User creation, Project creation, and Project import.

  2. Build WebProtégé from source

    master

    To build the WebProtégé .war file from the source code, clone the repository and use Maven to package the project. The resulting .war file will be located in the webprotege-server directory.

    git clone https://github.com/protegeproject/webprotege.git
    cd webprotege
    mvn clean package
  3. Build and deploy a custom WebProtégé Docker image

    master

    If you need to build a custom image from the latest source code (e.g., the master branch), follow these steps. This process compiles the entire application inside Docker, so you do not need Java or Maven installed locally.

    1. Clone and enter the repository:
      git clone https://github.com/protegeproject/webprotege.git
      cd webprotege
    2. Build the image: Use docker build. You must provide a WEBPROTEGE_VERSION build argument that matches the <version> tag in the project's pom.xml (e.g., 5.0.0-SNAPSHOT).
      docker build -t protegeproject/webprotege:latest-dev --build-arg WEBPROTEGE_VERSION=5.0.0-SNAPSHOT .
    3. Configure Docker Compose to use your local image: Create a docker-compose.override.yml file in the project root to point to your latest-dev tag:
      version: "3"
      
      services:
        webprotege:
          image: protegeproject/webprotege:latest-dev
    4. Start the services:
      docker-compose up -d
    5. Complete Setup: Follow the admin account creation and settings configuration steps described in the Running from Docker section.
  4. Run WebProtégé in SuperDev Mode using Maven

    master

    For development purposes, you can run WebProtégé in SuperDev Mode. This requires running two separate processes in two different terminal windows: the GWT code server and the Tomcat server.

    ```bash
    # Terminal 1: Start the GWT code server
    mvn gwt:codeserver
    
    # Terminal 2: Start the tomcat server
    mvn -Denv=dev tomcat7:run

    After starting both, access the application at http://localhost:8080.

  5. Deploy WebProtégé using Docker Compose

    master

    You can deploy the full WebProtégé stack using Docker Compose. The setup includes two services: webprotege (the application) and wpmongo (the MongoDB database).

    By default, the application is accessible on port 5000 of your host machine, which maps to port 8080 inside the container. Data for both MongoDB and WebProtégé is persisted in local directories under ./.protegedata/.

    version: "3"
    
    services:
    
    wpmongo:
        container_name: webprotege-mongodb
        image: mongo:4.1-bionic
        restart: unless-stopped
        volumes: 
          - ./.protegedata/mongodb:/data/db
    
    webprotege:
        container_name: webprotege
        image: protegeproject/webprotege
        depends_on:
          - wpmongo
        restart: unless-stopped
        environment:
          - webprotege.mongodb.host=wpmongo
        volumes: 
        - ./.protegedata/protege:/srv/webprotege
        ports:
          - 5000:8080
  6. Configure WebProtégé environment variables

    master

    When running WebProtégé via Docker, you can configure the connection to the MongoDB instance using environment variables.

    Key variable:

    • webprotege.mongodb.host: Specifies the hostname/address of the MongoDB server. In the standard Docker Compose setup, this is set to wpmongo.
    environment:
      - webprotege.mongodb.host=wpmongo
  7. Configure WebProtégé data persistence and ports

    master

    The WebProtégé Docker container uses volumes and port mappings that can be customized:

    Volumes

    • ./.protegedata/protege maps to /srv/webprotege inside the container. This is used for application-specific data persistence.

    Ports

    • The host port 5000 is mapped to the container port 8080. You can change the host port to access the application on a different port.