Skip to content

Instantly share code, notes, and snippets.

View kendall's full-sized avatar

Kendall Clark kendall

View GitHub Profile
@kendall
kendall / keybase.md
Last active August 29, 2015 13:57
keybase.md

Keybase proof

I hereby claim:

  • I am kendall on github.
  • I am kendall (https://keybase.io/kendall) on keybase.
  • I have a public key whose fingerprint is 2CE3 FDE8 E638 368F E9FF C269 15E8 E495 44C2 1C54

To claim this, I am signing this object:

@kendall
kendall / matrix.ttl
Created September 9, 2014 15:16
Matrix graph in RDF Turtle
:m1 a :Movie; :title "The Matrix"; :year "1999-03-31".
:m2 a :Movie; :title "The Matrix Reloaded"; :year "2003-05-07".
:m3 a :Movie; :title "The Matrix Revolutions"; :year "2003-10-27".
:neo a :Actor; :name "Keanu Reeves".
:morpheus a :Actor; :name "Larry F".
:trinity a :Actor; :name "CAM".
:neo :hasRole [:as "Neo"; :in :m1].
:neo :hasRole [:as "Neo"; :in :m2].
@kendall
kendall / roadmap.md
Created October 27, 2014 19:30
Stardog Roadmap for Blossom

Roadmap

This is a test.

Another Awesome Thing

@kendall
kendall / geo.sparql
Last active August 29, 2015 14:24
Geospatial query answering in Stardog
prefix geof: <http://www.opengis.net/def/function/geosparql/>
prefix geo: <http://www.opengis.net/ont/geosparql#>
//get locations within 2km of Complexible HQ
select ?name where {
?loc rdfs:label ?name .
?loc geo:hasGeometry ?feature .
?hq geo:hasGeometry ?hqGeo ; rdfs:label "Complexible Headquarters" .
?feature geof:nearby (?hqGeo 2 <http://www.qudt.org/qudt/owl/1.0.0/unit/Instances.html#Kilometer>).
#
# To query for all individuals that have an age between 18 and 37 (exclusive)
# in Pellet 2.0, you have to write (ignoring PREFIXes for now):
#
SELECT ?x
WHERE
{ ?x a [ a owl:Restriction ;
owl:onProperty :age ;
owl:someValuesFrom [
Graph aGraph = new GraphImpl();
URI aBook = aGraph.getValueFactory().createURI("urn:x-domain:oreilly.com:product:9780596514129.IP");
aGraph.add(aBook,
aGraph.getValueFactory().createURI("http://purl.org/dc/terms/publisher"),
aGraph.getValueFactory().createLiteral("O'Reilly Media / Pogue Press"));
aGraph.add(aBook,
aGraph.getValueFactory().createURI("http://purl.org/dc/terms/title"),
aGraph.getValueFactory().createLiteral("Switching to the Mac: The Missing Manual, Leopard Edition"));
// ... setting the additional properties here ...
@Namespaces({"frbr", "http://vocab.org/frbr/core#"})
@Entity
@RdfsClass("frbr:Expression")
public class Book
// but can be refreshed...
aManager.refresh(aNewBookCopy);
// and now contains the correct, up-to-date information
System.err.println(aNewBookCopy.getTitle());
System.err.println(aNewBookCopy.getEmbodiments());
Book aBook = new Book();
aBook.setTitle("Switching to the Mac: The Missing Manual, Leopard Edition");
aBook.setPublisher("O'Reilly Media / Pogue Press");
aBook.setIssueDate("2008-02-26");
// And so on...
Book aNewBookCopy = aManager.find(Book.class, aNewBook.getRdfId());
// true!
System.err.println(aNewBook.equals(aNewBookCopy));