Bohemian - SysML Model Viewer

Bohemian is a SysML model viewer and IDL code generator for IBM Rhapsody projects. It provides a graphical interface for exploring SysML models and can automatically generate OMG IDL files suitable for DDS deployment in GVA systems.

Bohemian Domain Diagram

Overview

Bohemian provides the following capabilities:

  • Rhapsody Project Loading: Parse and display IBM Rhapsody .rpyx project files and .sbsx model files
  • Model Navigation: Tree-based navigation of packages, classes, types, and relationships
  • Diagram Visualization: Interactive block diagram canvas showing class structures and dependencies
  • IDL Code Generation: Export SysML models to OMG IDL format for DDS communication
  • LDM Pattern Detection: Automatic detection of GVA Land Data Model patterns in models

Running Bohemian

Basic Usage

# Launch the GUI
./build/bin/bohemian

# Open a specific Rhapsody project
./build/bin/bohemian /path/to/project.rpyx

Command Line Options

Option Description
-e, --export-idl <dir> Export IDL files to directory and exit (headless mode)
-h, --help Display help information
--version Display version information
<project> Rhapsody project file (.rpyx) to open

Headless IDL Export

For automated builds or CI/CD pipelines, Bohemian can export IDL files without launching the GUI:

# Export IDL from a project file
./build/bin/bohemian --export-idl ./output/idl /path/to/project.rpyx

# Export IDL from a directory of .sbsx files
./build/bin/bohemian --export-idl ./output/idl /path/to/model/directory

User Interface

Main Window Layout

The Bohemian interface consists of three main panels:

  1. Model Tree (left): Hierarchical view of all model elements
  2. Diagram Canvas (center): Visual representation of blocks and relationships
  3. Properties Panel (right): Detailed information about selected elements

Class Diagram View

The diagram canvas displays SysML blocks with their attributes, operations, and relationships:

Bohemian Class Diagram - Actuators

Interaction Diagram View

Bohemian supports visualization of SysML interaction models (sequence diagrams) showing message flows between objects:

Bohemian Interaction Model

State Chart View

State machine diagrams display the behavioral states and transitions for classes:

Bohemian State Chart

View Controls

Shortcut Action
Ctrl++ Zoom in
Ctrl+- Zoom out
Ctrl+0 Reset zoom to 100%
Ctrl+F Zoom to fit all elements

IDL Code Generation

Bohemian generates OMG IDL files following the GVA Translator Guide (Issue 1.2) mapping rules:

SysML Element IDL Output
Package IDL module (P_<PackageName>)
Class IDL struct (C_<ClassName>)
Enumeration Type IDL enum (T_<TypeName>)
Structure Type IDL struct (T_<TypeName>)
Typedef IDL typedef
Attribute Struct member (A_<AttributeName>)
Operation Command struct (C_<ClassName>_<OpName>)

Using the Export Dialog

  1. Open a Rhapsody project using File > Open Project or drag-and-drop
  2. Navigate the model tree to verify the structure
  3. Select File > Export IDL... to open the export dialog
  4. Choose the output directory
  5. Click Export to generate IDL files

Bohemian Code Generation Dialog

Export Options

The IDL exporter supports several configuration options:

  • Generate Comments: Include element descriptions from the model
  • Generate @key Annotations: Add DDS key annotations for topic identification
  • Generate DDS Annotations: Add @appendable, @mutable, @autoid, @optional annotations
  • Generate Topic Constants: Create KC_*_TopicName constants for DDS topics
  • Generate Include Guards: Add #ifndef/#define header guards

Building Generated IDL

After exporting IDL files, compile them using the AstuteDDS IDL compiler:

Using astutedds-idl

# Generate C++ code from exported IDL files
astutedds-idl -o ./generated/cpp -I ./ldm/UK/GVA/v10.0.0/IDL Alarms.idl

# Compile multiple IDL files with include paths
astutedds-idl -o ./generated/cpp \
    -I ./ldm/UK/GVA/v10.0.0/IDL \
    -I ./ldm/UK/GVA/Common \
    Sensors.idl Actuators.idl

# Generate Python bindings
astutedds-idl -l python -o ./generated/python Alarms.idl

AstuteDDS IDL Compiler Options

