Re: A WebID Implementation

Melvin and Andrei:

Thanks for the complements and advice! I haven't explored rdflib.js, so 
I'll have to check that out. I actually use a few third-party libraries 
and lots of custom code for RDF handling in the browser, and I do lots 
of fetching/parsing/rendering on other pages. I guess I didn't think to 
get too fancy with the login stuff. I probably should render at least a 
name.

The site as a whole is a RESTful Linked Data portal for fictional 
things, and RDF is practically the only way the server communicates. 
Edit forms prepopulate from RDF and submit RDF to the server, and every 
user-published resource supports conneg for RDF. I'd like to release all 
of the code on GitHub at some point, but I have a lot of cleanup and 
licensing to do before then.

Anyways, I won't keep flooding the list with this thread, but I wanted 
to share my take on WebID and Linked Data so far. It's been a fantastic 
learning experience, and I hope to be a part of the future that these 
technologies will ideally bring.

Thanks again!

Sincerely,
Jeff Fuller

On 5/18/2014 6:19 PM, Melvin Carvalho wrote:
>
>
>
> On 19 May 2014 00:18, Melvin Carvalho <melvincarvalho@gmail.com 
> <mailto:melvincarvalho@gmail.com>> wrote:
>
>
>
>
>     On 19 May 2014 00:10, Andrei Sambra <andrei.sambra@gmail.com
>     <mailto:andrei.sambra@gmail.com>> wrote:
>
>         Hi Jeff,
>
>         Congratulations on your implementation! I just logged in with
>         several WebIDs and I can say that the whole logout/login
>         experience is pretty slick. Using different subdomains for
>         authentication was a clever way of avoiding certificate caching.
>
>         My only suggestion at this point would be to try and
>         personalize a bit the user experience, after login.
>         Say..displaying the user's name or picture instead of linking
>         to "Your profile".
>
>         Keep up the good work!
>
>
>     Really nice work!
>
>     Just to say here's some code that will do what Andrei suggests
>     using rdflib.js
>
>     <script src="rdflib.js"></script>
>
>             // CORS proxy
>             var PROXY = "https://rww.io/proxy?uri={uri}
>     <https://rww.io/proxy?uri=%7Buri%7D>";
>
>             // fetch user data
>             var g = $rdf.graph();
>             var f = $rdf.fetcher(g);
>             // add CORS proxy
>             $rdf.Fetcher.crossSiteProxyTemplate=PROXY;
>
>             // fetch user data
>     f.nowOrWhenFetched(webid,undefined,function(ok, body){
>               var FOAF = $rdf.Namespace("http://xmlns.com/foaf/0.1/");
>
>
> Oops you'll also need the RDF namespace:
>
>        var RDF = 
> $rdf.Namespace("http://www.w3.org/1999/02/22-rdf-syntax-ns#");
>
>
>               var person = g.statementsMatching(undefined,
>     RDF('type'), FOAF('Person'))[0];
>
>               var subject = person.subject;
>
>               var name = g.any(subject, FOAF('name'));
>
>               if (name) {
>                 console.log(name.value);
>     *            // do something
>     *
>               }
>
>             });
>
>
>         -- Andrei
>
>
>         On Sun, May 18, 2014 at 1:20 PM, Jeff Fuller
>         <jeff@fictionverse.net <mailto:jeff@fictionverse.net>> wrote:
>
>             Hello, everyone. My name is Jeff Fuller, and I want to
>             share with you my implementation of WebID that I developed
>             for my website, FictionVerse.net
>             <https://fictionverse.net> . I haven't been involved with
>             this mailing list, and I don't mean to introduce myself by
>             advertising, but I've been eager to share my work. Part of
>             the stated purpose of the WebID Community Group is to
>             "grow the community of implementations", so I hope this
>             will be deemed appropriate.
>
>             You can read about the details of the implementation in a
>             blog post I made,
>             <https://blog.fictionverse.net/technology/the-fictionverse-webid-implementation/>
>             .. It's a long post with some example code towards the
>             end. The tl;dr version is that it uses a wildcard SSL
>             certificate for WebID authentication and persists sessions
>             via cookies along with a little trickery to emulate some
>             useful features. It's ugly and perhaps not totally
>             innovative, but it does mask some of the issues commonly
>             faced when using WebID.
>
>              * It allows you to log in, log out, and change users at
>             any time, as often as needed, without restarting the browser.
>              * JavaScript can be used to detect a successful or failed
>             login, initiate a logout, and gain access to the
>             authenticated WebID, in real-time.
>              * Sessions are relatively easy to handle since they rely
>             on cookies, a mature and well-understood feature present
>             in all browsers.
>
>             That said, it's not a replacement for true identity
>             management in the browser and better API's for dealing
>             with user authentication. As I mention in the blog post,
>             it's just a polyfill. It seems to be working well enough
>             so far though.
>
>             I hope you find this to be informational, and I apologize
>             if my introduction here is bad form. I'm not subscribed to
>             the list because I don't feel like I can meaningfully
>             contribute, but I do like to read through the archives. I
>             very much admire the work that all of you are doing, and
>             no matter what the future of WebID is, know that I'm at
>             least one more soul in the world who believes in it.
>
>             Sincerely,
>             Jeff Fuller
>             <https://fictionverse.net/webid/jeff#id>
>
>
>
>
>
>

Received on Monday, 19 May 2014 03:08:34 UTC