Added default query. NIHVIVO-68
This commit is contained in:
parent
a2641ff5d7
commit
7f86bd600e
1 changed files with 31 additions and 21 deletions
|
@ -2,6 +2,8 @@
|
||||||
|
|
||||||
<%@page import="com.hp.hpl.jena.rdf.model.ModelMaker"%>
|
<%@page import="com.hp.hpl.jena.rdf.model.ModelMaker"%>
|
||||||
<%@page import="java.util.Iterator"%>
|
<%@page import="java.util.Iterator"%>
|
||||||
|
<%@page import="java.util.ArrayList"%>
|
||||||
|
<%@page import="java.util.List"%>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<div id="content" class="sparqlform">
|
<div id="content" class="sparqlform">
|
||||||
|
@ -16,28 +18,36 @@ PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
|
||||||
PREFIX owl: <http://www.w3.org/2002/07/owl#>
|
PREFIX owl: <http://www.w3.org/2002/07/owl#>
|
||||||
PREFIX swrl: <http://www.w3.org/2003/11/swrl#>
|
PREFIX swrl: <http://www.w3.org/2003/11/swrl#>
|
||||||
PREFIX swrlb: <http://www.w3.org/2003/11/swrlb#>
|
PREFIX swrlb: <http://www.w3.org/2003/11/swrlb#>
|
||||||
PREFIX vitro: <http://vitro.mannlib.cornell.edu/ns/vitro/0.7#>
|
<%
|
||||||
PREFIX vivo: <http://vivo.library.cornell.edu/ns/0.1#>
|
List prefixes = (List)request.getAttribute("prefixList");
|
||||||
PREFIX geopolitical.owl: <http://aims.fao.org/aos/geopolitical.owl#>
|
if(prefixes != null){
|
||||||
PREFIX bibo: <http://purl.org/ontology/bibo/>
|
Iterator prefixItr = prefixes.iterator();
|
||||||
PREFIX dcterms: <http://purl.org/dc/terms/>
|
Integer count = 0;
|
||||||
PREFIX event: <http://purl.org/NET/c4dm/event.owl#>
|
while (prefixItr.hasNext()){
|
||||||
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
|
String prefixText = (String) prefixItr.next();
|
||||||
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
|
if(prefixText.equals("(not yet specified)")){
|
||||||
PREFIX core: <http://vivoweb.org/ontology/core#>
|
count++;
|
||||||
#
|
prefixText = "j." + count.toString();
|
||||||
# This example query gets the label, research focus, and netID
|
}
|
||||||
# for 20 Cornell employees.
|
String urlText = (String) prefixItr.next();
|
||||||
#
|
%>
|
||||||
SELECT ?person ?personLabel ?focus ?netid
|
PREFIX <%=prefixText%>: <<%=urlText%>>
|
||||||
WHERE
|
<%
|
||||||
{
|
}
|
||||||
?person vivo:CornellemailnetId ?netid .
|
|
||||||
?person rdf:type vivo:CornellEmployee .
|
|
||||||
?person vivo:researchFocus ?focus.
|
|
||||||
OPTIONAL { ?person rdfs:label ?personLabel }
|
|
||||||
}
|
}
|
||||||
limit 20
|
|
||||||
|
%>
|
||||||
|
#
|
||||||
|
# This example query gets 20 geographic locations
|
||||||
|
# and (if available) their labels
|
||||||
|
#
|
||||||
|
SELECT ?geoLocation ?label
|
||||||
|
WHERE
|
||||||
|
{
|
||||||
|
?geoLocation rdf:type core:GeographicLocation .
|
||||||
|
OPTIONAL { ?geoLocation rdfs:label ?label }
|
||||||
|
}
|
||||||
|
LIMIT 20
|
||||||
</textarea>
|
</textarea>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue