Author: rwesten
Date: Mon Jun 2 07:12:33 2014
New Revision: 1599100
URL: http://svn.apache.org/r1599100
Log:
minor corrections and improvements; added TopicClassification documentation
Added:
stanbol/site/trunk/content/presentations/Topic-Classification.pdf (with
props)
Modified:
stanbol/site/trunk/content/docs/trunk/components/enhancer/engines/dereference.mdtext
stanbol/site/trunk/content/docs/trunk/components/enhancer/engines/entityhubdereference.mdtext
stanbol/site/trunk/content/docs/trunk/components/enhancer/engines/index.mdtext
stanbol/site/trunk/content/docs/trunk/components/enhancer/enhancementproperties.mdtext
Modified:
stanbol/site/trunk/content/docs/trunk/components/enhancer/engines/dereference.mdtext
URL:
http://svn.apache.org/viewvc/stanbol/site/trunk/content/docs/trunk/components/enhancer/engines/dereference.mdtext?rev=1599100&r1=1599099&r2=1599100&view=diff
==============================================================================
---
stanbol/site/trunk/content/docs/trunk/components/enhancer/engines/dereference.mdtext
(original)
+++
stanbol/site/trunk/content/docs/trunk/components/enhancer/engines/dereference.mdtext
Mon Jun 2 07:12:33 2014
@@ -45,6 +45,7 @@ The following Configuration parameter ar
This option is only useful in cases where multiple dereference engines are
used in the same enhancement chain. It allows to ensure the following workflows
1. First running Dereference Engines for fast/local data sources.
Especially those where one can configure an _URI Prefix_ and/or an _URI
Pattern_ - by deactivating _Fallback Mode_. Second running Dereference Engines
for datastes that require remote service calls or for those no _URI Prefix_ nor
_URI Pattern_ can be configured - by activating _Fallback Mode_. This can
greatly improve performance and reduce the number of remote service calls as
already dereferenced Entities will not get scheduled to be dereferenced by
using the remote service.
2. In settings where a partial local cache for an otherwise slow data
source exists. In this case one can configure two Entity Dereference Engines
for the same data source. First one with _Fallback Mode_ deactivated for the
partial cache and a second with enabled _Fallback Mode_ for the original but
slower datasource.
+* __Dereference Properties__ _(enhancer.engines.dereference.references)_: The
list of properties that reference Entities. By default `fise:entity-reference`
is used. A Triple pattern `(null,{entity-reference},null)` is used for all
configured property URIs. All unique objects of type URI are considered as
entities to be dereferenced. _NOTE_ that configured _URI Prefix_ and/or an _URI
Pattern_ are also applied to the list of entity uris.
* __Dereference Languages__ _(enhancer.engines.dereference.languages)_: A set
of languages that are dereferenced. Even if _'Dereference only Content Language
Literals'_ is active explicitly configured languages will still get
dereferenced. If not present and _'Dereference only Content Language Literals'_
is deactivated literals of any language will get dereferenced.
* __Dereference only Content Language Literals__
_(enhancer.engine.dereference.filterContentlanguages)_: If enabled only
Literals with the same language as the language detected for the Content will
get dereferenced. Literals with no language tag will always get dereferenced.
* __Dereferenced Fields__ _(enhancer.engines.dereference.fields)_: The
dereferenced fields - in RDF terminology 'properties' - to be dereferenced.
Typically QNames (e.g. `rdf:label`) can be used for the configuration. However
support for QNames is optional. Some Implementations might also support
wildcards and exclusions.
@@ -108,6 +109,23 @@ Extending the `DereferenceContextFactory
}
});
+For the initialization of the custom `DereferenceContext` one need to use the
`initialise` callback
+
+ :::java
+ public class MyDereferenceContext extends DereferenceContext {
+
+ protected MyDereferenceContext(MyDereferenceEngine engine,
+ Map<String,Object> enhancementProps) throws
DereferenceConfigurationException {
+ super(engine, enhancementProps);
+ }
+
+ @Override
+ protected void initialise() throws DereferenceConfigurationException {
+ //do your custom initialisation here
+ }
+
+ }
+
If you apply this code all calls to `EntityDereferencer#dereference(..)` will
parse an instance of the custom `DereferenceContext` implementation.
The custom
[DereferenceContext](http://svn.apache.org/repos/asf/stanbol/trunk/enhancement-engines/dereference/entityhub/src/main/java/org/apache/stanbol/enhancer/engines/dereference/entityhub/EntityhubDereferenceContext.java)
implementation of the Entityhub Dereference Engine is a good example to start
from.
Modified:
stanbol/site/trunk/content/docs/trunk/components/enhancer/engines/entityhubdereference.mdtext
URL:
http://svn.apache.org/viewvc/stanbol/site/trunk/content/docs/trunk/components/enhancer/engines/entityhubdereference.mdtext?rev=1599100&r1=1599099&r2=1599100&view=diff
==============================================================================
---
stanbol/site/trunk/content/docs/trunk/components/enhancer/engines/entityhubdereference.mdtext
(original)
+++
stanbol/site/trunk/content/docs/trunk/components/enhancer/engines/entityhubdereference.mdtext
Mon Jun 2 07:12:33 2014
@@ -28,6 +28,7 @@ The following Configuration parameter ar
Additional Supported Properties that are not included in the configuration
form:
+* __Dereference Properties__ _(enhancer.engines.dereference.references)_: The
list of properties that reference Entities. By default `fise:entity-reference`
is used. A Triple pattern `(null,{entity-reference},null)` is used for all
configured property URIs. All unique objects of type URI are considered as
entities to be dereferenced. _NOTE_ that configured _URI Prefix_ and/or an _URI
Pattern_ are also applied to the list of entity uris.
* __Dereference Languages__ _(enhancer.engines.dereference.languages)_: A set
of languages that are dereferenced. Even if _'Dereference only Content Language
Literals'_ is active explicitly configured languages will still get
dereferenced. If not present and _'Dereference only Content Language Literals'_
is deactivated literals of any language will get dereferenced.
* __Service Ranking__ _(service.ranking)_: The OSGI service ranking. Will only
have an effect if their are two engines with the same name. In such cases the
one with the higher service ranking will get called.
@@ -81,6 +82,7 @@ __since version `0.12.1`__ with [STANBOL
The following Enhancement Properties are supported by the Entityhub
Dereference Engine
+* __Dereference Properties__ _(enhancer.engines.dereference.references)_: a
collection of properties that reference Entities. Parsed values will me merged
(union) to those statically configured for the Engine.
* __Dereference Languages__ _(enhancer.engines.dereference.languages)_: A set
of languages that are dereferenced. Even if _'Dereference only Content Language
Literals'_ is active explicitly configured languages will still get
dereferenced. * __Dereferenced Fields__
_(enhancer.engines.dereference.fields)_: The dereferenced fields - in RDF
terminology 'properties' - to be dereferenced. QNames (e.g. `rdf:label`) can be
used for the configuration. This Engine supports the use of FieldMappings for
the configuration. Dereferenced Fields parsed as EnhancementProperty will
override values configured for the Engine.
* __Dereference LD Path__ _(enhancer.engines.dereference.ldpath)_: The [LD
Path Language](http://marmotta.apache.org/ldpath/language.html) allows to
define powerful selectors for dereferenced Entities. An LD Path program parsed
as EnhancementProperty will be executed in addition to those configured for the
engine.
Modified:
stanbol/site/trunk/content/docs/trunk/components/enhancer/engines/index.mdtext
URL:
http://svn.apache.org/viewvc/stanbol/site/trunk/content/docs/trunk/components/enhancer/engines/index.mdtext?rev=1599100&r1=1599099&r2=1599100&view=diff
==============================================================================
---
stanbol/site/trunk/content/docs/trunk/components/enhancer/engines/index.mdtext
(original)
+++
stanbol/site/trunk/content/docs/trunk/components/enhancer/engines/index.mdtext
Mon Jun 2 07:12:33 2014
@@ -85,6 +85,52 @@ Basically this features allows the imple
However, the engine ordering is not the only possibility for users to control
the execution order. Enhancement chain implementations such as the [List
Chain](../chains/listchain.html) and the [Graph
Chain](../chains/graphchain.html) do also allow to directly define the oder of
execution. For these chains the ordering information provided by enhancement
engines are ignored.
+### Enhancement Properties support
+
+__since version `0.12.1`__
+
+[Enhancement Properties](../enhancementproperties) can be used to parameterize
[Enhancement Chains](../chains) and/or the enhancement of single [Content
Item](../contentitem)s. Support by EnhancementEngines is optional. Engines that
do support EnhancementProperties _SHOULD_ list the keys of supported properties
in their documentation.
+
+In version `0.12.1` and `1.*` EnhancementProperties are contained in the
[ContentItem](contentitem) parsed to the EnhancementEngine. The
`EnhancementEngineHeloer` utility has methods to access them. The following
listing shows the code necessary to get the Enhancement Properties from the
parsed ContentItem.
+
+ :::java
+ @Override
+ public final void computeEnhancements(ContentItem ci) throws
EngineException {
+ Map<String,Object> enhancemntProps =
EnhancementEngineHelper.getEnhancementProperties(this, ci);
+ [..]
+ }
+
+With `2.0.0` the EnhancementEngine API will be changed so that the
EnhancementProperties are parsed as an additional parameter.
+
+ :::java
+ @Override
+ public final void computeEnhancements(ContentItem ci,
+ Map<String,Object> enhancemntProps) throws EngineException {
+ [..]
+ }
+
+The `Map<String,Object>` containing the EnhancementProperties is a
read/write-able copy of the EnhancementProperties parsed with the ContentItem.
That mean that EnhancementEngine implementations are free to change the
contents of that map. Those changes will not affect the state of the
ContentItem.
+
+The keys of in the map are the string keys of the parsed Enhancement
Properties (e.g. `enhancer.max-suggestion` or
`enhancer.engines.dereference.fields`). Values can be any Object. Arrays and
Collections may be used for multi value properties. The
`EnhancementEngineHelper` utility provides methods to convert values to
expected.
+
+ :::java
+ //define supported enhancement properties as constants
+ public static final String MAX_SUGGESTIONS = "enhancer.max-suggestions";
+ public static final String DEREFERENCED_FIELDS =
"enhancer.engines.dereference.fields";
+
+ [..]
+
+ @Override
+ public final void computeEnhancements(ContentItem ci) throws
EngineException {
+ Map<String,Object> enhProp =
EnhancementEngineHelper.getEnhancementProperties(this, ci);
+ Integer maxSuggestions =
EnhancementEngineHelper.getFirstConfigValue(this, ci,
+ enhProp, MAX_SUGGESTIONS, Integer.class);
+
+ Collection<String> fields =
EnhancementEngineHelper.getConfigValues(this, ci,
+ enhProp, DEREFERENCED_FIELDS, String.class);
+ }
+
+There are also `parseConfig*(..)` methods where one can directly parse the
object value. Those methods do also not throw an
`EnhancementPropertyException`. Note also the
`get*ConfigValue(Dictionary<String,Object>, ...)` methods that can be used to
parsed the OSGI component configuration.
## Enhancement Engine Management
Modified:
stanbol/site/trunk/content/docs/trunk/components/enhancer/enhancementproperties.mdtext
URL:
http://svn.apache.org/viewvc/stanbol/site/trunk/content/docs/trunk/components/enhancer/enhancementproperties.mdtext?rev=1599100&r1=1599099&r2=1599100&view=diff
==============================================================================
---
stanbol/site/trunk/content/docs/trunk/components/enhancer/enhancementproperties.mdtext
(original)
+++
stanbol/site/trunk/content/docs/trunk/components/enhancer/enhancementproperties.mdtext
Mon Jun 2 07:12:33 2014
@@ -86,14 +86,14 @@ The keys of in the map are the string ke
@Override
public final void computeEnhancements(ContentItem ci) throws
EngineException {
Map<String,Object> enhProp =
EnhancementEngineHelper.getEnhancementProperties(this, ci);
- Integer maxSuggestions = EnhancementEngineHelper.getFirstConfigValue(
- enhProp.get(MAX_SUGGESTIONS), Integer.class);
+ Integer maxSuggestions =
EnhancementEngineHelper.getFirstConfigValue(this, ci,
+ enhProp, MAX_SUGGESTIONS, Integer.class);
- Collection<String> fields = EnhancementEngineHelper.getConfigValues(
- enhProp.get(DEREFERENCED_FIELDS), String.class);
+ Collection<String> fields =
EnhancementEngineHelper.getConfigValues(this, ci,
+ enhProp, DEREFERENCED_FIELDS, String.class);
}
-_TIP_ the same methods can also be used to process the configuration parsed by
OSGI.
+There are also `parseConfig*(..)` methods where one can directly parse the
object value. Those methods do also not throw an
`EnhancementPropertyException`. Note also the
`get*ConfigValue(Dictionary<String,Object>, ...)` methods that can be used to
parsed the OSGI component configuration.
Definition ofChain scoped Enhancement Properties
------------------------------------------------
Added: stanbol/site/trunk/content/presentations/Topic-Classification.pdf
URL:
http://svn.apache.org/viewvc/stanbol/site/trunk/content/presentations/Topic-Classification.pdf?rev=1599100&view=auto
==============================================================================
Binary file - no diff available.
Propchange: stanbol/site/trunk/content/presentations/Topic-Classification.pdf
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream