Ruben Verborgh, Ghent University – imec
GhentJS Meetup, 10 April 2019
Ruben Verborgh
Ghent University – imec
Orange is
the new black.
Blockchain is
the new JavaScript.
GraphQL is
the new REST.
Future Web apps will access
data from different people
from different places.
That’s why, at UGent/imec,
we are querying the Web
with JavaScript.
{
"name": "Jane Doe",
"jobTitle": "developer",
"telephone": "(425) 123-4567"
}
{
"@context": "http://schema.org/",
"name": "Jane Doe",
"jobTitle": "developer",
"telephone": "(425) 123-4567"
}
{
"@context": "http://schema.org/",
"http://schema.org/name": "Jane Doe",
"http://schema.org/jobTitle": "developer",
"http://schema.org/telephone": "(425) 123-4567"
}
# List 50 people and their names
{
person(first:50) {
name
}
}
# List 50 people and their names
{
users(first:50) {
fullName
}
}
# List 50 people and their names
{
friends(first:10) {
displayName
}
}
PREFIX dbo: <http://dbpedia.org/ontology/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
# List 50 people and their names
SELECT * {
?person a dbo:Person;
rdfs:label ?name.
}
LIMIT 50
Try it out at github.com/comunica.
import { newEngine } from '@comunica/actor-init-sparql';
const engine = newEngine();
async function printResults(sparql, source) {
const result = await engine.query(sparql,
sources: [ { type: 'hypermedia', value: source } ]);
result.bindingsStream.on('data', data =>
console.log(data.toObject()));
}
Anyone can say anything about anything.
Sign in with Facebook to see this content.
Facebook works better with the native app.
This is for everyone #london2012 #oneweb #openingceremony @webfoundation @w3c
Tim Berners-Lee July 27, 2012
Solid is about choice.
The Solid ecosystem enables people
to pick the apps they need,
while
storing their data wherever they want.
People control their data,
and share it
with the apps and people they choose.
{
"@context": "https://www.w3.org/ns/activitystreams",
"id": "#ruben-likes-ghentjs",
"type": "Like",
"actor": "https://ruben.verborgh.org/profile/#me",
"object": "https://javascript.gent/#this",
"published": "2019-04-10T20:00:00Z"
}
{
"@context": "https://www.w3.org/ns/activitystreams",
"id": "#ruben-likes-ghentjs",
"type": "Like",
"actor": "https://ruben.verborgh.org/profile/#me",
"object": "https://javascript.gent/#this",
"published": "2019-04-10T20:00:00Z"
}
{
"@context": "https://www.w3.org/ns/activitystreams",
"@graph": [{
"type": "Like",
"actor": "https://ruben.verborgh.org/profile/#me",
"object": "https://javascript.gent/#this",
"published": "2019-04-10T20:00:00Z"
},{
"type": "Like",
"actor": "https://example.org/people/klaas#me",
"object": "https://javascript.gent/#this",
"published": "2019-04-10T20:05:00Z"
}]
}
data.user.friend.firstName
Proxy
await data.user.friend.firstName
Proxy
can makeawait
in front of it?
Promise
then
function!for await
… of
?
AsyncIterable
Symbol.asyncIterator
property!<LoggedIn>
<p>Welcome, <Value src="user.firstName"/></p>
<Image src="user.image" defaultSrc="profile.svg"/>
<ul>
<li><Link href="user.inbox">Your inbox</Link></li>
<li><Link href="user.homepage">Your homepage</Link></li>
</ul>
<h2>Your friends</h2>
<List src="user.friends.firstName"/>
</LoggedIn>
<LoggedIn>
<p>Welcome, <Value src="user.firstName"/></p>
<Image src="user.image" defaultSrc="profile.svg"/>
<ul>
<li><Link href="user.inbox">Your inbox</Link></li>
<li><Link href="user.homepage">Your homepage</Link></li>
</ul>
<h2>Your friends</h2>
<List src="user.friends.firstName"/>
</LoggedIn>
On the future Web,
people will control their data,
which they will store everywhere.
A new developer experience is emerging
and queries will play a major role.
See you on solid.inrupt.com!
Talk to me about: