I believe the issue boils down to how to present the type as requested in the fields parameter, while maintaining full linkage.
The primary data would of course always include everything, unless sparse fieldsets is used to reduce it. However, full linkage must be maintained so the appropriate resource objects with nothing more than type, id, and links to build the chain from primary data to the included resource.
The way I view include in this context is essentially a pre-fetch operation to batch the request for related resources without the need to individually request the items through relationship identifiers. It essentially is performing multiple requests in one. Sparse fieldsets then takes the document and reduces the result to the requested resources + any required objects for full linkage.
I have also had the urge to use sparse fieldsets to reduce the load on storage, so my advice would be to use the approach of returning minimum linkage + whatever is requested in the case of conflicting statements. In this way you would be able to retrieve all the keys required for full linkage, without including any of the unrequested data. This would still satisfy full linkage, as well the sparse fieldsets request.
Using the example you listed should yield something like this.
GET http://www.example.com/post/1?include=author&fields[post]=title
{
"type": "post",
"id": "1",
"attributes": {
"title": "It's a title."
},
"relationships": {
"author": {
"links": {
"self": "http://example.com/articles/1/relationships/author",
"related": "http://example.com/people?filter[article]=1"
},
"data":{
"type":"people", "id":"9"
}
}
},
"included":[
{
"type":"people",
"id": "9",
"attributes": {
"first-name": "Dan",
"last-name": "Gebhardt",
"twitter": "dgeb"
},
"links": {
"self": "http://example.com/people/9"
}
}
],
"links": {
"self": "http://example.com/articles/1"
}
}
Include is used to declare how far out on a particular relationship chain you would like included in this request, for convenience in this case. Sparse fieldsets is used to reduce the data sent for any of those types to the bare minimum of requested items + linkage.