Package org.apache.clerezza.rdf.core.serializedform

Examples of org.apache.clerezza.rdf.core.serializedform.Serializer.serialize()


            } catch (JSONException e) {
                throw new WebApplicationException(e, Status.INTERNAL_SERVER_ERROR);
            }
        } else { // RDF
            Serializer ser = ContextHelper.getServiceFromContext(Serializer.class, servletContext);
            ser.serialize(entityStream, EntityToRDF.toRDF(rep), mediaTypeString);
        }
       
    }

}
View Full Code Here


      try {
        createEnhancements(dbpslGraph, ci, text, language, surfaceForm2TextAnnotation);
        if (log.isDebugEnabled()) {
          Serializer serializer = Serializer.getInstance();
          ByteArrayOutputStream debugStream = new ByteArrayOutputStream();
          serializer.serialize(debugStream, ci.getMetadata(),
              "application/rdf+xml");
          try {
            log.debug("DBPedia Spotlight Enhancements:\n{}",
                debugStream.toString("UTF-8"));
          } catch (UnsupportedEncodingException e) {
View Full Code Here

      try {
        createEnhancements(dbpslGraph, ci,text,language);
        if (log.isDebugEnabled()) {
          Serializer serializer = Serializer.getInstance();
          ByteArrayOutputStream debugStream = new ByteArrayOutputStream();
          serializer.serialize(debugStream, ci.getMetadata(),
              "application/rdf+xml");
          try {
            log.debug("DBpedia Spotlight Spot Enhancements:\n{}",
                debugStream.toString("UTF-8"));
          } catch (UnsupportedEncodingException e) {
View Full Code Here

            } catch (JSONException e) {
                throw new WebApplicationException(e, Status.INTERNAL_SERVER_ERROR);
            }
        } else { // RDF
            Serializer ser = ContextHelper.getServiceFromContext(Serializer.class, servletContext);
            ser.serialize(entityStream, EntityToRDF.toRDF(rep), mediaTypeString);
        }
       
    }

}
View Full Code Here

  public static void main(String[] args) {
    InputStream in = Utils.getResourceAsStream("data/data.ttl");
    Parser parser = Parser.getInstance();
    Graph g = parser.parse(in, SupportedFormat.TURTLE);
    Serializer serializer = Serializer.getInstance();
    serializer.serialize(System.out, g, SupportedFormat.N_TRIPLE);
  }
 
}
View Full Code Here

            try {
                createEnhancements(queryModel(calaisModel), ci);
                if (log.isDebugEnabled()) {
                    Serializer serializer = Serializer.getInstance();
                    ByteArrayOutputStream debugStream = new ByteArrayOutputStream();
                    serializer.serialize(debugStream, ci.getMetadata(), "application/rdf+xml");
                    try {
                        log.debug("Calais Enhancements:\n{}",debugStream.toString("UTF-8"));
                    } catch (UnsupportedEncodingException e) {
                        e.printStackTrace();
                    }
View Full Code Here

            try {
                createEnhancements(queryModel(calaisModel), ci);
                if (log.isDebugEnabled()) {
                    Serializer serializer = Serializer.getInstance();
                    ByteArrayOutputStream debugStream = new ByteArrayOutputStream();
                    serializer.serialize(debugStream, ci.getMetadata(), "application/rdf+xml");
                    try {
                        log.debug("Calais Enhancements:\n{}",debugStream.toString("UTF-8"));
                    } catch (UnsupportedEncodingException e) {
                        e.printStackTrace();
                    }
View Full Code Here

      try {
        createEnhancements(dbpslGraph, ci,text,language);
        if (log.isDebugEnabled()) {
          Serializer serializer = Serializer.getInstance();
          ByteArrayOutputStream debugStream = new ByteArrayOutputStream();
          serializer.serialize(debugStream, ci.getMetadata(),
              "application/rdf+xml");
          try {
            log.debug("DBpedia Spotlight Spot Enhancements:\n{}",
                debugStream.toString("UTF-8"));
          } catch (UnsupportedEncodingException e) {
View Full Code Here

      try {
        createEnhancements(dbpslGraph, ci,text,language);
        if (log.isDebugEnabled()) {
          Serializer serializer = Serializer.getInstance();
          ByteArrayOutputStream debugStream = new ByteArrayOutputStream();
          serializer.serialize(debugStream, ci.getMetadata(),
              "application/rdf+xml");
          try {
            log.debug("DBpedia Spotlight Spot Enhancements:\n{}",
                debugStream.toString("UTF-8"));
          } catch (UnsupportedEncodingException e) {
View Full Code Here

      try {
        createEnhancements(dbpslGraph, ci, language);
        if (log.isDebugEnabled()) {
          Serializer serializer = Serializer.getInstance();
          ByteArrayOutputStream debugStream = new ByteArrayOutputStream();
          serializer.serialize(debugStream, ci.getMetadata(),
              "application/rdf+xml");
          try {
            log.debug("DBpedia Enhancements:\n{}",
                debugStream.toString("UTF-8"));
          } catch (UnsupportedEncodingException e) {
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.