trustgraph/trustgraph-flow
Wei Xu f106ae2103
fix: preserve non-ASCII entity names in ontology URI normalization (#1036)
The entity URI normalizer stripped every non-ASCII character via the
ASCII-only patterns `[^a-z0-9\-.]` and `[^a-z0-9\-]`. For non-Latin
entity names (e.g. Chinese), this deleted the entire name, so distinct
entities collapsed onto the same URI (".../<ontology>/-"), silently
merging unrelated nodes and breaking OntoRAG for non-English content.

Switch both filters to `[^\w\-.]` / `[^\w\-]`. In Python 3, `\w` is
Unicode-aware for str patterns, so non-ASCII letters (CJK, etc.) are
preserved while punctuation and symbols are still removed. ASCII
behaviour is unchanged: names are lowercased and underscores converted
to hyphens before the filter runs, so for ASCII input the patterns are
equivalent to the originals.

Adds tests covering ASCII regression guards and non-ASCII names/types,
including the core case that two distinct Chinese entities must not
collapse onto the same URI.

Co-authored-by: arthurxuwei <5179840+arthurxuwei@users.noreply.github.com>
2026-07-09 00:05:35 +01:00
..
trustgraph fix: preserve non-ASCII entity names in ontology URI normalization (#1036) 2026-07-09 00:05:35 +01:00
pyproject.toml feat: hybrid retrieval (BM25 + vector RRF fusion) for document-RAG (#875) (#1030) 2026-07-07 12:54:02 +01:00
README.md Maint/fix build env (#84) 2024-09-30 19:47:09 +01:00