Examples of copyPrefixesFrom()


Examples of org.semanticweb.owlapi.formats.ManchesterSyntaxDocumentFormat.copyPrefixesFrom()

            changes.add(new AddAxiom(ont, pair.getAxiom()));
        }
        changes.add(new SetOntologyID(ont, ontologyID));
        ont.getOWLOntologyManager().applyChanges(changes);
        ManchesterSyntaxDocumentFormat format = new ManchesterSyntaxDocumentFormat();
        format.copyPrefixesFrom(pm);
        return format;
    }

    private ManchesterOWLSyntaxOntologyHeader
            parseOntologyHeader(boolean toEOF) {
View Full Code Here

Examples of org.semanticweb.owlapi.formats.ManchesterSyntaxDocumentFormat.copyPrefixesFrom()

        // OWLOntologyDocumentTarget documentTarget = new
        // SystemOutDocumentTarget();
        // Try another format - The Manchester OWL Syntax
        ManchesterSyntaxDocumentFormat manSyntaxFormat = new ManchesterSyntaxDocumentFormat();
        if (format.isPrefixOWLOntologyFormat()) {
            manSyntaxFormat
                    .copyPrefixesFrom(format.asPrefixOWLOntologyFormat());
        }
        manager.saveOntology(pizzaOntology, manSyntaxFormat,
                new StreamDocumentTarget(new ByteArrayOutputStream()));
    }
View Full Code Here

Examples of org.semanticweb.owlapi.formats.OWLXMLDocumentFormat.copyPrefixesFrom()

        // case we loaded the pizza ontology from an rdf/xml format, which
        // supports prefixes. When we save the ontology in the new format we
        // will copy the prefixes over so that we have nicely abbreviated IRIs
        // in the new ontology document
        if (format.isPrefixOWLOntologyFormat()) {
            owlxmlFormat.copyPrefixesFrom(format.asPrefixOWLOntologyFormat());
        }
        manager.saveOntology(pizzaOntology, owlxmlFormat,
                IRI.create(file.toURI()));
        // We can also dump an ontology to System.out by specifying a different
        // OWLOntologyOutputTarget Note that we can write an ontology to a
View Full Code Here

Examples of org.semanticweb.owlapi.formats.OWLXMLDocumentFormat.copyPrefixesFrom()

            SAXParser parser = factory.newSAXParser();
            isrc = getInputSource(documentSource, configuration);
            OWLXMLParserHandler handler = new OWLXMLParserHandler(ontology,
                    configuration);
            parser.parse(isrc, handler);
            format.copyPrefixesFrom(handler.getPrefixName2PrefixMap());
            return format;
        } catch (ParserConfigurationException e) {
            throw new OWLRuntimeException(e);
        } catch (SAXException e) {
            // General exception
View Full Code Here

Examples of org.semanticweb.owlapi.formats.PrefixDocumentFormat.copyPrefixesFrom()

                && format.isPrefixOWLOntologyFormat()) {
            PrefixDocumentFormat fromPrefixFormat = fromFormat
                    .asPrefixOWLOntologyFormat();
            PrefixDocumentFormat toPrefixFormat = format
                    .asPrefixOWLOntologyFormat();
            toPrefixFormat.copyPrefixesFrom(fromPrefixFormat);
        }
        boolean addMissingTypes = true;
        if (format instanceof RDFDocumentFormat) {
            format.setAddMissingTypes(addMissingTypes);
        }
View Full Code Here

Examples of org.semanticweb.owlapi.io.OWLXMLOntologyFormat.copyPrefixesFrom()

        RDFXMLOntologyFormat rdfxmlFormat = new RDFXMLOntologyFormat();
       
        // Some ontology formats support prefix names and prefix IRIs.  When we save the ontology in the new format we
        // will copy the prefixes over so that we have nicely abbreviated IRIs in the new ontology document
        if (format.isPrefixOWLOntologyFormat()) {
            owlxmlFormat.copyPrefixesFrom(format.asPrefixOWLOntologyFormat());
        }
       
//        manager.saveOntology(ontology, owlxmlFormat, IRI.create(file.toURI()));  //uses the owl ontology format
//        manager.saveOntology(ontology, IRI.create(file.toURI()));   //uses...some type of RDF format, but not the same as SWEET
        manager.saveOntology(ontology, rdfxmlFormat, IRI.create(file.toURI()));
View Full Code Here

Examples of org.semanticweb.owlapi.io.OWLXMLOntologyFormat.copyPrefixesFrom()

        // case we loaded the pizza ontology from an rdf/xml format, which
        // supports prefixes. When we save the ontology in the new format we
        // will copy the prefixes over so that we have nicely abbreviated IRIs
        // in the new ontology document
        if (format.isPrefixOWLOntologyFormat()) {
            owlxmlFormat.copyPrefixesFrom(format.asPrefixOWLOntologyFormat());
        }

        manager.saveOntology(ontology, owlxmlFormat, IRI.create(file.toURI()));
    }
 
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.