This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public Response hello(@PathParam("name") String name, @Context UriInfo ui) { | |
URI provUri = ui.getBaseUriBuilder().path(getClass(), "helloProvenance").build(name); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Link provLink = Link.fromUri(provUri).rel(HAS_PROVENANCE).build(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static final String HAS_PROVENANCE = "http://www.w3.org/ns/prov#has_provenance"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
return responseBuilder.header(HttpHeaders.LINK, provLink).build(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static final String HAS_PROVENANCE = "http://www.w3.org/ns/prov#has_provenance"; | |
@GET | |
@Path("hello/{name}") | |
@Produces("text/plain") | |
public Response hello(@PathParam("name") String name, @Context UriInfo ui) { | |
// TODO: Could have used Link.fromResourceMethod instead, | |
// but it seems to return wrong URI in current CXF | |
URI provUri = ui.getBaseUriBuilder().path(getClass(), "helloProvenance").build(name); | |
Link provLink = Link.fromUri(provUri).rel(HAS_PROVENANCE).build(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
stain@ralph-ubuntu:~/src/paq$ git checkout paq | |
Switched to branch 'paq' | |
stain@ralph-ubuntu:~/src/paq$ mvn clean jetty:run | |
[INFO] Scanning for projects... | |
[INFO] | |
[INFO] ------------------------------------------------------------------------ | |
[INFO] Building Example PROV-AQ usage 0.1-SNAPSHOT | |
(..) | |
2013-03-27 16:56:29.565:INFO::Started SelectChannelConnector@0.0.0.0:8080 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
stain@ralph-ubuntu:~/src/paq$ curl -i http://localhost:8080/paq/hello/Alice | |
HTTP/1.1 200 OK | |
Content-Type: text/plain | |
Date: Wed, 27 Mar 2013 16:59:46 GMT | |
Link: <http://localhost:8080/paq/provenance/hello/Alice>;rel=http://www.w3.org/ns/prov#has_provenance | |
Content-Length: 13 | |
Server: Jetty(6.1.26) | |
Hello, Alice |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
stain@ralph-ubuntu:~/src/paq$ curl http://localhost:8080/paq/provenance/hello/Alice | |
document | |
prefix hello <http://localhost:8080/paq/hello/> | |
prefix app <http://localhost:8080/paq/> | |
entity(hello:Alice) | |
wasDerivedFrom(hello:Alice, name) | |
entity(name, [ prov:value="Alice" ]) | |
agent(app:hello, [ prov:type=prov:SoftwareAgent ]) | |
wasAttributedTo(hello:Alice, app:hello) | |
endDocument |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
stain@ralph-ubuntu:~/src/paq$ curl -s -I http://localhost:8080/paq/hello/Alice | | |
grep ^Link:.*has_provenance | sed 's/.*<//' | sed 's/>.*//' | |
http://localhost:8080/paq/provenance/hello/Alice |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
stain@ralph-ubuntu:~/src/paq$ ./paq2svg.sh http://localhost:8080/paq/hello/Alice | |
InteropFramework run() -> {hello=http://localhost:8080/paq/hello/, app=http://localhost:8080/paq/} | |
log4j:WARN No appenders could be found for logger (org.openprovenance.prov.interop.InteropFramework). | |
log4j:WARN Please initialize the log4j system properly. | |
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info. | |
ProvToDot role no label | |
ProvToDot role no label (by default) | |
Created /tmp/21903.svg |