Queries
this issue is dedicated to how we represent queries, for both humans and machines to understand.
previous discsusions:
- https://github.com/valueflows/agent/issues/5
- https://github.com/valueflows/agent/pull/37#issuecomment-147740739
extracting my favorite parts:
@simontegg: Holodex is data-centric, meaning that it works with an underlying unified dataset of people, groups and relationships. This makes Holodex distinct from applications like metamaps and kumu where users compose maps directly, but a person on one map is not linked to the same person in another map. When the user adds public data to Holodex they add to the Global General Graph ( a data commons )
We assume that since the entire dataset (the Graph) will be very large this makes viewing and navigating the all of the people groups and relationship in a single view overwhelming and infeasible.
The first solution we came upon was to make the general navigation of the graph constrained to a single agent at a time (the
contextAgent
)We assume that a further solution to the above problem is for the user to query, view and combine particular slices of the Graph,
queries
, depending on what they're interested in. Graph queries (that I'm familiar with) have two attributes that make for a good potential solution, technically, and usability-wise:
- a human readable description
- routine to implement with a graph database
Graph queries can take the form of a known entity, a known relationship, and an unknown set of entities - "People [unknown set of entities] who live in [known relationship] Wellington [known entity].
[they might also be two known entities and an unknown set of relationships "Relationships that connect Simon and Wellington"]
a
queryLabel
then is a natural language description of a query. Because queries are constructed on the fly by users we can't hardcode all possible queryLabels, but because we're largely dealing with people and groups it seems feasible to generate them from templates. In English generally something like: [agentType :plural] -- that [relationship :verb] -- [entity] - (known), or [agentType :plural] -- that -- [entity] - (known) -- [relationship :verb]"People who steward Simon" "Groups that Mikey belongs to"
By using these labels in an autocomplete feature I assume that this will be a usable way for performing graph queries (see FB). Once executed they provide a clear description of what the user is viewing.
I was imagining that when users create a new relationship they would be prompted to compose a description of Agents that perform the relationship or have the relationship performed on them.
@ahdinosaur: another piece worth mentioning is composability, as queries must inherently compose. currently we only compose the graph routines as distinctly separate objects, and don't even try to compose the human descriptions, which seems to work just fine. on this topic, my current train of thinking is how levelgraph does composable querying.
@elf-pavlik: For queries like
label: 'People who steward {target}'
I recommend checking outOr for simple traversals, my collection proposal based on ldp:DirectContainer and brainstorming in Hydra group