Merging from branch. Adding getRdfsLabel() to Individual and subclasses. NIHVIVO-836

This commit is contained in:
bdc34 2010-07-21 14:44:36 +00:00
parent 7bb0dc1095
commit d565eca6b6
6 changed files with 221 additions and 0 deletions

172
.classpath Normal file
View file

@ -0,0 +1,172 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="webapp/src"/>
<classpathentry kind="src" path="webapp/test"/>
<classpathentry kind="src" path="webapp/web/admin/axis"/>
<classpathentry kind="lib" path="config/ant/lib/ant-contrib-1.0b2.jar"/>
<classpathentry kind="lib" path="services/lib/axis-ant.jar"/>
<classpathentry kind="lib" path="services/lib/axis.jar"/>
<classpathentry kind="lib" path="services/lib/commons-discovery-0.2.jar"/>
<classpathentry kind="lib" path="services/lib/commons-logging-1.0.4.jar"/>
<classpathentry kind="lib" path="services/lib/jaxrpc.jar"/>
<classpathentry kind="lib" path="services/lib/saaj.jar"/>
<classpathentry kind="lib" path="services/lib/wsdl4j-1.5.1.jar"/>
<classpathentry kind="lib" path="utilities/ingest/xformer/saxon9he.jar"/>
<classpathentry kind="lib" path="utilities/ingest/xslt/saxon9he.jar"/>
<classpathentry kind="lib" path="utilities/testrunner/lib/junit-4.8.1.jar"/>
<classpathentry kind="lib" path="utilities/testrunner/selenium/selenium-server.jar"/>
<classpathentry kind="lib" path="webapp/lib/activation-1.1.jar"/>
<classpathentry kind="lib" path="webapp/lib/aduna-appbase-core-3.4.jar"/>
<classpathentry kind="lib" path="webapp/lib/aduna-appbase-logging-api-3.4.jar"/>
<classpathentry kind="lib" path="webapp/lib/aduna-appbase-logging-file-3.4.jar"/>
<classpathentry kind="lib" path="webapp/lib/aduna-appbase-webapp-base-core-3.4.jar"/>
<classpathentry kind="lib" path="webapp/lib/aduna-commons-collections-2.3.jar"/>
<classpathentry kind="lib" path="webapp/lib/aduna-commons-concurrent-2.2.jar"/>
<classpathentry kind="lib" path="webapp/lib/aduna-commons-i18n-1.0.jar"/>
<classpathentry kind="lib" path="webapp/lib/aduna-commons-io-2.4.jar"/>
<classpathentry kind="lib" path="webapp/lib/aduna-commons-iteration-2.3.jar"/>
<classpathentry kind="lib" path="webapp/lib/aduna-commons-lang-2.2.jar"/>
<classpathentry kind="lib" path="webapp/lib/aduna-commons-net-2.2.jar"/>
<classpathentry kind="lib" path="webapp/lib/aduna-commons-platform-info-2.4.jar"/>
<classpathentry kind="lib" path="webapp/lib/aduna-commons-text-2.2.jar"/>
<classpathentry kind="lib" path="webapp/lib/aduna-commons-webapp-core-2.3.jar"/>
<classpathentry kind="lib" path="webapp/lib/aduna-commons-xml-2.2.jar"/>
<classpathentry kind="lib" path="webapp/lib/antlr-2.7.7.jar"/>
<classpathentry kind="lib" path="webapp/lib/arq-extra.jar"/>
<classpathentry kind="lib" path="webapp/lib/arq.jar"/>
<classpathentry kind="lib" path="webapp/lib/aterm-java-1.6.jar"/>
<classpathentry kind="lib" path="webapp/lib/commons-beanutils-core.jar"/>
<classpathentry kind="lib" path="webapp/lib/commons-betwixt-0.7.jar"/>
<classpathentry kind="lib" path="webapp/lib/commons-cli-1.1.jar"/>
<classpathentry kind="lib" path="webapp/lib/commons-codec-1.3.jar"/>
<classpathentry kind="lib" path="webapp/lib/commons-collections-3.2.1.jar"/>
<classpathentry kind="lib" path="webapp/lib/commons-dbcp-1.2.1.jar"/>
<classpathentry kind="lib" path="webapp/lib/commons-dbcp-1.2.2.jar"/>
<classpathentry kind="lib" path="webapp/lib/commons-digester-1.7.jar"/>
<classpathentry kind="lib" path="webapp/lib/commons-discovery-0.2.jar"/>
<classpathentry kind="lib" path="webapp/lib/commons-fileupload-1.2.1.jar"/>
<classpathentry kind="lib" path="webapp/lib/commons-httpclient-3.1.jar"/>
<classpathentry kind="lib" path="webapp/lib/commons-io-1.3.2.jar"/>
<classpathentry kind="lib" path="webapp/lib/commons-lang-2.4.jar"/>
<classpathentry kind="lib" path="webapp/lib/commons-logging-1.1.1.jar"/>
<classpathentry kind="lib" path="webapp/lib/commons-pool-1.3.jar"/>
<classpathentry kind="lib" path="webapp/lib/concurrent.jar"/>
<classpathentry kind="lib" path="webapp/lib/cos.jar"/>
<classpathentry kind="lib" path="webapp/lib/csv-1.0.jar"/>
<classpathentry kind="lib" path="webapp/lib/dom4j-1.6.1.jar"/>
<classpathentry kind="lib" path="webapp/lib/dwr-2.0.M2.8.jar"/>
<classpathentry kind="lib" path="webapp/lib/fedora-client.jar"/>
<classpathentry kind="lib" path="webapp/lib/freemarker.jar"/>
<classpathentry kind="lib" path="webapp/lib/gson-1.4.jar"/>
<classpathentry kind="lib" path="webapp/lib/icu4j_3_4.jar"/>
<classpathentry kind="lib" path="webapp/lib/iri.jar"/>
<classpathentry kind="lib" path="webapp/lib/iText-5.0.2.jar"/>
<classpathentry kind="lib" path="webapp/lib/jai_codec.jar"/>
<classpathentry kind="lib" path="webapp/lib/jai_core.jar"/>
<classpathentry kind="lib" path="webapp/lib/jakarta-jstl1.2-jstl.jar"/>
<classpathentry kind="lib" path="webapp/lib/jakarta-jstl1.2-standard.jar"/>
<classpathentry kind="lib" path="webapp/lib/jakarta-oro-2.0.8.jar"/>
<classpathentry kind="lib" path="webapp/lib/jaxen-1.1-beta-6.jar"/>
<classpathentry kind="lib" path="webapp/lib/jaxen-1.1-beta-9.jar"/>
<classpathentry kind="lib" path="webapp/lib/jaxrpc.jar"/>
<classpathentry kind="lib" path="webapp/lib/jcalendar.jar"/>
<classpathentry kind="lib" path="webapp/lib/jdom-1.0.jar"/>
<classpathentry kind="lib" path="webapp/lib/jdom.jar"/>
<classpathentry kind="lib" path="webapp/lib/jena.jar"/>
<classpathentry kind="lib" path="webapp/lib/jenatest.jar"/>
<classpathentry kind="lib" path="webapp/lib/jga-0.8.jar"/>
<classpathentry kind="lib" path="webapp/lib/joda-time-1.4.jar"/>
<classpathentry kind="lib" path="webapp/lib/json-taglib-0.4.1.jar"/>
<classpathentry kind="lib" path="webapp/lib/jsp-api.jar"/>
<classpathentry kind="lib" path="webapp/lib/jtidy-8.0-20060801.124516-2.jar"/>
<classpathentry kind="lib" path="webapp/lib/junit-4.8.1.jar"/>
<classpathentry kind="lib" path="webapp/lib/ldap.jar"/>
<classpathentry kind="lib" path="webapp/lib/log4j-1.2.14.jar"/>
<classpathentry kind="lib" path="webapp/lib/lucene-analyzers-2.4.jar"/>
<classpathentry kind="lib" path="webapp/lib/lucene-core-2.4.0.jar"/>
<classpathentry kind="lib" path="webapp/lib/lucene-highlighter-2.4.jar"/>
<classpathentry kind="lib" path="webapp/lib/mail-1.4.jar"/>
<classpathentry kind="lib" path="webapp/lib/mysql-connector-java-3.0.16-ga-bin.jar"/>
<classpathentry kind="lib" path="webapp/lib/ojdbc14_g.jar"/>
<classpathentry kind="lib" path="webapp/lib/pellet-cli.jar"/>
<classpathentry kind="lib" path="webapp/lib/pellet-core.jar"/>
<classpathentry kind="lib" path="webapp/lib/pellet-datatypes.jar"/>
<classpathentry kind="lib" path="webapp/lib/pellet-dig.jar"/>
<classpathentry kind="lib" path="webapp/lib/pellet-el.jar"/>
<classpathentry kind="lib" path="webapp/lib/pellet-explanation.jar"/>
<classpathentry kind="lib" path="webapp/lib/pellet-jena.jar"/>
<classpathentry kind="lib" path="webapp/lib/pellet-modularity.jar"/>
<classpathentry kind="lib" path="webapp/lib/pellet-owlapi.jar"/>
<classpathentry kind="lib" path="webapp/lib/pellet-pellint.jar"/>
<classpathentry kind="lib" path="webapp/lib/pellet-query.jar"/>
<classpathentry kind="lib" path="webapp/lib/pellet-rules.jar"/>
<classpathentry kind="lib" path="webapp/lib/pellet-test.jar"/>
<classpathentry kind="lib" path="webapp/lib/pellet.jar"/>
<classpathentry kind="lib" path="webapp/lib/relaxngDatatype.jar"/>
<classpathentry kind="lib" path="webapp/lib/rowset-20040728-v101.jar"/>
<classpathentry kind="lib" path="webapp/lib/rsslib4j-0.2.jar"/>
<classpathentry kind="lib" path="webapp/lib/saaj.jar"/>
<classpathentry kind="lib" path="webapp/lib/saxon9he.jar"/>
<classpathentry kind="lib" path="webapp/lib/sdb.jar"/>
<classpathentry kind="lib" path="webapp/lib/servlet-api.jar"/>
<classpathentry kind="lib" path="webapp/lib/sesame-console-2.2.3.jar"/>
<classpathentry kind="lib" path="webapp/lib/sesame-http-client-2.2.3.jar"/>
<classpathentry kind="lib" path="webapp/lib/sesame-http-protocol-2.2.3.jar"/>
<classpathentry kind="lib" path="webapp/lib/sesame-http-server-spring-2.2.3.jar"/>
<classpathentry kind="lib" path="webapp/lib/sesame-model-2.2.3.jar"/>
<classpathentry kind="lib" path="webapp/lib/sesame-query-2.2.3.jar"/>
<classpathentry kind="lib" path="webapp/lib/sesame-queryalgebra-evaluation-2.2.3.jar"/>
<classpathentry kind="lib" path="webapp/lib/sesame-queryalgebra-model-2.2.3.jar"/>
<classpathentry kind="lib" path="webapp/lib/sesame-queryparser-api-2.2.3.jar"/>
<classpathentry kind="lib" path="webapp/lib/sesame-queryparser-serql-2.2.3.jar"/>
<classpathentry kind="lib" path="webapp/lib/sesame-queryparser-sparql-2.2.3.jar"/>
<classpathentry kind="lib" path="webapp/lib/sesame-queryresultio-api-2.2.3.jar"/>
<classpathentry kind="lib" path="webapp/lib/sesame-queryresultio-binary-2.2.3.jar"/>
<classpathentry kind="lib" path="webapp/lib/sesame-queryresultio-sparqljson-2.2.3.jar"/>
<classpathentry kind="lib" path="webapp/lib/sesame-queryresultio-sparqlxml-2.2.3.jar"/>
<classpathentry kind="lib" path="webapp/lib/sesame-queryresultio-text-2.2.3.jar"/>
<classpathentry kind="lib" path="webapp/lib/sesame-repository-api-2.2.3.jar"/>
<classpathentry kind="lib" path="webapp/lib/sesame-repository-contextaware-2.2.3.jar"/>
<classpathentry kind="lib" path="webapp/lib/sesame-repository-dataset-2.2.3.jar"/>
<classpathentry kind="lib" path="webapp/lib/sesame-repository-event-2.2.3.jar"/>
<classpathentry kind="lib" path="webapp/lib/sesame-repository-http-2.2.3.jar"/>
<classpathentry kind="lib" path="webapp/lib/sesame-repository-manager-2.2.3.jar"/>
<classpathentry kind="lib" path="webapp/lib/sesame-repository-sail-2.2.3.jar"/>
<classpathentry kind="lib" path="webapp/lib/sesame-rio-api-2.2.3.jar"/>
<classpathentry kind="lib" path="webapp/lib/sesame-rio-n3-2.2.3.jar"/>
<classpathentry kind="lib" path="webapp/lib/sesame-rio-ntriples-2.2.3.jar"/>
<classpathentry kind="lib" path="webapp/lib/sesame-rio-rdfxml-2.2.3.jar"/>
<classpathentry kind="lib" path="webapp/lib/sesame-rio-trig-2.2.3.jar"/>
<classpathentry kind="lib" path="webapp/lib/sesame-rio-trix-2.2.3.jar"/>
<classpathentry kind="lib" path="webapp/lib/sesame-rio-turtle-2.2.3.jar"/>
<classpathentry kind="lib" path="webapp/lib/sesame-runtime-2.2.3.jar"/>
<classpathentry kind="lib" path="webapp/lib/sesame-sail-api-2.2.3.jar"/>
<classpathentry kind="lib" path="webapp/lib/sesame-sail-inferencer-2.2.3.jar"/>
<classpathentry kind="lib" path="webapp/lib/sesame-sail-memory-2.2.3.jar"/>
<classpathentry kind="lib" path="webapp/lib/sesame-sail-nativerdf-2.2.3.jar"/>
<classpathentry kind="lib" path="webapp/lib/sesame-sail-rdbms-2.2.3.jar"/>
<classpathentry kind="lib" path="webapp/lib/slf4j-api-1.5.6.jar"/>
<classpathentry kind="lib" path="webapp/lib/slf4j-log4j12-1.5.6.jar"/>
<classpathentry kind="lib" path="webapp/lib/solr-1.0.jar"/>
<classpathentry kind="lib" path="webapp/lib/sparqltag.jar"/>
<classpathentry kind="lib" path="webapp/lib/spring2.5.6.jar"/>
<classpathentry kind="lib" path="webapp/lib/stax-api-1.0.1.jar"/>
<classpathentry kind="lib" path="webapp/lib/stax-api-1.0.jar"/>
<classpathentry kind="lib" path="webapp/lib/taglibs-mailer.jar"/>
<classpathentry kind="lib" path="webapp/lib/taglibs-random.jar"/>
<classpathentry kind="lib" path="webapp/lib/taglibs-string.jar"/>
<classpathentry kind="lib" path="webapp/lib/trippi-1.3.2-core.jar"/>
<classpathentry kind="lib" path="webapp/lib/wsdl4j-1.5.2.jar"/>
<classpathentry kind="lib" path="webapp/lib/wstx-asl-3.0.0.jar"/>
<classpathentry kind="lib" path="webapp/lib/xalan.jar"/>
<classpathentry kind="lib" path="webapp/lib/xbean-2.1.0.jar"/>
<classpathentry kind="lib" path="webapp/lib/xbean-spring-2.5.jar"/>
<classpathentry kind="lib" path="webapp/lib/xercesImpl.jar"/>
<classpathentry kind="lib" path="webapp/lib/xml-apis.jar"/>
<classpathentry kind="lib" path="webapp/lib/XmlSchema-1.0.3.jar"/>
<classpathentry kind="lib" path="webapp/lib/xpp3_min-1.1.3.4.O.jar"/>
<classpathentry kind="lib" path="webapp/lib/xsdlib.jar"/>
<classpathentry kind="lib" path="webapp/lib/xstream-1.2.2.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="output" path="bin"/>
</classpath>

17
.project Normal file
View file

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>vitro-core-rel-1.1-maint</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>

View file

@ -19,6 +19,13 @@ public interface Individual extends ResourceBean, VitroTimeWindowedResource, Com
String getName();
void setName(String in);
/**
* Returns an rdfs:label if there is one on the individual. Returns null
* if none can be found. If more than one rdfs:label can be found for the individual
* one of the labels will be returned, which one is undefined.
*/
String getRdfsLabel();
String getVClassURI();
void setVClassURI(String in);

View file

@ -25,6 +25,7 @@ public class IndividualImpl extends BaseResourceBean implements Individual, Comp
protected static final String NOT_INITIALIZED = "__%NOT_INITIALIZED%__";
public String name = null;
protected String rdfsLabel = null;
public String vClassURI = null;
protected VClass vClass = null;
protected List<VClass> directVClasses = null;
@ -81,6 +82,9 @@ public class IndividualImpl extends BaseResourceBean implements Individual, Comp
public String getName(){return name;}
public void setName(String in){name=in;}
public String getRdfsLabel(){ return rdfsLabel; }
public void setRdfsLabel(String s){ rdfsLabel = s; }
// private String modTime = null;
// public String getModtime(){return modTime;}
// public void setModtime(String in){modTime=in;}

View file

@ -292,6 +292,9 @@ public class IndividualFiltering implements Individual {
return _innerIndividual.getName();
}
public String getRdfsLabel(){
return _innerIndividual.getRdfsLabel();
}
public String getNamespace() {
return _innerIndividual.getNamespace();

View file

@ -50,6 +50,7 @@ public class IndividualJena extends IndividualImpl implements Individual {
private OntResource ind = null;
private WebappDaoFactoryJena webappDaoFactory = null;
private Float _searchBoostJena = null;
private boolean retreivedNullRdfsLabel = false;
public IndividualJena(OntResource ind, WebappDaoFactoryJena wadf) {
this.ind = ind;
@ -81,6 +82,23 @@ public class IndividualJena extends IndividualImpl implements Individual {
}
}
public String getRdfsLabel() {
if (this.rdfsLabel != null) {
return rdfsLabel;
} else if( this.rdfsLabel == null && retreivedNullRdfsLabel ){
return null;
} else {
ind.getOntModel().enterCriticalSection(Lock.READ);
try {
this.rdfsLabel = webappDaoFactory.getJenaBaseDao().getLabel(ind);
retreivedNullRdfsLabel = this.rdfsLabel == null;
return this.rdfsLabel;
} finally {
ind.getOntModel().leaveCriticalSection();
}
}
}
public String getVClassURI() {
if (this.vClassURI != null) {
return vClassURI;