Examples of OntologyContentInputSource


Examples of org.apache.stanbol.ontologymanager.ontonet.api.io.OntologyContentInputSource

    @POST
    @Consumes(value = {OWL_XML, FUNCTIONAL_OWL, MANCHESTER_OWL})
    public Response storeOWLOntology(InputStream content, @Context HttpHeaders headers) {
        long before = System.currentTimeMillis();
        try {
            OntologyInputSource<OWLOntology,OWLOntologyManager> src = new OntologyContentInputSource(content);
            ontologyProvider.loadInStore(src.getRootOntology(), null, true);
        } catch (OWLOntologyCreationException e) {
            throw new WebApplicationException(e, INTERNAL_SERVER_ERROR);
        }
        log.debug("POST request for ontology addition completed in {} ms.",
            (System.currentTimeMillis() - before));
View Full Code Here

Examples of org.apache.stanbol.ontologymanager.sources.owlapi.OntologyContentInputSource

                rb = Response.status(Status.INTERNAL_SERVER_ERROR);
            }
        } else if (OWL_XML_TYPE.equals(mt) || FUNCTIONAL_OWL_TYPE.equals(mt)
                || MANCHESTER_OWL_TYPE.equals(mt)) {
            try {
                OntologyInputSource<OWLOntology> src = new OntologyContentInputSource(content);
                ontologyProvider.loadInStore(src.getRootOntology(), true);
                rb = Response.ok();
            } catch (OWLOntologyCreationException e) {
                throw new WebApplicationException(e, INTERNAL_SERVER_ERROR);
            }
        } else {
View Full Code Here

Examples of org.apache.stanbol.ontologymanager.sources.owlapi.OntologyContentInputSource

        String mt = headers.getMediaType().toString();
        if (session == null) rb = Response.status(NOT_FOUND); // Always check session first
        else try {
            log.debug("POST content claimed to be of type {}.", mt);
            OntologyInputSource<?> src;
            if (OWL_XML.equals(mt) || FUNCTIONAL_OWL.equals(mt) || MANCHESTER_OWL.equals(mt)) src = new OntologyContentInputSource(
                    content);
            else // content = new BufferedInputStream(content);
            src = new GraphContentInputSource(content, mt, ontologyProvider.getStore());
            log.debug("SUCCESS parse with media type {}.", mt);
            OWLOntologyID key = session.addOntology(src);
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.