clerezza-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tomm...@apache.org
Subject svn commit: r943078 - /incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.uima/org.apache.clerezza.uima.metadata-generator/src/main/java/org/apache/clerezza/uima/metadatagenerator/UIMABaseMetadataGenerator.java
Date Tue, 11 May 2010 10:53:29 GMT
Author: tommaso
Date: Tue May 11 10:53:29 2010
New Revision: 943078

URL: http://svn.apache.org/viewvc?rev=943078&view=rev
Log:
[CLEREZZA-193] - as CLEREZZA-212 switched to GraphNode addPropertyValue instead of private
similar method

Modified:
    incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.uima/org.apache.clerezza.uima.metadata-generator/src/main/java/org/apache/clerezza/uima/metadatagenerator/UIMABaseMetadataGenerator.java

Modified: incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.uima/org.apache.clerezza.uima.metadata-generator/src/main/java/org/apache/clerezza/uima/metadatagenerator/UIMABaseMetadataGenerator.java
URL: http://svn.apache.org/viewvc/incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.uima/org.apache.clerezza.uima.metadata-generator/src/main/java/org/apache/clerezza/uima/metadatagenerator/UIMABaseMetadataGenerator.java?rev=943078&r1=943077&r2=943078&view=diff
==============================================================================
--- incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.uima/org.apache.clerezza.uima.metadata-generator/src/main/java/org/apache/clerezza/uima/metadatagenerator/UIMABaseMetadataGenerator.java
(original)
+++ incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.uima/org.apache.clerezza.uima.metadata-generator/src/main/java/org/apache/clerezza/uima/metadatagenerator/UIMABaseMetadataGenerator.java
Tue May 11 10:53:29 2010
@@ -1,7 +1,5 @@
 package org.apache.clerezza.uima.metadatagenerator;
 
-import org.apache.clerezza.rdf.core.LiteralFactory;
-import org.apache.clerezza.rdf.core.UriRef;
 import org.apache.clerezza.rdf.metadata.MetaDataGenerator;
 import org.apache.clerezza.rdf.ontologies.DC;
 import org.apache.clerezza.rdf.ontologies.DCTERMS;
@@ -30,8 +28,9 @@ public class UIMABaseMetadataGenerator i
     // FIXME only TEXT_PLAIN, also different MediaTypes should be served
     if (MediaType.TEXT_PLAIN.equals(mediaType.getType())) {
       try {
-        //add language to the document
+        // add language to the document
         addLanguage(node, data);
+        // add wide purpose subject to the document
         addCategory(node, data);
         
       } catch (Throwable e) {
@@ -43,17 +42,13 @@ public class UIMABaseMetadataGenerator i
   private void addCategory(GraphNode node, byte[] data) throws UIMAException {
     // get category to bind it to the node
     String category = facade.getCategory(data.toString());
-    addStringLiteral(category, node, DC.subject);
+    node.addPropertyValue(DC.subject,category);
   }
 
   private void addLanguage(GraphNode node, byte[] data) throws UIMAException {
     // get language to bind to the node
     String language = facade.getLanguage(data.toString());
-    addStringLiteral(language, node, DCTERMS.language);
-  }
-
-  private void addStringLiteral(String value, GraphNode node, UriRef uriRef) {
-    node.addProperty(uriRef, LiteralFactory.getInstance().createTypedLiteral(value));
+    node.addPropertyValue(DCTERMS.language,language);
   }
 
 }



Mime
View raw message