History of dbpedia_country
The changes to the source code of this entry in the repository, newest first, each with the differences it made to the entry's files. They are also listed on GitLab.
[entries] Add the date when each entry was added, and remove icon_hash beff7c9
The dates are those of the commits that first added the entries' files (2020-08-11 for the entries of the initial commit); renamed entries keep the date of their first name. Changed: none
diff --git a/entries/dbpedia_country/__init__.py b/entries/dbpedia_country/__init__.py
index 1db7881..2184a2f 100644
--- a/entries/dbpedia_country/__init__.py
+++ b/entries/dbpedia_country/__init__.py
@@ -35,7 +35,7 @@ tags = ['Informational', 'Affiliation', 'Unweighted', 'Metadata']
url = 'https://downloads.dbpedia.org/3.9/en/'
citation = [('S. Auer, C. Bizer, G. Kobilarov, J. Lehmann, R. Cyganiak, Z. Ives, "DBpedia: A nucleus for a web of open data." In The Semantic Web (ISWC 2007 + ASWC 2007), Lecture Notes in Computer Science 4825, 722-735 (2007)', 'https://doi.org/10.1007/978-3-540-76298-0_52'),
('J. Lehmann et al., "DBpedia - A large-scale, multilingual knowledge base extracted from Wikipedia." Semantic Web 6(2), 167-195 (2015)', 'https://doi.org/10.3233/SW-140134')]
-icon_hash = '57340d36461efe0c7a6782f3'
+date_added = '2020-08-11'
upstream_license = ("Creative Commons Attribution-ShareAlike 3.0 (CC BY-SA 3.0)",
"https://creativecommons.org/licenses/by-sa/3.0/")
upstream_prefix = 'https://downloads.dbpedia.org/3.9/en'
[entries] Prefix the properties in the descriptions with (Node), (Edge) or (Graph) bc3dbbd
The lists of properties at the end of the descriptions marked edge properties with "Edge" but left node properties unmarked, or grouped them in "Nodes: `a`, ...; `b`, ..." items, so the kind of a property was often unclear. Every item now starts with (Node), (Edge) or (Graph), followed by the property names, a colon and the explanation, one item per property or group of properties; qualifications (kinds of nodes, networks) follow the names in parentheses. Properties that were only named got a short explanation, and a few items that named the wrong kind of property were corrected.
diff --git a/entries/dbpedia_country/__init__.py b/entries/dbpedia_country/__init__.py
index 8c379e1..1db7881 100644
--- a/entries/dbpedia_country/__init__.py
+++ b/entries/dbpedia_country/__init__.py
@@ -28,9 +28,9 @@ A resource that appears on both sides of the relation is represented by two dist
The network has the following properties:
-- `name`: the name of the DBpedia resource, i.e. the title of the corresponding English Wikipedia article (with underscores instead of spaces), with the percent-encoding of the URI decoded.
-- `type`: the most specific class of the resource in the DBpedia ontology, from the "Mapping-based Types" dataset of the same release (empty if the resource has no type, e.g. because it has no infobox mapped to the ontology).
-- `is_country`: whether the node is a country (otherwise it is an entity)."""
+- (Node) `name`: the name of the DBpedia resource, i.e. the title of the corresponding English Wikipedia article (with underscores instead of spaces), with the percent-encoding of the URI decoded.
+- (Node) `type`: the most specific class of the resource in the DBpedia ontology, from the "Mapping-based Types" dataset of the same release (empty if the resource has no type, e.g. because it has no infobox mapped to the ontology).
+- (Node) `is_country`: whether the node is a country (otherwise it is an entity)."""
tags = ['Informational', 'Affiliation', 'Unweighted', 'Metadata']
url = 'https://downloads.dbpedia.org/3.9/en/'
citation = [('S. Auer, C. Bizer, G. Kobilarov, J. Lehmann, R. Cyganiak, Z. Ives, "DBpedia: A nucleus for a web of open data." In The Semantic Web (ISWC 2007 + ASWC 2007), Lecture Notes in Computer Science 4825, 722-735 (2007)', 'https://doi.org/10.1007/978-3-540-76298-0_52'),
[entries] Remove unneeded code from the entries 2c69f19
Unneeded "global files" statements, unused imports and variables, f-strings without placeholders, duplicate keys in foodweb_little_rock (keeping the order and the values used), and the second definition of get_lines() in twitter_higgs. Nothing changes in the networks or descriptions. Changed: none
diff --git a/entries/dbpedia_country/__init__.py b/entries/dbpedia_country/__init__.py
index 5e913af..8c379e1 100644
--- a/entries/dbpedia_country/__init__.py
+++ b/entries/dbpedia_country/__init__.py
@@ -114,7 +114,6 @@ def read_types(f, uris):
@coerce_props()
@annotate()
def parse(alts=None):
- global files
name = __name__.split(".")[-1]
for fnames, alt, fmt in files:
if alts is not None and alt not in alts:
[entries] Move more KONECT-derived entries to their original sources bf9dc0e
The entries now download the data from where KONECT obtained them (live, or via the Wayback Machine), using the same release as KONECT where it is still available, and gain the metadata KONECT dropped; descriptions and citations are rewritten from the original sources: - Linton Freeman's UCINET data page: bible_nouns, bison, cattle, hens, highschool, kangaroo, macaques, moreno_sheep, physician_trust (the three relations and the physicians' attributes), rhesus_monkey, train_terrorists, windsurfers (now the networks `interaction` and `closeness`), college_freshmen, crime, interactome_yeast (from the primary source), moreno_taro (undirected), residence_hall, zebras - other pages, archived: contiguous_usa, advogato, google, github, digg_reply, twitter, bookcrossing, dbtropes_feature (without KONECT's spurious "ItemName" tropes) - movielens_100k (in fact the MovieLens 10M tag assignments) - dblp release 2017-05-02: dblp_author_paper, dblp_cite, dblp_coauthor - DBpedia 3.9: dbpedia_country, dbpedia_genre, dbpedia_location, dbpedia_occupation, dbpedia_producer, dbpedia_recordlabel, dbpedia_starring, dbpedia_team, dbpedia_writer, dbpedia_all, dbpedia_link - Discogs releases dump of October 2015: discogs_affiliation, discogs_genre and discogs_label (now with genre and style networks)
diff --git a/entries/dbpedia_country/__init__.py b/entries/dbpedia_country/__init__.py
index 4ebbc41..5e913af 100644
--- a/entries/dbpedia_country/__init__.py
+++ b/entries/dbpedia_country/__init__.py
@@ -17,21 +17,99 @@
# with this program. If not, see <http://www.gnu.org/licenses/>.
from .. import *
+import bz2
+import re
+import urllib.parse
-title = "Person-Country Affiliations (DBpedia, 2016)"
-description = """A bipartite network of the affiliations between notable people and countries of the world, as extracted from Wikipedia via the DBpedia project. Countries include former countries, empires, kingdoms, and some country-like entities.[^icon]
-[^icon]: Description obtained from the [ICON](https://icon.colorado.edu) project."""
-tags = ['Social', 'Affiliation', 'Unweighted']
-url = 'http://konect.cc/networks/dbpedia-country'
-citation = [('S. Auer et al. "DBpedia: A nucleus for a web of open data." In Proc. Int. Semantic Web Conf. (ISWC), 722-735 (2008)', 'https://doi.org/10.1007/978-3-540-76298-0_52')]
+title = 'Entity-Country Affiliations (DBpedia, 2013)'
+description = """A bipartite network of Wikipedia entities and the countries they are associated with. The data are from version 3.9 of DBpedia, which extracts structured information from the infoboxes of Wikipedia articles and maps it onto the DBpedia ontology; this release was extracted from the English Wikipedia dumps of late March / early April 2013, and was published in September 2013. Each edge is one triple of the [`dbo:country`](http://dbpedia.org/ontology/country) relation in the "Mapping-based Properties (Cleaned)" dataset of the release, from which the statements identified as incorrect by heuristic inference were removed. Nodes are entities and countries, and each edge connects an entity to a country listed in its infobox. Most entities are places (settlements, villages, towns, administrative regions, cities, rivers), but they also include films, books, schools, universities, television shows, military units, and many other kinds. The countries include former countries, empires and kingdoms, as well as disputed country-like entities, and some resources that are not countries (e.g. regions, cities or ethnic groups).
+
+A resource that appears on both sides of the relation is represented by two distinct nodes, one on each side, and repeated triples are included only once. Objects of the relation do not necessarily have an infobox, or even a Wikipedia article, of their own (e.g. when the infobox links to a missing article). Besides proper Wikipedia articles, some resources are intermediate nodes created by DBpedia for parts of an infobox, named after the article with a suffix `__<n>`.
+
+The network has the following properties:
+
+- `name`: the name of the DBpedia resource, i.e. the title of the corresponding English Wikipedia article (with underscores instead of spaces), with the percent-encoding of the URI decoded.
+- `type`: the most specific class of the resource in the DBpedia ontology, from the "Mapping-based Types" dataset of the same release (empty if the resource has no type, e.g. because it has no infobox mapped to the ontology).
+- `is_country`: whether the node is a country (otherwise it is an entity)."""
+tags = ['Informational', 'Affiliation', 'Unweighted', 'Metadata']
+url = 'https://downloads.dbpedia.org/3.9/en/'
+citation = [('S. Auer, C. Bizer, G. Kobilarov, J. Lehmann, R. Cyganiak, Z. Ives, "DBpedia: A nucleus for a web of open data." In The Semantic Web (ISWC 2007 + ASWC 2007), Lecture Notes in Computer Science 4825, 722-735 (2007)', 'https://doi.org/10.1007/978-3-540-76298-0_52'),
+ ('J. Lehmann et al., "DBpedia - A large-scale, multilingual knowledge base extracted from Wikipedia." Semantic Web 6(2), 167-195 (2015)', 'https://doi.org/10.3233/SW-140134')]
icon_hash = '57340d36461efe0c7a6782f3'
-upstream_prefix = 'http://konect.cc/files'
-files = [('download.tsv.dbpedia-country.tar.bz2', None, 'konect')]
+upstream_license = ("Creative Commons Attribution-ShareAlike 3.0 (CC BY-SA 3.0)",
+ "https://creativecommons.org/licenses/by-sa/3.0/")
+upstream_prefix = 'https://downloads.dbpedia.org/3.9/en'
+files = [(('mappingbased_properties_cleaned_en.nt.bz2', 'instance_types_en.nt.bz2'),
+ None, None)]
+
+# DBpedia ontology relation; name of the property that marks the nodes on
+# one side, and whether these are the objects (True) or the subjects (False)
+# of the relation; vertex properties taken from literals of the given
+# ontology predicates
+relation = 'country'
+side_prop, side_is_object = 'is_country', True
+literal_props = {}
def fetch_upstream(force=False):
return fetch_upstream_files(__name__.split(".")[-1], upstream_prefix, files,
force)
+_res = b"<http://dbpedia.org/resource/"
+_ntesc = re.compile(r"\\u([0-9A-Fa-f]{4})|\\U([0-9A-Fa-f]{8})|\\(.)")
+_ntchr = {"t": "\t", "n": "\n", "r": "\r", "b": "\b", "f": "\f"}
+
+def _unescape(s):
+ """Decode the escapes of N-Triples strings and URIs."""
+ return _ntesc.sub(lambda m: (chr(int(m.group(1) or m.group(2), 16))
+ if m.group(3) is None
+ else _ntchr.get(m.group(3), m.group(3))), s)
+
+def _resource_name(iri):
+ """Name of a DBpedia resource, from its N-Triples URI token."""
+ return urllib.parse.unquote(_unescape(iri[len(_res):-1].decode("utf-8")))
+
+def read_relation(f, rel, literals=()):
+ """Distinct (subject, object) URI pairs of the given ontology relation,
+ in order of first appearance, and the literal values of the given
+ ontology predicates, for each subject."""
+ pred = b" <http://dbpedia.org/ontology/" + rel.encode() + b"> "
+ lpreds = {b" <http://dbpedia.org/ontology/" + p.encode() + b"> \"": p
+ for p in literals}
+ pairs = {}
+ lits = {p: {} for p in literals}
+ for line in f:
+ if pred in line:
+ s, p, o = line.split(b" ", 3)[:3]
+ if s.startswith(_res) and o.startswith(_res):
+ pairs[(s, o)] = None
+ continue
+ for lp, p in lpreds.items():
+ i = line.find(lp)
+ if i < 0:
+ continue
+ val = line[i + len(lp) - 1:].rstrip()
+ val = val[1:val.rindex(b'"')].decode("utf-8")
+ vals = lits[p].setdefault(line[:i], [])
+ val = _unescape(val)
+ if val not in vals:
+ vals.append(val)
+ return list(pairs), lits
+
+def read_types(f, uris):
+ """Most specific DBpedia ontology class of each resource in uris (the
+ first one listed in the file, which is the most specific one)."""
+ rdftype = b" <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://dbpedia.org/ontology/"
+ types = {}
+ for line in f:
+ i = line.find(rdftype)
+ if i < 0:
+ continue
+ s = line[:i]
+ if s not in uris or s in types:
+ continue
+ types[s] = line[i + len(rdftype):].split(b">", 1)[0].decode()
+ return types
+
@cache_network()
@coerce_props()
@annotate()
@@ -41,9 +119,33 @@ def parse(alts=None):
for fnames, alt, fmt in files:
if alts is not None and alt not in alts:
continue
- if isinstance(fnames, str):
- fnames = [fnames]
- with ExitStack() as stack:
- fs = [stack.enter_context(open_upstream_file(name, fn, "rb")) for fn in fnames]
- g = parse_graph(fs, fmt, directed=True)
+ with open_upstream_file(name, fnames[0], "rb") as f:
+ with bz2.open(f) as bf:
+ pairs, lits = read_relation(bf, relation,
+ literal_props.values())
+ subjects, objects = {}, {}
+ for s, o in pairs:
+ subjects.setdefault(s, len(subjects))
+ objects.setdefault(o, len(objects))
+ with open_upstream_file(name, fnames[1], "rb") as f:
+ with bz2.open(f) as bf:
+ types = read_types(bf, subjects.keys() | objects.keys())
+ ns = len(subjects)
+ g = Graph(directed=False)
+ g.add_vertex(ns + len(objects))
+ g.add_edge_list([(subjects[s], ns + objects[o]) for s, o in pairs])
+ g.vp.name = g.new_vp("string")
+ g.vp.type = g.new_vp("string")
+ for k in literal_props:
+ g.vp[k] = g.new_vp("string")
+ g.vp[side_prop] = g.new_vp("bool")
+ for uris, off in [(subjects, 0), (objects, ns)]:
+ for u, j in uris.items():
+ v = g.vertex(off + j)
+ g.vp.name[v] = _resource_name(u)
+ g.vp.type[v] = types.get(u, "")
+ for k, p in literal_props.items():
+ g.vp[k][v] = "; ".join(lits[p].get(u, []))
+ g.vp[side_prop].a[ns:] = side_is_object
+ g.vp[side_prop].a[:ns] = not side_is_object
yield alt, g
Update copyright information 73a4f0d
diff --git a/entries/dbpedia_country/__init__.py b/entries/dbpedia_country/__init__.py
index 8b7a803..4ebbc41 100644
--- a/entries/dbpedia_country/__init__.py
+++ b/entries/dbpedia_country/__init__.py
@@ -1,7 +1,7 @@
#! /usr/bin/env python
# -*- coding: utf-8 -*-
#
-# Copyright (C) 2020-2024 Tiago de Paula Peixoto <tiago@skewed.de>
+# Copyright (C) 2020-2026 Tiago de Paula Peixoto <tiago@skewed.de>
#
# This program is free software: you can redistribute it and/or modify it under
# the terms of the GNU Affero General Public License as published by the Free
Update copyright information 3d288ea
diff --git a/entries/dbpedia_country/__init__.py b/entries/dbpedia_country/__init__.py
index 6c2a347..8b7a803 100644
--- a/entries/dbpedia_country/__init__.py
+++ b/entries/dbpedia_country/__init__.py
@@ -1,7 +1,7 @@
#! /usr/bin/env python
# -*- coding: utf-8 -*-
#
-# Copyright (C) 2020-2023 Tiago de Paula Peixoto <tiago@skewed.de>
+# Copyright (C) 2020-2024 Tiago de Paula Peixoto <tiago@skewed.de>
#
# This program is free software: you can redistribute it and/or modify it under
# the terms of the GNU Affero General Public License as published by the Free
Update copyright information 8d005ae
diff --git a/entries/dbpedia_country/__init__.py b/entries/dbpedia_country/__init__.py
index c91d309..6c2a347 100644
--- a/entries/dbpedia_country/__init__.py
+++ b/entries/dbpedia_country/__init__.py
@@ -1,7 +1,7 @@
#! /usr/bin/env python
# -*- coding: utf-8 -*-
#
-# Copyright (C) 2021 Tiago de Paula Peixoto <tiago@skewed.de>
+# Copyright (C) 2020-2023 Tiago de Paula Peixoto <tiago@skewed.de>
#
# This program is free software: you can redistribute it and/or modify it under
# the terms of the GNU Affero General Public License as published by the Free
Update copyright info db2efcc
diff --git a/entries/dbpedia_country/__init__.py b/entries/dbpedia_country/__init__.py
index dce10c5..c91d309 100644
--- a/entries/dbpedia_country/__init__.py
+++ b/entries/dbpedia_country/__init__.py
@@ -1,7 +1,7 @@
#! /usr/bin/env python
# -*- coding: utf-8 -*-
#
-# Copyright (C) 2020 Tiago de Paula Peixoto <tiago@skewed.de>
+# Copyright (C) 2021 Tiago de Paula Peixoto <tiago@skewed.de>
#
# This program is free software: you can redistribute it and/or modify it under
# the terms of the GNU Affero General Public License as published by the Free
Un-orphan KONECT datasets 894eba5
KONECT has been brought back from the dead for the time being.
diff --git a/entries/dbpedia_country/__init__.py b/entries/dbpedia_country/__init__.py
index ac799e7..dce10c5 100644
--- a/entries/dbpedia_country/__init__.py
+++ b/entries/dbpedia_country/__init__.py
@@ -26,7 +26,6 @@ url = 'http://konect.cc/networks/dbpedia-country'
citation = [('S. Auer et al. "DBpedia: A nucleus for a web of open data." In Proc. Int. Semantic Web Conf. (ISWC), 722-735 (2008)', 'https://doi.org/10.1007/978-3-540-76298-0_52')]
icon_hash = '57340d36461efe0c7a6782f3'
upstream_prefix = 'http://konect.cc/files'
-orphan = True
files = [('download.tsv.dbpedia-country.tar.bz2', None, 'konect')]
def fetch_upstream(force=False):
Update citations to use DOIs e878874
diff --git a/entries/dbpedia_country/__init__.py b/entries/dbpedia_country/__init__.py
index fbfbdad..ac799e7 100644
--- a/entries/dbpedia_country/__init__.py
+++ b/entries/dbpedia_country/__init__.py
@@ -23,7 +23,7 @@ description = """A bipartite network of the affiliations between notable people
[^icon]: Description obtained from the [ICON](https://icon.colorado.edu) project."""
tags = ['Social', 'Affiliation', 'Unweighted']
url = 'http://konect.cc/networks/dbpedia-country'
-citation = [('S. Auer et al. "DBpedia: A nucleus for a web of open data." In Proc. Int. Semantic Web Conf. (ISWC), 722-735 (2008)', 'http://www.informatik.uni-leipzig.de/~auer/publication/dbpedia.pdf')]
+citation = [('S. Auer et al. "DBpedia: A nucleus for a web of open data." In Proc. Int. Semantic Web Conf. (ISWC), 722-735 (2008)', 'https://doi.org/10.1007/978-3-540-76298-0_52')]
icon_hash = '57340d36461efe0c7a6782f3'
upstream_prefix = 'http://konect.cc/files'
orphan = True
Add support for 'orphan' datasets and tag konect entries e330b80
diff --git a/entries/dbpedia_country/__init__.py b/entries/dbpedia_country/__init__.py
index 1e3872c..fbfbdad 100644
--- a/entries/dbpedia_country/__init__.py
+++ b/entries/dbpedia_country/__init__.py
@@ -26,6 +26,7 @@ url = 'http://konect.cc/networks/dbpedia-country'
citation = [('S. Auer et al. "DBpedia: A nucleus for a web of open data." In Proc. Int. Semantic Web Conf. (ISWC), 722-735 (2008)', 'http://www.informatik.uni-leipzig.de/~auer/publication/dbpedia.pdf')]
icon_hash = '57340d36461efe0c7a6782f3'
upstream_prefix = 'http://konect.cc/files'
+orphan = True
files = [('download.tsv.dbpedia-country.tar.bz2', None, 'konect')]
def fetch_upstream(force=False):
Change license from GPLv3 to AGPLv3 d754be5
diff --git a/entries/dbpedia_country/__init__.py b/entries/dbpedia_country/__init__.py
index 994840b..1e3872c 100644
--- a/entries/dbpedia_country/__init__.py
+++ b/entries/dbpedia_country/__init__.py
@@ -3,18 +3,18 @@
#
# Copyright (C) 2020 Tiago de Paula Peixoto <tiago@skewed.de>
#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
+# This program is free software: you can redistribute it and/or modify it under
+# the terms of the GNU Affero General Public License as published by the Free
+# Software Foundation, either version 3 of the License, or (at your option) any
+# later version.
#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
+# details.
#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
+# You should have received a copy of the GNU Affero General Public License along
+# with this program. If not, see <http://www.gnu.org/licenses/>.
from .. import *
Add explicit attribution to descriptions obtained from ICON 1645314
diff --git a/entries/dbpedia_country/__init__.py b/entries/dbpedia_country/__init__.py
index 7870629..994840b 100644
--- a/entries/dbpedia_country/__init__.py
+++ b/entries/dbpedia_country/__init__.py
@@ -19,7 +19,8 @@
from .. import *
title = "Person-Country Affiliations (DBpedia, 2016)"
-description = "A bipartite network of the affiliations between notable people and countries of the world, as extracted from Wikipedia via the DBpedia project. Countries include former countries, empires, kingdoms, and some country-like entities."
+description = """A bipartite network of the affiliations between notable people and countries of the world, as extracted from Wikipedia via the DBpedia project. Countries include former countries, empires, kingdoms, and some country-like entities.[^icon]
+[^icon]: Description obtained from the [ICON](https://icon.colorado.edu) project."""
tags = ['Social', 'Affiliation', 'Unweighted']
url = 'http://konect.cc/networks/dbpedia-country'
citation = [('S. Auer et al. "DBpedia: A nucleus for a web of open data." In Proc. Int. Semantic Web Conf. (ISWC), 722-735 (2008)', 'http://www.informatik.uni-leipzig.de/~auer/publication/dbpedia.pdf')]
Initial commit cc85872
diff --git a/entries/dbpedia_country/__init__.py b/entries/dbpedia_country/__init__.py
new file mode 100644
index 0000000..7870629
--- /dev/null
+++ b/entries/dbpedia_country/__init__.py
@@ -0,0 +1,48 @@
+#! /usr/bin/env python
+# -*- coding: utf-8 -*-
+#
+# Copyright (C) 2020 Tiago de Paula Peixoto <tiago@skewed.de>
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+from .. import *
+
+title = "Person-Country Affiliations (DBpedia, 2016)"
+description = "A bipartite network of the affiliations between notable people and countries of the world, as extracted from Wikipedia via the DBpedia project. Countries include former countries, empires, kingdoms, and some country-like entities."
+tags = ['Social', 'Affiliation', 'Unweighted']
+url = 'http://konect.cc/networks/dbpedia-country'
+citation = [('S. Auer et al. "DBpedia: A nucleus for a web of open data." In Proc. Int. Semantic Web Conf. (ISWC), 722-735 (2008)', 'http://www.informatik.uni-leipzig.de/~auer/publication/dbpedia.pdf')]
+icon_hash = '57340d36461efe0c7a6782f3'
+upstream_prefix = 'http://konect.cc/files'
+files = [('download.tsv.dbpedia-country.tar.bz2', None, 'konect')]
+
+def fetch_upstream(force=False):
+ return fetch_upstream_files(__name__.split(".")[-1], upstream_prefix, files,
+ force)
+
+@cache_network()
+@coerce_props()
+@annotate()
+def parse(alts=None):
+ global files
+ name = __name__.split(".")[-1]
+ for fnames, alt, fmt in files:
+ if alts is not None and alt not in alts:
+ continue
+ if isinstance(fnames, str):
+ fnames = [fnames]
+ with ExitStack() as stack:
+ fs = [stack.enter_context(open_upstream_file(name, fn, "rb")) for fn in fnames]
+ g = parse_graph(fs, fmt, directed=True)
+ yield alt, g