Added default query. NIHVIVO-68

This commit is contained in:
ass92 2010-04-02 18:40:24 +00:00
parent a2641ff5d7
commit 7f86bd600e

View file

@ -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();
}
String urlText = (String) prefixItr.next();
%>
PREFIX <%=prefixText%>: <<%=urlText%>>
<%
}
}
%>
# #
# This example query gets the label, research focus, and netID # This example query gets 20 geographic locations
# for 20 Cornell employees. # and (if available) their labels
# #
SELECT ?person ?personLabel ?focus ?netid SELECT ?geoLocation ?label
WHERE WHERE
{ {
?person vivo:CornellemailnetId ?netid . ?geoLocation rdf:type core:GeographicLocation .
?person rdf:type vivo:CornellEmployee . OPTIONAL { ?geoLocation rdfs:label ?label }
?person vivo:researchFocus ?focus.
OPTIONAL { ?person rdfs:label ?personLabel }
} }
limit 20 LIMIT 20
</textarea> </textarea>
</div> </div>