Author: rwesten
Date: Wed Apr 11 08:50:33 2012
New Revision: 1324645
URL: http://svn.apache.org/viewvc?rev=1324645&view=rev
Log:
added link to ContentItemFactory in the enhancer main page, some other minor
corrections (STANBOL-573)
Modified:
incubator/stanbol/site/trunk/content/stanbol/docs/trunk/enhancer/contentitem.mdtext
incubator/stanbol/site/trunk/content/stanbol/docs/trunk/enhancer/contentitemfactory.mdtext
incubator/stanbol/site/trunk/content/stanbol/docs/trunk/enhancer/index.mdtext
Modified:
incubator/stanbol/site/trunk/content/stanbol/docs/trunk/enhancer/contentitem.mdtext
URL:
http://svn.apache.org/viewvc/incubator/stanbol/site/trunk/content/stanbol/docs/trunk/enhancer/contentitem.mdtext?rev=1324645&r1=1324644&r2=1324645&view=diff
==============================================================================
---
incubator/stanbol/site/trunk/content/stanbol/docs/trunk/enhancer/contentitem.mdtext
(original)
+++
incubator/stanbol/site/trunk/content/stanbol/docs/trunk/enhancer/contentitem.mdtext
Wed Apr 11 08:50:33 2012
@@ -26,15 +26,15 @@ Content parts are accessible by the inde
There are two types of content parts:
-1. Content parts which have additional metadata provided within the metadata
of the content item. Such content parts are typically used to store transformed
versions of the original content. This allows e.g. engines which can only
process plain text versions to query for the content part containing this
version of the parsed document.
+1. Content parts which have additional metadata provided within the metadata
of the content item. Such content parts are typically used to store transformed
versions of the original content. This allows e.g. engines which can only
process plain text versions to query for the content part containing this
version of the passed document.
2. Content parts that are registered under a predefined URI. Such content
parts are typically not mentioned within the metadata of the content item. This
is used to share intermediate enhancement results between enhancement engines.
An example would be tokens, sentences, POS tags and chunks that are extracted
by some NLP engine. Engines which want to consume such data need to know the
predefined URI of the content part holding this data. They will check within
the <code>canEnhance(..)</code> method if a content part with an expected URI
is present and if it has the correct type.
### Accessing the main content of the ContentItem
-The main content of the ContentItem refers to the content parsed by the
enhancement request (or downloaded from the URL provided by a request). For
accessing this content the following methods are available
+The main content of the ContentItem refers to the content passed by the
enhancement request (or downloaded from the URL provided by a request). For
accessing this content the following methods are available
:::java
- /** Getter for the InputStream of the content as parsed
+ /** Getter for the InputStream of the content as passed
for the ContentItem */
+ getStream() : InputStream
/** Getter for the mime type of the content */
@@ -44,7 +44,7 @@ The main content of the ContentItem refe
The <code>getStream()</code> and <code>getMimeType()</code> methods are
shortcuts for the according methods of the content item's blob object. Calling
<code>contentItem.getBlob.getStream()</code> will return an InputStream over
the exact same content as directly calling <code>getStream()</code> on the
content item. _Note that the blob interface also provides a
<code>getParameter()</code> method which allows to retrieve mime-type
parameters such as the charset of textual content._
-The content parsed by the user is stored as content part at the index '0' with
the URI of the content item in the form of a blob. Therefore, calling
+The content passed by the user is stored as content part at the index '0' with
the URI of the content item in the form of a blob. Therefore, calling
:::java
contentItem.getPart(0,Blob.class)
@@ -126,7 +126,7 @@ __Enhancement Metadata__
* If present this MUST BE the first MIME part within the "multipart/form-data"
container representing the ContentItem.
* The "name" parameter of the "Content-Disposition" header MUST BE "metadata"
-* If the "fileName" parameter of the "Content-Disposition" header is present
it MUST BE the URI of the ContentItem. Users are typically required to set this
header in case they want to parse existing metadata with enhancement requests.
This is because is such cases it is important that the URI of the ContentItem
created by the Stanbol Enhancer is equal to the URI used to describe the
Content within the parsed Metadata. The Stanbol Enhancer MUST set to "fileName"
parameter of the metadata to the URI of the processed ContentItem.
+* If the "fileName" parameter of the "Content-Disposition" header is present
it MUST BE the URI of the ContentItem. Users are typically required to set this
header in case they want to parse existing metadata with enhancement requests.
This is because is such cases it is important that the URI of the ContentItem
created by the Stanbol Enhancer is equal to the URI used to describe the
Content within the passed Metadata. The Stanbol Enhancer MUST set to "fileName"
parameter of the metadata to the URI of the processed ContentItem.
* The "Content-Type" of the metadata can be any RDF serialization supported by
Apache Stanbol. UTF-8 is used as default charset.
* The RDF data serialized in this MIME part represent the enhancement results.
@@ -141,7 +141,7 @@ The various content elements are contain
* the "name" parameter of the "Content-Disposition" is set to the URI of the
ContentPart in the ContentItem.
* the "Content-Type" header must correspond to the media type of the content
-Note that users which want to send a single ContentPart AND Metadata to the
Stanbol Enhancer can also directly add the content to the "multipart/form-data"
container of the ContentItem. In this case the "name" parameter MUST BE still
set to "content" but the "Content-Type" header needs to be directly set to the
media type of the parsed ContentPart. The Stanbol Enhancer does NOT use this
option when serializing ContentItems. It will ALWAYS use a
"multipart/alternate" container for the "content" even when only a single
ContentPart is included in an Response.
+Note that users which want to send a single ContentPart AND Metadata to the
Stanbol Enhancer can also directly add the content to the "multipart/form-data"
container of the ContentItem. In this case the "name" parameter MUST BE still
set to "content" but the "Content-Type" header needs to be directly set to the
media type of the passed ContentPart. The Stanbol Enhancer does NOT use this
option when serializing ContentItems. It will ALWAYS use a
"multipart/alternate" container for the "content" even when only a single
ContentPart is included in an Response.
__Additional Metadata__
Modified:
incubator/stanbol/site/trunk/content/stanbol/docs/trunk/enhancer/contentitemfactory.mdtext
URL:
http://svn.apache.org/viewvc/incubator/stanbol/site/trunk/content/stanbol/docs/trunk/enhancer/contentitemfactory.mdtext?rev=1324645&r1=1324644&r2=1324645&view=diff
==============================================================================
---
incubator/stanbol/site/trunk/content/stanbol/docs/trunk/enhancer/contentitemfactory.mdtext
(original)
+++
incubator/stanbol/site/trunk/content/stanbol/docs/trunk/enhancer/contentitemfactory.mdtext
Wed Apr 11 08:50:33 2012
@@ -32,7 +32,7 @@ The following methods of the ContentItem
+ createBlob(ContentReference reference) : Blob
+ createContentSink(String mediaType) : ContentSink
-The Blob interface is used by the Stanbol Enhancer to represent content. Blobs
are added to ContentItems as [content parts](contentitem.html#content_parts).
In addition to the ContentSource and ContentReference interfaces that are also
supported for the creation of ContentItems for the creation of Blobs also a
ContentSink can be used. A ContentSink allows to obtain an OutputStream to an
initially empty Blob that can later be used to stream the content. This is
intended to be used by EnhancementEngine that need to convert content from one
format to an other because it allows to avoid caching the converted content
in-memory.
+The Blob interface is used by the Stanbol Enhancer to represent content. Blobs
are added to ContentItems as [content parts](contentitem.html#content-parts).
In addition to the ContentSource and ContentReference interfaces that are also
supported for the creation of ContentItems for the creation of Blobs also a
ContentSink can be used. A ContentSink allows to obtain an OutputStream to an
initially empty Blob that can later be used to stream the content. This is
intended to be used by EnhancementEngine that need to convert content from one
format to an other because it allows to avoid caching the converted content
in-memory.
### ContentItem implementations
Modified:
incubator/stanbol/site/trunk/content/stanbol/docs/trunk/enhancer/index.mdtext
URL:
http://svn.apache.org/viewvc/incubator/stanbol/site/trunk/content/stanbol/docs/trunk/enhancer/index.mdtext?rev=1324645&r1=1324644&r2=1324645&view=diff
==============================================================================
---
incubator/stanbol/site/trunk/content/stanbol/docs/trunk/enhancer/index.mdtext
(original)
+++
incubator/stanbol/site/trunk/content/stanbol/docs/trunk/enhancer/index.mdtext
Wed Apr 11 08:50:33 2012
@@ -1,6 +1,6 @@
Title: Stanbol Enhancer
-The Apache Stanbol Enhancer provides both a RESTful and a Java API that allows
a caller to extract features from parsed content. In more detail the parsed
content is processed by [Enhancement Engines](engines) as defined by the called
[Enhancement Chain](chains).
+The Apache Stanbol Enhancer provides both a RESTful and a Java API that allows
a caller to extract features from passed content. In more detail the passed
content is processed by [Enhancement Engines](engines) as defined by the called
[Enhancement Chain](chains).
## Using the Stanbol Enhancer
@@ -18,7 +18,7 @@ The content to be analyzed should be sen
Paris and people such as Bob Marley." \
http://localhost:8080/enhancer
-The RESTful interface also provides parameters that can be used to
parse/request additional information. The following example shows a request
which answers with the plain/text version of the parsed HTML content.
+The RESTful interface also provides parameters that can be used to
parse/request additional information. The following example shows a request
which answers with the plain/text version extracted from the HTML content
passed in the request.
:::bash
curl -v -X POST -H "Accept: text/plain" \
@@ -60,7 +60,7 @@ This code snipped shows how to enhance a
//Get the enhancement Results
MGraph enhancements = contentItem.getMetadata();
-After the enhancement process, ContentItems 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 [Metaxa Engine](engines/metaxaengine.html).
+After the enhancement process, ContentItems do not only contain the metadata
but also other informations such as converted versions of the passed content.
The following code snippet shows how to retrieve the text version of the passed
HTML content such as created by the [Metaxa Engine](engines/metaxaengine.html).
:::java
Entry<UriRef,Blob> textContentPart =
@@ -79,9 +79,9 @@ Apache Stanbol comes with a [list of enh
## Main Interfaces and Utilities
-* __ContentItem__: A [content item](contentitem.html) is the unit of content
the Stanbol Enhancer can deal with. It gives access to the binary content that
was registered, and the graph that represents its metadata (provided by client
and/or generated).
+* __ContentItem__: A [content item](contentitem.html) is the unit of content
the Stanbol Enhancer can deal with. It gives access to the binary content that
was registered, and the graph that represents its metadata (provided by client
and/or generated). ContentItems are created by using the
[ContentItemFactory](contentitemfactory.html).
* __EnhancementEngine__: The [enhancement engine](engines) provides the
interface to internal or external semantic enhancement engines. Typically
content items will be processed by several enhancement engines.
-* __EnhancementChain__: An [enhancement chain](chains) represents a user
provided configuration which describes how [content items](contentitem.html)
parsed to this chain should be processed by the Stanbol Enhancer. The chain
defines a list of [available enhancement engines](engines/list.html) and their
order of execution.
+* __EnhancementChain__: An [enhancement chain](chains) represents a user
provided configuration which describes how [content items](contentitem.html)
passed to this chain should be processed by the Stanbol Enhancer. The chain
defines a list of [available enhancement engines](engines/list.html) and their
order of execution.
* __EnhancementJobManager__: The [enhancement job
manager](enhancementjobmanager.html) performs the execution of the enhancement
process as described in the [execution plan](chains/executionplan.html)
provided by the [enhancement chain](chains). The enhancement job manager is
also responsible for recording the [execution metadata](executionmetadata.html).
* __ChainManager__: The [chain manager](chains/chainmanager.html) allows to
lookup all configured enhancement chains. It also provides a getter for the
default chain.
* __EnhancementEngineManager__: The [enhancement engine
manager](engines/enhancementenginemanager.html) allows to lookup active
enhancement engines by their name.