work on NIHVIVO-116 'Enable RDF TBox export by ontology namespace'
This commit is contained in:
parent
f13e2cb5b1
commit
5ebd33a6ea
5 changed files with 28 additions and 5 deletions
|
@ -29,7 +29,9 @@ public class Controllers {
|
|||
|
||||
public static final String SITE_ADMIN = "/siteAdmin";
|
||||
public static final String LOGIN = "/siteAdmin";
|
||||
public static final String LOGOUT = "/siteAdmin";
|
||||
public static final String LOGOUT = "/siteAdmin";
|
||||
|
||||
public static final String EXPORT_RDF = "/export";
|
||||
|
||||
// jsps go here:
|
||||
|
||||
|
|
|
@ -85,7 +85,8 @@ public class OntologyEditController extends BaseEditController {
|
|||
// See OntologyDaoJena.ontologyFromOntologyResource() comments
|
||||
String realURI = OntologyDaoJena.adjustOntologyURI(o.getURI());
|
||||
request.setAttribute("realURI", realURI);
|
||||
|
||||
request.setAttribute("exportURL", request.getContextPath() + Controllers.EXPORT_RDF);
|
||||
|
||||
Portal portal = (new VitroRequest(request)).getPortal();
|
||||
RequestDispatcher rd = request.getRequestDispatcher(Controllers.BASIC_JSP);
|
||||
request.setAttribute("epoKey",epo.getKey());
|
||||
|
|
|
@ -78,6 +78,7 @@ public class JenaExportController extends BaseEditController {
|
|||
String formatParam = vreq.getParameter("format");
|
||||
String subgraphParam = vreq.getParameter("subgraph");
|
||||
String assertedOrInferredParam = vreq.getParameter("assertedOrInferred");
|
||||
String ontologyURI = vreq.getParameter("ontologyURI");
|
||||
|
||||
Model model = null;
|
||||
|
||||
|
@ -109,7 +110,7 @@ public class JenaExportController extends BaseEditController {
|
|||
} else if ( "tbox".equals(subgraphParam) ) {
|
||||
if (limitToInferred) {
|
||||
Model fullModel = getOntModelFromAttribute( FULL_ONT_MODEL_ATTR, vreq );
|
||||
model = xutil.extractTBox( fullModel );
|
||||
model = xutil.extractTBox( fullModel, ontologyURI );
|
||||
try {
|
||||
inferenceModel.enterCriticalSection(Lock.READ);
|
||||
model = model.intersection(inferenceModel);
|
||||
|
@ -117,7 +118,7 @@ public class JenaExportController extends BaseEditController {
|
|||
inferenceModel.leaveCriticalSection();
|
||||
}
|
||||
} else {
|
||||
model = xutil.extractTBox( model );
|
||||
model = xutil.extractTBox( model, ontologyURI );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -216,7 +216,7 @@ private final OntModelSpec DEFAULT_ONT_MODEL_SPEC = OntModelSpec.OWL_MEM;
|
|||
} else {
|
||||
// limit resources to those in the supplied namespace
|
||||
describeQueryStrBuff
|
||||
.append(" FILTER (afn:namespace(?res) == \"")
|
||||
.append(" FILTER (afn:namespace(?res) = \"")
|
||||
.append(namespace)
|
||||
.append("\") \n");
|
||||
}
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
xmlns:c="http://java.sun.com/jstl/core"
|
||||
xmlns:form="http://vitro.mannlib.cornell.edu/edit/tags"
|
||||
version="2.0">
|
||||
<jsp:directive.page import="edu.cornell.mannlib.vitro.webapp.controller.Controllers"/>
|
||||
|
||||
|
||||
<div class="editingForm">
|
||||
|
@ -57,6 +58,24 @@
|
|||
<input type="hidden" name="mode" value="renameResource"/>
|
||||
<input type="hidden" name="controller" value="Refactor"/>
|
||||
</form>
|
||||
|
||||
<div style="margin-left:-0.5em;margin-top:0.5em;padding:0.5em;border-style:solid;border-width:1px;">
|
||||
<form action="${exportURL}" method="get">
|
||||
<input type="hidden" name="subgraph" value="tbox"/>
|
||||
<input type="hidden" name="assertedOrInferred" value="asserted"/>
|
||||
<input type="hidden" name="ontologyURI" value="${Ontology.URI}"/>
|
||||
<input type="submit" class="form-button" name="submit" value="export ontology to RDF"/>
|
||||
<div style="padding:0;margin-top:0.3em;white-space:nowrap;">
|
||||
<input type="radio" name="format" value="RDF/XML-ABBREV" checked="checked" selected="selected"/> RDF/XML abbreviated
|
||||
<input type="radio" name="format" value="RDF/XML"/> RDF/XML
|
||||
<input type="radio" name="format" value="N3"/> N3
|
||||
<input type="radio" name="format" value="N-TRIPLES"/> N-Triples
|
||||
<input type="radio" name="format" value="TURTLE"/> Turtle
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
|
Loading…
Add table
Reference in a new issue