These are chat archives for Sensorica/valuenetwork

15th
Jan 2016
Bob Haugen
@bhaugen
Jan 15 2016 00:36
P.S. User is complicated...
Chris Troutner
@christroutner
Jan 15 2016 01:22
I was thinking I might start with People. I noticed that Projects are a child of People. Do they exist in a separate area too or are they just children?
Bob Haugen
@bhaugen
Jan 15 2016 11:20
I'll start wih People today, although we got a lot of errands and guests today, so I might not get finished.
Projects are not children of People. People may be affiliated with Projects, and/or contribute to Projects.
I put them on the People API because I thought I understood that as a request.
I'll write up something about all of the relationships that different objects have to one another, so you can get some idea of what is available.
Projects are a type of Context Agent, which you can read about here: https://speakerdeck.com/mikorizal/2-nrp-organization-setup-tutorial?slide=5
Bob Haugen
@bhaugen
Jan 15 2016 11:26
Contexts have their own API, which you can find on the API root.
Bob Haugen
@bhaugen
Jan 15 2016 12:15
I tried an experiment which allows POSTs using the form at the bottom of the People API page.
The missing field was agent_type.
I had been using a DRF serializer field that showed the value of agent_type in the GET, but did not appear in the POST.
I changed it so the GET now shows the api_url of the person's agent_type, which is uglier, but now it appears as a Selector in the POST form, and works. (But feels really hacky...)
I'm not sure where to go with this next. I am just learning DRF as we go, and have no idea whether this will work for POSTs from Backbone.
Bob Haugen
@bhaugen
Jan 15 2016 12:22
You can see the previous treatment of agent_type on the context or allagents APIs. But you can't POST successfully from them yet, because the agent_type doesn't appear in the POST form.
I am aware you will not be using that POST form, so will wait and see what happens from Backbone.
I expect we will need to iterate through this a few times before it gets both workable and nicer.
Oh, and you'll need to resync from the upstream again... :frowning:
Lynn Foster
@fosterlynn
Jan 15 2016 13:39
@christroutner here is a simple UML diagram of the core model: https://github.com/Sensorica/valuenetwork/wiki/Core and scroll down towards the end. Look on the right side of the "NRP Core Model" for agent and agent relationship in the orange box.
To add to that: The Agent Types are user defined, but there is a property there called party_type that will definitively tell you if the agent is a person or an organization or a network. There used to be a property there called is_context so that all agents of a type were considered context agents or not. We recently moved that to EconomicAgent so that it can be defined at the agent level.
Lynn Foster
@fosterlynn
Jan 15 2016 13:45

definitively tell you if the agent is a person or an organization or a network.

more clearly, tell you if any agent of that type is a person etc.

I'd be happy to do a walkthrough of the model some time if that would be helpful. Or maybe just the piece of the model you are working with if you prefer.
Lynn Foster
@fosterlynn
Jan 15 2016 13:51
.... or maybe that would just confuse things? I understand @bhaugen is giving you people and context agents in separate api's, although all of them are EconomicAgents in the model.
Bob Haugen
@bhaugen
Jan 15 2016 14:42
@christroutner - might be useful for you to tell us how you like to learn about data models, object relationships, etc.
This is a complex app with a lot of relationships between the objects. Each object class also corresponds to a database table.
We can do a lot of selection and some simplification in the API, but it will probably help if you understand how things are connected.
Bob Haugen
@bhaugen
Jan 15 2016 15:12
In addition to the wiki page @fosterlynn cited, see also https://github.com/Sensorica/valuenetwork/blob/master/docs/core_model.txt
(Lynn, we shd update that to make sure it is still accurate. That was from Nov 6 2014)
Lynn Foster
@fosterlynn
Jan 15 2016 15:16
One thing about that document is that it is pruned to the data that seemed useful to inter-network operations. So for example, it doesn't have the reference to is_context there at all. (I looked for that because it is one change I remember.)
(It was done as initial input to the vocabulary project.)
Chris Troutner
@christroutner
Jan 15 2016 16:00
Like you @bhaugen , I'm just wading through this materials as we go. That was a good brain dump. I'll look through this stuff this evening and sync the Sensorica branch with the upstream.
Bob Haugen
@bhaugen
Jan 15 2016 18:41
P.S. on the API People POST form, you can't put anything into the projects field. It should be read-only, which I'll figure out how to do once it becomes important.
Bob Haugen
@bhaugen
Jan 15 2016 21:09
People.projects is now read-only.