< 282024-03-29⋎30 >

Topic for #farmOS is: farmOS (farmos.org) is a free and open source, web-based farm management system. User guide: farmos.org/guide/ - Forum: farmOS.discourse.groupSet by mstenta on 2021-06-15 at 12:52
00:06symbioquine[m]<mstenta[m]> "symbioquine: I started playing..." <- Very cool. I'll look forward to seeing how you're approaching it!
13:14symbioquine[m]<mstenta[m]> "symbioquine: I started playing..." <- Also, I don't know if you've seen this: github.com/symbioquine/farmOS_wfs/blob/a
13:14symbioquine[m]Might be similar to what you're doing...
13:17mstenta[m]Oh neat!
13:18symbioquine[m]That makes it so when you zoom in QGIS (or similar) can ask for just the assets which will be onscreen
13:18mstenta[m]ah that's nice
13:19symbioquine[m]If you set a minimum zoom level and a few query filters on the layers you can make it so it never issues "get all assets" queries
13:20mstenta[m]this is the basic query i was experimenting with: github.com/mstenta/farmOS/blob/10c10309f
13:20mstenta[m](super simple, just a proof of concept still)
13:20symbioquine[m]i.e. shows the property boundary and landmark assets at any zoom level, but doesn't show beds, plantings, etc until you're zoomed in enough that it will be a subset of the assets.
13:20mstenta[m]that query requires postgis
13:21mstenta[m]but I'm curious if we could do something similar with other dbs
13:21mstenta[m]or postgres w/out postgis
13:22mstenta[m]right now this query takes ANY wkt
13:22mstenta[m]it might make sense to limit it to a point
13:23mstenta[m]if we did that, then we could potentially use the bounding box fields in the db table to do a more rough intersection without any geometry functions
13:23mstenta[m](similar to what you have)
13:23symbioquine[m]Or you can generate a bounding box, query the features, and do a final filter step in PHP
13:24symbioquine[m]To still end up with a strict intersection
13:24mstenta[m]yea perhaps!
13:24mstenta[m]i'd like to wrap this in a Views argument handler, so we can add it to any View as a contextual filter basically
13:25mstenta[m]i'm imagining showing a list of logs filtered by intersecting wkt as a first step
13:25mstenta[m]assets would be easy too
13:25mstenta[m](geometry vs intrinsic_geometry fields in different database tables, so two different Views)
13:26symbioquine[m]Hmmm
13:28symbioquine[m]Couldn't it work like the [AssetOrLocationArgument](github.com/farmOS/farmOS/blob/c9770ca6ca) to do both in the same view?
13:29mstenta[m]Well... one is a query of assets and one is a query of logs
13:30mstenta[m]AssetOrLocationArgument is only used in a query of logs
13:30mstenta[m](logs that reference and asset OR logs that reference a location)
13:30mstenta[m]for this report, we may want "logs that have a geometry that intersects this point" and "assets that have an intrinsic geometry that intersects this point"
13:31mstenta[m]SELECT * FROM log vs SELECT * FROM asset
13:31mstenta[m]But that won't be too hard... we can just embed two views in the report
13:31mstenta[m]Or provide a radio button to select which you want
13:32mstenta[m]Still thinking through how it should work from a UX perspective :-)
13:32symbioquine[m]I thought you were saying that it fixed assets and non-fixed assets wouldn't be query-able (by geometry intersection) in the same view
13:32mstenta[m]Another thing on my mind: query performance, do we need to add a geometry index, etc
13:32symbioquine[m]s/it//
13:32mstenta[m]Oh maybe I misunderstood
13:33mstenta[m]Right... I do think we would need to limit to fixed assets for the asset view
13:34mstenta[m]Although might be able to do a sub-select to get each asset's most recent movement log geometry... but that gets hairy. probably easier to start simple.
13:35symbioquine[m]mstenta[m]: I think that's what I'm doing here: github.com/symbioquine/farmOS_wfs/blob/a
13:36mstenta[m]oh cool - maybe we could reuse that
13:37symbioquine[m]Agree on starting simple though as long as the UX makes sense and it doesn't preclude doing the more complete implementation later.
13:37mstenta[m]i've been burned by complicated queries (and specifically cross-db-comaptibility) in the past so i tend to avoid thinking about things like this haha
14:49*OctavioMartnDuarte[m] has joined
14:49OctavioMartnDuarte[m]Hello! I'm having an issue with the new JSON schema for boolean stuff, I though I could get some help from mstenta or paul121 .
14:49OctavioMartnDuarte[m]OctavioMartnDuarte[m]: The new schema sets the type as "boolean", but it has a custom definition asking for 0/1 values.
14:49mstenta[m]Sure Octavio Martín Duarte what's up?
14:50OctavioMartnDuarte[m]OctavioMartnDuarte[m]: This seems to contradict the official definition in the JSON schema documentation.
14:50OctavioMartnDuarte[m]json-schema.org/understanding-json-schem
14:50OctavioMartnDuarte[m]OctavioMartnDuarte[m]: Which asks for either "true" or "false" as values.
14:50mstenta[m]OctavioMartnDuarte[m]: Ah I see
14:50OctavioMartnDuarte[m]mstenta[m]: The result of this is I get a schema that has 0 possible valid entries.
14:50mstenta[m]OctavioMartnDuarte[m]: I think I know why that would happen
14:51mstenta[m]mstenta[m]: I need to refresh on where that code is...
14:51mstenta[m]mstenta[m]: But I bet it is just simply showing the allowed values of the database *internally*
14:51mstenta[m]mstenta[m]: which is 0 or 1
14:51mstenta[m]mstenta[m]: And not translating it to what JSON would expect
14:51OctavioMartnDuarte[m]mstenta[m]: That could make sense.
14:52mstenta[m]OctavioMartnDuarte[m]: In all other cases, that's how it works, so I wouldn't be surprised (just showing internal allowed values and not translating)
14:52OctavioMartnDuarte[m]mstenta[m]: But the JSON schema, as written (unless as it tends to happen I'm making a mistake), is contradictory.
14:52mstenta[m]OctavioMartnDuarte[m]: I imagine it would require some special logic for that translation
14:52mstenta[m]mstenta[m]: Right, it should say `true` and `false` as allowed values you mean?
14:53OctavioMartnDuarte[m]mstenta[m]: It could either only read `type: boolean` , which implies `true`/`false` or (exclusive or, xor) have the `oneOf` asking for either 0 or 1.
14:53OctavioMartnDuarte[m]OctavioMartnDuarte[m]: As I get it, at least. Perhaps I'm getting it wron.
14:53OctavioMartnDuarte[m]OctavioMartnDuarte[m]: *g
14:54mstenta[m]OctavioMartnDuarte[m]: OK good to know
14:54mstenta[m]mstenta[m]: Let's see... who is the developer to blame for this code....
14:54mstenta[m]mstenta[m]: Oh right. It's me. 😅
14:54mstenta[m]mstenta[m]: www.drupal.org/project/jsonapi_schema/is
14:54mstenta[m]mstenta[m]: I will have to modify that merge request to include special logic for boolean fields
14:55OctavioMartnDuarte[m]mstenta[m]: I can have a special version just on our end and downstream from us.
14:55mstenta[m]OctavioMartnDuarte[m]: And then we will have to update the patch that is applied in farmOS
14:55OctavioMartnDuarte[m]mstenta[m]: but if I'm getting it properly, it might be worth fixing on your end.
14:55mstenta[m]OctavioMartnDuarte[m]: Which means this won't be fixed until the next release of farmOS at the earliest
14:55mstenta[m]mstenta[m]: So if you are able to work around it yourself in the meantime, that might be worth doing
14:55mstenta[m]mstenta[m]: But I will definitely get this fixed upstream too
14:55OctavioMartnDuarte[m]mstenta[m]: Ok. We can keep working, we have the exact feature we need, which replaces the schema for a certain field across the whole schemata set.
14:56OctavioMartnDuarte[m]OctavioMartnDuarte[m]: Great, thanks a lot.
14:56OctavioMartnDuarte[m]OctavioMartnDuarte[m]: I'll check it a little more, but the documentation from their site seems to back my interpretation.
14:56OctavioMartnDuarte[m]OctavioMartnDuarte[m]: gbathree: this thread might be of your interest.
14:57mstenta[m]OctavioMartnDuarte[m]: > It could either only read type: boolean , which implies true/false or (exclusive or, xor) have the oneOf asking for either 0 or 1.
14:57mstenta[m]Which one do you think I should aim for?
14:57mstenta[m]mstenta[m]: Is one "more correct"?
14:58mstenta[m]mstenta[m]: The first option might be easier (omit `oneOf`)
14:59OctavioMartnDuarte[m]mstenta[m]: Yes, I'm partial towards just having `type: boolean` . It is cleaner and more intuitive.
14:59OctavioMartnDuarte[m]But you might have special requierements.
14:59OctavioMartnDuarte[m]I can propose several examples and attach valid and rejected entries for each one, if that's useful.
15:00mstenta[m]OctavioMartnDuarte[m]: I'll try for that first.
15:05OctavioMartnDuarte[m]mstenta[m]: Let me know if I can help in any way.
15:08mstenta[m]OctavioMartnDuarte[m]: Thanks for bringing it to my attention!
15:10OctavioMartnDuarte[m]mstenta[m]: Thanks for answering so fast!
16:58*jsoons[m] has quit (Quit: Client limit exceeded: 20000)
17:33mstenta[m]<OctavioMartnDuarte[m]> "Thanks for answering so fast!..." <- Updated the `jsonapi_schema` module patch: www.drupal.org/project/jsonapi_schema/is
17:33mstenta[m]mstenta[m]: I'll open a farmOS PR to use the new patch next.
17:39OctavioMartnDuarte[m]<mstenta[m]> "I'll open a farmOS PR to use the..." <- Awesome. Thanks.
17:39mstenta[m]<mstenta[m]> "I'll open a farmOS PR to use the..." <- github.com/farmOS/farmOS/pull/819
18:40mstenta[m]symbioquine: we discussed the "ontology uri" ideas again on the dev call yesterday, and I think we're going to settle on `external_uri`. That seems to be where the most consensus is. If you have any strong opinions otherwise feel free to chime in on the issue! Otherwise I think we'll end up with that. :-)
18:41mstenta[m]We got input from a few others on the call including @julietnpn:matrix.org and jgaehring
18:42mstenta[m]jgaehring actually suggested "definition uri" also :-)
18:42mstenta[m]after some discussion it felt like everyone was satisfied with "external uri"
18:43mstenta[m]another point that was made is that this still leaves open the possibility to add more specific field(s) in the future... such as a structured ontology reference field that has sub-values for data type etc
18:45mstenta[m]the last remaining bit is adding uri validation
20:42shplorf[m]<shplorf[m]> "Makes sense, thanks for the..." <- OK, so I got my backup/restore process working.... (full message at <matrix.org/_matrix/media/v3/download/mat>)
20:48shplorf[m]<shplorf[m]> "OK, so I got my backup/restore..." <- I realize now that the cron.daily script won't actually be run in a container so I'll just mount it to `local/bin` like the restore script and have an external cron job run it.
20:49shplorf[m]s/`/`/usr//
20:52*posted a file: (44KiB) < matrix.org/_matrix/media/v3/download/mat >
20:53shplorf[m]shplorf[m]: ^ Here's the output of my DB restore command, it has a bunch of errors like
20:53shplorf[m]> ERROR: table "asset__is_castrated" does not exist
20:53shplorf[m]Is this expected?
20:53mstenta[m]update: uri validation is done, PR is ready for final review
20:53shplorf[m] * ^ Here's the output of my DB restore command, it has a bunch of errors like
20:53shplorf[m]> ERROR: table "asset\_\_is\_castrated" does not exist
20:53shplorf[m]Is this expected?
20:53mstenta[m]shplorf[m]: no that means it didn't work i think
20:53shplorf[m] * ^ Here's the output of my DB restore command, it has a bunch of errors like
20:53shplorf[m]> ERROR: table "asset\_\_is\_castrated" does not exist
20:53shplorf[m]Is this expected?
20:53mstenta[m]mstenta[m]: sorry can't review in detail right now, and i'll probably forget about this thread 😅
20:53mstenta[m]mstenta[m]: might be worth a forum topic?
20:54mstenta[m]mstenta[m]: > Are there any issues with doing this while FarmOS is running?
20:54mstenta[m]Don't think so. If you want to be extra safe, Drupal has a "maintenance mode" which would prevent users from making any changes
20:54mstenta[m]mstenta[m]: So you could toggle that on/off if you want
20:54mstenta[m]mstenta[m]: drupal.stackexchange.com/questions/10077
20:57shplorf[m]mstenta[m]: OK, I can write it up in the forum. Def no expectation of any sort of timely responses here or there.... (full message at <matrix.org/_matrix/media/v3/download/mat>)
20:57mstenta[m]shplorf[m]: > ERROR: table "asset__is_castrated" does not exist
20:57mstenta[m]this would worry me
21:00shplorf[m]mstenta[m]: When I enter the DB credentials initially, where does that get saved?
21:00mstenta[m]shplorf[m]: `sites/default/settings.php`

< 282024-03-29⋏30 >