Bug 284529 - Url translation in filex from uuid to url only happens with the trailing slash
Summary: Url translation in filex from uuid to url only happens with the trailing slash
Status: RESOLVED FIXED
Alias: None
Product: nepomuk
Classification: Miscellaneous
Component: general (show other bugs)
Version: unspecified
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: Sebastian Trueg
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-20 09:21 UTC by Ignacio Serantes
Modified: 2011-10-21 10:23 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 4.7.3


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ignacio Serantes 2011-10-20 09:21:30 UTC
Version:           unspecified (using KDE 4.7.2) 
OS:                Linux

OneTouch4 is an external HD mounted in "/media/OneTouch4".

If you do a SPARQL query for a filex url the query fails if the path don't contains the trailing slash.

This query works:

SELECT ?x0
WHERE { 
  ?x0 nie:url ?url . FILTER(REGEX(?url, "^file:///media/OneTouch4/', 'i')) . 
}

But this not:

SELECT ?x0
WHERE { 
  ?x0 nie:url ?url . FILTER(REGEX(?url, "^file:///media/OneTouch', 'i')) . 
}

And the difference is "^file:///media/OneTouch4/" vs. "^file:///media/OneTouch" in the filter.


Reproducible: Always

Steps to Reproduce:
1) Mount and external HD.
2) Add data to at least one file.
3) Check the example queries.

Actual Results:  
No results if you don't add the trailing slash.

Expected Results:  
Same results as the first query.
Comment 1 Sebastian Trueg 2011-10-20 19:27:41 UTC
Git commit 2408391918db8a9aca554a1a0460ebba6f7fb468 by Sebastian Trueg.
Committed on 20/10/2011 at 20:58.
Pushed by trueg into branch 'master'.

Handle parent folders or convertable URLs.

So far we converted URLs which actually exist. Now we also handle
partial URLs like /media/foo if a storage is mounted on /media/foobar.
This is handled by adding additional regex filters to the already
existing one.
BUG: 284529

M  +15   -0    common/removablemediacache.cpp
M  +8    -0    common/removablemediacache.h
M  +73   -7    services/storage/removablemediamodel.cpp
M  +7    -1    services/storage/removablemediamodel.h
M  +39   -1    services/storage/test/removablemediamodeltest.cpp

http://commits.kde.org/nepomuk-core/2408391918db8a9aca554a1a0460ebba6f7fb468
Comment 2 Sebastian Trueg 2011-10-20 19:35:10 UTC
Git commit 12636cf34b7895dee64fbb52f41c3348263aca48 by Sebastian Trueg.
Committed on 20/10/2011 at 21:32.
Pushed by trueg into branch 'master'.

Handle parent folders or convertable URLs.

So far we converted URLs which actually exist. Now we also handle
partial URLs like /media/foo if a storage is mounted on /media/foobar.
This is handled by adding additional regex filters to the already
existing one.

BUG: 284529

M  +15   -0    nepomuk/common/removablemediacache.cpp
M  +8    -0    nepomuk/common/removablemediacache.h
M  +73   -7    nepomuk/services/storage/removablemediamodel.cpp
M  +7    -1    nepomuk/services/storage/removablemediamodel.h
M  +39   -1    nepomuk/services/storage/test/removablemediamodeltest.cpp

http://commits.kde.org/kde-runtime/12636cf34b7895dee64fbb52f41c3348263aca48
Comment 3 Sebastian Trueg 2011-10-21 10:23:14 UTC
Git commit 1b66b02ecf6a055159290849c8bf708a7043bd0d by Sebastian Trueg.
Committed on 20/10/2011 at 21:32.
Pushed by trueg into branch 'KDE/4.7'.

Handle parent folders or convertable URLs.

So far we converted URLs which actually exist. Now we also handle
partial URLs like /media/foo if a storage is mounted on /media/foobar.
This is handled by adding additional regex filters to the already
existing one.

BUG: 284529

M  +15   -0    nepomuk/common/removablemediacache.cpp
M  +8    -0    nepomuk/common/removablemediacache.h
M  +73   -7    nepomuk/services/storage/removablemediamodel.cpp
M  +7    -1    nepomuk/services/storage/removablemediamodel.h
M  +39   -1    nepomuk/services/storage/test/removablemediamodeltest.cpp

http://commits.kde.org/kde-runtime/1b66b02ecf6a055159290849c8bf708a7043bd0d