On Fri, Jul 5, 2013 at 1:06 PM, David Rocamora <[email protected]> wrote:

>
> I'm trying to use featurec to describe some relationships within a nested
> map. When I try to use it to find some keys in the map it returns nothing.
> Here is an example:
>

I don't believe you can match on the keys in a map - only the values.


One solution I have come up with is to massage the map into a vector like
> this:
>
...
> I would do this if the data I was dealing with was just the colors of
> food, but what I am really trying to do is use core.logic to create
> programs that understand relationships in AWS 
> CloudFormation<http://aws.amazon.com/cloudformation/> templates.
> A CFN template is a JSON file that is a bunch of nested maps that describe
> cloud computing infrastructure. I feel there are risks to massaging the
> templates and featurec feels right. What am I missing? Any guidance is
> appreciated.
>

We do a similar type of JSON matching with core.logic at threatgrid.  The
approach we take (which was developed before core.logic had featurec or any
 map unification capabilities) is walk the JSON (we use zippers to
search/extract) and make observations (
https://github.com/threatgrid/observations) about the data into a pldb
dataset (https://github.com/threatgrid/observations) that our core.logic
programs run against.

Some of the advantages in my mind are:

makes core logic code more robust to data changes (we can change the input
in
allows for simple data type transforms to structures core.logic can work
with better (getting a year from a date, or splitting a string)
allows for structural tranformations into more relational structures

This has worked really well for us, so something in this direction would
probably work for you too if you are going beyond what core.logic has to
offer out of the box.

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to