Skip to content

Instantly share code, notes, and snippets.

Kendall Clark kendall

Block or report user

Report or block kendall

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@kendall
kendall / graph_shortestpath_reasoning.ttl
Created Jan 14, 2014
Stardog 2.2 graph analytics embedded in SPARQL queries
View graph_shortestpath_reasoning.ttl
# graph for shortest path with reasoning
@prefix rule: <tag:stardog:api:rule:> .
@prefix : <urn:test:> .
@prefix g: <tag:stardog:api:property:graph:> .
# the graph
:one :to :two .
:one :to :four .
:two :to :four .
:two :to :five .
View spacemacs.el
;; -*- mode: dotspacemacs -*-
(defun dotspacemacs/layers ()
(setq-default
dotspacemacs-configuration-layers `(
spacemacs
my-web-dev
(colors :variables
colors-enable-rainbow-identifiers t
colors-enable-nyan-cat-progress-bar t)
@kendall
kendall / gist:1732851
Created Feb 3, 2012
Stardog 0.9 Admin Shell
View gist:1732851
-> % java -cp dist/lib/stardog-cli.jar com.clarkparsia.stardog.cli.console.StardogConsole
INFO: Stardog Server running on local:stardog
> help
Stardog 0.7.4 command line client
Type 'help <cmd>' or '<cmd> -h/--help' to print the usage information for a specific command
Available commands:
add
connect
@kendall
kendall / applicationContext.xml
Created Jul 30, 2011
applicationContext.xml
View applicationContext.xml
<bean name="dataSource" class="com.clarkparsia.stardog.ext.spring.DataSourceFactoryBean">
<property name="to" value="testdb"/>
<property name="createIfNotPresent" value="true"/>
</bean>
<bean name="template" class="com.clarkparsia.stardog.ext.spring.SnarlTemplate">
<property name="dataSource" ref="dataSource"/>
</bean>
<bean name="importer" class="com.clarkparsia.stardog.ext.spring.DataImporter">
@kendall
kendall / construct.java
Created Jul 30, 2011
Spring for Stardog fragments
View construct.java
String sparql = "CONSTRUCT { ?a <urn:test:new> ?b } WHERE { ?a <urn:test:p> ?b }";
List<Map<String,String>> results = snarlTemplate.construct(sparql, new GraphMapper<Map<String,String>>() {
@Override
public Map<String, String> mapRow(Statement next) {
Map<String,String> map = new HashMap<String,String>();
map.put(next.getSubject().stringValue(), next.getObject().stringValue());
return map;
}
});
@kendall
kendall / spring-select.java
Created Jul 30, 2011
Spring Select fragment
View spring-select.java
String sparql = "SELECT ?a ?b WHERE { ?a <urn:test:b> ?b } LIMIT 5";
List<Map<String,String>> results = snarlTemplate.query(sparql, new RowMapper<Map<String,String>>() {
@Override
public Map<String,String> mapRow(BindingSet bindingSet) {
Map<String,String> map = new HashMap<String,String>();
map.put("a", bindingSet.getValue("a").stringValue());
map.put("b", bindingSet.getValue("b").stringValue());
return map;
}
@kendall
kendall / thrift-output-osx
Created Oct 25, 2010
Here's the 'brew install -v thrift' output on my OSX box where thrift (0.5) won't compile
We couldn’t find that file to show.
View ps-desc.sh
[$]> ; wget --header "Accept:text/turtle" http://ps.clarkparsia.com/ -O ps-desc.ttl
View pellet-server-advert.js
{
"ps-discovery": {
"response-mimetype": [
"text/json",
"application/rdf+xml",
"application/x-turtle",
"application/x-ntriples"
],
"endpoint": {
"http-methods": ["GET"],
You can’t perform that action at this time.