use of org.semanticweb.owlapi.model.OWLClass in project webprotege by protegeproject.
the class RelationshipConverter method toSomeValuesFrom.
@Nonnull
public OWLObjectSomeValuesFrom toSomeValuesFrom(@Nonnull OBORelationship relationship) {
OWLObjectProperty property = relationship.getRelation().getEntity();
OWLClass filler = relationship.getValue().getEntity();
return dataFactory.getOWLObjectSomeValuesFrom(property, filler);
}
use of org.semanticweb.owlapi.model.OWLClass in project webprotege by protegeproject.
the class OBOTermRelationshipPortletPresenter method displayEntity.
@Override
protected void displayEntity(OWLEntity entity) {
Optional<OWLEntity> current = getSelectedEntity();
if (!current.isPresent()) {
editor.clearValue();
pristineValue = Optional.empty();
return;
}
if (!(current.get() instanceof OWLClass)) {
editor.clearValue();
pristineValue = Optional.empty();
return;
}
dispatch.execute(new GetOboTermRelationshipsAction(getProjectId(), entity.asOWLClass()), this, result -> {
List<OBORelationship> listOfRels = new ArrayList<>(result.getRelationships().getRelationships());
pristineValue = Optional.of(listOfRels);
editor.setValue(listOfRels);
});
}
use of org.semanticweb.owlapi.model.OWLClass in project webprotege by protegeproject.
the class OBOTermRelationshipPortletPresenter method commitChangesForEntity.
@Override
protected void commitChangesForEntity(OWLEntity entity) {
if (!(entity instanceof OWLClass)) {
return;
}
List<OBORelationship> relationships = editor.getValue().orElse(Collections.emptyList());
dispatch.execute(new SetOboTermRelationshipsAction(getProjectId(), entity, new OBOTermRelationships(Sets.newHashSet(relationships))), result -> {
});
}
use of org.semanticweb.owlapi.model.OWLClass in project webprotege by protegeproject.
the class GetClassFrameActionHandler method execute.
@Nonnull
@Override
public GetClassFrameResult execute(@Nonnull GetClassFrameAction action, @Nonnull ExecutionContext executionContext) {
OWLClass subject = action.getSubject();
FrameActionResultTranslator<ClassFrame, OWLClassData> translator = new FrameActionResultTranslator<>(renderingManager, translatorProvider.get(), renderingManager.getRendering(subject));
LabelledFrame<ClassFrame> f = translator.doIT();
ProjectId projectId = action.getProjectId();
logger.info(BROWSING, "{} {} retrieved Class frame for {} ({})", projectId, executionContext.getUserId(), subject, f.getDisplayName());
return new GetClassFrameResult(f);
}
use of org.semanticweb.owlapi.model.OWLClass in project webprotege by protegeproject.
the class GwtTest_DataFactory method test_getFreshEntityReturnsFreshEntity.
public void test_getFreshEntityReturnsFreshEntity() {
OWLClass cls = DataFactory.getFreshOWLEntity(EntityType.CLASS, "X");
assertTrue(DataFactory.isFreshEntity(cls));
assertEquals("X", DataFactory.getFreshEntityShortName(cls));
finishTest();
}
Aggregations