lemonhu / stock-knowledge-graph Goto Github PK
View Code? Open in Web Editor NEW利用网络上公开的数据构建一个小型的证券知识图谱/知识库
License: MIT License
利用网络上公开的数据构建一个小型的证券知识图谱/知识库
License: MIT License
您好,我冒昧的问一下,您能否将你数据爬取的代码也提供一下吗,比如如何爬取同花顺网页的代码?
当我尝试运行时,build_csv.py 报错
in build_executive
info = [row[0], row[1], row[2]]
我想知道为什么
使用neo4j-admin import进行csv数据导入后,只能查询单种关系,如employee_of, industry_of等。但无法查询如您demo图片中所示的多种混合关系在一起的结果,使用相关cpyher语句也不能查询。
希望您能帮助,谢谢
你好,我想问一下,为什么我运行完以后得到的.csv文件都存在乱码问题呢?
使用了tushare工具后会报以下两条错误:
1.socket.gaierror: [Errno 11001] getaddrinfo failed
2.urllib.error.URLError: <urlopen error [Errno 11001] getaddrinfo failed>
求解答!!!感谢感谢
Traceback (most recent call last):
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\urllib\request.py", line 1346, in do_open
h.request(req.get_method(), req.selector, req.data, headers,
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\http\client.py", line 1255, in request
self._send_request(method, url, body, headers, encode_chunked)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\http\client.py", line 1301, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\http\client.py", line 1250, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\http\client.py", line 1010, in _send_output
self.send(msg)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\http\client.py", line 950, in send
self.connect()
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\http\client.py", line 921, in connect
self.sock = self._create_connection(
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\socket.py", line 822, in create_connection
for res in getaddrinfo(host, port, 0, SOCK_STREAM):
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\socket.py", line 953, in getaddrinfo
for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno 11001] getaddrinfo failed
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "D:\stock.py", line 37, in
df_industry = ts.get_industry_classified()
File "C:\Users\Administrator\AppData\Roaming\Python\Python39\site-packages\tushare\stock\classifying.py", line 49, in get_industry_classified
df = pd.read_csv(ct.TSDATA_CLASS%(ct.P_TYPE['http'], ct.DOMAINS['oss'], 'industry'),
File "C:\Users\Administrator\AppData\Roaming\Python\Python39\site-packages\pandas\io\parsers.py", line 610, in read_csv
return _read(filepath_or_buffer, kwds)
File "C:\Users\Administrator\AppData\Roaming\Python\Python39\site-packages\pandas\io\parsers.py", line 462, in _read
parser = TextFileReader(filepath_or_buffer, **kwds)
File "C:\Users\Administrator\AppData\Roaming\Python\Python39\site-packages\pandas\io\parsers.py", line 819, in init
self._engine = self._make_engine(self.engine)
File "C:\Users\Administrator\AppData\Roaming\Python\Python39\site-packages\pandas\io\parsers.py", line 1050, in _make_engine
return mapping[engine](self.f, **self.options) # type: ignore[call-arg]
File "C:\Users\Administrator\AppData\Roaming\Python\Python39\site-packages\pandas\io\parsers.py", line 1867, in init
self._open_handles(src, kwds)
File "C:\Users\Administrator\AppData\Roaming\Python\Python39\site-packages\pandas\io\parsers.py", line 1362, in _open_handles
self.handles = get_handle(
File "C:\Users\Administrator\AppData\Roaming\Python\Python39\site-packages\pandas\io\common.py", line 558, in get_handle
ioargs = _get_filepath_or_buffer(
File "C:\Users\Administrator\AppData\Roaming\Python\Python39\site-packages\pandas\io\common.py", line 289, in _get_filepath_or_buffer
req = urlopen(filepath_or_buffer)
File "C:\Users\Administrator\AppData\Roaming\Python\Python39\site-packages\pandas\io\common.py", line 195, in urlopen
return urllib.request.urlopen(*args, **kwargs)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\urllib\request.py", line 214, in urlopen
return opener.open(url, data, timeout)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\urllib\request.py", line 517, in open
response = self._open(req, data)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\urllib\request.py", line 534, in _open
result = self._call_chain(self.handle_open, protocol, protocol +
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\urllib\request.py", line 494, in _call_chain
result = func(*args)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\urllib\request.py", line 1375, in http_open
return self.do_open(http.client.HTTPConnection, req)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\urllib\request.py", line 1349, in do_open
raise URLError(err)
urllib.error.URLError: <urlopen error [Errno 11001] getaddrinfo failed>
您好,我想问您个个人问题,不知您方便不方便解答,就是我现在有两个实体,一个是人、一个是公司,他们之间分别有人投资公司和公司投资公司这两个关系,假设type都是invest,那么我可以把这两个都放到一个csv文件吗,之后把这个文件import到neo4j中,
如题,谢谢~
大佬,您好,刚接触知识图谱,请问知识图谱适合做下面的任务吗:
输入一段文字,或者关键字,想在大量的文档里面搜索跟这个有关的,越密切的越好,要是能定位到输入文字在那篇文档里就最好了,知识图谱可以这样做不啊
.
卡在了任务五,输入shell命令,一直在报错,求大神指导
unrecognized option: ''
usage: neo4j-admin import [--mode=csv] [--database=]
[--additional-config=]
[--report-file=]
[--nodes[:Label1:Label2]=<"file1,file2,...">]
[--relationships[:RELATIONSHIP_TYPE]=<"file1,file2,...">]
[--id-type=<STRING|INTEGER|ACTUAL>]
[--input-encoding=]
[--ignore-extra-columns[=<true|false>]]
[--ignore-duplicate-nodes[=<true|false>]]
[--ignore-missing-nodes[=<true|false>]]
[--multiline-fields[=<true|false>]]
[--delimiter=]
[--array-delimiter=]
[--quote=]
[--max-memory=]
[--f=]
[--high-io=<true/false>]
usage: neo4j-admin import --mode=database [--database=]
[--additional-config=]
[--from=]
environment variables:
NEO4J_CONF Path to directory which contains neo4j.conf.
NEO4J_DEBUG Set to anything to enable debug output.
NEO4J_HOME Neo4j home directory.
HEAP_SIZE Set JVM maximum heap size during command execution.
Takes a number and a unit, for example 512m.
Import a collection of CSV files with --mode=csv (default), or a database from a
pre-3.0 installation with --mode=database.
小白不会画图。。。请问拿什么软件画?
executive.csv, stock.csv, concept.csv, industry.csv, executive_stock.csv, stock_industry.csv, stock_concept.csv
我的也是这样,导入完成后没有图谱产生
Traceback (most recent call last):
File "D:/PycharmProjects/untitled/stock-knowledge-graph-master/stock.py", line 1, in
import tushare as ts
File "D:\PycharmProjects\untitled\venv\lib\site-packages\tushare_init_.py", line 11, in
from tushare.stock.trading import (get_hist_data, get_tick_data,
File "D:\PycharmProjects\untitled\venv\lib\site-packages\tushare\stock\trading.py", line 15, in
import pandas as pd
ImportError: No module named 'pandas'
请问怎么解决?
我是一名新手,请问命令行究竟要怎么写,就一直报错。。。。。。一直报useage,我也把csv文件放在bin下面了,为什么会识别不出来,谢谢
:\neo4j-community-3.4.17\bin>neo4j-admin import --nodes executive.csv --nodes stock.csv -- nodes concept.csv --nodes industry.csv --relationships executive_stock.csv --relationships stock_industry.csv -- relationships stock_concept.csv
unrecognized option: ''
usage: neo4j-admin import [--mode=csv] [--database=]
[--additional-config=]
[--report-file=]
[--nodes[:Label1:Label2]=<"file1,file2,...">]
[--relationships[:RELATIONSHIP_TYPE]=<"file1,file2,...">]
[--id-type=<STRING|INTEGER|ACTUAL>]
[--input-encoding=]
[--ignore-extra-columns[=<true|false>]]
[--ignore-duplicate-nodes[=<true|false>]]
[--ignore-missing-nodes[=<true|false>]]
[--multiline-fields[=<true|false>]]
[--delimiter=]
[--array-delimiter=]
[--quote=]
[--max-memory=]
[--f=<File containing all arguments to this impo
我的csv文件放在了import目录下。命令行导入不进去啊,我从bin目录下执行noe4j-admin import 后面nodes 怎么改路径都不行。报invalid options和invalid file等错误。后来我把csv放入了bin目录下还是不行,报unmatched arguments错误。崩溃啦,大哥可以加个qq或者vx吗?417945175
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.