[MOBY-guts] biomoby commit
Eddie Kawas
kawas at pub.open-bio.org
Thu Nov 10 16:12:02 UTC 2005
kawas
Thu Nov 10 11:12:01 EST 2005
Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/registry/rdfagent/verifier
In directory pub.open-bio.org:/tmp/cvs-serv5843/org/biomoby/registry/rdfagent/verifier
Modified Files:
ServiceDescrParser.java
Log Message:
some bug fixes
moby-live/Java/src/main/org/biomoby/registry/rdfagent/verifier ServiceDescrParser.java,1.11,1.12
===================================================================
RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/registry/rdfagent/verifier/ServiceDescrParser.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- /home/repository/moby/moby-live/Java/src/main/org/biomoby/registry/rdfagent/verifier/ServiceDescrParser.java 2005/11/08 00:02:08 1.11
+++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/registry/rdfagent/verifier/ServiceDescrParser.java 2005/11/10 16:12:01 1.12
@@ -5,14 +5,12 @@
import java.util.Iterator;
import java.util.Vector;
+import org.biomoby.client.rdf.vocabulary.FetaVocabulary;
import org.biomoby.client.rdf.vocabulary.ServiceDescriptionPredicates;
-import org.biomoby.registry.rdfagent.util.Constants;
import org.biomoby.registry.rdfagent.util.Log;
import org.biomoby.registry.rdfagent.util.Report;
import org.biomoby.registry.rdfagent.util.XMLBuilder;
-import uk.ac.man.cs.img.fetaEngine.commons.FetaModelRDF;
-
import com.hp.hpl.jena.rdf.model.Model;
import com.hp.hpl.jena.rdf.model.ResIterator;
import com.hp.hpl.jena.rdf.model.Resource;
@@ -37,7 +35,7 @@
int n = 0;
int[] ver = { 0, 0, 0, 0, 0, 0, 0, 0 };
- private String[] vers = { "authority uri", "category","contact email","url","service type","service name","authoritative value","signature url" };
+ private String[] vers = { "authority uri", "category","contact email","url","service type","service name","description","authoritative value" };
ServiceDescrParser(Model serviceDescrMd) {
@@ -69,7 +67,7 @@
// get the set of RDF with the same signatureURL
- ResIterator iter = servDescrMd.listSubjectsWithProperty(servDescrMd.getProperty(FetaModelRDF.getURI()+"providedBy"));
+ ResIterator iter = servDescrMd.listSubjectsWithProperty(FetaVocabulary.providedBy);
while (iter.hasNext()) {
String resource = iter.next().toString(); // an LSID
Hashtable servSign = new Hashtable();
@@ -93,8 +91,15 @@
servError += 1;
String msg = "A bad Input or Output structure for the service <"
+ servName + ">. ";
- String msg1 = "The service have not processed";
+ String msg1 = "The service has not been processed";
Report.doWrite(msg + msg1);
+ Log.info(msg + msg1);
+ // added - should tell provider that service wasnt well.
+ Report.add(msg);
+ Report.add(msg1);
+ // send a message to service provider stating that service was removed
+ Report.send(signURL);
+ // end added
} else {
DataMngr.processService(servSign, servInp, servOut,
servName, auth_URI, signURL);
@@ -140,18 +145,11 @@
deletedServ.addElement(servName);
String msg = "The service < "
+ servName
- + " > was not found in the RDF file. The service was deregistered from MOBYCENTRAL Registry";
+ + " > was either missing or incorrectly represented in the RDF document. The service was deregistered from MOBYCENTRAL Registry.";
Report.doWrite(msg);
Report.add(msg);
-
- if (Constants.MB_MAIL_SERVER != null
- || !Constants.MB_MAIL_SERVER.equals("")) {
- String to = DataMngr.getContactEmail(signURL);
- Communicator.sendMail(to, Constants.SP_SUBJECT, msg,
- Constants.MB_FROM);
- // send message to the service provider - that service was
- // deregistered
- }
+ // send a message to service provider stating that service was removed
+ Report.send(signURL);
}
}
int del = deletedServ.size();
@@ -180,6 +178,103 @@
}
/**
+ * get a provider's RDF file by signatureURL, and check if every of service
+ * RDF is valid MOBY
+ *
+ * @param signURL -
+ * the URL of resource (signatureURL)
+ *
+ */
+
+ public void addServicesFromRdfDocument(String signURL, String email) {
+ String servNames = "";
+ String res = "";
+ int amount = 0;
+ int validMoby = 0;
+ int servError = 0;
+ Vector resources = new Vector(); // the list of services at given URL
+ // (including new services)
+ String auth_URI = "";
+ String servName = "";
+ Vector deletedServ = new Vector(); // the list of deleted services from
+ // database
+
+ // get the set of RDF with the same signatureURL
+
+ ResIterator iter = servDescrMd.listSubjectsWithProperty(FetaVocabulary.providedBy);
+ while (iter.hasNext()) {
+ Report
+ .add("****************************************************************************************");
+ Report.add(" START MOBY RDFAGENT REPORT ");
+ Report
+ .add("****************************************************************************************");
+ String resource = iter.next().toString(); // an LSID
+ Hashtable servSign = new Hashtable();
+ amount += 1;
+ servSign = getServSignature(resource);
+
+ if (!servSign.isEmpty()) { // a valid MOBY RDF
+ servName = servSign.get("servicename").toString();
+ servNames+=servName+",";
+ auth_URI = servSign.get("authURI").toString();
+ resources.addElement(servName);
+
+ Hashtable servInp = new Hashtable();
+ servInp = getInput(resource);
+ Hashtable servOut = new Hashtable();
+ servOut = getOutput(resource);
+
+ ver = new int[]{0,0,0,0,0,0,0,0};
+ if (servInp.containsValue("error")
+ | servOut.containsValue("error")) {
+ servError += 1;
+ String msg = "A bad Input or Output structure for the service <"
+ + servName + ">. ";
+ String msg1 = "The service has not been processed";
+ Report.add(msg);
+ Report.add(msg1);
+ Report
+ .add("=======================================================================================");
+ Report.add(" END MOBY RDFAGENT REPORT ");
+ Report
+ .add("=======================================================================================");
+ Log.info(msg);
+ Log.info((msg1));
+ Report.doWrite(msg);
+ Report.doWrite(msg1);
+ Report.send(signURL, email);
+ } else {
+ // set the email address to be the admin since it doesnt make sense to swallow services and to make someone else curate them
+ //servSign.put("contact_email", email);
+ DataMngr.processService(servSign, servInp, servOut,
+ servName, auth_URI, signURL);
+ }
+ } else {
+ validMoby += 1; // a not valid MOBY RDF
+ }
+ Report.clear();
+ }
+
+ String[] result = servNames.split(",");
+
+ Report
+ .add("----------------------------------------------------------------------------------------");
+ Report.add(" ");
+ Report.add("Expected services for given URL " + result.length);
+
+ Report.add("In fact = " + amount);
+ Report.add("notValidMoby services or with a bad structure = "
+ + (servError + validMoby));
+ Report.add(" ");
+
+ // Report.add("notValidMoby services or with a bad structure =
+ // "+(servError+validMoby));
+
+ Log
+ .info("=======================================================================");
+ }
+
+ /**
* get service Signature data for the service
*
* @param resource -
@@ -194,6 +289,7 @@
Resource si = servDescrMd.getResource(resource);
+ Report.clear();
Report
.doWrite("----------------------------------------------------------------------------------------");
Report
@@ -209,9 +305,9 @@
// hash *should* contain the following keys:
// authURI, category, contact_email, url, service_type_uri, servicename, authoritative, signatureURL
- if (si.hasProperty(FetaModelRDF.hasServiceType)) {
+ if (si.hasProperty(FetaVocabulary.hasServiceType)) {
ver[4] = 1; // set flag to indicate that we have the property
- String serviceType = si.getProperty(FetaModelRDF.hasServiceType).getObject().toString();
+ String serviceType = si.getProperty(FetaVocabulary.hasServiceType).getObject().toString();
sign.put("service_type_uri", "urn:lsid:biomoby.org:servicetype:"+serviceType);
}
@@ -221,8 +317,8 @@
sign.put("category", category);
}
- if (si.hasProperty(servDescrMd.getProperty(FetaModelRDF.getURI()+"providedBy"))) {
- Resource org = (Resource)si.getProperty(servDescrMd.getProperty(FetaModelRDF.getURI()+"providedBy")).getObject();
+ if (si.hasProperty(FetaVocabulary.providedBy)) {
+ Resource org = (Resource)si.getProperty(FetaVocabulary.providedBy).getObject();
if (org.hasProperty(DC.publisher)) {
ver[0] = 1;// set flag to indicate that we have the property
String authorityURI = org.getProperty(DC.publisher).getObject().toString();
@@ -234,35 +330,35 @@
sign.put("contact_email", email);
}
if (org.hasProperty(ServiceDescriptionPredicates.authoritative)) {
- ver[6] = 1;// set flag to indicate that we have the property
+ ver[7] = 1;// set flag to indicate that we have the property
String authoritative = org.getProperty(ServiceDescriptionPredicates.authoritative).getObject().toString();
sign.put("authoritative", ((authoritative.equalsIgnoreCase("true")) ? "authoritative" : "non-authoritative"));
}
}
-
- if (si.hasProperty(FetaModelRDF.locationURI)) {
+
+ if (si.hasProperty(FetaVocabulary.locationURI)) {
ver[3] = 1; // set flag to indicate that we have the property
- String url = si.getProperty(FetaModelRDF.locationURI).getObject().toString();
+ String url = si.getProperty(FetaVocabulary.locationURI).getObject().toString();
sign.put("URL", url);
}
- if (si.hasProperty(FetaModelRDF.hasServiceDescriptionLocation)) {
- ver[7] = 1; // set flag to indicate that we have the property
- String signatureURL = si.getProperty(FetaModelRDF.hasServiceDescriptionLocation).getObject().toString();
- sign.put("signatureURL", signatureURL);
+ if (si.hasProperty(FetaVocabulary.hasServiceDescriptionText)) {
+ ver[6] = 1; // set flag to indicate that we have the property
+ String description = si.getProperty(FetaVocabulary.hasServiceDescriptionText).getObject().toString();
+ sign.put("description", description);
}
- if (si.hasProperty(FetaModelRDF.hasServiceNameText)) {
+ if (si.hasProperty(FetaVocabulary.hasServiceNameText)) {
ver[5] = 1; // set flag to indicate that we have the property
- String name = si.getProperty(FetaModelRDF.hasServiceNameText).getObject().toString();
+ String name = si.getProperty(FetaVocabulary.hasServiceNameText).getObject().toString();
sign.put("servicename", name);
}
// check for the inputs (moby says at least one input/output)
- StmtIterator sit = si.listProperties(FetaModelRDF.hasOperation);
+ StmtIterator sit = si.listProperties(FetaVocabulary.hasOperation);
while (sit.hasNext()) {
Statement s = sit.nextStatement();
Resource r = (Resource) s.getObject();
- StmtIterator ins = r.listProperties(FetaModelRDF.inputParameter);
- StmtIterator outs = r.listProperties(FetaModelRDF.outputParameter);
+ StmtIterator ins = r.listProperties(FetaVocabulary.inputParameter);
+ StmtIterator outs = r.listProperties(FetaVocabulary.outputParameter);
while (ins.hasNext()) {
Resource parameter = (Resource)ins.nextStatement().getObject();
// if object type is null, then we have a secondary <- doesnt count
@@ -284,7 +380,7 @@
Report
.doWrite("THE RDF IS NOT VALID MOBY RDF: one or more MOBY descriptors are absent. " + vers[vn] + " is definitely absent.");
Report
- .add("THE RDF IS NOT VALID MOBY RDF: one or more MOBY descriptors are absent. " + vers[vn] + " is definitely absent.");
+ .add("\tTHE RDF IS NOT VALID MOBY RDF: one or more MOBY descriptors are absent. " + vers[vn] + " is definitely absent.");
sign.clear();
break; //TODO should we break? if we dont, wont we know what is wrong completely with our service?
}
@@ -293,7 +389,7 @@
Report
.doWrite("THE RDF IS NOT VALID MOBY RDF: Input and Output are absent ");
Report
- .add("THE RDF IS NOT VALID MOBY RDF: Input and Output are absent ");
+ .add("\nTHE RDF IS NOT VALID MOBY RDF: Input and Output are absent ");
Log
.info("THE RDF IS NOT VALID MOBY RDF - Inputs and Outputs are absent");
sign.clear();
@@ -327,30 +423,30 @@
Hashtable input = new Hashtable();
Resource si = servDescrMd.getResource(resource);
- if (si.hasProperty(FetaModelRDF.hasOperation))
+ if (si.hasProperty(FetaVocabulary.hasOperation))
try {
- StmtIterator sit = si.listProperties(FetaModelRDF.hasOperation);
+ StmtIterator sit = si.listProperties(FetaVocabulary.hasOperation);
while (sit.hasNext()) {
Statement s = sit.nextStatement();
Resource r = (Resource) s.getObject();
- StmtIterator ins = r.listProperties(FetaModelRDF.inputParameter);
+ StmtIterator ins = r.listProperties(FetaVocabulary.inputParameter);
while (ins.hasNext()) {
Resource parameter = (Resource)ins.nextStatement().getObject();
// if object type is null, then we have a secondary
- if (parameter.getProperty(this.servDescrMd.getProperty(FetaModelRDF.getURI()+"hasParameterType")).getObject().toString().endsWith("simpleParameter")) {
+ if (parameter.getProperty(FetaVocabulary.hasParameterType).getObject().toString().endsWith("simpleParameter")) {
// we have a simple
// make sure that object type and article name exist
Hashtable siminp = new Hashtable();
if (!parameter.hasProperty(ServiceDescriptionPredicates.object_type)) {
Report.doWrite("Invalid simple input found in " + resource +". Missing moby object type.");
- Report.add("Invalid simple input found in " + resource +". Missing moby object type.");
+ Report.add("\tInvalid simple input found in " + resource +". Missing moby object type.");
Log.info("Invalid simple input found in " + resource +". Missing moby object type.");
simple = "error";
break;
}
- if (!parameter.hasProperty(FetaModelRDF.hasParameterNameText)){
+ if (!parameter.hasProperty(FetaVocabulary.hasParameterNameText)){
Report.doWrite("Invalid simple input found in " + resource +". Missing an article name.");
- Report.add("Invalid simple input found in " + resource +". Missing an article name.");
+ Report.add("\tInvalid simple input found in " + resource +". Missing an article name.");
Log.info("Invalid simple input found in " + resource +". Missing an article name.");
simple = "error";
break;
@@ -362,8 +458,14 @@
datatype = "urn:lsid:biomoby.org:objectclass:" + datatype;
// extract the article name
- String articlename = parameter.getProperty(FetaModelRDF.hasParameterNameText).getObject().toString();
-
+ String articlename = parameter.getProperty(FetaVocabulary.hasParameterNameText).getObject().toString();
+ if (articlename.equals("")){
+ Report.doWrite("Invalid simple input found in " + resource +". Empty article name.");
+ Report.add("\tInvalid simple input found in " + resource +". Empty article name.");
+ Log.info("Invalid simple input found in " + resource +". Empty article name.");
+ simple = "error";
+ break;
+ }
// check for namespaces
StringBuffer sb = new StringBuffer();
String namespaces = null;
@@ -385,20 +487,20 @@
if (namespaces != null)
siminp.put("namespace_type_uris", namespaces);
input.put("siminp"+ sin++, siminp);
- } else if (parameter.getProperty(this.servDescrMd.getProperty(FetaModelRDF.getURI()+"hasParameterType")).getObject().toString().endsWith("collectionParameter")) {
+ } else if (parameter.getProperty(FetaVocabulary.hasParameterType).getObject().toString().endsWith("collectionParameter")) {
// we have a collection
// make sure that object type and article name exist
Hashtable colinp = new Hashtable();
if (!parameter.hasProperty(ServiceDescriptionPredicates.object_type)) {
Report.doWrite("Invalid collection input found in " + resource +". Missing moby object type.");
- Report.add("Invalid collection input found in " + resource +". Missing moby object type.");
+ Report.add("\tInvalid collection input found in " + resource +". Missing moby object type.");
Log.info("Invalid collection input found in " + resource +". Missing moby object type.");
collection = "error";
break;
}
- if (!parameter.hasProperty(FetaModelRDF.hasParameterNameText)){
+ if (!parameter.hasProperty(FetaVocabulary.hasParameterNameText)){
Report.doWrite("Invalid collection input found in " + resource +". Missing an article name.");
- Report.add("Invalid collection input found in " + resource +". Missing an article name.");
+ Report.add("\tInvalid collection input found in " + resource +". Missing an article name.");
Log.info("Invalid collection input found in " + resource +". Missing an article name.");
collection = "error";
break;
@@ -410,8 +512,14 @@
datatype = "urn:lsid:biomoby.org:objectclass:" + datatype;
// extract the article name
- String articlename = parameter.getProperty(FetaModelRDF.hasParameterNameText).getObject().toString();
-
+ String articlename = parameter.getProperty(FetaVocabulary.hasParameterNameText).getObject().toString();
+ if (articlename.equals("")){
+ Report.doWrite("Invalid collection input found in " + resource +". Missing an article name.");
+ Report.add("\tInvalid collection input found in " + resource +". Missing an article name.");
+ Log.info("Invalid collection input found in " + resource +". Missing an article name.");
+ collection = "error";
+ break;
+ }
// check for namespaces
StringBuffer sb = new StringBuffer();
String namespaces = null;
@@ -429,22 +537,23 @@
namespaces = namespaces.substring(0, namespaces.lastIndexOf(","));
}
colinp.put("col_articleName",articlename);
- colinp.put("namespace_type_uris", namespaces);
+ if (namespaces != null)
+ colinp.put("namespace_type_uris", namespaces);
colinp.put("object_type_uri", datatype);
input.put("colinp"+cin++, colinp);
- } else if (parameter.getProperty(this.servDescrMd.getProperty(FetaModelRDF.getURI()+"hasParameterType")).getObject().toString().endsWith("secondaryParameter")) {
+ } else if (parameter.getProperty(FetaVocabulary.hasParameterType).getObject().toString().endsWith("secondaryParameter")) {
// we have a secondary
Hashtable secinp = new Hashtable();
if (!parameter.hasProperty(ServiceDescriptionPredicates.datatype)) {
Report.doWrite("Invalid secondary input found in " + resource +". Missing moby datatype (one of String, Float, Integer, DateTime).");
- Report.add("Invalid secondary input found in " + resource +". Missing moby datatype (one of String, Float, Integer, DateTime).");
+ Report.add("\tInvalid secondary input found in " + resource +". Missing moby datatype (one of String, Float, Integer, DateTime).");
Log.info("Invalid secondary input found in " + resource +". Missing moby datatype (one of String, Float, Integer, DateTime).");
secondary = "error";
break;
}
- if (!parameter.hasProperty(FetaModelRDF.hasParameterNameText)){
+ if (!parameter.hasProperty(FetaVocabulary.hasParameterNameText)){
Report.doWrite("Invalid secondary input found in " + resource +". Missing an article name.");
- Report.add("Invalid secondary input found in " + resource +". Missing an article name.");
+ Report.add("\tInvalid secondary input found in " + resource +". Missing an article name.");
Log.info("Invalid secondary input found in " + resource +". Missing an article name.");
secondary = "error";
break;
@@ -454,13 +563,20 @@
if (datatype.indexOf("#") > 0)
datatype = datatype.substring(datatype.indexOf("#")+1);
// extract the article name
- String articlename = parameter.getProperty(FetaModelRDF.hasParameterNameText).getLiteral().getValue().toString();
+ String articlename = parameter.getProperty(FetaVocabulary.hasParameterNameText).getLiteral().getValue().toString();
+ if (articlename.equals("")){
+ Report.doWrite("Invalid secondary input found in " + resource +". Empty article name.");
+ Report.add("\tInvalid secondary input found in " + resource +". Empty article name.");
+ Log.info("Invalid secondary input found in " + resource +". Empty article name.");
+ secondary = "error";
+ break;
+ }
String defaultValue = null;
String min = null;
String max = null;
String enums = null;
- if (parameter.hasProperty(FetaModelRDF.hasDefaultValue)) {
- defaultValue = parameter.getProperty(FetaModelRDF.hasDefaultValue).getLiteral().getValue().toString();
+ if (parameter.hasProperty(FetaVocabulary.hasDefaultValue)) {
+ defaultValue = parameter.getProperty(FetaVocabulary.hasDefaultValue).getLiteral().getValue().toString();
}
if (parameter.hasProperty(ServiceDescriptionPredicates.max)) {
max = parameter.getProperty(ServiceDescriptionPredicates.max).getLiteral().getValue().toString();
@@ -533,30 +649,30 @@
Hashtable output = new Hashtable();
Resource si = servDescrMd.getResource(resource);
- if (si.hasProperty(FetaModelRDF.hasOperation))
+ if (si.hasProperty(FetaVocabulary.hasOperation))
try {
- StmtIterator sit = si.listProperties(FetaModelRDF.hasOperation);
+ StmtIterator sit = si.listProperties(FetaVocabulary.hasOperation);
while (sit.hasNext()) {
Statement s = sit.nextStatement();
Resource r = (Resource) s.getObject();
- StmtIterator ins = r.listProperties(FetaModelRDF.outputParameter);
+ StmtIterator ins = r.listProperties(FetaVocabulary.outputParameter);
while (ins.hasNext()) {
Resource parameter = (Resource)ins.nextStatement().getObject();
// if object type is null, then we have a secondary
- if (parameter.getProperty(this.servDescrMd.getProperty(FetaModelRDF.getURI()+"hasParameterType")).getObject().toString().endsWith("simpleParameter")) {
+ if (parameter.getProperty(FetaVocabulary.hasParameterType).getObject().toString().endsWith("simpleParameter")) {
// we have a simple
// make sure that object type and article name exist
Hashtable siminp = new Hashtable();
if (!parameter.hasProperty(ServiceDescriptionPredicates.object_type)) {
Report.doWrite("Invalid simple output found in " + resource +". Missing moby object type.");
- Report.add("Invalid simple output found in " + resource +". Missing moby object type.");
+ Report.add("\tInvalid simple output found in " + resource +". Missing moby object type.");
Log.info("Invalid simple output found in " + resource +". Missing moby object type.");
simple = "error";
break;
}
- if (!parameter.hasProperty(FetaModelRDF.hasParameterNameText)){
+ if (!parameter.hasProperty(FetaVocabulary.hasParameterNameText)){
Report.doWrite("Invalid simple output found in " + resource +". Missing an article name.");
- Report.add("Invalid simple output found in " + resource +". Missing an article name.");
+ Report.add("\tInvalid simple output found in " + resource +". Missing an article name.");
Log.info("Invalid simple output found in " + resource +". Missing an article name.");
simple = "error";
break;
@@ -568,8 +684,14 @@
datatype = "urn:lsid:biomoby.org:objectclass:" + datatype;
// extract the article name
- String articlename = parameter.getProperty(FetaModelRDF.hasParameterNameText).getObject().toString();
-
+ String articlename = parameter.getProperty(FetaVocabulary.hasParameterNameText).getObject().toString();
+ if (articlename.equals("")){
+ Report.doWrite("Invalid simple output found in " + resource +". Empty article name.");
+ Report.add("\tInvalid simple output found in " + resource +". Empty article name.");
+ Log.info("Invalid simple output found in " + resource +". Empty article name.");
+ simple = "error";
+ break;
+ }
// check for namespaces
StringBuffer sb = new StringBuffer();
String namespaces = null;
@@ -591,21 +713,21 @@
if (namespaces != null)
siminp.put("namespace_type_uris", namespaces);
output.put("simout"+ so++, siminp);
- } else if (parameter.getProperty(this.servDescrMd.getProperty(FetaModelRDF.getURI()+"hasParameterType")).getObject().toString().endsWith("collectionParameter")) {
+ } else if (parameter.getProperty(FetaVocabulary.hasParameterType).getObject().toString().endsWith("collectionParameter")) {
// we have a collection
// make sure that object type and article name exist
Hashtable colinp = new Hashtable();
if (!parameter.hasProperty(ServiceDescriptionPredicates.object_type)) {
- Report.doWrite("Invalid collection input found in " + resource +". Missing moby object type.");
- Report.add("Invalid collection input found in " + resource +". Missing moby object type.");
- Log.info("Invalid collection input found in " + resource +". Missing moby object type.");
+ Report.doWrite("Invalid collection output found in " + resource +". Missing moby object type.");
+ Report.add("\tInvalid collection output found in " + resource +". Missing moby object type.");
+ Log.info("Invalid collection output found in " + resource +". Missing moby object type.");
collection = "error";
break;
}
- if (!parameter.hasProperty(FetaModelRDF.hasParameterNameText)){
- Report.doWrite("Invalid collection input found in " + resource +". Missing an article name.");
- Report.add("Invalid collection input found in " + resource +". Missing an article name.");
- Log.info("Invalid collection input found in " + resource +". Missing an article name.");
+ if (!parameter.hasProperty(FetaVocabulary.hasParameterNameText)){
+ Report.doWrite("Invalid collection output found in " + resource +". Missing an article name.");
+ Report.add("\tInvalid collection output found in " + resource +". Missing an article name.");
+ Log.info("Invalid collection output found in " + resource +". Missing an article name.");
collection = "error";
break;
}
@@ -616,8 +738,14 @@
datatype = "urn:lsid:biomoby.org:objectclass:" + datatype;
// extract the article name
- String articlename = parameter.getProperty(FetaModelRDF.hasParameterNameText).getObject().toString();
-
+ String articlename = parameter.getProperty(FetaVocabulary.hasParameterNameText).getObject().toString();
+ if (articlename.equals("")){
+ Report.doWrite("Invalid collection output found in " + resource +". Missing an article name.");
+ Report.add("\tInvalid collection output found in " + resource +". Missing an article name.");
+ Log.info("Invalid collection output found in " + resource +". Missing an article name.");
+ collection = "error";
+ break;
+ }
// check for namespaces
StringBuffer sb = new StringBuffer();
String namespaces = null;
@@ -635,7 +763,8 @@
namespaces = namespaces.substring(0, namespaces.lastIndexOf(","));
}
colinp.put("col_articleName",articlename);
- colinp.put("namespace_type_uris", namespaces);
+ if (namespaces != null)
+ colinp.put("namespace_type_uris", namespaces);
colinp.put("object_type_uri", datatype);
output.put("colout"+ co++, colinp);
} else {
More information about the MOBY-guts
mailing list