Merge branch 'develop' into feature/theming
This commit is contained in:
commit
1774a07ffa
226 changed files with 20153 additions and 24054 deletions
5
.gitignore
vendored
5
.gitignore
vendored
|
@ -17,3 +17,8 @@ utilities/rdbmigration/.work
|
|||
**/target
|
||||
|
||||
**/overlays
|
||||
|
||||
# Eclipse artifacts
|
||||
**/.settings
|
||||
**/.classpath
|
||||
**/.project
|
||||
|
|
|
@ -1,13 +1,20 @@
|
|||
language: java
|
||||
dist: trusty
|
||||
sudo: false
|
||||
|
||||
jdk:
|
||||
- openjdk8
|
||||
- oraclejdk8
|
||||
|
||||
env:
|
||||
# Give Maven 1GB of memory to work with
|
||||
- MAVEN_OPTS=-Xmx1024M
|
||||
|
||||
cache:
|
||||
directories:
|
||||
- .autoconf
|
||||
- $HOME/.m2
|
||||
|
||||
install:
|
||||
- git clone https://github.com/vivo-project/Vitro.git ../Vitro
|
||||
|
||||
|
|
24
api/pom.xml
24
api/pom.xml
|
@ -7,13 +7,13 @@
|
|||
|
||||
<groupId>org.vivoweb</groupId>
|
||||
<artifactId>vivo-api</artifactId>
|
||||
<version>1.9.0-SNAPSHOT</version>
|
||||
<version>1.10.0-SNAPSHOT</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<parent>
|
||||
<groupId>org.vivoweb</groupId>
|
||||
<artifactId>vivo-project</artifactId>
|
||||
<version>1.9.0-SNAPSHOT</version>
|
||||
<version>1.10.0-SNAPSHOT</version>
|
||||
<relativePath>..</relativePath>
|
||||
</parent>
|
||||
|
||||
|
@ -30,16 +30,6 @@
|
|||
<type>pom</type>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>axis</groupId>
|
||||
<artifactId>axis</artifactId>
|
||||
<version>1.3</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.google.code.gson</groupId>
|
||||
<artifactId>gson</artifactId>
|
||||
<version>1.4</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.itextpdf</groupId>
|
||||
<artifactId>itextpdf</artifactId>
|
||||
|
@ -56,11 +46,6 @@
|
|||
<version>2.5.6</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.vivoweb.dependencies</groupId>
|
||||
<artifactId>agrovocws</artifactId>
|
||||
<version>3.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.vivoweb.dependencies</groupId>
|
||||
<artifactId>oim.vivo.scimapcore</artifactId>
|
||||
|
@ -84,6 +69,11 @@
|
|||
<version>2.0</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>javax.xml</groupId>
|
||||
<artifactId>jaxrpc</artifactId>
|
||||
<version>1.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
|
|
|
@ -1,25 +0,0 @@
|
|||
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
|
||||
package edu.cornell.mannlib.semservices.bo;
|
||||
|
||||
public class BaseObject {
|
||||
/**
|
||||
* Simple JavaBean domain object with an id property.
|
||||
* Used as a base class for objects needing this property.
|
||||
*/
|
||||
private Integer id;
|
||||
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public boolean isNew() {
|
||||
return (this.id == null);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -1,163 +0,0 @@
|
|||
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
|
||||
|
||||
package edu.cornell.mannlib.semservices.bo;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class Concept {
|
||||
|
||||
private String definedBy;
|
||||
private String conceptId;
|
||||
private String bestMatch;
|
||||
private String label;
|
||||
private String type;
|
||||
private String definition;
|
||||
private String uri;
|
||||
private String schemeURI;
|
||||
private List<String> broaderURIList;
|
||||
private List<String> narrowerURIList;
|
||||
private List<String> exactMatchURIList;
|
||||
private List<String> closeMatchURIList;
|
||||
private List<String> altLabelList;
|
||||
|
||||
/**
|
||||
* default constructor
|
||||
*/
|
||||
public Concept() {
|
||||
this.broaderURIList = new ArrayList<String>();
|
||||
this.narrowerURIList = new ArrayList<String>();
|
||||
this.exactMatchURIList = new ArrayList<String>();
|
||||
this.closeMatchURIList = new ArrayList<String>();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the conceptId
|
||||
*/
|
||||
public String getConceptId() {
|
||||
return conceptId;
|
||||
}
|
||||
/**
|
||||
* @param conceptId the conceptId to set
|
||||
*/
|
||||
public void setConceptId(String conceptId) {
|
||||
this.conceptId = conceptId;
|
||||
}
|
||||
/**
|
||||
* @return the label
|
||||
*/
|
||||
public String getLabel() {
|
||||
return label;
|
||||
}
|
||||
/**
|
||||
* @param label the label to set
|
||||
*/
|
||||
public void setLabel(String label) {
|
||||
this.label = label;
|
||||
}
|
||||
/**
|
||||
* @return the type
|
||||
*/
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
/**
|
||||
* @param type the type to set
|
||||
*/
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
/**
|
||||
* @return the definition
|
||||
*/
|
||||
public String getDefinition() {
|
||||
return definition;
|
||||
}
|
||||
/**
|
||||
* @param definition the definition to set
|
||||
*/
|
||||
public void setDefinition(String definition) {
|
||||
this.definition = definition;
|
||||
}
|
||||
/**
|
||||
* @return the uri
|
||||
*/
|
||||
public String getUri() {
|
||||
return uri;
|
||||
}
|
||||
/**
|
||||
* @param uri the uri to set
|
||||
*/
|
||||
public void setUri(String uri) {
|
||||
this.uri = uri;
|
||||
}
|
||||
/**
|
||||
* @return the definedBy
|
||||
*/
|
||||
public String getDefinedBy() {
|
||||
return definedBy;
|
||||
}
|
||||
/**
|
||||
* @param definedBy the definedBy to set
|
||||
*/
|
||||
public void setDefinedBy(String definedBy) {
|
||||
this.definedBy = definedBy;
|
||||
}
|
||||
/**
|
||||
* @return the schemeURI
|
||||
*/
|
||||
public String getSchemeURI() {
|
||||
return schemeURI;
|
||||
}
|
||||
/**
|
||||
* @param schemeURI the schemeURI to set
|
||||
*/
|
||||
public void setSchemeURI(String schemeURI) {
|
||||
this.schemeURI = schemeURI;
|
||||
}
|
||||
/**
|
||||
* @return the bestMatch
|
||||
*/
|
||||
public String getBestMatch() {
|
||||
return bestMatch;
|
||||
}
|
||||
/**
|
||||
* @param bestMatch the bestMatch to set
|
||||
*/
|
||||
public void setBestMatch(String bestMatch) {
|
||||
this.bestMatch = bestMatch;
|
||||
}
|
||||
public List<String> getBroaderURIList() {
|
||||
return broaderURIList;
|
||||
}
|
||||
public void setBroaderURIList(List<String> broaderURIList) {
|
||||
this.broaderURIList = broaderURIList;
|
||||
}
|
||||
public List<String> getNarrowerURIList() {
|
||||
return narrowerURIList;
|
||||
}
|
||||
public void setNarrowerURIList(List<String> narrowerURIList) {
|
||||
this.narrowerURIList = narrowerURIList;
|
||||
}
|
||||
public List<String> getExactMatchURIList() {
|
||||
return exactMatchURIList;
|
||||
}
|
||||
public void setExactMatchURIList(List<String> exactMatchURIList) {
|
||||
this.exactMatchURIList = exactMatchURIList;
|
||||
}
|
||||
public List<String> getCloseMatchURIList() {
|
||||
return closeMatchURIList;
|
||||
}
|
||||
public void setCloseMatchURIList(List<String> closeMatchURIList) {
|
||||
this.closeMatchURIList = closeMatchURIList;
|
||||
}
|
||||
|
||||
public List<String> getAltLabelList() {
|
||||
return altLabelList;
|
||||
}
|
||||
|
||||
public void setAltLabelList(List<String> altLabelList) {
|
||||
this.altLabelList = altLabelList;
|
||||
}
|
||||
|
||||
}
|
|
@ -1,32 +0,0 @@
|
|||
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
|
||||
|
||||
package edu.cornell.mannlib.semservices.bo;
|
||||
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
public class ConceptInfo extends SemanticServicesInfoBase {
|
||||
|
||||
private List<?> conceptList;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public ConceptInfo() {
|
||||
super();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the conceptList
|
||||
*/
|
||||
public List<?> getConceptList() {
|
||||
return conceptList;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param conceptList the conceptList to set
|
||||
*/
|
||||
public void setConceptList(List<?> conceptList) {
|
||||
this.conceptList = conceptList;
|
||||
}
|
||||
}
|
|
@ -1,75 +0,0 @@
|
|||
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
|
||||
|
||||
package edu.cornell.mannlib.semservices.bo;
|
||||
|
||||
public class SemanticServicesError {
|
||||
private String message;
|
||||
private String exception;
|
||||
private String severity;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public SemanticServicesError() {
|
||||
super();
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @param exception Exception description
|
||||
* @param message Error message
|
||||
* @param severity Severity
|
||||
*/
|
||||
public SemanticServicesError(String exception, String message, String severity) {
|
||||
super();
|
||||
this.exception = exception;
|
||||
this.message = message;
|
||||
this.severity = severity;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @return the message
|
||||
*/
|
||||
public String getMessage() {
|
||||
return message;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param message the message to set
|
||||
*/
|
||||
public void setMessage(String message) {
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the exception
|
||||
*/
|
||||
public String getException() {
|
||||
return exception;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param exception the exception to set
|
||||
*/
|
||||
public void setException(String exception) {
|
||||
this.exception = exception;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the severity
|
||||
*/
|
||||
public String getSeverity() {
|
||||
return severity;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param severity the severity to set
|
||||
*/
|
||||
public void setSeverity(String severity) {
|
||||
this.severity = severity;
|
||||
}
|
||||
|
||||
}
|
|
@ -1,29 +0,0 @@
|
|||
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
|
||||
|
||||
package edu.cornell.mannlib.semservices.bo;
|
||||
|
||||
public class SemanticServicesInfoBase {
|
||||
|
||||
private SemanticServicesError semanticServicesError;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public SemanticServicesInfoBase() {
|
||||
super();
|
||||
// TODO Auto-generated constructor stub
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the semanticServicesError
|
||||
*/
|
||||
public SemanticServicesError getSemanticServicesError() {
|
||||
return semanticServicesError;
|
||||
}
|
||||
/**
|
||||
* @param semanticServicesError the semanticServicesError to set
|
||||
*/
|
||||
public void setSemanticServicesError(SemanticServicesError semanticServicesError) {
|
||||
this.semanticServicesError = semanticServicesError;
|
||||
}
|
||||
|
||||
}
|
|
@ -1,15 +0,0 @@
|
|||
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
|
||||
|
||||
package edu.cornell.mannlib.semservices.exceptions;
|
||||
|
||||
public class ConceptsNotFoundException extends Exception {
|
||||
/**
|
||||
* An exception that indicates a service could not find a Concept
|
||||
*/
|
||||
private static final long serialVersionUID = -4729465393290022840L;
|
||||
public ConceptsNotFoundException() { }
|
||||
public ConceptsNotFoundException(String message) { super(message); }
|
||||
public ConceptsNotFoundException(Throwable cause) { super(cause); }
|
||||
public ConceptsNotFoundException(String message, Throwable cause) { super(message, cause); }
|
||||
|
||||
}
|
|
@ -1,27 +0,0 @@
|
|||
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
|
||||
|
||||
package edu.cornell.mannlib.semservices.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import edu.cornell.mannlib.semservices.bo.Concept;
|
||||
|
||||
public interface ExternalConceptService {
|
||||
|
||||
/**
|
||||
* @param term Term
|
||||
*/
|
||||
List<Concept> processResults(String term) throws Exception;
|
||||
|
||||
/**
|
||||
* @param term Term
|
||||
* @throws Exception
|
||||
*/
|
||||
List<Concept> getConcepts(String term) throws Exception;
|
||||
|
||||
/**
|
||||
* @param uri URI
|
||||
*/
|
||||
List<Concept> getConceptsByURIWithSparql(String uri) throws Exception;
|
||||
|
||||
}
|
|
@ -17,6 +17,7 @@ import java.util.HashSet;
|
|||
import java.util.Iterator;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import javax.xml.parsers.ParserConfigurationException;
|
||||
import javax.xml.rpc.ServiceException;
|
||||
|
@ -25,11 +26,9 @@ import net.sf.json.JSONArray;
|
|||
import net.sf.json.JSONObject;
|
||||
import net.sf.json.JSONSerializer;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.fao.www.webservices.AgrovocWS.ACSWWebService;
|
||||
import org.fao.www.webservices.AgrovocWS.ACSWWebServiceServiceLocator;
|
||||
import org.w3c.dom.Attr;
|
||||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.NamedNodeMap;
|
||||
|
@ -56,7 +55,6 @@ import edu.cornell.mannlib.vitro.webapp.web.URLEncoder;
|
|||
public class AgrovocService implements ExternalConceptService {
|
||||
|
||||
protected final Log logger = LogFactory.getLog(getClass());
|
||||
private java.lang.String AgrovocWS_address = "http://agrovoc.fao.org/axis/services/SKOSWS";
|
||||
private final String schemeUri = "http://aims.fao.org/aos/agrovoc/agrovocScheme";
|
||||
private final String ontologyName = "agrovoc";
|
||||
private final String format = "SKOS";
|
||||
|
@ -137,7 +135,6 @@ public class AgrovocService implements ExternalConceptService {
|
|||
if (closeMatch.startsWith("http://dbpedia.org")) {
|
||||
try {
|
||||
String description = getDbpediaDescription(closeMatch);
|
||||
// System.out.println("description: "+ description);
|
||||
c.setDefinition(description);
|
||||
} catch (Exception ex) {
|
||||
logger.error("An error occurred in the process of retrieving dbpedia description", ex);
|
||||
|
@ -190,153 +187,6 @@ public class AgrovocService implements ExternalConceptService {
|
|||
return concept;
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
protected String getTermcodeByTerm(String term) throws Exception {
|
||||
String result = new String();
|
||||
ACSWWebServiceServiceLocator locator = new ACSWWebServiceServiceLocator();
|
||||
try {
|
||||
URL url = new URL(AgrovocWS_address);
|
||||
ACSWWebService agrovoc_service = locator.getACSWWebService(url);
|
||||
result = agrovoc_service.getTermcodeByTerm(term);
|
||||
} catch (ServiceException e) {
|
||||
logger.error("service exception", e);
|
||||
throw e;
|
||||
} catch (RemoteException e) {
|
||||
logger.error("remote exception", e);
|
||||
throw e;
|
||||
} catch (MalformedURLException e) {
|
||||
logger.error("malformed URL exception", e);
|
||||
throw e;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
protected String getTermCodeByTermAndLangXML(String ontologyName,
|
||||
String searchString, String lang, String codeName, String format) {
|
||||
String result = new String();
|
||||
ACSWWebServiceServiceLocator locator = new ACSWWebServiceServiceLocator();
|
||||
try {
|
||||
URL url = new URL(AgrovocWS_address);
|
||||
ACSWWebService agrovoc_service = locator.getACSWWebService(url);
|
||||
result = agrovoc_service.getTermCodeByTermAndLangXML(ontologyName,
|
||||
searchString, lang, codeName, format);
|
||||
} catch (ServiceException e) {
|
||||
logger.error("service exception", e);
|
||||
e.printStackTrace();
|
||||
} catch (RemoteException e) {
|
||||
e.printStackTrace();
|
||||
} catch (MalformedURLException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
protected String getURIByTermAndLangXML(String ontologyName, String term,
|
||||
String searchMode, String format, String lang) {
|
||||
String result = new String();
|
||||
ACSWWebServiceServiceLocator locator = new ACSWWebServiceServiceLocator();
|
||||
try {
|
||||
URL url = new URL(AgrovocWS_address);
|
||||
ACSWWebService agrovoc_service = locator.getACSWWebService(url);
|
||||
result = agrovoc_service.getURIByTermAndLangXML(ontologyName, term,
|
||||
searchMode, format, lang);
|
||||
} catch (ServiceException e) {
|
||||
e.printStackTrace();
|
||||
} catch (RemoteException e) {
|
||||
e.printStackTrace();
|
||||
} catch (MalformedURLException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
// Creating method for term expansion
|
||||
protected String getTermExpansion(String ontologyName, String term,
|
||||
String searchMode, String format, String lang) {
|
||||
String result = new String();
|
||||
ACSWWebServiceServiceLocator locator = new ACSWWebServiceServiceLocator();
|
||||
try {
|
||||
URL url = new URL(AgrovocWS_address);
|
||||
ACSWWebService agrovoc_service = locator.getACSWWebService(url);
|
||||
result = agrovoc_service.getTermExpansion(ontologyName, term,
|
||||
format, searchMode, lang); // the actual call has this order
|
||||
// for parameters
|
||||
} catch (ServiceException e) {
|
||||
e.printStackTrace();
|
||||
} catch (RemoteException e) {
|
||||
e.printStackTrace();
|
||||
} catch (MalformedURLException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
protected String getConceptInfoByTermcodeXML(String termcode, String format) {
|
||||
String result = new String();
|
||||
ACSWWebServiceServiceLocator locator = new ACSWWebServiceServiceLocator();
|
||||
try {
|
||||
URL url = new URL(AgrovocWS_address);
|
||||
ACSWWebService agrovoc_service = locator.getACSWWebService(url);
|
||||
result = agrovoc_service.getConceptInfoByTermcodeXML(termcode,
|
||||
format);
|
||||
} catch (ServiceException e) {
|
||||
logger.error("service exception", e);
|
||||
e.printStackTrace();
|
||||
} catch (RemoteException e) {
|
||||
e.printStackTrace();
|
||||
} catch (MalformedURLException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
protected String getConceptByKeyword(String ontologyName,
|
||||
String searchString, String format, String searchMode, String lang) {
|
||||
String result = new String();
|
||||
ACSWWebServiceServiceLocator locator = new ACSWWebServiceServiceLocator();
|
||||
try {
|
||||
URL url = new URL(AgrovocWS_address);
|
||||
ACSWWebService agrovoc_service = locator.getACSWWebService(url);
|
||||
result = agrovoc_service.getConceptByKeyword(ontologyName,
|
||||
searchString, format, searchMode, lang);
|
||||
} catch (ServiceException e) {
|
||||
logger.error("service exception", e);
|
||||
e.printStackTrace();
|
||||
} catch (RemoteException e) {
|
||||
e.printStackTrace();
|
||||
} catch (MalformedURLException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
protected String getWsdl() {
|
||||
String result = new String();
|
||||
try {
|
||||
|
||||
StringWriter sw = new StringWriter();
|
||||
URL rss = new URL(this.AgrovocWS_address + "?wsdl");
|
||||
|
||||
BufferedReader in = new BufferedReader(new InputStreamReader(
|
||||
rss.openStream()));
|
||||
String inputLine;
|
||||
while ((inputLine = in.readLine()) != null) {
|
||||
sw.write(inputLine);
|
||||
}
|
||||
in.close();
|
||||
|
||||
result = sw.toString();
|
||||
|
||||
} catch (Exception ex) {
|
||||
logger.error("error occurred in servlet", ex);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public List<Concept> getConceptsByURIWithSparql(String uri)
|
||||
throws Exception {
|
||||
// deprecating this method...just return an empty list
|
||||
|
@ -440,8 +290,8 @@ public class AgrovocService implements ExternalConceptService {
|
|||
try {
|
||||
|
||||
Query query = QueryFactory.create(qs);
|
||||
qexec = QueryExecutionFactory.sparqlService(this.dbpedia_endpoint,
|
||||
query);
|
||||
qexec = QueryExecutionFactory.sparqlService(this.dbpedia_endpoint, query);
|
||||
qexec.setTimeout(5000, TimeUnit.MILLISECONDS);
|
||||
resultList = new ArrayList<HashMap>();
|
||||
ResultSet resultSet = qexec.execSelect();
|
||||
int resultSetSize = 0;
|
||||
|
@ -501,28 +351,6 @@ public class AgrovocService implements ExternalConceptService {
|
|||
}
|
||||
}
|
||||
|
||||
// Get concept using agrovoc service
|
||||
protected String getConceptInfoByURI(String ontologyName,
|
||||
String conceptURI, String format) {
|
||||
String result = new String();
|
||||
ACSWWebServiceServiceLocator locator = new ACSWWebServiceServiceLocator();
|
||||
try {
|
||||
URL url = new URL(AgrovocWS_address);
|
||||
ACSWWebService agrovoc_service = locator.getACSWWebService(url);
|
||||
result = agrovoc_service.getConceptByURI(ontologyName, conceptURI,
|
||||
format);
|
||||
} catch (ServiceException e) {
|
||||
logger.error("service exception", e);
|
||||
e.printStackTrace();
|
||||
} catch (RemoteException e) {
|
||||
e.printStackTrace();
|
||||
} catch (MalformedURLException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* The code here utilizes the SKOSMOS REST API for Agrovoc
|
||||
* This returns JSON LD so we would parse JSON instead of RDF
|
||||
|
|
|
@ -24,7 +24,7 @@ import edu.cornell.mannlib.semservices.service.ExternalConceptService;
|
|||
|
||||
public class GemetService implements ExternalConceptService {
|
||||
protected final Log logger = LogFactory.getLog(getClass());
|
||||
private final String GemetWS_address = "http://www.eionet.europa.eu/gemet/";
|
||||
private final String GemetWS_address = "https://www.eionet.europa.eu/gemet/";
|
||||
private final String narrowerUri = "http://www.w3.org/2004/02/skos/core%23narrower";
|
||||
private final String broaderUri = "http://www.w3.org/2004/02/skos/core%23broader";
|
||||
private final String relatedUri = "http://www.w3.org/2004/02/skos/core%23related";
|
||||
|
|
|
@ -18,7 +18,7 @@ import javax.xml.parsers.ParserConfigurationException;
|
|||
import net.sf.json.JSONObject;
|
||||
import net.sf.json.JSONSerializer;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.w3c.dom.Attr;
|
||||
|
@ -49,7 +49,7 @@ public class LCSHService implements ExternalConceptService {
|
|||
String results = null;
|
||||
String dataUrl = baseUri + "?q=" + URLEncoder.encode(term, "UTF-8")
|
||||
+ "&q=cs%3Ahttp%3A%2F%2Fid.loc.gov%2Fauthorities%2Fsubjects"
|
||||
+ "&format=XML";
|
||||
+ "&format=atom";
|
||||
log.debug("dataURL " + dataUrl);
|
||||
|
||||
try {
|
||||
|
@ -81,7 +81,7 @@ public class LCSHService implements ExternalConceptService {
|
|||
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
|
||||
// and narrower terms as applicable as well as any description (skos:note)
|
||||
// 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 not the URI itself which would be http://id.loc.gov/authorities/subjects/sh85014203
|
||||
String conceptURLString = getSKOSURL(uri);
|
||||
String baseConceptURI = getConceptURI(uri);
|
||||
String baseConceptURI = uri;
|
||||
URL conceptURL = null;
|
||||
try {
|
||||
conceptURL = new URL(conceptURLString);
|
||||
|
@ -154,23 +154,12 @@ public class LCSHService implements ExternalConceptService {
|
|||
|
||||
|
||||
private String getSKOSURL(String uri) {
|
||||
// Strip .xml at the end and replace with .skos.rdf
|
||||
String skosURI = uri;
|
||||
if (uri.endsWith(".xml")) {
|
||||
skosURI = uri.substring(0, uri.length() - 4);
|
||||
skosURI += skosSuffix;
|
||||
}
|
||||
return hostUri + skosURI;
|
||||
String skosURI = uri + skosSuffix;
|
||||
|
||||
return 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) {
|
||||
List<String> uris = new ArrayList<String>();
|
||||
|
@ -192,14 +181,25 @@ public class LCSHService implements ExternalConceptService {
|
|||
String conceptUri = new String();
|
||||
try {
|
||||
Document doc = XMLUtils.parse(rdf);
|
||||
NodeList nodes = doc.getElementsByTagName("search:result");
|
||||
NodeList nodes = doc.getElementsByTagName("entry");
|
||||
int len = nodes.getLength();
|
||||
int i;
|
||||
int i, j;
|
||||
for (i = 0; i < len; i++) {
|
||||
Node node = nodes.item(i);
|
||||
NamedNodeMap attrs = node.getAttributes();
|
||||
Attr idAttr = (Attr) attrs.getNamedItem("uri");
|
||||
conceptUri = idAttr.getTextContent();
|
||||
NodeList childNodes = node.getChildNodes();
|
||||
for(j = 0; j < childNodes.getLength(); j++) {
|
||||
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);
|
||||
uris.add(conceptUri);
|
||||
}
|
||||
|
@ -250,10 +250,4 @@ public class LCSHService implements ExternalConceptService {
|
|||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -1,26 +0,0 @@
|
|||
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
|
||||
|
||||
package edu.cornell.mannlib.semservices.util;
|
||||
import java.util.Iterator;
|
||||
import javax.xml.XMLConstants;
|
||||
import javax.xml.namespace.NamespaceContext;
|
||||
|
||||
public class MetadataNamespaceContext implements NamespaceContext {
|
||||
public String getNamespaceURI(String prefix) {
|
||||
if (prefix == null) throw new NullPointerException("Null prefix");
|
||||
else if ("mix".equals(prefix)) return "http://www.loc.gov/mix/";
|
||||
else if ("xml".equals(prefix)) return XMLConstants.XML_NS_URI;
|
||||
return XMLConstants.NULL_NS_URI;
|
||||
}
|
||||
|
||||
// This method isn't necessary for XPath processing.
|
||||
public String getPrefix(String uri) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
// This method isn't necessary for XPath processing either.
|
||||
public Iterator getPrefixes(String uri) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
}
|
|
@ -1,266 +0,0 @@
|
|||
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
|
||||
|
||||
/* We are no longer using the SKOS API since Vitro has moved to V 4.0 of OWL API which does not appear to be compatible.
|
||||
This file will contain methods used for reading SKOS as XML and parsing it for the properties
|
||||
we want to extract*/
|
||||
|
||||
package edu.cornell.mannlib.semservices.util;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.StringReader;
|
||||
import java.io.StringWriter;
|
||||
import java.net.URL;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
import org.apache.jena.rdf.model.Model;
|
||||
import org.apache.jena.rdf.model.ModelFactory;
|
||||
import org.apache.jena.rdf.model.NodeIterator;
|
||||
import org.apache.jena.rdf.model.RDFNode;
|
||||
import org.apache.jena.rdf.model.ResourceFactory;
|
||||
import org.apache.jena.rdf.model.Statement;
|
||||
import org.apache.jena.rdf.model.StmtIterator;
|
||||
|
||||
import edu.cornell.mannlib.semservices.bo.Concept;
|
||||
|
||||
public class SKOSUtils {
|
||||
protected final static Log log = LogFactory.getLog(SKOSUtils.class);
|
||||
|
||||
public static String getConceptXML(String conceptUriString) {
|
||||
URL conceptURL = null;
|
||||
try {
|
||||
conceptURL = new URL(conceptUriString);
|
||||
} catch (Exception e) {
|
||||
log.error("Exception occurred in instantiating URL for "
|
||||
+ conceptUriString, e);
|
||||
// If the url is having trouble, just return null for the concept
|
||||
return null;
|
||||
}
|
||||
log.debug("loading concept uri " + conceptUriString);
|
||||
|
||||
String results = null;
|
||||
try {
|
||||
|
||||
StringWriter sw = new StringWriter();
|
||||
|
||||
BufferedReader in = new BufferedReader(new InputStreamReader(
|
||||
conceptURL.openStream()));
|
||||
String inputLine;
|
||||
while ((inputLine = in.readLine()) != null) {
|
||||
sw.write(inputLine);
|
||||
}
|
||||
in.close();
|
||||
|
||||
results = sw.toString();
|
||||
log.debug(results);
|
||||
} catch (Exception ex) {
|
||||
log.error("Error occurred in getting concept from the URL "
|
||||
+ conceptUriString, ex);
|
||||
return null;
|
||||
}
|
||||
return results;
|
||||
}
|
||||
|
||||
// Downloading the XML from the URI itself
|
||||
// No language tag support here but can be specified if need be at this
|
||||
// level as well
|
||||
public static Concept createConceptUsingXMLFromURL(Concept concept,
|
||||
String conceptURLString, String langTagValue, boolean addNotes) {
|
||||
String results = getConceptXML(conceptURLString);
|
||||
if (StringUtils.isEmpty(results)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// return createConceptUsingXML(concept, results, langTagValue);
|
||||
return createConceptUsingXMLModel(concept, results, langTagValue,
|
||||
addNotes);
|
||||
|
||||
}
|
||||
|
||||
// Because of the fact the xml returns matches by tag name, and the XML may
|
||||
// look like <skos:narrower><skos:Concept ..><skos:broader
|
||||
// rdf:resource:"conceptURI">
|
||||
// where conceptURI is the concept that is the subject of skos:narrower, we
|
||||
// need to ensure we are not returning the same uri as that of the main
|
||||
// concept
|
||||
public static List<String> removeConceptURIFromList(List<String> uris,
|
||||
String conceptURI) {
|
||||
// remove will return a boolean if the value exists in the list and is
|
||||
// removed
|
||||
// if/when it returns false, the URI is not in the list
|
||||
while (uris.remove(conceptURI)) {
|
||||
}
|
||||
;
|
||||
return uris;
|
||||
}
|
||||
|
||||
/**
|
||||
* The above code, although functional, does not take advantage of the fact
|
||||
* that we can actually read and query the RDF in precisely the manner we
|
||||
* wish.
|
||||
*/
|
||||
|
||||
public static Concept createConceptUsingXMLModel(Concept concept,
|
||||
String results, String langTagValue, boolean addNotes) {
|
||||
|
||||
try {
|
||||
String conceptURI = concept.getUri();
|
||||
|
||||
// Load Model from RDF
|
||||
StringReader reader = new StringReader(results);
|
||||
Model model = ModelFactory.createDefaultModel();
|
||||
model.read(reader, null, "RDF/XML");
|
||||
|
||||
// Execute the following query to get the information we want for
|
||||
// this resource
|
||||
|
||||
// Preferred label
|
||||
List<String> labelLiterals = getPrefLabelsFromModel(conceptURI,
|
||||
model, langTagValue);
|
||||
if (labelLiterals.size() > 0) {
|
||||
concept.setLabel(labelLiterals.get(0));
|
||||
} else {
|
||||
// This is an error because there should be at least one label
|
||||
// returned
|
||||
log.debug("The number of preferred labels is not greater than zero");
|
||||
}
|
||||
|
||||
// Alternate label
|
||||
|
||||
List<String> altLabelList = getAltLabelsFromModel(conceptURI,
|
||||
model, langTagValue);
|
||||
concept.setAltLabelList(altLabelList);
|
||||
|
||||
// Broder, narrower, exact match, and close match properties
|
||||
|
||||
List<String> broaderURIList = getBroaderURIsFromModel(conceptURI,
|
||||
model);
|
||||
// broaderURIList = removeConceptURIFromList(broaderURIList,
|
||||
// conceptURI);
|
||||
concept.setBroaderURIList(broaderURIList);
|
||||
List<String> narrowerURIList = getNarrowerURIsFromModel(conceptURI,
|
||||
model);
|
||||
// narrowerURIList = removeConceptURIFromList(narrowerURIList,
|
||||
// conceptURI);
|
||||
concept.setNarrowerURIList(narrowerURIList);
|
||||
|
||||
List<String> exactMatchURIList = getExactMatchURIsFromModel(
|
||||
conceptURI, model);
|
||||
// exactMatchURIList = removeConceptURIFromList(exactMatchURIList,
|
||||
// conceptURI);
|
||||
concept.setExactMatchURIList(exactMatchURIList);
|
||||
List<String> closeMatchURIList = getCloseMatchURIsFromModel(
|
||||
conceptURI, model);
|
||||
// closeMatchURIList = removeConceptURIFromList(closeMatchURIList,
|
||||
// conceptURI);
|
||||
concept.setCloseMatchURIList(closeMatchURIList);
|
||||
|
||||
// Notes may exist, in which case they should be employed
|
||||
if (addNotes) {
|
||||
List<String> notes = getNotesFromModel(conceptURI, model,
|
||||
langTagValue);
|
||||
if (notes.size() > 0) {
|
||||
concept.setDefinition(notes.get(0));
|
||||
}
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
log.error("error occurred in parsing " + results, e);
|
||||
}
|
||||
|
||||
return concept;
|
||||
|
||||
}
|
||||
|
||||
private static List<String> getPrefLabelsFromModel(String conceptURI,
|
||||
Model model, String langTagValue) {
|
||||
String propertyURI = "http://www.w3.org/2004/02/skos/core#prefLabel";
|
||||
return getLabelsFromModel(conceptURI, propertyURI, model, langTagValue);
|
||||
}
|
||||
|
||||
private static List<String> getAltLabelsFromModel(String conceptURI,
|
||||
Model model, String langTagValue) {
|
||||
String propertyURI = "http://www.w3.org/2004/02/skos/core#altLabel";
|
||||
return getLabelsFromModel(conceptURI, propertyURI, model, langTagValue);
|
||||
}
|
||||
|
||||
private static List<String> getLabelsFromModel(String conceptURI,
|
||||
String propertyURI, Model model, String langTagValue) {
|
||||
List<String> labels = new ArrayList<String>();
|
||||
StmtIterator statements = model.listStatements(
|
||||
ResourceFactory.createResource(conceptURI),
|
||||
ResourceFactory.createProperty(propertyURI), (RDFNode) null);
|
||||
while (statements.hasNext()) {
|
||||
Statement statement = statements.nextStatement();
|
||||
RDFNode node = statement.getObject();
|
||||
if (node != null && node.isLiteral()) {
|
||||
String label = node.asLiteral().getString();
|
||||
if (StringUtils.isNotEmpty(langTagValue)) {
|
||||
String language = node.asLiteral().getLanguage();
|
||||
if (language != null && language.equals(langTagValue)) {
|
||||
labels.add(label);
|
||||
}
|
||||
} else {
|
||||
labels.add(label);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
return labels;
|
||||
}
|
||||
|
||||
private static List<String> getNotesFromModel(String conceptURI,
|
||||
Model model, String langTagValue) {
|
||||
String propertyURI = "http://www.w3.org/2004/02/skos/core#note";
|
||||
return getLabelsFromModel(conceptURI, propertyURI, model, langTagValue);
|
||||
}
|
||||
|
||||
private static List<String> getCloseMatchURIsFromModel(String conceptURI,
|
||||
Model model) {
|
||||
String propertyURI = "http://www.w3.org/2004/02/skos/core#closeMatch";
|
||||
return getRelatedURIsFromModel(conceptURI, propertyURI, model);
|
||||
|
||||
}
|
||||
|
||||
private static List<String> getExactMatchURIsFromModel(String conceptURI,
|
||||
Model model) {
|
||||
String propertyURI = "http://www.w3.org/2004/02/skos/core#exactMatch";
|
||||
return getRelatedURIsFromModel(conceptURI, propertyURI, model);
|
||||
}
|
||||
|
||||
private static List<String> getNarrowerURIsFromModel(String conceptURI,
|
||||
Model model) {
|
||||
String propertyURI = "http://www.w3.org/2004/02/skos/core#narrower";
|
||||
return getRelatedURIsFromModel(conceptURI, propertyURI, model);
|
||||
}
|
||||
|
||||
private static List<String> getBroaderURIsFromModel(String conceptURI,
|
||||
Model model) {
|
||||
String propertyURI = "http://www.w3.org/2004/02/skos/core#broader";
|
||||
return getRelatedURIsFromModel(conceptURI, propertyURI, model);
|
||||
}
|
||||
|
||||
private static List<String> getRelatedURIsFromModel(String conceptURI,
|
||||
String propertyURI, Model model) {
|
||||
List<String> URIs = new ArrayList<String>();
|
||||
NodeIterator nodeIterator = model.listObjectsOfProperty(
|
||||
ResourceFactory.createResource(conceptURI),
|
||||
ResourceFactory.createProperty(propertyURI));
|
||||
|
||||
while (nodeIterator.hasNext()) {
|
||||
RDFNode node = nodeIterator.nextNode();
|
||||
if (node.isResource() && node.asResource().getURI() != null) {
|
||||
String URI = node.asResource().getURI();
|
||||
URIs.add(URI);
|
||||
}
|
||||
}
|
||||
|
||||
return URIs;
|
||||
}
|
||||
|
||||
}
|
|
@ -1,361 +0,0 @@
|
|||
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
|
||||
|
||||
package edu.cornell.mannlib.semservices.util;
|
||||
|
||||
import java.io.BufferedWriter;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStreamWriter;
|
||||
import java.io.StringReader;
|
||||
import java.io.StringWriter;
|
||||
import java.io.Writer;
|
||||
|
||||
import javax.xml.parsers.DocumentBuilder;
|
||||
import javax.xml.parsers.DocumentBuilderFactory;
|
||||
import javax.xml.parsers.ParserConfigurationException;
|
||||
import javax.xml.transform.OutputKeys;
|
||||
import javax.xml.transform.Source;
|
||||
import javax.xml.transform.Transformer;
|
||||
import javax.xml.transform.TransformerConfigurationException;
|
||||
import javax.xml.transform.TransformerException;
|
||||
import javax.xml.transform.TransformerFactory;
|
||||
import javax.xml.transform.TransformerFactoryConfigurationError;
|
||||
import javax.xml.transform.stream.StreamResult;
|
||||
import javax.xml.transform.stream.StreamSource;
|
||||
import javax.xml.xpath.XPath;
|
||||
import javax.xml.xpath.XPathConstants;
|
||||
import javax.xml.xpath.XPathExpressionException;
|
||||
import javax.xml.xpath.XPathFactory;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.DocumentType;
|
||||
import org.w3c.dom.NamedNodeMap;
|
||||
import org.w3c.dom.Node;
|
||||
import org.w3c.dom.NodeList;
|
||||
import org.xml.sax.InputSource;
|
||||
import org.xml.sax.SAXException;
|
||||
|
||||
/**
|
||||
* Convenience Class to parse XML strings to DOM Document for XML contents
|
||||
* retrieval.
|
||||
*/
|
||||
public class XMLUtils {
|
||||
private static DocumentBuilder parser;
|
||||
public static Writer writer;
|
||||
static private String indent = "";
|
||||
protected static final Log logger = LogFactory.getLog(XMLUtils.class);
|
||||
|
||||
|
||||
/**
|
||||
* @throws ParserConfigurationException
|
||||
*/
|
||||
public static DocumentBuilder getDocumentBuilder()
|
||||
throws ParserConfigurationException {
|
||||
if (parser == null) {
|
||||
// JPT: Remove xerces use
|
||||
DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory
|
||||
.newInstance();
|
||||
documentBuilderFactory.setNamespaceAware(true);
|
||||
documentBuilderFactory.setValidating(false);
|
||||
parser = documentBuilderFactory.newDocumentBuilder();
|
||||
}
|
||||
|
||||
return parser;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param xmlString XML String
|
||||
* @throws IOException
|
||||
* @throws SAXException
|
||||
* @throws ParserConfigurationException
|
||||
*/
|
||||
public synchronized static Document parse(String xmlString)
|
||||
throws IOException, SAXException, ParserConfigurationException {
|
||||
StringReader reader = new StringReader(xmlString);
|
||||
InputSource inputSource = new InputSource(reader);
|
||||
return getDocumentBuilder().parse(inputSource);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param stream Input stream
|
||||
* @throws IOException
|
||||
* @throws SAXException
|
||||
* @throws ParserConfigurationException
|
||||
*/
|
||||
public synchronized static Document parse(InputStream stream)
|
||||
throws IOException, SAXException, ParserConfigurationException {
|
||||
return getDocumentBuilder().parse(stream);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param document DOM Document
|
||||
* @param name Name
|
||||
*/
|
||||
public static String getElementByName(Document document, String name) {
|
||||
NodeList nodes = document.getElementsByTagName(name);
|
||||
String s = null;
|
||||
for (int i=0; i < nodes.getLength() ; i++) {
|
||||
Node node = nodes.item(i);
|
||||
s = node.getTextContent().trim();
|
||||
}
|
||||
return s;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param doc DOM Document
|
||||
* @throws IOException
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
public static void serializeDoc(Document doc) throws IOException {
|
||||
org.apache.xml.serialize.XMLSerializer serializer = new org.apache.xml.serialize.XMLSerializer();
|
||||
serializer.setOutputByteStream(System.out);
|
||||
serializer.serialize(doc);
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
public static String serializeDoctoString(Document doc) throws IOException {
|
||||
org.apache.xml.serialize.XMLSerializer serializer = new org.apache.xml.serialize.XMLSerializer();
|
||||
ByteArrayOutputStream bout = new ByteArrayOutputStream();
|
||||
|
||||
serializer.setOutputByteStream(bout);
|
||||
serializer.serialize(doc);
|
||||
return bout.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param xml XML String
|
||||
*/
|
||||
public static void prettyPrint(String xml) {
|
||||
Source xmlInput = new StreamSource(new StringReader(xml));
|
||||
StreamResult xmlOutput = new StreamResult(new StringWriter());
|
||||
Transformer transformer = null;
|
||||
try {
|
||||
transformer = TransformerFactory.newInstance().newTransformer();
|
||||
} catch (TransformerConfigurationException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
} catch (TransformerFactoryConfigurationError e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
//transformer.setOutputProperty(OutputKeys.DOCTYPE_SYSTEM, "testing.dtd");
|
||||
transformer.setOutputProperty(OutputKeys.INDENT, "yes");
|
||||
transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "2");
|
||||
try {
|
||||
transformer.transform(xmlInput, xmlOutput);
|
||||
} catch (TransformerException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
String formattedxml=xmlOutput.getWriter().toString();
|
||||
System.out.println(formattedxml);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @param xml XML String
|
||||
*/
|
||||
public static String prettyPrintToString(String xml) {
|
||||
Source xmlInput = new StreamSource(new StringReader(xml));
|
||||
StreamResult xmlOutput = new StreamResult(new StringWriter());
|
||||
Transformer transformer = null;
|
||||
try {
|
||||
transformer = TransformerFactory.newInstance().newTransformer();
|
||||
} catch (TransformerConfigurationException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
} catch (TransformerFactoryConfigurationError e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
//transformer.setOutputProperty(OutputKeys.DOCTYPE_SYSTEM, "testing.dtd");
|
||||
transformer.setOutputProperty(OutputKeys.INDENT, "yes");
|
||||
transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "2");
|
||||
try {
|
||||
transformer.transform(xmlInput, xmlOutput);
|
||||
} catch (TransformerException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
String formattedxml=xmlOutput.getWriter().toString();
|
||||
return formattedxml;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @param node DOM Node
|
||||
*/
|
||||
public static void displayNodeInfo(Node node) {
|
||||
switch (node.getNodeType()) {
|
||||
case Node.DOCUMENT_NODE:
|
||||
System.out.println("Document Node ");
|
||||
break;
|
||||
case Node.ELEMENT_NODE:
|
||||
System.out.println("Element Node: "+ node.getNodeName());
|
||||
break;
|
||||
case Node.TEXT_NODE:
|
||||
System.out.println("Text Node: "+ node.getNodeName());
|
||||
break;
|
||||
case Node.CDATA_SECTION_NODE:
|
||||
System.out.println("CDATA Section Node: ");
|
||||
break;
|
||||
case Node.COMMENT_NODE:
|
||||
System.out.println("Comment Node ");
|
||||
break;
|
||||
case Node.PROCESSING_INSTRUCTION_NODE:
|
||||
System.out.println("Processing Instruction Node ");
|
||||
break;
|
||||
case Node.ENTITY_REFERENCE_NODE:
|
||||
System.out.println("Entity Reference Node ");
|
||||
break;
|
||||
case Node.DOCUMENT_TYPE_NODE:
|
||||
System.out.println("Document Type Node ");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param node DOM Node
|
||||
* @throws IOException
|
||||
*/
|
||||
public static void serializeNode(Node node) throws IOException {
|
||||
if (writer == null) writer = new BufferedWriter(new OutputStreamWriter(System.out));
|
||||
|
||||
switch (node.getNodeType()) {
|
||||
case Node.DOCUMENT_NODE:
|
||||
Document doc = (Document) node;
|
||||
writer.write("<?xml version=\"");
|
||||
writer.write(doc.getXmlVersion());
|
||||
writer.write("\" encoding=\"UTF-8\" standalone=\"");
|
||||
if (doc.getXmlStandalone())
|
||||
writer.write("yes");
|
||||
else
|
||||
writer.write("no");
|
||||
writer.write("\"?>\n");
|
||||
|
||||
NodeList nodes = node.getChildNodes();
|
||||
if (nodes != null)
|
||||
for (int i = 0; i < nodes.getLength(); i++)
|
||||
serializeNode(nodes.item(i));
|
||||
break;
|
||||
case Node.ELEMENT_NODE:
|
||||
String name = node.getNodeName();
|
||||
writer.write("<" + name);
|
||||
NamedNodeMap attributes = node.getAttributes();
|
||||
for (int i = 0; i < attributes.getLength(); i++) {
|
||||
Node current = attributes.item(i);
|
||||
writer.write(" " + current.getNodeName() + "=\"");
|
||||
print(current.getNodeValue());
|
||||
writer.write("\"");
|
||||
}
|
||||
writer.write(">");
|
||||
|
||||
NodeList children = node.getChildNodes();
|
||||
if (children != null) {
|
||||
//if ((children.item(0) != null) && (children.item(0).getNodeType() == Node.ELEMENT_NODE))
|
||||
// writer.write("\n");
|
||||
|
||||
for (int i = 0; i < children.getLength(); i++)
|
||||
serializeNode(children.item(i));
|
||||
if ((children.item(0) != null)
|
||||
&& (children.item(children.getLength() - 1).getNodeType() == Node.ELEMENT_NODE))
|
||||
writer.write("");
|
||||
}
|
||||
|
||||
writer.write("</" + name + ">");
|
||||
break;
|
||||
case Node.TEXT_NODE:
|
||||
print(node.getNodeValue());
|
||||
break;
|
||||
case Node.CDATA_SECTION_NODE:
|
||||
writer.write("CDATA");
|
||||
print(node.getNodeValue());
|
||||
writer.write("");
|
||||
break;
|
||||
case Node.COMMENT_NODE:
|
||||
writer.write("<!-- " + node.getNodeValue() + " -->\n");
|
||||
break;
|
||||
case Node.PROCESSING_INSTRUCTION_NODE:
|
||||
writer.write("<?" + node.getNodeName() + " " + node.getNodeValue() + "?>\n");
|
||||
break;
|
||||
case Node.ENTITY_REFERENCE_NODE:
|
||||
writer.write("&" + node.getNodeName() + ";");
|
||||
break;
|
||||
case Node.DOCUMENT_TYPE_NODE:
|
||||
DocumentType docType = (DocumentType) node;
|
||||
String publicId = docType.getPublicId();
|
||||
String systemId = docType.getSystemId();
|
||||
String internalSubset = docType.getInternalSubset();
|
||||
writer.write("<!DOCTYPE " + docType.getName());
|
||||
if (publicId != null)
|
||||
writer.write(" PUBLIC \"" + publicId + "\" ");
|
||||
else
|
||||
writer.write(" SYSTEM ");
|
||||
writer.write("\"" + systemId + "\"");
|
||||
if (internalSubset != null)
|
||||
writer.write(" [" + internalSubset + "]");
|
||||
writer.write(">\n");
|
||||
break;
|
||||
}
|
||||
writer.flush();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param s String
|
||||
* @throws IOException
|
||||
*/
|
||||
private static void print(String s) throws IOException {
|
||||
if (s == null)
|
||||
return;
|
||||
for (int i = 0, len = s.length(); i < len; i++) {
|
||||
char c = s.charAt(i);
|
||||
switch (c) {
|
||||
case '<':
|
||||
writer.write("<");
|
||||
break;
|
||||
case '>':
|
||||
writer.write(">");
|
||||
break;
|
||||
case '&':
|
||||
writer.write("&");
|
||||
break;
|
||||
case '\r':
|
||||
writer.write("
");
|
||||
break;
|
||||
default:
|
||||
writer.write(c);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param obj (either a Document or a Node)
|
||||
* @param expression Expression
|
||||
* @return string contents
|
||||
*/
|
||||
public static Node getNodeWithXpath(Object obj, String expression) {
|
||||
Object root = null;
|
||||
if (obj instanceof Document) {
|
||||
Document doc = (Document) obj;
|
||||
root = doc.getDocumentElement();
|
||||
} else {
|
||||
root = (Node) obj;
|
||||
}
|
||||
|
||||
XPath xpath = XPathFactory.newInstance().newXPath();
|
||||
xpath.setNamespaceContext(new MetadataNamespaceContext());
|
||||
Node result = null;
|
||||
|
||||
try {
|
||||
result = ((Node) xpath.evaluate(expression, root, XPathConstants.NODE));
|
||||
return result;
|
||||
} catch (XPathExpressionException e) {
|
||||
logger.error("XPathExpressionException ", e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -36,7 +36,7 @@ public class GeoFocusMapLocations extends AbstractAjaxResponder {
|
|||
+ "PREFIX core: <http://vivoweb.org/ontology/core#> \n"
|
||||
+ "PREFIX foaf: <http://xmlns.com/foaf/0.1/> \n"
|
||||
+ "PREFIX vivoc: <http://vivo.library.cornell.edu/ns/0.1#> \n"
|
||||
+ "PREFIX afn: <http://jena.hpl.hp.com/ARQ/function#> "
|
||||
+ "PREFIX afn: <http://jena.apache.org/ARQ/function#> "
|
||||
+ "SELECT DISTINCT ?label ?location (afn:localname(?location) AS ?localName) (COUNT(DISTINCT ?person) AS ?count) \n"
|
||||
+ "WHERE { { \n"
|
||||
+ " ?location rdf:type core:GeographicRegion . \n"
|
||||
|
|
|
@ -66,7 +66,7 @@ public class ManageGrantsForIndividualController extends FreemarkerHttpServlet {
|
|||
+ "PREFIX core: <http://vivoweb.org/ontology/core#> \n"
|
||||
+ "PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> \n"
|
||||
+ "PREFIX vitro: <http://vitro.mannlib.cornell.edu/ns/vitro/0.7#> \n"
|
||||
+ "PREFIX afn: <http://jena.hpl.hp.com/ARQ/function#> \n"
|
||||
+ "PREFIX afn: <http://jena.apache.org/ARQ/function#> \n"
|
||||
+ "SELECT DISTINCT ?subclass ?role (str(?label2) as ?label) ?activity ?hideThis WHERE { \n"
|
||||
+ " ?subject <http://purl.obolibrary.org/obo/RO_0000053> ?role . \n"
|
||||
+ " ?role a core:ResearcherRole . \n"
|
||||
|
|
|
@ -66,7 +66,7 @@ public class ManagePeopleForOrganizationController extends FreemarkerHttpServlet
|
|||
+ "PREFIX core: <http://vivoweb.org/ontology/core#> \n"
|
||||
+ "PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> \n"
|
||||
+ "PREFIX vitro: <http://vitro.mannlib.cornell.edu/ns/vitro/0.7#> \n"
|
||||
+ "PREFIX afn: <http://jena.hpl.hp.com/ARQ/function#> \n"
|
||||
+ "PREFIX afn: <http://jena.apache.org/ARQ/function#> \n"
|
||||
+ "PREFIX foaf: <http://xmlns.com/foaf/0.1/> \n"
|
||||
+ "SELECT DISTINCT ?subclass ?position ?positionLabel (str(?label) as ?name) ?person ?hideThis WHERE { \n"
|
||||
+ " ?subject core:relatedBy ?position . \n"
|
||||
|
|
|
@ -66,7 +66,7 @@ public class ManagePublicationsForIndividualController extends FreemarkerHttpSer
|
|||
+ "PREFIX core: <http://vivoweb.org/ontology/core#> \n"
|
||||
+ "PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> \n"
|
||||
+ "PREFIX vitro: <http://vitro.mannlib.cornell.edu/ns/vitro/0.7#> \n"
|
||||
+ "PREFIX afn: <http://jena.hpl.hp.com/ARQ/function#> \n"
|
||||
+ "PREFIX afn: <http://jena.apache.org/ARQ/function#> \n"
|
||||
+ "SELECT DISTINCT ?subclass ?authorship (str(?label) as ?title) ?pub ?hideThis WHERE { \n"
|
||||
+ " ?subject core:relatedBy ?authorship . \n"
|
||||
+ " ?authorship a core:Authorship . \n"
|
||||
|
|
|
@ -6,18 +6,20 @@ import java.io.BufferedReader;
|
|||
import java.io.File;
|
||||
import java.io.FileReader;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStreamReader;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.commons.csv.CSVFormat;
|
||||
import org.apache.commons.csv.CSVParser;
|
||||
import org.apache.commons.csv.CSVRecord;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.skife.csv.SimpleReader;
|
||||
|
||||
import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* An implementation of FileHarvestJob that can be used for any CSV file harvest.
|
||||
*/
|
||||
|
@ -214,75 +216,48 @@ class CsvFileHarvestJob implements FileHarvestJob {
|
|||
@SuppressWarnings("rawtypes")
|
||||
public String validateUpload(File file) {
|
||||
try {
|
||||
SimpleReader reader = new SimpleReader();
|
||||
|
||||
List templateCsv = reader.parse(this.templateFile);
|
||||
String[] templateFirstLine = (String[])templateCsv.get(0);
|
||||
|
||||
//if a line ends in a comma (absolutely a comma, no whitespace), SimpleReader will not consider the part after the comma to be a blank section.
|
||||
List csv = reader.parse(file);
|
||||
boolean[] linesEndingInComma = getLinesEndingInComma(file);
|
||||
|
||||
int length = csv.size();
|
||||
|
||||
if(length == 0)
|
||||
return "No data in file";
|
||||
|
||||
for(int i = 0; i < length; i++) {
|
||||
String[] line = (String[])csv.get(i);
|
||||
boolean endsInComma = linesEndingInComma[i];
|
||||
if(i == 0) {
|
||||
String errorMessage = validateCsvFirstLine(templateFirstLine, line);
|
||||
if(errorMessage != null)
|
||||
return errorMessage;
|
||||
String message = "No data in file";
|
||||
CSVParser cReader = new CSVParser(new FileReader(file), CSVFormat.DEFAULT);
|
||||
try {
|
||||
int rowNum = 0;
|
||||
int numberFields = 0;
|
||||
String errorMsg = "File header does not match template";
|
||||
for (CSVRecord cRecord : cReader) {
|
||||
rowNum++;
|
||||
if (false) {
|
||||
numberFields = cRecord.size();
|
||||
errorMsg += "file header items: ";
|
||||
for(int i = 0; i < cRecord.size(); i++) {
|
||||
errorMsg += cRecord.get(i) + ", ";
|
||||
}
|
||||
else if(line.length != 0) {
|
||||
int actualLineLength = line.length + (endsInComma ? 1 : 0);
|
||||
if(actualLineLength != templateFirstLine.length) {
|
||||
return "Mismatch in number of entries in row " + i + ": expected " + templateFirstLine.length + ", found " + actualLineLength;
|
||||
} else {
|
||||
if (cRecord.size() > 0) {
|
||||
if(cRecord.size() != numberFields) {
|
||||
if (errorMsg != null) {
|
||||
errorMsg += "template items: ";
|
||||
for(int i = 0; i < cRecord.size(); i++) {
|
||||
errorMsg += cRecord.get(i) + ", ";
|
||||
}
|
||||
return errorMsg;
|
||||
}
|
||||
return "Mismatch in number of entries in row " + rowNum + ": expected " + numberFields + ", found " + cRecord.size();
|
||||
}
|
||||
}
|
||||
message = null;
|
||||
errorMsg = null;
|
||||
}
|
||||
}
|
||||
|
||||
return message;
|
||||
} finally {
|
||||
cReader.close();
|
||||
}
|
||||
} catch (IOException e) {
|
||||
log.error(e, e);
|
||||
return e.getMessage();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Makes sure that the first line of the CSV file is identical to the first line of the template file. This is
|
||||
* assuming we are expecting all user CSV files to contain an initial header line. If this is not the case, then
|
||||
* this method is unnecessary.
|
||||
* @param templateFirstLine the parsed-out contents of the first line of the template file
|
||||
* @param line the parsed-out contents of the first line of the input file
|
||||
* @return an error message if the two lines don't match, or null if they do
|
||||
*/
|
||||
private String validateCsvFirstLine(String[] templateFirstLine, String[] line) {
|
||||
String errorMessage = "File header does not match template";
|
||||
if(line.length != templateFirstLine.length) {
|
||||
//return errorMessage + ": " + "file header columns = " + line.length + ", template columns = " + templateFirstLine.length;
|
||||
String errorMsg = "";
|
||||
errorMsg += "file header items: ";
|
||||
for(int i = 0; i < line.length; i++) {
|
||||
errorMsg += line[i] + ", ";
|
||||
}
|
||||
errorMsg += "template items: ";
|
||||
for(int i = 0; i < templateFirstLine.length; i++) {
|
||||
errorMsg += templateFirstLine[i] + ", ";
|
||||
}
|
||||
return errorMsg;
|
||||
}
|
||||
for(int i = 0; i < line.length; i++)
|
||||
{
|
||||
if(!line[i].equals(templateFirstLine[i]))
|
||||
return errorMessage + ": file header column " + (i + 1) + " = " + line[i] + ", template column " + (i + 1) + " = " + templateFirstLine[i];
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
private void prepareWorkspaceDirectory() {
|
||||
String path = FileHarvestController.getFileHarvestRootPath() + "workspaces/" + this.sessionId;
|
||||
|
|
|
@ -9,7 +9,7 @@ import java.util.Map;
|
|||
|
||||
import javax.servlet.ServletContext;
|
||||
|
||||
import org.apache.commons.lang.StringEscapeUtils;
|
||||
import org.apache.commons.lang3.StringEscapeUtils;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
|
@ -168,7 +168,7 @@ public class ShortURLVisualizationController extends FreemarkerHttpServlet {
|
|||
+ matchedPatternGroups.get(1);
|
||||
}
|
||||
|
||||
subjectURI = StringEscapeUtils.escapeHtml(subjectURI);
|
||||
subjectURI = StringEscapeUtils.ESCAPE_HTML4.translate(subjectURI);
|
||||
parameters.put(VisualizationFrameworkConstants.INDIVIDUAL_URI_KEY, subjectURI);
|
||||
|
||||
if (VisualizationFrameworkConstants.COAUTHORSHIP_VIS_SHORT_URL
|
||||
|
@ -243,7 +243,7 @@ public class ShortURLVisualizationController extends FreemarkerHttpServlet {
|
|||
|
||||
List<String> matchedGroups = new ArrayList<String>();
|
||||
String subURIString = vitroRequest.getRequestURI().substring(vitroRequest.getContextPath().length()+1);
|
||||
String[] urlParams = StringEscapeUtils.escapeHtml(subURIString).split("/");
|
||||
String[] urlParams = StringEscapeUtils.ESCAPE_HTML4.translate(subURIString).split("/");
|
||||
|
||||
if (urlParams.length > 1
|
||||
&& urlParams[0].equalsIgnoreCase("vis")) {
|
||||
|
|
|
@ -6,7 +6,7 @@ import java.util.HashMap;
|
|||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@ import java.util.HashMap;
|
|||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import org.apache.jena.rdf.model.Literal;
|
||||
|
||||
|
|
|
@ -352,7 +352,7 @@ public class AddAuthorsToInformationResourceGenerator extends VivoBaseGenerator
|
|||
|
||||
private static String AUTHORSHIPS_MODEL = " \n"
|
||||
+ "PREFIX core: <http://vivoweb.org/ontology/core#>\n"
|
||||
+ "PREFIX afn: <http://jena.hpl.hp.com/ARQ/function#>\n"
|
||||
+ "PREFIX afn: <http://jena.apache.org/ARQ/function#>\n"
|
||||
+ "PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>\n"
|
||||
+ "PREFIX foaf: <http://xmlns.com/foaf/0.1/>\n"
|
||||
+ "PREFIX vcard: <http://www.w3.org/2006/vcard/ns#>\n"
|
||||
|
@ -418,7 +418,7 @@ public class AddAuthorsToInformationResourceGenerator extends VivoBaseGenerator
|
|||
|
||||
private static String AUTHORSHIPS_QUERY = " \n"
|
||||
+ "PREFIX core: <http://vivoweb.org/ontology/core#> \n"
|
||||
+ "PREFIX afn: <http://jena.hpl.hp.com/ARQ/function#> \n"
|
||||
+ "PREFIX afn: <http://jena.apache.org/ARQ/function#> \n"
|
||||
+ "PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> \n"
|
||||
+ "PREFIX foaf: <http://xmlns.com/foaf/0.1/> \n"
|
||||
+ "PREFIX vcard: <http://www.w3.org/2006/vcard/ns#> \n"
|
||||
|
|
|
@ -315,7 +315,7 @@ public class AddEditorsToInformationResourceGenerator extends VivoBaseGenerator
|
|||
|
||||
private static String EDITORSHIPS_MODEL = ""
|
||||
+ "PREFIX core: <http://vivoweb.org/ontology/core#>\n"
|
||||
+ "PREFIX afn: <http://jena.hpl.hp.com/ARQ/function#>\n"
|
||||
+ "PREFIX afn: <http://jena.apache.org/ARQ/function#>\n"
|
||||
+ "PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>\n"
|
||||
+ "PREFIX foaf: <http://xmlns.com/foaf/0.1/>\n"
|
||||
+ "CONSTRUCT\n"
|
||||
|
@ -353,7 +353,7 @@ public class AddEditorsToInformationResourceGenerator extends VivoBaseGenerator
|
|||
|
||||
private static String EDITORSHIPS_QUERY = ""
|
||||
+ "PREFIX core: <http://vivoweb.org/ontology/core#> \n"
|
||||
+ "PREFIX afn: <http://jena.hpl.hp.com/ARQ/function#> \n"
|
||||
+ "PREFIX afn: <http://jena.apache.org/ARQ/function#> \n"
|
||||
+ "PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> \n"
|
||||
+ "PREFIX foaf: <http://xmlns.com/foaf/0.1/> \n"
|
||||
+ "SELECT ?editorshipURI (afn:localname(?editorshipURI) AS ?editorshipName) ?editorURI ?editorName ?rank \n"
|
||||
|
|
|
@ -11,7 +11,7 @@ import java.util.Map;
|
|||
|
||||
import javax.servlet.http.HttpSession;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.vivoweb.webapp.util.ModelUtils;
|
||||
|
|
|
@ -13,7 +13,7 @@ import javax.servlet.http.HttpSession;
|
|||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import org.apache.jena.rdf.model.Literal;
|
||||
import org.apache.jena.rdf.model.Model;
|
||||
|
|
|
@ -39,7 +39,7 @@ public class VIVODefaultAddMissingIndividualFormGenerator extends DefaultAddMiss
|
|||
return prefixStrings;
|
||||
}
|
||||
|
||||
private String getN3ForName() {
|
||||
protected String getN3ForName() {
|
||||
return "?" + objectVarName + " rdfs:label ?label .";
|
||||
}
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ import net.sf.json.JSON;
|
|||
import net.sf.json.JSONArray;
|
||||
import net.sf.json.JSONSerializer;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ import java.util.HashMap;
|
|||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ import java.util.HashMap;
|
|||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ package edu.cornell.mannlib.vitro.webapp.searchindex.extensions;
|
|||
|
||||
import static edu.cornell.mannlib.vitro.webapp.search.VitroSearchTermNames.ALLTEXT;
|
||||
import static edu.cornell.mannlib.vitro.webapp.search.VitroSearchTermNames.ALLTEXTUNSTEMMED;
|
||||
import static edu.cornell.mannlib.vitro.webapp.utils.sparql.SelectQueryRunner.createQueryContext;
|
||||
import static edu.cornell.mannlib.vitro.webapp.utils.sparqlrunner.SparqlQueryRunner.createSelectQueryContext;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
|
@ -104,31 +104,19 @@ public class LabelsAcrossContextNodes implements IndexingUriFinder,
|
|||
this.rdfService = models.getRDFService();
|
||||
}
|
||||
|
||||
@Property(uri = "http://www.w3.org/2000/01/rdf-schema#label")
|
||||
@Property(uri = "http://www.w3.org/2000/01/rdf-schema#label", maxOccurs = 1)
|
||||
public void setLabel(String l) {
|
||||
label = l;
|
||||
}
|
||||
|
||||
@Property(uri = "http://vitro.mannlib.cornell.edu/ns/vitro/ApplicationSetup#hasIncomingProperty")
|
||||
@Property(uri = "http://vitro.mannlib.cornell.edu/ns/vitro/ApplicationSetup#hasIncomingProperty", minOccurs = 1, maxOccurs = 1)
|
||||
public void setIncomingProperty(String incomingUri) {
|
||||
if (incomingPropertyUri == null) {
|
||||
incomingPropertyUri = incomingUri;
|
||||
} else {
|
||||
throw new IllegalStateException(
|
||||
"Configuration includes multiple declarations for hasIncomingProperty: "
|
||||
+ incomingPropertyUri + ", and " + incomingUri);
|
||||
}
|
||||
}
|
||||
|
||||
@Property(uri = "http://vitro.mannlib.cornell.edu/ns/vitro/ApplicationSetup#hasOutgoingProperty")
|
||||
@Property(uri = "http://vitro.mannlib.cornell.edu/ns/vitro/ApplicationSetup#hasOutgoingProperty", minOccurs = 1, maxOccurs = 1)
|
||||
public void setOutgoingProperty(String outgoingUri) {
|
||||
if (outgoingPropertyUri == null) {
|
||||
outgoingPropertyUri = outgoingUri;
|
||||
} else {
|
||||
throw new IllegalStateException(
|
||||
"Configuration includes multiple declarations for hasOutgoingProperty: "
|
||||
+ outgoingPropertyUri + ", and " + outgoingUri);
|
||||
}
|
||||
}
|
||||
|
||||
@Property(uri = "http://vitro.mannlib.cornell.edu/ns/vitro/ApplicationSetup#hasTypeRestriction")
|
||||
|
@ -149,14 +137,6 @@ public class LabelsAcrossContextNodes implements IndexingUriFinder,
|
|||
formatRestrictions(typeRestrictions),
|
||||
formatRestrictions(contextNodeClasses));
|
||||
}
|
||||
if (incomingPropertyUri == null) {
|
||||
throw new IllegalStateException(
|
||||
"Configuration did not declare hasIncomingProperty.");
|
||||
}
|
||||
if (outgoingPropertyUri == null) {
|
||||
throw new IllegalStateException(
|
||||
"Configuration did not declare hasOutgoingProperty.");
|
||||
}
|
||||
}
|
||||
|
||||
private String formatRestrictions(Set<String> uris) {
|
||||
|
@ -242,25 +222,26 @@ public class LabelsAcrossContextNodes implements IndexingUriFinder,
|
|||
|
||||
private void addLabelsFromAllContextNodeClasses(Individual ind,
|
||||
SearchInputDocument doc) {
|
||||
addValuesToTextFields(doc,
|
||||
createQueryContext(rdfService, LABELS_WITHOUT_RESTRICTION)
|
||||
addValuesToTextFields(
|
||||
doc,
|
||||
createSelectQueryContext(rdfService, LABELS_WITHOUT_RESTRICTION)
|
||||
.bindVariableToUri("uri", ind.getURI())
|
||||
.bindVariableToUri("incoming", incomingPropertyUri)
|
||||
.bindVariableToUri("outgoing", outgoingPropertyUri)
|
||||
.execute().getStringFields("label").flatten());
|
||||
.execute().toStringFields("label").flatten());
|
||||
}
|
||||
|
||||
private void addLabelsFromContextNodeClass(Individual ind,
|
||||
SearchInputDocument doc, String contextNodeClass) {
|
||||
addValuesToTextFields(
|
||||
doc,
|
||||
createQueryContext(rdfService,
|
||||
createSelectQueryContext(rdfService,
|
||||
LABELS_FOR_SPECIFIC_CONTEXT_NODE_TYPE)
|
||||
.bindVariableToUri("uri", ind.getURI())
|
||||
.bindVariableToUri("nodeType", contextNodeClass)
|
||||
.bindVariableToUri("incoming", incomingPropertyUri)
|
||||
.bindVariableToUri("outgoing", outgoingPropertyUri)
|
||||
.execute().getStringFields("label").flatten());
|
||||
.execute().toStringFields("label").flatten());
|
||||
}
|
||||
|
||||
private void addValuesToTextFields(SearchInputDocument doc,
|
||||
|
@ -349,23 +330,23 @@ public class LabelsAcrossContextNodes implements IndexingUriFinder,
|
|||
}
|
||||
|
||||
private Set<String> locatePartnersWithoutRestriction(String uri) {
|
||||
return createQueryContext(rdfService,
|
||||
return createSelectQueryContext(rdfService,
|
||||
LOCATE_PARTNERS_WITHOUT_RESTRICTION)
|
||||
.bindVariableToUri("uri", uri)
|
||||
.bindVariableToUri("incoming", incomingPropertyUri)
|
||||
.bindVariableToUri("outgoing", outgoingPropertyUri).execute()
|
||||
.getStringFields("partner").flattenToSet();
|
||||
.toStringFields("partner").flattenToSet();
|
||||
}
|
||||
|
||||
private Collection<? extends String> locatePartnersAcrossContextNodeClass(
|
||||
String uri, String contextNodeClass) {
|
||||
return createQueryContext(rdfService,
|
||||
return createSelectQueryContext(rdfService,
|
||||
LOCATE_PARTNERS_ON_CONTEXT_NODE_TYPE)
|
||||
.bindVariableToUri("uri", uri)
|
||||
.bindVariableToUri("nodeType", contextNodeClass)
|
||||
.bindVariableToUri("incoming", incomingPropertyUri)
|
||||
.bindVariableToUri("outgoing", outgoingPropertyUri).execute()
|
||||
.getStringFields("partner").flattenToSet();
|
||||
.toStringFields("partner").flattenToSet();
|
||||
}
|
||||
|
||||
private boolean isIncomingStatementOnAcceptableContextNode(Statement stmt) {
|
||||
|
@ -388,9 +369,9 @@ public class LabelsAcrossContextNodes implements IndexingUriFinder,
|
|||
}
|
||||
|
||||
private Set<String> getTypes(String uri) {
|
||||
return createQueryContext(rdfService, GET_TYPES)
|
||||
.bindVariableToUri("uri", uri).execute()
|
||||
.getStringFields("type").flattenToSet();
|
||||
return createSelectQueryContext(rdfService, GET_TYPES)
|
||||
.bindVariableToUri("uri", uri).execute().toStringFields("type")
|
||||
.flattenToSet();
|
||||
}
|
||||
|
||||
private Set<String> locateOtherPartners(Statement stmt) {
|
||||
|
@ -402,12 +383,12 @@ public class LabelsAcrossContextNodes implements IndexingUriFinder,
|
|||
String objectUri = (stmt.getObject().isURIResource()) ? stmt
|
||||
.getObject().asResource().getURI() : "NO_MATCH";
|
||||
|
||||
return createQueryContext(rdfService,
|
||||
return createSelectQueryContext(rdfService,
|
||||
LOCATE_OTHER_PARTNERS_ON_THIS_NODE)
|
||||
.bindVariableToUri("contextNode", nodeUri)
|
||||
.bindVariableToUri("uri", objectUri)
|
||||
.bindVariableToUri("outgoing", outgoingPropertyUri).execute()
|
||||
.getStringFields("partner").flattenToSet();
|
||||
.toStringFields("partner").flattenToSet();
|
||||
}
|
||||
|
||||
private List<String> filterByType(Collection<String> uris) {
|
||||
|
|
|
@ -11,7 +11,7 @@ import javax.servlet.ServletException;
|
|||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
package edu.cornell.mannlib.vitro.webapp.visualization.capabilitymap;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.jena.query.Dataset;
|
||||
import org.apache.jena.query.QueryExecution;
|
||||
import org.apache.jena.query.QueryExecutionFactory;
|
||||
|
@ -24,7 +25,6 @@ import edu.cornell.mannlib.vitro.webapp.visualization.model.ConceptPeopleMap;
|
|||
import edu.cornell.mannlib.vitro.webapp.visualization.model.OrganizationPeopleMap;
|
||||
import edu.cornell.mannlib.vitro.webapp.visualization.utilities.VisualizationCaches;
|
||||
import edu.cornell.mannlib.vitro.webapp.visualization.visutils.VisualizationRequestHandler;
|
||||
import org.apache.axis.utils.StringUtils;
|
||||
import org.apache.commons.logging.Log;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
|
|
@ -22,7 +22,7 @@ import edu.cornell.mannlib.vitro.webapp.rdfservice.RDFServiceException;
|
|||
import edu.cornell.mannlib.vitro.webapp.rdfservice.ResultSetConsumer;
|
||||
import edu.cornell.mannlib.vitro.webapp.visualization.utilities.VisualizationCaches;
|
||||
import edu.cornell.mannlib.vitro.webapp.visualization.visutils.UtilityFunctions;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.jena.iri.IRI;
|
||||
import org.apache.jena.iri.IRIFactory;
|
||||
|
|
|
@ -8,8 +8,8 @@ import java.util.Map.Entry;
|
|||
import java.util.Set;
|
||||
import java.util.TreeMap;
|
||||
|
||||
import org.apache.commons.lang.StringEscapeUtils;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.commons.lang3.StringEscapeUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.commons.logging.Log;
|
||||
|
||||
import org.apache.jena.query.Dataset;
|
||||
|
|
|
@ -41,7 +41,7 @@ public class QueryConstants {
|
|||
put("vivo", "http://vivo.library.cornell.edu/ns/0.1#");
|
||||
put("geo", "http://aims.fao.org/aos/geopolitical.owl#");
|
||||
put("public", "http://vitro.mannlib.cornell.edu/ns/vitro/public#");
|
||||
put("afn", "http://jena.hpl.hp.com/ARQ/function#");
|
||||
put("afn", "http://jena.apache.org/ARQ/function#");
|
||||
put("vivosocnet", "http://vivo.cns.iu.edu/ns/#");
|
||||
put("obo", "http://purl.obolibrary.org/obo/");
|
||||
put("vcard", "http://www.w3.org/2006/vcard/ns#");
|
||||
|
|
|
@ -8,7 +8,7 @@ import java.util.Set;
|
|||
import edu.cornell.mannlib.vitro.webapp.rdfservice.RDFService;
|
||||
import edu.cornell.mannlib.vitro.webapp.rdfservice.RDFServiceException;
|
||||
import edu.cornell.mannlib.vitro.webapp.rdfservice.impl.RDFServiceUtils;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.apache.jena.iri.IRI;
|
||||
|
|
|
@ -17,7 +17,7 @@ import edu.cornell.mannlib.vitro.webapp.rdfservice.RDFService;
|
|||
import edu.cornell.mannlib.vitro.webapp.rdfservice.RDFServiceException;
|
||||
import edu.cornell.mannlib.vitro.webapp.rdfservice.ResultSetConsumer;
|
||||
import edu.cornell.mannlib.vitro.webapp.visualization.visutils.UtilityFunctions;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.apache.jena.iri.IRI;
|
||||
|
|
|
@ -6,8 +6,8 @@ import java.util.Map;
|
|||
import java.util.Set;
|
||||
import java.util.TreeMap;
|
||||
|
||||
import org.apache.commons.lang.StringEscapeUtils;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.commons.lang3.StringEscapeUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.commons.logging.Log;
|
||||
|
||||
import org.apache.jena.query.Dataset;
|
||||
|
|
|
@ -22,8 +22,8 @@ import edu.cornell.mannlib.vitro.webapp.visualization.utilities.VisualizationCac
|
|||
import mapping.ScienceMapping;
|
||||
import mapping.ScienceMappingResult;
|
||||
|
||||
import org.apache.commons.lang.StringEscapeUtils;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.commons.lang3.StringEscapeUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.commons.logging.Log;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
|
|
|
@ -18,7 +18,7 @@ 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.valueobjects.Activity;
|
||||
import edu.cornell.mannlib.vitro.webapp.visualization.visutils.QueryRunner;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.jena.iri.IRI;
|
||||
import org.apache.jena.iri.IRIFactory;
|
||||
|
|
|
@ -8,7 +8,7 @@ import java.util.Map.Entry;
|
|||
import java.util.Set;
|
||||
|
||||
import edu.cornell.mannlib.vitro.webapp.visualization.visutils.QueryRunner;
|
||||
import org.apache.commons.lang.StringEscapeUtils;
|
||||
import org.apache.commons.lang3.StringEscapeUtils;
|
||||
import org.apache.commons.logging.Log;
|
||||
|
||||
import org.apache.jena.query.Dataset;
|
||||
|
|
|
@ -14,7 +14,7 @@ import org.apache.jena.vocabulary.RDFS;
|
|||
import edu.cornell.mannlib.vitro.webapp.rdfservice.RDFService;
|
||||
import edu.cornell.mannlib.vitro.webapp.rdfservice.RDFServiceException;
|
||||
import edu.cornell.mannlib.vitro.webapp.rdfservice.ResultSetConsumer;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.jena.iri.IRI;
|
||||
import org.apache.jena.iri.IRIFactory;
|
||||
|
|
|
@ -7,8 +7,8 @@ import java.util.Map;
|
|||
import java.util.Map.Entry;
|
||||
import java.util.Set;
|
||||
|
||||
import org.apache.commons.lang.StringEscapeUtils;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.commons.lang3.StringEscapeUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.commons.logging.Log;
|
||||
|
||||
import org.apache.jena.query.Dataset;
|
||||
|
|
|
@ -4,7 +4,7 @@ package edu.cornell.mannlib.vitro.webapp.visualization.temporalgraph;
|
|||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.jena.iri.IRI;
|
||||
import org.apache.jena.iri.IRIFactory;
|
||||
|
|
|
@ -15,8 +15,8 @@ import edu.cornell.mannlib.vitro.webapp.visualization.model.OrganizationPeopleMa
|
|||
import edu.cornell.mannlib.vitro.webapp.visualization.utilities.CounterUtils;
|
||||
import edu.cornell.mannlib.vitro.webapp.visualization.utilities.OrgUtils;
|
||||
import edu.cornell.mannlib.vitro.webapp.visualization.utilities.VisualizationCaches;
|
||||
import org.apache.commons.lang.StringEscapeUtils;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.commons.lang3.StringEscapeUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.commons.logging.Log;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
|
|
|
@ -15,8 +15,8 @@ import edu.cornell.mannlib.vitro.webapp.visualization.model.OrganizationPeopleMa
|
|||
import edu.cornell.mannlib.vitro.webapp.visualization.utilities.CounterUtils;
|
||||
import edu.cornell.mannlib.vitro.webapp.visualization.utilities.OrgUtils;
|
||||
import edu.cornell.mannlib.vitro.webapp.visualization.utilities.VisualizationCaches;
|
||||
import org.apache.commons.lang.StringEscapeUtils;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.commons.lang3.StringEscapeUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.commons.logging.Log;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
package edu.cornell.mannlib.vitro.webapp.visualization.utilities;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Map;
|
||||
|
|
|
@ -7,7 +7,7 @@ import java.util.Map;
|
|||
|
||||
import edu.cornell.mannlib.vitro.webapp.rdfservice.RDFServiceException;
|
||||
import edu.cornell.mannlib.vitro.webapp.rdfservice.ResultSetConsumer;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.jena.iri.IRI;
|
||||
import org.apache.jena.iri.IRIFactory;
|
||||
|
|
|
@ -4,7 +4,7 @@ package edu.cornell.mannlib.vitro.webapp.visualization.valueobjects;
|
|||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import org.apache.jena.rdf.model.Model;
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@ package edu.cornell.mannlib.vitro.webapp.visualization.visutils;
|
|||
import edu.cornell.mannlib.vitro.webapp.rdfservice.RDFService;
|
||||
import edu.cornell.mannlib.vitro.webapp.rdfservice.RDFServiceException;
|
||||
import edu.cornell.mannlib.vitro.webapp.rdfservice.ResultSetConsumer;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.apache.jena.iri.IRI;
|
||||
|
|
|
@ -12,7 +12,7 @@ import java.util.TreeMap;
|
|||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.joda.time.DateTime;
|
||||
import org.joda.time.format.DateTimeFormatter;
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
package edu.cornell.mannlib.vitro.webapp.web.templatemodels.individuallist;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
package edu.cornell.mannlib.vitro.webapp.web.templatemodels.searchresult;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ import javax.servlet.ServletContext;
|
|||
import javax.servlet.ServletContextEvent;
|
||||
import javax.servlet.ServletContextListener;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
|
|
|
@ -18,15 +18,14 @@ import org.apache.jena.rdf.model.Resource;
|
|||
|
||||
import edu.cornell.mannlib.vitro.webapp.auth.identifier.IdentifierBundle;
|
||||
import edu.cornell.mannlib.vitro.webapp.auth.identifier.RequestIdentifiers;
|
||||
import edu.cornell.mannlib.vitro.webapp.auth.identifier.common.HasAssociatedIndividual;
|
||||
import edu.cornell.mannlib.vitro.webapp.auth.identifier.common.HasProfile;
|
||||
import edu.cornell.mannlib.vitro.webapp.auth.identifier.common.HasProxyEditingRights;
|
||||
import edu.cornell.mannlib.vitro.webapp.auth.identifier.common.IsRootUser;
|
||||
import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest;
|
||||
import edu.cornell.mannlib.vitro.webapp.controller.freemarker.UrlBuilder;
|
||||
import edu.cornell.mannlib.vitro.webapp.utils.SparqlQueryRunner;
|
||||
import edu.cornell.mannlib.vitro.webapp.utils.SparqlQueryRunner.QueryParser;
|
||||
import edu.cornell.mannlib.vitro.webapp.utils.dataGetter.DataGetter;
|
||||
import edu.cornell.mannlib.vitro.webapp.utils.sparqlrunner.ResultSetParser;
|
||||
import edu.cornell.mannlib.vitro.webapp.utils.sparqlrunner.SparqlQueryRunner;
|
||||
import edu.cornell.mannlib.vivo.orcid.controller.OrcidIntegrationController;
|
||||
|
||||
/**
|
||||
|
@ -122,8 +121,9 @@ public class OrcidIdDataGetter implements DataGetter {
|
|||
private List<OrcidInfo> runSparqlQuery(String individualUri) {
|
||||
String queryStr = String.format(QUERY_TEMPLATE, individualUri,
|
||||
ORCID_ID, ORCID_IS_CONFIRMED);
|
||||
SparqlQueryRunner runner = new SparqlQueryRunner(vreq.getJenaOntModel());
|
||||
return runner.executeSelect(new OrcidResultParser(), queryStr);
|
||||
return SparqlQueryRunner
|
||||
.createSelectQueryContext(vreq.getJenaOntModel(), queryStr)
|
||||
.execute().parse(new OrcidResultParser());
|
||||
}
|
||||
|
||||
private Map<String, Object> buildMap(boolean isAuthorizedToConfirm,
|
||||
|
@ -154,7 +154,7 @@ public class OrcidIdDataGetter implements DataGetter {
|
|||
/**
|
||||
* Parse the results of the SPARQL query.
|
||||
*/
|
||||
private static class OrcidResultParser extends QueryParser<List<OrcidInfo>> {
|
||||
private static class OrcidResultParser extends ResultSetParser<List<OrcidInfo>> {
|
||||
@Override
|
||||
protected List<OrcidInfo> defaultValue() {
|
||||
return Collections.emptyList();
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
package org.vivoweb.webapp.sitemap;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.jena.query.QuerySolution;
|
||||
import edu.cornell.mannlib.vitro.webapp.controller.VitroHttpServlet;
|
||||
import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest;
|
||||
|
@ -9,7 +10,6 @@ import edu.cornell.mannlib.vitro.webapp.controller.freemarker.UrlBuilder;
|
|||
import edu.cornell.mannlib.vitro.webapp.rdfservice.RDFServiceException;
|
||||
import edu.cornell.mannlib.vitro.webapp.rdfservice.ResultSetConsumer;
|
||||
import edu.cornell.mannlib.vitro.webapp.visualization.constants.QueryConstants;
|
||||
import org.apache.axis.utils.StringUtils;
|
||||
import org.apache.commons.io.IOUtils;
|
||||
|
||||
import javax.servlet.ServletException;
|
||||
|
|
|
@ -11,7 +11,7 @@ import edu.cornell.mannlib.vitro.webapp.controller.individuallist.IndividualJson
|
|||
import edu.cornell.mannlib.vitro.webapp.dao.ObjectPropertyStatementDao;
|
||||
import edu.cornell.mannlib.vitro.webapp.dao.WebappDaoFactory;
|
||||
import edu.cornell.mannlib.vitro.webapp.dao.jena.QueryUtils;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.json.JSONException;
|
||||
|
|
|
@ -7,13 +7,13 @@
|
|||
|
||||
<groupId>org.vivoweb</groupId>
|
||||
<artifactId>vivo-home</artifactId>
|
||||
<version>1.9.0-SNAPSHOT</version>
|
||||
<version>1.10.0-SNAPSHOT</version>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<parent>
|
||||
<groupId>org.vivoweb</groupId>
|
||||
<artifactId>vivo-project</artifactId>
|
||||
<version>1.9.0-SNAPSHOT</version>
|
||||
<version>1.10.0-SNAPSHOT</version>
|
||||
<relativePath>..</relativePath>
|
||||
</parent>
|
||||
|
||||
|
|
|
@ -95,7 +95,7 @@
|
|||
<rdfs:label xml:lang="en-US">M.P.H. Master of Public Health</rdfs:label>
|
||||
<core:description rdf:datatype="http://www.w3.org/2001/XMLSchema#string"><p>Professional public health degree. (contrast with M.S.P.H.)</p>
|
||||
<p>See the Wikipedia entry at: http://en.wikipedia.org/wiki/Professional_degrees_of_public_health</p></core:description>
|
||||
<core:abbreviation rdf:datatype="http://www.w3.org/2000/01/rdf-schema#Literal">M.P.H.</core:abbreviation>
|
||||
<core:abbreviation>M.P.H.</core:abbreviation>
|
||||
<rdf:type rdf:resource="http://vivoweb.org/ontology/core#AcademicDegree"/>
|
||||
</rdf:Description>
|
||||
<rdf:Description rdf:about="http://vivoweb.org/ontology/degree/academicDegree101">
|
||||
|
@ -398,7 +398,7 @@
|
|||
<core:description rdf:datatype="http://www.w3.org/2001/XMLSchema#string">Abbreviation commonly used by Canadian and British universities.</core:description>
|
||||
<rdfs:label xml:lang="en-US">B.Sc. Bachelor of Science</rdfs:label>
|
||||
<rdf:type rdf:resource="http://vivoweb.org/ontology/core#AcademicDegree"/>
|
||||
<core:abbreviation rdf:datatype="http://www.w3.org/2000/01/rdf-schema#Literal">B.Sc.</core:abbreviation>
|
||||
<core:abbreviation>B.Sc.</core:abbreviation>
|
||||
</rdf:Description>
|
||||
<rdf:Description rdf:about="http://vivoweb.org/ontology/degree/academicDegree17">
|
||||
<rdfs:label xml:lang="en-US">B.D. Bachelor of Divinity</rdfs:label>
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
xmlns:vitro="http://vitro.mannlib.cornell.edu/ns/vitro/0.7#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:j.2="http://www.w3.org/2008/05/skos#"
|
||||
xmlns:afn="http://jena.hpl.hp.com/ARQ/function#"
|
||||
xmlns:afn="http://jena.apache.org/ARQ/function#"
|
||||
xmlns:bibo="http://purl.org/ontology/bibo/"
|
||||
xmlns:foaf="http://xmlns.com/foaf/0.1/"
|
||||
xmlns:j.3="http://www.w3.org/2003/06/sw-vocab-status/ns#"
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
|
||||
@prefix core: <http://vivoweb.org/ontology/core#> .
|
||||
@prefix vivoweb: <http://vivoweb.org/ontology#> .
|
||||
@prefix afn: <http://jena.hpl.hp.com/ARQ/function#> .
|
||||
@prefix afn: <http://jena.apache.org/ARQ/function#> .
|
||||
|
||||
|
||||
#### Check to see if the person being viewed has a first and last name. ####
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
@prefix hr: <http://vivo.cornell.edu/ns/hr/0.9/hr.owl#> .
|
||||
@prefix afn: <http://jena.hpl.hp.com/ARQ/function#> .
|
||||
@prefix afn: <http://jena.apache.org/ARQ/function#> .
|
||||
@prefix : <http://vivoweb.org/ontology/activity-insight#> .
|
||||
@prefix scires: <http://vivoweb.org/ontology/scientific-research#> .
|
||||
@prefix aka: <http://vivoweb.org/ontology/aka#> .
|
||||
|
|
|
@ -71,7 +71,7 @@
|
|||
<geopolitical:sourceIdentifier rdf:datatype="http://www.w3.org/2001/XMLSchema#string">http://data.worldbank.org/indicator/NY.GDP.MKTP.CD</geopolitical:sourceIdentifier>
|
||||
<geopolitical:sourceIdentifier xml:lang="ar">http://data.albankaldawli.org/indicator/NY.GDP.MKTP.CD</geopolitical:sourceIdentifier>
|
||||
<geopolitical:sourceIdentifier xml:lang="en">http://data.worldbank.org/indicator/NY.GDP.MKTP.CD</geopolitical:sourceIdentifier>
|
||||
<geopolitical:sourceIdentifier xml:lang="es">ttp://datos.bancomundial.org/indicador/NY.GDP.MKTP.CD</geopolitical:sourceIdentifier>
|
||||
<geopolitical:sourceIdentifier xml:lang="es">http://datos.bancomundial.org/indicador/NY.GDP.MKTP.CD</geopolitical:sourceIdentifier>
|
||||
<geopolitical:sourceIdentifier xml:lang="fr">http://donnees.banquemondiale.org/indicateur/NY.GDP.MKTP.CD</geopolitical:sourceIdentifier>
|
||||
</owl:DatatypeProperty>
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
xmlns:swrlb="http://www.w3.org/2003/11/swrlb#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:bibo="http://purl.org/ontology/bibo/"
|
||||
xmlns:afn="http://jena.hpl.hp.com/ARQ/function#"
|
||||
xmlns:afn="http://jena.apache.org/ARQ/function#"
|
||||
xmlns:foaf="http://xmlns.com/foaf/0.1/"
|
||||
xmlns:dcterms="http://purl.org/dc/terms/"
|
||||
xmlns:scires="http://vivoweb.org/ontology/scientific-research#"
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
xmlns:swrlb="http://www.w3.org/2003/11/swrlb#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:bibo="http://purl.org/ontology/bibo/"
|
||||
xmlns:afn="http://jena.hpl.hp.com/ARQ/function#"
|
||||
xmlns:afn="http://jena.apache.org/ARQ/function#"
|
||||
xmlns:foaf="http://xmlns.com/foaf/0.1/"
|
||||
xmlns:dcterms="http://purl.org/dc/terms/"
|
||||
xmlns:scires="http://vivoweb.org/ontology/scientific-research#"
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
xmlns:swrlb="http://www.w3.org/2003/11/swrlb#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:bibo="http://purl.org/ontology/bibo/"
|
||||
xmlns:afn="http://jena.hpl.hp.com/ARQ/function#"
|
||||
xmlns:afn="http://jena.apache.org/ARQ/function#"
|
||||
xmlns:foaf="http://xmlns.com/foaf/0.1/"
|
||||
xmlns:dcterms="http://purl.org/dc/terms/"
|
||||
xmlns:scires="http://vivoweb.org/ontology/scientific-research#"
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
@prefix afn: <http://jena.hpl.hp.com/ARQ/function#> .
|
||||
@prefix afn: <http://jena.apache.org/ARQ/function#> .
|
||||
@prefix : <http://purl.obolibrary.org/obo/arg/app-views/vivo/vivo-app.owl#> .
|
||||
@prefix hr: <http://vivo.cornell.edu/ns/hr/0.9/hr.owl#> .
|
||||
@prefix ns: <http://www.w3.org/2003/06/sw-vocab-status/ns#> .
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
@prefix hr: <http://vivo.cornell.edu/ns/hr/0.9/hr.owl#> .
|
||||
@prefix afn: <http://jena.hpl.hp.com/ARQ/function#> .
|
||||
@prefix afn: <http://jena.apache.org/ARQ/function#> .
|
||||
@prefix : <http://vivoweb.org/ontology/activity-insight#> .
|
||||
@prefix scires: <http://vivoweb.org/ontology/scientific-research#> .
|
||||
@prefix aka: <http://vivoweb.org/ontology/aka#> .
|
||||
|
|
|
@ -7,13 +7,13 @@
|
|||
|
||||
<groupId>org.vivoweb</groupId>
|
||||
<artifactId>vivo-installer-home</artifactId>
|
||||
<version>1.9.0-SNAPSHOT</version>
|
||||
<version>1.10.0-SNAPSHOT</version>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<parent>
|
||||
<groupId>org.vivoweb</groupId>
|
||||
<artifactId>vivo-installer</artifactId>
|
||||
<version>1.9.0-SNAPSHOT</version>
|
||||
<version>1.10.0-SNAPSHOT</version>
|
||||
<relativePath>..</relativePath>
|
||||
</parent>
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
<groupId>org.vivoweb</groupId>
|
||||
<artifactId>vivo-installer</artifactId>
|
||||
<version>1.9.0-SNAPSHOT</version>
|
||||
<version>1.10.0-SNAPSHOT</version>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<name>VIVO Installer</name>
|
||||
|
@ -21,8 +21,8 @@
|
|||
<plugin>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<configuration>
|
||||
<source>1.7</source>
|
||||
<target>1.7</target>
|
||||
<source>1.8</source>
|
||||
<target>1.8</target>
|
||||
<encoding>UTF-8</encoding>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
|
|
@ -7,13 +7,13 @@
|
|||
|
||||
<groupId>org.vivoweb</groupId>
|
||||
<artifactId>vivo-installer-solr</artifactId>
|
||||
<version>1.9.0-SNAPSHOT</version>
|
||||
<version>1.10.0-SNAPSHOT</version>
|
||||
<packaging>war</packaging>
|
||||
|
||||
<parent>
|
||||
<groupId>org.vivoweb</groupId>
|
||||
<artifactId>vivo-installer</artifactId>
|
||||
<version>1.9.0-SNAPSHOT</version>
|
||||
<version>1.10.0-SNAPSHOT</version>
|
||||
<relativePath>..</relativePath>
|
||||
</parent>
|
||||
|
||||
|
|
|
@ -7,13 +7,13 @@
|
|||
|
||||
<groupId>org.vivoweb</groupId>
|
||||
<artifactId>vivo-installer-vivo</artifactId>
|
||||
<version>1.9.0-SNAPSHOT</version>
|
||||
<version>1.10.0-SNAPSHOT</version>
|
||||
<packaging>war</packaging>
|
||||
|
||||
<parent>
|
||||
<groupId>org.vivoweb</groupId>
|
||||
<artifactId>vivo-installer</artifactId>
|
||||
<version>1.9.0-SNAPSHOT</version>
|
||||
<version>1.10.0-SNAPSHOT</version>
|
||||
<relativePath>..</relativePath>
|
||||
</parent>
|
||||
|
||||
|
|
|
@ -46,4 +46,4 @@ log4j.logger.org.apache.jena.sdb.layout2.LoaderTuplesNodes=FATAL
|
|||
log4j.logger.org.apache.jena.sdb.sql.SDBConnection=ERROR
|
||||
log4j.logger.org.openjena.riot=FATAL
|
||||
log4j.logger.org.apache.jena.riot=FATAL
|
||||
log4j.logger.org.directwebremoting=FATAL
|
||||
log4j.logger.org.directwebremoting=WARN
|
||||
|
|
6
pom.xml
6
pom.xml
|
@ -7,7 +7,7 @@
|
|||
|
||||
<groupId>org.vivoweb</groupId>
|
||||
<artifactId>vivo-project</artifactId>
|
||||
<version>1.9.0-SNAPSHOT</version>
|
||||
<version>1.10.0-SNAPSHOT</version>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<name>VIVO</name>
|
||||
|
@ -230,8 +230,8 @@
|
|||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<configuration>
|
||||
<source>1.7</source>
|
||||
<target>1.7</target>
|
||||
<source>1.8</source>
|
||||
<target>1.8</target>
|
||||
<encoding>UTF-8</encoding>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package org.vivoweb.vivo.selenium;
|
||||
|
||||
import com.sun.tools.internal.xjc.Driver;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.commons.lang33.StringUtils;
|
||||
import org.junit.Assert;
|
||||
import org.openqa.selenium.Alert;
|
||||
import org.openqa.selenium.By;
|
||||
|
|
|
@ -7,13 +7,13 @@
|
|||
|
||||
<groupId>org.vivoweb</groupId>
|
||||
<artifactId>vivo-webapp</artifactId>
|
||||
<version>1.9.0-SNAPSHOT</version>
|
||||
<version>1.10.0-SNAPSHOT</version>
|
||||
<packaging>war</packaging>
|
||||
|
||||
<parent>
|
||||
<groupId>org.vivoweb</groupId>
|
||||
<artifactId>vivo-project</artifactId>
|
||||
<version>1.9.0-SNAPSHOT</version>
|
||||
<version>1.10.0-SNAPSHOT</version>
|
||||
<relativePath>..</relativePath>
|
||||
</parent>
|
||||
|
||||
|
@ -69,7 +69,7 @@
|
|||
<dependency>
|
||||
<groupId>org.vivoweb</groupId>
|
||||
<artifactId>vivo-api</artifactId>
|
||||
<version>1.9.0-SNAPSHOT</version>
|
||||
<version>1.10.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
xmlns:vitro="http://vitro.mannlib.cornell.edu/ns/vitro/0.7#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:j.2="http://www.w3.org/2008/05/skos#"
|
||||
xmlns:afn="http://jena.hpl.hp.com/ARQ/function#"
|
||||
xmlns:afn="http://jena.apache.org/ARQ/function#"
|
||||
xmlns:bibo="http://purl.org/ontology/bibo/"
|
||||
xmlns:foaf="http://xmlns.com/foaf/0.1/"
|
||||
xmlns:j.3="http://www.w3.org/2003/06/sw-vocab-status/ns#"
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
xmlns:vitro="http://vitro.mannlib.cornell.edu/ns/vitro/0.7#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:j.2="http://www.w3.org/2008/05/skos#"
|
||||
xmlns:afn="http://jena.hpl.hp.com/ARQ/function#"
|
||||
xmlns:afn="http://jena.apache.org/ARQ/function#"
|
||||
xmlns:bibo="http://purl.org/ontology/bibo/"
|
||||
xmlns:foaf="http://xmlns.com/foaf/0.1/"
|
||||
xmlns:j.3="http://www.w3.org/2003/06/sw-vocab-status/ns#"
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
xmlns:vitro="http://vitro.mannlib.cornell.edu/ns/vitro/0.7#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:skos="http://www.w3.org/2008/05/skos#"
|
||||
xmlns:afn="http://jena.hpl.hp.com/ARQ/function#"
|
||||
xmlns:afn="http://jena.apache.org/ARQ/function#"
|
||||
xmlns:bibo="http://purl.org/ontology/bibo/"
|
||||
xmlns:foaf="http://xmlns.com/foaf/0.1/"
|
||||
xmlns:swvs="http://www.w3.org/2003/06/sw-vocab-status/ns#"
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
xmlns:vitro="http://vitro.mannlib.cornell.edu/ns/vitro/0.7#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:skos="http://www.w3.org/2008/05/skos#"
|
||||
xmlns:afn="http://jena.hpl.hp.com/ARQ/function#"
|
||||
xmlns:afn="http://jena.apache.org/ARQ/function#"
|
||||
xmlns:bibo="http://purl.org/ontology/bibo/"
|
||||
xmlns:foaf="http://xmlns.com/foaf/0.1/"
|
||||
xmlns:swvs="http://www.w3.org/2003/06/sw-vocab-status/ns#"
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
xmlns:vitro="http://vitro.mannlib.cornell.edu/ns/vitro/0.7#"
|
||||
xmlns:skos="http://www.w3.org/2008/05/skos#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:afn="http://jena.hpl.hp.com/ARQ/function#"
|
||||
xmlns:afn="http://jena.apache.org/ARQ/function#"
|
||||
xmlns:bibo="http://purl.org/ontology/bibo/"
|
||||
xmlns:foaf="http://xmlns.com/foaf/0.1/"
|
||||
xmlns:swvs="http://www.w3.org/2003/06/sw-vocab-status/ns#"
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
xmlns:vivo="http://vivoweb.org/ontology/core#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:bibo="http://purl.org/ontology/bibo/"
|
||||
xmlns:afn="http://jena.hpl.hp.com/ARQ/function#"
|
||||
xmlns:afn="http://jena.apache.org/ARQ/function#"
|
||||
xmlns:foaf="http://xmlns.com/foaf/0.1/"
|
||||
xmlns:scires="http://vivoweb.org/ontology/scientific-research#"
|
||||
xmlns:dcterms="http://purl.org/dc/terms/"
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
xmlns:vivo="http://vivoweb.org/ontology/core#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:bibo="http://purl.org/ontology/bibo/"
|
||||
xmlns:afn="http://jena.hpl.hp.com/ARQ/function#"
|
||||
xmlns:afn="http://jena.apache.org/ARQ/function#"
|
||||
xmlns:foaf="http://xmlns.com/foaf/0.1/"
|
||||
xmlns:scires="http://vivoweb.org/ontology/scientific-research#"
|
||||
xmlns:dcterms="http://purl.org/dc/terms/"
|
||||
|
|
|
@ -1060,7 +1060,7 @@
|
|||
|
||||
<servlet>
|
||||
<servlet-name>dwr-invoker</servlet-name>
|
||||
<servlet-class>uk.ltd.getahead.dwr.DWRServlet</servlet-class>
|
||||
<servlet-class>org.directwebremoting.servlet.DwrServlet</servlet-class>
|
||||
<init-param>
|
||||
<param-name>debug</param-name>
|
||||
<param-value>true</param-value>
|
||||
|
@ -1475,6 +1475,17 @@
|
|||
<url-pattern>/orcid/*</url-pattern>
|
||||
</servlet-mapping>
|
||||
|
||||
|
||||
<servlet>
|
||||
<display-name>TpfServlet</display-name>
|
||||
<servlet-name>TpfServlet</servlet-name>
|
||||
<servlet-class>org.vivoweb.linkeddatafragments.servlet.VitroLinkedDataFragmentServlet</servlet-class>
|
||||
</servlet>
|
||||
<servlet-mapping>
|
||||
<servlet-name>TpfServlet</servlet-name>
|
||||
<url-pattern>/tpf/*</url-pattern>
|
||||
</servlet-mapping>
|
||||
|
||||
<!-- ==================== mime types ============================== -->
|
||||
|
||||
<mime-mapping>
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
<list-view-config>
|
||||
<query-select>
|
||||
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
|
||||
PREFIX afn: <http://jena.hpl.hp.com/ARQ/function#>
|
||||
PREFIX afn: <http://jena.apache.org/ARQ/function#>
|
||||
PREFIX bibo: <http://purl.org/ontology/bibo/>
|
||||
PREFIX core: <http://vivoweb.org/ontology/core#>
|
||||
PREFIX owl: <http://www.w3.org/2002/07/owl#>
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
<list-view-config>
|
||||
<query-select>
|
||||
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
|
||||
PREFIX afn: <http://jena.hpl.hp.com/ARQ/function#>
|
||||
PREFIX afn: <http://jena.apache.org/ARQ/function#>
|
||||
PREFIX bibo: <http://purl.org/ontology/bibo/>
|
||||
PREFIX core: <http://vivoweb.org/ontology/core#>
|
||||
PREFIX owl: <http://www.w3.org/2002/07/owl#>
|
||||
|
|
|
@ -41,7 +41,7 @@
|
|||
OPTIONAL { ?infoResource bibo:pageStart ?startPage }
|
||||
OPTIONAL { ?infoResource bibo:pageEnd ?endPage }
|
||||
OPTIONAL { ?infoResource bibo:doi ?doi }
|
||||
OPTIONAL { ?infoResource bibo:pmid ?doi }
|
||||
OPTIONAL { ?infoResource bibo:pmid ?pmid }
|
||||
OPTIONAL { ?infoResource bibo:isbn10 ?isbn10 }
|
||||
OPTIONAL { ?infoResource bibo:isbn13 ?isbn13 }
|
||||
OPTIONAL { ?infoResource core:placeOfPublication ?locale }
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<query-select>
|
||||
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
|
||||
PREFIX core: <http://vivoweb.org/ontology/core#>
|
||||
PREFIX afn: <http://jena.hpl.hp.com/ARQ/function#>
|
||||
PREFIX afn: <http://jena.apache.org/ARQ/function#>
|
||||
|
||||
SELECT DISTINCT ?dateTimeInterval ?label
|
||||
?valueStart ?valueStartName
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<query-select>
|
||||
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
|
||||
PREFIX core: <http://vivoweb.org/ontology/core#>
|
||||
PREFIX afn: <http://jena.hpl.hp.com/ARQ/function#>
|
||||
PREFIX afn: <http://jena.apache.org/ARQ/function#>
|
||||
|
||||
SELECT DISTINCT ?dateTimeValue
|
||||
(afn:localname(?dateTimePrecision) AS ?precision)
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
<list-view-config>
|
||||
<query-select>
|
||||
PREFIX afn: <http://jena.hpl.hp.com/ARQ/function#>
|
||||
PREFIX afn: <http://jena.apache.org/ARQ/function#>
|
||||
PREFIX core: <http://vivoweb.org/ontology/core#>
|
||||
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
|
||||
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
<list-view-config>
|
||||
<query-select>
|
||||
PREFIX afn: <http://jena.hpl.hp.com/ARQ/function#>
|
||||
PREFIX afn: <http://jena.apache.org/ARQ/function#>
|
||||
PREFIX core: <http://vivoweb.org/ontology/core#>
|
||||
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
|
||||
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
|
||||
PREFIX vivo: <http://vivoweb.org/ontology/core#>
|
||||
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
|
||||
PREFIX afn: <http://jena.hpl.hp.com/ARQ/function#>
|
||||
PREFIX afn: <http://jena.apache.org/ARQ/function#>
|
||||
|
||||
SELECT ?concept ?conceptLabel ?conceptName ?vocabularySource ?vocabularySourceName
|
||||
WHERE {
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
<list-view-config>
|
||||
<query-select>
|
||||
PREFIX afn: <http://jena.hpl.hp.com/ARQ/function#>
|
||||
PREFIX afn: <http://jena.apache.org/ARQ/function#>
|
||||
PREFIX bibo: <http://purl.org/ontology/bibo/>
|
||||
PREFIX vivo: <http://vivoweb.org/ontology/core#>
|
||||
PREFIX owl: <http://www.w3.org/2002/07/owl#>
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
<list-view-config>
|
||||
<query-select>
|
||||
PREFIX afn: <http://jena.hpl.hp.com/ARQ/function#>
|
||||
PREFIX afn: <http://jena.apache.org/ARQ/function#>
|
||||
PREFIX core: <http://vivoweb.org/ontology/core#>
|
||||
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
|
||||
PREFIX vitro: <http://vitro.mannlib.cornell.edu/ns/vitro/0.7#>
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
<list-view-config>
|
||||
<query-select>
|
||||
PREFIX afn: <http://jena.hpl.hp.com/ARQ/function#>
|
||||
PREFIX afn: <http://jena.apache.org/ARQ/function#>
|
||||
PREFIX core: <http://vivoweb.org/ontology/core#>
|
||||
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
|
||||
PREFIX vitro: <http://vitro.mannlib.cornell.edu/ns/vitro/0.7#>
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
<list-view-config>
|
||||
<query-select>
|
||||
PREFIX afn: <http://jena.hpl.hp.com/ARQ/function#>
|
||||
PREFIX afn: <http://jena.apache.org/ARQ/function#>
|
||||
PREFIX core: <http://vivoweb.org/ontology/core#>
|
||||
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
|
||||
PREFIX vitro: <http://vitro.mannlib.cornell.edu/ns/vitro/0.7#>
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
<list-view-config>
|
||||
<query-select>
|
||||
PREFIX afn: <http://jena.hpl.hp.com/ARQ/function#>
|
||||
PREFIX afn: <http://jena.apache.org/ARQ/function#>
|
||||
PREFIX bibo: <http://purl.org/ontology/bibo/>
|
||||
PREFIX vivo: <http://vivoweb.org/ontology/core#>
|
||||
PREFIX owl: <http://www.w3.org/2002/07/owl#>
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue