Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bsless/datalog-parser.spec
1-1 translation of datalog query spec based on the official Datomic documentation
https://github.com/bsless/datalog-parser.spec
Last synced: 3 months ago
JSON representation
1-1 translation of datalog query spec based on the official Datomic documentation
- Host: GitHub
- URL: https://github.com/bsless/datalog-parser.spec
- Owner: bsless
- License: epl-1.0
- Created: 2022-09-22T08:46:55.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2022-09-26T12:10:34.000Z (over 2 years ago)
- Last Synced: 2024-07-10T18:56:25.285Z (6 months ago)
- Language: Clojure
- Size: 13.7 KB
- Stars: 8
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[![Clojars Project](https://img.shields.io/clojars/v/io.github.bsless/datalog-parser.spec.svg)](https://clojars.org/io.github.bsless/datalog-parser.spec)
# io.github.bsless/datalog-parser.spec
1-1 translation of datalog query spec based on the official Datomic documentation
- [Query](https://docs.datomic.com/on-prem/query/query.html)
- [Pull](https://docs.datomic.com/on-prem/query/pull.html)NOTE: Legacy spec not implemented
Exists as a reference implementation for other parsers.
## Usage
```clojure
(require '[bsless.datalog-parser.spec :as spec]
'[clojure.spec.alpha :as s])(s/conform
::spec/query
'[:find ?track-name ?minutes
:in $ ?artist-name
:where [?artist :artist/name ?artist-name]
[?track :track/artists ?artist]
[?track :track/duration ?millis]
[(quot ?millis 60000) ?minutes]
[?track :track/name ?track-name]])
```## License
Copyright © 2022 Ben Sless
Distributed under the Eclipse Public License version 1.0.