Package org.semanticweb.owlapi.util.mansyntax

Examples of org.semanticweb.owlapi.util.mansyntax.ManchesterOWLSyntaxParser


    }

    @Nonnull
    @Override
    public Set<OntologyAxiomPair> parse(String expression) {
        ManchesterOWLSyntaxParser parser = new ManchesterOWLSyntaxParserImpl(
                new OWLAPIConfigProvider(), dataFactory);
        parser.setOWLEntityChecker(checker);
        parser.setStringToParse(expression);
        parser.setDefaultOntology(verifyNotNull(defaultOntology));
        parser.setOWLOntologyChecker(verifyNotNull(ontologyChecker));
        return parser.parseFrames();
    }
View Full Code Here


        parse(text1);
    }

    private OWLClassExpression parse(@Nonnull String text) {
        MockEntityChecker checker = new MockEntityChecker(df);
        ManchesterOWLSyntaxParser parser = OWLManager.createManchesterParser();
        parser.setStringToParse(text);
        parser.setOWLEntityChecker(checker);
        return parser.parseClassExpression();
    }
View Full Code Here

        Set<OWLOntology> ontologies = m.getOntologies();
        ShortFormProvider sfp = new ManchesterOWLSyntaxPrefixNameShortFormProvider(
                wine.getOWLOntologyManager().getOntologyFormat(wine));
        BidirectionalShortFormProvider shortFormProvider = new BidirectionalShortFormProviderAdapter(
                ontologies, sfp);
        ManchesterOWLSyntaxParser parser = OWLManager.createManchesterParser();
        parser.setStringToParse(expression);
        parser.setDefaultOntology(wine);
        parser.setOWLEntityChecker(new ShortFormEntityChecker(shortFormProvider));
        parser.parseClassExpression();
    }
View Full Code Here

        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();
        parser.setStringToParse(text1);
        ShortFormEntityChecker owlEntityChecker = new ShortFormEntityChecker(
                shortFormProvider);
        parser.setOWLEntityChecker(owlEntityChecker);
        parser.setDefaultOntology(o);
        // when
        // finally parse
        OWLClassExpression dsvf = parser.parseClassExpression();
        // then
        assertEquals(expected, dsvf);
    }
View Full Code Here

        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();
        parser.setStringToParse(text1);
        ShortFormEntityChecker owlEntityChecker = new ShortFormEntityChecker(
                shortFormProvider);
        parser.setOWLEntityChecker(owlEntityChecker);
        parser.setDefaultOntology(o);
        // when
        // finally parse
        OWLClassExpression dsvf = parser.parseClassExpression();
        // then
        assertEquals("Expected " + expected + " actual " + dsvf, expected, dsvf);
    }
View Full Code Here

        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();
        parser.setStringToParse(text1);
        ShortFormEntityChecker owlEntityChecker = new ShortFormEntityChecker(
                shortFormProvider);
        parser.setOWLEntityChecker(owlEntityChecker);
        parser.setDefaultOntology(o);
        // when
        // finally parse
        OWLClassExpression dsvf = parser.parseClassExpression();
        // then
        assertEquals(expected, dsvf);
    }
View Full Code Here

        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();
        parser.setStringToParse(text1);
        ShortFormEntityChecker owlEntityChecker = new ShortFormEntityChecker(
                shortFormProvider);
        parser.setOWLEntityChecker(owlEntityChecker);
        parser.setDefaultOntology(o);
        // when
        // finally parse
        OWLClassExpression dsvf = parser.parseClassExpression();
        // then
        assertEquals("Expected " + expected + " actual " + dsvf, expected, dsvf);
    }
View Full Code Here

        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();
        parser.setStringToParse(in);
        ShortFormEntityChecker owlEntityChecker = new ShortFormEntityChecker(
                shortFormProvider);
        parser.setOWLEntityChecker(owlEntityChecker);
        parser.setDefaultOntology(o);
        // when
        // finally parse
        OWLAxiom axiom = parser.parseAxiom();
        // then
        assertEquals(df.getOWLSubClassOfAxiom(a, b), axiom);
    }
View Full Code Here

     */
    @Nonnull
    public OWLClassExpression parseClassExpression(
            @Nonnull String classExpressionString) {
        // Set up the real parser
        ManchesterOWLSyntaxParser parser = OWLManager.createManchesterParser();
        parser.setStringToParse(classExpressionString);
        parser.setDefaultOntology(rootOntology);
        // Specify an entity checker that wil be used to check a class
        // expression contains the correct names.
        OWLEntityChecker entityChecker = new ShortFormEntityChecker(
                bidiShortFormProvider);
        parser.setOWLEntityChecker(entityChecker);
        // Do the actual parsing
        return parser.parseClassExpression();
    }
View Full Code Here

    private class ParserWrapper {

        ParserWrapper() {}

        public void parse(@Nonnull String input) {
            ManchesterOWLSyntaxParser actualParser = OWLManager
                    .createManchesterParser();
            actualParser.setOWLEntityChecker(entityChecker);
            actualParser.setStringToParse(input);
            actualParser.parseFrames();
        }
View Full Code Here

TOP

Related Classes of org.semanticweb.owlapi.util.mansyntax.ManchesterOWLSyntaxParser

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.