Skip to content

Instantly share code, notes, and snippets.

View mhgrove's full-sized avatar

Michael Grove mhgrove

View GitHub Profile
@mhgrove
mhgrove / RuleExample.java
Created April 10, 2015 14:40
Demonstrates the use of Adder#graph correctly adds a Rule to the database
@Test
public void ruleExample() throws Exception {
final String aRule = "PREFIX :<urn:test:>\n" +
" IF {\n" +
" ?r a :Rectangle ;\n" +
" :width ?w ;\n" +
" :height ?h\n" +
" BIND (?w * ?h AS ?area)\n" +
" }\n" +
" THEN {\n" +
@mhgrove
mhgrove / gist:2952a69d54397b46f17e
Last active February 11, 2016 14:27
query example
mhgrove:dist mhgrove$ ./bin/stardog-admin db create -n foo
Successfully created database 'foo'.
mhgrove:dist mhgrove$ ./bin/stardog query foo "insert data { graph <tag:stardog:api:context:equipment> { <urn:a> <urn:b> <urn:c> } . graph <tag:stardog:api:context:phase-of-development> { <urn:d> <urn:e> <urn:f> } }"
Update query processed successfully in 00:00:00.147.
mhgrove:dist mhgrove$ ./bin/stardog data export foo --format NQUADS
<urn:a> <urn:b> <urn:c> <tag:stardog:api:context:equipment> .
<urn:d> <urn:e> <urn:f> <tag:stardog:api:context:phase-of-development> .
mhgrove:dist mhgrove$ ./bin/stardog query foo "SELECT ?s ?p ?o
> WHERE {