Merge branch 'maint-rel-1.6' into develop
This commit is contained in:
commit
e82c731e79
3 changed files with 181 additions and 0 deletions
|
@ -1119,6 +1119,16 @@
|
||||||
<url-pattern>/admin/sparqlquery</url-pattern>
|
<url-pattern>/admin/sparqlquery</url-pattern>
|
||||||
</servlet-mapping>
|
</servlet-mapping>
|
||||||
|
|
||||||
|
<servlet>
|
||||||
|
<servlet-name>SparqlUpdateApi</servlet-name>
|
||||||
|
<servlet-class>edu.cornell.mannlib.vitro.webapp.controller.api.SparqlUpdateApiController</servlet-class>
|
||||||
|
</servlet>
|
||||||
|
|
||||||
|
<servlet-mapping>
|
||||||
|
<servlet-name>SparqlUpdateApi</servlet-name>
|
||||||
|
<url-pattern>/api/sparqlUpdate</url-pattern>
|
||||||
|
</servlet-mapping>
|
||||||
|
|
||||||
<servlet>
|
<servlet>
|
||||||
<servlet-name>StandardVisualizationController</servlet-name>
|
<servlet-name>StandardVisualizationController</servlet-name>
|
||||||
<servlet-class>edu.cornell.mannlib.vitro.webapp.controller.visualization.StandardVisualizationController</servlet-class>
|
<servlet-class>edu.cornell.mannlib.vitro.webapp.controller.visualization.StandardVisualizationController</servlet-class>
|
||||||
|
|
|
@ -0,0 +1,8 @@
|
||||||
|
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
|
||||||
|
@prefix auth: <http://vitro.mannlib.cornell.edu/ns/vitro/authorization#> .
|
||||||
|
@prefix simplePermission: <java:edu.cornell.mannlib.vitro.webapp.auth.permissions.SimplePermission#> .
|
||||||
|
@prefix displayByRole: <java:edu.cornell.mannlib.vitro.webapp.auth.permissions.DisplayByRolePermission#> .
|
||||||
|
@prefix editByRole: <java:edu.cornell.mannlib.vitro.webapp.auth.permissions.EditByRolePermission#> .
|
||||||
|
|
||||||
|
auth:ADMIN
|
||||||
|
auth:hasPermission simplePermission:UseSparqlUpdateApi ;
|
|
@ -0,0 +1,163 @@
|
||||||
|
<style>
|
||||||
|
form {
|
||||||
|
border: 2 solid black;
|
||||||
|
background-color: #E0E0E0;
|
||||||
|
}
|
||||||
|
input, textarea {
|
||||||
|
margin: 6px;
|
||||||
|
}
|
||||||
|
form a {
|
||||||
|
float: right;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<h1>Test the SPARQL API</h1>
|
||||||
|
|
||||||
|
<form action="api/sparqlUpdate" method="POST">
|
||||||
|
<a href="individual?uri=http%3A%2F%2Ftest.domain%2Fns%23book1&format=rdfxml">Get RDF</a>
|
||||||
|
<input type="text" name="email" value="testAdmin@cornell.edu" />
|
||||||
|
<input type="text" name="password" value="Password" />
|
||||||
|
<br/>
|
||||||
|
<textarea name="update" rows="6" cols="70" wrap="soft">
|
||||||
|
INSERT DATA {
|
||||||
|
GRAPH <http://vitro.mannlib.cornell.edu/default/vitro-kb-2> {
|
||||||
|
<http://test.domain/ns#book1>
|
||||||
|
<http://purl.org/dc/elements/1.1/title>
|
||||||
|
"Fundamentals of Compiler Design" .
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</textarea>
|
||||||
|
<br/>
|
||||||
|
<input type="submit" value="Successful INSERT">
|
||||||
|
</form>
|
||||||
|
|
||||||
|
<form action="api/sparqlUpdate" method="POST">
|
||||||
|
<a href="individual?uri=http%3A%2F%2Ftest.domain%2Fns%23book1&format=rdfxml">Get RDF</a>
|
||||||
|
<input type="text" name="email" value="testAdmin@cornell.edu" />
|
||||||
|
<input type="text" name="password" value="Password" />
|
||||||
|
<br/>
|
||||||
|
<textarea name="update" rows="7" cols="70" wrap="soft">
|
||||||
|
DELETE DATA {
|
||||||
|
GRAPH <http://vitro.mannlib.cornell.edu/default/vitro-kb-2> {
|
||||||
|
<http://test.domain/ns#book1>
|
||||||
|
<http://purl.org/dc/elements/1.1/title>
|
||||||
|
"Fundamentals of Compiler Design" .
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</textarea>
|
||||||
|
<br/>
|
||||||
|
<input type="submit" value="Successful DELETE">
|
||||||
|
</form>
|
||||||
|
|
||||||
|
<form action="api/sparqlUpdate" method="GET">
|
||||||
|
<input type="text" name="email" value="testAdmin@cornell.edu" />
|
||||||
|
<input type="text" name="password" value="Password" />
|
||||||
|
<br/>
|
||||||
|
<textarea name="update" rows="4" cols="70" wrap="soft">
|
||||||
|
INSERT DATA {
|
||||||
|
GRAPH <bogus> {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</textarea>
|
||||||
|
<br/>
|
||||||
|
<input type="submit" value="GET method not allowed">
|
||||||
|
</form>
|
||||||
|
|
||||||
|
<form action="api/sparqlUpdate" method="POST">
|
||||||
|
<textarea name="update" rows="4" cols="70" wrap="soft">
|
||||||
|
INSERT DATA {
|
||||||
|
GRAPH <bogus> {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</textarea>
|
||||||
|
<br/>
|
||||||
|
<input type="submit" value="Email and password missing">
|
||||||
|
</form>
|
||||||
|
|
||||||
|
<form action="api/sparqlUpdate" method="POST">
|
||||||
|
<input type="text" name="email" value="bogus@cornell.edu" />
|
||||||
|
<input type="text" name="password" value="Password" />
|
||||||
|
<br/>
|
||||||
|
<textarea name="update" rows="4" cols="70" wrap="soft">
|
||||||
|
INSERT DATA {
|
||||||
|
GRAPH <bogus> {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</textarea>
|
||||||
|
<br/>
|
||||||
|
<input type="submit" value="No such user">
|
||||||
|
</form>
|
||||||
|
|
||||||
|
<form action="api/sparqlUpdate" method="POST">
|
||||||
|
<input type="text" name="email" value="testAdmin@cornell.edu" />
|
||||||
|
<input type="text" name="password" value="BOGUS" />
|
||||||
|
<br/>
|
||||||
|
<textarea name="update" rows="4" cols="70" wrap="soft">
|
||||||
|
INSERT DATA {
|
||||||
|
GRAPH <bogus> {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</textarea>
|
||||||
|
<br/>
|
||||||
|
<input type="submit" value="Wrong password">
|
||||||
|
</form>
|
||||||
|
|
||||||
|
<form action="api/sparqlUpdate" method="POST">
|
||||||
|
<input type="text" name="email" value="joeUser@cornell.edu" />
|
||||||
|
<input type="text" name="password" value="Password" />
|
||||||
|
<br/>
|
||||||
|
<textarea name="update" rows="4" cols="70" wrap="soft">
|
||||||
|
INSERT DATA {
|
||||||
|
GRAPH <bogus> {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</textarea>
|
||||||
|
<br/>
|
||||||
|
<input type="submit" value="Account not authorized">
|
||||||
|
</form>
|
||||||
|
|
||||||
|
<form action="api/sparqlUpdate" method="POST">
|
||||||
|
<input type="text" name="email" value="testAdmin@cornell.edu" />
|
||||||
|
<input type="text" name="password" value="Password" />
|
||||||
|
<input type="submit" value="SPARQL is missing">
|
||||||
|
</form>
|
||||||
|
|
||||||
|
<form action="api/sparqlUpdate" method="POST">
|
||||||
|
<input type="text" name="email" value="testAdmin@cornell.edu" />
|
||||||
|
<input type="text" name="password" value="Password" />
|
||||||
|
<br/>
|
||||||
|
<textarea name="update" rows="4" cols="70" wrap="soft">
|
||||||
|
INSERT DATA } {
|
||||||
|
GRAPH <bogus> {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</textarea>
|
||||||
|
<br/>
|
||||||
|
<input type="submit" value="SPARQL is invalid">
|
||||||
|
</form>
|
||||||
|
|
||||||
|
<form action="api/sparqlUpdate" method="POST">
|
||||||
|
<input type="text" name="email" value="testAdmin@cornell.edu" />
|
||||||
|
<input type="text" name="password" value="Password" />
|
||||||
|
<br/>
|
||||||
|
<textarea name="update" rows="5" cols="70" wrap="soft">
|
||||||
|
INSERT DATA {
|
||||||
|
<http://test.domain/ns#book1>
|
||||||
|
<http://purl.org/dc/elements/1.1/title>
|
||||||
|
"Fundamentals of Compiler Design" .
|
||||||
|
}
|
||||||
|
</textarea>
|
||||||
|
<br/>
|
||||||
|
<input type="submit" value="SPARQL doesn't specify a GRAPH">
|
||||||
|
</form>
|
||||||
|
|
||||||
|
<pre>
|
||||||
|
200 Success
|
||||||
|
400 Failed to parse SPARQL update
|
||||||
|
400 SPARQL update must specify a GRAPH URI.
|
||||||
|
403 username/password combination is not valid
|
||||||
|
403 Account is not authorized
|
||||||
|
405 Method not allowed
|
||||||
|
500 Unknown error
|
||||||
|
</pre>
|
||||||
|
|
Loading…
Add table
Reference in a new issue