You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stanbol.apache.org by bu...@apache.org on 2012/02/16 08:48:24 UTC

svn commit: r805038 - in /websites/staging/stanbol/trunk: ./ content/stanbol/docs/trunk/enhancer/index.html

Author: buildbot
Date: Thu Feb 16 07:48:24 2012
New Revision: 805038

Log:
Staging update by buildbot for stanbol

Modified:
    websites/staging/stanbol/trunk/   (props changed)
    websites/staging/stanbol/trunk/content/stanbol/docs/trunk/enhancer/index.html

Propchange: websites/staging/stanbol/trunk/
------------------------------------------------------------------------------
--- cms:source-revision (original)
+++ cms:source-revision Thu Feb 16 07:48:24 2012
@@ -1 +1 @@
-1244661
+1244874

Modified: websites/staging/stanbol/trunk/content/stanbol/docs/trunk/enhancer/index.html
==============================================================================
--- websites/staging/stanbol/trunk/content/stanbol/docs/trunk/enhancer/index.html (original)
+++ websites/staging/stanbol/trunk/content/stanbol/docs/trunk/enhancer/index.html Thu Feb 16 07:48:24 2012
@@ -63,16 +63,16 @@
 <p><img alt="Stanbol Enhancer Overview" src="enhanceroverview-s.png" title="Overview about the RESTful Services and Java API provided by the Stanbol Enhancer" /></p>
 <h3 id="restful_service">RESTful service:</h3>
 <p>The content to analyze should be sent in a POST request with the mimetype specified in the Content-type header. The response will hold the RDF enhancement serialized in the format specified in the Accept header:</p>
-<div class="codehilite"><pre><span class="n">curl</span> <span class="o">-</span><span class="n">X</span> <span class="n">POST</span> <span class="o">-</span><span class="n">H</span> <span class="s">&quot;Accept: text/turtle&quot;</span> <span class="o">-</span><span class="n">H</span> <span class="s">&quot;Content-type: text/plain&quot;</span> <span class="o">\</span>
-    <span class="o">--</span><span class="n">data</span> <span class="s">&quot;John Smith was born in London.&quot;</span> <span class="n">http:</span><span class="sr">//</span><span class="n">localhost:8080</span><span class="o">/</span><span class="n">enhancer</span>
+<div class="codehilite"><pre>curl -X POST -H <span class="s2">&quot;Accept: text/turtle&quot;</span> -H <span class="s2">&quot;Content-type: text/plain&quot;</span> <span class="se">\</span>
+    --data <span class="s2">&quot;John Smith was born in London.&quot;</span> http://localhost:8080/enhancer
 </pre></div>
 
 
 <p>The RESTful interface also provides parameters that can be used to parse/request additional informations. The following Example shows a request that would answer with the plain/text version of the parsed HTML content</p>
-<div class="codehilite"><pre>curl -v -X POST -H &quot;Accept: text/plain&quot; \
-    -H &quot;Content-type: text/html; charset=UTF-8&quot; \
-    --data &quot;<span class="nt">&lt;html&gt;&lt;body&gt;&lt;p&gt;</span>John Smith was born in London.<span class="nt">&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</span>&quot; \
-    &quot;http://localhost:8080/enhancer/chain/language?omitMetadata=true&quot;
+<div class="codehilite"><pre>curl -v -X POST -H <span class="s2">&quot;Accept: text/plain&quot;</span> <span class="se">\</span>
+    -H <span class="s2">&quot;Content-type: text/html; charset=UTF-8&quot;</span> <span class="se">\</span>
+    --data <span class="s2">&quot;&lt;html&gt;&lt;body&gt;&lt;p&gt;John Smith was born in London.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;&quot;</span> <span class="se">\</span>
+    <span class="s2">&quot;http://localhost:8080/enhancer/chain/language?omitMetadata=true&quot;</span>
 </pre></div>
 
 
@@ -108,14 +108,14 @@
 
 
 <p>After the enhancement process finishes ContentIems do not only contain the metadata but also other informations such as converted versions of the parsed content. The following code snippet shows how to retrieve the text version of the parsed HTML content such as created by the <a href="engines/metaxaengine.html">Metaxa Engine</a>.</p>
-<div class="codehilite"><pre><span class="n">Entry</span><span class="sr">&lt;UriRef,Blob&gt;</span> <span class="n">textContentPart</span> <span class="o">=</span> 
-        <span class="n">ContentItemHelper</span><span class="o">.</span><span class="n">getBlob</span><span class="p">(</span><span class="n">contentItem</span><span class="p">,</span> 
-            <span class="n">Collections</span><span class="o">.</span><span class="n">singleton</span><span class="p">(</span><span class="s">&quot;text/plain&quot;</span><span class="p">));</span>
-<span class="n">Blob</span> <span class="n">testBlob</span> <span class="o">=</span> <span class="n">textContentPart</span><span class="o">.</span><span class="n">getValue</span><span class="p">();</span>
-<span class="n">String</span> <span class="n">charset</span> <span class="o">=</span> <span class="n">testBlob</span><span class="o">.</span><span class="n">getParameter</span><span class="p">()</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s">&quot;charset&quot;</span><span class="p">);</span>
-<span class="n">String</span> <span class="n">plainText</span> <span class="o">=</span> <span class="n">IOUtils</span><span class="o">.</span><span class="n">toString</span><span class="p">(</span>
-    <span class="n">textContentPart</span><span class="o">.</span><span class="n">getValue</span><span class="p">()</span><span class="o">.</span><span class="n">getStream</span><span class="p">(),</span>
-    <span class="n">charset</span> <span class="o">==</span> <span class="n">null</span> <span class="p">?</span> <span class="s">&quot;UTF-8&quot;</span> <span class="p">:</span> <span class="n">charset</span><span class="p">);</span>
+<div class="codehilite"><pre><span class="n">Entry</span><span class="o">&lt;</span><span class="n">UriRef</span><span class="o">,</span><span class="n">Blob</span><span class="o">&gt;</span> <span class="n">textContentPart</span> <span class="o">=</span> 
+        <span class="n">ContentItemHelper</span><span class="o">.</span><span class="na">getBlob</span><span class="o">(</span><span class="n">contentItem</span><span class="o">,</span> 
+            <span class="n">Collections</span><span class="o">.</span><span class="na">singleton</span><span class="o">(</span><span class="s">&quot;text/plain&quot;</span><span class="o">));</span>
+<span class="n">Blob</span> <span class="n">testBlob</span> <span class="o">=</span> <span class="n">textContentPart</span><span class="o">.</span><span class="na">getValue</span><span class="o">();</span>
+<span class="n">String</span> <span class="n">charset</span> <span class="o">=</span> <span class="n">testBlob</span><span class="o">.</span><span class="na">getParameter</span><span class="o">().</span><span class="na">get</span><span class="o">(</span><span class="s">&quot;charset&quot;</span><span class="o">);</span>
+<span class="n">String</span> <span class="n">plainText</span> <span class="o">=</span> <span class="n">IOUtils</span><span class="o">.</span><span class="na">toString</span><span class="o">(</span>
+    <span class="n">textContentPart</span><span class="o">.</span><span class="na">getValue</span><span class="o">().</span><span class="na">getStream</span><span class="o">(),</span>
+    <span class="n">charset</span> <span class="o">==</span> <span class="kc">null</span> <span class="o">?</span> <span class="s">&quot;UTF-8&quot;</span> <span class="o">:</span> <span class="n">charset</span><span class="o">);</span>
 </pre></div>
 
 
@@ -167,9 +167,9 @@
 
 
 <p>By default the URI of the content item being enhanced is a local, non de-referencable URI automatically built out of a hash digest of the binary content. Sometimes it might be helpful to provide the URI of the content-item to be used in the enhancements RDF graph. This can be achieved by passing a URI request parameter as follows:</p>
-<div class="codehilite"><pre><span class="n">curl</span> <span class="o">-</span><span class="n">X</span> <span class="n">POST</span> <span class="o">-</span><span class="n">H</span> <span class="s">&quot;Accept: text/turtle&quot;</span> <span class="o">-</span><span class="n">H</span> <span class="s">&quot;Content-type: text/plain&quot;</span> <span class="o">\</span>
-<span class="o">--</span><span class="n">data</span> <span class="s">&quot;John Smith was born in London.&quot;</span> <span class="o">\</span>
-<span class="s">&quot;http://localhost:8080/engines?uri=urn:fise-example-content-item&quot;</span>
+<div class="codehilite"><pre>curl -X POST -H <span class="s2">&quot;Accept: text/turtle&quot;</span> -H <span class="s2">&quot;Content-type: text/plain&quot;</span> <span class="se">\</span>
+--data <span class="s2">&quot;John Smith was born in London.&quot;</span> <span class="se">\</span>
+<span class="s2">&quot;http://localhost:8080/engines?uri=urn:fise-example-content-item&quot;</span>
 </pre></div>
   </div>