Examples of OWLAnnotationValue


Examples of org.semanticweb.owlapi.model.OWLAnnotationValue

  }

  final public OWLAnnotationAssertionAxiom AnnotationAssertion() throws ParseException {
    OWLAnnotationProperty prop;
    OWLAnnotationSubject subj;
    OWLAnnotationValue val;
    Set<OWLAnnotation> axiomAnnos;
    jj_consume_token(ANNOTATIONASSERTION);
    jj_consume_token(OPENPAR);
    axiomAnnos = AxiomAnnotationSet();
    prop = AnnotationPropertyIRI();
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLAnnotationValue

        return !getConsumer().isAxiom(subject) && !getConsumer().isAnnotation(subject) && (builtInAnnotationProperty || !predicate.isReservedVocabulary());
    }

    @Override
    public void handleTriple(IRI subject, IRI predicate, IRI object) throws UnloadableImportException {
        OWLAnnotationValue value;
        if (isAnonymous(object)) {
            value = getDataFactory().getOWLAnonymousIndividual(object.toString());
        }
        else {
            value = object;
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLAnnotationValue

    @Override
    protected boolean matchesSafely(OWLAnnotationAssertionAxiom item) {
        if(!item.getProperty().isLabel()) {
            return false;
        }
        OWLAnnotationValue value = item.getValue();
        return value instanceof OWLLiteral && ((OWLLiteral) value).getLiteral().equals(expectedValue);
    }
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLAnnotationValue

    @Override
    protected boolean matchesSafely(OWLAnnotationAssertionAxiom item) {
        if(!item.getProperty().isLabel()) {
            return false;
        }
        OWLAnnotationValue value = item.getValue();
        return value instanceof OWLLiteral && ((OWLLiteral) value).getLiteral().equals(expectedValue)
                && lang.equals(((OWLLiteral) value).getLang());
    }
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLAnnotationValue

  private void printOntologyHeader(OWLOntology ontology) {
    for(OWLAnnotation annotation: ontology.getAnnotations())
    {
      IRI property = annotation.getProperty().getIRI();     
      OWLAnnotationValue value = annotation.getValue();

      if(property.equals(OWLRDFVocabulary.OWL_VERSION_INFO.getIRI()))
        verbose("Version Info = "+getString(value));
      else if(property.equals(OWLRDFVocabulary.OWL_PRIOR_VERSION.getIRI()))
        verbose("Prior Version Info = "+getString(value));
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLAnnotationValue

    }

    public static String getLabel(OWLEntity e, OWLOntology ont) {
        for (OWLAnnotation an : e.getAnnotations(ont)) {
            if (an.getProperty().isLabel()) {
                OWLAnnotationValue val = an.getValue();

                if (val instanceof IRI) {
                    return ((IRI) val).toString();
                } else if (val instanceof OWLLiteral) {
                    OWLLiteral lit = (OWLLiteral) val;
                    return lit.getLiteral();
                } else if (val instanceof OWLAnonymousIndividual) {
                    OWLAnonymousIndividual ind = (OWLAnonymousIndividual) val;
                    return ind.toStringID();
                } else {
                    throw new RuntimeException("Unexpected class "
                            + val.getClass());
                }
            }
        }
        return e.toStringID();
    }
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLAnnotationValue

    }

    public static String getLabel(OWLEntity e, OWLOntology ont) {
        for (OWLAnnotation an : e.getAnnotations(ont)) {
            if (an.getProperty().isLabel()) {
                OWLAnnotationValue val = an.getValue();

                if (val instanceof IRI) {
                    return ((IRI) val).toString();
                } else if (val instanceof OWLLiteral) {
                    OWLLiteral lit = (OWLLiteral) val;
                    return lit.getLiteral();
                } else if (val instanceof OWLAnonymousIndividual) {
                    OWLAnonymousIndividual ind = (OWLAnonymousIndividual) val;
                    return ind.toStringID();
                } else {
                    throw new RuntimeException("Unexpected class "
                            + val.getClass());
                }
            }
        }
        return e.toStringID();
    }
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLAnnotationValue

                for (OWLIndividual value : ((OWLIndividual) ind).getObjectPropertyValues(hasOntology, o))
                    if (value.isNamed()) ironts.add(value.asOWLNamedIndividual());
                // Get usages of hasOntology as an annotation property
                for (OWLAnnotationAssertionAxiom ann : o.getAnnotationAssertionAxioms(ind.getIRI()))
                    if (hasOntologyAnn.equals(ann.getProperty())) {
                        OWLAnnotationValue value = ann.getValue();
                        if (value instanceof OWLNamedObject) ironts.add((OWLNamedObject) value);
                        else if (value instanceof IRI) ironts.add(df.getOWLNamedIndividual((IRI) value));
                    }
            }
        }
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLAnnotationValue

                for (OWLIndividual value : ((OWLIndividual) ind).getObjectPropertyValues(isOntologyOf, o))
                    if (value.isNamed()) libs.add(value.asOWLNamedIndividual());
                // Get usages of isOntologyOf as an annotation property
                for (OWLAnnotationAssertionAxiom ann : o.getAnnotationAssertionAxioms(ind.getIRI()))
                    if (isOntologyOfAnn.equals(ann.getProperty())) {
                        OWLAnnotationValue value = ann.getValue();
                        if (value instanceof OWLNamedObject) libs.add((OWLNamedObject) value);
                        else if (value instanceof IRI) libs.add(df.getOWLNamedIndividual((IRI) value));
                    }
            }
        }
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLAnnotationValue

        for (IRI predicate : predicates) {
            if (isAnnotationProperty(predicate)) {
                IRI resVal = getResourceObject(mainNode, predicate, true);
                while (resVal != null) {
                    OWLAnnotationProperty prop = dataFactory.getOWLAnnotationProperty(predicate);
                    OWLAnnotationValue val;
                    if (isAnonymousNode(resVal)) {
                        val = dataFactory.getOWLAnonymousIndividual(resVal.toString());
                    }
                    else {
                        val = resVal;
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.