Skip to content

componentStaticDataDelivery

renepickhardt edited this page Sep 10, 2013 · 13 revisions

This component serves as a data store to provide content that will be edited rarely

TODOs

  • rating for entities (connection to like button)
  • reporting of entities

Requirements

  • [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)

Features

Technologies

API

  • Read
  • [Create] (#api-create)
  • [Update] (#api-update)
  • [Delete] (#api-delete)
  • [Error Handling] (#api-error)

Read

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:

type:detail person band record song genre city venue event
symbol person:symbol band:symbol record:symbol song:symbol genre:symbol city:symbol venue:symbol event:symbol
line person:line band:line record:line song:line genre:line city:line venue:line event:line
paragraph person:paragraph band:paragraph record:paragraph song:paragraph genre:paragraph city:paragraph venue:paragraph event:paragraph
profile person:profile band:profile record:profile song:profile genre:profile city:profile venue:profile event:profile
tooltip person:tooltip band:tooltip record:tooltip song:tooltip genre:tooltip city:tooltip venue:tooltip event:tooltip
search_entry person:search_entry band:search_entry record:search_entry song:search_entry genre:search_entry city:search_entry venue:search_entry event:search_entry
search_detailed person:search_detailed band:search_detailed record:search_detailed song:search_detailed genre:search_detailed city:search_detailed venue:search_detailed event:search_detailed

type="person"

detail="symbol"
{
    "id": "A07521C1B63678C0",
    "firstname": "Lukas",
    "lastname": "Schmelzeisen",
    "name": "Lukas Schmelzeisen",
    "url": "/user/Lukas+Schmelzeisen"
}
detail="line"
{
    "id": "2ED1F235685F5701",
    "firstname": "Lukas",
    "lastname": "Schmelzeisen",
    "name": "Lukas Schmelzeisen",
    "url": "/user/Lukas+Schmelzeisen",
    "city": like city:symbol,
    "birthday": "1993-01-14"
}
detail="paragraph"
{
    "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,
        ...
    ]
}
detail="profile"
TODO
detail="tooltip"
TODO
detail="search_entry"
TODO
detail="search_detailed"
TODO

type="band"

detail="symbol"
{
    "id": "3455421F8999E5AA",
    "name": "Ensiferum",
    "url": "/music/Ensiferum"
}
detail="line"
{
    "id": "92E20B5A2745CC94",
    "name": "Ensiferum",
    "url": "/music/Ensiferum",
    "foundation": "1995",
    "genre": like genre:symbol
}
detail="paragraph"
TODO
detail="profile"
TODO
detail="tooltip"
TODO
detail="search_entry"
{
    "id": "030E686B416416CD",
    "name": "Ensiferum",
    "url": "/muic/Ensiferum",
    "foundation": "1995",
    "city": like city:symbol,
    "genre": [
        like genre:symbol,
        ...
    ],
    "records: [
        like record:symbol,
        ...
    ]
}
detail="search_detailed"
{
    "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,
        ...
    ]
}

type="record"

detail="symbol"
{
    "id": "2B6716D1DDE0BC46",
    "name": "Victory Songs",
    "url": "/record/Victory+Songs",
}
detail="line"
{
    "id": "D24C4EC0EA15A6A6",
    "name": "Victory Songs",
    "url": "/record/Victory+Songs",
    "release": "2007-03-28"
}
detail="paragraph"
TODO
detail="profile"
TODO
detail="tooltip"
TODO
detail="search_entry"
TODO
detail="search_detailed"
TODO

type="song"

detail="symbol"
{
    "id": "120B79C8FD75D03E",
    "name": "Lai Lai Hei",
    "url": "/song/Lai+Lai+Hei"
}
detail="line"
{
    "id": "44DCF66332C72F21",
    "name": "Lai Lai Hei",
    "url": "/song/Lai+Lai+Hei",
    "length": "7:16",
    "record": like record:symbol
}
detail="paragraph"
TODO
detail="profile"
TODO
detail="tooltip"
TODO
detail="search_entry"
TODO
detail="search_detailed"
TODO

type="genre"

detail="symbol"
{
    "id": "6BE8B776586FA6A5",
    "name": "Pagan Metal",
    "genre": "/genre/Pagan+Metal"
}
detail="line"
TODO
detail="paragraph"
TODO
detail="profile"
TODO
detail="tooltip"
TODO
detail="search_entry"
TODO
detail="search_detailed"
TODO

type="city"

detail="symbol"
{
    "id": "0454C25C3F0C7592",
    "name": "Helsinki",
    "url": "/city/helsinki"
}
detail="line"
{
    "id": "476166283914E659",
    "name": "Helsinki",
    "url": "/city/helsinki",
    "country": "Finnland"
}
detail="paragraph"
TODO
detail="profile"
TODO
detail="tooltip"
TODO
detail="search_entry"
TODO
detail="search_detailed"
TODO

type="venue"

detail="symbol"
{
    "id": "E130A37CED8BC53F",
    "name": "Druckluftkammer",
    "url": "/venue/druckluftkammer"
}
detail="line"
{
    "id": "2DA1AC7B0FB08460",
    "name": "Druckluftkammer",
    "url": "/venue/druckluftkammer",
    "city": like city:symbol
}
detail="paragraph"
TODO
detail="profile"
TODO
detail="tooltip"
TODO
detail="search_entry"
TODO
detail="search_detailed"
TODO

type="event"

detail="symbol"
{
    "id": "F052D77AA7A5984E",
    "name": "Metalfest Loreley",
    "url": "/event/metalfest"
}
detail="line"
{
    "id": "7CC8120030D01570",
    "name": "Metalfest Loreley",
    "url": "/event/metalfest",
    "venue": like venue:symbol
}
detail="paragraph"This depen
TODO
detail="profile"
TODO
detail="tooltip"
TODO
detail="search_entry"
TODO
detail="search_detailed"
TODO

Create

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.

type="person"

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.

type="band"

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

type="record"

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.

type="song"

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.

type="genre"

Parameter Name Type Description
name String The genre's name.
description String Description of the genre.

type="city"

Parameter Name Type Description
name String The city's name.
position Position? TODO

type="venue"

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.

type="event"

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.

Update

TODO but probably very similiar to Create.

Delete

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.

Error Handling

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.

Open Questions

  • 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?

Responsible Developers

Clone this wiki locally