Skip to content

Instantly share code, notes, and snippets.

@koma5
Created January 22, 2017 13:21
Show Gist options
  • Save koma5/a83d29d1f31f8717ab946f12493482d5 to your computer and use it in GitHub Desktop.
Save koma5/a83d29d1f31f8717ab946f12493482d5 to your computer and use it in GitHub Desktop.
Display the source blob
Display the rendered blob
Raw
{
"cells": [
{
"cell_type": "code",
"execution_count": 2,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"import rdflib"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"g = rdflib.Graph()"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/plain": [
"<Graph identifier=N1a4be73df1c548348c55565ace1286d8 (<class 'rdflib.graph.Graph'>)>"
]
},
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"g.parse('./likes.ttl', format='turtle')"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"http://marcoko.ch/#i http://xmlns.com/foaf/0.1/interest http://dbpedia.org/resource/Dance\n",
"http://marcoko.ch/#i http://xmlns.com/foaf/0.1/interest http://dbpedia.org/resource/Amateur_radio\n",
"http://marcoko.ch/#i http://xmlns.com/foaf/0.1/interest http://dbpedia.org/resource/Building_automation\n",
"http://marcoko.ch/#i http://xmlns.com/foaf/0.1/interest http://dbpedia.org/resource/Poetry_slam\n",
"http://marcoko.ch/#i http://xmlns.com/foaf/0.1/interest http://dbpedia.org/resource/Rail_transport_modelling\n",
"http://marcoko.ch/#i http://xmlns.com/foaf/0.1/interest http://dbpedia.org/resource/Chess\n",
"http://marcoko.ch/#i http://xmlns.com/foaf/0.1/interest http://dbpedia.org/resource/France\n",
"http://marcoko.ch/#i http://xmlns.com/foaf/0.1/interest http://dbpedia.org/resource/Linux\n",
"http://marcoko.ch/#i http://xmlns.com/foaf/0.1/interest http://dbpedia.org/resource/Typography\n",
"http://marcoko.ch/#i http://xmlns.com/foaf/0.1/interest http://dbpedia.org/resource/Milky_Way\n",
"http://marcoko.ch/#i http://xmlns.com/foaf/0.1/interest http://dbpedia.org/resource/Cooking\n",
"http://marcoko.ch/#i http://xmlns.com/foaf/0.1/interest http://dbpedia.org/resource/Mail\n",
"http://marcoko.ch/#i http://xmlns.com/foaf/0.1/interest http://dbpedia.org/resource/Web_development\n",
"http://marcoko.ch/#i http://xmlns.com/foaf/0.1/interest http://dbpedia.org/resource/Turtle_(syntax)\n",
"http://marcoko.ch/#i http://xmlns.com/foaf/0.1/interest http://dbpedia.org/resource/Cryptocurrency\n",
"http://marcoko.ch/#i http://xmlns.com/foaf/0.1/interest http://dbpedia.org/resource/Raspberry_Pi\n",
"http://marcoko.ch/#i http://xmlns.com/foaf/0.1/interest http://dbpedia.org/resource/Wireless_sensor_network\n",
"http://marcoko.ch/#i http://xmlns.com/foaf/0.1/interest http://dbpedia.org/resource/Python\n",
"http://marcoko.ch/#i http://xmlns.com/foaf/0.1/interest http://dbpedia.org/resource/Communism\n",
"http://marcoko.ch/#i http://xmlns.com/foaf/0.1/interest http://dbpedia.org/resource/GNU_Project\n",
"http://marcoko.ch/#i http://xmlns.com/foaf/0.1/interest http://dbpedia.org/resource/Information_technology\n",
"http://marcoko.ch/#i http://xmlns.com/foaf/0.1/interest http://dbpedia.org/resource/Human_swimming\n",
"http://marcoko.ch/#i http://xmlns.com/foaf/0.1/interest http://dbpedia.org/resource/GNOME\n",
"http://marcoko.ch/#i http://xmlns.com/foaf/0.1/interest http://dbpedia.org/resource/MQTT\n",
"http://marcoko.ch/#i http://xmlns.com/foaf/0.1/interest http://dbpedia.org/resource/Forensic_science\n",
"http://marcoko.ch/#i http://xmlns.com/foaf/0.1/interest http://dbpedia.org/resource/Crowdsourcing\n",
"http://marcoko.ch/#i http://xmlns.com/foaf/0.1/interest http://dbpedia.org/resource/Arduino\n",
"http://marcoko.ch/#i http://xmlns.com/foaf/0.1/interest http://dbpedia.org/resource/World_Wide_Web\n",
"http://marcoko.ch/#i http://xmlns.com/foaf/0.1/interest http://dbpedia.org/resource/Book\n",
"http://marcoko.ch/#i http://xmlns.com/foaf/0.1/interest http://dbpedia.org/resource/Switzerland\n",
"http://marcoko.ch/#i http://xmlns.com/foaf/0.1/interest http://dbpedia.org/resource/Texas_hold_'em\n",
"http://marcoko.ch/#i http://xmlns.com/foaf/0.1/interest http://dbpedia.org/resource/Bodyweight_exercise\n",
"http://marcoko.ch/#i http://xmlns.com/foaf/0.1/interest http://dbpedia.org/resource/Peace\n",
"http://marcoko.ch/#i http://xmlns.com/foaf/0.1/interest http://dbpedia.org/resource/Resource_Description_Framework\n",
"http://marcoko.ch/#i http://xmlns.com/foaf/0.1/interest http://dbpedia.org/resource/3D_printing\n",
"http://marcoko.ch/#i http://xmlns.com/foaf/0.1/interest http://dbpedia.org/resource/Home_automation\n",
"http://marcoko.ch/#i http://xmlns.com/foaf/0.1/interest http://dbpedia.org/resource/Yoga\n",
"http://marcoko.ch/#i http://xmlns.com/foaf/0.1/interest http://dbpedia.org/resource/Citizens_band_radio\n",
"http://marcoko.ch/#i http://xmlns.com/foaf/0.1/interest http://dbpedia.org/resource/Abseiling\n",
"http://marcoko.ch/#i http://xmlns.com/foaf/0.1/interest http://dbpedia.org/resource/Chaos_Computer_Club\n",
"http://marcoko.ch/#i http://xmlns.com/foaf/0.1/interest http://dbpedia.org/resource/Universe\n",
"http://marcoko.ch/#i http://xmlns.com/foaf/0.1/interest http://dbpedia.org/resource/Cuisine\n",
"http://marcoko.ch/#i http://xmlns.com/foaf/0.1/interest http://dbpedia.org/resource/Arch_Linux\n",
"http://marcoko.ch/#i http://xmlns.com/foaf/0.1/interest http://dbpedia.org/resource/Creative_Commons\n",
"http://marcoko.ch/#i http://xmlns.com/foaf/0.1/interest http://dbpedia.org/resource/Writer\n",
"http://marcoko.ch/#i http://xmlns.com/foaf/0.1/interest http://dbpedia.org/resource/Guerrilla_gardening\n",
"http://marcoko.ch/#i http://xmlns.com/foaf/0.1/interest http://dbpedia.org/resource/Net_neutrality\n",
"http://marcoko.ch/#i http://xmlns.com/foaf/0.1/interest http://dbpedia.org/resource/Democracy\n",
"http://marcoko.ch/#i http://xmlns.com/foaf/0.1/interest http://dbpedia.org/resource/Writing\n",
"http://marcoko.ch/#i http://xmlns.com/foaf/0.1/interest http://dbpedia.org/resource/Data_visualization\n",
"http://marcoko.ch/#i http://xmlns.com/foaf/0.1/interest http://dbpedia.org/resource/Snail_mail\n",
"http://marcoko.ch/#i http://xmlns.com/foaf/0.1/interest http://dbpedia.org/resource/Hacker_(computer_security)\n",
"http://marcoko.ch/#i http://xmlns.com/foaf/0.1/interest http://dbpedia.org/resource/Open_source\n",
"http://marcoko.ch/#i http://xmlns.com/foaf/0.1/interest http://dbpedia.org/resource/Linux_distribution\n",
"http://marcoko.ch/#i http://xmlns.com/foaf/0.1/interest http://dbpedia.org/resource/OpenStreetMap\n",
"http://marcoko.ch/#i http://xmlns.com/foaf/0.1/interest http://dbpedia.org/resource/Morse_code\n",
"http://marcoko.ch/#i http://xmlns.com/foaf/0.1/interest http://dbpedia.org/resource/Software-defined_radio\n",
"http://marcoko.ch/#i http://xmlns.com/foaf/0.1/interest http://dbpedia.org/resource/French_language\n",
"http://marcoko.ch/#i http://xmlns.com/foaf/0.1/interest http://dbpedia.org/resource/Creativity\n",
"http://marcoko.ch/#i http://xmlns.com/foaf/0.1/interest http://dbpedia.org/resource/Free_software\n",
"http://marcoko.ch/#i http://xmlns.com/foaf/0.1/interest http://dbpedia.org/resource/Rope_access\n",
"http://marcoko.ch/#i http://xmlns.com/foaf/0.1/interest http://dbpedia.org/resource/Git_(software)\n",
"http://marcoko.ch/#i http://xmlns.com/foaf/0.1/interest http://dbpedia.org/resource/Woman\n",
"http://marcoko.ch/#i http://xmlns.com/foaf/0.1/interest http://dbpedia.org/resource/English_language\n",
"http://marcoko.ch/#i http://xmlns.com/foaf/0.1/interest http://dbpedia.org/resource/Pentoo\n",
"http://marcoko.ch/#i http://xmlns.com/foaf/0.1/interest http://dbpedia.org/resource/RDFa\n",
"http://marcoko.ch/#i http://xmlns.com/foaf/0.1/interest http://dbpedia.org/resource/Reading_(process)\n",
"http://marcoko.ch/#i http://xmlns.com/foaf/0.1/interest http://dbpedia.org/resource/Radio-controlled_aircraft\n",
"http://marcoko.ch/#i http://xmlns.com/foaf/0.1/interest http://dbpedia.org/resource/Running\n",
"http://marcoko.ch/#i http://xmlns.com/foaf/0.1/interest http://dbpedia.org/resource/Aquaponics\n",
"http://marcoko.ch/#i http://xmlns.com/foaf/0.1/interest http://dbpedia.org/resource/Scalable_Vector_Graphics\n",
"http://marcoko.ch/#i http://xmlns.com/foaf/0.1/interest http://dbpedia.org/resource/Distributed_computing\n",
"http://marcoko.ch/#i http://xmlns.com/foaf/0.1/interest http://dbpedia.org/resource/German_language\n",
"http://marcoko.ch/#i http://xmlns.com/foaf/0.1/interest http://dbpedia.org/resource/Russell's_teapot\n",
"http://marcoko.ch/#i http://xmlns.com/foaf/0.1/interest http://dbpedia.org/resource/Multirotor\n",
"http://marcoko.ch/#i http://xmlns.com/foaf/0.1/interest http://dbpedia.org/resource/Domain_Name_System\n",
"http://marcoko.ch/#i http://xmlns.com/foaf/0.1/interest http://dbpedia.org/resource/Geographic_information_system\n",
"http://marcoko.ch/#i http://xmlns.com/foaf/0.1/interest http://dbpedia.org/resource/Semantic_Web\n",
"http://marcoko.ch/#i http://xmlns.com/foaf/0.1/interest http://dbpedia.org/resource/Physics\n",
"http://marcoko.ch/#i http://xmlns.com/foaf/0.1/interest http://dbpedia.org/resource/Open_standard\n",
"http://marcoko.ch/#i http://xmlns.com/foaf/0.1/interest http://dbpedia.org/resource/NATO_phonetic_alphabet\n",
"http://marcoko.ch/#i http://xmlns.com/foaf/0.1/interest http://dbpedia.org/resource/Open_data\n",
"http://marcoko.ch/#i http://xmlns.com/foaf/0.1/interest http://dbpedia.org/resource/Pretty_Good_Privacy\n",
"http://marcoko.ch/#i http://xmlns.com/foaf/0.1/interest http://dbpedia.org/resource/Poker\n",
"http://marcoko.ch/#i http://xmlns.com/foaf/0.1/interest http://dbpedia.org/resource/Electronics\n",
"http://marcoko.ch/#i http://xmlns.com/foaf/0.1/interest http://dbpedia.org/resource/Decentralised_system\n",
"http://marcoko.ch/#i http://xmlns.com/foaf/0.1/interest http://dbpedia.org/resource/D3.js\n",
"http://marcoko.ch/#i http://xmlns.com/foaf/0.1/interest http://dbpedia.org/resource/Philosophy\n",
"http://marcoko.ch/#i http://xmlns.com/foaf/0.1/interest http://dbpedia.org/resource/United_Kingdom\n",
"http://marcoko.ch/#i http://xmlns.com/foaf/0.1/interest http://dbpedia.org/resource/Swiss_German\n",
"http://marcoko.ch/#i http://xmlns.com/foaf/0.1/interest http://dbpedia.org/resource/Peer-to-peer\n",
"http://marcoko.ch/#i http://xmlns.com/foaf/0.1/interest http://dbpedia.org/resource/Scuba_diving\n",
"http://marcoko.ch/#i http://xmlns.com/foaf/0.1/interest http://dbpedia.org/resource/Molecular_gastronomy\n",
"http://marcoko.ch/#i http://xmlns.com/foaf/0.1/interest http://dbpedia.org/resource/Open-source_hardware\n",
"http://marcoko.ch/#i http://xmlns.com/foaf/0.1/interest http://dbpedia.org/resource/Internet\n",
"http://marcoko.ch/#i http://xmlns.com/foaf/0.1/interest http://dbpedia.org/resource/Marxism\n",
"http://marcoko.ch/#i http://xmlns.com/foaf/0.1/interest http://dbpedia.org/resource/Meditation\n",
"http://marcoko.ch/#i http://xmlns.com/foaf/0.1/interest http://dbpedia.org/resource/Thorium\n",
"http://marcoko.ch/#i http://xmlns.com/foaf/0.1/interest http://dbpedia.org/resource/Hacker_culture\n",
"http://marcoko.ch/#i http://xmlns.com/foaf/0.1/interest http://dbpedia.org/resource/BeagleBoard\n",
"http://marcoko.ch/#i http://xmlns.com/foaf/0.1/interest http://dbpedia.org/resource/Internet_of_Things\n",
"http://marcoko.ch/#i http://xmlns.com/foaf/0.1/interest http://dbpedia.org/resource/Juggling\n",
"http://marcoko.ch/#i http://xmlns.com/foaf/0.1/interest http://dbpedia.org/resource/Teeline_Shorthand\n",
"http://marcoko.ch/#i http://xmlns.com/foaf/0.1/interest http://dbpedia.org/resource/Mirror_writing\n",
"http://marcoko.ch/#i http://xmlns.com/foaf/0.1/interest http://dbpedia.org/resource/Esperanto\n",
"http://marcoko.ch/#i http://xmlns.com/foaf/0.1/interest http://dbpedia.org/resource/GNU_General_Public_License\n",
"http://marcoko.ch/#i http://xmlns.com/foaf/0.1/interest http://dbpedia.org/resource/Computer_programming\n",
"http://marcoko.ch/#i http://xmlns.com/foaf/0.1/interest http://dbpedia.org/resource/Gardening\n",
"http://marcoko.ch/#i http://xmlns.com/foaf/0.1/interest http://dbpedia.org/resource/Genealogy\n",
"http://marcoko.ch/#i http://xmlns.com/foaf/0.1/interest http://dbpedia.org/resource/Open_format\n",
"http://marcoko.ch/#i http://xmlns.com/foaf/0.1/interest http://dbpedia.org/resource/Lock_picking\n",
"http://marcoko.ch/#i http://xmlns.com/foaf/0.1/interest http://dbpedia.org/resource/Linked_data\n",
"http://marcoko.ch/#i http://xmlns.com/foaf/0.1/interest http://dbpedia.org/resource/Photography\n",
"http://marcoko.ch/#i http://xmlns.com/foaf/0.1/interest http://dbpedia.org/resource/Cycling\n",
"http://marcoko.ch/#i http://xmlns.com/foaf/0.1/interest http://dbpedia.org/resource/ZigBee\n",
"http://marcoko.ch/#i http://xmlns.com/foaf/0.1/interest http://dbpedia.org/resource/Drawing\n",
"http://marcoko.ch/#i http://xmlns.com/foaf/0.1/interest http://dbpedia.org/resource/Tea\n",
"http://marcoko.ch/#i http://xmlns.com/foaf/0.1/interest http://dbpedia.org/resource/OpenWrt\n",
"http://marcoko.ch/#i http://xmlns.com/foaf/0.1/interest http://dbpedia.org/resource/Houseplant\n",
"http://marcoko.ch/#i http://xmlns.com/foaf/0.1/interest http://dbpedia.org/resource/Digital_forensics\n",
"http://marcoko.ch/#i http://xmlns.com/foaf/0.1/interest http://dbpedia.org/resource/Outline_of_food_preparation\n",
"http://marcoko.ch/#i http://xmlns.com/foaf/0.1/interest http://dbpedia.org/resource/Unix\n",
"http://marcoko.ch/#i http://xmlns.com/foaf/0.1/interest http://dbpedia.org/resource/Camping\n",
"http://marcoko.ch/#i http://xmlns.com/foaf/0.1/interest http://dbpedia.org/resource/Automation\n",
"http://marcoko.ch/#i http://xmlns.com/foaf/0.1/interest http://dbpedia.org/resource/Outer_space\n",
"http://marcoko.ch/#i http://xmlns.com/foaf/0.1/interest http://dbpedia.org/resource/Privacy\n",
"http://marcoko.ch/#i http://xmlns.com/foaf/0.1/interest http://dbpedia.org/resource/Web_of_trust\n",
"http://marcoko.ch/#i http://xmlns.com/foaf/0.1/interest http://dbpedia.org/resource/Baking\n",
"http://marcoko.ch/#i http://xmlns.com/foaf/0.1/interest http://dbpedia.org/resource/Berkeley_Software_Distribution\n",
"http://marcoko.ch/#i http://xmlns.com/foaf/0.1/interest http://dbpedia.org/resource/IPv6\n",
"http://marcoko.ch/#i http://xmlns.com/foaf/0.1/interest http://dbpedia.org/resource/BitTorrent\n"
]
}
],
"source": [
"for s,p,o in g:\n",
" print s,p,o"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"query = \"\"\"\n",
"PREFIX foaf: <http://xmlns.com/foaf/0.1/>\n",
"PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>\n",
"\n",
"\n",
"SELECT *\n",
"FROM <http://marcoko.ch/likes.ttl>\n",
"WHERE {\n",
"<http://marcoko.ch/#i> foaf:interest ?o .\n",
"?o rdfs:label ?label .\n",
"}\n",
"\n",
"LIMIT 50\n",
"\n",
"}\n",
"\n",
"\n",
"\"\"\""
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"r = g.query(\"\"\"\n",
"PREFIX foaf: <http://xmlns.com/foaf/0.1/>\n",
"PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>\n",
"\n",
"\n",
"SELECT ?o ?label\n",
"WHERE {\n",
"\n",
" SERVICE <http://dbpedia.org/sparql> {\n",
" ?o rdfs:label ?label .\n",
" }\n",
" SERVICE <http://marcoko.ch/likes.ttl> {\n",
" <http://marcoko.ch/#i> foaf:interest ?o .\n",
" }\n",
"\n",
"\n",
"}\n",
"\n",
"LIMIT 50\n",
"\n",
"\n",
"\"\"\")"
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"interests = g.query(\"\"\"\n",
"PREFIX foaf: <http://xmlns.com/foaf/0.1/>\n",
"PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>\n",
"\n",
"\n",
"SELECT ?o\n",
"WHERE {<http://marcoko.ch/#i> foaf:interest ?o .\n",
"}\n",
"LIMIT 200\n",
"\"\"\")"
]
},
{
"cell_type": "code",
"execution_count": 9,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"for i in interests:\n",
" g.parse(i[0])\n",
" !sleep 3"
]
},
{
"cell_type": "code",
"execution_count": 16,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"labels = g.query(\"\"\"\n",
"PREFIX foaf: <http://xmlns.com/foaf/0.1/>\n",
"PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>\n",
"\n",
"SELECT ?labelde ?labelfr ?labelen\n",
"WHERE {\n",
"<http://marcoko.ch/#i> foaf:interest ?o .\n",
"OPTIONAL {?o rdfs:label ?labelde .\n",
"FILTER (lang(?labelde) = 'de')}\n",
"OPTIONAL {?o rdfs:label ?labelfr .\n",
"FILTER (lang(?labelfr) = 'fr')}\n",
"OPTIONAL {?o rdfs:label ?labelen .\n",
"FILTER (lang(?labelen) = 'en')}\n",
"}\n",
"\n",
"\"\"\")"
]
},
{
"cell_type": "code",
"execution_count": 21,
"metadata": {
"collapsed": false,
"scrolled": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Tanz Danse Dance\n",
"Amateurfunkdienst Radioamateur Amateur radio\n",
"Gebäudeautomation Immotique Building automation\n",
"Poetry Slam Slam (poésie) Poetry slam\n",
"Modelleisenbahn Modélisme ferroviaire Rail transport modelling\n",
"Schach Échecs Chess\n",
"Frankreich France France\n",
"Linux Linux Linux\n",
"Typografie Typographie Typography\n",
"Milchstraße Voie lactée Milky Way\n",
"Kochen Cuisson des aliments Cooking\n",
"Post Poste Mail\n",
"None Programmation web Web development\n",
"Turtle (Syntax) Turtle (syntaxe) Turtle (syntax)\n",
"Kryptowährung Crypto-monnaie Cryptocurrency\n",
"Raspberry Pi Raspberry Pi Raspberry Pi\n",
"Sensornetz Réseau de capteurs sans fil Wireless sensor network\n",
"MQ Telemetry Transport MQTT MQTT\n",
"Kommunismus Communisme Communism\n",
"GNU-Projekt Projet GNU GNU Project\n",
"Informationstechnik Technologie de l'information Information technology\n",
"Forensik Science forensique Forensic science\n",
"Gnome GNOME GNOME\n",
"Python Python Python\n",
"Schwimmen Natation Human swimming\n",
"Crowdsourcing Crowdsourcing Crowdsourcing\n",
"Semantic Web Web sémantique Semantic Web\n",
"Hacker (Computersicherheit) Hacker (sécurité informatique) Hacker (computer security)\n",
"Buch Livre (document) Book\n",
"Schweiz Suisse Switzerland\n",
"Texas Hold’em Texas hold'em Texas hold 'em\n",
"Eigengewichtübung Musculation sans charges Bodyweight exercise\n",
"Frieden Paix Peace\n",
"Resource Description Framework Resource Description Framework Resource Description Framework\n",
"Arduino (Plattform) Arduino Arduino\n",
"None Domotique Home automation\n",
"Yoga Yoga Yoga\n",
"CB-Funk Citizen-band Citizens band radio\n",
"Abseilen Descente en rappel Abseiling\n",
"Chaos Computer Club Chaos Computer Club Chaos Computer Club\n",
"Universum Univers Universe\n",
"Kochkunst Cuisine Cuisine\n",
"Arch Linux Arch Linux Arch Linux\n",
"Creative Commons Creative Commons Creative Commons\n",
"Schriftsteller Écrivain Writer\n",
"Guerilla Gardening Guerrilla gardening Guerrilla gardening\n",
"Netzneutralität Neutralité du réseau Net neutrality\n",
"ZigBee ZigBee ZigBee\n",
"Demokratie Démocratie Democracy\n",
"Schreiben Écriture Writing\n",
"None None Data visualization\n",
"Schneckenpost None Snail mail\n",
"World Wide Web World Wide Web World Wide Web\n",
"Open Source Open source Open source\n",
"Linux-Distribution Distribution Linux Linux distribution\n",
"OpenStreetMap OpenStreetMap OpenStreetMap\n",
"Morsezeichen Morse (alphabet) Morse code\n",
"Software Defined Radio Radio logicielle Software-defined radio\n",
"Französische Sprache Français French language\n",
"Kreativität Créativité Creativity\n",
"Freie Software Logiciel libre Free software\n",
"Industrieklettern Cordiste Rope access\n",
"Git Git Git (software)\n",
"Frau Femme Woman\n",
"Englische Sprache Anglais English language\n",
"None Pentoo Pentoo\n",
"RDFa RDFa RDFa\n",
"Lesen Lecture Reading (process)\n",
"Flugmodell Avion radiocommandé Radio-controlled aircraft\n",
"Laufsport Course à pied Running\n",
"Aquaponik Aquaponie Aquaponics\n",
"Scalable Vector Graphics Scalable Vector Graphics Scalable Vector Graphics\n",
"Verteiltes Rechnen Calcul distribué Distributed computing\n",
"Deutsche Sprache Allemand German language\n",
"Russells Teekanne Théière de Russell Russell's teapot\n",
"Quadrocopter None Multirotor\n",
"Domain Name System Domain Name System Domain Name System\n",
"Geoinformationssystem Système d'information géographique Geographic information system\n",
"Fahrradfahren Cyclisme Cycling\n",
"Physik Physique Physics\n",
"Offener Standard None Open standard\n",
"None Alphabet phonétique de l'OTAN NATO phonetic alphabet\n",
"Open Data Open data Open data\n",
"Pretty Good Privacy Pretty Good Privacy Pretty Good Privacy\n",
"Poker Poker Poker\n",
"Elektronik Électronique Electronics\n",
"None None Decentralised system\n",
"None D3.js D3.js\n",
"Philosophie Philosophie Philosophy\n",
"Vereinigtes Königreich Royaume-Uni United Kingdom\n",
"Schweizerdeutsch Suisse allemand Swiss German\n",
"3D-Druck Impression tridimensionnelle 3D printing\n",
"Gerätetauchen None Scuba diving\n",
"Molekularküche Gastronomie moléculaire Molecular gastronomy\n",
"Freie Hardware Matériel libre Open-source hardware\n",
"Internet Internet Internet\n",
"Marxismus Marxisme Marxism\n",
"Meditation Méditation Meditation\n",
"Thorium Thorium Thorium\n",
"None None Hacker culture\n",
"BeagleBoard BeagleBoard BeagleBoard\n",
"Internet der Dinge Internet des objets Internet of Things\n",
"Jonglieren Jonglerie Juggling\n",
"None None Teeline Shorthand\n",
"Spiegelschrift Écriture spéculaire Mirror writing\n",
"Esperanto Espéranto Esperanto\n",
"GNU General Public License Licence publique générale GNU GNU General Public License\n",
"Programmierung Programmation informatique Computer programming\n",
"None Jardinage Gardening\n",
"Genealogie Généalogie Genealogy\n",
"Offenes Format Format ouvert Open format\n",
"Lockpicking Crochetage Lock picking\n",
"None Web des données Linked data\n",
"Fotografie Photographie Photography\n",
"Peer-to-Peer Pair à pair Peer-to-peer\n",
"Zeichnung (Kunst) Dessin Drawing\n",
"Tee Thé Tea\n",
"OpenWrt OpenWrt OpenWrt\n",
"Zimmerpflanze Plante d'intérieur Houseplant\n",
"None None Digital forensics\n",
"None None Outline of food preparation\n",
"Unix Unix Unix\n",
"Camping Camping Camping\n",
"Automatisierung Automation Automation\n",
"None Espace (cosmologie) Outer space\n",
"Privatsphäre Vie privée Privacy\n",
"Web of Trust Toile de confiance Web of trust\n",
"Backen None Baking\n",
"Berkeley Software Distribution Berkeley Software Distribution Berkeley Software Distribution\n",
"IPv6 IPv6 IPv6\n",
"BitTorrent BitTorrent (protocole) BitTorrent\n"
]
}
],
"source": [
"for l in labels:\n",
" print u\"{0} {1} {2}\".format(l[0], l[1], l[2])"
]
},
{
"cell_type": "code",
"execution_count": 15,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/plain": [
"95229"
]
},
"execution_count": 15,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"len(g)"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 2",
"language": "python",
"name": "python2"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 2
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython2",
"version": "2.7.13"
}
},
"nbformat": 4,
"nbformat_minor": 0
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment