@@ -43,11 +43,15 @@ public class GPADSPARQLExport {
43
43
private static final String BP = "http://purl.obolibrary.org/obo/GO_0008150" ;
44
44
private static final String CC = "http://purl.obolibrary.org/obo/GO_0005575" ;
45
45
private static final Set <String > rootTerms = new HashSet <>(Arrays .asList (MF , BP , CC ));
46
+
47
+ private static final String HAS_INPUT = "http://purl.obolibrary.org/obo/RO_0002233" ;
46
48
private static final String ENABLES = "http://purl.obolibrary.org/obo/RO_0002327" ;
47
49
private static final String CONTRIBUTES_TO = "http://purl.obolibrary.org/obo/RO_0002326" ;
48
50
private static final Set <String > functionRelations = new HashSet <>(Arrays .asList (ENABLES , CONTRIBUTES_TO ));
49
51
private static final String EMAPA_NAMESPACE = "http://purl.obolibrary.org/obo/EMAPA_" ;
50
52
private static final String UBERON_NAMESPACE = "http://purl.obolibrary.org/obo/UBERON_" ;
53
+
54
+ private static final String TAXON_NAMESPACE = "http://purl.obolibrary.org/obo/NCBITaxon_" ;
51
55
private static final String inconsistentQuery =
52
56
"PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>" +
53
57
"PREFIX owl: <http://www.w3.org/2002/07/owl#>" +
@@ -167,13 +171,18 @@ public Set<GPADData> getGPAD(WorkingMemory wm, IRI modelIRI) throws Inconsistent
167
171
annotationEvidences .forEach (currentEvidence -> {
168
172
String reference = currentEvidence .getReference ();
169
173
Set <ConjunctiveExpression > goodExtensions = new HashSet <>();
174
+ Optional <IRI > interactingTaxon = Optional .empty ();
170
175
for (AnnotationExtension extension : possibleExtensions ) {
171
176
if (extension .getTriple ().getSubject ().equals (annotation .getOntologyClassNode ()) && !(extension .getTriple ().getObject ().equals (annotation .getObjectNode ()))) {
172
177
for (Explanation expl : allExplanations .get (extension .getTriple ())) {
173
178
boolean allFactsOfExplanationHaveRefMatchingAnnotation = toJava (expl .facts ()).stream ().map (fact -> allEvidences .getOrDefault (Bridge .jenaFromTriple (fact ), Collections .emptySet ())).allMatch (evidenceSet ->
174
179
evidenceSet .stream ().anyMatch (ev -> ev .getReference ().equals (reference )));
175
180
if (allFactsOfExplanationHaveRefMatchingAnnotation ) {
176
- goodExtensions .add (new DefaultConjunctiveExpression (IRI .create (extension .getTriple ().getPredicate ().getURI ()), extension .getValueType ()));
181
+ if (!interactingTaxon .isPresent () && extension .getTriple ().getPredicate ().getURI ().equals (HAS_INPUT ) && extension .getValueType ().toString ().startsWith (TAXON_NAMESPACE )) {
182
+ interactingTaxon = Optional .of (extension .getValueType ());
183
+ } else {
184
+ goodExtensions .add (new DefaultConjunctiveExpression (IRI .create (extension .getTriple ().getPredicate ().getURI ()), extension .getValueType ()));
185
+ }
177
186
}
178
187
}
179
188
}
@@ -191,7 +200,7 @@ public Set<GPADData> getGPAD(WorkingMemory wm, IRI modelIRI) throws Inconsistent
191
200
final boolean rootMFWithOtherMF = annotation .getOntologyClass ().toString ().equals (MF ) && gpsWithAnyMFNotRootMF .contains (annotation .getObject ());
192
201
if (!rootViolation && !rootMFWithOtherMF ) {
193
202
DefaultGPADData defaultGPADData = new DefaultGPADData (annotation .getObject (), annotation .getQualifier (), annotation .getOntologyClass (), goodExtensions ,
194
- reference , currentEvidence .getEvidence (), currentEvidence .getWithOrFrom (), Optional . empty () , currentEvidence .getModificationDate (),
203
+ reference , currentEvidence .getEvidence (), currentEvidence .getWithOrFrom (), interactingTaxon , currentEvidence .getModificationDate (),
195
204
currentEvidence .getAssignedBy (), currentEvidence .getAnnotations ());
196
205
defaultGPADData .setOperator (annotation .getOperator ());
197
206
annotations .add (defaultGPADData );
0 commit comments