Skip to content
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

model tagging #313

Open
gregory-marton opened this issue Nov 17, 2015 · 5 comments
Open

model tagging #313

gregory-marton opened this issue Nov 17, 2015 · 5 comments

Comments

@gregory-marton
Copy link
Contributor

Associate model numbers with key-value pairs and allow people to use inner selects on the model table wherever they might have used one or more model numbers, e.g. to analyze for some iterations or to select or simulate.
#15
#48

@riastradh-probcomp
Copy link
Contributor

Why limit to key-value pairs? We have a relational database here -- create a relation with generator/modelno as foreign key.

@gregory-marton
Copy link
Contributor Author

Limits make the associated language design somewhat easier, and one can always expand it later. I'd rather have something working sooner, than something good working later.

@riastradh-probcomp
Copy link
Contributor

What language design is needed?

It is already straightforward to associate a tag or a datum with each model:

create table mytag (
    generator_id integer not null,
    modelno integer not null,
    datum text not null,
    primary key(generator_id, modelno),
    foreign key(generator_id, modelno) references bayesdb_generator_model
)

(Changing the syntax for model sets to support subqueries there is easy -- I don't think that itself requires much in the way of language design.)

@gregory-marton
Copy link
Contributor Author

That's an underlying schema change for each kind of mytag, no? This is fine from python, but from python, it's easy enough to associate the models with dictionaries on the outside and construct queries using them. If one wants to add tags from within BQL, then there should be a syntax for associating a new tag with a model, or a group of models. In your example, effectively the key is the mytag table. In my thought process, the table would be a tags table, and there would be a string key, so that users could easily produce arbitrary key-value pairs. Of course one has to decide about replace vs. append, etc.

@riastradh-probcomp
Copy link
Contributor

Creating tables is something the user of a bdb can do. SQL already has a notion of defining a meaningful relation with references to other relations, adding instances to the relation, specifying the semantics of insertion vs replacement, and so on.

In any case -- can you elaborate, with illustrative examples, on what you want to do with tagging? By 'illustrative' I mean with example syntax in the language to say in a hypothetical formal way what you want to express to solve a specific problem that would be difficult or inconvenient to solve otherwise.

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

No branches or pull requests

3 participants