[foaf-protocols] foaf-search.net now offers free API to search FOAF social graph

Melvin Carvalho melvincarvalho at gmail.com
Wed Aug 18 21:58:06 CEST 2010


On 18 August 2010 21:04, Melvin Carvalho <melvincarvalho at gmail.com> wrote:

>
>
> On 18 August 2010 10:04, Michael Brunnbauer <brunni at netestate.de> wrote:
>
>>
>> Dear all,
>>
>> foaf-search.net is a FOAF search engine with currently 4 million
>> interconnected persons, organisations and places crawled from the semantic
>> web.
>>
>> We now offer a free API to search though our social graph. You can search
>> by:
>>
>> -Name, nick, homepage, mailbox, mailbox-hash, URI, OpenID
>> -Interest (foaf:interest)
>> -Geocoordinates (geo:lat/long, foaf:based_near, contact:nearestAirport)
>> -Class (rdf:type)
>>
>> You can search for agents related to a given agent with foaf:knows,
>> foaf:member and the inverse relations.
>>
>> You can also get a list of all URIs, OpenIDs and mailboxes for an agent.
>>
>> A commercial version of the API offers extra functionality to get all
>> triples
>> or quads for an agent, provenance data for a given information or direct
>> access via SPARQL.
>>
>> You are invited to check out our website at http://www.foaf-search.net/or
>> our API description at http://www.foaf-search.net/API
>>
>
> very nice!
>
> one thing about the validation is that I need to do it via an email
> account, however I may not haven foaf:mbox associated with my account
>
> have you considered authentication via webid too, so authenticate your FOAF
> using a client certificate?  I think henry has an implementation in java ...
>

*To use WebID Validation
====================

*The easiest way it to use the server foafssl.org for delegated validation.

*Flow
====
*
1. you direct the user to foafssl.org

2. It validates the certiicate / webid

3. it directs you back


*Frond End
==========

*1. A button on your webpage pointing to foafssl.org

https://foafssl.org/srv/idp?authreqissuer=http://www.foaf-search.net/BlockProfile

What you need to implement on the back end

(one line of code)


*Back End
=========
*
1. parse the query string, looks something like:

webid=<webid>
ts=<timestamp>
sig=<sig>

2. Check the sig against the foafssl.org PEM

Either in a file or a variable:

private $IDPCertificates = array ( self::DEFAULT_IDP =>
"-----BEGIN CERTIFICATE-----
MIIDQzCCAqygAwIBAgIDC3vTMA0GCSqGSIb3DQEBBQUAMFoxCzAJBgNVBAYTAlVT
MRw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znBSVp+4V17I=
-----END CERTIFICATE-----
");

3. check the sig

*openssl_verify*($signedInfo, $signature, $pubKeyId);

3.1 Where signed info is the query string from (1) without sig
3.2 Signature is the sig from (1)
3.2 pubKeyID is the publick key from (2) you may need something like
openssl_get_publickey($idpCertificate); to get it

That's about it.

There's more complex ways, but this shouldnt be much more than a few lines
of code.

Hope that helps!


>
> CC: foaf-protocols
>
>
>>
>> Regards,
>>
>> Michael Brunnbauer
>>
>> --
>> ++  Michael Brunnbauer
>> ++  netEstate GmbH
>> ++  Geisenhausener Straße 11a
>> ++  81379 München
>> ++  Tel +49 89 32 19 77 80
>> ++  Fax +49 89 32 19 77 89
>> ++  E-Mail brunni at netestate.de
>> ++  http://www.netestate.de/
>> ++
>> ++  Sitz: München, HRB Nr.142452 (Handelsregister B München)
>> ++  USt-IdNr. DE221033342
>> ++  Geschäftsführer: Michael Brunnbauer, Franz Brunnbauer
>> ++  Prokurist: Dipl. Kfm. (Univ.) Markus Hendel
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.foaf-project.org/pipermail/foaf-protocols/attachments/20100818/03a2a04c/attachment.htm 


More information about the foaf-protocols mailing list