-
Notifications
You must be signed in to change notification settings - Fork 10
componentStaticDataDelivery
This component serves as a data store to provide content that will be edited rarely
- rating for entities (connection to like button)
- reporting of entities
- [Band] Sell products by providing a hyperlink to a shop
- [Fan] Express yourself by static content items on your profile page
- [Fan] Purchase Merchandise (with a given shop from a band)
- about 1 write request per second (this is the amount of write requests the german wikipedia is receiving)
- several 1000 read requests per second (especially since most pages will ask several read requests)
- Read
- [Create] (#api-create)
- [Update] (#api-update)
- [Delete] (#api-delete)
- [Error Handling] (#api-error)
You request data from SDD by submitting comma-separated id:detail
pairs. An example request might look like this:
http://sdd.domain/read?E8CFBCD86A523406:search_entry,E8CFBCD86A523406:search_detailed,2F17A7D011F9640F:symbol
An id
is a specific Entity-ID you wish to get recieve information about.
The detail
field controls the amount of information that is returned. Possible values:
detail | Description |
---|---|
symbol | Icon + Text. |
line | Like symbol with a few additional information not exceeding one line. |
paragraph | Like paragraph with information around the length of a paragraph (3-4 lines). |
profile | Full page display. |
tooltip | For tooltip display at mouseover. |
search_entry | One entry in returned search results. |
search_detailed | Big "semantic display" at the search side. |
The JSON-Response would look like this:
{
"E8CFBCD86A523406:search_entry": { ... },
"E8CFBCD86A523406:search_detailed": { ... },
"2F17A7D011F9640F:symbol": { ... }
}
The response is a JSON-Object that assings each requested id:detail
pair to a JSON-Object. The format of that object depends on the Entity-Type of the submitted id
and the detail
. See the following section for details.
Use this table for easier navigation:
{
"id": "A07521C1B63678C0",
"firstname": "Lukas",
"lastname": "Schmelzeisen",
"name": "Lukas Schmelzeisen",
"url": "/user/Lukas+Schmelzeisen"
}
{
"id": "2ED1F235685F5701",
"firstname": "Lukas",
"lastname": "Schmelzeisen",
"name": "Lukas Schmelzeisen",
"url": "/user/Lukas+Schmelzeisen",
"city": like city:symbol,
"birthday": "1993-01-14"
}
{
"id": "3753AC9EC13333F6",
"firstname": "Lukas",
"lastname": "Schmelzeisen",
"name": "Lukas Schmelzeisen",
"url": "/user/Lukas+Schmelzeisen",
"city": like city:symbol,
"birthday": "1993-01-14",
"genres": [
like genre:symbol,
...
],
"bands": [
like bands:symbol,
...
]
}
TODO
TODO
TODO
TODO
{
"id": "3455421F8999E5AA",
"name": "Ensiferum",
"url": "/music/Ensiferum"
}
{
"id": "92E20B5A2745CC94",
"name": "Ensiferum",
"url": "/music/Ensiferum",
"foundation": "1995",
"genre": like genre:symbol
}
TODO
TODO
TODO
{
"id": "030E686B416416CD",
"name": "Ensiferum",
"url": "/muic/Ensiferum",
"foundation": "1995",
"city": like city:symbol,
"genre": [
like genre:symbol,
...
],
"records: [
like record:symbol,
...
]
}
{
"id": "90148BFB390A055C",
"name": "Ensiferum",
"url": "/muic/Ensiferum",
"foudation": "1995",
"city": like city:symbol,
"webpage": like webpage:symbol
"genre": [
like genre:symbol,
...
],
"bio": "Ensiferum (lat. 'schwerttragend') ist eine finnische Metal-Band ..."
"members": [
like person:symbol,
...
],
"records": [
like record:paragaph,
...
],
"songs": [
like song:line,
...
]
}
{
"id": "2B6716D1DDE0BC46",
"name": "Victory Songs",
"url": "/record/Victory+Songs",
}
{
"id": "D24C4EC0EA15A6A6",
"name": "Victory Songs",
"url": "/record/Victory+Songs",
"release": "2007-03-28"
}
TODO
TODO
TODO
TODO
TODO
{
"id": "120B79C8FD75D03E",
"name": "Lai Lai Hei",
"url": "/song/Lai+Lai+Hei"
}
{
"id": "44DCF66332C72F21",
"name": "Lai Lai Hei",
"url": "/song/Lai+Lai+Hei",
"length": "7:16",
"record": like record:symbol
}
TODO
TODO
TODO
TODO
TODO
{
"id": "6BE8B776586FA6A5",
"name": "Pagan Metal",
"genre": "/genre/Pagan+Metal"
}
TODO
TODO
TODO
TODO
TODO
TODO
{
"id": "0454C25C3F0C7592",
"name": "Helsinki",
"url": "/city/helsinki"
}
{
"id": "476166283914E659",
"name": "Helsinki",
"url": "/city/helsinki",
"country": "Finnland"
}
TODO
TODO
TODO
TODO
TODO
{
"id": "E130A37CED8BC53F",
"name": "Druckluftkammer",
"url": "/venue/druckluftkammer"
}
{
"id": "2DA1AC7B0FB08460",
"name": "Druckluftkammer",
"url": "/venue/druckluftkammer",
"city": like city:symbol
}
TODO
TODO
TODO
TODO
TODO
{
"id": "F052D77AA7A5984E",
"name": "Metalfest Loreley",
"url": "/event/metalfest"
}
{
"id": "7CC8120030D01570",
"name": "Metalfest Loreley",
"url": "/event/metalfest",
"venue": like venue:symbol
}
TODO
TODO
TODO
TODO
TODO
New Entities can be created by sending a Create-Request are sent via POST.
Parameter Name | Type | Description |
---|---|---|
id | Entity-ID | The ID for the new Entity. |
type | Enum | The type for the new Entity can be either: person , band , record , song , genre , city , venue , event . |
Remaining fields depend on the type
specified.
Parameter Name | Type | Description |
---|---|---|
name | String | The person's surname. |
firstname | String | The person's first name. |
birthday | Date | The person's birthday. |
profile | String | A string displayed in the person's profile. |
Parameter Name | Type | Description |
---|---|---|
name | String | The band's name. |
foundation | Date | The official band foundation date. |
city | City-ID | The city the band was formed in / is currently located in. |
members | Person-ID[] | Comma separated list of Person-IDs of the members in the band. |
genres | Genre-ID[] | Comma separated list of Genre-IDs of the genres the band plays. |
bio | String | The biography of the band to be displayed in the profile |
Parameter Name | Type | Description |
---|---|---|
name | String | The record's name. |
band | Band-ID[] | Comma separated list of Band-IDs of the bands that released this record. |
release | Date | The date the record was released. |
Parameter Name | Type | Description |
---|---|---|
name | String | The song's name. |
file | File? | TODO |
length | Integers | Length of the song in seconds. |
records | Records-ID[] | Comma separated list of Record-IDs of the records that contained this song. |
bands | Bands-ID[] | Comma separated list of Band-IDs that participated in the songs creation. |
Parameter Name | Type | Description |
---|---|---|
name | String | The genre's name. |
description | String | Description of the genre. |
Parameter Name | Type | Description |
---|---|---|
name | String | The city's name. |
position | Position? | TODO |
Parameter Name | Type | Description |
---|---|---|
name | String | The venue's name. |
position | Position? | TODO |
city | City-ID | The City-ID of the city the band is located in. |
Parameter Name | Type | Description |
---|---|---|
name | String | The event's name. |
venue | Venue-ID | The Venue-ID of the venue the event is held at. |
bands | Band-ID[] | Comma separated list of Band-IDs of the bands playing at this event. |
TODO but probably very similiar to Create.
Entities can be deleted by sending a Delete-Request via POST.
Parameter Name | Type | Description |
---|---|---|
ids | Entity-ID[] | Comma separated list of Entity-IDs to be deleted. |
Every JSON-Response can also include a "error" attribute pointing to an array of warnings or errors.
A response to a erroneous request looks like this:
{
... usual response in case only warnings occured ...,
"error": [
{
"type": "warning",
"id": "requestInvalidID",
"desc": "...",
"suggest": "..."
},
{
"type": "error",
"id": "databaseConnectionError",
"desc": "...",
"suggest": "..."
}
]
}
Each Error-Object consist of these fields:
Field | Type | Description |
---|---|---|
type | Enum | Either Error or Warning . |
id | Error-ID | Unique ID for this error. |
desc | String | Human-readable error description. |
suggest | String | Human-readable suggestion to fix the error. |
- Images / files in general?
- Is SDD enough? Suppose we need a list of all citys in the database (for example this might be needed for autocompletion when the user selects his home city). Can and should SDD be able to do this?
- How do URLs work? Do we just assign a unique string identifier?
- For example a city has a list of all bands in it. Realistically we want that sorted by rating. Which components are responsible?
- Format for profile/bio/description? Maybe Markdown? Or Wiki-Style?
- componentSearch usually doesn't want to show band biographies. However if a keyword of the seach query would match on the band bio, it would then be nice to display a highlighted snippet of the bio. However if SDD doesn't returned bios because most of the time they aren't needed, Search can't do highlighting, requiring SDD to do it. Should highlighting be part of SDD?
- What happens when a Entity (for example a Band) is deleted? Do we delete all relating Entities (Songs) or do we keep them? Do we delete at all or just mark as no longer visible?
-
type
field necessary for create request? - Priority queue?
- Response style?