Newer
Older
`SOLID <https://solid.mit.edu/>`__ is a project start in 2015 and lead
in the 3WC by `Tim Berners Lee <https://fr.wikipedia.org/wiki/Tim_Berners-Lee>`__, the inventor of
the web that aims to universalizes web API. He was upset that his warning about the future of the web
wasn’t heard and that’s why he propose a new way to build web
application that give power back to the final user.
SOLID project has inspired Startin’blox a lot.
Let's have an overview on how we implement `SOLID specifications <https://github.com/solid/solid-spec>`__.
.. warning::
This page should be improve. Any feedbacks is sooo welcome :)
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
Here is an example of our API :
.. code:: json
{
"@id": "https://api.alpha.happy-dev.fr/users/alice/",
"first_name": "Alice",
"last_name": "Poggioli",
"username": "alice",
"email": "alice.poggioli@paca.happy-dev.fr",
"account": {
"@id": "https://api.alpha.happy-dev.fr/accounts/alice/"
},
"name": "Alice Poggioli",
"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",
{
"get_full_name": "rdfs:label"
}
],
}
Looks like a simple JSON but it’s more
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
Did you notice the presence of a context ?
.. code:: json
{
"@type": "foaf:user",
"@context": [
"https://cdn.happy-dev.fr/owl/hdcontext.jsonld",
{
"get_full_name": "rdfs:label"
}
]
}
It is a way to go from the Json to `JsonLD <https://fr.wikipedia.org/wiki/JSON-LD>`__
That’s mean that we encode `Linked
Data <https://en.wikipedia.org/wiki/Linked_data>`__ using Json.
JsonLD is an `RDF <https://en.wikipedia.org/wiki/RDF>`__ implementation,
which is its-selft the basic language of `semantic
web <https://en.wikipedia.org/wiki/Semantic_Web>`__.
This context allows you to link object properties in a JSON document to
concepts in an `ontology <https://en.wikipedia.org/wiki/Web_Ontology_Language>`__.
Here is the context referred :
.. code:: json
{
"@context": {
"@vocab": "http://happy-dev.fr/owl/#",
"foaf": "http://xmlns.com/foaf/0.1/",
"doap": "http://usefulinc.com/ns/doap#",
"ldp": "http://www.w3.org/ns/ldp#",
"rdfs": "http://www.w3.org/2000/01/rdf-schema#",
"rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
"xsd": "http://www.w3.org/2001/XMLSchema#",
"geo": "http://www.w3.org/2003/01/geo/wgs84_pos#",
"acl": "http://www.w3.org/ns/auth/acl#",
"name": "rdfs:label",
"deadline": "xsd:dateTime",
"lat": "geo:lat",
"lng": "geo:long",
"jabberID": "foaf:jabberID",
"permissions": "acl:accessControl",
"mode": "acl:mode",
"view": "acl:Read",
"change": "acl:Write",
"add": "acl:Append",
"delete": "acl:Delete",
"control": "acl:Control"
}
}
The type we use is ``foaf``. That means that we use the FOAF ontology
which is done to describe people.
If you go to the `foaf ontology <http://xmlns.com/foaf/0.1/>`__, you’ll
see that the properties which we can use are :
account \| accountName \| accountServiceHomepage \| age \| aimChatID \|
based_near \| birthday \| currentProject \| depiction \| depicts \|
dnaChecksum \| familyName \| family_name \| firstName \| focus \|
fundedBy \| geekcode \| gender \| givenName \| givenname \| holdsAccount
\| homepage \| icqChatID \| img \| interest \| isPrimaryTopicOf \|
jabberID \| knows \| lastName \| logo \| made \| maker \| mbox \|
mbox_sha1sum \| member \| membershipClass \| msnChatID \| myersBriggs \|
name \| nick \| openid \| page \| pastProject \| phone \| plan \|
primaryTopic \| publications \| schoolHomepage \| sha1 \| skypeID \|
status \| surname \| theme \| thumbnail \| tipjar \| title \| topic \|
topic_interest \| weblog \| workInfoHomepage \| workplaceHomepage \|
yahooChatID \|
Now we can describe a user for every machines in the world using a
universal language :)
Why JsonLD is awesome ?
A document structured in RDF is a set of triplets.
An RDF triplet is an association (subject, predicate, object) :
- the “subject” represents the resource to be described;
- the “predicate” represents a type of property applicable to this
resource;
- the “object” represents a data or another resource: it is the value
of the property.
But in today life, we use to structure datas in in a file, directory,
inventory logic and not in linked triplets. It’s quickly a mess to
apprehend.
JsonLD allow us to us Linked Datas in a very intuitive way.
Let's speak about containers
----------------------------
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
So how JsonLD manage to tiny the datas ?
Let’s have a look on this part :
.. code:: 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 directory and file
structuring management.
LDP allows us to bridge the gap between the semantic esoteric world and
web api’s that are not semantic. The magic is that turning your api into
ldp is very simple. You just have to add the contexts :)
Conclusion
Solid specifications are still being written today. Startin'blox contributes to their elaboration and tries to make their use accessible to the greatest number with the minimum of technical competence.
The accessibility of these technologies is for us a major issue in the future of a more open, more egalitarian and more respectful of end users.