Package org.obolibrary.oboformat.writer.OBOFormatWriter

Examples of org.obolibrary.oboformat.writer.OBOFormatWriter.NameProvider


        try {
            OWLAPIOwl2Obo translator = new OWLAPIOwl2Obo(
                    ontology.getOWLOntologyManager());
            final OBODoc result = translator.convert(ontology);
            boolean hasImports = ontology.getImports().isEmpty() == false;
            NameProvider nameProvider;
            if (hasImports) {
                // if the ontology has imports
                // use it as secondary lookup for labels
                final NameProvider primary = new OBODocNameProvider(result);
                final NameProvider secondary = new OWLOntologyNameProvider(
                        ontology, primary.getDefaultOboNamespace());
                // combine primary and secondary name provider
                nameProvider = new NameProvider() {

                    @Override
                    public String getName(String id) {
                        String name = primary.getName(id);
                        if (name != null) {
                            return name;
                        }
                        return secondary.getName(id);
                    }

                    @Override
                    public String getDefaultOboNamespace() {
                        return primary.getDefaultOboNamespace();
View Full Code Here

TOP

Related Classes of org.obolibrary.oboformat.writer.OBOFormatWriter.NameProvider

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.