Well I'm almost there.=0)
So this is what I have done the later part of the week. I also managed to run some SPARQL queries and got some problems to figure out there, main focus next week.
Most parts of Moss now work, although there are some settings that involves combining masks that are not quite finished yet. I actually think that I've spend most my hours on this and still not done...grr
Since Moss have over 30 different parameters I found it important to have a method that shows them. But just now I realized that this is what man moss is for. Well its the same text so no worries there.
Taken from the method though it will look something like this:
> moss.parameterDescription()
Examplea moss.createParamteters("aromatic", "always"),
moss.createParamteters("minEmbed", 6)
aromatic: ("aromatic", "never"/"upgrade"/"downgrade") |"String"
canonic: ("canonicequiv", false/true) |boolean
canonicEquiv: ("canonic", true/false) |boolean
carbonChainLength: ("carbonChainLength", true/false) |boolean
class: not for use
closed: ("closed", true/false) |boolean
exNode: ("exNode", "Atom") |"String"
exSeed: ("exSeed", "Atom") |"String"
extPrune: ("extPrune", "none"/"full"/"partial"/) |"String"
ignoreAtomTypes: ("ignoreAtomTypes", "never"/"always"/"in rings") |"String"
ignoreBond: ("ignoreBond", "never"/"always"/"in rings") |"String"
kekule: ("kekule", true/false) |boolean
limits: not for use
matchAromaticityAtoms: ("matchChargeOfAtoms", "never"/"always"/"in rings")
|"String"
matchChargeOfAtoms: ("matchAromaticityAtoms", "match"/"no match") |"String"
matom: not for use
maxEmbMemory: ("maxEmbMemory", value) |integer
maxEmbed: ("maxEmbed",value) |integer
maxRing: ("maxRing", value) |integer
maximalSupport: ("maximalSupport", value) |double
mbond: not for use
minEmbed: ("minEmbed", value) |integer
minRing: ("maxRing", value) |integer
minimalSupport: ("minimalSupport", value) |double
mode: not for use
mrgat: not for use
mrgbd: not for use
ringExtension: ("ringExtension", "none"/"full"/"merge"/"filter") |"String"
seed: ("seed", "Atom") |"String"
split: ("split", true/false) |boolean
threshold: ("threshold", value) |double
unembedSibling: ("unembedSibling", false/true) |boolean
Will immediately start working on the manager.
I figure that it would be nice to have one method that sets the parameters, in this case createParameters(). The first input specifies what you want to set and the second argument provides the value. The arguments is handled by the following method,
public String createParameters(String propertyName, Object value) throws Exception{
if(value.getClass().equals(Double.class)){
value= ((Double) value).intValue();
int values = (Integer) value;
mossbean.setParameters(mossbean, propertyName, values);
}else{
mossbean.setParameters(mossbean, propertyName, value);
}
return value +" is set to " +propertyName;
}
When trying out moss myself I got irritated that I forgot the values of my parameters hence the method parameterValues() was created. It returns the current values of all parameters:
> moss.parameterValues()
aromatic:
canonic: true
canonicEquiv: false
carbonChainLength:
class: class net.bioclipse.moss.business.backbone.MossBean
closed: true
exNode: H
exSeed:
extPrune:
ignoreAtomTypes:
ignoreBond:
kekule:
limits: 0.0
matchAromaticityAtoms:
matchChargeOfAtoms:
maxEmbMemory: 0
maxEmbed: 0
maxRing: 0
maximalSupport: 0.02
minEmbed: 0
minRing: 0
minimalSupport: 0.1
ringExtension: none
seed:
split: false
threshold: 0.5
unembedSibling: false
I will also create a method that restores the values to default since it is valuable to the end-user.
I can't figure out though how to return an arraylist in a smooth way. I returned it as a String, this is how I've done it
public String parameterValues() throws Exception{
ArrayList
String info="";
String names;
for(int i=0; i
info= info + names +": " + mossbean.getProperty(mossbean, names) + " \n";
}
return info;
If you know something better, please tell!
Mostly polishing left when it comes to Moss but (perhaps) bigger mask combination parts to, it depends on the outcome of my Moss tests(which I will do when it's not Friday afternoon and I have a sharp mind).
Next week main focus is to develop SPARQL queries again!