API for Relationships widget #33
Description
See MusicConnectionMachine/RelationshipsG3#27
I don't have rights, so please add Assigness and Deadline: 02.04.2017
so yesterdey me, @martomi and @vviro had a meeting and here is what came out of the discussion
The basic idea is that we want to display in a somewhat-table view non-trivial relationships (almost like a surprise-fun-fact table - Mozart | Liked | Getting Drunk)
Entity | Relation | Entity
When a user on the IMSLP site and exploring our widget, one of the entities is always fixed (for instance Mozart).
Now we want to have a search bar, where user can type in. The search bar should be very smart and display autosuggestions in form of:
Relations Suggestions
- Entity1
- Entity2
...
Entities Suggestions
- Entity1
- Entity2
...
Whenever a user clicks one of the suggestions, we'd make an api call with Entity | Entity
expecting relations
as response or Entity | Relations
expecting entities
as response to display the table view Entity | Relation | Entity
Requirement: for the autosuggestions
-
the API
GET /autosuggest
should accept:
a single paramquery: { primaryEntity, searchInput, }
-
the API should deliver:
{
entitites: [ { title: '...', importance: '...', confidence: '...' }, { ... } ]
relations: [ { title: '...', importance: '...', confidence: '...' }, { ... } ]
}
at least title
is required, importance
and confidence
would be nice.
Requirement: for data display
- The API
GET /relations
should accept:
a single paramquery: { primaryEntity: String, secondaryEntity: String, }
and return
{
relations: [ { title: '...', importance: '...', confidence: '...' }, { ... } ]
}
- The API
/entities
should accept:
a single paramquery: { primaryEntity: String, relation: String, }
and return
{
entities: [ { title: '...', importance: '...', confidence: '...' }, { ... } ]
}
@martomi can you double check if the API as defined is OK? Please edit the post directly if I missed something.
@vviro also encourages us to talk to him more often.