Skip to content

Commit 88f209f

Browse files
committed
Add OntologyStatement and remove unused classes
1 parent c9d4d7c commit 88f209f

15 files changed

Lines changed: 144 additions & 244 deletions

src/ubic/basecode/ontology/jena/AnnotationPropertyImpl.java

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -99,27 +99,28 @@ public boolean isObsolete() {
9999
@Override
100100
public boolean equals( @Nullable Object obj ) {
101101
if ( this == obj ) return true;
102-
if ( obj == null ) return false;
103-
if ( obj instanceof AnnotationPropertyImpl ) {
104-
final AnnotationPropertyImpl other = ( AnnotationPropertyImpl ) obj;
102+
if ( !( obj instanceof AnnotationProperty ) ) {
103+
return false;
104+
}
105+
final AnnotationProperty other = ( AnnotationProperty ) obj;
106+
if ( other instanceof AnnotationPropertyImpl ) {
105107
return super.equals( other )
106-
&& Objects.equals( object, other.object );
107-
} else if ( obj instanceof AnnotationProperty ) {
108-
final AnnotationProperty other = ( AnnotationProperty ) obj;
108+
&& Objects.equals( property, ( ( AnnotationPropertyImpl ) other ).property )
109+
&& Objects.equals( object, ( ( AnnotationPropertyImpl ) other ).object );
110+
} else {
109111
return super.equals( other )
112+
&& Objects.equals( getProperty(), other.getProperty() )
110113
&& Objects.equals( getContents(), other.getContents() );
111114
}
112-
return false;
113115
}
114116

115117
@Override
116118
public int hashCode() {
117-
return Objects.hash( super.hashCode(), object );
119+
return Objects.hash( super.hashCode(), property, object );
118120
}
119121

120122
@Override
121123
public String toString() {
122124
return property.getLocalName() + " " + object;
123125
}
124-
125126
}

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

Lines changed: 0 additions & 29 deletions
This file was deleted.

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

Lines changed: 0 additions & 31 deletions
This file was deleted.

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

Lines changed: 0 additions & 33 deletions
This file was deleted.

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

Lines changed: 0 additions & 30 deletions
This file was deleted.

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

Lines changed: 0 additions & 30 deletions
This file was deleted.

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

Lines changed: 0 additions & 30 deletions
This file was deleted.

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

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
/*
22
* The basecode project
3-
*
3+
*
44
* Copyright (c) 2007-2019 University of British Columbia
5-
*
5+
*
66
* Licensed under the Apache License, Version 2.0 (the "License");
77
* you may not use this file except in compliance with the License.
88
* You may obtain a copy of the License at
@@ -18,16 +18,19 @@
1818
*/
1919
package ubic.basecode.ontology.model;
2020

21+
import javax.annotation.Nullable;
22+
2123
/**
2224
* @author pavlidis
2325
*/
2426
public interface OntologyIndividual extends OntologyResource {
2527

2628
/**
2729
* Return the term that this is an instance of.
28-
*
30+
*
2931
* @return
3032
*/
33+
@Nullable
3134
public OntologyTerm getInstanceOf();
3235

3336
}

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ public interface OntologyResource {
3434
/**
3535
* A local name for this resource.
3636
*/
37+
@Nullable
3738
String getLocalName();
3839

3940
/**
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
package ubic.basecode.ontology.model;
2+
3+
/**
4+
* Represents a statement triplet in an ontology.
5+
* @author poirigui
6+
*/
7+
public interface OntologyStatement {
8+
9+
OntologyResource getSubject();
10+
11+
OntologyProperty getPredicate();
12+
13+
OntologyResource getObject();
14+
}

0 commit comments

Comments
 (0)