Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pietercolpaert/levelldf
Deprecated - Quick writes, quick triple pattern counts, quick triple pattern reads
https://github.com/pietercolpaert/levelldf
Last synced: 20 days ago
JSON representation
Deprecated - Quick writes, quick triple pattern counts, quick triple pattern reads
- Host: GitHub
- URL: https://github.com/pietercolpaert/levelldf
- Owner: pietercolpaert
- Created: 2014-06-04T14:16:43.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2014-08-06T12:58:37.000Z (over 10 years ago)
- Last Synced: 2024-04-14T12:56:52.109Z (7 months ago)
- Language: JavaScript
- Homepage:
- Size: 184 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# LevelLDF #
## Linked Data Fragments ##
A Linked Data Fragment (LDF) is a subset of elements in a Linked Data source that match a specific selector.
An LDF server serves Linked Data Fragments for specific selector classes through hypermedia.
## LevelLDF ##
LevelLDF resolves Basic Graph Patterns (BGP) in `O(n)`, with n the number of triples that match the BGP, and returns the number (count) of triples that match a certain BGP in `O(1)`.
LevelLDF uses LevelDB (a key value store) to store all triples using LevelGraph. It adds a second database which contains a hashed version of every possible BGP as a key and the count as a value. You can use LevelLDF to create your own LDF server, or to interface with a local LevelLDF database.
### Use the nodejs library###
#### getStream ####
```javascript
var ldf = require("levelldf");
ldf.getStream({predicate:"rdf:type"}).on("data", function ( triple ) {
console.log(triple);
});
```#### count ####
##### Performance
There's a script to test the performance of counts by comparing it to the wc bash command.
```bash
time -p ./test/performance.sh count
time -p ./test/performance.sh wc
```#### putN3Stream ####
Pipe an n3 filestream in here
### Using the command line tool ###
When you got ldf in your $PATH, check out
```bash
ldf --help
ldf init
ldf import turtle.ttl
ldf bgp -p 'rdf:type'
ldf count -p 'rdf:type'
```