Skip to content

Commit 9d79a3e

Browse files
committed
Fix null URI in OntologyTerm.getChildren
It's mentioned in jena that the URI can be null of the term is a bnode. This is causing the following issue: PavlidisLab/Gemma#247
1 parent ff6abf8 commit 9d79a3e

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/ubic/basecode/ontology/model/OntologyTermImpl.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -385,8 +385,9 @@ private void getChildren( boolean direct, Collection<OntologyTerm> work ) {
385385
ExtendedIterator<OntClass> iterator = ontResource.listSubClasses( true );
386386
while ( iterator.hasNext() ) {
387387
OntClass c = iterator.next();
388+
// URI can be null if the ont is a bnode (no idea what it is, but we have to handle this)
388389
// some reasoners will infer owl#Nothing as a subclass of everything
389-
if ( c.getURI().equals( NOTHING ) ) continue;
390+
if ( c.getURI() == null || c.getURI().equals( NOTHING ) ) continue;
390391

391392
if ( USE_PROPER_PART_RESTRICTIONS && c.isRestriction() ) {
392393

0 commit comments

Comments
 (0)