You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stanbol.apache.org by sf...@apache.org on 2010/12/12 16:02:37 UTC

svn commit: r1044829 [9/12] - in /incubator/stanbol/trunk/rick/generic: core/src/main/java/eu/iksproject/rick/core/impl/ core/src/main/java/eu/iksproject/rick/core/mapping/ core/src/main/java/eu/iksproject/rick/core/model/ core/src/main/java/eu/iksproj...

Modified: incubator/stanbol/trunk/rick/generic/query/src/main/java/eu/iksproject/rick/servicesapi/site/ReferencedSiteManager.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/rick/generic/query/src/main/java/eu/iksproject/rick/servicesapi/site/ReferencedSiteManager.java?rev=1044829&r1=1044828&r2=1044829&view=diff
==============================================================================
--- incubator/stanbol/trunk/rick/generic/query/src/main/java/eu/iksproject/rick/servicesapi/site/ReferencedSiteManager.java (original)
+++ incubator/stanbol/trunk/rick/generic/query/src/main/java/eu/iksproject/rick/servicesapi/site/ReferencedSiteManager.java Sun Dec 12 15:02:34 2010
@@ -4,48 +4,48 @@ import java.util.Collection;
 import java.util.Dictionary;
 
 public interface ReferencedSiteManager {
-	
-	/**
-	 * Returns if a site with the parsed id is referenced
-	 * @param baseUri the base URI
-	 * @return <code>true</code> if a site with the parsed ID is present. 
-	 * Otherwise <code>false</code>.
-	 */
-	boolean isReferred(String id);
-	
-	/**
-	 * Getter for the referenced site based on the id
-	 * @param baseUri the base URI of the referred Site
-	 * @return the {@link ReferencedSite} or <code>null</code> if no site is 
-	 * present for the parsed base ID.
-	 */
-	ReferencedSite getReferencedSite(String id);
-	
-	/**
-	 * TODO's:
-	 * <ul> 
-	 *  <li> use the ReferenceManager specific Exception to this Method
-	 *  <li> maybe use an own data structure instead of the generic Dictionary class
-	 *  <li> review the API based creation of Sites
-	 *  </ul>
-	 * @param baseUri
-	 * @param properties
-	 */
-	void addReferredSite(String baseUri,Dictionary<String,?> properties);
-	/**
-	 * Getter for Sites that manages entities with the given ID. A Site can 
-	 * define a list of prefixes of Entities ID it manages. This method can
-	 * be used to retrieve all the Site that may be able to dereference the
-	 * parsed entity id
-	 * @param entityUri the ID of the entity
-	 * @return A list of referenced sites that may manage the entity in question.
-	 */
-	Collection<ReferencedSite> getReferencedSitesByEntityPrefix(String entityUri);
-
-	/*
-	 * NOTE: We need a way to add/remove referred sites. But this may be done
-	 * via the OSGI ManagedServiceFactory interface. Implementations of the
-	 * Site Interface would than also implement the ManagedService interface
-	 */
+
+    /**
+     * Returns if a site with the parsed id is referenced
+     * @param baseUri the base URI
+     * @return <code>true</code> if a site with the parsed ID is present.
+     * Otherwise <code>false</code>.
+     */
+    boolean isReferred(String id);
+
+    /**
+     * Getter for the referenced site based on the id
+     * @param baseUri the base URI of the referred Site
+     * @return the {@link ReferencedSite} or <code>null</code> if no site is
+     * present for the parsed base ID.
+     */
+    ReferencedSite getReferencedSite(String id);
+
+    /**
+     * TODO's:
+     * <ul>
+     *  <li> use the ReferenceManager specific Exception to this Method
+     *  <li> maybe use an own data structure instead of the generic Dictionary class
+     *  <li> review the API based creation of Sites
+     *  </ul>
+     * @param baseUri
+     * @param properties
+     */
+    void addReferredSite(String baseUri,Dictionary<String,?> properties);
+    /**
+     * Getter for Sites that manages entities with the given ID. A Site can
+     * define a list of prefixes of Entities ID it manages. This method can
+     * be used to retrieve all the Site that may be able to dereference the
+     * parsed entity id
+     * @param entityUri the ID of the entity
+     * @return A list of referenced sites that may manage the entity in question.
+     */
+    Collection<ReferencedSite> getReferencedSitesByEntityPrefix(String entityUri);
+
+    /*
+     * NOTE: We need a way to add/remove referred sites. But this may be done
+     * via the OSGI ManagedServiceFactory interface. Implementations of the
+     * Site Interface would than also implement the ManagedService interface
+     */
 
 }

Modified: incubator/stanbol/trunk/rick/generic/query/src/main/java/eu/iksproject/rick/servicesapi/yard/CacheStrategy.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/rick/generic/query/src/main/java/eu/iksproject/rick/servicesapi/yard/CacheStrategy.java?rev=1044829&r1=1044828&r2=1044829&view=diff
==============================================================================
--- incubator/stanbol/trunk/rick/generic/query/src/main/java/eu/iksproject/rick/servicesapi/yard/CacheStrategy.java (original)
+++ incubator/stanbol/trunk/rick/generic/query/src/main/java/eu/iksproject/rick/servicesapi/yard/CacheStrategy.java Sun Dec 12 15:02:34 2010
@@ -1,19 +1,19 @@
 /**
- * 
+ *
  */
 package eu.iksproject.rick.servicesapi.yard;
 
 public enum CacheStrategy{
-	/**
-	 * All entities of this site should be cached
-	 */
-	all,
-	/**
-	 * Only entities mapped to symbols should be cached
-	 */
-	mapped,
-	/**
-	 * Entities of this site are not cached
-	 */
-	none
-}
\ No newline at end of file
+    /**
+     * All entities of this site should be cached
+     */
+    all,
+    /**
+     * Only entities mapped to symbols should be cached
+     */
+    mapped,
+    /**
+     * Entities of this site are not cached
+     */
+    none
+}

Modified: incubator/stanbol/trunk/rick/generic/query/src/main/java/eu/iksproject/rick/servicesapi/yard/Yard.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/rick/generic/query/src/main/java/eu/iksproject/rick/servicesapi/yard/Yard.java?rev=1044829&r1=1044828&r2=1044829&view=diff
==============================================================================
--- incubator/stanbol/trunk/rick/generic/query/src/main/java/eu/iksproject/rick/servicesapi/yard/Yard.java (original)
+++ incubator/stanbol/trunk/rick/generic/query/src/main/java/eu/iksproject/rick/servicesapi/yard/Yard.java Sun Dec 12 15:02:34 2010
@@ -29,100 +29,99 @@ import eu.iksproject.rick.servicesapi.si
  * <li> local installations of the software used by the referred site</li>
  * <li> and so on ... </li>
  * </ul>
- * 
+ *
  * TODO: The framework need to provide something like a default Yord
- * TODO: The framework need to provide a special Yard for storing {@link Symbol} 
+ * TODO: The framework need to provide a special Yard for storing {@link Symbol}
  * and {@link EntityMapping} information.
- * 
+ *
  * <p>Side note: The name yard was chosen because in farming the word "rick"
- * was used to describe small bales of Hay or Corn that are stacked in a 
- * criss-crossed fashion. The word "rick yard" describes a farm-yard containing 
+ * was used to describe small bales of Hay or Corn that are stacked in a
+ * criss-crossed fashion. The word "rick yard" describes a farm-yard containing
  * ricks of hay or corn.</p>
  * @author Rupert Westenthaler
  *
  * TODO: Need to decide how Yards are linked to the Site for which they
- * cache entities. 
+ * cache entities.
  *
  */
 public interface Yard {
-	
-	String ID = "eu.iksproject.rick.yard.id";
-	String NAME = "eu.iksproject.rick.yard.name";
-	String DESCRIPTION = "eu.iksproject.rick.yard.description";
-	/**
-	 * Getter for the unique ID of the Yard (within the local rick node)
-	 * @return the id
-	 */
-	String getId();
-	String getName();
-	String getDescription();
-	/**
-	 * Creates a new representation. The Yard is responsible to assign a valid
-	 * ID.
-	 * @return the created Representation initialised with a valid ID
-	 */
-	Representation create();
-	/**
-	 * Creates a new representation for the given id
-	 * @param id the id for the new representation or <code>null</code> to
-	 * indicate that the Yard should assign an id.
-	 * @return the created Representation
-	 * @throws IllegalArgumentException if the parsed id is not valid or there
-	 * exists already a representation with the parsed id. 
-	 */
-	Representation create(String id) throws IllegalArgumentException;
-	/**
-	 * Stores the representation in the Yard. if the parsed representation is
-	 * not present in the Yard it will add it to the Yard.
-	 * @param representation the representation
-	 * @throws IllegalArgumentException if <code>null</code> is parsed as argument or
-	 * the representation is not managed (e.g was not created by using this yard).
-	 */
-	void store(Representation representation) throws IllegalArgumentException;
-	/**
-	 * Removes the {@link Representation} with the given id
-	 * @param id the id
-	 * @throws IllegalArgumentException if the parsed ID is null or not valid 
-	 * formatted
-	 */
-	void remove(String id) throws IllegalArgumentException;
-	/**
-	 * checks if a representation with the given id is present in the Yard
-	 * @param id the id. Calls with <code>null</code> are ignored
-	 * @return <code>true</code> if a representation with the id is present in
-	 * the Yard. Otherwise <code>false</code>.
-	 * @throws IllegalArgumentException if the parsed ID is not valid 
-	 * formatted
-	 */
-	boolean isRepresentation(String id);
-	/**
-	 * Getter for the representation based on the id. Calls with 
-	 * <code>id = null</code> should return null.
-	 * @param id the id. 
-	 * @return The representation with the parsed id or <code>null</code> if
-	 * no representation with this id is present in the Yard
-	 * @throws IllegalArgumentException if the parsed ID is not valid 
-	 * formatted
-	 */
-	Representation getRepresentation(String id);
-	/**
-	 * Updates the store with the new state of the parsed representation
-	 * @param represnetation the representation
-	 * @throws IllegalArgumentException if the parsed representation <code>null</code>
-	 * or not present in the Yard
-	 */
-	void update(Representation represnetation) throws IllegalArgumentException;
-	
+
+    String ID = "eu.iksproject.rick.yard.id";
+    String NAME = "eu.iksproject.rick.yard.name";
+    String DESCRIPTION = "eu.iksproject.rick.yard.description";
+    /**
+     * Getter for the unique ID of the Yard (within the local rick node)
+     * @return the id
+     */
+    String getId();
+    String getName();
+    String getDescription();
+    /**
+     * Creates a new representation. The Yard is responsible to assign a valid
+     * ID.
+     * @return the created Representation initialised with a valid ID
+     */
+    Representation create();
+    /**
+     * Creates a new representation for the given id
+     * @param id the id for the new representation or <code>null</code> to
+     * indicate that the Yard should assign an id.
+     * @return the created Representation
+     * @throws IllegalArgumentException if the parsed id is not valid or there
+     * exists already a representation with the parsed id.
+     */
+    Representation create(String id) throws IllegalArgumentException;
+    /**
+     * Stores the representation in the Yard. if the parsed representation is
+     * not present in the Yard it will add it to the Yard.
+     * @param representation the representation
+     * @throws IllegalArgumentException if <code>null</code> is parsed as argument or
+     * the representation is not managed (e.g was not created by using this yard).
+     */
+    void store(Representation representation) throws IllegalArgumentException;
+    /**
+     * Removes the {@link Representation} with the given id
+     * @param id the id
+     * @throws IllegalArgumentException if the parsed ID is null or not valid
+     * formatted
+     */
+    void remove(String id) throws IllegalArgumentException;
+    /**
+     * checks if a representation with the given id is present in the Yard
+     * @param id the id. Calls with <code>null</code> are ignored
+     * @return <code>true</code> if a representation with the id is present in
+     * the Yard. Otherwise <code>false</code>.
+     * @throws IllegalArgumentException if the parsed ID is not valid
+     * formatted
+     */
+    boolean isRepresentation(String id);
+    /**
+     * Getter for the representation based on the id. Calls with
+     * <code>id = null</code> should return null.
+     * @param id the id.
+     * @return The representation with the parsed id or <code>null</code> if
+     * no representation with this id is present in the Yard
+     * @throws IllegalArgumentException if the parsed ID is not valid
+     * formatted
+     */
+    Representation getRepresentation(String id);
+    /**
+     * Updates the store with the new state of the parsed representation
+     * @param represnetation the representation
+     * @throws IllegalArgumentException if the parsed representation <code>null</code>
+     * or not present in the Yard
+     */
+    void update(Representation represnetation) throws IllegalArgumentException;
+
 /*
- * TODO: Maybe one would like to add status Information about cached 
+ * TODO: Maybe one would like to add status Information about cached
  *       Representations for registered Sites.
  */
 // enum ProcessingStatus {
-//		scheduled,
-//		processing,
-//		stored
-//	};
-//	ProcessingStatus getStatus(Site site);
-//	ProcessingStatus getStatus(String entityId);
+//        scheduled,
+//        processing,
+//        stored
+//    };
+//    ProcessingStatus getStatus(Site site);
+//    ProcessingStatus getStatus(String entityId);
 }
-

Modified: incubator/stanbol/trunk/rick/generic/query/src/main/java/eu/iksproject/rick/servicesapi/yard/YardManager.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/rick/generic/query/src/main/java/eu/iksproject/rick/servicesapi/yard/YardManager.java?rev=1044829&r1=1044828&r2=1044829&view=diff
==============================================================================
--- incubator/stanbol/trunk/rick/generic/query/src/main/java/eu/iksproject/rick/servicesapi/yard/YardManager.java (original)
+++ incubator/stanbol/trunk/rick/generic/query/src/main/java/eu/iksproject/rick/servicesapi/yard/YardManager.java Sun Dec 12 15:02:34 2010
@@ -3,31 +3,31 @@ package eu.iksproject.rick.servicesapi.y
 import java.util.Collection;
 
 /**
- * Manages the different active Yards 
+ * Manages the different active Yards
  * TODO: Who is responsible of initialising the RickYard (the yard storing
  * Symbols and Mapped Entities)?
  * @author Rupert Westenthaler
  */
 public interface YardManager {
 
-	/**
-	 * Getter for the IDs of Yards currently managed by this Manager
-	 * @return the Ids of the currently active Yards
-	 */
-	Collection<String> getYardIDs();
-	/**
-	 * Returns if there is a Yard for the parsed ID
-	 * @param id the id
-	 * @return <code>true</code> if a {@link Yard} with the parsed ID is managed
-	 * by this YardManager.
-	 */
-	boolean isYard(String id);
-	/**
-	 * Getter for the Yard based on the parsed Id
-	 * @param id the ID
-	 * @return The Yard or <code>null</code> if no Yard with the parsed ID is
-	 * active.
-	 */
-	Yard getYard(String id);
+    /**
+     * Getter for the IDs of Yards currently managed by this Manager
+     * @return the Ids of the currently active Yards
+     */
+    Collection<String> getYardIDs();
+    /**
+     * Returns if there is a Yard for the parsed ID
+     * @param id the id
+     * @return <code>true</code> if a {@link Yard} with the parsed ID is managed
+     * by this YardManager.
+     */
+    boolean isYard(String id);
+    /**
+     * Getter for the Yard based on the parsed Id
+     * @param id the ID
+     * @return The Yard or <code>null</code> if no Yard with the parsed ID is
+     * active.
+     */
+    Yard getYard(String id);
 
 }

Modified: incubator/stanbol/trunk/rick/generic/servicesapi/src/main/java/eu/iksproject/rick/servicesapi/Rick.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/rick/generic/servicesapi/src/main/java/eu/iksproject/rick/servicesapi/Rick.java?rev=1044829&r1=1044828&r2=1044829&view=diff
==============================================================================
--- incubator/stanbol/trunk/rick/generic/servicesapi/src/main/java/eu/iksproject/rick/servicesapi/Rick.java (original)
+++ incubator/stanbol/trunk/rick/generic/servicesapi/src/main/java/eu/iksproject/rick/servicesapi/Rick.java Sun Dec 12 15:02:34 2010
@@ -22,13 +22,13 @@ import eu.iksproject.rick.servicesapi.ya
  * <li>{@link Symbol}: Entities as defined by the local CMS</li>
  * <li>{@link EntityMapping}: External Entities that are aligned to {@link Symbol}
  *      used by the local CMS</li>
- * <li> {@link Sites}: External sites that manage entities. Such sites also define 
+ * <li> {@link Sites}: External sites that manage entities. Such sites also define
  *      default valued for MappedEntities and Symbols created based on Entities
  *      they manage</li>
  * </ul>
- * 
+ *
  * TODO's<ul>
- *  <li> Query Interface for Symbols and Entities. Probably a 
+ *  <li> Query Interface for Symbols and Entities. Probably a
  *       field -> value pattern based query language would be a good start
  *       (e.g. label="Par*" type="ns:Location")
  *  <li> How to deal with content (references, base62 encoded Strings,
@@ -40,150 +40,150 @@ import eu.iksproject.rick.servicesapi.ya
  *
  */
 public interface Rick {
-	
-	String DEFAUTL_RICK_PREFIX = "urn:eu.iksproject:rick";
-	
-	/**
-	 * Getter for the Yard storing the data (Symbols, MappedEntities) of the Rick.
-	 * @return The yard instance used to store the data of the Rick - the RickYard
-	 */
-	public Yard getRickYard();
 
-	/**
-	 * Getter for an Symbol for an reference to a {@link Sign}. If parsed
-	 * reference refers a Symbol, than this Symbol is returned. In any other
-	 * case this Method searches if the parsed reference is mapped to a
-	 * Symbol and returns the Symbol instead. To check if the parsed reference
-	 * is a {@link Symbol} simple check if {@link Symbol#getId()} equals to the
-	 * parsed reference.
-	 * @param reference the id of the referenced Sign
-	 * @return the symbol representing the parsed entity or <code>null</code> if
-	 * no symbol for the parsed entity is available
-	 * @throws RickException On any error while performing the operation
-	 */
-	Symbol lookupSymbol(String reference) throws RickException;
-	/**
-	 * Getter for an Symbol for an reference to a {@link Sign}. If parsed
-	 * reference refers a Symbol, than this Symbol is returned. In any other
-	 * case this Method searches if the parsed reference is mapped to a
-	 * Symbol and returns the Symbol instead. To check if the parsed reference
-	 * is a {@link Symbol} simple check if {@link Symbol#getId()} equals to the
-	 * parsed reference.<br>
-	 * If <code>create=true</code> and no {@link EntityMapping} is present for
-	 * the parsed reference, than a new Symbol is created and returned.
-	 * 
-	 * @param reference the id of the referenced Sign
-	 * @param create if <code>true</code> the {@link Rick} will try to create a
-	 * {@link Symbol} if necessary
-	 * @return the symbol or <code>null</code> if the parsed reference is not
-	 * known by any referenced sites.
-	 * @throws IllegalArgumentException If the referenced {@link Sign} was found, no
-	 * existing {@link EntityMapping} is present, but it is not possible to
-	 * create an {@link Symbol} for this {@link Sign} (normally because the
-	 * {@link Representation} of the {@link Sign} provides insufficient data).
-	 * @throws RickException On any error while performing the operation
-	 */
-	Symbol lookupSymbol(String reference, boolean create) throws IllegalArgumentException, RickException;
-	/**
-	 * Getter for a Symbol by ID. This method does only work with IDs of
-	 * Symbols managed by the Rick. To lookup Symbols by the ID of a Symbol,
-	 * a mappedEntity or an Entity of an referenced site use the
-	 * {@link #lookupSymbol(String, boolean)} method.
-	 * @param symbolId the ID of the Symbol
-	 * @return the Symbol or <code>null</code> if no {@link Symbol} with that
-	 * ID is managed by the Rick.
-	 * @throws IllegalArgumentException if <code>null</code> or an empty String
-	 * is parsed as symbolId
-	 * @throws RickException On any error while performing the operation
-	 */
-	Symbol getSymbol(String symbolId) throws IllegalArgumentException, RickException;
-	/**
-	 * Creates a Symbol for the parsed reference. If there is already a Symbol
-	 * present for the parsed reference, than this Method throws an
-	 * {@link IllegalStateException}. If no Sign can be found for the parsed
-	 * Reference, than <code>null</code> is returned. 
-	 * If the referenced {@link Sign} provides
-	 * insufficient data to create a {@link Symbol}, than an 
-	 * {@link IllegalArgumentException} is thrown.
-	 * @param reference the id of the {@link Sign}
-	 * @return the Symbol or <code>null</code> if the no {@link Sign} was found
-	 * for the parsed reference.
-	 * @throws IllegalStateException if there exists already a {@link Symbol} for
-	 * the parsed reference
-	 * @throws IllegalArgumentException  If the referenced {@link Sign} was found, no
-	 * existing {@link EntityMapping} is present, but it is not possible to
-	 * create an {@link Symbol} for this {@link Sign} (normally because the
-	 * {@link Representation} of the {@link Sign} provides insufficient data).
-	 * @throws RickException On any error while performing the operation
-	 */
-	Symbol createSymbol(String reference) throws IllegalStateException,IllegalArgumentException,RickException;
-	/**
-	 * Getter for a MappedEntity based on the ID
-	 * @param id the id of the mapped entity
-	 * @return the MappedEntity or <code>null</code> if none was found
-	 * @throws RickException On any error while performing the operation
-	 */
-	EntityMapping getMappingById(String id) throws RickException;
-	/**
-	 * Getter for all mappings for a entity
-	 * TODO: check if an Entity can be mapped to more than one Symbol
-	 * @param reference the ID of the referred entity
-	 * @return Iterator over all the Mappings defined for this entity
-	 * @throws RickException On any error while performing the operation
-	 */
-	EntityMapping getMappingByEntity(String reference) throws RickException;
-	/**
-	 * Getter for the {@link FieldQueryFactory} instance of the Rick. Typical
-	 * implementation will return the factory of the RickYard.
-	 * @return the query factory
-	 */
-	FieldQueryFactory getQueryFavtory();
-	/**
-	 * Getter for the FieldMappings configured for this Site
-	 * @return The {@link FieldMapping} present for this Site.
-	 */
-	FieldMapper getFieldMappings();
-//	/**
-//	 * Getter for the Configuration for the RICK
-//	 * @return the configuration of the RICK
-//	 */
-//	RickConfiguration getRickConfiguration();
-	/**
-	 * Getter for all the mappings of the parsed reference to a {@link Symbol}
-	 * @param symbol the reference to the symbol
-	 * @return the mappings for the parsed Symbol
-	 * @throws RickException On any error while performing the operation
-	 */
-	public Collection<EntityMapping> getMappingsBySymbol(String symbol) throws RickException;
-	
-	/**
-	 * Searches for symbols based on the parsed {@link FieldQuery} and returns
-	 * the references (ids). Note that selected fields of the query are ignored.
-	 * @param query the query
-	 * @return the references of the found symbols
-	 * @throws RickException On any error while performing the operation
-	 */
-	QueryResultList<String> findSymbolReferences(FieldQuery query) throws RickException;
-	/**
-	 * Searches for symbols based on the parsed {@link FieldQuery} and returns
-	 * representations as defined by the selected fields of the query. Note that
-	 * if the query defines also {@link Constraint}s for selected fields, that
-	 * the returned representation will only contain values selected by such
-	 * constraints.
-	 * @param query the query
-	 * @return the found symbols as representation containing only the selected
-	 * fields and there values.
-	 * @throws RickException On any error while performing the operation
-	 */
-	QueryResultList<Representation> find(FieldQuery query) throws RickException;
-	/**
-	 * Searches for Signs based on the parsed {@link FieldQuery} and returns
-	 * the selected Signs including the whole representation. Note that selected 
-	 * fields of the query are ignored.
-	 * @param query the query
-	 * @return All Entities selected by the Query.
-	 * @throws RickException On any error while performing the operation
-	 */
-	QueryResultList<Symbol> findSymbols(FieldQuery query) throws RickException;
+    String DEFAUTL_RICK_PREFIX = "urn:eu.iksproject:rick";
+
+    /**
+     * Getter for the Yard storing the data (Symbols, MappedEntities) of the Rick.
+     * @return The yard instance used to store the data of the Rick - the RickYard
+     */
+    Yard getRickYard();
+
+    /**
+     * Getter for an Symbol for an reference to a {@link Sign}. If parsed
+     * reference refers a Symbol, than this Symbol is returned. In any other
+     * case this Method searches if the parsed reference is mapped to a
+     * Symbol and returns the Symbol instead. To check if the parsed reference
+     * is a {@link Symbol} simple check if {@link Symbol#getId()} equals to the
+     * parsed reference.
+     * @param reference the id of the referenced Sign
+     * @return the symbol representing the parsed entity or <code>null</code> if
+     * no symbol for the parsed entity is available
+     * @throws RickException On any error while performing the operation
+     */
+    Symbol lookupSymbol(String reference) throws RickException;
+    /**
+     * Getter for an Symbol for an reference to a {@link Sign}. If parsed
+     * reference refers a Symbol, than this Symbol is returned. In any other
+     * case this Method searches if the parsed reference is mapped to a
+     * Symbol and returns the Symbol instead. To check if the parsed reference
+     * is a {@link Symbol} simple check if {@link Symbol#getId()} equals to the
+     * parsed reference.<br>
+     * If <code>create=true</code> and no {@link EntityMapping} is present for
+     * the parsed reference, than a new Symbol is created and returned.
+     *
+     * @param reference the id of the referenced Sign
+     * @param create if <code>true</code> the {@link Rick} will try to create a
+     * {@link Symbol} if necessary
+     * @return the symbol or <code>null</code> if the parsed reference is not
+     * known by any referenced sites.
+     * @throws IllegalArgumentException If the referenced {@link Sign} was found, no
+     * existing {@link EntityMapping} is present, but it is not possible to
+     * create an {@link Symbol} for this {@link Sign} (normally because the
+     * {@link Representation} of the {@link Sign} provides insufficient data).
+     * @throws RickException On any error while performing the operation
+     */
+    Symbol lookupSymbol(String reference, boolean create) throws IllegalArgumentException, RickException;
+    /**
+     * Getter for a Symbol by ID. This method does only work with IDs of
+     * Symbols managed by the Rick. To lookup Symbols by the ID of a Symbol,
+     * a mappedEntity or an Entity of an referenced site use the
+     * {@link #lookupSymbol(String, boolean)} method.
+     * @param symbolId the ID of the Symbol
+     * @return the Symbol or <code>null</code> if no {@link Symbol} with that
+     * ID is managed by the Rick.
+     * @throws IllegalArgumentException if <code>null</code> or an empty String
+     * is parsed as symbolId
+     * @throws RickException On any error while performing the operation
+     */
+    Symbol getSymbol(String symbolId) throws IllegalArgumentException, RickException;
+    /**
+     * Creates a Symbol for the parsed reference. If there is already a Symbol
+     * present for the parsed reference, than this Method throws an
+     * {@link IllegalStateException}. If no Sign can be found for the parsed
+     * Reference, than <code>null</code> is returned.
+     * If the referenced {@link Sign} provides
+     * insufficient data to create a {@link Symbol}, than an
+     * {@link IllegalArgumentException} is thrown.
+     * @param reference the id of the {@link Sign}
+     * @return the Symbol or <code>null</code> if the no {@link Sign} was found
+     * for the parsed reference.
+     * @throws IllegalStateException if there exists already a {@link Symbol} for
+     * the parsed reference
+     * @throws IllegalArgumentException  If the referenced {@link Sign} was found, no
+     * existing {@link EntityMapping} is present, but it is not possible to
+     * create an {@link Symbol} for this {@link Sign} (normally because the
+     * {@link Representation} of the {@link Sign} provides insufficient data).
+     * @throws RickException On any error while performing the operation
+     */
+    Symbol createSymbol(String reference) throws IllegalStateException,IllegalArgumentException,RickException;
+    /**
+     * Getter for a MappedEntity based on the ID
+     * @param id the id of the mapped entity
+     * @return the MappedEntity or <code>null</code> if none was found
+     * @throws RickException On any error while performing the operation
+     */
+    EntityMapping getMappingById(String id) throws RickException;
+    /**
+     * Getter for all mappings for a entity
+     * TODO: check if an Entity can be mapped to more than one Symbol
+     * @param reference the ID of the referred entity
+     * @return Iterator over all the Mappings defined for this entity
+     * @throws RickException On any error while performing the operation
+     */
+    EntityMapping getMappingByEntity(String reference) throws RickException;
+    /**
+     * Getter for the {@link FieldQueryFactory} instance of the Rick. Typical
+     * implementation will return the factory of the RickYard.
+     * @return the query factory
+     */
+    FieldQueryFactory getQueryFavtory();
+    /**
+     * Getter for the FieldMappings configured for this Site
+     * @return The {@link FieldMapping} present for this Site.
+     */
+    FieldMapper getFieldMappings();
+//    /**
+//     * Getter for the Configuration for the RICK
+//     * @return the configuration of the RICK
+//     */
+//    RickConfiguration getRickConfiguration();
+    /**
+     * Getter for all the mappings of the parsed reference to a {@link Symbol}
+     * @param symbol the reference to the symbol
+     * @return the mappings for the parsed Symbol
+     * @throws RickException On any error while performing the operation
+     */
+    Collection<EntityMapping> getMappingsBySymbol(String symbol) throws RickException;
+
+    /**
+     * Searches for symbols based on the parsed {@link FieldQuery} and returns
+     * the references (ids). Note that selected fields of the query are ignored.
+     * @param query the query
+     * @return the references of the found symbols
+     * @throws RickException On any error while performing the operation
+     */
+    QueryResultList<String> findSymbolReferences(FieldQuery query) throws RickException;
+    /**
+     * Searches for symbols based on the parsed {@link FieldQuery} and returns
+     * representations as defined by the selected fields of the query. Note that
+     * if the query defines also {@link Constraint}s for selected fields, that
+     * the returned representation will only contain values selected by such
+     * constraints.
+     * @param query the query
+     * @return the found symbols as representation containing only the selected
+     * fields and there values.
+     * @throws RickException On any error while performing the operation
+     */
+    QueryResultList<Representation> find(FieldQuery query) throws RickException;
+    /**
+     * Searches for Signs based on the parsed {@link FieldQuery} and returns
+     * the selected Signs including the whole representation. Note that selected
+     * fields of the query are ignored.
+     * @param query the query
+     * @return All Entities selected by the Query.
+     * @throws RickException On any error while performing the operation
+     */
+    QueryResultList<Symbol> findSymbols(FieldQuery query) throws RickException;
 
 }

Modified: incubator/stanbol/trunk/rick/generic/servicesapi/src/main/java/eu/iksproject/rick/servicesapi/RickConfiguration.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/rick/generic/servicesapi/src/main/java/eu/iksproject/rick/servicesapi/RickConfiguration.java?rev=1044829&r1=1044828&r2=1044829&view=diff
==============================================================================
--- incubator/stanbol/trunk/rick/generic/servicesapi/src/main/java/eu/iksproject/rick/servicesapi/RickConfiguration.java (original)
+++ incubator/stanbol/trunk/rick/generic/servicesapi/src/main/java/eu/iksproject/rick/servicesapi/RickConfiguration.java Sun Dec 12 15:02:34 2010
@@ -14,89 +14,89 @@ import eu.iksproject.rick.servicesapi.si
  *
  */
 public interface RickConfiguration {
-	/**
-	 * The key used to configure the ID of the RICK
-	 */
-	String ID = "eu.iksprojct.rick.id";
-	/**
-	 * The ID of the Rick. This ID is used as origin (sign site) for all symbols
-	 * and mapped entities created by the Rick
-	 * @return the ID of the Rick
-	 */
-	String getID();
-	/**
-	 * The property used to configure the prefix used for {@link Symbol}s and
-	 * {@link EntityMapping}s created by the Rick
-	 */
-	String PREFIX = "eu.iksproject.rick.prefix";
-	/**
-	 * Getter for the Prefix to be used for all {@link Symbol}s and {@link EntityMapping}s
-	 * created by the {@link Rick}
-	 * @return The prefix for {@link Symbol}s and {@link EntityMapping}s
-	 */
-	String getRickPrefix();
-	/**
-	 * The key used to configure the name of the RICK
-	 */
-	String NAME = "eu.iksprojct.rick.name";
-	/**
-	 * The human readable name of this RICK instance. Typically used as label 
-	 * in addition/instead of the ID.
-	 * @return the Name (or the ID in case no name is defined)
-	 */
-	String getName();
-	/**
-	 * The key used to configure the description of the RICK
-	 */
-	String DESCRIPTION = "eu.iksprojct.rick.description";
-	/**
-	 * The human readable description to provide some background information about
-	 * this RICK instance.
-	 * @return the description or <code>null</code> if none is defined/configured.
-	 */
-	String getDescription();
-	/**
-	 * The property used to configure the id of the RickYard
-	 */
-	String RICK_YARD_ID = "eu.iksproject.rick.yard.rickYardId";
-	/**
-	 * The default ID for the Yard used for the Rick
-	 */
-	String DEFAULT_RICK_YARD_ID = "rickYard";
-	/**
-	 * This is the ID of the Yard used by the Rick to store its data
-	 * @return the Rick-Yard id
-	 */
-	String getRickYardId();
-	/**
-	 * The property used to configure the field mappings for the RICK
-	 */
-	String FIELD_MAPPINGS = "eu.iksproject.rick.mapping.rick";
-	/**
-	 * Getter for the FieldMapping configuration of the Rick. These Mappings are
-	 * used for every {@link ReferencedSite} of the Rick.<br>
-	 * Note that {@link FieldMapping#parseFieldMapping(String)} is used to
-	 * parsed the values returned by this Method
-	 * @return the configured mappings for the Rick
-	 */
-	Collection<String> getFieldMappingConfig();
-	/**
-	 * The property used to configure the initial state for new {@link EntityMapping}s
-	 */
-	String DEFAULT_MAPPING_STATE = "eu.iksproject.rick.defaultMappingState";
-	/**
-	 * The initial (default) state for new {@link EntityMapping}s
-	 * @return the default state for new {@link EntityMapping}s
-	 */
-	MappingState getDefaultMappingState();
-	/**
-	 * The property used to configure the initial state for new {@link Symbol}s
-	 */
-	String DEFAULT_SYMBOL_STATE = "eu.iksproject.rick.defaultSymbolState";
-	/**
-	 * The initial (default) state for new {@link Symbol}s
-	 * @return the default state for new {@link Symbol}s
-	 */
-	Symbol.SymbolState getDefaultSymbolState();
+    /**
+     * The key used to configure the ID of the RICK
+     */
+    String ID = "eu.iksprojct.rick.id";
+    /**
+     * The ID of the Rick. This ID is used as origin (sign site) for all symbols
+     * and mapped entities created by the Rick
+     * @return the ID of the Rick
+     */
+    String getID();
+    /**
+     * The property used to configure the prefix used for {@link Symbol}s and
+     * {@link EntityMapping}s created by the Rick
+     */
+    String PREFIX = "eu.iksproject.rick.prefix";
+    /**
+     * Getter for the Prefix to be used for all {@link Symbol}s and {@link EntityMapping}s
+     * created by the {@link Rick}
+     * @return The prefix for {@link Symbol}s and {@link EntityMapping}s
+     */
+    String getRickPrefix();
+    /**
+     * The key used to configure the name of the RICK
+     */
+    String NAME = "eu.iksprojct.rick.name";
+    /**
+     * The human readable name of this RICK instance. Typically used as label
+     * in addition/instead of the ID.
+     * @return the Name (or the ID in case no name is defined)
+     */
+    String getName();
+    /**
+     * The key used to configure the description of the RICK
+     */
+    String DESCRIPTION = "eu.iksprojct.rick.description";
+    /**
+     * The human readable description to provide some background information about
+     * this RICK instance.
+     * @return the description or <code>null</code> if none is defined/configured.
+     */
+    String getDescription();
+    /**
+     * The property used to configure the id of the RickYard
+     */
+    String RICK_YARD_ID = "eu.iksproject.rick.yard.rickYardId";
+    /**
+     * The default ID for the Yard used for the Rick
+     */
+    String DEFAULT_RICK_YARD_ID = "rickYard";
+    /**
+     * This is the ID of the Yard used by the Rick to store its data
+     * @return the Rick-Yard id
+     */
+    String getRickYardId();
+    /**
+     * The property used to configure the field mappings for the RICK
+     */
+    String FIELD_MAPPINGS = "eu.iksproject.rick.mapping.rick";
+    /**
+     * Getter for the FieldMapping configuration of the Rick. These Mappings are
+     * used for every {@link ReferencedSite} of the Rick.<br>
+     * Note that {@link FieldMapping#parseFieldMapping(String)} is used to
+     * parsed the values returned by this Method
+     * @return the configured mappings for the Rick
+     */
+    Collection<String> getFieldMappingConfig();
+    /**
+     * The property used to configure the initial state for new {@link EntityMapping}s
+     */
+    String DEFAULT_MAPPING_STATE = "eu.iksproject.rick.defaultMappingState";
+    /**
+     * The initial (default) state for new {@link EntityMapping}s
+     * @return the default state for new {@link EntityMapping}s
+     */
+    MappingState getDefaultMappingState();
+    /**
+     * The property used to configure the initial state for new {@link Symbol}s
+     */
+    String DEFAULT_SYMBOL_STATE = "eu.iksproject.rick.defaultSymbolState";
+    /**
+     * The initial (default) state for new {@link Symbol}s
+     * @return the default state for new {@link Symbol}s
+     */
+    Symbol.SymbolState getDefaultSymbolState();
 
 }

Modified: incubator/stanbol/trunk/rick/generic/servicesapi/src/main/java/eu/iksproject/rick/servicesapi/RickException.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/rick/generic/servicesapi/src/main/java/eu/iksproject/rick/servicesapi/RickException.java?rev=1044829&r1=1044828&r2=1044829&view=diff
==============================================================================
--- incubator/stanbol/trunk/rick/generic/servicesapi/src/main/java/eu/iksproject/rick/servicesapi/RickException.java (original)
+++ incubator/stanbol/trunk/rick/generic/servicesapi/src/main/java/eu/iksproject/rick/servicesapi/RickException.java Sun Dec 12 15:02:34 2010
@@ -8,26 +8,26 @@ package eu.iksproject.rick.servicesapi;
  */
 public abstract class RickException extends Exception {
 
-	/**
-	 * default serial version uid.
-	 */
-	private static final long serialVersionUID = 1L;
+    /**
+     * default serial version uid.
+     */
+    private static final long serialVersionUID = 1L;
 
-	/**
-	 * Creates an exception with a message and a cause
-	 * @param reason the message describing the reason for the error
-	 * @param cause the parent
-	 */
-	protected RickException(String reason, Throwable cause) {
-		super(reason, cause);
-	}
+    /**
+     * Creates an exception with a message and a cause
+     * @param reason the message describing the reason for the error
+     * @param cause the parent
+     */
+    protected RickException(String reason, Throwable cause) {
+        super(reason, cause);
+    }
 
-	/**
-	 * Creates an exception with a message and a cause
-	 * @param reason the message describing the reason for the error
-	 */
-	protected RickException(String reason) {
-		super(reason);
-	}	
+    /**
+     * Creates an exception with a message and a cause
+     * @param reason the message describing the reason for the error
+     */
+    protected RickException(String reason) {
+        super(reason);
+    }
 
 }

Modified: incubator/stanbol/trunk/rick/generic/servicesapi/src/main/java/eu/iksproject/rick/servicesapi/defaults/DataTypeEnum.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/rick/generic/servicesapi/src/main/java/eu/iksproject/rick/servicesapi/defaults/DataTypeEnum.java?rev=1044829&r1=1044828&r2=1044829&view=diff
==============================================================================
--- incubator/stanbol/trunk/rick/generic/servicesapi/src/main/java/eu/iksproject/rick/servicesapi/defaults/DataTypeEnum.java (original)
+++ incubator/stanbol/trunk/rick/generic/servicesapi/src/main/java/eu/iksproject/rick/servicesapi/defaults/DataTypeEnum.java Sun Dec 12 15:02:34 2010
@@ -21,200 +21,200 @@ import eu.iksproject.rick.servicesapi.mo
 import eu.iksproject.rick.servicesapi.model.Text;
 /**
  * Holds data types used by Rick. Uses the xsd data types where possible.
- * 
+ *
  * @author Rupert Westenthaler
  *
  */
 public enum DataTypeEnum {
-	//Rick specific
-	//Reference
-	Reference(NamespaceEnum.rickModel,"ref",Reference.class),
-	//Natural language Text
-	Text(NamespaceEnum.rickModel,"text",Text.class),
-	//xsd types
-	/**
-	 * currently URIs are preferable mapped to {@link Reference}, because there
-	 * may be RDF URIs that are not valid {@link URI}s nor {@link URL}s. However
-	 * existing URI and URL instances are also accepted.
-	 */
-	AnyUri("anyURI",Reference.class,URI.class,URL.class),
-	Boolean("boolean",Boolean.class),
-	Byte("byte",Byte.class),
-	Short("short",Short.class),
-	Integer("integer",BigInteger.class),
-	Decimal("decimal",BigDecimal.class),
-	Int("int",Integer.class),
-	Long("long",Long.class),
-	Float("float",Float.class),
-	Double("double",Double.class),
-	String("string",String.class,Text.class),
-	Time("time",Date.class), //TODO: check if the XML calendar would be better
-	Date("date",Date.class),
-	DateTime("dateTime",Date.class),
-	Duration("duration",Duration.class),
-	;
-	final Class<?> javaType;
-	final QName qName;
-	final String shortName;
-	final String uri;
-	final Set<Class<?>> additional;
-	DataTypeEnum(Class<?> javaType,Class<?>...additional){
-		this(null,null,javaType,additional);
-	}
-	DataTypeEnum(String localName,Class<?> javaType,Class<?>...additional){
-		this(null,localName,javaType,additional);
-	}
-	private DataTypeEnum(NamespaceEnum namespace,Class<?> javaType,Class<?>...additional) {
-		this(namespace,null,javaType,additional);
-	}
-	private DataTypeEnum(NamespaceEnum namespace,String localName,Class<?> javaType,Class<?>...additional) {
-		if(namespace == null){
-			namespace = NamespaceEnum.xsd;
-		}
-		if(localName == null){
-			localName = name();
-		}
-		if(additional != null && additional.length>0){
-			this.additional = Collections.unmodifiableSet(new HashSet<Class<?>>(Arrays.asList(additional)));
-		} else {
-			this.additional = Collections.emptySet();
-		}
-		this.javaType = javaType;
-		this.qName = new QName(namespace.getNamespace(), localName, namespace.getPrefix());
-		//a lot of accesses will be based on the Uri and the shortName.
-		// -> so store the IDs and the shortName as local Vars.
-		this.shortName = qName.getPrefix()+':'+qName.getLocalPart();
-		this.uri = qName.getNamespaceURI()+qName.getLocalPart();
-	}
-	public final String getLocalName() {
-		return qName.getLocalPart();
-	}
-	public final Class<?> getJavaType() {
-		return javaType;
-	}
-	public Set<Class<?>> getAdditionalJavaTypes() {
-		return additional;
-	}
-	public final NamespaceEnum getNamespace() {
-		return NamespaceEnum.forNamespace(qName.getNamespaceURI());
-	}
-	public final String getUri(){
-		return uri;
-	}
-	public final String getShortName(){
-		return shortName;
-	}
-	public final QName getQName(){
-		return qName;
-	}
-	@Override
-	public String toString() {
-		return getUri();
-	}
-	
-	static private Map<Class<?>,Set<DataTypeEnum>> class2DataTypeMap;
-	static private Map<Class<?>,Set<DataTypeEnum>> interface2DataTypeMap;
-	static private Map<Class<?>,Set<DataTypeEnum>> allClass2DataTypeMap;
-	static private Map<Class<?>,Set<DataTypeEnum>> allInterface2DataTypeMap;
-	static private Map<String,DataTypeEnum> uri2DataType;
-	static private Map<String,DataTypeEnum> shortName2DataType;
-	static{
-		Map<Class<?>,Set<DataTypeEnum>> c2d = new HashMap<Class<?>, Set<DataTypeEnum>>();
-		Map<Class<?>,Set<DataTypeEnum>> i2d = new HashMap<Class<?>, Set<DataTypeEnum>>();
-		Map<Class<?>,Set<DataTypeEnum>> ac2d = new HashMap<Class<?>, Set<DataTypeEnum>>();
-		Map<Class<?>,Set<DataTypeEnum>> ai2d = new HashMap<Class<?>, Set<DataTypeEnum>>();
-		Map<String,DataTypeEnum> u2d = new HashMap<String, DataTypeEnum>();
-		Map<String,DataTypeEnum> s2d = new HashMap<String, DataTypeEnum>();
-		for(DataTypeEnum dataType : DataTypeEnum.values()){
-			//add primary javaType -> data type mappings
-			if(dataType.javaType.isInterface()){
-				Set<DataTypeEnum> dataTypes = i2d.get(dataType.javaType);
-				if(dataTypes == null){
-					dataTypes = EnumSet.noneOf(DataTypeEnum.class);
-					i2d.put(dataType.javaType, dataTypes);
-				}
-				dataTypes.add(dataType);
-			} else { //a class
-				Set<DataTypeEnum> dataTypes = c2d.get(dataType.javaType);
-				if(dataTypes == null){
-					dataTypes = EnumSet.noneOf(DataTypeEnum.class);
-					c2d.put(dataType.javaType, dataTypes);
-				}
-				dataTypes.add(dataType);
-			}
-			//add additional javaType -> data type mappings
-			for(Class<?> additionalClass : dataType.additional){
-				if(additionalClass.isInterface()){
-					Set<DataTypeEnum> dataTypes = ai2d.get(additionalClass);
-					if(dataTypes == null){
-						dataTypes = EnumSet.noneOf(DataTypeEnum.class);
-						ai2d.put(additionalClass, dataTypes);
-					}
-					dataTypes.add(dataType);
-				} else { //a class
-					Set<DataTypeEnum> dataTypes = ac2d.get(additionalClass);
-					if(dataTypes == null){
-						dataTypes = EnumSet.noneOf(DataTypeEnum.class);
-						ac2d.put(additionalClass, dataTypes);
-					}
-					dataTypes.add(dataType);
-				}
-			}
-			if(u2d.containsKey(dataType.getUri())){
-				throw new IllegalStateException(java.lang.String.format("Invalid configuration in DataTypeEnum because dataType uri %s is used for %s and %s!",
-						dataType.getUri(),dataType.name(),u2d.get(dataType.getUri()).name()));
-			}
-			u2d.put(dataType.getUri(), dataType);
-			if(s2d.containsKey(dataType.getShortName())){
-				throw new IllegalStateException(java.lang.String.format("Invalid configuration in DataTypeEnum because dataType short name (prefix:localname) %s is used for %s and %s!",
-						dataType.getShortName(),dataType.name(),s2d.get(dataType.getShortName()).name()));
-			}
-			s2d.put(dataType.getShortName(), dataType);
-		}
-		class2DataTypeMap = Collections.unmodifiableMap(c2d);
-		interface2DataTypeMap = Collections.unmodifiableMap(i2d);
-		allClass2DataTypeMap = Collections.unmodifiableMap(ac2d);
-		allInterface2DataTypeMap = Collections.unmodifiableMap(ai2d);
-		uri2DataType = Collections.unmodifiableMap(u2d);
-		shortName2DataType = Collections.unmodifiableMap(s2d);
-	}
-	public static Set<DataTypeEnum> getPrimaryDataTypes(Class<?> javaClass){
-		Set<DataTypeEnum> dataTypes = EnumSet.noneOf(DataTypeEnum.class);
-		Set<DataTypeEnum> classesTypes = class2DataTypeMap.get(javaClass);
-		if(classesTypes != null){
-			dataTypes.addAll(classesTypes);
-		}
-		for(Entry<Class<?>, Set<DataTypeEnum>> entry : interface2DataTypeMap.entrySet()){
-			if(entry.getKey().isAssignableFrom(javaClass)){
-				dataTypes.addAll(entry.getValue());
-			}
-		}
-		return dataTypes;
-		
-	}
-	public static Set<DataTypeEnum> getAllDataTypes(Class<?> javaClass){
-		//start with the primary
-		Set<DataTypeEnum> all = getPrimaryDataTypes(javaClass);
-		//now add the additional types
-		Set<DataTypeEnum> additionalClassesTypes = allClass2DataTypeMap.get(javaClass);
-		if(additionalClassesTypes != null){
-			all.addAll(additionalClassesTypes);
-		}
-		for(Entry<Class<?>, Set<DataTypeEnum>> entry : allInterface2DataTypeMap.entrySet()){
-			if(entry.getKey().isAssignableFrom(javaClass)){
-				all.addAll(entry.getValue());
-			}
-		}
-		return all;
-	}
-//	public static DataTypeEnum getDataType(Class<?> javaClass){
-//		List<DataTypeEnum> dataTypes = getAllDataTypes(javaClass);
-//		return dataTypes.isEmpty()?null:dataTypes.get(0);
-//	}
-	public static DataTypeEnum getDataType(String uri){
-		return uri2DataType.get(uri);
-	}
-	public static DataTypeEnum getDataTypeByShortName(String shortName){
-		return shortName2DataType.get(shortName);
-	}
+    //Rick specific
+    //Reference
+    Reference(NamespaceEnum.rickModel,"ref",Reference.class),
+    //Natural language Text
+    Text(NamespaceEnum.rickModel,"text",Text.class),
+    //xsd types
+    /**
+     * currently URIs are preferable mapped to {@link Reference}, because there
+     * may be RDF URIs that are not valid {@link URI}s nor {@link URL}s. However
+     * existing URI and URL instances are also accepted.
+     */
+    AnyUri("anyURI",Reference.class,URI.class,URL.class),
+    Boolean("boolean",Boolean.class),
+    Byte("byte",Byte.class),
+    Short("short",Short.class),
+    Integer("integer",BigInteger.class),
+    Decimal("decimal",BigDecimal.class),
+    Int("int",Integer.class),
+    Long("long",Long.class),
+    Float("float",Float.class),
+    Double("double",Double.class),
+    String("string",String.class,Text.class),
+    Time("time",Date.class), //TODO: check if the XML calendar would be better
+    Date("date",Date.class),
+    DateTime("dateTime",Date.class),
+    Duration("duration",Duration.class),
+    ;
+    final Class<?> javaType;
+    final QName qName;
+    final String shortName;
+    final String uri;
+    final Set<Class<?>> additional;
+    DataTypeEnum(Class<?> javaType,Class<?>...additional){
+        this(null,null,javaType,additional);
+    }
+    DataTypeEnum(String localName,Class<?> javaType,Class<?>...additional){
+        this(null,localName,javaType,additional);
+    }
+    private DataTypeEnum(NamespaceEnum namespace,Class<?> javaType,Class<?>...additional) {
+        this(namespace,null,javaType,additional);
+    }
+    private DataTypeEnum(NamespaceEnum namespace,String localName,Class<?> javaType,Class<?>...additional) {
+        if(namespace == null){
+            namespace = NamespaceEnum.xsd;
+        }
+        if(localName == null){
+            localName = name();
+        }
+        if(additional != null && additional.length>0){
+            this.additional = Collections.unmodifiableSet(new HashSet<Class<?>>(Arrays.asList(additional)));
+        } else {
+            this.additional = Collections.emptySet();
+        }
+        this.javaType = javaType;
+        this.qName = new QName(namespace.getNamespace(), localName, namespace.getPrefix());
+        //a lot of accesses will be based on the Uri and the shortName.
+        // -> so store the IDs and the shortName as local Vars.
+        this.shortName = qName.getPrefix()+':'+qName.getLocalPart();
+        this.uri = qName.getNamespaceURI()+qName.getLocalPart();
+    }
+    public final String getLocalName() {
+        return qName.getLocalPart();
+    }
+    public final Class<?> getJavaType() {
+        return javaType;
+    }
+    public Set<Class<?>> getAdditionalJavaTypes() {
+        return additional;
+    }
+    public final NamespaceEnum getNamespace() {
+        return NamespaceEnum.forNamespace(qName.getNamespaceURI());
+    }
+    public final String getUri(){
+        return uri;
+    }
+    public final String getShortName(){
+        return shortName;
+    }
+    public final QName getQName(){
+        return qName;
+    }
+    @Override
+    public String toString() {
+        return getUri();
+    }
+
+    static private Map<Class<?>,Set<DataTypeEnum>> class2DataTypeMap;
+    static private Map<Class<?>,Set<DataTypeEnum>> interface2DataTypeMap;
+    static private Map<Class<?>,Set<DataTypeEnum>> allClass2DataTypeMap;
+    static private Map<Class<?>,Set<DataTypeEnum>> allInterface2DataTypeMap;
+    static private Map<String,DataTypeEnum> uri2DataType;
+    static private Map<String,DataTypeEnum> shortName2DataType;
+    static{
+        Map<Class<?>,Set<DataTypeEnum>> c2d = new HashMap<Class<?>, Set<DataTypeEnum>>();
+        Map<Class<?>,Set<DataTypeEnum>> i2d = new HashMap<Class<?>, Set<DataTypeEnum>>();
+        Map<Class<?>,Set<DataTypeEnum>> ac2d = new HashMap<Class<?>, Set<DataTypeEnum>>();
+        Map<Class<?>,Set<DataTypeEnum>> ai2d = new HashMap<Class<?>, Set<DataTypeEnum>>();
+        Map<String,DataTypeEnum> u2d = new HashMap<String, DataTypeEnum>();
+        Map<String,DataTypeEnum> s2d = new HashMap<String, DataTypeEnum>();
+        for(DataTypeEnum dataType : DataTypeEnum.values()){
+            //add primary javaType -> data type mappings
+            if(dataType.javaType.isInterface()){
+                Set<DataTypeEnum> dataTypes = i2d.get(dataType.javaType);
+                if(dataTypes == null){
+                    dataTypes = EnumSet.noneOf(DataTypeEnum.class);
+                    i2d.put(dataType.javaType, dataTypes);
+                }
+                dataTypes.add(dataType);
+            } else { //a class
+                Set<DataTypeEnum> dataTypes = c2d.get(dataType.javaType);
+                if(dataTypes == null){
+                    dataTypes = EnumSet.noneOf(DataTypeEnum.class);
+                    c2d.put(dataType.javaType, dataTypes);
+                }
+                dataTypes.add(dataType);
+            }
+            //add additional javaType -> data type mappings
+            for(Class<?> additionalClass : dataType.additional){
+                if(additionalClass.isInterface()){
+                    Set<DataTypeEnum> dataTypes = ai2d.get(additionalClass);
+                    if(dataTypes == null){
+                        dataTypes = EnumSet.noneOf(DataTypeEnum.class);
+                        ai2d.put(additionalClass, dataTypes);
+                    }
+                    dataTypes.add(dataType);
+                } else { //a class
+                    Set<DataTypeEnum> dataTypes = ac2d.get(additionalClass);
+                    if(dataTypes == null){
+                        dataTypes = EnumSet.noneOf(DataTypeEnum.class);
+                        ac2d.put(additionalClass, dataTypes);
+                    }
+                    dataTypes.add(dataType);
+                }
+            }
+            if(u2d.containsKey(dataType.getUri())){
+                throw new IllegalStateException(java.lang.String.format("Invalid configuration in DataTypeEnum because dataType uri %s is used for %s and %s!",
+                        dataType.getUri(),dataType.name(),u2d.get(dataType.getUri()).name()));
+            }
+            u2d.put(dataType.getUri(), dataType);
+            if(s2d.containsKey(dataType.getShortName())){
+                throw new IllegalStateException(java.lang.String.format("Invalid configuration in DataTypeEnum because dataType short name (prefix:localname) %s is used for %s and %s!",
+                        dataType.getShortName(),dataType.name(),s2d.get(dataType.getShortName()).name()));
+            }
+            s2d.put(dataType.getShortName(), dataType);
+        }
+        class2DataTypeMap = Collections.unmodifiableMap(c2d);
+        interface2DataTypeMap = Collections.unmodifiableMap(i2d);
+        allClass2DataTypeMap = Collections.unmodifiableMap(ac2d);
+        allInterface2DataTypeMap = Collections.unmodifiableMap(ai2d);
+        uri2DataType = Collections.unmodifiableMap(u2d);
+        shortName2DataType = Collections.unmodifiableMap(s2d);
+    }
+    public static Set<DataTypeEnum> getPrimaryDataTypes(Class<?> javaClass){
+        Set<DataTypeEnum> dataTypes = EnumSet.noneOf(DataTypeEnum.class);
+        Set<DataTypeEnum> classesTypes = class2DataTypeMap.get(javaClass);
+        if(classesTypes != null){
+            dataTypes.addAll(classesTypes);
+        }
+        for(Entry<Class<?>, Set<DataTypeEnum>> entry : interface2DataTypeMap.entrySet()){
+            if(entry.getKey().isAssignableFrom(javaClass)){
+                dataTypes.addAll(entry.getValue());
+            }
+        }
+        return dataTypes;
+
+    }
+    public static Set<DataTypeEnum> getAllDataTypes(Class<?> javaClass){
+        //start with the primary
+        Set<DataTypeEnum> all = getPrimaryDataTypes(javaClass);
+        //now add the additional types
+        Set<DataTypeEnum> additionalClassesTypes = allClass2DataTypeMap.get(javaClass);
+        if(additionalClassesTypes != null){
+            all.addAll(additionalClassesTypes);
+        }
+        for(Entry<Class<?>, Set<DataTypeEnum>> entry : allInterface2DataTypeMap.entrySet()){
+            if(entry.getKey().isAssignableFrom(javaClass)){
+                all.addAll(entry.getValue());
+            }
+        }
+        return all;
+    }
+//    public static DataTypeEnum getDataType(Class<?> javaClass){
+//        List<DataTypeEnum> dataTypes = getAllDataTypes(javaClass);
+//        return dataTypes.isEmpty()?null:dataTypes.get(0);
+//    }
+    public static DataTypeEnum getDataType(String uri){
+        return uri2DataType.get(uri);
+    }
+    public static DataTypeEnum getDataTypeByShortName(String shortName){
+        return shortName2DataType.get(shortName);
+    }
 }

Modified: incubator/stanbol/trunk/rick/generic/servicesapi/src/main/java/eu/iksproject/rick/servicesapi/defaults/NamespaceEnum.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/rick/generic/servicesapi/src/main/java/eu/iksproject/rick/servicesapi/defaults/NamespaceEnum.java?rev=1044829&r1=1044828&r2=1044829&view=diff
==============================================================================
--- incubator/stanbol/trunk/rick/generic/servicesapi/src/main/java/eu/iksproject/rick/servicesapi/defaults/NamespaceEnum.java (original)
+++ incubator/stanbol/trunk/rick/generic/servicesapi/src/main/java/eu/iksproject/rick/servicesapi/defaults/NamespaceEnum.java Sun Dec 12 15:02:34 2010
@@ -5,138 +5,138 @@ import java.util.HashMap;
 import java.util.Map;
 
 public enum NamespaceEnum {
-	//Namespaces defined by RICK
-	rickModel("rick","http://www.iks-project.eu/ontology/rick/model/"),
-	rickQuery("rick-query","http://www.iks-project.eu/ontology/rick/query/"),
+    //Namespaces defined by RICK
+    rickModel("rick","http://www.iks-project.eu/ontology/rick/model/"),
+    rickQuery("rick-query","http://www.iks-project.eu/ontology/rick/query/"),
 
 
-	//First the XML Namespaces
-	xsd("http://www.w3.org/2001/XMLSchema/"),
-	xsi("http://www.w3.org/2001/XMLSchema-instance/"),
-	xml("http://www.w3.org/XML/1998/namespace/"),
-	//Start with the semantic Web Namespaces
-	rdf("http://www.w3.org/1999/02/22-rdf-syntax-ns#"),
-	rdfs("http://www.w3.org/2000/01/rdf-schema#"),
-	owl("http://www.w3.org/2002/07/owl#"),
-	//CMIS related
-	atom("http://www.w3.org/2005/Atom"),
-	cmis("http://docs.oasis-open.org/ns/cmis/core/200908/"),
-	cmisRa("cmis-ra","http://docs.oasis-open.org/ns/cmis/restatom/200908/"),
-	//now the JCR related Namespaces
-	jcr("jcr","http://www.jcp.org/jcr/1.0/"),
-	jcrSv("jcr-sv","http://www.jcp.org/jcr/sv/1.0/"),
-	jcrNt("jcr-nt","http://www.jcp.org/jcr/nt/1.0/"),
-	jcrMix("jcr-mix","http://www.jcp.org/jcr/mix/1.0/"),
-	//Some well known Namespaces of Ontologies
-	geo("http://www.w3.org/2003/01/geo/wgs84_pos#"),
-	georss("http://www.georss.org/georss/"),
-	dcElements("dc-elements","http://purl.org/dc/elements/1.1/"),
-	dcTerms("dc","http://purl.org/dc/terms/"), // RICK prefers DC-Terms, therefore use the "dc" prefix for the terms name space
-	foaf("http://xmlns.com/foaf/0.1/"),
-	vCal("http://www.w3.org/2002/12/cal#"),
-	vCard("http://www.w3.org/2001/vcard-rdf/3.0#"),
-	skos("http://www.w3.org/2004/02/skos/core#"),
-	sioc("http://rdfs.org/sioc/ns#"),
-	siocTypes("sioc-types","http://rdfs.org/sioc/types#"),
-	bio("dc-bio","http://purl.org/vocab/bio/0.1/"),
-	rss("http://purl.org/rss/1.0/"),
-	goodRelations("gr","http://purl.org/goodrelations/v1#"),
-	//Linked Data Ontologies
-	dbpediaOnt("dbp-ont","http://dbpedia.org/ontology/"),
-	dbpediaProp("dbp-prop","http://dbpedia.org/property/"),
-	geonames("http://www.geonames.org/ontology#"),
-	;
-	String ns;
-	String prefix;
-	private NamespaceEnum(String ns) {
-		if(ns == null){
-			throw new IllegalArgumentException("The namespace MUST NOT be NULL");
-		}
-		this.ns = ns;
-	}
-	private NamespaceEnum(String prefix,String ns) {
-		this(ns);
-		this.prefix = prefix;
-	}
-	public String getNamespace(){
-		return ns;
-	}
-	public String getPrefix(){
-		return prefix == null ? name() : prefix;
-	}
-	@Override
-	public String toString() {
-		return ns;
-	}
-	/*
-	 * ==== Code for Lookup Methods based on Prefix and Namespace ====
-	 */
-	private static Map<String, NamespaceEnum> prefix2Namespace;
-	private static Map<String, NamespaceEnum> namespace2Prefix;
-	static {
-		Map<String,NamespaceEnum> p2n = new HashMap<String, NamespaceEnum>();
-		Map<String,NamespaceEnum> n2p = new HashMap<String, NamespaceEnum>();
-		//The Exceptions are only thrown to check that this Enum is configured
-		//correctly!
-		for(NamespaceEnum entry : NamespaceEnum.values()){
-			if(p2n.containsKey(entry.getPrefix())){
-				throw new IllegalStateException(
-						String.format("Prefix %s used for multiple namespaces: %s and %s",
-								entry.getPrefix(),
-								p2n.get(entry.getPrefix()),
-								entry.getNamespace()));
-			} else {
-				p2n.put(entry.getPrefix(), entry);
-			}
-			if(n2p.containsKey(entry.getNamespace())){
-				throw new IllegalStateException(
-						String.format("Multiple Prefixs %s and %s for namespaces: %s",
-								entry.getPrefix(),
-								p2n.get(entry.getNamespace()),
-								entry.getNamespace()));
-			} else {
-				n2p.put(entry.getNamespace(), entry);
-			}
-		}
-		prefix2Namespace = Collections.unmodifiableMap(p2n);
-		namespace2Prefix = Collections.unmodifiableMap(n2p);
-	}
-	/**
-	 * Getter for the {@link NamespaceEnum} entry based on the string namespace
-	 * @param namespace the name space 
-	 * @return the {@link NamespaceEnum} entry or <code>null</code> if the prased
-	 *    namespace is not present
-	 */
-	public static NamespaceEnum forNamespace(String namespace){
-		return namespace2Prefix.get(namespace);
-	}
-	/**
-	 * Getter for the {@link NamespaceEnum} entry based on the prefix
-	 * @param prefix the prefix
-	 * @return the {@link NamespaceEnum} entry or <code>null</code> if the prased
-	 *    prefix is not present
-	 */
-	public static NamespaceEnum forPrefix(String prefix){
-		return prefix2Namespace.get(prefix);
-	}
-	/**
-	 * Lookup if the parsed URI uses one of the registered prefixes of this
-	 * Enumeration. If this is the case, the prefix is replaced by the namespace
-	 * and the full URI is returned. If no prefix is returned, the
-	 * parsed URI is returned
-	 * @param shortUri the short URI
-	 * @return the full URI if the parsed shortUri uses a prefix defined by this
-	 * Enumeration. Otherwise the parsed value.
-	 */
-	public static String getFullName(String shortUri){
-		if(shortUri == null) return null;
-		int index = shortUri.indexOf(':');
-		if(index>0){
-			NamespaceEnum namespace = NamespaceEnum.forPrefix(shortUri.substring(0, index));
-			if(namespace!= null){
-				shortUri = namespace.getNamespace()+shortUri.substring(index+1);
-			}
-		}
-		return shortUri;
-	}
+    //First the XML Namespaces
+    xsd("http://www.w3.org/2001/XMLSchema/"),
+    xsi("http://www.w3.org/2001/XMLSchema-instance/"),
+    xml("http://www.w3.org/XML/1998/namespace/"),
+    //Start with the semantic Web Namespaces
+    rdf("http://www.w3.org/1999/02/22-rdf-syntax-ns#"),
+    rdfs("http://www.w3.org/2000/01/rdf-schema#"),
+    owl("http://www.w3.org/2002/07/owl#"),
+    //CMIS related
+    atom("http://www.w3.org/2005/Atom"),
+    cmis("http://docs.oasis-open.org/ns/cmis/core/200908/"),
+    cmisRa("cmis-ra","http://docs.oasis-open.org/ns/cmis/restatom/200908/"),
+    //now the JCR related Namespaces
+    jcr("jcr","http://www.jcp.org/jcr/1.0/"),
+    jcrSv("jcr-sv","http://www.jcp.org/jcr/sv/1.0/"),
+    jcrNt("jcr-nt","http://www.jcp.org/jcr/nt/1.0/"),
+    jcrMix("jcr-mix","http://www.jcp.org/jcr/mix/1.0/"),
+    //Some well known Namespaces of Ontologies
+    geo("http://www.w3.org/2003/01/geo/wgs84_pos#"),
+    georss("http://www.georss.org/georss/"),
+    dcElements("dc-elements","http://purl.org/dc/elements/1.1/"),
+    dcTerms("dc","http://purl.org/dc/terms/"), // RICK prefers DC-Terms, therefore use the "dc" prefix for the terms name space
+    foaf("http://xmlns.com/foaf/0.1/"),
+    vCal("http://www.w3.org/2002/12/cal#"),
+    vCard("http://www.w3.org/2001/vcard-rdf/3.0#"),
+    skos("http://www.w3.org/2004/02/skos/core#"),
+    sioc("http://rdfs.org/sioc/ns#"),
+    siocTypes("sioc-types","http://rdfs.org/sioc/types#"),
+    bio("dc-bio","http://purl.org/vocab/bio/0.1/"),
+    rss("http://purl.org/rss/1.0/"),
+    goodRelations("gr","http://purl.org/goodrelations/v1#"),
+    //Linked Data Ontologies
+    dbpediaOnt("dbp-ont","http://dbpedia.org/ontology/"),
+    dbpediaProp("dbp-prop","http://dbpedia.org/property/"),
+    geonames("http://www.geonames.org/ontology#"),
+    ;
+    String ns;
+    String prefix;
+    private NamespaceEnum(String ns) {
+        if(ns == null){
+            throw new IllegalArgumentException("The namespace MUST NOT be NULL");
+        }
+        this.ns = ns;
+    }
+    private NamespaceEnum(String prefix,String ns) {
+        this(ns);
+        this.prefix = prefix;
+    }
+    public String getNamespace(){
+        return ns;
+    }
+    public String getPrefix(){
+        return prefix == null ? name() : prefix;
+    }
+    @Override
+    public String toString() {
+        return ns;
+    }
+    /*
+     * ==== Code for Lookup Methods based on Prefix and Namespace ====
+     */
+    private static Map<String, NamespaceEnum> prefix2Namespace;
+    private static Map<String, NamespaceEnum> namespace2Prefix;
+    static {
+        Map<String,NamespaceEnum> p2n = new HashMap<String, NamespaceEnum>();
+        Map<String,NamespaceEnum> n2p = new HashMap<String, NamespaceEnum>();
+        //The Exceptions are only thrown to check that this Enum is configured
+        //correctly!
+        for(NamespaceEnum entry : NamespaceEnum.values()){
+            if(p2n.containsKey(entry.getPrefix())){
+                throw new IllegalStateException(
+                        String.format("Prefix %s used for multiple namespaces: %s and %s",
+                                entry.getPrefix(),
+                                p2n.get(entry.getPrefix()),
+                                entry.getNamespace()));
+            } else {
+                p2n.put(entry.getPrefix(), entry);
+            }
+            if(n2p.containsKey(entry.getNamespace())){
+                throw new IllegalStateException(
+                        String.format("Multiple Prefixs %s and %s for namespaces: %s",
+                                entry.getPrefix(),
+                                p2n.get(entry.getNamespace()),
+                                entry.getNamespace()));
+            } else {
+                n2p.put(entry.getNamespace(), entry);
+            }
+        }
+        prefix2Namespace = Collections.unmodifiableMap(p2n);
+        namespace2Prefix = Collections.unmodifiableMap(n2p);
+    }
+    /**
+     * Getter for the {@link NamespaceEnum} entry based on the string namespace
+     * @param namespace the name space
+     * @return the {@link NamespaceEnum} entry or <code>null</code> if the prased
+     *    namespace is not present
+     */
+    public static NamespaceEnum forNamespace(String namespace){
+        return namespace2Prefix.get(namespace);
+    }
+    /**
+     * Getter for the {@link NamespaceEnum} entry based on the prefix
+     * @param prefix the prefix
+     * @return the {@link NamespaceEnum} entry or <code>null</code> if the prased
+     *    prefix is not present
+     */
+    public static NamespaceEnum forPrefix(String prefix){
+        return prefix2Namespace.get(prefix);
+    }
+    /**
+     * Lookup if the parsed URI uses one of the registered prefixes of this
+     * Enumeration. If this is the case, the prefix is replaced by the namespace
+     * and the full URI is returned. If no prefix is returned, the
+     * parsed URI is returned
+     * @param shortUri the short URI
+     * @return the full URI if the parsed shortUri uses a prefix defined by this
+     * Enumeration. Otherwise the parsed value.
+     */
+    public static String getFullName(String shortUri){
+        if(shortUri == null) return null;
+        int index = shortUri.indexOf(':');
+        if(index>0){
+            NamespaceEnum namespace = NamespaceEnum.forPrefix(shortUri.substring(0, index));
+            if(namespace!= null){
+                shortUri = namespace.getNamespace()+shortUri.substring(index+1);
+            }
+        }
+        return shortUri;
+    }
 }

Modified: incubator/stanbol/trunk/rick/generic/servicesapi/src/main/java/eu/iksproject/rick/servicesapi/mapping/FieldMapper.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/rick/generic/servicesapi/src/main/java/eu/iksproject/rick/servicesapi/mapping/FieldMapper.java?rev=1044829&r1=1044828&r2=1044829&view=diff
==============================================================================
--- incubator/stanbol/trunk/rick/generic/servicesapi/src/main/java/eu/iksproject/rick/servicesapi/mapping/FieldMapper.java (original)
+++ incubator/stanbol/trunk/rick/generic/servicesapi/src/main/java/eu/iksproject/rick/servicesapi/mapping/FieldMapper.java Sun Dec 12 15:02:34 2010
@@ -7,44 +7,44 @@ import eu.iksproject.rick.servicesapi.mo
 
 public interface FieldMapper extends Cloneable{
 
-	/**
-	 * Adds a FieldMapping.
-	 */
-	void addMapping(FieldMapping mapping);
+    /**
+     * Adds a FieldMapping.
+     */
+    void addMapping(FieldMapping mapping);
 
-	//	private static String getPrefix(String fieldPattern){
-	//		return fieldPattern.split("[\\?\\*]")[0];
-	//	}
-	/**
-	 * Removes a FieldMapping.
-	 * @param mapping the Mapping to remove
-	 */
-	void removeFieldMapping(FieldMapping mapping);
+    //    private static String getPrefix(String fieldPattern){
+    //        return fieldPattern.split("[\\?\\*]")[0];
+    //    }
+    /**
+     * Removes a FieldMapping.
+     * @param mapping the Mapping to remove
+     */
+    void removeFieldMapping(FieldMapping mapping);
 
-	/**
-	 * Uses the state of the source representation and the configured mappings 
-	 * to update the state of the target {@link Representation}. The state of the
-	 * source {@link Representation} is not modified. Existing values in the
-	 * target are not removed nor modified. If the same instance is parsed as
-	 * source and target representation, fields created by the mapping process
-	 * are NOT used as source fields for further mappings.
-	 * @param source the source for the mapping process
-	 * @param target the target for the processed mappings (can be the same as source)
-	 * @return the {@link Representation} parsed as target.
-	 * TODO: This Method should return a MappingReport, that can be stored with
-	 * the {@link EntityMapping}. However the MappingActivity functionality is
-	 * not yet designed/implemented!
-	 */
-	Representation applyMappings(Representation source, Representation target);
-	/**
-	 * Getter for the unmodifiable collection of all mappings
-	 * @return the configured mappings
-	 */
-	Collection<FieldMapping> getMappings();
-	/**
-	 * Creates a clone of this FieldMapper instance with shallow copies of the
-	 * {@link FieldMapping} instances
-	 * @return the clone
-	 */
-	FieldMapper clone();
-}
\ No newline at end of file
+    /**
+     * Uses the state of the source representation and the configured mappings
+     * to update the state of the target {@link Representation}. The state of the
+     * source {@link Representation} is not modified. Existing values in the
+     * target are not removed nor modified. If the same instance is parsed as
+     * source and target representation, fields created by the mapping process
+     * are NOT used as source fields for further mappings.
+     * @param source the source for the mapping process
+     * @param target the target for the processed mappings (can be the same as source)
+     * @return the {@link Representation} parsed as target.
+     * TODO: This Method should return a MappingReport, that can be stored with
+     * the {@link EntityMapping}. However the MappingActivity functionality is
+     * not yet designed/implemented!
+     */
+    Representation applyMappings(Representation source, Representation target);
+    /**
+     * Getter for the unmodifiable collection of all mappings
+     * @return the configured mappings
+     */
+    Collection<FieldMapping> getMappings();
+    /**
+     * Creates a clone of this FieldMapper instance with shallow copies of the
+     * {@link FieldMapping} instances
+     * @return the clone
+     */
+    FieldMapper clone();
+}

