Skip to content

Commit

Permalink
OntTerm.__call__ create predicates if it doesn't exist
Browse files Browse the repository at this point in the history
  • Loading branch information
tgbugs committed Apr 29, 2019
1 parent f4f564a commit 6a6fb67
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion ontquery/terms.py
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,7 @@ def __real_init__(self, validated, results_gen, noId):
setattr(self, k, v)
raise exc.NotFoundError(f'No results for {self!r}')
else:
print(red.format('WARNING:'), repr(self), '\n')
print(red.format('WARNING:'), repr(self), '\n') # FIXME log

return
# TODO this needs to go in a separate place, not here
Expand Down Expand Up @@ -534,6 +534,9 @@ def __call__(self, predicate, *predicates, depth=1, direction='OUTGOING', as_ter
else:
out[k] = v

if not hasattr(self, 'predicates'):
self.predicates = {}

self.predicates.update(out) # FIXME klobbering issues
return out

Expand Down

0 comments on commit 6a6fb67

Please sign in to comment.