INCATools / INCATools/oakx-grape
Check if graph transposition impacts parsing
- Dominant language
- Python
- Stars
- 5
- Forks
- 2
- PR merge metrics
- No merged PRs in 30d
Description
There are still some lingering issues with using original vs. transposed graphs, e.g.,
```
>>> predicates = ["rdfs:subClassOf"]
>>> tp = oi.termset_pairwise_similarity(["BFO:0000006"], ["BFO:0000018"], predicates)
Graph contains multiple disconnected components. Will ignore all but the largest component. 24 components are present. Largest component has 35 nodes.
>>> oi = get_implementation_from_shorthand("grape:sqlite:obo:phenio")
>>> tp = oi.termset_pairwise_similarity(["eye"], ["eyelash"], predicates)
Graph contains multiple disconnected components. Will ignore all but the largest component. 31982 components are present. Largest component has 242712 nodes.
Traceback (most recent call last):
File "", line 1, in
File "/home/harry/oakx-grape/src/oakx_grape/grape_implementation.py", line 324, in termset_pairwise_similarity
resnik_model = self._make_grape_resnik_model(dag=dag)
File "/home/harry/oakx-grape/src/oakx_grape/grape_implementation.py", line 287, in _make_grape_resnik_model
resnik_model.fit(graph, node_counts=counts)
File "/home/harry/oakx-grape/.venv/lib/python3.9/site-packages/embiggen/similarities/dag_resnik.py", line 32, in fit
self._model.fit(
ValueError: The current graph instance Unnamed is not directed acyclic.
```
This suggests that the graph isn't being interpreted as a DAG because the edges are going in the wrong direction - an issue that transposition will fix unless the original graph is already "correct".
Graphs should only be transposed if necessary, not by default.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start in src/oakx_grape/grape_implementation.py, especially termset_pairwise_similarity and _make_grape_resnik_model, and reproduce the reported calls with the shown predicates and shorthand implementations. Trace whether the graph passed to embiggen's DAG Resnik model is directed correctly; done means transposition is conditional rather than applied by default and the reported non-DAG failure is addressed.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- data
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100