All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.protege.editor.owl.ui.clsdescriptioneditor.OWLClassExpressionSetChecker Maven / Gradle / Ivy

package org.protege.editor.owl.ui.clsdescriptioneditor;

import org.protege.editor.owl.model.OWLModelManager;
import org.protege.editor.owl.model.classexpression.OWLExpressionParserException;
import org.protege.editor.owl.model.parser.ParserUtil;
import org.protege.editor.owl.model.parser.ProtegeOWLEntityChecker;
import org.semanticweb.owlapi.manchestersyntax.parser.ManchesterOWLSyntaxParserImpl;
import org.semanticweb.owlapi.manchestersyntax.renderer.ParserException;
import org.semanticweb.owlapi.model.OWLClassExpression;
import org.semanticweb.owlapi.model.OWLOntologyLoaderConfiguration;
import org.semanticweb.owlapi.util.mansyntax.ManchesterOWLSyntaxParser;

import java.util.Set;


/**
 * Author: Matthew Horridge
* The University Of Manchester
* Medical Informatics Group
* Date: 11-Oct-2006

* [email protected]
* www.cs.man.ac.uk/~horridgm

* */ class OWLClassExpressionSetChecker implements OWLExpressionChecker> { private OWLModelManager mngr; public OWLClassExpressionSetChecker(OWLModelManager mngr) { this.mngr = mngr; } public void check(String text) throws OWLExpressionParserException { createObject(text); } public Set createObject(String text) throws OWLExpressionParserException { ManchesterOWLSyntaxParser parser = new ManchesterOWLSyntaxParserImpl(OWLOntologyLoaderConfiguration::new, mngr.getOWLDataFactory()); parser.setOWLEntityChecker(new ProtegeOWLEntityChecker(mngr.getOWLEntityFinder())); try { parser.setStringToParse(text); return parser.parseClassExpressionList(); } catch (ParserException e) { throw ParserUtil.convertException(e); } } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy