TOAST has a RESTful API, to allow you to use it in your own applications.
The base URL for the API is: http://toast.arg-tech.org/api The following methods are available:
Description: evaluates an argumentation theory, returning a JSON description
Name | Description |
axioms | List of axioms |
premises | List of premises |
assumptions | List of assumptions |
kbPrefs | List of knowledge base preferences (note: cannot contain any axioms) |
rules | List of rules |
rulePrefs | List of rule preferences |
contrariness | List of contraries and contradictories |
link | Weakest (default) or last link preference principle |
semantics | Grounded (default), preferred or semi-stable |
query | Formula to find an (un)acceptable argument for |
transposition | True or false (default); whather or not to close the theory under transposition |
Data can be posted either as key-value pairs (in which case all lists are delimited by semi-colons), or as a JSON object (in which case, all lists are JSON arrays). For instance, using cURL:
curl -d "premises=p;q;&rules=[r1] p=>s;&contrariness=q^p;" http://toast.arg-tech.org/api/evaluate
Returns:
{
"wellformed":true,
"result":"",
"extensions":[
[
"A1: q"
]
],
"arguments":[
"A3: A2=>s",
"A2: p",
"A1: q"
],
"defeat":[
"A1>A3",
"A1>A2"
]
}
Alternatively, posting JSON:
curl -d
>'{"premises":["p","q"],"kbPrefs":["p<q"],"rules":["[r1] p=>s","[r2] q=>t"],"rulePrefs":["[r1]<[r2]"],"contrariness":["s-t"],"link":"weakest"}'
> http://toast.arg-tech.org/api/evaluate"
Returns:
{
"link":"weakest",
"kbPrefs":[
"p < q"
],
"semantics":"grounded",
"assumptions":[
],
"rulePrefs":[
"[r1] < [r2]"
],
"defeat":[
"A3>A4"
],
"axioms":[
],
"wellformed":true,
"extensions":{
"0":[
"A1",
"A2",
"A3"
]
},
"premises":[
"p",
"q"
],
"acceptableConclusions":{
"0":[
"p",
"q",
"t"
]
},
"arguments":[
"A1: p",
"A2: q",
"A4: A1=>s",
"A3: A2=>t"
],
"contrariness":[
"s-t"
]
}
Description: evaluates the provided argument ID in AIFdb, returning a JSON description.