Skip to content

join two schemas #269

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
micha99 opened this issue Feb 9, 2017 · 3 comments · May be fixed by #691
Open

join two schemas #269

micha99 opened this issue Feb 9, 2017 · 3 comments · May be fixed by #691

Comments

@micha99
Copy link

micha99 commented Feb 9, 2017

First of all: thanks for providing these plugins to the community. I am using both, the struct & bureaucracy plugin, they are great and really appreciated.

What I am looking for is a function to "join" the structured data from different schemas in a simple 1:N manner and it seems with the "lookup dropdown/lookup schema" features it was somehow intended, but I can't see a way to get it working. Maybe I am missing something more general here?

Here a quick example:

Schema "Country": name, president
Page: US, Trump
Page: France, Hollande

Schema "City": name, inhabitants, country(filled via lookup to "Country.name")
Page: Lyon, 500.000, France
Page: Paris, 2.200.000, France
Page: Washington, 650.000, US

Overview/Aggregation page for all Cities:

---- struct table ----
schema: City, Country
cols: City.name, City.inhabitants, Country.name, Country.president
filter: City.country=Country.name

Expected result:
city, inhabitants, country, president
Lyon, 500.000, France, Hollande
Paris, 2.200.000, France, Hollande
Washington, 650.000, US, Trump

I'd love to have such a feature. Cheers.

@juliusverrel
Copy link

this would be extremely useful

@stormlogix
Copy link

This will be THE killer feature for this plugin and Dokuwiki in general.

@juliusverrel
Copy link

@micha99's example could be realized by a feature that might be easier to implement than joining two schemas: accessing different fields of lookup type fields of a given schema.

In his/her example, schema City has a field country of type lookup, referring to schema Country by Country.name. To list also the president's name in the aggregation, this kind of syntax would make sense:

---- struct table ---- 
schema: City
cols: name, inhabitants, country.name, country.president
----

Accessing different fields of lookup types in filters would solve a problem which I need to solve. I have three schemas, linked to each other in the following way:

  • User: list of users
  • Project: field "Members" is of type lookup, referring to one or multiple instances of User (say, by field ID)
  • Event: field "Projects" is of type lookup, referring to one or multiple instances of Project

Listing all events related to projects a particular user with ID XYZ is a member of seems impossible at present, but would be possible with the extension I suggested:

---- struct table ---- 
schema: Event
filter: Projects.Members.ID ~* XYZ
----

Note that Projects.Members.ID would be an expansion of nested lists, i.e., the list of all IDs of members of projects related to a given event.

BTW, if the link between these schemas was different, with users pointing to projects (instead of projects to users), a different filter option would be helpful, "nontrivial overlap" (denoted ~~ below):

---- struct table ---- 
schema: Event
filter: Projects ~~ $STRUCT.User.Projects$
----

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants