@@ -0,0 +1,1997 @@
+package won.owner.web.rest;%0A%0Aimport org.apache.jena.query.Dataset;%0Aimport org.apache.jena.shared.PrefixMapping;%0Aimport org.apache.jena.shared.impl.PrefixMappingImpl;%0Aimport org.apache.jena.sparql.path.Path;%0Aimport org.apache.jena.sparql.path.PathParser;%0Aimport org.springframework.beans.factory.annotation.Autowired;%0Aimport org.springframework.stereotype.Controller;%0Aimport org.springframework.web.bind.annotation.RequestMapping;%0Aimport org.springframework.web.bind.annotation.RequestMethod;%0Aimport won.protocol.highlevel.HighlevelProtocols;%0Aimport won.protocol.util.linkeddata.LinkedDataSource;%0Aimport won.protocol.vocabulary.WON;%0Aimport won.protocol.vocabulary.WONMSG;%0A%0Aimport java.net.URI;%0Aimport java.util.ArrayList;%0Aimport java.util.List;%0A%0A@Controller%0A@RequestMapping(%22/rest/agreement%22)%0Apublic class AgreementController %7B%0A%0A    @Autowired%0A    private LinkedDataSource linkedDataSource;%0A%0A    public void setLinkedDataSource(LinkedDataSource linkedDataSource) %7B%0A        this.linkedDataSource = linkedDataSource;%0A    %7D%0A%0A    @RequestMapping(value = %22/getAgreements%22, method = RequestMethod.GET)%0A    public Dataset getAgreements(String connectionUri) %7B%0A%0A        //TODO: handle exceptions%0A%0A        int depth = 3;  // depth 3 from connection gives us the messages in the conversation%0A        int maxRequests = 1000;%0A        List%3CPath%3E propertyPaths = new ArrayList%3C%3E();%0A        PrefixMapping pmap = new PrefixMappingImpl();%0A        pmap.withDefaultMappings(PrefixMapping.Standard);%0A        pmap.setNsPrefix(%22won%22, WON.getURI());%0A        pmap.setNsPrefix(%22msg%22, WONMSG.getURI());%0A        propertyPaths.add(PathParser.parse(%22won:hasEventContainer%22, pmap));%0A        propertyPaths.add(PathParser.parse(%22won:hasEventContainer/rdfs:member%22, pmap));%0A%0A        Dataset conversationDataset = linkedDataSource.getDataForResourceWithPropertyPath(%0A                URI.create(connectionUri), propertyPaths, maxRequests, depth, false);%0A%0A        return HighlevelProtocols.getAgreements(conversationDataset);%0A    %7D%0A%7D%0A

add AgreementController in owner as rest service