I admit that I am actually not sure whether I am on the right track. I can only give some background here, you can find the project at https://findstat.org. It currently has no structured API.

I have the following “basic” resources:

- “Collections”, with identifiers of the form “Cc1234”
- “Maps”, with identifiers of the form “Mp12345”
- “Statistics”, with identifiers of the form “St123456”

All of these have some attributes, for example “Description”. “Statistics” and “Maps” also have relationships to “Collections”, for example “Domain” and “Codomain”.

I absolutely do not want to change the above identifiers. In particular, it makes sense to GET such a resource using “Statistics/St123456”.

A user will always have to specify the fields she wants to get, otherwise she only gets “type” and “id”.

Then I have a number of “compound” or “virtual” resources.

- “CompoundMaps” with identifiers of the form “Mp00020/Mp00101”
- “CompoundStatistics”, with identifiers of the form “Mp00020/Mp00101/St000005”.

One should be able to GET these using “Statistics/Mp00020/Mp00101/St000005” as a compound document (i.e., not using the endpoint “CompoundStatistics”.)

I realize that this introduces ambiguity: the type of “Statistics/St000005” is “Statistics”, although one might think it is “CompoundStatistics”. (Maybe I should rename “Statistics” to “BasicStatistics” and “CompoundStatistics” to “Statistics”…)

I thought I would represent “CompoundStatistics” as follows:

```
{
"type":"CompoundStatistics",
"id":"Mp00020/Mp00101/St000005",
"attributes":{
"Values":"[.,.] => [1,0] => [1,0] => 0\n[.,[.,.]] => [1,1,0,0] => [1,0,1,0] => 1\n[[.,.],.] => [1,0,1,0] => [1,1,0,0] => 0\n...",
"Distribution":{
"1":{
"0":1
},
"2":{
"0":1,
"1":1
}
}
},
"relationships":{
"Maps":{
"data":[
{
"type":"Maps",
"id":"Mp00020"
},
{
"type":"Maps",
"id":"Mp00101"
}
]
}
},
"Statistic":{
"data":{
"type":"Statistics",
"id":"St000005"
}
}
}
```

I dislike the “relationships” member quite a bit, it is and should be completely redundant.

It exists only because of the full-linkage requirement.

- “MatchingStatistics”, whose identifier will possibly be an identifier of a “CompoundStatistic” together with a running index, not sure about that yet.