Package org.semanticweb.owlapi.model

Examples of org.semanticweb.owlapi.model.OWLAnnotationProperty


            Set<OWLAnnotation> annotations = new HashSet<>();
            Set<IRI> predicates = consumer.getPredicatesBySubject(remappedNode);
            for (IRI i : predicates) {
                assert i != null;
                if (consumer.isAnnotationProperty(i)) {
                    OWLAnnotationProperty p = consumer.getDataFactory()
                            .getOWLAnnotationProperty(i);
                    OWLLiteral literal = consumer.getLiteralObject(
                            remappedNode, i, true);
                    while (literal != null) {
                        annotations.add(consumer.getDataFactory()
View Full Code Here


        AbstractAxiomsRoundTrippingTestCase {

    @Nonnull
    @Override
    protected Set<? extends OWLAxiom> createAxioms() {
        OWLAnnotationProperty ap = AnnotationProperty(IRI("http://annotation.com/annos#prop"));
        OWLLiteral val = Literal("Test", "");
        OWLAnnotation anno = Annotation(ap, val);
        Set<OWLAnnotation> annos = new HashSet<>();
        annos.add(anno);
        OWLClassExpression ce = Class(iri("A"));
View Full Code Here

        @Override
        public void handleTriple(IRI subject, IRI predicate, IRI object) {
            if (!isAnonymous(subject)) {
                Set<OWLAnnotation> annos = consumer.getPendingAnnotations();
                OWLAnnotationProperty property = df
                        .getOWLAnnotationProperty(subject);
                addAxiom(df.getOWLDeclarationAxiom(property, annos));
                consumeTriple(subject, predicate, object);
            }
            consumer.addAnnotationProperty(subject, true);
View Full Code Here

                .getOntologyLoaderMetaData().getUnparsedTriples().size());
        Set<OWLAnnotationAssertionAxiom> annotationAxioms = oo
                .getAxioms(AxiomType.ANNOTATION_ASSERTION);
        assertEquals("annotation axiom count should be 2", 2,
                annotationAxioms.size());
        OWLAnnotationProperty relProperty = df.getOWLAnnotationProperty(IRI
                .create("http://example.com/ns#rel"));
        OWLAnnotationProperty predProperty = df.getOWLAnnotationProperty(IRI
                .create("http://example.com/ns#pred"));
        Set<OWLAnonymousIndividual> anonymousIndividualSet = oo
                .getAnonymousIndividuals();
        assertEquals("should be one anonymous individual", 1,
                anonymousIndividualSet.size());
View Full Code Here

                + "           ex:pred ex:Visible ;\n"
                + "           ex:pred \"Not visible\" .\n"
                + "        ex:subj rdfs:label \"Visible\" .\n"
                + "        ex:subj ex:pred \"Visible\" .";
        OWLOntology oo = loadOntologyFromString(input);
        OWLAnnotationProperty pred = df.getOWLAnnotationProperty(IRI
                .create("http://www.example.org/pred"));
        int countLabels = 0;
        int countPreds = 0;
        int countBNodeAnnotations = 0;
        for (OWLAnnotationAssertionAxiom oa : oo
View Full Code Here

    @Nonnull
    public OWLAnnotation getAnnotationForTagValuePair(String tagName,
            String value) {
        IRI tagIRI = getTagIRI(tagName);
        OWLDataFactory df = getDataFactory();
        OWLAnnotationProperty annotationProperty = df
                .getOWLAnnotationProperty(tagIRI);
        String unescapedString = getUnquotedString(value);
        OWLLiteral annotationValue = df.getOWLLiteral(unescapedString);
        return df.getOWLAnnotation(annotationProperty, annotationValue);
    }
View Full Code Here

    }

    protected void addAnnotation(String id, String uriID,
            @Nonnull OWLLiteral value) {
        IRI subject = getIRIFromOBOId(id);
        OWLAnnotationProperty annotationProperty = getDataFactory()
                .getOWLAnnotationProperty(getIRIFromOBOId(uriID));
        OWLAxiom ax = getDataFactory().getOWLAnnotationAssertionAxiom(
                annotationProperty, subject, value);
        applyChange(new AddAxiom(getOntology(), ax));
    }
View Full Code Here

    @Override
    public void handle(String currentId, String value, String qualifierBlock,
            String comment) {
        IRI subject = getConsumer().getCurrentEntity().getIRI();
        IRI annotationPropertyIRI = OBOVocabulary.ALT_ID.getIRI();
        OWLAnnotationProperty property = getDataFactory()
                .getOWLAnnotationProperty(annotationPropertyIRI);
        IRI object = getIRIFromOBOId(value);
        OWLAnnotationAssertionAxiom ax = getDataFactory()
                .getOWLAnnotationAssertionAxiom(property, subject, object);
        applyChange(new AddAxiom(getOntology(), ax));
View Full Code Here

        OWLOntologyLoaderConfiguration loaderConfig = new OWLOntologyLoaderConfiguration()
                .setMissingImportHandlingStrategy(MissingImportHandlingStrategy.SILENT);
        OWLOntology ontology = rootOntologyManager
                .loadOntologyFromOntologyDocument(streamDocumentSource,
                        loaderConfig);
        OWLAnnotationProperty date = AnnotationProperty(IRI("http://www.geneontology.org/formats/oboInOwl#date"));
        OWLAnnotationProperty mpathSlim = AnnotationProperty(IRI("http://purl.obolibrary.org/obo/uo#mpath_slim"));
        OWLAnnotationProperty subsetProperty = AnnotationProperty(IRI("http://www.geneontology.org/formats/oboInOwl#SubsetProperty"));
        OWLAnnotationProperty attributeSlim = AnnotationProperty(IRI("http://purl.obolibrary.org/obo/uo#attribute_slim"));
        OWLAnnotationProperty hasOBONamespace = AnnotationProperty(IRI("http://www.geneontology.org/formats/oboInOwl#hasOBONamespace"));
        OWLAnnotationProperty autogeneratedby = AnnotationProperty(IRI("http://www.geneontology.org/formats/oboInOwl#auto-generated-by"));
        OWLAnnotationProperty hasDbXref = AnnotationProperty(IRI("http://www.geneontology.org/formats/oboInOwl#hasDbXref"));
        OWLAnnotationProperty defaultnamespace = AnnotationProperty(IRI("http://www.geneontology.org/formats/oboInOwl#default-namespace"));
        OWLAnnotationProperty hasOBOFormatVersion = AnnotationProperty(IRI("http://www.geneontology.org/formats/oboInOwl#hasOBOFormatVersion"));
        OWLAnnotationProperty iao0000115 = AnnotationProperty(IRI("http://purl.obolibrary.org/obo/IAO_0000115"));
        OWLAnnotationProperty namespaceIdRule = AnnotationProperty(IRI("http://www.geneontology.org/formats/oboInOwl#NamespaceIdRule"));
        OWLAnnotationProperty createdBy = AnnotationProperty(IRI("http://www.geneontology.org/formats/oboInOwl#created_by"));
        OWLAnnotationProperty inSubset = AnnotationProperty(IRI("http://www.geneontology.org/formats/oboInOwl#inSubset"));
        OWLAnnotationProperty savedby = AnnotationProperty(IRI("http://www.geneontology.org/formats/oboInOwl#saved-by"));
        OWLClass pato0001708 = Class(IRI("http://purl.obolibrary.org/obo/PATO_0001708"));
        OWLClass uo0 = Class(IRI("http://purl.obolibrary.org/obo/UO_0000000"));
        OWLClass uo1 = Class(IRI("http://purl.obolibrary.org/obo/UO_0000001"));
        OWLAnnotationProperty id = AnnotationProperty(IRI("http://www.geneontology.org/formats/oboInOwl#id"));
        OWLAnnotationProperty abnormalSlim = AnnotationProperty(IRI("http://purl.obolibrary.org/obo/uo#abnormal_slim"));
        OWLAnnotationProperty scalarSlim = AnnotationProperty(IRI("http://purl.obolibrary.org/obo/uo#scalar_slim"));
        OWLLiteral literal = Literal("Wikipedia:Wikipedia", XSD_STRING);
        OWLAnnotationProperty unitSlim = AnnotationProperty(IRI("http://purl.obolibrary.org/obo/uo#unit_slim"));
        OWLAnnotationProperty absentSlim = AnnotationProperty(IRI("http://purl.obolibrary.org/obo/uo#absent_slim"));
        OWLObjectProperty isUnitOf = ObjectProperty(IRI("http://purl.obolibrary.org/obo/uo#is_unit_of"));
        OWLAnnotationProperty cellQuality = AnnotationProperty(IRI("http://purl.obolibrary.org/obo/uo#cell_quality"));
        OWLAnnotationProperty unitGroupSlim = AnnotationProperty(IRI("http://purl.obolibrary.org/obo/uo#unit_group_slim"));
        OWLAnnotationProperty valueSlim = AnnotationProperty(IRI("http://purl.obolibrary.org/obo/uo#value_slim"));
        OWLAnnotationProperty prefixSlim = AnnotationProperty(IRI("http://purl.obolibrary.org/obo/uo#prefix_slim"));
        OWLAnnotationProperty dispositionSlim = AnnotationProperty(IRI("http://purl.obolibrary.org/obo/uo#disposition_slim"));
        OWLAnnotationProperty relationalSlim = AnnotationProperty(IRI("http://purl.obolibrary.org/obo/uo#relational_slim"));
        Set<OWLAxiom> expected = new HashSet<>(
                Arrays.asList(
                        Declaration(date),
                        Declaration(autogeneratedby),
                        Declaration(hasDbXref),
                        Declaration(defaultnamespace),
                        Declaration(subsetProperty),
                        Declaration(hasOBOFormatVersion),
                        Declaration(iao0000115),
                        Declaration(namespaceIdRule),
                        Declaration(createdBy),
                        Declaration(inSubset),
                        Declaration(savedby),
                        Declaration(pato0001708),
                        Declaration(uo0),
                        Declaration(RDFSComment()),
                        Declaration(RDFSLabel()),
                        Declaration(hasOBONamespace),
                        Declaration(uo1),
                        Declaration(id),
                        SubAnnotationPropertyOf(mpathSlim, subsetProperty),
                        AnnotationAssertion(hasOBONamespace, uo1.getIRI(),
                                Literal("unit.ontology", XSD_STRING)),
                        AnnotationAssertion(RDFSComment(),
                                attributeSlim.getIRI(),
                                Literal("Attribute slim", XSD_STRING)),
                        AnnotationAssertion(RDFSLabel(), iao0000115.getIRI(),
                                Literal("definition", XSD_STRING)),
                        AnnotationAssertion(hasOBONamespace, uo0.getIRI(),
                                Literal("unit.ontology", XSD_STRING)),
                        SubAnnotationPropertyOf(unitSlim, subsetProperty),
                        AnnotationAssertion(RDFSComment(), valueSlim.getIRI(),
                                Literal("Value slim", XSD_STRING)),
                        SubAnnotationPropertyOf(absentSlim, subsetProperty),
                        SubAnnotationPropertyOf(abnormalSlim, subsetProperty),
                        AnnotationAssertion(RDFSLabel(), uo1.getIRI(),
                                Literal("length unit", XSD_STRING)),
                        AnnotationAssertion(RDFSLabel(),
                                hasOBOFormatVersion.getIRI(),
                                Literal("has_obo_format_version", XSD_STRING)),
                        AnnotationAssertion(RDFSLabel(),
                                namespaceIdRule.getIRI(),
                                Literal("namespace-id-rule", XSD_STRING)),
                        SubClassOf(uo1,
                                ObjectSomeValuesFrom(isUnitOf, pato0001708)),
                        SubAnnotationPropertyOf(cellQuality, subsetProperty),
                        AnnotationAssertion(
                                RDFSComment(),
                                relationalSlim.getIRI(),
                                Literal("Relational slim: types of quality that require an additional entity in order to exist",
                                        XSD_STRING)),
                        SubAnnotationPropertyOf(prefixSlim, subsetProperty),
                        SubAnnotationPropertyOf(scalarSlim, subsetProperty),
                        AnnotationAssertion(RDFSComment(), scalarSlim.getIRI(),
View Full Code Here

                OWLManager.createOWLOntologyManager());
        OWLOntology owlOntology = obo2Owl.convert(obo);
        Set<OWLAnnotation> annotations = owlOntology.getAnnotations();
        Set<String> comments = new HashSet<>();
        for (OWLAnnotation owlAnnotation : annotations) {
            OWLAnnotationProperty property = owlAnnotation.getProperty();
            if (property.isComment()) {
                OWLAnnotationValue value = owlAnnotation.getValue();
                if (value instanceof OWLLiteral) {
                    OWLLiteral literal = (OWLLiteral) value;
                    comments.add(literal.getLiteral());
                }
View Full Code Here

TOP

Related Classes of org.semanticweb.owlapi.model.OWLAnnotationProperty

Copyright © 2018 www.massapicom. 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.