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="java.util.Iterator"%>
|
||||
<%@page import="java.util.ArrayList"%>
|
||||
<%@page import="java.util.List"%>
|
||||
|
||||
<body>
|
||||
<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 swrl: <http://www.w3.org/2003/11/swrl#>
|
||||
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#>
|
||||
PREFIX geopolitical.owl: <http://aims.fao.org/aos/geopolitical.owl#>
|
||||
PREFIX bibo: <http://purl.org/ontology/bibo/>
|
||||
PREFIX dcterms: <http://purl.org/dc/terms/>
|
||||
PREFIX event: <http://purl.org/NET/c4dm/event.owl#>
|
||||
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
|
||||
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
|
||||
PREFIX core: <http://vivoweb.org/ontology/core#>
|
||||
#
|
||||
# This example query gets the label, research focus, and netID
|
||||
# for 20 Cornell employees.
|
||||
#
|
||||
SELECT ?person ?personLabel ?focus ?netid
|
||||
WHERE
|
||||
{
|
||||
?person vivo:CornellemailnetId ?netid .
|
||||
?person rdf:type vivo:CornellEmployee .
|
||||
?person vivo:researchFocus ?focus.
|
||||
OPTIONAL { ?person rdfs:label ?personLabel }
|
||||
<%
|
||||
List prefixes = (List)request.getAttribute("prefixList");
|
||||
if(prefixes != null){
|
||||
Iterator prefixItr = prefixes.iterator();
|
||||
Integer count = 0;
|
||||
while (prefixItr.hasNext()){
|
||||
String prefixText = (String) prefixItr.next();
|
||||
if(prefixText.equals("(not yet specified)")){
|
||||
count++;
|
||||
prefixText = "j." + count.toString();
|
||||
}
|
||||
String urlText = (String) prefixItr.next();
|
||||
%>
|
||||
PREFIX <%=prefixText%>: <<%=urlText%>>
|
||||
<%
|
||||
}
|
||||
}
|
||||
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>
|
||||
</div>
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue