commit a0f27d8bdb0a8aca36b03dfa281d873c4a5a2706
Author: Cherian Mathew <c.mathew@bgbm.org>
Date:   Wed Nov 27 10:55:26 2013 +0000

    remote.xml : added simple rdf marshaller (named rdfMarshaller) for the web service rdf responses
    RdfViewTest, OaiPmhViewTest : changed SpringBeanByType annotation to SpringBeanByName since we have now two marshallers (remote.xml)
    RdfView, XmlView, OaiPmhResponseView : added qualifier for autowired marshaller since we now have two marshallers (remote.xml)
    RdfView : added implementation for marshalling (recognised) rdf objects
    RdfViewTest : added test for marshalling NameInformationRdf
    mappings.xml : addedd dozer mappings for mapping fields from NameInformation to NameInformationRdf
    TDWGNamespacePrefixMapper : added new namespaces, including our own
    cdmlib-remote-servlet.xml : added new rdf view to configuration
    NameCatalogueController : added call to deproxy NonViralName
    TaxonConcept : made HasRelationship fields public since it can be potentially used in other classes

diff --git a/cdmlib-model/src/main/java/eu/etaxonomy/cdm/jaxb/TDWGNamespacePrefixMapper.java b/cdmlib-model/src/main/java/eu/etaxonomy/cdm/jaxb/TDWGNamespacePrefixMapper.java
index 9369deb915..e44085fd2c 100644
--- a/cdmlib-model/src/main/java/eu/etaxonomy/cdm/jaxb/TDWGNamespacePrefixMapper.java
+++ b/cdmlib-model/src/main/java/eu/etaxonomy/cdm/jaxb/TDWGNamespacePrefixMapper.java
@@ -17,6 +17,7 @@ public class TDWGNamespacePrefixMapper extends NamespacePrefixMapper {
 	private static final String XML_PREFIX = "xml";
 	private static final String DC_PREFIX = "dc";
 	private static final String DCTERMS_PREFIX = "dcterms";
+	private static final String DCTERMS_TDWG_PREFIX = "dwcterms";
 	private static final String OWL_PREFIX = "owl";
 	private static final String TAXONNAME_PREFIX = "tn";
 	private static final String TAXONCONCEPT_PREFIX = "tc";
@@ -28,11 +29,14 @@ public class TDWGNamespacePrefixMapper extends NamespacePrefixMapper {
 	private static final String GEOGRAPHICALREGION_PREFIX = "gr";
 	private static final String OAIPMH_PREFIX = "oai";
 	private static final String OAIDC_PREFIX = "oai_dc";
+	
+	private static final String CDM_NAMEINFO_PREFIX = "cdmni";
 		
 	public static final String XML_NAMESPACE = "http://www.w3.org/XML/1998/namespace";
 	public static final String RDF_NAMESPACE = "http://www.w3.org/1999/02/22-rdf-syntax-ns#";
 	public static final String DC_NAMESPACE = "http://purl.org/dc/elements/1.1/";
 	public static final String DCTERMS_NAMESPACE = "http://purl.org/dc/terms/";
+	public static final String DCTERMS_TDWG_NAMESPACE = "http://rs.tdwg.org/dwc/terms/";
 	public static final String OWL_NAMESPACE = "http://www.w3.org/2002/07/owl#";
 	public static final String TAXONNAME_NAMESPACE = "http://rs.tdwg.org/ontology/voc/TaxonName#";
 	public static final String TAXONCONCEPT_NAMESPACE = "http://rs.tdwg.org/ontology/voc/TaxonConcept#";
@@ -45,6 +49,8 @@ public class TDWGNamespacePrefixMapper extends NamespacePrefixMapper {
 	public static final String OAIPMH_NAMESPACE = "http://www.openarchives.org/OAI/2.0/";
 	public static final String OAIDC_NAMESPACE = "http://www.openarchives.org/OAI/2.0/oai_dc/";
 	
+	public static final String CDM_NAMEINFORMATION_NAMESPACE = "http://cybertaxonomy.eu/cdm/ontology/voc/NameInformation#";
+	
 	public String getPreferredPrefix(String namespaceURI, String suggestion, boolean requirePrefix) {
 		String result = suggestion;
 		
@@ -66,6 +72,10 @@ public class TDWGNamespacePrefixMapper extends NamespacePrefixMapper {
 			return TDWGNamespacePrefixMapper.DCTERMS_PREFIX;
 		}
 		
+		if(namespaceURI.equals(TDWGNamespacePrefixMapper.DCTERMS_TDWG_NAMESPACE)) {
+			return TDWGNamespacePrefixMapper.DCTERMS_TDWG_PREFIX;
+		}
+		
 		if(namespaceURI.equals(TDWGNamespacePrefixMapper.OWL_NAMESPACE)) {
 			return TDWGNamespacePrefixMapper.OWL_PREFIX;
 		}
@@ -114,6 +124,10 @@ public class TDWGNamespacePrefixMapper extends NamespacePrefixMapper {
 			return TDWGNamespacePrefixMapper.OAIDC_PREFIX;
 		}
 		
+		if(namespaceURI.equals(TDWGNamespacePrefixMapper.CDM_NAMEINFORMATION_NAMESPACE)) {
+			return TDWGNamespacePrefixMapper.CDM_NAMEINFO_PREFIX;
+		}
+		
 		return result;
 	}
 
diff --git a/cdmlib-remote-webapp/src/main/webapp/WEB-INF/cdmlib-remote-servlet.xml b/cdmlib-remote-webapp/src/main/webapp/WEB-INF/cdmlib-remote-servlet.xml
index 9c5ca5b58a..7c80df47ce 100644
--- a/cdmlib-remote-webapp/src/main/webapp/WEB-INF/cdmlib-remote-servlet.xml
+++ b/cdmlib-remote-webapp/src/main/webapp/WEB-INF/cdmlib-remote-servlet.xml
@@ -122,6 +122,7 @@
             <entry key="xml" value="application/xml" />
             <entry key="dc" value="application/xml" />
             <entry key="rdf" value="application/xml" />
+            <entry key="rdfxml" value="application/rdf+xml" />
             <entry key="json" value="application/json" />
            </map>
         </property>
@@ -140,6 +141,13 @@
                 turn caching off FOR DEBUGING ONLY !!!!
               <property name="cache" value="false"/>
               -->
+          </bean>
+          <bean id="rdfTypeViewResolver" class="eu.etaxonomy.cdm.remote.view.PatternViewResolver">
+              <property name="location" value="/WEB-INF/rdf-views.xml"/>
+              <!--
+                turn caching off FOR DEBUGING ONLY !!!!
+              <property name="cache" value="false"/>
+              -->
           </bean>
             </list>
         </property>
diff --git a/cdmlib-remote/src/main/java/eu/etaxonomy/cdm/remote/controller/dto/NameCatalogueController.java b/cdmlib-remote/src/main/java/eu/etaxonomy/cdm/remote/controller/dto/NameCatalogueController.java
index fa0fe4f66f..095a52e71a 100755
--- a/cdmlib-remote/src/main/java/eu/etaxonomy/cdm/remote/controller/dto/NameCatalogueController.java
+++ b/cdmlib-remote/src/main/java/eu/etaxonomy/cdm/remote/controller/dto/NameCatalogueController.java
@@ -822,7 +822,7 @@ public class NameCatalogueController extends BaseController<TaxonNameBase, IName
 
                     logger.info("taxon uuid " + taxon.getUuid().toString() + " original hash code : " + System.identityHashCode(taxon) + ", name class " + taxon.getName().getClass().getName());
                     // update taxon information object with taxon related data
-                    NonViralName nvn = (NonViralName) taxon.getName();
+                    NonViralName nvn = CdmBase.deproxy(taxon.getName(),NonViralName.class);
 
                     String secTitle = "" ;
                     String modified = "";
diff --git a/cdmlib-remote/src/main/java/eu/etaxonomy/cdm/remote/dto/tdwg/voc/TaxonConcept.java b/cdmlib-remote/src/main/java/eu/etaxonomy/cdm/remote/dto/tdwg/voc/TaxonConcept.java
index 2ec9f8b3e9..b78537d22d 100644
--- a/cdmlib-remote/src/main/java/eu/etaxonomy/cdm/remote/dto/tdwg/voc/TaxonConcept.java
+++ b/cdmlib-remote/src/main/java/eu/etaxonomy/cdm/remote/dto/tdwg/voc/TaxonConcept.java
@@ -176,17 +176,17 @@ public class TaxonConcept extends Concept implements CycleRecoverable {
 		@XmlElement(name = "Relationship", namespace = "http://rs.tdwg.org/ontology/voc/TaxonConcept#")
 		private Relationship relationship;
 		
-		protected HasRelationship() {}
+		public HasRelationship() {}
 		
-		protected HasRelationship(Relationship relationship) {
+		public HasRelationship(Relationship relationship) {
 			this.relationship = relationship;
 		}
 		
-		protected Relationship getRelationship() {
+		public Relationship getRelationship() {
 			return relationship;
 		}
 
-		protected void setRelationship(Relationship relationship) {
+		public void setRelationship(Relationship relationship) {
 			this.relationship = relationship;
 		}
 	}
diff --git a/cdmlib-remote/src/main/java/eu/etaxonomy/cdm/remote/view/OaiPmhResponseView.java b/cdmlib-remote/src/main/java/eu/etaxonomy/cdm/remote/view/OaiPmhResponseView.java
index dde7feb042..f6fbf410e1 100644
--- a/cdmlib-remote/src/main/java/eu/etaxonomy/cdm/remote/view/OaiPmhResponseView.java
+++ b/cdmlib-remote/src/main/java/eu/etaxonomy/cdm/remote/view/OaiPmhResponseView.java
@@ -10,6 +10,7 @@ import javax.xml.transform.stream.StreamResult;
 
 import org.dozer.Mapper;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
 import org.springframework.oxm.Marshaller;
 import org.springframework.web.servlet.view.AbstractView;
 
@@ -28,6 +29,7 @@ public abstract class OaiPmhResponseView extends AbstractView {
 	protected Mapper mapper;
 	
 	@Autowired
+	@Qualifier("marshaller")
 	public void setMarshaller(Marshaller marshaller) {
 		this.marshaller = marshaller;
 	}
diff --git a/cdmlib-remote/src/main/java/eu/etaxonomy/cdm/remote/view/RdfView.java b/cdmlib-remote/src/main/java/eu/etaxonomy/cdm/remote/view/RdfView.java
index d3987219ed..2bffd52240 100644
--- a/cdmlib-remote/src/main/java/eu/etaxonomy/cdm/remote/view/RdfView.java
+++ b/cdmlib-remote/src/main/java/eu/etaxonomy/cdm/remote/view/RdfView.java
@@ -1,9 +1,22 @@
-// $Id$
+/**
+* Copyright (C) 2007 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
 package eu.etaxonomy.cdm.remote.view;
 
+
+
+import java.util.Collection;
 import java.util.HashMap;
+import java.util.Iterator;
 import java.util.Map;
 
+
+
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import javax.xml.transform.stream.StreamResult;
@@ -11,6 +24,7 @@ import javax.xml.transform.stream.StreamResult;
 import org.dozer.Mapper;
 import org.joda.time.DateTime;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
 import org.springframework.oxm.Marshaller;
 import org.springframework.web.servlet.view.AbstractView;
 
@@ -21,36 +35,91 @@ import eu.etaxonomy.cdm.model.common.IdentifiableEntity;
 import eu.etaxonomy.cdm.model.description.TaxonDescription;
 import eu.etaxonomy.cdm.model.taxon.Synonym;
 import eu.etaxonomy.cdm.model.taxon.Taxon;
+import eu.etaxonomy.cdm.remote.dto.common.RemoteResponse;
 import eu.etaxonomy.cdm.remote.dto.tdwg.BaseThing;
 import eu.etaxonomy.cdm.remote.dto.tdwg.voc.SpeciesProfileModel;
 import eu.etaxonomy.cdm.remote.dto.tdwg.voc.TaxonConcept;
+import eu.etaxonomy.cdm.remote.view.JsonView.Type;
 import eu.etaxonomy.remote.dto.rdf.Rdf;
 
 /**
- * View class which takes a MetadataResponse and returns the Source for serialization
- * @author ben
- * @see javax.xml.transform.Source
- * @see com.ibm.lsid.MetadataResponse
+ * This class handles rdf views by mapping data objects to corresponding rdf objects, which are later 
+ * run through a marshaller to produce xml or json 
+ * 
+ * @author b.clarke,c.mathew
+ * @version 1.0.0
+ * @created 25-Nov-2012
  */
+
 public class RdfView extends AbstractView {
 	
-	private Marshaller marshaller;
+	//FIXME : the standard marshaller as defined in remote.xml is not used in web service views so it
+	//is commented aout for the moment.
+	
+//	private Marshaller marshaller;
+	
+	private Marshaller rdfMarshaller;
 	
 	private Mapper mapper;
 	
-	private Map<Class<? extends CdmBase>,Class<? extends BaseThing>> classMap = new HashMap<Class<? extends CdmBase>,Class<? extends BaseThing>>();
+//	private Map<Class<? extends CdmBase>,Class<? extends BaseThing>> classMap = new HashMap<Class<? extends CdmBase>,Class<? extends BaseThing>>();
+	private Map<Class<? extends RemoteResponse>,Class<? extends BaseThing>> remoteClassMap = new HashMap<Class<? extends RemoteResponse>,Class<? extends BaseThing>>();
 	
 	private Integer expiresPlus;
 	
+    public enum Type{
+        RDFXML("application/rdf+xml"),
+        RDFJSON("application/rdf+json");
+
+        private final String contentType;
+
+        Type(String contentType){
+            this.contentType = contentType;
+        }
+
+        public String getContentType(){
+            return contentType;
+        }
+    }
+
+    private Type type = Type.RDFXML;
+
+
+    public Type getType() {
+        return type;
+    }
+
+    public void setType(Type type) {
+        this.type = type;
+    }
+    
+    /*
+     * (non-Javadoc)
+     * @see org.springframework.web.servlet.View#getContentType()
+     */
+    @Override
+    public String getContentType() {
+        return type.getContentType();
+    }
+    
 	public RdfView() {
-		classMap.put(Taxon.class, TaxonConcept.class);
-		classMap.put(Synonym.class, TaxonConcept.class);
-		classMap.put(TaxonDescription.class, SpeciesProfileModel.class);
+//		classMap.put(Taxon.class, TaxonConcept.class);
+//		classMap.put(Synonym.class, TaxonConcept.class);
+//		classMap.put(TaxonDescription.class, SpeciesProfileModel.class);
+		
+		remoteClassMap.put(eu.etaxonomy.cdm.remote.dto.namecatalogue.NameInformation.class, 
+				eu.etaxonomy.cdm.remote.dto.cdm.NameInformationRdf.class);
 	}
 	
+//	@Autowired
+//	public void setMarshaller(Marshaller marshaller) {
+//		this.marshaller = marshaller;
+//	}
+	
 	@Autowired
-	public void setMarshaller(Marshaller marshaller) {
-		this.marshaller = marshaller;
+	@Qualifier("rdfMarshaller")
+	public void setRdfMarshaller(Marshaller rdfMarshaller) {
+		this.rdfMarshaller = rdfMarshaller;
 	}
 	
 	@Autowired
@@ -69,19 +138,35 @@ public class RdfView extends AbstractView {
 		    DateTime expires = new DateTime();
 	        response.setHeader(HTTPConstants.EXPIRES_HEADER, HTTPConstants.HTTP_DATE_FORMAT.format(expires.plusDays(expiresPlus).toDate()));
 	    }
-		
+			
+		rdfMarshaller.marshal(buildRdf(model), new StreamResult(response.getOutputStream()));
+	}
+	
+	
+	public Rdf buildRdf(Map model) {
 		Rdf rdf = new Rdf();
 		for(Object object : model.values()) {
-		    if(object instanceof IdentifiableEntity) {
-		        IdentifiableEntity identifiableEntity = (IdentifiableEntity)object;
-		        Class clazz = classMap.get(identifiableEntity.getClass());
-		        if(clazz != null) {
-		          rdf.addThing((BaseThing)mapper.map(identifiableEntity, clazz));
-		        }
+//		    if(object instanceof IdentifiableEntity) {
+//		        IdentifiableEntity identifiableEntity = (IdentifiableEntity)object;
+//		        Class clazz = classMap.get(identifiableEntity.getClass());
+//		        if(clazz != null) {
+//		          rdf.addThing((BaseThing)mapper.map(identifiableEntity, clazz));
+//		        }
+//		    } else 
+		    if(object instanceof Collection) {
+		    	Collection c = (Collection)object;
+		    	Iterator itr = c.iterator();
+		    	while(itr.hasNext()) {		    		
+		    		Object obj = itr.next();
+		    		Class clazz = remoteClassMap.get(obj.getClass());
+		    		if(clazz != null) {
+		    			rdf.addThing((BaseThing)mapper.map(obj, clazz));
+
+		    		}
+		    	}
 		    }
-		}
-		
-		marshaller.marshal(rdf, new StreamResult(response.getOutputStream()));
+		} 	
+		return rdf;
 	}
 
 }
diff --git a/cdmlib-remote/src/main/java/eu/etaxonomy/cdm/remote/view/XmlView.java b/cdmlib-remote/src/main/java/eu/etaxonomy/cdm/remote/view/XmlView.java
index ae16b5f30f..15e2d4b58c 100644
--- a/cdmlib-remote/src/main/java/eu/etaxonomy/cdm/remote/view/XmlView.java
+++ b/cdmlib-remote/src/main/java/eu/etaxonomy/cdm/remote/view/XmlView.java
@@ -8,6 +8,7 @@ import javax.servlet.http.HttpServletResponse;
 import javax.xml.transform.stream.StreamResult;
 
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
 import org.springframework.oxm.Marshaller;
 import org.springframework.web.servlet.view.AbstractView;
 
@@ -40,6 +41,7 @@ public class XmlView extends AbstractView {
     }
 
     @Autowired
+    @Qualifier("marshaller")
     public void setMarshaller(Marshaller marshaller) {
         this.marshaller = marshaller;
     }
diff --git a/cdmlib-remote/src/main/java/eu/etaxonomy/remote/dto/rdf/Rdf.java b/cdmlib-remote/src/main/java/eu/etaxonomy/remote/dto/rdf/Rdf.java
index d0e0fefe49..fa49d028ea 100644
--- a/cdmlib-remote/src/main/java/eu/etaxonomy/remote/dto/rdf/Rdf.java
+++ b/cdmlib-remote/src/main/java/eu/etaxonomy/remote/dto/rdf/Rdf.java
@@ -42,7 +42,8 @@ public class Rdf {
 
     @XmlElements({
 	  @XmlElement(name = "TaxonConcept", namespace = "http://rs.tdwg.org/ontology/voc/TaxonConcept#", type = TaxonConcept.class),
-	  @XmlElement(name = "SpeciesProfileModel", namespace = "http://rs.tdwg.org/ontology/voc/SpeciesProfileModel#", type = SpeciesProfileModel.class)
+	  @XmlElement(name = "SpeciesProfileModel", namespace = "http://rs.tdwg.org/ontology/voc/SpeciesProfileModel#", type = SpeciesProfileModel.class),
+	  @XmlElement(name = "NameInformation", namespace = "http://cybertaxonomy.eu/cdm/ontology/voc/NameInformation#")
     })
     protected Set<BaseThing> things = new HashSet<BaseThing>();
 
diff --git a/cdmlib-remote/src/main/resources/eu/etaxonomy/cdm/remote.xml b/cdmlib-remote/src/main/resources/eu/etaxonomy/cdm/remote.xml
index 4a2cb4a569..81de67ed6b 100644
--- a/cdmlib-remote/src/main/resources/eu/etaxonomy/cdm/remote.xml
+++ b/cdmlib-remote/src/main/resources/eu/etaxonomy/cdm/remote.xml
@@ -10,7 +10,7 @@
     ">
 
 
-  <bean id="marshaller" class="org.springframework.oxm.jaxb.Jaxb2Marshaller">
+  <bean id="marshaller" name="marshaller" class="org.springframework.oxm.jaxb.Jaxb2Marshaller">
     <property name="classesToBeBound">
       <list>
         <value>eu.etaxonomy.remote.dto.rdf.Rdf</value>
@@ -30,6 +30,22 @@
       </map>
     </property>
   </bean>
+  
+  <bean id="rdfMarshaller" name="rdfMarshaller" class="org.springframework.oxm.jaxb.Jaxb2Marshaller">
+    <property name="classesToBeBound">
+      <list>
+        <value>eu.etaxonomy.remote.dto.rdf.Rdf</value>
+        <value>eu.etaxonomy.cdm.remote.dto.cdm.NameInformationRdf</value>
+      </list>
+    </property>
+    <property name="marshallerProperties">
+      <map>
+        <entry key="com.sun.xml.bind.namespacePrefixMapper">
+          <bean class="eu.etaxonomy.cdm.jaxb.TDWGNamespacePrefixMapper"/>
+        </entry>
+      </map>
+    </property>
+  </bean>
 
   <bean id="dozerMapper" class="eu.etaxonomy.cdm.remote.dto.assembler.DozerBeanMapperFactoryBean">
     <property name="mappingFiles">
diff --git a/cdmlib-remote/src/main/resources/eu/etaxonomy/cdm/remote/dto/tdwg/mappings.xml b/cdmlib-remote/src/main/resources/eu/etaxonomy/cdm/remote/dto/tdwg/mappings.xml
index f46e5a4095..e04530404e 100644
--- a/cdmlib-remote/src/main/resources/eu/etaxonomy/cdm/remote/dto/tdwg/mappings.xml
+++ b/cdmlib-remote/src/main/resources/eu/etaxonomy/cdm/remote/dto/tdwg/mappings.xml
@@ -98,5 +98,39 @@
           <b>nameComplete</b>
         </field>
     </mapping>
+    
+	<!-- mappings for the name catalogue dtos-->
+	<mapping wildcard="false">  
+        <class-a>eu.etaxonomy.cdm.remote.dto.namecatalogue.NameInformation</class-a>
+        <class-b>eu.etaxonomy.cdm.remote.dto.cdm.NameInformationRdf</class-b>
+        <field>
+          <a>request.nameUuid</a>
+          <b>scientificNameID</b>
+        </field>
+        <field>
+          <a>response.name</a>
+          <b>nameComplete</b>
+        </field>
+        <field>
+          <a>response.title</a>
+          <b>title</b>
+        </field>
+        <field>
+          <a>response.rank</a>
+          <b>rankString</b>
+        </field>
+        <field>
+          <a>response.citation</a>
+          <b>references</b>
+        </field>
+        <field>
+          <a>response.nomenclatureStatus</a>
+          <b>typeStatus</b>
+        </field>
+        <field>
+          <a>response.taxonUuids</a>
+          <b>taxonUuids</b>
+        </field>
+    </mapping>
       
 </mappings>
diff --git a/cdmlib-remote/src/test/java/eu/etaxonomy/cdm/remote/view/OaiPmhViewTest.java b/cdmlib-remote/src/test/java/eu/etaxonomy/cdm/remote/view/OaiPmhViewTest.java
index b339443749..f5b13116cf 100644
--- a/cdmlib-remote/src/test/java/eu/etaxonomy/cdm/remote/view/OaiPmhViewTest.java
+++ b/cdmlib-remote/src/test/java/eu/etaxonomy/cdm/remote/view/OaiPmhViewTest.java
@@ -21,6 +21,7 @@ import org.springframework.mock.web.MockHttpServletResponse;
 import org.springframework.oxm.Marshaller;
 import org.unitils.UnitilsJUnit4;
 import org.unitils.spring.annotation.SpringApplicationContext;
+import org.unitils.spring.annotation.SpringBeanByName;
 import org.unitils.spring.annotation.SpringBeanByType;
 
 import eu.etaxonomy.cdm.api.service.pager.Pager;
@@ -49,7 +50,7 @@ public class OaiPmhViewTest extends UnitilsJUnit4 {
 
     public static final Logger logger = Logger.getLogger(OaiPmhViewTest.class);
 
-    @SpringBeanByType
+    @SpringBeanByName
     private Marshaller marshaller;
 
     @SpringBeanByType
diff --git a/cdmlib-remote/src/test/java/eu/etaxonomy/cdm/remote/view/RdfViewTest.java b/cdmlib-remote/src/test/java/eu/etaxonomy/cdm/remote/view/RdfViewTest.java
index bbaffa6450..ad5c34ff78 100644
--- a/cdmlib-remote/src/test/java/eu/etaxonomy/cdm/remote/view/RdfViewTest.java
+++ b/cdmlib-remote/src/test/java/eu/etaxonomy/cdm/remote/view/RdfViewTest.java
@@ -7,8 +7,10 @@ import java.io.OutputStreamWriter;
 import java.io.StringReader;
 import java.io.Writer;
 import java.net.URI;
+import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.HashSet;
+import java.util.List;
 import java.util.Map;
 import java.util.Set;
 
@@ -16,6 +18,7 @@ import javax.xml.transform.stream.StreamResult;
 
 import org.custommonkey.xmlunit.XMLAssert;
 import org.custommonkey.xmlunit.XMLUnit;
+import org.dozer.Mapper;
 import org.joda.time.DateTime;
 import org.joda.time.DateTimeZone;
 import org.junit.Before;
@@ -24,9 +27,11 @@ import org.junit.Test;
 import org.springframework.oxm.Marshaller;
 import org.unitils.UnitilsJUnit4;
 import org.unitils.spring.annotation.SpringApplicationContext;
+import org.unitils.spring.annotation.SpringBeanByName;
 import org.unitils.spring.annotation.SpringBeanByType;
 
 import eu.etaxonomy.cdm.remote.dto.dc.Relation;
+import eu.etaxonomy.cdm.remote.dto.namecatalogue.NameInformation;
 import eu.etaxonomy.cdm.remote.dto.tdwg.voc.InfoItem;
 import eu.etaxonomy.cdm.remote.dto.tdwg.voc.PublicationCitation;
 import eu.etaxonomy.cdm.remote.dto.tdwg.voc.Relationship;
@@ -41,9 +46,15 @@ import eu.etaxonomy.remote.dto.rdf.Rdf;
 @SpringApplicationContext("file:./target/test-classes/eu/etaxonomy/cdm/applicationContext-test.xml")
 public class RdfViewTest extends UnitilsJUnit4 {
 
-	@SpringBeanByType
+	@SpringBeanByName
 	private Marshaller marshaller;
 
+	@SpringBeanByName
+	private Marshaller rdfMarshaller;
+	
+    @SpringBeanByType
+    private Mapper mapper;
+    
 	private Rdf rdf;
 	private TaxonConcept taxonConcept;
 	private SpeciesProfileModel speciesProfileModel;
@@ -123,7 +134,7 @@ public class RdfViewTest extends UnitilsJUnit4 {
 		writer.close();
 
 		String resource = "/eu/etaxonomy/cdm/remote/view/RdfViewTest.rdf";
-//		System.out.println(new String(outputStream.toByteArray()));
+		System.out.println(new String(outputStream.toByteArray()));
 		XMLAssert.assertXMLEqual(new InputStreamReader(this.getClass().getResourceAsStream(resource)),new StringReader(new String(outputStream.toByteArray())));
 	}
 
@@ -139,5 +150,40 @@ public class RdfViewTest extends UnitilsJUnit4 {
 //		System.out.println(new String(outputStream.toByteArray()));
 //		XMLAssert.assertXMLEqual(new InputStreamReader(this.getClass().getResourceAsStream(resource)),new StringReader(new String(outputStream.toByteArray())));
 	}
+	
+	@Test
+	public void testNameInformationRdf() throws Exception {
+		
+		Map model = new HashMap<String,List<NameInformation>>();
+		List niList = new ArrayList();
+		NameInformation ni = new NameInformation();
+		ni.setRequest("64cf8cf8-f56a-4411-8f49-c3dc95ea257a");
+		ni.setResponse("Platalea leucorodia Linnaeus, 1758",
+				"Platalea leucorodia",
+				"Species",
+				new HashSet(),
+				null,
+				new HashSet(),
+				new HashSet(),
+				new HashSet());
+		ni.getResponse().addToTaxonUuids("1a5bcb42-146f-42e5-9136-1b21d170163e");
+		niList.add(ni);
+		model.put("64cf8cf8-f56a-4411-8f49-c3dc95ea257a", niList);
+		RdfView rdfView = new RdfView();
+		rdfView.setMapper(mapper);
+		rdfView.setRdfMarshaller(marshaller);
+		rdf = rdfView.buildRdf(model);
+		
+		ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
+		Writer writer = new BufferedWriter(new OutputStreamWriter(outputStream,"UTF-8" ));
+		rdfMarshaller.marshal(rdf, new StreamResult(writer));		
+		writer.close();
+		System.out.println(new String(outputStream.toByteArray()));
+		
+		String resource = "/eu/etaxonomy/cdm/remote/view/NameInformationTest.rdf";
+		XMLAssert.assertXMLEqual(new InputStreamReader(this.getClass().getResourceAsStream(resource)),new StringReader(new String(outputStream.toByteArray())));
+	}
+	
+	
 
 }
