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
|
@ -31,6 +31,8 @@ public class Controllers {
|
||||||
public static final String LOGIN = "/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:
|
// jsps go here:
|
||||||
|
|
||||||
public static final String EMPTY = "/empty.jsp";
|
public static final String EMPTY = "/empty.jsp";
|
||||||
|
|
|
@ -85,6 +85,7 @@ public class OntologyEditController extends BaseEditController {
|
||||||
// See OntologyDaoJena.ontologyFromOntologyResource() comments
|
// See OntologyDaoJena.ontologyFromOntologyResource() comments
|
||||||
String realURI = OntologyDaoJena.adjustOntologyURI(o.getURI());
|
String realURI = OntologyDaoJena.adjustOntologyURI(o.getURI());
|
||||||
request.setAttribute("realURI", realURI);
|
request.setAttribute("realURI", realURI);
|
||||||
|
request.setAttribute("exportURL", request.getContextPath() + Controllers.EXPORT_RDF);
|
||||||
|
|
||||||
Portal portal = (new VitroRequest(request)).getPortal();
|
Portal portal = (new VitroRequest(request)).getPortal();
|
||||||
RequestDispatcher rd = request.getRequestDispatcher(Controllers.BASIC_JSP);
|
RequestDispatcher rd = request.getRequestDispatcher(Controllers.BASIC_JSP);
|
||||||
|
|
|
@ -78,6 +78,7 @@ public class JenaExportController extends BaseEditController {
|
||||||
String formatParam = vreq.getParameter("format");
|
String formatParam = vreq.getParameter("format");
|
||||||
String subgraphParam = vreq.getParameter("subgraph");
|
String subgraphParam = vreq.getParameter("subgraph");
|
||||||
String assertedOrInferredParam = vreq.getParameter("assertedOrInferred");
|
String assertedOrInferredParam = vreq.getParameter("assertedOrInferred");
|
||||||
|
String ontologyURI = vreq.getParameter("ontologyURI");
|
||||||
|
|
||||||
Model model = null;
|
Model model = null;
|
||||||
|
|
||||||
|
@ -109,7 +110,7 @@ public class JenaExportController extends BaseEditController {
|
||||||
} else if ( "tbox".equals(subgraphParam) ) {
|
} else if ( "tbox".equals(subgraphParam) ) {
|
||||||
if (limitToInferred) {
|
if (limitToInferred) {
|
||||||
Model fullModel = getOntModelFromAttribute( FULL_ONT_MODEL_ATTR, vreq );
|
Model fullModel = getOntModelFromAttribute( FULL_ONT_MODEL_ATTR, vreq );
|
||||||
model = xutil.extractTBox( fullModel );
|
model = xutil.extractTBox( fullModel, ontologyURI );
|
||||||
try {
|
try {
|
||||||
inferenceModel.enterCriticalSection(Lock.READ);
|
inferenceModel.enterCriticalSection(Lock.READ);
|
||||||
model = model.intersection(inferenceModel);
|
model = model.intersection(inferenceModel);
|
||||||
|
@ -117,7 +118,7 @@ public class JenaExportController extends BaseEditController {
|
||||||
inferenceModel.leaveCriticalSection();
|
inferenceModel.leaveCriticalSection();
|
||||||
}
|
}
|
||||||
} else {
|
} 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 {
|
} else {
|
||||||
// limit resources to those in the supplied namespace
|
// limit resources to those in the supplied namespace
|
||||||
describeQueryStrBuff
|
describeQueryStrBuff
|
||||||
.append(" FILTER (afn:namespace(?res) == \"")
|
.append(" FILTER (afn:namespace(?res) = \"")
|
||||||
.append(namespace)
|
.append(namespace)
|
||||||
.append("\") \n");
|
.append("\") \n");
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
xmlns:c="http://java.sun.com/jstl/core"
|
xmlns:c="http://java.sun.com/jstl/core"
|
||||||
xmlns:form="http://vitro.mannlib.cornell.edu/edit/tags"
|
xmlns:form="http://vitro.mannlib.cornell.edu/edit/tags"
|
||||||
version="2.0">
|
version="2.0">
|
||||||
|
<jsp:directive.page import="edu.cornell.mannlib.vitro.webapp.controller.Controllers"/>
|
||||||
|
|
||||||
|
|
||||||
<div class="editingForm">
|
<div class="editingForm">
|
||||||
|
@ -57,6 +58,24 @@
|
||||||
<input type="hidden" name="mode" value="renameResource"/>
|
<input type="hidden" name="mode" value="renameResource"/>
|
||||||
<input type="hidden" name="controller" value="Refactor"/>
|
<input type="hidden" name="controller" value="Refactor"/>
|
||||||
</form>
|
</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>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
Loading…
Add table
Reference in a new issue