Examples of OWLEntity


Examples of org.semanticweb.owlapi.model.OWLEntity

    }


    public void handle(String id, String value) {
        getConsumer().setCurrentId(value);
        final OWLEntity entity = getConsumer().getCurrentEntity();
        if (entity != null){
            applyChange(new AddAxiom(getOntology(), getDataFactory().getOWLDeclarationAxiom(entity)));
        }
    }
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLEntity

        int workDone = 0;

        for (OWLAxiom axiom : axioms) {
            if (axiom instanceof OWLDeclarationAxiom) {
                OWLDeclarationAxiom a = (OWLDeclarationAxiom)axiom;
                OWLEntity ent = a.getEntity();
                if (ent.isOWLClass()) {
                    res.add(new ConceptInclusion(
                            new NamedConcept(ent.asOWLClass().toStringID()), NamedConcept.TOP_CONCEPT));
                } else if (ent.isOWLObjectProperty()) {
                    // Do nothing for now.
                } else if (ent.isOWLDataProperty()) {
                    // Do nothing for now.
                }
            } else if (axiom instanceof OWLSubPropertyChainOfAxiom) {
                OWLSubPropertyChainOfAxiom a = (OWLSubPropertyChainOfAxiom) axiom;
                Axiom ax = transformOWLSubPropertyChainOfAxiom(a);
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLEntity

    private Component prepareRenderer(Object value, boolean isSelected, boolean hasFocus) {
        renderingComponent.setOpaque(isSelected || opaque);

        if (value instanceof OWLEntity) {
            OWLEntity entity = (OWLEntity) value;
            OWLDeclarationAxiom declAx = getOWLModelManager().getOWLDataFactory().getOWLDeclarationAxiom(entity);
            if (getOWLModelManager().getActiveOntology().containsAxiom(declAx)) {
                ontology = getOWLModelManager().getActiveOntology();
            }
            entity.accept(activeEntityVisitor);
        }


        prepareTextPane(value, isSelected);
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLEntity

            Style s = doc.getStyle(curToken);
            doc.setCharacterAttributes(tokenStartIndex, tokenLength, s, true);
        }
        else {
            // Not a keyword, so might be an entity (or delim)
            OWLEntity curEntity = getOWLModelManager().getOWLEntityFinder().getOWLEntity(curToken);
            if (curEntity != null) {
                if (focusedEntity != null) {
                    if (curEntity.equals(focusedEntity)) {
                        doc.setCharacterAttributes(tokenStartIndex, tokenLength, focusedEntityStyle, true);
                    }
                }
                else if (curEntity instanceof OWLClass) {
                    if (highlightUnsatisfiableClasses &&
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLEntity


    public void visit(OWLDeclarationAxiom axiom) {
        sb.append("Declaration(");
        writeAnnotations(axiom);
        OWLEntity entity = axiom.getEntity();
        if (entity.isOWLClass()) {
            sb.append("Class(");
        }
        else if (entity.isOWLObjectProperty()) {
            sb.append("ObjectProperty(");
        }
        else if (entity.isOWLDataProperty()) {
            sb.append("DataProperty(");
        }
        else if (entity.isOWLNamedIndividual()) {
            sb.append("NamedIndividual(");
        }
        else if (entity.isOWLDatatype()) {
            sb.append("Datatype(");
        }
        else if (entity.isOWLAnnotationProperty()) {
            sb.append("AnnotationProperty(");
        }
        axiom.getEntity().accept(this);
        sb.append("))");
    }
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLEntity

    }


    public void handle(String id, String value, String comment) {
        // This is an annotation - but add as a label
        OWLEntity ent;
        if (getConsumer().isTerm()) {
            ent = getDataFactory().getOWLClass(getIdIRI(id));
        } else if (getConsumer().isTypedef()) {
            ent = getDataFactory().getOWLObjectProperty(getIdIRI(id));
        } else {
            ent = getDataFactory().getOWLNamedIndividual(getIdIRI(id));
        }
        OWLLiteral con = getDataFactory().getOWLLiteral(value);
        OWLAxiom ax = getDataFactory().getOWLAnnotationAssertionAxiom(getDataFactory().getOWLAnnotationProperty(OWLRDFVocabulary.RDFS_LABEL.getIRI()), ent.getIRI(), con);
        applyChange(new AddAxiom(getOntology(), ax));
    }
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLEntity

            Set<OWLAnnotation> annotations = new HashSet<OWLAnnotation>();
            OWLAnnotation typeAnnotation = getSynonymTypeAnnotation(matcher);
            annotations.add(typeAnnotation);
            annotations.addAll(getXRefAnnotations(matcher, df));

            OWLEntity subject = getConsumer().getCurrentEntity();
            String synonym = matcher.group(VALUE_GROUP);
            OWLLiteral synonymLiteral = df.getOWLLiteral(synonym, "");
            OWLAnnotationAssertionAxiom annoAssertion = df.getOWLAnnotationAssertionAxiom(property, subject.getIRI(), synonymLiteral, annotations);
            applyChange(new AddAxiom(getOntology(), annoAssertion));
        }
    }
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLEntity

    }


    public void handle(String id, String value, String comment) {
        getConsumer().setCurrentId(value);
        final OWLEntity entity = getConsumer().getCurrentEntity();
        if (entity != null){
            applyChange(new AddAxiom(getOntology(), getDataFactory().getOWLDeclarationAxiom(entity)));
        }
    }
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLEntity

        return dataFactory.getOWLHasKeyAxiom(ce, props, axiomAnnos);
   
  }

  final public OWLAxiom Declaration() throws ParseException {
    OWLEntity entity = null;
//    IRI iri = null;
//    OWLLiteral con = null;
    Set<OWLAnnotation> axiomAnnos;
    jj_consume_token(DECLARATION);
    jj_consume_token(OPENPAR);
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLEntity

        }
   
  }

  final public OWLEntity Entity() throws ParseException {
    OWLEntity entity;
    if (jj_2_108(2)) {
      entity = Class();
    } else if (jj_2_109(2)) {
      entity = ObjectProperty();
    } else if (jj_2_110(2)) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.