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

svn commit: r1378005 - in /incubator/stanbol/branches/disambiguation-engine: ./ engines/ engines/disambiguation-mlt/ engines/disambiguation-mlt/src/ engines/disambiguation-mlt/src/main/ engines/disambiguation-mlt/src/main/java/ engines/disambiguation-m...

Author: rwesten
Date: Tue Aug 28 07:26:47 2012
New Revision: 1378005

URL: http://svn.apache.org/viewvc?rev=1378005&view=rev
Log:
STANOL-723: Applied the patch provided by Kritarth Anand (as results of the GSOC 2012 project). NOTES: a) this does only include the source provided by the patch and not the pdf and the java documentation b) this includes already some changes to the provided path (pom.xml, code formatting and some minor changes to #readEntities and SavedEntity class) basically be cause I had no internet and was therefore not able to commit before staring to work on the patch. c) added the disambiguation engine to the reactor POMs

Added:
    incubator/stanbol/branches/disambiguation-engine/engines/disambiguation-mlt/   (with props)
    incubator/stanbol/branches/disambiguation-engine/engines/disambiguation-mlt/README.md   (with props)
    incubator/stanbol/branches/disambiguation-engine/engines/disambiguation-mlt/pom.xml   (with props)
    incubator/stanbol/branches/disambiguation-engine/engines/disambiguation-mlt/src/
    incubator/stanbol/branches/disambiguation-engine/engines/disambiguation-mlt/src/main/
    incubator/stanbol/branches/disambiguation-engine/engines/disambiguation-mlt/src/main/java/
    incubator/stanbol/branches/disambiguation-engine/engines/disambiguation-mlt/src/main/java/org/
    incubator/stanbol/branches/disambiguation-engine/engines/disambiguation-mlt/src/main/java/org/apache/
    incubator/stanbol/branches/disambiguation-engine/engines/disambiguation-mlt/src/main/java/org/apache/stanbol/
    incubator/stanbol/branches/disambiguation-engine/engines/disambiguation-mlt/src/main/java/org/apache/stanbol/enhancer/
    incubator/stanbol/branches/disambiguation-engine/engines/disambiguation-mlt/src/main/java/org/apache/stanbol/enhancer/engine/
    incubator/stanbol/branches/disambiguation-engine/engines/disambiguation-mlt/src/main/java/org/apache/stanbol/enhancer/engine/disambiguation/
    incubator/stanbol/branches/disambiguation-engine/engines/disambiguation-mlt/src/main/java/org/apache/stanbol/enhancer/engine/disambiguation/mlt/
    incubator/stanbol/branches/disambiguation-engine/engines/disambiguation-mlt/src/main/java/org/apache/stanbol/enhancer/engine/disambiguation/mlt/DisambiguatorEngine.java   (with props)
    incubator/stanbol/branches/disambiguation-engine/engines/disambiguation-mlt/src/main/java/org/apache/stanbol/enhancer/engine/disambiguation/mlt/SavedEntity.java
    incubator/stanbol/branches/disambiguation-engine/engines/disambiguation-mlt/src/main/java/org/apache/stanbol/enhancer/engine/disambiguation/mlt/Suggestion.java
    incubator/stanbol/branches/disambiguation-engine/engines/disambiguation-mlt/src/main/resources/
    incubator/stanbol/branches/disambiguation-engine/engines/disambiguation-mlt/src/main/resources/OSGI-INF/
    incubator/stanbol/branches/disambiguation-engine/engines/disambiguation-mlt/src/main/resources/OSGI-INF/metatype/
    incubator/stanbol/branches/disambiguation-engine/engines/disambiguation-mlt/src/main/resources/OSGI-INF/metatype/metatype.properties   (with props)
Modified:
    incubator/stanbol/branches/disambiguation-engine/engines/pom.xml
    incubator/stanbol/branches/disambiguation-engine/pom.xml

Propchange: incubator/stanbol/branches/disambiguation-engine/engines/disambiguation-mlt/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Tue Aug 28 07:26:47 2012
@@ -0,0 +1,7 @@
+target
+
+.classpath
+
+.project
+
+.settings

Added: incubator/stanbol/branches/disambiguation-engine/engines/disambiguation-mlt/README.md
URL: http://svn.apache.org/viewvc/incubator/stanbol/branches/disambiguation-engine/engines/disambiguation-mlt/README.md?rev=1378005&view=auto
==============================================================================
--- incubator/stanbol/branches/disambiguation-engine/engines/disambiguation-mlt/README.md (added)
+++ incubator/stanbol/branches/disambiguation-engine/engines/disambiguation-mlt/README.md Tue Aug 28 07:26:47 2012
@@ -0,0 +1,29 @@
+README
+=======
+To install this Engine. 
+Maven should be installed.
+
+ dir/: the directory where it was code is present
+
+1. Have a Stanbol running. 
+2. Open terminal and go to /dir/.
+3. run:  mvn clean compile install
+4. Open a browser and open link  http://localhost:8080/system/console/bundles . 
+5. then click install/Update button
+6. on the pop up, check start bundle, click on browse and go to directory, select /dir/target/org.apache.stanbol.enhancer.engine.disambiguation.mlt-0.0.1-SNAPSHOT.jar  
+
+you can see that entity disambiguation engine is installed.
+
+
+TEST
+------------------------
+
+Before Installation of Engine if you input text
+
+"Paris is a small city in the state of Texas".
+
+It identifies Texas as state of US and Paris as Paris, France.
+
+
+When the Entity disambiguation engine works on it to it correctly identifies Paris as Paris, Texas.
+

Propchange: incubator/stanbol/branches/disambiguation-engine/engines/disambiguation-mlt/README.md
------------------------------------------------------------------------------
    svn:executable = *

Added: incubator/stanbol/branches/disambiguation-engine/engines/disambiguation-mlt/pom.xml
URL: http://svn.apache.org/viewvc/incubator/stanbol/branches/disambiguation-engine/engines/disambiguation-mlt/pom.xml?rev=1378005&view=auto
==============================================================================
--- incubator/stanbol/branches/disambiguation-engine/engines/disambiguation-mlt/pom.xml (added)
+++ incubator/stanbol/branches/disambiguation-engine/engines/disambiguation-mlt/pom.xml Tue Aug 28 07:26:47 2012
@@ -0,0 +1,96 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+
+	<modelVersion>4.0.0</modelVersion>
+
+	<parent>
+		<groupId>org.apache.stanbol</groupId>
+		<artifactId>org.apache.stanbol.enhancer.parent</artifactId>
+		<version>0.10.0-incubating-SNAPSHOT</version>
+		<relativePath>../../parent</relativePath>
+	</parent>
+	<groupId>org.apache.stanbol</groupId>
+	<artifactId>org.apache.stanbol.enhancer.engine.disambiguation.mlt
+	</artifactId>
+	<version>0.10.0-incubating-SNAPSHOT</version>
+	<packaging>bundle</packaging>
+
+	<name>Apache Stanbol Enhancer Enhancement Engine : Disambiguation using Solr MLT</name>
+	<description>
+		Entity Disambiguation Enhancement Engine that performs Similarity queries on
+		the Stanbol Entityhub to re-rank suggested Entities.
+	</description>
+
+	<inceptionYear>2012</inceptionYear>
+
+	<scm>
+		<connection>
+			scm:svn:http://svn.apache.org/repos/asf/incubator/stanbol/trunk/enhancer/engines/disambiguation-mlt/
+		</connection>
+		<developerConnection>
+			scm:svn:https://svn.apache.org/repos/asf/incubator/stanbol/trunk/enhancer/engines/disambiguation-mlt/
+		</developerConnection>
+		<url>http://incubator.apache.org/stanbol/</url>
+	</scm>
+
+	<build>
+		<plugins>
+			<plugin>
+				<groupId>org.apache.felix</groupId>
+				<artifactId>maven-bundle-plugin</artifactId>
+				<extensions>true</extensions>
+				<configuration>
+					<instructions>
+						<!-- Enable this for including your enhancement chain configuration -->
+						<!-- <Install-Path>config</Install-Path> -->
+						<Export-Package>
+							org.apache.stanbol.enhancer.engine.disambiguation.mlt.*;version=${project.version}
+						</Export-Package>
+						<Embed-Dependency>
+						</Embed-Dependency>
+					</instructions>
+				</configuration>
+			</plugin>
+			<plugin>
+				<groupId>org.apache.felix</groupId>
+				<artifactId>maven-scr-plugin</artifactId>
+			</plugin>
+		</plugins>
+	</build>
+
+	<dependencies>
+		<dependency>
+			<groupId>org.apache.stanbol</groupId>
+			<artifactId>org.apache.stanbol.commons.stanboltools.offline</artifactId>
+			<version>0.9.0-incubating</version>
+		</dependency>
+
+		<dependency>
+			<groupId>org.apache.stanbol</groupId>
+			<artifactId>org.apache.stanbol.enhancer.servicesapi</artifactId>
+			<version>0.10.0-incubating-SNAPSHOT</version>
+		</dependency>
+
+		<dependency>
+			<groupId>org.apache.stanbol</groupId>
+			<artifactId>org.apache.stanbol.entityhub.servicesapi</artifactId>
+			<version>0.11.0-incubating-SNAPSHOT</version>
+		</dependency>
+<!--  		<dependency>
+			<groupId>org.apache.stanbol</groupId>
+			<artifactId>org.apache.stanbol.entityhub.model.clerezza</artifactId>
+			<version>0.11.0-incubating-SNAPSHOT</version>
+			<scope>compile</scope>
+		</dependency>
+-->
+		<dependency>
+			<groupId>org.apache.felix</groupId>
+			<artifactId>org.apache.felix.scr.annotations</artifactId>
+		</dependency>
+		<dependency>
+            <groupId>commons-lang</groupId>
+            <artifactId>commons-lang</artifactId>
+		</dependency>
+
+	</dependencies>
+</project>

Propchange: incubator/stanbol/branches/disambiguation-engine/engines/disambiguation-mlt/pom.xml
------------------------------------------------------------------------------
    svn:executable = *

Added: incubator/stanbol/branches/disambiguation-engine/engines/disambiguation-mlt/src/main/java/org/apache/stanbol/enhancer/engine/disambiguation/mlt/DisambiguatorEngine.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/branches/disambiguation-engine/engines/disambiguation-mlt/src/main/java/org/apache/stanbol/enhancer/engine/disambiguation/mlt/DisambiguatorEngine.java?rev=1378005&view=auto
==============================================================================
--- incubator/stanbol/branches/disambiguation-engine/engines/disambiguation-mlt/src/main/java/org/apache/stanbol/enhancer/engine/disambiguation/mlt/DisambiguatorEngine.java (added)
+++ incubator/stanbol/branches/disambiguation-engine/engines/disambiguation-mlt/src/main/java/org/apache/stanbol/enhancer/engine/disambiguation/mlt/DisambiguatorEngine.java Tue Aug 28 07:26:47 2012
@@ -0,0 +1,659 @@
+/*
+ * Copyright 2012, FORMCEPT [http://www.formcept.com]
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.apache.stanbol.enhancer.engine.disambiguation.mlt;
+
+import static org.apache.commons.lang.StringUtils.getLevenshteinDistance;
+import static org.apache.stanbol.enhancer.servicesapi.rdf.Properties.ENHANCER_CONFIDENCE;
+import static org.apache.stanbol.enhancer.servicesapi.rdf.Properties.ENHANCER_END;
+import static org.apache.stanbol.enhancer.servicesapi.rdf.Properties.ENHANCER_ENTITY_LABEL;
+import static org.apache.stanbol.enhancer.servicesapi.rdf.Properties.ENHANCER_SELECTED_TEXT;
+import static org.apache.stanbol.enhancer.servicesapi.rdf.Properties.ENHANCER_SELECTION_CONTEXT;
+import static org.apache.stanbol.enhancer.servicesapi.rdf.Properties.ENHANCER_START;
+import static org.apache.stanbol.enhancer.servicesapi.rdf.Properties.RDFS_LABEL;
+import static org.apache.stanbol.enhancer.servicesapi.rdf.Properties.RDF_TYPE;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Dictionary;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.Set;
+
+import org.apache.clerezza.rdf.core.LiteralFactory;
+import org.apache.clerezza.rdf.core.MGraph;
+import org.apache.clerezza.rdf.core.Triple;
+import org.apache.clerezza.rdf.core.UriRef;
+import org.apache.clerezza.rdf.core.impl.TripleImpl;
+import org.apache.commons.lang.StringUtils;
+import org.apache.felix.scr.annotations.Activate;
+import org.apache.felix.scr.annotations.Component;
+import org.apache.felix.scr.annotations.Deactivate;
+import org.apache.felix.scr.annotations.Properties;
+import org.apache.felix.scr.annotations.Property;
+import org.apache.felix.scr.annotations.Reference;
+import org.apache.felix.scr.annotations.Service;
+import org.apache.stanbol.enhancer.servicesapi.ContentItem;
+import org.apache.stanbol.enhancer.servicesapi.EngineException;
+import org.apache.stanbol.enhancer.servicesapi.EnhancementEngine;
+import org.apache.stanbol.enhancer.servicesapi.InvalidContentException;
+import org.apache.stanbol.enhancer.servicesapi.ServiceProperties;
+import org.apache.stanbol.enhancer.servicesapi.helper.ContentItemHelper;
+import org.apache.stanbol.enhancer.servicesapi.helper.EnhancementEngineHelper;
+import org.apache.stanbol.enhancer.servicesapi.impl.AbstractEnhancementEngine;
+import org.apache.stanbol.enhancer.servicesapi.rdf.NamespaceEnum;
+import org.apache.stanbol.enhancer.servicesapi.rdf.TechnicalClasses;
+import org.apache.stanbol.entityhub.servicesapi.model.Entity;
+import org.apache.stanbol.entityhub.servicesapi.model.Representation;
+import org.apache.stanbol.entityhub.servicesapi.model.Text;
+import org.apache.stanbol.entityhub.servicesapi.model.rdf.RdfResourceEnum;
+import org.apache.stanbol.entityhub.servicesapi.query.Constraint;
+import org.apache.stanbol.entityhub.servicesapi.query.FieldQuery;
+import org.apache.stanbol.entityhub.servicesapi.query.QueryResultList;
+import org.apache.stanbol.entityhub.servicesapi.query.SimilarityConstraint;
+import org.apache.stanbol.entityhub.servicesapi.query.TextConstraint;
+import org.apache.stanbol.entityhub.servicesapi.site.Site;
+import org.apache.stanbol.entityhub.servicesapi.site.SiteException;
+import org.apache.stanbol.entityhub.servicesapi.site.SiteManager;
+import org.osgi.service.cm.ConfigurationException;
+import org.osgi.service.component.ComponentContext;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Simple Enhancer
+ * 
+ * @author Kritarth
+ */
+@Component(immediate = true, metatype = true)
+@Service
+@Properties(value = {
+    @Property(name = EnhancementEngine.PROPERTY_NAME, value = "entity-disambiguator")
+})
+public class DisambiguatorEngine extends AbstractEnhancementEngine<IOException,RuntimeException> implements
+        EnhancementEngine, ServiceProperties {
+
+    private static Logger log = LoggerFactory.getLogger(DisambiguatorEngine.class);
+
+    /**
+     * Service URL
+     */
+    private String serviceURL;
+
+    /**
+     * The default value for the execution of this Engine. Currently set to
+     * {@link ServiceProperties#ORDERING_POST_PROCESSING} + 90.
+     * <p>
+     * This should ensure that this engines runs as one of the first engines of the post-processing phase
+     */
+    public static final Integer defaultOrder = ServiceProperties.ORDERING_POST_PROCESSING - 90;
+    /**
+     * The plain text might be required for determining the extraction context
+     */
+    public static final String PLAIN_TEXT_MIMETYPE = "text/plain";
+    /**
+     * Contains the only supported mime type {@link #PLAIN_TEXT_MIMETYPE}
+     */
+    public static final Set<String> SUPPORTED_MIMETYPES = Collections.singleton(PLAIN_TEXT_MIMETYPE);
+
+    /**
+     * Used to lookup the Entityhub {@link Site} used to perform the disambiguation.
+     */
+    @Reference
+    protected SiteManager siteManager;
+
+    /**
+     * The {@link LiteralFactory} used to create typed RDF literals
+     */
+    private final LiteralFactory literalFactory = LiteralFactory.getInstance();
+
+    /**
+     * Returns the properties containing the {@link ServiceProperties#ENHANCEMENT_ENGINE_ORDERING}
+     */
+    @Override
+    public Map<String,Object> getServiceProperties() {
+        return Collections.unmodifiableMap(Collections.singletonMap(ENHANCEMENT_ENGINE_ORDERING,
+            (Object) defaultOrder));
+    }
+
+    @Override
+    public int canEnhance(ContentItem ci) throws EngineException {
+        // check if content is present
+        try {
+            if ((ContentItemHelper.getText(ci.getBlob()) == null)
+                || (ContentItemHelper.getText(ci.getBlob()).trim().isEmpty())) {
+                return CANNOT_ENHANCE;
+            }
+        } catch (IOException e) {
+            log.error("Failed to get the text for " + "enhancement of content: " + ci.getUri(), e);
+            throw new InvalidContentException(this, ci, e);
+        }
+        // default enhancement is synchronous enhancement
+        return ENHANCE_SYNCHRONOUS;
+    }
+
+    /*
+     * This function first evaluates all the possible ambiguations of each text annotation detected. the text
+     * of all entities detected is used for making a Dbpedia query with all string for MLT that contain all
+     * the other entities. The results obtained are used to calcualte new confidence values which are updated
+     * in the metadata.
+     */
+    @Override
+    public void computeEnhancements(ContentItem ci) throws EngineException {
+
+        MGraph graph = ci.getMetadata();
+
+        List<String> allEntities = new ArrayList<String>();
+        Map<SavedEntity,List<UriRef>> textAnnotations = new HashMap<SavedEntity,List<UriRef>>();
+        String contentLangauge = null;
+
+        // List to contain old confidence values that are to removed
+        List<Triple> loseConfidence = new ArrayList<Triple>();
+        // List to contain new confidence values to be added to metadata
+        List<Triple> gainConfidence = new ArrayList<Triple>();
+
+        ci.getLock().readLock().lock();
+        try {
+            contentLangauge = EnhancementEngineHelper.getLanguage(ci);
+            readEntities(loseConfidence, allEntities, textAnnotations, graph);
+        } catch (Exception e) {
+
+            log.info(" readEntities" + e.getMessage());
+
+        }
+        ci.getLock().readLock().unlock();
+
+        Site dbpediaSite = null;
+        try {
+            dbpediaSite = siteManager.getSite("dbpedia");
+
+            for (Entry<SavedEntity,List<UriRef>> entry : textAnnotations.entrySet()) {
+
+                SavedEntity savedEntity = entry.getKey();
+                // the selected text of the TextAnnotation to disambiguate
+                String label = savedEntity.getName();
+                Collection<String> types = null; // potential types of entities
+                String language = contentLangauge; // the language of the analyzed text
+                List<UriRef> subsumed = entry.getValue();
+                boolean casesensitive = false; //TODO: make configurable
+                String savedEntityLabel = casesensitive ? label : label.toLowerCase();
+
+                if (subsumed.size() <= 1) {
+                    continue;
+                }
+
+                String extractionContext = savedEntity.getContext();
+
+                List<String> L = EntitiesInRange(directoryTextAnotation,
+                    (savedEntity.getStart() + savedEntity.getEnd()) / 2);
+                // the surrounding text of the TextAnnotation
+                List<String> M = getEntititesSelection(label, allEntities, extractionContext); 
+
+                extractionContext = unionString(L, M, label);
+                if (extractionContext.equals("")) extractionContext = label;
+                QueryResultList<Entity> results = queryDbpedia(dbpediaSite, savedEntityLabel, language,
+                    extractionContext);
+                log.info(" - {} results returned by query {}", results.size(), results.getQuery());
+
+                List<Suggestion> matches = rankResults(results, casesensitive, language, savedEntityLabel);
+                Collections.sort(matches);
+
+                ci.getLock().readLock().lock();
+                try {
+                    if (intersectionCheck(matches, subsumed, graph, contentLangauge)) {
+                        gainConfidence = intersection(matches, subsumed, graph, gainConfidence,
+                            contentLangauge);
+                    } else {
+                        loseConfidence = unchangedConfidences(subsumed, graph, loseConfidence);
+                    }
+                } finally {
+                    ci.getLock().readLock().unlock();
+                }
+            }
+            ci.getLock().writeLock().lock();
+            try {
+                removeOldConfidenceFromGraph(graph, loseConfidence);
+
+                addNewConfidenceToGraph(graph, gainConfidence);
+            } finally {
+                ci.getLock().writeLock().unlock();
+            }
+
+        }
+
+        catch (Exception e) {
+            log.info("Error " + e.getMessage());
+            log.info("Error " + e.getStackTrace());
+
+        }
+    }
+
+    /*
+     * We create a data structure that stores the mapping of text annotation to List of Uri of all possible
+     * amiguations of the Text. Also it fills the list loseconfidence with confidence values of all the
+     * ambiguations for all entities (which will be removed eventually)
+     */
+    protected void readEntities(List<Triple> loseConfidence,
+                                List<String> allEntities,
+                                Map<SavedEntity,List<UriRef>> textAnnotations,
+                                MGraph graph) {
+        Iterator<Triple> it = graph.filter(null, RDF_TYPE, TechnicalClasses.ENHANCER_TEXTANNOTATION);
+        while (it.hasNext()) {
+            UriRef uri = (UriRef) it.next().getSubject();
+            String selectText = EnhancementEngineHelper.getString(graph, uri, ENHANCER_SELECTED_TEXT);
+// TODO: rwesten: do we really want to ignore fise:TextAnnotations that link to
+//       to an other one (typically two TextAnnotations that select the exact same text)
+//            if (graph.filter(uri, new UriRef(NamespaceEnum.dc + "relation"), null).hasNext()) {
+//                continue;
+//            }
+
+            SavedEntity savedEntity = SavedEntity.createFromTextAnnotation(graph, uri);
+            if (savedEntity != null) {
+                allEntities.add(selectText);
+                directoryTextAnotation.put(
+                    (savedEntity.getStart()+savedEntity.getEnd()) / 2, selectText);
+
+                List<UriRef> confidenceUriList = new ArrayList<UriRef>();
+                for (Iterator<Triple> it2 = graph
+                        .filter(null, new UriRef(NamespaceEnum.dc + "relation"), uri); it2.hasNext();) {
+                    UriRef uriAmbiguations = (UriRef) it2.next().getSubject();
+                    Iterator<Triple> confidenceTriple = graph.filter(uriAmbiguations, ENHANCER_CONFIDENCE,
+                        null);
+                    while (confidenceTriple.hasNext()) {
+                        loseConfidence.add(confidenceTriple.next());
+                    }
+
+                    // UriRef textAnnotation = uri; //the URI of the processed TextAnnotation
+                    // UriRef entityAnnotation = uriAmbiguations; //the URI of the original EntityAnnotation
+                    // UriRef copy = new UriRef("urn:enhancement-"
+                    // + EnhancementEngineHelper.randomUUID());
+
+                    // List<Triple> triples = new ArrayList<Triple>();
+                    // it = graph.filter(entityAnnotation,null,null);
+                    // int refCount = 0;
+                    // while(it.hasNext()){
+                    // Triple triple = it.next();
+                    // if(DC_RELATION.equals(triple.getPredicate())){
+                    // refCount++;
+                    // }
+                    // if(triple!=null)
+                    // triples.add(triple);
+                    // }
+                    /*
+                     * if(refCount > 1){ for(Triple triple : triples){
+                     * /*if(DC_RELATION.equals(triple.getPredicate())){
+                     * if(triple.getObject().equals(textAnnotation)){ //remove the dc relation to the
+                     * currently processed //textAnnotation from the original //graph.remove(triple); //
+                     * RemoveConf.add(triple); //and add it to the copy // graph.add(new TripleImpl( // copy,
+                     * triple.getPredicate(), triple.getObject())); //AddConf.add(triple); } //else it is not
+                     * the currently processed TextAnnotation // so we need to keep in in the original and NOT
+                     * add // it to the copy } else { //we can copy all other information 1:1 // graph.add(new
+                     * TripleImpl(copy,triple.getPredicate(), triple.getObject())); //AddConf.add(triple); } }
+                     * }
+                     */
+
+                    confidenceUriList.add(uriAmbiguations);
+
+                }
+                textAnnotations.put(savedEntity, confidenceUriList);
+            }
+        }
+        return;
+    }
+
+    /*
+     * Is used to query the Dbpedia with a entity as main constraint and then add string of all other entities
+     * detected as similarity constraints
+     */
+
+    protected QueryResultList<Entity> queryDbpedia(Site dbpediaSite,
+                                                   String savedEntityLabel,
+                                                   String language,
+                                                   String extractionContext) throws SiteException {
+
+        FieldQuery query = dbpediaSite.getQueryFactory().createFieldQuery();
+        Constraint labelConstraint;
+        if (language != null) {
+            labelConstraint = new TextConstraint(savedEntityLabel, false, language, null);
+        } else {
+            labelConstraint = new TextConstraint(savedEntityLabel, false);
+        }
+
+        query.setConstraint(RDFS_LABEL.getUnicodeString(), labelConstraint);
+        log.info("Init SavedEntityTaggingEngine instance for the Entityhub");
+        query.setConstraint("http://stanbol.apache.org/ontology/entityhub/query#fullText",
+            new SimilarityConstraint(extractionContext));
+        // query.setLimit(Math.max(20,9));
+
+        return dbpediaSite.findEntities(query);
+    }
+
+    /*
+     * If for an entity the Dbpedia query results in suggestion none of which match the already present
+     * ambiguations, we go with the ambiguations found earlier that is the ones we have with.
+     */
+
+    protected List<Triple> unchangedConfidences(List<UriRef> subsumed,
+                                                MGraph graph,
+                                                List<Triple> loseConfidence) {
+        for (int i = 0; i < subsumed.size(); i++) {
+            UriRef uri = subsumed.get(i);
+            Iterator<Triple> confidenceTriple = graph.filter(uri, ENHANCER_CONFIDENCE, null);
+            while (confidenceTriple.hasNext()) {
+                loseConfidence.remove(confidenceTriple.next());
+            }
+        }
+        return loseConfidence;
+    }
+
+    /* To convert the values from Dbpedia into score values. */
+    protected List<Suggestion> rankResults(QueryResultList<Entity> results,
+                                           boolean casesensitive,
+                                           String language,
+                                           String savedEntityLabel) {
+        List<Suggestion> matches = new ArrayList<Suggestion>(results.size());
+        Float maxScore = null;
+        Float maxExactScore = null;
+
+        for (Iterator<Entity> guesses = results.iterator(); guesses.hasNext();) {
+            Suggestion match = new Suggestion(guesses.next());
+            Representation rep = match.getEntity().getRepresentation();
+            Float score = rep.getFirst(RdfResourceEnum.resultScore.getUri(), Float.class);
+            match.setURI(rep.getId());
+            if (maxScore == null) {
+                maxScore = score;
+            }
+            Iterator<Text> labels = rep.getText(RDFS_LABEL.getUnicodeString());
+            while (labels.hasNext() && match.getLevenshtein() < 1.0) {
+                Text label1 = labels.next();
+                if (language == null || // if the content language is unknown -> accept all labels
+                    label1.getLanguage() == null || // accept labels with no language
+                    // and labels in the same language as the content
+                    (language != null && label1.getLanguage().startsWith(language))) {
+                    double actMatch = levenshtein(
+                        casesensitive ? label1.getText().toLowerCase() : label1.getText(), savedEntityLabel);
+                    if (actMatch > match.getLevenshtein()) {
+                        match.setLevenshtein(actMatch);
+                        // JOptionPane.showMessageDialog(null, "++"+label1);
+                        match.setMatchedLabel(label1);
+                    }
+                }
+            }
+            if (match.getMatchedLabel() != null) {
+                if (match.getLevenshtein() == 1.0) {
+                    if (maxExactScore == null) {
+                        maxExactScore = score;
+                    }
+                    // normalise exact matches against the best exact score
+                    match.setScore(score.doubleValue() / maxExactScore.doubleValue());
+                } else {
+                    // normalise partial matches against the best match and the
+                    // Levenshtein similarity with the label
+                    match.setScore(score.doubleValue() * match.getLevenshtein() / maxScore.doubleValue());
+                }
+                matches.add(match);
+            } else {
+                log.info("No value of {} for Entity {}!", RDFS_LABEL.getUnicodeString(), match.getEntity()
+                        .getId());
+            }
+        }
+        return matches;
+    }
+
+    /*
+     * Checks if there is any common elements amongst the ambiguations amongst latest dbpedia query and intial
+     * ambiguations
+     */
+
+    protected boolean intersectionCheck(List<Suggestion> matches,
+                                        List<UriRef> subsumed,
+                                        MGraph graph,
+                                        String contentLangauge) {
+        for (int i = 0; i < subsumed.size(); i++) {
+            UriRef uri = subsumed.get(i);
+
+            UriRef uri1 = EnhancementEngineHelper.getReference(graph, uri, new UriRef(NamespaceEnum.fise
+                                                                                      + "entity-reference"));
+
+            String selectedText = EnhancementEngineHelper.getString(graph, uri, ENHANCER_ENTITY_LABEL);
+
+            if (selectedText == null) {
+                continue;
+            }
+
+            for (int j = 0; j < matches.size(); j++) {
+                Suggestion suggestion = matches.get(j);
+                String suggestName = suggestion.getURI();
+                if (suggestName.compareToIgnoreCase(uri1.getUnicodeString()) == 0) return true;
+            }
+        }
+        return false;
+    }
+
+    public Map<Integer,String> directoryTextAnotation = new HashMap<Integer,String>();
+
+    int radii = 23;
+
+    // Value to be configured
+
+    public boolean toInclude(int k, int s) {
+        if (Math.abs(k - s) < radii && Math.abs(k - s) > 0) {
+            return true;
+        }
+        return false;
+    }
+
+    public List<String> EntitiesInRange(Map<Integer,String> map, int radius) {
+        List<String> temp = new ArrayList<String>();
+
+        for (Entry<Integer,String> entry : map.entrySet()) {
+            Integer s = entry.getKey();
+            String subs = entry.getValue();
+            if (toInclude(s, radius)) {
+                temp.add(subs);
+            }
+        }
+
+        return temp; // if(Cal(f,k))
+    }
+
+    /* Returns a string on appended text annotations seperated by spaces */
+    protected List<String> getEntititesSelection(String label, List<String> allEntities, String context) {
+        List<String> allEntityString = new ArrayList<String>();
+
+        for (int i = 0; i < allEntities.size(); i++) {
+
+            if (label.compareToIgnoreCase(allEntities.get(i)) != 0 && (context != null)
+                && (context.contains(allEntities.get(i)))) {
+                allEntityString.add(allEntities.get(i));
+
+            }
+
+        }
+
+        return allEntityString;
+    }
+
+    public String unionString(List<String> a, List<String> b, String h) {
+        Set union = new HashSet();
+
+        union.addAll(a);
+        union.addAll(b);
+        String AllString = "";
+
+        Object[] temp = union.toArray();
+        for (int i = 0; i < temp.length; i++) {
+            AllString = AllString + " " + (String) temp[i];
+        }
+        return AllString;
+    }
+
+    /*
+     * Finds values the lie in intersection of both the set of disambiguations( the one intially suggested and
+     * the one from dpedia). Update the confidence values of those and make the confidence values of others as
+     * 0 in gainconfidence list
+     */
+    protected List<Triple> intersection(List<Suggestion> matches,
+                                        List<UriRef> subsumed,
+                                        MGraph graph,
+                                        List<Triple> gainConfidence,
+                                        String contentLangauge) {
+
+        for (int i = 0; i < subsumed.size(); i++) {
+            boolean matchFound = false;
+            UriRef uri = subsumed.get(i);
+
+            UriRef uri1 = EnhancementEngineHelper.getReference(graph, uri, new UriRef(NamespaceEnum.fise
+                                                                                      + "entity-reference"));
+
+            for (int j = 0; j < matches.size(); j++) {
+                Suggestion suggestion = matches.get(j);
+                String suggestName = suggestion.getURI();
+
+                if (suggestName != null && uri1 != null
+                    && suggestName.compareToIgnoreCase(uri1.getUnicodeString()) == 0) {
+                    Triple confidenceTriple = new TripleImpl(uri, ENHANCER_CONFIDENCE, LiteralFactory
+                            .getInstance().createTypedLiteral(suggestion.getScore()));
+                    Triple contributorTriple = new TripleImpl((UriRef) confidenceTriple.getSubject(),
+                            new UriRef(NamespaceEnum.dc + "contributor"), LiteralFactory.getInstance()
+                                    .createTypedLiteral(this.getClass().getName()));
+                    gainConfidence.add(confidenceTriple);
+                    gainConfidence.add(contributorTriple);
+                    matchFound = true;
+                }
+            }
+
+            if (!matchFound) {
+                Triple confidenceTriple = new TripleImpl(uri, ENHANCER_CONFIDENCE, LiteralFactory
+                        .getInstance().createTypedLiteral(0.0));
+                Triple contributorTriple = new TripleImpl((UriRef) confidenceTriple.getSubject(), new UriRef(
+                        NamespaceEnum.dc + "contributor"), LiteralFactory.getInstance().createTypedLiteral(
+                    this.getClass().getName()));
+                gainConfidence.add(confidenceTriple);
+                gainConfidence.add(contributorTriple);
+            }
+        }
+
+        return gainConfidence;
+    }
+
+    /* Removes the value in lose confidence from the graph */
+    protected void removeOldConfidenceFromGraph(MGraph graph, List<Triple> loseConfidence) {
+        for (int i = 0; i < loseConfidence.size(); i++) {
+            Triple elementToRemove = loseConfidence.get(i);
+            graph.remove(elementToRemove);
+        }
+    }
+
+    /* adds the confidence values from gain confidence list to graph */
+    protected void addNewConfidenceToGraph(MGraph graph, List<Triple> gainConfidence) {
+        for (int i = 0; i < gainConfidence.size(); i++) {
+            Triple elementToAdd = gainConfidence.get(i);
+            graph.add(elementToAdd);
+        }
+    }
+
+    /* Returns a string on appended text annotations seperated by spaces */
+    protected String getEntitiesfromContext(String label, List<String> allEntities, String context) {
+        String allEntityString = "";
+
+        for (int i = 0; i < allEntities.size(); i++) {
+
+            if (label.compareToIgnoreCase(allEntities.get(i)) != 0 && (context != null)
+                && (context.contains(allEntities.get(i)))) {
+                allEntityString = allEntityString + "  " + allEntities.get(i);
+            }
+
+        }
+
+        return allEntityString;
+    }
+
+    protected String deriveSentence(String Context, int a, int b) {
+        String allEntityString = "";
+        String start = Context.substring(0, a);
+        String end = Context.substring(b);
+        int s = start.lastIndexOf('.');
+        int e = end.indexOf('.');
+        if (s < 0) {
+            if (e < 0) return Context;
+            else return Context.substring(0, b + e);
+        } else {
+            if (e < 0) return Context.substring(s);
+            else return Context.substring(s + 1, b + e);
+        }
+
+    }
+
+    /**
+     * Activate and read the properties
+     * 
+     * @param ce
+     *            the {@link ComponentContext}
+     */
+    @Activate
+    protected void activate(ComponentContext ce) throws ConfigurationException {
+        try {
+            super.activate(ce);
+        } catch (IOException e) {
+            // log
+            log.error("Failed to update the configuration", e);
+        }
+        @SuppressWarnings("unchecked")
+        Dictionary<String,Object> properties = ce.getProperties();
+        // update the service URL if it is defined
+        // if (properties.get(FORMCEPT_SERVICE_URL) != null) {
+        // this.serviceURL = (String) properties.get(FORMCEPT_SERVICE_URL);
+        // }
+    }
+
+    /**
+     * Deactivate
+     * 
+     * @param ce
+     *            the {@link ComponentContext}
+     */
+    @Deactivate
+    protected void deactivate(ComponentContext ce) {
+        super.deactivate(ce);
+    }
+
+    /**
+     * Gets the Service URL
+     * 
+     * @return
+     */
+    public String getServiceURL() {
+        return serviceURL;
+    }
+
+    private static double levenshtein(String s1, String s2) {
+        if (s1 == null || s2 == null) {
+            throw new IllegalArgumentException("NONE of the parsed String MUST BE NULL!");
+        }
+        s1 = StringUtils.trim(s1);
+        s2 = StringUtils.trim(s2);
+        return s1.isEmpty() || s2.isEmpty() ? 0
+                : 1.0 - (((double) getLevenshteinDistance(s1, s2)) / ((double) (Math.max(s1.length(),
+                    s2.length()))));
+    }
+
+}
\ No newline at end of file

Propchange: incubator/stanbol/branches/disambiguation-engine/engines/disambiguation-mlt/src/main/java/org/apache/stanbol/enhancer/engine/disambiguation/mlt/DisambiguatorEngine.java
------------------------------------------------------------------------------
    svn:executable = *

Added: incubator/stanbol/branches/disambiguation-engine/engines/disambiguation-mlt/src/main/java/org/apache/stanbol/enhancer/engine/disambiguation/mlt/SavedEntity.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/branches/disambiguation-engine/engines/disambiguation-mlt/src/main/java/org/apache/stanbol/enhancer/engine/disambiguation/mlt/SavedEntity.java?rev=1378005&view=auto
==============================================================================
--- incubator/stanbol/branches/disambiguation-engine/engines/disambiguation-mlt/src/main/java/org/apache/stanbol/enhancer/engine/disambiguation/mlt/SavedEntity.java (added)
+++ incubator/stanbol/branches/disambiguation-engine/engines/disambiguation-mlt/src/main/java/org/apache/stanbol/enhancer/engine/disambiguation/mlt/SavedEntity.java Tue Aug 28 07:26:47 2012
@@ -0,0 +1,144 @@
+/*
+* Licensed to the Apache Software Foundation (ASF) under one or more
+* contributor license agreements.  See the NOTICE file distributed with
+* this work for additional information regarding copyright ownership.
+* The ASF licenses this file to You under the Apache License, Version 2.0
+* (the "License"); you may not use this file except in compliance with
+* the License.  You may obtain a copy of the License at
+*
+*     http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+package org.apache.stanbol.enhancer.engine.disambiguation.mlt;
+
+import static org.apache.stanbol.enhancer.servicesapi.rdf.Properties.DC_TYPE;
+import static org.apache.stanbol.enhancer.servicesapi.rdf.Properties.ENHANCER_END;
+import static org.apache.stanbol.enhancer.servicesapi.rdf.Properties.ENHANCER_SELECTED_TEXT;
+import static org.apache.stanbol.enhancer.servicesapi.rdf.Properties.ENHANCER_SELECTION_CONTEXT;
+import static org.apache.stanbol.enhancer.servicesapi.rdf.Properties.ENHANCER_START;
+
+import org.apache.clerezza.rdf.core.LiteralFactory;
+import org.apache.clerezza.rdf.core.NonLiteral;
+import org.apache.clerezza.rdf.core.TripleCollection;
+import org.apache.clerezza.rdf.core.UriRef;
+import org.apache.stanbol.enhancer.servicesapi.helper.EnhancementEngineHelper;
+import org.apache.stanbol.enhancer.servicesapi.rdf.TechnicalClasses;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public final class SavedEntity {
+    private static final Logger log = LoggerFactory.getLogger(SavedEntity.class);
+    /**
+     * The {@link LiteralFactory} used to create typed RDF literals
+     */
+    private final static LiteralFactory literalFactory = LiteralFactory.getInstance();
+    private NonLiteral entity;
+    private String name;
+    private UriRef type;
+    private String URI;
+    private String context;
+    private Integer start;
+    private Integer end;
+    
+    private SavedEntity() {
+        //use createFromTextAnnotation to create an instance
+    }
+    /**
+     * Getter for the Node providing the information about that entity
+     * @return the entity
+     */
+    public final NonLiteral getEntity() {
+        return entity;
+    }
+    /**
+     * Getter for the name
+     * @return the name
+     */
+    public final String getName() {
+        return name;
+    }
+    /**
+     * Getter for the type
+     * @return the type
+     */
+    public final UriRef getType() {
+        return type;
+    }
+    @Override
+    public int hashCode() {
+        return entity.hashCode();
+    }
+    @Override
+    public boolean equals(Object o) {
+        return o instanceof SavedEntity && entity.equals(((SavedEntity)o).entity);
+    }
+    @Override
+    public String toString() {
+        return String.format("SavedEntity %s (name=%s|type=%s)",entity,name,type);
+    }
+    /**
+     * Extracts the information of an {@link SavedEntity} from an
+     * {@link TechnicalClasses#ENHANCER_TEXTANNOTATION} instance.
+     * @param graph the graph with the information
+     * @param textAnnotation the text annotation instance
+     * @return the {@link SavedEntity} or <code>null</code> if the parsed
+     * text annotation is missing required information.
+     */
+    public static SavedEntity createFromTextAnnotation(TripleCollection graph, NonLiteral textAnnotation){
+        SavedEntity entity = new SavedEntity();
+        String name = EnhancementEngineHelper.getString(graph, textAnnotation, ENHANCER_SELECTED_TEXT);
+        if (name == null) {
+            log.debug("Unable to create SavedEntity for TextAnnotation {} "
+                    + "because property {} is not present",textAnnotation,ENHANCER_SELECTED_TEXT);
+            return null;
+        }
+        // remove punctuation form the search string
+        entity.name = cleanupKeywords(name);
+        if(entity.name.isEmpty()){
+            log.debug("Unable to process TextAnnotation {} because its selects "
+            		+ "an empty Stirng !",textAnnotation);
+            return null;
+        }
+        entity.type = EnhancementEngineHelper.getReference(graph, textAnnotation, DC_TYPE);
+        //NOTE rwesten: TextAnnotations without dc:type should be still OK
+//        if (type == null) {
+//            log.warn("Unable to process TextAnnotation {} because property {}"
+//                     + " is not present!",textAnnotation, DC_TYPE);
+//            return null;
+//        }
+        entity.context = EnhancementEngineHelper.getString(graph, textAnnotation, ENHANCER_SELECTION_CONTEXT);
+        Integer start = EnhancementEngineHelper.get(graph, textAnnotation, ENHANCER_START,Integer.class,literalFactory);
+        Integer end = EnhancementEngineHelper.get(graph, textAnnotation, ENHANCER_END,Integer.class,literalFactory);
+        if(start == null || end ==null){
+            log.debug("Unable to process TextAnnotation {} because the start and/or the end "
+                + "position is not defined (selectedText: {}, start: {}, end: {})",
+                new Object[]{textAnnotation, name, start, end});
+            
+        }
+        return entity;
+    }        
+    /**
+     * Removes punctuation form a parsed string
+     */
+    private static String cleanupKeywords(String keywords) {
+        return keywords.replaceAll("\\p{P}", " ").trim();
+    }
+    
+    public String getURI()
+    {return this.URI;}
+
+    public String getContext()
+    {return this.context;}
+    
+    public int getStart()
+    {return this.start;}
+
+    public int getEnd()
+    {return this.end;}
+  
+}

Added: incubator/stanbol/branches/disambiguation-engine/engines/disambiguation-mlt/src/main/java/org/apache/stanbol/enhancer/engine/disambiguation/mlt/Suggestion.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/branches/disambiguation-engine/engines/disambiguation-mlt/src/main/java/org/apache/stanbol/enhancer/engine/disambiguation/mlt/Suggestion.java?rev=1378005&view=auto
==============================================================================
--- incubator/stanbol/branches/disambiguation-engine/engines/disambiguation-mlt/src/main/java/org/apache/stanbol/enhancer/engine/disambiguation/mlt/Suggestion.java (added)
+++ incubator/stanbol/branches/disambiguation-engine/engines/disambiguation-mlt/src/main/java/org/apache/stanbol/enhancer/engine/disambiguation/mlt/Suggestion.java Tue Aug 28 07:26:47 2012
@@ -0,0 +1,106 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.stanbol.enhancer.engine.disambiguation.mlt;
+
+import org.apache.stanbol.entityhub.servicesapi.model.Entity;
+import org.apache.stanbol.entityhub.servicesapi.model.Text;
+
+/**
+ * A suggestion of an {@link Entity} for a fise:TextAnnotation processed
+ * by the NamedEntityTaggingEngine
+ * @author Rupert Westenthaler
+ */
+public class Suggestion implements Comparable<Suggestion>{
+    private final Entity entity;
+    private double levenshtein = -1;
+    private Double score;
+    private Text matchedLabel;
+    private String URI;
+    protected Suggestion(Entity entity){
+        this.entity = entity;
+    }
+    
+    
+    /**
+     * @return the levenshtein
+     */
+    public final double getLevenshtein() {
+        return levenshtein;
+    }
+
+
+    /**
+     * @param levenshtein the levenshtein to set
+     */
+    protected final void setLevenshtein(double levenshtein) {
+        this.levenshtein = levenshtein;
+    }
+
+
+    /**
+     * @return the score
+     */
+    public final Double getScore() {
+        return score;
+    }
+
+
+    /**
+     * @param score the score to set
+     */
+    protected final void setScore(Double score) {
+        this.score = score;
+    }
+
+
+    /**
+     * @return the matchedLabel
+     */
+    public final Text getMatchedLabel() {
+        return matchedLabel;
+    }
+
+
+    /**
+     * @param matchedLabel the matchedLabel to set
+     */
+    protected final void setMatchedLabel(Text matchedLabel) {
+        this.matchedLabel = matchedLabel;
+    }
+
+    protected final String getURI() {
+        return this.URI;
+    }
+    protected final void setURI(String URI) {
+        this.URI = URI;
+    }
+
+    /**
+     * @return the entity
+     */
+    public final Entity getEntity() {
+        return entity;
+    }
+
+
+    @Override
+    public int compareTo(Suggestion other) {
+        return other.score.compareTo(score);
+    }
+    
+    
+}

Added: incubator/stanbol/branches/disambiguation-engine/engines/disambiguation-mlt/src/main/resources/OSGI-INF/metatype/metatype.properties
URL: http://svn.apache.org/viewvc/incubator/stanbol/branches/disambiguation-engine/engines/disambiguation-mlt/src/main/resources/OSGI-INF/metatype/metatype.properties?rev=1378005&view=auto
==============================================================================
--- incubator/stanbol/branches/disambiguation-engine/engines/disambiguation-mlt/src/main/resources/OSGI-INF/metatype/metatype.properties (added)
+++ incubator/stanbol/branches/disambiguation-engine/engines/disambiguation-mlt/src/main/resources/OSGI-INF/metatype/metatype.properties Tue Aug 28 07:26:47 2012
@@ -0,0 +1,29 @@
+#
+# Copyright 2012, FORMCEPT [http://www.formcept.com]
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+stanbol.enhancer.engine.name.name=Name
+stanbol.enhancer.engine.name.description=The name of the enhancement engine as \
+used in the RESTful interface '/engine/<name>'
+service.ranking.name=Ranking
+service.ranking.description=If two enhancement engines with the same name are active the \
+one with the higher ranking will be used to process parsed content items.
+
+#====================================================
+#Properties used to configure FORMCEPT Enhancer
+#====================================================
+
+org.formcept.engine.enhancer.url.name=FORMCEPT Service URL
+org.formcept.engine.enhancer.url.desc=The URL of the FORMCEPT Enhancement Service

Propchange: incubator/stanbol/branches/disambiguation-engine/engines/disambiguation-mlt/src/main/resources/OSGI-INF/metatype/metatype.properties
------------------------------------------------------------------------------
    svn:executable = *

Modified: incubator/stanbol/branches/disambiguation-engine/engines/pom.xml
URL: http://svn.apache.org/viewvc/incubator/stanbol/branches/disambiguation-engine/engines/pom.xml?rev=1378005&r1=1378004&r2=1378005&view=diff
==============================================================================
--- incubator/stanbol/branches/disambiguation-engine/engines/pom.xml (original)
+++ incubator/stanbol/branches/disambiguation-engine/engines/pom.xml Tue Aug 28 07:26:47 2012
@@ -56,5 +56,7 @@
     <module>geonames</module> <!-- http://geonames.org -->
     <module>opencalais</module> <!-- http://opencalais.com/ -->
     <module>zemanta</module> <!-- htt://zemanta.com -->
+    <!-- Disambiguation Engine -->
+    <module>disambiguation-mlt</module>
   </modules>
 </project>

Modified: incubator/stanbol/branches/disambiguation-engine/pom.xml
URL: http://svn.apache.org/viewvc/incubator/stanbol/branches/disambiguation-engine/pom.xml?rev=1378005&r1=1378004&r2=1378005&view=diff
==============================================================================
--- incubator/stanbol/branches/disambiguation-engine/pom.xml (original)
+++ incubator/stanbol/branches/disambiguation-engine/pom.xml Tue Aug 28 07:26:47 2012
@@ -61,6 +61,8 @@
     <module>chain/weighted</module>
     <module>chain/list</module>
     
+    <module>engines</module>
+      
     <module>jersey</module>
     <module>ldpath</module>
     <module>benchmark</module>