Option Description
-o <dir> Output directory for generated files (default: ./generated)
-l <lang> Output language: cpp (default), c, python
-I <dir> Add include search path (can be specified multiple times)
-D <macro> Define a preprocessor macro
-v Verbose output

Using the LDM SDK Build System

Alternatively, the LDM SDK's CMake configuration will automatically compile IDL files:

cd /path/to/ldm
mkdir -p build && cd build
cmake ..
make -j$(nproc)

Workflow Example

A typical workflow for using Bohemian with the LDM SDK:

  1. Design your data model in IBM Rhapsody using SysML
  2. Export the project to a .rpyx file
  3. Open the project in Bohemian to verify the structure
  4. Generate IDL files using the Export function
  5. Place IDL files in the appropriate ldm/ directory
  6. Build the LDM SDK to generate C++ types and Qt wrappers
  7. Use the generated QtWrapper*PubSub.h classes in your application

Troubleshooting

Project Won't Load

  • Ensure the .rpyx file is a valid IBM Rhapsody project
  • Check that all referenced .sbsx model files are accessible
  • Verify file permissions allow read access

IDL Export Fails

  • Confirm the output directory exists and is writable
  • Check for circular dependencies in the model
  • Review the console output for specific error messages

Diagram Not Displaying

  • Try View > Zoom to Fit to center the diagram
  • Use View > Toggle Auto Layout to reorganize elements
  • Check that the selected element has diagram content

The following documents from the LOSA Portal provide additional context for working with SysML models and IDL generation:

Document Description
LDM Methodology and Modelling Standard Issue v1.9 How to build PIMs following LDM conventions
GVA Translator Guide 2021 Issue 1.2 PIM to PSM to IDL mapping rules
LDM Adopters Guide Issue v1.1 Getting started with LDM adoption

Access these documents at https://landopensystems.mod.gov.uk

AI Agent for Domain Creation

Bohemian includes an integrated AI agent that assists with creating new LDM domains. The agent understands LDM modelling conventions, GVA patterns, and can help design data structures for integrating external systems.

Setting Up Claude API Access

Before using the AI agent, configure your Anthropic Claude API key:

  1. Obtain an API Key: Create an account at console.anthropic.com and generate an API key
  2. Open Preferences: Go to Edit > Preferences (Ctrl+,)
  3. Configure AI Settings: In the AI Agent tab, enter your API key and select your preferred model

Claude API Key Setup

Setting Description
API Key Your Anthropic Claude API key (starts with sk-ant-)
Model Claude model to use (claude-sonnet-4-20250514 recommended for best results)
API Endpoint Default: https://api.anthropic.com/v1/messages

Accessing the AI Agent

  1. Open the AI Agent panel via View > AI Agent or press Ctrl+Shift+A
  2. Verify the status indicator shows "Connected" (green)
  3. Start a conversation describing what you want to create

Creating New Domains

The AI agent excels at helping you design new domains for external system integration. For example, creating an ATAK Cursor-on-Target domain:

Creating a New Domain for ATAK Cursor-on-Target

Example workflow:

  1. Describe the external system or protocol you want to integrate
  2. The agent researches the data format and identifies key structures
  3. It proposes LDM-compliant types following naming conventions
  4. Review and refine the design interactively
  5. Export the generated IDL code

Understanding Domain Concepts

Ask the AI agent to explain complex military or technical concepts:

AI Agent Explaining Battlespace Objects

Example prompts:

Use Case Prompt
Protocol bridge "Create an LDM domain for NMEA 0183 GPS integration"
Sensor integration "Design types for a thermal camera with target detection"
C2 interface "Model artillery fire mission data following MIL-STD-6016"
External system "Create ATAK Cursor-on-Target messaging types for PLI and contacts"

AI Agent Features

  • LDM Convention Awareness - Applies P_, C_, T_, A_, L_, KC_ prefixes automatically
  • DDS Annotation Support - Adds @key, @appendable, @optional appropriately
  • Military Standards Knowledge - Understands STANAG, MIL-STD, and NATO formats
  • Step-by-Step Guidance - Walks through complex designs incrementally
  • IDL Code Generation - Produces ready-to-compile OMG IDL output