| ... | ... | @@ -15,6 +15,33 @@ Here is an example of our API : |
|
|
|
"profile": {
|
|
|
|
"@id": "https://api.alpha.happy-dev.fr/profiles/alice/"
|
|
|
|
},
|
|
|
|
"circles": {
|
|
|
|
"@id": "https://api.alpha.happy-dev.fr/users/alice/circles/",
|
|
|
|
"@type": "ldp:Container",
|
|
|
|
"ldp:contains": [
|
|
|
|
{
|
|
|
|
"@id": "https://api.alpha.happy-dev.fr/circle-members/23/"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"@id": "https://api.alpha.happy-dev.fr/circle-members/54/"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"@id": "https://api.alpha.happy-dev.fr/circle-members/656/"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"permissions": [
|
|
|
|
{
|
|
|
|
"mode": {
|
|
|
|
"@type": "add"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"mode": {
|
|
|
|
"@type": "view"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"@type": "foaf:user",
|
|
|
|
"@context": [
|
|
|
|
"https://cdn.happy-dev.fr/owl/hdcontext.jsonld",
|
| ... | ... | @@ -102,4 +129,41 @@ JsonLD allow us to us Linked Datas in a very intuitive way. |
|
|
|
|
|
|
|
So how JsonLD manage to tiny the datas ?
|
|
|
|
|
|
|
|
Let's have a look on this part :
|
|
|
|
|
|
|
|
```json
|
|
|
|
"circles": {
|
|
|
|
"@id": "https://api.alpha.happy-dev.fr/users/alice/circles/",
|
|
|
|
"@type": "ldp:Container",
|
|
|
|
"ldp:contains": [
|
|
|
|
{
|
|
|
|
"@id": "https://api.alpha.happy-dev.fr/circle-members/23/"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"@id": "https://api.alpha.happy-dev.fr/circle-members/54/"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"@id": "https://api.alpha.happy-dev.fr/circle-members/656/"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"permissions": [
|
|
|
|
{
|
|
|
|
"mode": {
|
|
|
|
"@type": "add"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"mode": {
|
|
|
|
"@type": "view"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
In web semantic language, that's mean : the resource pointed by the uri "https://api.alpha.happy-dev.fr/users/alice/circles/" virtually contains thoses resources.
|
|
|
|
|
|
|
|
With this trick, we stay in a semantic logic with a repository management.
|
|
|
|
|
|
|
|
That's the reason why JsonLD is very used to manipulate semantic datas.
|
|
|
|
|