atomic-server 0.12.0

Create, share and standardize linked atomic data!
atomic-server-0.12.0 is not a library.
Visit the last successful build: atomic-server-0.37.0

atomic-server

crates.io Discord chat MIT licensed

Status: pre-alpha

A lightweight HTTP server that shares created Atomic data on the web.

Progress

  • Respond to GET request for individual resources
  • URL extension recognition (.json, .ad3, .nt, etc.)
  • HTML serialization
  • JSON serialization
  • JSON-LD serialization
  • AD3 serialization
  • RDF (Turtle / N-Triples) serialization
  • Basic error handling
  • TPF endpoint
  • Homepage
  • Static asset support for .css / .ico / etc.
  • HTTPS (WIP, kind of working)
  • Content-type negotiation
  • CSS / design
  • Collections / dynamic resources
  • Write / Mutations support
  • Auth support (WebID-OICD possibly?)

Install from source

Install Cargo to build from source.

git clone git@github.com:joepio/atomic.git
cd atomic/server
# Create a new .env using the template
cp default.env .env
# Run the server. It creates a store in ~/.config/atomic/db by default
cargo run
# Visit http://localhost:8080/test
  • Run atomic-server inside a directory with /static folder for files
  • If you want to use HTTPS / SSL, set ATOMIC_CERT_INIT to true and run the server. After that, set it to false and set ATOMIC_HTTPS to true.
  • If no .ad3 store path is given, a new store will be created from memory.

Running from cargo

You can also install with cargo install atomic-server, but this binary will also require:

  • the .env from this repo, although the defaults should work just fine.
  • the /templates directory
  • the /static directory

Usage

Get individual resources

You can fetch individual items by sending a GET request to their URL.

# Fetch as AD3 triples
curl -i -H "Accept: application/ad3-ndjson" http://127.0.0.1:8081/test
# Fetch as JSON-LD
curl -i -H "Accept: application/ld+json" http://127.0.0.1:8081/test
# Fetch as JSON
curl -i -H "Accept: application/json" http://127.0.0.1:8081/test
# Fetch as Turtle / N3
curl -i -H "Accept: text/turtle" http://127.0.0.1:8081/test

Query the store with Triple Pattern Fragments

# Fetch as AD3 triples
curl -i -H "Accept: application/ad3-ndjson" "http://127.0.0.1:8081/tpf?subject=&property=&value=test"

Testing

# This also makes sure that cli and server work, plus it test the db feature
cargo test --all

Performance benchmarking

# Install drill
cargo install drill
drill -b benchmark.yml --stats