Package org.semanticweb.owlapi.vocab

Examples of org.semanticweb.owlapi.vocab.PrefixOWLOntologyFormat


  protected void storeOntology(OWLOntologyManager manager, OWLOntology ontology, Writer writer, OWLOntologyFormat format) throws
                                                                                                                            OWLOntologyStorageException {
        try {
            OWLObjectRenderer ren = new OWLObjectRenderer(manager, ontology, writer);
            if(format instanceof PrefixOWLOntologyFormat) {
                PrefixOWLOntologyFormat prefixFormat = (PrefixOWLOntologyFormat) format;
                DefaultPrefixManager man = new DefaultPrefixManager();
                Map<String, String> map = prefixFormat.getPrefixName2PrefixMap();
                for(String pn : map.keySet()) {
                    man.setPrefix(pn, map.get(pn));
                }
                ren.setPrefixManager(man);
            }
View Full Code Here



    private void processOntology() {
        namespaceUtil = new NamespaceUtil();
        if (ontologyFormat instanceof PrefixOWLOntologyFormat) {
            PrefixOWLOntologyFormat namespaceFormat = (PrefixOWLOntologyFormat) ontologyFormat;
            Map<String, String> namespacesByPrefix = namespaceFormat.getPrefixName2PrefixMap();
            for (String prefixName : namespacesByPrefix.keySet()) {
                    String xmlnsPrefixName = prefixName.substring(0, prefixName.length() - 1);
                    String xmlnsPrefix = namespacesByPrefix.get(prefixName);
                    namespaceUtil.setPrefix(xmlnsPrefix, xmlnsPrefixName);
            }
View Full Code Here

     * @param ontology The ontology
     * @return A suggested default namespace
     */
    private static String getDefaultNamespace(OWLOntology ontology, OWLOntologyFormat format) {
        if(format instanceof PrefixOWLOntologyFormat) {
            PrefixOWLOntologyFormat prefixOWLOntologyFormat = (PrefixOWLOntologyFormat) format;
            String defaultPrefix = prefixOWLOntologyFormat.getDefaultPrefix();
            if(defaultPrefix != null) {
                return defaultPrefix;
            }
        }
        if(ontology.getOntologyID().isAnonymous()) {
View Full Code Here

     * @param format The format from which prefix name mappings will be reused
     */
    public ManchesterOWLSyntaxPrefixNameShortFormProvider(OWLOntologyFormat format) {
        prefixManager = new DefaultPrefixManager();
        if(format instanceof PrefixOWLOntologyFormat) {
            PrefixOWLOntologyFormat prefixFormat = (PrefixOWLOntologyFormat) format;
            for(String prefixName : prefixFormat.getPrefixName2PrefixMap().keySet()) {
                prefixManager.setPrefix(prefixName, prefixFormat.getPrefix(prefixName));
            }
        }
    }
View Full Code Here

TOP

Related Classes of org.semanticweb.owlapi.vocab.PrefixOWLOntologyFormat

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.