You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|HP:0000002|HP:0000002|rdfs:label||Abnormality of body height|xsd:string||
18
+
|HP:0000014|HP:0000014|rdfs:label||Abnormality of the bladder|xsd:string||
19
+
|HP:0000022|HP:0000022|rdfs:label||Abnormality of male internal genitalia|xsd:string||
20
+
|HP:0000032|HP:0000032|rdfs:label||Abnormality of male external genitalia|xsd:string||
21
+
22
+
23
+
Ready-made ontologies can also be downloaded for any ontology in [OBO](http://obofoundry.org), using URLs such as https://s3.amazonaws.com/bbop-sqlite/hp.db
24
+
25
+
[relation-graph](https://github.com/balhoff/relation-graph/) is used to pre-generate tables of [entailed edges](https://incatools.github.io/semantic-sql/EntailedEdge/). For example,
26
+
all is-a and part-of ancestors of [finger](http://purl.obolibrary.org/obo/UBERON_0002389) in Uberon:
27
+
28
+
sqlite> SELECT * FROM entailed_edge WHERE subject='UBERON:0002389' and predicate IN ('rdfs:subClassOf', 'BFO:0000050');
29
+
14
30
15
31
## Installation
16
32
33
+
SemSQL comes with a helper Python library. Use of this is optional. To install:
34
+
17
35
```bash
18
36
pip install semsql
19
37
```
20
38
21
39
## Download ready-made SQLite databases
22
40
41
+
Pre-generated SQLite database are created weekly for all OBO ontologies and a selection of others.
42
+
43
+
To download:
44
+
23
45
```bash
24
46
semsql download obi -o obi.db
25
47
```
@@ -40,14 +62,19 @@ In either case:
40
62
- The input MUST be in RDF/XML serialization and have the suffix `.owl`:
41
63
- use robot to convert if format is different
42
64
65
+
We are planning to simplify this process in future.
66
+
43
67
### 1. Build a SQLite database directly
44
68
69
+
This requires some basic technical knowledge about how to install things on your machine
70
+
and how to put things in your PATH. It does not require Docker.
After installing these and putting both in your path:
77
+
After installing these and putting both `relation-graph` and `rdftab.rs`in your path:
51
78
52
79
```bash
53
80
semsql make foo.db
@@ -70,15 +97,16 @@ docker run -v $PWD:/work -w /work -ti linkml/semantic-sql semsql make foo.db
70
97
71
98
## Schema
72
99
73
-
See [LinkML Schema Docs](https://incatools.github.io/semantic-sql/)
100
+
See [Schema Documentation](https://incatools.github.io/semantic-sql/)
74
101
75
-
The source schema is in LinkML - this is then compiled down to SQL Tables and Views
102
+
The [source schema](https://github.com/INCATools/semantic-sql/tree/main/src/semsql/linkml) is in [LinkML](https://linkml.io) - this is then compiled down to SQL Tables and Views
76
103
77
104
## ORM Layer
78
105
79
106
A SemSQL relational database can be accessed in exactly the same way as any other SQLdb
80
107
81
-
For convenience, we provide a Python ORM layer using SQL Alchemy. This allows code like the following, which joins [RdfsSubclassOfStatement](https://incatools.github.io/semantic-sql/RdfsSubclassOfStatement) and [existential restrictions](https://incatools.github.io/semantic-sql/OwlSomeValuesFrom):
108
+
For convenience, we provide a Python Object-Relational Mapping (ORM) layer using SQL Alchemy.
109
+
This allows for code uchlike the following, which joins [RdfsSubclassOfStatement](https://incatools.github.io/semantic-sql/RdfsSubclassOfStatement) and [existential restrictions](https://incatools.github.io/semantic-sql/OwlSomeValuesFrom):
0 commit comments