MeAd – Medical Web Advisor

A Scholarly Technical Report

Authors
Team M&G (MeAd project team)
Repository
MeAd - Medical Web Advisor
Version
January 2026
License
MIT License

Table of Contents

  1. Introduction
    1. System Architecture Overview
    2. Technology Stack
    3. C4 Architecture Diagrams
  2. Internal Data Structures / Models
    1. Overview of Data Structures
    2. Conditions Service Data Models
    3. Geography Service Data Models
    4. RDF Model and Apache Jena Integration
    5. Vocabulary and Taxonomy Choices
  3. Technical API Documentation
    1. RESTful API Architecture
    2. Conditions Service API
    3. Geography Service API
  4. RDF-Based Knowledge Model
    1. Ontology Design Decisions
    2. Knowledge Graph Structure
  5. External Data Sources and SPARQL Integration
    1. Wikidata Knowledge Base Integration
    2. DBpedia Enrichment Strategies
    3. Non-trivial SPARQL Query Patterns
    4. Conformance to Linked Data Principles
  6. User Guide
    1. Case Study 1: Exploring a Medical Condition
    2. Case Study 2: Exploring Geographic Data
  7. Video Demonstration
  8. References

Abstract

MeAd (Medical Web Advisor) is a web-based platform designed to provide high-school students with an educational experience exploring medical conditions and understanding how health topics connect to population context in specific geographic regions. The solution combines a React-based single-page application frontend with multiple Spring Boot microservices that provide structured data and enrichment from external knowledge bases.

The project implements a comprehensive RDF-based knowledge model using the schema.org vocabulary, with data stored in Apache Jena datasets and exposed via RESTful APIs. The system enriches entities dynamically using SPARQL queries against the Wikidata and DBpedia public endpoints, employing asynchronous parallel fetching with Java's CompletableFuture for optimal performance.

The architecture consists of two primary microservices: mead-conditions-service managing medical conditions with external knowledge enrichment, and mead-geography-service handling geographic locations (continents, countries, cities) with Linked Data connections. Both services expose SPARQL endpoints enabling direct RDF querying, ensuring full compatibility with Linked Data principles.

1. Introduction

Medical education for high-school students often lacks interactive, structured exploration tools that connect health conditions to real-world geographic and demographic context. MeAd addresses this gap by providing a multimedia experience that allows students to explore:

The platform is built around a microservices architecture with the following components:

1.1 System Architecture Overview

1.2 Technology Stack

Layer Technology Purpose
Frontend React 18, Vite, React Router Single-page application with component-based UI
Backend Spring Boot 3.x, Java 17+ RESTful microservices with dependency injection
RDF Storage Apache Jena In-memory RDF dataset with transaction support
Data Format Turtle (.ttl), JSON-LD compatible RDF serialization and API responses
External APIs Wikidata SPARQL, DBpedia SPARQL Knowledge enrichment via federated queries

1.3 C4 Architecture Diagrams

The MeAd architecture is documented using the C4 model (Context, Container, Component, Code), which provides different levels of abstraction for understanding the system.

C4 Context Diagram

The context diagram shows the MeAd Medical Web Advisor system in relation to its users and external systems. The primary user (High-school student) accesses the platform via browser. The system interacts with multiple external data sources: Wikidata SPARQL and DBpedia SPARQL for data enrichment, WikiDoc API for medical summaries, and Wikipedia REST API for geographic summaries.

C4 Context Diagram
Figure 1. C4 Context Diagram - MeAd system in the context of users and external systems.

C4 Container Diagram

The container diagram details the main components of the MeAd system:

All containers communicate via HTTP/JSON, and the backend services query external SPARQL endpoints for additional data.

C4 Container Diagram
Figure 2. C4 Container Diagram - MeAd containers and their relationships.

C4 Component Diagram - Conditions Service

The component diagram for mead-conditions-service shows the internal architecture:

C4 Component Diagram - Conditions Service
Figure 3. C4 Component Diagram - Internal components of mead-conditions-service.

C4 Component Diagram - Geography Service

The component diagram for mead-geography-service has a similar structure:

