-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathdata.js
37 lines (35 loc) · 1.3 KB
/
data.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
const assignTypeAndId = type => x => Object.assign({ type, id: x.text }, x);
const comments = [
{ text: 'zeroth comment' },
{ text: 'first comment' },
{ text: 'second comment' },
{ text: 'third comment' },
{ text: 'fourth comment' },
{ text: 'fifth comment' },
{ text: 'sixth comment' },
{ text: 'seventh comment' },
{ text: 'eighth comment' },
{ text: 'ninth comment' },
{ text: 'tenth comment' },
{ text: 'eleventh comment' },
{ text: 'twelfth comment' },
{ text: 'thirteenth comment' },
{ text: 'fourteenth comment' },
{ text: 'fifteenth comment' },
{ text: 'sixteenth comment' },
{ text: 'seventeenth comment' },
{ text: 'eighteenth comment' },
{ text: 'nineteenth comment' },
].map(assignTypeAndId('Comment')); // type is useless for this example
module.exports = [
{
id: 'cool_article',
type: 'Article',
// The reference is usualy on the child, this can be done using owl:inverseOf
// foo:hasComments owl:inverseOf foo:belongsToArticle (where foo:belongsToArticle has foo:Comment in its domain)
// The lib would resolve foo:hasComments on foo:Article using the reference on foo:Comment instances
// Here none of it is required since we just want to display how to handle relay connections
hasComments: comments.map(c => c.id),
},
...comments,
];