Merge branch 'develop' of https://github.com/vivo-project/VIVO into develop
This commit is contained in:
commit
328d023b43
9 changed files with 14449 additions and 14498 deletions
|
@ -42,3 +42,5 @@
|
||||||
<http://vitro.mannlib.cornell.edu/ns/vitro/siteConfig/hasLeaderRoleConfig> <http://vitro.mannlib.cornell.edu/ns/vitro/ApplicationConfiguration#displayName> "jefe de"@es .
|
<http://vitro.mannlib.cornell.edu/ns/vitro/siteConfig/hasLeaderRoleConfig> <http://vitro.mannlib.cornell.edu/ns/vitro/ApplicationConfiguration#displayName> "jefe de"@es .
|
||||||
<http://vitro.mannlib.cornell.edu/ns/vitro/siteConfig/hasMemberRoleConfig> <http://vitro.mannlib.cornell.edu/ns/vitro/ApplicationConfiguration#displayName> "miembro de"@es .
|
<http://vitro.mannlib.cornell.edu/ns/vitro/siteConfig/hasMemberRoleConfig> <http://vitro.mannlib.cornell.edu/ns/vitro/ApplicationConfiguration#displayName> "miembro de"@es .
|
||||||
<http://vitro.mannlib.cornell.edu/ns/vitro/siteConfig/personTelephoneConfig> <http://vitro.mannlib.cornell.edu/ns/vitro/ApplicationConfiguration#displayName> "tel\u00E9fono"@es .
|
<http://vitro.mannlib.cornell.edu/ns/vitro/siteConfig/personTelephoneConfig> <http://vitro.mannlib.cornell.edu/ns/vitro/ApplicationConfiguration#displayName> "tel\u00E9fono"@es .
|
||||||
|
<http://vitro.mannlib.cornell.edu/ns/vitro/siteConfig/hasSubOrganizationConfig> <http://vitro.mannlib.cornell.edu/ns/vitro/ApplicationConfiguration#displayName> "tiene sub-organización"@es .
|
||||||
|
<http://vitro.mannlib.cornell.edu/ns/vitro/siteConfig/subOrganizationWithinConfig> <http://vitro.mannlib.cornell.edu/ns/vitro/ApplicationConfiguration#displayName> "organización dentro de"@es .
|
|
@ -25,7 +25,7 @@
|
||||||
|
|
||||||
<#if webpage?has_content> <#-- true when the property is in the list, even if not populated (when editing) -->
|
<#if webpage?has_content> <#-- true when the property is in the list, even if not populated (when editing) -->
|
||||||
<nav role="navigation">
|
<nav role="navigation">
|
||||||
<#local label = "Websites">
|
<#local label = "${i18n().websites}">
|
||||||
<@p.addLinkWithLabel webpage editable label />
|
<@p.addLinkWithLabel webpage editable label />
|
||||||
<#if webpage.statements?has_content> <#-- if there are any statements -->
|
<#if webpage.statements?has_content> <#-- if there are any statements -->
|
||||||
<#include "individual-webpage.ftl" >
|
<#include "individual-webpage.ftl" >
|
||||||
|
|
|
@ -3684,6 +3684,8 @@ vivo:hasPredecessorOrganization
|
||||||
<http://vivoweb.org/ontology#vitroPropertyGroupoverview> ;
|
<http://vivoweb.org/ontology#vitroPropertyGroupoverview> ;
|
||||||
vitro:prohibitedFromUpdateBelowRoleLevelAnnot
|
vitro:prohibitedFromUpdateBelowRoleLevelAnnot
|
||||||
<http://vitro.mannlib.cornell.edu/ns/vitro/role#public> ;
|
<http://vitro.mannlib.cornell.edu/ns/vitro/role#public> ;
|
||||||
|
vitro:offerCreateNewOptionAnnot
|
||||||
|
"true"^^xsd:boolean ;
|
||||||
vitro:selectFromExistingAnnot
|
vitro:selectFromExistingAnnot
|
||||||
"true"^^xsd:boolean .
|
"true"^^xsd:boolean .
|
||||||
|
|
||||||
|
@ -5088,6 +5090,8 @@ vivo:termLabel
|
||||||
|
|
||||||
skos:related
|
skos:related
|
||||||
rdfs:label "related"@en-US ;
|
rdfs:label "related"@en-US ;
|
||||||
|
vitro:customEntryFormAnnot
|
||||||
|
"edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.generators.AddConceptThroughObjectPropertyGenerator"^^xsd:string ;
|
||||||
vitro:displayLimitAnnot
|
vitro:displayLimitAnnot
|
||||||
"5"^^xsd:int ;
|
"5"^^xsd:int ;
|
||||||
vitro:displayRankAnnot
|
vitro:displayRankAnnot
|
||||||
|
|
|
@ -240,11 +240,22 @@ public class AddEditWebpageFormGenerator extends BaseEditConfigurationGenerator
|
||||||
private String getUrlPatternToReturnTo(VitroRequest vreq) {
|
private String getUrlPatternToReturnTo(VitroRequest vreq) {
|
||||||
String subjectUri = EditConfigurationUtils.getSubjectUri(vreq);
|
String subjectUri = EditConfigurationUtils.getSubjectUri(vreq);
|
||||||
String predicateUri = EditConfigurationUtils.getPredicateUri(vreq);
|
String predicateUri = EditConfigurationUtils.getPredicateUri(vreq);
|
||||||
|
//Also add domain and range uris if they exist to enable cancel to work properly
|
||||||
|
String domainUri = (String) vreq.getParameter("domainUri");
|
||||||
|
String rangeUri = (String) vreq.getParameter("rangeUri");
|
||||||
String generatorName = "edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.generators.ManageWebpagesForIndividualGenerator";
|
String generatorName = "edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.generators.ManageWebpagesForIndividualGenerator";
|
||||||
String editUrl = EditConfigurationUtils.getEditUrlWithoutContext(vreq);
|
String editUrl = EditConfigurationUtils.getEditUrlWithoutContext(vreq);
|
||||||
return editUrl + "?subjectUri=" + UrlBuilder.urlEncode(subjectUri) +
|
String returnPath = editUrl + "?subjectUri=" + UrlBuilder.urlEncode(subjectUri) +
|
||||||
"&predicateUri=" + UrlBuilder.urlEncode(predicateUri) +
|
"&predicateUri=" + UrlBuilder.urlEncode(predicateUri) +
|
||||||
"&editForm=" + UrlBuilder.urlEncode(generatorName);
|
"&editForm=" + UrlBuilder.urlEncode(generatorName);
|
||||||
|
if(domainUri != null && !domainUri.isEmpty()) {
|
||||||
|
returnPath += "&domainUri=" + UrlBuilder.urlEncode(domainUri);
|
||||||
|
}
|
||||||
|
if(rangeUri != null && !rangeUri.isEmpty()) {
|
||||||
|
returnPath += "&rangeUri=" + UrlBuilder.urlEncode(rangeUri);
|
||||||
|
}
|
||||||
|
return returnPath;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private String getLinkUri(VitroRequest vreq) {
|
private String getLinkUri(VitroRequest vreq) {
|
||||||
|
|
|
@ -12,26 +12,21 @@ import java.util.Set;
|
||||||
import org.apache.commons.logging.Log;
|
import org.apache.commons.logging.Log;
|
||||||
import org.apache.commons.logging.LogFactory;
|
import org.apache.commons.logging.LogFactory;
|
||||||
|
|
||||||
import com.hp.hpl.jena.ontology.OntModel;
|
|
||||||
import com.hp.hpl.jena.query.Query;
|
|
||||||
import com.hp.hpl.jena.query.QueryExecution;
|
|
||||||
import com.hp.hpl.jena.query.QueryExecutionFactory;
|
|
||||||
import com.hp.hpl.jena.query.QueryFactory;
|
|
||||||
import com.hp.hpl.jena.query.QuerySolution;
|
import com.hp.hpl.jena.query.QuerySolution;
|
||||||
import com.hp.hpl.jena.query.QuerySolutionMap;
|
import com.hp.hpl.jena.query.QuerySolutionMap;
|
||||||
import com.hp.hpl.jena.query.ResultSet;
|
import com.hp.hpl.jena.query.ResultSet;
|
||||||
import com.hp.hpl.jena.query.Syntax;
|
|
||||||
import com.hp.hpl.jena.rdf.model.RDFNode;
|
import com.hp.hpl.jena.rdf.model.RDFNode;
|
||||||
import com.hp.hpl.jena.rdf.model.Resource;
|
import com.hp.hpl.jena.rdf.model.Resource;
|
||||||
import com.hp.hpl.jena.rdf.model.ResourceFactory;
|
import com.hp.hpl.jena.rdf.model.ResourceFactory;
|
||||||
import com.hp.hpl.jena.rdf.model.Statement;
|
import com.hp.hpl.jena.rdf.model.Statement;
|
||||||
import com.hp.hpl.jena.shared.Lock;
|
|
||||||
|
|
||||||
|
import edu.cornell.mannlib.vitro.webapp.dao.jena.QueryUtils;
|
||||||
|
import edu.cornell.mannlib.vitro.webapp.rdfservice.RDFService;
|
||||||
import edu.cornell.mannlib.vitro.webapp.search.beans.StatementToURIsToUpdate;
|
import edu.cornell.mannlib.vitro.webapp.search.beans.StatementToURIsToUpdate;
|
||||||
|
|
||||||
public class AdditionalURIsForContextNodes implements StatementToURIsToUpdate {
|
public class AdditionalURIsForContextNodes implements StatementToURIsToUpdate {
|
||||||
|
|
||||||
private OntModel model;
|
private final RDFService rdfService;
|
||||||
private Set<String> alreadyChecked;
|
private Set<String> alreadyChecked;
|
||||||
private long accumulatedTime = 0;
|
private long accumulatedTime = 0;
|
||||||
|
|
||||||
|
@ -43,8 +38,8 @@ public class AdditionalURIsForContextNodes implements StatementToURIsToUpdate {
|
||||||
private Log log = LogFactory.getLog(AdditionalURIsForContextNodes.class);
|
private Log log = LogFactory.getLog(AdditionalURIsForContextNodes.class);
|
||||||
|
|
||||||
|
|
||||||
public AdditionalURIsForContextNodes( OntModel jenaOntModel){
|
public AdditionalURIsForContextNodes( RDFService rdfService){
|
||||||
this.model = jenaOntModel;
|
this.rdfService = rdfService;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -93,42 +88,27 @@ public class AdditionalURIsForContextNodes implements StatementToURIsToUpdate {
|
||||||
|
|
||||||
List<String> uriList = new ArrayList<String>();
|
List<String> uriList = new ArrayList<String>();
|
||||||
|
|
||||||
for(String query : queryList){
|
for (String query : queryList) {
|
||||||
|
QuerySolutionMap initialBinding = new QuerySolutionMap();
|
||||||
//log.info("Executing query: "+ query);
|
Resource uriResource = ResourceFactory.createResource(uri);
|
||||||
|
initialBinding.add("uri", uriResource);
|
||||||
QuerySolutionMap initialBinding = new QuerySolutionMap();
|
|
||||||
Resource uriResource = ResourceFactory.createResource(uri);
|
ResultSet results = QueryUtils.getQueryResults(query,
|
||||||
initialBinding.add("uri", uriResource);
|
initialBinding, rdfService);
|
||||||
|
while (results.hasNext()) {
|
||||||
Query sparqlQuery = QueryFactory.create( query, Syntax.syntaxARQ);
|
QuerySolution soln = results.nextSolution();
|
||||||
model.getLock().enterCriticalSection(Lock.READ);
|
Iterator<String> iter = soln.varNames();
|
||||||
try{
|
while (iter.hasNext()) {
|
||||||
QueryExecution qExec = QueryExecutionFactory.create(sparqlQuery, model, initialBinding);
|
String name = iter.next();
|
||||||
try{
|
RDFNode node = soln.get(name);
|
||||||
ResultSet results = qExec.execSelect();
|
if (node != null) {
|
||||||
while(results.hasNext()){
|
uriList.add("" + node.toString());
|
||||||
QuerySolution soln = results.nextSolution();
|
} else {
|
||||||
Iterator<String> iter = soln.varNames() ;
|
log.debug(name + " is null");
|
||||||
while( iter.hasNext()){
|
}
|
||||||
String name = iter.next();
|
}
|
||||||
RDFNode node = soln.get( name );
|
}
|
||||||
if( node != null ){
|
}
|
||||||
uriList.add("" + node.toString());
|
|
||||||
}else{
|
|
||||||
log.debug(name + " is null");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}catch(Throwable t){
|
|
||||||
log.error(t,t);
|
|
||||||
} finally{
|
|
||||||
qExec.close();
|
|
||||||
}
|
|
||||||
}finally{
|
|
||||||
model.getLock().leaveCriticalSection();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if( log.isDebugEnabled() )
|
if( log.isDebugEnabled() )
|
||||||
log.debug( "additional uris for " + uri + " are " + uriList);
|
log.debug( "additional uris for " + uri + " are " + uriList);
|
||||||
|
|
|
@ -5,9 +5,8 @@ package edu.cornell.mannlib.vitro.webapp.search.indexing;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import com.hp.hpl.jena.ontology.OntModel;
|
|
||||||
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.dao.IndividualDao;
|
import edu.cornell.mannlib.vitro.webapp.dao.IndividualDao;
|
||||||
|
import edu.cornell.mannlib.vitro.webapp.rdfservice.RDFService;
|
||||||
import edu.cornell.mannlib.vitro.webapp.search.beans.StatementToURIsToUpdate;
|
import edu.cornell.mannlib.vitro.webapp.search.beans.StatementToURIsToUpdate;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -16,12 +15,12 @@ import edu.cornell.mannlib.vitro.webapp.search.beans.StatementToURIsToUpdate;
|
||||||
*/
|
*/
|
||||||
public class AdditionalUriFinders {
|
public class AdditionalUriFinders {
|
||||||
|
|
||||||
public static List<StatementToURIsToUpdate> getList(OntModel jenaOntModel,
|
public static List<StatementToURIsToUpdate> getList(RDFService rdfService,
|
||||||
IndividualDao indDao) {
|
IndividualDao indDao) {
|
||||||
List<StatementToURIsToUpdate> uriFinders = new ArrayList<>();
|
List<StatementToURIsToUpdate> uriFinders = new ArrayList<>();
|
||||||
uriFinders.add(new AdditionalURIsForDataProperties());
|
uriFinders.add(new AdditionalURIsForDataProperties());
|
||||||
uriFinders.add(new AdditionalURIsForObjectProperties(jenaOntModel));
|
uriFinders.add(new AdditionalURIsForObjectProperties(rdfService));
|
||||||
uriFinders.add(new AdditionalURIsForContextNodes(jenaOntModel));
|
uriFinders.add(new AdditionalURIsForContextNodes(rdfService));
|
||||||
uriFinders.add(new AdditionalURIsForTypeStatements());
|
uriFinders.add(new AdditionalURIsForTypeStatements());
|
||||||
uriFinders.add(new URIsForClassGroupChange(indDao));
|
uriFinders.add(new URIsForClassGroupChange(indDao));
|
||||||
return uriFinders;
|
return uriFinders;
|
||||||
|
|
|
@ -12,11 +12,13 @@ import org.junit.Test;
|
||||||
import com.hp.hpl.jena.ontology.OntModel;
|
import com.hp.hpl.jena.ontology.OntModel;
|
||||||
import com.hp.hpl.jena.rdf.model.ModelFactory;
|
import com.hp.hpl.jena.rdf.model.ModelFactory;
|
||||||
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.search.indexing.AdditionalURIsForContextNodes;
|
import edu.cornell.mannlib.vitro.webapp.rdfservice.impl.jena.model.RDFServiceModel;
|
||||||
|
|
||||||
|
|
||||||
public class AdditionalURIsForContextNodesTest {
|
public class AdditionalURIsForContextNodesTest {
|
||||||
|
|
||||||
|
private AdditionalURIsForContextNodes uriFinder;
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testPositionChanges(){
|
public void testPositionChanges(){
|
||||||
String n3 =
|
String n3 =
|
||||||
|
@ -59,12 +61,7 @@ public class AdditionalURIsForContextNodesTest {
|
||||||
"<http://vivoweb.org/ontology/core#DateTimeInterval> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#Class> . \n" +
|
"<http://vivoweb.org/ontology/core#DateTimeInterval> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#Class> . \n" +
|
||||||
"<http://vivoweb.org/ontology/core#Department> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#Class> . \n" ;
|
"<http://vivoweb.org/ontology/core#Department> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#Class> . \n" ;
|
||||||
|
|
||||||
//make a test model with an person, an authorship context node and a book
|
populateModelAndCreateUriFinder(n3);
|
||||||
OntModel model = ModelFactory.createOntologyModel();
|
|
||||||
model.read( new StringReader(n3), null, "N3");
|
|
||||||
|
|
||||||
//make an AdditionalURIsForContextNodesTest object with that model
|
|
||||||
AdditionalURIsForContextNodes uriFinder = new AdditionalURIsForContextNodes( model );
|
|
||||||
|
|
||||||
//if the person changes then the org needs to be updated
|
//if the person changes then the org needs to be updated
|
||||||
List<String> uris = uriFinder.findAdditionalURIsToIndex( "http://caruso-laptop.mannlib.cornell.edu:8090/vivo/individual/n932");
|
List<String> uris = uriFinder.findAdditionalURIsToIndex( "http://caruso-laptop.mannlib.cornell.edu:8090/vivo/individual/n932");
|
||||||
|
@ -107,21 +104,15 @@ public class AdditionalURIsForContextNodesTest {
|
||||||
" core:contributingRole <http://caruso-laptop.mannlib.cornell.edu:8090/vivo/individual/n2577> . \n" +
|
" core:contributingRole <http://caruso-laptop.mannlib.cornell.edu:8090/vivo/individual/n2577> . \n" +
|
||||||
" <http://vivo.scripps.edu/individual/n14979> a <http://xmlns.com/foaf/0.1/Person> , owl:Thing , <http://xmlns.com/foaf/0.1/Agent> . \n";
|
" <http://vivo.scripps.edu/individual/n14979> a <http://xmlns.com/foaf/0.1/Person> , owl:Thing , <http://xmlns.com/foaf/0.1/Agent> . \n";
|
||||||
|
|
||||||
|
|
||||||
//make a test model with an person, an authorship context node and a book
|
//make a test model with an person, an authorship context node and a book
|
||||||
OntModel model = ModelFactory.createOntologyModel();
|
populateModelAndCreateUriFinder(n3);
|
||||||
model.read( new StringReader(n3), null, "N3");
|
|
||||||
|
|
||||||
|
|
||||||
//make an AdditionalURIsForContextNodesTest object with that model
|
|
||||||
AdditionalURIsForContextNodes uriFinder = new AdditionalURIsForContextNodes( model );
|
|
||||||
|
|
||||||
//get additional uris for org
|
//get additional uris for org
|
||||||
List<String> uris = uriFinder.findAdditionalURIsToIndex( "http://caruso-laptop.mannlib.cornell.edu:8090/vivo/individual/n2592");
|
List<String> uris = uriFinder.findAdditionalURIsToIndex( "http://caruso-laptop.mannlib.cornell.edu:8090/vivo/individual/n2592");
|
||||||
|
|
||||||
assertTrue("did not find person for context node", uris.contains("http://vivo.scripps.edu/individual/n14979" ));
|
assertTrue("did not find person for context node", uris.contains("http://vivo.scripps.edu/individual/n14979" ));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testLeaderRoleChanges(){
|
public void testLeaderRoleChanges(){
|
||||||
|
@ -153,13 +144,7 @@ public class AdditionalURIsForContextNodesTest {
|
||||||
"<http://vivo.scripps.edu/individual/n7080> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#Thing> . \n " +
|
"<http://vivo.scripps.edu/individual/n7080> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#Thing> . \n " +
|
||||||
"<http://vivo.scripps.edu/individual/n7080> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Organization> . \n " ;
|
"<http://vivo.scripps.edu/individual/n7080> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Organization> . \n " ;
|
||||||
|
|
||||||
|
populateModelAndCreateUriFinder(n3);
|
||||||
//make a test model with an person, a leader role node and a university
|
|
||||||
OntModel model = ModelFactory.createOntologyModel();
|
|
||||||
model.read( new StringReader(n3), null, "N3");
|
|
||||||
|
|
||||||
//make an AdditionalURIsForContextNodesTest object with that model
|
|
||||||
AdditionalURIsForContextNodes uriFinder = new AdditionalURIsForContextNodes( model );
|
|
||||||
|
|
||||||
//if the person changes then the university needs to be updated
|
//if the person changes then the university needs to be updated
|
||||||
List<String> uris = uriFinder.findAdditionalURIsToIndex( "http://vivo.scripps.edu/individual/n2027");
|
List<String> uris = uriFinder.findAdditionalURIsToIndex( "http://vivo.scripps.edu/individual/n2027");
|
||||||
|
@ -168,8 +153,6 @@ public class AdditionalURIsForContextNodesTest {
|
||||||
//if the university changes then the person needs to be updated
|
//if the university changes then the person needs to be updated
|
||||||
uris = uriFinder.findAdditionalURIsToIndex( "http://vivo.scripps.edu/individual/n7080");
|
uris = uriFinder.findAdditionalURIsToIndex( "http://vivo.scripps.edu/individual/n7080");
|
||||||
assertTrue("did not find person for context node", uris.contains("http://vivo.scripps.edu/individual/n2027" ));
|
assertTrue("did not find person for context node", uris.contains("http://vivo.scripps.edu/individual/n2027" ));
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -204,14 +187,7 @@ public class AdditionalURIsForContextNodesTest {
|
||||||
"<http://vivo.scripps.edu/individual/n6004> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#Thing> . \n " +
|
"<http://vivo.scripps.edu/individual/n6004> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#Thing> . \n " +
|
||||||
"<http://vivo.scripps.edu/individual/n6004> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Organization> . \n " ;
|
"<http://vivo.scripps.edu/individual/n6004> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Organization> . \n " ;
|
||||||
|
|
||||||
|
populateModelAndCreateUriFinder(n3);
|
||||||
|
|
||||||
//make a test model with an person, a member role node and a university
|
|
||||||
OntModel model = ModelFactory.createOntologyModel();
|
|
||||||
model.read( new StringReader(n3), null, "N3");
|
|
||||||
|
|
||||||
//make an AdditionalURIsForContextNodesTest object with that model
|
|
||||||
AdditionalURIsForContextNodes uriFinder = new AdditionalURIsForContextNodes( model );
|
|
||||||
|
|
||||||
//if the person changes then the university needs to be updated
|
//if the person changes then the university needs to be updated
|
||||||
List<String> uris = uriFinder.findAdditionalURIsToIndex( "http://vivo.scripps.edu/individual/n4519");
|
List<String> uris = uriFinder.findAdditionalURIsToIndex( "http://vivo.scripps.edu/individual/n4519");
|
||||||
|
@ -254,15 +230,8 @@ public class AdditionalURIsForContextNodesTest {
|
||||||
"<http://vivo.scripps.edu/individual/n5177> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://vivoweb.org/ontology/core#Project> . \n" +
|
"<http://vivo.scripps.edu/individual/n5177> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://vivoweb.org/ontology/core#Project> . \n" +
|
||||||
"<http://vivo.scripps.edu/individual/n5177> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#Thing> . \n" +
|
"<http://vivo.scripps.edu/individual/n5177> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#Thing> . \n" +
|
||||||
"<http://vivo.scripps.edu/individual/n5177> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://vivoweb.org/ontology/core#Process> . \n" ;
|
"<http://vivo.scripps.edu/individual/n5177> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://vivoweb.org/ontology/core#Process> . \n" ;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//make a test model with an person, a clinical role node and a project
|
populateModelAndCreateUriFinder(n3);
|
||||||
OntModel model = ModelFactory.createOntologyModel();
|
|
||||||
model.read( new StringReader(n3), null, "N3");
|
|
||||||
|
|
||||||
//make an AdditionalURIsForContextNodesTest object with that model
|
|
||||||
AdditionalURIsForContextNodes uriFinder = new AdditionalURIsForContextNodes( model );
|
|
||||||
|
|
||||||
//if the person changes then the project needs to be updated
|
//if the person changes then the project needs to be updated
|
||||||
List<String> uris = uriFinder.findAdditionalURIsToIndex( "http://vivo.scripps.edu/individual/n4858");
|
List<String> uris = uriFinder.findAdditionalURIsToIndex( "http://vivo.scripps.edu/individual/n4858");
|
||||||
|
@ -303,12 +272,7 @@ public class AdditionalURIsForContextNodesTest {
|
||||||
"<http://vivo.scripps.edu/individual/n4442> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#Thing> . \n" +
|
"<http://vivo.scripps.edu/individual/n4442> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#Thing> . \n" +
|
||||||
"<http://vivo.scripps.edu/individual/n4442> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://purl.obolibrary.org/obo/ERO_0000005> . \n" ;
|
"<http://vivo.scripps.edu/individual/n4442> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://purl.obolibrary.org/obo/ERO_0000005> . \n" ;
|
||||||
|
|
||||||
//make a test model with an person, a clinical role node and a service
|
populateModelAndCreateUriFinder(n3);
|
||||||
OntModel model = ModelFactory.createOntologyModel();
|
|
||||||
model.read( new StringReader(n3), null, "N3");
|
|
||||||
|
|
||||||
//make an AdditionalURIsForContextNodesTest object with that model
|
|
||||||
AdditionalURIsForContextNodes uriFinder = new AdditionalURIsForContextNodes( model );
|
|
||||||
|
|
||||||
//if the person changes then the service needs to be updated
|
//if the person changes then the service needs to be updated
|
||||||
List<String> uris = uriFinder.findAdditionalURIsToIndex( "http://vivo.scripps.edu/individual/n5651");
|
List<String> uris = uriFinder.findAdditionalURIsToIndex( "http://vivo.scripps.edu/individual/n5651");
|
||||||
|
@ -350,13 +314,7 @@ public class AdditionalURIsForContextNodesTest {
|
||||||
"<http://vivo.scripps.edu/individual/n1305> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://purl.org/NET/c4dm/event.owl#Event> . \n" +
|
"<http://vivo.scripps.edu/individual/n1305> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://purl.org/NET/c4dm/event.owl#Event> . \n" +
|
||||||
"<http://vivo.scripps.edu/individual/n1305> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#Thing> . \n" ;
|
"<http://vivo.scripps.edu/individual/n1305> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#Thing> . \n" ;
|
||||||
|
|
||||||
|
populateModelAndCreateUriFinder(n3);
|
||||||
//make a test model with an person, a presenter role node and a presentation
|
|
||||||
OntModel model = ModelFactory.createOntologyModel();
|
|
||||||
model.read( new StringReader(n3), null, "N3");
|
|
||||||
|
|
||||||
//make an AdditionalURIsForContextNodesTest object with that model
|
|
||||||
AdditionalURIsForContextNodes uriFinder = new AdditionalURIsForContextNodes( model );
|
|
||||||
|
|
||||||
//if the person changes then the presentation needs to be updated
|
//if the person changes then the presentation needs to be updated
|
||||||
List<String> uris = uriFinder.findAdditionalURIsToIndex( "http://vivo.scripps.edu/individual/n5596");
|
List<String> uris = uriFinder.findAdditionalURIsToIndex( "http://vivo.scripps.edu/individual/n5596");
|
||||||
|
@ -398,13 +356,8 @@ public class AdditionalURIsForContextNodesTest {
|
||||||
"<http://vivo.scripps.edu/individual/n4107> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://purl.org/NET/c4dm/event.owl#Event> . \n " +
|
"<http://vivo.scripps.edu/individual/n4107> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://purl.org/NET/c4dm/event.owl#Event> . \n " +
|
||||||
"<http://vivo.scripps.edu/individual/n4107> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#Thing> . \n " +
|
"<http://vivo.scripps.edu/individual/n4107> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#Thing> . \n " +
|
||||||
"<http://vivo.scripps.edu/individual/n4107> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://vivoweb.org/ontology/core#InvitedTalk> . \n " ;
|
"<http://vivo.scripps.edu/individual/n4107> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://vivoweb.org/ontology/core#InvitedTalk> . \n " ;
|
||||||
|
|
||||||
//make a test model with an person, a presenter role node and an invited talk
|
populateModelAndCreateUriFinder(n3);
|
||||||
OntModel model = ModelFactory.createOntologyModel();
|
|
||||||
model.read( new StringReader(n3), null, "N3");
|
|
||||||
|
|
||||||
//make an AdditionalURIsForContextNodesTest object with that model
|
|
||||||
AdditionalURIsForContextNodes uriFinder = new AdditionalURIsForContextNodes( model );
|
|
||||||
|
|
||||||
//if the person changes then the invited talk needs to be updated
|
//if the person changes then the invited talk needs to be updated
|
||||||
List<String> uris = uriFinder.findAdditionalURIsToIndex( "http://vivo.scripps.edu/individual/n4112");
|
List<String> uris = uriFinder.findAdditionalURIsToIndex( "http://vivo.scripps.edu/individual/n4112");
|
||||||
|
@ -447,13 +400,7 @@ public class AdditionalURIsForContextNodesTest {
|
||||||
"<http://vivo.scripps.edu/individual/n4252> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#Thing> . \n" +
|
"<http://vivo.scripps.edu/individual/n4252> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#Thing> . \n" +
|
||||||
"<http://vivo.scripps.edu/individual/n4252> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://vivoweb.org/ontology/core#Grant> . \n" ;
|
"<http://vivo.scripps.edu/individual/n4252> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://vivoweb.org/ontology/core#Grant> . \n" ;
|
||||||
|
|
||||||
|
populateModelAndCreateUriFinder(n3);
|
||||||
//make a test model with an person, a researcher role node and a grant
|
|
||||||
OntModel model = ModelFactory.createOntologyModel();
|
|
||||||
model.read( new StringReader(n3), null, "N3");
|
|
||||||
|
|
||||||
//make an AdditionalURIsForContextNodesTest object with that model
|
|
||||||
AdditionalURIsForContextNodes uriFinder = new AdditionalURIsForContextNodes( model );
|
|
||||||
|
|
||||||
//if the person changes then the grant needs to be updated
|
//if the person changes then the grant needs to be updated
|
||||||
List<String> uris = uriFinder.findAdditionalURIsToIndex( "http://vivo.scripps.edu/individual/n4957");
|
List<String> uris = uriFinder.findAdditionalURIsToIndex( "http://vivo.scripps.edu/individual/n4957");
|
||||||
|
@ -497,14 +444,7 @@ public class AdditionalURIsForContextNodesTest {
|
||||||
"<http://vivo.scripps.edu/individual/n564> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#Thing> . \n " +
|
"<http://vivo.scripps.edu/individual/n564> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#Thing> . \n " +
|
||||||
"<http://vivo.scripps.edu/individual/n564> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://vivoweb.org/ontology/core#Process> . \n " ;
|
"<http://vivo.scripps.edu/individual/n564> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://vivoweb.org/ontology/core#Process> . \n " ;
|
||||||
|
|
||||||
|
populateModelAndCreateUriFinder(n3);
|
||||||
|
|
||||||
//make a test model with an person, a researcher role node and a project
|
|
||||||
OntModel model = ModelFactory.createOntologyModel();
|
|
||||||
model.read( new StringReader(n3), null, "N3");
|
|
||||||
|
|
||||||
//make an AdditionalURIsForContextNodesTest object with that model
|
|
||||||
AdditionalURIsForContextNodes uriFinder = new AdditionalURIsForContextNodes( model );
|
|
||||||
|
|
||||||
//if the person changes then the project needs to be updated
|
//if the person changes then the project needs to be updated
|
||||||
List<String> uris = uriFinder.findAdditionalURIsToIndex( "http://vivo.scripps.edu/individual/n2029");
|
List<String> uris = uriFinder.findAdditionalURIsToIndex( "http://vivo.scripps.edu/individual/n2029");
|
||||||
|
@ -548,13 +488,7 @@ public class AdditionalURIsForContextNodesTest {
|
||||||
"<http://vivo.scripps.edu/individual/n1742> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#Thing> . \n" +
|
"<http://vivo.scripps.edu/individual/n1742> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#Thing> . \n" +
|
||||||
"<http://vivo.scripps.edu/individual/n1742> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://vivoweb.org/ontology/core#Grant> . \n" ;
|
"<http://vivo.scripps.edu/individual/n1742> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://vivoweb.org/ontology/core#Grant> . \n" ;
|
||||||
|
|
||||||
|
populateModelAndCreateUriFinder(n3);
|
||||||
//make a test model with an person, a principal investigator role node and a grant
|
|
||||||
OntModel model = ModelFactory.createOntologyModel();
|
|
||||||
model.read( new StringReader(n3), null, "N3");
|
|
||||||
|
|
||||||
//make an AdditionalURIsForContextNodesTest object with that model
|
|
||||||
AdditionalURIsForContextNodes uriFinder = new AdditionalURIsForContextNodes( model );
|
|
||||||
|
|
||||||
//if the person changes then the grant needs to be updated
|
//if the person changes then the grant needs to be updated
|
||||||
List<String> uris = uriFinder.findAdditionalURIsToIndex( "http://vivo.scripps.edu/individual/n2368");
|
List<String> uris = uriFinder.findAdditionalURIsToIndex( "http://vivo.scripps.edu/individual/n2368");
|
||||||
|
@ -598,13 +532,8 @@ public class AdditionalURIsForContextNodesTest {
|
||||||
"<http://vivo.scripps.edu/individual/n4931> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#Thing> . \n" +
|
"<http://vivo.scripps.edu/individual/n4931> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#Thing> . \n" +
|
||||||
"<http://vivo.scripps.edu/individual/n4931> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://vivoweb.org/ontology/core#Grant> . \n" ;
|
"<http://vivo.scripps.edu/individual/n4931> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://vivoweb.org/ontology/core#Grant> . \n" ;
|
||||||
|
|
||||||
//make a test model with an person, a co-principal investigator role node and a grant
|
populateModelAndCreateUriFinder(n3);
|
||||||
OntModel model = ModelFactory.createOntologyModel();
|
|
||||||
model.read( new StringReader(n3), null, "N3");
|
|
||||||
|
|
||||||
//make an AdditionalURIsForContextNodesTest object with that model
|
|
||||||
AdditionalURIsForContextNodes uriFinder = new AdditionalURIsForContextNodes( model );
|
|
||||||
|
|
||||||
//if the copi changes then the grant needs to be updated
|
//if the copi changes then the grant needs to be updated
|
||||||
List<String> uris = uriFinder.findAdditionalURIsToIndex( "http://vivo.scripps.edu/individual/n1373");
|
List<String> uris = uriFinder.findAdditionalURIsToIndex( "http://vivo.scripps.edu/individual/n1373");
|
||||||
assertTrue("did not find grant for co-pi", uris.contains("http://vivo.scripps.edu/individual/n4931" ));
|
assertTrue("did not find grant for co-pi", uris.contains("http://vivo.scripps.edu/individual/n4931" ));
|
||||||
|
@ -646,14 +575,8 @@ public class AdditionalURIsForContextNodesTest {
|
||||||
"<http://vivo.scripps.edu/individual/n160> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#Thing> . \n" +
|
"<http://vivo.scripps.edu/individual/n160> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#Thing> . \n" +
|
||||||
"<http://vivo.scripps.edu/individual/n160> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://vivoweb.org/ontology/core#Grant> . \n" ;
|
"<http://vivo.scripps.edu/individual/n160> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://vivoweb.org/ontology/core#Grant> . \n" ;
|
||||||
|
|
||||||
|
populateModelAndCreateUriFinder(n3);
|
||||||
//make a test model with an person, a investigator role node and a grant
|
|
||||||
OntModel model = ModelFactory.createOntologyModel();
|
|
||||||
model.read( new StringReader(n3), null, "N3");
|
|
||||||
|
|
||||||
//make an AdditionalURIsForContextNodesTest object with that model
|
|
||||||
AdditionalURIsForContextNodes uriFinder = new AdditionalURIsForContextNodes( model );
|
|
||||||
|
|
||||||
//if the investigator changes then the grant needs to be updated
|
//if the investigator changes then the grant needs to be updated
|
||||||
List<String> uris = uriFinder.findAdditionalURIsToIndex( "http://vivo.scripps.edu/individual/n5282");
|
List<String> uris = uriFinder.findAdditionalURIsToIndex( "http://vivo.scripps.edu/individual/n5282");
|
||||||
assertTrue("did not find grant for investigator", uris.contains("http://vivo.scripps.edu/individual/n160" ));
|
assertTrue("did not find grant for investigator", uris.contains("http://vivo.scripps.edu/individual/n160" ));
|
||||||
|
@ -661,10 +584,21 @@ public class AdditionalURIsForContextNodesTest {
|
||||||
//if the grant changes then the investigator needs to be updated
|
//if the grant changes then the investigator needs to be updated
|
||||||
uris = uriFinder.findAdditionalURIsToIndex( "http://vivo.scripps.edu/individual/n160");
|
uris = uriFinder.findAdditionalURIsToIndex( "http://vivo.scripps.edu/individual/n160");
|
||||||
assertTrue("did not find investigator for grant", uris.contains("http://vivo.scripps.edu/individual/n5282" ));
|
assertTrue("did not find investigator for grant", uris.contains("http://vivo.scripps.edu/individual/n5282" ));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------
|
||||||
|
// Helper methods
|
||||||
|
// ----------------------------------------------------------------------
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Build a Model from this N3 string, and create a URI Finder based on that
|
||||||
|
* Model.
|
||||||
|
*/
|
||||||
|
private void populateModelAndCreateUriFinder(String n3String) {
|
||||||
|
OntModel model = ModelFactory.createOntologyModel();
|
||||||
|
model.read(new StringReader(n3String), null, "N3");
|
||||||
|
uriFinder = new AdditionalURIsForContextNodes(
|
||||||
|
new RDFServiceModel(model));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -1,13 +1,12 @@
|
||||||
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
|
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
|
||||||
package edu.cornell.mannlib.vitro.webapp.search.solr;
|
package edu.cornell.mannlib.vitro.webapp.search.solr;
|
||||||
|
|
||||||
import static org.junit.Assert.assertNotNull;
|
import static org.junit.Assert.*;
|
||||||
import static org.junit.Assert.assertTrue;
|
|
||||||
|
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
|
|
||||||
|
import org.apache.solr.common.SolrInputDocument;
|
||||||
import org.junit.BeforeClass;
|
import org.junit.BeforeClass;
|
||||||
import org.junit.Ignore;
|
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
import com.hp.hpl.jena.rdf.model.Model;
|
import com.hp.hpl.jena.rdf.model.Model;
|
||||||
|
@ -25,33 +24,33 @@ import edu.cornell.mannlib.vitro.webapp.rdfservice.impl.RDFServiceFactorySingle;
|
||||||
import edu.cornell.mannlib.vitro.webapp.rdfservice.impl.jena.model.RDFServiceModel;
|
import edu.cornell.mannlib.vitro.webapp.rdfservice.impl.jena.model.RDFServiceModel;
|
||||||
|
|
||||||
|
|
||||||
public class VivoAgentContextNodeFieldsTest extends AbstractTestClass{
|
public class VivoAgentContextNodeFieldsTest extends AbstractTestClass{
|
||||||
|
|
||||||
static String SPCA = "http://vivo.mydomain.edu/individual/n8087";
|
static String SPCA = "http://vivo.mydomain.edu/individual/n8087";
|
||||||
|
|
||||||
static RDFServiceFactory rdfServiceFactory;
|
static RDFServiceFactory rdfServiceFactory;
|
||||||
|
|
||||||
@BeforeClass
|
@BeforeClass
|
||||||
public static void setup(){
|
public static void setup(){
|
||||||
Model m = ModelFactory.createDefaultModel();
|
Model m = ModelFactory.createDefaultModel();
|
||||||
InputStream stream = VivoAgentContextNodeFieldsTest
|
InputStream stream = VivoAgentContextNodeFieldsTest
|
||||||
.class.getResourceAsStream("./NIHVIVO3853_DataSet1.rdf");
|
.class.getResourceAsStream("./NIHVIVO3853_DataSet1.rdf");
|
||||||
|
|
||||||
long preloadSize = m.size();
|
long preloadSize = m.size();
|
||||||
|
|
||||||
m.read(stream, null);
|
m.read(stream, null);
|
||||||
assertTrue("expected to load statements from file", m.size() > preloadSize );
|
assertTrue("expected to load statements from file", m.size() > preloadSize );
|
||||||
|
|
||||||
assertTrue("expect statements about SPCA",
|
assertTrue("expect statements about SPCA",
|
||||||
m.contains(ResourceFactory.createResource(SPCA),(Property) null,(RDFNode) null));
|
m.contains(ResourceFactory.createResource(SPCA),(Property) null,(RDFNode) null));
|
||||||
|
|
||||||
RDFService rdfService = new RDFServiceModel(m);
|
RDFService rdfService = new RDFServiceModel(m);
|
||||||
rdfServiceFactory = new RDFServiceFactorySingle(rdfService);
|
rdfServiceFactory = new RDFServiceFactorySingle(rdfService);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testJane(){
|
public void testJane(){
|
||||||
Individual ind = new IndividualImpl();
|
Individual ind = new IndividualImpl();
|
||||||
ind.setURI(SPCA);
|
ind.setURI(SPCA);
|
||||||
|
|
||||||
VivoAgentContextNodeFields vacnf = new VivoAgentContextNodeFields(rdfServiceFactory);
|
VivoAgentContextNodeFields vacnf = new VivoAgentContextNodeFields(rdfServiceFactory);
|
||||||
|
@ -61,13 +60,12 @@ public class VivoAgentContextNodeFieldsTest extends AbstractTestClass{
|
||||||
String values = sb.toString();
|
String values = sb.toString();
|
||||||
|
|
||||||
boolean hasJane = values.toLowerCase().indexOf("jane") > 0;
|
boolean hasJane = values.toLowerCase().indexOf("jane") > 0;
|
||||||
assertTrue("expected to have jane because SPCA advises jane", hasJane);
|
assertTrue("expected to have jane because SPCA advises jane", hasJane);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore
|
@Test
|
||||||
@Test
|
public void testWonder(){
|
||||||
public void testWonder(){
|
Individual ind = new IndividualImpl();
|
||||||
Individual ind = new IndividualImpl();
|
|
||||||
ind.setURI(SPCA);
|
ind.setURI(SPCA);
|
||||||
|
|
||||||
VivoAgentContextNodeFields vacnf = new VivoAgentContextNodeFields(rdfServiceFactory);
|
VivoAgentContextNodeFields vacnf = new VivoAgentContextNodeFields(rdfServiceFactory);
|
||||||
|
@ -77,12 +75,12 @@ public class VivoAgentContextNodeFieldsTest extends AbstractTestClass{
|
||||||
String values = sb.toString();
|
String values = sb.toString();
|
||||||
|
|
||||||
boolean hasWonder = values.toLowerCase().indexOf("wonders") > 0;
|
boolean hasWonder = values.toLowerCase().indexOf("wonders") > 0;
|
||||||
assertTrue("expected to have jane because SPCA won wonders award", hasWonder);
|
assertTrue("expected to have jane because SPCA won wonders award", hasWonder);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testChimp(){
|
public void testChimp(){
|
||||||
Individual ind = new IndividualImpl();
|
Individual ind = new IndividualImpl();
|
||||||
ind.setURI(SPCA);
|
ind.setURI(SPCA);
|
||||||
|
|
||||||
VivoAgentContextNodeFields vacnf = new VivoAgentContextNodeFields(rdfServiceFactory);
|
VivoAgentContextNodeFields vacnf = new VivoAgentContextNodeFields(rdfServiceFactory);
|
||||||
|
@ -92,6 +90,6 @@ public class VivoAgentContextNodeFieldsTest extends AbstractTestClass{
|
||||||
String values = sb.toString();
|
String values = sb.toString();
|
||||||
|
|
||||||
boolean hasNotChimp = ! (values.toLowerCase().indexOf("chimp") > 0);
|
boolean hasNotChimp = ! (values.toLowerCase().indexOf("chimp") > 0);
|
||||||
assertTrue("expected to not have chimp because jane won chimp award, not SPCA", hasNotChimp);
|
assertTrue("expected to not have chimp because jane won chimp award, not SPCA", hasNotChimp);
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Add table
Reference in a new issue