Deduction

Deduction

Introduction

Deduction is the most basic reasoning pattern in AWMT. It can be used either for answering a question based on existing knowledge, or explaining (if possible) the reasoning behind a given statement (fact checking).

This process involves drawing conclusions from general rules or premises. Given a set of abstractions and their relationships, AWMT can deduce new information or conclusions based on the existing knowledge.

Question answering

request.gql
query {
	ask(text: "for which club does erling haaland play") @stream {
		kind
		label
		start {
			path
			label
		}
		end {
			path
			label
		}
	}
}

Answer should include the following steps :

response.json
{
	"data": {
		"ask": [
			{
				"kind": "INSTANCE_OF",
				"start": {
					"path": "erling_haaland",
					"label": "Erling Haaland"
				},
				"end": {
					"path": "football_player",
					"label": "Football player"
				}
			},
			{
				"kind": "HAS_PROPERTY",
				"label": "plays for",
				"start": {
					"path": "football_player",
					"label": "Football player"
				},
				"end": {
					"path": "football_club",
					"label": "Football club"
				}
			},
			{
				"kind": "REFERENCE",
				"start": {
					"path": "erling_haaland:plays_for"
				},
				"end": {
					"path": "manchester_city",
					"label": "Manchester City"
				}
			},
			{
				"kind": "INSTANCE_OF",
				"start": {
					"path": "manchester_city",
					"label": "Manchester City"
				},
				"end": {
					"path": "football_club",
					"label": "Football club"
				}
			}
		]
	}
}

Fact checking

In the case of a provable statement, the system should be able to explain the reasoning behind it.

response.json
query {
	explain(text: "erling haaland plays for manchester city") @stream {
		kind
		label
		start {
			path
			label
		}
		end {
			path
			label
		}
	}
}
response.json
{
	"data": {
		"explain": [
			{
				"kind": "INSTANCE_OF",
				"start": {
					"path": "erling_haaland",
					"label": "Erling Haaland"
				},
				"end": {
					"path": "football_player",
					"label": "Football player"
				}
			},
			{
				"kind": "HAS_PROPERTY",
				"label": "plays for",
				"start": {
					"path": "football_player",
					"label": "Football player"
				},
				"end": {
					"path": "football_club",
					"label": "Football club"
				}
			},
			{
				"kind": "REFERENCE",
				"start": {
					"path": "erling_haaland:plays_for"
				},
				"end": {
					"path": "manchester_city",
					"label": "Manchester City"
				}
			},
			{
				"kind": "INSTANCE_OF",
				"start": {
					"path": "manchester_city",
					"label": "Manchester City"
				},
				"end": {
					"path": "football_club",
					"label": "Football club"
				}
			}
		]
	}
}

In the case of a false statement, the system should be able to explain why it is false.

response.json
query {
	explain(text: "erling haaland plays for arsenal") @stream {
		kind
		label
		start {
			path
			label
		}
		end {
			path
			label
		}
	}
}
response.json
{
	"data": {
		"explain": [
			{
				"kind": "INSTANCE_OF",
				"start": {
					"path": "erling_haaland",
					"label": "Erling Haaland"
				},
				"end": {
					"path": "football_player",
					"label": "Football player"
				}
			},
			{
				"kind": "HAS_PROPERTY",
				"label": "plays for",
				"start": {
					"path": "football_player",
					"label": "Football player"
				},
				"end": {
					"path": "football_club",
					"label": "Football club"
				}
			},
			{
				"kind": "REFERENCE",
				"start": {
					"path": "erling_haaland:plays_for"
				},
				"end": {
					"path": "manchester_city",
					"label": "Manchester City"
				}
			},
			{
				"kind": "INSTANCE_OF",
				"start": {
					"path": "manchester_city",
					"label": "Manchester City"
				},
				"end": {
					"path": "football_club",
					"label": "Football club"
				}
			}
		]
	}
}