Package org.semanticweb.owlapi.util

Examples of org.semanticweb.owlapi.util.AnnotationValueShortFormProvider


        m.addAxiom(o, df.getOWLDeclarationAxiom(dateTime));
        m.addAxiom(o, annotation(a, "'GWAS study'"));
        m.addAxiom(o, annotation(p, "has_publication_date"));
        m.addAxiom(o, annotation(dateTime, "dateTime"));
        // select a short form provider that uses annotations
        ShortFormProvider sfp = new AnnotationValueShortFormProvider(
                Arrays.asList(df.getRDFSLabel()),
                Collections.<OWLAnnotationProperty, List<String>> emptyMap(), m);
        BidirectionalShortFormProvider shortFormProvider = new BidirectionalShortFormProviderAdapter(
                m.getOntologies(), sfp);
        ManchesterOWLSyntaxParser parser = OWLManager.createManchesterParser();
View Full Code Here


        m.addAxiom(o, df.getOWLDeclarationAxiom(b));
        m.addAxiom(o, df.getOWLDeclarationAxiom(c));
        m.addAxiom(o, df.getOWLDeclarationAxiom(d));
        m.addAxiom(o, df.getOWLSubClassOfAxiom(expected, d));
        // select a short form provider that uses annotations
        ShortFormProvider sfp = new AnnotationValueShortFormProvider(
                Arrays.asList(df.getRDFSLabel()),
                Collections.<OWLAnnotationProperty, List<String>> emptyMap(), m);
        BidirectionalShortFormProvider shortFormProvider = new BidirectionalShortFormProviderAdapter(
                m.getOntologies(), sfp);
        ManchesterOWLSyntaxParser parser = OWLManager.createManchesterParser();
View Full Code Here

        OWLOntology o = m.createOntology();
        m.addAxiom(o, df.getOWLDeclarationAxiom(p));
        m.addAxiom(o, df.getOWLDeclarationAxiom(decimal));
        m.addAxiom(o, annotation(p, "p"));
        // select a short form provider that uses annotations
        ShortFormProvider sfp = new AnnotationValueShortFormProvider(
                Arrays.asList(df.getRDFSLabel()),
                Collections.<OWLAnnotationProperty, List<String>> emptyMap(), m);
        BidirectionalShortFormProvider shortFormProvider = new BidirectionalShortFormProviderAdapter(
                m.getOntologies(), sfp);
        ManchesterOWLSyntaxParser parser = OWLManager.createManchesterParser();
View Full Code Here

        m.addAxiom(o, df.getOWLDeclarationAxiom(b));
        m.addAxiom(o, df.getOWLDeclarationAxiom(c));
        m.addAxiom(o, df.getOWLDeclarationAxiom(d));
        m.addAxiom(o, df.getOWLSubClassOfAxiom(expected, d));
        // select a short form provider that uses annotations
        ShortFormProvider sfp = new AnnotationValueShortFormProvider(
                Arrays.asList(df.getRDFSLabel()),
                Collections.<OWLAnnotationProperty, List<String>> emptyMap(), m);
        BidirectionalShortFormProvider shortFormProvider = new BidirectionalShortFormProviderAdapter(
                m.getOntologies(), sfp);
        ManchesterOWLSyntaxParser parser = OWLManager.createManchesterParser();
View Full Code Here

        String in = "A SubClassOf B";
        OWLOntology o = m.createOntology();
        m.addAxiom(o, df.getOWLDeclarationAxiom(a));
        m.addAxiom(o, df.getOWLDeclarationAxiom(b));
        // select a short form provider that uses annotations
        ShortFormProvider sfp = new AnnotationValueShortFormProvider(
                Arrays.asList(df.getRDFSLabel()),
                Collections.<OWLAnnotationProperty, List<String>> emptyMap(), m);
        BidirectionalShortFormProvider shortFormProvider = new BidirectionalShortFormProviderAdapter(
                m.getOntologies(), sfp);
        ManchesterOWLSyntaxParser parser = OWLManager.createManchesterParser();
View Full Code Here

    public void testLiteralWithoutLanguageValue() {
        OWLNamedIndividual root = NamedIndividual("ind", pm);
        String shortForm = "MyLabel";
        Ontology(m,
                AnnotationAssertion(prop, root.getIRI(), Literal(shortForm)));
        AnnotationValueShortFormProvider sfp = new AnnotationValueShortFormProvider(
                props, langMap, m);
        assertEquals(sfp.getShortForm(root), shortForm);
    }
View Full Code Here

        Ontology(
                m,
                AnnotationAssertion(prop, root.getIRI(), Literal(label1, "ab")),
                AnnotationAssertion(prop, root.getIRI(), Literal(label2, "xy")));
        langMap.put(prop, Arrays.asList("ab", "xy"));
        AnnotationValueShortFormProvider sfp = new AnnotationValueShortFormProvider(
                props, langMap, m);
        assertEquals(sfp.getShortForm(root), label1);
        Map<OWLAnnotationProperty, List<String>> langMap2 = new HashMap<>();
        langMap2.put(prop, Arrays.asList("xy", "ab"));
        AnnotationValueShortFormProvider sfp2 = new AnnotationValueShortFormProvider(
                props, langMap2, m);
        assertEquals(sfp2.getShortForm(root), label2);
    }
View Full Code Here

        OWLNamedIndividual root = NamedIndividual("ind", pm);
        Ontology(
                m,
                AnnotationAssertion(prop, root.getIRI(),
                        IRI("http://org.semanticweb.owlapi/ont#myIRI")));
        AnnotationValueShortFormProvider sfp = new AnnotationValueShortFormProvider(
                props, langMap, m);
        assertEquals("myIRI", sfp.getShortForm(root));
    }
View Full Code Here

    public void shouldWrapWithDoubleQuotes() {
        OWLNamedIndividual root = NamedIndividual("ind", pm);
        String shortForm = "MyLabel";
        Ontology(m,
                AnnotationAssertion(prop, root.getIRI(), Literal(shortForm)));
        AnnotationValueShortFormProvider sfp = new AnnotationValueShortFormProvider(
                m, new SimpleShortFormProvider(),
                new SimpleIRIShortFormProvider(), props, langMap);
        sfp.setLiteralRenderer(new StringAnnotationVisitor() {

            private static final long serialVersionUID = 1L;

            @Nonnull
            @Override
            public String visit(@Nonnull OWLLiteral literal) {
                return '"' + literal.getLiteral() + '"';
            }
        });
        String shortForm2 = sfp.getShortForm(root);
        assertEquals(shortForm2, '"' + shortForm + '"');
    }
View Full Code Here

TOP

Related Classes of org.semanticweb.owlapi.util.AnnotationValueShortFormProvider

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.