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 / 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"],
View pellet-server.js
{
"service-discovery" : {
"response-mimetype" : [ "text/json", "application/rdf+xml", "application/x-turtle", "application/x-ntriples" ],
"endpoint" : {
"http-methods" : [ "GET" ],
"url" : "http://foo:8080/"
}
},
"knowledge-bases" : [ {
"name" : "wine",
View empire-11.java
// now we can delete our new book
aManager.remove(aNewBook);
// false!
System.err.println(aManager.contains(aNewBook));
// but the new manifestation still exists, since we did not specify that deletes should cascade...
// true!
System.err.println(aManager.contains(aPDFManifestation));
View empire-10.java
// Lastly, we can use the query API to run arbitrary sparql queries
// create a jpql-style partial SPARQL query (JPQL is currently unsupported)
Query aQuery = aManager.createQuery("where { ?result frbr:embodiment ?manifest." +
" ?foo <http://purl.org/goodrelations/v1#typeOfGood> ?manifest . " +
" ?foo <http://purl.org/goodrelations/v1#hasPriceSpecification> ?price. " +
" ?price <http://purl.org/goodrelations/v1#hasCurrencyValue> ?value. " +
" ?price <http://purl.org/goodrelations/v1#hasCurrency> \"USD\"@en." +
" filter(?value > ??min). }");
// this query should return instances of type Book
View empire-9.java
// 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());
View empire-8.java
// let's edit our book...maybe we changed the title and published as a PDF
aNewBook.setTitle("Return of the Empire");
// create a new manifestation
Manifestation aPDFManifestation = new Manifestation();
aPDFManifestation.setIssued(new Date());
// set the dc:type attribute
aPDFManifestation.setType(URI.create("http://purl.oreilly.com/product-types/PDF"));
aNewBook.setEmbodiments(Arrays.asList(aPDFManifestation));
View gist:393586
Book aNewBookCopy = aManager.find(Book.class, aNewBook.getRdfId());
// true!
System.err.println(aNewBook.equals(aNewBookCopy));
You can’t perform that action at this time.