summaryrefslogtreecommitdiff
path: root/issues/autogenerate-documuntation-for-rdf.gmi
blob: 2feb17b8d467a599afac0f53127e24261be0c8c9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# Autogenerate documentation: trees, and labels


# Tags
* assigned: bonfacem
* type: feature, NextGenDatabases
* priority: high
* keywords: RDF, GNSOC2023

See this

=> https://github.com/genenetwork/dump-genenetwork-database/pull/11

Given an s-expression say:

```
(define-dump dump-species
  (tables (Species))
  (schema-triples
   (gn:name rdfs:range rdfs:Literal)
   (gn:displayName rdfs:range rdfs:Literal)
   (gn:binomialName rdfs:range rdfs:Literal)
   (gn:family rdfs:range rdfs:Literal))
  (triples (string->identifier "species" (field Species FullName))
    (set rdf:type 'gn:species)
    (set gn:name (field Species SpeciesName))
    (set gn:displayName (field Species MenuName))
    (set gn:binomialName (field Species FullName))
    (set gn:family (field Species Family))
    (set gn:organism (ontology 'ncbiTaxon: (field Species TaxonomyId)))))
```

... parse the s-expression into markdown into a form that looks like this:

```

# dump-species
## Metadata for predicates used in defining dump-species

gn:name -> rdfs:range -> rdfs:Literal
gn:display -> rdfs:range -> rdfs:Literal
gn:binomialName -> rdf:range -> rdfs:Literal
gn:family -> rdfs:range -> rdfs:Literal

## Triples inside the dump-species
An example of an identifer that would be used as a subject is: gn:species_mus_musculus


gn:species_mus_musculus -> rdf:type -> gn:species
gn:species_mus_musculus -> gn:name -> Species.SpeciesName
gn:species_mus_musculus -> gn:displayName -> Species.MenuName
gn:species_mus_musculus -> gn:binomialName -> Species.FullName
gn:species_mus_musculus -> gn:family -> Species.Family
gn:species_mus_musculus -> gn:organism -> Species.TaxonomyId

Example query to fetch all metadata about a species:

: SELECT ?p ?o WHERE { gn:species_mus_musculus ?p ?o } LIMIT 1
```

Some current challenges I'm facing: in the case of "blank-nodes", how do I autogenerate the docs?

* closed