Skip to content

Instantly share code, notes, and snippets.

View stain's full-sized avatar

Stian Soiland-Reyes stain

View GitHub Profile
{
"Fred": "test",
"soup": {
"x": {
"soup": "1234"
}
}
}
GET http://example.com/resource.html HTTP/1.1
Accept: text/html
HTTP/1.1 200 OK
Content-type: text/html
Link: <http://example.com/resource-provenance>;
rel="http://www.w3.org/ns/prov#has_provenance";
anchor="http://example.com/resource"
<html>
@stain
stain / gist:5255523
Created March 27, 2013 16:13
Checking out PAQ source code from https://github.com/stain/paq.git
stain@ralph-ubuntu:~/src$ git clone https://github.com/stain/paq.git
Cloning into 'paq'...
remote: Counting objects: 127, done.
remote: Compressing objects: 100% (55/55), done.
remote: Total 127 (delta 26), reused 125 (delta 24)
Receiving objects: 100% (127/127), 35.72 KiB, done.
Resolving deltas: 100% (26/26), done.
@stain
stain / gist:5255614
Last active December 15, 2015 11:49
Building and running PAQ
stain@ralph-ubuntu:~/src/paq$ mvn clean jetty:run
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building Example PROV-AQ usage 0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
(..)
INFO: Root WebApplicationContext: initialization completed in 2462 ms
2013-03-27 16:22:04.566:INFO::Started SelectChannelConnector@0.0.0.0:8080
[INFO] Started Jetty Server
[INFO] Starting scanner at interval of 10 seconds.
@stain
stain / gist:5255655
Created March 27, 2013 16:25
PAQ request for Alice greeting
stain@ralph-ubuntu:~/src/paq$ curl http://localhost:8080/paq/hello/Alice
Hello, Alice
@stain
stain / gist:5255666
Created March 27, 2013 16:26
URI-escaped name
stain@ralph-ubuntu:~/src/paq$ curl http://localhost:8080/paq/hello/Joe%20Bloggs
Hello, Joe Bloggs
stain@ralph-ubuntu:~/src/paq$ curl -i http://localhost:8080/paq/provenance/hello/Alice
HTTP/1.1 200 OK
Content-Type: text/provenance-notation
Date: Wed, 27 Mar 2013 16:27:14 GMT
Content-Length: 305
Server: Jetty(6.1.26)
document
prefix hello <http://localhost:8080/paq/hello/>
prefix app <http://localhost:8080/paq/>
@GET
@Path("hello/{name}")
@Produces("text/plain")
public String hello(@PathParam("name") String name) {
String greeting = "Hello, " + name + "\n";
return greeting;
}
@stain
stain / gist:5255791
Last active December 15, 2015 11:49
Link: <http://localhost:8080/paq/provenance/hello/Alice>;
rel="http://www.w3.org/ns/prov#has_provenance"
@GET
@Path("hello/{name}")
@Produces("text/plain")
public Response hello(@PathParam("name") String name) {
String greeting = "Hello, " + name + "\n";
ResponseBuilder responseBuilder = Response.ok().entity(greeting);
return responseBuilder.build();
}