<br><br><div class="gmail_quote">On Tue, Jul 3, 2012 at 12:15 AM, Sebastian Trüg <span dir="ltr"><<a href="mailto:trueg@kde.org" target="_blank">trueg@kde.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I don't think the pimo code being very complicated. And it is very separate from the rest.<br>
I would not remove it but if you really want to it would be fine with me.<div class="im"><br></div></blockquote><div><br>Hmm. Well, the groundingOccurance and everything isn't watched by the resourcewatcher. So, it has an additional overhead.<br>
<br>For now I'm removing them, once the port to shared memory is done, I might add them again. But I want the flexibility of not having to worry about deprecating them/supporting them forever. Right now, I can still mess with the source compatibility.<br>
<br></div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="im">
<br>
On 07/01/2012 03:08 PM, Vishesh Handa wrote:<br>
</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">
Oh yeah. Also, can we get rid of all the pimo stuff from the Resource class?<br>
<br>
AFAIK, no one really uses any of the pimo features over there and they<br>
really complicate the code base.<br>
<br>
commit 755131d501c687c790c166f8d1ce4d<u></u>1b56550301<br></div>
Author: Vishesh Handa <<a href="mailto:me@vhanda.in" target="_blank">me@vhanda.in</a> <mailto:<a href="mailto:me@vhanda.in" target="_blank">me@vhanda.in</a>>><div><div class="h5"><br>
Date: Sat Jun 30 11:32:09 2012 +0530<br>
<br>
Loose all the pimo related functions<br>
<br>
No one uses them and they complicate the code base. We want this code<br>
base to be as simple as possible.<br>
<br>
diff --git a/libnepomukcore/resource/<u></u>resource.cpp<br>
b/libnepomukcore/resource/<u></u>resource.cpp<br>
index b559f07..c237f44 100644<br>
--- a/libnepomukcore/resource/<u></u>resource.cpp<br>
+++ b/libnepomukcore/resource/<u></u>resource.cpp<br>
@@ -25,7 +25,6 @@<br>
#include "tools.h"<br>
#include "tag.h"<br>
#include "pimo.h"<br>
-#include "thing.h"<br>
#include "file.h"<br>
#include "property.h"<br>
#include "nfo.h"<br>
@@ -283,9 +282,9 @@ QString Nepomuk2::Resource::<u></u>genericLabel() const<br>
if(!label.isEmpty())<br>
return label;<br>
<br>
- label = m_data->pimoThing().label();<br>
- if(!label.isEmpty())<br>
- return label;<br>
+ //label = m_data->pimoThing().label();<br>
+ //if(!label.isEmpty())<br>
+ // return label;<br>
<br>
label = property( Nepomuk2::Vocabulary::NFO::<u></u>fileName() ).toString();<br>
if(!label.isEmpty())<br>
@@ -357,13 +356,6 @@ QString Nepomuk2::Resource::<u></u>genericIcon() const<br>
}<br>
<br>
<br>
-Nepomuk2::Thing Nepomuk2::Resource::pimoThing(<u></u>)<br>
-{<br>
- determineFinalResourceData();<br>
- return m_data->pimoThing();<br>
-}<br>
-<br>
-<br>
bool Nepomuk2::Resource::operator==<u></u>( const Resource& other ) const<br>
{<br>
if( this == &other )<br>
diff --git a/libnepomukcore/resource/<u></u>resource.h<br>
b/libnepomukcore/resource/<u></u>resource.h<br>
index 2edb562..3cc30c2 100644<br>
--- a/libnepomukcore/resource/<u></u>resource.h<br>
+++ b/libnepomukcore/resource/<u></u>resource.h<br>
@@ -35,7 +35,6 @@ namespace Nepomuk2 {<br>
class ResourceData;<br>
class Variant;<br>
class Tag;<br>
- class Thing;<br>
class File;<br>
namespace Types {<br>
class Property;<br>
@@ -344,16 +343,6 @@ namespace Nepomuk2 {<br>
QString genericIcon() const;<br>
<br>
/**<br>
- * Get or create the PIMO thing that relates to this resource.<br>
If this resource<br>
- * itself is a pimo:Thing, a reference to this is returned. If<br>
a pimo:Thing exists<br>
- * with has as occurrence this resource, the thing is returned.<br>
Otherwise a new thing<br>
- * is created.<br>
- *<br>
- * \since 4.2<br>
- */<br>
- Thing pimoThing();<br>
-<br>
- /**<br>
* Operator to compare two Resource objects.<br>
*/<br>
bool operator==( const Resource& ) const;<br>
diff --git a/libnepomukcore/resource/<u></u>resourcedata.cpp<br>
b/libnepomukcore/resource/<u></u>resourcedata.cpp<br>
index f908177..e19b4bd 100644<br>
--- a/libnepomukcore/resource/<u></u>resourcedata.cpp<br>
+++ b/libnepomukcore/resource/<u></u>resourcedata.cpp<br>
@@ -54,6 +54,8 @@ using namespace Soprano;<br>
<br>
#define MAINMODEL (m_rm->m_manager->mainModel())<br>
<br>
+using namespace Soprano::Vocabulary;<br>
+using namespace Nepomuk2::Vocabulary;<br>
<br>
Nepomuk2::ResourceData::<u></u>ResourceData( const QUrl& uri, const QUrl&<br>
kickOffUri, const QUrl& type, ResourceManagerPrivate* rm )<br>
: m_uri(uri),<br>
@@ -61,8 +63,6 @@ Nepomuk2::ResourceData::<u></u>ResourceData( const QUrl& uri,<br>
const QUrl& kickOffUri, c<br>
m_modificationMutex(QMutex::<u></u>Recursive),<br>
m_cacheDirty(false),<br>
m_addedToWatcher(false),<br>
- m_pimoThing(0),<br>
- m_groundingOccurence(0),<br>
m_rm(rm)<br>
{<br>
if( m_mainType.isEmpty() ) {<br>
@@ -197,9 +197,6 @@ void Nepomuk2::ResourceData::<u></u>resetAll( bool isDelete )<br>
m_cache.clear();<br>
m_cacheDirty = false;<br>
m_types.clear();<br>
- delete m_pimoThing;<br>
- m_pimoThing = 0;<br>
- m_groundingOccurence = 0;<br>
<br>
// when we are being deleted the value of m_mainType is not important<br>
// anymore. Also since ResourceManager is a global static it might be<br>
@@ -321,13 +318,6 @@ bool Nepomuk2::ResourceData::store(<u></u>)<br>
m_rm->addToKickOffList( this, m_kickoffUris );<br>
}<br>
<br>
- // store our grounding occurrence in case we are a thing<br>
created by the pimoThing() method<br>
- if( m_groundingOccurence ) {<br>
- if( m_groundingOccurence != this )<br>
- m_groundingOccurence->store();<br>
- setProperty(Vocabulary::PIMO::<u></u>groundingOccurrence(),<br>
Variant(m_groundingOccurence-><u></u>uri()) );<br>
- }<br>
-<br>
foreach( const KUrl& url, m_kickoffUris ) {<br>
if( url.scheme().isEmpty() )<br>
setProperty( Soprano::Vocabulary::NAO::<u></u>identifier(),<br>
Variant(url.url()) );<br>
@@ -437,23 +427,6 @@ bool Nepomuk2::ResourceData::load()<br>
}<br>
<br>
m_cacheDirty = false;<br>
-<br>
- delete m_pimoThing;<br>
- m_pimoThing = 0;<br>
- if( hasType( Vocabulary::PIMO::Thing() ) ) {<br>
- m_pimoThing = new Thing( m_uri );<br>
- }<br>
- else {<br>
- // TODO: somehow handle pimo:referencingOccurrence and<br>
pimo:occurrence<br>
- QueryResultIterator pimoIt = MAINMODEL->executeQuery(<br>
QString( "select ?r where { ?r <%1> <%2> . }")<br>
-<br>
.arg( Vocabulary::PIMO::<u></u>groundingOccurrence().<u></u>toString() )<br>
-<br>
.arg( QString::fromAscii( m_uri.toEncoded() ) ),<br>
-<br>
Soprano::Query::<u></u>QueryLanguageSparqlNoInference );<br>
- if( pimoIt.next() ) {<br>
- m_pimoThing = new Thing( pimoIt.binding("r").uri() );<br>
- }<br>
- }<br>
-<br>
return true;<br>
}<br>
else {<br>
@@ -707,32 +680,6 @@ void Nepomuk2::ResourceData::<u></u>invalidateCache()<br>
}<br>
<br>
<br>
-Nepomuk2::Thing Nepomuk2::ResourceData::<u></u>pimoThing()<br>
-{<br>
- load();<br>
- if( !m_pimoThing ) {<br>
- //<br>
- // We only create a new thing if we are a nie:InformationElement.<br>
- // All other resources will simply be converted into a pimo:Thing<br>
- //<br>
- // Files, however, are a special case in every aspect. this<br>
includes pimo things.<br>
- // Files are their own grounding occurrence. This makes a lot<br>
of things<br>
- // much simpler.<br>
- //<br>
- if( hasType( Vocabulary::PIMO::Thing() ) ||<br>
- isFile() ||<br>
- !hasType( Vocabulary::NIE::<u></u>InformationElement() ) ) {<br>
- m_pimoThing = new Thing(this);<br>
- }<br>
- else {<br>
- m_pimoThing = new Thing();<br>
- }<br>
- m_pimoThing->m_data->m_<u></u>groundingOccurence = this;<br>
- }<br>
- return *m_pimoThing;<br>
-}<br>
-<br>
-<br>
bool Nepomuk2::ResourceData::<u></u>operator==( const ResourceData& other ) const<br>
{<br>
if( this == &other )<br>
diff --git a/libnepomukcore/resource/<u></u>resourcedata.h<br>
b/libnepomukcore/resource/<u></u>resourcedata.h<br>
index c6b267f..3708897 100644<br>
--- a/libnepomukcore/resource/<u></u>resourcedata.h<br>
+++ b/libnepomukcore/resource/<u></u>resourcedata.h<br>
@@ -29,7 +29,6 @@<br>
#include <QtCore/QSet><br>
<br>
#include "variant.h"<br>
-#include "thing.h"<br>
#include <kurl.h><br>
<br>
#include <soprano/statement.h><br>
@@ -157,8 +156,6 @@ namespace Nepomuk2 {<br>
<br>
void invalidateCache();<br>
<br>
- Thing pimoThing();<br>
-<br>
/**<br>
* Compares the properties of two ResourceData objects taking<br>
into account the Deleted flag<br>
*/<br>
@@ -205,12 +202,6 @@ namespace Nepomuk2 {<br>
bool m_cacheDirty;<br>
bool m_addedToWatcher;<br>
<br>
- // using a pointer to avoid infinite creation loop<br>
- Thing* m_pimoThing;<br>
-<br>
- // only used for delayed storage of the pimo thing relation<br>
- ResourceData* m_groundingOccurence;<br>
-<br>
ResourceManagerPrivate* m_rm;<br>
};<br>
}<br>
<br>
<br>
<br>
On Sun, Jul 1, 2012 at 4:39 PM, Vishesh Handa <<a href="mailto:me@vhanda.in" target="_blank">me@vhanda.in</a><br></div></div><div class="im">
<mailto:<a href="mailto:me@vhanda.in" target="_blank">me@vhanda.in</a>>> wrote:<br>
<br>
Hey Sebastian<br>
<br>
I still have around 3 more weeks during which I'm allowed to break<br>
ABI and API compatibility. I was thinking of changing -<br>
<br>
* Resource::resourceUri() -> Resource::uri()<br>
* Resource::resourceType() -> Resource::type()<br>
<br>
Is that okay?<br>
<br>
--<br>
Vishesh Handa<br>
<br>
<br>
<br>
<br>
--<br>
Vishesh Handa<br>
<br>
</div></blockquote>
</blockquote></div><br><br clear="all"><br>-- <br><span style="color:rgb(192,192,192)">Vishesh Handa</span><br><br>