NOODB: Projection Update

When I last wrote, I was planning on working on the property resolver. That didn’t happen. Sleep happened.

This was a busy week. I was in training for the week, so there was a lot of driving. I didn’t have any time left to work on this, but I’ve been thinking about it as time permits.

I was pondering the most elegant and efficient way of dealing with the projections. Every time I thought I had it, I’d keep thinking about it, and come up with a scenario where it wouldn’t work.

Tonight, I was finally able to sit down and work on it while watching SGU, and a variety of other shows. The fields aren’t being passed to the data object yet, but everything is being properly parsed and it knows what needs to be retrieved.

The following is output of test code. The test code runs the parser against a query, then converts the select output to text.

As previously described, .** means select everything from the current object and all of it’s children. .* means just select the simple properties from the current object. The rules are applied left to right.

Notice that when you include a property, it includes all of its ascendant properties. That’s so there aren’t any gaps in the graph as we retrieve and reconstruct the various parts.

from p in QpBlah select p.**, -p.Author.Address.**, p.Author.Address.State.Abbreviation
include: Root2
include: Author
     include: Name
     include: Address
          include: State
               include: Abbreviation
               exclude: Name
          exclude: Street
          exclude: City
include: Root1


from p in QpBlah select p.Author.Address.State.Abbreviation
exclude: Root2
include: Author
     exclude: Name
     include: Address
          include: State
               include: Abbreviation
               exclude: Name
          exclude: Street
          exclude: City
exclude: Root1


from p in QpBlah select p.Root1
exclude: Root2
exclude: Author
     exclude: Name
     exclude: Address
          exclude: State
               exclude: Abbreviation
               exclude: Name
          exclude: Street
          exclude: City
include: Root1


from p in QpBlah select p.Author.Address.State.**
exclude: Root2
include: Author
     exclude: Name
     include: Address
          include: State
               include: Abbreviation
               include: Name
          exclude: Street
          exclude: City
exclude: Root1


from p in QpBlah select p.Author.Address.State.Abbreviation
exclude: Root2
include: Author
     exclude: Name
     include: Address
          include: State
               include: Abbreviation
               exclude: Name
          exclude: Street
          exclude: City
exclude: Root1


from p in QpBlah select p.Author.Address.State.**, -p.author.address.state.abbreviation
exclude: Root2
exclude: Author
     exclude: Name
     exclude: Address
          include: State
               exclude: Abbreviation
               include: Name
          exclude: Street
          exclude: City
exclude: Root1


from p in QpBlah select p.Author.**, -p.author.address.state.**, p.Root1, -p.author.address.**
exclude: Root2
include: Author
     include: Name
     exclude: Address
          exclude: State
               exclude: Abbreviation
               exclude: Name
          exclude: Street
          exclude: City
include: Root1


from p in QpBlah select p.**, -p.author.address.**, p.author.address.state.**
include: Root2
include: Author
     include: Name
     include: Address
          include: State
               include: Abbreviation
               include: Name
          exclude: Street
          exclude: City
include: Root1



In conclusion, this is a big piece, and I’m glad it’s done. Next, I have to plug it into the server and the db parts. I already set that all up, but may have to change it since the resolver has evolved so much. Maybe tomorrow.

Getting close…

Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: