ricgraph 2.10__tar.gz → 2.11__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ricgraph
3
- Version: 2.10
3
+ Version: 2.11
4
4
  Summary: Ricgraph - Research in context graph
5
5
  Author: Rik D.T. Janssen
6
6
  Project-URL: Website, https://www.ricgraph.eu
@@ -122,7 +122,7 @@ The items surrounded by the red line are the solution to this use case.
122
122
 
123
123
  <img src="https://raw.githubusercontent.com/UtrechtUniversity/ricgraph/main/docs/images/researcher-use-case.jpg" alt="Ricgraph use case for a researcher." width="35%">
124
124
 
125
- ### Main contributions of Ricgraph
125
+ ## Main contributions of Ricgraph
126
126
 
127
127
  * Ricgraph can store many types of items in a single graph.
128
128
  * Ricgraph harvests multiple source systems into a single graph.
@@ -130,7 +130,7 @@ The items surrounded by the red line are the solution to this use case.
130
130
  * Ricgraph facilitates reasoning about items because it infers new relations between items.
131
131
  * Ricgraph can be tailored for an application area.
132
132
 
133
- ### Read more about Ricgraph
133
+ ## Read more about Ricgraph
134
134
 
135
135
  For a gentle introduction in Ricgraph, read the reference publication:
136
136
  Rik D.T. Janssen (2024). Ricgraph: A flexible and extensible graph to explore research in
