[OTDev] Are there some sample dataset services available ?

Nina Jeliazkova nina at acad.bg
Fri Feb 19 20:31:13 CET 2010


>
> b) how do I retrieve the value contained in the Feature node in the
> statement :
>
>                 RDFNode value = fv.getProperty(OT.value).getObject();
>                 out.write(String.format("%s=%s\n",
>                         //Feature
>                         fv.getProperty(OT.feature).getObject().toString(),
>                         //Value
>                         value));
>
> Value is a string representation of the node like so
> : Cc1ccc(N=Nc2c(O)ccc3ccccc23)c(c1)N(=O)O^^
> http://www.w3.org/2001/XMLSchema#string
>
> I would like to retrieve the just the value (the smile string ...)
>
>   

    if (value.isLiteral() )
       ((Literal) value).getString();


will return the string value; there are similar functions for other data
types.   But again, use it for data values, not chemical structures. 

Regards,
Nina





More information about the Development mailing list