History of epinions
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/epinions/__init__.py b/entries/epinions/__init__.py
index 60dfc81..4a53078 100644
--- a/entries/epinions/__init__.py
+++ b/entries/epinions/__init__.py
@@ -47,7 +47,7 @@ url = ['https://web.archive.org/web/20080514161127/http://www.trustlet.org/wiki/
'https://www.kaggle.com/datasets/masoud3/epinions-trust-network']
citation = [('P. Massa, P. Avesani, "Controversial users demand local trust metrics: An experimental study on Epinions.com community." Proceedings of the 20th National Conference on Artificial Intelligence (AAAI-05), 121-126 (2005)', 'https://cdn.aaai.org/AAAI/2005/AAAI05-020.pdf'),
('M. R. Hamedani, I. Ali, J. Hong, S.-W. Kim, "TrustRec: An effective approach to exploit implicit trust and distrust relationships along with explicit ones for accurate recommendations." Computer Science and Information Systems 18(1), 93-114 (2021)', 'https://doi.org/10.2298/csis200608039h')]
-icon_hash = '5818e7ac8cf714f319c3eae6'
+date_added = '2020-08-11'
upstream_license = ('Other (no license stated; Kaggle dataset masoud3/epinions-trust-network)', 'https://www.kaggle.com/datasets/masoud3/epinions-trust-network')
# trustlet.org no longer exists; its directory of the dataset was captured
# completely by the Internet Archive only for rating.txt (the same file as
[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/epinions/__init__.py b/entries/epinions/__init__.py
index 9febc13..60dfc81 100644
--- a/entries/epinions/__init__.py
+++ b/entries/epinions/__init__.py
@@ -29,10 +29,19 @@ description = """The "extended Epinions dataset", which the staff of the consume
The networks have the following properties:
-- `ratings`, nodes: `is_user`, whether the node is a user (otherwise an article); `id`, the anonymized id of the user or article; `author_id`, the id of the user who wrote the article (-1 for users, and for the articles not listed in `mc.txt`); `subject_id`, the id of the subject the article is about (-1 likewise, and for the 341 articles of `mc.txt` without a subject).
-- `ratings`, edges: `rating`, the rating value (1 to 5, or the undocumented value 6); `status`, the display status of the rating (1 if the user chose not to show their name next to the rating, 0 otherwise); `time`, the date the article was first rated by the user (Unix time, at 00:00 UTC of that date); `last_modified`, the date the rating was last modified (Unix time, at 00:00 UTC; -1 if not given); `type`, the type of the rated object (1 or 2; the meaning of the values is not documented); `vertical_id`, the id of the category ("vertical") of the article (-1 for about 7% of the ratings, which the documentation does not explain, and for the incomplete last rating).
-- `trust`, nodes: `id`, the anonymized id of the user.
-- `trust`, edges: `sign`, +1 for trust and -1 for distrust; `time`, the date of the statement (Unix time, at 00:00 UTC of that date)."""
+- (Node) `is_user` (`ratings`): whether the node is a user (otherwise an article).
+- (Node) `id` (`ratings`): the anonymized id of the user or article.
+- (Node) `author_id` (`ratings`): the id of the user who wrote the article (-1 for users, and for the articles not listed in `mc.txt`).
+- (Node) `subject_id` (`ratings`): the id of the subject the article is about (-1 for users, for the articles not listed in `mc.txt`, and for the 341 articles of `mc.txt` without a subject).
+- (Edge) `rating` (`ratings`): the rating value (1 to 5, or the undocumented value 6).
+- (Edge) `status` (`ratings`): the display status of the rating (1 if the user chose not to show their name next to the rating, 0 otherwise).
+- (Edge) `time` (`ratings`): the date the article was first rated by the user (Unix time, at 00:00 UTC of that date).
+- (Edge) `last_modified` (`ratings`): the date the rating was last modified (Unix time, at 00:00 UTC; -1 if not given).
+- (Edge) `type` (`ratings`): the type of the rated object (1 or 2; the meaning of the values is not documented).
+- (Edge) `vertical_id` (`ratings`): the id of the category ("vertical") of the article (-1 for about 7% of the ratings, which the documentation does not explain, and for the incomplete last rating).
+- (Node) `id` (`trust`): the anonymized id of the user.
+- (Edge) `sign` (`trust`): +1 for trust and -1 for distrust.
+- (Edge) `time` (`trust`): the date of the statement (Unix time, at 00:00 UTC of that date)."""
tags = ['Economic', 'Preferences', 'Social', 'Online', 'Bipartite', 'Weighted', 'Signed', 'Timestamps', 'Metadata']
url = ['https://web.archive.org/web/20080514161127/http://www.trustlet.org/wiki/Extended_Epinions_dataset',
'https://www.kaggle.com/datasets/masoud3/epinions-trust-network']
[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/epinions/__init__.py b/entries/epinions/__init__.py
index 8f064c7..9febc13 100644
--- a/entries/epinions/__init__.py
+++ b/entries/epinions/__init__.py
@@ -162,7 +162,6 @@ def parse_trust(name, fname):
@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 contact, convote_mentions, douban, email_company, epinions, flixster, football_league_results, hyves, lastfm, libimseti, livemocha, reuters, sa_companies, sister_cities, tripadvisor_ratings, wikilens_ratings and wikipedia_discussions_de to their original sources 8f097de
These entries downloaded KONECT's copies of the data. They now download the original data (live, from pinned Wayback Machine snapshots, or by re-extracting from public dumps), gaining the metadata KONECT dropped (names, identifiers, timestamps, attributes), with descriptions and citations rewritten from the original sources and factual errors fixed (years and periods of contact, email_company, douban, flixster, libimseti, sa_companies; the rated objects of epinions; the sign of convote_mentions; songs merged by title alone in lastfm). New networks: the trust network of epinions, the links of wikilens_ratings, the JSON crawl of tripadvisor_ratings, and current versions of sister_cities and wikipedia_discussions_de next to the ones KONECT used. asu_social_networks only loses its mention of KONECT. Changed: upstream contact convote_mentions douban email_company epinions flixster football_league_results hyves lastfm libimseti livemocha reuters sa_companies sister_cities tripadvisor_ratings wikilens_ratings wikipedia_discussions_de
diff --git a/entries/epinions/__init__.py b/entries/epinions/__init__.py
index ff78aa2..8f064c7 100644
--- a/entries/epinions/__init__.py
+++ b/entries/epinions/__init__.py
@@ -18,20 +18,146 @@
from .. import *
-title = "Epinions product ratings (2005)"
-description = """A bipartite network of users and the products they rated on the website Epinions.com. A user connects to all products on which that user entered a rating. Edge weight represents the rating score, and edges are timestamped.[^icon]
-[^icon]: Description obtained from the [ICON](https://icon.colorado.edu) project."""
-tags = ['Economic', 'Preferences', 'Timestamps', 'Weighted']
-url = 'http://konect.cc/networks/epinions-rating'
-citation = [('P. Massa and P Avesani. "Controversial users demand local trust metrics: An experimental study on epinions. com community." Proc. of the Internat. Conf. on AI (AAAI 2005).', 'http://www.aaai.org/Papers/AAAI/2005/AAAI05-020.pdf')]
+import array
+import datetime as dt
+
+title = "Epinions review ratings and trust (2001-2003)"
+description = """The "extended Epinions dataset", which the staff of the consumer review site Epinions.com gave to Paolo Massa, and which he distributed on the TrustLet wiki: the helpfulness ratings that the users gave to the reviews and essays (articles) written by other users, and the trust and distrust statements among the users, including the distrust statements, which the site did not show publicly. Users and articles are identified by anonymized numeric ids. The files are obtained from a copy of the dataset on Kaggle (the TrustLet site no longer exists).
+
+- `ratings`: a bipartite network of the users and the articles they rated. Nodes are the users who rated some article, and the rated articles (users and articles have separate id spaces), and an edge connects a user to an article they rated. The rated objects are articles, not products: each rating states how helpful a user found an article of another user, on a scale of 1 ("not helpful") to 5 ("most helpful"). The data contain also 6 as rating value (in about 0.7% of the ratings), which the original documentation does not mention (the Kaggle copy says to treat it as 5); the values are kept as they are. The creation dates of the ratings range from 10 January 2001 to May 2002, but about 90% of the ratings bear the date of 10 January 2001, which is apparently the earliest date recorded (Epinions was founded in 1999), so that the dates of the earlier ratings are not known. The file of the ratings ends in the middle of its last line, without the category of that rating (and possibly cut short at the source: the copies of the file on TrustLet and on Kaggle are the same); that rating is kept, with the category -1. The authors and subjects of the articles are given for the articles in the file `mc.txt` of the dataset.
+- `trust`: a directed signed network of the trust and distrust statements among the users (717,667 trusts and 123,705 distrusts), with their dates, from January 2001 to August 2003. Nodes are the users making or receiving some statement (in the same id space as the users of `ratings` and the authors of the articles), and a directed edge from user A to user B is a statement of A about B (573 users made a statement about themselves). These are the same data as the network `epinions` of the entry `signed_social_media` (from SNAP, with the same numbers of statements and of users, 131,828), here with the original user ids and the dates.
+
+The networks have the following properties:
+
+- `ratings`, nodes: `is_user`, whether the node is a user (otherwise an article); `id`, the anonymized id of the user or article; `author_id`, the id of the user who wrote the article (-1 for users, and for the articles not listed in `mc.txt`); `subject_id`, the id of the subject the article is about (-1 likewise, and for the 341 articles of `mc.txt` without a subject).
+- `ratings`, edges: `rating`, the rating value (1 to 5, or the undocumented value 6); `status`, the display status of the rating (1 if the user chose not to show their name next to the rating, 0 otherwise); `time`, the date the article was first rated by the user (Unix time, at 00:00 UTC of that date); `last_modified`, the date the rating was last modified (Unix time, at 00:00 UTC; -1 if not given); `type`, the type of the rated object (1 or 2; the meaning of the values is not documented); `vertical_id`, the id of the category ("vertical") of the article (-1 for about 7% of the ratings, which the documentation does not explain, and for the incomplete last rating).
+- `trust`, nodes: `id`, the anonymized id of the user.
+- `trust`, edges: `sign`, +1 for trust and -1 for distrust; `time`, the date of the statement (Unix time, at 00:00 UTC of that date)."""
+tags = ['Economic', 'Preferences', 'Social', 'Online', 'Bipartite', 'Weighted', 'Signed', 'Timestamps', 'Metadata']
+url = ['https://web.archive.org/web/20080514161127/http://www.trustlet.org/wiki/Extended_Epinions_dataset',
+ 'https://www.kaggle.com/datasets/masoud3/epinions-trust-network']
+citation = [('P. Massa, P. Avesani, "Controversial users demand local trust metrics: An experimental study on Epinions.com community." Proceedings of the 20th National Conference on Artificial Intelligence (AAAI-05), 121-126 (2005)', 'https://cdn.aaai.org/AAAI/2005/AAAI05-020.pdf'),
+ ('M. R. Hamedani, I. Ali, J. Hong, S.-W. Kim, "TrustRec: An effective approach to exploit implicit trust and distrust relationships along with explicit ones for accurate recommendations." Computer Science and Information Systems 18(1), 93-114 (2021)', 'https://doi.org/10.2298/csis200608039h')]
icon_hash = '5818e7ac8cf714f319c3eae6'
-upstream_prefix = 'http://konect.cc/files'
-files = [('download.tsv.epinions-rating.tar.bz2', None, 'konect')]
+upstream_license = ('Other (no license stated; Kaggle dataset masoud3/epinions-trust-network)', 'https://www.kaggle.com/datasets/masoud3/epinions-trust-network')
+# trustlet.org no longer exists; its directory of the dataset was captured
+# completely by the Internet Archive only for rating.txt (the same file as
+# here), so the files are obtained from the copy on Kaggle (public, no login
+# needed), as one archive of the whole dataset (version 1)
+upstream_prefix = 'kaggle://masoud3/epinions-trust-network/1'
+files = [(('epinions-trust-network.zip:epinions/rating.txt',
+ 'epinions-trust-network.zip:epinions/mc.txt'), 'ratings', None),
+ ('epinions-trust-network.zip:epinions/user_rating.txt', 'trust', None)]
+
+# Limit of ratings (and trust statements) to read, for quick checks
+_check_rows = None
def fetch_upstream(force=False):
return fetch_upstream_files(__name__.split(".")[-1], upstream_prefix, files,
force)
+def parse_date(s):
+ "Unix time of a date given as YYYY/MM/DD (at 00:00 UTC), -1 if empty."
+ if s == "":
+ return -1
+ d = dt.datetime.strptime(s, "%Y/%m/%d").replace(tzinfo=dt.timezone.utc)
+ return int(d.timestamp())
+
+def read_ratings(f):
+ """The users, the articles and the ratings of the open text file `f`
+ (tab-separated columns OBJECT_ID, MEMBER_ID, RATING, STATUS, CREATION,
+ LAST_MODIFIED, TYPE, VERTICAL_ID). The last line is incomplete: it
+ ends after the tab that precedes VERTICAL_ID, which is set to -1."""
+ users = {}
+ objects = {}
+ # one array per column: user, article, rating, status, created,
+ # modified, type, vertical
+ edges = [array.array("q") for i in range(8)]
+ dates = {}
+ last = False
+ for n, line in enumerate(f):
+ if _check_rows is not None and n >= _check_rows:
+ break
+ # only the last line may be incomplete
+ assert not last
+ if not line.endswith("\n"):
+ last = True
+ obj, user, rating, status, created, modified, typ, vertical = \
+ line.rstrip("\n").split("\t")
+ if vertical == "":
+ assert last
+ vertical = -1
+ u = users.setdefault(int(user), len(users))
+ o = objects.setdefault(int(obj), len(objects))
+ t_c = dates.get(created)
+ if t_c is None:
+ t_c = dates[created] = parse_date(created)
+ t_m = dates.get(modified)
+ if t_m is None:
+ t_m = dates[modified] = parse_date(modified)
+ for c, x in zip(edges, (u, o, int(rating), int(status), t_c, t_m,
+ int(typ), int(vertical))):
+ c.append(x)
+ return users, objects, edges
+
+def parse_ratings(name, fnames):
+ with open_upstream_file(name, fnames[0], "r") as f:
+ users, objects, edges = read_ratings(f)
+ N_u = len(users)
+ edges = numpy.column_stack([numpy.frombuffer(c, dtype="int64")
+ for c in edges])
+ edges[:, 1] += N_u
+ g = Graph(directed=False)
+ g.add_vertex(N_u + len(objects))
+ g.vp.is_user = g.new_vp("bool")
+ g.vp.is_user.a[:N_u] = True
+ g.vp.id = g.new_vp("int64_t")
+ g.vp.id.a[:N_u] = list(users.keys())
+ g.vp.id.a[N_u:] = list(objects.keys())
+ del users
+ eprops = [g.new_ep("int64_t") for i in range(6)]
+ g.add_edge_list(edges, eprops=eprops)
+ del edges
+ for k, p in zip(["rating", "status", "time", "last_modified", "type",
+ "vertical_id"], eprops):
+ g.ep[k] = p
+ # Authors and subjects of the articles: CONTENT_ID|AUTHOR_ID|SUBJECT_ID
+ g.vp.author_id = g.new_vp("int64_t", val=-1)
+ g.vp.subject_id = g.new_vp("int64_t", val=-1)
+ with open_upstream_file(name, fnames[1], "r") as f:
+ for line in f:
+ # (the subject is empty for some articles)
+ obj, author, subject = (int(x) if x.strip() else -1
+ for x in line.split("|"))
+ o = objects.get(obj)
+ if o is None:
+ continue
+ g.vp.author_id.a[N_u + o] = author
+ g.vp.subject_id.a[N_u + o] = subject
+ return g
+
+def parse_trust(name, fname):
+ # Tab-separated columns MY_ID, OTHER_ID, VALUE, CREATION
+ users = {}
+ edges = []
+ with open_upstream_file(name, fname, "r") as f:
+ for n, line in enumerate(f):
+ if _check_rows is not None and n >= _check_rows:
+ break
+ s, t, v, d = line.rstrip("\n").split("\t")
+ assert v in ("1", "-1")
+ edges.append((users.setdefault(int(s), len(users)),
+ users.setdefault(int(t), len(users)),
+ int(v), parse_date(d)))
+ g = Graph(directed=True)
+ g.add_vertex(len(users))
+ g.vp.id = g.new_vp("int64_t")
+ g.vp.id.a = list(users.keys())
+ g.ep.sign = g.new_ep("int")
+ g.ep.time = g.new_ep("int64_t")
+ g.add_edge_list(edges, eprops=[g.ep.sign, g.ep.time])
+ return g
+
@cache_network()
@coerce_props()
@annotate()
@@ -41,9 +167,8 @@ 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)
+ if alt == "ratings":
+ g = parse_ratings(name, fnames)
+ else:
+ g = parse_trust(name, fnames)
yield alt, g
Update copyright information 73a4f0d
diff --git a/entries/epinions/__init__.py b/entries/epinions/__init__.py
index df4c9e2..ff78aa2 100644
--- a/entries/epinions/__init__.py
+++ b/entries/epinions/__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/epinions/__init__.py b/entries/epinions/__init__.py
index 865626e..df4c9e2 100644
--- a/entries/epinions/__init__.py
+++ b/entries/epinions/__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/epinions/__init__.py b/entries/epinions/__init__.py
index dbcefa4..865626e 100644
--- a/entries/epinions/__init__.py
+++ b/entries/epinions/__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/epinions/__init__.py b/entries/epinions/__init__.py
index f5b4638..dbcefa4 100644
--- a/entries/epinions/__init__.py
+++ b/entries/epinions/__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/epinions/__init__.py b/entries/epinions/__init__.py
index d054f2a..f5b4638 100644
--- a/entries/epinions/__init__.py
+++ b/entries/epinions/__init__.py
@@ -26,7 +26,6 @@ url = 'http://konect.cc/networks/epinions-rating'
citation = [('P. Massa and P Avesani. "Controversial users demand local trust metrics: An experimental study on epinions. com community." Proc. of the Internat. Conf. on AI (AAAI 2005).', 'http://www.aaai.org/Papers/AAAI/2005/AAAI05-020.pdf')]
icon_hash = '5818e7ac8cf714f319c3eae6'
upstream_prefix = 'http://konect.cc/files'
-orphan = True
files = [('download.tsv.epinions-rating.tar.bz2', None, 'konect')]
def fetch_upstream(force=False):
Add support for 'orphan' datasets and tag konect entries e330b80
diff --git a/entries/epinions/__init__.py b/entries/epinions/__init__.py
index f5b4638..d054f2a 100644
--- a/entries/epinions/__init__.py
+++ b/entries/epinions/__init__.py
@@ -26,6 +26,7 @@ url = 'http://konect.cc/networks/epinions-rating'
citation = [('P. Massa and P Avesani. "Controversial users demand local trust metrics: An experimental study on epinions. com community." Proc. of the Internat. Conf. on AI (AAAI 2005).', 'http://www.aaai.org/Papers/AAAI/2005/AAAI05-020.pdf')]
icon_hash = '5818e7ac8cf714f319c3eae6'
upstream_prefix = 'http://konect.cc/files'
+orphan = True
files = [('download.tsv.epinions-rating.tar.bz2', None, 'konect')]
def fetch_upstream(force=False):
Change license from GPLv3 to AGPLv3 d754be5
diff --git a/entries/epinions/__init__.py b/entries/epinions/__init__.py
index 0386db8..f5b4638 100644
--- a/entries/epinions/__init__.py
+++ b/entries/epinions/__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/epinions/__init__.py b/entries/epinions/__init__.py
index 245080d..0386db8 100644
--- a/entries/epinions/__init__.py
+++ b/entries/epinions/__init__.py
@@ -19,7 +19,8 @@
from .. import *
title = "Epinions product ratings (2005)"
-description = "A bipartite network of users and the products they rated on the website Epinions.com. A user connects to all products on which that user entered a rating. Edge weight represents the rating score, and edges are timestamped."
+description = """A bipartite network of users and the products they rated on the website Epinions.com. A user connects to all products on which that user entered a rating. Edge weight represents the rating score, and edges are timestamped.[^icon]
+[^icon]: Description obtained from the [ICON](https://icon.colorado.edu) project."""
tags = ['Economic', 'Preferences', 'Timestamps', 'Weighted']
url = 'http://konect.cc/networks/epinions-rating'
citation = [('P. Massa and P Avesani. "Controversial users demand local trust metrics: An experimental study on epinions. com community." Proc. of the Internat. Conf. on AI (AAAI 2005).', 'http://www.aaai.org/Papers/AAAI/2005/AAAI05-020.pdf')]
Initial commit cc85872
diff --git a/entries/epinions/__init__.py b/entries/epinions/__init__.py
new file mode 100644
index 0000000..245080d
--- /dev/null
+++ b/entries/epinions/__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 = "Epinions product ratings (2005)"
+description = "A bipartite network of users and the products they rated on the website Epinions.com. A user connects to all products on which that user entered a rating. Edge weight represents the rating score, and edges are timestamped."
+tags = ['Economic', 'Preferences', 'Timestamps', 'Weighted']
+url = 'http://konect.cc/networks/epinions-rating'
+citation = [('P. Massa and P Avesani. "Controversial users demand local trust metrics: An experimental study on epinions. com community." Proc. of the Internat. Conf. on AI (AAAI 2005).', 'http://www.aaai.org/Papers/AAAI/2005/AAAI05-020.pdf')]
+icon_hash = '5818e7ac8cf714f319c3eae6'
+upstream_prefix = 'http://konect.cc/files'
+files = [('download.tsv.epinions-rating.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