Examples of DocumentSource


Examples of org.apache.any23.source.DocumentSource

    }

    @Test
    public void testExceptionPropagation() throws IOException {
        Any23 any23 = new Any23();
        DocumentSource source = new FileDocumentSource(
                new File("src/test/resources/application/turtle/geolinkeddata.ttl"),
                "http://www.test.com"
        );
        CountingTripleHandler cth1 = new CountingTripleHandler();
        try {
View Full Code Here

Examples of org.apache.any23.source.DocumentSource

    @Test
    public void testXMLMimeTypeManagement() throws IOException, ExtractionException {
        final String documentURI = "http://www.test.com/resource.xml";
        final String contentType = "application/xml";
        final String in = StreamUtils.asString( this.getClass().getResourceAsStream("any23-xml-mimetype.xml") );
        final DocumentSource doc = new StringDocumentSource(in, documentURI, contentType);
        final Any23 any23 = new Any23();
        final CountingTripleHandler cth = new CountingTripleHandler(false);
        final ReportingTripleHandler rth = new ReportingTripleHandler(cth);
        final ExtractionReport report = any23.extract(doc, rth);
        Assert.assertFalse(report.hasMatchingExtractors());
View Full Code Here

Examples of org.apache.any23.source.DocumentSource

    @Test
    public void testAbstractMethodErrorIssue186_1() throws IOException, ExtractionException{
        final Any23 runner = new Any23();
        final String content = FileUtils.readResourceContent("/html/rdfa/rdfa-issue186-1.xhtml");
        final DocumentSource source = new StringDocumentSource(content, "http://base.com");
        final ByteArrayOutputStream out = new ByteArrayOutputStream();
        final TripleHandler handler = new NTriplesWriter(out);
        runner.extract(source, handler);
        String n3 = out.toString("UTF-8");
        logger.debug(n3);
View Full Code Here

Examples of org.apache.any23.source.DocumentSource

    @Test
    public void testAbstractMethodErrorIssue186_2() throws IOException, ExtractionException{
        final Any23 runner = new Any23();
        final String content = FileUtils.readResourceContent("/html/rdfa/rdfa-issue186-2.xhtml");
        final DocumentSource source = new StringDocumentSource(content, "http://richard.cyganiak.de/");
        final ByteArrayOutputStream out = new ByteArrayOutputStream();
        final TripleHandler handler = new NTriplesWriter(out);
        runner.extract(source, handler);
        final String n3 = out.toString("UTF-8");
        logger.debug(n3);
View Full Code Here

Examples of org.apache.any23.source.DocumentSource

        final ModifiableConfiguration modifiableConf = DefaultConfiguration.copy();
        modifiableConf.setProperty("any23.extraction.metadata.timesize", "off");
        final Any23 any23 = new Any23(modifiableConf);

        final String content = FileUtils.readResourceContent("/rdf/rdf-issue183.ttl");
        final DocumentSource source = new StringDocumentSource(content, "http://base.com");
        final ByteArrayOutputStream out = new ByteArrayOutputStream();
        final TripleHandler handler = new NTriplesWriter(out);
        any23.extract(source, handler);
        handler.close();
        final String n3 = out.toString("UTF-8");
View Full Code Here

Examples of org.apache.metamodel.data.DocumentSource

        _tableBuilders = new ConcurrentHashMap<String, InferentialTableBuilder>();
    }

    @Override
    public void offerSources(DocumentSourceProvider documentSourceProvider) {
        final DocumentSource documentSource = documentSourceProvider.getMixedDocumentSourceForSampling();
        try {
            while (true) {
                final Document document = documentSource.next();
                if (document == null) {
                    break;
                }
                final String tableName = determineTable(document);
                addObservation(tableName, document);
            }
        } finally {
            documentSource.close();
        }
    }
View Full Code Here

Examples of org.apache.metamodel.data.DocumentSource

        _tableName = tableName;
    }

    @Override
    public void offerSources(DocumentSourceProvider documentSourceProvider) {
        final DocumentSource documentSource = documentSourceProvider.getMixedDocumentSourceForSampling();
        getTableBuilder(_tableName).offerSource(documentSource);
    }
View Full Code Here

Examples of org.apache.metamodel.data.DocumentSource

    public void offerSources(DocumentSourceProvider documentSourceProvider) {
        if (_databaseNames == null) {
            super.offerSources(documentSourceProvider);
        } else {
            for (String databaseName : _databaseNames) {
                final DocumentSource documentSource = documentSourceProvider.getDocumentSourceForTable(databaseName);
                offerDocumentSource(documentSource);
            }
        }
    }
View Full Code Here

Examples of org.apache.metamodel.data.DocumentSource

    @Override
    protected DataSet materializeMainSchemaTable(Table table, Column[] columns, int maxRows) {
        final DocumentConverter documentConverter = _schemaBuilder.getDocumentConverter(table);
        final SelectItem[] selectItems = MetaModelHelper.createSelectItems(columns);
        final DataSetHeader header = new CachingDataSetHeader(selectItems);
        final DocumentSource documentSource = getDocumentSourceForTable(table.getName());

        DataSet dataSet = new DocumentSourceDataSet(header, documentSource, documentConverter);

        if (maxRows > 0) {
            dataSet = new MaxRowsDataSet(dataSet, maxRows);
View Full Code Here

Examples of org.dom4j.io.DocumentSource

      Document doc = node.getDocument();
      if (doc == null) {
        doc = new DOMDocument();
        doc.add(node);
      }
      DocumentSource xmlsource = new DocumentSource(node);
     
      //ByteArrayOutputStream baos = new ByteArrayOutputStream();
      StringWriter sw = new StringWriter();
      StreamResult result = new StreamResult(sw);
      synchronized (transformer) {//o_clusterOK by:fj transformer is per vm
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.