Hmm I thought I had to do some special handlings for Expression.NIL to cater
for polymorphism. Didn't think it'd work for normal sourceExpression, I
can't remember what I did but maybe it was already working.. anyway that's
good :D. I used Expression.NIL because the ECQL parser in app-schema can't
handle NULL values (as you already know). 


Tara Athan-2 wrote:
> 
> 
> 
> 
>   
> 
> 
> This works- the property is omitted for the  appropriate cases. An
> internet search for Expression.Nil turned up this link: 
> http://docs.geoserver.org/trunk/en/user/data/app-schema/polymorphism.html#null-or-missing-value
>  
> 
> with example:
> 
>   if_then_else(isNull(VALUE), Expression.NIL, 'gsml:CGI_TermValue') 
>   
> 
> 
> So, it looks like this IS documented in the manual on trunk. 
> 
> Thanks, Tara 
> 
> Ben Caradoc-Davies wrote:
> Try:
>   
>   
> <OCQL>if_then_else(equalTo(CAT_DESC, 'No Name'), Expression.Nil,
> CAT_DESC)</OCQL>
>   
>   
> I found this in Rini's polymorphism.xml (used in PolymorphismWfsTest,
> in the feature with id=f4) but I have no idea how she found it! If it
> works, we should document it.
>   
>   
> xs:nillable means that an element with a non-empty content model (e.g.
> at least one property with minOccurs>=1) can be encoded empty but
> with am xs:nil="true" attribute. We do not support this. All the
> schemas we use instead have properties that can be omitted, a content
> model that can be empty, or a community profile to use a xlink:href to
> a special URI to represent a missing value. The if_then_else above
> should let you skip an optional property.
>   
>   
> Kind regards,
>   
> Ben.
>   
>   
>   
> On 21/09/10 22:55, Tara Athan wrote:
>   
>   Thanks for all these links. I have almost
> managed to get the syntax I am looking for. I am still stuck on setting
> a field to NULL.
>     
> This expression parses
>     
> <OCQL>if_then_else(equalTo(CAT_DESC, 'No Name'), 'NULL',
> CAT_DESC)</OCQL>
>     
>     
> This does not
>     
> <OCQL>if_then_else(equalTo(CAT_DESC, 'No Name'), NULL,
> CAT_DESC)</OCQL>
>     
>     
> Am I approaching this wrong?
>     
>     
> As I understand it, "nillable" in GML means the element may be missing.
> Is there some other way to cause  an element to be conditionally
> omitted?
>     
>     
> Tara
>     
>   
>   
> 
> 
> 
> -- 
> Tara Athan
> Owner, Athan Ecological Reconciliation Services
> tara_athan at alt2is.com
> 707-272-2115 (cell, preferred)
> 707-485-1198 (office)
> 249 W. Gobbi St. #A
> Ukiah, CA 95482 
> 
> 
> 
> 
> ------------------------------------------------------------------------------
> Start uncovering the many advantages of virtual appliances
> and start using them to simplify application deployment and
> accelerate your shift to cloud computing.
> http://p.sf.net/sfu/novell-sfdev2dev
> _______________________________________________
> Geoserver-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/geoserver-users
> 
> 

-- 
View this message in context: 
http://old.nabble.com/ECQL-for-app-schema--reference--tp29765536p29777361.html
Sent from the GeoServer - User mailing list archive at Nabble.com.


------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
Geoserver-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Reply via email to