Changeset 385 for trunk/src/TM-SPARQL


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/TM-SPARQL
Files:
2 added
1 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)
Note: See TracChangeset for help on using the changeset viewer.