After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 770658 - gdata: Too many nfo:Equipment objects are needlessly created
gdata: Too many nfo:Equipment objects are needlessly created
Status: RESOLVED FIXED
Product: gnome-online-miners
Classification: Applications
Component: general
3.20.x
Other All
: Normal normal
: ---
Assigned To: GNOME Online Miners maintainer(s)
GNOME Online Miners maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2016-08-31 16:39 UTC by Debarshi Ray
Modified: 2016-09-02 08:23 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gdata: Don't create a separate nfo:Equipment for each photo (5.96 KB, patch)
2016-08-31 16:41 UTC, Debarshi Ray
committed Details | Review

Description Debarshi Ray 2016-08-31 16:39:28 UTC
The nfo:Equipment handling code is a bit broken at the moment. It uses gom_tracker_sparql_connection_ensure_resource to check if a there is a nfo:Equipment with a nao:identifier matching the nmm:Photo's URN. Then it proceeds to create a separate nfo:Equipment for each photo that has camera information attached to it.

This is wasteful. Instead we should do something similar to gom_tracker_utils_ensure_contact_resource and use the same strategy that Tracker uses to assign fixed URNs (urn:equipment:<make>:<model>:) to each nfo:Equipment.
Comment 1 Debarshi Ray 2016-08-31 16:41:26 UTC
Created attachment 334543 [details] [review]
gdata: Don't create a separate nfo:Equipment for each photo
Comment 2 Debarshi Ray 2016-08-31 16:44:56 UTC
(In reply to Debarshi Ray from comment #0)
> Instead we should do something similar to
> gom_tracker_utils_ensure_contact_resource and use the same strategy that
> Tracker uses to assign fixed URNs (urn:equipment:<make>:<model>:) to each
> nfo:Equipment.

Note that Tracker's behaviour has subtly changed recently (see bug 767472). Now it uses 'urn:equipment:<make>:<model>' (without the trailing colon) as the fixed URN for nfo:Equipments. Maybe we should fix Tracker, maybe we should just use the new scheme? Or we can query both formats before creating a new nfo:Equipment.
Comment 3 Debarshi Ray 2016-09-02 08:23:21 UTC
(In reply to Debarshi Ray from comment #2)
> Note that Tracker's behaviour has subtly changed recently (see bug 767472).
> Now it uses 'urn:equipment:<make>:<model>' (without the trailing colon) as
> the fixed URN for nfo:Equipments. Maybe we should fix Tracker, maybe we
> should just use the new scheme? Or we can query both formats before creating
> a new nfo:Equipment.

We decided to fix Tracker to restore the old behaviour.
Comment 4 Debarshi Ray 2016-09-02 08:23:58 UTC
I have pushed this patch so that I can release 3.20.1. Let me know if I missed anything.