Skip to content

Commit

Permalink
initial import of common-lisp.net subversion repo
Browse files Browse the repository at this point in the history
  • Loading branch information
kraison committed Jun 29, 2011
1 parent 62e9f8d commit e536cf9
Show file tree
Hide file tree
Showing 10 changed files with 464 additions and 0 deletions.
25 changes: 25 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
cl-neo4j

Copyright (c) 2010 Kevin Raison <raison@chatsubo.net>

Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.

1 change: 1 addition & 0 deletions README
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
TODO.
41 changes: 41 additions & 0 deletions cl-neo4j-package.lisp
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
(in-package #:cl-user)

(defpackage #:cl-neo4j
(:use #:cl
#:json
#:json-rpc
#:drakma)
(:export #:do-neo4j-query
#:get-node
#:extract-node-id
#:create-node
#:set-node-properties
#:get-node-properties
#:del-node-properties
#:set-node-property
#:get-node-property
#:del-node-property
#:delete-node
#:create-relationship
#:set-relationship-properties
#:get-relationship-properties
#:del-relationship-properties
#:set-relationship-property
#:get-relationship-property
#:del-relationship-property
#:delete-relationship
#:get-node-relationships
#:list-indices
#:add-to-index
#:remove-from-index
#:query-index
#:traverse
;; Vars
#:*neo4j-host*
#:*neo4j-port*
#:*use-structs*
;; Node struct
#:neo-node?
#:neo-node-self-url
#:neo-node-id
))
25 changes: 25 additions & 0 deletions cl-neo4j.asd
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
;; ASDF package description for cl-neo4j -*- Lisp -*-

(defpackage :cl-neo4j-system (:use :cl :asdf))
(in-package :cl-neo4j-system)

(defsystem cl-neo4j
:name "neo4j RESTful Client Interface ()"
:maintainer "Kevin Raison"
:author "Kevin Raison <last name @ chatsubo dot net>"
:version "0.2"
:description "neo4j RESTful Client Interface"
:long-description "neo4j RESTful Client Interface."
:depends-on (:drakma
:cl-ppcre
:cl-json)
:components ((:file "cl-neo4j-package")
(:file "globals" :depends-on ("cl-neo4j-package"))
(:file "utilities" :depends-on ("globals"))
(:file "conditions" :depends-on ("utilities"))
(:file "struct" :depends-on ("conditions"))
(:file "neo4j" :depends-on ("conditions" "struct"))
(:file "struct-methods" :depends-on ("neo4j"))))



44 changes: 44 additions & 0 deletions conditions.lisp
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
(in-package #:cl-neo4j)

(define-condition unknown-return-type-error (error)
((uri :accessor uri :initarg :uri)
(property :accessor property :initarg :property)
(status :accessor status :initarg :status))
(:report (lambda (condition stream)
(format stream "Unknown status ~A returned for ~A (~A)"
(status condition) (uri condition) (property condition)))))

(define-condition invalid-data-sent-error (error)
((json :accessor json :initarg :json)
(uri :accessor uri :initarg :uri))
(:report (lambda (condition stream)
(format stream "Invalid data sent to ~A: ~A" (uri condition) (json condition)))))

(define-condition node-not-found-error (error)
((uri :accessor uri :initarg :uri)
(property :accessor property :initarg :property))
(:report (lambda (condition stream)
(if (slot-boundp condition 'property)
(format stream "Property ~A not found for node ~A"
(property condition) (uri condition))
(format stream "Node not found ~A" (uri condition))))))

(define-condition unable-to-delete-node-error (error)
((uri :accessor uri :initarg :uri))
(:report (lambda (condition stream)
(format stream "Unable to delete node ~A. Still has relationships?" (uri condition)))))

(define-condition relationship-not-found-error (error)
((uri :accessor uri :initarg :uri)
(property :accessor property :initarg :property))
(:report (lambda (condition stream)
(if (slot-boundp condition 'property)
(format stream "Property ~A not found for relationship ~A"
(property condition) (uri condition))
(format stream "Relationship not found ~A" (uri condition))))))

(define-condition index-entry-not-found-error (error)
((uri :accessor uri :initarg :uri))
(:report (lambda (condition stream)
(format stream "Index entry not found ~A" (uri condition)))))

5 changes: 5 additions & 0 deletions globals.lisp
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
(in-package #:cl-neo4j)

(defparameter *use-structs* nil)
(defvar *neo4j-host* "localhost")
(defvar *neo4j-port* 9999)
Loading

0 comments on commit e536cf9

Please sign in to comment.