File tree Expand file tree Collapse file tree
src/ubic/basecode/ontology/jena Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -737,9 +737,13 @@ public String toString() {
737737
738738 private Set <OntClass > getOntClassesFromTerms ( Collection <OntologyTerm > terms ) {
739739 return terms .stream ()
740- .map ( OntologyTerm ::getUri )
741- .filter ( Objects ::nonNull )
742- .map ( model ::getOntClass )
740+ .map ( o -> {
741+ if ( o instanceof OntologyTermImpl ) {
742+ return ( ( OntologyTermImpl ) o ).getOntClass ();
743+ } else {
744+ return o .getUri () != null ? model .getOntClass ( o .getUri () ) : null ;
745+ }
746+ } )
743747 .filter ( Objects ::nonNull )
744748 .collect ( Collectors .toSet () );
745749 }
Original file line number Diff line number Diff line change 2626import ubic .basecode .ontology .model .OntologyTerm ;
2727
2828import javax .annotation .Nullable ;
29- import java .util .*;
29+ import java .util .Collection ;
30+ import java .util .Collections ;
31+ import java .util .HashSet ;
32+ import java .util .Set ;
3033import java .util .stream .Collectors ;
3134
3235import static ubic .basecode .ontology .jena .JenaUtils .where ;
@@ -232,4 +235,8 @@ public boolean isRoot() {
232235 public boolean isTermObsolete () {
233236 return isObsolete ();
234237 }
238+
239+ public OntClass getOntClass () {
240+ return ontResource ;
241+ }
235242}
You can’t perform that action at this time.
0 commit comments