Search in sources :

Example 1 with OWLClass

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);
}
Also used : OWLClass(org.semanticweb.owlapi.model.OWLClass) OWLObjectProperty(org.semanticweb.owlapi.model.OWLObjectProperty) Nonnull(javax.annotation.Nonnull)

Example 2 with OWLClass

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);
    });
}
Also used : OBORelationship(edu.stanford.bmir.protege.web.shared.obo.OBORelationship) OWLEntity(org.semanticweb.owlapi.model.OWLEntity) ArrayList(java.util.ArrayList) GetOboTermRelationshipsAction(edu.stanford.bmir.protege.web.shared.obo.GetOboTermRelationshipsAction) OWLClass(org.semanticweb.owlapi.model.OWLClass)

Example 3 with OWLClass

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 -> {
    });
}
Also used : OBORelationship(edu.stanford.bmir.protege.web.shared.obo.OBORelationship) OBOTermRelationships(edu.stanford.bmir.protege.web.shared.obo.OBOTermRelationships) OWLClass(org.semanticweb.owlapi.model.OWLClass) SetOboTermRelationshipsAction(edu.stanford.bmir.protege.web.shared.obo.SetOboTermRelationshipsAction)

Example 4 with OWLClass

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);
}
Also used : OWLClassData(edu.stanford.bmir.protege.web.shared.entity.OWLClassData) GetClassFrameResult(edu.stanford.bmir.protege.web.shared.frame.GetClassFrameResult) ClassFrame(edu.stanford.bmir.protege.web.shared.frame.ClassFrame) ProjectId(edu.stanford.bmir.protege.web.shared.project.ProjectId) OWLClass(org.semanticweb.owlapi.model.OWLClass) Nonnull(javax.annotation.Nonnull)

Example 5 with OWLClass

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();
}
Also used : OWLClass(org.semanticweb.owlapi.model.OWLClass)

Aggregations

OWLClass (org.semanticweb.owlapi.model.OWLClass)40 OWLOntology (org.semanticweb.owlapi.model.OWLOntology)14 OWLDataFactory (org.semanticweb.owlapi.model.OWLDataFactory)13 OWLOntologyCreationException (org.semanticweb.owlapi.model.OWLOntologyCreationException)13 OWLOntologyManager (org.semanticweb.owlapi.model.OWLOntologyManager)13 OWLObjectProperty (org.semanticweb.owlapi.model.OWLObjectProperty)12 IRI (org.semanticweb.owlapi.model.IRI)10 OWLDataProperty (org.semanticweb.owlapi.model.OWLDataProperty)10 OWLNamedIndividual (org.semanticweb.owlapi.model.OWLNamedIndividual)9 OWLAnnotationProperty (org.semanticweb.owlapi.model.OWLAnnotationProperty)8 OWLAnnotationAssertionAxiom (org.semanticweb.owlapi.model.OWLAnnotationAssertionAxiom)6 OWLLiteral (org.semanticweb.owlapi.model.OWLLiteral)6 AddAxiom (org.semanticweb.owlapi.model.AddAxiom)5 OWLClassAssertionAxiom (org.semanticweb.owlapi.model.OWLClassAssertionAxiom)5 OWLDataPropertyAssertionAxiom (org.semanticweb.owlapi.model.OWLDataPropertyAssertionAxiom)5 OWLIndividual (org.semanticweb.owlapi.model.OWLIndividual)5 OWLObjectPropertyAssertionAxiom (org.semanticweb.owlapi.model.OWLObjectPropertyAssertionAxiom)5 OntClass (com.hp.hpl.jena.ontology.OntClass)4 OntModel (com.hp.hpl.jena.ontology.OntModel)4 OWLAnnotation (org.semanticweb.owlapi.model.OWLAnnotation)4