{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<img src=\"dbpedia_getting_started.jpg\">\n",
    "\n",
    "# Getting started with the DBpedia SPARQL endpoint\n",
    "\n",
    "In this episode I begin to explore the DBpedia public SPARQL endpoint.  I'll go through the following stages\n",
    "\n",
    "* setting up tools\n",
    "* counting triples\n",
    "* counting predicates\n",
    "* examination of the predicate **pr:skipperlastname**\n",
    "* countings classes\n",
    "* examination of the class **on:CareerStation**\n",
    "\n",
    "My method is a deliberate combination of systematic analysis (looking at counts, methods that can applied to arbitrary predicates or classes) and opportunism\n",
    "(looking at topics that catch my eye.)  DBpedia is too heterogenous to characterize in one article,  but I'll begin to uncover the dark art of writing SPARQL queries against generic databases.\n",
    "\n",
    "## Setting up tools\n",
    "\n",
    "A first step is to import a number of symbols that we'll use to do SPARQL queries and visualize the result"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "%load_ext autotime\n",
    "import sys\n",
    "from gastrodon import RemoteEndpoint,QName,ttl,URIRef,inline\n",
    "import pandas as pd\n",
    "pd.options.display.width=120\n",
    "pd.options.display.max_colwidth=100"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "First I'll define a few prefixes for namespaces that I want to use."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "time: 7.5 ms\n"
     ]
    }
   ],
   "source": [
    "prefixes=inline(\"\"\"\n",
    "    @prefix : <http://dbpedia.org/resource/> .\n",
    "    @prefix on: <http://dbpedia.org/ontology/> .\n",
    "    @prefix pr: <http://dbpedia.org/property/> .\n",
    "\"\"\").graph"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Next I set up a SPARQL endpoint and register the above prefixes so I can use them;  it is also important that I set the default graph and base_uri so we'll get good looking short results."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "time: 12 ms\n"
     ]
    }
   ],
   "source": [
    "endpoint=RemoteEndpoint(\n",
    "    \"http://dbpedia.org/sparql/\"\n",
    "    ,default_graph=\"http://dbpedia.org\"\n",
    "    ,prefixes=prefixes\n",
    "    ,base_uri=\"http://dbpedia.org/resource/\"\n",
    ")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Counting Triples\n",
    "\n",
    "First I count how many triples there are in the main graph"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "438336517"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "time: 2.01 s\n"
     ]
    }
   ],
   "source": [
    "count=endpoint.select(\"\"\"\n",
    "    SELECT (COUNT(*) AS ?count) { ?s ?p ?o .}\n",
    "\"\"\").at[0,\"count\"]\n",
    "count"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Counting Predicates\n",
    "\n",
    "For the next query I make a list of common predicates;  note that there are a whole lot of them!  The public SPARQL endpoint has a limit of 10,000 returned rows and we are finding many more than that.\n",
    "\n",
    "Each predicate is a relationship between a topic and either another topic or a literal value.  For instance,  the **rdf:type** predicate links a topic to another topic representing a class that the first topic is an instance,  for instance:\n",
    "\n",
    "```\n",
    "<Alan_Alda> rdf:type on:Person .\n",
    "```\n",
    "\n",
    "**rdfs:label**,  on the other hand,  links topics to literal values,  such as\n",
    "\n",
    "```\n",
    "<Alan_Alda> rdfs:label \n",
    "                \"Alan Alda\"@en,\n",
    "                \"アラン・アルダ\"@ja . \n",
    "```\n",
    "\n",
    "Strings in RDF (like the one above) are unusual compared to other computer languages because they can contain language tags,  a particularly helpful feature for multilingual databases such as DBpedia."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "scrolled": false
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>count</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>p</th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>rdf:type</th>\n",
       "      <td>113715893</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://www.w3.org/2002/07/owl#sameAs</th>\n",
       "      <td>33623696</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://purl.org/dc/terms/subject</th>\n",
       "      <td>23990506</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>rdfs:label</th>\n",
       "      <td>22430852</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://www.w3.org/ns/prov#wasDerivedFrom</th>\n",
       "      <td>15801285</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:wikiPageID</th>\n",
       "      <td>15797811</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:wikiPageRevisionID</th>\n",
       "      <td>15797811</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://purl.org/dc/elements/1.1/language</th>\n",
       "      <td>12845235</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://xmlns.com/foaf/0.1/primaryTopic</th>\n",
       "      <td>12845235</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://xmlns.com/foaf/0.1/isPrimaryTopicOf</th>\n",
       "      <td>12845234</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>rdfs:comment</th>\n",
       "      <td>12391811</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:abstract</th>\n",
       "      <td>12390578</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:wikiPageExternalLink</th>\n",
       "      <td>7772279</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:wikiPageRedirects</th>\n",
       "      <td>7632358</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://xmlns.com/foaf/0.1/name</th>\n",
       "      <td>4146581</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://purl.org/linguistics/gold/hypernym</th>\n",
       "      <td>4090049</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://www.w3.org/2004/02/skos/core#broader</th>\n",
       "      <td>3080338</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://purl.org/dc/elements/1.1/rights</th>\n",
       "      <td>2897004</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:team</th>\n",
       "      <td>2007122</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:birthDate</th>\n",
       "      <td>1740614</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://xmlns.com/foaf/0.1/depiction</th>\n",
       "      <td>1698618</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:thumbnail</th>\n",
       "      <td>1695460</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>pr:title</th>\n",
       "      <td>1566113</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:wikiPageDisambiguates</th>\n",
       "      <td>1537180</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://www.w3.org/2004/02/skos/core#prefLabel</th>\n",
       "      <td>1475015</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://xmlns.com/foaf/0.1/thumbnail</th>\n",
       "      <td>1448505</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://xmlns.com/foaf/0.1/gender</th>\n",
       "      <td>1418209</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:birthPlace</th>\n",
       "      <td>1330297</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>pr:subdivisionType</th>\n",
       "      <td>1321475</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://purl.org/dc/terms/description</th>\n",
       "      <td>1289109</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>pr:plantLatM</th>\n",
       "      <td>135</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>ns2:v4b</th>\n",
       "      <td>135</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>ns5:v1b</th>\n",
       "      <td>135</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>pr:affdate</th>\n",
       "      <td>135</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:dissolved</th>\n",
       "      <td>135</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>pr:game11Attendance</th>\n",
       "      <td>135</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>ns5:v2b</th>\n",
       "      <td>135</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>pr:game9Attendance</th>\n",
       "      <td>135</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>pr:dharmaName</th>\n",
       "      <td>135</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>pr:irishGridReference</th>\n",
       "      <td>135</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>pr:seats1Next</th>\n",
       "      <td>135</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>pr:payloadCapacity</th>\n",
       "      <td>135</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>pr:ports</th>\n",
       "      <td>135</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>pr:compartment</th>\n",
       "      <td>135</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>pr:powerout</th>\n",
       "      <td>135</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>pr:seats1Begin</th>\n",
       "      <td>135</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>pr:longMin</th>\n",
       "      <td>135</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>pr:rotAreaSqm</th>\n",
       "      <td>135</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>pr:plantLongM</th>\n",
       "      <td>135</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>pr:deacon</th>\n",
       "      <td>135</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>pr:singleTemperature</th>\n",
       "      <td>135</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>pr:skipperlastname</th>\n",
       "      <td>135</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>pr:anchor</th>\n",
       "      <td>135</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>pr:flavour</th>\n",
       "      <td>135</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>pr:bo</th>\n",
       "      <td>135</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>pr:buschCarTeam</th>\n",
       "      <td>135</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>pr:majorsites</th>\n",
       "      <td>135</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>ns1:v4b</th>\n",
       "      <td>135</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>ns10:a</th>\n",
       "      <td>135</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>pr:seats1Last</th>\n",
       "      <td>134</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>10000 rows × 1 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "                                                   count\n",
       "p                                                       \n",
       "rdf:type                                       113715893\n",
       "http://www.w3.org/2002/07/owl#sameAs            33623696\n",
       "http://purl.org/dc/terms/subject                23990506\n",
       "rdfs:label                                      22430852\n",
       "http://www.w3.org/ns/prov#wasDerivedFrom        15801285\n",
       "on:wikiPageID                                   15797811\n",
       "on:wikiPageRevisionID                           15797811\n",
       "http://purl.org/dc/elements/1.1/language        12845235\n",
       "http://xmlns.com/foaf/0.1/primaryTopic          12845235\n",
       "http://xmlns.com/foaf/0.1/isPrimaryTopicOf      12845234\n",
       "rdfs:comment                                    12391811\n",
       "on:abstract                                     12390578\n",
       "on:wikiPageExternalLink                          7772279\n",
       "on:wikiPageRedirects                             7632358\n",
       "http://xmlns.com/foaf/0.1/name                   4146581\n",
       "http://purl.org/linguistics/gold/hypernym        4090049\n",
       "http://www.w3.org/2004/02/skos/core#broader      3080338\n",
       "http://purl.org/dc/elements/1.1/rights           2897004\n",
       "on:team                                          2007122\n",
       "on:birthDate                                     1740614\n",
       "http://xmlns.com/foaf/0.1/depiction              1698618\n",
       "on:thumbnail                                     1695460\n",
       "pr:title                                         1566113\n",
       "on:wikiPageDisambiguates                         1537180\n",
       "http://www.w3.org/2004/02/skos/core#prefLabel    1475015\n",
       "http://xmlns.com/foaf/0.1/thumbnail              1448505\n",
       "http://xmlns.com/foaf/0.1/gender                 1418209\n",
       "on:birthPlace                                    1330297\n",
       "pr:subdivisionType                               1321475\n",
       "http://purl.org/dc/terms/description             1289109\n",
       "...                                                  ...\n",
       "pr:plantLatM                                         135\n",
       "ns2:v4b                                              135\n",
       "ns5:v1b                                              135\n",
       "pr:affdate                                           135\n",
       "on:dissolved                                         135\n",
       "pr:game11Attendance                                  135\n",
       "ns5:v2b                                              135\n",
       "pr:game9Attendance                                   135\n",
       "pr:dharmaName                                        135\n",
       "pr:irishGridReference                                135\n",
       "pr:seats1Next                                        135\n",
       "pr:payloadCapacity                                   135\n",
       "pr:ports                                             135\n",
       "pr:compartment                                       135\n",
       "pr:powerout                                          135\n",
       "pr:seats1Begin                                       135\n",
       "pr:longMin                                           135\n",
       "pr:rotAreaSqm                                        135\n",
       "pr:plantLongM                                        135\n",
       "pr:deacon                                            135\n",
       "pr:singleTemperature                                 135\n",
       "pr:skipperlastname                                   135\n",
       "pr:anchor                                            135\n",
       "pr:flavour                                           135\n",
       "pr:bo                                                135\n",
       "pr:buschCarTeam                                      135\n",
       "pr:majorsites                                        135\n",
       "ns1:v4b                                              135\n",
       "ns10:a                                               135\n",
       "pr:seats1Last                                        134\n",
       "\n",
       "[10000 rows x 1 columns]"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "time: 7.89 s\n"
     ]
    }
   ],
   "source": [
    "predicates=endpoint.select(\"\"\"\n",
    "    SELECT ?p (COUNT(*) AS ?count) { ?s ?p ?o .} GROUP BY ?p ORDER BY DESC(?count)\n",
    "\"\"\")\n",
    "predicates"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Some notes.  \n",
    "\n",
    "First of all,  properties that are original to DBpedia. are in two namespaces;  the **on** namespace contains DBpedia Ontology properties which are better organized (mapped manually) than the **pr** namespace that contains properties that are mapped automatically.  The `select` function returns short names for predicates in these namespaces because I specified them in the prefix list above.\n",
    "\n",
    "DBpedia also uses predicates that are defined in other namespaces,  such as **foaf** and **dc**.  Frequently these duplicate properties that are defined in DBpedia,  but facilitate interoperability with tools and data that use standard vocabularies.  `select` would show you short names for these to if I added them to the prefix list,  but I didn't,  so it doesn't.\n",
    "\n",
    "If you look closely,  you might notice we got exactly 10,000 results from this last query.  This is not because DBpedia uses only 10,000 distinct predicates,  but because the DBpedia SPARQL endpoint has a 10,000 row result limit.  This can be annoying sometimes,  but it protects the endpoint from people who write crazy queries.  There is a bag of tricks for dealing with this,  but in the purposes of this article,  10,000 predicates is enough to get started.\n",
    "\n",
    "This begs the question:\n",
    "\n",
    "\"How many distinct predicates are used in DBpedia?\"\n",
    "\n",
    "which is easy to answer with a SPARQL query:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>count</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>60649</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   count\n",
       "0  60649"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "time: 269 ms\n"
     ]
    }
   ],
   "source": [
    "endpoint.select(\"\"\"\n",
    "    SELECT (COUNT(*) AS ?count) { SELECT DISTINCT ?p { ?s ?p ?o .} }\n",
    "\"\"\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "When you have a number of \"things\" ordered by how prevalent there are,  a cumulative distribution function is a great nonparametric method of characterizing the statistics"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "time: 2.5 ms\n"
     ]
    }
   ],
   "source": [
    "predicates[\"dist\"]=predicates[\"count\"].cumsum()/count"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.axes._subplots.AxesSubplot at 0x1673ca97518>"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXcAAAEKCAYAAADpfBXhAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMS4wLCBo\ndHRwOi8vbWF0cGxvdGxpYi5vcmcvpW3flQAAH2FJREFUeJzt3XucXGWd5/HPt6svuUKABIhJMFED\niMhlzAQdcUQHHcDdRAUVRlcZR1l2DK73wRUZxPE6s7ovV7xEFlFHQUBlIqKICAMol3TkGiAYA5g2\nIJEEciPpdPdv/zhPpU8qla7TTZfVOXzfr1e/6lyec56nTp361tNPVZ1SRGBmZuXS1uoGmJnZ6HO4\nm5mVkMPdzKyEHO5mZiXkcDczKyGHu5lZCTnczcxKyOFuZlZCDnczsxJqb1XFU6dOjdmzZ7eqejOz\nPdKyZcv+FBHTGpVrWbjPnj2b7u7uVlVvZrZHkvRIkXIeljEzKyGHu5lZCTnczcxKyOFuZlZCDcNd\n0kWSHpd0727WS9KXJK2UdLekvxj9ZpqZ2XAU6blfDJwwxPoTgbnp7wzgq8+8WWZm9kw0DPeIuBFY\nN0SRhcC3I3MrMEXS9NFqoJmZDd9ofM59BrA6N9+Tlj06Cvs2s2GKCAYid0sQQfaXpgciCCAG6ixL\n2wZpWZBND0Ta/2DZ6nqo1pntb2Bg13rzbWJHnTvXRXVZTZuIwbry7azuJ3bc91y9ueORX7djOpWp\n1k+qZ9ftd11GzbFKm+60T4bYPr8s/7gNbl9tTm67Yf4k6miEu+osq9sKSWeQDd1w0EEHjULVVgYR\nwfb+oG9ggO19QW//wI7p7QMD9A/Ejr++gaB/YID+AehL6/oGgoEd62rnB+qur7e/atnquoGo3maB\nMpCfjizABqJmWZDK1ZYJ+neEW9A/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4n2yI5iKyTty7qPnkTp3jczvZENOtwCdTJ+5HZOfqXWRDLh+JiMdS\n+XrHhVTXgcDKdO58g6wzOJRGj3etH5ANPVUfq9uApyKil6yD+bl0Pt/JyD9F92c3Jr6hquzz8XdE\nxP/LLdsUEZNGYd+zyd5sPPyZ7mtPouy7BDeQfVqi3r+0RfYxm5Ifu2fDfXwmRnJ80jDfpoj4t4Ll\njyP7AMN/GUETR4WkSen9kv3IXphennvh2SO18pK/AKSe+Wbgg61uS1lIejvZp0A+MNJgN3uWuUrZ\nl+E6yf7T2KODHcZIz93MzEaXry1jZlZCDnczsxJyuJuZlZDD3cyshBzuZmYl5HA3S5RdI/wBSd9K\nX1i7Qs/Ca6hbOTjczXZ2CLA4Io4g+4bvP7a4PWYj4nA321ntFSKPbWVjzEbK4W62s91dIdJsj+Jw\nN9vZcK8gajYmOdzNdtbwCpFme4KWXzjMbIwZiIgzGxczG9vcczczKyFfFdLMrITcczczKyGHu5lZ\nCTnczcxKyOFuZlZCDnczsxJyuJuZldD/B4TsxRe4zU4EAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x1673cc65b38>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "time: 345 ms\n"
     ]
    }
   ],
   "source": [
    "%matplotlib inline\n",
    "predicates[\"dist\"].plot()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "This distribution certainly looks like it has a \"knee\" somewhere in the teens,  probably involving a transition from predicates that could apply to any topic such as **rdfs:comment** as opposed to predicates specific to certain subject areas,  such as **on:team**."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.axes._subplots.AxesSubplot at 0x1673c4a5390>"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAAN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r/nJZ3cNZx39bSc4hp8m+PyhY5SWO+rG/BuqZtbq7gWnuP0K4D+Ab7v7\n/wv7/t5C0EIZ8H7jmZlVAt9z9xvGYNl/SdBH/tVRWFbcdVpwuuSv3X1xv+lfJviQ7Zsx7pMN9ISf\nq1wGfDfs0hGREUr4qwvwbwQfgvwEwN0vAjAbTnf++BB+ODTqwR4u+yejuKwxqzM0E3gkfAvfBXx4\nDNclMqHo2jIiIilI15YREUlBCncRkRSkcBcRSUEKdxGRFKRwFxFJQQp3kZAFV0TcZmY/Cq/u95hF\nXS9cZDxRuIuc6CzgQXc/j+AbnB8bZH6RpKRwFznRfnd/JRz+CcFVFUXGHYW7yIliXfVPZNxRuIuc\naGbUlS3vZODLMoskNYW7yIm2Elx5cwPBVSm/O8j8IkkpGS4cJpJMet091qV5RcYVtdxFRFKQrgop\nIpKC1HIXEUlBCncRkRSkcBcRSUEKdxGRFKRwFxFJQQp3EZEU9P8ByZFlCzwtNbEAAAAASUVORK5C\nYII=\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x1673d1f6470>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "time: 120 ms\n"
     ]
    }
   ],
   "source": [
    "predicates[\"dist\"].head(100).plot()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Here are the top 20 predicates,  representing more than 80% of the predicates used in the main graph"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>count</th>\n",
       "      <th>dist</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>p</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>rdf:type</th>\n",
       "      <td>113715893</td>\n",
       "      <td>0.259426</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://www.w3.org/2002/07/owl#sameAs</th>\n",
       "      <td>33623696</td>\n",
       "      <td>0.336134</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://purl.org/dc/terms/subject</th>\n",
       "      <td>23990506</td>\n",
       "      <td>0.390864</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>rdfs:label</th>\n",
       "      <td>22430852</td>\n",
       "      <td>0.442037</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://www.w3.org/ns/prov#wasDerivedFrom</th>\n",
       "      <td>15801285</td>\n",
       "      <td>0.478085</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:wikiPageID</th>\n",
       "      <td>15797811</td>\n",
       "      <td>0.514126</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:wikiPageRevisionID</th>\n",
       "      <td>15797811</td>\n",
       "      <td>0.550166</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://purl.org/dc/elements/1.1/language</th>\n",
       "      <td>12845235</td>\n",
       "      <td>0.579471</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://xmlns.com/foaf/0.1/primaryTopic</th>\n",
       "      <td>12845235</td>\n",
       "      <td>0.608775</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://xmlns.com/foaf/0.1/isPrimaryTopicOf</th>\n",
       "      <td>12845234</td>\n",
       "      <td>0.638080</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>rdfs:comment</th>\n",
       "      <td>12391811</td>\n",
       "      <td>0.666350</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:abstract</th>\n",
       "      <td>12390578</td>\n",
       "      <td>0.694617</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:wikiPageExternalLink</th>\n",
       "      <td>7772279</td>\n",
       "      <td>0.712348</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:wikiPageRedirects</th>\n",
       "      <td>7632358</td>\n",
       "      <td>0.729760</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://xmlns.com/foaf/0.1/name</th>\n",
       "      <td>4146581</td>\n",
       "      <td>0.739220</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://purl.org/linguistics/gold/hypernym</th>\n",
       "      <td>4090049</td>\n",
       "      <td>0.748551</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://www.w3.org/2004/02/skos/core#broader</th>\n",
       "      <td>3080338</td>\n",
       "      <td>0.755578</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://purl.org/dc/elements/1.1/rights</th>\n",
       "      <td>2897004</td>\n",
       "      <td>0.762187</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:team</th>\n",
       "      <td>2007122</td>\n",
       "      <td>0.766766</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:birthDate</th>\n",
       "      <td>1740614</td>\n",
       "      <td>0.770737</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://xmlns.com/foaf/0.1/depiction</th>\n",
       "      <td>1698618</td>\n",
       "      <td>0.774612</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:thumbnail</th>\n",
       "      <td>1695460</td>\n",
       "      <td>0.778480</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>pr:title</th>\n",
       "      <td>1566113</td>\n",
       "      <td>0.782053</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:wikiPageDisambiguates</th>\n",
       "      <td>1537180</td>\n",
       "      <td>0.785560</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://www.w3.org/2004/02/skos/core#prefLabel</th>\n",
       "      <td>1475015</td>\n",
       "      <td>0.788925</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://xmlns.com/foaf/0.1/thumbnail</th>\n",
       "      <td>1448505</td>\n",
       "      <td>0.792230</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://xmlns.com/foaf/0.1/gender</th>\n",
       "      <td>1418209</td>\n",
       "      <td>0.795465</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:birthPlace</th>\n",
       "      <td>1330297</td>\n",
       "      <td>0.798500</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>pr:subdivisionType</th>\n",
       "      <td>1321475</td>\n",
       "      <td>0.801515</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://purl.org/dc/terms/description</th>\n",
       "      <td>1289109</td>\n",
       "      <td>0.804456</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                                                   count      dist\n",
       "p                                                                 \n",
       "rdf:type                                       113715893  0.259426\n",
       "http://www.w3.org/2002/07/owl#sameAs            33623696  0.336134\n",
       "http://purl.org/dc/terms/subject                23990506  0.390864\n",
       "rdfs:label                                      22430852  0.442037\n",
       "http://www.w3.org/ns/prov#wasDerivedFrom        15801285  0.478085\n",
       "on:wikiPageID                                   15797811  0.514126\n",
       "on:wikiPageRevisionID                           15797811  0.550166\n",
       "http://purl.org/dc/elements/1.1/language        12845235  0.579471\n",
       "http://xmlns.com/foaf/0.1/primaryTopic          12845235  0.608775\n",
       "http://xmlns.com/foaf/0.1/isPrimaryTopicOf      12845234  0.638080\n",
       "rdfs:comment                                    12391811  0.666350\n",
       "on:abstract                                     12390578  0.694617\n",
       "on:wikiPageExternalLink                          7772279  0.712348\n",
       "on:wikiPageRedirects                             7632358  0.729760\n",
       "http://xmlns.com/foaf/0.1/name                   4146581  0.739220\n",
       "http://purl.org/linguistics/gold/hypernym        4090049  0.748551\n",
       "http://www.w3.org/2004/02/skos/core#broader      3080338  0.755578\n",
       "http://purl.org/dc/elements/1.1/rights           2897004  0.762187\n",
       "on:team                                          2007122  0.766766\n",
       "on:birthDate                                     1740614  0.770737\n",
       "http://xmlns.com/foaf/0.1/depiction              1698618  0.774612\n",
       "on:thumbnail                                     1695460  0.778480\n",
       "pr:title                                         1566113  0.782053\n",
       "on:wikiPageDisambiguates                         1537180  0.785560\n",
       "http://www.w3.org/2004/02/skos/core#prefLabel    1475015  0.788925\n",
       "http://xmlns.com/foaf/0.1/thumbnail              1448505  0.792230\n",
       "http://xmlns.com/foaf/0.1/gender                 1418209  0.795465\n",
       "on:birthPlace                                    1330297  0.798500\n",
       "pr:subdivisionType                               1321475  0.801515\n",
       "http://purl.org/dc/terms/description             1289109  0.804456"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "time: 9.5 ms\n"
     ]
    }
   ],
   "source": [
    "predicates.head(30)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Looking at the tail,  I find some very random sorts of properties."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>count</th>\n",
       "      <th>dist</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>p</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>pr:buschCarTeam</th>\n",
       "      <td>135</td>\n",
       "      <td>0.998442</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>pr:majorsites</th>\n",
       "      <td>135</td>\n",
       "      <td>0.998442</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>ns1:v4b</th>\n",
       "      <td>135</td>\n",
       "      <td>0.998442</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>ns10:a</th>\n",
       "      <td>135</td>\n",
       "      <td>0.998442</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>pr:seats1Last</th>\n",
       "      <td>134</td>\n",
       "      <td>0.998443</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                 count      dist\n",
       "p                               \n",
       "pr:buschCarTeam    135  0.998442\n",
       "pr:majorsites      135  0.998442\n",
       "ns1:v4b            135  0.998442\n",
       "ns10:a             135  0.998442\n",
       "pr:seats1Last      134  0.998443"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "time: 15 ms\n"
     ]
    }
   ],
   "source": [
    "predicates.tail()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Here are predicates that are at the 90%,  95%, 98%, and 99% cumulative distributions,  just to get a sense of what happens as things get more rare."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>count</th>\n",
       "      <th>dist</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>p</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>on:areaTotal</th>\n",
       "      <td>179581</td>\n",
       "      <td>0.900161</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "               count      dist\n",
       "p                             \n",
       "on:areaTotal  179581  0.900161"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "time: 17.1 ms\n"
     ]
    }
   ],
   "source": [
    "predicates[predicates[\"dist\"]>0.9].head(1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>count</th>\n",
       "      <th>dist</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>p</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>pr:nativeName</th>\n",
       "      <td>31226</td>\n",
       "      <td>0.95004</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "               count     dist\n",
       "p                            \n",
       "pr:nativeName  31226  0.95004"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "time: 18 ms\n"
     ]
    }
   ],
   "source": [
    "predicates[predicates[\"dist\"]>0.95].head(1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>count</th>\n",
       "      <th>dist</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>p</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>pr:ordination</th>\n",
       "      <td>4839</td>\n",
       "      <td>0.980009</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "               count      dist\n",
       "p                             \n",
       "pr:ordination   4839  0.980009"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "time: 15.5 ms\n"
     ]
    }
   ],
   "source": [
    "predicates[predicates[\"dist\"]>0.98].head(1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>count</th>\n",
       "      <th>dist</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>p</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>pr:namedAfter</th>\n",
       "      <td>1765</td>\n",
       "      <td>0.990003</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "               count      dist\n",
       "p                             \n",
       "pr:namedAfter   1765  0.990003"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "time: 19.5 ms\n"
     ]
    }
   ],
   "source": [
    "predicates[predicates[\"dist\"]>0.99].head(1)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": true
   },
   "source": [
    "**pr:skipperlastname** (property ranked number 9993) caught my eye,  so I take a look at it."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>s</th>\n",
       "      <th>o</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>&lt;1989–90_Whitbread_Round_the_World_Race&gt;</td>\n",
       "      <td>English</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>&lt;1993–94_Whitbread_Round_the_World_Race&gt;</td>\n",
       "      <td>Field</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>&lt;1973–74_Whitbread_Round_the_World_Race&gt;</td>\n",
       "      <td>Goodwin</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>&lt;1977–78_Whitbread_Round_the_World_Race&gt;</td>\n",
       "      <td>James</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>&lt;1989–90_Whitbread_Round_the_World_Race&gt;</td>\n",
       "      <td>Smith</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>&lt;1993–94_Whitbread_Round_the_World_Race&gt;</td>\n",
       "      <td>Smith</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>&lt;1981–82_Whitbread_Round_the_World_Race&gt;</td>\n",
       "      <td>Taylor</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>&lt;1985–86_Whitbread_Round_the_World_Race&gt;</td>\n",
       "      <td>Taylor</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>&lt;Oryx_Quest&gt;</td>\n",
       "      <td>Thompson</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>&lt;1973–74_Whitbread_Round_the_World_Race&gt;</td>\n",
       "      <td>Ainslie</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>&lt;The_Race_(yachting_race)&gt;</td>\n",
       "      <td>Lewis</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>&lt;1977–78_Whitbread_Round_the_World_Race&gt;</td>\n",
       "      <td>Watts</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>&lt;Volvo_Baltic_Race&gt;</td>\n",
       "      <td>Williams</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>&lt;1981–82_Whitbread_Round_the_World_Race&gt;</td>\n",
       "      <td>Williams</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>&lt;1977–78_Whitbread_Round_the_World_Race&gt;</td>\n",
       "      <td>Williams</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>&lt;1973–74_Whitbread_Round_the_World_Race&gt;</td>\n",
       "      <td>Williams</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>&lt;1989–90_Whitbread_Round_the_World_Race&gt;</td>\n",
       "      <td>Dubois</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>&lt;1989–90_Whitbread_Round_the_World_Race&gt;</td>\n",
       "      <td>Edwards</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>&lt;Volvo_Baltic_Race&gt;</td>\n",
       "      <td>Mortensen</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>&lt;1993–94_Whitbread_Round_the_World_Race&gt;</td>\n",
       "      <td>Riley</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20</th>\n",
       "      <td>&lt;1985–86_Whitbread_Round_the_World_Race&gt;</td>\n",
       "      <td>Salmon</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21</th>\n",
       "      <td>&lt;1989–90_Whitbread_Round_the_World_Race&gt;</td>\n",
       "      <td>Salmon</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>22</th>\n",
       "      <td>&lt;1989–90_Whitbread_Round_the_World_Race&gt;</td>\n",
       "      <td>Dalton</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>23</th>\n",
       "      <td>&lt;1993–94_Whitbread_Round_the_World_Race&gt;</td>\n",
       "      <td>Dalton</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24</th>\n",
       "      <td>&lt;The_Race_(yachting_race)&gt;</td>\n",
       "      <td>Dalton</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25</th>\n",
       "      <td>&lt;1977–78_Whitbread_Round_the_World_Race&gt;</td>\n",
       "      <td>Francis</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>26</th>\n",
       "      <td>&lt;1977–78_Whitbread_Round_the_World_Race&gt;</td>\n",
       "      <td>Ridgway</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>27</th>\n",
       "      <td>&lt;1993–94_Whitbread_Round_the_World_Race&gt;</td>\n",
       "      <td>Dickson</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>28</th>\n",
       "      <td>&lt;1985–86_Whitbread_Round_the_World_Race&gt;</td>\n",
       "      <td>Berner</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>29</th>\n",
       "      <td>&lt;1993–94_Whitbread_Round_the_World_Race&gt;</td>\n",
       "      <td>Conner</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>105</th>\n",
       "      <td>&lt;1973–74_Whitbread_Round_the_World_Race&gt;</td>\n",
       "      <td>Laucht</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>106</th>\n",
       "      <td>&lt;1985–86_Whitbread_Round_the_World_Race&gt;</td>\n",
       "      <td>Lugt</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>107</th>\n",
       "      <td>&lt;1993–94_Whitbread_Round_the_World_Race&gt;</td>\n",
       "      <td>Maisto</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>108</th>\n",
       "      <td>&lt;1981–82_Whitbread_Round_the_World_Race&gt;</td>\n",
       "      <td>Malingri</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>109</th>\n",
       "      <td>&lt;1973–74_Whitbread_Round_the_World_Race&gt;</td>\n",
       "      <td>Malingri</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>110</th>\n",
       "      <td>&lt;1989–90_Whitbread_Round_the_World_Race&gt;</td>\n",
       "      <td>Mallé</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>111</th>\n",
       "      <td>&lt;1981–82_Whitbread_Round_the_World_Race&gt;</td>\n",
       "      <td>Mcgown-Fyfe</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>112</th>\n",
       "      <td>&lt;1973–74_Whitbread_Round_the_World_Race&gt;</td>\n",
       "      <td>Myatt</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>113</th>\n",
       "      <td>&lt;1985–86_Whitbread_Round_the_World_Race&gt;</td>\n",
       "      <td>Norsk</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>114</th>\n",
       "      <td>&lt;1981–82_Whitbread_Round_the_World_Race&gt;</td>\n",
       "      <td>Panada</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>115</th>\n",
       "      <td>&lt;1973–74_Whitbread_Round_the_World_Race&gt;</td>\n",
       "      <td>Pascoli</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>116</th>\n",
       "      <td>&lt;1973–74_Whitbread_Round_the_World_Race&gt;</td>\n",
       "      <td>Perlicki</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>117</th>\n",
       "      <td>&lt;1973–74_Whitbread_Round_the_World_Race&gt;</td>\n",
       "      <td>Pienkawa</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>118</th>\n",
       "      <td>&lt;1985–86_Whitbread_Round_the_World_Race&gt;</td>\n",
       "      <td>Péan</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>119</th>\n",
       "      <td>&lt;1981–82_Whitbread_Round_the_World_Race&gt;</td>\n",
       "      <td>Rietschoten</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>120</th>\n",
       "      <td>&lt;1977–78_Whitbread_Round_the_World_Race&gt;</td>\n",
       "      <td>Rietschoten</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>121</th>\n",
       "      <td>&lt;1981–82_Whitbread_Round_the_World_Race&gt;</td>\n",
       "      <td>Stampi</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>122</th>\n",
       "      <td>&lt;1981–82_Whitbread_Round_the_World_Race&gt;</td>\n",
       "      <td>Tabarly</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>123</th>\n",
       "      <td>&lt;1985–86_Whitbread_Round_the_World_Race&gt;</td>\n",
       "      <td>Tabarly</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>124</th>\n",
       "      <td>&lt;1989–90_Whitbread_Round_the_World_Race&gt;</td>\n",
       "      <td>Tabarly</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>125</th>\n",
       "      <td>&lt;1993–94_Whitbread_Round_the_World_Race&gt;</td>\n",
       "      <td>Tabarly</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>126</th>\n",
       "      <td>&lt;1973–74_Whitbread_Round_the_World_Race&gt;</td>\n",
       "      <td>Tabarly</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>127</th>\n",
       "      <td>&lt;1981–82_Whitbread_Round_the_World_Race&gt;</td>\n",
       "      <td>Versluys</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>128</th>\n",
       "      <td>&lt;1985–86_Whitbread_Round_the_World_Race&gt;</td>\n",
       "      <td>Versluys</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>129</th>\n",
       "      <td>&lt;1981–82_Whitbread_Round_the_World_Race&gt;</td>\n",
       "      <td>Viant</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>130</th>\n",
       "      <td>&lt;1977–78_Whitbread_Round_the_World_Race&gt;</td>\n",
       "      <td>Viant</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>131</th>\n",
       "      <td>&lt;1973–74_Whitbread_Round_the_World_Race&gt;</td>\n",
       "      <td>Viant</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>132</th>\n",
       "      <td>&lt;1985–86_Whitbread_Round_the_World_Race&gt;</td>\n",
       "      <td>Visiers</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>133</th>\n",
       "      <td>&lt;1989–90_Whitbread_Round_the_World_Race&gt;</td>\n",
       "      <td>Wilkeri</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>134</th>\n",
       "      <td>&lt;1985–86_Whitbread_Round_the_World_Race&gt;</td>\n",
       "      <td>Zehender-Mueller</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>135 rows × 2 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "                                            s                 o\n",
       "0    <1989–90_Whitbread_Round_the_World_Race>           English\n",
       "1    <1993–94_Whitbread_Round_the_World_Race>             Field\n",
       "2    <1973–74_Whitbread_Round_the_World_Race>           Goodwin\n",
       "3    <1977–78_Whitbread_Round_the_World_Race>             James\n",
       "4    <1989–90_Whitbread_Round_the_World_Race>             Smith\n",
       "5    <1993–94_Whitbread_Round_the_World_Race>             Smith\n",
       "6    <1981–82_Whitbread_Round_the_World_Race>            Taylor\n",
       "7    <1985–86_Whitbread_Round_the_World_Race>            Taylor\n",
       "8                                <Oryx_Quest>          Thompson\n",
       "9    <1973–74_Whitbread_Round_the_World_Race>           Ainslie\n",
       "10                 <The_Race_(yachting_race)>             Lewis\n",
       "11   <1977–78_Whitbread_Round_the_World_Race>             Watts\n",
       "12                        <Volvo_Baltic_Race>          Williams\n",
       "13   <1981–82_Whitbread_Round_the_World_Race>          Williams\n",
       "14   <1977–78_Whitbread_Round_the_World_Race>          Williams\n",
       "15   <1973–74_Whitbread_Round_the_World_Race>          Williams\n",
       "16   <1989–90_Whitbread_Round_the_World_Race>            Dubois\n",
       "17   <1989–90_Whitbread_Round_the_World_Race>           Edwards\n",
       "18                        <Volvo_Baltic_Race>         Mortensen\n",
       "19   <1993–94_Whitbread_Round_the_World_Race>             Riley\n",
       "20   <1985–86_Whitbread_Round_the_World_Race>            Salmon\n",
       "21   <1989–90_Whitbread_Round_the_World_Race>            Salmon\n",
       "22   <1989–90_Whitbread_Round_the_World_Race>            Dalton\n",
       "23   <1993–94_Whitbread_Round_the_World_Race>            Dalton\n",
       "24                 <The_Race_(yachting_race)>            Dalton\n",
       "25   <1977–78_Whitbread_Round_the_World_Race>           Francis\n",
       "26   <1977–78_Whitbread_Round_the_World_Race>           Ridgway\n",
       "27   <1993–94_Whitbread_Round_the_World_Race>           Dickson\n",
       "28   <1985–86_Whitbread_Round_the_World_Race>            Berner\n",
       "29   <1993–94_Whitbread_Round_the_World_Race>            Conner\n",
       "..                                        ...               ...\n",
       "105  <1973–74_Whitbread_Round_the_World_Race>            Laucht\n",
       "106  <1985–86_Whitbread_Round_the_World_Race>              Lugt\n",
       "107  <1993–94_Whitbread_Round_the_World_Race>            Maisto\n",
       "108  <1981–82_Whitbread_Round_the_World_Race>          Malingri\n",
       "109  <1973–74_Whitbread_Round_the_World_Race>          Malingri\n",
       "110  <1989–90_Whitbread_Round_the_World_Race>             Mallé\n",
       "111  <1981–82_Whitbread_Round_the_World_Race>       Mcgown-Fyfe\n",
       "112  <1973–74_Whitbread_Round_the_World_Race>             Myatt\n",
       "113  <1985–86_Whitbread_Round_the_World_Race>             Norsk\n",
       "114  <1981–82_Whitbread_Round_the_World_Race>            Panada\n",
       "115  <1973–74_Whitbread_Round_the_World_Race>           Pascoli\n",
       "116  <1973–74_Whitbread_Round_the_World_Race>          Perlicki\n",
       "117  <1973–74_Whitbread_Round_the_World_Race>          Pienkawa\n",
       "118  <1985–86_Whitbread_Round_the_World_Race>              Péan\n",
       "119  <1981–82_Whitbread_Round_the_World_Race>       Rietschoten\n",
       "120  <1977–78_Whitbread_Round_the_World_Race>       Rietschoten\n",
       "121  <1981–82_Whitbread_Round_the_World_Race>            Stampi\n",
       "122  <1981–82_Whitbread_Round_the_World_Race>           Tabarly\n",
       "123  <1985–86_Whitbread_Round_the_World_Race>           Tabarly\n",
       "124  <1989–90_Whitbread_Round_the_World_Race>           Tabarly\n",
       "125  <1993–94_Whitbread_Round_the_World_Race>           Tabarly\n",
       "126  <1973–74_Whitbread_Round_the_World_Race>           Tabarly\n",
       "127  <1981–82_Whitbread_Round_the_World_Race>          Versluys\n",
       "128  <1985–86_Whitbread_Round_the_World_Race>          Versluys\n",
       "129  <1981–82_Whitbread_Round_the_World_Race>             Viant\n",
       "130  <1977–78_Whitbread_Round_the_World_Race>             Viant\n",
       "131  <1973–74_Whitbread_Round_the_World_Race>             Viant\n",
       "132  <1985–86_Whitbread_Round_the_World_Race>           Visiers\n",
       "133  <1989–90_Whitbread_Round_the_World_Race>           Wilkeri\n",
       "134  <1985–86_Whitbread_Round_the_World_Race>  Zehender-Mueller\n",
       "\n",
       "[135 rows x 2 columns]"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "time: 483 ms\n"
     ]
    }
   ],
   "source": [
    "endpoint.select(\"\"\"\n",
    "    SELECT ?s ?o  { ?s pr:skipperlastname ?o  }\n",
    "\"\"\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Looks like it has to do with sailing.  It's not an area that I know much about,  so I'll transclude the page describing one of the topics from Wikipedia so we can understand it."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "time: 152 ms\n"
     ]
    }
   ],
   "source": [
    "from bs4 import BeautifulSoup\n",
    "from IPython.display import display, HTML\n",
    "from uritools import urijoin\n",
    "\n",
    "def transclude(file):\n",
    "    with open(file,\"rt\",encoding=\"utf8\") as fp:\n",
    "        soop = BeautifulSoup(fp,\"html5lib\")\n",
    "    for a in soop.find_all(\"a\"):\n",
    "        a[\"href\"]=urijoin(\"http://en.wikipedia.org/\",a[\"href\"])   \n",
    "    return HTML(str(soop.body))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<body><h1 class=\"firstHeading\" id=\"firstHeading\" lang=\"en\">The Race (yachting race)</h1>\n",
       "\t\t\t\t\t\t\t\t\t<div class=\"mw-body-content\" id=\"bodyContent\">\n",
       "\t\t\t\t\t\t\t\t\t<div class=\"noprint\" id=\"siteSub\">From Wikipedia, the free encyclopedia</div>\n",
       "\n",
       "<p><b>The Race</b> was a round-the-world sailing race starting in <a href=\"http://en.wikipedia.org/wiki/Barcelona\" title=\"Barcelona\">Barcelona</a>, <a href=\"http://en.wikipedia.org/wiki/Spain\" title=\"Spain\">Spain</a> on December 31, 2000. It was the first ever non-stop, no-rules, no-limits, round-the-world sailing event, with a $2 million US prize. It was organized by <a href=\"http://en.wikipedia.org/wiki/Bruno_Peyron\" title=\"Bruno Peyron\">Bruno Peyron</a>.</p>\n",
       "<p>The stated objectives of this race were:</p>\n",
       "<ul>\n",
       "<li>to unite the different maritime cultures of the world</li>\n",
       "<li>to gather together the world's premiere yachtsmen and women in a common event</li>\n",
       "<li>to promote creativity in ocean sailing</li>\n",
       "<li>to ally high technology and the environment</li>\n",
       "<li>to create the most spectacular and most prestigious fleet of offshore racers that sailing has ever seen</li>\n",
       "</ul>\n",
       "<p>A second race was planned for 2004, but was cancelled amid controversy that <a href=\"http://en.wikipedia.org/wiki/Tracy_Edwards\" title=\"Tracy Edwards\">Tracy Edwards</a> had organized a competing event called <a href=\"http://en.wikipedia.org/wiki/Oryx_Quest\" title=\"Oryx Quest\">Oryx Quest</a>.</p>\n",
       "<p></p>\n",
       "<div class=\"toc\" id=\"toc\">\n",
       "<div class=\"toctitle\">\n",
       "<h2>Contents</h2>\n",
       "</div>\n",
       "<ul>\n",
       "<li class=\"toclevel-1 tocsection-1\"><a href=\"http://en.wikipedia.org/#Results\"><span class=\"tocnumber\">1</span> <span class=\"toctext\">Results</span></a></li>\n",
       "<li class=\"toclevel-1 tocsection-2\"><a href=\"http://en.wikipedia.org/#References\"><span class=\"tocnumber\">2</span> <span class=\"toctext\">References</span></a></li>\n",
       "<li class=\"toclevel-1 tocsection-3\"><a href=\"http://en.wikipedia.org/#See_also\"><span class=\"tocnumber\">3</span> <span class=\"toctext\">See also</span></a></li>\n",
       "<li class=\"toclevel-1 tocsection-4\"><a href=\"http://en.wikipedia.org/#External_links\"><span class=\"tocnumber\">4</span> <span class=\"toctext\">External links</span></a></li>\n",
       "</ul>\n",
       "</div>\n",
       "<p></p>\n",
       "<h2><span class=\"mw-headline\" id=\"Results\">Results</span><span class=\"mw-editsection\"><span class=\"mw-editsection-bracket\">[</span><a href=\"http://en.wikipedia.org/w/index.php?title=The_Race_(yachting_race)&amp;action=edit&amp;section=1\" title=\"Edit section: Results\">edit</a><span class=\"mw-editsection-bracket\">]</span></span></h2>\n",
       "<p>The 2000–01 race was won by <i><a class=\"mw-redirect\" href=\"http://en.wikipedia.org/wiki/Club_Med_(yacht)\" title=\"Club Med (yacht)\">Club Med</a></i>, skippered by <a href=\"http://en.wikipedia.org/wiki/Grant_Dalton\" title=\"Grant Dalton\">Grant Dalton</a> in 62d 6h 56' 33\".</p>\n",
       "<table class=\"wikitable\">\n",
       "<tbody><tr>\n",
       "<th data-sort-type=\"number\" width=\"28\"><abbr title=\"Position\">Pos</abbr></th>\n",
       "<th width=\"120\">Boat</th>\n",
       "<th width=\"190\">Crew</th>\n",
       "<th width=\"190\">Country</th>\n",
       "<th width=\"120\">Time</th>\n",
       "</tr>\n",
       "<tr>\n",
       "<td style=\"text-align:center\">1</td>\n",
       "<td style=\"text-align:center\"><i><a href=\"http://en.wikipedia.org/wiki/Doha_2006_(yacht)\" title=\"Doha 2006 (yacht)\">Club Med</a></i></td>\n",
       "<td><span class=\"sortkey\">Dalton, Grant</span> <span class=\"vcard\"><span class=\"fn\"><a href=\"http://en.wikipedia.org/wiki/Grant_Dalton\" title=\"Grant Dalton\">Grant Dalton</a></span></span></td>\n",
       "<td><span class=\"flagicon\"><img alt=\"\" class=\"thumbborder\" data-file-height=\"600\" data-file-width=\"1200\" height=\"12\" src=\"//upload.wikimedia.org/wikipedia/commons/thumb/3/3e/Flag_of_New_Zealand.svg/23px-Flag_of_New_Zealand.svg.png\" srcset=\"//upload.wikimedia.org/wikipedia/commons/thumb/3/3e/Flag_of_New_Zealand.svg/35px-Flag_of_New_Zealand.svg.png 1.5x, //upload.wikimedia.org/wikipedia/commons/thumb/3/3e/Flag_of_New_Zealand.svg/46px-Flag_of_New_Zealand.svg.png 2x\" width=\"23\"/> </span><a href=\"http://en.wikipedia.org/wiki/New_Zealand\" title=\"New Zealand\">New Zealand</a></td>\n",
       "<td style=\"text-align:center\"><b>62d 6h 56m 33s</b></td>\n",
       "</tr>\n",
       "<tr>\n",
       "<td style=\"text-align:center\">2</td>\n",
       "<td style=\"text-align:center\"><i><a class=\"mw-redirect\" href=\"http://en.wikipedia.org/wiki/Innovation_Explorer\" title=\"Innovation Explorer\">Innovation Explorer</a></i></td>\n",
       "<td><span class=\"sortkey\">Peyron, Loick</span> <span class=\"vcard\"><span class=\"fn\"><a class=\"mw-redirect\" href=\"http://en.wikipedia.org/wiki/Loick_Peyron\" title=\"Loick Peyron\">Loick Peyron</a></span></span> &amp; <a class=\"new\" href=\"http://en.wikipedia.org/w/index.php?title=Skip_Novak&amp;action=edit&amp;redlink=1\" title=\"Skip Novak (page does not exist)\">Skip Novak</a></td>\n",
       "<td><span class=\"flagicon\"><img alt=\"\" class=\"thumbborder\" data-file-height=\"600\" data-file-width=\"900\" height=\"15\" src=\"//upload.wikimedia.org/wikipedia/en/thumb/c/c3/Flag_of_France.svg/23px-Flag_of_France.svg.png\" srcset=\"//upload.wikimedia.org/wikipedia/en/thumb/c/c3/Flag_of_France.svg/35px-Flag_of_France.svg.png 1.5x, //upload.wikimedia.org/wikipedia/en/thumb/c/c3/Flag_of_France.svg/45px-Flag_of_France.svg.png 2x\" width=\"23\"/> </span><a href=\"http://en.wikipedia.org/wiki/France\" title=\"France\">France</a></td>\n",
       "<td style=\"text-align:center\"><b>64d 22h 32m 38s</b></td>\n",
       "</tr>\n",
       "<tr>\n",
       "<td style=\"text-align:center\">3</td>\n",
       "<td style=\"text-align:center\"><i><a class=\"new\" href=\"http://en.wikipedia.org/w/index.php?title=Team_Adventure&amp;action=edit&amp;redlink=1\" title=\"Team Adventure (page does not exist)\">Team Adventure</a></i></td>\n",
       "<td><span class=\"sortkey\">Lewis, Cam</span> <span class=\"vcard\"><span class=\"fn\"><a class=\"new\" href=\"http://en.wikipedia.org/w/index.php?title=Cam_Lewis&amp;action=edit&amp;redlink=1\" title=\"Cam Lewis (page does not exist)\">Cam Lewis</a></span></span></td>\n",
       "<td><span class=\"flagicon\"><img alt=\"\" class=\"thumbborder\" data-file-height=\"650\" data-file-width=\"1235\" height=\"12\" src=\"//upload.wikimedia.org/wikipedia/en/thumb/a/a4/Flag_of_the_United_States.svg/23px-Flag_of_the_United_States.svg.png\" srcset=\"//upload.wikimedia.org/wikipedia/en/thumb/a/a4/Flag_of_the_United_States.svg/35px-Flag_of_the_United_States.svg.png 1.5x, //upload.wikimedia.org/wikipedia/en/thumb/a/a4/Flag_of_the_United_States.svg/46px-Flag_of_the_United_States.svg.png 2x\" width=\"23\"/> </span><a href=\"http://en.wikipedia.org/wiki/United_States\" title=\"United States\">United States</a></td>\n",
       "<td style=\"text-align:center\"><b>82d 20h 21m 02s</b></td>\n",
       "</tr>\n",
       "<tr>\n",
       "<td style=\"text-align:center\">4</td>\n",
       "<td style=\"text-align:center\"><i><a href=\"http://en.wikipedia.org/wiki/Warta_Polpharma\" title=\"Warta Polpharma\">Warta Polpharma</a></i></td>\n",
       "<td><span class=\"sortkey\">Paszke, Roman</span> <span class=\"vcard\"><span class=\"fn\"><a class=\"new\" href=\"http://en.wikipedia.org/w/index.php?title=Roman_Paszke&amp;action=edit&amp;redlink=1\" title=\"Roman Paszke (page does not exist)\">Roman Paszke</a></span></span></td>\n",
       "<td><span class=\"flagicon\"><img alt=\"\" class=\"thumbborder\" data-file-height=\"800\" data-file-width=\"1280\" height=\"14\" src=\"//upload.wikimedia.org/wikipedia/en/thumb/1/12/Flag_of_Poland.svg/23px-Flag_of_Poland.svg.png\" srcset=\"//upload.wikimedia.org/wikipedia/en/thumb/1/12/Flag_of_Poland.svg/35px-Flag_of_Poland.svg.png 1.5x, //upload.wikimedia.org/wikipedia/en/thumb/1/12/Flag_of_Poland.svg/46px-Flag_of_Poland.svg.png 2x\" width=\"23\"/> </span><a href=\"http://en.wikipedia.org/wiki/Poland\" title=\"Poland\">Poland</a></td>\n",
       "<td style=\"text-align:center\"><b>99d 12h 31m</b></td>\n",
       "</tr>\n",
       "<tr>\n",
       "<td style=\"text-align:center\">5</td>\n",
       "<td style=\"text-align:center\"><i><a class=\"mw-redirect\" href=\"http://en.wikipedia.org/wiki/Team_Legato\" title=\"Team Legato\">Team Legato</a></i></td>\n",
       "<td><span class=\"sortkey\">Bullimore, Tony</span> <span class=\"vcard\"><span class=\"fn\"><a href=\"http://en.wikipedia.org/wiki/Tony_Bullimore\" title=\"Tony Bullimore\">Tony Bullimore</a></span></span></td>\n",
       "<td><span class=\"flagicon\"><img alt=\"\" class=\"thumbborder\" data-file-height=\"600\" data-file-width=\"1200\" height=\"12\" src=\"//upload.wikimedia.org/wikipedia/en/thumb/a/ae/Flag_of_the_United_Kingdom.svg/23px-Flag_of_the_United_Kingdom.svg.png\" srcset=\"//upload.wikimedia.org/wikipedia/en/thumb/a/ae/Flag_of_the_United_Kingdom.svg/35px-Flag_of_the_United_Kingdom.svg.png 1.5x, //upload.wikimedia.org/wikipedia/en/thumb/a/ae/Flag_of_the_United_Kingdom.svg/46px-Flag_of_the_United_Kingdom.svg.png 2x\" width=\"23\"/> </span><a href=\"http://en.wikipedia.org/wiki/United_Kingdom\" title=\"United Kingdom\">Great Britain</a></td>\n",
       "<td style=\"text-align:center\"><b>104d 20h 52m</b></td>\n",
       "</tr>\n",
       "<tr>\n",
       "<td style=\"text-align:center\">-</td>\n",
       "<td style=\"text-align:center\"><i><a class=\"mw-redirect\" href=\"http://en.wikipedia.org/wiki/PlayStation_(yacht)\" title=\"PlayStation (yacht)\">PlayStation</a></i></td>\n",
       "<td><span class=\"sortkey\">Fossett, Steve</span> <span class=\"vcard\"><span class=\"fn\"><a href=\"http://en.wikipedia.org/wiki/Steve_Fossett\" title=\"Steve Fossett\">Steve Fossett</a></span></span></td>\n",
       "<td><span class=\"flagicon\"><img alt=\"\" class=\"thumbborder\" data-file-height=\"650\" data-file-width=\"1235\" height=\"12\" src=\"//upload.wikimedia.org/wikipedia/en/thumb/a/a4/Flag_of_the_United_States.svg/23px-Flag_of_the_United_States.svg.png\" srcset=\"//upload.wikimedia.org/wikipedia/en/thumb/a/a4/Flag_of_the_United_States.svg/35px-Flag_of_the_United_States.svg.png 1.5x, //upload.wikimedia.org/wikipedia/en/thumb/a/a4/Flag_of_the_United_States.svg/46px-Flag_of_the_United_States.svg.png 2x\" width=\"23\"/> </span><a href=\"http://en.wikipedia.org/wiki/United_States\" title=\"United States\">United States</a></td>\n",
       "<td style=\"text-align:center\"><b>DNF<sup class=\"reference\" id=\"cite_ref-1\"><a href=\"http://en.wikipedia.org/#cite_note-1\">[a]</a></sup></b></td>\n",
       "</tr>\n",
       "<tr>\n",
       "<td style=\"text-align:center\">-</td>\n",
       "<td style=\"text-align:center\"><i><a href=\"http://en.wikipedia.org/wiki/Team_Philips\" title=\"Team Philips\">Team Philips</a></i></td>\n",
       "<td><span class=\"sortkey\">Goss, Pete</span> <span class=\"vcard\"><span class=\"fn\"><a href=\"http://en.wikipedia.org/wiki/Pete_Goss\" title=\"Pete Goss\">Pete Goss</a></span></span></td>\n",
       "<td><span class=\"flagicon\"><img alt=\"\" class=\"thumbborder\" data-file-height=\"600\" data-file-width=\"1200\" height=\"12\" src=\"//upload.wikimedia.org/wikipedia/en/thumb/a/ae/Flag_of_the_United_Kingdom.svg/23px-Flag_of_the_United_Kingdom.svg.png\" srcset=\"//upload.wikimedia.org/wikipedia/en/thumb/a/ae/Flag_of_the_United_Kingdom.svg/35px-Flag_of_the_United_Kingdom.svg.png 1.5x, //upload.wikimedia.org/wikipedia/en/thumb/a/ae/Flag_of_the_United_Kingdom.svg/46px-Flag_of_the_United_Kingdom.svg.png 2x\" width=\"23\"/> </span><a href=\"http://en.wikipedia.org/wiki/United_Kingdom\" title=\"United Kingdom\">Great Britain</a></td>\n",
       "<td style=\"text-align:center\"><b>DNS</b></td>\n",
       "</tr>\n",
       "</tbody></table>\n",
       "<div class=\"reflist\" style=\"list-style-type: lower-alpha;\">\n",
       "<div class=\"mw-references-wrap\">\n",
       "<ol class=\"references\">\n",
       "<li id=\"cite_note-1\"><span class=\"mw-cite-backlink\"><b><a href=\"http://en.wikipedia.org/#cite_ref-1\">^</a></b></span> <span class=\"reference-text\">Damaged and forced to withdraw on day 16</span></li>\n",
       "</ol>\n",
       "</div>\n",
       "</div>\n",
       "<p>Legend: <small><span class=\"nowrap\"><b>DNF</b> – Did not finish;</span> <span class=\"nowrap\"><b>DNS</b> – Did not start;</span></small></p>\n",
       "</div></body>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "time: 42.5 ms\n"
     ]
    }
   ],
   "source": [
    " transclude(\"The_Race.html\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "That wikipedia page is pretty informative,  let's see what facts are in DBpedia concerning \"The Race\".\n",
    "\n",
    "Because I set the **base_uri** when I the endpoint object,  DBpedia resources (which largely correspond to Wikipedia pages) can be easily written using angle brackets.  It would be tempting to create a namespace for them,  but it turns out that SPARQL and Turtle let you write a wider range of characters insides brackets,  as opposed to in a namespace.  Particularly,  the parenthesis in **`<The_Race_(yachting_race)>`** are legal,  but **`dbpedia:The_Race_(yachting_race)`** is not allowed!"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>p</th>\n",
       "      <th>o</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>rdf:type</td>\n",
       "      <td>on:SportsEvent</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>rdf:type</td>\n",
       "      <td>http://dbpedia.org/class/yago/WikicatSailingRaces</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>rdf:type</td>\n",
       "      <td>http://dbpedia.org/class/yago/WikicatSportsCompetitionsInSpain</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>rdf:type</td>\n",
       "      <td>http://dbpedia.org/class/yago/Abstraction100002137</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>rdf:type</td>\n",
       "      <td>http://dbpedia.org/class/yago/Contest107456188</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>rdf:type</td>\n",
       "      <td>http://dbpedia.org/class/yago/Event100029378</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>rdf:type</td>\n",
       "      <td>http://dbpedia.org/class/yago/PsychologicalFeature100023100</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>rdf:type</td>\n",
       "      <td>http://dbpedia.org/class/yago/Race107472657</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>rdf:type</td>\n",
       "      <td>http://dbpedia.org/class/yago/SocialEvent107288639</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>rdf:type</td>\n",
       "      <td>http://dbpedia.org/class/yago/YagoPermanentlyLocatedEntity</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>rdfs:label</td>\n",
       "      <td>The Race (yachting race)</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>rdfs:label</td>\n",
       "      <td>The Race</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>rdfs:label</td>\n",
       "      <td>The Race</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>rdfs:label</td>\n",
       "      <td>The Race (vela)</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>rdfs:label</td>\n",
       "      <td>The Race</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>rdfs:label</td>\n",
       "      <td>The Race</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>rdfs:comment</td>\n",
       "      <td>The Race : No Limit Around The World est une épreuve sportive imaginée et créée par Bruno Peyron...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>rdfs:comment</td>\n",
       "      <td>The Race war eine Hochseeregatta, die 2000/2001 auf Mehrrumpf-Segelyachten der G-Class - d. h. u...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>rdfs:comment</td>\n",
       "      <td>The Race : No Limit Around The World è stata una corsa a vela immaginata e creata da Bruno Peyro...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>rdfs:comment</td>\n",
       "      <td>The Race (fr. La Course du Millénaire) – regaty dookoła świata bez zawijania do portu, które odb...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20</th>\n",
       "      <td>rdfs:comment</td>\n",
       "      <td>The Race was a round-the-world sailing race starting in Barcelona, Spain on December 31, 2000. I...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21</th>\n",
       "      <td>rdfs:comment</td>\n",
       "      <td>The Race was de eerste non-stop, no-limits wedstrijd rond de wereld die startte op 31 december 2...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>22</th>\n",
       "      <td>http://www.w3.org/2002/07/owl#sameAs</td>\n",
       "      <td>http://www.wikidata.org/entity/Q1130959</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>23</th>\n",
       "      <td>http://www.w3.org/2002/07/owl#sameAs</td>\n",
       "      <td>http://de.dbpedia.org/resource/The_Race</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24</th>\n",
       "      <td>http://www.w3.org/2002/07/owl#sameAs</td>\n",
       "      <td>http://fr.dbpedia.org/resource/The_Race</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25</th>\n",
       "      <td>http://www.w3.org/2002/07/owl#sameAs</td>\n",
       "      <td>http://it.dbpedia.org/resource/The_Race_(vela)</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>26</th>\n",
       "      <td>http://www.w3.org/2002/07/owl#sameAs</td>\n",
       "      <td>http://pl.dbpedia.org/resource/The_Race</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>27</th>\n",
       "      <td>http://www.w3.org/2002/07/owl#sameAs</td>\n",
       "      <td>http://wikidata.dbpedia.org/resource/Q1130959</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>28</th>\n",
       "      <td>http://www.w3.org/2002/07/owl#sameAs</td>\n",
       "      <td>http://nl.dbpedia.org/resource/The_Race</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>29</th>\n",
       "      <td>http://www.w3.org/2002/07/owl#sameAs</td>\n",
       "      <td>http://rdf.freebase.com/ns/m.070k42</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>30</th>\n",
       "      <td>http://www.w3.org/2002/07/owl#sameAs</td>\n",
       "      <td>http://yago-knowledge.org/resource/The_Race_(yachting_race)</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>31</th>\n",
       "      <td>http://purl.org/dc/terms/subject</td>\n",
       "      <td>&lt;Category:Yachting_races&gt;</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32</th>\n",
       "      <td>http://purl.org/dc/terms/subject</td>\n",
       "      <td>&lt;Category:Round-the-world_sailing_competitions&gt;</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>33</th>\n",
       "      <td>http://purl.org/dc/terms/subject</td>\n",
       "      <td>&lt;Category:2000_in_sailing&gt;</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>34</th>\n",
       "      <td>on:wikiPageID</td>\n",
       "      <td>2280786</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>35</th>\n",
       "      <td>on:wikiPageRevisionID</td>\n",
       "      <td>660377883</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>36</th>\n",
       "      <td>on:wikiPageExternalLink</td>\n",
       "      <td>http://www.cat-alist.com/therace.htm</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>37</th>\n",
       "      <td>http://xmlns.com/foaf/0.1/isPrimaryTopicOf</td>\n",
       "      <td>http://en.wikipedia.org/wiki/The_Race_(yachting_race)</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>38</th>\n",
       "      <td>http://www.w3.org/ns/prov#wasDerivedFrom</td>\n",
       "      <td>http://en.wikipedia.org/wiki/The_Race_(yachting_race)?oldid=660377883</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>39</th>\n",
       "      <td>on:abstract</td>\n",
       "      <td>The Race : No Limit Around The World est une épreuve sportive imaginée et créée par Bruno Peyron...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>40</th>\n",
       "      <td>on:abstract</td>\n",
       "      <td>The Race was a round-the-world sailing race starting in Barcelona, Spain on December 31, 2000. I...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>41</th>\n",
       "      <td>on:abstract</td>\n",
       "      <td>The Race war eine Hochseeregatta, die 2000/2001 auf Mehrrumpf-Segelyachten der G-Class - d. h. u...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>42</th>\n",
       "      <td>on:abstract</td>\n",
       "      <td>The Race : No Limit Around The World è stata una corsa a vela immaginata e creata da Bruno Peyro...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>43</th>\n",
       "      <td>on:abstract</td>\n",
       "      <td>The Race (fr. La Course du Millénaire) – regaty dookoła świata bez zawijania do portu, które odb...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>44</th>\n",
       "      <td>on:abstract</td>\n",
       "      <td>The Race was de eerste non-stop, no-limits wedstrijd rond de wereld die startte op 31 december 2...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>45</th>\n",
       "      <td>pr:nation</td>\n",
       "      <td>FRA</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>46</th>\n",
       "      <td>pr:nation</td>\n",
       "      <td>POL</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>47</th>\n",
       "      <td>pr:nation</td>\n",
       "      <td>USA</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>48</th>\n",
       "      <td>pr:nation</td>\n",
       "      <td>GBR</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>49</th>\n",
       "      <td>pr:nation</td>\n",
       "      <td>NZL</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>50</th>\n",
       "      <td>pr:nationality</td>\n",
       "      <td>yes</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>51</th>\n",
       "      <td>pr:pos</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>52</th>\n",
       "      <td>pr:pos</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>53</th>\n",
       "      <td>pr:pos</td>\n",
       "      <td>3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>54</th>\n",
       "      <td>pr:pos</td>\n",
       "      <td>4</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>55</th>\n",
       "      <td>pr:pos</td>\n",
       "      <td>5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>56</th>\n",
       "      <td>pr:pos</td>\n",
       "      <td>–</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>57</th>\n",
       "      <td>pr:time</td>\n",
       "      <td>yes</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>58</th>\n",
       "      <td>pr:time</td>\n",
       "      <td>DNF</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>59</th>\n",
       "      <td>pr:time</td>\n",
       "      <td>5381793.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>60</th>\n",
       "      <td>pr:time</td>\n",
       "      <td>5610758.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>61</th>\n",
       "      <td>pr:time</td>\n",
       "      <td>7158062.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>62</th>\n",
       "      <td>pr:time</td>\n",
       "      <td>8598660.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>63</th>\n",
       "      <td>pr:time</td>\n",
       "      <td>9060720.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>64</th>\n",
       "      <td>pr:time</td>\n",
       "      <td>DNS</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>65</th>\n",
       "      <td>pr:boatname</td>\n",
       "      <td>&lt;Warta_Polpharma&gt;</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>66</th>\n",
       "      <td>pr:boatname</td>\n",
       "      <td>&lt;Team_Philips&gt;</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>67</th>\n",
       "      <td>pr:boatname</td>\n",
       "      <td>&lt;PlayStation_(yacht)&gt;</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>68</th>\n",
       "      <td>pr:boatname</td>\n",
       "      <td>&lt;Doha_2006_(yacht)&gt;</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>69</th>\n",
       "      <td>pr:boatname</td>\n",
       "      <td>&lt;Innovation_Explorer&gt;</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>70</th>\n",
       "      <td>pr:boatname</td>\n",
       "      <td>&lt;Team_Adventure&gt;</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>71</th>\n",
       "      <td>pr:boatname</td>\n",
       "      <td>&lt;Team_Legato&gt;</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>72</th>\n",
       "      <td>pr:boatname</td>\n",
       "      <td>yes</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>73</th>\n",
       "      <td>pr:dnf</td>\n",
       "      <td>yes</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>74</th>\n",
       "      <td>pr:dns</td>\n",
       "      <td>yes</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>75</th>\n",
       "      <td>pr:skipper</td>\n",
       "      <td>yes</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>76</th>\n",
       "      <td>pr:skipper</td>\n",
       "      <td>Skip Novak</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>77</th>\n",
       "      <td>pr:skipperfirstname</td>\n",
       "      <td>Grant</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>78</th>\n",
       "      <td>pr:skipperfirstname</td>\n",
       "      <td>Roman</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>79</th>\n",
       "      <td>pr:skipperfirstname</td>\n",
       "      <td>Tony</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>80</th>\n",
       "      <td>pr:skipperfirstname</td>\n",
       "      <td>Steve</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>81</th>\n",
       "      <td>pr:skipperfirstname</td>\n",
       "      <td>Pete</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>82</th>\n",
       "      <td>pr:skipperfirstname</td>\n",
       "      <td>Cam</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>83</th>\n",
       "      <td>pr:skipperfirstname</td>\n",
       "      <td>Loick</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>84</th>\n",
       "      <td>pr:skipperlastname</td>\n",
       "      <td>Lewis</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>85</th>\n",
       "      <td>pr:skipperlastname</td>\n",
       "      <td>Dalton</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>86</th>\n",
       "      <td>pr:skipperlastname</td>\n",
       "      <td>Bullimore</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>87</th>\n",
       "      <td>pr:skipperlastname</td>\n",
       "      <td>Fossett</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>88</th>\n",
       "      <td>pr:skipperlastname</td>\n",
       "      <td>Goss</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>89</th>\n",
       "      <td>pr:skipperlastname</td>\n",
       "      <td>Paszke</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>90</th>\n",
       "      <td>pr:skipperlastname</td>\n",
       "      <td>Peyron</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>91</th>\n",
       "      <td>http://purl.org/linguistics/gold/hypernym</td>\n",
       "      <td>&lt;Race&gt;</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                                             p  \\\n",
       "0                                     rdf:type   \n",
       "1                                     rdf:type   \n",
       "2                                     rdf:type   \n",
       "3                                     rdf:type   \n",
       "4                                     rdf:type   \n",
       "5                                     rdf:type   \n",
       "6                                     rdf:type   \n",
       "7                                     rdf:type   \n",
       "8                                     rdf:type   \n",
       "9                                     rdf:type   \n",
       "10                                  rdfs:label   \n",
       "11                                  rdfs:label   \n",
       "12                                  rdfs:label   \n",
       "13                                  rdfs:label   \n",
       "14                                  rdfs:label   \n",
       "15                                  rdfs:label   \n",
       "16                                rdfs:comment   \n",
       "17                                rdfs:comment   \n",
       "18                                rdfs:comment   \n",
       "19                                rdfs:comment   \n",
       "20                                rdfs:comment   \n",
       "21                                rdfs:comment   \n",
       "22        http://www.w3.org/2002/07/owl#sameAs   \n",
       "23        http://www.w3.org/2002/07/owl#sameAs   \n",
       "24        http://www.w3.org/2002/07/owl#sameAs   \n",
       "25        http://www.w3.org/2002/07/owl#sameAs   \n",
       "26        http://www.w3.org/2002/07/owl#sameAs   \n",
       "27        http://www.w3.org/2002/07/owl#sameAs   \n",
       "28        http://www.w3.org/2002/07/owl#sameAs   \n",
       "29        http://www.w3.org/2002/07/owl#sameAs   \n",
       "30        http://www.w3.org/2002/07/owl#sameAs   \n",
       "31            http://purl.org/dc/terms/subject   \n",
       "32            http://purl.org/dc/terms/subject   \n",
       "33            http://purl.org/dc/terms/subject   \n",
       "34                               on:wikiPageID   \n",
       "35                       on:wikiPageRevisionID   \n",
       "36                     on:wikiPageExternalLink   \n",
       "37  http://xmlns.com/foaf/0.1/isPrimaryTopicOf   \n",
       "38    http://www.w3.org/ns/prov#wasDerivedFrom   \n",
       "39                                 on:abstract   \n",
       "40                                 on:abstract   \n",
       "41                                 on:abstract   \n",
       "42                                 on:abstract   \n",
       "43                                 on:abstract   \n",
       "44                                 on:abstract   \n",
       "45                                   pr:nation   \n",
       "46                                   pr:nation   \n",
       "47                                   pr:nation   \n",
       "48                                   pr:nation   \n",
       "49                                   pr:nation   \n",
       "50                              pr:nationality   \n",
       "51                                      pr:pos   \n",
       "52                                      pr:pos   \n",
       "53                                      pr:pos   \n",
       "54                                      pr:pos   \n",
       "55                                      pr:pos   \n",
       "56                                      pr:pos   \n",
       "57                                     pr:time   \n",
       "58                                     pr:time   \n",
       "59                                     pr:time   \n",
       "60                                     pr:time   \n",
       "61                                     pr:time   \n",
       "62                                     pr:time   \n",
       "63                                     pr:time   \n",
       "64                                     pr:time   \n",
       "65                                 pr:boatname   \n",
       "66                                 pr:boatname   \n",
       "67                                 pr:boatname   \n",
       "68                                 pr:boatname   \n",
       "69                                 pr:boatname   \n",
       "70                                 pr:boatname   \n",
       "71                                 pr:boatname   \n",
       "72                                 pr:boatname   \n",
       "73                                      pr:dnf   \n",
       "74                                      pr:dns   \n",
       "75                                  pr:skipper   \n",
       "76                                  pr:skipper   \n",
       "77                         pr:skipperfirstname   \n",
       "78                         pr:skipperfirstname   \n",
       "79                         pr:skipperfirstname   \n",
       "80                         pr:skipperfirstname   \n",
       "81                         pr:skipperfirstname   \n",
       "82                         pr:skipperfirstname   \n",
       "83                         pr:skipperfirstname   \n",
       "84                          pr:skipperlastname   \n",
       "85                          pr:skipperlastname   \n",
       "86                          pr:skipperlastname   \n",
       "87                          pr:skipperlastname   \n",
       "88                          pr:skipperlastname   \n",
       "89                          pr:skipperlastname   \n",
       "90                          pr:skipperlastname   \n",
       "91   http://purl.org/linguistics/gold/hypernym   \n",
       "\n",
       "                                                                                                      o  \n",
       "0                                                                                        on:SportsEvent  \n",
       "1                                                     http://dbpedia.org/class/yago/WikicatSailingRaces  \n",
       "2                                        http://dbpedia.org/class/yago/WikicatSportsCompetitionsInSpain  \n",
       "3                                                    http://dbpedia.org/class/yago/Abstraction100002137  \n",
       "4                                                        http://dbpedia.org/class/yago/Contest107456188  \n",
       "5                                                          http://dbpedia.org/class/yago/Event100029378  \n",
       "6                                           http://dbpedia.org/class/yago/PsychologicalFeature100023100  \n",
       "7                                                           http://dbpedia.org/class/yago/Race107472657  \n",
       "8                                                    http://dbpedia.org/class/yago/SocialEvent107288639  \n",
       "9                                            http://dbpedia.org/class/yago/YagoPermanentlyLocatedEntity  \n",
       "10                                                                             The Race (yachting race)  \n",
       "11                                                                                             The Race  \n",
       "12                                                                                             The Race  \n",
       "13                                                                                      The Race (vela)  \n",
       "14                                                                                             The Race  \n",
       "15                                                                                             The Race  \n",
       "16  The Race : No Limit Around The World est une épreuve sportive imaginée et créée par Bruno Peyron...  \n",
       "17  The Race war eine Hochseeregatta, die 2000/2001 auf Mehrrumpf-Segelyachten der G-Class - d. h. u...  \n",
       "18  The Race : No Limit Around The World è stata una corsa a vela immaginata e creata da Bruno Peyro...  \n",
       "19  The Race (fr. La Course du Millénaire) – regaty dookoła świata bez zawijania do portu, które odb...  \n",
       "20  The Race was a round-the-world sailing race starting in Barcelona, Spain on December 31, 2000. I...  \n",
       "21  The Race was de eerste non-stop, no-limits wedstrijd rond de wereld die startte op 31 december 2...  \n",
       "22                                                              http://www.wikidata.org/entity/Q1130959  \n",
       "23                                                              http://de.dbpedia.org/resource/The_Race  \n",
       "24                                                              http://fr.dbpedia.org/resource/The_Race  \n",
       "25                                                       http://it.dbpedia.org/resource/The_Race_(vela)  \n",
       "26                                                              http://pl.dbpedia.org/resource/The_Race  \n",
       "27                                                        http://wikidata.dbpedia.org/resource/Q1130959  \n",
       "28                                                              http://nl.dbpedia.org/resource/The_Race  \n",
       "29                                                                  http://rdf.freebase.com/ns/m.070k42  \n",
       "30                                          http://yago-knowledge.org/resource/The_Race_(yachting_race)  \n",
       "31                                                                            <Category:Yachting_races>  \n",
       "32                                                      <Category:Round-the-world_sailing_competitions>  \n",
       "33                                                                           <Category:2000_in_sailing>  \n",
       "34                                                                                              2280786  \n",
       "35                                                                                            660377883  \n",
       "36                                                                 http://www.cat-alist.com/therace.htm  \n",
       "37                                                http://en.wikipedia.org/wiki/The_Race_(yachting_race)  \n",
       "38                                http://en.wikipedia.org/wiki/The_Race_(yachting_race)?oldid=660377883  \n",
       "39  The Race : No Limit Around The World est une épreuve sportive imaginée et créée par Bruno Peyron...  \n",
       "40  The Race was a round-the-world sailing race starting in Barcelona, Spain on December 31, 2000. I...  \n",
       "41  The Race war eine Hochseeregatta, die 2000/2001 auf Mehrrumpf-Segelyachten der G-Class - d. h. u...  \n",
       "42  The Race : No Limit Around The World è stata una corsa a vela immaginata e creata da Bruno Peyro...  \n",
       "43  The Race (fr. La Course du Millénaire) – regaty dookoła świata bez zawijania do portu, które odb...  \n",
       "44  The Race was de eerste non-stop, no-limits wedstrijd rond de wereld die startte op 31 december 2...  \n",
       "45                                                                                                  FRA  \n",
       "46                                                                                                  POL  \n",
       "47                                                                                                  USA  \n",
       "48                                                                                                  GBR  \n",
       "49                                                                                                  NZL  \n",
       "50                                                                                                  yes  \n",
       "51                                                                                                    1  \n",
       "52                                                                                                    2  \n",
       "53                                                                                                    3  \n",
       "54                                                                                                    4  \n",
       "55                                                                                                    5  \n",
       "56                                                                                                    –  \n",
       "57                                                                                                  yes  \n",
       "58                                                                                                  DNF  \n",
       "59                                                                                            5381793.0  \n",
       "60                                                                                            5610758.0  \n",
       "61                                                                                            7158062.0  \n",
       "62                                                                                            8598660.0  \n",
       "63                                                                                            9060720.0  \n",
       "64                                                                                                  DNS  \n",
       "65                                                                                    <Warta_Polpharma>  \n",
       "66                                                                                       <Team_Philips>  \n",
       "67                                                                                <PlayStation_(yacht)>  \n",
       "68                                                                                  <Doha_2006_(yacht)>  \n",
       "69                                                                                <Innovation_Explorer>  \n",
       "70                                                                                     <Team_Adventure>  \n",
       "71                                                                                        <Team_Legato>  \n",
       "72                                                                                                  yes  \n",
       "73                                                                                                  yes  \n",
       "74                                                                                                  yes  \n",
       "75                                                                                                  yes  \n",
       "76                                                                                           Skip Novak  \n",
       "77                                                                                                Grant  \n",
       "78                                                                                                Roman  \n",
       "79                                                                                                 Tony  \n",
       "80                                                                                                Steve  \n",
       "81                                                                                                 Pete  \n",
       "82                                                                                                  Cam  \n",
       "83                                                                                                Loick  \n",
       "84                                                                                                Lewis  \n",
       "85                                                                                               Dalton  \n",
       "86                                                                                            Bullimore  \n",
       "87                                                                                              Fossett  \n",
       "88                                                                                                 Goss  \n",
       "89                                                                                               Paszke  \n",
       "90                                                                                               Peyron  \n",
       "91                                                                                               <Race>  "
      ]
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "time: 466 ms\n"
     ]
    }
   ],
   "source": [
    "pd.options.display.max_rows=99\n",
    "endpoint.select(\"\"\"\n",
    "    SELECT ?p ?o  {<The_Race_(yachting_race)> ?p ?o  }\n",
    "\"\"\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "What's the story here?  Cells from the table have been converted into facts,  but the order of the facts has been scrambled.  We know that one of the boats finished in \"5381793.0\" seconds,  and we know there was a boat named \"Warta_Polpharma\" and so forth,  but we don't know which boats finished,  which boats boats finished in what time,  which boat had what skipper,  etc.\n",
    "\n",
    "This is not a limitation of RDF,  but it is a common limitation of RDF-based systems in the \"Linked Data\" era,  and it's historically been a problem in RDF.\n",
    "\n",
    "The basic problem is that if we want to write a statement like the one on the first row of the HTML table,  we end up having to write something like\n",
    "\n",
    "```\n",
    "<Some_Node>\n",
    "  pr:pos 1 ;\n",
    "  pr:boat <Club_Med> ;\n",
    "  pr:skipper <Grant_Dalton> ;\n",
    "  pr:nation \"NZL\" ;\n",
    "  pr:time 5381793.0 .\n",
    "  \n",
    "<The_Race_(yaching_race)> pr:entry <Some_Node> .\n",
    "```\n",
    "\n",
    "the only hard part is determing a name for `<Some_Node>`.  In the case of DBpedia,  names are derived from URIs in Wikipedia,  a formula that doesn't apply when we're talking about a concept that doesn't have a URI in Wikipedia.  We can duck the problem of assigning a name by using a blank node (which states a node exists without giving a specific name) but that causes problems of its own which come from the difficulty of having something nameless in a distributed system.  (What if I want to talk about a nameless entity that exists in DBpedia?)\n",
    "\n",
    "For specific problems,  it's possible,  and often straightforward,  to find ways to name nodes like `<Some_Node>`.  However,  it is hard to find a solution that pleases everybody,  particularly when we are talking about a system which is decentralized,  in which people would like names to be stable over time,  etc.\n",
    "\n",
    "With conflicting demands,  it's no wonder that this area has not been standardized by the W3C,  but it's great to see that DBpedia is making some progress in this area,  which I'll show in the next section."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Classes"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Note I started this analysis by looking first at the most commonly used predicates.  If I was looking a SQL database,  this would be like looking at a list of columns first,  and if I was looking at an Object-Oriented program,  it would be like looking at a list of methods and fields.\n",
    "\n",
    "It would be much more common to look at tables first in SQL or classes first in Java,  but RDF is different from SQL and Java,  and it often makes sense to look at properties first.\n",
    "\n",
    "For one thing,  it is possible to write properties without defining any classes or categories,  that is,  the RDF statement\n",
    "\n",
    "```\n",
    "<SomeTopic> :hasNumber 1023 .\n",
    "```\n",
    "\n",
    "is self-sufficient and meaningful without knowledge that `<SomeTopic>` is a particular kind of topic.  Thus,  properties are more fundamental.\n",
    "\n",
    "More practically,  people get into more trouble with classes than they do with properties.  Part of it is that people tend to argue more about classes (ex. can a [video game be art?](http://www.rogerebert.com/rogers-journal/video-games-can-never-be-art))\n",
    "than they do about properties (ex. \"Hideo Kojima was thge director of Metal Gear Solid\") In the case of DBpedia,  one problem is the sheer number of categories:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>count</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>type</th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>http://xmlns.com/foaf/0.1/Document</th>\n",
       "      <td>12856178</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://www.w3.org/2002/07/owl#Thing</th>\n",
       "      <td>5044222</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:Image</th>\n",
       "      <td>2897004</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://dbpedia.org/class/yago/PhysicalEntity100001930</th>\n",
       "      <td>2822488</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://dbpedia.org/class/yago/Object100002684</th>\n",
       "      <td>2720458</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://dbpedia.org/class/yago/YagoLegalActorGeo</th>\n",
       "      <td>2190190</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://dbpedia.org/class/yago/Whole100003553</th>\n",
       "      <td>2061271</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:Person</th>\n",
       "      <td>1818074</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://dbpedia.org/class/yago/YagoPermanentlyLocatedEntity</th>\n",
       "      <td>1654844</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://dbpedia.org/class/yago/YagoLegalActor</th>\n",
       "      <td>1548330</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:Agent</th>\n",
       "      <td>1546264</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://www.wikidata.org/entity/Q24229398</th>\n",
       "      <td>1529881</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://www.ontologydesignpatterns.org/ont/dul/DUL.owl#Agent</th>\n",
       "      <td>1529881</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://www.w3.org/2004/02/skos/core#Concept</th>\n",
       "      <td>1475015</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://dbpedia.org/class/yago/LivingThing100004258</th>\n",
       "      <td>1366065</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://dbpedia.org/class/yago/Organism100004475</th>\n",
       "      <td>1365758</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://www.ontologydesignpatterns.org/ont/dul/DUL.owl#NaturalPerson</th>\n",
       "      <td>1243399</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://schema.org/Person</th>\n",
       "      <td>1243399</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://www.wikidata.org/entity/Q215627</th>\n",
       "      <td>1243399</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://www.wikidata.org/entity/Q5</th>\n",
       "      <td>1243399</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://xmlns.com/foaf/0.1/Person</th>\n",
       "      <td>1243399</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://dbpedia.org/class/yago/CausalAgent100007347</th>\n",
       "      <td>1229049</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://dbpedia.org/class/yago/Person100007846</th>\n",
       "      <td>1216438</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:TimePeriod</th>\n",
       "      <td>1127706</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://dbpedia.org/class/yago/Abstraction100002137</th>\n",
       "      <td>1079890</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://www.w3.org/2003/01/geo/wgs84_pos#SpatialThing</th>\n",
       "      <td>996625</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://dbpedia.org/class/yago/YagoGeoEntity</th>\n",
       "      <td>989272</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:CareerStation</th>\n",
       "      <td>977023</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:Place</th>\n",
       "      <td>881597</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://schema.org/Place</th>\n",
       "      <td>839987</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:Location</th>\n",
       "      <td>839987</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://dbpedia.org/class/yago/Artifact100021939</th>\n",
       "      <td>689249</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://dbpedia.org/class/yago/WikicatLivingPeople</th>\n",
       "      <td>659092</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://dbpedia.org/class/yago/Location100027167</th>\n",
       "      <td>644115</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://dbpedia.org/class/yago/Region108630985</th>\n",
       "      <td>620586</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:Settlement</th>\n",
       "      <td>581293</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:PopulatedPlace</th>\n",
       "      <td>516747</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:Work</th>\n",
       "      <td>508099</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://dbpedia.org/class/yago/District108552138</th>\n",
       "      <td>497592</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://schema.org/CreativeWork</th>\n",
       "      <td>496070</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://www.wikidata.org/entity/Q386724</th>\n",
       "      <td>496070</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://www.wikidata.org/entity/Q486972</th>\n",
       "      <td>478906</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://dbpedia.org/class/yago/AdministrativeDistrict108491826</th>\n",
       "      <td>468228</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://dbpedia.org/class/yago/GeographicalArea108574314</th>\n",
       "      <td>455794</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://dbpedia.org/class/yago/Group100031264</th>\n",
       "      <td>421838</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://dbpedia.org/class/yago/PsychologicalFeature100023100</th>\n",
       "      <td>407890</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:Athlete</th>\n",
       "      <td>392672</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://dbpedia.org/class/yago/SocialGroup107950920</th>\n",
       "      <td>373140</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:Organisation</th>\n",
       "      <td>352081</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://dbpedia.org/class/yago/WikicatGlacialLakesOfTheUnitedStates</th>\n",
       "      <td>257</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://dbpedia.org/class/yago/WikicatChristianDemocraticParties</th>\n",
       "      <td>257</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://dbpedia.org/class/yago/Emotion107480068</th>\n",
       "      <td>257</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://dbpedia.org/class/yago/WikicatFemaleAviators</th>\n",
       "      <td>257</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://dbpedia.org/class/yago/WikicatPopulatedPlacesInZalaCounty</th>\n",
       "      <td>257</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://dbpedia.org/class/yago/WikicatCanadianMaleActors</th>\n",
       "      <td>257</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://dbpedia.org/class/yago/Formulation114873641</th>\n",
       "      <td>257</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://dbpedia.org/class/yago/WikicatDeportivoDeLaCoruñaPlayers</th>\n",
       "      <td>257</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://dbpedia.org/class/yago/WikicatMexicanMaleFilmActors</th>\n",
       "      <td>257</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://dbpedia.org/class/yago/WikicatU.S.ArmyAll-AmericanBowlFootballPlayers</th>\n",
       "      <td>257</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://dbpedia.org/class/yago/WikicatCronulla-SutherlandSharksPlayers</th>\n",
       "      <td>257</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://dbpedia.org/class/yago/WikicatPeopleFromCountyLimerick</th>\n",
       "      <td>257</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://dbpedia.org/class/yago/WikicatCitiesInArizona</th>\n",
       "      <td>257</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://dbpedia.org/class/yago/WikicatBritishComedians</th>\n",
       "      <td>257</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://dbpedia.org/class/yago/WikicatBrazilianExpatriatesInPortugal</th>\n",
       "      <td>256</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://dbpedia.org/class/yago/WikicatEducationalInstitutionsEstablishedIn1991</th>\n",
       "      <td>256</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://dbpedia.org/class/yago/WikicatMaleWestern(genre)FilmActors</th>\n",
       "      <td>256</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://dbpedia.org/class/yago/WikicatWarnerBros.RecordsArtists</th>\n",
       "      <td>256</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://dbpedia.org/class/yago/Apostle109799461</th>\n",
       "      <td>256</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://dbpedia.org/class/yago/WikicatAcademicsOfImperialCollegeLondon</th>\n",
       "      <td>256</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://dbpedia.org/class/yago/WikicatBritishDrummers</th>\n",
       "      <td>256</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://dbpedia.org/class/yago/WikicatCharitiesBasedInLondon</th>\n",
       "      <td>256</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://dbpedia.org/class/yago/WikicatFantasy-comedyFilms</th>\n",
       "      <td>256</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://dbpedia.org/class/yago/SearchEngine106578654</th>\n",
       "      <td>256</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://dbpedia.org/class/yago/WikicatCommunesOfCameroon</th>\n",
       "      <td>256</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://dbpedia.org/class/yago/WikicatMicrosoftGames</th>\n",
       "      <td>256</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://dbpedia.org/class/yago/WikicatRadioStationsEstablishedIn1947</th>\n",
       "      <td>256</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://dbpedia.org/class/yago/WikicatVillagesInBielskCounty</th>\n",
       "      <td>256</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://dbpedia.org/class/yago/WikicatRomanianEssayists</th>\n",
       "      <td>256</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://dbpedia.org/class/yago/WikicatProtestantTheologians</th>\n",
       "      <td>256</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://dbpedia.org/class/yago/Waterway109476331</th>\n",
       "      <td>256</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://dbpedia.org/class/yago/WikicatEducationalInstitutionsEstablishedIn1954</th>\n",
       "      <td>256</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://dbpedia.org/class/yago/Polyhedron113883885</th>\n",
       "      <td>256</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://dbpedia.org/class/yago/WikicatMolecularBiologists</th>\n",
       "      <td>256</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://dbpedia.org/class/yago/WikicatMunicipalitiesOfElSalvador</th>\n",
       "      <td>256</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://dbpedia.org/class/yago/Smith110614629</th>\n",
       "      <td>256</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://dbpedia.org/class/yago/WikicatAmericanExpatriatesInFrance</th>\n",
       "      <td>256</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://dbpedia.org/class/yago/WikicatDCComicsCharactersWithSuperhumanStrength</th>\n",
       "      <td>256</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://dbpedia.org/class/yago/WikicatShelbourneF.C.Players</th>\n",
       "      <td>256</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://dbpedia.org/class/yago/WikicatEnglishWomenPoets</th>\n",
       "      <td>256</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://dbpedia.org/class/yago/WikicatK.A.A.GentPlayers</th>\n",
       "      <td>256</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://dbpedia.org/class/yago/WikicatGreekPoliticians</th>\n",
       "      <td>256</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://dbpedia.org/class/yago/Body109224911</th>\n",
       "      <td>256</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://dbpedia.org/class/yago/WikicatEnglishTheatreDirectors</th>\n",
       "      <td>256</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://dbpedia.org/class/yago/WikicatPeopleFromSaxony</th>\n",
       "      <td>256</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://dbpedia.org/class/yago/WikicatDisneyChannelShows</th>\n",
       "      <td>256</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://dbpedia.org/class/yago/WikicatPeopleFromBratislava</th>\n",
       "      <td>256</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://dbpedia.org/class/yago/WikicatCitiesInLuxembourg</th>\n",
       "      <td>256</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://dbpedia.org/class/yago/WikicatVillagesInBlagoevgradProvince</th>\n",
       "      <td>256</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>10000 rows × 1 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "                                                                                  count\n",
       "type                                                                                   \n",
       "http://xmlns.com/foaf/0.1/Document                                             12856178\n",
       "http://www.w3.org/2002/07/owl#Thing                                             5044222\n",
       "on:Image                                                                        2897004\n",
       "http://dbpedia.org/class/yago/PhysicalEntity100001930                           2822488\n",
       "http://dbpedia.org/class/yago/Object100002684                                   2720458\n",
       "http://dbpedia.org/class/yago/YagoLegalActorGeo                                 2190190\n",
       "http://dbpedia.org/class/yago/Whole100003553                                    2061271\n",
       "on:Person                                                                       1818074\n",
       "http://dbpedia.org/class/yago/YagoPermanentlyLocatedEntity                      1654844\n",
       "http://dbpedia.org/class/yago/YagoLegalActor                                    1548330\n",
       "on:Agent                                                                        1546264\n",
       "http://www.wikidata.org/entity/Q24229398                                        1529881\n",
       "http://www.ontologydesignpatterns.org/ont/dul/DUL.owl#Agent                     1529881\n",
       "http://www.w3.org/2004/02/skos/core#Concept                                     1475015\n",
       "http://dbpedia.org/class/yago/LivingThing100004258                              1366065\n",
       "http://dbpedia.org/class/yago/Organism100004475                                 1365758\n",
       "http://www.ontologydesignpatterns.org/ont/dul/DUL.owl#NaturalPerson             1243399\n",
       "http://schema.org/Person                                                        1243399\n",
       "http://www.wikidata.org/entity/Q215627                                          1243399\n",
       "http://www.wikidata.org/entity/Q5                                               1243399\n",
       "http://xmlns.com/foaf/0.1/Person                                                1243399\n",
       "http://dbpedia.org/class/yago/CausalAgent100007347                              1229049\n",
       "http://dbpedia.org/class/yago/Person100007846                                   1216438\n",
       "on:TimePeriod                                                                   1127706\n",
       "http://dbpedia.org/class/yago/Abstraction100002137                              1079890\n",
       "http://www.w3.org/2003/01/geo/wgs84_pos#SpatialThing                             996625\n",
       "http://dbpedia.org/class/yago/YagoGeoEntity                                      989272\n",
       "on:CareerStation                                                                 977023\n",
       "on:Place                                                                         881597\n",
       "http://schema.org/Place                                                          839987\n",
       "on:Location                                                                      839987\n",
       "http://dbpedia.org/class/yago/Artifact100021939                                  689249\n",
       "http://dbpedia.org/class/yago/WikicatLivingPeople                                659092\n",
       "http://dbpedia.org/class/yago/Location100027167                                  644115\n",
       "http://dbpedia.org/class/yago/Region108630985                                    620586\n",
       "on:Settlement                                                                    581293\n",
       "on:PopulatedPlace                                                                516747\n",
       "on:Work                                                                          508099\n",
       "http://dbpedia.org/class/yago/District108552138                                  497592\n",
       "http://schema.org/CreativeWork                                                   496070\n",
       "http://www.wikidata.org/entity/Q386724                                           496070\n",
       "http://www.wikidata.org/entity/Q486972                                           478906\n",
       "http://dbpedia.org/class/yago/AdministrativeDistrict108491826                    468228\n",
       "http://dbpedia.org/class/yago/GeographicalArea108574314                          455794\n",
       "http://dbpedia.org/class/yago/Group100031264                                     421838\n",
       "http://dbpedia.org/class/yago/PsychologicalFeature100023100                      407890\n",
       "on:Athlete                                                                       392672\n",
       "http://dbpedia.org/class/yago/SocialGroup107950920                               373140\n",
       "on:Organisation                                                                  352081\n",
       "...                                                                                 ...\n",
       "http://dbpedia.org/class/yago/WikicatGlacialLakesOfTheUnitedStates                  257\n",
       "http://dbpedia.org/class/yago/WikicatChristianDemocraticParties                     257\n",
       "http://dbpedia.org/class/yago/Emotion107480068                                      257\n",
       "http://dbpedia.org/class/yago/WikicatFemaleAviators                                 257\n",
       "http://dbpedia.org/class/yago/WikicatPopulatedPlacesInZalaCounty                    257\n",
       "http://dbpedia.org/class/yago/WikicatCanadianMaleActors                             257\n",
       "http://dbpedia.org/class/yago/Formulation114873641                                  257\n",
       "http://dbpedia.org/class/yago/WikicatDeportivoDeLaCoruñaPlayers                     257\n",
       "http://dbpedia.org/class/yago/WikicatMexicanMaleFilmActors                          257\n",
       "http://dbpedia.org/class/yago/WikicatU.S.ArmyAll-AmericanBowlFootballPlayers        257\n",
       "http://dbpedia.org/class/yago/WikicatCronulla-SutherlandSharksPlayers               257\n",
       "http://dbpedia.org/class/yago/WikicatPeopleFromCountyLimerick                       257\n",
       "http://dbpedia.org/class/yago/WikicatCitiesInArizona                                257\n",
       "http://dbpedia.org/class/yago/WikicatBritishComedians                               257\n",
       "http://dbpedia.org/class/yago/WikicatBrazilianExpatriatesInPortugal                 256\n",
       "http://dbpedia.org/class/yago/WikicatEducationalInstitutionsEstablishedIn1991       256\n",
       "http://dbpedia.org/class/yago/WikicatMaleWestern(genre)FilmActors                   256\n",
       "http://dbpedia.org/class/yago/WikicatWarnerBros.RecordsArtists                      256\n",
       "http://dbpedia.org/class/yago/Apostle109799461                                      256\n",
       "http://dbpedia.org/class/yago/WikicatAcademicsOfImperialCollegeLondon               256\n",
       "http://dbpedia.org/class/yago/WikicatBritishDrummers                                256\n",
       "http://dbpedia.org/class/yago/WikicatCharitiesBasedInLondon                         256\n",
       "http://dbpedia.org/class/yago/WikicatFantasy-comedyFilms                            256\n",
       "http://dbpedia.org/class/yago/SearchEngine106578654                                 256\n",
       "http://dbpedia.org/class/yago/WikicatCommunesOfCameroon                             256\n",
       "http://dbpedia.org/class/yago/WikicatMicrosoftGames                                 256\n",
       "http://dbpedia.org/class/yago/WikicatRadioStationsEstablishedIn1947                 256\n",
       "http://dbpedia.org/class/yago/WikicatVillagesInBielskCounty                         256\n",
       "http://dbpedia.org/class/yago/WikicatRomanianEssayists                              256\n",
       "http://dbpedia.org/class/yago/WikicatProtestantTheologians                          256\n",
       "http://dbpedia.org/class/yago/Waterway109476331                                     256\n",
       "http://dbpedia.org/class/yago/WikicatEducationalInstitutionsEstablishedIn1954       256\n",
       "http://dbpedia.org/class/yago/Polyhedron113883885                                   256\n",
       "http://dbpedia.org/class/yago/WikicatMolecularBiologists                            256\n",
       "http://dbpedia.org/class/yago/WikicatMunicipalitiesOfElSalvador                     256\n",
       "http://dbpedia.org/class/yago/Smith110614629                                        256\n",
       "http://dbpedia.org/class/yago/WikicatAmericanExpatriatesInFrance                    256\n",
       "http://dbpedia.org/class/yago/WikicatDCComicsCharactersWithSuperhumanStrength       256\n",
       "http://dbpedia.org/class/yago/WikicatShelbourneF.C.Players                          256\n",
       "http://dbpedia.org/class/yago/WikicatEnglishWomenPoets                              256\n",
       "http://dbpedia.org/class/yago/WikicatK.A.A.GentPlayers                              256\n",
       "http://dbpedia.org/class/yago/WikicatGreekPoliticians                               256\n",
       "http://dbpedia.org/class/yago/Body109224911                                         256\n",
       "http://dbpedia.org/class/yago/WikicatEnglishTheatreDirectors                        256\n",
       "http://dbpedia.org/class/yago/WikicatPeopleFromSaxony                               256\n",
       "http://dbpedia.org/class/yago/WikicatDisneyChannelShows                             256\n",
       "http://dbpedia.org/class/yago/WikicatPeopleFromBratislava                           256\n",
       "http://dbpedia.org/class/yago/WikicatCitiesInLuxembourg                             256\n",
       "http://dbpedia.org/class/yago/WikicatVillagesInBlagoevgradProvince                  256\n",
       "\n",
       "[10000 rows x 1 columns]"
      ]
     },
     "execution_count": 20,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "time: 1min 30s\n"
     ]
    }
   ],
   "source": [
    "types=endpoint.select(\"\"\"\n",
    "    SELECT ?type (COUNT(*) AS ?count) { ?s a ?type .} GROUP BY ?type ORDER BY DESC(?count)\n",
    "\"\"\")\n",
    "types"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>count</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>483605</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "    count\n",
       "0  483605"
      ]
     },
     "execution_count": 21,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "time: 12.1 s\n"
     ]
    }
   ],
   "source": [
    "endpoint.select(\"\"\"\n",
    "    SELECT (COUNT(*) AS ?count) { SELECT DISTINCT ?type { ?s a ?type .} }\n",
    "\"\"\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "On average,  that's nearly eight classes for every property!\n",
    "\n",
    "DBpedia,  it turns out,  contains many types from YAGO,  which are in turn generated from Wikipedia Categories and other data sources.  Many of these classes such as **yago:WikicatPeopleFromYokohama** and **yago:MexicanMaleFilmActors** are classes that are members of very large families that include \"People from Lanzarote\",  \"Brazillian female professional wrestlers\" as such.  Two common patterns are:\n",
    "\n",
    "1. Restriction types:  One could name \"People from Yokohama\" as a class,  and ask for instances of that class.  Alternatively,  one could query for people for whom the property \"comes from\" has the value \"Yokohama\".  A class whose membership is determined by property values is a \"restriction type\".\n",
    "2. Intersection types:  \"Mexican Person\" is a class,  \"Male Person\" is a class,  \"Film Actor\" is a class.  The set of topics which are members of all of those classes is \"Mexican Male Film Actors\".\n",
    "\n",
    "As you can say the same things with or without restriction and intersection types,  it is a case-by-case decision as to whether to use them or to compose them from other elements.  What is clear,  in this type,  is that there are so many realized restriction and intersection types from YAGO that it gets in the way of seeing what kind of things are talked about in DBpedia.\n",
    "\n",
    "An easy \"set of blinders\" to use here is to look only at types that are in the DBpedia Ontology namespace.  Rather than write a new SPARQL query,  I use the filtering operator in Pandas to pick out common types from the DBpedia Ontology."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>count</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>type</th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>on:Image</th>\n",
       "      <td>2897004</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:Person</th>\n",
       "      <td>1818074</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:Agent</th>\n",
       "      <td>1546264</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:TimePeriod</th>\n",
       "      <td>1127706</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:CareerStation</th>\n",
       "      <td>977023</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:Place</th>\n",
       "      <td>881597</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:Location</th>\n",
       "      <td>839987</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:Settlement</th>\n",
       "      <td>581293</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:PopulatedPlace</th>\n",
       "      <td>516747</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:Work</th>\n",
       "      <td>508099</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:Athlete</th>\n",
       "      <td>392672</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:Organisation</th>\n",
       "      <td>352081</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:SportsTeamMember</th>\n",
       "      <td>318735</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:OrganisationMember</th>\n",
       "      <td>318392</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:Species</th>\n",
       "      <td>306833</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:Eukaryote</th>\n",
       "      <td>302686</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:Village</th>\n",
       "      <td>231103</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:Animal</th>\n",
       "      <td>230175</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:MusicalWork</th>\n",
       "      <td>209142</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:ArchitecturalStructure</th>\n",
       "      <td>203065</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:PersonFunction</th>\n",
       "      <td>171413</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:SoccerPlayer</th>\n",
       "      <td>151207</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:Album</th>\n",
       "      <td>147917</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:Insect</th>\n",
       "      <td>146657</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:Film</th>\n",
       "      <td>129980</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:Building</th>\n",
       "      <td>123567</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:Company</th>\n",
       "      <td>109629</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:Infrastructure</th>\n",
       "      <td>92281</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:Artist</th>\n",
       "      <td>82757</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:Event</th>\n",
       "      <td>77583</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:OfficeHolder</th>\n",
       "      <td>71753</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:MusicalArtist</th>\n",
       "      <td>71014</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:TelevisionShow</th>\n",
       "      <td>70690</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:Station</th>\n",
       "      <td>69525</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:WrittenWork</th>\n",
       "      <td>69112</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:NaturalPlace</th>\n",
       "      <td>67863</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:Band</th>\n",
       "      <td>67831</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:Single</th>\n",
       "      <td>67150</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:Book</th>\n",
       "      <td>64239</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:Plant</th>\n",
       "      <td>62543</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:SocietalEvent</th>\n",
       "      <td>60321</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:MeanOfTransportation</th>\n",
       "      <td>59078</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:EducationalInstitution</th>\n",
       "      <td>55860</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:SportsSeason</th>\n",
       "      <td>55732</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:Software</th>\n",
       "      <td>52743</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:School</th>\n",
       "      <td>45445</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:Town</th>\n",
       "      <td>45415</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:SportsTeam</th>\n",
       "      <td>44978</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:BodyOfWater</th>\n",
       "      <td>44204</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:DartsPlayer</th>\n",
       "      <td>587</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:Chef</th>\n",
       "      <td>584</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:RugbyLeague</th>\n",
       "      <td>584</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:Winery</th>\n",
       "      <td>569</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:Jockey</th>\n",
       "      <td>556</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:MusicFestival</th>\n",
       "      <td>547</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:Skater</th>\n",
       "      <td>545</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:VoiceActor</th>\n",
       "      <td>543</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:Presenter</th>\n",
       "      <td>532</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:TableTennisPlayer</th>\n",
       "      <td>524</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:LawFirm</th>\n",
       "      <td>514</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:Rocket</th>\n",
       "      <td>501</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:Medician</th>\n",
       "      <td>501</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:FloweringPlant</th>\n",
       "      <td>499</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:AustralianFootballTeam</th>\n",
       "      <td>492</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:Moss</th>\n",
       "      <td>486</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:LacrossePlayer</th>\n",
       "      <td>482</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:CyclingTeam</th>\n",
       "      <td>482</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:SumoWrestler</th>\n",
       "      <td>473</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:Bodybuilder</th>\n",
       "      <td>472</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:SnookerPlayer</th>\n",
       "      <td>465</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:Photographer</th>\n",
       "      <td>459</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:Canoeist</th>\n",
       "      <td>458</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:AmateurBoxer</th>\n",
       "      <td>448</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:RoadJunction</th>\n",
       "      <td>448</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:Entomologist</th>\n",
       "      <td>437</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:Artery</th>\n",
       "      <td>428</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:SquashPlayer</th>\n",
       "      <td>422</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:Nerve</th>\n",
       "      <td>415</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:Racecourse</th>\n",
       "      <td>410</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:Pope</th>\n",
       "      <td>407</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:HandballTeam</th>\n",
       "      <td>393</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:GreenAlga</th>\n",
       "      <td>391</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:SolarEclipse</th>\n",
       "      <td>380</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:Database</th>\n",
       "      <td>363</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:RadioHost</th>\n",
       "      <td>359</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:Muscle</th>\n",
       "      <td>347</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:HorseTrainer</th>\n",
       "      <td>330</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:ClassicalMusicArtist</th>\n",
       "      <td>322</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:RoadTunnel</th>\n",
       "      <td>314</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:Poet</th>\n",
       "      <td>308</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:IceHockeyLeague</th>\n",
       "      <td>304</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:Brewery</th>\n",
       "      <td>292</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:Rower</th>\n",
       "      <td>279</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:BaseballSeason</th>\n",
       "      <td>275</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:PlayboyPlaymate</th>\n",
       "      <td>274</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:RaceTrack</th>\n",
       "      <td>269</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:NetballPlayer</th>\n",
       "      <td>263</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:CricketGround</th>\n",
       "      <td>260</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>388 rows × 1 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "                             count\n",
       "type                              \n",
       "on:Image                   2897004\n",
       "on:Person                  1818074\n",
       "on:Agent                   1546264\n",
       "on:TimePeriod              1127706\n",
       "on:CareerStation            977023\n",
       "on:Place                    881597\n",
       "on:Location                 839987\n",
       "on:Settlement               581293\n",
       "on:PopulatedPlace           516747\n",
       "on:Work                     508099\n",
       "on:Athlete                  392672\n",
       "on:Organisation             352081\n",
       "on:SportsTeamMember         318735\n",
       "on:OrganisationMember       318392\n",
       "on:Species                  306833\n",
       "on:Eukaryote                302686\n",
       "on:Village                  231103\n",
       "on:Animal                   230175\n",
       "on:MusicalWork              209142\n",
       "on:ArchitecturalStructure   203065\n",
       "on:PersonFunction           171413\n",
       "on:SoccerPlayer             151207\n",
       "on:Album                    147917\n",
       "on:Insect                   146657\n",
       "on:Film                     129980\n",
       "on:Building                 123567\n",
       "on:Company                  109629\n",
       "on:Infrastructure            92281\n",
       "on:Artist                    82757\n",
       "on:Event                     77583\n",
       "on:OfficeHolder              71753\n",
       "on:MusicalArtist             71014\n",
       "on:TelevisionShow            70690\n",
       "on:Station                   69525\n",
       "on:WrittenWork               69112\n",
       "on:NaturalPlace              67863\n",
       "on:Band                      67831\n",
       "on:Single                    67150\n",
       "on:Book                      64239\n",
       "on:Plant                     62543\n",
       "on:SocietalEvent             60321\n",
       "on:MeanOfTransportation      59078\n",
       "on:EducationalInstitution    55860\n",
       "on:SportsSeason              55732\n",
       "on:Software                  52743\n",
       "on:School                    45445\n",
       "on:Town                      45415\n",
       "on:SportsTeam                44978\n",
       "on:BodyOfWater               44204\n",
       "...                            ...\n",
       "on:DartsPlayer                 587\n",
       "on:Chef                        584\n",
       "on:RugbyLeague                 584\n",
       "on:Winery                      569\n",
       "on:Jockey                      556\n",
       "on:MusicFestival               547\n",
       "on:Skater                      545\n",
       "on:VoiceActor                  543\n",
       "on:Presenter                   532\n",
       "on:TableTennisPlayer           524\n",
       "on:LawFirm                     514\n",
       "on:Rocket                      501\n",
       "on:Medician                    501\n",
       "on:FloweringPlant              499\n",
       "on:AustralianFootballTeam      492\n",
       "on:Moss                        486\n",
       "on:LacrossePlayer              482\n",
       "on:CyclingTeam                 482\n",
       "on:SumoWrestler                473\n",
       "on:Bodybuilder                 472\n",
       "on:SnookerPlayer               465\n",
       "on:Photographer                459\n",
       "on:Canoeist                    458\n",
       "on:AmateurBoxer                448\n",
       "on:RoadJunction                448\n",
       "on:Entomologist                437\n",
       "on:Artery                      428\n",
       "on:SquashPlayer                422\n",
       "on:Nerve                       415\n",
       "on:Racecourse                  410\n",
       "on:Pope                        407\n",
       "on:HandballTeam                393\n",
       "on:GreenAlga                   391\n",
       "on:SolarEclipse                380\n",
       "on:Database                    363\n",
       "on:RadioHost                   359\n",
       "on:Muscle                      347\n",
       "on:HorseTrainer                330\n",
       "on:ClassicalMusicArtist        322\n",
       "on:RoadTunnel                  314\n",
       "on:Poet                        308\n",
       "on:IceHockeyLeague             304\n",
       "on:Brewery                     292\n",
       "on:Rower                       279\n",
       "on:BaseballSeason              275\n",
       "on:PlayboyPlaymate             274\n",
       "on:RaceTrack                   269\n",
       "on:NetballPlayer               263\n",
       "on:CricketGround               260\n",
       "\n",
       "[388 rows x 1 columns]"
      ]
     },
     "execution_count": 22,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "time: 21 ms\n"
     ]
    }
   ],
   "source": [
    "types[types.index.str.startswith('on:')]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "**on:Image** catches my eye,  so I look at a few examples and pick one out."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>that</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>http://en.wikipedia.org/wiki/Special:FilePath/Alfred_Schütz.jpg</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>http://en.wikipedia.org/wiki/Special:FilePath/Aromas.JPG</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>http://en.wikipedia.org/wiki/Special:FilePath/Baldwin_Park_CA_logo.jpg</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>http://en.wikipedia.org/wiki/Special:FilePath/Bayfield,CO.jpg</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>http://en.wikipedia.org/wiki/Special:FilePath/Bennettcoskyline.JPG</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>http://en.wikipedia.org/wiki/Special:FilePath/Bitterspring.jpg</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>http://en.wikipedia.org/wiki/Special:FilePath/Boulder_Creek.jpg</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>http://en.wikipedia.org/wiki/Special:FilePath/BrandonFL.gif</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>http://en.wikipedia.org/wiki/Special:FilePath/Buttonwillow.jpg</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>http://en.wikipedia.org/wiki/Special:FilePath/CarberryBookplate.jpg</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                                                                     that\n",
       "0         http://en.wikipedia.org/wiki/Special:FilePath/Alfred_Schütz.jpg\n",
       "1                http://en.wikipedia.org/wiki/Special:FilePath/Aromas.JPG\n",
       "2  http://en.wikipedia.org/wiki/Special:FilePath/Baldwin_Park_CA_logo.jpg\n",
       "3           http://en.wikipedia.org/wiki/Special:FilePath/Bayfield,CO.jpg\n",
       "4      http://en.wikipedia.org/wiki/Special:FilePath/Bennettcoskyline.JPG\n",
       "5          http://en.wikipedia.org/wiki/Special:FilePath/Bitterspring.jpg\n",
       "6         http://en.wikipedia.org/wiki/Special:FilePath/Boulder_Creek.jpg\n",
       "7             http://en.wikipedia.org/wiki/Special:FilePath/BrandonFL.gif\n",
       "8          http://en.wikipedia.org/wiki/Special:FilePath/Buttonwillow.jpg\n",
       "9     http://en.wikipedia.org/wiki/Special:FilePath/CarberryBookplate.jpg"
      ]
     },
     "execution_count": 23,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "time: 293 ms\n"
     ]
    }
   ],
   "source": [
    "endpoint.select(\"\"\"\n",
    "    SELECT ?that { \n",
    "        ?that a on:Image\n",
    "    } LIMIT 10\n",
    "\"\"\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<img src=\"http://en.wikipedia.org/wiki/Special:FilePath/Alfred_Schütz.jpg\">"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "execution_count": 24,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "time: 4 ms\n"
     ]
    }
   ],
   "source": [
    "HTML('<img src=\"{0}\">'.format(_.at[0,'that']))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "These \"topics\" are what I would call \"non-topic topics\" in the sense that they are the subject of a statement,  but not an actual \"thing in the world\" described by the knowledge base.  (Wikipedia documents the outside world primarily,  and only secondarily has a metadata catalog for items that are in it.)\n",
    "\n",
    "The following query finds \"plain ordinary topics\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>that</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>&lt;Andreas_Ekberg&gt;</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>&lt;Danilo_Tognon&gt;</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>&lt;Lorine_Livington_Pruette&gt;</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>&lt;Megan_Lawrence&gt;</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>&lt;Nikolaos_Ventouras&gt;</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>&lt;Peter_Ceffons&gt;</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>&lt;Sani_ol_molk&gt;</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>&lt;Siniša_Žugić&gt;</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>&lt;Strength_athlete&gt;</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>&lt;Trampolino_Gigante_Corno_d'Aola&gt;</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                                that\n",
       "0                   <Andreas_Ekberg>\n",
       "1                    <Danilo_Tognon>\n",
       "2         <Lorine_Livington_Pruette>\n",
       "3                   <Megan_Lawrence>\n",
       "4               <Nikolaos_Ventouras>\n",
       "5                    <Peter_Ceffons>\n",
       "6                     <Sani_ol_molk>\n",
       "7                     <Siniša_Žugić>\n",
       "8                 <Strength_athlete>\n",
       "9  <Trampolino_Gigante_Corno_d'Aola>"
      ]
     },
     "execution_count": 25,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "time: 289 ms\n"
     ]
    }
   ],
   "source": [
    "endpoint.select(\"\"\"\n",
    "    SELECT ?that { \n",
    "        ?that a on:Person\n",
    "    } LIMIT 10\n",
    "\"\"\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "\"Andres_Ekberg\" is a shorthand for [`<http://dbpedia.org/resource/Andreas_Ekberg>`](https://en.wikipedia.org/wiki/Andreas_Ekberg) which is parallel to the Wikipedia page at\n",
    "[`<http://en.wikipedia.org/wiki/Andres_Ekberg>`](https://en.wikipedia.org/wiki/Andreas_Ekberg).  The select() method shows just \"Andreas_Ekberg\" because I registered `<http://dbpedia.org/resource/>` as the base URI of this endpoint when I created the `endpoint` object way back at the beginning of this notebook.\n",
    "\n",
    "What most people would think of as \"topics\" in DBpedia live in the `<http://dbpedia.org/resource/>` namespace.\n",
    "\n",
    "Another common kind of topic in DBpedia is the **on:Agent**:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>that</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>&lt;3Com&gt;</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>&lt;7-Eleven&gt;</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>&lt;A._C._Bhaktivedanta_Swami_Prabhupada&gt;</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>&lt;Aardman_Animations&gt;</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>&lt;Aaron_Burr&gt;</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>&lt;Abbie_Hoffman&gt;</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>&lt;About.com&gt;</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>&lt;Abraham_Robinson&gt;</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>&lt;Abraham_de_Moivre&gt;</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>&lt;Academy_of_Motion_Picture_Arts_and_Sciences&gt;</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                                            that\n",
       "0                                         <3Com>\n",
       "1                                     <7-Eleven>\n",
       "2         <A._C._Bhaktivedanta_Swami_Prabhupada>\n",
       "3                           <Aardman_Animations>\n",
       "4                                   <Aaron_Burr>\n",
       "5                                <Abbie_Hoffman>\n",
       "6                                    <About.com>\n",
       "7                             <Abraham_Robinson>\n",
       "8                            <Abraham_de_Moivre>\n",
       "9  <Academy_of_Motion_Picture_Arts_and_Sciences>"
      ]
     },
     "execution_count": 26,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "time: 280 ms\n"
     ]
    }
   ],
   "source": [
    "endpoint.select(\"\"\"\n",
    "    SELECT ?that { \n",
    "        ?that a on:Agent\n",
    "    } LIMIT 10\n",
    "\"\"\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "The \"Agent\" concept is connected with the shared attributes of individuals and organizations;  I like to think that an \"Agent\" is something that can be the originator or recipient of a communication.  If I remove people using the **MINUS** operator,  only organizations remain."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>that</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>&lt;3Com&gt;</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>&lt;7-Eleven&gt;</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>&lt;Aardman_Animations&gt;</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>&lt;About.com&gt;</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>&lt;Academy_of_Motion_Picture_Arts_and_Sciences&gt;</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>&lt;Acorn_Computers&gt;</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>&lt;Activision&gt;</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>&lt;Ad_Lib,_Inc.&gt;</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>&lt;Adnams_Brewery&gt;</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>&lt;Aermacchi&gt;</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                                            that\n",
       "0                                         <3Com>\n",
       "1                                     <7-Eleven>\n",
       "2                           <Aardman_Animations>\n",
       "3                                    <About.com>\n",
       "4  <Academy_of_Motion_Picture_Arts_and_Sciences>\n",
       "5                              <Acorn_Computers>\n",
       "6                                   <Activision>\n",
       "7                                 <Ad_Lib,_Inc.>\n",
       "8                               <Adnams_Brewery>\n",
       "9                                    <Aermacchi>"
      ]
     },
     "execution_count": 27,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "time: 290 ms\n"
     ]
    }
   ],
   "source": [
    "endpoint.select(\"\"\"\n",
    "    SELECT ?that { \n",
    "        ?that a on:Agent\n",
    "        MINUS {?that a on:Person}\n",
    "    } LIMIT 10\n",
    "\"\"\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Unlike the classes I've shown so far,  a **on:TimePeriod** can be either a topic or non-topic.  Asking for just 10 time periods,  I find that some of them correspond to calendar years:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>that</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>&lt;1&gt;</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>&lt;10&gt;</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>&lt;100&gt;</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>&lt;1000&gt;</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>&lt;1001&gt;</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>&lt;1002&gt;</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>&lt;1003&gt;</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>&lt;1004&gt;</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>&lt;1005&gt;</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>&lt;1006&gt;</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "     that\n",
       "0     <1>\n",
       "1    <10>\n",
       "2   <100>\n",
       "3  <1000>\n",
       "4  <1001>\n",
       "5  <1002>\n",
       "6  <1003>\n",
       "7  <1004>\n",
       "8  <1005>\n",
       "9  <1006>"
      ]
     },
     "execution_count": 28,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "time: 298 ms\n"
     ]
    }
   ],
   "source": [
    "endpoint.select(\"\"\"\n",
    "    SELECT ?that { \n",
    "        ?that a on:TimePeriod\n",
    "    } LIMIT 10\n",
    "\"\"\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<body><h1 class=\"firstHeading\" id=\"firstHeading\" lang=\"en\">1004</h1>\n",
       "\t\t\t\t\t\t\t\t\t<div class=\"mw-body-content\" id=\"bodyContent\">\n",
       "\t\t\t\t\t\t\t\t\t<div class=\"noprint\" id=\"siteSub\">From Wikipedia, the free encyclopedia</div>\n",
       "\t\t\t\t\t\t\t\t<div id=\"contentSub\"></div>\n",
       "\t\t\t\t<div class=\"mw-content-ltr\" dir=\"ltr\" id=\"mw-content-text\" lang=\"en\"><div class=\"mw-parser-output\"><div class=\"hatnote navigation-not-searchable\" role=\"note\">This article is about the year 1004.</div>\n",
       " <p>Year <b>1004</b> (<b><a href=\"http://en.wikipedia.org/wiki/Roman_numerals\" title=\"Roman numerals\">MIV</a></b>) was a <a href=\"http://en.wikipedia.org/wiki/Leap_year_starting_on_Saturday\" title=\"Leap year starting on Saturday\">leap year starting on Saturday</a> (link will display the full calendar) of the <a href=\"http://en.wikipedia.org/wiki/Julian_calendar\" title=\"Julian calendar\">Julian calendar</a>.</p>\n",
       "<p></p>\n",
       "<div class=\"toc\" id=\"toc\">\n",
       "<div class=\"toctitle\">\n",
       "<h2>Contents</h2>\n",
       "</div>\n",
       "<ul>\n",
       "<li class=\"toclevel-1 tocsection-1\"><a href=\"http://en.wikipedia.org/#Events\"><span class=\"tocnumber\">1</span> <span class=\"toctext\">Events</span></a>\n",
       "<ul>\n",
       "<li class=\"toclevel-2 tocsection-2\"><a href=\"http://en.wikipedia.org/#By_place\"><span class=\"tocnumber\">1.1</span> <span class=\"toctext\">By place</span></a>\n",
       "<ul>\n",
       "<li class=\"toclevel-3 tocsection-3\"><a href=\"http://en.wikipedia.org/#Africa\"><span class=\"tocnumber\">1.1.1</span> <span class=\"toctext\">Africa</span></a></li>\n",
       "<li class=\"toclevel-3 tocsection-4\"><a href=\"http://en.wikipedia.org/#Asia\"><span class=\"tocnumber\">1.1.2</span> <span class=\"toctext\">Asia</span></a></li>\n",
       "<li class=\"toclevel-3 tocsection-5\"><a href=\"http://en.wikipedia.org/#Europe\"><span class=\"tocnumber\">1.1.3</span> <span class=\"toctext\">Europe</span></a></li>\n",
       "</ul>\n",
       "</li>\n",
       "</ul>\n",
       "</li>\n",
       "<li class=\"toclevel-1 tocsection-6\"><a href=\"http://en.wikipedia.org/#Births\"><span class=\"tocnumber\">2</span> <span class=\"toctext\">Births</span></a></li>\n",
       "<li class=\"toclevel-1 tocsection-7\"><a href=\"http://en.wikipedia.org/#Deaths\"><span class=\"tocnumber\">3</span> <span class=\"toctext\">Deaths</span></a></li>\n",
       "<li class=\"toclevel-1 tocsection-8\"><a href=\"http://en.wikipedia.org/#References\"><span class=\"tocnumber\">4</span> <span class=\"toctext\">References</span></a></li>\n",
       "</ul>\n",
       "</div>\n",
       "<p></p>\n",
       "<h2><span class=\"mw-headline\" id=\"Events\">Events</span><span class=\"mw-editsection\"><span class=\"mw-editsection-bracket\">[</span><a href=\"http://en.wikipedia.org/w/index.php?title=1004&amp;action=edit&amp;section=1\" title=\"Edit section: Events\">edit</a><span class=\"mw-editsection-bracket\">]</span></span></h2>\n",
       "<h3><span class=\"mw-headline\" id=\"By_place\">By place</span><span class=\"mw-editsection\"><span class=\"mw-editsection-bracket\">[</span><a href=\"http://en.wikipedia.org/w/index.php?title=1004&amp;action=edit&amp;section=2\" title=\"Edit section: By place\">edit</a><span class=\"mw-editsection-bracket\">]</span></span></h3>\n",
       "<h4><span class=\"mw-headline\" id=\"Africa\">Africa</span><span class=\"mw-editsection\"><span class=\"mw-editsection-bracket\">[</span><a href=\"http://en.wikipedia.org/w/index.php?title=1004&amp;action=edit&amp;section=3\" title=\"Edit section: Africa\">edit</a><span class=\"mw-editsection-bracket\">]</span></span></h4>\n",
       "<ul>\n",
       "<li>An episode of plague and famine breaks out in <a href=\"http://en.wikipedia.org/wiki/North_Africa\" title=\"North Africa\">North Africa</a>.<sup class=\"reference\" id=\"cite_ref-1\"><a href=\"http://en.wikipedia.org/#cite_note-1\">[1]</a></sup></li>\n",
       "</ul>\n",
       "<h4><span class=\"mw-headline\" id=\"Asia\">Asia</span><span class=\"mw-editsection\"><span class=\"mw-editsection-bracket\">[</span><a href=\"http://en.wikipedia.org/w/index.php?title=1004&amp;action=edit&amp;section=4\" title=\"Edit section: Asia\">edit</a><span class=\"mw-editsection-bracket\">]</span></span></h4>\n",
       "<ul>\n",
       "<li>December – The <a class=\"mw-redirect\" href=\"http://en.wikipedia.org/wiki/Samanids\" title=\"Samanids\">Samanid dynasty</a> ends in <a class=\"mw-redirect\" href=\"http://en.wikipedia.org/wiki/Bokhara\" title=\"Bokhara\">Bokhara</a>.</li>\n",
       "<li>The <a href=\"http://en.wikipedia.org/wiki/Liao_dynasty\" title=\"Liao dynasty\">Liao dynasty</a> launches a major offensive against the <a href=\"http://en.wikipedia.org/wiki/Song_dynasty\" title=\"Song dynasty\">Song dynasty</a>. Their armies meet near Shanyang, north of the Song capital of <a href=\"http://en.wikipedia.org/wiki/Kaifeng\" title=\"Kaifeng\">Kaifeng</a>.</li>\n",
       "<li>Battle of Shanzhou: The Liao dynasty general Xiao Talin is picked off, by an elite Song Chinese crossbow <a href=\"http://en.wikipedia.org/wiki/Sniper\" title=\"Sniper\">sniper</a>.</li>\n",
       "<li><a href=\"http://en.wikipedia.org/wiki/Jingdezhen_porcelain\" title=\"Jingdezhen porcelain\">Jingdezhen porcelain</a> enters a period of significant production.</li>\n",
       "</ul>\n",
       "<h4><span class=\"mw-headline\" id=\"Europe\">Europe</span><span class=\"mw-editsection\"><span class=\"mw-editsection-bracket\">[</span><a href=\"http://en.wikipedia.org/w/index.php?title=1004&amp;action=edit&amp;section=5\" title=\"Edit section: Europe\">edit</a><span class=\"mw-editsection-bracket\">]</span></span></h4>\n",
       "<ul>\n",
       "<li><a href=\"http://en.wikipedia.org/wiki/May_14\" title=\"May 14\">May 14</a> – <a href=\"http://en.wikipedia.org/wiki/Henry_II,_Holy_Roman_Emperor\" title=\"Henry II, Holy Roman Emperor\">Henry II</a> is crowned <a href=\"http://en.wikipedia.org/wiki/King_of_Italy\" title=\"King of Italy\">King of Italy</a> at <a href=\"http://en.wikipedia.org/wiki/Pavia\" title=\"Pavia\">Pavia</a>. A quarrel between his German companions and the Pavese erupts into a full-scale battle.</li>\n",
       "<li><a href=\"http://en.wikipedia.org/wiki/Henry_II,_Holy_Roman_Emperor\" title=\"Henry II, Holy Roman Emperor\">Henry II</a> launches a war against <a class=\"mw-redirect\" href=\"http://en.wikipedia.org/wiki/Boles%C5%82aw_I_Chrobry\" title=\"Bolesław I Chrobry\">Bolesław</a> of Poland (which lasts until <a href=\"http://en.wikipedia.org/wiki/1018\" title=\"1018\">1018</a>).</li>\n",
       "<li><a class=\"mw-redirect\" href=\"http://en.wikipedia.org/wiki/Boleslaus_I_of_Poland\" title=\"Boleslaus I of Poland\">Boleslaus I of Poland</a> loses <a href=\"http://en.wikipedia.org/wiki/Bohemia\" title=\"Bohemia\">Bohemia</a>, after having become duke the previous year. He is succeeded as Duke of Bohemia by <a class=\"mw-redirect\" href=\"http://en.wikipedia.org/wiki/Jaromir,_Duke_of_Bohemia\" title=\"Jaromir, Duke of Bohemia\">Jaromir</a>.</li>\n",
       "<li><a class=\"mw-redirect\" href=\"http://en.wikipedia.org/wiki/Sancho_III_of_Navarra\" title=\"Sancho III of Navarra\">Sancho III</a> becomes king of <a href=\"http://en.wikipedia.org/wiki/Navarre\" title=\"Navarre\">Navarre</a>, <a href=\"http://en.wikipedia.org/wiki/Kingdom_of_Aragon\" title=\"Kingdom of Aragon\">Aragon</a> and <a class=\"mw-redirect\" href=\"http://en.wikipedia.org/wiki/Kingdom_of_Castille\" title=\"Kingdom of Castille\">Castille</a>.</li>\n",
       "<li><a class=\"mw-redirect\" href=\"http://en.wikipedia.org/wiki/Sweyn_I_of_Denmark\" title=\"Sweyn I of Denmark\">Sweyn I of Denmark</a> destroys <a class=\"mw-redirect\" href=\"http://en.wikipedia.org/wiki/Norwich,_England\" title=\"Norwich, England\">Norwich</a>.</li>\n",
       "<li><a class=\"mw-redirect\" href=\"http://en.wikipedia.org/wiki/Aberdeen,_Scotland\" title=\"Aberdeen, Scotland\">Aberdeen</a> becomes a bishopric.</li>\n",
       "<li>The <a href=\"http://en.wikipedia.org/wiki/Arabs\" title=\"Arabs\">Arabs</a> sack <a href=\"http://en.wikipedia.org/wiki/Pisa\" title=\"Pisa\">Pisa</a>.</li>\n",
       "<li>The troops of Vizier <a class=\"mw-redirect\" href=\"http://en.wikipedia.org/wiki/Al-Mansur_Ibn_Abi_Aamir\" title=\"Al-Mansur Ibn Abi Aamir\">Al-Mansur</a> sack the Catalan city of <a href=\"http://en.wikipedia.org/wiki/Manresa\" title=\"Manresa\">Manresa</a>.<sup class=\"reference\" id=\"cite_ref-french_crusades_2-0\"><a href=\"http://en.wikipedia.org/#cite_note-french_crusades-2\">[2]</a></sup></li>\n",
       "<li><a href=\"http://en.wikipedia.org/wiki/Pope_John_XVIII\" title=\"Pope John XVIII\">Pope John XVIII</a> begins his reign (or <a href=\"http://en.wikipedia.org/wiki/1003\" title=\"1003\">1003</a>).</li>\n",
       "</ul>\n",
       "<p><br/></p>\n",
       "<h2><span class=\"mw-headline\" id=\"Births\">Births</span><span class=\"mw-editsection\"><span class=\"mw-editsection-bracket\">[</span><a href=\"http://en.wikipedia.org/w/index.php?title=1004&amp;action=edit&amp;section=6\" title=\"Edit section: Births\">edit</a><span class=\"mw-editsection-bracket\">]</span></span></h2>\n",
       "<ul>\n",
       "<li><a href=\"http://en.wikipedia.org/wiki/Abdallah_ibn_Al-Aftas\" title=\"Abdallah ibn Al-Aftas\">Abdallah ibn Al-Aftas</a> (approximate date) (d. <a href=\"http://en.wikipedia.org/wiki/1060\" title=\"1060\">1060</a>)</li>\n",
       "<li><a class=\"mw-redirect\" href=\"http://en.wikipedia.org/wiki/Goda_of_England\" title=\"Goda of England\">Goda of England</a> (d. <a href=\"http://en.wikipedia.org/wiki/1055\" title=\"1055\">1055</a>)</li>\n",
       "</ul>\n",
       "<h2><span class=\"mw-headline\" id=\"Deaths\">Deaths</span><span class=\"mw-editsection\"><span class=\"mw-editsection-bracket\">[</span><a href=\"http://en.wikipedia.org/w/index.php?title=1004&amp;action=edit&amp;section=7\" title=\"Edit section: Deaths\">edit</a><span class=\"mw-editsection-bracket\">]</span></span></h2>\n",
       "<ul>\n",
       "<li><a href=\"http://en.wikipedia.org/wiki/November_13\" title=\"November 13\">November 13</a> – <a href=\"http://en.wikipedia.org/wiki/Abbo_of_Fleury\" title=\"Abbo of Fleury\">Abbo of Fleury</a></li>\n",
       "<li><a href=\"http://en.wikipedia.org/wiki/Adelaide_of_Aquitaine\" title=\"Adelaide of Aquitaine\">Adelaide of Aquitaine</a>, queen of France, wife of <a class=\"mw-redirect\" href=\"http://en.wikipedia.org/wiki/Hugh_Capet_of_France\" title=\"Hugh Capet of France\">Hugh Capet</a></li>\n",
       "<li><a href=\"http://en.wikipedia.org/wiki/Erik_the_Red\" title=\"Erik the Red\">Erik the Red</a> (or <a href=\"http://en.wikipedia.org/wiki/1003\" title=\"1003\">1003</a>) (b. <a href=\"http://en.wikipedia.org/wiki/950\" title=\"950\">950</a>)</li>\n",
       "<li><a class=\"mw-redirect\" href=\"http://en.wikipedia.org/wiki/Garcia_IV_of_Pamplona\" title=\"Garcia IV of Pamplona\">Garcia IV of Pamplona</a></li>\n",
       "<li><a href=\"http://en.wikipedia.org/wiki/Li_Jiqian\" title=\"Li Jiqian\">Li Jiqian</a>, <a href=\"http://en.wikipedia.org/wiki/Tangut_people\" title=\"Tangut people\">Tangut</a> <i><a href=\"http://en.wikipedia.org/wiki/Jiedushi\" title=\"Jiedushi\">jiedushi</a></i> who ruled the new <a class=\"mw-redirect\" href=\"http://en.wikipedia.org/wiki/Western_Xia_Dynasty\" title=\"Western Xia Dynasty\">Western Xia Dynasty</a> in northwestern <a href=\"http://en.wikipedia.org/wiki/China\" title=\"China\">China</a> (b. <a href=\"http://en.wikipedia.org/wiki/963\" title=\"963\">963</a>)</li>\n",
       "</ul></div></div></div></body>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "execution_count": 29,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "time: 35 ms\n"
     ]
    }
   ],
   "source": [
    " transclude(\"1004.html\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "If,  however,  I make a query that eliminates topics that start with a number,  the query returns a large number of non-topics.  Even though these resources are in the `<http://dbpedia.org/resource/>` namespace,  they don't have corresponding Wikipedia pages."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>that</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>&lt;A._M._A._Azeez__1&gt;</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>&lt;A._R._Colquhoun__1&gt;</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>&lt;Abbie_Wolanow__1&gt;</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>&lt;Abbie_Wolanow__2&gt;</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>&lt;Abbie_Wolanow__3&gt;</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>&lt;Abbie_Wolanow__4&gt;</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>&lt;Abbie_Wolanow__5&gt;</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>&lt;Abdul_Wahab_Khan__1&gt;</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>&lt;Adam_Wolanin__1&gt;</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>&lt;Adam_Wolanin__2&gt;</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                    that\n",
       "0    <A._M._A._Azeez__1>\n",
       "1   <A._R._Colquhoun__1>\n",
       "2     <Abbie_Wolanow__1>\n",
       "3     <Abbie_Wolanow__2>\n",
       "4     <Abbie_Wolanow__3>\n",
       "5     <Abbie_Wolanow__4>\n",
       "6     <Abbie_Wolanow__5>\n",
       "7  <Abdul_Wahab_Khan__1>\n",
       "8      <Adam_Wolanin__1>\n",
       "9      <Adam_Wolanin__2>"
      ]
     },
     "execution_count": 30,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "time: 352 ms\n"
     ]
    }
   ],
   "source": [
    "endpoint.select(\"\"\"\n",
    "    SELECT ?that { \n",
    "        ?that a on:TimePeriod .\n",
    "        FILTER(STRSTARTS(STR(?that),\"http://dbpedia.org/resource/A\"))\n",
    "    } LIMIT 10\n",
    "\"\"\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Let's take a closer look.  It seems that this record describes a time that a soccer player spent playing for a team (although unfortunately it doesn't say when this time began or ended):"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>p</th>\n",
       "      <th>o</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>rdf:type</td>\n",
       "      <td>http://www.w3.org/2002/07/owl#Thing</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>rdf:type</td>\n",
       "      <td>on:CareerStation</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>rdf:type</td>\n",
       "      <td>on:TimePeriod</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>on:team</td>\n",
       "      <td>&lt;Hapoel_Tel_Aviv_F.C.&gt;</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "          p                                    o\n",
       "0  rdf:type  http://www.w3.org/2002/07/owl#Thing\n",
       "1  rdf:type                     on:CareerStation\n",
       "2  rdf:type                        on:TimePeriod\n",
       "3   on:team               <Hapoel_Tel_Aviv_F.C.>"
      ]
     },
     "execution_count": 31,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "time: 288 ms\n"
     ]
    }
   ],
   "source": [
    "endpoint.select(\"\"\"\n",
    "    BASE <http://dbpedia.org/resource/>\n",
    "    SELECT ?p ?o { \n",
    "        <Abbie_Wolanow__1> ?p ?o .\n",
    "    }\n",
    "\"\"\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "This record is more complete,  and shows how the career record can be linked to a time,  as well as information about how the player performed:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>p</th>\n",
       "      <th>o</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>rdf:type</td>\n",
       "      <td>http://www.w3.org/2002/07/owl#Thing</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>rdf:type</td>\n",
       "      <td>on:CareerStation</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>rdf:type</td>\n",
       "      <td>on:TimePeriod</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>on:numberOfGoals</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>on:numberOfMatches</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>on:team</td>\n",
       "      <td>&lt;United_States_men's_national_soccer_team&gt;</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>on:years</td>\n",
       "      <td>1961-01-01</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                    p                                           o\n",
       "0            rdf:type         http://www.w3.org/2002/07/owl#Thing\n",
       "1            rdf:type                            on:CareerStation\n",
       "2            rdf:type                               on:TimePeriod\n",
       "3    on:numberOfGoals                                           0\n",
       "4  on:numberOfMatches                                           1\n",
       "5             on:team  <United_States_men's_national_soccer_team>\n",
       "6            on:years                                  1961-01-01"
      ]
     },
     "execution_count": 32,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "time: 283 ms\n"
     ]
    }
   ],
   "source": [
    "endpoint.select(\"\"\"\n",
    "    BASE <http://dbpedia.org/resource/>\n",
    "    SELECT ?p ?o { \n",
    "        <Abbie_Wolanow__5> ?p ?o .\n",
    "    }\n",
    "\"\"\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Going to the right of the career station (finding objects for which it is the subject) we see the team,  but we don't see the player.  Going to the left,  however (finding objects for which it is the subject) we see the player."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 33,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>s</th>\n",
       "      <th>p</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>&lt;Abbie_Wolanow&gt;</td>\n",
       "      <td>on:careerStation</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                 s                 p\n",
       "0  <Abbie_Wolanow>  on:careerStation"
      ]
     },
     "execution_count": 33,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "time: 282 ms\n"
     ]
    }
   ],
   "source": [
    "endpoint.select(\"\"\"\n",
    "    BASE <http://dbpedia.org/resource/>\n",
    "    SELECT ?s ?p  { \n",
    "        ?s ?p <Abbie_Wolanow__5> .\n",
    "    }\n",
    "\"\"\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Thus this fragment of the RDF graph looks like:\n",
    "    \n",
    "<img src=\"Wolanow5.png\">\n",
    "\n",
    "and this a general pattern for how one might deal with situations where we want to say something more complex than \"Abbie Wolanow played for the U.S. Men's National Soccer Team\".\n",
    "\n",
    "In terms of the source data,  Career stations are much like the race entries in the yachting example in that a single page on Wikipedia contains a number of \"sub-topics\" that need to be referred to in order to keep together facts such as \"**this boat** was the third finisher\" and \"Cam Lewis was the skipper of **this boat**\"\n",
    "\n",
    "The difference is that DBpedia identifies individual career stations while it does not indentify individual race entries."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Here is a survey of the different predicate types that are used to\n",
    "describe career stations.  I was probably a bit unlucky to pick a player who didn't have **on:years** specified very often:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 34,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>count</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>p</th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>rdf:type</th>\n",
       "      <td>2931158</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:team</th>\n",
       "      <td>941316</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:years</th>\n",
       "      <td>927710</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:numberOfGoals</th>\n",
       "      <td>647584</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:numberOfMatches</th>\n",
       "      <td>645122</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:title</th>\n",
       "      <td>12</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:filename</th>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:description</th>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:deathDate</th>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:birthDate</th>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://purl.org/dc/elements/1.1/type</th>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:country</th>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://xmlns.com/foaf/0.1/name</th>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                                        count\n",
       "p                                            \n",
       "rdf:type                              2931158\n",
       "on:team                                941316\n",
       "on:years                               927710\n",
       "on:numberOfGoals                       647584\n",
       "on:numberOfMatches                     645122\n",
       "on:title                                   12\n",
       "on:filename                                 2\n",
       "on:description                              2\n",
       "on:deathDate                                1\n",
       "on:birthDate                                1\n",
       "http://purl.org/dc/elements/1.1/type        1\n",
       "on:country                                  1\n",
       "http://xmlns.com/foaf/0.1/name              1"
      ]
     },
     "execution_count": 34,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "time: 2.15 s\n"
     ]
    }
   ],
   "source": [
    "endpoint.select(\"\"\"\n",
    "    SELECT ?p (COUNT(*) AS ?count) { \n",
    "        ?that a on:CareerStation .\n",
    "        ?that ?p ?o .\n",
    "    } GROUP BY ?p ORDER BY DESC(?count)\n",
    "\"\"\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "What sort of people have career stations?  I count the career stations and get the following results:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 35,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>count</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>type</th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>on:Person</th>\n",
       "      <td>977021</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:Agent</th>\n",
       "      <td>977021</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:SoccerPlayer</th>\n",
       "      <td>869100</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:Athlete</th>\n",
       "      <td>823540</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:SoccerManager</th>\n",
       "      <td>197693</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:SportsManager</th>\n",
       "      <td>197451</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:IceHockeyPlayer</th>\n",
       "      <td>2079</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:Building</th>\n",
       "      <td>178</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:River</th>\n",
       "      <td>178</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:AmericanFootballPlayer</th>\n",
       "      <td>116</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:Organisation</th>\n",
       "      <td>108</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                            count\n",
       "type                             \n",
       "on:Person                  977021\n",
       "on:Agent                   977021\n",
       "on:SoccerPlayer            869100\n",
       "on:Athlete                 823540\n",
       "on:SoccerManager           197693\n",
       "on:SportsManager           197451\n",
       "on:IceHockeyPlayer           2079\n",
       "on:Building                   178\n",
       "on:River                      178\n",
       "on:AmericanFootballPlayer     116\n",
       "on:Organisation               108"
      ]
     },
     "execution_count": 35,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "time: 12.7 s\n"
     ]
    }
   ],
   "source": [
    "pd.options.display.max_rows=20\n",
    "has_cs_types=endpoint.select(\"\"\"\n",
    "    SELECT ?type (COUNT(*) AS ?count) { \n",
    "        ?station a on:CareerStation .\n",
    "        ?who on:careerStation ?station .\n",
    "        ?who a ?type .\n",
    "    } GROUP BY ?type ORDER BY DESC(?count)\n",
    "\"\"\")\n",
    "has_cs_types[has_cs_types.index.str.startswith(\"on:\")]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Career stations seem heavily weighted towards people who play soccer!  The numbers above are hard to compare to other characteristics,  however,  because they are counting the career stations instead of the people.  For instance,  Abbie Wolanow is counted five times because he has five career stations.\n",
    "\n",
    "With a slightly different query,  I can count the actual number of people of various types who have career stations."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 36,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>count</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>type</th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>on:Person</th>\n",
       "      <td>135887</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:Agent</th>\n",
       "      <td>135887</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:SoccerPlayer</th>\n",
       "      <td>125421</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:Athlete</th>\n",
       "      <td>121552</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:SoccerManager</th>\n",
       "      <td>18652</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:SportsManager</th>\n",
       "      <td>18617</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:IceHockeyPlayer</th>\n",
       "      <td>268</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:Building</th>\n",
       "      <td>31</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:River</th>\n",
       "      <td>28</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:AmericanFootballPlayer</th>\n",
       "      <td>19</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:Cricketer</th>\n",
       "      <td>16</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:Organisation</th>\n",
       "      <td>14</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:FictionalCharacter</th>\n",
       "      <td>13</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>on:SportsTeam</th>\n",
       "      <td>9</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                            count\n",
       "type                             \n",
       "on:Person                  135887\n",
       "on:Agent                   135887\n",
       "on:SoccerPlayer            125421\n",
       "on:Athlete                 121552\n",
       "on:SoccerManager            18652\n",
       "on:SportsManager            18617\n",
       "on:IceHockeyPlayer            268\n",
       "on:Building                    31\n",
       "on:River                       28\n",
       "on:AmericanFootballPlayer      19\n",
       "on:Cricketer                   16\n",
       "on:Organisation                14\n",
       "on:FictionalCharacter          13\n",
       "on:SportsTeam                   9"
      ]
     },
     "execution_count": 36,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "time: 11.2 s\n"
     ]
    }
   ],
   "source": [
    "has_cs_types=endpoint.select(\"\"\"\n",
    "    SELECT ?type (COUNT(*) AS ?count) {\n",
    "        { SELECT DISTINCT ?who {\n",
    "            ?station a on:CareerStation .\n",
    "            ?who on:careerStation ?station .\n",
    "        } }\n",
    "        ?who a ?type .\n",
    "    } GROUP BY ?type ORDER BY DESC(?count)\n",
    "\"\"\")\n",
    "has_cs_types[has_cs_types.index.str.startswith(\"on:\")]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Note that the counts here do not need to add up to anything in particular,  because it is possible for someone to be in more than one category at a time.  For instance,  we see the same count for `on:Person` and `on:Agent` as well as `on:Athlete` and `on:SoccerPlayer` because each soccer player is an athlete.  I got suspicious,  however,  and found that if I added the number of soccer players to the number of soccer managers..."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 37,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "135887"
      ]
     },
     "execution_count": 37,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "time: 2.5 ms\n"
     ]
    }
   ],
   "source": [
    "18617+117270"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "... and found they were equal!  That suggests that all of the people with career stations are involved with soccer,  and that **on:SoccerPlayer** and **on:SoccerManager** are mutually exclusive.\n",
    "\n",
    "I test that mutually exclusive bit by counting the number of topics which are both soccer players and soccer managers:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 38,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>count</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>8192</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   count\n",
       "0   8192"
      ]
     },
     "execution_count": 38,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "time: 528 ms\n"
     ]
    }
   ],
   "source": [
    "endpoint.select(\"\"\"\n",
    "    SELECT (COUNT(*) AS ?count) {\n",
    "        ?x a on:SoccerPlayer .\n",
    "        ?x a on:SoccerManager .\n",
    "    }\n",
    "\"\"\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Those two really are mutually exclusive.\n",
    "\n",
    "This seems strange to me.  I don't know much about soccer (I am from the U.S. after all!) but frequently coaches and team managers are former players in other sports,  shoudn't they be in soccer?\n",
    "\n",
    "I investigate just a bit more,  first getting a sample of managers..."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 39,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>x</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>&lt;Alan_Shearer&gt;</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>&lt;Alex_Ferguson&gt;</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>&lt;Dennis_Bergkamp&gt;</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>&lt;Enzo_Scifo&gt;</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>&lt;Marco_van_Basten&gt;</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>&lt;Osvaldo_Ardiles&gt;</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>&lt;Ruud_Gullit&gt;</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>&lt;Walter_Winterbottom&gt;</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>&lt;Alejandro_Morera_Soto&gt;</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>&lt;Aleksandr_Smirnov_(footballer,_born_1968)&gt;</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                                             x\n",
       "0                               <Alan_Shearer>\n",
       "1                              <Alex_Ferguson>\n",
       "2                            <Dennis_Bergkamp>\n",
       "3                                 <Enzo_Scifo>\n",
       "4                           <Marco_van_Basten>\n",
       "5                            <Osvaldo_Ardiles>\n",
       "6                                <Ruud_Gullit>\n",
       "7                        <Walter_Winterbottom>\n",
       "8                      <Alejandro_Morera_Soto>\n",
       "9  <Aleksandr_Smirnov_(footballer,_born_1968)>"
      ]
     },
     "execution_count": 39,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "time: 273 ms\n"
     ]
    }
   ],
   "source": [
    "endpoint.select(\"\"\"\n",
    "    SELECT ?x {\n",
    "        ?x a on:SoccerManager .\n",
    "    } LIMIT 10\n",
    "\"\"\") "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "... and then looking at the text description of one in particular:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 40,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'Sir Alexander Chapman \"Alex\" Ferguson, CBE (born 31 December 1941) is a former Scottish football manager and player who managed Manchester United from 1986 to 2013. He is regarded by many players, managers and analysts to be one of the greatest and most successful managers of all time.'"
      ]
     },
     "execution_count": 40,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "time: 339 ms\n"
     ]
    }
   ],
   "source": [
    "endpoint.select(\"\"\"\n",
    "    SELECT ?comment  { \n",
    "       <http://dbpedia.org/resource/Alex_Ferguson> rdfs:comment ?comment .\n",
    "       FILTER(LANG(?comment)='en')\n",
    "    }\n",
    "\"\"\").at[0,\"comment\"]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": true
   },
   "source": [
    "As I suspected,  Alex Ferguson was a player who became a manager.  These things are not mutually exclusive in the real world,  although they are mutually exclusive in DBpedia.\n",
    "\n",
    "It's a typical example of what you find when you look at \"how things are\" as opposed to \"how things are supposed to be\".  \n",
    "\n",
    "If it were up to me you'd be a soccer player if you'd ever played soccer and you'd be a manager if you'd ever managed a soccer team.  On the other hand,  I don't have my own database of thousands of soccer players (and managers!) so having to accept data in the format it is provided in is part of the price of \"free\" data."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": true
   },
   "source": [
    "# Conclusion\n",
    "\n",
    "In this article I began an investigation of data in DBpedia that particularly focused on two kinds of topics:  race entries and the careers of soccer players.  In the first case,  information about different entries in the race are scrambled,  because no subject is introduced for each entry.  In the second case,  DBpedia provides identifiers for \"Career Stations\" upon which it can state facts such as what team a person played on,  for what time period,  and so forth.\n",
    "\n",
    "I hope very much that the \"Career Station\" is the future of DBpedia because there are many other things that can be modeled very similarly such as:\n",
    "\n",
    "* a person's educational career\n",
    "* the work career of a person who works for multiple employers over time\n",
    "* times in which a person has been a member of a band\n",
    "* locations of a concert tour\n",
    "* results of a series of sports events\n",
    "\n",
    "Introduced in DBpedia 3.9,  \"Career Station\" is relatively new.  Other generic databases such as Freebase and Wikidata have used mechanisms such as [compound value types](http://basekb.com/docs/manual/compound-value-types.php) and [qualifiers](https://www.wikidata.org/wiki/Help:Qualifiers) to similar effect.  Let's hope that the enthusiasm soccer fans have brought to DBpedia will carry over to other sports and endeavors!\n",
    "\n",
    "<img src=\"goooal.jpg\">\n",
    "\n",
    "\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "\n",
    "<table width=\"600\" align=\"center\"> \n",
    "    <tbody>\n",
    "     <tr>\n",
    "      <td style=\"background: navy; align:center\">\n",
    "       <div style=\"color: white; text-align:center\">\n",
    "         This article is part of a series.<br>\n",
    "         Subscribe to my mailing list to be notified when new installments come out.\n",
    "        <br>&nbsp;\n",
    "        <br> \n",
    "        <form action=\"https://legalentityidentifier.info/lei/submitForm\" method=\"post\"> \n",
    "         <input name=\"email\" value=\"\"> \n",
    "         <input type=\"hidden\" name=\"what\" value=\"rs-book\"> \n",
    "         <input type=\"hidden\" name=\"v\" value=\"24c0e1c0-ab8a-4068-806d-71e6db4ca6fc\"> \n",
    "         <input type=\"submit\" name=\"action\" value=\"Subscribe!\" style=\"color: black\"> \n",
    "        </form> \n",
    "       </div></td>\n",
    "     </tr> \n",
    "    </tbody>\n",
    "   </table><script>\n",
    "  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){\n",
    "  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),\n",
    "  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)\n",
    "  })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');\n",
    "\n",
    "  ga('create', 'UA-3262918-17', 'auto');\n",
    "  ga('send', 'pageview');\n",
    "</script>"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
