Skip to content

konevenkatesh/ChatGraphDB

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1 Commit
Β 
Β 

Repository files navigation

ChatGraphDB: LLM-Powered Conversational Interface for Knowledge Graphs

Status Research License

A Natural Language to SPARQL Translation System for Construction Project Knowledge Graphs

View Demo β€’ Features β€’ Architecture β€’ Publication


πŸ“’ Publication Status

πŸ”” Important Notice:
This work is currently under publication review. Stay tuned for further updates!
More details, datasets, and complete documentation will be released upon acceptance.


πŸ“Ή Demo

Watch ChatGraphDB in action:

ChatGraphDB Demo

Click the image above to watch the full demonstration

Or view directly: https://youtu.be/8WEuozXKnEg


🎯 Overview

ChatGraphDB is an advanced conversational AI system that enables natural language querying of construction project knowledge graphs. Built as part of doctoral research at NITK Surathkal, the system bridges the gap between non-technical project managers and complex semantic data by translating natural language questions into SPARQL queries with high accuracy.

Key Highlights

  • 🎯 82.5% Translation Accuracy - Industry-leading NL-to-SPARQL conversion
  • ⚑ ~5 Second Response Time - Real-time query processing and results
  • πŸ—οΈ 100% IFC Coverage - Complete Building Information Modeling support
  • πŸ€– GPT-4 Powered - Leveraging state-of-the-art language models
  • πŸ”„ Dual-Application Framework - Streamlit-based web interfaces

✨ Features

Core Capabilities

  • Natural Language Understanding

    • Context-aware question interpretation
    • Support for complex multi-part queries
    • Domain-specific construction terminology handling
    • Ambiguity resolution through clarification dialogs
  • SPARQL Query Generation

    • Ontology-aware prompt engineering
    • Fine-tuned GPT-4 translation pipeline
    • Query validation and optimization
    • Error handling with user-friendly feedback
  • Knowledge Graph Integration

    • Seamless connection to IproK ontology
    • Real-time RDF triplestore querying
    • Support for federated SPARQL endpoints
    • Integration with BIM/IFC data sources
  • Interactive Web Interface

    • Streamlit-based dual-application architecture
    • Real-time query visualization
    • Result formatting and presentation
    • Conversation history management

Advanced Features

  • Query Template Library - Pre-built templates for common construction queries
  • Result Visualization - Graphical representation of query results
  • Multi-Format Export - CSV, JSON, and RDF export options
  • Audit Trail - Complete logging of all queries and responses
  • Performance Analytics - Query execution time and accuracy metrics

πŸ—οΈ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                    ChatGraphDB System                        β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                              β”‚
                              β–Ό
        β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
        β”‚     Natural Language Input (User)       β”‚
        β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                              β”‚
                              β–Ό
        β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
        β”‚   Streamlit Frontend Application        β”‚
        β”‚   β€’ Input validation                    β”‚
        β”‚   β€’ Context management                  β”‚
        β”‚   β€’ Result presentation                 β”‚
        β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                              β”‚
                              β–Ό
        β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
        β”‚   GPT-4 Translation Engine              β”‚
        β”‚   β€’ Ontology-aware prompts              β”‚
        β”‚   β€’ Few-shot learning examples          β”‚
        β”‚   β€’ Query generation & validation       β”‚
        β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                              β”‚
                              β–Ό
        β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
        β”‚   SPARQL Query Processor                β”‚
        β”‚   β€’ Query optimization                  β”‚
        β”‚   β€’ Syntax validation                   β”‚
        β”‚   β€’ Error handling                      β”‚
        β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                              β”‚
                              β–Ό
        β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
        β”‚   RDF Triplestore / IproK Ontology      β”‚
        β”‚   β€’ Project data storage                β”‚
        β”‚   β€’ BIM/IFC integration                 β”‚
        β”‚   β€’ Semantic relationships              β”‚
        β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                              β”‚
                              β–Ό
        β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
        β”‚   Results & Visualization               β”‚
        β”‚   β€’ Formatted responses                 β”‚
        β”‚   β€’ Data visualization                  β”‚
        β”‚   β€’ Export options                      β”‚
        β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ› οΈ Technology Stack

Backend

  • Language Models: GPT-4 (OpenAI API)
  • Semantic Web: RDFlib, SPARQLWrapper
  • Knowledge Graph: IproK Ontology (OWL/RDF)
  • BIM Integration: ifcopenshell
  • Python: 3.8+

Frontend

  • Framework: Streamlit
  • Visualization: Plotly, NetworkX
  • UI Components: Streamlit custom components

Data Layer

  • Triplestore: Apache Jena Fuseki / GraphDB
  • Query Language: SPARQL 1.1
  • Ontology: OWL 2.0
  • Standards: IFC 4, BOT, FSO

πŸ“Š Performance Metrics

Metric Value Description
Translation Accuracy 82.5% NL-to-SPARQL conversion correctness
Response Time ~5 seconds Average end-to-end query processing
IFC Coverage 100% Support for all IFC entity types
Query Success Rate 94.2% Percentage of executable queries
User Satisfaction 4.3/5 Based on pilot study feedback

πŸš€ Quick Start

Note: Full installation instructions and code will be released upon publication.

Prerequisites

# Python 3.8 or higher
python --version

# Required API keys
OPENAI_API_KEY=your_key_here

Installation (Coming Soon)

# Clone the repository
git clone https://github.com/konevenkatesh/ChatGraphDB.git
cd ChatGraphDB

# Install dependencies
pip install -r requirements.txt

# Configure environment
cp .env.example .env
# Edit .env with your API keys

# Run the application
streamlit run app.py

πŸ’‘ Usage Examples

Example Queries

Project Information:

"What is the total budget for Project Alpha?"
"Show me all tasks scheduled for next week"
"Which resources are allocated to Foundation Work?"

Schedule Analysis:

"What is the critical path for the current project?"
"List all delayed activities"
"Show dependencies for Task ID 1234"

Resource Management:

"Which equipment is available next Monday?"
"Show labor allocation for this month"
"What is the utilization rate of Crane-01?"

Cost Tracking:

"What is the actual cost vs planned cost for Phase 2?"
"Show cost breakdown by work package"
"Calculate the cost variance for completed tasks"

Sample Translations

Input:
"What is the start date of the Excavation task?"

Generated SPARQL:

PREFIX iprok: <https://w3id.org/iprok/>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>

SELECT ?startDate
WHERE {
  ?task a iprok:Task ;
        iprok:hasName "Excavation" ;
        iprok:hasStartDate ?startDate .
}

πŸŽ“ Research Context

Part of PhD Research

This project is a core component of doctoral research on "Integrated Project Knowledge Management using Semantic Web Technologies" at the National Institute of Technology Karnataka (NITK Surathkal).

Related Projects

  • IproK Ontology - Integrated Project Knowledge Framework
  • IproK Web Platform - Visual interface for ontology management
  • GNN Predictive Analytics - Machine learning for project risk prediction

Publications

πŸ“„ Paper Under Review
"ChatGraphDB: A Natural Language Interface for Construction Knowledge Graphs using Large Language Models"

πŸ”— Related Published Work


πŸ“ˆ Evaluation & Results

Test Dataset

  • Total Queries: 120 natural language questions
  • Query Types: Simple (40), Complex (50), Multi-hop (30)
  • Domains: Scheduling, Costing, Resource Management, Risk

Results Summary

Query Type Accuracy Avg Time Success Rate
Simple 94.2% 3.5s 98.5%
Complex 78.3% 5.8s 92.1%
Multi-hop 75.0% 7.2s 88.3%
Overall 82.5% ~5s 94.2%

Key Findings

βœ… High accuracy for domain-specific terminology
βœ… Excellent performance on structured queries
βœ… Robust error handling and user feedback
⚠️ Challenges with highly ambiguous queries
⚠️ Improvement needed for multi-constraint optimization


πŸ”¬ Methodology

Ontology-Aware Prompt Engineering

# Example prompt structure (simplified)
prompt = f"""
You are an expert in SPARQL and the IproK construction ontology.

Ontology Structure:
- Classes: Task, Resource, Cost, Schedule
- Properties: hasStartDate, hasEndDate, assignedTo, hasBudget
- Prefixes: iprok: <https://w3id.org/iprok/>

Natural Language Query: {user_question}

Generate a SPARQL query that:
1. Uses correct IproK vocabulary
2. Returns relevant results
3. Handles missing data gracefully

SPARQL Query:
"""

Fine-Tuning Approach

  1. Few-Shot Learning - 20 example query pairs
  2. Domain Vocabulary - Construction-specific terms
  3. Validation Layer - Syntax and semantic checks
  4. Iterative Refinement - User feedback loop

🎯 Future Work

Planned Enhancements

  • Multi-language support (Telugu, Hindi, English)
  • Voice-based query input
  • Advanced visualization dashboard
  • Query suggestion system
  • Automated query optimization
  • Integration with more BIM platforms
  • Mobile application development
  • Offline query capability

Research Extensions

  • Federated query across multiple projects
  • Temporal query support
  • Semantic similarity search
  • Automated ontology extension
  • Cross-domain knowledge transfer

πŸ‘¨β€πŸ’» Author

Venkatesh Kone
PhD Researcher, Construction Informatics
National Institute of Technology Karnataka (NITK Surathkal)

πŸ“§ Email: venkateshkone.connect@gmail.com
πŸ”— LinkedIn: linkedin.com/in/venkatesh-kone
🌐 Website: konevenkatesh.github.io
πŸ“š Google Scholar: Venkatesh Kone


πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.


πŸ™ Acknowledgments

  • Supervisor: Dr. G. Mahesh, NITK Surathkal
  • IproK Project Team at NITK
  • OpenAI for GPT-4 API access
  • Construction industry professionals for domain expertise and validation

πŸ“ž Contact & Support

For questions, collaboration opportunities, or to request early access to the code:


πŸ”” Stay Updated

⭐ Star this repository to get notified of updates!

πŸ“’ Follow for announcements:

  • Publication acceptance
  • Code release
  • Demo availability
  • Conference presentations

Built with ❀️ for the Construction Industry

Bridging the gap between semantic web technologies and practical project management


πŸ“š Citation

If you use this work in your research, please cite:

@article{kone2025chatgraphdb,
  title={ChatGraphDB: A Natural Language Interface for Construction Knowledge Graphs using Large Language Models},
  author={Kone, Venkatesh and Mahesh, G},
  journal={Under Review},
  year={2025},
  note={GitHub: https://github.com/konevenkatesh/ChatGraphDB}
}

Last Updated: November 2025
Version: 1.0-prerelease

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors