<docbook><section><title>VirtSpongerCartridgeFacebook</title><para>  </para>
<title> Virtuoso Sponger Cartridge for Facebook</title> Virtuoso Sponger Cartridge for Facebook
<bridgehead class="http://www.w3.org/1999/xhtml:h2"> Create Facebook API Key and Session:</bridgehead>
<orderedlist spacing="compact"><listitem>Create an account at <ulink url="http://facebook.com">http://facebook.com</ulink> </listitem>
<listitem>Go to link &quot;Applications&quot; </listitem>
<listitem>Click the link &quot;developers&quot;.
</listitem>
<listitem>Go to <ulink url="http://www.facebook.com/developers/editapp.php?new">http://www.facebook.com/developers/editapp.php?new</ulink> </listitem>
<listitem>Click &quot;Get Started&quot; link.
</listitem>
<listitem>Click the link &quot;Add Facebook Developer Application&quot; </listitem>
<listitem>Click the button &quot;Set up New Application&quot; </listitem>
<listitem>Enter name in the field &quot;Application Name&quot; </listitem>
<listitem>Check the shown check-box.
</listitem>
<listitem>Click the &quot;Optional fields&quot; link.
</listitem>
<listitem>Enter in &quot;Callback Url&quot; field the url to your ods location, i.e.
<programlisting>http://host:port/ods/
</programlisting></listitem>
<listitem>Fill in the &quot;Canvas Page URL&quot; field, for example: <programlisting>http://apps.facebook.com/myods/
</programlisting></listitem>
<listitem>Select the radio-box &quot;Use iframe&quot;.
</listitem>
<listitem>For &quot;Can your application be added on Facebook?&quot; choose the &quot;Yes&quot; radio-box.
</listitem>
<listitem>For the field &quot;Post-Add URL&quot; enter your canvas url from above, for example: <programlisting>http://apps.facebook.com/myods/
</programlisting></listitem>
<listitem>For the field &quot;Side Nav URL&quot; enter your canvas url from above, for example: <programlisting>http://apps.facebook.com/myods/
</programlisting></listitem>
<listitem>Click Submit </listitem>
<listitem>As result your API key and session will be created and shown under the name of the created application.</listitem>
</orderedlist><bridgehead class="http://www.w3.org/1999/xhtml:h2"> Facebook integration in Conductor:</bridgehead>
<orderedlist spacing="compact"><listitem>Upgrade to the latest <ulink url="https://virtuoso.openlinksw.com/download/">conductor_dav.vad</ulink>, <ulink url="https://virtuoso.openlinksw.com/download/">ods_framework_dav.vad</ulink> and <ulink url="https://virtuoso.openlinksw.com/download/">cartridges_dav.vad</ulink> packages.
</listitem>
<listitem>Go from Conductor to tab RDF-&gt;Linked Data-&gt;Sponger-&gt;Extractor Cartridges </listitem>
<listitem>As result in the Cartridges list should be shown a mapper with description &quot;Facebook&quot; and pattern &quot; <ulink url="http://www.facebook.com/.*">http://www.facebook.com/.*</ulink>&quot; </listitem>
<listitem>Click its &quot;Edit&quot; link.
</listitem>
<listitem>Click the link &quot;Get FB Session&quot;.
</listitem>
<listitem>Now enter the API key you have created from above for your FB application.
</listitem>
<listitem>Click the &quot;Get token&quot; button.
</listitem>
<listitem>Click the link &quot;get login code for [the name of your app]&quot; </listitem>
<listitem>As result should be shown the page with title &quot;Save My Login Info&quot;.
 Click the &quot;Generate&quot; button.
</listitem>
<listitem>As result should be shown the one-time code.
</listitem>
<listitem>In the form bellow the page enter in the &quot;Authentication Token&quot; the code from step 10.
 and enter the secret value you have generated from above.
</listitem>
<listitem>Click the &quot;Generate session&quot; button.
</listitem>
<listitem>As result this message should be shown: <programlisting>&quot;FB permanent session generation
Your permanent FB session key is:
....
Copy an paste the shown code in the FB Linked Data &#39;session&#39; option, then can 
close this window.&quot;
</programlisting></listitem>
<listitem>Now in the still opened page from Conductor in the Options text-area enter the session=[the session key from above] and for secret=[enter the generated one form above] </listitem>
<listitem>Enter for API Key the generated one from above.
</listitem>
<listitem>Click the button &quot;Update&quot;.</listitem>
</orderedlist><bridgehead class="http://www.w3.org/1999/xhtml:h2"> Facebook integration in ODS:</bridgehead>
<para>Note: If no ODS user Profile Edit Page is set with FB key, secret and session, then by default the values are taken from Conductor, if entered.</para>
<orderedlist spacing="compact"><listitem>Login at ODS </listitem>
<listitem>Go to user&#39;s Edit Profile Page </listitem>
<listitem>Go to tab &quot;Associations&amp; Web Services&quot; </listitem>
<listitem>Fill in the values in the &quot;Facebook Session&quot; text-area respectively for key, secret with the generated ones from above.
</listitem>
<listitem>If you do not have the session value, click the &quot;Get FB session&quot; button and: <orderedlist spacing="compact"><listitem>As result will open a new pop-up page.
 Enter the API key for your FB application.
</listitem>
<listitem>Click the &quot;Get token&quot; button.
</listitem>
<listitem>Click the link &quot;get login code for [the name of your app]&quot; </listitem>
<listitem>As result should be shown the page with title &quot;Save My Login Info&quot;.
 Click the &quot;Generate&quot; button.
</listitem>
<listitem>As result should be shown the one-time code.
</listitem>
<listitem>In the form bellow the page enter in the &quot;Authentication Token&quot; the code from step 10.
 and enter the secret value you have generated from above.
</listitem>
<listitem>Click the &quot;Generate session&quot; button.
</listitem>
<listitem>As result this message should be shown: <programlisting>&quot;FB permanent session generation
Your permanent FB session key is:
....
Copy an paste the shown code in the FB Linked Data &#39;session&#39; option, then can 
close this window.&quot;
</programlisting></listitem>
<listitem>Copy the generated session value and close the page.
</listitem>
</orderedlist></listitem>
<listitem>Paste the generated session value in the &quot;session=&quot; area.
</listitem>
<listitem>Click Save.</listitem>
</orderedlist><para> </para>
<bridgehead class="http://www.w3.org/1999/xhtml:h2"> Viewing your ODS as application of Facebook:</bridgehead>
<orderedlist spacing="compact"><listitem>Go to the url you have entered from above for your application, for example: <programlisting>http://apps.facebook.com/myods/
</programlisting></listitem>
<listitem>In the shown frame with ODS click sign in and login with an account you have at your ODS location.
</listitem>
<listitem>As result you should be logged in successfully.</listitem>
</orderedlist><bridgehead class="http://www.w3.org/1999/xhtml:h2"> Injecting Facebook data into ODS:</bridgehead>
<orderedlist spacing="compact"><listitem>In your Facebook account area create an album with several images uploaded.
</listitem>
<listitem>Share the album to your friend(s).
</listitem>
<listitem>Create several events.
</listitem>
<listitem>Go to Facebook Profile page.
</listitem>
<listitem>At the bottom click the &quot;Create a Profile Badge&quot; link.
</listitem>
<listitem>Click the button &quot;Create Badge&quot;.
</listitem>
<listitem>Click the button &quot;Save&quot;.
</listitem>
<listitem>As result at the bottom of the page will be shown your profile public link, for example: <programlisting>Put a link to your Facebook profile on AIM: &lt;a href=http://www.facebook.com/p/Lio_Lao/646053997&gt;Facebook me!&lt;/a&gt;
</programlisting></listitem>
<listitem>Copy this URL: <ulink url="http://www.facebook.com/p/">http://www.facebook.com/p/</ulink>[your name]/[fid] </listitem>
<listitem>Now go to <ulink url="http://host:port/sparql">http://host:port/sparql</ulink>  (you can also use the RDF Browser, isparql or the isql tool).
</listitem>
<listitem>Enter as default Graph URL the url from the previous step.
</listitem>
<listitem>Execute the query: <programlisting>SELECT DISTINCT ?Concept
FROM &lt;http://www.facebook.com/p/[your name]/[fid]&gt;
WHERE {
  [] rdf:type ?Concept .
}
</programlisting>Note: if you have entered the FB key, session and secret for an ODS User and you want to view his FB Graph data, you need to add the login name in front of the query, i.e.: <programlisting>define get:login &quot;test1&quot;
SELECT DISTINCT ?Concept
FROM &lt;http://www.facebook.com/p/Lio_Lao/646053997&gt;
WHERE {
  [] rdf:type ?Concept .
}
</programlisting> <ulink url="CategoryVirtuoso">CategoryVirtuoso</ulink> <ulink url="CategorySponger">CategorySponger</ulink> <ulink url="CategorySpec">CategorySpec</ulink> <ulink url="CategoryDocumentation">CategoryDocumentation</ulink> <ulink url="CategoryFacebook">CategoryFacebook</ulink> <ulink url="CategoryODS">CategoryODS</ulink> <ulink url="CategoryRDF">CategoryRDF</ulink></listitem>
</orderedlist></section></docbook>