Changeset 385


Ignore:
Timestamp:
01/25/11 17:46:43 (14 years ago)
Author:
lgiessmann
Message:

tm-sparql: added an xtm file that contains all special uris defined by the networkedplanet tmsparql proposal as topic with corresponding PSIs; added a funtion that allos to initialise the tmsparql module, ie. the tmsparql xtm is imported

Location:
trunk/src
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified trunk/src/TM-SPARQL/sparql.lisp

    r384 r385  
    99
    1010(defpackage :TM-SPARQL
    11   (:use :cl :datamodel :base-tools :exceptions :constants)
     11  (:use :cl :datamodel :base-tools :exceptions :constants
     12        :TM-SPARQL-Constants :xml-importer :xml-constants
     13        :isidorus-threading :xml-tools)
    1214  (:export :SPARQL-Query
    13            :result))
     15           :result
     16           :init-tm-sparql))
    1417
    1518(in-package :TM-SPARQL)
     
    1922(defvar *equal-operators* nil "A Table taht contains tuples of
    2023                               classes and equality operators.")
     24
     25
     26(defun init-tm-sparql (&optional (revision (get-revision)))
     27  "Imports the file tmsparql_core_psis.xtm. core_psis.xtm has to be imported
     28   before."
     29  (with-writer-lock
     30    (with-tm (revision "tmsparql.xtm" (concat *tms* "topic-map"))
     31      (let ((core-dom (cxml:parse-file *tmsparql_core_psis.xtm*
     32                                       (cxml-dom:make-dom-builder)))
     33            (xtm-id (reverse
     34                     (base-tools:string-until
     35                      (reverse
     36                       (pathname-name
     37                        xml-constants:*tmsparql_core_psis.xtm*)) "/"))))
     38        (elephant:ensure-transaction (:txn-nosync t)
     39          (loop for top-elem across
     40               (xpath-child-elems-by-qname (dom:document-element core-dom)
     41                                           *xtm2.0-ns* "topic")
     42             do (let ((top
     43                       (from-topic-elem-to-stub top-elem revision
     44                                                :xtm-id xtm-id)))
     45                  (add-to-tm xml-importer::tm top))))))))
     46
     47
    2148
    2249(defun init-*equal-operators* ()
     
    11651192  ;; => an intersection is invoked
    11661193  (reduce-results construct (make-result-lists construct))
    1167 ;  (dolist (triple (select-group construct))
    1168 ;    (dolist (filter (filters construct))
    1169 ;      (invoke-filter triple construct filter)))
    11701194  (process-filters construct)
    11711195  construct)
  • TabularUnified trunk/src/isidorus.asd

    r384 r385  
    2424               (:static-file "xml/xtm/core_psis.xtm")
    2525               (:static-file "xml/rdf/rdf_core_psis.xtm")
     26               (:static-file "TM-SPARQL/tmsparql_core_psis.xtm")
    2627               (:file "xml-constants"
    2728                      :depends-on ("xml/xtm/core_psis.xtm"
     
    4142                        :depends-on ("constants" "base-tools"))
    4243               (:module "TM-SPARQL"
    43                         :components ((:file "sparql")
     44                        :components ((:file "sparql_constants")
     45                                     (:file "sparql"
     46                                            :depends-on ("sparql_constants"))
    4447                                     (:file "filter_wrappers"
    4548                                            :depends-on ("sparql"))
     
    4851                                     (:file "sparql_parser"
    4952                                            :depends-on ("sparql" "sparql_filter")))
    50                         :depends-on ("constants" "base-tools" "model"))
     53                        :depends-on ("constants"
     54                                     "base-tools"
     55                                     "model"
     56                                     "xml-constants"
     57                                     "xml"
     58                                     "threading"))
    5159               (:module "xml"
    5260                        :components ((:module "xtm"
  • TabularUnified trunk/src/xml-constants.lisp

    r328 r385  
    1515  (:export :*xml-component*
    1616           :*core_psis.xtm*
    17            :*rdf_core_psis.xtm*))
     17           :*rdf_core_psis.xtm*
     18           :*tmsparql_core_psis.xtm*))
    1819
    1920(in-package :xml-constants)
     
    2930  (asdf:component-pathname
    3031   (asdf:find-component *isidorus-system* "xml/rdf/rdf_core_psis.xtm")))
     32
     33(defparameter *tmsparql_core_psis.xtm*
     34  (asdf:component-pathname
     35   (asdf:find-component *isidorus-system* "TM-SPARQL/tmsparql_core_psis.xtm")))
Note: See TracChangeset for help on using the changeset viewer.