Examples of OWLAnnotation


Examples of org.semanticweb.owlapi.model.OWLAnnotation

    final public OWLAnnotation Annotation() throws ParseException {
        OWLAnnotationProperty prop;
        OWLAnnotationValue val;
        Set<OWLAnnotation> annos = null;
        OWLAnnotation anno = null;
        jj_consume_token(ANNOTATION);
        annos = new HashSet<OWLAnnotation>();
        jj_consume_token(OPENPAR);
        label_14: while (true) {
            switch (jj_ntk == -1 ? jj_ntk_f() : jj_ntk) {
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLAnnotation

        throw new Error("Missing return statement in function");
    }

    final public Set<OWLAnnotation> AxiomAnnotationSet() throws ParseException {
        Set<OWLAnnotation> annos = null;
        OWLAnnotation anno;
        label_15: while (true) {
            switch (jj_ntk == -1 ? jj_ntk_f() : jj_ntk) {
                case ANNOTATION: {
                    ;
                    break;
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLAnnotation

    private final Set<SWRLAtom> head = new HashSet<>(Arrays.asList(v2));

    @Test
    public void shouldBuildAnnotation() {
        // given
        OWLAnnotation expected = df.getOWLAnnotation(ap, lit);
        BuilderAnnotation builder = new BuilderAnnotation(expected, df);
        // when
        OWLObject built = builder.buildObject();
        // then
        assertEquals(expected, built);
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLAnnotation

                + ":FMDomain rdf:type owl:NamedIndividual , prov:Activity ; prov:ass :DM .";
        OWLOntology ontology = loadOntologyFromString(input);
        OWLOntology o = roundTrip(ontology, new TurtleDocumentFormat());
        Set<OWLSubClassOfAxiom> axioms = o.getAxioms(AxiomType.SUBCLASS_OF);
        assertEquals(1, axioms.size());
        OWLAnnotation next = axioms.iterator().next().getAnnotations()
                .iterator().next();
        assertTrue(next.getValue() instanceof OWLAnonymousIndividual);
        OWLAnonymousIndividual ind = (OWLAnonymousIndividual) next.getValue();
        Set<OWLAxiom> anns = new HashSet<>();
        for (OWLAxiom ax : o.getAxioms()) {
            if (ax.getAnonymousIndividuals().contains(ind)) {
                anns.add(ax);
            }
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLAnnotation

    @Test
    public void testPlainLiteralSerializationComments2() throws Exception {
        OWLOntology o = m.createOntology();
        OWLLiteral l = m.getOWLDataFactory().getOWLLiteral("test",
                OWL2Datatype.RDF_PLAIN_LITERAL);
        OWLAnnotation a = m.getOWLDataFactory().getOWLAnnotation(
                m.getOWLDataFactory().getRDFSComment(), l);
        m.applyChange(new AddOntologyAnnotation(o, a));
        ByteArrayOutputStream out = new ByteArrayOutputStream();
        m.saveOntology(o, out);
        String expected = "<rdfs:comment>test</rdfs:comment>";
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLAnnotation

    @Nonnull
    @Override
    protected Set<? extends OWLAxiom> createAxioms() {
        Set<OWLAxiom> axioms = new HashSet<>();
        OWLAnnotation annoOuterOuter1 = df.getOWLAnnotation(
                AnnotationProperty(iri("myOuterOuterLabel1")),
                Literal("Outer Outer label 1"));
        OWLAnnotation annoOuterOuter2 = df.getOWLAnnotation(
                AnnotationProperty(iri("myOuterOuterLabel2")),
                Literal("Outer Outer label 2"));
        Set<OWLAnnotation> outerOuterAnnos = new HashSet<>();
        outerOuterAnnos.add(annoOuterOuter1);
        outerOuterAnnos.add(annoOuterOuter2);
        OWLAnnotation annoOuter = df.getOWLAnnotation(
                AnnotationProperty(iri("myOuterLabel")),
                Literal("Outer label"), outerOuterAnnos);
        OWLAnnotation annoInner = df.getOWLAnnotation(
                AnnotationProperty(iri("myLabel")), Literal("Label"),
                singleton(annoOuter));
        OWLAxiom ax = df.getOWLSubClassOfAxiom(Class(iri("A")),
                Class(iri("B")), singleton(annoInner));
        axioms.add(ax);
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLAnnotation

        body.add(df.getSWRLDataPropertyAtom(p, x, y));
        body.add(df.getSWRLDataRangeAtom(
                df.getOWLDatatype(XSDVocabulary.STRING.getIRI()), y));
        Set<SWRLAtom> head = new TreeSet<>();
        head.add(df.getSWRLClassAtom(a, x));
        OWLAnnotation ann = df.getOWLAnnotation(df.getRDFSLabel(),
                df.getOWLLiteral("test", ""));
        SWRLRule rule = df.getSWRLRule(body, head, singleton(ann));
        ontology.getOWLOntologyManager().addAxiom(ontology, rule);
        OWLDatatypeDefinitionAxiom def = df.getOWLDatatypeDefinitionAxiom(
                df.getOWLDatatype(IRI.create("urn:mydatatype")),
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLAnnotation

    @Override
    protected OWLOntology createOntology() {
        OWLOntology ont = getOWLOntology("AnnotationOntology");
        OWLAnnotationProperty prop = AnnotationProperty(IRI("http://www.semanticweb.org/ontologies/test/annotationont#prop"));
        OWLLiteral value = Literal(33);
        OWLAnnotation annotation = Annotation(prop, value);
        ont.getOWLOntologyManager().applyChange(
                new AddOntologyAnnotation(ont, annotation));
        ont.getOWLOntologyManager().addAxiom(ont, Declaration(prop));
        return ont;
    }
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLAnnotation

                value = df.getOWLAnonymousIndividual(object.toString());
            } else {
                value = object;
            }
            OWLAnnotationProperty prop = df.getOWLAnnotationProperty(predicate);
            OWLAnnotation anno = df.getOWLAnnotation(prop, value);
            OWLAnnotationSubject annoSubject;
            if (isAnonymous(subject)) {
                annoSubject = df.getOWLAnonymousIndividual(subject.toString());
            } else {
                annoSubject = subject;
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLAnnotation

        }
    }

    private Set<OWLAnnotation> getSynonymTypeAnnotations(Matcher matcher) {
        if (matcher.group(SYNONYM_TYPE_GROUP) != null) {
            OWLAnnotation typeAnnotation = getSynonymTypeAnnotation(matcher);
            return Collections.singleton(typeAnnotation);
        } else {
            return Collections.emptySet();
        }
    }
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.