- Local usage
- Usage
- API doc
- install node and npm
- install yeoman - npm install -g yo
Or if you don't want to install yeoman :
Download and unpack the repo, open a terminal and cd to its root directory, then :
npm install -u
bower install -u
That's it !
Development :
grunt serve
Production :
grunt build
cd dist
API PROPOSAL
Returns json data about all entities in our corpus
GET http://www.dictosite.org/api/entities
{
'themes':
[
{ 'name' : 'agriculture', 'value' : 20, id:'theme-agriculture' },
{ 'name' : 'chemicals', 'value' : 8, id:'theme-chemicals' },
...
],
'speakers':
[
{ 'name' : 'Gabibbo', 'value' : 20, id:'speaker-gabibbo' },
{ 'name' : 'Fantozzi', 'value' : 2, id:'speaker-fantozzi'},
...
],
'places':
[
{ 'name' : 'Rionero in Vulture', 'value' : 2, id:'place-rionero-in-vulture' },
{ 'name' : 'Ortona', 'value' : 20, id:'place-ortona' },
...
]
}
Notes on data :
- 'value' attribute corresponds to the total number of occurence of an entity
- 'id' attribute is a slug build with : entity's type + '-' + slugified name
Returns json data about all video chunks containing the entity
GET http://www.dictosite.org/api/entities/:id
{
'name':'agriculture',
'id':'theme-agriculture',
'chunks':
[
{
'videoId' : 'an-incredible-story',
'videoTitle': 'an incredible story',
'id' : 'an-incredible-story-12',
'start':20,
'end' : 32,
'duration': 12,
'content' : 'this is the content of the chunk',
'speakers': [
{
'name': 'Nebojsa Nakicenovic',
'id': 'speaker-nebojsa-nakicenovic'
},
{
'name': 'Jan Zalasiewicz',
'id': 'speaker-jan-zalasiewicz'
},
...
],
'themes':[
{
'name' : 'agriculture',
'id':'theme-agriculture'
},
{ 'name' : 'chemicals',
'id': 'theme-chemicals'
},
...
],
'places': [
{
'name' : 'Rionero in Vulture',
'id':'place-rionero-in-vulture'
},
{
'name' : 'Ortona',
'id': 'place-ortona'
},
...
]
},
{
'videoId' : 'an-amazing-story',
'videoTitle': 'an amazing story',
'id' : 'an-amazing-story-15',
'start' : 120,
'end' : 164,
'duration': 44,
'content' : 'this is the content of the chunk',
'speakers': [
{
'name': 'Nebojsa Nakicenovic',
'id': 'speaker-nebojsa-nakicenovic'
},
{
'name': 'Jan Zalasiewicz',
'id': 'speaker-jan-zalasiewicz'
},
...
],
'themes':[
{
'name' : 'agriculture',
'id':'theme-agriculture'
},
{ 'name' : 'chemicals',
'id': 'theme-chemicals'
},
...
],
'places': [
{
'name' : 'Rionero in Vulture',
'id':'place-rionero-in-vulture'
},
{
'name' : 'Ortona',
'id': 'place-ortona'
},
...
]
},
...
]
}
Notes on data :
- 'value' attribute corresponds to the total number of occurence of an entity
- chunk's 'id' is the slugified title of its origin video + '-' + the (ordinal) position of the chunk in its original video
- tag's 'id' attribute is a slug build with : entity's type + '-' + slugified name
- 'videoId' is built with the slugified title of the video
Returns json data about the network of one or more entities
GET http://www.dictosite.org/api/network
Parameter | Type | Example | Description |
---|---|---|---|
nodes | Array | [20, 12,34] | List of entities id in the network |
{
'nodes':
[
{
'id' : 4,
'name' : 'agriculture',
'value' : 20,
'category' : 'theme'
},
{
'id' : 20,
'name' : 'chemicals',
'value' : 2,
'category' : 'theme'
},
...
],
'links':
[
{
'source' : 4,
'target' : 20,
'value' : 2
},
...
]
}
Notes on data's nodes :
- 'value' attribute corresponds to the total number of occurence of an entity
- entity's 'id' attribute corresponds to the order of the tag in nodes' array (not the same as other endpoints)
- entity's category is the category of entity (theme || speaker || place)
Notes on data's links :
- 'value' attribute is calculated by counting co-occurences of entities within the same chunk
Returns json data with either (if no id specified) all available chunks, or (if an id is specified) the info of the chunk
GET http://www.dictosite.org/api/chunks/:id?
{
'id' : 'an-amazing-story-15',
'videoTitle': 'an amazing story',
'videoId' : 'an-amazing-story',
'videoSubtitles': 'path/to/an-amazing-story.json',
'start' : 120,
'end' : 164,
'duration': 44,
'content' : 'Here is the content of the chunk',
'speakers': [
{
'name': 'Nebojsa Nakicenovic',
'id': 'speaker-nebojsa-nakicenovic'
},
{
'name': 'Jan Zalasiewicz',
'id': 'speaker-jan-zalasiewicz'
},
...
],
'themes':[
{
'name' : 'agriculture',
'id':'theme-agriculture'
},
{ 'name' : 'chemicals',
'id': 'theme-chemicals'
},
...
],
'places': [
{
'name' : 'Rionero in Vulture',
'id':'place-rionero-in-vulture'
},
{
'name' : 'Ortona',
'id': 'place-ortona'
},
...
]
}
Notes on data :
- 'value' attribute corresponds to the total number of occurence of an entity
- tag's 'id' attribute is a slug build with : entity's type + '-' + slugified name
- 'videoId' is built with the slugified title of the video
Returns json data with the info of all videos
GET http://www.dictosite.org/api/videos/:id
[
{
'videoId' : 'an-amazing-story',
'videoTitle': 'an amazing story',
'videoSubtitles': 'path/to/an-amazing-story.json'
'duration': 560,
'speakers': [
{
'name': 'Nebojsa Nakicenovic',
'id': 'speaker-nebojsa-nakicenovic'
},
{
'name': 'Jan Zalasiewicz',
'id': 'speaker-jan-zalasiewicz'
},
...
],
'themes':[
{
'name' : 'agriculture',
'id':'theme-agriculture'
},
{ 'name' : 'chemicals',
'id': 'theme-chemicals'
},
...
],
'places': [
{
'name' : 'Rionero in Vulture',
'id':'place-rionero-in-vulture'
},
{
'name' : 'Ortona',
'id': 'place-ortona'
},
...
]
},
...
]
Returns json data with the info of the video
GET http://www.dictosite.org/api/videos/:id
{
'videoId' : 'an-amazing-story',
'videoTitle': 'an amazing story',
'videoSubtitles': 'path/to/an-amazing-story.json'
'duration': 560,
'speakers': [
{
'name': 'Nebojsa Nakicenovic',
'id': 'speaker-nebojsa-nakicenovic'
},
{
'name': 'Jan Zalasiewicz',
'id': 'speaker-jan-zalasiewicz'
},
...
],
'themes':[
{
'name' : 'agriculture',
'id':'theme-agriculture'
},
{ 'name' : 'chemicals',
'id': 'theme-chemicals'
},
...
],
'places': [
{
'name' : 'Rionero in Vulture',
'id':'place-rionero-in-vulture'
},
{
'name' : 'Ortona',
'id': 'place-ortona'
},
...
]
}
Returns list of playlists represented by their metadata
GET http://www.dictosite.org/api/playlists
[
{
'id': 'about-agriculture',
'title' : 'About agriculture',
'speakers': [
{
'name': 'Nebojsa Nakicenovic',
'id': 'speaker-nebojsa-nakicenovic'
},
{
'name': 'Jan Zalasiewicz',
'id': 'speaker-jan-zalasiewicz'
},
...
],
'themes':[
{
'name' : 'agriculture',
'id':'theme-agriculture'
},
{ 'name' : 'chemicals',
'id': 'theme-chemicals'
},
...
],
'places': [
{
'name' : 'Rionero in Vulture',
'id':'place-rionero-in-vulture'
},
{
'name' : 'Ortona',
'id': 'place-ortona'
},
...
]
},
...
]
Returns metadata and chunks of a given playlist
GET http://www.dictosite.org/api/playlists/:id
{
'id': 'about-agriculture',
'title' : 'About agriculture',
'chunks':[
{
'id' : 'an-amazing-story-15',
'videoTitle': 'an amazing story',
'videoId' : 'an-amazing-story',
'videoSubtitles': 'path/to/subtitles.json',
'start' : 120,
'end' : 164,
'duration': 44,
'content' : 'Here is the content of the chunk',
'speakers': [
{
'name': 'Nebojsa Nakicenovic',
'id': 'speaker-nebojsa-nakicenovic'
},
{
'name': 'Jan Zalasiewicz',
'id': 'speaker-jan-zalasiewicz'
},
...
],
'themes':[
{
'name' : 'agriculture',
'id':'theme-agriculture'
},
{ 'name' : 'chemicals',
'id': 'theme-chemicals'
},
...
],
'places': [
{
'name' : 'Rionero in Vulture',
'id':'place-rionero-in-vulture'
},
{
'name' : 'Ortona',
'id': 'place-ortona'
},
...
]
},
....
]
}