Skip to content

Commit

Permalink
Merge pull request #135 from geneontology/ce-negated
Browse files Browse the repository at this point in the history
Testing ComplementOf expressions
  • Loading branch information
cmungall authored Aug 24, 2017
2 parents 24a12d3 + 23db2ef commit 20e172c
Showing 1 changed file with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@
import org.junit.BeforeClass;
import org.junit.Test;
import org.semanticweb.owlapi.model.IRI;
import org.semanticweb.owlapi.model.OWLClass;
import org.semanticweb.owlapi.model.OWLClassExpression;
import org.semanticweb.owlapi.model.OWLObjectComplementOf;
import org.semanticweb.owlapi.model.OWLOntologyCreationException;

import owltools.graph.OWLGraphWrapper;
Expand Down Expand Up @@ -116,6 +118,22 @@ public void testParseClazz() throws Exception {
assertEquals(graph.getOWLClassByIdentifier(CELL_MORPHOGENESIS), ce);
}

@Test
public void testParseClazzNegated() throws Exception {

JsonOwlObject expression = new JsonOwlObject();
expression.type = JsonOwlObjectType.ComplementOf;
expression.filler = new JsonOwlObject();
expression.filler.id = NUCLEUS;
expression.filler.type = JsonOwlObjectType.Class;

OWLClassExpression ce = new M3ExpressionParser(curieHandler).parse(graph, expression, null);
OWLClass nucleus = graph.getOWLClassByIdentifier(NUCLEUS);
OWLObjectComplementOf ceExpected = graph.getDataFactory().getOWLObjectComplementOf(nucleus);
assertEquals(ceExpected, ce);
}


/**
* test that Default expression parser will throw UnknownIdentifierException
* when confronted with a non-CURIE
Expand Down

0 comments on commit 20e172c

Please sign in to comment.