[tracker-miners/wip/carlosg/extractor-additional-files: 1/2] libtracker-miner: Be more specific in tracker-extract remaining files query




commit 4bfe4a56457d453cda3cd02f2d6531cbc7c979d5
Author: Carlos Garnacho <carlosg gnome org>
Date:   Sat Oct 30 15:02:53 2021 +0200

    libtracker-miner: Be more specific in tracker-extract remaining files query
    
    Currently, some extractors (mainly, disc-generic for cue files) link their
    nie:InformationElement to more than one nfo:FileDataObject (in disc-generic
    case, bin/raw/img/etc files pointed by the cue file being extracted).
    
    This has the unintended side effect of adding the corresponding
    nfo:FileDataObject in the corresponding metadata graph, which is seen in
    the future by tracker-extract-3 as a file that is missing extraction as
    it lacks the tracker:extractorHash property.
    
    From there it becomes a little bit awkward, with tracker-extract-3
    attempting (and sort of succeeding) in extracting these files despite
    no extractor existing for them, just to fail with inconsistent SPARQL:
    
        Subject `file:///...' is not in domain `nie:DataObject' of property `nie:interpretedAs'
    
    Be more specific in the query performed by tracker-extract-3 to find
    out the files missing extraction, in order to skip these files introduced
    in the graph just for cross-referencing purposes. Ensuring there is a
    nfo:fileName has somewhat better guarantees that we are dealing with tasks
    left by tracker-miner-fs-3.

 src/libtracker-miner/tracker-decorator.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/src/libtracker-miner/tracker-decorator.c b/src/libtracker-miner/tracker-decorator.c
index 5b83490d8..f3f298c04 100644
--- a/src/libtracker-miner/tracker-decorator.c
+++ b/src/libtracker-miner/tracker-decorator.c
@@ -551,7 +551,7 @@ append_graph_patterns (TrackerDecorator *decorator,
                        g_string_append (query, "UNION ");
 
                g_string_append_printf (query,
-                                       "{ GRAPH %s { ?urn a nfo:FileDataObject } } ",
+                                       "{ GRAPH %s { ?urn a nfo:FileDataObject ; nfo:fileName [] } } ",
                                        graphs[i]);
                first = FALSE;
        }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]