Quickstart Guide
Dydra is an RDF store meant to be quick and easy for developers. Getting started quickly will require already being familiar with RDF and SPARQL.
You can get started quickly using either the web interface or the command-line RubyGem. As soon as you've created your repository, your SPARQL endpoint is already ready.
Starting from your browser
After you create your account, visit your dashboard and
create a new repository with the New Repository
button. You can enter some optional
metadata; the only thing your repository needs is a name.
Once you have created your repository, you will be redirected to your repository’s import page. From here you can import from local files or simply input a URL that we will fetch for you. We accept Turtle, TriG, N-Triples, N-Quads, RDF/JSON, RDF/XML, and RDFa encodings. During the beta period, there are some limitations on the size of repositories we will allow you to create.
After your import is complete, try running a quick query. Click ‘Query’ on the upper right, and you’ll visit the query creation screen, which lets you run example SPARQL queries in your browser. Try this one to get a list of the predicates in your dataset:
SELECT DISTINCT ?p WHERE { ?s ?p ?o }
Go ahead and run it. You’ll see the results in your browser.
When you’re done, you can access your SPARQL endpoint via any existing tools you might have.
Command line RubyGem
You can perform most repository functions from the command line with the
dydra
RubyGem. After creating your account, try this:
$ gem install dydra $ dydra create my-test-repository Username or Email address: <your username> Password: $ dydra import my-test-repository http://datagraph.org/jhacker.nt $ dydra query my-test-repository 'SELECT DISTINCT ?p WHERE {?s ?p ?o}'
When you’re done, you can access your SPARQL endpint via any existing tools you might have.
SPARQL
Your repository already has a standard SPARQL endpoint. It’s at:
http://dydra.com/your/repository/sparql
As simple query, which specifies a user identifier and returns a statement count for
the jhacker/foaf
repository can be done with curl
$ curl -H 'Accept: application/sparql-results+json' \ 'http://dydra.com/jhacker/foaf/sparql?query=select%20count(*)%20where%20%7b?s%20?p%20?o%7d&user_id=myId' { "head": { "vars": [ "COUNT1" ] }, "results": { "bindings": [ { "COUNT1": {"type":"typed-literal", "datatype":"http://www.w3.org/2001/XMLSchema#integer", "value":"10"} } ] } } $