feat: Implement Unstructured Text Processor for RDF generation and semantic mapping #214
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Implements a new module that processes unstructured textual documents and maps them into the existing Semantic Layer. This enables converting extracted text (from OCR or other sources) into RDF triples and integrating them with the SemanticModel.
Type of Change
Related Issue(s)
Fixes #108
Changes Made
src/intugle/text_processor/module with:models.py: Pydantic models for Entity, Relationship, RDFTriple, RDFGraph with RDF-star supportprocessor.py: MainTextToSemanticProcessorclass for text-to-RDF conversionextractors/base.py: AbstractBaseExtractorinterface for pluggable NLP backendsextractors/llm_extractor.py: LLM-based entity and relationship extraction using LangChainrdf/builder.py:RDFBuilderclass for constructing RDF triples from extracted datamapper.py:SemanticMapperfor aligning RDF entities to existing SemanticModel nodesSemanticModel.overlay()method for integrating RDF graphsintugle text-to-semanticCLI commandTextToSemanticProcessorat package levelTesting
Test Configuration
Test Cases
Test Commands
Screenshots/Examples
Checklist
Documentation Updates
Breaking Changes
Performance Impact
Additional Context
This implementation uses LLM-based extraction (via LangChain) for flexible entity and relationship discovery. The architecture supports pluggable extractors for future backends (spaCy, Hugging Face, etc.).
Deployment Notes
No special deployment requirements. The CLI command becomes available after installation.