Crates.io | hatchling |
lib.rs | hatchling |
version | 0.1.0 |
source | src |
created_at | 2019-11-02 21:50:22.47631 |
updated_at | 2019-11-02 21:50:22.47631 |
description | Converts Facebook social media data exported via the Download Your Information tool (https://www.facebook.com/settings) into Turtle triplets for a SOLID (https://solid.mit.edu/) profile |
homepage | |
repository | https://github.com/bushidocodes/hatchling |
max_upload_size | |
id | 177628 |
size | 420,045 |
Break out of the Facebook Shell by converting your social Data into Turtle Triples
I'm a fan of Facebook. They create social networks that my grandparents are able to use, and they contribute heavily to the open-source ecosystem. That said, I'm a bigger fan of user empowerment and choice.
Out of the alternatives today, I believe that Tim Berners-Lee's vision for SOLID (a decentralized social network built around linked-data principles) offers the most pragmatic vision for data ownership. It offers the possibility that existing social networks could work with the standards bodies and adopt linked data and the SOLID data ownership model.
However, for this to be a possibility, tech early adopters need to engage with the linked data ecosystem and learn the fundamental of the semantic web.
This project aims to encourage SOLID adoption by simplifying the process of expressing a profile using linked data and Turtle. It provides a binary that converting provided by Facebook's Download Your Information into semantic web triples used by SOLID.
Note: If you want to learn more about the theory beTo learn more about this, I suggest reading Linked Data Fundamentals on the SOLID website.
profile_information.json
to handy locationFacebook's Download Your Information advertises the following:
You can download a copy of your Facebook information at any time. You can download a complete copy, or you can select only the types of information and date ranges you want. You can choose to receive your information in an HTML format that is easy to view, or a JSON format, which could allow another service to more easily import it.
This is quite useful for exporting profile information and all of the Facebook metadata that Facebook tags you with for advertising and tracking purposes. By downloading your personal data, you can get a good grasp of the data that Facebook has on you, and that can help you make informed decisions about your privacy settings and the degree to which your are comfortable being tracked while using Facebook.
However, the most important and valuable data on a social network is often not your profile information, but your friend connections which define your role in the social graph. Looking through the zip file containing JSON of much of my profile, such data was conspicuously absent.
While Facebook does allow you to export "Friends" data, the data only shows a human-friendly encoding of the friend's name. Realistically, services require some sort of globally unique identifier (GUID) to be able to identify someone on the web,which for Facebook would likely be the public URL of a user's Facebook profile.
"John Smith" is not useful, but https://www.facebook.com/johnjohn.smith.12345 is.
To get around this, we can scrape this data off our Facebook profiles using browser DevTools and a bit of JavaScript.
JSON.stringify([...document.querySelectorAll("[data-testid = 'friend_list_item']")].map(el => [...el.querySelectorAll("*")].filter(child => child.className === "fsl fwb fcb")[0].firstChild).map(el => ({name: el.textContent, target: `${el.getAttribute("href")}`.split("?")[0]})))
friends.json
file and save to the same directory as profile_information.json
hatchling.exe profile_information.json out.ttl
if you skipped Step 2. Otherwise run hatchling.exe --friends friends.json profile_information.json out.ttl
.Now that you've generated a Turtle file, you should verbally inspect the output and manually remove privileged data.
When done, you can validate your file for correct syntax with the W3C validator