Comments (4)
Hi @linuxfreakus, @alan-salimov-vai we've been able to resolve both issues and are in progress of releasing these fixes.
from falkordb.
Thank you @linuxfreakus, @alan-salimov-vai
We're able to replicate the issue from our end and are investigating.
from falkordb.
Related to this issue, we start from a fresh falkordb instance (pulled from the latest image as of this morning).
Inserting a single node of type "Page" then adding additional nodes normally works.
However, if you add and drop a constraint on the URL field, undefined behavior occurs. Either a segfault or the inserted URLs are malformed (resulting in UnicodeDecodeErrors when attempting to access.)
from falkordb import FalkorDB, Node
from redis.exceptions import ResponseError
def reset_graph(use_constraints=False, port=8080):
# Connect to FalkorDB
db = FalkorDB(host='localhost', port=port)
graph = db.select_graph('Page')
try:
graph.delete()
except ResponseError:
pass
for index, url in enumerate(['https://en.wikipedia.org/wiki/Napoleon']):
node = Node(labels="Page", properties={'url':url})
query = 'CREATE ' + (str(node))
graph.query(query)
if use_constraints:
graph.create_node_unique_constraint('Page', 'url')
graph.list_constraints()
graph.drop_node_unique_constraint('Page', 'url')
ct = graph.query("MATCH (n:Page) RETURN COUNT(n)").result_set[0][0]
print("Graph reset, count=", ct)
return graph
target_url_list = ['https://en.wikipedia.org/wiki/Assembly_language', 'https://en.wikipedia.org/wiki/Sabbatical']
# ---- NO CONSTRAINT SET ---- #
graph = reset_graph(use_constraints=False)
insert_query = graph.query("""
WITH $target_urls AS target_urls_list
UNWIND target_urls_list AS target_url
MATCH (src:Page {url: $source_url})
MERGE (tgt:Page {url: target_url})
MERGE (src)-[:CONNECTED_TO]->(tgt)
RETURN src
""", params={"source_url": 'https://en.wikipedia.org/wiki/Napoleon', "target_urls": target_url_list})
ct = graph.query("MATCH (n:Page) RETURN COUNT(n)").result_set[0][0]
print(ct) # Prints 3
url_match_set = graph.query("MATCH (n:Page) RETURN n.url").result_set # Returns 3 URLs
# ---- YES CONSTRAINT SET ---- #
graph = reset_graph(use_constraints=True)
insert_query = graph.query("""
WITH $target_urls AS target_urls_list
UNWIND target_urls_list AS target_url
MATCH (src:Page {url: $source_url})
MERGE (tgt:Page {url: target_url})
MERGE (src)-[:CONNECTED_TO]->(tgt)
""", params={"source_url": 'https://en.wikipedia.org/wiki/Napoleon', "target_urls": target_url_list}) # --> SEGFAULT
# LONGER TARGET LIST
target_list = ['https://www.worldcat.org/issn/0098-3500',
'https://en.wikipedia.org/wiki/Assembly_language',
'https://en.wikipedia.org/wiki/Sabbatical',
'https://en.wikipedia.org/wiki/Kazushige_Goto',
'https://en.wikipedia.org/wiki/Wikipedia:File_Upload_Wizard',
'https://en.wikipedia.org/wiki/TFLOPS',
'https://en.wikipedia.org/wiki/BSD_license',
'https://en.wikipedia.org/wiki/Multiprocessing',
'https://en.wikipedia.org/wiki/LAPACK']
graph = reset_graph(use_constraints=True)
insert_query = graph.query("""
WITH $target_urls AS target_urls_list
UNWIND target_urls_list AS target_url
MATCH (src:Page {url: $source_url})
MERGE (tgt:Page {url: target_url})
MERGE (src)-[:CONNECTED_TO]->(tgt)
""", params={"source_url": 'https://en.wikipedia.org/wiki/Napoleon', "target_urls": target_url_list})
ct = graph.query("MATCH (n:Page) RETURN COUNT(n)").result_set[0][0]
print(ct) # Returns 7???
url_match_set = graph.query("MATCH (n:Page) RETURN n.url").result_set
print(url_match_set) # Throws UnicodeDecodeError. Malformed URLs here.```
from falkordb.
Seems like this is related to the index return from graph.list_indices()
.
from falkordb.
Related Issues (20)
- Improve map access performance
- Support complex update paths
- Aggregation context should be passed to a single expression
- Running docker image with TLS fails
- Feature: Optionally provide TLS certs for docker image
- add github action for code coverage
- Ignore external libraries on the codecov report
- 4.0.10 release
- Number type storage error. What is the maximum length of the integer? HOT 2
- How to choose version upgrade HOT 1
- Update codecov/codecov-action version
- Adding metadata on the Graph level HOT 1
- How should I set up rdb save related configurations HOT 3
- Number Wrong HOT 2
- Malformed query error when alias starts with a number HOT 1
- Update GraphBLAS version to 9.2.0-beta1
- Relationship matching not following OpenCypher specs HOT 1
- rename falkordb-rs submodule
- Add documentation to run falkordb container with volume
- FOREACH ignores context variables? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from falkordb.