Package org.apache.clerezza.rdf.jena.serializer

Examples of org.apache.clerezza.rdf.jena.serializer.JenaSerializerProvider.serialize()


    public static void main(String[] args) throws Exception {
        JenaSerializerProvider p = new JenaSerializerProvider();
        ByteArrayOutputStream out = new ByteArrayOutputStream();
        MGraph g = new SimpleMGraph();
        g.add(new TripleImpl(new UriRef("urn:test"),new UriRef("http://test.org/test"),new PlainLiteralImpl("test")));
        p.serialize(out, g, SupportedFormat.N_TRIPLE);
        System.out.println(new String(out.toByteArray(),Charset.forName("UTF-8")));
    }
}
View Full Code Here


   
    ByteArrayOutputStream out = new ByteArrayOutputStream();
   
    SerializingProvider serializingProvider = new JenaSerializerProvider();
   
    serializingProvider.serialize(out, mGraph, SupportedFormat.RDF_XML);
   
    ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray());
   
    Model jenaModel = ModelFactory.createDefaultModel();
   
View Full Code Here

         * change.
         */

        ByteArrayOutputStream out = new ByteArrayOutputStream();
        SerializingProvider serializingProvider = new JenaSerializerProvider();
        serializingProvider.serialize(out, graph, SupportedFormat.RDF_XML);
        ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray());
        OWLOntology ontology = null;
        try {
            ontology = ontologyManager.loadOntologyFromOntologyDocument(in);
        } catch (OWLOntologyAlreadyExistsException e) {
View Full Code Here

    public static void main(String[] args) throws Exception {
        JenaSerializerProvider p = new JenaSerializerProvider();
        ByteArrayOutputStream out = new ByteArrayOutputStream();
        MGraph g = new SimpleMGraph();
        g.add(new TripleImpl(new UriRef("urn:test"),new UriRef("http://test.org/test"),new PlainLiteralImpl("test")));
        p.serialize(out, g, SupportedFormat.N_TRIPLE);
        System.out.println(new String(out.toByteArray(),Charset.forName("UTF-8")));
    }
}
View Full Code Here

        } catch (EngineException e) {
            RemoteServiceHelper.checkServiceUnavailable(e);
            return;
        }
        JenaSerializerProvider serializer = new JenaSerializerProvider();
        serializer.serialize(System.out, ci.getMetadata(), TURTLE);
        Map<UriRef,Resource> expectedValues = new HashMap<UriRef,Resource>();
        expectedValues.put(Properties.ENHANCER_EXTRACTED_FROM, ci.getUri());
        expectedValues.put(Properties.DC_CREATOR, LiteralFactory.getInstance().createTypedLiteral(
            zemantaEngine.getClass().getName()));
        //deactivate require fise:confidence values for fise:TextAnnotations, because
View Full Code Here

    private TestUtils(){}
   
    public static void logEnhancements(ContentItem ci) {
        JenaSerializerProvider serializer = new JenaSerializerProvider();
        ByteArrayOutputStream logOut = new ByteArrayOutputStream();
        serializer.serialize(logOut, ci.getMetadata(), TURTLE);
        log.info("Enhancements: \n{}",new String(logOut.toByteArray(),Charset.forName("UTF-8")));
    }

}
View Full Code Here

                return;
            }
            throw e;
        }
        JenaSerializerProvider serializer = new JenaSerializerProvider();
        serializer.serialize(System.out, ci.getMetadata(), TURTLE);
        int textAnnoNum = checkAllTextAnnotations(ci.getMetadata(), BIO_DOMAIN_TEXT);
        log.info(textAnnoNum + " TextAnnotations found ...");
        int entityAnnoNum = checkAllEntityAnnotations(ci.getMetadata());
        log.info(entityAnnoNum + " EntityAnnotations found ...");
    }
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.