Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[higgins-dev] Data type issue with JNDI CP

Hi,

I have written the following sample IdAS code to get the OWL data type for
a generalizedTime type attribute 'createTimeStamp' and ran it against the
JNDI CP.

java.util.List attrList = new java.util.ArrayList();
attrList.add(new java.net.URI(
"http://www.eclipse.org/higgins/ontologies/2006/higgins/ldap#attr_createTimeStamp";
));

IEntity person = context.getEntity("uid=riyer,o=Higgins",
attrList.iterator());
IAttribute property = (IAttribute)person.getAttribute(new java.net.URI(
"http://www.eclipse.org/higgins/ontologies/2006/higgins/ldap#attr_createTimeStamp";
));
Iterator valItr = property.getValues();
while ( valItr.hasNext() ) {
      IAttributeValue propVal = (IAttributeValue)valItr.next();
      if (propVal.isSimple()) {
            ISimpleAttrValue simpleAttrValue = (ISimpleAttrValue) propVal;
            java.net.URI valType = simpleAttrValue.getValueType();
            System.out.println(valType.toString());
      }
}

The output data type for the 'createTimeStamp' attribute is
http://www.w3.org/2001/XMLSchema#string. Should it not be the XML dateTime
data type?

Further investigation showed that the getAttribute(URI consumerAttrName) in
JNDIEntity,java has code like -

Object jndiValue = jndiAttrValEnum.next();
if (jndiValue instanceof String) {
      attr.addSimpleValue(ISimpleAttrValue.STRING_TYPE_URI, (String)
jndiValue);
}

Shouldn't the check here be for the data type of the LDAP attribute instead
of the type of value?

Thanks,
Best regards,
Rajalakshmi Iyer






Back to the top