Package org.coode.owlapiv2.xml

Examples of org.coode.owlapiv2.xml.OWLOntologyNamespaceManager


     */
    public static OWLOntologyManager createOWLOntologyManager(OWLDataFactory dataFactory) {
        // Create the ontology manager and add ontology factories, mappers and storers
        OWLOntologyManager ontologyManager = new OWLOntologyManagerImpl(dataFactory);
        ontologyManager.addOntologyStorer(new RDFXMLOntologyStorer());
        ontologyManager.addOntologyStorer(new OWLXMLOntologyStorer());
        ontologyManager.addOntologyStorer(new OWLFunctionalSyntaxOntologyStorer());
        ontologyManager.addOntologyStorer(new ManchesterOWLSyntaxOntologyStorer());
        ontologyManager.addOntologyStorer(new OBOFlatFileOntologyStorer());
        ontologyManager.addOntologyStorer(new KRSS2OWLSyntaxOntologyStorer());
        ontologyManager.addOntologyStorer(new TurtleOntologyStorer());
View Full Code Here


    public TurtleRenderer(OWLOntology ontology, OWLOntologyManager manager, Writer writer) {
        super(ontology, manager);
        this.writer = new PrintWriter(writer);
        pending = new HashSet<RDFResourceNode>();
        nsm = new OWLOntologyNamespaceManager(manager, getOntology());
        base = "";
    }
View Full Code Here

    public ManchesterOWLSyntaxFrameRenderer(OWLOntologyManager owlOntologyManager, OWLOntology ontology,
                                            Writer writer) {
        super(writer);
        this.ontology = ontology;
        nsm = new OWLOntologyNamespaceManager(owlOntologyManager, ontology);
        setShortFormProvider(new ShortFormProvider() {
            public String getShortForm(OWLEntity entity) {
                return nsm.getQName(entity.getURI().toString());
            }
View Full Code Here

    public RDFXMLRenderer(OWLOntologyManager manager, OWLOntology ontology, Writer w, OWLOntologyFormat format) {
        super(ontology, manager, format);
        pending = new HashSet<RDFResourceNode>();
        writer = new RDFXMLWriter(XMLWriterFactory.getInstance().createXMLWriter(w,
                                                                                 new OWLOntologyNamespaceManager(manager,
                                                                                                                 ontology,
                                                                                                                 format),
                                                                                 ontology.getURI().toString()));
        prettyPrintedTypes = new HashSet<URI>();
        prettyPrintedTypes.add(OWLRDFVocabulary.OWL_CLASS.getURI());
View Full Code Here

        super(owlOntologyManager);
    }

    public void render(OWLOntology ontology, Writer writer, OWLOntologyFormat format) throws OWLRendererException {
        try {
            OWLOntologyNamespaceManager nsm = new OWLOntologyNamespaceManager(getOWLOntologyManager(), ontology);
            nsm.setDefaultNamespace(Namespaces.OWL2XML.toString());
            nsm.setPrefix("owl2xml", Namespaces.OWL2XML.toString());
            if(format instanceof NamespaceOWLOntologyFormat) {
                NamespaceOWLOntologyFormat namespaceFormat = (NamespaceOWLOntologyFormat) format;
                final Map<String,String> nsByPrefixMap = namespaceFormat.getNamespacesByPrefixMap();
                for(String prefix : nsByPrefixMap.keySet()) {
                    String ns = nsByPrefixMap.get(prefix);
                    if(ns != null && ns.length() > 0) {
                       nsm.setPrefix(prefix, ns);
                    }
                }
                if(namespaceFormat.getDefaultNamespace() != null) {
                    nsm.setDefaultNamespace(namespaceFormat.getDefaultNamespace());
                }
            }
            OWLXMLWriter w = new OWLXMLWriter(writer, nsm, ontology);
            w.startDocument(ontology);
            OWLXMLObjectRenderer ren = new OWLXMLObjectRenderer(ontology, w);
View Full Code Here

    public OWLObjectRenderer(OWLOntologyManager man, OWLOntology ontology, Writer writer) {
        this.ontology = ontology;
        this.writer = writer;
        writeEnitiesAsURIs = true;
        nsm = new OWLOntologyNamespaceManager(man, ontology);
        focusedObject = man.getOWLDataFactory().getOWLThing();
    }
View Full Code Here

public class DIGXMLWriterFactory {

     public static final String DIG_BASE = "http://dig.org";

    public static XMLWriter getXMLWriter(Writer writer) {
        XMLWriterNamespaceManager nsm = new XMLWriterNamespaceManager(DIG_BASE + "#");
        return XMLWriterFactory.getInstance().createXMLWriter(writer, nsm, DIG_BASE);
    }
View Full Code Here

TOP

Related Classes of org.coode.owlapiv2.xml.OWLOntologyNamespaceManager

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.