Package org.dbpedia.spotlight.model

Examples of org.dbpedia.spotlight.model.Text


                             @DefaultValue(SpotlightConfiguration.DEFAULT_TYPES) @QueryParam("types") String resourceTypesString,
                            @DefaultValue("250") @FormParam("n") int nHits) {

        try {
            List<OntologyType> ontologyTypes = Factory.ontologyType().fromCSVString(resourceTypesString);
            return ok(asJSON(new Text(text), nHits, ontologyTypes));
        } catch (Exception e) {
            e.printStackTrace();
            throw new WebApplicationException(Response.status(Response.Status.BAD_REQUEST). entity(ServerUtils.print(e)).type(MediaType.APPLICATION_JSON).build());
        }
    }
View Full Code Here


                           @DefaultValue(SpotlightConfiguration.DEFAULT_TYPES) @QueryParam("types") String resourceTypesString,
                            @DefaultValue("250") @QueryParam("n") int nHits) {

        try {
            List<OntologyType> ontologyTypes = Factory.ontologyType().fromCSVString(resourceTypesString);
            return ok(asXML(new Text(text), nHits, ontologyTypes));
        } catch (Exception e) {
            e.printStackTrace();
            throw new WebApplicationException(Response.status(Response.Status.BAD_REQUEST). entity(ServerUtils.print(e)).type(MediaType.APPLICATION_XML).build());
        }
    }
View Full Code Here

                            @DefaultValue(SpotlightConfiguration.DEFAULT_TYPES) @QueryParam("types") String resourceTypesString,
                            @DefaultValue("250") @FormParam("n") int nHits) {

        try {
            List<OntologyType> ontologyTypes = Factory.ontologyType().fromCSVString(resourceTypesString);
            return ok(asXML(new Text(textString), nHits, ontologyTypes));
            //return ok(asXML(new Text(text), nHits));
        } catch (Exception e) {
            e.printStackTrace();
            throw new WebApplicationException(Response.status(Response.Status.BAD_REQUEST). entity(ServerUtils.print(e)).type(MediaType.APPLICATION_XML).build());
        }
View Full Code Here

TOP

Related Classes of org.dbpedia.spotlight.model.Text

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.