You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stanbol.apache.org by re...@apache.org on 2013/07/10 15:42:21 UTC

svn commit: r1501766 - /stanbol/trunk/development/archetypes/enhancement-engine/src/main/resources/archetype-resources/src/main/java/ExampleEnhancer.java

Author: reto
Date: Wed Jul 10 13:42:21 2013
New Revision: 1501766

URL: http://svn.apache.org/r1501766
Log:
STANBOL-1137: EnhancementEngine to be compatible with the changed Enhancer UI.

Modified:
    stanbol/trunk/development/archetypes/enhancement-engine/src/main/resources/archetype-resources/src/main/java/ExampleEnhancer.java

Modified: stanbol/trunk/development/archetypes/enhancement-engine/src/main/resources/archetype-resources/src/main/java/ExampleEnhancer.java
URL: http://svn.apache.org/viewvc/stanbol/trunk/development/archetypes/enhancement-engine/src/main/resources/archetype-resources/src/main/java/ExampleEnhancer.java?rev=1501766&r1=1501765&r2=1501766&view=diff
==============================================================================
--- stanbol/trunk/development/archetypes/enhancement-engine/src/main/resources/archetype-resources/src/main/java/ExampleEnhancer.java (original)
+++ stanbol/trunk/development/archetypes/enhancement-engine/src/main/resources/archetype-resources/src/main/java/ExampleEnhancer.java Wed Jul 10 13:42:21 2013
@@ -10,6 +10,7 @@ import org.apache.clerezza.rdf.core.MGra
 import org.apache.clerezza.rdf.core.UriRef;
 import org.apache.clerezza.rdf.core.impl.PlainLiteralImpl;
 import org.apache.clerezza.rdf.core.impl.TripleImpl;
+import org.apache.clerezza.rdf.ontologies.DCTERMS;
 import org.apache.clerezza.rdf.ontologies.RDFS;
 import org.apache.felix.scr.annotations.Component;
 import org.apache.felix.scr.annotations.Properties;
@@ -41,10 +42,11 @@ public class ExampleEnhancer extends Abs
     private static final Logger log = LoggerFactory.getLogger(ExampleEnhancer.class);
 
     /**
-     * Default ordering means that ths engine is called after all engines that
-     * use a value within the ordering range defined by
-     * {@link ServiceProperties${symbol_pound}ORDERING_EXTRACTION_ENHANCEMENT} and what that
-     * the latter means will hoefully become clear with STANBOL-967
+     * ServiceProperties are currently only used for automatic ordering of the 
+     * execution of EnhancementEngines (e.g. by the WeightedChain implementation).
+     * Default ordering means that the engine is called after all engines that
+     * use a value < {@link ServiceProperties#ORDERING_CONTENT_EXTRACTION}
+     * and >= {@link ServiceProperties#ORDERING_EXTRACTION_ENHANCEMENT}.
      */
     public Map getServiceProperties() {
         return Collections.unmodifiableMap(Collections.singletonMap(
@@ -81,6 +83,8 @@ public class ExampleEnhancer extends Abs
             MGraph metadata = ci.getMetadata();
             // update some sample data
             UriRef textAnnotation = EnhancementEngineHelper.createTextEnhancement(ci, this);
+            metadata.add(new TripleImpl(textAnnotation, DCTERMS.type, 
+                    new UriRef("http://example.org/ontology/LengthEnhancement")));
             metadata.add(new TripleImpl(textAnnotation, RDFS.comment,
                     new PlainLiteralImpl("A text of " + content.length() + " charaters")));
         } catch (IOException ex) {