[isidorus-cvs] r351 - in trunk/src: . TM-SPARQL ajax/javascripts

Lukas Giessmann lgiessmann at common-lisp.net
Fri Nov 26 10:09:20 UTC 2010


Author: lgiessmann
Date: Fri Nov 26 05:09:20 2010
New Revision: 351

Log:
Isidorus-UI: fixed ticket #96 => set the timeout to 30 seconds to avoid time-out errors; removed the setting of the exteranl-default-format in isidorus.asd, since it should be set explcitly by the end user

Modified:
   trunk/src/TM-SPARQL/sparql.lisp
   trunk/src/TM-SPARQL/sparql_parser.lisp
   trunk/src/ajax/javascripts/constants.js
   trunk/src/constants.lisp
   trunk/src/isidorus.asd

Modified: trunk/src/TM-SPARQL/sparql.lisp
==============================================================================
--- trunk/src/TM-SPARQL/sparql.lisp	(original)
+++ trunk/src/TM-SPARQL/sparql.lisp	Fri Nov 26 05:09:20 2010
@@ -54,6 +54,11 @@
 			'missing-argument-error
 			:message "From SPARQL-Triple(): subject must be set"))
 	    :documentation "Represents the subject of an RDF-triple.")
+   (subject-result :initarg :subject-result
+		   :accessor subject-result
+		   :type T
+		   :initform nil
+		   :documentation "Contains the result of the subject triple elem.")
    (predicate :initarg :predicate
 	      :accessor predicate
 	      :type SPARQL-Triple-Elem
@@ -62,6 +67,12 @@
 			  'missing-argument-error
 			  :message "From SPARQL-Triple(): predicate must be set"))
 	    :documentation "Represents the predicate of an RDF-triple.")
+   (predicate-result :initarg :predicate-result
+		     :accessor predicate-result
+		     :type T
+		     :initform nil
+		     :documentation "Contains the result of the predicate
+                                     triple elem.")
    (object :initarg :object
 	   :accessor object
 	   :type SPARQL-Triple-Elem
@@ -69,7 +80,12 @@
 		      (make-condition
 		       'missing-argument-error
 		       :message "From SPARQL-Triple-(): object must be set"))
-	   :documentation "Represents the subject of an RDF-triple."))
+	   :documentation "Represents the subject of an RDF-triple.")
+   (object-result :initarg :object-result
+		  :accessor object-result
+		  :type T
+		  :initform nil
+		  :documentation "Contains the result of the object triple elem."))
   (:documentation "Represents an entire RDF-triple."))
 
 
@@ -179,6 +195,38 @@
 		(variables construct))))))
 
 
