Package org.obolibrary.oboformat.writer.OBOFormatWriter

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


            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();
                    }
                };
            } else {
                nameProvider = new OBODocNameProvider(result);
            }
            OBOFormatWriter oboFormatWriter = new OBOFormatWriter();
            oboFormatWriter.setCheckStructure((Boolean) format.getParameter(
                    OBODocumentFormat.VALIDATION, Boolean.TRUE));
            oboFormatWriter.write(result, new BufferedWriter(writer),
View Full Code Here

TOP

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

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.