Package org.semanticweb.owlapi.io

Examples of org.semanticweb.owlapi.io.IRIDocumentSource


        } else {
            // Nothing we can do here. We can't get a document IRI to load
            // the ontology from.
            throw new OntologyIRIMappingNotFoundException(ontologyIRI);
        }
        return loadOntology(ontologyIRI, new IRIDocumentSource(documentIRI,
                null, null), configuration);
    }
View Full Code Here


    @Override
    public OWLOntology loadOntologyFromOntologyDocument(IRI documentIRI)
            throws OWLOntologyCreationException {
        // Ontology URI not known in advance
        return loadOntology(null,
                new IRIDocumentSource(documentIRI, null, null),
                getOntologyLoaderConfiguration());
    }
View Full Code Here

    public OWLOntology loadOntology(String fileName) {
        try {
            URL url = getClass().getResource('/' + fileName);
            return m.loadOntologyFromOntologyDocument(
                    new IRIDocumentSource(IRI.create(url), null, null),
                    new OWLOntologyLoaderConfiguration()
                            .setReportStackTraces(true));
        } catch (OWLOntologyCreationException e) {
            fail(e.getMessage());
            throw new OWLRuntimeException(e);
View Full Code Here

    protected OWLOntology createOntology() throws OWLOntologyCreationException {
        String fileName = getFileName();
        URL uri = getClass().getResource('/' + fileName);
        return m.loadOntologyFromOntologyDocument(
                new IRIDocumentSource(IRI.create(uri), null, null),
                getConfiguration());
    }
View Full Code Here

                    log.debug("Cannot load from a local bundle relative path", e1);
                    log.debug("Try to load the configuration ontology resolving the given IRI");
                    IRI iri = IRI.create(configPath);
                    if (!iri.isAbsolute()) throw new Exception("IRI seems to be not absolute! value was: "
                                                               + iri.toQuotedString());
                    oConfSrc = new IRIDocumentSource(iri);
                } catch (Exception e) {
                    try {
                        log.debug("Cannot load from the web", e1);
                        log.debug("Try to load the configuration ontology as full local file path");
                        oConfSrc = new FileDocumentSource(new File(configPath));
View Full Code Here

        for (String loc : locations) {
            try {
                IRI iri = IRI.create(loc);
                OWLOntologyDocumentSource src = null;
                OWLOntology o = null;
                if (iri.isAbsolute()) src = new IRIDocumentSource(iri);
                else {
                    // Relative IRI : use data file provider
                    log.debug("Found relative IRI {} . Will try to retrieve from data file providers.", iri);
                    Map<String,String> info = new HashMap<String,String>();
                    if (dataFileProvider != null && dataFileProvider.isAvailable(null, loc, info)) src = new StreamDocumentSource(
View Full Code Here

        else {
            // Nothing we can do here.  We can't get a document IRI to load
            // the ontology from.
            throw new OntologyIRIMappingNotFoundException(ontologyIRI);
        }
        return loadOntology(ontologyIRI, new IRIDocumentSource(documentIRI), configuration);
    }
View Full Code Here

    }


    public OWLOntology loadOntologyFromOntologyDocument(IRI documentIRI) throws OWLOntologyCreationException {
        // Ontology URI not known in advance
        return loadOntology(null, new IRIDocumentSource(documentIRI), new OWLOntologyLoaderConfiguration());
    }
View Full Code Here

        for (String loc : locations) {
            try {
                IRI iri = IRI.create(loc);
                OWLOntologyDocumentSource src = null;
                OWLOntology o = null;
                if (iri.isAbsolute()) src = new IRIDocumentSource(iri);
                else {
                    // Relative IRI : use data file provider
                    log.debug("Found relative IRI {} . Will try to retrieve from data file providers.", iri);
                    Map<String,String> info = new HashMap<String,String>();
                    if (dataFileProvider != null && dataFileProvider.isAvailable(null, loc, info)) src = new StreamDocumentSource(
View Full Code Here

                    log.debug("Cannot load from a local bundle relative path", e1);
                    log.debug("Try to load the configuration ontology resolving the given IRI");
                    IRI iri = IRI.create(configPath);
                    if (!iri.isAbsolute()) throw new Exception("IRI seems to be not absolute! value was: "
                                                               + iri.toQuotedString());
                    oConfSrc = new IRIDocumentSource(iri);
                } catch (Exception e) {
                    try {
                        log.debug("Cannot load from the web", e1);
                        log.debug("Try to load the configuration ontology as full local file path");
                        oConfSrc = new FileDocumentSource(new File(configPath));
View Full Code Here

TOP

Related Classes of org.semanticweb.owlapi.io.IRIDocumentSource

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.