Merge branch 'develop' of git://github.com/vivo-project/VIVO into develop

This commit is contained in:
Jim Blake 2016-12-14 11:19:58 -05:00
commit 67f771fecf
287 changed files with 21445 additions and 23879 deletions

View file

@ -1,6 +1,9 @@
language: java language: java
sudo: false sudo: false
jdk:
- oraclejdk8
env: env:
# Give Maven 1GB of memory to work with # Give Maven 1GB of memory to work with
- MAVEN_OPTS=-Xmx1024M - MAVEN_OPTS=-Xmx1024M

View file

@ -4,8 +4,7 @@ VIVO is an open source semantic web tool for research discovery -- finding peopl
VIVO supports editing, searching, browsing and visualizing research activity in order to discover people, programs, VIVO supports editing, searching, browsing and visualizing research activity in order to discover people, programs,
facilities, funding, scholarly works and events. VIVO's search returns results faceted by type for rapid retrieval of facilities, funding, scholarly works and events. VIVO's search returns results faceted by type for rapid retrieval of
desired information across disciplines at one institution or, through a prototype at vivosearch.org, across multiple desired information across disciplines.
distributed institutions.
## Resources ## Resources
@ -15,8 +14,10 @@ http://vivoweb.org/
### VIVO Project Wiki ### VIVO Project Wiki
https://wiki.duraspace.org/display/VIVO/ https://wiki.duraspace.org/display/VIVO/
### Installation Instructions
Installation instructions for the latest release can be found at this location on the wiki: Installation instructions for the latest release can be found at this location on the wiki:
https://wiki.duraspace.org/display/VIVO/VIVO+Technical+Documentation https://wiki.duraspace.org/display/VIVODOC19x/Installing+VIVO#InstallingVIVO-Git
## Contact us ## Contact us
There are several ways to contact the VIVO community. There are several ways to contact the VIVO community.

View file

@ -7,13 +7,13 @@
<groupId>org.vivoweb</groupId> <groupId>org.vivoweb</groupId>
<artifactId>vivo-api</artifactId> <artifactId>vivo-api</artifactId>
<version>1.9.0-SNAPSHOT</version> <version>1.10.0-SNAPSHOT</version>
<packaging>jar</packaging> <packaging>jar</packaging>
<parent> <parent>
<groupId>org.vivoweb</groupId> <groupId>org.vivoweb</groupId>
<artifactId>vivo-project</artifactId> <artifactId>vivo-project</artifactId>
<version>1.9.0-SNAPSHOT</version> <version>1.10.0-SNAPSHOT</version>
<relativePath>..</relativePath> <relativePath>..</relativePath>
</parent> </parent>
@ -27,7 +27,6 @@
<dependency> <dependency>
<groupId>org.vivoweb</groupId> <groupId>org.vivoweb</groupId>
<artifactId>vitro-dependencies</artifactId> <artifactId>vitro-dependencies</artifactId>
<version>1.9.0-SNAPSHOT</version>
<type>pom</type> <type>pom</type>
</dependency> </dependency>

View file

@ -5,9 +5,6 @@ public class BaseObject {
/** /**
* Simple JavaBean domain object with an id property. * Simple JavaBean domain object with an id property.
* Used as a base class for objects needing this property. * Used as a base class for objects needing this property.
*
* @author Ken Krebs
* @author Juergen Hoeller
*/ */
private Integer id; private Integer id;

View file

@ -17,9 +17,9 @@ public class SemanticServicesError {
/** /**
* @param exception * @param exception Exception description
* @param message * @param message Error message
* @param severity * @param severity Severity
*/ */
public SemanticServicesError(String exception, String message, String severity) { public SemanticServicesError(String exception, String message, String severity) {
super(); super();

View file

@ -9,21 +9,18 @@ import edu.cornell.mannlib.semservices.bo.Concept;
public interface ExternalConceptService { public interface ExternalConceptService {
/** /**
* @param term * @param term Term
* @return
*/ */
List<Concept> processResults(String term) throws Exception; List<Concept> processResults(String term) throws Exception;
/** /**
* @param term * @param term Term
* @return
* @throws Exception * @throws Exception
*/ */
List<Concept> getConcepts(String term) throws Exception; List<Concept> getConcepts(String term) throws Exception;
/** /**
* @param uri * @param uri URI
* @return
*/ */
List<Concept> getConceptsByURIWithSparql(String uri) throws Exception; List<Concept> getConceptsByURIWithSparql(String uri) throws Exception;

View file

@ -37,15 +37,15 @@ import org.w3c.dom.Node;
import org.w3c.dom.NodeList; import org.w3c.dom.NodeList;
import org.xml.sax.SAXException; import org.xml.sax.SAXException;
import com.hp.hpl.jena.query.Query; import org.apache.jena.query.Query;
import com.hp.hpl.jena.query.QueryExecution; import org.apache.jena.query.QueryExecution;
import com.hp.hpl.jena.query.QueryExecutionFactory; import org.apache.jena.query.QueryExecutionFactory;
import com.hp.hpl.jena.query.QueryFactory; import org.apache.jena.query.QueryFactory;
import com.hp.hpl.jena.query.QuerySolution; import org.apache.jena.query.QuerySolution;
import com.hp.hpl.jena.query.ResultSet; import org.apache.jena.query.ResultSet;
import com.hp.hpl.jena.rdf.model.Literal; import org.apache.jena.rdf.model.Literal;
import com.hp.hpl.jena.rdf.model.RDFNode; import org.apache.jena.rdf.model.RDFNode;
import com.hp.hpl.jena.rdf.model.Resource; import org.apache.jena.rdf.model.Resource;
import edu.cornell.mannlib.semservices.bo.Concept; import edu.cornell.mannlib.semservices.bo.Concept;
import edu.cornell.mannlib.semservices.service.ExternalConceptService; import edu.cornell.mannlib.semservices.service.ExternalConceptService;
@ -481,8 +481,7 @@ public class AgrovocService implements ExternalConceptService {
} }
/** /**
* @param uri * @param uri The URI
* @return
*/ */
protected String stripConceptId(String uri) { protected String stripConceptId(String uri) {
String conceptId = new String(); String conceptId = new String();
@ -492,8 +491,7 @@ public class AgrovocService implements ExternalConceptService {
} }
/** /**
* @param str * @param str The String
* @return
*/ */
protected String extractConceptId(String str) { protected String extractConceptId(String str) {
try { try {

View file

@ -75,8 +75,7 @@ public class GemetService implements ExternalConceptService {
} }
/** /**
* @param results * @param results Results to process
* @return
*/ */
private List<Concept> processOutput(String results) throws Exception { private List<Concept> processOutput(String results) throws Exception {
@ -145,9 +144,8 @@ public class GemetService implements ExternalConceptService {
/** /**
* Get a string from a json object or an empty string if there is no value for the given key * Get a string from a json object or an empty string if there is no value for the given key
* @param obj * @param obj JSON Object
* @param key * @param key Key to retrieve
* @return
*/ */
protected String getJsonValue(JSONObject obj, String key) { protected String getJsonValue(JSONObject obj, String key) {
if (obj.has(key)) { if (obj.has(key)) {
@ -159,8 +157,7 @@ public class GemetService implements ExternalConceptService {
/** /**
* @param concept_uri * @param concept_uri Concept URI
* @return
* @throws Exception * @throws Exception
*/ */
protected String getAvailableLangs(String concept_uri) throws Exception { protected String getAvailableLangs(String concept_uri) throws Exception {
@ -177,8 +174,7 @@ public class GemetService implements ExternalConceptService {
} }
/** /**
* @param concept_uri * @param concept_uri concept URI
* @return
* @throws Exception * @throws Exception
*/ */
protected String getConcept(String concept_uri) throws Exception { protected String getConcept(String concept_uri) throws Exception {
@ -196,9 +192,8 @@ public class GemetService implements ExternalConceptService {
} }
/** /**
* @param concept_uri * @param concept_uri Concept URI
* @param property * @param property Property
* @return
* @throws Exception * @throws Exception
*/ */
protected String getAllTranslationsForConcept(String concept_uri, String property) throws Exception { protected String getAllTranslationsForConcept(String concept_uri, String property) throws Exception {
@ -235,9 +230,8 @@ public class GemetService implements ExternalConceptService {
/** /**
* @param concept_uri * @param concept_uri Concept URI
* @param relation * @param relation Relations
* @return
* @throws Exception * @throws Exception
*/ */
protected String getRelatedConcepts(String concept_uri, String relation) throws Exception { protected String getRelatedConcepts(String concept_uri, String relation) throws Exception {
@ -266,8 +260,7 @@ public class GemetService implements ExternalConceptService {
/** /**
* @param keyword * @param keyword Keyword
* @return
* @throws Exception * @throws Exception
*/ */
protected String getConceptsMatchingKeyword(String keyword) throws Exception { protected String getConceptsMatchingKeyword(String keyword) throws Exception {
@ -288,8 +281,7 @@ public class GemetService implements ExternalConceptService {
} }
/** /**
* @param url * @param url URI
* @return
*/ */
protected String getGemetResults(String url) throws Exception { protected String getGemetResults(String url) throws Exception {
String results = new String(); String results = new String();

View file

@ -49,7 +49,7 @@ public class LCSHService implements ExternalConceptService {
String results = null; String results = null;
String dataUrl = baseUri + "?q=" + URLEncoder.encode(term, "UTF-8") String dataUrl = baseUri + "?q=" + URLEncoder.encode(term, "UTF-8")
+ "&q=cs%3Ahttp%3A%2F%2Fid.loc.gov%2Fauthorities%2Fsubjects" + "&q=cs%3Ahttp%3A%2F%2Fid.loc.gov%2Fauthorities%2Fsubjects"
+ "&format=XML"; + "&format=atom";
log.debug("dataURL " + dataUrl); log.debug("dataURL " + dataUrl);
try { try {
@ -81,7 +81,7 @@ public class LCSHService implements ExternalConceptService {
return conceptList; return conceptList;
} }
// Results are in json format (atom) - atom entries need to be extracted // Results are in XML format (atom) - atom entries need to be extracted
// retrieve the URIs and get the SKOS version of the entry, getting broader // retrieve the URIs and get the SKOS version of the entry, getting broader
// and narrower terms as applicable as well as any description (skos:note) // and narrower terms as applicable as well as any description (skos:note)
// that might exist // that might exist
@ -99,7 +99,7 @@ public class LCSHService implements ExternalConceptService {
//This is the URL for retrieving the concept - the pattern is http://id.loc.gov/authorities/subjects/sh85014203.skos.rdf //This is the URL for retrieving the concept - the pattern is http://id.loc.gov/authorities/subjects/sh85014203.skos.rdf
//This is not the URI itself which would be http://id.loc.gov/authorities/subjects/sh85014203 //This is not the URI itself which would be http://id.loc.gov/authorities/subjects/sh85014203
String conceptURLString = getSKOSURL(uri); String conceptURLString = getSKOSURL(uri);
String baseConceptURI = getConceptURI(uri); String baseConceptURI = uri;
URL conceptURL = null; URL conceptURL = null;
try { try {
conceptURL = new URL(conceptURLString); conceptURL = new URL(conceptURLString);
@ -154,23 +154,12 @@ public class LCSHService implements ExternalConceptService {
private String getSKOSURL(String uri) { private String getSKOSURL(String uri) {
// Strip .xml at the end and replace with .skos.rdf String skosURI = uri + skosSuffix;
String skosURI = uri;
if (uri.endsWith(".xml")) { return skosURI;
skosURI = uri.substring(0, uri.length() - 4);
skosURI += skosSuffix;
}
return hostUri + skosURI;
} }
//Given the URI from the xml, get just the base URI
private String getConceptURI(String uri) {
String skosURI = uri;
if (uri.endsWith(".xml")) {
skosURI = uri.substring(0, uri.length() - 4);
}
return hostUri + skosURI;
}
public List<String> getConceptURISFromJSON(String results) { public List<String> getConceptURISFromJSON(String results) {
List<String> uris = new ArrayList<String>(); List<String> uris = new ArrayList<String>();
@ -192,14 +181,25 @@ public class LCSHService implements ExternalConceptService {
String conceptUri = new String(); String conceptUri = new String();
try { try {
Document doc = XMLUtils.parse(rdf); Document doc = XMLUtils.parse(rdf);
NodeList nodes = doc.getElementsByTagName("search:result"); NodeList nodes = doc.getElementsByTagName("entry");
int len = nodes.getLength(); int len = nodes.getLength();
int i; int i, j;
for (i = 0; i < len; i++) { for (i = 0; i < len; i++) {
Node node = nodes.item(i); Node node = nodes.item(i);
NamedNodeMap attrs = node.getAttributes(); NodeList childNodes = node.getChildNodes();
Attr idAttr = (Attr) attrs.getNamedItem("uri"); for(j = 0; j < childNodes.getLength(); j++) {
conceptUri = idAttr.getTextContent(); Node childNode = childNodes.item(j);
if(childNode.getNodeName().equals("link")) {
NamedNodeMap attrs = childNode.getAttributes();
Attr hrefAttr = (Attr) attrs.getNamedItem("href");
//if type doesn't exist, this is the direct URL without extension
if((hrefAttr != null) && ((Attr)attrs.getNamedItem("type") == null)) {
conceptUri = hrefAttr.getTextContent();
}
}
}
log.debug("concept uri is " + conceptUri); log.debug("concept uri is " + conceptUri);
uris.add(conceptUri); uris.add(conceptUri);
} }
@ -221,8 +221,7 @@ public class LCSHService implements ExternalConceptService {
} }
/** /**
* @param uri * @param uri URI
* @return
*/ */
protected String stripConceptId(String uri) { protected String stripConceptId(String uri) {
String conceptId = new String(); String conceptId = new String();
@ -232,8 +231,7 @@ public class LCSHService implements ExternalConceptService {
} }
/** /**
* @param str * @param str String with concept id
* @return
*/ */
protected String extractConceptId(String str) { protected String extractConceptId(String str) {
try { try {
@ -251,11 +249,5 @@ public class LCSHService implements ExternalConceptService {
return null; return null;
} }
} }

View file

@ -97,8 +97,7 @@ public class UMLSService implements ExternalConceptService {
} }
/** /**
* @param uri * @param uri URI
* @return
*/ */
public List<Concept> getConceptsByURIWithSparql(String uri) public List<Concept> getConceptsByURIWithSparql(String uri)
throws Exception { throws Exception {
@ -108,8 +107,7 @@ public class UMLSService implements ExternalConceptService {
} }
/** /**
* @param results * @param results Results to process
* @return
*/ */
private List<Concept> processOutput(String results) throws Exception { private List<Concept> processOutput(String results) throws Exception {
@ -193,9 +191,8 @@ public class UMLSService implements ExternalConceptService {
/** /**
* Get a string from a json object or an empty string if there is no value for the given key * Get a string from a json object or an empty string if there is no value for the given key
* @param obj * @param obj JSON Object
* @param key * @param key Key to retrieve
* @return
*/ */
protected String getJsonValue(JSONObject obj, String key) { protected String getJsonValue(JSONObject obj, String key) {
if (obj.has(key)) { if (obj.has(key)) {

View file

@ -18,13 +18,13 @@ import org.apache.commons.lang.StringUtils;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
import com.hp.hpl.jena.rdf.model.Model; import org.apache.jena.rdf.model.Model;
import com.hp.hpl.jena.rdf.model.ModelFactory; import org.apache.jena.rdf.model.ModelFactory;
import com.hp.hpl.jena.rdf.model.NodeIterator; import org.apache.jena.rdf.model.NodeIterator;
import com.hp.hpl.jena.rdf.model.RDFNode; import org.apache.jena.rdf.model.RDFNode;
import com.hp.hpl.jena.rdf.model.ResourceFactory; import org.apache.jena.rdf.model.ResourceFactory;
import com.hp.hpl.jena.rdf.model.Statement; import org.apache.jena.rdf.model.Statement;
import com.hp.hpl.jena.rdf.model.StmtIterator; import org.apache.jena.rdf.model.StmtIterator;
import edu.cornell.mannlib.semservices.bo.Concept; import edu.cornell.mannlib.semservices.bo.Concept;

View file

@ -50,7 +50,6 @@ public class XMLUtils {
/** /**
* @return
* @throws ParserConfigurationException * @throws ParserConfigurationException
*/ */
public static DocumentBuilder getDocumentBuilder() public static DocumentBuilder getDocumentBuilder()
@ -68,8 +67,7 @@ public class XMLUtils {
} }
/** /**
* @param xmlString * @param xmlString XML String
* @return
* @throws IOException * @throws IOException
* @throws SAXException * @throws SAXException
* @throws ParserConfigurationException * @throws ParserConfigurationException
@ -82,8 +80,7 @@ public class XMLUtils {
} }
/** /**
* @param stream * @param stream Input stream
* @return
* @throws IOException * @throws IOException
* @throws SAXException * @throws SAXException
* @throws ParserConfigurationException * @throws ParserConfigurationException
@ -94,9 +91,8 @@ public class XMLUtils {
} }
/** /**
* @param document * @param document DOM Document
* @param name * @param name Name
* @return
*/ */
public static String getElementByName(Document document, String name) { public static String getElementByName(Document document, String name) {
NodeList nodes = document.getElementsByTagName(name); NodeList nodes = document.getElementsByTagName(name);
@ -109,7 +105,7 @@ public class XMLUtils {
} }
/** /**
* @param doc * @param doc DOM Document
* @throws IOException * @throws IOException
*/ */
@SuppressWarnings("deprecation") @SuppressWarnings("deprecation")
@ -130,7 +126,7 @@ public class XMLUtils {
} }
/** /**
* @param xml * @param xml XML String
*/ */
public static void prettyPrint(String xml) { public static void prettyPrint(String xml) {
Source xmlInput = new StreamSource(new StringReader(xml)); Source xmlInput = new StreamSource(new StringReader(xml));
@ -160,7 +156,7 @@ public class XMLUtils {
} }
/** /**
* @param xml * @param xml XML String
*/ */
public static String prettyPrintToString(String xml) { public static String prettyPrintToString(String xml) {
Source xmlInput = new StreamSource(new StringReader(xml)); Source xmlInput = new StreamSource(new StringReader(xml));
@ -190,7 +186,7 @@ public class XMLUtils {
} }
/** /**
* @param node * @param node DOM Node
*/ */
public static void displayNodeInfo(Node node) { public static void displayNodeInfo(Node node) {
switch (node.getNodeType()) { switch (node.getNodeType()) {
@ -222,7 +218,7 @@ public class XMLUtils {
} }
/** /**
* @param node * @param node DOM Node
* @throws IOException * @throws IOException
*/ */
public static void serializeNode(Node node) throws IOException { public static void serializeNode(Node node) throws IOException {
@ -308,7 +304,7 @@ public class XMLUtils {
} }
/** /**
* @param s * @param s String
* @throws IOException * @throws IOException
*/ */
private static void print(String s) throws IOException { private static void print(String s) throws IOException {
@ -336,8 +332,8 @@ public class XMLUtils {
} }
/** /**
* @param doc (either a Document or a Node) * @param obj (either a Document or a Node)
* @param expression * @param expression Expression
* @return string contents * @return string contents
*/ */
public static Node getNodeWithXpath(Object obj, String expression) { public static Node getNodeWithXpath(Object obj, String expression) {

View file

@ -11,8 +11,8 @@ import edu.cornell.mannlib.vitro.webapp.web.templatemodels.individual.Individual
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
import com.hp.hpl.jena.query.QuerySolution; import org.apache.jena.query.QuerySolution;
import com.hp.hpl.jena.query.ResultSet; import org.apache.jena.query.ResultSet;
import edu.cornell.mannlib.vitro.webapp.beans.Individual; import edu.cornell.mannlib.vitro.webapp.beans.Individual;
import edu.cornell.mannlib.vitro.webapp.controller.freemarker.FreemarkerHttpServlet; import edu.cornell.mannlib.vitro.webapp.controller.freemarker.FreemarkerHttpServlet;

View file

@ -16,9 +16,9 @@ import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
import org.json.JSONException; import org.json.JSONException;
import com.hp.hpl.jena.query.QuerySolution; import org.apache.jena.query.QuerySolution;
import com.hp.hpl.jena.query.ResultSet; import org.apache.jena.query.ResultSet;
import com.hp.hpl.jena.rdf.model.RDFNode; import org.apache.jena.rdf.model.RDFNode;
import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest; import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest;
import edu.cornell.mannlib.vitro.webapp.controller.ajax.VitroAjaxController; import edu.cornell.mannlib.vitro.webapp.controller.ajax.VitroAjaxController;

View file

@ -16,9 +16,9 @@ import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
import org.json.JSONException; import org.json.JSONException;
import com.hp.hpl.jena.query.QuerySolution; import org.apache.jena.query.QuerySolution;
import com.hp.hpl.jena.query.ResultSet; import org.apache.jena.query.ResultSet;
import com.hp.hpl.jena.rdf.model.RDFNode; import org.apache.jena.rdf.model.RDFNode;
import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest; import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest;
import edu.cornell.mannlib.vitro.webapp.controller.ajax.VitroAjaxController; import edu.cornell.mannlib.vitro.webapp.controller.ajax.VitroAjaxController;

View file

@ -13,8 +13,8 @@ import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
import org.json.JSONException; import org.json.JSONException;
import com.hp.hpl.jena.query.QuerySolution; import org.apache.jena.query.QuerySolution;
import com.hp.hpl.jena.query.ResultSet; import org.apache.jena.query.ResultSet;
import edu.cornell.mannlib.vitro.webapp.beans.Individual; import edu.cornell.mannlib.vitro.webapp.beans.Individual;
import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest; import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest;

View file

@ -12,12 +12,12 @@ import javax.servlet.http.HttpServletResponse;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
import com.hp.hpl.jena.rdf.model.Model; import org.apache.jena.rdf.model.Model;
import com.hp.hpl.jena.rdf.model.RDFNode; import org.apache.jena.rdf.model.RDFNode;
import com.hp.hpl.jena.rdf.model.ResourceFactory; import org.apache.jena.rdf.model.ResourceFactory;
import com.hp.hpl.jena.rdf.model.Statement; import org.apache.jena.rdf.model.Statement;
import com.hp.hpl.jena.rdf.model.StmtIterator; import org.apache.jena.rdf.model.StmtIterator;
import com.hp.hpl.jena.shared.Lock; import org.apache.jena.shared.Lock;
import edu.cornell.mannlib.vitro.webapp.auth.permissions.SimplePermission; import edu.cornell.mannlib.vitro.webapp.auth.permissions.SimplePermission;
import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.AuthorizationRequest; import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.AuthorizationRequest;

View file

@ -10,9 +10,9 @@ import java.util.Map;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
import com.hp.hpl.jena.query.QuerySolution; import org.apache.jena.query.QuerySolution;
import com.hp.hpl.jena.query.ResultSet; import org.apache.jena.query.ResultSet;
import com.hp.hpl.jena.rdf.model.RDFNode; import org.apache.jena.rdf.model.RDFNode;
import edu.cornell.mannlib.vitro.webapp.auth.permissions.SimplePermission; import edu.cornell.mannlib.vitro.webapp.auth.permissions.SimplePermission;
import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.AuthorizationRequest; import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.AuthorizationRequest;

View file

@ -10,9 +10,9 @@ import java.util.Map;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
import com.hp.hpl.jena.query.QuerySolution; import org.apache.jena.query.QuerySolution;
import com.hp.hpl.jena.query.ResultSet; import org.apache.jena.query.ResultSet;
import com.hp.hpl.jena.rdf.model.RDFNode; import org.apache.jena.rdf.model.RDFNode;
import edu.cornell.mannlib.vitro.webapp.auth.permissions.SimplePermission; import edu.cornell.mannlib.vitro.webapp.auth.permissions.SimplePermission;
import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.AuthorizationRequest; import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.AuthorizationRequest;

View file

@ -10,9 +10,9 @@ import java.util.Map;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
import com.hp.hpl.jena.query.QuerySolution; import org.apache.jena.query.QuerySolution;
import com.hp.hpl.jena.query.ResultSet; import org.apache.jena.query.ResultSet;
import com.hp.hpl.jena.rdf.model.RDFNode; import org.apache.jena.rdf.model.RDFNode;
import edu.cornell.mannlib.vitro.webapp.auth.permissions.SimplePermission; import edu.cornell.mannlib.vitro.webapp.auth.permissions.SimplePermission;
import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.AuthorizationRequest; import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.AuthorizationRequest;

View file

@ -12,9 +12,9 @@ import javax.servlet.http.HttpServletResponse;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
import com.hp.hpl.jena.query.Dataset; import org.apache.jena.query.Dataset;
import com.hp.hpl.jena.query.Syntax; import org.apache.jena.query.Syntax;
import com.hp.hpl.jena.rdf.model.Model; import org.apache.jena.rdf.model.Model;
import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.AuthorizationRequest; import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.AuthorizationRequest;
import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest; import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest;

View file

@ -12,9 +12,9 @@ import javax.servlet.http.HttpServletResponse;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
import com.hp.hpl.jena.query.Dataset; import org.apache.jena.query.Dataset;
import com.hp.hpl.jena.query.Syntax; import org.apache.jena.query.Syntax;
import com.hp.hpl.jena.rdf.model.Model; import org.apache.jena.rdf.model.Model;
import edu.cornell.mannlib.vitro.webapp.controller.VitroHttpServlet; import edu.cornell.mannlib.vitro.webapp.controller.VitroHttpServlet;
import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest; import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest;

View file

@ -13,9 +13,9 @@ import org.apache.commons.lang.StringEscapeUtils;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
import com.hp.hpl.jena.query.Dataset; import org.apache.jena.query.Dataset;
import com.hp.hpl.jena.query.Syntax; import org.apache.jena.query.Syntax;
import com.hp.hpl.jena.rdf.model.Model; import org.apache.jena.rdf.model.Model;
import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.AuthorizationRequest; import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.AuthorizationRequest;
import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest; import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest;

View file

@ -7,9 +7,9 @@ import javax.servlet.ServletContext;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
import com.hp.hpl.jena.query.Dataset; import org.apache.jena.query.Dataset;
import com.hp.hpl.jena.query.Syntax; import org.apache.jena.query.Syntax;
import com.hp.hpl.jena.rdf.model.Model; import org.apache.jena.rdf.model.Model;
import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.AuthorizationRequest; import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.AuthorizationRequest;
import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest; import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest;

View file

@ -19,8 +19,7 @@ public class VisualizationsDependencyInjector {
* This method is used to inject vis dependencies i.e. the vis algorithms that are * This method is used to inject vis dependencies i.e. the vis algorithms that are
* being implemented into the vis controller. Modified Dependency Injection pattern is * being implemented into the vis controller. Modified Dependency Injection pattern is
* used here. XML file containing the location of all the vis is saved in accessible folder. * used here. XML file containing the location of all the vis is saved in accessible folder.
* @param servletContext * @param servletContext Servlet context
* @return
*/ */
private synchronized static Map<String, VisualizationRequestHandler> initVisualizations( private synchronized static Map<String, VisualizationRequestHandler> initVisualizations(
ServletContext servletContext) { ServletContext servletContext) {

View file

@ -6,7 +6,7 @@ import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import com.hp.hpl.jena.rdf.model.Literal; import org.apache.jena.rdf.model.Literal;
import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.N3ValidatorVTwo; import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.N3ValidatorVTwo;
import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.EditConfigurationVTwo; import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.EditConfigurationVTwo;

View file

@ -6,7 +6,7 @@ import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import com.hp.hpl.jena.rdf.model.Literal; import org.apache.jena.rdf.model.Literal;
import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.N3ValidatorVTwo; import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.N3ValidatorVTwo;
import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.EditConfigurationVTwo; import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.EditConfigurationVTwo;

View file

@ -10,7 +10,7 @@ import org.apache.commons.lang.StringUtils;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
import com.hp.hpl.jena.rdf.model.Literal; import org.apache.jena.rdf.model.Literal;
import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.N3ValidatorVTwo; import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.N3ValidatorVTwo;
import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.EditConfigurationVTwo; import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.EditConfigurationVTwo;

View file

@ -10,7 +10,7 @@ import java.util.Map;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import com.hp.hpl.jena.rdf.model.Literal; import org.apache.jena.rdf.model.Literal;
import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.N3ValidatorVTwo; import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.N3ValidatorVTwo;
import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.EditConfigurationVTwo; import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.EditConfigurationVTwo;

View file

@ -16,19 +16,19 @@ import javax.servlet.http.HttpSession;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
import com.hp.hpl.jena.ontology.OntModel; import org.apache.jena.ontology.OntModel;
import com.hp.hpl.jena.query.Query; import org.apache.jena.query.Query;
import com.hp.hpl.jena.query.QueryExecution; import org.apache.jena.query.QueryExecution;
import com.hp.hpl.jena.query.QueryExecutionFactory; import org.apache.jena.query.QueryExecutionFactory;
import com.hp.hpl.jena.query.QueryFactory; import org.apache.jena.query.QueryFactory;
import com.hp.hpl.jena.query.QuerySolution; import org.apache.jena.query.QuerySolution;
import com.hp.hpl.jena.query.ResultSet; import org.apache.jena.query.ResultSet;
import com.hp.hpl.jena.rdf.model.Literal; import org.apache.jena.rdf.model.Literal;
import com.hp.hpl.jena.rdf.model.Model; import org.apache.jena.rdf.model.Model;
import com.hp.hpl.jena.rdf.model.Resource; import org.apache.jena.rdf.model.Resource;
import com.hp.hpl.jena.vocabulary.RDF; import org.apache.jena.vocabulary.RDF;
import com.hp.hpl.jena.vocabulary.RDFS; import org.apache.jena.vocabulary.RDFS;
import com.hp.hpl.jena.vocabulary.XSD; import org.apache.jena.vocabulary.XSD;
import edu.cornell.mannlib.vitro.webapp.beans.Individual; import edu.cornell.mannlib.vitro.webapp.beans.Individual;
import edu.cornell.mannlib.vitro.webapp.beans.ObjectProperty; import edu.cornell.mannlib.vitro.webapp.beans.ObjectProperty;

View file

@ -12,20 +12,20 @@ import java.util.Map.Entry;
import javax.servlet.http.HttpSession; import javax.servlet.http.HttpSession;
import com.hp.hpl.jena.query.QueryExecution; import org.apache.jena.query.QueryExecution;
import com.hp.hpl.jena.query.QueryExecutionFactory; import org.apache.jena.query.QueryExecutionFactory;
import com.hp.hpl.jena.rdf.model.Model; import org.apache.jena.rdf.model.Model;
import com.hp.hpl.jena.rdf.model.ModelFactory; import org.apache.jena.rdf.model.ModelFactory;
import edu.cornell.mannlib.vitro.webapp.rdfservice.RDFService; import edu.cornell.mannlib.vitro.webapp.rdfservice.RDFService;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
import com.hp.hpl.jena.query.QuerySolution; import org.apache.jena.query.QuerySolution;
import com.hp.hpl.jena.query.ResultSet; import org.apache.jena.query.ResultSet;
import com.hp.hpl.jena.rdf.model.RDFNode; import org.apache.jena.rdf.model.RDFNode;
import com.hp.hpl.jena.rdf.model.Literal; import org.apache.jena.rdf.model.Literal;
import com.hp.hpl.jena.vocabulary.RDFS; import org.apache.jena.vocabulary.RDFS;
import com.hp.hpl.jena.vocabulary.XSD; import org.apache.jena.vocabulary.XSD;
import edu.cornell.mannlib.vitro.webapp.beans.DataPropertyComparator; import edu.cornell.mannlib.vitro.webapp.beans.DataPropertyComparator;
import edu.cornell.mannlib.vitro.webapp.beans.DataPropertyStatement; import edu.cornell.mannlib.vitro.webapp.beans.DataPropertyStatement;

View file

@ -10,13 +10,13 @@ import javax.servlet.http.HttpSession;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
import com.hp.hpl.jena.query.QuerySolution; import org.apache.jena.query.QuerySolution;
import com.hp.hpl.jena.query.ResultSet; import org.apache.jena.query.ResultSet;
import com.hp.hpl.jena.rdf.model.Literal; import org.apache.jena.rdf.model.Literal;
import com.hp.hpl.jena.rdf.model.Model; import org.apache.jena.rdf.model.Model;
import com.hp.hpl.jena.rdf.model.ModelFactory; import org.apache.jena.rdf.model.ModelFactory;
import com.hp.hpl.jena.rdf.model.RDFNode; import org.apache.jena.rdf.model.RDFNode;
import com.hp.hpl.jena.vocabulary.XSD; import org.apache.jena.vocabulary.XSD;
import edu.cornell.mannlib.vitro.webapp.beans.Individual; import edu.cornell.mannlib.vitro.webapp.beans.Individual;
import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest; import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest;

View file

@ -12,20 +12,20 @@ import java.util.Map.Entry;
import javax.servlet.http.HttpSession; import javax.servlet.http.HttpSession;
import com.hp.hpl.jena.query.QueryExecution; import org.apache.jena.query.QueryExecution;
import com.hp.hpl.jena.query.QueryExecutionFactory; import org.apache.jena.query.QueryExecutionFactory;
import com.hp.hpl.jena.rdf.model.Model; import org.apache.jena.rdf.model.Model;
import com.hp.hpl.jena.rdf.model.ModelFactory; import org.apache.jena.rdf.model.ModelFactory;
import edu.cornell.mannlib.vitro.webapp.rdfservice.RDFService; import edu.cornell.mannlib.vitro.webapp.rdfservice.RDFService;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
import com.hp.hpl.jena.query.QuerySolution; import org.apache.jena.query.QuerySolution;
import com.hp.hpl.jena.query.ResultSet; import org.apache.jena.query.ResultSet;
import com.hp.hpl.jena.rdf.model.RDFNode; import org.apache.jena.rdf.model.RDFNode;
import com.hp.hpl.jena.rdf.model.Literal; import org.apache.jena.rdf.model.Literal;
import com.hp.hpl.jena.vocabulary.RDFS; import org.apache.jena.vocabulary.RDFS;
import com.hp.hpl.jena.vocabulary.XSD; import org.apache.jena.vocabulary.XSD;
import edu.cornell.mannlib.vitro.webapp.beans.DataPropertyComparator; import edu.cornell.mannlib.vitro.webapp.beans.DataPropertyComparator;
import edu.cornell.mannlib.vitro.webapp.beans.DataPropertyStatement; import edu.cornell.mannlib.vitro.webapp.beans.DataPropertyStatement;

View file

@ -8,14 +8,14 @@ import java.util.List;
import javax.servlet.http.HttpSession; import javax.servlet.http.HttpSession;
import com.hp.hpl.jena.query.Query; import org.apache.jena.query.Query;
import com.hp.hpl.jena.query.QueryExecution; import org.apache.jena.query.QueryExecution;
import com.hp.hpl.jena.query.QueryExecutionFactory; import org.apache.jena.query.QueryExecutionFactory;
import com.hp.hpl.jena.query.QueryFactory; import org.apache.jena.query.QueryFactory;
import com.hp.hpl.jena.rdf.model.RDFNode; import org.apache.jena.rdf.model.RDFNode;
import com.hp.hpl.jena.rdf.model.Resource; import org.apache.jena.rdf.model.Resource;
import com.hp.hpl.jena.sparql.resultset.ResultSetMem; import org.apache.jena.sparql.resultset.ResultSetMem;
import com.hp.hpl.jena.vocabulary.XSD; import org.apache.jena.vocabulary.XSD;
import edu.cornell.mannlib.vitro.webapp.beans.Individual; import edu.cornell.mannlib.vitro.webapp.beans.Individual;
import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest; import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest;

View file

@ -14,7 +14,7 @@ import javax.servlet.http.HttpSession;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
import com.hp.hpl.jena.vocabulary.XSD; import org.apache.jena.vocabulary.XSD;
import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest; import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest;
import edu.cornell.mannlib.vitro.webapp.dao.VitroVocabulary; import edu.cornell.mannlib.vitro.webapp.dao.VitroVocabulary;

View file

@ -14,11 +14,11 @@ import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
import org.vivoweb.webapp.util.ModelUtils; import org.vivoweb.webapp.util.ModelUtils;
import com.hp.hpl.jena.ontology.OntModel; import org.apache.jena.ontology.OntModel;
import com.hp.hpl.jena.rdf.model.Literal; import org.apache.jena.rdf.model.Literal;
import com.hp.hpl.jena.vocabulary.RDF; import org.apache.jena.vocabulary.RDF;
import com.hp.hpl.jena.vocabulary.RDFS; import org.apache.jena.vocabulary.RDFS;
import com.hp.hpl.jena.vocabulary.XSD; import org.apache.jena.vocabulary.XSD;
import edu.cornell.mannlib.vitro.webapp.beans.ObjectProperty; import edu.cornell.mannlib.vitro.webapp.beans.ObjectProperty;
import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest; import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest;
@ -556,9 +556,9 @@ public class AddGrantRoleToPersonGenerator implements EditConfigurationGenerator
/** /**
* Prepare edit configuration for update * Prepare edit configuration for update
* @param vreq * @param vreq - current VitroRequest
* @param session * @param session - the HTTP session
* @param editConfiguration * @param editConfiguration - Edit configuration
*/ */
private void prepareForUpdate(VitroRequest vreq, HttpSession session, EditConfigurationVTwo editConfiguration) { private void prepareForUpdate(VitroRequest vreq, HttpSession session, EditConfigurationVTwo editConfiguration) {

View file

@ -14,7 +14,7 @@ import javax.servlet.http.HttpSession;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
import com.hp.hpl.jena.vocabulary.XSD; import org.apache.jena.vocabulary.XSD;
import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest; import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest;
import edu.cornell.mannlib.vitro.webapp.dao.VitroVocabulary; import edu.cornell.mannlib.vitro.webapp.dao.VitroVocabulary;

View file

@ -6,7 +6,7 @@ import java.util.Arrays;
import javax.servlet.http.HttpSession; import javax.servlet.http.HttpSession;
import com.hp.hpl.jena.vocabulary.XSD; import org.apache.jena.vocabulary.XSD;
import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest; import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest;
import edu.cornell.mannlib.vitro.webapp.dao.VitroVocabulary; import edu.cornell.mannlib.vitro.webapp.dao.VitroVocabulary;

View file

@ -9,15 +9,15 @@ import java.util.Map;
import javax.servlet.http.HttpSession; import javax.servlet.http.HttpSession;
import com.hp.hpl.jena.query.Query; import org.apache.jena.query.Query;
import com.hp.hpl.jena.query.QueryExecution; import org.apache.jena.query.QueryExecution;
import com.hp.hpl.jena.query.QueryExecutionFactory; import org.apache.jena.query.QueryExecutionFactory;
import com.hp.hpl.jena.query.QueryFactory; import org.apache.jena.query.QueryFactory;
import com.hp.hpl.jena.rdf.model.Literal; import org.apache.jena.rdf.model.Literal;
import com.hp.hpl.jena.rdf.model.RDFNode; import org.apache.jena.rdf.model.RDFNode;
import com.hp.hpl.jena.rdf.model.Resource; import org.apache.jena.rdf.model.Resource;
import com.hp.hpl.jena.sparql.resultset.ResultSetMem; import org.apache.jena.sparql.resultset.ResultSetMem;
import com.hp.hpl.jena.vocabulary.XSD; import org.apache.jena.vocabulary.XSD;
import edu.cornell.mannlib.vitro.webapp.beans.Individual; import edu.cornell.mannlib.vitro.webapp.beans.Individual;
import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest; import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest;

View file

@ -16,9 +16,9 @@ import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
import org.vivoweb.webapp.util.ModelUtils; import org.vivoweb.webapp.util.ModelUtils;
import com.hp.hpl.jena.vocabulary.RDF; import org.apache.jena.vocabulary.RDF;
import com.hp.hpl.jena.vocabulary.RDFS; import org.apache.jena.vocabulary.RDFS;
import com.hp.hpl.jena.vocabulary.XSD; import org.apache.jena.vocabulary.XSD;
import edu.cornell.mannlib.vitro.webapp.beans.ObjectProperty; import edu.cornell.mannlib.vitro.webapp.beans.ObjectProperty;
import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest; import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest;
@ -436,7 +436,6 @@ public abstract class AddRoleToPersonTwoStageGenerator extends BaseEditConfigura
/** /**
* Utility method for subclasses to make a query for type from a ChildVClassesOptions object. * Utility method for subclasses to make a query for type from a ChildVClassesOptions object.
* @throws Exception
*/ */
protected String getActivityTypeQueryForChildVClassOptions(VitroRequest vreq, ChildVClassesOptions opts){ protected String getActivityTypeQueryForChildVClassOptions(VitroRequest vreq, ChildVClassesOptions opts){
log.debug("objectClassUri = " + opts.getClassUri()); log.debug("objectClassUri = " + opts.getClassUri());
@ -447,7 +446,6 @@ public abstract class AddRoleToPersonTwoStageGenerator extends BaseEditConfigura
/** /**
* Utility method for subclasses to make a query for type from a IndividualsViaClassGroupOptions object. * Utility method for subclasses to make a query for type from a IndividualsViaClassGroupOptions object.
* @throws Exception
*/ */
protected String getActivityTypeQueryForIndividualsViaClassGroupOptions(VitroRequest vreq, IndividualsViaClassGroupOptions opts){ protected String getActivityTypeQueryForIndividualsViaClassGroupOptions(VitroRequest vreq, IndividualsViaClassGroupOptions opts){
log.debug("ClassGroupUri = " + opts.getClassGroupUri()); log.debug("ClassGroupUri = " + opts.getClassGroupUri());

View file

@ -13,8 +13,8 @@ import javax.servlet.http.HttpSession;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
import com.hp.hpl.jena.rdf.model.Literal; import org.apache.jena.rdf.model.Literal;
import com.hp.hpl.jena.vocabulary.XSD; import org.apache.jena.vocabulary.XSD;
import edu.cornell.mannlib.vitro.webapp.beans.DataPropertyStatement; import edu.cornell.mannlib.vitro.webapp.beans.DataPropertyStatement;
import edu.cornell.mannlib.vitro.webapp.beans.ObjectProperty; import edu.cornell.mannlib.vitro.webapp.beans.ObjectProperty;

View file

@ -8,7 +8,7 @@ import java.util.Map;
import javax.servlet.http.HttpSession; import javax.servlet.http.HttpSession;
import com.hp.hpl.jena.vocabulary.XSD; import org.apache.jena.vocabulary.XSD;
import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest; import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest;
import edu.cornell.mannlib.vitro.webapp.dao.VitroVocabulary; import edu.cornell.mannlib.vitro.webapp.dao.VitroVocabulary;

View file

@ -8,7 +8,7 @@ import java.util.List;
import javax.servlet.http.HttpSession; import javax.servlet.http.HttpSession;
import com.hp.hpl.jena.vocabulary.XSD; import org.apache.jena.vocabulary.XSD;
import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest; import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest;
import edu.cornell.mannlib.vitro.webapp.dao.VitroVocabulary; import edu.cornell.mannlib.vitro.webapp.dao.VitroVocabulary;

View file

@ -21,9 +21,9 @@ import javax.servlet.http.HttpSession;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
import com.hp.hpl.jena.query.QuerySolution; import org.apache.jena.query.QuerySolution;
import com.hp.hpl.jena.query.ResultSet; import org.apache.jena.query.ResultSet;
import com.hp.hpl.jena.rdf.model.Literal; import org.apache.jena.rdf.model.Literal;
import edu.cornell.mannlib.vitro.webapp.auth.policy.PolicyHelper; import edu.cornell.mannlib.vitro.webapp.auth.policy.PolicyHelper;
import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.propstmt.AddDataPropertyStatement; import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.propstmt.AddDataPropertyStatement;
@ -556,6 +556,6 @@ public class ManageLabelsForPersonGenerator extends BaseEditConfigurationGenerat
} }
} }
private String N3_PREFIX = "@prefix foaf:<http://xmlns.com/foaf/0.1/> .\n"; private String N3_PREFIX = "@prefix foaf: <http://xmlns.com/foaf/0.1/> .\n";
} }

View file

@ -7,17 +7,17 @@ import java.util.Map;
import javax.servlet.http.HttpSession; import javax.servlet.http.HttpSession;
import com.hp.hpl.jena.query.QueryExecution; import org.apache.jena.query.QueryExecution;
import com.hp.hpl.jena.query.QueryExecutionFactory; import org.apache.jena.query.QueryExecutionFactory;
import com.hp.hpl.jena.rdf.model.Model; import org.apache.jena.rdf.model.Model;
import com.hp.hpl.jena.rdf.model.ModelFactory; import org.apache.jena.rdf.model.ModelFactory;
import edu.cornell.mannlib.vitro.webapp.rdfservice.RDFService; import edu.cornell.mannlib.vitro.webapp.rdfservice.RDFService;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
import com.hp.hpl.jena.query.QuerySolution; import org.apache.jena.query.QuerySolution;
import com.hp.hpl.jena.query.ResultSet; import org.apache.jena.query.ResultSet;
import com.hp.hpl.jena.rdf.model.RDFNode; import org.apache.jena.rdf.model.RDFNode;
import edu.cornell.mannlib.vitro.webapp.beans.Individual; import edu.cornell.mannlib.vitro.webapp.beans.Individual;
import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest; import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest;

View file

@ -8,7 +8,7 @@ import java.util.Map;
import javax.servlet.http.HttpSession; import javax.servlet.http.HttpSession;
import com.hp.hpl.jena.vocabulary.XSD; import org.apache.jena.vocabulary.XSD;
import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest; import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest;
import edu.cornell.mannlib.vitro.webapp.dao.VitroVocabulary; import edu.cornell.mannlib.vitro.webapp.dao.VitroVocabulary;

View file

@ -8,7 +8,7 @@ import java.util.List;
import javax.servlet.http.HttpSession; import javax.servlet.http.HttpSession;
import com.hp.hpl.jena.vocabulary.XSD; import org.apache.jena.vocabulary.XSD;
import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest; import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest;
import edu.cornell.mannlib.vitro.webapp.dao.VitroVocabulary; import edu.cornell.mannlib.vitro.webapp.dao.VitroVocabulary;

View file

@ -5,7 +5,7 @@ import java.util.Arrays;
import javax.servlet.http.HttpSession; import javax.servlet.http.HttpSession;
import com.hp.hpl.jena.vocabulary.XSD; import org.apache.jena.vocabulary.XSD;
import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest; import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest;
import edu.cornell.mannlib.vitro.webapp.dao.VitroVocabulary; import edu.cornell.mannlib.vitro.webapp.dao.VitroVocabulary;

View file

@ -7,7 +7,7 @@ import java.util.HashMap;
import javax.servlet.http.HttpSession; import javax.servlet.http.HttpSession;
import com.hp.hpl.jena.vocabulary.XSD; import org.apache.jena.vocabulary.XSD;
import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest; import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest;
import edu.cornell.mannlib.vitro.webapp.dao.VitroVocabulary; import edu.cornell.mannlib.vitro.webapp.dao.VitroVocabulary;

View file

@ -7,7 +7,7 @@ import java.util.HashMap;
import javax.servlet.http.HttpSession; import javax.servlet.http.HttpSession;
import com.hp.hpl.jena.vocabulary.XSD; import org.apache.jena.vocabulary.XSD;
import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest; import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest;
import edu.cornell.mannlib.vitro.webapp.dao.VitroVocabulary; import edu.cornell.mannlib.vitro.webapp.dao.VitroVocabulary;

View file

@ -6,7 +6,7 @@ import java.util.Arrays;
import javax.servlet.http.HttpSession; import javax.servlet.http.HttpSession;
import com.hp.hpl.jena.vocabulary.XSD; import org.apache.jena.vocabulary.XSD;
import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest; import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest;
import edu.cornell.mannlib.vitro.webapp.dao.VitroVocabulary; import edu.cornell.mannlib.vitro.webapp.dao.VitroVocabulary;

View file

@ -8,7 +8,7 @@ import java.util.List;
import javax.servlet.http.HttpSession; import javax.servlet.http.HttpSession;
import com.hp.hpl.jena.vocabulary.XSD; import org.apache.jena.vocabulary.XSD;
import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest; import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest;
import edu.cornell.mannlib.vitro.webapp.dao.VitroVocabulary; import edu.cornell.mannlib.vitro.webapp.dao.VitroVocabulary;

View file

@ -14,7 +14,7 @@ import javax.servlet.http.HttpSession;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
import com.hp.hpl.jena.vocabulary.XSD; import org.apache.jena.vocabulary.XSD;
import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest; import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest;
import edu.cornell.mannlib.vitro.webapp.dao.VitroVocabulary; import edu.cornell.mannlib.vitro.webapp.dao.VitroVocabulary;

View file

@ -8,7 +8,7 @@ import java.util.Map;
import javax.servlet.http.HttpSession; import javax.servlet.http.HttpSession;
import com.hp.hpl.jena.vocabulary.XSD; import org.apache.jena.vocabulary.XSD;
import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest; import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest;
import edu.cornell.mannlib.vitro.webapp.dao.VitroVocabulary; import edu.cornell.mannlib.vitro.webapp.dao.VitroVocabulary;

View file

@ -9,7 +9,7 @@ import java.util.List;
import javax.servlet.http.HttpSession; import javax.servlet.http.HttpSession;
import com.hp.hpl.jena.vocabulary.XSD; import org.apache.jena.vocabulary.XSD;
import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest; import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest;
import edu.cornell.mannlib.vitro.webapp.dao.VitroVocabulary; import edu.cornell.mannlib.vitro.webapp.dao.VitroVocabulary;

View file

@ -14,7 +14,7 @@ import javax.servlet.http.HttpSession;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
import com.hp.hpl.jena.vocabulary.XSD; import org.apache.jena.vocabulary.XSD;
import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest; import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest;
import edu.cornell.mannlib.vitro.webapp.dao.VitroVocabulary; import edu.cornell.mannlib.vitro.webapp.dao.VitroVocabulary;

View file

@ -8,7 +8,7 @@ import java.util.List;
import javax.servlet.http.HttpSession; import javax.servlet.http.HttpSession;
import com.hp.hpl.jena.vocabulary.XSD; import org.apache.jena.vocabulary.XSD;
import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest; import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest;
import edu.cornell.mannlib.vitro.webapp.dao.VitroVocabulary; import edu.cornell.mannlib.vitro.webapp.dao.VitroVocabulary;

View file

@ -14,7 +14,7 @@ import javax.servlet.http.HttpSession;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
import com.hp.hpl.jena.vocabulary.XSD; import org.apache.jena.vocabulary.XSD;
import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest; import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest;
import edu.cornell.mannlib.vitro.webapp.dao.VitroVocabulary; import edu.cornell.mannlib.vitro.webapp.dao.VitroVocabulary;

View file

@ -15,11 +15,11 @@ import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import com.hp.hpl.jena.rdf.model.Literal; import org.apache.jena.rdf.model.Literal;
import com.hp.hpl.jena.rdf.model.Model; import org.apache.jena.rdf.model.Model;
import com.hp.hpl.jena.rdf.model.ModelFactory; import org.apache.jena.rdf.model.ModelFactory;
import com.hp.hpl.jena.vocabulary.XSD; import org.apache.jena.vocabulary.XSD;
import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest; import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest;
import edu.cornell.mannlib.vitro.webapp.dao.VitroVocabulary; import edu.cornell.mannlib.vitro.webapp.dao.VitroVocabulary;

View file

@ -35,11 +35,11 @@ public class VIVODefaultAddMissingIndividualFormGenerator extends DefaultAddMiss
protected List<String> getN3Prefixes() { protected List<String> getN3Prefixes() {
List<String> prefixStrings = super.getN3Prefixes(); List<String> prefixStrings = super.getN3Prefixes();
prefixStrings.add("@prefix vcard:<http://www.w3.org/2006/vcard/ns#> ."); prefixStrings.add("@prefix vcard: <http://www.w3.org/2006/vcard/ns#> .");
return prefixStrings; return prefixStrings;
} }
private String getN3ForName() { protected String getN3ForName() {
return "?" + objectVarName + " rdfs:label ?label ."; return "?" + objectVarName + " rdfs:label ?label .";
} }

View file

@ -9,9 +9,9 @@ import java.util.List;
import javax.servlet.http.HttpSession; import javax.servlet.http.HttpSession;
import com.hp.hpl.jena.rdf.model.Literal; import org.apache.jena.rdf.model.Literal;
import com.hp.hpl.jena.vocabulary.RDFS; import org.apache.jena.vocabulary.RDFS;
import com.hp.hpl.jena.vocabulary.XSD; import org.apache.jena.vocabulary.XSD;
import edu.cornell.mannlib.vitro.webapp.beans.VClass; import edu.cornell.mannlib.vitro.webapp.beans.VClass;
import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest; import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest;
@ -43,7 +43,7 @@ public class VIVONewIndividualFormGenerator extends BaseEditConfigurationGenerat
//Person uses first name and last name whereas individual of other class would use label //Person uses first name and last name whereas individual of other class would use label
//middle name is also optional //middle name is also optional
config.setN3Optional(list( config.setN3Optional(list(
N3_PREFIX + "@prefix vcard:<http://www.w3.org/2006/vcard/ns#> .\n" N3_PREFIX + "@prefix vcard: <http://www.w3.org/2006/vcard/ns#> .\n"
+ " ?newInd <http://purl.obolibrary.org/obo/ARG_2000028> ?newVcardInd . \n" + " ?newInd <http://purl.obolibrary.org/obo/ARG_2000028> ?newVcardInd . \n"
+ " ?newVcardInd <http://purl.obolibrary.org/obo/ARG_2000029> ?newInd . \n" + " ?newVcardInd <http://purl.obolibrary.org/obo/ARG_2000029> ?newInd . \n"
+ " ?newVcardInd a vcard:Individual . \n" + " ?newVcardInd a vcard:Individual . \n"
@ -52,7 +52,7 @@ public class VIVONewIndividualFormGenerator extends BaseEditConfigurationGenerat
+ " ?newVcardName vcard:givenName ?firstName . \n" + " ?newVcardName vcard:givenName ?firstName . \n"
+ " ?newVcardName vcard:familyName ?lastName . \n", + " ?newVcardName vcard:familyName ?lastName . \n",
N3_PREFIX + " ?newInd <" + RDFS.label.getURI() + "> ?label .", N3_PREFIX + " ?newInd <" + RDFS.label.getURI() + "> ?label .",
N3_PREFIX + "@prefix vcard:<http://www.w3.org/2006/vcard/ns#> .\n" N3_PREFIX + "@prefix vcard: <http://www.w3.org/2006/vcard/ns#> .\n"
+ " ?newInd <http://purl.obolibrary.org/obo/ARG_2000028> ?newVcardInd . \n" + " ?newInd <http://purl.obolibrary.org/obo/ARG_2000028> ?newVcardInd . \n"
+ " ?newVcardInd a vcard:Individual . \n" + " ?newVcardInd a vcard:Individual . \n"
+ " ?newVcardInd vcard:hasName ?newVcardName . \n" + " ?newVcardInd vcard:hasName ?newVcardName . \n"
@ -204,5 +204,5 @@ public class VIVONewIndividualFormGenerator extends BaseEditConfigurationGenerat
editConfiguration.setLiteralsInScope(new HashMap<String, List<Literal>>()); editConfiguration.setLiteralsInScope(new HashMap<String, List<Literal>>());
} }
private String N3_PREFIX = "@prefix foaf:<http://xmlns.com/foaf/0.1/> .\n"; private String N3_PREFIX = "@prefix foaf: <http://xmlns.com/foaf/0.1/> .\n";
} }

View file

@ -16,19 +16,19 @@ import org.apache.commons.lang.StringUtils;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
import com.hp.hpl.jena.ontology.OntModel; import org.apache.jena.ontology.OntModel;
import com.hp.hpl.jena.query.Query; import org.apache.jena.query.Query;
import com.hp.hpl.jena.query.QueryExecution; import org.apache.jena.query.QueryExecution;
import com.hp.hpl.jena.query.QueryExecutionFactory; import org.apache.jena.query.QueryExecutionFactory;
import com.hp.hpl.jena.query.QueryFactory; import org.apache.jena.query.QueryFactory;
import com.hp.hpl.jena.query.QuerySolution; import org.apache.jena.query.QuerySolution;
import com.hp.hpl.jena.query.ResultSet; import org.apache.jena.query.ResultSet;
import com.hp.hpl.jena.rdf.model.Literal; import org.apache.jena.rdf.model.Literal;
import com.hp.hpl.jena.rdf.model.Resource; import org.apache.jena.rdf.model.Resource;
import com.hp.hpl.jena.vocabulary.OWL; import org.apache.jena.vocabulary.OWL;
import com.hp.hpl.jena.vocabulary.RDF; import org.apache.jena.vocabulary.RDF;
import com.hp.hpl.jena.vocabulary.RDFS; import org.apache.jena.vocabulary.RDFS;
import com.hp.hpl.jena.vocabulary.XSD; import org.apache.jena.vocabulary.XSD;
import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest; import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest;
import edu.cornell.mannlib.vitro.webapp.dao.WebappDaoFactory; import edu.cornell.mannlib.vitro.webapp.dao.WebappDaoFactory;

View file

@ -7,17 +7,17 @@ import javax.servlet.http.HttpServletRequest;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
import com.hp.hpl.jena.ontology.OntModel; import org.apache.jena.ontology.OntModel;
import com.hp.hpl.jena.query.Query; import org.apache.jena.query.Query;
import com.hp.hpl.jena.query.QueryExecution; import org.apache.jena.query.QueryExecution;
import com.hp.hpl.jena.query.QueryExecutionFactory; import org.apache.jena.query.QueryExecutionFactory;
import com.hp.hpl.jena.query.QueryFactory; import org.apache.jena.query.QueryFactory;
import com.hp.hpl.jena.query.Syntax; import org.apache.jena.query.Syntax;
import com.hp.hpl.jena.rdf.model.Model; import org.apache.jena.rdf.model.Model;
import com.hp.hpl.jena.rdf.model.ModelFactory; import org.apache.jena.rdf.model.ModelFactory;
import com.hp.hpl.jena.shared.Lock; import org.apache.jena.shared.Lock;
import com.hp.hpl.jena.vocabulary.RDF; import org.apache.jena.vocabulary.RDF;
import com.hp.hpl.jena.vocabulary.RDFS; import org.apache.jena.vocabulary.RDFS;
import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest; import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest;
import edu.cornell.mannlib.vitro.webapp.modelaccess.ModelAccess; import edu.cornell.mannlib.vitro.webapp.modelaccess.ModelAccess;

View file

@ -9,13 +9,13 @@ import java.util.Map;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import com.hp.hpl.jena.ontology.OntModel; import org.apache.jena.ontology.OntModel;
import com.hp.hpl.jena.rdf.model.Literal; import org.apache.jena.rdf.model.Literal;
import com.hp.hpl.jena.rdf.model.Model; import org.apache.jena.rdf.model.Model;
import com.hp.hpl.jena.rdf.model.Property; import org.apache.jena.rdf.model.Property;
import com.hp.hpl.jena.rdf.model.ResIterator; import org.apache.jena.rdf.model.ResIterator;
import com.hp.hpl.jena.rdf.model.Resource; import org.apache.jena.rdf.model.Resource;
import com.hp.hpl.jena.rdf.model.Statement; import org.apache.jena.rdf.model.Statement;
import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest; import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest;
import edu.cornell.mannlib.vitro.webapp.dao.VitroVocabulary; import edu.cornell.mannlib.vitro.webapp.dao.VitroVocabulary;

View file

@ -13,20 +13,20 @@ import org.apache.commons.lang.StringUtils;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
import com.hp.hpl.jena.query.Query; import org.apache.jena.query.Query;
import com.hp.hpl.jena.query.QueryExecution; import org.apache.jena.query.QueryExecution;
import com.hp.hpl.jena.query.QueryExecutionFactory; import org.apache.jena.query.QueryExecutionFactory;
import com.hp.hpl.jena.query.QueryFactory; import org.apache.jena.query.QueryFactory;
import com.hp.hpl.jena.query.QuerySolution; import org.apache.jena.query.QuerySolution;
import com.hp.hpl.jena.query.ResultSet; import org.apache.jena.query.ResultSet;
import com.hp.hpl.jena.rdf.model.Literal; import org.apache.jena.rdf.model.Literal;
import com.hp.hpl.jena.rdf.model.Model; import org.apache.jena.rdf.model.Model;
import com.hp.hpl.jena.rdf.model.ModelFactory; import org.apache.jena.rdf.model.ModelFactory;
import com.hp.hpl.jena.rdf.model.Resource; import org.apache.jena.rdf.model.Resource;
import com.hp.hpl.jena.rdf.model.ResourceFactory; import org.apache.jena.rdf.model.ResourceFactory;
import com.hp.hpl.jena.vocabulary.XSD; import org.apache.jena.vocabulary.XSD;
import com.hp.hpl.jena.rdf.model.Property; import org.apache.jena.rdf.model.Property;
import com.hp.hpl.jena.shared.Lock; import org.apache.jena.shared.Lock;
import edu.cornell.mannlib.vitro.webapp.beans.ObjectProperty; import edu.cornell.mannlib.vitro.webapp.beans.ObjectProperty;
import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest; import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest;

View file

@ -13,20 +13,20 @@ import org.apache.commons.lang.StringUtils;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
import com.hp.hpl.jena.query.Query; import org.apache.jena.query.Query;
import com.hp.hpl.jena.query.QueryExecution; import org.apache.jena.query.QueryExecution;
import com.hp.hpl.jena.query.QueryExecutionFactory; import org.apache.jena.query.QueryExecutionFactory;
import com.hp.hpl.jena.query.QueryFactory; import org.apache.jena.query.QueryFactory;
import com.hp.hpl.jena.query.QuerySolution; import org.apache.jena.query.QuerySolution;
import com.hp.hpl.jena.query.ResultSet; import org.apache.jena.query.ResultSet;
import com.hp.hpl.jena.rdf.model.Literal; import org.apache.jena.rdf.model.Literal;
import com.hp.hpl.jena.rdf.model.Model; import org.apache.jena.rdf.model.Model;
import com.hp.hpl.jena.rdf.model.ModelFactory; import org.apache.jena.rdf.model.ModelFactory;
import com.hp.hpl.jena.rdf.model.Resource; import org.apache.jena.rdf.model.Resource;
import com.hp.hpl.jena.rdf.model.ResourceFactory; import org.apache.jena.rdf.model.ResourceFactory;
import com.hp.hpl.jena.vocabulary.XSD; import org.apache.jena.vocabulary.XSD;
import com.hp.hpl.jena.rdf.model.Property; import org.apache.jena.rdf.model.Property;
import com.hp.hpl.jena.shared.Lock; import org.apache.jena.shared.Lock;
import edu.cornell.mannlib.vitro.webapp.beans.ObjectProperty; import edu.cornell.mannlib.vitro.webapp.beans.ObjectProperty;
import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest; import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest;

View file

@ -12,16 +12,16 @@ import java.util.Map;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
import com.hp.hpl.jena.ontology.OntModel; import org.apache.jena.ontology.OntModel;
import com.hp.hpl.jena.query.Query; import org.apache.jena.query.Query;
import com.hp.hpl.jena.query.QueryExecution; import org.apache.jena.query.QueryExecution;
import com.hp.hpl.jena.query.QueryExecutionFactory; import org.apache.jena.query.QueryExecutionFactory;
import com.hp.hpl.jena.query.QueryFactory; import org.apache.jena.query.QueryFactory;
import com.hp.hpl.jena.query.QuerySolution; import org.apache.jena.query.QuerySolution;
import com.hp.hpl.jena.query.ResultSet; import org.apache.jena.query.ResultSet;
import com.hp.hpl.jena.rdf.model.Literal; import org.apache.jena.rdf.model.Literal;
import com.hp.hpl.jena.rdf.model.Resource; import org.apache.jena.rdf.model.Resource;
import com.hp.hpl.jena.rdf.model.ResourceFactory; import org.apache.jena.rdf.model.ResourceFactory;
import edu.cornell.mannlib.vitro.webapp.dao.DisplayVocabulary; import edu.cornell.mannlib.vitro.webapp.dao.DisplayVocabulary;
import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.fields.FieldVTwo; import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.fields.FieldVTwo;

View file

@ -11,20 +11,20 @@ import java.util.Set;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
import com.hp.hpl.jena.query.Dataset; import org.apache.jena.query.Dataset;
import com.hp.hpl.jena.query.DatasetFactory; import org.apache.jena.query.DatasetFactory;
import com.hp.hpl.jena.query.Query; import org.apache.jena.query.Query;
import com.hp.hpl.jena.query.QueryExecution; import org.apache.jena.query.QueryExecution;
import com.hp.hpl.jena.query.QueryExecutionFactory; import org.apache.jena.query.QueryExecutionFactory;
import com.hp.hpl.jena.query.QueryFactory; import org.apache.jena.query.QueryFactory;
import com.hp.hpl.jena.query.QuerySolution; import org.apache.jena.query.QuerySolution;
import com.hp.hpl.jena.query.QuerySolutionMap; import org.apache.jena.query.QuerySolutionMap;
import com.hp.hpl.jena.query.ResultSet; import org.apache.jena.query.ResultSet;
import com.hp.hpl.jena.query.Syntax; import org.apache.jena.query.Syntax;
import com.hp.hpl.jena.rdf.model.RDFNode; import org.apache.jena.rdf.model.RDFNode;
import com.hp.hpl.jena.rdf.model.Resource; import org.apache.jena.rdf.model.Resource;
import com.hp.hpl.jena.rdf.model.ResourceFactory; import org.apache.jena.rdf.model.ResourceFactory;
import com.hp.hpl.jena.shared.Lock; import org.apache.jena.shared.Lock;
import edu.cornell.mannlib.vitro.webapp.beans.Individual; import edu.cornell.mannlib.vitro.webapp.beans.Individual;
import edu.cornell.mannlib.vitro.webapp.modelaccess.ContextModelAccess; import edu.cornell.mannlib.vitro.webapp.modelaccess.ContextModelAccess;

View file

@ -16,9 +16,9 @@ import java.util.Set;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
import com.hp.hpl.jena.rdf.model.ResourceFactory; import org.apache.jena.rdf.model.ResourceFactory;
import com.hp.hpl.jena.rdf.model.Statement; import org.apache.jena.rdf.model.Statement;
import com.hp.hpl.jena.vocabulary.RDFS; import org.apache.jena.vocabulary.RDFS;
import edu.cornell.mannlib.vitro.webapp.beans.Individual; import edu.cornell.mannlib.vitro.webapp.beans.Individual;
import edu.cornell.mannlib.vitro.webapp.beans.VClass; import edu.cornell.mannlib.vitro.webapp.beans.VClass;

View file

@ -12,18 +12,18 @@ import javax.servlet.ServletContext;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
import com.hp.hpl.jena.query.Query; import org.apache.jena.query.Query;
import com.hp.hpl.jena.query.QueryExecution; import org.apache.jena.query.QueryExecution;
import com.hp.hpl.jena.query.QueryExecutionFactory; import org.apache.jena.query.QueryExecutionFactory;
import com.hp.hpl.jena.query.QueryFactory; import org.apache.jena.query.QueryFactory;
import com.hp.hpl.jena.query.QuerySolution; import org.apache.jena.query.QuerySolution;
import com.hp.hpl.jena.query.QuerySolutionMap; import org.apache.jena.query.QuerySolutionMap;
import com.hp.hpl.jena.query.ResultSet; import org.apache.jena.query.ResultSet;
import com.hp.hpl.jena.rdf.model.Model; import org.apache.jena.rdf.model.Model;
import com.hp.hpl.jena.rdf.model.RDFNode; import org.apache.jena.rdf.model.RDFNode;
import com.hp.hpl.jena.rdf.model.ResourceFactory; import org.apache.jena.rdf.model.ResourceFactory;
import com.hp.hpl.jena.rdf.model.Statement; import org.apache.jena.rdf.model.Statement;
import com.hp.hpl.jena.rdf.model.StmtIterator; import org.apache.jena.rdf.model.StmtIterator;
import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest; import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest;
import edu.cornell.mannlib.vitro.webapp.dao.DisplayVocabulary; import edu.cornell.mannlib.vitro.webapp.dao.DisplayVocabulary;

View file

@ -7,11 +7,11 @@ import java.util.Map;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
import com.hp.hpl.jena.rdf.model.Model; import org.apache.jena.rdf.model.Model;
import com.hp.hpl.jena.rdf.model.ModelFactory; import org.apache.jena.rdf.model.ModelFactory;
import com.hp.hpl.jena.rdf.model.Resource; import org.apache.jena.rdf.model.Resource;
import com.hp.hpl.jena.rdf.model.ResourceFactory; import org.apache.jena.rdf.model.ResourceFactory;
import com.hp.hpl.jena.vocabulary.RDF; import org.apache.jena.vocabulary.RDF;
import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest; import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest;
import edu.cornell.mannlib.vitro.webapp.dao.DisplayVocabulary; import edu.cornell.mannlib.vitro.webapp.dao.DisplayVocabulary;

View file

@ -11,10 +11,10 @@ import javax.servlet.ServletContext;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
import com.hp.hpl.jena.ontology.OntModel; import org.apache.jena.ontology.OntModel;
import com.hp.hpl.jena.rdf.model.RDFNode; import org.apache.jena.rdf.model.RDFNode;
import com.hp.hpl.jena.rdf.model.ResourceFactory; import org.apache.jena.rdf.model.ResourceFactory;
import com.hp.hpl.jena.rdf.model.StmtIterator; import org.apache.jena.rdf.model.StmtIterator;
import edu.cornell.mannlib.vitro.webapp.dao.VitroVocabulary; import edu.cornell.mannlib.vitro.webapp.dao.VitroVocabulary;
import edu.cornell.mannlib.vitro.webapp.modelaccess.ModelAccess; import edu.cornell.mannlib.vitro.webapp.modelaccess.ModelAccess;

View file

@ -3,13 +3,13 @@
package edu.cornell.mannlib.vitro.webapp.visualization.capabilitymap; package edu.cornell.mannlib.vitro.webapp.visualization.capabilitymap;
import com.google.gson.Gson; import com.google.gson.Gson;
import com.hp.hpl.jena.query.Dataset; import org.apache.jena.query.Dataset;
import com.hp.hpl.jena.query.QueryExecution; import org.apache.jena.query.QueryExecution;
import com.hp.hpl.jena.query.QueryExecutionFactory; import org.apache.jena.query.QueryExecutionFactory;
import com.hp.hpl.jena.query.QuerySolution; import org.apache.jena.query.QuerySolution;
import com.hp.hpl.jena.rdf.model.Literal; import org.apache.jena.rdf.model.Literal;
import com.hp.hpl.jena.rdf.model.Model; import org.apache.jena.rdf.model.Model;
import com.hp.hpl.jena.rdf.model.ModelFactory; import org.apache.jena.rdf.model.ModelFactory;
import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.AuthorizationRequest; import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.AuthorizationRequest;
import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest; import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest;
import edu.cornell.mannlib.vitro.webapp.controller.freemarker.responsevalues.ResponseValues; import edu.cornell.mannlib.vitro.webapp.controller.freemarker.responsevalues.ResponseValues;
@ -50,10 +50,10 @@ public class CapabilityMapRequestHandler implements VisualizationRequestHandler
@Override @Override
public Object generateAjaxVisualization(VitroRequest vitroRequest, Log log, Dataset dataSource) throws MalformedQueryParametersException { public Object generateAjaxVisualization(VitroRequest vitroRequest, Log log, Dataset dataSource) throws MalformedQueryParametersException {
ConceptLabelMap conceptLabelMap = VisualizationCaches.conceptToLabel.get(vitroRequest.getRDFService()); ConceptLabelMap conceptLabelMap = VisualizationCaches.conceptToLabel.getNoWait(vitroRequest.getRDFService());
ConceptPeopleMap conceptPeopleMap = VisualizationCaches.conceptToPeopleMap.get(vitroRequest.getRDFService()); ConceptPeopleMap conceptPeopleMap = VisualizationCaches.conceptToPeopleMap.getNoWait(vitroRequest.getRDFService());
OrganizationPeopleMap organizationPeopleMap = VisualizationCaches.organisationToPeopleMap.get(vitroRequest.getRDFService()); OrganizationPeopleMap organizationPeopleMap = VisualizationCaches.organisationToPeopleMap.getNoWait(vitroRequest.getRDFService());
Map<String, String> organizationLabels = VisualizationCaches.organizationLabels.get(vitroRequest.getRDFService()); Map<String, String> organizationLabels = VisualizationCaches.organizationLabels.getNoWait(vitroRequest.getRDFService());
String data = vitroRequest.getParameter("data"); String data = vitroRequest.getParameter("data");
if (!StringUtils.isEmpty(data)) { if (!StringUtils.isEmpty(data)) {

View file

@ -12,10 +12,10 @@ import java.util.Map;
import java.util.Set; import java.util.Set;
import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentHashMap;
import com.hp.hpl.jena.query.QueryExecution; import org.apache.jena.query.QueryExecution;
import com.hp.hpl.jena.query.QueryExecutionFactory; import org.apache.jena.query.QueryExecutionFactory;
import com.hp.hpl.jena.rdf.model.Model; import org.apache.jena.rdf.model.Model;
import com.hp.hpl.jena.rdf.model.ModelFactory; import org.apache.jena.rdf.model.ModelFactory;
import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest; import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest;
import edu.cornell.mannlib.vitro.webapp.rdfservice.RDFService; import edu.cornell.mannlib.vitro.webapp.rdfservice.RDFService;
import edu.cornell.mannlib.vitro.webapp.rdfservice.RDFServiceException; import edu.cornell.mannlib.vitro.webapp.rdfservice.RDFServiceException;
@ -28,9 +28,9 @@ import org.apache.jena.iri.IRI;
import org.apache.jena.iri.IRIFactory; import org.apache.jena.iri.IRIFactory;
import org.apache.jena.iri.Violation; import org.apache.jena.iri.Violation;
import com.hp.hpl.jena.query.QuerySolution; import org.apache.jena.query.QuerySolution;
import com.hp.hpl.jena.query.Syntax; import org.apache.jena.query.Syntax;
import com.hp.hpl.jena.rdf.model.RDFNode; import org.apache.jena.rdf.model.RDFNode;
import edu.cornell.mannlib.vitro.webapp.visualization.collaborationutils.CoAuthorshipData; import edu.cornell.mannlib.vitro.webapp.visualization.collaborationutils.CoAuthorshipData;
import edu.cornell.mannlib.vitro.webapp.visualization.collaborationutils.CollaboratorComparator; import edu.cornell.mannlib.vitro.webapp.visualization.collaborationutils.CollaboratorComparator;

View file

@ -12,7 +12,7 @@ import org.apache.commons.lang.StringEscapeUtils;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import com.hp.hpl.jena.query.Dataset; import org.apache.jena.query.Dataset;
import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.AuthorizationRequest; import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.AuthorizationRequest;
import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest; import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest;
@ -177,8 +177,7 @@ public class CoAuthorshipRequestHandler implements VisualizationRequestHandler {
/** /**
* Provides response when a csv file containing number & names of unique co-authors per * Provides response when a csv file containing number & names of unique co-authors per
* year is requested. * year is requested.
* @param authorNodesAndEdges * @param authorNodesAndEdges Author nodes and edges
* @param response
*/ */
private Map<String, String> prepareCoauthorsCountPerYearDataResponse( private Map<String, String> prepareCoauthorsCountPerYearDataResponse(
CollaborationData authorNodesAndEdges) { CollaborationData authorNodesAndEdges) {
@ -214,8 +213,7 @@ public class CoAuthorshipRequestHandler implements VisualizationRequestHandler {
/** /**
* Provides response when a csv file containing number & names of unique co-authors per * Provides response when a csv file containing number & names of unique co-authors per
* year is requested. * year is requested.
* @param authorNodesAndEdges * @param coAuthorshipData Co authorship data
* @param response
*/ */
private Map<String, String> prepareCoauthorsListDataResponse( private Map<String, String> prepareCoauthorsListDataResponse(
CollaborationData coAuthorshipData) { CollaborationData coAuthorshipData) {
@ -246,8 +244,7 @@ public class CoAuthorshipRequestHandler implements VisualizationRequestHandler {
/** /**
* Provides a response when graphml formatted co-authorship network is requested, typically by * Provides a response when graphml formatted co-authorship network is requested, typically by
* the flash vis. * the flash vis.
* @param authorNodesAndEdges * @param authorNodesAndEdges Author nodes and edges
* @param response
*/ */
private Map<String, String> prepareNetworkStreamDataResponse( private Map<String, String> prepareNetworkStreamDataResponse(
CollaborationData authorNodesAndEdges) { CollaborationData authorNodesAndEdges) {

View file

@ -62,8 +62,8 @@ public class CoAuthorshipVisCodeGenerator {
/** /**
* This method is used to setup parameters for the sparkline value object. These parameters * This method is used to setup parameters for the sparkline value object. These parameters
* will be used in the template to construct the actual html/javascript code. * will be used in the template to construct the actual html/javascript code.
* @param visMode * @param visMode Visualization mode
* @param visContainer * @param providedVisContainerID Container ID
*/ */
private SparklineData setupSparklineParameters(String visMode, private SparklineData setupSparklineParameters(String visMode,
String providedVisContainerID) { String providedVisContainerID) {

View file

@ -15,14 +15,14 @@ import org.apache.jena.iri.IRI;
import org.apache.jena.iri.IRIFactory; import org.apache.jena.iri.IRIFactory;
import org.apache.jena.iri.Violation; import org.apache.jena.iri.Violation;
import com.hp.hpl.jena.query.Dataset; import org.apache.jena.query.Dataset;
import com.hp.hpl.jena.query.Query; import org.apache.jena.query.Query;
import com.hp.hpl.jena.query.QueryExecution; import org.apache.jena.query.QueryExecution;
import com.hp.hpl.jena.query.QueryExecutionFactory; import org.apache.jena.query.QueryExecutionFactory;
import com.hp.hpl.jena.query.QueryFactory; import org.apache.jena.query.QueryFactory;
import com.hp.hpl.jena.query.Syntax; import org.apache.jena.query.Syntax;
import com.hp.hpl.jena.rdf.model.Model; import org.apache.jena.rdf.model.Model;
import com.hp.hpl.jena.rdf.model.ModelFactory; import org.apache.jena.rdf.model.ModelFactory;
import edu.cornell.mannlib.vitro.webapp.visualization.constants.QueryConstants; import edu.cornell.mannlib.vitro.webapp.visualization.constants.QueryConstants;
import edu.cornell.mannlib.vitro.webapp.visualization.exceptions.MalformedQueryParametersException; import edu.cornell.mannlib.vitro.webapp.visualization.exceptions.MalformedQueryParametersException;

View file

@ -24,9 +24,9 @@ import org.apache.jena.iri.IRI;
import org.apache.jena.iri.IRIFactory; import org.apache.jena.iri.IRIFactory;
import org.apache.jena.iri.Violation; import org.apache.jena.iri.Violation;
import com.hp.hpl.jena.query.QuerySolution; import org.apache.jena.query.QuerySolution;
import com.hp.hpl.jena.query.Syntax; import org.apache.jena.query.Syntax;
import com.hp.hpl.jena.rdf.model.RDFNode; import org.apache.jena.rdf.model.RDFNode;
import edu.cornell.mannlib.vitro.webapp.visualization.collaborationutils.CoInvestigationData; import edu.cornell.mannlib.vitro.webapp.visualization.collaborationutils.CoInvestigationData;
import edu.cornell.mannlib.vitro.webapp.visualization.collaborationutils.CollaborationData; import edu.cornell.mannlib.vitro.webapp.visualization.collaborationutils.CollaborationData;

View file

@ -10,8 +10,8 @@ import org.apache.commons.lang.StringEscapeUtils;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import com.hp.hpl.jena.query.Dataset; import org.apache.jena.query.Dataset;
import com.hp.hpl.jena.rdf.model.Model; import org.apache.jena.rdf.model.Model;
import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.AuthorizationRequest; import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.AuthorizationRequest;
import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest; import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest;
@ -174,8 +174,7 @@ public class CoPIGrantCountRequestHandler implements VisualizationRequestHandler
/** /**
* Provides response when a csv file containing number & names of unique co-pis per * Provides response when a csv file containing number & names of unique co-pis per
* year is requested. * year is requested.
* @param piNodesAndEdges * @param piNodesAndEdges PI nodes and edges
* @param response
*/ */
private Map<String, String> prepareCoPIsCountPerYearDataResponse( private Map<String, String> prepareCoPIsCountPerYearDataResponse(
CollaborationData piNodesAndEdges) { CollaborationData piNodesAndEdges) {
@ -211,8 +210,7 @@ public class CoPIGrantCountRequestHandler implements VisualizationRequestHandler
/** /**
* Provides response when a csv file containing number & names of unique co-pis per * Provides response when a csv file containing number & names of unique co-pis per
* year is requested. * year is requested.
* @param coPIData * @param coPIData Co Principal Investigator Data
* @param response
*/ */
private Map<String, String> prepareCoPIsListDataResponse(CollaborationData coPIData) { private Map<String, String> prepareCoPIsListDataResponse(CollaborationData coPIData) {
@ -242,8 +240,7 @@ public class CoPIGrantCountRequestHandler implements VisualizationRequestHandler
/** /**
* Provides a response when graphml formatted co-pi network is requested, typically by * Provides a response when graphml formatted co-pi network is requested, typically by
* the flash vis. * the flash vis.
* @param coPIData * @param coPIData Co Investigator data
* @param response
*/ */
private Map<String, String> prepareNetworkStreamDataResponse(CollaborationData coPIData) { private Map<String, String> prepareNetworkStreamDataResponse(CollaborationData coPIData) {

View file

@ -69,8 +69,8 @@ public class CoPIVisCodeGenerator {
/** /**
* This method is used to setup parameters for the sparkline value object. These parameters * This method is used to setup parameters for the sparkline value object. These parameters
* will be used in the template to construct the actual html/javascript code. * will be used in the template to construct the actual html/javascript code.
* @param visMode * @param visMode Visualization mode
* @param visContainer * @param providedVisContainerID Container ID
*/ */
private SparklineData setupSparklineParameters(String visMode, private SparklineData setupSparklineParameters(String visMode,
String providedVisContainerID) { String providedVisContainerID) {

View file

@ -9,8 +9,9 @@ import java.util.HashSet;
import java.util.Map; import java.util.Map;
import java.util.Set; import java.util.Set;
import com.hp.hpl.jena.query.QuerySolution; import org.apache.jena.query.QuerySolution;
import edu.cornell.mannlib.vitro.webapp.beans.Individual; import edu.cornell.mannlib.vitro.webapp.beans.Individual;
import edu.cornell.mannlib.vitro.webapp.config.ConfigurationProperties;
import edu.cornell.mannlib.vitro.webapp.rdfservice.RDFService; import edu.cornell.mannlib.vitro.webapp.rdfservice.RDFService;
import edu.cornell.mannlib.vitro.webapp.rdfservice.RDFServiceException; import edu.cornell.mannlib.vitro.webapp.rdfservice.RDFServiceException;
import edu.cornell.mannlib.vitro.webapp.rdfservice.ResultSetConsumer; import edu.cornell.mannlib.vitro.webapp.rdfservice.ResultSetConsumer;
@ -26,7 +27,7 @@ import org.apache.commons.lang.StringUtils;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import com.google.gson.Gson; import com.google.gson.Gson;
import com.hp.hpl.jena.query.Dataset; import org.apache.jena.query.Dataset;
import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.AuthorizationRequest; import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.AuthorizationRequest;
import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest; import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest;
@ -450,7 +451,15 @@ public class MapOfScienceVisualizationRequestHandler implements VisualizationReq
body.put("vivoDefaultNamespace", vreq.getWebappDaoFactory().getDefaultNamespace()); body.put("vivoDefaultNamespace", vreq.getWebappDaoFactory().getDefaultNamespace());
ConfigurationProperties properties = ConfigurationProperties.getBean(vreq);
if (properties != null) {
String key = properties.getProperty("google.maps.key");
if (!StringUtils.isEmpty(key)) {
body.put("googleMapsKey", key);
}
}
return new TemplateResponseValues(standaloneTemplate, body); return new TemplateResponseValues(standaloneTemplate, body);
} }

View file

@ -13,7 +13,7 @@ import edu.cornell.mannlib.vitro.webapp.visualization.utilities.VisualizationCac
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import com.google.gson.Gson; import com.google.gson.Gson;
import com.hp.hpl.jena.query.Dataset; import org.apache.jena.query.Dataset;
import edu.cornell.mannlib.vitro.webapp.auth.permissions.SimplePermission; import edu.cornell.mannlib.vitro.webapp.auth.permissions.SimplePermission;
import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.AuthorizationRequest; import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.AuthorizationRequest;

View file

@ -4,7 +4,7 @@ package edu.cornell.mannlib.vitro.webapp.visualization.modelconstructor;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
import com.hp.hpl.jena.rdf.model.Model; import org.apache.jena.rdf.model.Model;
import edu.cornell.mannlib.vitro.webapp.rdfservice.RDFService; import edu.cornell.mannlib.vitro.webapp.rdfservice.RDFService;
import edu.cornell.mannlib.vitro.webapp.visualization.exceptions.MalformedQueryParametersException; import edu.cornell.mannlib.vitro.webapp.visualization.exceptions.MalformedQueryParametersException;

View file

@ -8,9 +8,9 @@ import edu.cornell.mannlib.vitro.webapp.rdfservice.RDFService;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
import com.hp.hpl.jena.query.Syntax; import org.apache.jena.query.Syntax;
import com.hp.hpl.jena.rdf.model.Model; import org.apache.jena.rdf.model.Model;
import com.hp.hpl.jena.rdf.model.ModelFactory; import org.apache.jena.rdf.model.ModelFactory;
import edu.cornell.mannlib.vitro.webapp.visualization.constants.QueryConstants; import edu.cornell.mannlib.vitro.webapp.visualization.constants.QueryConstants;
import edu.cornell.mannlib.vitro.webapp.visualization.exceptions.MalformedQueryParametersException; import edu.cornell.mannlib.vitro.webapp.visualization.exceptions.MalformedQueryParametersException;

View file

@ -1,7 +1,7 @@
/* $This file is distributed under the terms of the license in /doc/license.txt$ */ /* $This file is distributed under the terms of the license in /doc/license.txt$ */
package edu.cornell.mannlib.vitro.webapp.visualization.modelconstructor.factory; package edu.cornell.mannlib.vitro.webapp.visualization.modelconstructor.factory;
import com.hp.hpl.jena.rdf.model.Model; import org.apache.jena.rdf.model.Model;
import edu.cornell.mannlib.vitro.webapp.rdfservice.RDFService; import edu.cornell.mannlib.vitro.webapp.rdfservice.RDFService;
import edu.cornell.mannlib.vitro.webapp.visualization.exceptions.MalformedQueryParametersException; import edu.cornell.mannlib.vitro.webapp.visualization.exceptions.MalformedQueryParametersException;

View file

@ -2,15 +2,15 @@
package edu.cornell.mannlib.vitro.webapp.visualization.persongrantcount; package edu.cornell.mannlib.vitro.webapp.visualization.persongrantcount;
import com.hp.hpl.jena.query.Query; import org.apache.jena.query.Query;
import com.hp.hpl.jena.query.QueryExecution; import org.apache.jena.query.QueryExecution;
import com.hp.hpl.jena.query.QueryExecutionFactory; import org.apache.jena.query.QueryExecutionFactory;
import com.hp.hpl.jena.query.QueryFactory; import org.apache.jena.query.QueryFactory;
import com.hp.hpl.jena.query.QuerySolution; import org.apache.jena.query.QuerySolution;
import com.hp.hpl.jena.query.Syntax; import org.apache.jena.query.Syntax;
import com.hp.hpl.jena.rdf.model.Model; import org.apache.jena.rdf.model.Model;
import com.hp.hpl.jena.rdf.model.ModelFactory; import org.apache.jena.rdf.model.ModelFactory;
import com.hp.hpl.jena.rdf.model.RDFNode; import org.apache.jena.rdf.model.RDFNode;
import edu.cornell.mannlib.vitro.webapp.rdfservice.RDFService; import edu.cornell.mannlib.vitro.webapp.rdfservice.RDFService;
import edu.cornell.mannlib.vitro.webapp.rdfservice.RDFServiceException; import edu.cornell.mannlib.vitro.webapp.rdfservice.RDFServiceException;
import edu.cornell.mannlib.vitro.webapp.rdfservice.ResultSetConsumer; import edu.cornell.mannlib.vitro.webapp.rdfservice.ResultSetConsumer;

View file

@ -11,7 +11,7 @@ import edu.cornell.mannlib.vitro.webapp.visualization.visutils.QueryRunner;
import org.apache.commons.lang.StringEscapeUtils; import org.apache.commons.lang.StringEscapeUtils;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import com.hp.hpl.jena.query.Dataset; import org.apache.jena.query.Dataset;
import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.AuthorizationRequest; import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.AuthorizationRequest;
import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest; import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest;
@ -199,9 +199,8 @@ public class PersonGrantCountRequestHandler implements VisualizationRequestHandl
/** /**
* Provides response when csv file containing the grant count over the years * Provides response when csv file containing the grant count over the years
* is requested. * is requested.
* @param investigator * @param investigator Investigator entiry
* @param yearToGrantCount * @param yearToGrantCount Year / grant counts
* @return
*/ */
private Map<String, String> prepareDataResponse( private Map<String, String> prepareDataResponse(
SubEntity investigator, SubEntity investigator,
@ -225,9 +224,8 @@ public class PersonGrantCountRequestHandler implements VisualizationRequestHandl
/** /**
* Provides response when an entire page dedicated to grant sparkline is requested. * Provides response when an entire page dedicated to grant sparkline is requested.
* @param vreq * @param vreq Vitro Request
* @param valueObjectContainer * @param valueObjectContainer Sparkline data
* @return
*/ */
private TemplateResponseValues prepareStandaloneResponse(VitroRequest vreq, private TemplateResponseValues prepareStandaloneResponse(VitroRequest vreq,
SparklineData valueObjectContainer) { SparklineData valueObjectContainer) {
@ -245,10 +243,9 @@ public class PersonGrantCountRequestHandler implements VisualizationRequestHandl
/** /**
* Provides response when the grant sparkline has to be rendered in already existing * Provides response when the grant sparkline has to be rendered in already existing
* page, e.g. profile page. * page, e.g. profile page.
* @param vreq * @param vreq Vitro Request
* @param valueObjectContainer * @param valueObjectContainer Sparkline data
* @param shouldVIVOrenderVis * @param shouldVIVOrenderVis Flag to render visualization
* @return
*/ */
private TemplateResponseValues prepareDynamicResponse( private TemplateResponseValues prepareDynamicResponse(
VitroRequest vreq, VitroRequest vreq,

View file

@ -60,10 +60,8 @@ public class PersonGrantCountVisCodeGenerator {
/** /**
* This method is used to setup parameters for the sparkline value object. These parameters * This method is used to setup parameters for the sparkline value object. These parameters
* will be used in the template to construct the actual html/javascript code. * will be used in the template to construct the actual html/javascript code.
* @param visMode * @param visMode Visualisation mode
* @param visContainer * @param providedVisContainerID Container ID
* @param authorDocuments
* @return
*/ */
private SparklineData setupSparklineParameters(String visMode, private SparklineData setupSparklineParameters(String visMode,
String providedVisContainerID) { String providedVisContainerID) {

View file

@ -11,7 +11,7 @@ import edu.cornell.mannlib.vitro.webapp.visualization.collaborationutils.CoInves
import edu.cornell.mannlib.vitro.webapp.visualization.visutils.CollaborationDataViewHelper; import edu.cornell.mannlib.vitro.webapp.visualization.visutils.CollaborationDataViewHelper;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import com.hp.hpl.jena.query.Dataset; import org.apache.jena.query.Dataset;
import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.AuthorizationRequest; import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.AuthorizationRequest;
import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest; import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest;

View file

@ -5,12 +5,12 @@ package edu.cornell.mannlib.vitro.webapp.visualization.personpubcount;
import java.util.HashSet; import java.util.HashSet;
import java.util.Set; import java.util.Set;
import com.hp.hpl.jena.rdf.model.Model; import org.apache.jena.rdf.model.Model;
import com.hp.hpl.jena.rdf.model.ModelFactory; import org.apache.jena.rdf.model.ModelFactory;
import com.hp.hpl.jena.rdf.model.Resource; import org.apache.jena.rdf.model.Resource;
import com.hp.hpl.jena.rdf.model.ResourceFactory; import org.apache.jena.rdf.model.ResourceFactory;
import com.hp.hpl.jena.rdf.model.Statement; import org.apache.jena.rdf.model.Statement;
import com.hp.hpl.jena.vocabulary.RDFS; import org.apache.jena.vocabulary.RDFS;
import edu.cornell.mannlib.vitro.webapp.rdfservice.RDFService; import edu.cornell.mannlib.vitro.webapp.rdfservice.RDFService;
import edu.cornell.mannlib.vitro.webapp.rdfservice.RDFServiceException; import edu.cornell.mannlib.vitro.webapp.rdfservice.RDFServiceException;
import edu.cornell.mannlib.vitro.webapp.rdfservice.ResultSetConsumer; import edu.cornell.mannlib.vitro.webapp.rdfservice.ResultSetConsumer;
@ -20,15 +20,15 @@ import org.apache.jena.iri.IRI;
import org.apache.jena.iri.IRIFactory; import org.apache.jena.iri.IRIFactory;
import org.apache.jena.iri.Violation; import org.apache.jena.iri.Violation;
import com.hp.hpl.jena.query.Dataset; import org.apache.jena.query.Dataset;
import com.hp.hpl.jena.query.Query; import org.apache.jena.query.Query;
import com.hp.hpl.jena.query.QueryExecution; import org.apache.jena.query.QueryExecution;
import com.hp.hpl.jena.query.QueryExecutionFactory; import org.apache.jena.query.QueryExecutionFactory;
import com.hp.hpl.jena.query.QueryFactory; import org.apache.jena.query.QueryFactory;
import com.hp.hpl.jena.query.QuerySolution; import org.apache.jena.query.QuerySolution;
import com.hp.hpl.jena.query.ResultSet; import org.apache.jena.query.ResultSet;
import com.hp.hpl.jena.query.Syntax; import org.apache.jena.query.Syntax;
import com.hp.hpl.jena.rdf.model.RDFNode; import org.apache.jena.rdf.model.RDFNode;
import edu.cornell.mannlib.vitro.webapp.visualization.constants.QueryConstants; import edu.cornell.mannlib.vitro.webapp.visualization.constants.QueryConstants;
import edu.cornell.mannlib.vitro.webapp.visualization.constants.QueryFieldLabels; import edu.cornell.mannlib.vitro.webapp.visualization.constants.QueryFieldLabels;

View file

@ -11,7 +11,7 @@ import org.apache.commons.lang.StringEscapeUtils;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import com.hp.hpl.jena.query.Dataset; import org.apache.jena.query.Dataset;
import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.AuthorizationRequest; import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.AuthorizationRequest;
import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest; import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest;
@ -217,10 +217,8 @@ VisualizationRequestHandler {
* Provides response when csv file containing the publication count over the * Provides response when csv file containing the publication count over the
* years is requested. * years is requested.
* *
* @param author * @param authorName Name of author
* @param authorDocuments * @param yearToPublicationCount Year / publication counts
* @param yearToPublicationCount
* @return
*/ */
private Map<String, String> prepareDataResponse(String authorName, private Map<String, String> prepareDataResponse(String authorName,
Map<String, Integer> yearToPublicationCount) { Map<String, Integer> yearToPublicationCount) {
@ -251,9 +249,8 @@ VisualizationRequestHandler {
* Provides response when an entire page dedicated to publication sparkline * Provides response when an entire page dedicated to publication sparkline
* is requested. * is requested.
* *
* @param vreq * @param vreq Vitro Request
* @param valueObjectContainer * @param valueObjectContainer Sparkline Data
* @return
*/ */
private TemplateResponseValues prepareStandaloneResponse(VitroRequest vreq, private TemplateResponseValues prepareStandaloneResponse(VitroRequest vreq,
SparklineData valueObjectContainer) { SparklineData valueObjectContainer) {
@ -272,10 +269,10 @@ VisualizationRequestHandler {
* Provides response when the publication sparkline has to be rendered in * Provides response when the publication sparkline has to be rendered in
* already existing page, e.g. profile page. * already existing page, e.g. profile page.
* *
* @param vreq * @param vreq Vitro Request
* @param valueObjectContainer * @param valueObjectContainer Sparkline data
* @param yearToPublicationCount * @param shouldVIVOrenderVis Flag to render visualization
* @return * @param requestingTemplate Requesting template name
*/ */
private TemplateResponseValues prepareDynamicResponse(VitroRequest vreq, private TemplateResponseValues prepareDynamicResponse(VitroRequest vreq,
SparklineData valueObjectContainer, boolean shouldVIVOrenderVis, String requestingTemplate) { SparklineData valueObjectContainer, boolean shouldVIVOrenderVis, String requestingTemplate) {

View file

@ -62,9 +62,8 @@ public class PersonPublicationCountVisCodeGenerator {
/** /**
* This method is used to setup parameters for the sparkline value object. These parameters * This method is used to setup parameters for the sparkline value object. These parameters
* will be used in the template to construct the actual html/javascript code. * will be used in the template to construct the actual html/javascript code.
* @param visMode * @param visMode Visualization mode
* @param visContainer * @param providedVisContainerID container id
* @return
*/ */
private SparklineData setupSparklineParameters(String visMode, private SparklineData setupSparklineParameters(String visMode,
String providedVisContainerID) { String providedVisContainerID) {

View file

@ -9,10 +9,10 @@ import org.apache.commons.logging.Log;
import org.apache.jena.iri.IRI; import org.apache.jena.iri.IRI;
import org.apache.jena.iri.IRIFactory; import org.apache.jena.iri.IRIFactory;
import com.hp.hpl.jena.query.Dataset; import org.apache.jena.query.Dataset;
import com.hp.hpl.jena.query.QuerySolution; import org.apache.jena.query.QuerySolution;
import com.hp.hpl.jena.query.ResultSet; import org.apache.jena.query.ResultSet;
import com.hp.hpl.jena.rdf.model.RDFNode; import org.apache.jena.rdf.model.RDFNode;
import edu.cornell.mannlib.vitro.webapp.beans.Individual; import edu.cornell.mannlib.vitro.webapp.beans.Individual;
import edu.cornell.mannlib.vitro.webapp.config.ConfigurationProperties; import edu.cornell.mannlib.vitro.webapp.config.ConfigurationProperties;

View file

@ -20,7 +20,7 @@ import org.apache.commons.lang.StringUtils;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import com.google.gson.Gson; import com.google.gson.Gson;
import com.hp.hpl.jena.query.Dataset; import org.apache.jena.query.Dataset;
import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.AuthorizationRequest; import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.AuthorizationRequest;
import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest; import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest;

View file

@ -20,7 +20,7 @@ import org.apache.commons.lang.StringUtils;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import com.google.gson.Gson; import com.google.gson.Gson;
import com.hp.hpl.jena.query.Dataset; import org.apache.jena.query.Dataset;
import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.AuthorizationRequest; import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.AuthorizationRequest;
import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest; import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest;

View file

@ -7,7 +7,7 @@ import java.util.Map;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import com.hp.hpl.jena.query.Dataset; import org.apache.jena.query.Dataset;
import edu.cornell.mannlib.vitro.webapp.auth.permissions.SimplePermission; import edu.cornell.mannlib.vitro.webapp.auth.permissions.SimplePermission;
import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.AuthorizationRequest; import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.AuthorizationRequest;

View file

@ -5,20 +5,20 @@ package edu.cornell.mannlib.vitro.webapp.visualization.utilities;
import edu.cornell.mannlib.vitro.webapp.rdfservice.RDFService; import edu.cornell.mannlib.vitro.webapp.rdfservice.RDFService;
import edu.cornell.mannlib.vitro.webapp.utils.threads.VitroBackgroundThread; import edu.cornell.mannlib.vitro.webapp.utils.threads.VitroBackgroundThread;
import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
import java.util.HashSet; import java.util.HashSet;
import java.util.Map; import java.util.Map;
import java.util.Set; import java.util.Set;
import java.util.concurrent.Callable; import java.util.concurrent.Callable;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.ExecutionException; import java.util.concurrent.ExecutionException;
import java.util.concurrent.FutureTask; import java.util.concurrent.FutureTask;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException; import java.util.concurrent.TimeoutException;
/** /**
* Utilicy class that populates and returns a cache. * Utility class that populates and returns a cache.
* Once the cache is populated, it can return the cached results whilst refreshing in the background. * Once the cache is populated, it can return the cached results whilst refreshing in the background.
* *
* @param <T> * @param <T>
@ -30,7 +30,7 @@ public class CachingRDFServiceExecutor<T> {
private T cachedResults; private T cachedResults;
private long lastCacheTime; private long lastCacheTime;
private RDFServiceCallable<T> resultBuilder; private final RDFServiceCallable<T> resultBuilder;
/** /**
* Background task tracker * Background task tracker
@ -59,9 +59,28 @@ public class CachingRDFServiceExecutor<T> {
* Will wait for completion if the cache is not already populated, otherwise the refresh will happen in the background. * Will wait for completion if the cache is not already populated, otherwise the refresh will happen in the background.
* *
* @param rdfService an RDF service to use, in foreground mode, if the background service is missing * @param rdfService an RDF service to use, in foreground mode, if the background service is missing
* @return
*/ */
public synchronized T get(RDFService rdfService) { public synchronized T get(RDFService rdfService) {
return get(rdfService, false);
}
/**
* Return the cached results if present, or start the task.
* Will wait for completion if the cache is not already populated, otherwise the refresh will happen in the background.
*
* @param rdfService an RDF service to use, in foreground mode, if the background service is missing
*/
public synchronized T getNoWait(RDFService rdfService) {
return get(rdfService, true);
}
/**
* Return the cached results if present, or start the task.
* Will wait for completion if the cache is not already populated, otherwise the refresh will happen in the background.
*
* @param rdfService an RDF service to use, in foreground mode, if the background service is missing
*/
public synchronized T get(RDFService rdfService, boolean allowWaits) {
// First, check if there are results from the previous background task, and update the cache // First, check if there are results from the previous background task, and update the cache
if (backgroundTask != null && backgroundTask.isDone()) { if (backgroundTask != null && backgroundTask.isDone()) {
completeBackgroundTask(); completeBackgroundTask();
@ -71,19 +90,24 @@ public class CachingRDFServiceExecutor<T> {
if (cachedResults != null) { if (cachedResults != null) {
// If the background service exists, and the cache is considered invalid // If the background service exists, and the cache is considered invalid
if (backgroundRDFService != null && resultBuilder.invalidateCache(System.currentTimeMillis() - lastCacheTime)) { if (backgroundRDFService != null && resultBuilder.invalidateCache(System.currentTimeMillis() - lastCacheTime)) {
// Determine how long we are prepared to wait for an answer // In most cases, only wait for half a second
long waitFor = (backgroundTask == null ? 1000 : 500); long waitFor = 500;
// Start the background task to refresh the cache if (backgroundTask == null) {
startBackgroundTask(rdfService); // Start the background task to refresh the cache
startBackgroundTask(backgroundRDFService);
// As we've just started the background task, allow a wait time of 1 second
waitFor = 1000;
}
// See if we expect it to complete in time, and if so, wait for it // See if we expect it to complete in time, and if so, wait for it
if (isExpectedToCompleteIn(waitFor)) { if (allowWaits && isExpectedToCompleteIn(waitFor)) {
completeBackgroundTask(waitFor); completeBackgroundTask(waitFor);
} }
} }
} else { } else {
// No cached results, so fetch the results using any availabe RDF service // No cached results, so fetch the results using any available RDF service
if (rdfService != null) { if (rdfService != null) {
startBackgroundTask(rdfService); startBackgroundTask(rdfService);
} else if (backgroundRDFService != null) { } else if (backgroundRDFService != null) {
@ -126,8 +150,8 @@ public class CachingRDFServiceExecutor<T> {
startBackgroundTask(backgroundRDFService); startBackgroundTask(backgroundRDFService);
completeBackgroundTaskAsync(); completeBackgroundTaskAsync();
} else if (rdfService != null) { } else if (rdfService != null) {
// No background service, so use the paassed RDF service, and wait for completion // No background service, so use the passed RDF service, and wait for completion
startBackgroundTask(backgroundRDFService); startBackgroundTask(rdfService);
completeBackgroundTask(); completeBackgroundTask();
} }
} }
@ -171,7 +195,7 @@ public class CachingRDFServiceExecutor<T> {
/** /**
* Create and start a background thread using the configured task * Create and start a background thread using the configured task
* @param rdfService * @param rdfService An RDFService
*/ */
private void startBackgroundTask(RDFService rdfService) { private void startBackgroundTask(RDFService rdfService) {
// Ensure that there isn't already a task // Ensure that there isn't already a task
@ -211,11 +235,7 @@ public class CachingRDFServiceExecutor<T> {
backgroundCompletion = new Thread(new Runnable() { backgroundCompletion = new Thread(new Runnable() {
@Override @Override
public void run() { public void run() {
try { completeBackgroundTask(-1);
Thread.sleep(500);
completeBackgroundTask(-1);
} catch (InterruptedException e) {
}
} }
}); });
backgroundCompletion.setDaemon(true); backgroundCompletion.setDaemon(true);
@ -259,11 +279,8 @@ public class CachingRDFServiceExecutor<T> {
abortBackgroundTask(); abortBackgroundTask();
} catch (ExecutionException e) { } catch (ExecutionException e) {
// There was a problem inside the task, so abort and throw an exception // There was a problem inside the task, so abort and throw an exception
try { abortBackgroundTask();
abortBackgroundTask(); throw new RuntimeException("Background RDF thread through an exception", e.getCause());
} finally {
throw new RuntimeException("Background RDF thread through an exception", e.getCause());
}
} catch (TimeoutException e) { } catch (TimeoutException e) {
// Ignore a timeout waiting for the results // Ignore a timeout waiting for the results
} }
@ -271,7 +288,7 @@ public class CachingRDFServiceExecutor<T> {
/** /**
* Set the RDF service to be used for background threads (called from a startup servlet) * Set the RDF service to be used for background threads (called from a startup servlet)
* @param rdfService * @param rdfService An RDFService
*/ */
public static void setBackgroundRDFService(RDFService rdfService) { public static void setBackgroundRDFService(RDFService rdfService) {
backgroundRDFService = rdfService; backgroundRDFService = rdfService;
@ -299,13 +316,13 @@ public class CachingRDFServiceExecutor<T> {
/** /**
* Constructor that allows an affinity object to be supplied * Constructor that allows an affinity object to be supplied
* @param affinity * @param affinity Affinity
*/ */
public RDFServiceCallable(Affinity affinity) { this.affinity = affinity; } public RDFServiceCallable(Affinity affinity) { this.affinity = affinity; }
/** /**
* Set the RDF service to be used * Set the RDF service to be used
* @param rdfService * @param rdfService An RDFService
*/ */
final void setRDFService(RDFService rdfService) { final void setRDFService(RDFService rdfService) {
this.rdfService = rdfService; this.rdfService = rdfService;
@ -313,8 +330,7 @@ public class CachingRDFServiceExecutor<T> {
/** /**
* Entry point for the background threads, ensuring the right start / cleanup is done * Entry point for the background threads, ensuring the right start / cleanup is done
* @return * @throws Exception Any exception
* @throws Exception
*/ */
@Override @Override
final public T call() throws Exception { final public T call() throws Exception {
@ -349,17 +365,15 @@ public class CachingRDFServiceExecutor<T> {
/** /**
* Method for users to implement, to return the results * Method for users to implement, to return the results
* @param rdfService * @param rdfService An RDFService
* @return * @throws Exception Any exception
* @throws Exception
*/ */
protected abstract T callWithService(RDFService rdfService) throws Exception; protected abstract T callWithService(RDFService rdfService) throws Exception;
/** /**
* Method to determine if the cache should be invalidated for the current results * Method to determine if the cache should be invalidated for the current results
* Default implementation dynamically adjusts the cache time based on the efficiency of creating results * Default implementation dynamically adjusts the cache time based on the efficiency of creating results
* @param timeCached * @param timeCached The time of caching
* @return
*/ */
boolean invalidateCache(long timeCached) { boolean invalidateCache(long timeCached) {
if (executionTime > -1) { if (executionTime > -1) {
@ -390,50 +404,64 @@ public class CachingRDFServiceExecutor<T> {
* Affinity class that serializes background processing for tasks given the same affinity * Affinity class that serializes background processing for tasks given the same affinity
*/ */
public static class Affinity { public static class Affinity {
private int maxThreads = 1; private final int maxThreads = 1;
static class ThreadControl {
ThreadControl(long started, long expectedDuration) {
this.started = started;
this.expectedDuration = expectedDuration;
}
final long started;
final long expectedDuration;
final CountDownLatch latch = new CountDownLatch(1);
}
// Map of executing threads, and the time they expect to need to execute // Map of executing threads, and the time they expect to need to execute
private Map<Thread, Long> threadToExecutionTime = new HashMap<>(); private final Map<Thread, ThreadControl> threadToExecutionTime = new HashMap<>();
private Set<Thread> executingThreads = new HashSet<>(); private final Set<Thread> executingThreads = new HashSet<>();
/** /**
* Called by a background thread to determine if it is allowed to start * Called by a background thread to determine if it is allowed to start
* @param expectedExecutionTime time that the thread expects to take (usualling the last execution time) * @param expectedExecutionTime time that the thread expects to take (usually the last execution time)
*/ */
private void requestStart(long expectedExecutionTime) { private void requestStart(long expectedExecutionTime) {
Thread executingThread = Thread.currentThread();
// Ask if the task needs to be queued // Ask if the task needs to be queued
if (queueThis(Thread.currentThread(), expectedExecutionTime)) { CountDownLatch latch = queueThis(executingThread, expectedExecutionTime);
// Synchronize the thread to call wait
synchronized (Thread.currentThread()) { // We got a latch from the queue, so wait for it to clear
try { if (latch != null) {
// Make the thread wait until it is notified to continue try {
Thread.currentThread().wait(); latch.await();
} catch(InterruptedException e) { } catch (InterruptedException e) {
}
} }
} }
} }
/** /**
* Adds a thread to the map, returns whether the thread needs to wait * Adds a thread to the map, returns whether the thread needs to wait
* @param thread * @param thread The thread to add
* @param time * @param time start time of the thread
* @return true if the thread needs to wait, false if it can continue * @return true if the thread needs to wait, false if it can continue
*/ */
private synchronized boolean queueThis(Thread thread, Long time) { private synchronized CountDownLatch queueThis(Thread thread, Long time) {
// If we have fewer that the max threads running // If we have fewer that the max threads running
if (executingThreads.size() < maxThreads) { if (executingThreads.size() < maxThreads) {
// Add thread to executing set // Add thread to executing set
executingThreads.add(thread); executingThreads.add(thread);
// Not queued - we can continue // Not queued - we can continue
return false; return null;
} else { } else {
// Add the thread to the map ThreadControl control = new ThreadControl(System.currentTimeMillis(), time);
threadToExecutionTime.put(thread, time);
// Let the caller know that we are queued // Add the thread to the map
return true; threadToExecutionTime.put(thread, control);
// Give the caller a handle to the latch for the queued thread
return control.latch;
} }
} }
@ -450,26 +478,41 @@ public class CachingRDFServiceExecutor<T> {
// If there are still threads to execute, and we have not exhausted maximum threads // If there are still threads to execute, and we have not exhausted maximum threads
while (threadToExecutionTime.size() > 0 && executingThreads.size() < maxThreads) { while (threadToExecutionTime.size() > 0 && executingThreads.size() < maxThreads) {
Thread nextToRelease = null; Thread nextToRelease = null;
long executionTime = -1; ThreadControl nextToReleaseControl = null;
long current = System.currentTimeMillis();
boolean favourStartTime = false;
// Find the thread that expects to take the least time // Find the thread that expects to take the least time
for (Thread thread : threadToExecutionTime.keySet()) { for (Thread thread : threadToExecutionTime.keySet()) {
long thisTime = threadToExecutionTime.get(thread); ThreadControl threadControl = threadToExecutionTime.get(thread);
// If there are threads that have been waiting over 2 seconds, favour the oldest thread
if (threadControl.started + 2000 < current) {
favourStartTime = true;
}
if (nextToRelease == null) { if (nextToRelease == null) {
nextToRelease = thread; nextToRelease = thread;
executionTime = thisTime; nextToReleaseControl = threadControl;
} else if (thisTime < executionTime) { } else {
nextToRelease = thread; if (favourStartTime) {
executionTime = thisTime; // Find the oldest thread
if (threadControl.started < nextToReleaseControl.started) {
nextToRelease = thread;
nextToReleaseControl = threadControl;
}
} else if (threadControl.expectedDuration < nextToReleaseControl.expectedDuration) {
nextToRelease = thread;
nextToReleaseControl = threadControl;
}
} }
} }
// Synchronize on the thread we are releasing, and notify it to continue // Notify the Thread we are releasing to continue
synchronized (nextToRelease) { if (nextToRelease != null) {
threadToExecutionTime.remove(nextToRelease); threadToExecutionTime.remove(nextToRelease);
executingThreads.add(nextToRelease); executingThreads.add(nextToRelease);
nextToRelease.notify(); nextToReleaseControl.latch.countDown();
} }
} }
} }

View file

@ -15,10 +15,10 @@ import org.apache.jena.iri.Violation;
import org.vivoweb.webapp.util.ModelUtils; import org.vivoweb.webapp.util.ModelUtils;
import com.google.gson.Gson; import com.google.gson.Gson;
import com.hp.hpl.jena.query.Dataset; import org.apache.jena.query.Dataset;
import com.hp.hpl.jena.query.QuerySolution; import org.apache.jena.query.QuerySolution;
import com.hp.hpl.jena.query.ResultSet; import org.apache.jena.query.ResultSet;
import com.hp.hpl.jena.rdf.model.RDFNode; import org.apache.jena.rdf.model.RDFNode;
import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.AuthorizationRequest; import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.AuthorizationRequest;
import edu.cornell.mannlib.vitro.webapp.beans.ObjectProperty; import edu.cornell.mannlib.vitro.webapp.beans.ObjectProperty;

View file

@ -2,14 +2,14 @@
package edu.cornell.mannlib.vitro.webapp.visualization.utilities; package edu.cornell.mannlib.vitro.webapp.visualization.utilities;
import com.hp.hpl.jena.query.QueryExecution; import org.apache.jena.query.QueryExecution;
import com.hp.hpl.jena.query.QueryExecutionFactory; import org.apache.jena.query.QueryExecutionFactory;
import com.hp.hpl.jena.query.QuerySolution; import org.apache.jena.query.QuerySolution;
import com.hp.hpl.jena.rdf.model.Literal; import org.apache.jena.rdf.model.Literal;
import com.hp.hpl.jena.rdf.model.Model; import org.apache.jena.rdf.model.Model;
import com.hp.hpl.jena.rdf.model.ModelFactory; import org.apache.jena.rdf.model.ModelFactory;
import com.hp.hpl.jena.rdf.model.RDFNode; import org.apache.jena.rdf.model.RDFNode;
import com.hp.hpl.jena.rdf.model.Resource; import org.apache.jena.rdf.model.Resource;
import edu.cornell.mannlib.vitro.webapp.rdfservice.RDFService; import edu.cornell.mannlib.vitro.webapp.rdfservice.RDFService;
import edu.cornell.mannlib.vitro.webapp.rdfservice.ResultSetConsumer; import edu.cornell.mannlib.vitro.webapp.rdfservice.ResultSetConsumer;
import edu.cornell.mannlib.vitro.webapp.visualization.constants.QueryConstants; import edu.cornell.mannlib.vitro.webapp.visualization.constants.QueryConstants;
@ -82,7 +82,7 @@ final public class VisualizationCaches {
/** /**
* Rebuild the specifield caches * Rebuild the specifield caches
* @param executors * @param executors Caching RDF executors
*/ */
public static void rebuild(CachingRDFServiceExecutor... executors) { public static void rebuild(CachingRDFServiceExecutor... executors) {
if (executors != null) { if (executors != null) {

View file

@ -36,7 +36,6 @@ public class Activity extends Individual {
* The 2 choices, in order, are, * The 2 choices, in order, are,
* 1. parsed year from xs:DateTime object saved in core:dateTimeValue * 1. parsed year from xs:DateTime object saved in core:dateTimeValue
* 2. Default Publication Year * 2. Default Publication Year
* @return
*/ */
public String getParsedActivityYear() { public String getParsedActivityYear() {
@ -47,7 +46,6 @@ public class Activity extends Individual {
/** /**
* This method should be used to get the raw date & not the parsed publication year. * This method should be used to get the raw date & not the parsed publication year.
* For the later use getParsedPublicationYear. * For the later use getParsedPublicationYear.
* @return
*/ */
public String getActivityDate() { public String getActivityDate() {
return activityDate; return activityDate;

Some files were not shown because too many files have changed in this diff Show more