camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From acosent...@apache.org
Subject [camel] 13/20: Improve documentation
Date Wed, 21 Aug 2019 07:58:08 GMT
This is an automated email from the ASF dual-hosted git repository.

acosentino pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git

commit e0cbc3123f6969d43fe15e9070892cf5ebeadcd9
Author: Roberto Flores <betoflowv93@gmail.com>
AuthorDate: Mon Jul 29 01:14:33 2019 -0500

    Improve documentation
---
 components/camel-any23/src/main/docs/any23-dataformat.adoc   | 11 ++++++++---
 .../camel/dataformat/any23/Any23DataFormatDefaultTest.java   |  4 ----
 ...taFormatDefaultTest.java => Any23DataFormatHTTPTest.java} | 12 ++++--------
 3 files changed, 12 insertions(+), 15 deletions(-)

diff --git a/components/camel-any23/src/main/docs/any23-dataformat.adoc b/components/camel-any23/src/main/docs/any23-dataformat.adoc
index 5a8b0ad..7e51ad2 100644
--- a/components/camel-any23/src/main/docs/any23-dataformat.adoc
+++ b/components/camel-any23/src/main/docs/any23-dataformat.adoc
@@ -1,6 +1,11 @@
 [[any23-dataformat]]
 == Any23 DataFormat
-== Any23 DataFormat
+Camel Any23 is a DataFormat that uses the Apache Anything To Triples (Any23) library to extract
structured data in RDF from a variety of documents on the web. 
+*Available as of Camel version 3.0*
+
+The main functionality of this DataFormat focuses on its Unmarshal method which extracts
RDF triplets from compatible pages, in a wide variety of RDF syntaxes.
+
+
 *Available as of Camel version 3.0*
 Any23 is a Data Format that is intended to convert HTML from a site (or file) into rdf.
 
@@ -62,7 +67,7 @@ An example where the consumer provides some HTML
 
 [source,java]
 ---------------------------------------------------------------------------
-from("file://site/inbox").unmarshal().tidyMarkup().to("file://site/blogs");
+from("direct:start").unmarshal().any23("http://mock.foo/bar").to("mock:result");
 ---------------------------------------------------------------------------
 
 ### Spring XML Example
@@ -99,4 +104,4 @@ the download page for the latest versions).
   <artifactId>camel-tagsoup</artifactId>
   <version>x.x.x</version>
 </dependency>
-----------------------------------------
+----------------------------------------
\ No newline at end of file
diff --git a/components/camel-any23/src/test/java/org/apache/camel/dataformat/any23/Any23DataFormatDefaultTest.java
b/components/camel-any23/src/test/java/org/apache/camel/dataformat/any23/Any23DataFormatDefaultTest.java
index fee62a5..1bfd89b 100644
--- a/components/camel-any23/src/test/java/org/apache/camel/dataformat/any23/Any23DataFormatDefaultTest.java
+++ b/components/camel-any23/src/test/java/org/apache/camel/dataformat/any23/Any23DataFormatDefaultTest.java
@@ -17,17 +17,13 @@
 package org.apache.camel.dataformat.any23;
 
 import java.io.File;
-import java.io.InputStream;
 import java.util.List;
 import org.apache.camel.Exchange;
 import org.apache.camel.Message;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.mock.MockEndpoint;
 import org.apache.camel.test.junit4.CamelTestSupport;
-import org.apache.commons.io.IOUtils;
 import org.eclipse.rdf4j.model.Model;
-import org.eclipse.rdf4j.rio.RDFFormat;
-import org.eclipse.rdf4j.rio.Rio;
 import org.junit.Test;
 
 public class Any23DataFormatDefaultTest extends CamelTestSupport {
diff --git a/components/camel-any23/src/test/java/org/apache/camel/dataformat/any23/Any23DataFormatDefaultTest.java
b/components/camel-any23/src/test/java/org/apache/camel/dataformat/any23/Any23DataFormatHTTPTest.java
similarity index 78%
copy from components/camel-any23/src/test/java/org/apache/camel/dataformat/any23/Any23DataFormatDefaultTest.java
copy to components/camel-any23/src/test/java/org/apache/camel/dataformat/any23/Any23DataFormatHTTPTest.java
index fee62a5..086ae00 100644
--- a/components/camel-any23/src/test/java/org/apache/camel/dataformat/any23/Any23DataFormatDefaultTest.java
+++ b/components/camel-any23/src/test/java/org/apache/camel/dataformat/any23/Any23DataFormatHTTPTest.java
@@ -17,28 +17,24 @@
 package org.apache.camel.dataformat.any23;
 
 import java.io.File;
-import java.io.InputStream;
 import java.util.List;
 import org.apache.camel.Exchange;
 import org.apache.camel.Message;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.mock.MockEndpoint;
 import org.apache.camel.test.junit4.CamelTestSupport;
-import org.apache.commons.io.IOUtils;
 import org.eclipse.rdf4j.model.Model;
-import org.eclipse.rdf4j.rio.RDFFormat;
-import org.eclipse.rdf4j.rio.Rio;
 import org.junit.Test;
 
-public class Any23DataFormatDefaultTest extends CamelTestSupport {
+public class Any23DataFormatHTTPTest extends CamelTestSupport {
 
   private final String BASEURI = "http://mock.foo/bar";
 
   @Test
   public void test() throws Exception {
     MockEndpoint resultEndpoint = resolveMandatoryEndpoint("mock:result", MockEndpoint.class);
-    String contenhtml = Any23TestSupport.loadFileAsString(new File("src/test/resources/org/apache/camel/dataformat/any23/microformat/vcard.html"));
-    template.sendBody("direct:start", contenhtml);
+    //String contenhtml = Any23TestSupport.loadFileAsString(new File("src/test/resources/org/apache/camel/dataformat/any23/microformat/vcard.html"));
+    //template.sendBody("direct:start", contenhtml);
     List<Exchange> list = resultEndpoint.getReceivedExchanges();
     for (Exchange exchange : list) {
       Message in = exchange.getIn();
@@ -51,7 +47,7 @@ public class Any23DataFormatDefaultTest extends CamelTestSupport {
   protected RouteBuilder createRouteBuilder() {
     return new RouteBuilder() {
       public void configure() {
-        from("direct:start").unmarshal().any23(BASEURI).to("mock:result");
+        from("http://dbpedia.org/page/Ecuador").unmarshal().any23(BASEURI).to("mock:result");
       }
     };
   }


Mime
View raw message