Package org.semanticweb.owlapi.util

Examples of org.semanticweb.owlapi.util.DefaultPrefixManager


    public OWLObjectRenderer(OWLOntologyManager man, OWLOntology ontology, Writer writer) {
        this.ontology = ontology;
        this.writer = writer;
        writeEnitiesAsURIs = true;
        prefixManager = new DefaultPrefixManager();
        if (!ontology.isAnonymous()) {
            String defPrefix = ontology.getOntologyID().getOntologyIRI() + "#";
            prefixManager.setDefaultPrefix(defPrefix);
        }
        OWLOntologyFormat ontologyFormat = man.getOntologyFormat(ontology);
View Full Code Here


                                                                                                                            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);
            }
            ontology.accept(ren);
            writer.flush();
View Full Code Here

            OWLRDFConsumerAdapter consumer = new OWLRDFConsumerAdapter(ontology, parser, configuration);
            parser.setTripleHandler(consumer);
            parser.parseDocument();
            TurtleOntologyFormat format = new TurtleOntologyFormat();
            DefaultPrefixManager prefixManager = parser.getPrefixManager();
            for(String prefixName : prefixManager.getPrefixNames()) {
                format.setPrefix(prefixName, prefixManager.getPrefix(prefixName));
            }
            return format;

        }
        catch(ParseException e) {
View Full Code Here

    /**
     * Constructs a short form provider that reuses any prefix name mappings from the specified ontology format
     * @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

    public ManchesterOWLSyntaxPrefixNameShortFormProvider(DefaultPrefixManager prefixManager) {
        this.prefixManager = prefixManager;
    }

    public PrefixManager getPrefixManager() {
        return new DefaultPrefixManager(prefixManager);
    }
View Full Code Here

TOP

Related Classes of org.semanticweb.owlapi.util.DefaultPrefixManager

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.