implement HighlevelProtocols
@@ -3,6 +3,9 @@ package won.protocol.highlevel;
import org.apache.jena.query.Dataset;
import won.utils.acknowledgement.AcknowledgedSelection;
+import won.utils.agreement.AgreementFunction;
+import won.utils.modification.ModifiedSelection;
+import won.utils.proposal.ProposalFunction;
public class HighlevelProtocols {
@@ -10,12 +13,15 @@ public class HighlevelProtocols {
* Calculates all agreements present in the specified conversation dataset.
*/
public static Dataset getAgreements(Dataset conversationDataset) {
- //TODO: use AcknowledgedSelection, ModifiedSelection, and AgreementFunction
- //to calculate agrements
AcknowledgedSelection acknowledgedSelection = new AcknowledgedSelection();
- Dataset result = acknowledgedSelection.applyAcknowledgedSelection(conversationDataset);
+ ModifiedSelection modifiedSelection = new ModifiedSelection();
+ AgreementFunction agreementFunction = new AgreementFunction();
- return null;
+ Dataset acknowledged = acknowledgedSelection.applyAcknowledgedSelection(conversationDataset);
+ Dataset modified = modifiedSelection.applyModificationSelection(acknowledged);
+ Dataset agreed = agreementFunction.applyAgreementFunction(modified);
+
+ return agreed;
}
/**
@@ -24,10 +30,14 @@ public class HighlevelProtocols {
* @return
*/
public static Dataset getProposals(Dataset conversationDataset) {
- //TODO: use AcknowledgedSelection, ModifiedSelection, and a (yet to be created ProposalFunction)
- //to calculate all open proposals.
- return null;
- }
+ AcknowledgedSelection acknowledgedSelection = new AcknowledgedSelection();
+ ModifiedSelection modifiedSelection = new ModifiedSelection();
+ ProposalFunction proposalFunction = new ProposalFunction();
+ Dataset acknowledged = acknowledgedSelection.applyAcknowledgedSelection(conversationDataset);
+ Dataset modified = modifiedSelection.applyModificationSelection(acknowledged);
+ Dataset proposed = proposalFunction.applyProposalFunction(modified);
+ return proposed;
+ }
}
