Skip to content

Instantly share code, notes, and snippets.

Stian Soiland-Reyes stain

View GitHub Profile
View gist:5236357
{
"Fred": "test",
"soup": {
"x": {
"soup": "1234"
}
}
}
View gist:5253726
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>
View gist:5255523
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 Dec 15, 2015
Building and running PAQ
View gist:5255614
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 Mar 27, 2013
PAQ request for Alice greeting
View gist:5255655
stain@ralph-ubuntu:~/src/paq$ curl http://localhost:8080/paq/hello/Alice
Hello, Alice
@stain
stain / gist:5255666
Created Mar 27, 2013
URI-escaped name
View gist:5255666
stain@ralph-ubuntu:~/src/paq$ curl http://localhost:8080/paq/hello/Joe%20Bloggs
Hello, Joe Bloggs
View gist:5255675
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/>
View HelloWorld.java
@GET
@Path("hello/{name}")
@Produces("text/plain")
public String hello(@PathParam("name") String name) {
String greeting = "Hello, " + name + "\n";
return greeting;
}
View gist:5255791
Link: <http://localhost:8080/paq/provenance/hello/Alice>;
rel="http://www.w3.org/ns/prov#has_provenance"
View HelloWorld.java
@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();
}
You can’t perform that action at this time.