bruth / cypher Goto Github PK
View Code? Open in Web Editor NEWNeo4j Cypher compiler for building domain-specific APIs
License: BSD 2-Clause "Simplified" License
Neo4j Cypher compiler for building domain-specific APIs
License: BSD 2-Clause "Simplified" License
REMOVE
FOREACH
CREATE UNIQUE
CREATE INDEX ON
USING INDEX
DROP INDEX ON
CREATE CONSTRAINT ON ... ASSERT ... IS UNIQUE
DROP CONSTRAINT ON ... ASSERT ... IS UNIQUE
CASE ... WHEN/ELSE .. END
Python 2.7.5 (default, Aug 25 2013, 00:04:04)
[GCC 4.2.1 Compatible Apple LLVM 5.0 (clang-500.0.68)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from cypher import *
>>> Node(identifier='http://www.example.com/location.xhtml?locationId=1373')
(`http://www.example.com/location.xhtml?locationId=1373`)
>>> Rel(Node(identifier='http://www.example.com/location.xhtml?locationId=1373'), Node(identifier='http://www.example.com/about.xhtml'), 'LINKSTO', identifier='linksto')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/techdragon/.virtualenvs/crawl/src/cypher/cypher/token.py", line 23, in __repr__
return str(self)
File "/Users/techdragon/.virtualenvs/crawl/src/cypher/cypher/token.py", line 12, in __str__
return ''.join([str(t) for t in self.tokenize()])
File "/Users/techdragon/.virtualenvs/crawl/src/cypher/cypher/syntax.py", line 250, in tokenize
elif self.type.startswith('*'):
AttributeError: 'Node' object has no attribute 'startswith'
>>> page1 = Node(identifier='http://www.example.com/location.xhtml?locationId=1373')
>>> page2 = Node(identifier='http://www.example.com/about.xhtml')
>>> Rel(page1, page2, 'LINKSTO' identifier='linksto')
File "<stdin>", line 1
Rel(page1, page2, 'LINKSTO' identifier='linksto')
^
SyntaxError: invalid syntax
>>> Rel(page1, page2, 'LINKSTO' identifier='linksto')
File "<stdin>", line 1
Rel(page1, page2, 'LINKSTO' identifier='linksto')
^
SyntaxError: invalid syntax
>>> Rel(page1, page2, 'LINKSTO', identifier='linksto')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/techdragon/.virtualenvs/crawl/src/cypher/cypher/token.py", line 23, in __repr__
return str(self)
File "/Users/techdragon/.virtualenvs/crawl/src/cypher/cypher/token.py", line 12, in __str__
return ''.join([str(t) for t in self.tokenize()])
File "/Users/techdragon/.virtualenvs/crawl/src/cypher/cypher/syntax.py", line 250, in tokenize
elif self.type.startswith('*'):
AttributeError: 'Node' object has no attribute 'startswith'
>>>
Im not sure what more to say at this point. If i fix this ill give a pull request, but I only just found this library so not sure if ill be able to work it out before you could, or if Im even using this library right.
P.S. @bruth also, this little library is the exact kind of thing I wish there was more of in python. :) ๐
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.