package org.dspace.foresite;

import java.net.URI;
import java.net.URISyntaxException;

import org.junit.Test;


public class AggregationTest {
	
	@Test
	public void testAggregation() throws OREException, URISyntaxException, ORESerialiserException
	{
			Aggregation ag1= OREFactory.createAggregation(new URI("http://www.ciaomondo.agg/#12"));
			ResourceMap rem1= OREFactory.createResourceMap(new URI("http://www.ciaomondo.rem/#12"));
			ag1.addSeeAlso(new URI("http://www.uri.seealso.com/ciao"));
			AggregatedResource agregated1= OREFactory.createAggregatedResource(new URI("http://www.aggregated.com/agres1"));
			AggregatedResource agregated2= OREFactory.createAggregatedResource(new URI("http://www.aggregated.com/agres2"));
			Predicate pred2= new Predicate();
			String NameSpacePredicato="http://www.Doroty.hbcde/relations/";
			pred2.setNamespace(NameSpacePredicato);
			pred2.setPrefix("doroty");
			pred2.setURI(new URI(NameSpacePredicato+"hasCompoundObject"));
			
			ag1.addAggregatedResource(agregated1);
			ag1.addAggregatedResource(agregated2);
			rem1.setAggregation(ag1);
			Triple t2= OREFactory.createTriple(agregated1, pred2, agregated2);
			rem1.addTriple(t2);
			
			
			ORESerialiser serial = ORESerialiserFactory.getInstance("RDF/XML");
			ResourceMapDocument doc = serial.serialise(rem1);
			String serialisation = doc.toString();
			System.out.println(serialisation);
			
			
		
		
	}

}
