use of org.semanticweb.owlapi.model.OWLLiteral in project stanbol by apache.
the class GreaterEqualThanAtom method getOWLTypedLiteral.
private OWLLiteral getOWLTypedLiteral(Object argument) {
OWLDataFactory factory = OWLManager.createOWLOntologyManager().getOWLDataFactory();
OWLLiteral owlLiteral;
if (argument instanceof String) {
owlLiteral = factory.getOWLTypedLiteral((String) argument);
} else if (argument instanceof Integer) {
owlLiteral = factory.getOWLTypedLiteral(((Integer) argument).intValue());
} else if (argument instanceof Double) {
owlLiteral = factory.getOWLTypedLiteral(((Double) argument).doubleValue());
} else if (argument instanceof Float) {
owlLiteral = factory.getOWLTypedLiteral(((Float) argument).floatValue());
} else if (argument instanceof Boolean) {
owlLiteral = factory.getOWLTypedLiteral(((Boolean) argument).booleanValue());
} else {
owlLiteral = factory.getOWLStringLiteral(argument.toString());
}
return owlLiteral;
}
use of org.semanticweb.owlapi.model.OWLLiteral in project stanbol by apache.
the class GreaterThanAtom method getOWLTypedLiteral.
private OWLLiteral getOWLTypedLiteral(Object argument) {
OWLDataFactory factory = OWLManager.createOWLOntologyManager().getOWLDataFactory();
OWLLiteral owlLiteral;
if (argument instanceof String) {
owlLiteral = factory.getOWLTypedLiteral((String) argument);
} else if (argument instanceof Integer) {
owlLiteral = factory.getOWLTypedLiteral(((Integer) argument).intValue());
} else if (argument instanceof Double) {
owlLiteral = factory.getOWLTypedLiteral(((Double) argument).doubleValue());
} else if (argument instanceof Float) {
owlLiteral = factory.getOWLTypedLiteral(((Float) argument).floatValue());
} else if (argument instanceof Boolean) {
owlLiteral = factory.getOWLTypedLiteral(((Boolean) argument).booleanValue());
} else {
owlLiteral = factory.getOWLStringLiteral(argument.toString());
}
return owlLiteral;
}
use of org.semanticweb.owlapi.model.OWLLiteral in project stanbol by apache.
the class LessEqualThanAtom method getOWLTypedLiteral.
private OWLLiteral getOWLTypedLiteral(Object argument) {
OWLDataFactory factory = OWLManager.createOWLOntologyManager().getOWLDataFactory();
OWLLiteral owlLiteral;
if (argument instanceof String) {
owlLiteral = factory.getOWLTypedLiteral((String) argument);
} else if (argument instanceof Integer) {
owlLiteral = factory.getOWLTypedLiteral(((Integer) argument).intValue());
} else if (argument instanceof Double) {
owlLiteral = factory.getOWLTypedLiteral(((Double) argument).doubleValue());
} else if (argument instanceof Float) {
owlLiteral = factory.getOWLTypedLiteral(((Float) argument).floatValue());
} else if (argument instanceof Boolean) {
owlLiteral = factory.getOWLTypedLiteral(((Boolean) argument).booleanValue());
} else {
owlLiteral = factory.getOWLStringLiteral(argument.toString());
}
return owlLiteral;
}
use of org.semanticweb.owlapi.model.OWLLiteral in project stanbol by apache.
the class LessThanAtom method getOWLTypedLiteral.
private OWLLiteral getOWLTypedLiteral(Object argument) {
OWLDataFactory factory = OWLManager.createOWLOntologyManager().getOWLDataFactory();
OWLLiteral owlLiteral;
if (argument instanceof String) {
owlLiteral = factory.getOWLTypedLiteral((String) argument);
} else if (argument instanceof Integer) {
owlLiteral = factory.getOWLTypedLiteral(((Integer) argument).intValue());
} else if (argument instanceof Double) {
owlLiteral = factory.getOWLTypedLiteral(((Double) argument).doubleValue());
} else if (argument instanceof Float) {
owlLiteral = factory.getOWLTypedLiteral(((Float) argument).floatValue());
} else if (argument instanceof Boolean) {
owlLiteral = factory.getOWLTypedLiteral(((Boolean) argument).booleanValue());
} else {
owlLiteral = factory.getOWLStringLiteral(argument.toString());
}
return owlLiteral;
}
use of org.semanticweb.owlapi.model.OWLLiteral in project stanbol by apache.
the class SWRLLiteralBuilder method getSWRLLiteral.
public static SWRLLiteralArgument getSWRLLiteral(Object argument) {
OWLDataFactory factory = OWLManager.getOWLDataFactory();
OWLLiteral owlLiteral;
if (argument instanceof TypedLiteralAtom) {
TypedLiteralAtom typedLiteralAtom = (TypedLiteralAtom) argument;
URIResource xsdType = typedLiteralAtom.getXsdType();
if (xsdType.getURI().equals(XSD.xboolean)) {
owlLiteral = factory.getOWLLiteral(Boolean.valueOf(argument.toString()).booleanValue());
} else if (xsdType.getURI().equals(XSD.xdouble)) {
owlLiteral = factory.getOWLLiteral(Double.valueOf(argument.toString()).doubleValue());
} else if (xsdType.getURI().equals(XSD.xfloat)) {
owlLiteral = factory.getOWLLiteral(Float.valueOf(argument.toString()).floatValue());
} else if (xsdType.getURI().equals(XSD.xint)) {
owlLiteral = factory.getOWLLiteral(Integer.valueOf(argument.toString()).intValue());
} else {
owlLiteral = factory.getOWLLiteral(argument.toString());
}
} else if (argument instanceof String) {
owlLiteral = factory.getOWLLiteral((String) argument);
} else if (argument instanceof Integer) {
owlLiteral = factory.getOWLLiteral(((Integer) argument).intValue());
} else if (argument instanceof Double) {
owlLiteral = factory.getOWLLiteral(((Double) argument).doubleValue());
} else if (argument instanceof Float) {
owlLiteral = factory.getOWLLiteral(((Float) argument).floatValue());
} else if (argument instanceof Boolean) {
owlLiteral = factory.getOWLLiteral(((Boolean) argument).booleanValue());
} else {
owlLiteral = factory.getOWLLiteral(argument.toString());
}
return factory.getSWRLLiteralArgument(owlLiteral);
}
Aggregations