Skip to content

Instantly share code, notes, and snippets.

@aamedina
aamedina / FOODON_00001164.clj
Last active January 26, 2023 22:26
tomato food product
;; dev> (run! rdf/print-doc (mop/compute-class-precedence-list :obo/FOODON_00001164))
;; -------------------------
;; :obo/FOODON_00001164
;; tomato food product
;; isa?
;; :obo/AGRO_00000154
;; :obo/BFO_0000001
;; :obo/BFO_0000002
;; :obo/BFO_0000004
;; :obo/BFO_0000024
@aamedina
aamedina / pupil.clj
Created January 26, 2023 16:16
Pupil facts
(def OBA_VT0001317
"pupil morphology trait"
{:db/ident :obo/OBA_VT0001317,
:obo/IAO_0000115 "The morphology of a pupil.",
:oboInOwl/hasExactSynonym "morphology of pupil",
:owl/equivalentClass {:owl/intersectionOf [:obo/PATO_0000051
{:owl/onProperty :obo/RO_0002314,
:owl/someValuesFrom
:obo/UBERON_0001771,
:rdf/type :owl/Restriction}],
@aamedina
aamedina / auto.clj
Last active January 18, 2023 21:32
isa? in datomic query
(d/q '[:find (distinct ?ident)
:in $ ?h
:where
[?e :db/ident ?ident]
[(isa? ?h ?ident :auto-vs/VehicleSensor)]]
(db) temple/*tree-of-life*)
;=>
[[#{:auto-vs/Speedometer
:auto-vs/Gearbox
:auto-vs/BrakeFluidLevelSensor
@aamedina
aamedina / mop.clj
Created January 10, 2023 20:44
make-instance
(defmulti make-instance
"Creates and returns a new instance of the given class."
{:arglists '([class & {:as initargs}])}
type-of
:hierarchy #'net.wikipunk.temple/*tree-of-life*)
@aamedina
aamedina / ado.clj
Created January 10, 2023 18:13
Alzheimer's Disease Ontology
(ns net.wikipunk.rdf.ado
"Alzheimer's Disease Ontology is a knowledge-based ontology that encompasses varieties of concepts related to Alzheimer'S Disease, foundamentally structured by upper level Basic Formal Ontology(BFO). This Ontology is enriched by the interrelational entities that demonstrate the nextwork of the understanding on Alzheimer's disease and can be readily applied for text mining."
{:dcat/downloadURL "http://purl.obolibrary.org/obo/ado.owl",
:dcterms/creator ["Astghik Sargsyan"
"Vanessa Lage-Rupprecht"
"Alpha Tom Kodamullil"
"Philipp Wegner"
"Bide Zhang"
"Stephan Gebel"],
:dcterms/description
{:doap/name
["Simple Amplifier"
#lstr "Amplificador Simple@es"
#lstr "簡単なアンプ@jp"
#lstr "Einfacher Verstärker@de"
#lstr "Amplificateur de Base@fr"
#lstr "简单放大器@zh"
#lstr "Amplificatore Semplice@it"
#lstr "Просто Усилитель@ru"
#lstr "Simple Amplifier@en-gb"],
@aamedina
aamedina / dev.clj
Last active December 18, 2022 18:32
LV2 RDF vocabulary
(require '[net.wikipunk.rdf :as rdf])
;; rdf/read-vocab slurps the EDN triples output here from disk lazily (https://gist.github.com/aamedina/71efafc7b5a2b368bdf4a9a39ba6f859)
(transduce (comp
(map deref)
(map :vann/preferredNamespacePrefix)
(keep #(io/resource (str "lv2/" % ".edn")))
(mapcat rdf/read-vocab)
(filter (fn [[s p o]]
@aamedina
aamedina / atom.edn
Last active December 18, 2022 17:46
lv2 specs as Clojure / EDN data
^{:net.wikipunk.rdf/ns-prefix-map
{"ui" "http://lv2plug.in/ns/extensions/ui#",
"owl" "http://www.w3.org/2002/07/owl#",
"rdf" "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
"xsd" "http://www.w3.org/2001/XMLSchema#",
"lv2" "http://lv2plug.in/ns/lv2core#",
"rdfs" "http://www.w3.org/2000/01/rdf-schema#",
"units" "http://lv2plug.in/ns/extensions/units#",
"atom" "http://lv2plug.in/ns/ext/atom#"},
:vann/preferredNamespacePrefix "atom",
@aamedina
aamedina / schema.edn
Created December 8, 2022 21:48
schema.org
This file has been truncated, but you can view the full file.
^{:net.wikipunk.rdf/ns-prefix-map
{"owl" "http://www.w3.org/2002/07/owl#",
"foaf" "http://xmlns.com/foaf/0.1/",
"void" "http://rdfs.org/ns/void#",
"dcterms" "http://purl.org/dc/terms/",
"rdf" "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
"dcat" "http://www.w3.org/ns/dcat#",
"schema" "https://schema.org/",
"dcmitype" "http://purl.org/dc/dcmitype/",
"dc11" "http://purl.org/dc/elements/1.1/",
@aamedina
aamedina / boot.edn
Created November 23, 2022 22:37
examining the vocabulary of the semantic web
This file has been truncated, but you can view the full file.
#_(into [] cat (d/qseq '[:find (pull ?e [*])
:where
(or [?e :db/ident ?eid]
[?e :rdf/uri ?eid]
[?e :rdf/blank ?eid])]
(db rdf)))
[{:db/id 0,
:db/ident :db.part/db,
:db.install/partition
[#:db{:id 0, :ident :db.part/db}