History of escorts
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] Fix parse bugs and improve descriptions and metadata 6bb6851
- parse fixes from the review of the descriptions, e.g. us_patents (directed), celegans_2019 (synapse direction), ecoli_transcription and yeast_transcription (regulator to target), bitcoin (direction, phantom node), ego_social (Google+ features and circles), scotus_majority, arxiv_authors and social_location (as in SNAP), caida_as, dnc, dom, mist, reuters and bibsonomy (names on the right nodes), uci_zoo - every description now states explicitly what the nodes and edges represent; corrected titles, years, tags, citations and licences - the "Hypergraph" tag is removed; very large entries are marked `huge = True` (see --skip-huge) - ICON ids of partial duplicates added (hiv_transmission, congress_bills, openflights, dutch_school)
diff --git a/entries/escorts/__init__.py b/entries/escorts/__init__.py
index f34f9de..aed2b27 100644
--- a/entries/escorts/__init__.py
+++ b/entries/escorts/__init__.py
@@ -20,8 +20,12 @@ from .. import *
import csv
title = "Brazilian prostitution network (2010)"
-description = """A bipartite network of escort and individuals who buy sex from them in Brazil, extracted from a Brazilian online community for such ratings. Edges represent a purchase of sexual intercourse with an escort, and the edge weight gives the buyer's rating of the escort: -1 (bad), 0 (neutral), or +1 (good). Other edge attributes are available. Edges are timestamped.[^icon]
-[^icon]: Description obtained from the [ICON](https://icon.colorado.edu) project."""
+description = """A bipartite network of sex buyers and escorts (sex sellers) in Brazil, compiled by L. E. C. Rocha, F. Liljeros and P. Holme from a Brazilian online community where sex buyers post reviews of their encounters with escorts. The data cover the forum's activity from its start in September 2002 to October 2008. Nodes are 10,106 buyers (all male) and 6,624 escorts (all female), and an undirected edge connects a buyer to an escort for each post in which the buyer reports a sexual encounter with her; repeated encounters result in parallel edges. Edges are timestamped by the date of the post.
+
+The network has the following properties:
+
+- Nodes: `is_male`, whether the node is a buyer (male) or an escort (female).
+- Edges: `time`, the date of the post, in days since the beginning of the data; `rating`, the grade given by the buyer to the escort (-1: bad, 0: neutral, +1: good); `anal`, `oral` and `kiss`, answers reported in the post to the questions "anal sex with/without condom?", "oral sex with condom?" and "mouth kiss?", respectively (+1: yes, -1: no, 0: information not available)."""
tags = ['Social', 'Public Health', 'Weighted', 'Timestamps']
url = 'https://doi.org/10.1371/journal.pcbi.1001109'
citation = [('L. Rocha, F. Liljeros, & P. Holme. "Simulated epidemics in an empirical spatiotemporal network of 50,185 sexual contacts." PLoS Comput Biol, 7(3). (2011).', 'https://doi.org/10.1371/journal.pcbi.1001109')]
@@ -58,7 +62,8 @@ def parse(alts=None):
g.ep[p] = g.new_ep("int")
g.add_edge_list(edges(), hashed=False,
eprops=[g.ep[p] for p in eprops])
- g.vp.male = g.new_vp("bool")
- g.vp.male.a = g.degree_property_map("out").a > 0
+ # columns: female (escort), male (buyer), ...
+ g.vp.is_male = g.new_vp("bool")
+ g.vp.is_male.a = g.degree_property_map("in").a > 0
g.set_directed(False)
yield alt, g
Update copyright information 73a4f0d
diff --git a/entries/escorts/__init__.py b/entries/escorts/__init__.py
index 88361fe..f34f9de 100644
--- a/entries/escorts/__init__.py
+++ b/entries/escorts/__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/escorts/__init__.py b/entries/escorts/__init__.py
index adcc619..88361fe 100644
--- a/entries/escorts/__init__.py
+++ b/entries/escorts/__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/escorts/__init__.py b/entries/escorts/__init__.py
index eac4a13..adcc619 100644
--- a/entries/escorts/__init__.py
+++ b/entries/escorts/__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/escorts/__init__.py b/entries/escorts/__init__.py
index e653c72..eac4a13 100644
--- a/entries/escorts/__init__.py
+++ b/entries/escorts/__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
Update citations to use DOIs e878874
diff --git a/entries/escorts/__init__.py b/entries/escorts/__init__.py
index 2ac940b..e653c72 100644
--- a/entries/escorts/__init__.py
+++ b/entries/escorts/__init__.py
@@ -24,7 +24,7 @@ description = """A bipartite network of escort and individuals who buy sex from
[^icon]: Description obtained from the [ICON](https://icon.colorado.edu) project."""
tags = ['Social', 'Public Health', 'Weighted', 'Timestamps']
url = 'https://doi.org/10.1371/journal.pcbi.1001109'
-citation = [('L. Rocha, F. Liljeros, & P. Holme. "Simulated epidemics in an empirical spatiotemporal network of 50,185 sexual contacts." PLoS Comput Biol, 7(3). (2011).', 'http://journals.plos.org/ploscompbiol/article?id=10.1371/journal.pcbi.1001109')]
+citation = [('L. Rocha, F. Liljeros, & P. Holme. "Simulated epidemics in an empirical spatiotemporal network of 50,185 sexual contacts." PLoS Comput Biol, 7(3). (2011).', 'https://doi.org/10.1371/journal.pcbi.1001109')]
icon_hash = '5832214b8cf714f319c427a0'
upstream_prefix = 'https://doi.org/10.1371'
files = [('journal.pcbi.1001109.s001', None, 'csv')]
Change license from GPLv3 to AGPLv3 d754be5
diff --git a/entries/escorts/__init__.py b/entries/escorts/__init__.py
index 7bd41bf..2ac940b 100644
--- a/entries/escorts/__init__.py
+++ b/entries/escorts/__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 *
import csv
escorts: extract from upstream instead of konect 2f8cde8
diff --git a/entries/escorts/__init__.py b/entries/escorts/__init__.py
index 8cd849e..7bd41bf 100644
--- a/entries/escorts/__init__.py
+++ b/entries/escorts/__init__.py
@@ -17,16 +17,17 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from .. import *
+import csv
title = "Brazilian prostitution network (2010)"
description = """A bipartite network of escort and individuals who buy sex from them in Brazil, extracted from a Brazilian online community for such ratings. Edges represent a purchase of sexual intercourse with an escort, and the edge weight gives the buyer's rating of the escort: -1 (bad), 0 (neutral), or +1 (good). Other edge attributes are available. Edges are timestamped.[^icon]
[^icon]: Description obtained from the [ICON](https://icon.colorado.edu) project."""
tags = ['Social', 'Public Health', 'Weighted', 'Timestamps']
-url = 'http://konect.cc/networks/escorts'
+url = 'https://doi.org/10.1371/journal.pcbi.1001109'
citation = [('L. Rocha, F. Liljeros, & P. Holme. "Simulated epidemics in an empirical spatiotemporal network of 50,185 sexual contacts." PLoS Comput Biol, 7(3). (2011).', 'http://journals.plos.org/ploscompbiol/article?id=10.1371/journal.pcbi.1001109')]
icon_hash = '5832214b8cf714f319c427a0'
-upstream_prefix = 'http://konect.cc/files'
-files = [('download.tsv.escorts.tar.bz2', None, 'konect')]
+upstream_prefix = 'https://doi.org/10.1371'
+files = [('journal.pcbi.1001109.s001', None, 'csv')]
def fetch_upstream(force=False):
return fetch_upstream_files(__name__.split(".")[-1], upstream_prefix, files,
@@ -44,6 +45,20 @@ def parse(alts=None):
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)
+ fs = [stack.enter_context(open_upstream_file(name, fn, "r")) for fn in fnames]
+ g = Graph(directed=True)
+ reader = csv.reader(fs[0], delimiter=";")
+ def edges():
+ for row in reader:
+ if len(row) == 1:
+ continue
+ yield [int(x) for x in row]
+ eprops = ["time", "rating", "anal", "oral", "kiss"]
+ for p in eprops:
+ g.ep[p] = g.new_ep("int")
+ g.add_edge_list(edges(), hashed=False,
+ eprops=[g.ep[p] for p in eprops])
+ g.vp.male = g.new_vp("bool")
+ g.vp.male.a = g.degree_property_map("out").a > 0
+ g.set_directed(False)
yield alt, g
Add explicit attribution to descriptions obtained from ICON 1645314
diff --git a/entries/escorts/__init__.py b/entries/escorts/__init__.py
index 3a9a69f..8cd849e 100644
--- a/entries/escorts/__init__.py
+++ b/entries/escorts/__init__.py
@@ -19,7 +19,8 @@
from .. import *
title = "Brazilian prostitution network (2010)"
-description = "A bipartite network of escort and individuals who buy sex from them in Brazil, extracted from a Brazilian online community for such ratings. Edges represent a purchase of sexual intercourse with an escort, and the edge weight gives the buyer's rating of the escort: -1 (bad), 0 (neutral), or +1 (good). Other edge attributes are available. Edges are timestamped."
+description = """A bipartite network of escort and individuals who buy sex from them in Brazil, extracted from a Brazilian online community for such ratings. Edges represent a purchase of sexual intercourse with an escort, and the edge weight gives the buyer's rating of the escort: -1 (bad), 0 (neutral), or +1 (good). Other edge attributes are available. Edges are timestamped.[^icon]
+[^icon]: Description obtained from the [ICON](https://icon.colorado.edu) project."""
tags = ['Social', 'Public Health', 'Weighted', 'Timestamps']
url = 'http://konect.cc/networks/escorts'
citation = [('L. Rocha, F. Liljeros, & P. Holme. "Simulated epidemics in an empirical spatiotemporal network of 50,185 sexual contacts." PLoS Comput Biol, 7(3). (2011).', 'http://journals.plos.org/ploscompbiol/article?id=10.1371/journal.pcbi.1001109')]
Initial commit cc85872
diff --git a/entries/escorts/__init__.py b/entries/escorts/__init__.py
new file mode 100644
index 0000000..3a9a69f
--- /dev/null
+++ b/entries/escorts/__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 = "Brazilian prostitution network (2010)"
+description = "A bipartite network of escort and individuals who buy sex from them in Brazil, extracted from a Brazilian online community for such ratings. Edges represent a purchase of sexual intercourse with an escort, and the edge weight gives the buyer's rating of the escort: -1 (bad), 0 (neutral), or +1 (good). Other edge attributes are available. Edges are timestamped."
+tags = ['Social', 'Public Health', 'Weighted', 'Timestamps']
+url = 'http://konect.cc/networks/escorts'
+citation = [('L. Rocha, F. Liljeros, & P. Holme. "Simulated epidemics in an empirical spatiotemporal network of 50,185 sexual contacts." PLoS Comput Biol, 7(3). (2011).', 'http://journals.plos.org/ploscompbiol/article?id=10.1371/journal.pcbi.1001109')]
+icon_hash = '5832214b8cf714f319c427a0'
+upstream_prefix = 'http://konect.cc/files'
+files = [('download.tsv.escorts.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