Suggestion

Suggestion

Introduction

One of the powerful features of AWMT API is its ability to suggest what to put in a submodel depending on the constraints and rules that apply to it.

Suggestion can be combined with search in order to provide a more accurate and relevant list of references.

Suggesting references

request.gql
query {
	model(path: "ehaaland") {
		at(submodel: "club") {
			suggest {
				path
				label
				description
			}
		}
	}
}

Suggesting from search

request.gql
query { 
	model(path: "ehaaland") {
		at(submodel: "club") {
			suggest(query: "manchester") {
				path
				label
				description
			}
		}
	}
}

In that case, supposing that the model "ehaaland" has a submodel "club", the suggestion will return the list of models that are the closest match to the search query "manchester" based on their labels and descriptions, along with a score that indicates how well they match the search query.

So in that case, if several soccer clubs are recorded as abstractions, the suggestion will return the ones that are the closest match to "manchester", such as "Manchester United", "Manchester City", etc.

Since the "club" submodel is constrained by the rule that it must be a soccer club, the suggestion will only return soccer clubs, and not, for instance, "Manchester Town Hall". This is a interesting example of the combination of structured constraints and natural language search.