Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check if graph transposition impacts parsing #27

Open
caufieldjh opened this issue Jan 31, 2023 · 0 comments
Open

Check if graph transposition impacts parsing #27

caufieldjh opened this issue Jan 31, 2023 · 0 comments

Comments

@caufieldjh
Copy link
Contributor

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 "<stdin>", line 1, in <module>
  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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant