You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stanbol.apache.org by og...@apache.org on 2012/03/27 16:50:25 UTC

svn commit: r1305856 - in /incubator/stanbol/trunk/enhancer/engines/topic/src/main/java/org/apache/stanbol/enhancer: engine/topic/TopicClassificationEngine.java topic/TopicClassifier.java

Author: ogrisel
Date: Tue Mar 27 14:50:24 2012
New Revision: 1305856

URL: http://svn.apache.org/viewvc?rev=1305856&view=rev
Log:
STANBOL-197: make it possible to import a SKOS taxonomy from RDF

Modified:
    incubator/stanbol/trunk/enhancer/engines/topic/src/main/java/org/apache/stanbol/enhancer/engine/topic/TopicClassificationEngine.java
    incubator/stanbol/trunk/enhancer/engines/topic/src/main/java/org/apache/stanbol/enhancer/topic/TopicClassifier.java

Modified: incubator/stanbol/trunk/enhancer/engines/topic/src/main/java/org/apache/stanbol/enhancer/engine/topic/TopicClassificationEngine.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/enhancer/engines/topic/src/main/java/org/apache/stanbol/enhancer/engine/topic/TopicClassificationEngine.java?rev=1305856&r1=1305855&r2=1305856&view=diff
==============================================================================
--- incubator/stanbol/trunk/enhancer/engines/topic/src/main/java/org/apache/stanbol/enhancer/engine/topic/TopicClassificationEngine.java (original)
+++ incubator/stanbol/trunk/enhancer/engines/topic/src/main/java/org/apache/stanbol/enhancer/engine/topic/TopicClassificationEngine.java Tue Mar 27 14:50:24 2012
@@ -1232,6 +1232,7 @@ public class TopicClassificationEngine e
         return chainNames;
     }
 
+    @Override
     public int importConceptsFromGraph(Graph graph, UriRef conceptClass, UriRef broaderProperty) throws ClassifierException {
         int importedCount = 0;
         Iterator<Triple> conceptIterator = graph.filter(null,

Modified: incubator/stanbol/trunk/enhancer/engines/topic/src/main/java/org/apache/stanbol/enhancer/topic/TopicClassifier.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/enhancer/engines/topic/src/main/java/org/apache/stanbol/enhancer/topic/TopicClassifier.java?rev=1305856&r1=1305855&r2=1305856&view=diff
==============================================================================
--- incubator/stanbol/trunk/enhancer/engines/topic/src/main/java/org/apache/stanbol/enhancer/topic/TopicClassifier.java (original)
+++ incubator/stanbol/trunk/enhancer/engines/topic/src/main/java/org/apache/stanbol/enhancer/topic/TopicClassifier.java Tue Mar 27 14:50:24 2012
@@ -20,6 +20,8 @@ import java.util.Collection;
 import java.util.List;
 import java.util.Set;
 
+import org.apache.clerezza.rdf.core.Graph;
+import org.apache.clerezza.rdf.core.UriRef;
 import org.apache.stanbol.enhancer.servicesapi.ChainException;
 import org.apache.stanbol.enhancer.servicesapi.EngineException;
 import org.apache.stanbol.enhancer.topic.training.TrainingSet;
@@ -167,4 +169,11 @@ public interface TopicClassifier {
      * engine.
      */
     List<String> getChainNames() throws InvalidSyntaxException, ChainException;
+
+    /**
+     * Initialize the concept hierarch of the model using the provided RDF model (e.g. a SKOS taxonomy).
+     * 
+     * @return the number of concepts successfully imported (including roots).
+     */
+    int importConceptsFromGraph(Graph graph, UriRef conceptClass, UriRef broaderProperty) throws ClassifierException;
 }