[infectious-disease-ontology] r342 committed - make it easier next time

1 view
Skip to first unread message

infectious-di...@googlecode.com

unread,
Dec 5, 2010, 9:55:52 PM12/5/10
to ido-t...@googlegroups.com
Revision: 342
Author: alanruttenberg
Date: Sun Dec 5 18:54:56 2010
Log: make it easier next time
http://code.google.com/p/infectious-disease-ontology/source/detail?r=342

Modified:
/trunk/src/tools/generate-obo.lisp
/trunk/src/tools/ido-to-obo.lisp

=======================================
--- /trunk/src/tools/generate-obo.lisp Sun Dec 5 14:59:33 2010
+++ /trunk/src/tools/generate-obo.lisp Sun Dec 5 18:54:56 2010
@@ -130,6 +130,7 @@
(ontology-uri "http://purl.obolibrary.org/obo/obi.owl")
(filter-dont-include nil)
(include-obsolete nil)
+ (remarks nil)
)
(with-open-file (f
path :direction :output :if-does-not-exist :create :if-exists :supersede)
(let ((*current-labels* (rdfs-labels kb)) ; speed optimization for
labels and comments
@@ -162,10 +163,9 @@
idspace: VO http://purl.obolibrary.org/obo/VO \"Vaccine Ontology\"
idspace: SO http://purl.org/obo/owl/SO# \"Sequence Ontology\"
idspace: HPO http://purl.org/obo/owl/HP# \"Human Phenotype Ontology\"
-remark: This file is a subset of ~a adequate for indexing using the OLS
service. It does not include all logical assertions present in the OWL
file, which can be obtained at ~a
-
-" (obo-format-time) saved-by default-namespace
- ontology-name ontology-uri)
+idspace: UBERON http://purl.org/obo/owl/UBERON# \"Multi-species anatomy\"
+~{~^remark: ~a~%~}
+" (obo-format-time) saved-by default-namespace remarks)
(loop for class in (set-difference (descendants !owl:Thing kb)
(list !protegeowl:DIRECTED-BINARY-RELATION !protegeowl:PAL-CONSTRAINT))
for obsolete = (and (not (eq
class !<http://www.geneontology.org/formats/oboInOwl#ObsoleteClass>))
(or
=======================================
--- /trunk/src/tools/ido-to-obo.lisp Sun Dec 5 14:59:33 2010
+++ /trunk/src/tools/ido-to-obo.lisp Sun Dec 5 18:54:56 2010
@@ -2,6 +2,8 @@

(defun ido-dont-include (uri)
"return t to mean include this term"
+ (not (#"matches" (uri-full uri) "(?i).*oboinowl.*")))
+
'(let ((matches (or
(#"matches" (uri-full uri) ".*OGMS.*")
(#"matches" (uri-full uri) ".*IAO_.*")
@@ -17,11 +19,37 @@
(default-namespace "IDO")
(ontology-name "IDO")
(ontology-uri "http://purl.obolibrary.org/obo/ido.owl")
- )
+ )
(instantiate-reasoner ido :pellet-sparql)
- (setf (gethash !owl:Thing (rdfs-labels ido)) '("Thing"))
- (generate-obo :kb ido :path path :saved-by saved-by :default-namespace
default-namespace
- :ontology-name ontology-name :ontology-uri
ontology-uri :default-definition-source " [OBO:sourced \"IDO consortium
http://www.infectiousdiseaseontology.org\"]" :filter-dont-include 'ido-dont-include :include-obsolete
t))
+ (let ((comments
+ (sparql '(:select (?comment) ()
+ (?o :a !owl:Ontology)
+ (?o !rdfs:comment ?comment)
+ (:filter (regex (str ?o) ".*ido-*.owl")))
+ :use-reasoner :none :kb ido :flatten t))
+ (creators
+ (sort
+ (sparql '(:select (?creator) (:distinct t)
+ (?o :a !owl:Ontology)
+ (?o !dc:creator ?creator)
+ (:filter (regex (str ?o) ".*ido-*.owl")))
+ :use-reasoner :none :kb ido :flatten t)
+ 'string-lessp
+ :key (lambda(e) (car (last (split-at-char e #\space))))))
+ (contributors
+ (sort (sparql '(:select (?contributor) (:distinct t)
+ (?o :a !owl:Ontology)
+ (?o !dc:contributor ?contributor)
+ (:filter (regex (str ?o) ".*ido-*.owl")))
+ :use-reasoner :none :kb ido :flatten t)
+ 'string-lessp
+ :key (lambda(e) (car (last (split-at-char e #\space))))))
+ (disclaimer (format nil "This file is a subset of IDO adequate for
indexing using the OLS service. It does not include all logical assertions
present in the OWL file, which can be obtained at ~a" ontology-uri)))
+ (and contributors (setq contributors (list (format nil "Contributors:
~{~a~^, ~}" contriabutors))))
+ (and creators (setq creators (list (format nil "Creators: ~{~a~^, ~}"
creators))))
+ (setf (gethash !owl:Thing (rdfs-labels ido)) '("Thing"))
+ (generate-obo :kb ido :path path :saved-by saved-by :default-namespace
default-namespace
+ :ontology-name ontology-name :ontology-uri
ontology-uri :default-definition-source " [OBO:sourced \"IDO consortium
http://www.infectiousdiseaseontology.org\"]" :filter-dont-include 'ido-dont-include :include-obsolete
t :remarks (cons disclaimer (append comments creators contributors)))))

(defun rdfs-comments (kb)
(let ((table (make-hash-table)))

Reply all
Reply to author
Forward
0 new messages