Examples of RDFContainerFactoryImpl


Examples of org.semanticdesktop.aperture.rdf.impl.RDFContainerFactoryImpl

            extractor = new HtmlTextExtractUtil();
        } catch (InitializationException e) {
            throw new ExtractorException("Could not initialize HtmlExtractor: " + e.getMessage());
        }
        InputStream stream = new ByteArrayInputStream(string.getBytes());
        RDFContainerFactory containerFactory = new RDFContainerFactoryImpl();
        URI id = rdf.getDescribedUri();
        RDFContainer result = containerFactory.getRDFContainer(id);
        extractor.extract(id, charset, stream, result);
        Model meta = result.getModel();
       
        // append metadata and full-text to a string buffer
        StringBuilder buffer = new StringBuilder(32 * 1024);
 
View Full Code Here

Examples of org.semanticdesktop.aperture.rdf.impl.RDFContainerFactoryImpl

   
    public static void main(String[] args) throws Exception {
        int argv = 0;
        SimpleMailExtractor extractor = new SimpleMailExtractor();
       
        RDFContainerFactory rdfFactory = new RDFContainerFactoryImpl();
        for (int i = argv; i < args.length; ++i) {
            File file = new File(args[i]);
            InputStream in = new FileInputStream(file);
            URI uri = new URIImpl(file.toURI().toString());
            RDFContainer rdfContainer = rdfFactory.getRDFContainer(uri);
            extractor.extract(uri, in, null, null, rdfContainer);
            Model model = rdfContainer.getModel();
            model.writeTo(System.out, Syntax.RdfXml);
            model.close();
        }
View Full Code Here

Examples of org.semanticdesktop.aperture.rdf.impl.RDFContainerFactoryImpl

            // get extractor from the first available factory
            ExtractorFactory factory =
                (ExtractorFactory)factories.iterator().next();
            Extractor extractor = factory.get();
            RDFContainerFactory containerFactory =
                new RDFContainerFactoryImpl();
            RDFContainer container =
                containerFactory.getRDFContainer(docId);
            extractor.extract(
                container.getDescribedUri(),
                new BufferedInputStream(in, 8192),
                null, mimeType, container);
            in.close();
View Full Code Here

Examples of org.semanticdesktop.aperture.rdf.impl.RDFContainerFactoryImpl

    }

    public static void main(String[] args) throws Exception {
        int argv = 0;
        IksHtmlExtractor inst = new IksHtmlExtractor();
        RDFContainerFactory rdfFactory = new RDFContainerFactoryImpl();
        for (int i = argv; i < args.length; ++i) {
            File file = new File(args[i]);
            InputStream input = new FileInputStream(file);
            Charset charset = Charset.forName("UTF-8");
            String mimeType = "text/html";
            URI uri = new URIImpl(file.toURI().toString());
            RDFContainer container = rdfFactory.getRDFContainer(uri);
            inst.extract(uri, input, charset, mimeType, container);
            System.out.println("Model for " + args[i]);
            container.getModel().writeTo(System.out);
            System.out.println();
            container.dispose();
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.