# Semantic Interoperability on Blockchain by Generating Smart Contracts Based on Knowledge Graphs

arXiv: https://arxiv.org/abs/2409.12171 · HTML: https://mlsanity.com/paper/2409.12171/

## Key facts

- Cited by 2 papers in the map (data through 14 Oct 2026).
- Builds on 5 of its 47 references that are in the map.
- First posted on arXiv 11 Sep 2024.

## Builds on (most cited first, 5 of 5)

- [Blockchain Technology Overview](https://mlsanity.com/paper/1906.11078/) (2019)
- [Using Large Language Models for Generating Smart Contracts for Health Insurance from Textual Policies](https://mlsanity.com/paper/2407.07019/) (2024)
- [Existential Notation3 Logic](https://mlsanity.com/paper/2308.07332/) (2023)
- [TrialChain: A Blockchain-Based Platform to Validate Data Integrity in Large, Biomedical Research Studies](https://mlsanity.com/paper/1807.03662/) (2018)
- [Predicting future state for adaptive clinical pathway management](https://mlsanity.com/paper/2010.12027/) (2020)

## Built on by (most cited first, 2 of 2)

- [Curriculum-Guided Reinforcement Learning for Synthesizing Gas-Efficient Financial Derivatives Contracts](https://mlsanity.com/paper/2509.23976/) (2025)
- [A Benchmark for Gap and Overlap Analysis as a Test of KG Task Readiness](https://mlsanity.com/paper/2604.10853/) (2026)

## Abstract (arXiv)

Background: Health 3.0 allows decision making to be based on longitudinal data from multiple institutions, from across the patient's healthcare journey. In such a distributed setting, blockchain smart contracts can act as neutral intermediaries to implement trustworthy decision making. Objective: In a distributed setting, transmitted data will be structured using standards (such as HL7 FHIR) for semantic interoperability. In turn, the smart contract will require interoperability with this standard, implement a complex communication setup (e.g., using oracles), and be developed using blockchain languages (e.g., Solidity). We propose the encoding of smart contract logic using a high-level semantic Knowledge Graph, using concepts from the domain standard. We then deploy this semantic KG on blockchain. Methods: Off-chain, a code generation pipeline compiles the KG into a concrete smart contract, which is then deployed on-chain. Our pipeline targets an intermediary bridge representation, which can be transpiled into a specific blockchain language. Our choice avoids on-chain rule engines, with unpredictable and likely higher computational cost; it is thus in line with the economic rules of blockchain. Results: We applied our code generation approach to generate smart contracts for 3 health insurance cases from Medicare. We discuss the suitability of our approach - the need for a neutral intermediary - for a number of healthcare use cases. Our evaluation finds that the generated contracts perform well in terms of correctness and execution cost ("gas") on blockchain. Conclusions: We showed that it is feasible to automatically generate smart contract code based on a semantic KG, in a way that respects the economic rules of blockchain. Future work includes studying the use of Large Language Models (LLM) in our approach, and evaluations on other blockchains.