@@ -144,3 +144,11 @@ To use Ricgraph, installing the [Ricgraph package from PyPI](https://pypi.org/pr
144
144
  is not sufficient. Please read the
145
145
  installation instructions in the Ricgraph GitHub repository.
146
146
 
147
+ ## Contact
148
+
149
+ Ricgraph has been created and is being maintained by
150
+ Rik D.T. Janssen from Utrecht University in the Netherlands.
151
+ You can find contact details at
152
+ [his Utrecht University employee page](https://www.uu.nl/staff/DTJanssen).
153
+ He also has an ORCID profile on
154
+ [ORCID 0000-0001-9510-0802](https://orcid.org/0000-0001-9510-0802).
@@ -97,7 +97,7 @@ The items surrounded by the red line are the solution to this use case.
97
97
 
98
98
  <img src="https://raw.githubusercontent.com/UtrechtUniversity/ricgraph/main/docs/images/researcher-use-case.jpg" alt="Ricgraph use case for a researcher." width="35%">
99
99
 
100
- ### Main contributions of Ricgraph
100
+ ## Main contributions of Ricgraph
101
101
 
102
102
  * Ricgraph can store many types of items in a single graph.
103
103
  * Ricgraph harvests multiple source systems into a single graph.
@@ -105,7 +105,7 @@ The items surrounded by the red line are the solution to this use case.
105
105
  * Ricgraph facilitates reasoning about items because it infers new relations between items.
106
106
  * Ricgraph can be tailored for an application area.
107
107
 
108
- ### Read more about Ricgraph
108
+ ## Read more about Ricgraph
109
109
 
110
110
  For a gentle introduction in Ricgraph, read the reference publication:
111
111
  Rik D.T. Janssen (2024). Ricgraph: A flexible and extensible graph to explore research in
@@ -119,3 +119,11 @@ To use Ricgraph, installing the [Ricgraph package from PyPI](https://pypi.org/pr
119
119
  is not sufficient. Please read the
120
120
  installation instructions in the Ricgraph GitHub repository.
121
121
 
122
+ ## Contact
123
+
124
+ Ricgraph has been created and is being maintained by
125
+ Rik D.T. Janssen from Utrecht University in the Netherlands.
126
+ You can find contact details at
127
+ [his Utrecht University employee page](https://www.uu.nl/staff/DTJanssen).
128
+ He also has an ORCID profile on
129
+ [ORCID 0000-0001-9510-0802](https://orcid.org/0000-0001-9510-0802).
@@ -22,6 +22,11 @@ We use color=#4c1 (green), that color is used by the 'repo status' badge.
22
22
  Documentation about the Podman badges can be found here: https://github.com/eggplants/ghcr-badge.
23
23
  --->
24
24
 
25
+ > Read the [Tutorial](docs/ricgraph_tutorial.md#tutorial-ricgraph---research-in-context-graph).
26
+ > Go to the [Documentation website](https://docs.ricgraph.eu).
27
+ > Consult the [Table of contents](docs/ricgraph_toc_documentation.md#table-of-contents-ricgraph-documentation),
28
+ > or the [Index](docs/ricgraph_index_documentation.md#index-ricgraph-documentation).
29
+
25
30
  <img alt="Ricgraph logo" src="docs/images/ricgraph_logo.png" width="30%">
26
31
 
27
32
  <!---
@@ -34,12 +39,6 @@ to remove everything up and including these lines. Do not modify the text in it.
34
39
 
35
40
  # Ricgraph - Research in context graph
36
41
 
37
- [Read the Tutorial Ricgraph](docs/ricgraph_tutorial.md#tutorial-ricgraph---research-in-context-graph).
38
- Go to the [documentation website for Ricgraph](https://docs.ricgraph.eu).
39
-
40
- [Table of contents of Ricgraph documentation](docs/ricgraph_toc_documentation.md#table-of-contents-ricgraph-documentation) and
41
- [Index of Ricgraph documentation](docs/ricgraph_index_documentation.md#index-ricgraph-documentation).
42
-
43
42
  ## What is Ricgraph?
44
43
 
45
44
  Ricgraph, also known as Research in context graph, enables the exploration of researchers,
@@ -54,8 +53,36 @@ relations that are not present in any of the separate source systems.
54
53
  It is flexible and extensible, and can be
55
54
  adapted to new application areas.
56
55
 
57
- Throughout this documentation, we illustrate how Ricgraph works by applying
58
- it to the application area research information.
56
+ Currently, there are people working on the following extensions for Ricgraph:
57
+
58
+ * [BackToPure](https://github.com/UtrechtUniversity/backtopure)
59
+ is a tool designed to enhance an organization's
60
+ [Research Information System Pure](https://www.elsevier.com/solutions/pure)
61
+ by enriching its content. BackToPure can identify items
62
+ (such as publications, data sets or software)
63
+ that exist in other external sources but are missing from the organization's Pure,
64
+ and then insert (enrich) those items into Pure.
65
+ The result is a more complete overview of research at that organization.
66
+ Status: experimental stage (beta).
67
+ * A chatbot that allows you to "talk" to Ricgraph. You can formulate questions in
68
+ plain English, such as "Please give me the research results of the Geosciences
69
+ faculty of Utrecht University?"
70
+ or "With what organizations does that faculty collaborate?".
71
+ It uses a local Large Language Model.
72
+ Status: planning stage (pre-alpha).
73
+ * A project that uses
74
+ [AI and Large Language Models to cluster and visualize large amounts of research
75
+ information](https://docs.ricgraph.eu/docs/ricgraph_pubs_pres_news_use_ment.html#ricgraph-projects-with-students).
76
+ It assigns *topics* to publications,
77
+ data sets, and software. By selecting a number of topics, research results are
78
+ grouped, and possibly experts on these topics can be found.
79
+ Status: planning stage (pre-alpha).
80
+ * A tool that helps Pure administrators to clean up "external organizations" in Pure.
81
+ Status: planning stage (pre-alpha).
82
+
83
+ Throughout this documentation, we illustrate how Ricgraph works by applying
84
+ it to the application area research information.
85
+
59
86
 
60
87
  ## Motivation
61
88
 
@@ -120,7 +147,7 @@ The items surrounded by the red line are the solution to this use case.
120
147
  <img src="docs/images/researcher-use-case.jpg" alt="Ricgraph use case for a researcher." width="35%">
121
148
 
122
149
 
123
- ### Main contributions of Ricgraph
150
+ ## Main contributions of Ricgraph
124
151
 
125
152
  * Ricgraph can store many types of items in a single graph.
126
153
  * Ricgraph harvests multiple source systems into a single graph.
@@ -128,65 +155,6 @@ The items surrounded by the red line are the solution to this use case.
128
155
  * Ricgraph facilitates reasoning about items because it infers new relations between items.
129
156
  * Ricgraph can be tailored for an application area.
130
157
 
131
- ### How to use Ricgraph (very short)
132
-
133
- * [Install and configure Ricgraph](docs/ricgraph_install_configure.md#install-and-configure-ricgraph).
134
- * Start harvesting data, see [Ricgraph harvest scripts](docs/ricgraph_harvest_scripts.md#ricgraph-harvest-scripts).
135
- * Use [Ricgraph Explorer](docs/ricgraph_explorer.md#ricgraph-explorer),
136
- the exploration tool for Ricgraph.
137
- * Use the [Ricgraph REST API](docs/ricgraph_restapi.md#ricgraph-rest-api),
138
- the REST API for Ricgraph.
139
- * Optional: modify code to fit Ricgraph to your specific use case.
140
-
141
- For more details, read the remainder of this documentation.
142
-
143
- ### Read more about Ricgraph
144
-
145
- For a gentle introduction in Ricgraph, read the reference publication:
146
- Rik D.T. Janssen (2024). Ricgraph: A flexible and extensible graph to explore research in
147
- context from various systems. *SoftwareX*, 26(101736).
148
- [https://doi.org/10.1016/j.softx.2024.101736](https://doi.org/10.1016/j.softx.2024.101736).
149
-
150
- For a further introduction, you might want to read these two presentations:
151
-
152
- * A general presentation about Ricgraph, presenting Ricgraph in a visual manner:
153
- [https://doi.org/10.5281/zenodo.12634234](https://doi.org/10.5281/zenodo.12634234).
154
- * A presentation explaining how to enrich
155
- the [Research Information System Pure](https://www.elsevier.com/solutions/pure)
156
- (and other source systems) using Ricgraph
157
- and [BackToPure](https://github.com/UtrechtUniversity/BackToPure):
158
- [https://doi.org/10.5281/zenodo.12634658](https://doi.org/10.5281/zenodo.12634658).
159
- This presentation explains that after harvesting several Pure systems
160
- (from different institutions) and other source systems,
161
- such as [OpenAlex](https://openalex.org),
162
- one can enrich its own Pure _A_ by using information in other source
163
- systems, not present in one's own Pure _A_.
164
-
165
- To learn more about Ricgraph,
166
- [read why Ricgraph has been developed](#why-ricgraph).
167
- This is followed by
168
- [Ricgraph in bullet points](#ricgraph-in-bullet-points). There is also
169
- [a section with next steps you might want to take](#next-steps),
170
- including [further information about
171
- Ricgraph](#further-information-about-ricgraph),
172
- an [explanation how to install Ricgraph and harvest
173
- data](#steps-to-take-if-you-would-like-to-install-ricgraph-and-harvest-data),
174
- an [explanation how to use Ricgraph](#steps-to-take-if-you-would-like-to-use-ricgraph),
175
- and [information about extending Ricgraph](#read-this-in-case-you-would-like-to-extend-ricgraph).
176
- Of course there are
177
- [videos we have made to demonstrate Ricgraph](docs/ricgraph_example_use_videos.md#ricgraph-videos),
178
- and there is an overview of the
179
- [publications](docs/ricgraph_pubs_pres_news_use_ment.md#ricgraph-publications),
180
- [presentations](docs/ricgraph_pubs_pres_news_use_ment.md#ricgraph-presentations),
181
- [newsletters](docs/ricgraph_pubs_pres_news_use_ment.md#ricgraph-newsletters)
182
- (to subscribe, go to [Ricgraph Contact](#contact)),
183
- [use](docs/ricgraph_pubs_pres_news_use_ment.md#ricgraph-use), and
184
- [mentions](docs/ricgraph_pubs_pres_news_use_ment.md#ricgraph-mentions)
185
- of Ricgraph.
186
-
187
- You can also use the [Table of contents of Ricgraph documentation](docs/ricgraph_toc_documentation.md#table-of-contents-ricgraph-documentation)
188
- or the [Index of Ricgraph documentation](docs/ricgraph_index_documentation.md#index-ricgraph-documentation).
189
-
190
158
  ## Why Ricgraph?
191
159
 
192
160
  Ricgraph can answer questions like:
@@ -225,6 +193,9 @@ exploration tool for Ricgraph:
225
193
  clicking on a number in one of these
226
194
  two tables to find the nodes corresponding to that number.
227
195
 
196
+ If you would like to get this information programmatically, you can use
197
+ the [Ricgraph REST API](https://docs.ricgraph.eu/docs/ricgraph_restapi.html#ricgraph-rest-api).
198
+
228
199
  With Ricgraph, you can get metadata from objects from any source system you’d like.
229
200
  You run the harvest script for that
230
201
  system, and data will be imported in Ricgraph and will be
@@ -232,19 +203,18 @@ combined automatically with data which is already there.
232
203
  Ricgraph provides harvest scripts for the systems mentioned above.
233
204
  Scripts for other sources can be written easily.
234
205
 
235
- In the remainder of this text, Ricgraph is described in the use case of
236
- showing people, organizations and research outputs in relation to each other
237
- in a university context.
238
-
239
206
  ## Examples
240
207
 
241
- See the figures below for example graphs that show how Ricgraph works.
208
+ See the figures below for example graphs that show how Ricgraph works. In this section, we use the following
209
+ symbols and colors.
210
+
211
+ | symbols for type of object | colors for source system |
212
+ |:---------------------------------------------------------------------------------:|:---------------------------------------------------------------------------------------:|
213
+ | <img alt="Symbols for type of object." src="docs/images/symbols.jpg" width="20%"> | <img alt="Colors for source system." src="docs/images/colors-vertical.jpg" width="20%"> |
242
214
 
243
- | one person with several research outputs | symbols for type of object | colors for source system |
244
- |:------------------------------------------------------------------------------------------------------------------------:|:---------------------------------------------------------------------------------:|:---------------------------------------------------------------------------------------:|
245
- | <img alt="One person with several research outputs." src="docs/images/one-person-with-research-outputs.jpg" width="33%"> | <img alt="Symbols for type of object." src="docs/images/symbols.jpg" width="33%"> | <img alt="Colors for source system." src="docs/images/colors-vertical.jpg" width="33%"> |
246
215
 
247
- This figure shows one person *A* using a
216
+ The following figure shows one person with several research outputs.
217
+ It shows one person *A* using a
248
218
  [*person-root* node, a node which "represents" a person](docs/ricgraph_details.md#person-root-node-in-ricgraph)
249
219
  as it is called
250
220
  in Ricgraph.
@@ -260,21 +230,24 @@ and
260
230
  the software package is from the
261
231
  [Research Software Directory](https://research-software-directory.org) (in blue).
262
232
 
233
+ <img alt="One person with several research outputs." src="docs/images/one-person-with-research-outputs.jpg" width="25%">
263
234
 
264
- | several persons with several research outputs | one person with several identifiers and research outputs |
265
- |:----------------------------------------------------------------------------------------------------------------------------------:|:-------------------------------------------------------------------------------------------------------------------------------:|
266
- | <img alt="Several persons with several research outputs." src="docs/images/several-persons-with-research-outputs.jpg" width="40%"> | <img alt="One person with several identifiers and research outputs." src="docs/images/identifiers-and-outputs.jpg" width="50%"> |
267
-
268
- The left part of this figure shows several persons having several research outputs
269
- (the symbols) and
235
+ The following figure shows several persons with several research outputs (the symbols) and
270
236
  how these are related (i.e. which person contributed to which research output).
271
237
  It also shows from which source system these research outputs have originated
272
238
  (using different colors).
273
- The right part shows one person having several identifiers and several research outputs.
239
+
240
+ <img alt="Several persons with several research outputs." src="docs/images/several-persons-with-research-outputs.jpg" width="35%">
241
+
242
+ The following figure shows one person having several identifiers and several research outputs.
274
243
  This person has two different ORCIDs, one ISNI, one SCOPUS_AUTHOR_ID, and two FULL_NAMEs (which differ
275
244
  in spelling). These identifiers have also been obtained from different source systems, as their color indicates.
276
245
 
277
- More examples can be found in [Ricgraph details](docs/ricgraph_details.md#implementation-details).
246
+ <img alt="One person with several identifiers and research outputs." src="docs/images/identifiers-and-outputs.jpg" width="25%">
247
+
248
+ The following figure shows how three persons have contributed to one research output.
249
+
250
+ <img alt="Three persons with one research output." src="docs/images/three-persons-one-research-output.jpg" width="15%">
278
251
 
279
252
  ## Ricgraph in bullet points
280
253
 
@@ -295,14 +268,8 @@ More examples can be found in [Ricgraph details](docs/ricgraph_details.md#implem
295
268
  relation between two objects.
296
269
  * Ricgraph and Ricgraph Explorer are written in Python. You can use two different
297
270
  [graph database backends](https://en.wikipedia.org/wiki/Graph_database):
298
- * [Neo4j](https://neo4j.com) (either Neo4j Desktop or Neo4j Community Edition);
299
- * [Memgraph](https://memgraph.com).
300
- * Metadata of an object are stored as "properties"
301
- in a node, i.e. as information associated with a node.
302
- For example, a node may store two properties, *name = PET* and
303
- *value = cat*. Another node may store *name = FULL_NAME* and *value = John Doe*.
304
- Then the edge between those two nodes means that the person with FULL_NAME John Doe
305
- has a PET which is a cat. Ricgraph can store any number of properties in a node.
271
+ [Neo4j](docs/ricgraph_backend_neo4j.md#ricgraph-with-neo4j-graph-database-backend) and
272
+ [Memgraph](docs/ricgraph_backend_memgraph.md#ricgraph-with-memgraph-graph-database-backend).
306
273
  * The objective of Ricgraph is to get metadata from
307
274
  objects from a source system in a process called "harvesting".
308
275
  That means that e.g. persons and publications
@@ -315,30 +282,19 @@ More examples can be found in [Ricgraph details](docs/ricgraph_details.md#implem
315
282
  the data repository [Yoda](https://www.uu.nl/en/research/yoda),
316
283
  the [Research Software Directory](https://research-software-directory.org), and
317
284
  for the [Utrecht University staff pages](https://www.uu.nl/staff/search).
318
- * Ricgraph can be used as an ID resolver. It can, given an identifier of a person,
285
+ * Ricgraph is an ID resolver. It can, given an identifier of a person,
319
286
  easily find other identifiers of that person. When new identifiers are found when
320
287
  harvesting from new systems,
321
288
  they will be added automatically.
322
- * Ricgraph can check the consistency of information harvested. For example, ORCIDs and ISNIs
323
- are supposed to refer to one person, so every node representing such an identifier should have
324
- only one edge. This can be checked easily.
325
- An example script is included.
326
- * Ricgraph can enrich information in its own graph by using information from other systems.
327
- For example,
328
- if a person has an ORCID, but not a Scopus Author ID,
329
- [OpenAlex](https://openalex.org) can be used
330
- to find the missing Scopus Author ID. An example script is included.
331
289
  * Ricgraph can enrich a source system based on information that is present in one
332
- source system, but not in another source system. See the use case above.
290
+ source system, but not in another source system.
291
+ See the [librarian use case](#use-case-for-a-librarian) above.
333
292
 
334
293
  ## Next steps
335
294
 
336
- [Table of contents of Ricgraph documentation](docs/ricgraph_toc_documentation.md#table-of-contents-ricgraph-documentation) and
337
- [Index of Ricgraph documentation](docs/ricgraph_index_documentation.md#index-ricgraph-documentation).
338
-
339
295
  ### Further information about Ricgraph
340
296
 
341
- * Read the full documentation of Ricgraph on
297
+ * Explore the full documentation of Ricgraph on
342
298
  [https://docs.ricgraph.eu](https://docs.ricgraph.eu).
343
299
  * For a gentle introduction in Ricgraph, read the reference publication:
344
300
  Rik D.T. Janssen (2024). Ricgraph: A flexible and extensible graph to explore research in
@@ -367,10 +323,11 @@ More examples can be found in [Ricgraph details](docs/ricgraph_details.md#implem
367
323
  [use](docs/ricgraph_pubs_pres_news_use_ment.md#ricgraph-use), and
368
324
  [mentions](docs/ricgraph_pubs_pres_news_use_ment.md#ricgraph-mentions)
369
325
  of Ricgraph.
370
- * Look at the [videos we have made to demonstrate Ricgraph](docs/ricgraph_example_use_videos.md#ricgraph-videos).
371
- * Read more about [Ricgraph details](docs/ricgraph_details.md#implementation-details),
372
- such as example graphs, person identifiers and the *person-root* node.
373
- * You might want to [compare Ricgraph to other systems](docs/ricgraph_comparison.md#ricgraph-comparison).
326
+ * The Ricgraph main website is www.ricgraph.eu.
327
+ Alternative sites are www.ricgraph.nl and www.ricgraph.com.
328
+ These are generated using the
329
+ [ricgraph-documentation](https://github.com/UtrechtUniversity/ricgraph-documentation)
330
+ GitHub repository.
374
331
 
375
332
  ### Steps to take if you would like to install Ricgraph and harvest data
376
333
 
@@ -387,28 +344,35 @@ More examples can be found in [Ricgraph details](docs/ricgraph_details.md#implem
387
344
 
388
345
  ### Steps to take if you would like to use Ricgraph
389
346
 
390
- * First, install Ricgraph (see above).
391
347
  * Use [Ricgraph Explorer](docs/ricgraph_explorer.md#ricgraph-explorer),
392
348
  the exploration tool for Ricgraph.
393
349
  * Use the [Ricgraph REST API](docs/ricgraph_restapi.md#ricgraph-rest-api),
394
350
  the REST API for Ricgraph.
395
-
396
- ### Read this in case you would like to extend Ricgraph
397
-
398
- * Start writing scripts, see [Ricgraph script writing](docs/ricgraph_script_writing.md#ricgraph-script-writing).
399
-
400
- ### Ricgraph website
401
- Ricgraph has a main Ricgraph website on www.ricgraph.eu.
402
- Alternative sites are www.ricgraph.nl and www.ricgraph.com.
403
- The sources for this website are on GitHub in repository
404
- [https://github.com/UtrechtUniversity/ricgraph-website](https://github.com/UtrechtUniversity/ricgraph-website).
351
+ * You can also [write your own harvest scripts](docs/ricgraph_script_writing.md#ricgraph-script-writing),
352
+ or modify any part of the Ricgraph code.
405
353
 
406
354
  ## Contact
407
- Ricgraph has been created and is being maintained by
408
- [Rik D.T. Janssen from Utrecht University in the Netherlands](https://www.uu.nl/staff/DTJanssen)
409
- [(ORCID 0000-0001-9510-0802)](https://orcid.org/0000-0001-9510-0802).
355
+ Ricgraph has been created and is being maintained by
356
+ Rik D.T. Janssen from Utrecht University in the Netherlands.
357
+ You can find contact details at
358
+ [his Utrecht University employee page](https://www.uu.nl/staff/DTJanssen).
359
+ He also has an ORCID profile on
360
+ [ORCID 0000-0001-9510-0802](https://orcid.org/0000-0001-9510-0802).
410
361
  You can contact him for presentations, demos and workshops.
411
362
 
363
+ He is also very interested in working together on projects involving Ricgraph.
364
+ Ricgraph is a flexible platform that brings
365
+ together information from multiple systems into a single graph.
366
+ It allows users to analyze this information and explore how it relates
367
+ to other types of information.
368
+ We could work together on use cases applying Ricgraph to
369
+ research information, such as exploring collaborations or
370
+ analyzing how people or organizations contribute to research results.
371
+ We could also explore entirely different domains.
372
+ Any application that involves representing and analyzing
373
+ interconnected information as nodes and relations in a graph,
374
+ regardless of the field, is of interest.
375
+
412
376
  About three to four times a year we send out a
413
377
  newsletter.
414
378
  [Please click here to subscribe to it. Your email program will open with
@@ -418,10 +382,12 @@ We also have a
418
382
  [newsletter archive](docs/ricgraph_pubs_pres_news_use_ment.md#ricgraph-newsletters).
419
383
 
420
384
  If you like Ricgraph, please give it a GitHub Star by clicking on the top right
421
- *Star* button on this page. If you have any suggestions or improvements,
422
- please let me know by creating a GitHub *Issue* at the top left of this page.
385
+ *Star* button on the Ricgraph GitHub page
386
+ [https://github.com/UtrechtUniversity/ricgraph](https://github.com/UtrechtUniversity/ricgraph).
387
+ If you have any suggestions or improvements,
388
+ please let me know by creating a GitHub *Issue* at the top left of that page.
423
389
 
424
390
  <!-- Do not change the lines below. The version number will be
425
391
  modified by script maintenance/update_version.bash -->
426
392
  This README.md file is part of the
427
- documentation for version 2.10 of Ricgraph - Research in context graph.
393
+ documentation for version 2.11 of Ricgraph - Research in context graph.
@@ -7,7 +7,7 @@ packages = ["ricgraph"]
7
7
 
8
8
  [project]
9
9
  name = "ricgraph"
10
- version = "2.10"
10
+ version = "2.11"
11
11
  authors = [
12
12
  { name="Rik D.T. Janssen" },
13
13
  ]
@@ -123,7 +123,7 @@ __package__ = 'Ricgraph'
123
123
  # __version__ should be placed here instead of in __init__.py.
124
124
  # If not here, it cannot be found when executing something like
125
125
  # PYTHONPATH=../ricgraph ../bin/python ricgraph_explorer.py
126
- __version__ = '2.10'
126
+ __version__ = '2.11'
127
127
 
128
128
 
129
129
  # ########################################################################
@@ -153,6 +153,12 @@ nodes_cache_key_element_id = {}
153
153
  # Cache size. 'nodes_cache_key_element_id' will be emptied if it has this number of elements.
154
154
  MAX_NODES_CACHE_KEY_ID = 15000
155
155
 
156
+ # In merge_two_nodes(node_merge_from, node_merge_to), we are constructing a list of
157
+ # all the nodes that are to be merged with node_merge_to, to add to property _history
158
+ # in that node. This value restricts the length of that list (to prevent property
159
+ # values that are too long).
160
+ MAX_NR_HISTORYITEMS_TO_ADD = 100
161
+
156
162
 
157
163
  # These counters are used to count the number of accesses to the
158
164
  # graph database backend.
@@ -683,17 +689,20 @@ def cypher_merge_nodes(node_merge_from_element_id: str,
683
689
  result_transformer_=Result.value,
684
690
  database_=ricgraph_databasename())
685
691
 
686
- # If merge_node_from does not have neighbors, it will not be deleted.
687
- # Do another Cypher query to be sure it is gone.
688
- cypher_delete_node(node_element_id=node_merge_from_element_id)
692
+ if len(nodes) == 0:
693
+ # If merge_node_from does not have neighbors, len(nodes) will be 0.
694
+ # Also, it will not have been deleted. The merge has been done.
695
+ # Do another Cypher query to be sure it is gone.
696
+ cypher_delete_node(node_element_id=node_merge_from_element_id)
697
+ node_merge_to_properties['_history'].append('Merged two nodes of which the merged from did not have neighbors.')
698
+ node = cypher_update_node_properties(node_element_id=node_merge_to_element_id,
699
+ node_properties=node_merge_to_properties)
700
+ return node
689
701
 
690
702
  nr_edges = ricgraph_nr_edges_of_node(node_element_id=node_merge_to_element_id)
691
703
  graphdb_nr_reads += 2 * nr_edges # Approximation: edges are in two directions.
692
704
  graphdb_nr_updates += 2 * nr_edges # Approximation: edges are in two directions.
693
- if len(nodes) == 0:
694
- return None
695
- else:
696
- return nodes[0]
705
+ return nodes[0]
697
706
 
698
707
 
699
708
  def cypher_create_edge_if_not_exists(left_node_element_id: str, right_node_element_id: str) -> None:
@@ -1611,12 +1620,18 @@ def update_node_value(name: str, old_value: str, new_value: str) -> Union[Node,
1611
1620
 
1612
1621
  time_stamp = datetimestamp()
1613
1622
  node = read_node(name=lname, value=loldvalue)
1614
- if node is None:
1623
+ newnode = read_node(name=lname, value=lnewvalue)
1624
+ if node is None and newnode is None:
1615
1625
  # Node we want to change does not exist.
1626
+ print('update_node_value(): Error: both of the nodes do not exist.')
1616
1627
  return None
1617
1628
 
1618
- newnode = read_node(name=lname, value=lnewvalue)
1619
- if newnode is not None:
1629
+ if node is None and newnode is not None:
1630
+ # Node we want to change does not exist,
1631
+ # but newnode does, we don't do anything.
1632
+ return newnode
1633
+
1634
+ if node is not None and newnode is not None:
1620
1635
  # The node we want to change to does already exist.
1621
1636
  # So this happens to be a merge of two nodes.
1622
1637
  merged_node = merge_two_nodes(node_merge_from=node,
@@ -1802,8 +1817,14 @@ def merge_two_nodes(node_merge_from: Node, node_merge_to: Node) -> Union[Node, N
1802
1817
  # Done.
1803
1818
  return node_merge_to
1804
1819
 
1805
- if node_merge_from is None or node_merge_to is None:
1806
- print('merge_two_nodes(): Error: one or both of the nodes is None - cannot be found.')
1820
+ if node_merge_from is not None and node_merge_to is None:
1821
+ print('merge_two_nodes(): Error: it seems that you are trying to move a node')
1822
+ print(' to another node. This is not supported.')
1823
+ print(' You might want to use update_node_value().')
1824
+ return None
1825
+
1826
+ if node_merge_from is None and node_merge_to is None:
1827
+ print('merge_two_nodes(): Error: both of the nodes do not exist.')
1807
1828
  return None
1808
1829
 
1809
1830
  if node_merge_from['name'] != node_merge_to['name'] \
@@ -1836,23 +1857,27 @@ def merge_two_nodes(node_merge_from: Node, node_merge_to: Node) -> Union[Node, N
1836
1857
 
1837
1858
  count += 1
1838
1859
  what_happened = time_stamp + '-' + format(count, '02d') + ': '
1839
- what_happened += 'Start of history of the deleted node.'
1860
+ what_happened += '--- Start of history of the deleted node.'
1840
1861
  node_merge_to_properties['_history'].append(what_happened)
1841
1862
 
1842
1863
  for history in node_merge_from['_history']:
1843
1864
  count += 1
1844
1865
  what_happened = time_stamp + '-' + format(count, '02d') + ': '
1866
+ if count >= MAX_NR_HISTORYITEMS_TO_ADD:
1867
+ what_happened += 'List truncated, too many history lines for _history.'
1868
+ node_merge_to_properties['_history'].append(what_happened)
1869
+ break
1845
1870
  what_happened += history
1846
1871
  node_merge_to_properties['_history'].append(what_happened)
1847
1872
 
1848
1873
  count += 1
1849
1874
  what_happened = time_stamp + '-' + format(count, '02d') + ': '
1850
- what_happened += 'End of history of the deleted node.'
1875
+ what_happened += '--- End of history of the deleted node.'
1851
1876
  node_merge_to_properties['_history'].append(what_happened)
1852
1877
 
1853
1878
  count += 1
1854
1879
  what_happened = time_stamp + '-' + format(count, '02d') + ': '
1855
- what_happened += 'These were the neighbors of the deleted node, '
1880
+ what_happened += '--- These were the neighbors of the deleted node, '
1856
1881
  what_happened += 'now merged with the neighbors of this node:'
1857
1882
  node_merge_to_properties['_history'].append(what_happened)
1858
1883
 
@@ -1866,12 +1891,16 @@ def merge_two_nodes(node_merge_from: Node, node_merge_to: Node) -> Union[Node, N
1866
1891
  for node in neighbornodes:
1867
1892
  count += 1
1868
1893
  what_happened = time_stamp + '-' + format(count, '02d') + ': '
1894
+ if count >= MAX_NR_HISTORYITEMS_TO_ADD:
1895
+ what_happened += 'List truncated, too many history lines for _history.'
1896
+ node_merge_to_properties['_history'].append(what_happened)
1897
+ break
1869
1898
  what_happened += '"' + str(node['_key']) + '" '
1870
1899
  node_merge_to_properties['_history'].append(what_happened)
1871
1900
 
1872
1901
  count += 1
1873
1902
  what_happened = time_stamp + '-' + format(count, '02d') + ': '
1874
- what_happened += 'End of list of neighbors of the deleted node.'
1903
+ what_happened += '--- End of list of neighbors of the deleted node.'
1875
1904
  node_merge_to_properties['_history'].append(what_happened)
1876
1905
 
1877
1906
  count += 1
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ricgraph
3
- Version: 2.10
3
+ Version: 2.11
4
4
  Summary: Ricgraph - Research in context graph
5
5
  Author: Rik D.T. Janssen
6
6
  Project-URL: Website, https://www.ricgraph.eu
@@ -122,7 +122,7 @@ The items surrounded by the red line are the solution to this use case.
122
122
 
123
123
  <img src="https://raw.githubusercontent.com/UtrechtUniversity/ricgraph/main/docs/images/researcher-use-case.jpg" alt="Ricgraph use case for a researcher." width="35%">
124
124
 
125
- ### Main contributions of Ricgraph
125
+ ## Main contributions of Ricgraph
126
126
 
127
127
  * Ricgraph can store many types of items in a single graph.
128
128
  * Ricgraph harvests multiple source systems into a single graph.
@@ -130,7 +130,7 @@ The items surrounded by the red line are the solution to this use case.
130
130
  * Ricgraph facilitates reasoning about items because it infers new relations between items.
131
131
  * Ricgraph can be tailored for an application area.
132
132
 
133
- ### Read more about Ricgraph
133
+ ## Read more about Ricgraph
134
134
 
135
135
  For a gentle introduction in Ricgraph, read the reference publication:
136
136
  Rik D.T. Janssen (2024). Ricgraph: A flexible and extensible graph to explore research in
@@ -144,3 +144,11 @@ To use Ricgraph, installing the [Ricgraph package from PyPI](https://pypi.org/pr
144
144
  is not sufficient. Please read the
145
145
  installation instructions in the Ricgraph GitHub repository.
146
146
 
147
+ ## Contact
148
+
149
+ Ricgraph has been created and is being maintained by
150
+ Rik D.T. Janssen from Utrecht University in the Netherlands.
151
+ You can find contact details at
152
+ [his Utrecht University employee page](https://www.uu.nl/staff/DTJanssen).
153
+ He also has an ORCID profile on
154
+ [ORCID 0000-0001-9510-0802](https://orcid.org/0000-0001-9510-0802).
File without changes
File without changes
File without changes