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

most_likely_tagsets should return classes, not strings #76

Open
epaulson opened this issue Oct 20, 2021 · 0 comments
Open

most_likely_tagsets should return classes, not strings #76

epaulson opened this issue Oct 20, 2021 · 0 comments

Comments

@epaulson
Copy link
Contributor

It'd be nice if the most_likely_tagset call returned actual RDFlib objects instead of just a list of strings so we could figure out the classes involved, (though maybe it's easy to go from the strings to classes?)

The use case is in the recon API, after we predict the class for a query, in the protocol response we need to set an extra 'type' field. (For our use case, that's a bit redundant since we're actually predicting a type, but the protocol specs it, because there are other use cases where it's matching actual entities so an additional type field is useful in the response.) And because it doesn't usually matter, for type we just put back in whatever type the client asked to reconcile against, e.g. 'EquipmentClass', 'PointClass', or 'BrickClass', and default to BrickClass. Because we just get back a string like "Air_Flow_Pressure_Sensor" we can't do anything better, like look up the superclass of 'Air_Flow_Pressure_Sensor' and return that.

The bummer here is that OpenRefine doesn't actually use 'manifest' of possible types to decide what types to display to the user to reconcile against - OpenRefine, even before you officially start 'reconciling', just sends over a sample of a couple of rows to the server to see what types it gets back, and presents them as the list of possible types. This is wrong and a bug in OpenRefine - but it hurts Brick specifically, because obviously OpenRefine is sending these 'prequery' queries without specifying a type, which in our implementation means we reply back saying they're of type 'BrickClass', and hence the only possible type option OpenRefine displays for the real reconciliation process is 'BrickClass'.

Hopefully OpenRefine will fix its limitation and look at the manifest instead of trying to sample what types are possible, but one thing we could do is look at the type we predict and figure out its superclass.

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

1 participant