C4 Component Diagram - Geography Service
Figure 4. C4 Component Diagram - Internal components of mead-geography-service.

Each service loads its RDF dataset at startup into an in-memory Apache Jena transactional dataset. The datasets are loaded from Turtle files located under src/main/resources/rdf. For the conditions service, enrichment is performed by contacting Wikidata and DBpedia SPARQL endpoints in parallel, then merging, normalizing, and caching results.

2. Internal Data Structures / Models

The internal data structures define how medical conditions and geographic locations are represented within the application. The core data model is designed to capture essential properties, relationships, and classifications in a structured format that aligns with schema.org vocabulary. Both microservices use Java records for immutable data transfer objects (DTOs) and repository patterns for data access. Each entity includes schema:sameAs links to external knowledge bases (Wikidata and DBpedia) for Linked Data interoperability.

2.1 Overview of Data Structures

The primary entities in the system are MedicalCondition and Place. Each entity is associated with various attributes that describe its properties and external Linked Data links to Wikidata and DBpedia knowledge bases.

Entity RDF Type Count Service
MedicalCondition schema:MedicalCondition 51 conditions mead-conditions-service
Place schema:Place 43 locations mead-geography-service

2.2 Conditions Service Data Models

The conditions service uses Java records to represent data at different layers:

Repository Layer: Condition Record

public record Condition(
    String identifier,    // Stable slug: "asthma", "type-2-diabetes"
    String name,          // Display label: "Asthma", "Type 2 diabetes"
    List<String> sameAs   // External URIs: Wikidata, DBpedia links
) {}

API Layer: ConditionSummary (List View)

public record ConditionSummary(
    String id,            // Same as identifier
    String name,          // Human-readable name
    List<String> sameAs   // External knowledge base links
) {}

API Layer: ConditionDetail (Enriched View)

public record ConditionDetail(
    String context,       // "https://schema.org/"
    String id,            // Full URI: "https://mead.example/condition/asthma"
    String type,          // "MedicalCondition"
    String identifier,    // Slug identifier
    String name,          // Display name
    String description,   // From DBpedia/Wikidata (dbo:abstract, schema:description)
    List<String> images,  // Normalized image URLs from P18, dbo:thumbnail, foaf:depiction
    List<String> symptoms,     // From P780 (Wikidata) or dbo:symptom (DBpedia)
    List<String> riskFactors,  // From P5642 (Wikidata) or dbo:medicalCause (DBpedia)
    List<String> sameAs,       // External URIs for linked data traversal
    String wikidocSnippet      // Curated student-friendly summary (50 files)
) {}

Enrichment Records

// From WikidataClient
public record WikidataEnrichment(
    String description,
    List<String> symptoms,
    List<String> riskFactors,
    List<String> images
) {}

// From DbpediaClient
public record DbpediaEnrichment(
    String description,
    List<String> symptoms,
    List<String> riskFactors,
    List<String> images
) {}

2.3 Geography Service Data Models

The geography service manages 43 geographic locations including continents (Europe, Asia, Africa, North America, South America, Antarctica), countries (Romania, Germany, France, Spain, Italy, United States, United Kingdom, Japan, Canada, Australia, China, India, Brazil, Mexico, Egypt, South Korea), and cities (Bucharest, Berlin, Paris, Madrid, Rome, New York City, London, Tokyo, and many more).

Place Records

// Repository layer
public record Region(
    String identifier,           // "romania", "bucharest", "europe"
    String name,                 // "Romania", "Bucharest", "Europe"
    List<String> sameAs          // Wikidata/DBpedia URIs for Linked Data
) {}

// API layer
public record RegionSummary(String id, String name) {}

public record RegionDetail(
    String context,              // "https://schema.org/"
    String id,                   // Full URI: "https://mead.example/region/romania"
    String type,                 // "Place"
    String identifier,           // Slug identifier
    String name,                 // Display name
    List<String> sameAs          // External URIs for linked data traversal
) {}

Example Places in the Dataset

Category Examples Count
Continents Europe, Asia, Africa, North America, South America, Antarctica 6
Countries Romania, Germany, France, Spain, Italy, USA, UK, Japan, Canada, Australia, China, India, Brazil, Mexico, Egypt, South Korea 16
Cities Bucharest, Iași, Cluj-Napoca, Timișoara, Brașov, Berlin, Paris, Madrid, Rome, New York City, Washington D.C., London, Tokyo, Ottawa, Canberra, Beijing, New Delhi, Brasília, Mexico City, Cairo, Seoul 21

2.4 RDF Model and Apache Jena Integration

Both microservices use Apache Jena with in-memory datasets loaded from Turtle (.ttl) files at startup. Data is stored as RDF triples (subject-predicate-object).

Example (Turtle format):

@prefix schema: <https://schema.org/> .
@prefix condition: <https://mead.example/condition/> .

condition:asthma a schema:MedicalCondition ;
    schema:identifier "asthma" ;
    schema:name "Asthma"@en ;
    schema:sameAs <https://www.wikidata.org/entity/Q35869>, <http://dbpedia.org/resource/Asthma> .

The conditions service has 51 medical conditions, the geography service has 43 locations - each with schema:sameAs links to Wikidata and DBpedia.

2.5 Vocabulary and Taxonomy Choices

The ontology is structured around core concepts using schema.org vocabulary. This choice ensures interoperability with the broader Semantic Web and Linked Data ecosystem, as schema.org is widely adopted by major search engines and linked data applications.

In RDF/OWL terminology, classes define the type of an entity (used with rdf:type or a in Turtle syntax), while properties (also called predicates) define relationships or attributes that connect a subject to a value.

Classes Used

ClassURIUsageService
MedicalConditionschema:MedicalConditionRepresents diseases, disorders, allergies (51 entities)conditions
Placeschema:PlaceRepresents geographic locations - continents, countries, cities (43 entities)geography

Properties Used

PropertyURIDescription
identifierschema:identifierStable slug for API access (e.g., "asthma", "romania", "bucharest")
nameschema:nameHuman-readable label with language tags (@en)
sameAsschema:sameAsLinks to external knowledge bases (Wikidata, DBpedia URIs)

External Vocabulary Mappings

When querying external knowledge bases, the system maps to their vocabularies:

SourceNamespaceProperties Used
Wikidatawdt: (http://www.wikidata.org/prop/direct/)P780 (symptoms), P5642 (risk factors), P18 (image)
DBpedia Ontologydbo: (http://dbpedia.org/ontology/)symptom, medicalCause, abstract, thumbnail
DBpedia Propertydbp: (http://dbpedia.org/property/)symptoms, causes, complications, image
FOAFfoaf: (http://xmlns.com/foaf/0.1/)depiction (images)

3. Technical API Documentation

The application exposes Spring Boot-based RESTful APIs that interact with the underlying RDF datasets. Each microservice provides endpoints to retrieve lists, fetch detailed information, and execute SPARQL queries against the internal knowledge graph.

3.1 RESTful API Architecture

The APIs follow REST architectural principles:

3.2 Conditions Service API

The Conditions Service provides RESTful access to medical condition data. It serves both lightweight summaries for listing/search and enriched details that aggregate data from Wikidata, DBpedia, and WikiDoc API.

Endpoints Overview

MethodEndpointDescriptionResponse
GET /api/v1/conditions List all 50 medical conditions ConditionSummary[]
GET /api/v1/conditions/{id} Get enriched details for a specific condition ConditionDetail
GET /api/v1/health Health check for monitoring {"status":"OK"}

Response Models

ConditionSummary

Lightweight representation used in list responses. Contains only essential identification data:

FieldTypeDescription
idstringURL-safe identifier (slug) for API access
namestringHuman-readable condition name
sameAsstring[]Links to Wikidata and DBpedia entities

Example:

GET /mead-conditions-service/api/v1/conditions

[
  { "id": "asthma", "name": "Asthma", "sameAs": ["https://www.wikidata.org/entity/Q35869", "http://dbpedia.org/resource/Asthma"] },
  { "id": "type-2-diabetes", "name": "Type 2 diabetes", "sameAs": ["https://www.wikidata.org/entity/Q3025883", "http://dbpedia.org/resource/Type_2_diabetes"] }
  // ... 48 more conditions
]
ConditionDetail

Full representation with enriched data from external sources. Uses schema.org vocabulary for semantic interoperability:

FieldTypeSourceDescription
contextstringstaticSchema.org vocabulary reference (https://schema.org/)
idstringlocal RDFCanonical URI for this condition
typestringlocal RDFAlways "MedicalCondition"
identifierstringlocal RDFURL-safe slug
namestringlocal RDFHuman-readable name
descriptionstringWikidata/DBpediaLong-form description (dbo:abstract or schema:description)
symptomsstring[]Wikidata/DBpediaList of associated symptoms
riskFactorsstring[]Wikidata/DBpediaContributing risk factors or causes
imagesstring[]Wikidata/DBpediaURLs to relevant images
sameAsstring[]local RDFExternal entity URIs (Linked Data)
wikidocSnippetstringWikiDoc APIStudent-friendly educational summary

Example:

GET /mead-conditions-service/api/v1/conditions/asthma

{
  "context": "https://schema.org/",
  "id": "https://mead.example/condition/asthma",
  "type": "MedicalCondition",
  "identifier": "asthma",
  "name": "Asthma",
  "description": "long-term disease involving inflamed airways",
  "images": [
    "https://commons.wikimedia.org/wiki/Special:FilePath/Asthma.jpg",
    "https://commons.wikimedia.org/wiki/Special:FilePath/Asthma_attack.png"
  ],
  "symptoms": ["wheeze", "cough", "inflammation", "chest pain"],
  "riskFactors": ["air pollution", "smoking"],
  "sameAs": [
    "https://www.wikidata.org/entity/Q35869",
    "http://dbpedia.org/resource/Asthma"
  ],
  "wikidocSnippet": "Asthma is a long-term condition that affects the airways..."
}

3.3 Geography Service API

The Geography Service provides RESTful access to geographic location data. It serves both lightweight summaries for listing and enriched details that aggregate data from Wikidata, DBpedia, and WikiDoc API.

Endpoints Overview

MethodEndpointDescriptionResponse
GET /api/v1/regions List all 43 geographic locations RegionSummary[]
GET /api/v1/regions/{id} Get enriched details for a specific region RegionDetail
GET /api/v1/health Health check for monitoring {"status":"OK"}

Response Models

RegionSummary

Lightweight representation used in list responses:

FieldTypeDescription
idstringURL-safe identifier (slug) for API access
namestringHuman-readable location name
typestringResolved type from Wikidata (country, city, continent, or Place)
sameAsstring[]Links to Wikidata and DBpedia entities

Example:

GET /mead-geography-service/api/v1/regions

[
  { "id": "romania", "name": "Romania", "type": "country", "sameAs": ["https://www.wikidata.org/entity/Q218", "http://dbpedia.org/resource/Romania"] },
  { "id": "bucharest", "name": "Bucharest", "type": "city", "sameAs": ["https://www.wikidata.org/entity/Q19660", "http://dbpedia.org/resource/Bucharest"] },
  { "id": "europe", "name": "Europe", "type": "continent", "sameAs": ["https://www.wikidata.org/entity/Q46", "http://dbpedia.org/resource/Europe"] }
  // ... 40 more regions
]
RegionDetail

Full representation with enriched data from external sources:

FieldTypeSourceDescription
contextstringstaticSchema.org vocabulary reference
idstringlocal RDFCanonical URI for this region
typestringWikidataResolved type (country, city, continent, or Place)
identifierstringlocal RDFURL-safe slug
namestringlocal RDFHuman-readable name
descriptionstringWikidata/DBpediaLong-form description
populationTotalstringWikidata/DBpediaTotal population count
populationDensitystringWikidata/DBpediaPopulation per km² (calculated)
climatesstring[]Wikidata/DBpediaClimate types (Köppen classification)
industrialDevelopmentstring[]Wikidata/DBpediaMajor industries in the region
culturalFactorsstring[]Wikidata/DBpediaLanguages, demonyms, cultural info
imagesstring[]Wikidata/DBpediaURLs to relevant images
sameAsstring[]local RDFExternal entity URIs (Linked Data)
wikidocSnippetstringWikiDoc APIStudent-friendly educational summary

Example:

GET /mead-geography-service/api/v1/regions/romania

{
  "context": "https://schema.org/",
  "id": "https://mead.example/region/romania",
  "type": "country",
  "identifier": "romania",
  "name": "Romania",
  "description": "Romania is a country in Southeastern Europe...",
  "populationTotal": "19053815",
  "populationDensity": "80.12",
  "climates": ["humid continental climate", "oceanic climate"],
  "industrialDevelopment": ["automotive industry", "information technology"],
  "culturalFactors": ["Romanian", "Romanians"],
  "images": ["https://commons.wikimedia.org/wiki/Special:FilePath/Romania_location_map.svg"],
  "sameAs": [
    "https://www.wikidata.org/entity/Q218",
    "http://dbpedia.org/resource/Romania"
  ],
  "wikidocSnippet": "Romania is a country located in southeastern Europe..."
}

4. RDF-Based Knowledge Model

This section describes the design decisions, expressiveness, and real-world usage of the RDF-based knowledge models employed by MeAd. The system uses a lightweight yet expressive ontology based on schema.org vocabulary, extended through linked data connections to established knowledge bases.

4.1 Ontology Design Decisions

The knowledge model follows these design principles:

Namespace Definitions

@prefix schema:    <https://schema.org/> .
@prefix condition: <https://mead.example/condition/> .   # Medical conditions namespace (51 entities)
@prefix region:    <https://mead.example/region/> .      # Geographic locations namespace (43 entities)
@prefix xsd:       <http://www.w3.org/2001/XMLSchema#> . # XML Schema datatypes

Entity URI Patterns

Entity TypeURI PatternExample
Conditionhttps://mead.example/condition/{slug}condition:asthma (51 entities)
Region/Placehttps://mead.example/region/{slug}region:romania, region:bucharest (43 entities)

4.2 Knowledge Graph Structure

The system maintains two separate RDF knowledge graphs loaded into Apache Jena datasets:

Conditions Knowledge Graph Statistics

MetricCount
Medical Conditions51
External Links (sameAs)102 (2 per condition: Wikidata + DBpedia)
WikiDoc SnippetsAvailable for select conditions
Approximate Triple Count~260 triples

Geography Knowledge Graph Statistics

MetricCount
Geographic Locations (Places)43
Continents6
Countries16
Cities21
External Links (sameAs)86 (2 per location: Wikidata + DBpedia)
Approximate Triple Count~220 triples

[Knowledge graph visualization showing conditions linked to Wikidata/DBpedia. Suggested file: docs/images/knowledge-graph.png]

Figure 2. Knowledge graph structure showing internal entities and external knowledge base connections.

5. External Data Sources and SPARQL Integration

MeAd integrates external data using SPARQL queries against public knowledge bases. The two primary sources are Wikidata (structured, multilingual facts) and DBpedia (Wikipedia-derived knowledge), with the WikiDoc API providing curated student-friendly medical summaries.

5.1 Wikidata Knowledge Base Integration

The WikidataClient fetches enriched data from Wikidata's SPARQL endpoint. All queries run in parallel using CompletableFuture for optimal performance.

Data Retrieved

DataWikidata PropertyExample (Asthma)
Descriptionschema:description"chronic lung disease"
Symptomswdt:P780wheezing, coughing, chest tightness
Risk Factorswdt:P5642allergies, air pollution, smoking
Imageswdt:P18Wikimedia Commons URLs

Example SPARQL Query (Symptoms)

SELECT DISTINCT ?symptomLabel WHERE {
  wd:Q35869 wdt:P780 ?symptom .
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
} LIMIT 30

5.2 DBpedia Enrichment Strategies

The DbpediaClient fetches Wikipedia-derived data from DBpedia's SPARQL endpoint. It uses fallback chains to maximize data coverage when primary properties are empty.

Data Retrieved with Fallback Strategy

DataPrimary SourceFallback
Descriptiondbo:abstractdbo:descriptionrdfs:comment
Symptomsdbo:symptom + rdfs:labeldbp:symptoms (literals)
Risk Factorsdbo:medicalCausedbp:causesdbp:complications
ImagesUNION: dbo:thumbnail, foaf:depiction, schema:image, dbp:image

Example SPARQL Query (Images with UNION)

SELECT DISTINCT ?img WHERE {
  { <http://dbpedia.org/resource/Asthma> dbo:thumbnail ?img . }
  UNION { <http://dbpedia.org/resource/Asthma> foaf:depiction ?img . }
  UNION { <http://dbpedia.org/resource/Asthma> schema:image ?img . }
} LIMIT 10

5.3 Non-trivial SPARQL Query Patterns

The system uses advanced SPARQL patterns to maximize data coverage from external knowledge bases.

Query 1: Wikidata Label Service

Fetches symptoms for a condition using Wikidata's built-in label resolution service:

PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX bd: <http://www.bigdata.com/rdf#>

SELECT DISTINCT ?symptomLabel WHERE {
  wd:Q35869 wdt:P780 ?symptom .
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
} LIMIT 30

Pattern: The SERVICE wikibase:label automatically resolves entity URIs to human-readable labels (e.g., Q35869 → "Asthma").

Query 2: UNION for Multiple Image Sources (DBpedia)

Combines multiple image predicates to maximize coverage:

PREFIX dbo: <http://dbpedia.org/ontology/>
PREFIX dbp: <http://dbpedia.org/property/>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX schema: <http://schema.org/>

SELECT DISTINCT ?img WHERE {
  { <http://dbpedia.org/resource/Romania> dbo:thumbnail ?img . }
  UNION { <http://dbpedia.org/resource/Romania> foaf:depiction ?img . }
  UNION { <http://dbpedia.org/resource/Romania> schema:image ?img . }
  UNION { <http://dbpedia.org/resource/Romania> dbp:image ?img . }
} LIMIT 10

Pattern: UNION combines results from multiple predicates, ensuring images are found regardless of which property DBpedia uses.

Query 3: Dereferencing with rdfs:label (DBpedia)

Resolves resource URIs to human-readable labels:

PREFIX dbo: <http://dbpedia.org/ontology/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>

SELECT DISTINCT ?label WHERE {
  <http://dbpedia.org/resource/Romania> dbo:officialLanguage ?langResource .
  ?langResource rdfs:label ?label .
  FILTER(LANG(?label) = "en")
} LIMIT 50

Pattern: When a property points to another resource (not a literal), we follow the link and fetch its rdfs:label for a human-readable name.

5.4 Conformance to Linked Data Principles

MeAd follows Tim Berners-Lee's four Linked Data principles:

PrincipleImplementation
1. URIs as namesEach entity has a URI: https://mead.example/condition/asthma
2. HTTP URIsAll URIs use HTTPS scheme, accessible via REST API
3. Standard formatsRDF/Turtle storage, SPARQL endpoint, schema.org vocabulary
4. Links to other URIsschema:sameAs links to Wikidata and DBpedia for each entity

6. User Guide

Use Cases

Case Study 1: Exploring a Medical Condition

Search conditions
Search: Users can filter conditions by typing in the search bar. The list updates instantly, showing matching conditions (e.g., "Anemia", "Iron deficiency anemia"). Clicking "View details" opens the condition detail page.
Condition details
Detail: The condition page displays enriched information from Wikidata and DBpedia: image carousel, description, symptoms (e.g., "Headache", "Blurred vision"), and risk factors.

Case Study 2: Exploring Geographic Data

Geography regions list
List: The Geography service provides 43 locations organized by type (continents, countries, cities). Each location shows its name, type, and Linked Data references.
Geography region details
Detail: Each region displays enriched data from Wikidata: population, climate types, industries, cultural factors, and images.

7. Video Demonstration

A comprehensive video demonstration showing the MeAd Medical Web Advisor platform in action:

Video demonstration of the MeAd platform.

9. References

Knowledge Bases

Technologies and Frameworks