+
+
+;;TODO:
+;;
+;; find-triples (subject predicate object)
+;; * var var var => return the entire graph (all subjects)
+;; * var var object
+;; * var predicate var
+;; * var predicate object
+;; * subject var var
+;; * subject var object
+;; * subject predicate var
+;; * subject predicate object => return subject predicate object if true otherweise nil
+;; handle special URIs => http://www.networkedplanet.com/ontopic/2009/11/making_topic_maps_sparql.html
+
+(defgeneric set-result (construct)
+  (:documentation "Calculates the result of a triple and set all the values in
+                   the passed object.")
+  (:method ((construct SPARQL-Triple))
+    ;;TODO: implement
+    construct))
+
+
+(defgeneric find-subject-var-var (construct)
+  (:documentation "Finds a triple corresponding to the subject and sets
+                   both variables.")
+  (:method ((construct SPARQL-Triple))
+
+    ))
+
+
+
 (defmethod initialize-instance :after ((construct SPARQL-Query) &rest args)
   (declare (ignorable args))
   (parser-start construct (original-query construct))

Modified: trunk/src/TM-SPARQL/sparql_parser.lisp
==============================================================================
--- trunk/src/TM-SPARQL/sparql_parser.lisp	(original)
+++ trunk/src/TM-SPARQL/sparql_parser.lisp	Fri Nov 26 05:09:20 2010
@@ -9,7 +9,6 @@
 
 (in-package :TM-SPARQL)
 
-
 (defun make-sparql-parser-condition(rest-of-query entire-query expected)
   "Creates a spqrql-parser-error object."
   (declare (String rest-of-query entire-query expected))
@@ -157,7 +156,12 @@
 	   (SPARQL-Query query-object)
 	   (Boolean literal-allowed))
   (let ((trimmed-str (cut-comment query-string)))
-    (cond ((string-starts-with trimmed-str "<")
+    (cond ((string-starts-with trimmed-str "a ") ;;rdf:type
+	   (list :next-query (cut-comment (subseq trimmed-str 1))
+		 :value (make-instance 'SPARQL-Triple-Elem
+				       :elem-type 'IRI
+				       :value *rdf-type*)))
+	  ((string-starts-with trimmed-str "<")
 	   (parse-base-suffix-pair trimmed-str query-object))
 	  ((or (string-starts-with trimmed-str "?")
 	       (string-starts-with trimmed-str "$"))
@@ -441,9 +445,7 @@
 	   (predicate-result (parse-triple-elem
 			      (if last-subject
 				  trimmed-str
-				  (if last-subject
-				      trimmed-str
-				      (getf subject-result :next-query)))
+				  (getf subject-result :next-query))
 			      construct))
 	   (object-result (parse-triple-elem (getf predicate-result :next-query)
 					     construct :literal-allowed t)))

Modified: trunk/src/ajax/javascripts/constants.js
==============================================================================
--- trunk/src/ajax/javascripts/constants.js	(original)
+++ trunk/src/ajax/javascripts/constants.js	Fri Nov 26 05:09:20 2010
@@ -24,7 +24,7 @@
 var SUMMARY_URL = HOST_PREF + "json/summary";
 var MARK_AS_DELETED_URL = HOST_PREF + "mark-as-deleted";
 var TM_OVERVIEW = HOST_PREF + "json/tmcl/overview/";
-var TIMEOUT = 20000; // const TIMEOUT = 10000 --> "const" doesn't work under IE
+var TIMEOUT = 30000; // const TIMEOUT = 10000 --> "const" doesn't work under IE
 
 
 

Modified: trunk/src/constants.lisp
==============================================================================
--- trunk/src/constants.lisp	(original)
+++ trunk/src/constants.lisp	Fri Nov 26 05:09:20 2010
@@ -39,6 +39,7 @@
 	   :*rdf-nil*
 	   :*rdf-first*
 	   :*rdf-rest*
+	   :*rdf-type*
 	   :*rdf2tm-object*
 	   :*rdf2tm-subject*
 	   :*rdf2tm-scope-prefix*
@@ -126,6 +127,8 @@
 
 (defparameter *rdf-nil* (concatenate 'string *rdf-ns* "nil"))
 
+(defparameter *rdf-type* (concatenate 'string *rdf-ns* "type"))
+
 (defparameter *rdf-first* (concatenate 'string *rdf-ns* "first"))
 
 (defparameter *rdf-rest* (concatenate 'string *rdf-ns* "rest"))

Modified: trunk/src/isidorus.asd
==============================================================================
--- trunk/src/isidorus.asd	(original)
+++ trunk/src/isidorus.asd	Fri Nov 26 05:09:20 2010
@@ -12,8 +12,8 @@
   (:use :asdf :cl))
 (in-package :isidorus-system)
 
-(defvar *old-external-format* sb-impl::*default-external-format*)
-(setf sb-impl::*default-external-format* :UTF-8)
+;(defvar *old-external-format* sb-impl::*default-external-format*) ;;should be set by user
+;(setf sb-impl::*default-external-format* :UTF-8)
 
 (asdf:defsystem "isidorus"
   :description "The future ingenious, self-evaluating Lisp TM engine"
@@ -230,7 +230,9 @@
                :uuid
 	       :cl-json))
 
-(setf sb-impl::*default-external-format* *old-external-format*)
+;(setf sb-impl::*default-external-format* *old-external-format*)
+
+
 
 ;;
 ;; For the package pathnames, create a link from  ~/.sbcl/systems




More information about the Isidorus-cvs mailing list