Search in sources :

Example 16 with OWLEntity

use of org.semanticweb.owlapi.model.OWLEntity in project webprotege by protegeproject.

the class OWLEntityReadConverter_TestCase method shouldReadOWLDataProperty.

@Test
public void shouldReadOWLDataProperty() {
    when(dbObject.get("type")).thenReturn(EntityType.DATA_PROPERTY.getName());
    OWLEntity entity = converter.convert(dbObject);
    assertThat(entity.isOWLDataProperty(), is(true));
    assertThat(entity.getIRI(), is(iri));
}
Also used : OWLEntity(org.semanticweb.owlapi.model.OWLEntity) Test(org.junit.Test)

Example 17 with OWLEntity

use of org.semanticweb.owlapi.model.OWLEntity in project webprotege by protegeproject.

the class OWLEntityReadConverter_TestCase method shouldReadOWLAnnotationProperty.

@Test
public void shouldReadOWLAnnotationProperty() {
    when(dbObject.get("type")).thenReturn(EntityType.ANNOTATION_PROPERTY.getName());
    OWLEntity entity = converter.convert(dbObject);
    assertThat(entity.isOWLAnnotationProperty(), is(true));
    assertThat(entity.getIRI(), is(iri));
}
Also used : OWLEntity(org.semanticweb.owlapi.model.OWLEntity) Test(org.junit.Test)

Example 18 with OWLEntity

use of org.semanticweb.owlapi.model.OWLEntity in project webprotege by protegeproject.

the class OWLEntityReadConverter_TestCase method shouldReadOWLClass.

@Test
public void shouldReadOWLClass() {
    when(dbObject.get("type")).thenReturn(EntityType.CLASS.getName());
    OWLEntity entity = converter.convert(dbObject);
    assertThat(entity.isOWLClass(), is(true));
    assertThat(entity.getIRI(), is(iri));
}
Also used : OWLEntity(org.semanticweb.owlapi.model.OWLEntity) Test(org.junit.Test)

Example 19 with OWLEntity

use of org.semanticweb.owlapi.model.OWLEntity in project webprotege by protegeproject.

the class ClassFrame method getSignature.

public Set<OWLEntity> getSignature() {
    Set<OWLEntity> result = new HashSet<>();
    result.add(subject.getEntity());
    for (OWLClassData entry : classEntries) {
        result.add(entry.getEntity());
    }
    for (PropertyValue propertyValue : propertyValues) {
        result.addAll(propertyValue.getProperty().getSignature());
        result.addAll(propertyValue.getValue().getSignature());
    }
    return result;
}
Also used : OWLClassData(edu.stanford.bmir.protege.web.shared.entity.OWLClassData) OWLEntity(org.semanticweb.owlapi.model.OWLEntity)

Example 20 with OWLEntity

use of org.semanticweb.owlapi.model.OWLEntity in project webprotege by protegeproject.

the class IssueBuilder_TestCase method shouldBuildIssueWithoutRemovedTargetEntity.

@Test
public void shouldBuildIssueWithoutRemovedTargetEntity() {
    OWLEntity entity = mock(OWLEntity.class);
    builder.addTargetEntity(entity, userId, TIMESTAMP);
    builder.removeTargetEntity(entity, userId, TIMESTAMP);
    Issue issue = builder.build(mentionParser);
    assertThat(issue.getTargetEntities(), is(empty()));
}
Also used : OWLEntity(org.semanticweb.owlapi.model.OWLEntity) Test(org.junit.Test)

Aggregations

OWLEntity (org.semanticweb.owlapi.model.OWLEntity)45 Test (org.junit.Test)13 OWLOntologyChange (org.semanticweb.owlapi.model.OWLOntologyChange)7 OWLEntityData (edu.stanford.bmir.protege.web.shared.entity.OWLEntityData)6 ArrayList (java.util.ArrayList)6 Nonnull (javax.annotation.Nonnull)6 Inject (javax.inject.Inject)6 UserId (edu.stanford.bmir.protege.web.shared.user.UserId)5 ProjectId (edu.stanford.bmir.protege.web.shared.project.ProjectId)4 AccessManager (edu.stanford.bmir.protege.web.server.access.AccessManager)3 IRI (org.semanticweb.owlapi.model.IRI)3 DBObject (com.mongodb.DBObject)2 EntitySuggestion (edu.stanford.bmir.protege.web.client.library.suggest.EntitySuggestion)2 AbstractProjectActionHandler (edu.stanford.bmir.protege.web.server.dispatch.AbstractProjectActionHandler)2 ExecutionContext (edu.stanford.bmir.protege.web.server.dispatch.ExecutionContext)2 VIEW_PROJECT (edu.stanford.bmir.protege.web.shared.access.BuiltInAction.VIEW_PROJECT)2 ColumnType (edu.stanford.bmir.protege.web.shared.csv.ColumnType)2 OWLPrimitiveData (edu.stanford.bmir.protege.web.shared.entity.OWLPrimitiveData)2 ProjectEvent (edu.stanford.bmir.protege.web.shared.event.ProjectEvent)2 Comparator.comparing (java.util.Comparator.comparing)2