Skip to content

Commit

Permalink
neurondm LabelMake hasAnatomicalSystemPhenotype, fix namespaces
Browse files Browse the repository at this point in the history
after tracking down an issue where abbreviations were not showing up
in generaged labels correctly (which was fixed in the previous commit,
and was due to junk namespaces being inserted silently by calls from
infixowl to bad Graph.compute_qname defaults which is what we fixed)
we now need to make sure that the namespaces are not empty, otherwise
infixowl calls will cause an error

also remove remaining direct usage of makeGraph
  • Loading branch information
tgbugs committed May 31, 2023
1 parent e1ad135 commit bd9d082
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions neurondm/neurondm/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from ttlser import natsort
from augpathlib import RepoPath
from pyontutils import combinators as cmb
from pyontutils.core import Ont, makeGraph, OntId as bOntId, OntTerm as bOntTerm
from pyontutils.core import Ont, OntId as bOntId, OntTerm as bOntTerm
from pyontutils.core import OntConjunctiveGraph, OntResAny, OntResIri, OntResPath
from pyontutils.utils import stack_magic, injective_dict, makeSimpleLogger, cacheout
from pyontutils.utils import TermColors as tc, subclasses, get_working_dir
Expand Down Expand Up @@ -424,6 +424,9 @@ def hasConnectionPhenotype(self, phenotypes):
def hasExperimentalPhenotype(self, phenotypes):
yield from self._default(phenotypes)
@od
def hasAnatomicalSystemPhenotype(self, phenotypes):
yield from self._default(phenotypes)
@od
def hasClassificationPhenotype(self, phenotypes):
yield from self._default(phenotypes)
@od
Expand Down Expand Up @@ -1470,7 +1473,7 @@ def makeLocalRemote(suffixes):
for ig in use_in_paths:
in_graph.parse(ig, format='turtle')

nin_graph = makeGraph('', prefixes=PREFIXES, graph=in_graph)
in_graph.namespace_manager.populate_from(PREFIXES)
graphBase.in_graph = in_graph
graphBase.ignore_existing = ignore_existing

Expand Down Expand Up @@ -1501,15 +1504,14 @@ class NeurOnt(Ont): # FIXME this is super misleading wrt the source ...
NeuronBase.existing_ids = {}
else:
no = None
graphBase.ng = makeGraph('', prefixes=PREFIXES, graph=out_graph)
#new_graph = makeGraph('', prefixes=PREFIXES, graph=out_graph)
out_graph.namespace_manager.populate_from(PREFIXES)

graphBase.out_graph = out_graph

# python output setup
graphBase.compiled_location = compiled_location

# makeGraph setup
new_graph = graphBase.ng #= new_graph
new_graph = graphBase.ng # FIXME remove this usage
new_graph.filename = out_graph_path

if iri is not None:
Expand Down Expand Up @@ -3630,6 +3632,7 @@ def getLocalContext():
else:
# note: this solves part of the problem, but mostly defers it until later
_g = OntConjunctiveGraph()
_g.namespace_manager.populate_from(uPREFIXES)
graphBase.core_graph = _g


Expand Down

0 comments on commit bd9d082

Please sign in to comment.