Starting from a domain-specific .txt file:
- Automatic extraction of:
- Classes
- Object properties
- Data properties
- Generation of:
- Structured JSON ontology
- Interactive HTML graph representing ontological relations
- Explicit semantic constraints:
- No classes or relations are invented
- Only information explicitly present in the text is considered
- ISA relations are expressed using
is_a
.
├── data/
│ ├── input_text/ # .txt files
│ ├── ontology/ # .graphol file
│ └── validation_set/ # .xlsx files
├── results/
│ ├── json/ # Ontology outputs (JSON)
│ ├── kg/ # Interactive HTML Knowledge Graphs
│ └── analysis/ # CSV with results analysis (Confusion Matrices)
└── WebApp_llm-ontology-designer.py # Streamlit application
└── README.md
Execute 'pip install -r requirements.txt' from terminal
- streamlit
- openai
- rdflib
- pyvis
- python-dotenv
- pandas
- Clone the repository:
git clone <repository-url>
cd ontologIA
- (Optional but recommended) Create a virtual environment and install dependencies:
pip install -r requirements.txt
- Create a .env file in the project root: OPENAI_API_KEY=your_api_key_here
- Run the application: From terminal:
streamlit run WebApp_OntologIA.py
The interface guides the user step by step through:
- Selection of the process type (Direct / Inverse)
- Selection or upload of the input file
- Use or customization of the prompt
- Execution of the process
- Visualization and download of results
All files are saved with automatic versioning to prevent overwriting.
State-driven pipeline to prevent inconsistent executions Explicit and editable prompts for transparency in LLM usage Clear separation between inputs, temporary files, and final results Semantic visualization through interactive graphs Controlled session state management
JSON parsing assumes well-formed model output No formal OWL/RDF validation is currently implemented The project is intended for prototyping, research, and experimentation
Automatic export to OWL / RDF Ontology semantic validation Multilingual support Execution history tracking Ontology comparison tools
This project was developed as an experimental tool for exploring and mediating between natural language and formal ontologies.