Modified: incubator/stanbol/trunk/rick/generic/servicesapi/src/main/java/eu/iksproject/rick/servicesapi/mapping/FieldMapperConfig.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/rick/generic/servicesapi/src/main/java/eu/iksproject/rick/servicesapi/mapping/FieldMapperConfig.java?rev=1044829&r1=1044828&r2=1044829&view=diff
==============================================================================
--- incubator/stanbol/trunk/rick/generic/servicesapi/src/main/java/eu/iksproject/rick/servicesapi/mapping/FieldMapperConfig.java (original)
+++ incubator/stanbol/trunk/rick/generic/servicesapi/src/main/java/eu/iksproject/rick/servicesapi/mapping/FieldMapperConfig.java Sun Dec 12 15:02:34 2010
@@ -5,24 +5,24 @@ import eu.iksproject.rick.servicesapi.si
 import eu.iksproject.rick.servicesapi.site.ReferencedSite;
 /**
  * Intended to define the configuration of the fieldMapper.
- * 
+ *
  * @author Rupert Westenthaler
- * @deprecated unsure - Currently the functionality of this service is part of 
+ * @deprecated unsure - Currently the functionality of this service is part of
  * the {@link RickConfig} and the {@link ConfiguredSite} interfaces. Access
  * Methods for the {@link FieldMapper} are defined by the {@link Rick} and
  * the {@link ReferencedSite} interfaces
  */
 @Deprecated
 public interface FieldMapperConfig {
-	/**
-	 * The property used to configure the default mappings used by all 
-	 * {@link ReferencedSite} instances active within the Rick
-	 */
-	String DEFAULT_MAPPINGS = "eu.iksproject.rick.mapping.default";
-	/**
-	 * The Property used to configure mappings that are only used for
-	 * representation of a specific Site.
-	 */
-	String SITE_MAPPINGS = "eu.iksproject.rick.mapping.site";
+    /**
+     * The property used to configure the default mappings used by all
+     * {@link ReferencedSite} instances active within the Rick
+     */
+    String DEFAULT_MAPPINGS = "eu.iksproject.rick.mapping.default";
+    /**
+     * The Property used to configure mappings that are only used for
+     * representation of a specific Site.
+     */
+    String SITE_MAPPINGS = "eu.iksproject.rick.mapping.site";
 
 }