logo Netzschleuder network catalog, repository, and centrifuge

History of eu_copatenting

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 by Tiago de Paula Peixoto 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/eu_copatenting/__init__.py b/entries/eu_copatenting/__init__.py
index f690f97..2349c2f 100644
--- a/entries/eu_copatenting/__init__.py
+++ b/entries/eu_copatenting/__init__.py
@@ -27,7 +27,7 @@ Vertex properties: `is_patent`, which marks the patents (the remaining nodes are
 tags = ['Economic', 'Production', 'Unweighted', 'Metadata']
 url = 'https://github.com/dvasques83/co-patenting'
 citation = [('D. Vasques Filho and D. R. J. O\'Neale, "The role of bipartite structure in R&D collaboration networks." Journal of Complex Networks 8(4), cnaa016 (2020).', 'https://doi.org/10.1093/comnet/cnaa016')]
-icon_hash = '5fa1dbb0a21d662d5acf893a'
+date_added = '2026-10-25'
 upstream_license = None
 upstream_prefix = 'https://raw.githubusercontent.com/dvasques83/co-patenting/master'
 files = [('institution_patent_edgelist.zip:institution_patent_edgelist.csv', None, None)]
[entries] Remove unneeded code from the entries by Tiago de Paula Peixoto 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/eu_copatenting/__init__.py b/entries/eu_copatenting/__init__.py
index 67f62c5..f690f97 100644
--- a/entries/eu_copatenting/__init__.py
+++ b/entries/eu_copatenting/__init__.py
@@ -18,7 +18,7 @@
 
 
 from .. import *
-import csv, io
+import csv
 
 title = "European patents and applicant institutions (1978-2015)"
 description = """A bipartite network of institutions and the patents they filed, built by D. Vasques Filho and D. R. J. O'Neale from about 2.8 million patents recorded by the European Patent Office (EPO), to study the co-patenting (R&D collaboration) network among institutions, which is its one-mode projection onto the institutions. Nodes are institutions (companies, universities, research institutes, and other patent applicants) and patents, and an edge connects an institution to a patent filed by it; patents filed jointly by several institutions thus connect them. The network has 313,767 institutions, 2,784,313 patents and 2,970,404 edges (there are no multiple edges). Most patents have a single applicant institution.
@@ -40,7 +40,6 @@ def fetch_upstream(force=False):
 @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] New entry: eu_copatenting by Tiago de Paula Peixoto 367f9cd
diff --git a/entries/eu_copatenting/__init__.py b/entries/eu_copatenting/__init__.py
new file mode 100644
index 0000000..67f62c5
--- /dev/null
+++ b/entries/eu_copatenting/__init__.py
@@ -0,0 +1,76 @@
+#! /usr/bin/env python
+# -*- coding: utf-8 -*-
+#
+# 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
+# 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 Affero General Public License for more
+# details.
+#
+# 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, io
+
+title = "European patents and applicant institutions (1978-2015)"
+description = """A bipartite network of institutions and the patents they filed, built by D. Vasques Filho and D. R. J. O'Neale from about 2.8 million patents recorded by the European Patent Office (EPO), to study the co-patenting (R&D collaboration) network among institutions, which is its one-mode projection onto the institutions. Nodes are institutions (companies, universities, research institutes, and other patent applicants) and patents, and an edge connects an institution to a patent filed by it; patents filed jointly by several institutions thus connect them. The network has 313,767 institutions, 2,784,313 patents and 2,970,404 edges (there are no multiple edges). Most patents have a single applicant institution.
+
+Vertex properties: `is_patent`, which marks the patents (the remaining nodes are institutions); `institution_id`, the numeric identifier of the institution in the data (-1 for patents); `country`, the two-letter country code of the institution (empty for patents); `patent_number`, the EPO publication number of the patent (empty for institutions); `year`, the year of the patent, between 1978 and 2015 (-1 for institutions)."""
+tags = ['Economic', 'Production', 'Unweighted', 'Metadata']
+url = 'https://github.com/dvasques83/co-patenting'
+citation = [('D. Vasques Filho and D. R. J. O\'Neale, "The role of bipartite structure in R&D collaboration networks." Journal of Complex Networks 8(4), cnaa016 (2020).', 'https://doi.org/10.1093/comnet/cnaa016')]
+icon_hash = '5fa1dbb0a21d662d5acf893a'
+upstream_license = None
+upstream_prefix = 'https://raw.githubusercontent.com/dvasques83/co-patenting/master'
+files = [('institution_patent_edgelist.zip:institution_patent_edgelist.csv', None, None)]
+
+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
+        insts = {}
+        pats = {}
+        edges = []
+        with open_upstream_file(name, fnames, "r") as f:
+            reader = csv.reader(f)
+            header = next(reader)
+            assert header == ["institution_id", "patent_number", "inst_country", "pat_year"]
+            for inst, pat, country, year in reader:
+                i = insts.setdefault(inst, (len(insts), country))[0]
+                p = pats.setdefault(pat, (len(pats), year))[0]
+                edges.append((i, p))
+        NI = len(insts)
+        g = Graph(directed=False)
+        g.add_vertex(NI + len(pats))
+        edges = numpy.array(edges, dtype="int64")
+        edges[:, 1] += NI
+        g.add_edge_list(edges)
+        g.vp.is_patent = g.new_vp("bool")
+        g.vp.is_patent.a[NI:] = True
+        g.vp.institution_id = g.new_vp("int64_t")
+        g.vp.institution_id.a = -1
+        g.vp.institution_id.a[:NI] = [int(x) for x in insts.keys()]
+        g.vp.country = g.new_vp("string", vals=[c for i, c in insts.values()] +
+                                [""] * len(pats))
+        g.vp.patent_number = g.new_vp("string", vals=[""] * NI + list(pats.keys()))
+        g.vp.year = g.new_vp("int")
+        g.vp.year.a = -1
+        g.vp.year.a[NI:] = [int(y) for i, y in pats.values()]
+        yield alt, g