OWLSConverters.java revision 2
/*
* Created on Dec 10, 2004
*/
/**
* @author Evren Sirin
*/
public class OWLSConverters {
public static Map getConverters() {
// OWLObjectConverter valueDataConverter =
// new ValueDataConverter();
// added by Michael Daenzer
// end added by Michael Daenzer
// changed by Michael Daenzer
});
// end changed by Michael Daenzer
// added by Michael Daenzer
// end added by Michael Daenzer
// changed by Michael Daenzer
// end changed by Michael Daenzer
new SWRLIndividualConverter();
new SWRLDataValueConverter();
// converters.put(ValueData.class, valueDataConverter);
return converters;
}
public static class GenericOWLSConverter implements OWLObjectConverter {
}
this.individuals = individuals;
try {
} catch(Exception e) {
throw new RuntimeException(e);
}
}
return (object instanceof OWLIndividual) &&
(!OWLConfig.getStrictConversion() ||
}
try {
} catch(Exception e) {
e.printStackTrace();
}
}
}
}
}
public static class CombinedOWLSConverter implements OWLObjectConverter {
this.converters = converters;
}
return true;
}
}
return false;
}
}
}
}
}
}
public static class ListConverter extends GenericOWLSConverter {
this.vocabulary = vocabulary;
}
if(object instanceof OWLIndividual) {
}
return false;
}
throw new ConversionException("Cannot do conversion for object lists!");
}
}
public static class ExpressionConverter implements OWLObjectConverter {
boolean convertToExpression;
// OWLClass specificClass;
// OWLIndividual specificValue;
public ExpressionConverter(boolean convertToExpression) {
if(convertToExpression) {
// specificClass = OWLS.Expression.SWRL_Expression;
}
else {
// specificClass = OWLS.Expression.SWRL_Condition;
}
// specificValue = OWLS.Expression.SWRL;
}
if(object instanceof OWLIndividual) {
if(!OWLConfig.getStrictConversion())
return true;
return true;
if(convertToExpression) {
}
else {
}
// if(ind.equals(OWLS.Expression.AlwaysTrue))
// ind.isType(specificClass) ||
// (ind.isType(owlClass) && ind.hasProperty(OWLS.Expression.expressionLanguage, specificValue)))
// return true;
}
return false;
}
try {
else
} catch(Exception e) {
e.printStackTrace();
}
}
}
}
public static class SWRLIndividualConverter implements OWLObjectConverter {
return (object instanceof OWLIndividual);
}
throw new ConversionException("OWLObject " + object + " cannot be converted to " + SWRLIndividualObject.class);
}
throw new NotImplementedException();
}
}
public static class SWRLDataValueConverter implements OWLObjectConverter {
public SWRLDataValueConverter() {
}
return (object instanceof OWLDataValue);
}
}
throw new NotImplementedException();
}
}
// public static class ValueDataConverter implements OWLObjectConverter {
// public ValueDataConverter() {
// }
//
// public boolean canCast(OWLObject object) {
// return (object instanceof OWLDataValue);
// }
//
// public OWLObject cast(OWLObject object) {
// if(!canCast(object))
// throw new ConversionException("OWLObject " + object + " cannot be converted to ValueData");
//
// OWLDataValue literal = (OWLDataValue) object;
// OWLOntology test = OWLFactory.createKB().parseLiteral(literal.getLexicalValue(), null);
// OWLValue value = test.findTheIndividual(OWL.Thing);
// if(value == null)
// value = literal;
//
// return new ValueDataImpl(value);
// }
//
// public OWLObject convert(OWLObject object) {
// if(canCast(object))
// cast(object);
//
// throw new NotImplementedException();
// }
// }
}