利用pandas将excel中数据抽取,以三元组形式加载到neo4j数据库中构建相关知识图谱

Skyellbin, updated 🕥 2022-12-07 23:38:05

neo4j-python-pandas-py2neo-v3

利用pandas将excel中数据抽取,以三元组形式加载到neo4j数据库中构建相关知识图谱

Neo4j知识图谱构建

1.运行环境:

python3.6.5
windows10
具体包依赖可以参考文件requirements.txt pip install -r requirements.txt

2.Pandas抽取excel数据

Excel数据结构如下

通过函数data_extraction和函数relation_extrantion分别抽取构建知识图谱所需要的节点数据以及联系数据,构建三元组。
数据提取主要采用pandas将excel数据转换成dataframe类型
invoice_neo4j.py

3.建立知识图谱所需节点和边数据

DataToNeo4jClass.py


2019.2.15更新

更新neo4j_matrix.py代码,将知识图谱中数据抽取转化成矩阵,为机器学习模型提供数据

感谢大家的支持,以后有关于知识图谱的分享会同步到我的公众号【云将数据】

Issues

请问invoice_neo4j.py文件里第四行os.chdir('xxxx')中的xxx要改成什么呀

opened on 2023-01-16 06:33:27 by kkaixin None

大佬们,请问py2neo3对应的python和neo4j版本是什么呀

opened on 2023-01-15 12:44:52 by kkaixin None

Bump certifi from 2016.2.28 to 2022.12.7

opened on 2022-12-07 23:38:05 by dependabot[bot]

Bumps certifi from 2016.2.28 to 2022.12.7.

Commits


Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) - `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language - `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language - `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language - `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language You can disable automated security fix PRs for this repo from the [Security Alerts page](https://github.com/Skyellbin/neo4j-python-pandas-py2neo-v3/network/alerts).

Bump numpy from 1.15.3 to 1.22.0

opened on 2022-06-21 21:32:08 by dependabot[bot]

Bumps numpy from 1.15.3 to 1.22.0.

Release notes

Sourced from numpy's releases.

v1.22.0

NumPy 1.22.0 Release Notes

NumPy 1.22.0 is a big release featuring the work of 153 contributors spread over 609 pull requests. There have been many improvements, highlights are:

  • Annotations of the main namespace are essentially complete. Upstream is a moving target, so there will likely be further improvements, but the major work is done. This is probably the most user visible enhancement in this release.
  • A preliminary version of the proposed Array-API is provided. This is a step in creating a standard collection of functions that can be used across application such as CuPy and JAX.
  • NumPy now has a DLPack backend. DLPack provides a common interchange format for array (tensor) data.
  • New methods for quantile, percentile, and related functions. The new methods provide a complete set of the methods commonly found in the literature.
  • A new configurable allocator for use by downstream projects.

These are in addition to the ongoing work to provide SIMD support for commonly used functions, improvements to F2PY, and better documentation.

The Python versions supported in this release are 3.8-3.10, Python 3.7 has been dropped. Note that 32 bit wheels are only provided for Python 3.8 and 3.9 on Windows, all other wheels are 64 bits on account of Ubuntu, Fedora, and other Linux distributions dropping 32 bit support. All 64 bit wheels are also linked with 64 bit integer OpenBLAS, which should fix the occasional problems encountered by folks using truly huge arrays.

Expired deprecations

Deprecated numeric style dtype strings have been removed

Using the strings "Bytes0", "Datetime64", "Str0", "Uint32", and "Uint64" as a dtype will now raise a TypeError.

(gh-19539)

Expired deprecations for loads, ndfromtxt, and mafromtxt in npyio

numpy.loads was deprecated in v1.15, with the recommendation that users use pickle.loads instead. ndfromtxt and mafromtxt were both deprecated in v1.17 - users should use numpy.genfromtxt instead with the appropriate value for the usemask parameter.

(gh-19615)

... (truncated)

Commits


Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) - `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language - `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language - `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language - `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language You can disable automated security fix PRs for this repo from the [Security Alerts page](https://github.com/Skyellbin/neo4j-python-pandas-py2neo-v3/network/alerts).

请问为什么会选择多个属性

opened on 2022-04-05 14:31:59 by yuanchengzhi-liuwen

您好我想问下为什么我只选择了复核属性,却连收款人属性都显示出来了。。 Snipaste_2022-04-07_17-42-09

可以提供py2neo 3版本的whl文件吗?现在下载最低都是4开始的

opened on 2022-02-23 07:13:06 by Ariel-Hou

我跑您的代码,报错cannot import name 'SocketAddress' from 'neo4j.addressing'或者如图问题,不知道是不是版本未对应,您知道如何解决吗? image

Mazza Will

耐得住寂寞,守得住繁华

GitHub Repository