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/12/06 11:44:01 UTC

svn commit: r1417801 [1/3] - in /stanbol/trunk: commons/ commons/solr/install/src/main/java/org/apache/stanbol/commons/solr/install/impl/ enhancement-engines/entitytagging/ enhancement-engines/entitytagging/src/main/java/org/apache/stanbol/enhancer/eng...

Author: rwesten
Date: Thu Dec  6 10:43:52 2012
New Revision: 1417801

URL: http://svn.apache.org/viewvc?rev=1417801&view=rev
Log:
STANBOL-824: Adaptions to all Stanbol Components to change usages of the Entityhub NamespaceEnum to the new NamespaceprefixSerice. This includes the Entityhub Indexing Tool that now also allows to define custom namespace prefix mappings in the ./indexing/config/namespaceprefix.mappings file

Modified:
    stanbol/trunk/commons/pom.xml
    stanbol/trunk/commons/solr/install/src/main/java/org/apache/stanbol/commons/solr/install/impl/SolrIndexInstaller.java
    stanbol/trunk/enhancement-engines/entitytagging/pom.xml
    stanbol/trunk/enhancement-engines/entitytagging/src/main/java/org/apache/stanbol/enhancer/engines/entitytagging/impl/NamedEntityTaggingEngine.java
    stanbol/trunk/enhancement-engines/keywordextraction/pom.xml
    stanbol/trunk/enhancement-engines/keywordextraction/src/main/java/org/apache/stanbol/enhancer/engines/keywordextraction/engine/KeywordLinkingEngine.java
    stanbol/trunk/enhancement-engines/keywordextraction/src/main/java/org/apache/stanbol/enhancer/engines/keywordextraction/impl/EntityLinkerConfig.java
    stanbol/trunk/enhancer/jersey/pom.xml
    stanbol/trunk/entityhub/generic/core/pom.xml
    stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/impl/EntityhubImpl.java
    stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/impl/ReferencedSiteImpl.java
    stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/mapping/FieldMappingUtils.java
    stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/site/CacheImpl.java
    stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/site/CacheUtils.java
    stanbol/trunk/entityhub/generic/servicesapi/src/main/java/org/apache/stanbol/entityhub/servicesapi/defaults/NamespaceEnum.java
    stanbol/trunk/entityhub/generic/servicesapi/src/main/java/org/apache/stanbol/entityhub/servicesapi/model/rdf/RdfResourceEnum.java
    stanbol/trunk/entityhub/indexing/core/pom.xml
    stanbol/trunk/entityhub/indexing/core/src/main/java/org/apache/stanbol/entityhub/indexing/core/config/IndexingConfig.java
    stanbol/trunk/entityhub/indexing/core/src/main/java/org/apache/stanbol/entityhub/indexing/core/processor/FieldValueFilter.java
    stanbol/trunk/entityhub/indexing/core/src/main/java/org/apache/stanbol/entityhub/indexing/core/processor/FiledMapperProcessor.java
    stanbol/trunk/entityhub/indexing/dblp/pom.xml
    stanbol/trunk/entityhub/indexing/dbpedia/pom.xml
    stanbol/trunk/entityhub/indexing/dbpedia/src/main/resources/indexing/config/mappings.txt
    stanbol/trunk/entityhub/indexing/destination/solryard/pom.xml
    stanbol/trunk/entityhub/indexing/genericrdf/pom.xml
    stanbol/trunk/entityhub/indexing/source/jenatdb/pom.xml
    stanbol/trunk/entityhub/indexing/source/jenatdb/src/main/java/org/apache/stanbol/entityhub/indexing/source/jenatdb/ResourceFilterIterator.java
    stanbol/trunk/entityhub/jersey/pom.xml
    stanbol/trunk/entityhub/jersey/src/main/java/org/apache/stanbol/entityhub/jersey/fragment/EntityhubWebFragment.java
    stanbol/trunk/entityhub/jersey/src/main/java/org/apache/stanbol/entityhub/jersey/grefine/ReconcileProperty.java
    stanbol/trunk/entityhub/jersey/src/main/java/org/apache/stanbol/entityhub/jersey/grefine/ReconcileQuery.java
    stanbol/trunk/entityhub/jersey/src/main/java/org/apache/stanbol/entityhub/jersey/grefine/ReconcileValue.java
    stanbol/trunk/entityhub/jersey/src/main/java/org/apache/stanbol/entityhub/jersey/parsers/FieldQueryReader.java
    stanbol/trunk/entityhub/jersey/src/main/java/org/apache/stanbol/entityhub/jersey/parsers/RepresentationReader.java
    stanbol/trunk/entityhub/jersey/src/main/java/org/apache/stanbol/entityhub/jersey/resource/EntityhubRootResource.java
    stanbol/trunk/entityhub/jersey/src/main/java/org/apache/stanbol/entityhub/jersey/resource/ReferencedSiteRootResource.java
    stanbol/trunk/entityhub/jersey/src/main/java/org/apache/stanbol/entityhub/jersey/resource/SiteManagerRootResource.java
    stanbol/trunk/entityhub/jersey/src/main/java/org/apache/stanbol/entityhub/jersey/resource/reconcile/BaseGoogleRefineReconcileResource.java
    stanbol/trunk/entityhub/jersey/src/main/java/org/apache/stanbol/entityhub/jersey/resource/reconcile/EntityhubReconcileResource.java
    stanbol/trunk/entityhub/jersey/src/main/java/org/apache/stanbol/entityhub/jersey/resource/reconcile/ReferencedSiteReconcileResource.java
    stanbol/trunk/entityhub/jersey/src/main/java/org/apache/stanbol/entityhub/jersey/resource/reconcile/SiteManagerReconcileResource.java
    stanbol/trunk/entityhub/jersey/src/main/java/org/apache/stanbol/entityhub/jersey/utils/JerseyUtils.java
    stanbol/trunk/entityhub/jersey/src/main/java/org/apache/stanbol/entityhub/jersey/utils/LDPathHelper.java
    stanbol/trunk/entityhub/jersey/src/main/java/org/apache/stanbol/entityhub/jersey/writers/EntityToJSON.java
    stanbol/trunk/entityhub/jersey/src/main/java/org/apache/stanbol/entityhub/jersey/writers/EntityToRDF.java
    stanbol/trunk/entityhub/jersey/src/main/java/org/apache/stanbol/entityhub/jersey/writers/FieldQueryToJSON.java
    stanbol/trunk/entityhub/jersey/src/main/java/org/apache/stanbol/entityhub/jersey/writers/QueryResultListWriter.java
    stanbol/trunk/entityhub/jersey/src/main/java/org/apache/stanbol/entityhub/jersey/writers/QueryResultsToJSON.java
    stanbol/trunk/entityhub/jersey/src/main/java/org/apache/stanbol/entityhub/jersey/writers/QueryResultsToRDF.java
    stanbol/trunk/entityhub/jersey/src/test/java/org/apache/stanbol/entityhub/jersey/parsers/RepresetnationReaderTest.java
    stanbol/trunk/entityhub/site/managed/src/main/java/org/apache/stanbol/entityhub/site/managed/ManagedSiteComponent.java
    stanbol/trunk/entityhub/site/managed/src/main/java/org/apache/stanbol/entityhub/site/managed/impl/YardSite.java
    stanbol/trunk/integration-tests/pom.xml
    stanbol/trunk/integration-tests/src/test/java/org/apache/stanbol/enhancer/it/MultiThreadedTestBase.java
    stanbol/trunk/launchers/bundlelists/stanbolcommons/src/main/bundles/list.xml

Modified: stanbol/trunk/commons/pom.xml
URL: http://svn.apache.org/viewvc/stanbol/trunk/commons/pom.xml?rev=1417801&r1=1417800&r2=1417801&view=diff
==============================================================================
--- stanbol/trunk/commons/pom.xml (original)
+++ stanbol/trunk/commons/pom.xml Thu Dec  6 10:43:52 2012
@@ -61,7 +61,7 @@
     <!-- module>namespaceprefix/bundleprovider</module -->
     <!-- module>namespaceprefix/datafileprovider</module -->
     <module>namespaceprefix/stanbolprovider</module>
-    <!-- module>namespaceprefix/prefixccprovider</module -->
+    <module>namespaceprefix/prefixccprovider</module>
 
     <!-- Apache Solr integration--> 
     <module>solr/core</module>

Modified: stanbol/trunk/commons/solr/install/src/main/java/org/apache/stanbol/commons/solr/install/impl/SolrIndexInstaller.java
URL: http://svn.apache.org/viewvc/stanbol/trunk/commons/solr/install/src/main/java/org/apache/stanbol/commons/solr/install/impl/SolrIndexInstaller.java?rev=1417801&r1=1417800&r2=1417801&view=diff
==============================================================================
--- stanbol/trunk/commons/solr/install/src/main/java/org/apache/stanbol/commons/solr/install/impl/SolrIndexInstaller.java (original)
+++ stanbol/trunk/commons/solr/install/src/main/java/org/apache/stanbol/commons/solr/install/impl/SolrIndexInstaller.java Thu Dec  6 10:43:52 2012
@@ -78,7 +78,7 @@ import org.slf4j.LoggerFactory;
  * 
  */
 @Component(immediate = true)
