Skip to content

Commit 8e69a22

Browse files
committed
Several fixes
1 parent ff4cf42 commit 8e69a22

5 files changed

Lines changed: 22 additions & 4 deletions

File tree

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

88

9+
## [0.2.3] - 2026-02-03
10+
11+
## Added
12+
- LinkedProject now includes `relation_index` with chain location/type provenance to support LSP relation navigation.
13+
914
## [0.2.2] - 2026-01-23
1015

1116
### Fixed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "synesis"
7-
version = "0.2.2"
7+
version = "0.2.3"
88
description = "The confluence of information into intelligence - A DSL compiler that transforms qualitative research annotations into canonical knowledge structures"
99
readme = "README.md"
1010
requires-python = ">=3.10"

synesis/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
# Semantic
6565
from synesis.semantic.linker import LinkedProject
6666

67-
__version__ = "0.2.1"
67+
__version__ = "0.2.3"
6868
__all__ = [
6969
# API em memoria
7070
"load",

synesis/cli.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
from synesis.parser.lexer import SynesisSyntaxError, parse_file
4545
from synesis.parser.template_loader import TemplateLoadError, load_template
4646

47-
VERSION = "0.2.2"
47+
VERSION = "0.2.3"
4848

4949

5050
HELP_EPILOG = (

synesis/semantic/linker.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ class LinkedProject:
5858
hierarchy: Dict[str, str]
5959
all_triples: List[Tuple[str, str, str]]
6060
topic_index: Dict[str, List[str]]
61+
relation_index: Dict[Tuple[str, str, str], Dict[str, Any]] = field(default_factory=dict)
6162

6263

6364
@dataclass
@@ -103,6 +104,7 @@ def link(self) -> LinkedProject:
103104
ontology_index = {self._norm_code(o.concept): o for o in self.ontologies}
104105
code_usage: Dict[str, List[ItemNode]] = {}
105106
all_triples: List[Tuple[str, str, str]] = []
107+
relation_index: Dict[Tuple[str, str, str], Dict[str, Any]] = {}
106108

107109
for item in self.items:
108110
for code in self._collect_item_codes(item):
@@ -121,7 +123,17 @@ def link(self) -> LinkedProject:
121123
for chain in item.chains:
122124
# Detecta se template define RELATIONS (chain qualificada)
123125
has_relations = self._has_chain_relations()
124-
all_triples.extend(chain.to_triples(has_relations=has_relations))
126+
triples = chain.to_triples(has_relations=has_relations)
127+
all_triples.extend(triples)
128+
129+
relation_type = "qualified" if has_relations else "simple"
130+
chain_location = chain.location or item.location or SourceLocation(Path("<unknown>"), 1, 1)
131+
for triple in triples:
132+
if triple not in relation_index:
133+
relation_index[triple] = {
134+
"location": chain_location,
135+
"type": relation_type,
136+
}
125137

126138
hierarchy: Dict[str, str] = {}
127139
for ontology in self.ontologies:
@@ -145,6 +157,7 @@ def link(self) -> LinkedProject:
145157
hierarchy=hierarchy,
146158
all_triples=all_triples,
147159
topic_index=topic_index,
160+
relation_index=relation_index,
148161
)
149162

150163
def _is_a_pairs(self, chain: ChainNode) -> List[Tuple[str, str]]:

0 commit comments

Comments
 (0)