-@Services(value = {@Service(value = InstallTaskFactory.class), @Service(value = ResourceTransformer.class)})
+@Service(value = {InstallTaskFactory.class, ResourceTransformer.class})
 @Property(name = Constants.SERVICE_RANKING, intValue = 100)
 // we need to be in front of the Sling Components
 public class SolrIndexInstaller implements InstallTaskFactory, ResourceTransformer {

Modified: stanbol/trunk/enhancement-engines/entitytagging/pom.xml
URL: http://svn.apache.org/viewvc/stanbol/trunk/enhancement-engines/entitytagging/pom.xml?rev=1417801&r1=1417800&r2=1417801&view=diff
==============================================================================
--- stanbol/trunk/enhancement-engines/entitytagging/pom.xml (original)
+++ stanbol/trunk/enhancement-engines/entitytagging/pom.xml Thu Dec  6 10:43:52 2012
@@ -81,6 +81,12 @@
   <dependencies>
     <dependency>
       <groupId>org.apache.stanbol</groupId>
+      <artifactId>org.apache.stanbol.commons.namespaceprefix.service</artifactId>
+      <version>0.10.0-SNAPSHOT</version>
+    </dependency>
+
+    <dependency>
+      <groupId>org.apache.stanbol</groupId>
       <artifactId>org.apache.stanbol.enhancer.servicesapi</artifactId>
       <version>0.10.0-SNAPSHOT</version>
     </dependency>

Modified: stanbol/trunk/enhancement-engines/entitytagging/src/main/java/org/apache/stanbol/enhancer/engines/entitytagging/impl/NamedEntityTaggingEngine.java
URL: http://svn.apache.org/viewvc/stanbol/trunk/enhancement-engines/entitytagging/src/main/java/org/apache/stanbol/enhancer/engines/entitytagging/impl/NamedEntityTaggingEngine.java?rev=1417801&r1=1417800&r2=1417801&view=diff
==============================================================================
--- stanbol/trunk/enhancement-engines/entitytagging/src/main/java/org/apache/stanbol/enhancer/engines/entitytagging/impl/NamedEntityTaggingEngine.java (original)
+++ stanbol/trunk/enhancement-engines/entitytagging/src/main/java/org/apache/stanbol/enhancer/engines/entitytagging/impl/NamedEntityTaggingEngine.java Thu Dec  6 10:43:52 2012
@@ -45,6 +45,8 @@ import org.apache.felix.scr.annotations.
 import org.apache.felix.scr.annotations.ReferencePolicy;
 import org.apache.felix.scr.annotations.ReferenceStrategy;
 import org.apache.felix.scr.annotations.Service;
+import org.apache.stanbol.commons.namespaceprefix.NamespaceMappingUtils;
+import org.apache.stanbol.commons.namespaceprefix.NamespacePrefixService;
 import org.apache.stanbol.commons.stanboltools.offline.OfflineMode;
 import org.apache.stanbol.enhancer.servicesapi.ContentItem;
 import org.apache.stanbol.enhancer.servicesapi.EngineException;
@@ -59,7 +61,6 @@ import org.apache.stanbol.enhancer.servi
 import org.apache.stanbol.entityhub.model.clerezza.RdfValueFactory;
 import org.apache.stanbol.entityhub.servicesapi.Entityhub;
 import org.apache.stanbol.entityhub.servicesapi.EntityhubException;
-import org.apache.stanbol.entityhub.servicesapi.defaults.NamespaceEnum;
 import org.apache.stanbol.entityhub.servicesapi.model.Entity;
 import org.apache.stanbol.entityhub.servicesapi.model.Representation;
 import org.apache.stanbol.entityhub.servicesapi.model.Text;
@@ -147,6 +148,9 @@ public class NamedEntityTaggingEngine ex
     @Reference
     protected Entityhub entityhub;
 
+    @Reference(cardinality=ReferenceCardinality.OPTIONAL_UNARY)
+    protected NamespacePrefixService nsPrefixService;
+    
     /**
      * This holds the id of the {@link Site} used to lookup Entities or <code>null</code> if the
      * {@link Entityhub} is used.
@@ -270,17 +274,18 @@ public class NamedEntityTaggingEngine ex
         state = config.get(PLACE_STATE);
         placeState = state == null ? true : Boolean.parseBoolean(state.toString());
         Object type = config.get(PERSON_TYPE);
-        personType = type == null || type.toString().isEmpty() ? null : NamespaceEnum.getFullName(type
-                .toString());
+        personType = type == null || type.toString().isEmpty() ? null : 
+            NamespaceMappingUtils.getConfiguredUri(nsPrefixService,PERSON_TYPE, type.toString());
         type = config.get(ORG_TYPE);
-        orgType = type == null || type.toString().isEmpty() ? null : NamespaceEnum.getFullName(type
-                .toString());
+        orgType = type == null || type.toString().isEmpty() ? null : 
+            NamespaceMappingUtils.getConfiguredUri(nsPrefixService,ORG_TYPE,type.toString());
         type = config.get(PLACE_TYPE);
-        placeType = type == null || type.toString().isEmpty() ? null : NamespaceEnum.getFullName(type
-                .toString());
+        placeType = type == null || type.toString().isEmpty() ? null : 
+            NamespaceMappingUtils.getConfiguredUri(nsPrefixService,PLACE_TYPE,type.toString());
         Object nameField = config.get(NAME_FIELD);
-        this.nameField = nameField == null || nameField.toString().isEmpty() ? NamespaceEnum.rdfs + "label"
-                : NamespaceEnum.getFullName(nameField.toString());
+        this.nameField = nameField == null || nameField.toString().isEmpty() ? 
+                "http://www.w3.org/2000/01/rdf-schema#label" : 
+                    NamespaceMappingUtils.getConfiguredUri(nsPrefixService,NAME_FIELD,nameField.toString());
         Object dereferenceEntities = config.get(DEREFERENCE_ENTITIES);
         this.dereferenceEntities = state == null ? true : Boolean
                 .parseBoolean(dereferenceEntities.toString());
@@ -296,6 +301,8 @@ public class NamedEntityTaggingEngine ex
         nameField = null;
     }
 
+
+    
     public void computeEnhancements(ContentItem ci) throws EngineException {
         final Site site;
         if (referencedSiteID != null) { // lookup the referenced site

Modified: stanbol/trunk/enhancement-engines/keywordextraction/pom.xml
URL: http://svn.apache.org/viewvc/stanbol/trunk/enhancement-engines/keywordextraction/pom.xml?rev=1417801&r1=1417800&r2=1417801&view=diff
==============================================================================
--- stanbol/trunk/enhancement-engines/keywordextraction/pom.xml (original)
+++ stanbol/trunk/enhancement-engines/keywordextraction/pom.xml Thu Dec  6 10:43:52 2012
@@ -86,6 +86,12 @@
   <dependencies>
     <dependency>
       <groupId>org.apache.stanbol</groupId>
+      <artifactId>org.apache.stanbol.commons.namespaceprefix.service</artifactId>
+      <version>0.10.0-SNAPSHOT</version>
+    </dependency>
+
+    <dependency>
+      <groupId>org.apache.stanbol</groupId>
       <artifactId>org.apache.stanbol.enhancer.servicesapi</artifactId>
       <version>0.10.0-SNAPSHOT</version>
     </dependency>

Modified: stanbol/trunk/enhancement-engines/keywordextraction/src/main/java/org/apache/stanbol/enhancer/engines/keywordextraction/engine/KeywordLinkingEngine.java
URL: http://svn.apache.org/viewvc/stanbol/trunk/enhancement-engines/keywordextraction/src/main/java/org/apache/stanbol/enhancer/engines/keywordextraction/engine/KeywordLinkingEngine.java?rev=1417801&r1=1417800&r2=1417801&view=diff
==============================================================================
--- stanbol/trunk/enhancement-engines/keywordextraction/src/main/java/org/apache/stanbol/enhancer/engines/keywordextraction/engine/KeywordLinkingEngine.java (original)
+++ stanbol/trunk/enhancement-engines/keywordextraction/src/main/java/org/apache/stanbol/enhancer/engines/keywordextraction/engine/KeywordLinkingEngine.java Thu Dec  6 10:43:52 2012
@@ -16,8 +16,6 @@
 */
 package org.apache.stanbol.enhancer.engines.keywordextraction.engine;
 
-import static org.apache.stanbol.entityhub.servicesapi.defaults.NamespaceEnum.getFullName;
-
 import java.io.IOException;
 import java.net.URI;
 import java.net.URISyntaxException;
@@ -36,7 +34,6 @@ import org.apache.clerezza.rdf.core.Lang
 import org.apache.clerezza.rdf.core.Literal;
 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.PlainLiteralImpl;
 import org.apache.clerezza.rdf.core.impl.TripleImpl;
@@ -51,6 +48,8 @@ import org.apache.felix.scr.annotations.
 import org.apache.felix.scr.annotations.ReferencePolicy;
 import org.apache.felix.scr.annotations.ReferenceStrategy;
 import org.apache.felix.scr.annotations.Service;
+import org.apache.stanbol.commons.namespaceprefix.NamespaceMappingUtils;
+import org.apache.stanbol.commons.namespaceprefix.NamespacePrefixService;
 import org.apache.stanbol.commons.opennlp.OpenNLP;
 import org.apache.stanbol.commons.opennlp.TextAnalyzer;
 import org.apache.stanbol.commons.opennlp.TextAnalyzer.TextAnalyzerConfig;
@@ -79,7 +78,6 @@ import org.apache.stanbol.enhancer.servi
 import org.apache.stanbol.enhancer.servicesapi.rdf.Properties;
 import org.apache.stanbol.entityhub.model.clerezza.RdfValueFactory;
 import org.apache.stanbol.entityhub.servicesapi.Entityhub;
-import org.apache.stanbol.entityhub.servicesapi.defaults.NamespaceEnum;
 import org.apache.stanbol.entityhub.servicesapi.model.Reference;
 import org.apache.stanbol.entityhub.servicesapi.model.Text;
 import org.apache.stanbol.entityhub.servicesapi.model.rdf.RdfResourceEnum;
@@ -100,10 +98,10 @@ import org.slf4j.LoggerFactory;
 @org.apache.felix.scr.annotations.Properties(value={
     @Property(name=EnhancementEngine.PROPERTY_NAME),
     @Property(name=KeywordLinkingEngine.REFERENCED_SITE_ID),
-    @Property(name=KeywordLinkingEngine.NAME_FIELD,value=EntityLinkerConfig.DEFAULT_NAME_FIELD),
+    @Property(name=KeywordLinkingEngine.NAME_FIELD,value="rdfs:label"),
     @Property(name=KeywordLinkingEngine.CASE_SENSITIVE,boolValue=EntityLinkerConfig.DEFAULT_CASE_SENSITIVE_MATCHING_STATE),
-    @Property(name=KeywordLinkingEngine.TYPE_FIELD,value=EntityLinkerConfig.DEFAULT_TYPE_FIELD),
-    @Property(name=KeywordLinkingEngine.REDIRECT_FIELD,value=EntityLinkerConfig.DEFAULT_REDIRECT_FIELD),
+    @Property(name=KeywordLinkingEngine.TYPE_FIELD,value="rdf:type"),
+    @Property(name=KeywordLinkingEngine.REDIRECT_FIELD,value="rdfs:seeAlso"),
     @Property(name=KeywordLinkingEngine.REDIRECT_PROCESSING_MODE,options={
         @PropertyOption(
             value='%'+KeywordLinkingEngine.REDIRECT_PROCESSING_MODE+".option.ignore",
@@ -185,11 +183,11 @@ public class KeywordLinkingEngine 
      * Additional fields added for dereferenced entities
      */
     private static final Collection<String> DEREFERENCE_FIELDS = Arrays.asList(
-        getFullName("rdfs:comment"),
-        getFullName("geo:lat"),
-        getFullName("geo:long"),
-        getFullName("foaf:depiction"),
-        getFullName("dbp-ont:thumbnail"));
+        "http://www.w3.org/2000/01/rdf-schema#comment",
+        "http://www.w3.org/2003/01/geo/wgs84_pos#lat",
+        "http://www.w3.org/2003/01/geo/wgs84_pos#long",
+        "http://xmlns.com/foaf/0.1/depiction",
+        "http://dbpedia.org/ontology/thumbnail");
     /**
      * The dereferenceEntitiesState as set in {@link #activateEntityDereference(Dictionary)}
      */
@@ -219,6 +217,10 @@ public class KeywordLinkingEngine 
      */
     @org.apache.felix.scr.annotations.Reference
     private OpenNLP openNLP;
+    
+    @org.apache.felix.scr.annotations.Reference(cardinality=ReferenceCardinality.OPTIONAL_UNARY)
+    protected NamespacePrefixService nsPrefixService;
+
     //TextAnalyzer was changed to have a scope of a single request ( call to
     //#computeEnhancement!
     //private TextAnalyzer textAnalyser;
@@ -685,7 +687,9 @@ public class KeywordLinkingEngine 
             if(value.toString().isEmpty()){
                 throw new ConfigurationException(NAME_FIELD,"The configured name field MUST NOT be empty");
             }
-            linkerConfig.setNameField(value.toString());
+            
+            linkerConfig.setNameField(NamespaceMappingUtils.getConfiguredUri(
+                nsPrefixService, NAME_FIELD, value.toString()));
         }
         //init case sensitivity
         value = configuration.get(CASE_SENSITIVE);
@@ -700,7 +704,8 @@ public class KeywordLinkingEngine 
             if(value.toString().isEmpty()){
                 throw new ConfigurationException(TYPE_FIELD,"The configured name field MUST NOT be empty");
             }
-            linkerConfig.setTypeField(value.toString());
+            linkerConfig.setTypeField(NamespaceMappingUtils.getConfiguredUri(
+                nsPrefixService, TYPE_FIELD, value.toString()));
         }
         //init REDIRECT_FIELD
         value = configuration.get(REDIRECT_FIELD);
@@ -708,7 +713,8 @@ public class KeywordLinkingEngine 
             if(value.toString().isEmpty()){
                 throw new ConfigurationException(NAME_FIELD,"The configured name field MUST NOT be empty");
             }
-            linkerConfig.setRedirectField(value.toString());
+            linkerConfig.setRedirectField(NamespaceMappingUtils.getConfiguredUri(
+                nsPrefixService, REDIRECT_FIELD, value.toString()));
         }
         //init MAX_SUGGESTIONS
         value = configuration.get(MAX_SUGGESTIONS);
@@ -845,7 +851,8 @@ public class KeywordLinkingEngine 
                         continue configs;
                     }
                     String targetType = config.length < 2 ? sourceTypes[0] : config[1];
-                    targetType = getFullName(targetType.trim()); //support for ns:localName
+                    targetType = NamespaceMappingUtils.getConfiguredUri(
+                        nsPrefixService,TYPE_MAPPINGS,targetType.trim()); //support for ns:localName
                     try { //validate
                         new URI(targetType);
                     } catch (URISyntaxException e) {
@@ -856,7 +863,8 @@ public class KeywordLinkingEngine 
                     UriRef targetUri = new UriRef(targetType);
                     for(String sourceType : sourceTypes){
                         if(!sourceType.isEmpty()){
-                            sourceType = getFullName(sourceType.trim()); //support for ns:localName
+                            sourceType = NamespaceMappingUtils.getConfiguredUri(
+                                nsPrefixService,TYPE_MAPPINGS,sourceType.trim()); //support for ns:localName
                             try { //validate
                                 new URI(sourceType);
                                 UriRef old = linkerConfig.setTypeMapping(sourceType, targetUri);

Modified: stanbol/trunk/enhancement-engines/keywordextraction/src/main/java/org/apache/stanbol/enhancer/engines/keywordextraction/impl/EntityLinkerConfig.java
URL: http://svn.apache.org/viewvc/stanbol/trunk/enhancement-engines/keywordextraction/src/main/java/org/apache/stanbol/enhancer/engines/keywordextraction/impl/EntityLinkerConfig.java?rev=1417801&r1=1417800&r2=1417801&view=diff
==============================================================================
--- stanbol/trunk/enhancement-engines/keywordextraction/src/main/java/org/apache/stanbol/enhancer/engines/keywordextraction/impl/EntityLinkerConfig.java (original)
+++ stanbol/trunk/enhancement-engines/keywordextraction/src/main/java/org/apache/stanbol/enhancer/engines/keywordextraction/impl/EntityLinkerConfig.java Thu Dec  6 10:43:52 2012
@@ -72,15 +72,15 @@ public class EntityLinkerConfig {
     /**
      * Default value for {@link #getNameField()} (rdfs:label)
      */
-    public static final String DEFAULT_NAME_FIELD = "rdfs:label";
+    public static final String DEFAULT_NAME_FIELD = "http://www.w3.org/2000/01/rdf-schema#label";
     /**
      * Default value for {@link #getTypeField()} (rdf:type)
      */
-    public static final String DEFAULT_TYPE_FIELD = "rdf:type";
+    public static final String DEFAULT_TYPE_FIELD = "http://www.w3.org/1999/02/22-rdf-syntax-ns#type";
     /**
      * Default value for {@link #getRedirectField()} (rdf:seeAlso)
      */
-    public static final String DEFAULT_REDIRECT_FIELD = "rdfs:seeAlso";
+    public static final String DEFAULT_REDIRECT_FIELD = "http://www.w3.org/2000/01/rdf-schema#seeAlso";
     /**
      * The default language used to search for labels regardless of the language
      * of the text. The default value is <code>null</code> causing to include
@@ -99,21 +99,27 @@ public class EntityLinkerConfig {
     
     static { //the default mappings for the three types used by the Stanbol Enhancement Structure
         Map<String,UriRef> mappings = new HashMap<String,UriRef>();
-        mappings.put(OntologicalClasses.DBPEDIA_ORGANISATION.getUnicodeString(), OntologicalClasses.DBPEDIA_ORGANISATION);
-        mappings.put(NamespaceEnum.dbpediaOnt+"Newspaper", OntologicalClasses.DBPEDIA_ORGANISATION);
-        mappings.put(NamespaceEnum.schema+"Organization", OntologicalClasses.DBPEDIA_ORGANISATION);
+        mappings.put(OntologicalClasses.DBPEDIA_ORGANISATION.getUnicodeString(), 
+            OntologicalClasses.DBPEDIA_ORGANISATION);
+        mappings.put("http://dbpedia.org/ontology/Newspaper", OntologicalClasses.DBPEDIA_ORGANISATION);
+        mappings.put("http://schema.org/Organization", OntologicalClasses.DBPEDIA_ORGANISATION);
 //        mappings.put(NamespaceEnum.dailymed+"organization",OntologicalClasses.DBPEDIA_ORGANISATION);
         
-        mappings.put(OntologicalClasses.DBPEDIA_PERSON.getUnicodeString(), OntologicalClasses.DBPEDIA_PERSON);
-        mappings.put(NamespaceEnum.foaf+"Person", OntologicalClasses.DBPEDIA_PERSON);
-        mappings.put(NamespaceEnum.schema+"Person", OntologicalClasses.DBPEDIA_PERSON);
+        mappings.put(OntologicalClasses.DBPEDIA_PERSON.getUnicodeString(),
+            OntologicalClasses.DBPEDIA_PERSON);
+        mappings.put("http://xmlns.com/foaf/0.1/Person", OntologicalClasses.DBPEDIA_PERSON);
+        mappings.put("http://schema.org/Person", OntologicalClasses.DBPEDIA_PERSON);
 
-        mappings.put(OntologicalClasses.DBPEDIA_PLACE.getUnicodeString(), OntologicalClasses.DBPEDIA_PLACE);
-        mappings.put(NamespaceEnum.schema+"Place", OntologicalClasses.DBPEDIA_PLACE);
-        mappings.put(NamespaceEnum.gml+"_Feature", OntologicalClasses.DBPEDIA_PLACE);
+        mappings.put(OntologicalClasses.DBPEDIA_PLACE.getUnicodeString(), 
+            OntologicalClasses.DBPEDIA_PLACE);
+        mappings.put("http://schema.org/Place", OntologicalClasses.DBPEDIA_PLACE);
+        mappings.put("http://www.opengis.net/gml/_Feature", OntologicalClasses.DBPEDIA_PLACE);
 
-        mappings.put(OntologicalClasses.SKOS_CONCEPT.getUnicodeString(), OntologicalClasses.SKOS_CONCEPT);
+        mappings.put(OntologicalClasses.SKOS_CONCEPT.getUnicodeString(),
+            OntologicalClasses.SKOS_CONCEPT);
 
+        mappings.put(OntologicalClasses.DBPEDIA_ORGANISATION.getUnicodeString(), 
+            OntologicalClasses.DBPEDIA_ORGANISATION);
 //        UriRef DRUG = new UriRef(NamespaceEnum.drugbank+"drugs");
 //        mappings.put(DRUG.getUnicodeString(), DRUG);
 //        mappings.put(NamespaceEnum.dbpediaOnt+"Drug", DRUG);
@@ -277,14 +283,13 @@ public class EntityLinkerConfig {
         return nameField;
     }
     /**
-     * Setter for the uri of the field used for the names in the taxonomy
-     * (e.g. rdfs:label, skos:prefLabel). 
-     * Converts short to full URIy by using the prefixes as registered in the
+     * Setter for the uri of the field used for the entities in the vocabulary<p>
+     * <b>NOTE</b>: does NOT support the convertion of short to full URIs
      * {@link NamespaceEnum}.
      * @param nameField the nameField to set
      */
     public final void setNameField(String nameField) {
-        this.nameField = NamespaceEnum.getFullName(nameField);
+        this.nameField = nameField;
         updateSelectedFields();
     }
     /**
@@ -314,13 +319,12 @@ public class EntityLinkerConfig {
         return redirectField;
     }
     /**
-     * The field used to follow redirects (typically rdf:seeAlso)
-     * Converts short to full URIy by using the prefixes as registered in the
-     * {@link NamespaceEnum}.
+     * The field used to follow redirects (typically rdf:seeAlso)<p>
+     * <b>NOTE</b>: does NOT support the convertion of short to full URIs
      * @param redirectField the redirectField to set
      */
     public final void setRedirectField(String redirectField) {
-        this.redirectField = NamespaceEnum.getFullName(redirectField);
+        this.redirectField = redirectField;
         updateSelectedFields();
     }
     /**
@@ -331,13 +335,12 @@ public class EntityLinkerConfig {
         return typeField;
     }
     /**
-     * The field used to lookup the types (typically rdf:type)
-     * Converts short to full URIy by using the prefixes as registered in the
-     * {@link NamespaceEnum}.
+     * The field used to lookup the types (typically rdf:type)<p>
+     * <b>NOTE</b>: does NOT support the convertion of short to full URIs
      * @param typeField the typeField to set
      */
     public final void setTypeField(String typeField) {
-        this.typeField = NamespaceEnum.getFullName(typeField);
+        this.typeField = typeField;
         updateSelectedFields();
     }
     /**

Modified: stanbol/trunk/enhancer/jersey/pom.xml
URL: http://svn.apache.org/viewvc/stanbol/trunk/enhancer/jersey/pom.xml?rev=1417801&r1=1417800&r2=1417801&view=diff
==============================================================================
--- stanbol/trunk/enhancer/jersey/pom.xml (original)
+++ stanbol/trunk/enhancer/jersey/pom.xml Thu Dec  6 10:43:52 2012
@@ -130,7 +130,7 @@
     	<groupId>org.apache.stanbol</groupId>
   		<artifactId>org.apache.stanbol.commons.viewable</artifactId>
     </dependency>
-<dependency>
+    <dependency>
       <groupId>com.sun.jersey</groupId>
       <artifactId>jersey-server</artifactId>
     </dependency>

Modified: stanbol/trunk/entityhub/generic/core/pom.xml
URL: http://svn.apache.org/viewvc/stanbol/trunk/entityhub/generic/core/pom.xml?rev=1417801&r1=1417800&r2=1417801&view=diff
==============================================================================
--- stanbol/trunk/entityhub/generic/core/pom.xml (original)
+++ stanbol/trunk/entityhub/generic/core/pom.xml Thu Dec  6 10:43:52 2012
@@ -105,6 +105,11 @@
     </dependency>
     <dependency>
       <groupId>org.apache.stanbol</groupId>
+      <artifactId>org.apache.stanbol.commons.namespaceprefix.service</artifactId>
+      <version>0.10.0-SNAPSHOT</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.stanbol</groupId>
       <artifactId>org.apache.stanbol.commons.stanboltools.offline</artifactId>
       <version>0.9.0-incubating</version>
     </dependency>

Modified: stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/impl/EntityhubImpl.java
URL: http://svn.apache.org/viewvc/stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/impl/EntityhubImpl.java?rev=1417801&r1=1417800&r2=1417801&view=diff
==============================================================================
--- stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/impl/EntityhubImpl.java (original)
+++ stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/impl/EntityhubImpl.java Thu Dec  6 10:43:52 2012
@@ -31,7 +31,9 @@ import org.apache.felix.scr.annotations.
 import org.apache.felix.scr.annotations.ConfigurationPolicy;
 import org.apache.felix.scr.annotations.Deactivate;
 import org.apache.felix.scr.annotations.Reference;
+import org.apache.felix.scr.annotations.ReferenceCardinality;
 import org.apache.felix.scr.annotations.Service;
+import org.apache.stanbol.commons.namespaceprefix.NamespacePrefixService;
 import org.apache.stanbol.entityhub.core.mapping.DefaultFieldMapperImpl;
 import org.apache.stanbol.entityhub.core.mapping.FieldMappingUtils;
 import org.apache.stanbol.entityhub.core.mapping.ValueConverterFactory;
@@ -106,6 +108,9 @@ public final class EntityhubImpl impleme
      */
     @Reference // 1..1, static
     private SiteManager siteManager;
+    
+    @Reference(cardinality=ReferenceCardinality.OPTIONAL_UNARY)
+    private NamespacePrefixService nsPrefixService;
 
     private static final String DEFAULT_MANAGED_ENTITY_PREFIX = "entity";
     private static final String DEFAULT_MAPPING_PREFIX = "mapping";
@@ -171,7 +176,7 @@ public final class EntityhubImpl impleme
         log.info(" ... init FieldMappings");
         fieldMapper = new DefaultFieldMapperImpl(ValueConverterFactory.getDefaultInstance());
         for(String mappingString : config.getFieldMappingConfig()){
-            FieldMapping mapping = FieldMappingUtils.parseFieldMapping(mappingString);
+            FieldMapping mapping = FieldMappingUtils.parseFieldMapping(mappingString,nsPrefixService);
             if(mapping != null){
                 log.info("   + mapping: "+mapping);
                 fieldMapper.addMapping(mapping);

Modified: stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/impl/ReferencedSiteImpl.java
URL: http://svn.apache.org/viewvc/stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/impl/ReferencedSiteImpl.java?rev=1417801&r1=1417800&r2=1417801&view=diff
==============================================================================
--- stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/impl/ReferencedSiteImpl.java (original)
+++ stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/impl/ReferencedSiteImpl.java Thu Dec  6 10:43:52 2012
@@ -54,6 +54,7 @@ import org.apache.felix.scr.annotations.
 import org.apache.felix.scr.annotations.ReferencePolicy;
 import org.apache.felix.scr.annotations.ReferenceStrategy;
 import org.apache.felix.scr.annotations.Service;
+import org.apache.stanbol.commons.namespaceprefix.NamespacePrefixService;
 import org.apache.stanbol.commons.stanboltools.offline.OfflineMode;
 import org.apache.stanbol.entityhub.core.mapping.DefaultFieldMapperImpl;
 import org.apache.stanbol.entityhub.core.mapping.FieldMappingUtils;
@@ -142,86 +143,66 @@ import org.slf4j.LoggerFactory;
  * @author Rupert Westenthaler
  * 
  */
-@Component(name = "org.apache.stanbol.entityhub.site.referencedSite", configurationFactory = true, policy = ConfigurationPolicy.REQUIRE, // the
-// baseUri
-// is
-// required!
-specVersion = "1.1", metatype = true, immediate = true)
+@Component(name = "org.apache.stanbol.entityhub.site.referencedSite",
+    configurationFactory = true,
+    policy = ConfigurationPolicy.REQUIRE, // the baseUri is required!
+    specVersion = "1.1",
+    metatype = true,
+    immediate = true)
 @Service(value = Site.class)
 @Properties(value = {
-                     @Property(name = SiteConfiguration.ID),
-                     @Property(name = SiteConfiguration.NAME),
-                     @Property(name = SiteConfiguration.DESCRIPTION),
-                     @Property(name = SiteConfiguration.ENTITY_PREFIX, cardinality = 1000),
-                     @Property(name = ACCESS_URI),
-                     @Property(name = ENTITY_DEREFERENCER_TYPE, options = {
-                                                                           @PropertyOption(value = '%'
-                                                                                                   + ENTITY_DEREFERENCER_TYPE
-                                                                                                   + ".option.none", name = ""),
-                                                                           @PropertyOption(value = '%'
-                                                                                                   + ENTITY_DEREFERENCER_TYPE
-                                                                                                   + ".option.sparql", name = "org.apache.stanbol.entityhub.dereferencer.SparqlDereferencer"),
-                                                                           @PropertyOption(value = '%'
-                                                                                                   + ReferencedSiteConfiguration.ENTITY_DEREFERENCER_TYPE
-                                                                                                   + ".option.coolUri", name = "org.apache.stanbol.entityhub.dereferencer.CoolUriDereferencer")}, value = "org.apache.stanbol.entityhub.dereferencer.SparqlDereferencer"),
-                     @Property(name = QUERY_URI), // the deri server has better performance
-                     @Property(name = ENTITY_SEARCHER_TYPE, options = {
-                                                                       @PropertyOption(value = '%'
-                                                                                               + ENTITY_SEARCHER_TYPE
-                                                                                               + ".option.none", name = ""),
-                                                                       @PropertyOption(value = '%'
-                                                                                               + ENTITY_SEARCHER_TYPE
-                                                                                               + ".option.sparql", name = "org.apache.stanbol.entityhub.searcher.SparqlSearcher"),
-                                                                       @PropertyOption(value = '%'
-                                                                                               + ENTITY_SEARCHER_TYPE
-                                                                                               + ".option.sparql-virtuoso", name = "org.apache.stanbol.entityhub.searcher.VirtuosoSearcher"),
-                                                                       @PropertyOption(value = '%'
-                                                                                               + ENTITY_SEARCHER_TYPE
-                                                                                               + ".option.sparql-larq", name = "org.apache.stanbol.entityhub.searcher.LarqSearcher")}, value = "org.apache.stanbol.entityhub.searcher.SparqlSearcher"),
-                     @Property(name = DEFAULT_SYMBOL_STATE, options = {
-                                                                       @PropertyOption( // seems, that name
-                                                                                        // and value are
-                                                                                        // exchanged ...
-                                                                       value = '%' + DEFAULT_SYMBOL_STATE
-                                                                               + ".option.proposed", name = "proposed"),
-                                                                       @PropertyOption(value = '%'
-                                                                                               + DEFAULT_SYMBOL_STATE
-                                                                                               + ".option.active", name = "active")
-                     // the other states make no sense for new symbols
-                     }, value = "proposed"),
-                     @Property(name = DEFAULT_MAPPING_STATE, options = {
-                                                                        @PropertyOption(value = '%'
-                                                                                                + DEFAULT_MAPPING_STATE
-                                                                                                + ".option.proposed", name = "proposed"),
-                                                                        @PropertyOption(value = '%'
-                                                                                                + DEFAULT_MAPPING_STATE
-                                                                                                + ".option.confirmed", name = "confirmed")
-                     // the other states make no sense for new symbols
-                     }, value = "proposed"),
-                     @Property(name = DEFAULT_EXPIRE_DURATION, options = {
-                                                                          @PropertyOption(value = '%'
-                                                                                                  + DEFAULT_EXPIRE_DURATION
-                                                                                                  + ".option.oneMonth", name = ""
-                                                                                                                               + (1000L * 60 * 60 * 24 * 30)),
-                                                                          @PropertyOption(value = '%'
-                                                                                                  + DEFAULT_EXPIRE_DURATION
-                                                                                                  + ".option.halfYear", name = ""
-                                                                                                                               + (1000L * 60 * 60 * 24 * 183)),
-                                                                          @PropertyOption(value = '%'
-                                                                                                  + DEFAULT_EXPIRE_DURATION
-                                                                                                  + ".option.oneYear", name = ""
-                                                                                                                              + (1000L * 60 * 60 * 24 * 365)),
-                                                                          @PropertyOption(value = '%'
-                                                                                                  + DEFAULT_EXPIRE_DURATION
-                                                                                                  + ".option.none", name = "0")}, value = "0"),
-                     @Property(name = CACHE_STRATEGY, options = {
-                                                                 @PropertyOption(value = '%' + CACHE_STRATEGY
-                                                                                         + ".option.none", name = "none"),
-                                                                 @PropertyOption(value = '%' + CACHE_STRATEGY
-                                                                                         + ".option.used", name = "used"),
-                                                                 @PropertyOption(value = '%' + CACHE_STRATEGY
-                                                                                         + ".option.all", name = "all")}, value = "none"),
-                     @Property(name = CACHE_ID), @Property(name = SITE_FIELD_MAPPINGS, cardinality = 1000)})
+        @Property(name = SiteConfiguration.ID),
+        @Property(name = SiteConfiguration.NAME),
+        @Property(name = SiteConfiguration.DESCRIPTION),
+        @Property(name = SiteConfiguration.ENTITY_PREFIX, cardinality = 1000),
+        @Property(name = ACCESS_URI),
+        @Property(name = ENTITY_DEREFERENCER_TYPE,
+            options = {
+                    @PropertyOption(value = '%' + ENTITY_DEREFERENCER_TYPE + ".option.none", name = ""),
+                    @PropertyOption(value = '%' + ENTITY_DEREFERENCER_TYPE + ".option.sparql",
+                        name = "org.apache.stanbol.entityhub.dereferencer.SparqlDereferencer"),
+                    @PropertyOption(value = '%' + ReferencedSiteConfiguration.ENTITY_DEREFERENCER_TYPE
+                            + ".option.coolUri",
+                        name = "org.apache.stanbol.entityhub.dereferencer.CoolUriDereferencer")},
+            value = "org.apache.stanbol.entityhub.dereferencer.SparqlDereferencer"),
+        @Property(name = QUERY_URI), // the deri server has better performance
+        @Property(name = ENTITY_SEARCHER_TYPE,
+            options = {
+                    @PropertyOption(value = '%' + ENTITY_SEARCHER_TYPE + ".option.none", name = ""),
+                    @PropertyOption(value = '%' + ENTITY_SEARCHER_TYPE + ".option.sparql",
+                        name = "org.apache.stanbol.entityhub.searcher.SparqlSearcher"),
+                    @PropertyOption(value = '%' + ENTITY_SEARCHER_TYPE + ".option.sparql-virtuoso",
+                        name = "org.apache.stanbol.entityhub.searcher.VirtuosoSearcher"),
+                    @PropertyOption(value = '%' + ENTITY_SEARCHER_TYPE + ".option.sparql-larq",
+                        name = "org.apache.stanbol.entityhub.searcher.LarqSearcher")},
+            value = "org.apache.stanbol.entityhub.searcher.SparqlSearcher"),
+        @Property(name = DEFAULT_SYMBOL_STATE,
+            options = {
+                    @PropertyOption(value = '%' + DEFAULT_SYMBOL_STATE + ".option.proposed",
+                        name = "proposed"),
+                    @PropertyOption(value = '%' + DEFAULT_SYMBOL_STATE + ".option.active", name = "active")},
+            value = "proposed"),
+        @Property(name = DEFAULT_MAPPING_STATE,
+            options = {
+                    @PropertyOption(value = '%' + DEFAULT_MAPPING_STATE + ".option.proposed",
+                        name = "proposed"),
+                    @PropertyOption(value = '%' + DEFAULT_MAPPING_STATE + ".option.confirmed",
+                        name = "confirmed")}, value = "proposed"),
+        @Property(name = DEFAULT_EXPIRE_DURATION,
+            options = {
+                    @PropertyOption(value = '%' + DEFAULT_EXPIRE_DURATION + ".option.oneMonth", name = ""
+                            + (1000L * 60 * 60 * 24 * 30)),
+                    @PropertyOption(value = '%' + DEFAULT_EXPIRE_DURATION + ".option.halfYear", name = ""
+                            + (1000L * 60 * 60 * 24 * 183)),
+                    @PropertyOption(value = '%' + DEFAULT_EXPIRE_DURATION + ".option.oneYear", name = ""
+                            + (1000L * 60 * 60 * 24 * 365)),
+                    @PropertyOption(value = '%' + DEFAULT_EXPIRE_DURATION + ".option.none", name = "0")},
+            value = "0"),
+        @Property(name = CACHE_STRATEGY, options = {
+                @PropertyOption(value = '%' + CACHE_STRATEGY + ".option.none", name = "none"),
+                @PropertyOption(value = '%' + CACHE_STRATEGY + ".option.used", name = "used"),
+                @PropertyOption(value = '%' + CACHE_STRATEGY + ".option.all", name = "all")}, value = "none"),
+        @Property(name = CACHE_ID), @Property(name = SITE_FIELD_MAPPINGS, cardinality = 1000)})
 public class ReferencedSiteImpl implements Site {
     static final int maxInt = Integer.MAX_VALUE;
     private final Logger log;
@@ -260,9 +241,16 @@ public class ReferencedSiteImpl implemen
      * @see #isOfflineMode()
      * @see #ensureOnline(String, Class)
      */
-    @Reference(cardinality = ReferenceCardinality.OPTIONAL_UNARY, policy = ReferencePolicy.DYNAMIC, bind = "enableOfflineMode", unbind = "disableOfflineMode", strategy = ReferenceStrategy.EVENT)
+    @Reference(cardinality = ReferenceCardinality.OPTIONAL_UNARY,
+        policy = ReferencePolicy.DYNAMIC,
+        bind = "enableOfflineMode",
+        unbind = "disableOfflineMode",
+        strategy = ReferenceStrategy.EVENT)
     private OfflineMode offlineMode;
 
+    @Reference(cardinality = ReferenceCardinality.OPTIONAL_UNARY)
+    private NamespacePrefixService nsPrefixService;
+
     public ReferencedSiteImpl() {
         this(LoggerFactory.getLogger(ReferencedSiteImpl.class));
     }
@@ -298,7 +286,7 @@ public class ReferencedSiteImpl implemen
                 } catch (YardException e) {
                     if (siteConfiguration.getEntitySearcherType() == null || isOfflineMode()) {
                         throw new SiteException("Unable to execute query on Cache "
-                                                + siteConfiguration.getCacheId(), e);
+                                + siteConfiguration.getCacheId(), e);
                     } else {
                         log.warn(
                             String.format(
@@ -343,7 +331,7 @@ public class ReferencedSiteImpl implemen
                 entity = getEntity(id);
                 if (entity == null) {
                     log.warn("Unable to create Entity for ID that was selected by an FieldQuery (id=" + id
-                             + ")");
+                            + ")");
                 }
                 entities.add(entity);
                 // use the position in the list as resultSocre
@@ -387,7 +375,7 @@ public class ReferencedSiteImpl implemen
                 } catch (YardException e) {
                     if (siteConfiguration.getEntitySearcherType() == null || isOfflineMode()) {
                         throw new SiteException("Unable to execute query on Cache "
-                                                + siteConfiguration.getCacheId(), e);
+                                + siteConfiguration.getCacheId(), e);
                     } else {
                         log.warn(
                             String.format(
@@ -432,7 +420,7 @@ public class ReferencedSiteImpl implemen
                 } catch (YardException e) {
                     if (siteConfiguration.getEntitySearcherType() == null || isOfflineMode()) {
                         throw new SiteException("Unable to execute query on Cache "
-                                                + siteConfiguration.getCacheId(), e);
+                                + siteConfiguration.getCacheId(), e);
                     } else {
                         log.warn(
                             String.format(
@@ -656,9 +644,8 @@ public class ReferencedSiteImpl implemen
 
     @SuppressWarnings("unchecked")
     @Activate
-    protected void activate(final ComponentContext context) throws ConfigurationException,
-                                                           YardException,
-                                                           InvalidSyntaxException {
+    protected void activate(final ComponentContext context) throws ConfigurationException, YardException,
+            InvalidSyntaxException {
         log.debug("in {} activate with properties {}", ReferencedSiteImpl.class.getSimpleName(),
             context.getProperties());
         if (context == null || context.getProperties() == null) {
@@ -676,7 +663,7 @@ public class ReferencedSiteImpl implemen
                 PROHIBITED_SITE_IDS));
         }
         log.info(" > initialise Referenced Site {}", siteConfiguration.getName());
-        this.siteMetadata = extractSiteMetadata(siteConfiguration,InMemoryValueFactory.getInstance());
+        this.siteMetadata = extractSiteMetadata(siteConfiguration, InMemoryValueFactory.getInstance());
 
         // if the accessUri is the same as the queryUri and both the
         // dereferencer and
@@ -685,20 +672,21 @@ public class ReferencedSiteImpl implemen
         // for both dependencies.
         this.dereferencerEqualsEntitySearcherComponent =
         // (1) accessURI == queryURI
-        siteConfiguration.getAccessUri() != null
-                && siteConfiguration.getAccessUri().equals(siteConfiguration.getQueryUri())
-                &&
-                // (2) entity dereferencer == entity searcher
-                siteConfiguration.getEntityDereferencerType() != null
-                && siteConfiguration.getEntityDereferencerType().equals(
-                    siteConfiguration.getEntitySearcherType());
+                siteConfiguration.getAccessUri() != null
+                        && siteConfiguration.getAccessUri().equals(siteConfiguration.getQueryUri())
+                        &&
+                        // (2) entity dereferencer == entity searcher
+                        siteConfiguration.getEntityDereferencerType() != null
+                        && siteConfiguration.getEntityDereferencerType().equals(
+                            siteConfiguration.getEntitySearcherType());
 
         // init the fieldMapper based on the configuration
         fieldMappings = new DefaultFieldMapperImpl(ValueConverterFactory.getDefaultInstance());
         if (siteConfiguration.getFieldMappings() != null) {
             log.debug(" > Initialise configured field mappings");
             for (String configuredMapping : siteConfiguration.getFieldMappings()) {
-                FieldMapping mapping = FieldMappingUtils.parseFieldMapping(configuredMapping);
+                FieldMapping mapping =
+                        FieldMappingUtils.parseFieldMapping(configuredMapping, nsPrefixService);
                 if (mapping != null) {
                     log.debug("   - add FieldMapping {}", mapping);
                     fieldMappings.addMapping(mapping);
@@ -711,10 +699,12 @@ public class ReferencedSiteImpl implemen
         // If a cache is configured init the ServiceTracker used to manage the
         // Reference to the cache!
         if (siteConfiguration.getCacheId() != null) {
-            String cacheFilter = String.format("(&(%s=%s)(%s=%s))", Constants.OBJECTCLASS,
-                Cache.class.getName(), Cache.CACHE_YARD, siteConfiguration.getCacheId());
-            cacheTracker = new ServiceTracker(context.getBundleContext(), context.getBundleContext()
-                    .createFilter(cacheFilter), null);
+            String cacheFilter =
+                    String.format("(&(%s=%s)(%s=%s))", Constants.OBJECTCLASS, Cache.class.getName(),
+                        Cache.CACHE_YARD, siteConfiguration.getCacheId());
+            cacheTracker =
+                    new ServiceTracker(context.getBundleContext(), context.getBundleContext().createFilter(
+                        cacheFilter), null);
             cacheTracker.open();
         }
     }
@@ -736,51 +726,48 @@ public class ReferencedSiteImpl implemen
     private void initDereferencerAndEntitySearcher() throws InvalidSyntaxException {
         if (siteConfiguration.getAccessUri() != null && // initialise only if a
                                                         // accessUri
-            !siteConfiguration.getAccessUri().isEmpty() && // is configured
-            siteConfiguration.getEntitySearcherType() != null) {
-            String componentNameFilterString = String.format("(%s=%s)", "component.name",
-                siteConfiguration.getEntitySearcherType());
-            String filterString = String.format("(&(%s=%s)%s)", Constants.OBJECTCLASS,
-                ComponentFactory.class.getName(), componentNameFilterString);
-            ServiceReference[] refs = context.getBundleContext().getServiceReferences(
-                ComponentFactory.class.getName(), componentNameFilterString);
+                !siteConfiguration.getAccessUri().isEmpty() && // is configured
+                siteConfiguration.getEntitySearcherType() != null) {
+            String componentNameFilterString =
+                    String.format("(%s=%s)", "component.name", siteConfiguration.getEntitySearcherType());
+            String filterString =
+                    String.format("(&(%s=%s)%s)", Constants.OBJECTCLASS, ComponentFactory.class.getName(),
+                        componentNameFilterString);
+            ServiceReference[] refs =
+                    context.getBundleContext().getServiceReferences(ComponentFactory.class.getName(),
+                        componentNameFilterString);
             if (refs != null && refs.length > 0) {
                 createEntitySearcherComponent((ComponentFactory) context.getBundleContext().getService(
                     refs[0]));
             } else { // service factory not yet available -> add servicelistener
-                this.searcherComponentFactoryListener = new ComponentFactoryListener(
-                        context.getBundleContext());
+                this.searcherComponentFactoryListener =
+                        new ComponentFactoryListener(context.getBundleContext());
+                // NOTE: here the filter MUST include also the objectClass!
                 context.getBundleContext().addServiceListener(this.searcherComponentFactoryListener,
-                    filterString); // NOTE:
-                                   // here
-                                   // the
-                                   // filter
-                                   // MUST
-                                   // include
-                                   // also
-                                   // the
-                                   // objectClass!
+                    filterString);
             }
             // context.getComponentInstance().dispose();
             // throw an exception to avoid an successful activation
         }
         if (siteConfiguration.getQueryUri() != null
-            && // initialise only if a query URI
-            !siteConfiguration.getQueryUri().isEmpty()
-            && // is configured
-            siteConfiguration.getEntityDereferencerType() != null
-            && !this.dereferencerEqualsEntitySearcherComponent) {
-            String componentNameFilterString = String.format("(%s=%s)", "component.name",
-                siteConfiguration.getEntityDereferencerType());
-            String filterString = String.format("(&(%s=%s)%s)", Constants.OBJECTCLASS,
-                ComponentFactory.class.getName(), componentNameFilterString);
-            ServiceReference[] refs = context.getBundleContext().getServiceReferences(
-                ComponentFactory.class.getName(), componentNameFilterString);
+                && // initialise only if a query URI
+                !siteConfiguration.getQueryUri().isEmpty()
+                && // is configured
+                siteConfiguration.getEntityDereferencerType() != null
+                && !this.dereferencerEqualsEntitySearcherComponent) {
+            String componentNameFilterString =
+                    String.format("(%s=%s)", "component.name", siteConfiguration.getEntityDereferencerType());
+            String filterString =
+                    String.format("(&(%s=%s)%s)", Constants.OBJECTCLASS, ComponentFactory.class.getName(),
+                        componentNameFilterString);
+            ServiceReference[] refs =
+                    context.getBundleContext().getServiceReferences(ComponentFactory.class.getName(),
+                        componentNameFilterString);
             if (refs != null && refs.length > 0) {
                 createDereferencerComponent((ComponentFactory) context.getBundleContext().getService(refs[0]));
             } else { // service factory not yet available -> add servicelistener
-                this.dereferencerComponentFactoryListener = new ComponentFactoryListener(
-                        context.getBundleContext());
+                this.dereferencerComponentFactoryListener =
+                        new ComponentFactoryListener(context.getBundleContext());
                 this.context.getBundleContext().addServiceListener(this.dereferencerComponentFactoryListener,
                     filterString); // NOTE: here the filter MUST
                                    // include also the objectClass!
@@ -806,8 +793,8 @@ public class ReferencedSiteImpl implemen
         // multiple component instances because of concurrent calls
         synchronized (this.searcherAndDereferencerLock) {
             if (entitySearcherComponentInstance == null) {
-                this.entitySearcherComponentInstance = factory.newInstance(OsgiUtils.copyConfig(context
-                        .getProperties()));
+                this.entitySearcherComponentInstance =
+                        factory.newInstance(OsgiUtils.copyConfig(context.getProperties()));
                 this.entitySearcher = (EntitySearcher) entitySearcherComponentInstance.getInstance();
             }
             if (dereferencerEqualsEntitySearcherComponent) {
@@ -829,8 +816,8 @@ public class ReferencedSiteImpl implemen
         // multiple component instances because of concurrent calls
         synchronized (this.searcherAndDereferencerLock) {
             if (dereferencerComponentInstance == null) {
-                dereferencerComponentInstance = factory.newInstance(OsgiUtils.copyConfig(context
-                        .getProperties()));
+                dereferencerComponentInstance =
+                        factory.newInstance(OsgiUtils.copyConfig(context.getProperties()));
                 this.dereferencer = (EntityDereferencer) dereferencerComponentInstance.getInstance();
             }
         }
@@ -860,14 +847,14 @@ public class ReferencedSiteImpl implemen
             if (event.getType() == ServiceEvent.REGISTERED) {
                 log.info("Process ServiceEvent for ComponentFactory {} and State REGISTERED",
                     eventComponentName);
-                ComponentFactory factory = (ComponentFactory) bundleContext.getService(event
-                        .getServiceReference());
+                ComponentFactory factory =
+                        (ComponentFactory) bundleContext.getService(event.getServiceReference());
                 if (siteConfiguration.getEntityDereferencerType() != null
-                    && siteConfiguration.getEntityDereferencerType().equals(eventComponentName)) {
+                        && siteConfiguration.getEntityDereferencerType().equals(eventComponentName)) {
                     createDereferencerComponent(factory);
                 }
                 if (siteConfiguration.getEntitySearcherType() != null
-                    && siteConfiguration.getEntitySearcherType().equals(eventComponentName)) {
+                        && siteConfiguration.getEntitySearcherType().equals(eventComponentName)) {
                     createEntitySearcherComponent(factory);
                 }
             } else {

Modified: stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/mapping/FieldMappingUtils.java
URL: http://svn.apache.org/viewvc/stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/mapping/FieldMappingUtils.java?rev=1417801&r1=1417800&r2=1417801&view=diff
==============================================================================
--- stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/mapping/FieldMappingUtils.java (original)
+++ stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/mapping/FieldMappingUtils.java Thu Dec  6 10:43:52 2012
@@ -25,6 +25,8 @@ import java.util.Iterator;
 import java.util.List;
 import java.util.Set;
 
+import org.apache.stanbol.commons.namespaceprefix.NamespaceMappingUtils;
+import org.apache.stanbol.commons.namespaceprefix.NamespacePrefixService;
 import org.apache.stanbol.entityhub.servicesapi.defaults.DataTypeEnum;
 import org.apache.stanbol.entityhub.servicesapi.defaults.NamespaceEnum;
 import org.apache.stanbol.entityhub.servicesapi.mapping.FieldMapper;
@@ -124,10 +126,12 @@ public final class FieldMappingUtils {
      * </ul>
      * TODO: Add Support for {@link Constraint}s on the field values.
      * @param mapping The mapping
+     * @param nps Optionally a namespace prefix service used to convert 
+     * '{prefix}:{localname}' configurations to full URIs
      * @return the parsed {@link FieldMapping} or <code>null</code> if the parsed
      *    String can not be parsed.
      */
-    public static FieldMapping parseFieldMapping(String mapping){
+    public static FieldMapping parseFieldMapping(String mapping, NamespacePrefixService nps){
         if(mapping == null){
             return null;
         }
@@ -153,7 +157,7 @@ public final class FieldMappingUtils {
         List<String> mappedTo = Collections.emptyList();
         String fieldPattern;
         if(!parts[0].isEmpty() && !parts[0].equals("*")){
-            fieldPattern = NamespaceEnum.getFullName(parts[0]);
+            fieldPattern = NamespaceMappingUtils.getConfiguredUri(nps,parts[0]);
         } else {
             fieldPattern = parts[0];
         }
@@ -163,7 +167,7 @@ public final class FieldMappingUtils {
                 filter = parseConstraint(parts[i+1]);
             }
             if(">".equals(parts[i]) && parts.length > i+1){
-                mappedTo = parseMappings(parts,i+1);
+                mappedTo = parseMappings(parts,i+1,nps);
             }
         }
         if(ignore && filter != null){
@@ -178,12 +182,13 @@ public final class FieldMappingUtils {
             return null;
         }
     }
+
     /**
      * Parses FieldMappings from the parsed strings
      * @param mappings the mappings to parse
      * @return the parsed mappings
      */
-    public static List<FieldMapping> parseFieldMappings(Iterator<String> mappings) {
+    public static List<FieldMapping> parseFieldMappings(Iterator<String> mappings, NamespacePrefixService nps) {
         List<FieldMapping> fieldMappings = new ArrayList<FieldMapping>();
         log.debug("Parse FieldMappings");
         while(mappings.hasNext()){
@@ -192,7 +197,7 @@ public final class FieldMappingUtils {
             if(mappingString != null && 
                     !mappingString.isEmpty() && //not an empty line
                     !(mappingString.charAt(0) == FieldMapping.COMMENT_CHAR)){ //not an comment
-                FieldMapping fieldMapping = FieldMappingUtils.parseFieldMapping(mappingString.toString());
+                FieldMapping fieldMapping = FieldMappingUtils.parseFieldMapping(mappingString.toString(),nps);
                 if(fieldMapping != null){
                     fieldMappings.add(fieldMapping);
                 } else {
@@ -210,10 +215,10 @@ public final class FieldMappingUtils {
      * @param mappings The mappings or <code>null</code> if none
      * @return A new and configured FieldMapper instance.
      */
-    public static FieldMapper createDefaultFieldMapper(Iterator<String> mappings){
+    public static FieldMapper createDefaultFieldMapper(Iterator<String> mappings, NamespacePrefixService nps){
         FieldMapper mapper =  new DefaultFieldMapperImpl(ValueConverterFactory.getDefaultInstance());
         if(mappings != null){
-            for(FieldMapping mapping : parseFieldMappings(mappings)){
+            for(FieldMapping mapping : parseFieldMappings(mappings,nps)){
                 mapper.addMapping(mapping);
             }
         }
@@ -236,26 +241,11 @@ public final class FieldMappingUtils {
         return mapper;
     }
 
-//moved to NamespaceEnum
-//    private static String getFullUri(String value){
-//        int index = value.indexOf(':');
-//        if(index>0){
-//            NamespaceEnum namespace = NamespaceEnum.forPrefix(value.substring(0, index));
-//            if(namespace!= null){
-//                value = namespace.getNamespace()+value.substring(index+1);
-//            }
-//        }
-//        return value;
-//    }
-
-    private static List<String> parseMappings(String[] parts, int start) {
+    private static List<String> parseMappings(String[] parts, int start, NamespacePrefixService nps) {
         ArrayList<String> mappings = new ArrayList<String>(parts.length-start);
         for(int i=start;i<parts.length;i++){
             if(!parts[i].isEmpty()){ //needed to remove two spaces in a row
-                String act = NamespaceEnum.getFullName(parts[i]);
-//                if(!act.isEmpty()){ 
-                    mappings.add(act);
- //               }
+                mappings.add(NamespaceMappingUtils.getConfiguredUri(nps, parts[i]));
             }
         }
         return mappings;

Modified: stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/site/CacheImpl.java
URL: http://svn.apache.org/viewvc/stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/site/CacheImpl.java?rev=1417801&r1=1417800&r2=1417801&view=diff
==============================================================================
--- stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/site/CacheImpl.java (original)
+++ stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/site/CacheImpl.java Thu Dec  6 10:43:52 2012
@@ -23,7 +23,10 @@ import org.apache.felix.scr.annotations.
 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.ReferenceCardinality;
 import org.apache.felix.scr.annotations.Service;
+import org.apache.stanbol.commons.namespaceprefix.NamespacePrefixService;
 import org.apache.stanbol.entityhub.core.mapping.DefaultFieldMapperImpl;
 import org.apache.stanbol.entityhub.core.mapping.FieldMappingUtils;
 import org.apache.stanbol.entityhub.core.mapping.ValueConverterFactory;
@@ -89,6 +92,9 @@ public class CacheImpl implements Cache 
     private FieldMapper baseMapper;
     private FieldMapper additionalMapper;
     private ComponentContext context;
+    
+    @Reference(cardinality=ReferenceCardinality.OPTIONAL_UNARY)
+    NamespacePrefixService nsPrefixService;
 
     @Activate
     protected void activate(ComponentContext context) throws ConfigurationException, YardException, IllegalStateException, InvalidSyntaxException {
@@ -111,7 +117,7 @@ public class CacheImpl implements Cache 
      */
     protected void initWithCacheYard(Yard yard) throws YardException {
         //(1) Read the base mappings from the Yard
-        this.baseMapper = CacheUtils.loadBaseMappings(yard);
+        this.baseMapper = CacheUtils.loadBaseMappings(yard,nsPrefixService);
 
         //(2) Init the additional mappings based on the configuration
         Object mappings = context.getProperties().get(Cache.ADDITIONAL_MAPPINGS);
@@ -119,7 +125,7 @@ public class CacheImpl implements Cache 
         if (mappings instanceof String[] && ((String[]) mappings).length > 0) {
             configuredMappings = new DefaultFieldMapperImpl(ValueConverterFactory.getDefaultInstance());
             for (String mappingString : (String[]) mappings) {
-                FieldMapping fieldMapping = FieldMappingUtils.parseFieldMapping(mappingString);
+                FieldMapping fieldMapping = FieldMappingUtils.parseFieldMapping(mappingString, nsPrefixService);
                 if (fieldMapping != null) {
                     configuredMappings.addMapping(fieldMapping);
                 }
@@ -129,7 +135,7 @@ public class CacheImpl implements Cache 
                 configuredMappings = null; //if no mappings where found set to null
             }
         }
-        FieldMapper yardAdditionalMappings = CacheUtils.loadAdditionalMappings(yard);
+        FieldMapper yardAdditionalMappings = CacheUtils.loadAdditionalMappings(yard,nsPrefixService);
         if (yardAdditionalMappings == null) {
             if (configuredMappings != null) {
                 setAdditionalMappings(yard, configuredMappings);

Modified: stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/site/CacheUtils.java
URL: http://svn.apache.org/viewvc/stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/site/CacheUtils.java?rev=1417801&r1=1417800&r2=1417801&view=diff
==============================================================================
--- stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/site/CacheUtils.java (original)
+++ stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/site/CacheUtils.java Thu Dec  6 10:43:52 2012
@@ -16,6 +16,7 @@
  */
 package org.apache.stanbol.entityhub.core.site;
 
+import org.apache.stanbol.commons.namespaceprefix.NamespacePrefixService;
 import org.apache.stanbol.entityhub.core.mapping.DefaultFieldMapperImpl;
 import org.apache.stanbol.entityhub.core.mapping.FieldMappingUtils;
 import org.apache.stanbol.entityhub.core.mapping.ValueConverterFactory;
@@ -40,6 +41,7 @@ public final class CacheUtils {
     /**
      * Loads the base mappings form the parsed Yard
      * @param yard The yard
+     * @param nsPrefixService if present '{prefix}:{localname}' configurations are
      * @return The baseMappings
      * @throws YardException on any Error while getting the Representation holding
      * the Configuration from the Yard.
@@ -47,13 +49,13 @@ public final class CacheUtils {
      * valid.
      * @throws IllegalArgumentException if <code>null</code> is parsed as {@link Yard}
      */
-    public static FieldMapper loadBaseMappings(Yard yard) throws YardException,CacheInitialisationException{
+    public static FieldMapper loadBaseMappings(Yard yard, NamespacePrefixService nsPrefixService) throws YardException,CacheInitialisationException{
         if(yard == null){
             throw new IllegalArgumentException("The parsed Yard MUST NOT be NULL!");
         }
         Representation baseConfig = yard.getRepresentation(Cache.BASE_CONFIGURATION_URI);
         if(baseConfig != null){
-            FieldMapper mapper = readFieldConfig(yard,baseConfig);
+            FieldMapper mapper = readFieldConfig(yard,baseConfig, nsPrefixService);
             if(mapper == null){
                 String msg = "Invalid Base Configuration: Unable to parse FieldMappings from Field "+Cache.FIELD_MAPPING_CONFIG_FIELD;
                 log.error(msg);
@@ -73,18 +75,19 @@ public final class CacheUtils {
      * Loads the additional field mappings used by this cache from the yard.
      * This method sets the {@link #baseMapper} field during initialisation.
      * @param yard The yard
+     * @param nsPrefixService if present '{prefix}:{localname}' configurations are
      * @return The parsed mappings or <code>null</code> if no found
      * @throws YardException on any Error while reading the {@link Representation}
      * holding the configuration from the {@link Yard}.
      * @throws IllegalArgumentException if <code>null</code> is parsed as {@link Yard}.
      */
-    protected static FieldMapper loadAdditionalMappings(Yard yard) throws YardException {
+    protected static FieldMapper loadAdditionalMappings(Yard yard, NamespacePrefixService nsPrefixService) throws YardException {
         if(yard == null){
             throw new IllegalArgumentException("The parsed Yard MUST NOT be NULL!");
         }
         Representation addConfig = yard.getRepresentation(Cache.ADDITIONAL_CONFIGURATION_URI);
         if(addConfig != null){
-            FieldMapper mapper = readFieldConfig(yard,addConfig);
+            FieldMapper mapper = readFieldConfig(yard,addConfig, nsPrefixService);
             if(mapper == null){
                 log.warn("Invalid Additinal Configuration: Unable to parse FieldMappings from Field "+Cache.FIELD_MAPPING_CONFIG_FIELD+"-> return NULL (no additional Configuration)");
                 if(log.isWarnEnabled()){
@@ -100,15 +103,17 @@ public final class CacheUtils {
      * Reads the field mapping config from an document
      * @param yard the yard of the parsed Representation
      * @param config the configuration MUST NOT be <code>null</code>
+     * @param nsPrefixService if present '{prefix}:{localname}' configurations are
+     * supported for the fieldmappings used by the cache. 
      * @return A field mapper configured based on the configuration in the parsed {@link Representation}
      * @throws if the parsed {@link Representation} does not contain a value for {@value CacheConstants.FIELD_MAPPING_CONFIG_FIELD}.
      */
-    private static FieldMapper readFieldConfig(Yard yard,Representation config) {
+    private static FieldMapper readFieldConfig(Yard yard,Representation config, NamespacePrefixService nsPrefixService) {
         Object mappingValue = config.getFirst(Cache.FIELD_MAPPING_CONFIG_FIELD);
         if(mappingValue != null){
             DefaultFieldMapperImpl fieldMapper = new DefaultFieldMapperImpl(ValueConverterFactory.getDefaultInstance());
             for(String mappingStirng : mappingValue.toString().split("\n")){
-                FieldMapping mapping = FieldMappingUtils.parseFieldMapping(mappingStirng);
+                FieldMapping mapping = FieldMappingUtils.parseFieldMapping(mappingStirng, nsPrefixService);
                 if(mapping != null){
                     log.info("  > add Mapping: "+mappingStirng);
                     fieldMapper.addMapping(mapping);

Modified: stanbol/trunk/entityhub/generic/servicesapi/src/main/java/org/apache/stanbol/entityhub/servicesapi/defaults/NamespaceEnum.java
URL: http://svn.apache.org/viewvc/stanbol/trunk/entityhub/generic/servicesapi/src/main/java/org/apache/stanbol/entityhub/servicesapi/defaults/NamespaceEnum.java?rev=1417801&r1=1417800&r2=1417801&view=diff
==============================================================================
--- stanbol/trunk/entityhub/generic/servicesapi/src/main/java/org/apache/stanbol/entityhub/servicesapi/defaults/NamespaceEnum.java (original)
+++ stanbol/trunk/entityhub/generic/servicesapi/src/main/java/org/apache/stanbol/entityhub/servicesapi/defaults/NamespaceEnum.java Thu Dec  6 10:43:52 2012
@@ -57,46 +57,29 @@ public enum NamespaceEnum {
 
     //First the XML Namespaces
     /**
-    * @deprecated All none core namespaces where deprecated. Users should use
-    * the NamespacePrefixService (module:
-    * org.apache.stanbol.commons.namespaceprefixservice) instead (see also
-    * <a href="https://issues.apache.org/jira/browse/STANBOL-824">STANBOL-824)</a>
-    */
+     * The XSD namespace as used by the datatypes of XML and RDF literals 
+     */
     xsd("http://www.w3.org/2001/XMLSchema#"),
     /**
-    * @deprecated All none core namespaces where deprecated. Users should use
-    * the NamespacePrefixService (module:
-    * org.apache.stanbol.commons.namespaceprefixservice) instead (see also
-    * <a href="https://issues.apache.org/jira/browse/STANBOL-824">STANBOL-824)</a>
-    */
+     * The XSI namespace
+     */
     xsi("http://www.w3.org/2001/XMLSchema-instance#"),
     /**
-    * @deprecated All none core namespaces where deprecated. Users should use
-    * the NamespacePrefixService (module:
-    * org.apache.stanbol.commons.namespaceprefixservice) instead (see also
-    * <a href="https://issues.apache.org/jira/browse/STANBOL-824">STANBOL-824)</a>
-    */
+     * The XML namespace as used by the language attribute of XML and the language
+     * for RDF literals
+     */
     xml("http://www.w3.org/XML/1998/namespace#"),
     //Start with the semantic Web Namespaces
     /**
-    * @deprecated All none core namespaces where deprecated. Users should use
-    * the NamespacePrefixService (module:
-    * org.apache.stanbol.commons.namespaceprefixservice) instead (see also
-    * <a href="https://issues.apache.org/jira/browse/STANBOL-824">STANBOL-824)</a>
+    * The RDF namespace (rdf:type)
     */
     rdf("http://www.w3.org/1999/02/22-rdf-syntax-ns#"),
     /**
-    * @deprecated All none core namespaces where deprecated. Users should use
-    * the NamespacePrefixService (module:
-    * org.apache.stanbol.commons.namespaceprefixservice) instead (see also
-    * <a href="https://issues.apache.org/jira/browse/STANBOL-824">STANBOL-824)</a>
+    * The RDFS namespace (rdfs:label, rdfs:comment, rdfs:seeAlso)
     */
     rdfs("http://www.w3.org/2000/01/rdf-schema#"),
     /**
-    * @deprecated All none core namespaces where deprecated. Users should use
-    * the NamespacePrefixService (module:
-    * org.apache.stanbol.commons.namespaceprefixservice) instead (see also
-    * <a href="https://issues.apache.org/jira/browse/STANBOL-824">STANBOL-824)</a>
+    * The OWL namespace (owl:sameAs)
     */
     owl("http://www.w3.org/2002/07/owl#"),
     //CMIS related
@@ -180,17 +163,13 @@ public enum NamespaceEnum {
     */
     dcElements("dc-elements","http://purl.org/dc/elements/1.1/"),
     /**
-    * @deprecated All none core namespaces where deprecated. Users should use
-    * the NamespacePrefixService (module:
-    * org.apache.stanbol.commons.namespaceprefixservice) instead (see also
-    * <a href="https://issues.apache.org/jira/browse/STANBOL-824">STANBOL-824)</a>
+    * The DC terms ontology as used by the Entityhub to manage metadata such as
+    * creator, creation/modification dates as well as linking to the license
     */
     dcTerms("dc","http://purl.org/dc/terms/"), // Entityhub prefers DC-Terms, therefore use the "dc" prefix for the terms name space
     /**
-    * @deprecated All none core namespaces where deprecated. Users should use
-    * the NamespacePrefixService (module:
-    * org.apache.stanbol.commons.namespaceprefixservice) instead (see also
-    * <a href="https://issues.apache.org/jira/browse/STANBOL-824">STANBOL-824)</a>
+    * FOAF ontology used as type for the resource providing metadata about an
+    * Entity (foaf:Document)
     */
     foaf("http://xmlns.com/foaf/0.1/"),
     /**
@@ -208,10 +187,7 @@ public enum NamespaceEnum {
     */
     vCard("http://www.w3.org/2001/vcard-rdf/3.0#"),
     /**
-    * @deprecated All none core namespaces where deprecated. Users should use
-    * the NamespacePrefixService (module:
-    * org.apache.stanbol.commons.namespaceprefixservice) instead (see also
-    * <a href="https://issues.apache.org/jira/browse/STANBOL-824">STANBOL-824)</a>
+    * The SKOS namespace (skos:Concept)
     */
     skos("http://www.w3.org/2004/02/skos/core#"),
     /**
@@ -258,10 +234,7 @@ public enum NamespaceEnum {
     swrc("http://swrc.ontoware.org/ontology#"), //The Semantic Web for Research Communities Ontology
     //Linked Data Ontologies
     /**
-    * @deprecated All none core namespaces where deprecated. Users should use
-    * the NamespacePrefixService (module:
-    * org.apache.stanbol.commons.namespaceprefixservice) instead (see also
-    * <a href="https://issues.apache.org/jira/browse/STANBOL-824">STANBOL-824)</a>
+    * THe DBpedia.org ontology (dbp-ont:Person, dbp-ont:Organisation, dbp-ont:Place, ...)
     */
     dbpediaOnt("dbp-ont","http://dbpedia.org/ontology/"),
     /**
@@ -280,10 +253,7 @@ public enum NamespaceEnum {
     geonames("http://www.geonames.org/ontology#"),
     //copyright and license
     /**
-    * @deprecated All none core namespaces where deprecated. Users should use
-    * the NamespacePrefixService (module:
-    * org.apache.stanbol.commons.namespaceprefixservice) instead (see also
-    * <a href="https://issues.apache.org/jira/browse/STANBOL-824">STANBOL-824)</a>
+    * Creative Commons as used by the Entityhub for license and attribution information
     */
     cc("http://creativecommons.org/ns#"),
     //Schema.org (see http://schema.org/docs/schemaorg.owl for the Ontology)

Modified: stanbol/trunk/entityhub/generic/servicesapi/src/main/java/org/apache/stanbol/entityhub/servicesapi/model/rdf/RdfResourceEnum.java
URL: http://svn.apache.org/viewvc/stanbol/trunk/entityhub/generic/servicesapi/src/main/java/org/apache/stanbol/entityhub/servicesapi/model/rdf/RdfResourceEnum.java?rev=1417801&r1=1417800&r2=1417801&view=diff
==============================================================================
--- stanbol/trunk/entityhub/generic/servicesapi/src/main/java/org/apache/stanbol/entityhub/servicesapi/model/rdf/RdfResourceEnum.java (original)
+++ stanbol/trunk/entityhub/generic/servicesapi/src/main/java/org/apache/stanbol/entityhub/servicesapi/model/rdf/RdfResourceEnum.java Thu Dec  6 10:43:52 2012
@@ -17,11 +17,6 @@
 package org.apache.stanbol.entityhub.servicesapi.model.rdf;
 
 import org.apache.stanbol.entityhub.servicesapi.defaults.NamespaceEnum;
-import org.apache.stanbol.entityhub.servicesapi.defaults.SpecialFieldEnum;
-import org.apache.stanbol.entityhub.servicesapi.model.Entity;
-import org.apache.stanbol.entityhub.servicesapi.model.Reference;
-import org.apache.stanbol.entityhub.servicesapi.query.FieldQuery;
-import org.apache.stanbol.entityhub.servicesapi.yard.Yard;
 
 public enum RdfResourceEnum {
     /**

Modified: stanbol/trunk/entityhub/indexing/core/pom.xml
URL: http://svn.apache.org/viewvc/stanbol/trunk/entityhub/indexing/core/pom.xml?rev=1417801&r1=1417800&r2=1417801&view=diff
==============================================================================
--- stanbol/trunk/entityhub/indexing/core/pom.xml (original)
+++ stanbol/trunk/entityhub/indexing/core/pom.xml Thu Dec  6 10:43:52 2012
@@ -92,6 +92,13 @@
   </build>
   
   <dependencies>
+  
+    <dependency>
+      <groupId>org.apache.stanbol</groupId>
+      <artifactId>org.apache.stanbol.commons.namespaceprefix.service</artifactId>
+      <version>0.10.0-SNAPSHOT</version>
+    </dependency>
+  
     <dependency>
       <groupId>org.apache.stanbol</groupId>
       <artifactId>org.apache.stanbol.entityhub.core</artifactId>
@@ -141,5 +148,12 @@
       <artifactId>slf4j-simple</artifactId>
       <scope>test</scope>
     </dependency>
+    <!-- namespace prefixes mappings are used in the unit tests-->
+    <dependency> <!-- provides the default Stanbol mappings -->
+     <groupId>org.apache.stanbol</groupId>
+     <artifactId>org.apache.stanbol.commons.namespaceprefix.provider.stanbol</artifactId>
+      <version>0.10.0-SNAPSHOT</version>
+      <scope>test</scope>
+    </dependency>    
   </dependencies>
 </project>

Modified: stanbol/trunk/entityhub/indexing/core/src/main/java/org/apache/stanbol/entityhub/indexing/core/config/IndexingConfig.java
URL: http://svn.apache.org/viewvc/stanbol/trunk/entityhub/indexing/core/src/main/java/org/apache/stanbol/entityhub/indexing/core/config/IndexingConfig.java?rev=1417801&r1=1417800&r2=1417801&view=diff
==============================================================================
--- stanbol/trunk/entityhub/indexing/core/src/main/java/org/apache/stanbol/entityhub/indexing/core/config/IndexingConfig.java (original)
+++ stanbol/trunk/entityhub/indexing/core/src/main/java/org/apache/stanbol/entityhub/indexing/core/config/IndexingConfig.java Thu Dec  6 10:43:52 2012
@@ -37,6 +37,7 @@ import java.io.UnsupportedEncodingExcept
 import java.net.URL;
 import java.net.URLDecoder;
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.Enumeration;
@@ -52,6 +53,8 @@ import org.apache.commons.io.FileUtils;
 import org.apache.commons.io.FilenameUtils;
 import org.apache.commons.io.IOUtils;
 import org.apache.commons.io.LineIterator;
+import org.apache.stanbol.commons.namespaceprefix.NamespacePrefixService;
+import org.apache.stanbol.commons.namespaceprefix.service.StanbolNamespacePrefixService;
 import org.apache.stanbol.entityhub.core.mapping.FieldMappingUtils;
 import org.apache.stanbol.entityhub.indexing.core.EntityDataIterable;
 import org.apache.stanbol.entityhub.indexing.core.EntityDataProvider;
@@ -217,6 +220,8 @@ public class IndexingConfig {
      */
     private String classpathResourceOffset;
     
+    private NamespacePrefixService namespacePrefixService;
+    
     /**
      * Creates an instance using {@link #DEFAULT_ROOT_PATH} (relative to the
      * working directory) as {@link #getIndexingFolder()} for the indexing
@@ -305,6 +310,13 @@ public class IndexingConfig {
         //set up the root folder for the classpath
         this.classPathRootDir = getConfigClasspathRootFolder();
         log.info("Classpath Indexing Root {}",classPathRootDir);
+        //read the prefixnamespace mappings
+        try {
+            initNamespacePrefixMapper();
+        } catch (IOException e) {
+            throw new IllegalStateException("Unable to get create NamespacePrefixMapper",e);
+        }
+        
         //check the main configuration
         this.configuration = loadConfig(INDEXING_PROERTIES,true);
         Object value = configuration.get(KEY_NAME);
@@ -321,6 +333,7 @@ public class IndexingConfig {
         if(value == null || value.toString().isEmpty()){
             value = DEFAULT_INDEX_FIELD_CONFIG_FILE_NAME;
         }
+        
         final File indexFieldConfig = getConfigFile(value.toString());
         if(indexFieldConfig.isFile()){
             try {
@@ -338,7 +351,7 @@ public class IndexingConfig {
                     public void remove() {
                         it.remove();
                     }
-                });
+                },getNamespacePrefixService());
             } catch (IOException e) {
                throw new IllegalStateException("Unable to read Index Field Configuration form '"
                    +indexFieldConfig+"'!",e);
@@ -350,6 +363,26 @@ public class IndexingConfig {
             		"' in the '"+INDEXING_PROERTIES+"' to configure a different one!");
         }
     }
+    
+    public NamespacePrefixService getNamespacePrefixService() {
+        return namespacePrefixService;
+    }
+    /**
+     * @param configDir
+     * @throws IOException
+     */
+    private void initNamespacePrefixMapper() throws IOException {
+        File nsPrefixMappings = new File(getConfigFolder(),"namespaceprefix.mappings");
+        if(!nsPrefixMappings.isFile()){
+            FileUtils.writeLines(nsPrefixMappings,"UTF-8",Arrays.asList(
+                "# Syntax: '{prefix}\\t{namespace}\\n",
+                "# where:",
+                "#   {prefix} ... [0..9A..Za..z-_]",
+                "#   {namespace} ... must end with '#' or '/' for URLs and ':' for URNs",
+                "# one mapping per line, multiple prefixes for the same namespace allowed"));
+        }
+        namespacePrefixService = new StanbolNamespacePrefixService(nsPrefixMappings);
+    }
 
     /**
      * Searches for a configuration file. If the configuration is not found