/* trf-persona-store.c generated by valac 0.13.4, the Vala compiler
 * generated from trf-persona-store.vala, do not modify */

/*
 * Copyright (C) 2011 Collabora Ltd.
 *
 * This library is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 2.1 of the License, or
 * (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this library.  If not, see <http://www.gnu.org/licenses/>.
 *
 * Authors:
 *         Travis Reitter <travis.reitter@collabora.co.uk>
 *         Philip Withnall <philip.withnall@collabora.co.uk>
 *         Marco Barisione <marco.barisione@collabora.co.uk>
 *         Raul Gutierrez Segales <raul.gutierrez.segales@collabora.co.uk>
 */

#include <glib.h>
#include <glib-object.h>
#include <folks/folks.h>
#include <gee.h>
#include <gio/gio.h>
#include <libtracker-sparql/tracker-sparql.h>
#include <string.h>
#include <stdlib.h>
#include <glib/gi18n-lib.h>


#define TRF_TYPE_FIELDS (trf_fields_get_type ())

#define TRF_TYPE_AFFL_INFO_FIELDS (trf_affl_info_fields_get_type ())

#define TRF_TYPE_POSTAL_ADDRESS_FIELDS (trf_postal_address_fields_get_type ())

#define TRF_TYPE_URLS_FIELDS (trf_urls_fields_get_type ())

#define TRF_TYPE_ROLE_FIELDS (trf_role_fields_get_type ())

#define TRF_TYPE_IM_FIELDS (trf_im_fields_get_type ())

#define TRF_TYPE_PHONE_FIELDS (trf_phone_fields_get_type ())

#define TRF_TYPE_EMAIL_FIELDS (trf_email_fields_get_type ())

#define TRF_TYPE_TAG_FIELDS (trf_tag_fields_get_type ())

#define TRF_TYPE_ATTRIB (trf_attrib_get_type ())

#define TRF_TYPE_PERSONA_STORE (trf_persona_store_get_type ())
#define TRF_PERSONA_STORE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TRF_TYPE_PERSONA_STORE, TrfPersonaStore))
#define TRF_PERSONA_STORE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TRF_TYPE_PERSONA_STORE, TrfPersonaStoreClass))
#define TRF_IS_PERSONA_STORE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TRF_TYPE_PERSONA_STORE))
#define TRF_IS_PERSONA_STORE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TRF_TYPE_PERSONA_STORE))
#define TRF_PERSONA_STORE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TRF_TYPE_PERSONA_STORE, TrfPersonaStoreClass))

typedef struct _TrfPersonaStore TrfPersonaStore;
typedef struct _TrfPersonaStoreClass TrfPersonaStoreClass;
typedef struct _TrfPersonaStorePrivate TrfPersonaStorePrivate;

#define TRF_TYPE_PERSONA (trf_persona_get_type ())
#define TRF_PERSONA(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TRF_TYPE_PERSONA, TrfPersona))
#define TRF_PERSONA_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TRF_TYPE_PERSONA, TrfPersonaClass))
#define TRF_IS_PERSONA(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TRF_TYPE_PERSONA))
#define TRF_IS_PERSONA_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TRF_TYPE_PERSONA))
#define TRF_PERSONA_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TRF_TYPE_PERSONA, TrfPersonaClass))

typedef struct _TrfPersona TrfPersona;
typedef struct _TrfPersonaClass TrfPersonaClass;

#define TYPE_RESOURCES (resources_get_type ())
#define RESOURCES(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_RESOURCES, Resources))
#define IS_RESOURCES(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_RESOURCES))
#define RESOURCES_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), TYPE_RESOURCES, ResourcesIface))

typedef struct _Resources Resources;
typedef struct _ResourcesIface ResourcesIface;

#define TYPE_RESOURCES_PROXY (resources_proxy_get_type ())
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_hash_table_unref0(var) ((var == NULL) ? NULL : (var = (g_hash_table_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_date_time_unref0(var) ((var == NULL) ? NULL : (var = (g_date_time_unref (var), NULL)))
#define __vala_GValue_free0(var) ((var == NULL) ? NULL : (var = (_vala_GValue_free (var), NULL)))
#define _g_list_free0(var) ((var == NULL) ? NULL : (var = (g_list_free (var), NULL)))
typedef struct _TrfPersonaStoreAddPersonaFromDetailsData TrfPersonaStoreAddPersonaFromDetailsData;
typedef struct _TrfPersonaStoreRemovePersonaData TrfPersonaStoreRemovePersonaData;
typedef struct _TrfPersonaStoreRemoveAttributesFromPersonaData TrfPersonaStoreRemoveAttributesFromPersonaData;
typedef struct _TrfPersonaStoreBuildUpdateQuerySetData TrfPersonaStoreBuildUpdateQuerySetData;
typedef struct _TrfPersonaStoreRemoveAttributesData TrfPersonaStoreRemoveAttributesData;
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
typedef struct _TrfPersonaStorePrepareData TrfPersonaStorePrepareData;
typedef struct _TrfPersonaStoreBuildPredicatesTableData TrfPersonaStoreBuildPredicatesTableData;
typedef struct _TrfPersonaStoreBuildUrnPrefixTableData TrfPersonaStoreBuildUrnPrefixTableData;
#define _g_variant_iter_free0(var) ((var == NULL) ? NULL : (var = (g_variant_iter_free (var), NULL)))
typedef struct _TrfPersonaStoreHandleEventsData TrfPersonaStoreHandleEventsData;

#define TYPE_EVENT (event_get_type ())
typedef struct _Event Event;
typedef struct _TrfPersonaStoreHandleDeleteEventsData TrfPersonaStoreHandleDeleteEventsData;
typedef struct _TrfPersonaStoreHandleInsertEventsData TrfPersonaStoreHandleInsertEventsData;
typedef struct _TrfPersonaStoreDoAddContactsData TrfPersonaStoreDoAddContactsData;

#define TRF_TYPE_AFFL_INFO (trf_affl_info_get_type ())
#define TRF_AFFL_INFO(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TRF_TYPE_AFFL_INFO, TrfAfflInfo))
#define TRF_AFFL_INFO_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TRF_TYPE_AFFL_INFO, TrfAfflInfoClass))
#define TRF_IS_AFFL_INFO(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TRF_TYPE_AFFL_INFO))
#define TRF_IS_AFFL_INFO_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TRF_TYPE_AFFL_INFO))
#define TRF_AFFL_INFO_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TRF_TYPE_AFFL_INFO, TrfAfflInfoClass))

typedef struct _TrfAfflInfo TrfAfflInfo;
typedef struct _TrfAfflInfoClass TrfAfflInfoClass;
typedef struct _TrfAfflInfoPrivate TrfAfflInfoPrivate;
typedef struct _TrfPersonaStoreDoUpdateData TrfPersonaStoreDoUpdateData;
typedef struct _TrfPersonaStoreGetPropertyData TrfPersonaStoreGetPropertyData;
typedef struct _TrfPersonaStoreGetNaoPropertyByPersonIdData TrfPersonaStoreGetNaoPropertyByPersonIdData;
typedef struct _TrfPersonaStoreGetNaoPropertyByPropIdData TrfPersonaStoreGetNaoPropertyByPropIdData;
typedef struct _TrfPersonaStoreGetAfflInfoData TrfPersonaStoreGetAfflInfoData;
#define _g_variant_unref0(var) ((var == NULL) ? NULL : (var = (g_variant_unref (var), NULL)))
typedef struct _TrfPersonaStoreInsertPersonaData TrfPersonaStoreInsertPersonaData;
typedef struct _TrfPersonaStoreSingleValueQueryData TrfPersonaStoreSingleValueQueryData;
typedef struct _TrfPersonaStoreMultiValueQueryData TrfPersonaStoreMultiValueQueryData;
typedef struct _TrfPersonaStoreUrnFromTrackerIdData TrfPersonaStoreUrnFromTrackerIdData;
typedef struct _TrfPersonaStoreSetNicknameData TrfPersonaStoreSetNicknameData;
typedef struct _TrfPersonaStoreSetLocalIdsData TrfPersonaStoreSetLocalIdsData;
typedef struct _TrfPersonaStoreSetWebServiceAddrsData TrfPersonaStoreSetWebServiceAddrsData;
typedef struct _TrfPersonaStoreSetTrackerPropertyData TrfPersonaStoreSetTrackerPropertyData;
typedef struct _TrfPersonaStoreSetIsFavouriteData TrfPersonaStoreSetIsFavouriteData;
typedef struct _TrfPersonaStoreSetEmailsData TrfPersonaStoreSetEmailsData;
typedef struct _TrfPersonaStoreSetPhonesData TrfPersonaStoreSetPhonesData;
typedef struct _TrfPersonaStoreSetUniqueAttribSetData TrfPersonaStoreSetUniqueAttribSetData;
typedef struct _TrfPersonaStoreSetUrlsData TrfPersonaStoreSetUrlsData;
typedef struct _TrfPersonaStoreSetImAddressesData TrfPersonaStoreSetImAddressesData;
typedef struct _TrfPersonaStoreSetPostalAddressesData TrfPersonaStoreSetPostalAddressesData;
typedef struct _TrfPersonaStoreSetRolesData TrfPersonaStoreSetRolesData;
typedef struct _TrfPersonaStoreSetNotesData TrfPersonaStoreSetNotesData;
typedef struct _TrfPersonaStoreSetBirthdayData TrfPersonaStoreSetBirthdayData;
typedef struct _TrfPersonaStoreSetGenderData TrfPersonaStoreSetGenderData;
typedef struct _TrfPersonaStoreSetAvatarData TrfPersonaStoreSetAvatarData;
typedef struct _TrfPersonaStoreSetStructuredNameData TrfPersonaStoreSetStructuredNameData;
typedef struct _TrfPersonaStoreSetFullNameData TrfPersonaStoreSetFullNameData;
typedef struct _TrfPersonaStoreSetAttribSetData TrfPersonaStoreSetAttribSetData;
typedef struct _TrfPersonaStoreTrackerUpdateData TrfPersonaStoreTrackerUpdateData;
typedef struct _TrfPersonaStoreAffiliationsFromPersonaData TrfPersonaStoreAffiliationsFromPersonaData;
typedef struct _TrfPersonaStorePhonesFromAffiliationData TrfPersonaStorePhonesFromAffiliationData;
typedef struct _TrfPersonaStorePostalsFromAffiliationData TrfPersonaStorePostalsFromAffiliationData;
typedef struct _TrfPersonaStoreImaddrsFromAffiliationData TrfPersonaStoreImaddrsFromAffiliationData;
typedef struct _TrfPersonaStoreEmailsFromAffiliationData TrfPersonaStoreEmailsFromAffiliationData;
typedef struct _TrfPersonaStoreResourceUsageCountData TrfPersonaStoreResourceUsageCountData;
typedef struct _TrfPersonaStoreDeleteResourceData TrfPersonaStoreDeleteResourceData;
typedef struct _TrfPersonaStoreLinkedResourcesData TrfPersonaStoreLinkedResourcesData;
typedef struct _TrfPersonaStoreUrnFromPersonaData TrfPersonaStoreUrnFromPersonaData;
typedef struct _TrfPersonaStoreUrnFromPropertyData TrfPersonaStoreUrnFromPropertyData;

typedef enum  {
	TRF_FIELDS_TRACKER_ID,
	TRF_FIELDS_FULL_NAME,
	TRF_FIELDS_FAMILY_NAME,
	TRF_FIELDS_GIVEN_NAME,
	TRF_FIELDS_ADDITIONAL_NAMES,
	TRF_FIELDS_PREFIXES,
	TRF_FIELDS_SUFFIXES,
	TRF_FIELDS_NICKNAME,
	TRF_FIELDS_BIRTHDAY,
	TRF_FIELDS_AVATAR_URL,
	TRF_FIELDS_IM_ADDRESSES,
	TRF_FIELDS_PHONES,
	TRF_FIELDS_EMAILS,
	TRF_FIELDS_URLS,
	TRF_FIELDS_FAVOURITE,
	TRF_FIELDS_CONTACT_URN,
	TRF_FIELDS_ROLES,
	TRF_FIELDS_NOTE,
	TRF_FIELDS_GENDER,
	TRF_FIELDS_POSTAL_ADDRESS,
	TRF_FIELDS_LOCAL_IDS_PROPERTY
} TrfFields;

typedef enum  {
	TRF_AFFL_INFO_FIELDS_IM_TRACKER_ID,
	TRF_AFFL_INFO_FIELDS_IM_PROTOCOL,
	TRF_AFFL_INFO_FIELDS_IM_ACCOUNT_ID,
	TRF_AFFL_INFO_FIELDS_AFFL_TRACKER_ID,
	TRF_AFFL_INFO_FIELDS_AFFL_ROLE,
	TRF_AFFL_INFO_FIELDS_AFFL_ORG,
	TRF_AFFL_INFO_FIELDS_AFFL_TITLE,
	TRF_AFFL_INFO_FIELDS_AFFL_POBOX,
	TRF_AFFL_INFO_FIELDS_AFFL_DISTRICT,
	TRF_AFFL_INFO_FIELDS_AFFL_COUNTY,
	TRF_AFFL_INFO_FIELDS_AFFL_LOCALITY,
	TRF_AFFL_INFO_FIELDS_AFFL_POSTALCODE,
	TRF_AFFL_INFO_FIELDS_AFFL_STREET_ADDRESS,
	TRF_AFFL_INFO_FIELDS_AFFL_ADDRESS_LOCATION,
	TRF_AFFL_INFO_FIELDS_AFFL_EXTENDED_ADDRESS,
	TRF_AFFL_INFO_FIELDS_AFFL_COUNTRY,
	TRF_AFFL_INFO_FIELDS_AFFL_REGION,
	TRF_AFFL_INFO_FIELDS_AFFL_EMAIL,
	TRF_AFFL_INFO_FIELDS_AFFL_PHONE,
	TRF_AFFL_INFO_FIELDS_AFFL_WEBSITE,
	TRF_AFFL_INFO_FIELDS_AFFL_BLOG,
	TRF_AFFL_INFO_FIELDS_AFFL_URL,
	TRF_AFFL_INFO_FIELDS_IM_NICKNAME
} TrfAfflInfoFields;

typedef enum  {
	TRF_POSTAL_ADDRESS_FIELDS_TRACKER_ID,
	TRF_POSTAL_ADDRESS_FIELDS_POBOX,
	TRF_POSTAL_ADDRESS_FIELDS_DISTRICT,
	TRF_POSTAL_ADDRESS_FIELDS_COUNTY,
	TRF_POSTAL_ADDRESS_FIELDS_LOCALITY,
	TRF_POSTAL_ADDRESS_FIELDS_POSTALCODE,
	TRF_POSTAL_ADDRESS_FIELDS_STREET_ADDRESS,
	TRF_POSTAL_ADDRESS_FIELDS_ADDRESS_LOCATION,
	TRF_POSTAL_ADDRESS_FIELDS_EXTENDED_ADDRESS,
	TRF_POSTAL_ADDRESS_FIELDS_COUNTRY,
	TRF_POSTAL_ADDRESS_FIELDS_REGION
} TrfPostalAddressFields;

typedef enum  {
	TRF_URLS_FIELDS_TRACKER_ID,
	TRF_URLS_FIELDS_BLOG,
	TRF_URLS_FIELDS_WEBSITE,
	TRF_URLS_FIELDS_URL
} TrfUrlsFields;

typedef enum  {
	TRF_ROLE_FIELDS_TRACKER_ID,
	TRF_ROLE_FIELDS_ROLE,
	TRF_ROLE_FIELDS_DEPARTMENT,
	TRF_ROLE_FIELDS_TITLE
} TrfRoleFields;

typedef enum  {
	TRF_IM_FIELDS_TRACKER_ID,
	TRF_IM_FIELDS_PROTO,
	TRF_IM_FIELDS_ID,
	TRF_IM_FIELDS_IM_NICKNAME
} TrfIMFields;

typedef enum  {
	TRF_PHONE_FIELDS_TRACKER_ID,
	TRF_PHONE_FIELDS_PHONE
} TrfPhoneFields;

typedef enum  {
	TRF_EMAIL_FIELDS_TRACKER_ID,
	TRF_EMAIL_FIELDS_EMAIL
} TrfEmailFields;

typedef enum  {
	TRF_TAG_FIELDS_TRACKER_ID
} TrfTagFields;

typedef enum  {
	TRF_ATTRIB_EMAILS,
	TRF_ATTRIB_PHONES,
	TRF_ATTRIB_URLS,
	TRF_ATTRIB_IM_ADDRESSES,
	TRF_ATTRIB_POSTAL_ADDRESSES
} TrfAttrib;

struct _TrfPersonaStore {
	FolksPersonaStore parent_instance;
	TrfPersonaStorePrivate * priv;
};

struct _TrfPersonaStoreClass {
	FolksPersonaStoreClass parent_class;
};

struct _ResourcesIface {
	GTypeInterface parent_iface;
};

struct _TrfPersonaStorePrivate {
	GeeHashMap* _personas;
	GStaticRecMutex __lock__personas;
	GeeMap* _personas_ro;
	gboolean _is_prepared;
	GStaticRecMutex __lock__is_prepared;
	gboolean _is_quiescent;
	Resources* _resources_object;
	TrackerSparqlConnection* _connection;
};

struct _TrfPersonaStoreAddPersonaFromDetailsData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	TrfPersonaStore* self;
	GHashTable* details;
	FolksPersona* result;
	GLoadableIcon* avatar;
	TrackerSparqlBuilder* _tmp0_;
	TrackerSparqlBuilder* builder;
	TrackerSparqlBuilder* _tmp1_;
	TrackerSparqlBuilder* _tmp2_;
	TrackerSparqlBuilder* _tmp3_;
	TrackerSparqlBuilder* _tmp4_;
	GHashTable* _tmp5_;
	GList* _tmp6_;
	GList* k_collection;
	GList* k_it;
	const gchar* k;
	GHashTable* _tmp7_;
	const gchar* _tmp8_;
	gconstpointer _tmp9_;
	GValue* _tmp10_;
	GValue* v;
	const gchar* _tmp11_;
	const gchar* _tmp12_;
	TrackerSparqlBuilder* _tmp13_;
	TrackerSparqlBuilder* _tmp14_;
	TrackerSparqlBuilder* _tmp15_;
	GValue* _tmp16_;
	const gchar* _tmp17_;
	const gchar* _tmp18_;
	const gchar* _tmp19_;
	TrackerSparqlBuilder* _tmp20_;
	TrackerSparqlBuilder* _tmp21_;
	TrackerSparqlBuilder* _tmp22_;
	GValue* _tmp23_;
	const gchar* _tmp24_;
	const gchar* _tmp25_;
	const gchar* _tmp26_;
	GValue* _tmp27_;
	GObject* _tmp28_;
	FolksStructuredName* _tmp29_;
	FolksStructuredName* sname;
	TrackerSparqlBuilder* _tmp30_;
	TrackerSparqlBuilder* _tmp31_;
	TrackerSparqlBuilder* _tmp32_;
	FolksStructuredName* _tmp33_;
	const gchar* _tmp34_;
	const gchar* _tmp35_;
	TrackerSparqlBuilder* _tmp36_;
	TrackerSparqlBuilder* _tmp37_;
	FolksStructuredName* _tmp38_;
	const gchar* _tmp39_;
	const gchar* _tmp40_;
	TrackerSparqlBuilder* _tmp41_;
	TrackerSparqlBuilder* _tmp42_;
	FolksStructuredName* _tmp43_;
	const gchar* _tmp44_;
	const gchar* _tmp45_;
	TrackerSparqlBuilder* _tmp46_;
	TrackerSparqlBuilder* _tmp47_;
	FolksStructuredName* _tmp48_;
	const gchar* _tmp49_;
	const gchar* _tmp50_;
	TrackerSparqlBuilder* _tmp51_;
	TrackerSparqlBuilder* _tmp52_;
	FolksStructuredName* _tmp53_;
	const gchar* _tmp54_;
	const gchar* _tmp55_;
	const gchar* _tmp56_;
	const gchar* _tmp57_;
	GValue* _tmp58_;
	gboolean _tmp59_;
	TrackerSparqlBuilder* _tmp60_;
	TrackerSparqlBuilder* _tmp61_;
	TrackerSparqlBuilder* _tmp62_;
	const gchar* _tmp63_;
	const gchar* _tmp64_;
	GValue* _tmp65_;
	GObject* _tmp66_;
	GLoadableIcon* _tmp67_;
	GLoadableIcon* new_avatar;
	GLoadableIcon* _tmp68_;
	GLoadableIcon* _tmp69_;
	GLoadableIcon* _tmp70_;
	const gchar* _tmp71_;
	const gchar* _tmp72_;
	GValue* _tmp73_;
	void* _tmp74_;
	GDateTime* _tmp75_;
	GDateTime* birthday;
	TrackerSparqlBuilder* _tmp76_;
	TrackerSparqlBuilder* _tmp77_;
	GTimeVal tv;
	GDateTime* _tmp78_;
	GTimeVal _tmp79_;
	TrackerSparqlBuilder* _tmp80_;
	gchar* _tmp81_;
	gchar* _tmp82_;
	const gchar* _tmp83_;
	const gchar* _tmp84_;
	GValue* _tmp85_;
	gint _tmp86_;
	FolksGender gender;
	FolksGender _tmp87_;
	TrackerSparqlBuilder* _tmp88_;
	TrackerSparqlBuilder* _tmp89_;
	FolksGender _tmp90_;
	TrackerSparqlBuilder* _tmp91_;
	TrackerSparqlBuilder* _tmp92_;
	const gchar* _tmp93_;
	const gchar* _tmp94_;
	GValue* _tmp95_;
	GObject* _tmp96_;
	GeeSet* _tmp97_;
	GeeSet* email_addresses;
	TrackerSparqlBuilder* _tmp98_;
	GeeSet* _tmp99_;
	const gchar* _tmp100_;
	const gchar* _tmp101_;
	GValue* _tmp102_;
	GObject* _tmp103_;
	GeeMultiMap* _tmp104_;
	GeeMultiMap* im_addresses;
	gint im_cnt;
	GeeMultiMap* _tmp105_;
	GeeSet* _tmp106_;
	GeeSet* _tmp107_;
	GeeIterator* _tmp108_;
	GeeIterator* _tmp109_;
	GeeIterator* _proto_it;
	GeeIterator* _tmp110_;
	gboolean _tmp111_;
	GeeIterator* _tmp112_;
	gpointer _tmp113_;
	gchar* proto;
	GeeMultiMap* _tmp114_;
	const gchar* _tmp115_;
	GeeCollection* _tmp116_;
	GeeCollection* addrs_a;
	GeeCollection* _tmp117_;
	GeeIterator* _tmp118_;
	GeeIterator* _im_fd_it;
	GeeIterator* _tmp119_;
	gboolean _tmp120_;
	GeeIterator* _tmp121_;
	gpointer _tmp122_;
	FolksImFieldDetails* im_fd;
	gint _tmp123_;
	gchar* _tmp124_;
	gchar* im_affl;
	gint _tmp125_;
	gchar* _tmp126_;
	gchar* im;
	TrackerSparqlBuilder* _tmp127_;
	const gchar* _tmp128_;
	TrackerSparqlBuilder* _tmp129_;
	TrackerSparqlBuilder* _tmp130_;
	TrackerSparqlBuilder* _tmp131_;
	TrackerSparqlBuilder* _tmp132_;
	FolksImFieldDetails* _tmp133_;
	gconstpointer _tmp134_;
	const gchar* _tmp135_;
	TrackerSparqlBuilder* _tmp136_;
	TrackerSparqlBuilder* _tmp137_;
	const gchar* _tmp138_;
	TrackerSparqlBuilder* _tmp139_;
	const gchar* _tmp140_;
	TrackerSparqlBuilder* _tmp141_;
	TrackerSparqlBuilder* _tmp142_;
	TrackerSparqlBuilder* _tmp143_;
	TrackerSparqlBuilder* _tmp144_;
	const gchar* _tmp145_;
	TrackerSparqlBuilder* _tmp146_;
	TrackerSparqlBuilder* _tmp147_;
	TrackerSparqlBuilder* _tmp148_;
	const gchar* _tmp149_;
	gint _tmp150_;
	const gchar* _tmp151_;
	const gchar* _tmp152_;
	GValue* _tmp153_;
	GObject* _tmp154_;
	GeeHashSet* _tmp155_;
	GeeHashSet* notes;
	GeeHashSet* _tmp156_;
	GeeIterator* _tmp157_;
	GeeIterator* _n_it;
	GeeIterator* _tmp158_;
	gboolean _tmp159_;
	GeeIterator* _tmp160_;
	gpointer _tmp161_;
	FolksNoteFieldDetails* n;
	TrackerSparqlBuilder* _tmp162_;
	TrackerSparqlBuilder* _tmp163_;
	TrackerSparqlBuilder* _tmp164_;
	FolksNoteFieldDetails* _tmp165_;
	gconstpointer _tmp166_;
	const gchar* _tmp167_;
	const gchar* _tmp168_;
	const gchar* _tmp169_;
	GValue* _tmp170_;
	GObject* _tmp171_;
	GeeSet* _tmp172_;
	GeeSet* phone_numbers;
	TrackerSparqlBuilder* _tmp173_;
	GeeSet* _tmp174_;
	const gchar* _tmp175_;
	const gchar* _tmp176_;
	GValue* _tmp177_;
	GObject* _tmp178_;
	GeeHashSet* _tmp179_;
	GeeHashSet* roles;
	gint roles_cnt;
	GeeHashSet* _tmp180_;
	GeeIterator* _tmp181_;
	GeeIterator* _role_fd_it;
	GeeIterator* _tmp182_;
	gboolean _tmp183_;
	GeeIterator* _tmp184_;
	gpointer _tmp185_;
	FolksRoleFieldDetails* role_fd;
	gint _tmp186_;
	gchar* _tmp187_;
	gchar* role_affl;
	TrackerSparqlBuilder* _tmp188_;
	const gchar* _tmp189_;
	TrackerSparqlBuilder* _tmp190_;
	TrackerSparqlBuilder* _tmp191_;
	TrackerSparqlBuilder* _tmp192_;
	TrackerSparqlBuilder* _tmp193_;
	FolksRoleFieldDetails* _tmp194_;
	gconstpointer _tmp195_;
	FolksRole* _tmp196_;
	const gchar* _tmp197_;
	const gchar* _tmp198_;
	TrackerSparqlBuilder* _tmp199_;
	TrackerSparqlBuilder* _tmp200_;
	FolksRoleFieldDetails* _tmp201_;
	gconstpointer _tmp202_;
	FolksRole* _tmp203_;
	const gchar* _tmp204_;
	const gchar* _tmp205_;
	TrackerSparqlBuilder* _tmp206_;
	TrackerSparqlBuilder* _tmp207_;
	FolksRoleFieldDetails* _tmp208_;
	gconstpointer _tmp209_;
	FolksRole* _tmp210_;
	const gchar* _tmp211_;
	const gchar* _tmp212_;
	TrackerSparqlBuilder* _tmp213_;
	TrackerSparqlBuilder* _tmp214_;
	TrackerSparqlBuilder* _tmp215_;
	const gchar* _tmp216_;
	gint _tmp217_;
	const gchar* _tmp218_;
	const gchar* _tmp219_;
	GValue* _tmp220_;
	GObject* _tmp221_;
	GeeSet* _tmp222_;
	GeeSet* postal_addresses;
	gint postal_cnt;
	GeeSet* _tmp223_;
	GeeIterator* _tmp224_;
	GeeIterator* _pafd_it;
	GeeIterator* _tmp225_;
	gboolean _tmp226_;
	GeeIterator* _tmp227_;
	gpointer _tmp228_;
	FolksPostalAddressFieldDetails* pafd;
	FolksPostalAddressFieldDetails* _tmp229_;
	gconstpointer _tmp230_;
	FolksPostalAddress* _tmp231_;
	FolksPostalAddress* _tmp232_;
	FolksPostalAddress* pa;
	gint _tmp233_;
	gchar* _tmp234_;
	gchar* postal_affl;
	gint _tmp235_;
	gchar* _tmp236_;
	gchar* postal;
	TrackerSparqlBuilder* _tmp237_;
	const gchar* _tmp238_;
	TrackerSparqlBuilder* _tmp239_;
	TrackerSparqlBuilder* _tmp240_;
	TrackerSparqlBuilder* _tmp241_;
	TrackerSparqlBuilder* _tmp242_;
	FolksPostalAddress* _tmp243_;
	const gchar* _tmp244_;
	const gchar* _tmp245_;
	TrackerSparqlBuilder* _tmp246_;
	TrackerSparqlBuilder* _tmp247_;
	FolksPostalAddress* _tmp248_;
	const gchar* _tmp249_;
	const gchar* _tmp250_;
	TrackerSparqlBuilder* _tmp251_;
	TrackerSparqlBuilder* _tmp252_;
	FolksPostalAddress* _tmp253_;
	const gchar* _tmp254_;
	const gchar* _tmp255_;
	TrackerSparqlBuilder* _tmp256_;
	TrackerSparqlBuilder* _tmp257_;
	FolksPostalAddress* _tmp258_;
	const gchar* _tmp259_;
	const gchar* _tmp260_;
	TrackerSparqlBuilder* _tmp261_;
	TrackerSparqlBuilder* _tmp262_;
	FolksPostalAddress* _tmp263_;
	const gchar* _tmp264_;
	const gchar* _tmp265_;
	TrackerSparqlBuilder* _tmp266_;
	TrackerSparqlBuilder* _tmp267_;
	FolksPostalAddress* _tmp268_;
	const gchar* _tmp269_;
	const gchar* _tmp270_;
	TrackerSparqlBuilder* _tmp271_;
	TrackerSparqlBuilder* _tmp272_;
	FolksPostalAddress* _tmp273_;
	const gchar* _tmp274_;
	const gchar* _tmp275_;
	TrackerSparqlBuilder* _tmp276_;
	const gchar* _tmp277_;
	TrackerSparqlBuilder* _tmp278_;
	TrackerSparqlBuilder* _tmp279_;
	TrackerSparqlBuilder* _tmp280_;
	TrackerSparqlBuilder* _tmp281_;
	const gchar* _tmp282_;
	TrackerSparqlBuilder* _tmp283_;
	TrackerSparqlBuilder* _tmp284_;
	TrackerSparqlBuilder* _tmp285_;
	const gchar* _tmp286_;
	gint _tmp287_;
	const gchar* _tmp288_;
	const gchar* _tmp289_;
	GValue* _tmp290_;
	GObject* _tmp291_;
	GeeSet* _tmp292_;
	GeeSet* url_fds;
	gint url_cnt;
	GeeSet* _tmp293_;
	GeeIterator* _tmp294_;
	GeeIterator* _url_fd_it;
	GeeIterator* _tmp295_;
	gboolean _tmp296_;
	GeeIterator* _tmp297_;
	gpointer _tmp298_;
	FolksUrlFieldDetails* url_fd;
	gint _tmp299_;
	gchar* _tmp300_;
	gchar* url_affl;
	TrackerSparqlBuilder* _tmp301_;
	const gchar* _tmp302_;
	TrackerSparqlBuilder* _tmp303_;
	TrackerSparqlBuilder* _tmp304_;
	TrackerSparqlBuilder* _tmp305_;
	TrackerSparqlBuilder* _tmp306_;
	FolksUrlFieldDetails* _tmp307_;
	gconstpointer _tmp308_;
	const gchar* _tmp309_;
	TrackerSparqlBuilder* _tmp310_;
	TrackerSparqlBuilder* _tmp311_;
	TrackerSparqlBuilder* _tmp312_;
	const gchar* _tmp313_;
	gint _tmp314_;
	const gchar* _tmp315_;
	const gchar* _tmp316_;
	GValue* _tmp317_;
	GObject* _tmp318_;
	GeeHashSet* _tmp319_;
	GeeHashSet* local_ids;
	GeeHashSet* _tmp320_;
	gchar* _tmp321_;
	gchar* ids;
	TrackerSparqlBuilder* _tmp322_;
	TrackerSparqlBuilder* _tmp323_;
	TrackerSparqlBuilder* _tmp324_;
	TrackerSparqlBuilder* _tmp325_;
	TrackerSparqlBuilder* _tmp326_;
	TrackerSparqlBuilder* _tmp327_;
	TrackerSparqlBuilder* _tmp328_;
	const gchar* _tmp329_;
	TrackerSparqlBuilder* _tmp330_;
	TrackerSparqlBuilder* _tmp331_;
	TrackerSparqlBuilder* _tmp332_;
	const gchar* _tmp333_;
	const gchar* _tmp334_;
	GValue* _tmp335_;
	GObject* _tmp336_;
	GeeMultiMap* _tmp337_;
	GeeMultiMap* ws_obj;
	GeeMultiMap* _tmp338_;
	gchar* _tmp339_;
	gchar* ws_addrs;
	TrackerSparqlBuilder* _tmp340_;
	TrackerSparqlBuilder* _tmp341_;
	TrackerSparqlBuilder* _tmp342_;
	TrackerSparqlBuilder* _tmp343_;
	TrackerSparqlBuilder* _tmp344_;
	TrackerSparqlBuilder* _tmp345_;
	TrackerSparqlBuilder* _tmp346_;
	const gchar* _tmp347_;
	TrackerSparqlBuilder* _tmp348_;
	TrackerSparqlBuilder* _tmp349_;
	TrackerSparqlBuilder* _tmp350_;
	const gchar* _tmp351_;
	const gchar* _tmp352_;
	const gchar* _tmp353_;
	const gchar* _tmp354_;
	GError* _tmp355_;
	TrackerSparqlBuilder* _tmp356_;
	TrfPersona* ret;
	GeeHashMap* _tmp357_;
	TrackerSparqlBuilder* _tmp358_;
	const gchar* _tmp359_;
	const gchar* _tmp360_;
	gchar* _tmp361_;
	gchar* contact_urn;
	const gchar* _tmp362_;
	const gchar* _tmp363_;
	gchar* _tmp364_;
	gchar* filter;
	const gchar* _tmp365_;
	gchar* _tmp366_;
	gchar* query;
	const gchar* _tmp367_;
	GeeHashSet* _tmp368_;
	GeeHashSet* ret_personas;
	GeeHashSet* _tmp369_;
	GeeIterator* _tmp370_;
	GeeIterator* _p_it;
	GeeIterator* _tmp371_;
	gboolean _tmp372_;
	GeeIterator* _tmp373_;
	gpointer _tmp374_;
	TrfPersona* p;
	TrfPersona* _tmp375_;
	TrfPersona* _tmp376_;
	GeeHashMap* _tmp377_;
	gboolean _tmp378_;
	TrfPersona* _tmp379_;
	GLoadableIcon* _tmp380_;
	gboolean _tmp381_;
	TrfPersona* _tmp382_;
	GLoadableIcon* _tmp383_;
	GError * _inner_error_;
};

struct _TrfPersonaStoreRemovePersonaData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	TrfPersonaStore* self;
	FolksPersona* persona;
	FolksPersona* _tmp0_;
	gchar* _tmp1_;
	gchar* urn;
	gchar* _tmp2_;
	gchar* q;
	gchar* _tmp3_;
	gchar* _tmp4_;
};

struct _TrfPersonaStoreRemoveAttributesFromPersonaData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	TrfPersonaStore* self;
	FolksPersona* persona;
	gchar remove_flag;
	gchar* result;
	FolksPersona* _tmp0_;
	gchar* _tmp1_;
	gchar* urn;
	gchar _tmp2_;
};

struct _TrfPersonaStoreBuildUpdateQuerySetData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	TrfPersonaStore* self;
	TrackerSparqlBuilder* builder;
	GeeSet* properties;
	gchar* contact_var;
	TrfAttrib attrib;
	gchar* affl_var;
	gchar* obj_var;
	const gchar* related_attrib;
	const gchar* related_prop;
	const gchar* related_connection;
	TrfAttrib _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	gint cnt;
	GeeSet* _tmp5_;
	GeeIterator* _tmp6_;
	GeeIterator* _p_it;
	GeeIterator* _tmp7_;
	gboolean _tmp8_;
	GeeIterator* _tmp9_;
	gpointer _tmp10_;
	FolksAbstractFieldDetails* p;
	const gchar* _tmp11_;
	gint _tmp12_;
	gchar* _tmp13_;
	gchar* affl;
	const gchar* _tmp14_;
	const gchar* _tmp15_;
	FolksAbstractFieldDetails* _tmp16_;
	gconstpointer _tmp17_;
	const gchar* _tmp18_;
	gchar* _tmp19_;
	gchar* obj;
	const gchar* _tmp20_;
	const gchar* _tmp21_;
	gint _tmp22_;
	gchar* _tmp23_;
	TrackerSparqlBuilder* _tmp24_;
	const gchar* _tmp25_;
	TrackerSparqlBuilder* _tmp26_;
	TrackerSparqlBuilder* _tmp27_;
	const gchar* _tmp28_;
	TrackerSparqlBuilder* _tmp29_;
	const gchar* _tmp30_;
	TrackerSparqlBuilder* _tmp31_;
	FolksAbstractFieldDetails* _tmp32_;
	gconstpointer _tmp33_;
	const gchar* _tmp34_;
	TrackerSparqlBuilder* _tmp35_;
	const gchar* _tmp36_;
	TrackerSparqlBuilder* _tmp37_;
	TrackerSparqlBuilder* _tmp38_;
	TrackerSparqlBuilder* _tmp39_;
	const gchar* _tmp40_;
	TrackerSparqlBuilder* _tmp41_;
	const gchar* _tmp42_;
	TrackerSparqlBuilder* _tmp43_;
	const gchar* _tmp44_;
	TrackerSparqlBuilder* _tmp45_;
	TrackerSparqlBuilder* _tmp46_;
	const gchar* _tmp47_;
	gint _tmp48_;
};

struct _TrfPersonaStoreRemoveAttributesData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	TrfPersonaStore* self;
	gchar* urn;
	gchar remove_flag;
	const gchar* _tmp0_;
	GeeHashSet* _tmp1_;
	GeeHashSet* affiliations;
	GeeHashSet* _tmp2_;
	GeeIterator* _tmp3_;
	GeeIterator* _affl_it;
	GeeIterator* _tmp4_;
	gboolean _tmp5_;
	GeeIterator* _tmp6_;
	gpointer _tmp7_;
	gchar* affl;
	gboolean got_attrib;
	gboolean _tmp8_;
	gchar _tmp9_;
	gchar _tmp10_;
	gboolean _tmp11_;
	const gchar* _tmp12_;
	GeeHashSet* _tmp13_;
	GeeHashSet* phones;
	GeeHashSet* _tmp14_;
	GeeIterator* _tmp15_;
	GeeIterator* _phone_it;
	GeeIterator* _tmp16_;
	gboolean _tmp17_;
	GeeIterator* _tmp18_;
	gpointer _tmp19_;
	gchar* phone;
	const gchar* _tmp20_;
	gboolean _tmp21_;
	gchar _tmp22_;
	gchar _tmp23_;
	gboolean _tmp24_;
	const gchar* _tmp25_;
	GeeHashSet* _tmp26_;
	GeeHashSet* postals;
	GeeHashSet* _tmp27_;
	GeeIterator* _tmp28_;
	GeeIterator* _postal_it;
	GeeIterator* _tmp29_;
	gboolean _tmp30_;
	GeeIterator* _tmp31_;
	gpointer _tmp32_;
	gchar* postal;
	const gchar* _tmp33_;
	gboolean _tmp34_;
	gchar _tmp35_;
	gchar _tmp36_;
	gboolean _tmp37_;
	const gchar* _tmp38_;
	GeeHashSet* _tmp39_;
	GeeHashSet* im_addrs;
	GeeHashSet* _tmp40_;
	GeeIterator* _tmp41_;
	GeeIterator* _im_addr_it;
	GeeIterator* _tmp42_;
	gboolean _tmp43_;
	GeeIterator* _tmp44_;
	gpointer _tmp45_;
	gchar* im_addr;
	const gchar* _tmp46_;
	gboolean _tmp47_;
	gchar _tmp48_;
	gchar _tmp49_;
	gboolean _tmp50_;
	const gchar* _tmp51_;
	GeeHashSet* _tmp52_;
	GeeHashSet* emails;
	GeeHashSet* _tmp53_;
	GeeIterator* _tmp54_;
	GeeIterator* _email_it;
	GeeIterator* _tmp55_;
	gboolean _tmp56_;
	GeeIterator* _tmp57_;
	gpointer _tmp58_;
	gchar* email;
	const gchar* _tmp59_;
	gboolean _tmp60_;
	gboolean _tmp61_;
	gchar _tmp62_;
	gboolean _tmp63_;
	const gchar* _tmp64_;
};

struct _TrfPersonaStorePrepareData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	TrfPersonaStore* self;
	gboolean _tmp0_;
	gboolean _tmp1_;
	TrackerSparqlConnection* _tmp2_;
	TrackerSparqlConnection* _tmp3_;
	gchar* _tmp4_;
	gchar* _tmp5_;
	GeeHashSet* _tmp6_;
	GeeHashSet* _tmp7_;
	Resources* _tmp8_;
	Resources* _tmp9_;
	gboolean _tmp10_;
	Resources* _tmp11_;
	GDBusConnection* _tmp12_;
	GDBusConnection* _tmp13_;
	GDBusConnection* _tmp14_;
	GError* e1;
	GError* _tmp15_;
	const gchar* _tmp16_;
	GError* _tmp17_;
	const gchar* _tmp18_;
	GError* _tmp19_;
	GError* e2;
	GError* _tmp20_;
	const gchar* _tmp21_;
	GError* _tmp22_;
	const gchar* _tmp23_;
	GError* _tmp24_;
	GError* e3;
	GError* _tmp25_;
	const gchar* _tmp26_;
	GError* _tmp27_;
	const gchar* _tmp28_;
	GError* _tmp29_;
	gboolean _tmp30_;
	GError * _inner_error_;
};

struct _TrfPersonaStoreBuildPredicatesTableData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	TrfPersonaStore* self;
	GeeTreeMap* _tmp0_;
	GeeTreeMap* _tmp1_;
	gchar* _tmp2_;
	gchar* query;
	GeeTreeMap* _tmp3_;
	GeeSet* _tmp4_;
	GeeSet* _tmp5_;
	GeeSet* _tmp6_;
	GeeIterator* _tmp7_;
	GeeIterator* _tmp8_;
	GeeIterator* _urn_t_it;
	GeeIterator* _tmp9_;
	gboolean _tmp10_;
	GeeIterator* _tmp11_;
	gpointer _tmp12_;
	gchar* urn_t;
	const gchar* _tmp13_;
	const gchar* _tmp14_;
	gchar* _tmp15_;
	gchar* _tmp16_;
	gchar* _tmp17_;
	gchar* _tmp18_;
	gchar* _tmp19_;
	const gchar* _tmp20_;
	gchar* _tmp21_;
	TrackerSparqlConnection* _tmp22_;
	const gchar* _tmp23_;
	TrackerSparqlCursor* _tmp24_;
	TrackerSparqlCursor* cursor;
	TrackerSparqlCursor* _tmp25_;
	gboolean _tmp26_;
	gboolean _tmp27_;
	gint i;
	GeeTreeMap* _tmp28_;
	GeeSet* _tmp29_;
	GeeSet* _tmp30_;
	GeeSet* _tmp31_;
	GeeIterator* _tmp32_;
	GeeIterator* _tmp33_;
	GeeIterator* _urn_it;
	GeeIterator* _tmp34_;
	gboolean _tmp35_;
	GeeIterator* _tmp36_;
	gpointer _tmp37_;
	gchar* urn;
	TrackerSparqlCursor* _tmp38_;
	gint _tmp39_;
	gint64 _tmp40_;
	gint tracker_id;
	GeeTreeMap* _tmp41_;
	const gchar* _tmp42_;
	gpointer _tmp43_;
	gchar* _tmp44_;
	gchar* _tmp45_;
	gchar* _tmp46_;
	gchar* prefix;
	GeeTreeMap* _tmp47_;
	const gchar* _tmp48_;
	gint _tmp49_;
	gint _tmp50_;
	GError* e1;
	const gchar* _tmp51_;
	GError* _tmp52_;
	const gchar* _tmp53_;
	GError* e2;
	const gchar* _tmp54_;
	GError* _tmp55_;
	const gchar* _tmp56_;
	GError * _inner_error_;
};

struct _TrfPersonaStoreBuildUrnPrefixTableData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	TrfPersonaStore* self;
	GeeTreeMap* _tmp0_;
	GeeTreeMap* _tmp1_;
	GeeTreeMap* _tmp2_;
	GeeTreeMap* _tmp3_;
	GeeTreeMap* _tmp4_;
	GeeTreeMap* _tmp5_;
	GeeTreeMap* _tmp6_;
	GeeTreeMap* _tmp7_;
	GeeTreeMap* _tmp8_;
	GeeTreeMap* _tmp9_;
	GeeTreeMap* _tmp10_;
	GeeTreeMap* _tmp11_;
	GeeTreeMap* _tmp12_;
	GeeTreeMap* _tmp13_;
	GeeTreeMap* _tmp14_;
	GeeTreeMap* _tmp15_;
	GeeTreeMap* _tmp16_;
	GeeTreeMap* _tmp17_;
	GeeTreeMap* _tmp18_;
	GeeTreeMap* _tmp19_;
	GeeTreeMap* _tmp20_;
	GeeTreeMap* _tmp21_;
	GeeTreeMap* _tmp22_;
	GeeTreeMap* _tmp23_;
	GeeTreeMap* _tmp24_;
	GeeTreeMap* _tmp25_;
};

struct _TrfPersonaStoreHandleEventsData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	TrfPersonaStore* self;
	GVariantIter* iter_del;
	GVariantIter* iter_ins;
	GVariantIter* _tmp0_;
	GVariantIter* _tmp1_;
};

struct _Event {
	gint graph_id;
	gint subject_id;
	gint pred_id;
	gint object_id;
};

struct _TrfPersonaStoreHandleDeleteEventsData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	TrfPersonaStore* self;
	GVariantIter* iter_del;
	GeeHashSet* _tmp0_;
	GeeHashSet* removed_personas;
	GeeTreeMap* _tmp1_;
	gpointer _tmp2_;
	gint nco_person_id;
	GeeTreeMap* _tmp3_;
	gpointer _tmp4_;
	gint rdf_type_id;
	Event e;
	GVariantIter* _tmp5_;
	gboolean _tmp6_;
	const gchar* _tmp7_;
	const gchar* _tmp8_;
	Event _tmp9_;
	gint _tmp10_;
	gchar* _tmp11_;
	gchar* _tmp12_;
	gchar* _tmp13_;
	gchar* _tmp14_;
	gchar* p_id;
	gboolean _tmp15_;
	Event _tmp16_;
	gint _tmp17_;
	gint _tmp18_;
	Event _tmp19_;
	gint _tmp20_;
	gint _tmp21_;
	gboolean _tmp22_;
	GeeHashMap* _tmp23_;
	GeeHashMap* _tmp24_;
	const gchar* _tmp25_;
	gpointer _tmp26_;
	TrfPersona* removed_p;
	TrfPersona* _tmp27_;
	GeeHashSet* _tmp28_;
	TrfPersona* _tmp29_;
	GeeHashMap* _tmp30_;
	TrfPersona* _tmp31_;
	const gchar* _tmp32_;
	const gchar* _tmp33_;
	GeeHashMap* _tmp34_;
	GeeHashMap* _tmp35_;
	const gchar* _tmp36_;
	gpointer _tmp37_;
	TrfPersona* persona;
	TrfPersona* _tmp38_;
	TrfPersona* _tmp39_;
	Event _tmp40_;
	GeeHashSet* _tmp41_;
	gint _tmp42_;
	gint _tmp43_;
	GeeHashSet* _tmp44_;
	GError * _inner_error_;
};

struct _TrfPersonaStoreHandleInsertEventsData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	TrfPersonaStore* self;
	GVariantIter* iter_ins;
	GeeHashSet* _tmp0_;
	GeeHashSet* added_personas;
	Event e;
	GVariantIter* _tmp1_;
	gboolean _tmp2_;
	Event _tmp3_;
	gint _tmp4_;
	gchar* _tmp5_;
	gchar* subject_tracker_id;
	const gchar* _tmp6_;
	const gchar* _tmp7_;
	const gchar* _tmp8_;
	gchar* _tmp9_;
	gchar* p_id;
	TrfPersona* persona;
	GeeHashMap* _tmp10_;
	GeeHashMap* _tmp11_;
	const gchar* _tmp12_;
	gpointer _tmp13_;
	TrfPersona* _tmp14_;
	const gchar* _tmp15_;
	TrfPersona* _tmp16_;
	GeeHashMap* _tmp17_;
	TrfPersona* _tmp18_;
	const gchar* _tmp19_;
	const gchar* _tmp20_;
	TrfPersona* _tmp21_;
	GeeHashSet* _tmp22_;
	TrfPersona* _tmp23_;
	GeeHashMap* _tmp24_;
	TrfPersona* _tmp25_;
	Event _tmp26_;
	GeeHashSet* _tmp27_;
	gint _tmp28_;
	gint _tmp29_;
	GeeHashSet* _tmp30_;
	GError * _inner_error_;
};

struct _TrfPersonaStoreDoAddContactsData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	TrfPersonaStore* self;
	gchar* query;
	GeeHashSet* result;
	GeeHashSet* _tmp0_;
	GeeHashSet* added_personas;
	TrackerSparqlConnection* _tmp1_;
	const gchar* _tmp2_;
	TrackerSparqlCursor* _tmp3_;
	TrackerSparqlCursor* cursor;
	TrackerSparqlCursor* _tmp4_;
	gboolean _tmp5_;
	gboolean _tmp6_;
	TrackerSparqlCursor* _tmp7_;
	gint64 _tmp8_;
	gint tracker_id;
	const gchar* _tmp9_;
	const gchar* _tmp10_;
	gint _tmp11_;
	gchar* _tmp12_;
	gchar* _tmp13_;
	gchar* _tmp14_;
	gchar* _tmp15_;
	gchar* p_id;
	GeeHashMap* _tmp16_;
	const gchar* _tmp17_;
	gpointer _tmp18_;
	TrfPersona* _tmp19_;
	gboolean _tmp20_;
	gint _tmp21_;
	gchar* _tmp22_;
	gchar* _tmp23_;
	TrackerSparqlCursor* _tmp24_;
	TrfPersona* _tmp25_;
	TrfPersona* _tmp26_;
	TrfPersona* persona;
	GeeHashMap* _tmp27_;
	TrfPersona* _tmp28_;
	const gchar* _tmp29_;
	const gchar* _tmp30_;
	TrfPersona* _tmp31_;
	GeeHashSet* _tmp32_;
	TrfPersona* _tmp33_;
	GeeHashSet* _tmp34_;
	gint _tmp35_;
	gint _tmp36_;
	GeeHashSet* _tmp37_;
	GError* e;
	const gchar* _tmp38_;
	GError* _tmp39_;
	const gchar* _tmp40_;
	GError * _inner_error_;
};

struct _TrfAfflInfo {
	GObject parent_instance;
	TrfAfflInfoPrivate * priv;
	FolksPostalAddressFieldDetails* postal_address_fd;
};

struct _TrfAfflInfoClass {
	GObjectClass parent_class;
};

struct _TrfPersonaStoreDoUpdateData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	TrfPersonaStore* self;
	TrfPersona* p;
	Event e;
	gboolean adding;
	Event _tmp0_;
	gint _tmp1_;
	GeeTreeMap* _tmp2_;
	gpointer _tmp3_;
	gchar* _tmp4_;
	gchar* fullname;
	gboolean _tmp5_;
	Event _tmp6_;
	gint _tmp7_;
	gchar* _tmp8_;
	TrfPersona* _tmp9_;
	const gchar* _tmp10_;
	Event _tmp11_;
	gint _tmp12_;
	GeeTreeMap* _tmp13_;
	gpointer _tmp14_;
	gchar* _tmp15_;
	gchar* nickname;
	gboolean _tmp16_;
	Event _tmp17_;
	gint _tmp18_;
	gchar* _tmp19_;
	TrfPersona* _tmp20_;
	const gchar* _tmp21_;
	Event _tmp22_;
	gint _tmp23_;
	GeeTreeMap* _tmp24_;
	gpointer _tmp25_;
	gchar* _tmp26_;
	gchar* family_name;
	gboolean _tmp27_;
	Event _tmp28_;
	gint _tmp29_;
	gchar* _tmp30_;
	TrfPersona* _tmp31_;
	const gchar* _tmp32_;
	Event _tmp33_;
	gint _tmp34_;
	GeeTreeMap* _tmp35_;
	gpointer _tmp36_;
	gchar* _tmp37_;
	gchar* given_name;
	gboolean _tmp38_;
	Event _tmp39_;
	gint _tmp40_;
	gchar* _tmp41_;
	TrfPersona* _tmp42_;
	const gchar* _tmp43_;
	Event _tmp44_;
	gint _tmp45_;
	GeeTreeMap* _tmp46_;
	gpointer _tmp47_;
	gchar* _tmp48_;
	gchar* additional_name;
	gboolean _tmp49_;
	Event _tmp50_;
	gint _tmp51_;
	gchar* _tmp52_;
	TrfPersona* _tmp53_;
	const gchar* _tmp54_;
	Event _tmp55_;
	gint _tmp56_;
	GeeTreeMap* _tmp57_;
	gpointer _tmp58_;
	gchar* _tmp59_;
	gchar* suffix_name;
	gboolean _tmp60_;
	Event _tmp61_;
	gint _tmp62_;
	gchar* _tmp63_;
	TrfPersona* _tmp64_;
	const gchar* _tmp65_;
	Event _tmp66_;
	gint _tmp67_;
	GeeTreeMap* _tmp68_;
	gpointer _tmp69_;
	gchar* _tmp70_;
	gchar* prefix_name;
	gboolean _tmp71_;
	Event _tmp72_;
	gint _tmp73_;
	gchar* _tmp74_;
	TrfPersona* _tmp75_;
	const gchar* _tmp76_;
	Event _tmp77_;
	gint _tmp78_;
	GeeTreeMap* _tmp79_;
	gpointer _tmp80_;
	Event _tmp81_;
	gint _tmp82_;
	gint _tmp83_;
	gboolean _tmp84_;
	TrfPersona* _tmp85_;
	TrfPersona* _tmp86_;
	Event _tmp87_;
	gint _tmp88_;
	GeeTreeMap* _tmp89_;
	gpointer _tmp90_;
	gboolean _tmp91_;
	Event _tmp92_;
	gint _tmp93_;
	gchar* _tmp94_;
	gchar* email;
	TrfPersona* _tmp95_;
	const gchar* _tmp96_;
	Event _tmp97_;
	gint _tmp98_;
	gchar* _tmp99_;
	gchar* _tmp100_;
	TrfPersona* _tmp101_;
	Event _tmp102_;
	gint _tmp103_;
	gchar* _tmp104_;
	gchar* _tmp105_;
	Event _tmp106_;
	gint _tmp107_;
	GeeTreeMap* _tmp108_;
	gpointer _tmp109_;
	gboolean _tmp110_;
	Event _tmp111_;
	gint _tmp112_;
	gchar* _tmp113_;
	gchar* phone;
	TrfPersona* _tmp114_;
	const gchar* _tmp115_;
	Event _tmp116_;
	gint _tmp117_;
	gchar* _tmp118_;
	gchar* _tmp119_;
	TrfPersona* _tmp120_;
	Event _tmp121_;
	gint _tmp122_;
	gchar* _tmp123_;
	gchar* _tmp124_;
	Event _tmp125_;
	gint _tmp126_;
	GeeTreeMap* _tmp127_;
	gpointer _tmp128_;
	gboolean _tmp129_;
	Event _tmp130_;
	gint _tmp131_;
	gchar* _tmp132_;
	gchar* _tmp133_;
	Event _tmp134_;
	gint _tmp135_;
	gchar* _tmp136_;
	gchar* _tmp137_;
	TrfAfflInfo* _tmp138_;
	TrfAfflInfo* _tmp139_;
	TrfAfflInfo* affl_info;
	TrfAfflInfo* _tmp140_;
	gchar* _tmp141_;
	gchar* _tmp142_;
	TrfAfflInfo* _tmp143_;
	const gchar* _tmp144_;
	const gchar* _tmp145_;
	TrfPersona* _tmp146_;
	TrfAfflInfo* _tmp147_;
	const gchar* _tmp148_;
	const gchar* _tmp149_;
	TrfAfflInfo* _tmp150_;
	const gchar* _tmp151_;
	const gchar* _tmp152_;
	TrfPersona* _tmp153_;
	TrfAfflInfo* _tmp154_;
	const gchar* _tmp155_;
	const gchar* _tmp156_;
	TrfAfflInfo* _tmp157_;
	const gchar* _tmp158_;
	const gchar* _tmp159_;
	TrfAfflInfo* _tmp160_;
	const gchar* _tmp161_;
	const gchar* _tmp162_;
	TrfAfflInfo* _tmp163_;
	const gchar* _tmp164_;
	const gchar* _tmp165_;
	gboolean _tmp166_;
	TrfAfflInfo* _tmp167_;
	const gchar* _tmp168_;
	const gchar* _tmp169_;
	TrfAfflInfo* _tmp170_;
	const gchar* _tmp171_;
	const gchar* _tmp172_;
	gboolean _tmp173_;
	TrfPersona* _tmp174_;
	TrfAfflInfo* _tmp175_;
	const gchar* _tmp176_;
	const gchar* _tmp177_;
	TrfAfflInfo* _tmp178_;
	const gchar* _tmp179_;
	const gchar* _tmp180_;
	TrfAfflInfo* _tmp181_;
	const gchar* _tmp182_;
	const gchar* _tmp183_;
	TrfAfflInfo* _tmp184_;
	const gchar* _tmp185_;
	const gchar* _tmp186_;
	TrfAfflInfo* _tmp187_;
	FolksPostalAddressFieldDetails* _tmp188_;
	TrfPersona* _tmp189_;
	TrfAfflInfo* _tmp190_;
	FolksPostalAddressFieldDetails* _tmp191_;
	TrfAfflInfo* _tmp192_;
	const gchar* _tmp193_;
	const gchar* _tmp194_;
	TrfPersona* _tmp195_;
	TrfAfflInfo* _tmp196_;
	const gchar* _tmp197_;
	const gchar* _tmp198_;
	Event _tmp199_;
	gint _tmp200_;
	gchar* _tmp201_;
	gchar* _tmp202_;
	TrfAfflInfo* _tmp203_;
	const gchar* _tmp204_;
	const gchar* _tmp205_;
	TrfPersona* _tmp206_;
	TrfAfflInfo* _tmp207_;
	const gchar* _tmp208_;
	const gchar* _tmp209_;
	Event _tmp210_;
	gint _tmp211_;
	gchar* _tmp212_;
	gchar* _tmp213_;
	TrfAfflInfo* _tmp214_;
	const gchar* _tmp215_;
	const gchar* _tmp216_;
	TrfPersona* _tmp217_;
	TrfAfflInfo* _tmp218_;
	const gchar* _tmp219_;
	const gchar* _tmp220_;
	TrfAfflInfo* _tmp221_;
	const gchar* _tmp222_;
	const gchar* _tmp223_;
	TrfAfflInfo* _tmp224_;
	const gchar* _tmp225_;
	const gchar* _tmp226_;
	TrfPersona* _tmp227_;
	TrfAfflInfo* _tmp228_;
	const gchar* _tmp229_;
	const gchar* _tmp230_;
	TrfAfflInfo* _tmp231_;
	const gchar* _tmp232_;
	const gchar* _tmp233_;
	TrfAfflInfo* _tmp234_;
	const gchar* _tmp235_;
	const gchar* _tmp236_;
	TrfPersona* _tmp237_;
	TrfAfflInfo* _tmp238_;
	const gchar* _tmp239_;
	const gchar* _tmp240_;
	TrfAfflInfo* _tmp241_;
	const gchar* _tmp242_;
	const gchar* _tmp243_;
	TrfPersona* _tmp244_;
	Event _tmp245_;
	gint _tmp246_;
	gchar* _tmp247_;
	gchar* _tmp248_;
	TrfPersona* _tmp249_;
	Event _tmp250_;
	gint _tmp251_;
	gchar* _tmp252_;
	gchar* _tmp253_;
	TrfPersona* _tmp254_;
	Event _tmp255_;
	gint _tmp256_;
	gchar* _tmp257_;
	gchar* _tmp258_;
	TrfPersona* _tmp259_;
	Event _tmp260_;
	gint _tmp261_;
	gchar* _tmp262_;
	gchar* _tmp263_;
	TrfPersona* _tmp264_;
	Event _tmp265_;
	gint _tmp266_;
	gchar* _tmp267_;
	gchar* _tmp268_;
	TrfPersona* _tmp269_;
	Event _tmp270_;
	gint _tmp271_;
	gchar* _tmp272_;
	gchar* _tmp273_;
	Event _tmp274_;
	gint _tmp275_;
	GeeTreeMap* _tmp276_;
	gpointer _tmp277_;
	gchar* _tmp278_;
	gchar* bday;
	gboolean _tmp279_;
	Event _tmp280_;
	gint _tmp281_;
	gchar* _tmp282_;
	TrfPersona* _tmp283_;
	const gchar* _tmp284_;
	Event _tmp285_;
	gint _tmp286_;
	GeeTreeMap* _tmp287_;
	gpointer _tmp288_;
	gchar* _tmp289_;
	gchar* note;
	gboolean _tmp290_;
	Event _tmp291_;
	gint _tmp292_;
	gchar* _tmp293_;
	TrfPersona* _tmp294_;
	const gchar* _tmp295_;
	Event _tmp296_;
	gint _tmp297_;
	GeeTreeMap* _tmp298_;
	gpointer _tmp299_;
	gboolean _tmp300_;
	TrfPersona* _tmp301_;
	Event _tmp302_;
	gint _tmp303_;
	TrfPersona* _tmp304_;
	Event _tmp305_;
	gint _tmp306_;
	GeeTreeMap* _tmp307_;
	gpointer _tmp308_;
	gchar* _tmp309_;
	gchar* avatar_url;
	gboolean _tmp310_;
	Event _tmp311_;
	gint _tmp312_;
	gchar* _tmp313_;
	TrfPersona* _tmp314_;
	const gchar* _tmp315_;
	Event _tmp316_;
	gint _tmp317_;
	GeeTreeMap* _tmp318_;
	gpointer _tmp319_;
	gboolean _tmp320_;
	Event _tmp321_;
	gint _tmp322_;
	gint _tmp323_;
	gchar** _tmp324_;
	gchar** prop_info;
	gint prop_info_length1;
	gint _prop_info_size_;
	gchar** _tmp325_;
	gint _tmp325__length1;
	const gchar* _tmp326_;
	TrfPersona* _tmp327_;
	gchar** _tmp328_;
	gint _tmp328__length1;
	const gchar* _tmp329_;
	gchar** _tmp330_;
	gint _tmp330__length1;
	const gchar* _tmp331_;
	TrfPersona* _tmp332_;
	gchar** _tmp333_;
	gint _tmp333__length1;
	const gchar* _tmp334_;
	Event _tmp335_;
	gint _tmp336_;
	gchar* _tmp337_;
	gchar* local_ids;
	Event _tmp338_;
	gint _tmp339_;
	gchar* _tmp340_;
	gchar* ws_addrs;
	TrfPersona* _tmp341_;
	const gchar* _tmp342_;
	TrfPersona* _tmp343_;
	const gchar* _tmp344_;
};

struct _TrfPersonaStoreGetPropertyData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	TrfPersonaStore* self;
	gint subject_tracker_id;
	gchar* property;
	gchar* subject_type;
	gchar* result;
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	gint _tmp2_;
	gchar* _tmp3_;
	gchar* query;
	gchar* _tmp4_;
};

struct _TrfPersonaStoreGetNaoPropertyByPersonIdData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	TrfPersonaStore* self;
	gint nco_person_id;
	gchar* prop_name;
	gchar* result;
	gint _tmp0_;
	const gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* query;
	gchar* _tmp3_;
};

struct _TrfPersonaStoreGetNaoPropertyByPropIdData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	TrfPersonaStore* self;
	gint nao_prop_id;
	gchar** result;
	gint result_length1;
	gint _tmp0_;
	gchar* _tmp1_;
	gchar* query;
	gchar* _tmp2_;
	gchar* ret;
	gchar** _tmp3_;
	gchar** _tmp4_;
	gchar** _tmp5_;
	gint _tmp5__length1;
};

struct _TrfPersonaStoreGetAfflInfoData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	TrfPersonaStore* self;
	gchar* person_id;
	gchar* affiliation_id;
	TrfAfflInfo* result;
	TrfAfflInfo* _tmp0_;
	TrfAfflInfo* affl_info;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* query;
	const gchar* _tmp4_;
	TrackerSparqlConnection* _tmp5_;
	const gchar* _tmp6_;
	TrackerSparqlCursor* _tmp7_;
	TrackerSparqlCursor* cursor;
	TrackerSparqlCursor* _tmp8_;
	gboolean _tmp9_;
	gboolean _tmp10_;
	TrfAfflInfo* _tmp11_;
	TrackerSparqlCursor* _tmp12_;
	const gchar* _tmp13_;
	gchar* _tmp14_;
	gchar* _tmp15_;
	TrfAfflInfo* _tmp16_;
	TrackerSparqlCursor* _tmp17_;
	const gchar* _tmp18_;
	gchar* _tmp19_;
	gchar* _tmp20_;
	TrfAfflInfo* _tmp21_;
	TrackerSparqlCursor* _tmp22_;
	const gchar* _tmp23_;
	gchar* _tmp24_;
	gchar* _tmp25_;
	TrfAfflInfo* _tmp26_;
	TrackerSparqlCursor* _tmp27_;
	const gchar* _tmp28_;
	gchar* _tmp29_;
	gchar* _tmp30_;
	TrfAfflInfo* _tmp31_;
	TrackerSparqlCursor* _tmp32_;
	const gchar* _tmp33_;
	gchar* _tmp34_;
	gchar* _tmp35_;
	TrfAfflInfo* _tmp36_;
	TrackerSparqlCursor* _tmp37_;
	const gchar* _tmp38_;
	gchar* _tmp39_;
	gchar* _tmp40_;
	TrfAfflInfo* _tmp41_;
	TrackerSparqlCursor* _tmp42_;
	const gchar* _tmp43_;
	gchar* _tmp44_;
	gchar* _tmp45_;
	TrfAfflInfo* _tmp46_;
	TrackerSparqlCursor* _tmp47_;
	const gchar* _tmp48_;
	gchar* _tmp49_;
	gchar* _tmp50_;
	TrackerSparqlCursor* _tmp51_;
	const gchar* _tmp52_;
	gchar* _tmp53_;
	gchar* po_box;
	TrackerSparqlCursor* _tmp54_;
	const gchar* _tmp55_;
	gchar* _tmp56_;
	gchar* extension;
	TrackerSparqlCursor* _tmp57_;
	const gchar* _tmp58_;
	gchar* _tmp59_;
	gchar* street;
	TrackerSparqlCursor* _tmp60_;
	const gchar* _tmp61_;
	gchar* _tmp62_;
	gchar* locality;
	TrackerSparqlCursor* _tmp63_;
	const gchar* _tmp64_;
	gchar* _tmp65_;
	gchar* region;
	TrackerSparqlCursor* _tmp66_;
	const gchar* _tmp67_;
	gchar* _tmp68_;
	gchar* postal_code;
	TrackerSparqlCursor* _tmp69_;
	const gchar* _tmp70_;
	gchar* _tmp71_;
	gchar* country;
	const gchar* _tmp72_;
	const gchar* _tmp73_;
	const gchar* _tmp74_;
	const gchar* _tmp75_;
	const gchar* _tmp76_;
	const gchar* _tmp77_;
	const gchar* _tmp78_;
	TrfAfflInfo* _tmp79_;
	const gchar* _tmp80_;
	const gchar* _tmp81_;
	FolksPostalAddress* _tmp82_;
	FolksPostalAddress* postal_address;
	TrfAfflInfo* _tmp83_;
	FolksPostalAddress* _tmp84_;
	FolksPostalAddressFieldDetails* _tmp85_;
	TrfAfflInfo* _tmp86_;
	TrackerSparqlCursor* _tmp87_;
	const gchar* _tmp88_;
	gchar* _tmp89_;
	gchar* _tmp90_;
	TrfAfflInfo* _tmp91_;
	TrackerSparqlCursor* _tmp92_;
	const gchar* _tmp93_;
	gchar* _tmp94_;
	gchar* _tmp95_;
	TrfAfflInfo* _tmp96_;
	TrackerSparqlCursor* _tmp97_;
	const gchar* _tmp98_;
	gchar* _tmp99_;
	gchar* _tmp100_;
	TrfAfflInfo* _tmp101_;
	TrackerSparqlCursor* _tmp102_;
	const gchar* _tmp103_;
	gchar* _tmp104_;
	gchar* _tmp105_;
	TrfAfflInfo* _tmp106_;
	TrackerSparqlCursor* _tmp107_;
	const gchar* _tmp108_;
	gchar* _tmp109_;
	gchar* _tmp110_;
	GError* e1;
	const gchar* _tmp111_;
	GError* _tmp112_;
	const gchar* _tmp113_;
	GError* e2;
	const gchar* _tmp114_;
	GError* _tmp115_;
	const gchar* _tmp116_;
	GError * _inner_error_;
};

struct _TrfPersonaStoreInsertPersonaData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	TrfPersonaStore* self;
	gchar* query;
	gchar* persona_var;
	gchar* result;
	GVariant* variant;
	gchar* contact_urn;
	const gchar* _tmp0_;
	TrackerSparqlConnection* _tmp1_;
	const gchar* _tmp2_;
	GVariant* _tmp3_;
	GVariant* _tmp4_;
	GVariantIter* iter1;
	GVariantIter* iter2;
	GVariantIter* iter3;
	gchar* anon_var;
	GVariant* _tmp5_;
	GVariantIter* _tmp6_;
	GVariantIter* _tmp7_;
	gboolean _tmp8_;
	GVariantIter* _tmp9_;
	GVariantIter* _tmp10_;
	gboolean _tmp11_;
	GVariantIter* _tmp12_;
	GVariantIter* _tmp13_;
	gboolean _tmp14_;
	const gchar* _tmp15_;
	const gchar* _tmp16_;
	GError* e;
	GError* _tmp17_;
	const gchar* _tmp18_;
	GError * _inner_error_;
};

struct _TrfPersonaStoreSingleValueQueryData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	TrfPersonaStore* self;
	gchar* query;
	gchar* result;
	const gchar* _tmp0_;
	GeeHashSet* _tmp1_;
	GeeHashSet* rows;
	GeeHashSet* _tmp2_;
	GeeIterator* _tmp3_;
	GeeIterator* _r_it;
	GeeIterator* _tmp4_;
	gboolean _tmp5_;
	GeeIterator* _tmp6_;
	gpointer _tmp7_;
	gchar* r;
	gchar* _tmp8_;
};

struct _TrfPersonaStoreMultiValueQueryData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	TrfPersonaStore* self;
	gchar* query;
	GeeHashSet* result;
	GeeHashSet* _tmp0_;
	GeeHashSet* ret;
	const gchar* _tmp1_;
	TrackerSparqlConnection* _tmp2_;
	const gchar* _tmp3_;
	TrackerSparqlCursor* _tmp4_;
	TrackerSparqlCursor* cursor;
	TrackerSparqlCursor* _tmp5_;
	gboolean _tmp6_;
	gboolean _tmp7_;
	TrackerSparqlCursor* _tmp8_;
	const gchar* _tmp9_;
	gchar* _tmp10_;
	gchar* prop;
	const gchar* _tmp11_;
	GeeHashSet* _tmp12_;
	const gchar* _tmp13_;
	GError* e1;
	const gchar* _tmp14_;
	GError* _tmp15_;
	const gchar* _tmp16_;
	GError* e2;
	const gchar* _tmp17_;
	GError* _tmp18_;
	const gchar* _tmp19_;
	GError * _inner_error_;
};

struct _TrfPersonaStoreUrnFromTrackerIdData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	TrfPersonaStore* self;
	gchar* tracker_id;
	gchar* result;
	const gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
};

struct _TrfPersonaStoreSetNicknameData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	TrfPersonaStore* self;
	TrfPersona* persona;
	gchar* nickname;
	TrfPersona* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	const gchar* _tmp3_;
	TrfPersona* _tmp4_;
	gchar* _tmp5_;
	gchar* _tmp6_;
	gchar* _tmp7_;
	gchar* _tmp8_;
	gchar* query;
};

struct _TrfPersonaStoreSetLocalIdsData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	TrfPersonaStore* self;
	TrfPersona* persona;
	GeeSet* local_ids;
	GeeSet* _tmp0_;
	gchar* _tmp1_;
	gchar* ids;
	TrfPersona* _tmp2_;
};

struct _TrfPersonaStoreSetWebServiceAddrsData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	TrfPersonaStore* self;
	TrfPersona* persona;
	GeeMultiMap* ws_obj;
	GeeMultiMap* _tmp0_;
	gchar* _tmp1_;
	gchar* ws_addrs;
	TrfPersona* _tmp2_;
};

struct _TrfPersonaStoreSetTrackerPropertyData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	TrfPersonaStore* self;
	TrfPersona* persona;
	gchar* prop_name;
	gchar* prop_value;
	gchar* callers_name;
	TrfPersona* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	const gchar* _tmp3_;
	const gchar* _tmp4_;
	const gchar* _tmp5_;
	TrfPersona* _tmp6_;
	gchar* _tmp7_;
	gchar* _tmp8_;
	gchar* _tmp9_;
	gchar* _tmp10_;
	gchar* query;
	const gchar* _tmp11_;
};

struct _TrfPersonaStoreSetIsFavouriteData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	TrfPersonaStore* self;
	FolksPersona* persona;
	gboolean is_favourite;
	gchar* query;
	gboolean _tmp0_;
	FolksPersona* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	FolksPersona* _tmp5_;
	gchar* _tmp6_;
	gchar* _tmp7_;
	gchar* _tmp8_;
	const gchar* _tmp9_;
};

struct _TrfPersonaStoreSetEmailsData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	TrfPersonaStore* self;
	FolksPersona* persona;
	GeeSet* emails;
	FolksPersona* _tmp0_;
	GeeSet* _tmp1_;
};

struct _TrfPersonaStoreSetPhonesData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	TrfPersonaStore* self;
	FolksPersona* persona;
	GeeSet* phone_numbers;
	FolksPersona* _tmp0_;
	GeeSet* _tmp1_;
};

struct _TrfPersonaStoreSetUniqueAttribSetData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	TrfPersonaStore* self;
	FolksPersona* persona;
	GeeSet* properties;
	TrfAttrib attrib;
	gchar* query_name;
	FolksPersona* _tmp0_;
	gchar* _tmp1_;
	gchar* p_id;
	TrackerSparqlBuilder* _tmp2_;
	TrackerSparqlBuilder* builder;
	TrackerSparqlBuilder* _tmp3_;
	TrfAttrib _tmp4_;
	gchar* _tmp5_;
	FolksPersona* _tmp6_;
	gchar* _tmp7_;
	gchar* _tmp8_;
	TrackerSparqlBuilder* _tmp9_;
	GeeSet* _tmp10_;
	gchar* _tmp11_;
	FolksPersona* _tmp12_;
	gchar* _tmp13_;
	gchar* _tmp14_;
	TrackerSparqlBuilder* _tmp15_;
	GeeSet* _tmp16_;
	TrackerSparqlBuilder* _tmp17_;
	TrackerSparqlBuilder* _tmp18_;
	TrackerSparqlBuilder* _tmp19_;
	TrackerSparqlBuilder* _tmp20_;
	TrackerSparqlBuilder* _tmp21_;
	const gchar* _tmp22_;
	gchar* _tmp23_;
	gchar* filter;
	TrackerSparqlBuilder* _tmp24_;
	TrackerSparqlBuilder* _tmp25_;
	TrackerSparqlBuilder* _tmp26_;
	const gchar* _tmp27_;
	const gchar* _tmp28_;
	const gchar* _tmp29_;
};

struct _TrfPersonaStoreSetUrlsData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	TrfPersonaStore* self;
	FolksPersona* persona;
	GeeSet* urls;
	FolksPersona* _tmp0_;
	GeeSet* _tmp1_;
};

struct _TrfPersonaStoreSetImAddressesData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	TrfPersonaStore* self;
	FolksPersona* persona;
	GeeMultiMap* im_addresses;
	GeeHashSet* _tmp0_;
	GeeHashSet* ims;
	GeeMultiMap* _tmp1_;
	GeeSet* _tmp2_;
	GeeSet* _tmp3_;
	GeeIterator* _tmp4_;
	GeeIterator* _tmp5_;
	GeeIterator* _proto_it;
	GeeIterator* _tmp6_;
	gboolean _tmp7_;
	GeeIterator* _tmp8_;
	gpointer _tmp9_;
	gchar* proto;
	GeeMultiMap* _tmp10_;
	const gchar* _tmp11_;
	GeeCollection* _tmp12_;
	GeeCollection* addrs;
	GeeCollection* _tmp13_;
	GeeIterator* _tmp14_;
	GeeIterator* _im_fd_it;
	GeeIterator* _tmp15_;
	gboolean _tmp16_;
	GeeIterator* _tmp17_;
	gpointer _tmp18_;
	FolksImFieldDetails* im_fd;
	FolksImFieldDetails* _tmp19_;
	gconstpointer _tmp20_;
	const gchar* _tmp21_;
	FolksImFieldDetails* _tmp22_;
	FolksImFieldDetails* new_im_fd;
	FolksImFieldDetails* _tmp23_;
	const gchar* _tmp24_;
	GeeHashSet* _tmp25_;
	FolksImFieldDetails* _tmp26_;
	FolksPersona* _tmp27_;
	GeeHashSet* _tmp28_;
};

struct _TrfPersonaStoreSetPostalAddressesData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	TrfPersonaStore* self;
	FolksPersona* persona;
	GeeSet* postal_addresses;
	FolksPersona* _tmp0_;
	GeeSet* _tmp1_;
};

struct _TrfPersonaStoreSetRolesData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	TrfPersonaStore* self;
	FolksPersona* persona;
	GeeSet* roles;
	FolksPersona* _tmp0_;
	gchar* _tmp1_;
	gchar* p_id;
	const gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* del_q;
	TrackerSparqlBuilder* _tmp4_;
	TrackerSparqlBuilder* builder;
	TrackerSparqlBuilder* _tmp5_;
	gint i;
	GeeSet* _tmp6_;
	GeeIterator* _tmp7_;
	GeeIterator* _role_fd_it;
	GeeIterator* _tmp8_;
	gboolean _tmp9_;
	GeeIterator* _tmp10_;
	gpointer _tmp11_;
	FolksRoleFieldDetails* role_fd;
	gint _tmp12_;
	gchar* _tmp13_;
	gchar* affl;
	TrackerSparqlBuilder* _tmp14_;
	const gchar* _tmp15_;
	TrackerSparqlBuilder* _tmp16_;
	TrackerSparqlBuilder* _tmp17_;
	TrackerSparqlBuilder* _tmp18_;
	TrackerSparqlBuilder* _tmp19_;
	FolksRoleFieldDetails* _tmp20_;
	gconstpointer _tmp21_;
	FolksRole* _tmp22_;
	const gchar* _tmp23_;
	const gchar* _tmp24_;
	TrackerSparqlBuilder* _tmp25_;
	TrackerSparqlBuilder* _tmp26_;
	FolksRoleFieldDetails* _tmp27_;
	gconstpointer _tmp28_;
	FolksRole* _tmp29_;
	const gchar* _tmp30_;
	const gchar* _tmp31_;
	TrackerSparqlBuilder* _tmp32_;
	TrackerSparqlBuilder* _tmp33_;
	FolksRoleFieldDetails* _tmp34_;
	gconstpointer _tmp35_;
	FolksRole* _tmp36_;
	const gchar* _tmp37_;
	const gchar* _tmp38_;
	TrackerSparqlBuilder* _tmp39_;
	TrackerSparqlBuilder* _tmp40_;
	TrackerSparqlBuilder* _tmp41_;
	const gchar* _tmp42_;
	TrackerSparqlBuilder* _tmp43_;
	TrackerSparqlBuilder* _tmp44_;
	TrackerSparqlBuilder* _tmp45_;
	TrackerSparqlBuilder* _tmp46_;
	TrackerSparqlBuilder* _tmp47_;
	const gchar* _tmp48_;
	gchar* _tmp49_;
	gchar* filter;
	TrackerSparqlBuilder* _tmp50_;
	TrackerSparqlBuilder* _tmp51_;
	const gchar* _tmp52_;
	TrackerSparqlBuilder* _tmp53_;
	const gchar* _tmp54_;
	const gchar* _tmp55_;
	gchar* _tmp56_;
	gchar* _tmp57_;
};

struct _TrfPersonaStoreSetNotesData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	TrfPersonaStore* self;
	FolksPersona* persona;
	GeeSet* notes;
	FolksPersona* _tmp0_;
	gchar* _tmp1_;
	gchar* p_id;
	const gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* del_q;
	TrackerSparqlBuilder* _tmp4_;
	TrackerSparqlBuilder* builder;
	TrackerSparqlBuilder* _tmp5_;
	GeeSet* _tmp6_;
	GeeIterator* _tmp7_;
	GeeIterator* _n_it;
	GeeIterator* _tmp8_;
	gboolean _tmp9_;
	GeeIterator* _tmp10_;
	gpointer _tmp11_;
	FolksNoteFieldDetails* n;
	TrackerSparqlBuilder* _tmp12_;
	TrackerSparqlBuilder* _tmp13_;
	TrackerSparqlBuilder* _tmp14_;
	FolksNoteFieldDetails* _tmp15_;
	gconstpointer _tmp16_;
	const gchar* _tmp17_;
	TrackerSparqlBuilder* _tmp18_;
	TrackerSparqlBuilder* _tmp19_;
	TrackerSparqlBuilder* _tmp20_;
	TrackerSparqlBuilder* _tmp21_;
	TrackerSparqlBuilder* _tmp22_;
	const gchar* _tmp23_;
	gchar* _tmp24_;
	gchar* filter;
	TrackerSparqlBuilder* _tmp25_;
	TrackerSparqlBuilder* _tmp26_;
	const gchar* _tmp27_;
	TrackerSparqlBuilder* _tmp28_;
	const gchar* _tmp29_;
	const gchar* _tmp30_;
	gchar* _tmp31_;
	gchar* _tmp32_;
};

struct _TrfPersonaStoreSetBirthdayData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	TrfPersonaStore* self;
	FolksPersona* persona;
	GDateTime* bday;
	FolksPersona* _tmp0_;
	gchar* _tmp1_;
	gchar* p_id;
	GTimeVal tv;
	GDateTime* _tmp2_;
	GTimeVal _tmp3_;
	gchar* _tmp4_;
	gchar* _tmp5_;
	gchar* _tmp6_;
	gchar* _tmp7_;
	gchar* query;
};

struct _TrfPersonaStoreSetGenderData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	TrfPersonaStore* self;
	FolksPersona* persona;
	FolksGender gender;
	FolksPersona* _tmp0_;
	gchar* _tmp1_;
	gchar* p_id;
	gchar* query;
	FolksGender _tmp2_;
	const gchar* _tmp3_;
	gchar* _tmp4_;
	gchar* gender_urn;
	FolksGender _tmp5_;
	gchar* _tmp6_;
	gchar* _tmp7_;
	const gchar* _tmp8_;
	gchar* _tmp9_;
	gchar* _tmp10_;
	const gchar* _tmp11_;
	const gchar* _tmp12_;
	gchar* _tmp13_;
	gchar* _tmp14_;
	gchar* _tmp15_;
	const gchar* _tmp16_;
};

struct _TrfPersonaStoreSetAvatarData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	TrfPersonaStore* self;
	FolksPersona* persona;
	GLoadableIcon* avatar;
	FolksPersona* _tmp0_;
	gchar* _tmp1_;
	gchar* p_id;
	const gchar* _tmp2_;
	gint _tmp3_;
	gchar* _tmp4_;
	gchar* image_urn;
	const gchar* _tmp5_;
	const gchar* _tmp6_;
	gchar* _tmp7_;
	gchar* _tmp8_;
	const gchar* _tmp9_;
	gchar* _tmp10_;
	gchar* query;
	FolksAvatarCache* _tmp11_;
	FolksAvatarCache* cache;
	GLoadableIcon* _tmp12_;
	FolksAvatarCache* _tmp13_;
	FolksPersona* _tmp14_;
	const gchar* _tmp15_;
	const gchar* _tmp16_;
	GLoadableIcon* _tmp17_;
	gchar* _tmp18_;
	gchar* uri;
	const gchar* _tmp19_;
	const gchar* _tmp20_;
	const gchar* _tmp21_;
	gchar* _tmp22_;
	gchar* _tmp23_;
	gchar* _tmp24_;
	GError* e1;
	FolksPersona* _tmp25_;
	const gchar* _tmp26_;
	const gchar* _tmp27_;
	GError* _tmp28_;
	const gchar* _tmp29_;
	FolksAvatarCache* _tmp30_;
	FolksPersona* _tmp31_;
	const gchar* _tmp32_;
	const gchar* _tmp33_;
	GError* e2;
	const gchar* _tmp34_;
	GError * _inner_error_;
};

struct _TrfPersonaStoreSetStructuredNameData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	TrfPersonaStore* self;
	FolksPersona* persona;
	FolksStructuredName* sname;
	FolksPersona* _tmp0_;
	gchar* _tmp1_;
	gchar* p_id;
	const gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* query;
	FolksStructuredName* _tmp4_;
	FolksStructuredName* _tmp5_;
	const gchar* _tmp6_;
	const gchar* _tmp7_;
	FolksStructuredName* _tmp8_;
	const gchar* _tmp9_;
	const gchar* _tmp10_;
	FolksStructuredName* _tmp11_;
	const gchar* _tmp12_;
	const gchar* _tmp13_;
	FolksStructuredName* _tmp14_;
	const gchar* _tmp15_;
	const gchar* _tmp16_;
	FolksStructuredName* _tmp17_;
	const gchar* _tmp18_;
	const gchar* _tmp19_;
	const gchar* _tmp20_;
	gchar* _tmp21_;
	const gchar* _tmp22_;
};

struct _TrfPersonaStoreSetFullNameData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	TrfPersonaStore* self;
	FolksPersona* persona;
	gchar* full_name;
	FolksPersona* _tmp0_;
	gchar* _tmp1_;
	gchar* p_id;
	const gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* query;
};

struct _TrfPersonaStoreSetAttribSetData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	TrfPersonaStore* self;
	FolksPersona* persona;
	GeeSet* attribs;
	TrfAttrib what;
	FolksPersona* _tmp0_;
	gchar* _tmp1_;
	gchar* p_id;
	const gchar* related_attrib;
	const gchar* related_prop;
	const gchar* related_prop_2;
	const gchar* related_connection;
	TrfAttrib _tmp2_;
	FolksPersona* _tmp3_;
	gchar* _tmp4_;
	gchar* _tmp5_;
	FolksPersona* _tmp6_;
	gchar* _tmp7_;
	gchar* _tmp8_;
	TrackerSparqlBuilder* _tmp9_;
	TrackerSparqlBuilder* builder;
	TrackerSparqlBuilder* _tmp10_;
	gint i;
	GeeSet* _tmp11_;
	GeeIterator* _tmp12_;
	GeeIterator* _p_it;
	GeeIterator* _tmp13_;
	gboolean _tmp14_;
	GeeIterator* _tmp15_;
	gpointer _tmp16_;
	GObject* p;
	FolksAbstractFieldDetails* fd;
	FolksPostalAddressFieldDetails* pafd;
	FolksPostalAddress* pa;
	gint _tmp17_;
	gchar* _tmp18_;
	gchar* affl;
	gchar* attr;
	TrfAttrib _tmp19_;
	GObject* _tmp20_;
	FolksPostalAddressFieldDetails* _tmp21_;
	FolksPostalAddressFieldDetails* _tmp22_;
	gconstpointer _tmp23_;
	FolksPostalAddress* _tmp24_;
	FolksPostalAddress* _tmp25_;
	gint _tmp26_;
	gchar* _tmp27_;
	TrackerSparqlBuilder* _tmp28_;
	const gchar* _tmp29_;
	TrackerSparqlBuilder* _tmp30_;
	TrackerSparqlBuilder* _tmp31_;
	const gchar* _tmp32_;
	TrackerSparqlBuilder* _tmp33_;
	TrackerSparqlBuilder* _tmp34_;
	FolksPostalAddress* _tmp35_;
	const gchar* _tmp36_;
	const gchar* _tmp37_;
	TrackerSparqlBuilder* _tmp38_;
	TrackerSparqlBuilder* _tmp39_;
	FolksPostalAddress* _tmp40_;
	const gchar* _tmp41_;
	const gchar* _tmp42_;
	TrackerSparqlBuilder* _tmp43_;
	TrackerSparqlBuilder* _tmp44_;
	FolksPostalAddress* _tmp45_;
	const gchar* _tmp46_;
	const gchar* _tmp47_;
	TrackerSparqlBuilder* _tmp48_;
	TrackerSparqlBuilder* _tmp49_;
	FolksPostalAddress* _tmp50_;
	const gchar* _tmp51_;
	const gchar* _tmp52_;
	TrackerSparqlBuilder* _tmp53_;
	TrackerSparqlBuilder* _tmp54_;
	FolksPostalAddress* _tmp55_;
	const gchar* _tmp56_;
	const gchar* _tmp57_;
	TrackerSparqlBuilder* _tmp58_;
	TrackerSparqlBuilder* _tmp59_;
	FolksPostalAddress* _tmp60_;
	const gchar* _tmp61_;
	const gchar* _tmp62_;
	TrackerSparqlBuilder* _tmp63_;
	TrackerSparqlBuilder* _tmp64_;
	FolksPostalAddress* _tmp65_;
	const gchar* _tmp66_;
	const gchar* _tmp67_;
	GObject* _tmp68_;
	FolksAbstractFieldDetails* _tmp69_;
	FolksAbstractFieldDetails* _tmp70_;
	GeeCollection* _tmp71_;
	GeeCollection* type_p;
	GeeCollection* _tmp72_;
	gboolean _tmp73_;
	GeeCollection* _tmp74_;
	gboolean _tmp75_;
	GeeCollection* _tmp76_;
	gboolean _tmp77_;
	FolksAbstractFieldDetails* _tmp78_;
	gconstpointer _tmp79_;
	const gchar* _tmp80_;
	gchar* _tmp81_;
	GObject* _tmp82_;
	FolksAbstractFieldDetails* _tmp83_;
	gint _tmp84_;
	gchar* _tmp85_;
	TrackerSparqlBuilder* _tmp86_;
	const gchar* _tmp87_;
	TrackerSparqlBuilder* _tmp88_;
	TrackerSparqlBuilder* _tmp89_;
	const gchar* _tmp90_;
	TrackerSparqlBuilder* _tmp91_;
	const gchar* _tmp92_;
	TrackerSparqlBuilder* _tmp93_;
	FolksAbstractFieldDetails* _tmp94_;
	gconstpointer _tmp95_;
	const gchar* _tmp96_;
	TrfAttrib _tmp97_;
	TrackerSparqlBuilder* _tmp98_;
	const gchar* _tmp99_;
	FolksAbstractFieldDetails* _tmp100_;
	GeeCollection* _tmp101_;
	GeeCollection* _tmp102_;
	gint _tmp103_;
	gpointer* _tmp104_;
	gchar** _tmp105_;
	gint _tmp105__length1;
	gchar** im_params;
	gint im_params_length1;
	gint _im_params_size_;
	TrackerSparqlBuilder* _tmp106_;
	gchar** _tmp107_;
	gint _tmp107__length1;
	const gchar* _tmp108_;
	TrackerSparqlBuilder* _tmp109_;
	const gchar* _tmp110_;
	TrackerSparqlBuilder* _tmp111_;
	TrackerSparqlBuilder* _tmp112_;
	TrackerSparqlBuilder* _tmp113_;
	const gchar* _tmp114_;
	TrackerSparqlBuilder* _tmp115_;
	const gchar* _tmp116_;
	TrackerSparqlBuilder* _tmp117_;
	TrackerSparqlBuilder* _tmp118_;
	TrackerSparqlBuilder* _tmp119_;
	const gchar* _tmp120_;
	gint _tmp121_;
	TrackerSparqlBuilder* _tmp122_;
	TrackerSparqlBuilder* _tmp123_;
	TrackerSparqlBuilder* _tmp124_;
	TrackerSparqlBuilder* _tmp125_;
	TrackerSparqlBuilder* _tmp126_;
	const gchar* _tmp127_;
	gchar* _tmp128_;
	gchar* filter;
	TrackerSparqlBuilder* _tmp129_;
	TrackerSparqlBuilder* _tmp130_;
	TrackerSparqlBuilder* _tmp131_;
	const gchar* _tmp132_;
	const gchar* _tmp133_;
};

struct _TrfPersonaStoreTrackerUpdateData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	TrfPersonaStore* self;
	gchar* query;
	gchar* caller;
	gboolean result;
	gboolean ret;
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	TrackerSparqlConnection* _tmp2_;
	const gchar* _tmp3_;
	GError* e1;
	const gchar* _tmp4_;
	GError* _tmp5_;
	const gchar* _tmp6_;
	const gchar* _tmp7_;
	GError* e2;
	const gchar* _tmp8_;
	GError* _tmp9_;
	const gchar* _tmp10_;
	GError* e3;
	const gchar* _tmp11_;
	GError* _tmp12_;
	const gchar* _tmp13_;
	GError * _inner_error_;
};

struct _TrfPersonaStoreAffiliationsFromPersonaData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	TrfPersonaStore* self;
	gchar* urn;
	GeeHashSet* result;
	const gchar* _tmp0_;
	GeeHashSet* _tmp1_;
};

struct _TrfPersonaStorePhonesFromAffiliationData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	TrfPersonaStore* self;
	gchar* affl;
	GeeHashSet* result;
	const gchar* _tmp0_;
	GeeHashSet* _tmp1_;
};

struct _TrfPersonaStorePostalsFromAffiliationData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	TrfPersonaStore* self;
	gchar* affl;
	GeeHashSet* result;
	const gchar* _tmp0_;
	GeeHashSet* _tmp1_;
};

struct _TrfPersonaStoreImaddrsFromAffiliationData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	TrfPersonaStore* self;
	gchar* affl;
	GeeHashSet* result;
	const gchar* _tmp0_;
	GeeHashSet* _tmp1_;
};

struct _TrfPersonaStoreEmailsFromAffiliationData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	TrfPersonaStore* self;
	gchar* affl;
	GeeHashSet* result;
	const gchar* _tmp0_;
	GeeHashSet* _tmp1_;
};

struct _TrfPersonaStoreResourceUsageCountData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	TrfPersonaStore* self;
	gchar* resource;
	gint result;
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* query;
	gchar* _tmp3_;
	gchar* _result_;
	gint _tmp4_;
};

struct _TrfPersonaStoreDeleteResourceData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	TrfPersonaStore* self;
	gchar* resource_urn;
	gboolean check_count;
	gboolean result;
	gboolean deleted;
	gchar* _tmp0_;
	gchar* query_t;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	const gchar* _tmp3_;
	gchar* _tmp4_;
	gchar* query;
	gboolean _tmp5_;
	const gchar* _tmp6_;
	gint _tmp7_;
	gint count;
	gint _tmp8_;
	const gchar* _tmp9_;
	gboolean _tmp10_;
	const gchar* _tmp11_;
	gboolean _tmp12_;
};

struct _TrfPersonaStoreLinkedResourcesData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	TrfPersonaStore* self;
	gchar* urn;
	gchar* subject_type;
	gchar* linking_predicate;
	GeeHashSet* result;
	gchar* _tmp0_;
	gchar* query_t;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	const gchar* _tmp3_;
	gchar* _tmp4_;
	gchar* query;
	GeeHashSet* _tmp5_;
};

struct _TrfPersonaStoreUrnFromPersonaData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	TrfPersonaStore* self;
	FolksPersona* persona;
	gchar* result;
	FolksPersona* _tmp0_;
	gchar* _tmp1_;
	gchar* id;
	gchar* _tmp2_;
};

struct _TrfPersonaStoreUrnFromPropertyData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	TrfPersonaStore* self;
	gchar* class_name;
	gchar* property_name;
	gchar* property_value;
	gchar* result;
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* query;
	gchar* _tmp4_;
};


static gpointer trf_persona_store_parent_class = NULL;
static GeeTreeMap* trf_persona_store__urn_prefix;
static GeeTreeMap* trf_persona_store__urn_prefix = NULL;
static GeeTreeMap* trf_persona_store__prefix_tracker_id;
static GeeTreeMap* trf_persona_store__prefix_tracker_id = NULL;

GType trf_fields_get_type (void) G_GNUC_CONST;
GType trf_affl_info_fields_get_type (void) G_GNUC_CONST;
GType trf_postal_address_fields_get_type (void) G_GNUC_CONST;
GType trf_urls_fields_get_type (void) G_GNUC_CONST;
GType trf_role_fields_get_type (void) G_GNUC_CONST;
GType trf_im_fields_get_type (void) G_GNUC_CONST;
GType trf_phone_fields_get_type (void) G_GNUC_CONST;
GType trf_email_fields_get_type (void) G_GNUC_CONST;
GType trf_tag_fields_get_type (void) G_GNUC_CONST;
GType trf_attrib_get_type (void) G_GNUC_CONST;
#define _REMOVE_ALL_ATTRIBS ((gchar) 0x01)
#define _REMOVE_PHONES ((gchar) 0x02)
#define _REMOVE_POSTALS ((gchar) 0x04)
#define _REMOVE_IM_ADDRS ((gchar) 0x08)
#define _REMOVE_EMAILS ((gchar) 0x10)
GType trf_persona_store_get_type (void) G_GNUC_CONST;
GType trf_persona_get_type (void) G_GNUC_CONST;
GType resources_get_type (void) G_GNUC_CONST;
GType resources_proxy_get_type (void) G_GNUC_CONST;
guint resources_register_object (void* object, GDBusConnection* connection, const gchar* path, GError** error);
#define TRF_PERSONA_STORE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TRF_TYPE_PERSONA_STORE, TrfPersonaStorePrivate))
enum  {
	TRF_PERSONA_STORE_DUMMY_PROPERTY,
	TRF_PERSONA_STORE_TYPE_ID,
	TRF_PERSONA_STORE_CAN_ADD_PERSONAS,
	TRF_PERSONA_STORE_CAN_ALIAS_PERSONAS,
	TRF_PERSONA_STORE_CAN_GROUP_PERSONAS,
	TRF_PERSONA_STORE_CAN_REMOVE_PERSONAS,
	TRF_PERSONA_STORE_IS_PREPARED,
	TRF_PERSONA_STORE_ALWAYS_WRITEABLE_PROPERTIES,
	TRF_PERSONA_STORE_IS_QUIESCENT,
	TRF_PERSONA_STORE_PERSONAS
};
#define TRF_PERSONA_STORE__LOCAL_ID_PROPERTY_NAME "folks-linking-ids"
#define TRF_PERSONA_STORE__WSD_PROPERTY_NAME "folks-linking-ws-addrs"
#define TRF_PERSONA_STORE__OBJECT_NAME "org.freedesktop.Tracker1"
#define TRF_PERSONA_STORE__OBJECT_IFACE "org.freedesktop.Tracker1.Resources"
#define TRF_PERSONA_STORE__OBJECT_PATH "/org/freedesktop/Tracker1/Resources"
#define TRF_PERSONA_STORE__default_timeout 100
#define TRF_PERSONA_STORE__INITIAL_QUERY "SELECT " "tracker:id(?_contact) " "nco:fullname(?_contact) " "nco:nameFamily(?_contact) " "nco:nameGiven(?_contact) " "nco:nameAdditional(?_contact) " "nco:nameHonorificPrefix(?_contact) " "nco:nameHonorificSuffix(?_contact) " "nco:nickname(?_contact) " "nco:birthDate(?_contact) " "nie:url(nco:photo(?_contact)) " "(SELECT " "GROUP_CONCAT ( " " fn:concat(tracker:id(?affl),'\t'," " tracker:coalesce(nco:imProtocol(?a),''), " "'\t', tracker:coalesce(nco:imID(?a),''), '\t'," " tracker:coalesce(nco:imNickname(?a),'')), '\\n') " "WHERE { ?_contact nco:hasAffiliation ?affl. " " ?affl nco:hasIMAddress ?a } ) " "(SELECT " "GROUP_CONCAT " " (fn:concat(tracker:id(?affl),'\t', " " nco:phoneNumber(?aff_number)), " "'\\n') " "WHERE { ?_contact nco:hasAffiliation ?affl . " " ?affl nco:hasPhoneNumber ?aff_number  } ) " "(SELECT " "GROUP_CONCAT " " (fn:concat(tracker:id(?affl), '\t', " "  nco:emailAddress(?emailaddress)), " "',') " "WHERE { ?_contact nco:hasAffiliation ?affl . " " ?affl nco:hasEmailAddress ?emailaddress }) " " (SELECT " "GROUP_CONCAT " " (fn:concat(tracker:id(?affl), '\t'," "  tracker:coalesce(nco:blogUrl(?affl),'')," "  '\t'," "  tracker:coalesce(nco:websiteUrl(?affl),'')" "  , '\t'," "  tracker:coalesce(nco:url(?affl),''))," "  '\\n') " "WHERE { ?_contact nco:hasAffiliation ?affl  } )" "(SELECT " "GROUP_CONCAT(tracker:id(?_tag), " "',') " "WHERE { ?_contact nao:hasTag " "?_tag }) " "?_contact " "(SELECT " "GROUP_CONCAT " " (fn:concat(tracker:id(?affl), '\t', " "  tracker:coalesce(nco:role(?affl),''), '\t', " "  tracker:coalesce(nco:department(?affl),''), '\t', " "  tracker:coalesce(nco:title(?affl),'')), " "'\\n') " "WHERE { ?_contact nco:hasAffiliation " "?affl }) " "nco:note(?_contact) " "tracker:id(nco:gender(?_contact)) " "(SELECT " "GROUP_CONCAT " " (fn:concat(tracker:id(?affl), '\t', " "  tracker:coalesce(nco:pobox(?postal),'')" "  , '\t', " "  tracker:coalesce(nco:district(?postal),'')" "  , '\t', " "  tracker:coalesce(nco:county(?postal),'')" "  , '\t', " "  tracker:coalesce(nco:locality(?postal),'')" "  , '\t', " "  tracker:coalesce(nco:postalcode(?postal),'')" "  , '\t', " "  tracker:coalesce(nco:streetAddress(?postal)" "  ,''), '\t', " "  tracker:coalesce(nco:addressLocation(?postal)" "  ,''), '\t', " "  tracker:coalesce(nco:extendedAddress(?postal)" "  ,''), '\t', " "  tracker:coalesce(nco:country(?postal),'')" "  , '\t', " "  tracker:coalesce(nco:region(?postal),'')),  " "'\\n') " "WHERE { ?_contact nco:hasAffiliation " "?affl . ?affl nco:hasPostalAddress ?postal }) " "(SELECT " "GROUP_CONCAT " " (?prop_value,  " "',') " "WHERE { ?_contact nao:hasProperty ?prop . " " ?prop nao:propertyName ?prop_name . " " ?prop nao:propertyValue ?prop_value . " " FILTER (?prop_name = 'folks-linking-ids') } ) " "{ ?_contact a nco:PersonContact . %s } " "ORDER BY tracker:id(?_contact) "
TrfPersonaStore* trf_persona_store_new (void);
TrfPersonaStore* trf_persona_store_construct (GType object_type);
static void trf_persona_store_real_add_persona_from_details_data_free (gpointer _data);
static void trf_persona_store_real_add_persona_from_details (FolksPersonaStore* base, GHashTable* details, GAsyncReadyCallback _callback_, gpointer _user_data_);
static gboolean trf_persona_store_real_add_persona_from_details_co (TrfPersonaStoreAddPersonaFromDetailsData* _data_);
static GValue* _g_value_dup (GValue* self);
#define TRF_ONTOLOGY_DEFS_NCO_NICKNAME "nco:nickname"
#define TRF_ONTOLOGY_DEFS_NCO_FULLNAME "nco:fullname"
#define TRF_ONTOLOGY_DEFS_NCO_FAMILY "nco:nameFamily"
#define TRF_ONTOLOGY_DEFS_NCO_GIVEN "nco:nameGiven"
#define TRF_ONTOLOGY_DEFS_NCO_ADDITIONAL "nco:nameAdditional"
#define TRF_ONTOLOGY_DEFS_NCO_SUFFIX "nco:nameHonorificSuffix"
#define TRF_ONTOLOGY_DEFS_NCO_PREFIX "nco:nameHonorificPrefix"
#define TRF_ONTOLOGY_DEFS_NAO_TAG "nao:hasTag"
#define TRF_ONTOLOGY_DEFS_NAO_FAVORITE "nao:predefined-tag-favorite"
#define TRF_ONTOLOGY_DEFS_NCO_BIRTHDAY "nco:birthDate"
#define TRF_ONTOLOGY_DEFS_NCO_GENDER "nco:gender"
#define TRF_ONTOLOGY_DEFS_NCO_MALE "nco:gender-male"
#define TRF_ONTOLOGY_DEFS_NCO_FEMALE "nco:gender-female"
static void _trf_persona_store_build_update_query_set (TrfPersonaStore* self, TrackerSparqlBuilder* builder, GeeSet* properties, const gchar* contact_var, TrfAttrib attrib, GAsyncReadyCallback _callback_, gpointer _user_data_);
static void _trf_persona_store_build_update_query_set_finish (TrfPersonaStore* self, GAsyncResult* _res_);
static void trf_persona_store_add_persona_from_details_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
#define TRF_ONTOLOGY_DEFS_NCO_IMADDRESS "nco:IMAddress"
#define TRF_ONTOLOGY_DEFS_NCO_IMID "nco:imID"
#define TRF_ONTOLOGY_DEFS_NCO_IMPROTOCOL "nco:imProtocol"
#define TRF_ONTOLOGY_DEFS_NCO_AFFILIATION "nco:Affiliation"
#define TRF_ONTOLOGY_DEFS_NCO_HAS_IMADDRESS "nco:hasIMAddress"
#define TRF_ONTOLOGY_DEFS_NCO_HAS_AFFILIATION "nco:hasAffiliation"
#define TRF_ONTOLOGY_DEFS_NCO_NOTE "nco:note"
#define TRF_ONTOLOGY_DEFS_NCO_ROLE "nco:role"
#define TRF_ONTOLOGY_DEFS_NCO_TITLE "nco:title"
#define TRF_ONTOLOGY_DEFS_NCO_ORG "nco:org"
#define TRF_ONTOLOGY_DEFS_NCO_POSTAL_ADDRESS "nco:PostalAddress"
#define TRF_ONTOLOGY_DEFS_NCO_POBOX "nco:pobox"
#define TRF_ONTOLOGY_DEFS_NCO_LOCALITY "nco:locality"
#define TRF_ONTOLOGY_DEFS_NCO_POSTALCODE "nco:postalcode"
#define TRF_ONTOLOGY_DEFS_NCO_STREET_ADDRESS "nco:streetAddress"
#define TRF_ONTOLOGY_DEFS_NCO_EXTENDED_ADDRESS "nco:extendedAddress"
#define TRF_ONTOLOGY_DEFS_NCO_COUNTRY "nco:country"
#define TRF_ONTOLOGY_DEFS_NCO_REGION "nco:region"
#define TRF_ONTOLOGY_DEFS_NCO_HAS_POSTAL_ADDRESS "nco:hasPostalAddress"
#define TRF_ONTOLOGY_DEFS_NCO_URL "nco:url"
gchar* trf_persona_store_serialize_local_ids (GeeSet* local_ids);
#define TRF_ONTOLOGY_DEFS_NAO_PROPERTY "nao:Property"
#define TRF_ONTOLOGY_DEFS_NAO_PROPERTY_NAME "nao:propertyName"
#define TRF_ONTOLOGY_DEFS_NAO_PROPERTY_VALUE "nao:propertyValue"
#define TRF_ONTOLOGY_DEFS_NAO_HAS_PROPERTY "nao:hasProperty"
gchar* trf_persona_store_serialize_web_services (GeeMultiMap* ws_obj);
static void _vala_GValue_free (GValue* self);
static void _trf_persona_store_insert_persona (TrfPersonaStore* self, const gchar* query, const gchar* persona_var, GAsyncReadyCallback _callback_, gpointer _user_data_);
static gchar* _trf_persona_store_insert_persona_finish (TrfPersonaStore* self, GAsyncResult* _res_);
static void _trf_persona_store_do_add_contacts (TrfPersonaStore* self, const gchar* query, GAsyncReadyCallback _callback_, gpointer _user_data_);
static GeeHashSet* _trf_persona_store_do_add_contacts_finish (TrfPersonaStore* self, GAsyncResult* _res_);
void _trf_persona_store_set_avatar (TrfPersonaStore* self, FolksPersona* persona, GLoadableIcon* avatar, GAsyncReadyCallback _callback_, gpointer _user_data_);
void _trf_persona_store_set_avatar_finish (TrfPersonaStore* self, GAsyncResult* _res_);
GeeMultiMap* trf_persona_store_unserialize_web_services (const gchar* ws_addrs);
GeeSet* trf_persona_store_unserialize_local_ids (const gchar* local_ids);
static void trf_persona_store_real_remove_persona_data_free (gpointer _data);
static void trf_persona_store_real_remove_persona (FolksPersonaStore* base, FolksPersona* persona, GAsyncReadyCallback _callback_, gpointer _user_data_);
static gboolean trf_persona_store_real_remove_persona_co (TrfPersonaStoreRemovePersonaData* _data_);
static void _trf_persona_store_remove_attributes_from_persona (TrfPersonaStore* self, FolksPersona* persona, gchar remove_flag, GAsyncReadyCallback _callback_, gpointer _user_data_);
static gchar* _trf_persona_store_remove_attributes_from_persona_finish (TrfPersonaStore* self, GAsyncResult* _res_);
static void trf_persona_store_remove_persona_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static void _trf_persona_store_tracker_update (TrfPersonaStore* self, const gchar* query, const gchar* caller, GAsyncReadyCallback _callback_, gpointer _user_data_);
static gboolean _trf_persona_store_tracker_update_finish (TrfPersonaStore* self, GAsyncResult* _res_);
static void _trf_persona_store_remove_attributes_from_persona_data_free (gpointer _data);
static gboolean _trf_persona_store_remove_attributes_from_persona_co (TrfPersonaStoreRemoveAttributesFromPersonaData* _data_);
static void _trf_persona_store_urn_from_persona (TrfPersonaStore* self, FolksPersona* persona, GAsyncReadyCallback _callback_, gpointer _user_data_);
static gchar* _trf_persona_store_urn_from_persona_finish (TrfPersonaStore* self, GAsyncResult* _res_);
static void _trf_persona_store_remove_attributes_from_persona_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static void _trf_persona_store_remove_attributes (TrfPersonaStore* self, const gchar* urn, gchar remove_flag, GAsyncReadyCallback _callback_, gpointer _user_data_);
static void _trf_persona_store_remove_attributes_finish (TrfPersonaStore* self, GAsyncResult* _res_);
static void _trf_persona_store_build_update_query_set_data_free (gpointer _data);
static gboolean _trf_persona_store_build_update_query_set_co (TrfPersonaStoreBuildUpdateQuerySetData* _data_);
#define TRF_ONTOLOGY_DEFS_NCO_PHONE "nco:PhoneNumber"
#define TRF_ONTOLOGY_DEFS_NCO_PHONE_PROP "nco:phoneNumber"
#define TRF_ONTOLOGY_DEFS_NCO_HAS_PHONE "nco:hasPhoneNumber"
#define TRF_ONTOLOGY_DEFS_NCO_EMAIL "nco:EmailAddress"
#define TRF_ONTOLOGY_DEFS_NCO_EMAIL_PROP "nco:emailAddress"
#define TRF_ONTOLOGY_DEFS_NCO_HAS_EMAIL "nco:hasEmailAddress"
static void _trf_persona_store_urn_from_property (TrfPersonaStore* self, const gchar* class_name, const gchar* property_name, const gchar* property_value, GAsyncReadyCallback _callback_, gpointer _user_data_);
static gchar* _trf_persona_store_urn_from_property_finish (TrfPersonaStore* self, GAsyncResult* _res_);
static void _trf_persona_store_build_update_query_set_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static void _trf_persona_store_remove_attributes_data_free (gpointer _data);
static gboolean _trf_persona_store_remove_attributes_co (TrfPersonaStoreRemoveAttributesData* _data_);
static void _trf_persona_store_affiliations_from_persona (TrfPersonaStore* self, const gchar* urn, GAsyncReadyCallback _callback_, gpointer _user_data_);
static GeeHashSet* _trf_persona_store_affiliations_from_persona_finish (TrfPersonaStore* self, GAsyncResult* _res_);
static void _trf_persona_store_remove_attributes_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static void _trf_persona_store_phones_from_affiliation (TrfPersonaStore* self, const gchar* affl, GAsyncReadyCallback _callback_, gpointer _user_data_);
static GeeHashSet* _trf_persona_store_phones_from_affiliation_finish (TrfPersonaStore* self, GAsyncResult* _res_);
static void _trf_persona_store_delete_resource (TrfPersonaStore* self, const gchar* resource_urn, gboolean check_count, GAsyncReadyCallback _callback_, gpointer _user_data_);
static gboolean _trf_persona_store_delete_resource_finish (TrfPersonaStore* self, GAsyncResult* _res_);
static void _trf_persona_store_postals_from_affiliation (TrfPersonaStore* self, const gchar* affl, GAsyncReadyCallback _callback_, gpointer _user_data_);
static GeeHashSet* _trf_persona_store_postals_from_affiliation_finish (TrfPersonaStore* self, GAsyncResult* _res_);
static void _trf_persona_store_imaddrs_from_affiliation (TrfPersonaStore* self, const gchar* affl, GAsyncReadyCallback _callback_, gpointer _user_data_);
static GeeHashSet* _trf_persona_store_imaddrs_from_affiliation_finish (TrfPersonaStore* self, GAsyncResult* _res_);
static void _trf_persona_store_emails_from_affiliation (TrfPersonaStore* self, const gchar* affl, GAsyncReadyCallback _callback_, gpointer _user_data_);
static GeeHashSet* _trf_persona_store_emails_from_affiliation_finish (TrfPersonaStore* self, GAsyncResult* _res_);
static void trf_persona_store_real_prepare_data_free (gpointer _data);
static void trf_persona_store_real_prepare (FolksPersonaStore* base, GAsyncReadyCallback _callback_, gpointer _user_data_);
static gboolean trf_persona_store_real_prepare_co (TrfPersonaStorePrepareData* _data_);
static void trf_persona_store_prepare_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static void _trf_persona_store_build_predicates_table (TrfPersonaStore* self, GAsyncReadyCallback _callback_, gpointer _user_data_);
static void _trf_persona_store_build_predicates_table_finish (TrfPersonaStore* self, GAsyncResult* _res_);
#define TRF_ONTOLOGY_DEFS_PERSON_CLASS "http://www.semanticdesktop.org/ontologies/2007/03/22/nco#PersonContact"
static void _trf_persona_store_graph_updated_cb (TrfPersonaStore* self, GDBusConnection* connection, const gchar* sender_name, const gchar* object_path, const gchar* interface_name, const gchar* signal_name, GVariant* parameters);
static void __trf_persona_store_graph_updated_cb_gd_bus_signal_callback (GDBusConnection* connection, const gchar* sender_name, const gchar* object_path, const gchar* interface_name, const gchar* signal_name, GVariant* parameters, gpointer self);
gint trf_persona_store_get_favorite_id (TrfPersonaStore* self);
gint trf_persona_store_get_gender_male_id (TrfPersonaStore* self);
gint trf_persona_store_get_gender_female_id (TrfPersonaStore* self);
static void _trf_persona_store_build_predicates_table_data_free (gpointer _data);
static gboolean _trf_persona_store_build_predicates_table_co (TrfPersonaStoreBuildPredicatesTableData* _data_);
static void _trf_persona_store_build_urn_prefix_table (TrfPersonaStore* self, GAsyncReadyCallback _callback_, gpointer _user_data_);
static void _trf_persona_store_build_urn_prefix_table_finish (TrfPersonaStore* self, GAsyncResult* _res_);
static void _trf_persona_store_build_predicates_table_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static void _trf_persona_store_build_urn_prefix_table_data_free (gpointer _data);
static gboolean _trf_persona_store_build_urn_prefix_table_co (TrfPersonaStoreBuildUrnPrefixTableData* _data_);
#define TRF_ONTOLOGY_DEFS_NCO_URL_PREFIX "<http://www.semanticdesktop.org/ontologies/2007/03/22/"
#define TRF_ONTOLOGY_DEFS_RDF_URL_PREFIX "<http://www.w3.org/1999/02/"
#define TRF_ONTOLOGY_DEFS_RDF_TYPE "ns:type"
#define TRF_ONTOLOGY_DEFS_NCO_PERSON "nco:PersonContact"
#define TRF_ONTOLOGY_DEFS_NCO_WEBSITE "nco:websiteUrl"
#define TRF_ONTOLOGY_DEFS_NCO_BLOG "nco:blogUrl"
#define TRF_ONTOLOGY_DEFS_NAO_URL_PREFIX "<http://www.semanticdesktop.org/ontologies/2007/08/15/"
#define TRF_ONTOLOGY_DEFS_NCO_PHOTO "nco:photo"
static void _trf_persona_store_handle_events (TrfPersonaStore* self, GVariantIter* iter_del, GVariantIter* iter_ins, GAsyncReadyCallback _callback_, gpointer _user_data_);
static void _trf_persona_store_handle_events_finish (TrfPersonaStore* self, GAsyncResult* _res_);
static void _trf_persona_store_handle_events_data_free (gpointer _data);
static gboolean _trf_persona_store_handle_events_co (TrfPersonaStoreHandleEventsData* _data_);
static void _trf_persona_store_handle_delete_events (TrfPersonaStore* self, GVariantIter* iter_del, GAsyncReadyCallback _callback_, gpointer _user_data_);
static void _trf_persona_store_handle_delete_events_finish (TrfPersonaStore* self, GAsyncResult* _res_);
static void _trf_persona_store_handle_events_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static void _trf_persona_store_handle_insert_events (TrfPersonaStore* self, GVariantIter* iter_ins, GAsyncReadyCallback _callback_, gpointer _user_data_);
static void _trf_persona_store_handle_insert_events_finish (TrfPersonaStore* self, GAsyncResult* _res_);
static void _trf_persona_store_handle_delete_events_data_free (gpointer _data);
static gboolean _trf_persona_store_handle_delete_events_co (TrfPersonaStoreHandleDeleteEventsData* _data_);
GType event_get_type (void) G_GNUC_CONST;
Event* event_dup (const Event* self);
void event_free (Event* self);
gchar* trf_persona_build_iid (const gchar* store_id, const gchar* tracker_id);
static void _trf_persona_store_do_update (TrfPersonaStore* self, TrfPersona* p, Event* e, gboolean adding, GAsyncReadyCallback _callback_, gpointer _user_data_);
static void _trf_persona_store_do_update_finish (TrfPersonaStore* self, GAsyncResult* _res_);
static void _trf_persona_store_handle_delete_events_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static void _trf_persona_store_handle_insert_events_data_free (gpointer _data);
static gboolean _trf_persona_store_handle_insert_events_co (TrfPersonaStoreHandleInsertEventsData* _data_);
TrfPersona* trf_persona_new (TrfPersonaStore* store, const gchar* tracker_id, TrackerSparqlCursor* cursor);
TrfPersona* trf_persona_construct (GType object_type, TrfPersonaStore* store, const gchar* tracker_id, TrackerSparqlCursor* cursor);
static void _trf_persona_store_handle_insert_events_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static void _trf_persona_store_do_add_contacts_data_free (gpointer _data);
static gboolean _trf_persona_store_do_add_contacts_co (TrfPersonaStoreDoAddContactsData* _data_);
static void _trf_persona_store_do_add_contacts_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static void _trf_persona_store_do_update_data_free (gpointer _data);
static gboolean _trf_persona_store_do_update_co (TrfPersonaStoreDoUpdateData* _data_);
static void _trf_persona_store_get_property (TrfPersonaStore* self, gint subject_tracker_id, const gchar* property, const gchar* subject_type, GAsyncReadyCallback _callback_, gpointer _user_data_);
static gchar* _trf_persona_store_get_property_finish (TrfPersonaStore* self, GAsyncResult* _res_);
static void _trf_persona_store_do_update_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
void _trf_persona_update_full_name (TrfPersona* self, const gchar* fn);
void _trf_persona_update_nickname (TrfPersona* self, const gchar* nickname);
void _trf_persona_update_family_name (TrfPersona* self, const gchar* family_name);
void _trf_persona_update_given_name (TrfPersona* self, const gchar* given_name);
void _trf_persona_update_additional_names (TrfPersona* self, const gchar* additional_names);
void _trf_persona_update_suffixes (TrfPersona* self, const gchar* suffixes);
void _trf_persona_update_prefixes (TrfPersona* self, const gchar* prefixes);
void _trf_persona_set_favourite (TrfPersona* self, gboolean is_fav);
gboolean _trf_persona_add_email (TrfPersona* self, const gchar* addr, const gchar* tracker_id);
gboolean _trf_persona_remove_email (TrfPersona* self, const gchar* tracker_id);
gboolean _trf_persona_add_phone (TrfPersona* self, const gchar* phone, const gchar* tracker_id);
gboolean _trf_persona_remove_phone (TrfPersona* self, const gchar* tracker_id);
static void _trf_persona_store_get_affl_info (TrfPersonaStore* self, const gchar* person_id, const gchar* affiliation_id, GAsyncReadyCallback _callback_, gpointer _user_data_);
GType trf_affl_info_get_type (void) G_GNUC_CONST;
static TrfAfflInfo* _trf_persona_store_get_affl_info_finish (TrfPersonaStore* self, GAsyncResult* _res_);
gchar* trf_affl_info_to_string (TrfAfflInfo* self);
const gchar* trf_affl_info_get_im_tracker_id (TrfAfflInfo* self);
const gchar* trf_affl_info_get_im_nickname (TrfAfflInfo* self);
const gchar* trf_affl_info_get_im_proto (TrfAfflInfo* self);
gboolean _trf_persona_add_im_address (TrfPersona* self, const gchar* tracker_id, const gchar* im_proto, const gchar* account_id, gboolean notify);
const gchar* trf_affl_info_get_affl_tracker_id (TrfAfflInfo* self);
const gchar* trf_affl_info_get_im_account_id (TrfAfflInfo* self);
const gchar* trf_affl_info_get_title (TrfAfflInfo* self);
const gchar* trf_affl_info_get_org (TrfAfflInfo* self);
gboolean _trf_persona_add_role (TrfPersona* self, const gchar* tracker_id, const gchar* role, const gchar* title, const gchar* org);
const gchar* trf_affl_info_get_role (TrfAfflInfo* self);
gboolean _trf_persona_add_postal_address (TrfPersona* self, FolksPostalAddressFieldDetails* postal_address_fd);
const gchar* trf_affl_info_get_phone (TrfAfflInfo* self);
const gchar* trf_affl_info_get_email (TrfAfflInfo* self);
const gchar* trf_affl_info_get_website (TrfAfflInfo* self);
gboolean _trf_persona_add_url (TrfPersona* self, const gchar* url, const gchar* tracker_id, const gchar* type);
const gchar* trf_affl_info_get_blog (TrfAfflInfo* self);
const gchar* trf_affl_info_get_url (TrfAfflInfo* self);
gboolean _trf_persona_remove_im_address (TrfPersona* self, const gchar* tracker_id, gboolean notify);
gboolean _trf_persona_remove_role (TrfPersona* self, const gchar* tracker_id);
gboolean _trf_persona_remove_postal_address (TrfPersona* self, const gchar* tracker_id);
gboolean _trf_persona_remove_url (TrfPersona* self, const gchar* tracker_id);
void _trf_persona_set_birthday (TrfPersona* self, const gchar* birthday);
void _trf_persona_set_note (TrfPersona* self, const gchar* note_content);
void _trf_persona_set_gender (TrfPersona* self, gint gender_id);
#define TRF_ONTOLOGY_DEFS_NIE_URL "nie:url"
#define TRF_ONTOLOGY_DEFS_NFO_IMAGE "nfo:Image"
gboolean _trf_persona_set_avatar_from_uri (TrfPersona* self, const gchar* avatar_url);
static void _trf_persona_store_get_nao_property_by_prop_id (TrfPersonaStore* self, gint nao_prop_id, GAsyncReadyCallback _callback_, gpointer _user_data_);
static gchar** _trf_persona_store_get_nao_property_by_prop_id_finish (TrfPersonaStore* self, GAsyncResult* _res_, int* result_length1);
gboolean _trf_persona_set_local_ids (TrfPersona* self, const gchar* local_ids);
gboolean _trf_persona_set_web_service_addrs (TrfPersona* self, const gchar* ws_addrs);
static void _trf_persona_store_get_nao_property_by_person_id (TrfPersonaStore* self, gint nco_person_id, const gchar* prop_name, GAsyncReadyCallback _callback_, gpointer _user_data_);
static gchar* _trf_persona_store_get_nao_property_by_person_id_finish (TrfPersonaStore* self, GAsyncResult* _res_);
static void _trf_persona_store_get_property_data_free (gpointer _data);
static gboolean _trf_persona_store_get_property_co (TrfPersonaStoreGetPropertyData* _data_);
static void _trf_persona_store_single_value_query (TrfPersonaStore* self, const gchar* query, GAsyncReadyCallback _callback_, gpointer _user_data_);
static gchar* _trf_persona_store_single_value_query_finish (TrfPersonaStore* self, GAsyncResult* _res_);
static void _trf_persona_store_get_property_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static void _trf_persona_store_get_nao_property_by_person_id_data_free (gpointer _data);
static gboolean _trf_persona_store_get_nao_property_by_person_id_co (TrfPersonaStoreGetNaoPropertyByPersonIdData* _data_);
static void _trf_persona_store_get_nao_property_by_person_id_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static void _trf_persona_store_get_nao_property_by_prop_id_data_free (gpointer _data);
static gboolean _trf_persona_store_get_nao_property_by_prop_id_co (TrfPersonaStoreGetNaoPropertyByPropIdData* _data_);
static void _trf_persona_store_get_nao_property_by_prop_id_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static void _trf_persona_store_get_affl_info_data_free (gpointer _data);
static gboolean _trf_persona_store_get_affl_info_co (TrfPersonaStoreGetAfflInfoData* _data_);
TrfAfflInfo* trf_affl_info_new (void);
TrfAfflInfo* trf_affl_info_construct (GType object_type);
#define TRF_ONTOLOGY_DEFS_NCO_DISTRICT "nco:district"
#define TRF_ONTOLOGY_DEFS_NCO_COUNTY "nco:county"
#define TRF_ONTOLOGY_DEFS_NCO_ADDRESS_LOCATION "nco:addressLocation"
#define TRF_ONTOLOGY_DEFS_NCO_IM_NICKNAME "nco:imNickname"
static void _trf_persona_store_get_affl_info_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
void trf_affl_info_set_im_tracker_id (TrfAfflInfo* self, const gchar* value);
void trf_affl_info_set_im_proto (TrfAfflInfo* self, const gchar* value);
void trf_affl_info_set_im_account_id (TrfAfflInfo* self, const gchar* value);
void trf_affl_info_set_im_nickname (TrfAfflInfo* self, const gchar* value);
void trf_affl_info_set_affl_tracker_id (TrfAfflInfo* self, const gchar* value);
void trf_affl_info_set_role (TrfAfflInfo* self, const gchar* value);
void trf_affl_info_set_org (TrfAfflInfo* self, const gchar* value);
void trf_affl_info_set_title (TrfAfflInfo* self, const gchar* value);
void trf_affl_info_set_email (TrfAfflInfo* self, const gchar* value);
void trf_affl_info_set_phone (TrfAfflInfo* self, const gchar* value);
void trf_affl_info_set_website (TrfAfflInfo* self, const gchar* value);
void trf_affl_info_set_blog (TrfAfflInfo* self, const gchar* value);
void trf_affl_info_set_url (TrfAfflInfo* self, const gchar* value);
static void _trf_persona_store_insert_persona_data_free (gpointer _data);
static gboolean _trf_persona_store_insert_persona_co (TrfPersonaStoreInsertPersonaData* _data_);
static void _trf_persona_store_insert_persona_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static void _trf_persona_store_single_value_query_data_free (gpointer _data);
static gboolean _trf_persona_store_single_value_query_co (TrfPersonaStoreSingleValueQueryData* _data_);
static void _trf_persona_store_multi_value_query (TrfPersonaStore* self, const gchar* query, GAsyncReadyCallback _callback_, gpointer _user_data_);
static GeeHashSet* _trf_persona_store_multi_value_query_finish (TrfPersonaStore* self, GAsyncResult* _res_);
static void _trf_persona_store_single_value_query_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static void _trf_persona_store_multi_value_query_data_free (gpointer _data);
static gboolean _trf_persona_store_multi_value_query_co (TrfPersonaStoreMultiValueQueryData* _data_);
static void _trf_persona_store_multi_value_query_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static void _trf_persona_store_urn_from_tracker_id_data_free (gpointer _data);
static void _trf_persona_store_urn_from_tracker_id (TrfPersonaStore* self, const gchar* tracker_id, GAsyncReadyCallback _callback_, gpointer _user_data_);
static gchar* _trf_persona_store_urn_from_tracker_id_finish (TrfPersonaStore* self, GAsyncResult* _res_);
static gboolean _trf_persona_store_urn_from_tracker_id_co (TrfPersonaStoreUrnFromTrackerIdData* _data_);
static void _trf_persona_store_urn_from_tracker_id_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static void _trf_persona_store_set_nickname_data_free (gpointer _data);
void _trf_persona_store_set_nickname (TrfPersonaStore* self, TrfPersona* persona, const gchar* nickname, GAsyncReadyCallback _callback_, gpointer _user_data_);
void _trf_persona_store_set_nickname_finish (TrfPersonaStore* self, GAsyncResult* _res_);
static gboolean _trf_persona_store_set_nickname_co (TrfPersonaStoreSetNicknameData* _data_);
gchar* trf_persona_tracker_id (TrfPersona* self);
static void _trf_persona_store_set_nickname_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static void _trf_persona_store_set_local_ids_data_free (gpointer _data);
void _trf_persona_store_set_local_ids (TrfPersonaStore* self, TrfPersona* persona, GeeSet* local_ids, GAsyncReadyCallback _callback_, gpointer _user_data_);
void _trf_persona_store_set_local_ids_finish (TrfPersonaStore* self, GAsyncResult* _res_);
static gboolean _trf_persona_store_set_local_ids_co (TrfPersonaStoreSetLocalIdsData* _data_);
static void _trf_persona_store_set_tracker_property (TrfPersonaStore* self, TrfPersona* persona, const gchar* prop_name, const gchar* prop_value, const gchar* callers_name, GAsyncReadyCallback _callback_, gpointer _user_data_);
static void _trf_persona_store_set_tracker_property_finish (TrfPersonaStore* self, GAsyncResult* _res_);
static void _trf_persona_store_set_local_ids_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static void _trf_persona_store_set_web_service_addrs_data_free (gpointer _data);
void _trf_persona_store_set_web_service_addrs (TrfPersonaStore* self, TrfPersona* persona, GeeMultiMap* ws_obj, GAsyncReadyCallback _callback_, gpointer _user_data_);
void _trf_persona_store_set_web_service_addrs_finish (TrfPersonaStore* self, GAsyncResult* _res_);
static gboolean _trf_persona_store_set_web_service_addrs_co (TrfPersonaStoreSetWebServiceAddrsData* _data_);
static void _trf_persona_store_set_web_service_addrs_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static void _trf_persona_store_set_tracker_property_data_free (gpointer _data);
static gboolean _trf_persona_store_set_tracker_property_co (TrfPersonaStoreSetTrackerPropertyData* _data_);
static void _trf_persona_store_set_tracker_property_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static void _trf_persona_store_set_is_favourite_data_free (gpointer _data);
void _trf_persona_store_set_is_favourite (TrfPersonaStore* self, FolksPersona* persona, gboolean is_favourite, GAsyncReadyCallback _callback_, gpointer _user_data_);
void _trf_persona_store_set_is_favourite_finish (TrfPersonaStore* self, GAsyncResult* _res_);
static gboolean _trf_persona_store_set_is_favourite_co (TrfPersonaStoreSetIsFavouriteData* _data_);
static void _trf_persona_store_set_is_favourite_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static void _trf_persona_store_set_emails_data_free (gpointer _data);
void _trf_persona_store_set_emails (TrfPersonaStore* self, FolksPersona* persona, GeeSet* emails, GAsyncReadyCallback _callback_, gpointer _user_data_);
void _trf_persona_store_set_emails_finish (TrfPersonaStore* self, GAsyncResult* _res_);
static gboolean _trf_persona_store_set_emails_co (TrfPersonaStoreSetEmailsData* _data_);
void _trf_persona_store_set_unique_attrib_set (TrfPersonaStore* self, FolksPersona* persona, GeeSet* properties, TrfAttrib attrib, GAsyncReadyCallback _callback_, gpointer _user_data_);
void _trf_persona_store_set_unique_attrib_set_finish (TrfPersonaStore* self, GAsyncResult* _res_);
static void _trf_persona_store_set_emails_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static void _trf_persona_store_set_phones_data_free (gpointer _data);
void _trf_persona_store_set_phones (TrfPersonaStore* self, FolksPersona* persona, GeeSet* phone_numbers, GAsyncReadyCallback _callback_, gpointer _user_data_);
void _trf_persona_store_set_phones_finish (TrfPersonaStore* self, GAsyncResult* _res_);
static gboolean _trf_persona_store_set_phones_co (TrfPersonaStoreSetPhonesData* _data_);
static void _trf_persona_store_set_phones_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static void _trf_persona_store_set_unique_attrib_set_data_free (gpointer _data);
static gboolean _trf_persona_store_set_unique_attrib_set_co (TrfPersonaStoreSetUniqueAttribSetData* _data_);
static void _trf_persona_store_set_unique_attrib_set_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static void _trf_persona_store_set_urls_data_free (gpointer _data);
void _trf_persona_store_set_urls (TrfPersonaStore* self, FolksPersona* persona, GeeSet* urls, GAsyncReadyCallback _callback_, gpointer _user_data_);
void _trf_persona_store_set_urls_finish (TrfPersonaStore* self, GAsyncResult* _res_);
static gboolean _trf_persona_store_set_urls_co (TrfPersonaStoreSetUrlsData* _data_);
static void _trf_persona_store_set_attrib_set (TrfPersonaStore* self, FolksPersona* persona, GeeSet* attribs, TrfAttrib what, GAsyncReadyCallback _callback_, gpointer _user_data_);
static void _trf_persona_store_set_attrib_set_finish (TrfPersonaStore* self, GAsyncResult* _res_);
static void _trf_persona_store_set_urls_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static void _trf_persona_store_set_im_addresses_data_free (gpointer _data);
void _trf_persona_store_set_im_addresses (TrfPersonaStore* self, FolksPersona* persona, GeeMultiMap* im_addresses, GAsyncReadyCallback _callback_, gpointer _user_data_);
void _trf_persona_store_set_im_addresses_finish (TrfPersonaStore* self, GAsyncResult* _res_);
static gboolean _trf_persona_store_set_im_addresses_co (TrfPersonaStoreSetImAddressesData* _data_);
static void _trf_persona_store_set_im_addresses_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static void _trf_persona_store_set_postal_addresses_data_free (gpointer _data);
void _trf_persona_store_set_postal_addresses (TrfPersonaStore* self, FolksPersona* persona, GeeSet* postal_addresses, GAsyncReadyCallback _callback_, gpointer _user_data_);
void _trf_persona_store_set_postal_addresses_finish (TrfPersonaStore* self, GAsyncResult* _res_);
static gboolean _trf_persona_store_set_postal_addresses_co (TrfPersonaStoreSetPostalAddressesData* _data_);
static void _trf_persona_store_set_postal_addresses_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static void _trf_persona_store_set_roles_data_free (gpointer _data);
void _trf_persona_store_set_roles (TrfPersonaStore* self, FolksPersona* persona, GeeSet* roles, GAsyncReadyCallback _callback_, gpointer _user_data_);
void _trf_persona_store_set_roles_finish (TrfPersonaStore* self, GAsyncResult* _res_);
static gboolean _trf_persona_store_set_roles_co (TrfPersonaStoreSetRolesData* _data_);
static void _trf_persona_store_set_roles_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static void _trf_persona_store_set_notes_data_free (gpointer _data);
void _trf_persona_store_set_notes (TrfPersonaStore* self, FolksPersona* persona, GeeSet* notes, GAsyncReadyCallback _callback_, gpointer _user_data_);
void _trf_persona_store_set_notes_finish (TrfPersonaStore* self, GAsyncResult* _res_);
static gboolean _trf_persona_store_set_notes_co (TrfPersonaStoreSetNotesData* _data_);
static void _trf_persona_store_set_notes_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static void _trf_persona_store_set_birthday_data_free (gpointer _data);
void _trf_persona_store_set_birthday (TrfPersonaStore* self, FolksPersona* persona, GDateTime* bday, GAsyncReadyCallback _callback_, gpointer _user_data_);
void _trf_persona_store_set_birthday_finish (TrfPersonaStore* self, GAsyncResult* _res_);
static gboolean _trf_persona_store_set_birthday_co (TrfPersonaStoreSetBirthdayData* _data_);
static void _trf_persona_store_set_birthday_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static void _trf_persona_store_set_gender_data_free (gpointer _data);
void _trf_persona_store_set_gender (TrfPersonaStore* self, FolksPersona* persona, FolksGender gender, GAsyncReadyCallback _callback_, gpointer _user_data_);
void _trf_persona_store_set_gender_finish (TrfPersonaStore* self, GAsyncResult* _res_);
static gboolean _trf_persona_store_set_gender_co (TrfPersonaStoreSetGenderData* _data_);
static void _trf_persona_store_set_gender_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static void _trf_persona_store_set_avatar_data_free (gpointer _data);
static gboolean _trf_persona_store_set_avatar_co (TrfPersonaStoreSetAvatarData* _data_);
#define TRF_ONTOLOGY_DEFS_NIE_DATAOBJECT "nie:DataObject"
static void _trf_persona_store_set_avatar_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static void _trf_persona_store_set_structured_name_data_free (gpointer _data);
void _trf_persona_store_set_structured_name (TrfPersonaStore* self, FolksPersona* persona, FolksStructuredName* sname, GAsyncReadyCallback _callback_, gpointer _user_data_);
void _trf_persona_store_set_structured_name_finish (TrfPersonaStore* self, GAsyncResult* _res_);
static gboolean _trf_persona_store_set_structured_name_co (TrfPersonaStoreSetStructuredNameData* _data_);
static void _trf_persona_store_set_structured_name_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static void _trf_persona_store_set_full_name_data_free (gpointer _data);
void _trf_persona_store_set_full_name (TrfPersonaStore* self, FolksPersona* persona, const gchar* full_name, GAsyncReadyCallback _callback_, gpointer _user_data_);
void _trf_persona_store_set_full_name_finish (TrfPersonaStore* self, GAsyncResult* _res_);
static gboolean _trf_persona_store_set_full_name_co (TrfPersonaStoreSetFullNameData* _data_);
static void _trf_persona_store_set_full_name_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static void _trf_persona_store_set_attrib_set_data_free (gpointer _data);
static gboolean _trf_persona_store_set_attrib_set_co (TrfPersonaStoreSetAttribSetData* _data_);
static void _trf_persona_store_set_attrib_set_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static void _trf_persona_store_tracker_update_data_free (gpointer _data);
static gboolean _trf_persona_store_tracker_update_co (TrfPersonaStoreTrackerUpdateData* _data_);
static void _trf_persona_store_tracker_update_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static void _trf_persona_store_affiliations_from_persona_data_free (gpointer _data);
static gboolean _trf_persona_store_affiliations_from_persona_co (TrfPersonaStoreAffiliationsFromPersonaData* _data_);
static void _trf_persona_store_linked_resources (TrfPersonaStore* self, const gchar* urn, const gchar* subject_type, const gchar* linking_predicate, GAsyncReadyCallback _callback_, gpointer _user_data_);
static GeeHashSet* _trf_persona_store_linked_resources_finish (TrfPersonaStore* self, GAsyncResult* _res_);
static void _trf_persona_store_affiliations_from_persona_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static void _trf_persona_store_phones_from_affiliation_data_free (gpointer _data);
static gboolean _trf_persona_store_phones_from_affiliation_co (TrfPersonaStorePhonesFromAffiliationData* _data_);
static void _trf_persona_store_phones_from_affiliation_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static void _trf_persona_store_postals_from_affiliation_data_free (gpointer _data);
static gboolean _trf_persona_store_postals_from_affiliation_co (TrfPersonaStorePostalsFromAffiliationData* _data_);
static void _trf_persona_store_postals_from_affiliation_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static void _trf_persona_store_imaddrs_from_affiliation_data_free (gpointer _data);
static gboolean _trf_persona_store_imaddrs_from_affiliation_co (TrfPersonaStoreImaddrsFromAffiliationData* _data_);
static void _trf_persona_store_imaddrs_from_affiliation_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static void _trf_persona_store_emails_from_affiliation_data_free (gpointer _data);
static gboolean _trf_persona_store_emails_from_affiliation_co (TrfPersonaStoreEmailsFromAffiliationData* _data_);
static void _trf_persona_store_emails_from_affiliation_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static void _trf_persona_store_resource_usage_count_data_free (gpointer _data);
static void _trf_persona_store_resource_usage_count (TrfPersonaStore* self, const gchar* resource, GAsyncReadyCallback _callback_, gpointer _user_data_);
static gint _trf_persona_store_resource_usage_count_finish (TrfPersonaStore* self, GAsyncResult* _res_);
static gboolean _trf_persona_store_resource_usage_count_co (TrfPersonaStoreResourceUsageCountData* _data_);
static void _trf_persona_store_resource_usage_count_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static void _trf_persona_store_delete_resource_data_free (gpointer _data);
static gboolean _trf_persona_store_delete_resource_co (TrfPersonaStoreDeleteResourceData* _data_);
static void _trf_persona_store_delete_resource_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static void _trf_persona_store_linked_resources_data_free (gpointer _data);
static gboolean _trf_persona_store_linked_resources_co (TrfPersonaStoreLinkedResourcesData* _data_);
static void _trf_persona_store_linked_resources_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static void _trf_persona_store_urn_from_persona_data_free (gpointer _data);
static gboolean _trf_persona_store_urn_from_persona_co (TrfPersonaStoreUrnFromPersonaData* _data_);
static void _trf_persona_store_urn_from_persona_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static void _trf_persona_store_urn_from_property_data_free (gpointer _data);
static gboolean _trf_persona_store_urn_from_property_co (TrfPersonaStoreUrnFromPropertyData* _data_);
static void _trf_persona_store_urn_from_property_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static void trf_persona_store_finalize (GObject* obj);
static void _vala_trf_persona_store_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func);
static gint _vala_array_length (gpointer array);

static const gchar* TRF_PERSONA_STORE__always_writeable_properties[15] = {"alias", "phone-numbers", "email-addresses", "avatar", "structured-name", "full-name", "gender", "birthday", "roles", "notes", "urls", "im-addresses", "is-favourite", "local-ids", "web-service-addresses"};

GType trf_fields_get_type (void) {
	static volatile gsize trf_fields_type_id__volatile = 0;
	if (g_once_init_enter (&trf_fields_type_id__volatile)) {
		static const GEnumValue values[] = {{TRF_FIELDS_TRACKER_ID, "TRF_FIELDS_TRACKER_ID", "tracker-id"}, {TRF_FIELDS_FULL_NAME, "TRF_FIELDS_FULL_NAME", "full-name"}, {TRF_FIELDS_FAMILY_NAME, "TRF_FIELDS_FAMILY_NAME", "family-name"}, {TRF_FIELDS_GIVEN_NAME, "TRF_FIELDS_GIVEN_NAME", "given-name"}, {TRF_FIELDS_ADDITIONAL_NAMES, "TRF_FIELDS_ADDITIONAL_NAMES", "additional-names"}, {TRF_FIELDS_PREFIXES, "TRF_FIELDS_PREFIXES", "prefixes"}, {TRF_FIELDS_SUFFIXES, "TRF_FIELDS_SUFFIXES", "suffixes"}, {TRF_FIELDS_NICKNAME, "TRF_FIELDS_NICKNAME", "nickname"}, {TRF_FIELDS_BIRTHDAY, "TRF_FIELDS_BIRTHDAY", "birthday"}, {TRF_FIELDS_AVATAR_URL, "TRF_FIELDS_AVATAR_URL", "avatar-url"}, {TRF_FIELDS_IM_ADDRESSES, "TRF_FIELDS_IM_ADDRESSES", "im-addresses"}, {TRF_FIELDS_PHONES, "TRF_FIELDS_PHONES", "phones"}, {TRF_FIELDS_EMAILS, "TRF_FIELDS_EMAILS", "emails"}, {TRF_FIELDS_URLS, "TRF_FIELDS_URLS", "urls"}, {TRF_FIELDS_FAVOURITE, "TRF_FIELDS_FAVOURITE", "favourite"}, {TRF_FIELDS_CONTACT_URN, "TRF_FIELDS_CONTACT_URN", "contact-urn"}, {TRF_FIELDS_ROLES, "TRF_FIELDS_ROLES", "roles"}, {TRF_FIELDS_NOTE, "TRF_FIELDS_NOTE", "note"}, {TRF_FIELDS_GENDER, "TRF_FIELDS_GENDER", "gender"}, {TRF_FIELDS_POSTAL_ADDRESS, "TRF_FIELDS_POSTAL_ADDRESS", "postal-address"}, {TRF_FIELDS_LOCAL_IDS_PROPERTY, "TRF_FIELDS_LOCAL_IDS_PROPERTY", "local-ids-property"}, {0, NULL, NULL}};
		GType trf_fields_type_id;
		trf_fields_type_id = g_enum_register_static ("TrfFields", values);
		g_once_init_leave (&trf_fields_type_id__volatile, trf_fields_type_id);
	}
	return trf_fields_type_id__volatile;
}


GType trf_affl_info_fields_get_type (void) {
	static volatile gsize trf_affl_info_fields_type_id__volatile = 0;
	if (g_once_init_enter (&trf_affl_info_fields_type_id__volatile)) {
		static const GEnumValue values[] = {{TRF_AFFL_INFO_FIELDS_IM_TRACKER_ID, "TRF_AFFL_INFO_FIELDS_IM_TRACKER_ID", "im-tracker-id"}, {TRF_AFFL_INFO_FIELDS_IM_PROTOCOL, "TRF_AFFL_INFO_FIELDS_IM_PROTOCOL", "im-protocol"}, {TRF_AFFL_INFO_FIELDS_IM_ACCOUNT_ID, "TRF_AFFL_INFO_FIELDS_IM_ACCOUNT_ID", "im-account-id"}, {TRF_AFFL_INFO_FIELDS_AFFL_TRACKER_ID, "TRF_AFFL_INFO_FIELDS_AFFL_TRACKER_ID", "affl-tracker-id"}, {TRF_AFFL_INFO_FIELDS_AFFL_ROLE, "TRF_AFFL_INFO_FIELDS_AFFL_ROLE", "affl-role"}, {TRF_AFFL_INFO_FIELDS_AFFL_ORG, "TRF_AFFL_INFO_FIELDS_AFFL_ORG", "affl-org"}, {TRF_AFFL_INFO_FIELDS_AFFL_TITLE, "TRF_AFFL_INFO_FIELDS_AFFL_TITLE", "affl-title"}, {TRF_AFFL_INFO_FIELDS_AFFL_POBOX, "TRF_AFFL_INFO_FIELDS_AFFL_POBOX", "affl-pobox"}, {TRF_AFFL_INFO_FIELDS_AFFL_DISTRICT, "TRF_AFFL_INFO_FIELDS_AFFL_DISTRICT", "affl-district"}, {TRF_AFFL_INFO_FIELDS_AFFL_COUNTY, "TRF_AFFL_INFO_FIELDS_AFFL_COUNTY", "affl-county"}, {TRF_AFFL_INFO_FIELDS_AFFL_LOCALITY, "TRF_AFFL_INFO_FIELDS_AFFL_LOCALITY", "affl-locality"}, {TRF_AFFL_INFO_FIELDS_AFFL_POSTALCODE, "TRF_AFFL_INFO_FIELDS_AFFL_POSTALCODE", "affl-postalcode"}, {TRF_AFFL_INFO_FIELDS_AFFL_STREET_ADDRESS, "TRF_AFFL_INFO_FIELDS_AFFL_STREET_ADDRESS", "affl-street-address"}, {TRF_AFFL_INFO_FIELDS_AFFL_ADDRESS_LOCATION, "TRF_AFFL_INFO_FIELDS_AFFL_ADDRESS_LOCATION", "affl-address-location"}, {TRF_AFFL_INFO_FIELDS_AFFL_EXTENDED_ADDRESS, "TRF_AFFL_INFO_FIELDS_AFFL_EXTENDED_ADDRESS", "affl-extended-address"}, {TRF_AFFL_INFO_FIELDS_AFFL_COUNTRY, "TRF_AFFL_INFO_FIELDS_AFFL_COUNTRY", "affl-country"}, {TRF_AFFL_INFO_FIELDS_AFFL_REGION, "TRF_AFFL_INFO_FIELDS_AFFL_REGION", "affl-region"}, {TRF_AFFL_INFO_FIELDS_AFFL_EMAIL, "TRF_AFFL_INFO_FIELDS_AFFL_EMAIL", "affl-email"}, {TRF_AFFL_INFO_FIELDS_AFFL_PHONE, "TRF_AFFL_INFO_FIELDS_AFFL_PHONE", "affl-phone"}, {TRF_AFFL_INFO_FIELDS_AFFL_WEBSITE, "TRF_AFFL_INFO_FIELDS_AFFL_WEBSITE", "affl-website"}, {TRF_AFFL_INFO_FIELDS_AFFL_BLOG, "TRF_AFFL_INFO_FIELDS_AFFL_BLOG", "affl-blog"}, {TRF_AFFL_INFO_FIELDS_AFFL_URL, "TRF_AFFL_INFO_FIELDS_AFFL_URL", "affl-url"}, {TRF_AFFL_INFO_FIELDS_IM_NICKNAME, "TRF_AFFL_INFO_FIELDS_IM_NICKNAME", "im-nickname"}, {0, NULL, NULL}};
		GType trf_affl_info_fields_type_id;
		trf_affl_info_fields_type_id = g_enum_register_static ("TrfAfflInfoFields", values);
		g_once_init_leave (&trf_affl_info_fields_type_id__volatile, trf_affl_info_fields_type_id);
	}
	return trf_affl_info_fields_type_id__volatile;
}


GType trf_postal_address_fields_get_type (void) {
	static volatile gsize trf_postal_address_fields_type_id__volatile = 0;
	if (g_once_init_enter (&trf_postal_address_fields_type_id__volatile)) {
		static const GEnumValue values[] = {{TRF_POSTAL_ADDRESS_FIELDS_TRACKER_ID, "TRF_POSTAL_ADDRESS_FIELDS_TRACKER_ID", "tracker-id"}, {TRF_POSTAL_ADDRESS_FIELDS_POBOX, "TRF_POSTAL_ADDRESS_FIELDS_POBOX", "pobox"}, {TRF_POSTAL_ADDRESS_FIELDS_DISTRICT, "TRF_POSTAL_ADDRESS_FIELDS_DISTRICT", "district"}, {TRF_POSTAL_ADDRESS_FIELDS_COUNTY, "TRF_POSTAL_ADDRESS_FIELDS_COUNTY", "county"}, {TRF_POSTAL_ADDRESS_FIELDS_LOCALITY, "TRF_POSTAL_ADDRESS_FIELDS_LOCALITY", "locality"}, {TRF_POSTAL_ADDRESS_FIELDS_POSTALCODE, "TRF_POSTAL_ADDRESS_FIELDS_POSTALCODE", "postalcode"}, {TRF_POSTAL_ADDRESS_FIELDS_STREET_ADDRESS, "TRF_POSTAL_ADDRESS_FIELDS_STREET_ADDRESS", "street-address"}, {TRF_POSTAL_ADDRESS_FIELDS_ADDRESS_LOCATION, "TRF_POSTAL_ADDRESS_FIELDS_ADDRESS_LOCATION", "address-location"}, {TRF_POSTAL_ADDRESS_FIELDS_EXTENDED_ADDRESS, "TRF_POSTAL_ADDRESS_FIELDS_EXTENDED_ADDRESS", "extended-address"}, {TRF_POSTAL_ADDRESS_FIELDS_COUNTRY, "TRF_POSTAL_ADDRESS_FIELDS_COUNTRY", "country"}, {TRF_POSTAL_ADDRESS_FIELDS_REGION, "TRF_POSTAL_ADDRESS_FIELDS_REGION", "region"}, {0, NULL, NULL}};
		GType trf_postal_address_fields_type_id;
		trf_postal_address_fields_type_id = g_enum_register_static ("TrfPostalAddressFields", values);
		g_once_init_leave (&trf_postal_address_fields_type_id__volatile, trf_postal_address_fields_type_id);
	}
	return trf_postal_address_fields_type_id__volatile;
}


GType trf_urls_fields_get_type (void) {
	static volatile gsize trf_urls_fields_type_id__volatile = 0;
	if (g_once_init_enter (&trf_urls_fields_type_id__volatile)) {
		static const GEnumValue values[] = {{TRF_URLS_FIELDS_TRACKER_ID, "TRF_URLS_FIELDS_TRACKER_ID", "tracker-id"}, {TRF_URLS_FIELDS_BLOG, "TRF_URLS_FIELDS_BLOG", "blog"}, {TRF_URLS_FIELDS_WEBSITE, "TRF_URLS_FIELDS_WEBSITE", "website"}, {TRF_URLS_FIELDS_URL, "TRF_URLS_FIELDS_URL", "url"}, {0, NULL, NULL}};
		GType trf_urls_fields_type_id;
		trf_urls_fields_type_id = g_enum_register_static ("TrfUrlsFields", values);
		g_once_init_leave (&trf_urls_fields_type_id__volatile, trf_urls_fields_type_id);
	}
	return trf_urls_fields_type_id__volatile;
}


GType trf_role_fields_get_type (void) {
	static volatile gsize trf_role_fields_type_id__volatile = 0;
	if (g_once_init_enter (&trf_role_fields_type_id__volatile)) {
		static const GEnumValue values[] = {{TRF_ROLE_FIELDS_TRACKER_ID, "TRF_ROLE_FIELDS_TRACKER_ID", "tracker-id"}, {TRF_ROLE_FIELDS_ROLE, "TRF_ROLE_FIELDS_ROLE", "role"}, {TRF_ROLE_FIELDS_DEPARTMENT, "TRF_ROLE_FIELDS_DEPARTMENT", "department"}, {TRF_ROLE_FIELDS_TITLE, "TRF_ROLE_FIELDS_TITLE", "title"}, {0, NULL, NULL}};
		GType trf_role_fields_type_id;
		trf_role_fields_type_id = g_enum_register_static ("TrfRoleFields", values);
		g_once_init_leave (&trf_role_fields_type_id__volatile, trf_role_fields_type_id);
	}
	return trf_role_fields_type_id__volatile;
}


GType trf_im_fields_get_type (void) {
	static volatile gsize trf_im_fields_type_id__volatile = 0;
	if (g_once_init_enter (&trf_im_fields_type_id__volatile)) {
		static const GEnumValue values[] = {{TRF_IM_FIELDS_TRACKER_ID, "TRF_IM_FIELDS_TRACKER_ID", "tracker-id"}, {TRF_IM_FIELDS_PROTO, "TRF_IM_FIELDS_PROTO", "proto"}, {TRF_IM_FIELDS_ID, "TRF_IM_FIELDS_ID", "id"}, {TRF_IM_FIELDS_IM_NICKNAME, "TRF_IM_FIELDS_IM_NICKNAME", "im-nickname"}, {0, NULL, NULL}};
		GType trf_im_fields_type_id;
		trf_im_fields_type_id = g_enum_register_static ("TrfIMFields", values);
		g_once_init_leave (&trf_im_fields_type_id__volatile, trf_im_fields_type_id);
	}
	return trf_im_fields_type_id__volatile;
}


GType trf_phone_fields_get_type (void) {
	static volatile gsize trf_phone_fields_type_id__volatile = 0;
	if (g_once_init_enter (&trf_phone_fields_type_id__volatile)) {
		static const GEnumValue values[] = {{TRF_PHONE_FIELDS_TRACKER_ID, "TRF_PHONE_FIELDS_TRACKER_ID", "tracker-id"}, {TRF_PHONE_FIELDS_PHONE, "TRF_PHONE_FIELDS_PHONE", "phone"}, {0, NULL, NULL}};
		GType trf_phone_fields_type_id;
		trf_phone_fields_type_id = g_enum_register_static ("TrfPhoneFields", values);
		g_once_init_leave (&trf_phone_fields_type_id__volatile, trf_phone_fields_type_id);
	}
	return trf_phone_fields_type_id__volatile;
}


GType trf_email_fields_get_type (void) {
	static volatile gsize trf_email_fields_type_id__volatile = 0;
	if (g_once_init_enter (&trf_email_fields_type_id__volatile)) {
		static const GEnumValue values[] = {{TRF_EMAIL_FIELDS_TRACKER_ID, "TRF_EMAIL_FIELDS_TRACKER_ID", "tracker-id"}, {TRF_EMAIL_FIELDS_EMAIL, "TRF_EMAIL_FIELDS_EMAIL", "email"}, {0, NULL, NULL}};
		GType trf_email_fields_type_id;
		trf_email_fields_type_id = g_enum_register_static ("TrfEmailFields", values);
		g_once_init_leave (&trf_email_fields_type_id__volatile, trf_email_fields_type_id);
	}
	return trf_email_fields_type_id__volatile;
}


GType trf_tag_fields_get_type (void) {
	static volatile gsize trf_tag_fields_type_id__volatile = 0;
	if (g_once_init_enter (&trf_tag_fields_type_id__volatile)) {
		static const GEnumValue values[] = {{TRF_TAG_FIELDS_TRACKER_ID, "TRF_TAG_FIELDS_TRACKER_ID", "tracker-id"}, {0, NULL, NULL}};
		GType trf_tag_fields_type_id;
		trf_tag_fields_type_id = g_enum_register_static ("TrfTagFields", values);
		g_once_init_leave (&trf_tag_fields_type_id__volatile, trf_tag_fields_type_id);
	}
	return trf_tag_fields_type_id__volatile;
}


GType trf_attrib_get_type (void) {
	static volatile gsize trf_attrib_type_id__volatile = 0;
	if (g_once_init_enter (&trf_attrib_type_id__volatile)) {
		static const GEnumValue values[] = {{TRF_ATTRIB_EMAILS, "TRF_ATTRIB_EMAILS", "emails"}, {TRF_ATTRIB_PHONES, "TRF_ATTRIB_PHONES", "phones"}, {TRF_ATTRIB_URLS, "TRF_ATTRIB_URLS", "urls"}, {TRF_ATTRIB_IM_ADDRESSES, "TRF_ATTRIB_IM_ADDRESSES", "im-addresses"}, {TRF_ATTRIB_POSTAL_ADDRESSES, "TRF_ATTRIB_POSTAL_ADDRESSES", "postal-addresses"}, {0, NULL, NULL}};
		GType trf_attrib_type_id;
		trf_attrib_type_id = g_enum_register_static ("TrfAttrib", values);
		g_once_init_leave (&trf_attrib_type_id__volatile, trf_attrib_type_id);
	}
	return trf_attrib_type_id__volatile;
}


/**
   * Create a new PersonaStore.
   *
   * Create a new persona store to store the {@link Persona}s for the contacts
   */
TrfPersonaStore* trf_persona_store_construct (GType object_type) {
	TrfPersonaStore * self = NULL;
	GeeHashMap* _tmp0_;
	GeeHashMap* _tmp1_;
	GeeMap* _tmp2_;
	GeeMap* _tmp3_;
	self = (TrfPersonaStore*) g_object_new (object_type, "id", BACKEND_NAME, "display-name", BACKEND_NAME, NULL);
	_tmp0_ = gee_hash_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, TRF_TYPE_PERSONA, (GBoxedCopyFunc) g_object_ref, g_object_unref, NULL, NULL, NULL);
	_g_object_unref0 (self->priv->_personas);
	self->priv->_personas = _tmp0_;
	_tmp1_ = self->priv->_personas;
	_tmp2_ = gee_abstract_map_get_read_only_view ((GeeAbstractMap*) _tmp1_);
	_tmp3_ = _tmp2_;
	_g_object_unref0 (self->priv->_personas_ro);
	self->priv->_personas_ro = _tmp3_;
	g_debug ("trf-persona-store.vala:419: Initial query : \n%s\n", TRF_PERSONA_STORE__INITIAL_QUERY);
	return self;
}


TrfPersonaStore* trf_persona_store_new (void) {
	return trf_persona_store_construct (TRF_TYPE_PERSONA_STORE);
}


static void trf_persona_store_real_add_persona_from_details_data_free (gpointer _data) {
	TrfPersonaStoreAddPersonaFromDetailsData* _data_;
	_data_ = _data;
	_g_hash_table_unref0 (_data_->details);
	_g_object_unref0 (_data_->result);
	_g_object_unref0 (_data_->self);
	g_slice_free (TrfPersonaStoreAddPersonaFromDetailsData, _data_);
}


static gpointer _g_object_ref0 (gpointer self) {
	return self ? g_object_ref (self) : NULL;
}


static gpointer _g_hash_table_ref0 (gpointer self) {
	return self ? g_hash_table_ref (self) : NULL;
}


static void trf_persona_store_real_add_persona_from_details (FolksPersonaStore* base, GHashTable* details, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	TrfPersonaStore * self;
	TrfPersonaStoreAddPersonaFromDetailsData* _data_;
	TrfPersonaStore* _tmp0_;
	GHashTable* _tmp1_;
	GHashTable* _tmp2_;
	self = (TrfPersonaStore*) base;
	_data_ = g_slice_new0 (TrfPersonaStoreAddPersonaFromDetailsData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, trf_persona_store_real_add_persona_from_details);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, trf_persona_store_real_add_persona_from_details_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = details;
	_tmp2_ = _g_hash_table_ref0 (_tmp1_);
	_data_->details = _tmp2_;
	trf_persona_store_real_add_persona_from_details_co (_data_);
}


static FolksPersona* trf_persona_store_real_add_persona_from_details_finish (FolksPersonaStore* base, GAsyncResult* _res_, GError** error) {
	FolksPersona* result;
	TrfPersonaStoreAddPersonaFromDetailsData* _data_;
	if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
		return NULL;
	}
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
	result = _data_->result;
	_data_->result = NULL;
	return result;
}


/**
   * Add a new {@link Persona} to the PersonaStore.
   *
   * Accepted keys for `details` are:
   * - PersonaStore.detail_key (PersonaDetail.IM_ADDRESSES)
   * - PersonaStore.detail_key (PersonaDetail.NICKNAME)
   * - PersonaStore.detail_key (PersonaDetail.FULL_NAME)
   * - PersonaStore.detail_key (PersonaDetail.IS_FAVOURITE)
   * - PersonaStore.detail_key (PersonaDetail.STRUCTURED_NAME)
   * - PersonaStore.detail_key (PersonaDetail.AVATAR)
   * - PersonaStore.detail_key (PersonaDetail.BIRTHDAY)
   * - PersonaStore.detail_key (PersonaDetail.GENDER)
   * - PersonaStore.detail_key (PersonaDetail.EMAIL_ADDRESSES)
   * - PersonaStore.detail_key (PersonaDetail.IM_ADDRESSES)
   * - PersonaStore.detail_key (PersonaDetail.NOTES)
   * - PersonaStore.detail_key (PersonaDetail.PHONE_NUMBERS)
   * - PersonaStore.detail_key (PersonaDetail.POSTAL_ADDRESSES)
   * - PersonaStore.detail_key (PersonaDetail.ROLES)
   * - PersonaStore.detail_key (PersonaDetail.URL)
   * - PersonaStore.detail_key (PersonaDetail.WEB_SERVICE_ADDRESSES)
   *
   * See {@link Folks.PersonaStore.add_persona_from_details}.
   */
static GValue* _g_value_dup (GValue* self) {
	return g_boxed_copy (G_TYPE_VALUE, self);
}


static gpointer __g_value_dup0 (gpointer self) {
	return self ? _g_value_dup (self) : NULL;
}


static gpointer _g_date_time_ref0 (gpointer self) {
	return self ? g_date_time_ref (self) : NULL;
}


static void trf_persona_store_add_persona_from_details_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	TrfPersonaStoreAddPersonaFromDetailsData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	trf_persona_store_real_add_persona_from_details_co (_data_);
}


static void _vala_GValue_free (GValue* self) {
	g_value_unset (self);
	g_free (self);
}


static gboolean trf_persona_store_real_add_persona_from_details_co (TrfPersonaStoreAddPersonaFromDetailsData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		case 2:
		goto _state_2;
		case 3:
		goto _state_3;
		case 4:
		goto _state_4;
		case 5:
		goto _state_5;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->avatar = NULL;
	_data_->_tmp0_ = tracker_sparql_builder_new_update ();
	_data_->builder = _data_->_tmp0_;
	_data_->_tmp1_ = _data_->builder;
	tracker_sparql_builder_insert_open (_data_->_tmp1_, NULL);
	_data_->_tmp2_ = _data_->builder;
	tracker_sparql_builder_subject (_data_->_tmp2_, "_:p");
	_data_->_tmp3_ = _data_->builder;
	tracker_sparql_builder_predicate (_data_->_tmp3_, "a");
	_data_->_tmp4_ = _data_->builder;
	tracker_sparql_builder_object (_data_->_tmp4_, "nco:PersonContact");
	_data_->_tmp5_ = _data_->details;
	_data_->_tmp6_ = NULL;
	_data_->_tmp6_ = g_hash_table_get_keys (_data_->_tmp5_);
	{
		_data_->k_collection = _data_->_tmp6_;
		_data_->k_it = NULL;
		for (_data_->k_it = _data_->k_collection; _data_->k_it != NULL; _data_->k_it = _data_->k_it->next) {
			_data_->k = (const gchar*) _data_->k_it->data;
			{
				_data_->_tmp7_ = _data_->details;
				_data_->_tmp8_ = _data_->k;
				_data_->_tmp9_ = NULL;
				_data_->_tmp9_ = g_hash_table_lookup (_data_->_tmp7_, _data_->_tmp8_);
				_data_->_tmp10_ = __g_value_dup0 ((GValue*) _data_->_tmp9_);
				_data_->v = _data_->_tmp10_;
				_data_->_tmp11_ = _data_->k;
				_data_->_tmp12_ = NULL;
				_data_->_tmp12_ = folks_persona_store_detail_key (FOLKS_PERSONA_DETAIL_NICKNAME);
				if (g_strcmp0 (_data_->_tmp11_, _data_->_tmp12_) == 0) {
					_data_->_tmp13_ = _data_->builder;
					tracker_sparql_builder_subject (_data_->_tmp13_, "_:p");
					_data_->_tmp14_ = _data_->builder;
					tracker_sparql_builder_predicate (_data_->_tmp14_, TRF_ONTOLOGY_DEFS_NCO_NICKNAME);
					_data_->_tmp15_ = _data_->builder;
					_data_->_tmp16_ = _data_->v;
					_data_->_tmp17_ = NULL;
					_data_->_tmp17_ = g_value_get_string (_data_->_tmp16_);
					tracker_sparql_builder_object_string (_data_->_tmp15_, _data_->_tmp17_);
				} else {
					_data_->_tmp18_ = _data_->k;
					_data_->_tmp19_ = NULL;
					_data_->_tmp19_ = folks_persona_store_detail_key (FOLKS_PERSONA_DETAIL_FULL_NAME);
					if (g_strcmp0 (_data_->_tmp18_, _data_->_tmp19_) == 0) {
						_data_->_tmp20_ = _data_->builder;
						tracker_sparql_builder_subject (_data_->_tmp20_, "_:p");
						_data_->_tmp21_ = _data_->builder;
						tracker_sparql_builder_predicate (_data_->_tmp21_, TRF_ONTOLOGY_DEFS_NCO_FULLNAME);
						_data_->_tmp22_ = _data_->builder;
						_data_->_tmp23_ = _data_->v;
						_data_->_tmp24_ = NULL;
						_data_->_tmp24_ = g_value_get_string (_data_->_tmp23_);
						tracker_sparql_builder_object_string (_data_->_tmp22_, _data_->_tmp24_);
					} else {
						_data_->_tmp25_ = _data_->k;
						_data_->_tmp26_ = NULL;
						_data_->_tmp26_ = folks_persona_store_detail_key (FOLKS_PERSONA_DETAIL_STRUCTURED_NAME);
						if (g_strcmp0 (_data_->_tmp25_, _data_->_tmp26_) == 0) {
							_data_->_tmp27_ = _data_->v;
							_data_->_tmp28_ = NULL;
							_data_->_tmp28_ = g_value_get_object (_data_->_tmp27_);
							_data_->_tmp29_ = _g_object_ref0 (FOLKS_STRUCTURED_NAME (_data_->_tmp28_));
							_data_->sname = _data_->_tmp29_;
							_data_->_tmp30_ = _data_->builder;
							tracker_sparql_builder_subject (_data_->_tmp30_, "_:p");
							_data_->_tmp31_ = _data_->builder;
							tracker_sparql_builder_predicate (_data_->_tmp31_, TRF_ONTOLOGY_DEFS_NCO_FAMILY);
							_data_->_tmp32_ = _data_->builder;
							_data_->_tmp33_ = _data_->sname;
							_data_->_tmp34_ = folks_structured_name_get_family_name (_data_->_tmp33_);
							_data_->_tmp35_ = _data_->_tmp34_;
							tracker_sparql_builder_object_string (_data_->_tmp32_, _data_->_tmp35_);
							_data_->_tmp36_ = _data_->builder;
							tracker_sparql_builder_predicate (_data_->_tmp36_, TRF_ONTOLOGY_DEFS_NCO_GIVEN);
							_data_->_tmp37_ = _data_->builder;
							_data_->_tmp38_ = _data_->sname;
							_data_->_tmp39_ = folks_structured_name_get_given_name (_data_->_tmp38_);
							_data_->_tmp40_ = _data_->_tmp39_;
							tracker_sparql_builder_object_string (_data_->_tmp37_, _data_->_tmp40_);
							_data_->_tmp41_ = _data_->builder;
							tracker_sparql_builder_predicate (_data_->_tmp41_, TRF_ONTOLOGY_DEFS_NCO_ADDITIONAL);
							_data_->_tmp42_ = _data_->builder;
							_data_->_tmp43_ = _data_->sname;
							_data_->_tmp44_ = folks_structured_name_get_additional_names (_data_->_tmp43_);
							_data_->_tmp45_ = _data_->_tmp44_;
							tracker_sparql_builder_object_string (_data_->_tmp42_, _data_->_tmp45_);
							_data_->_tmp46_ = _data_->builder;
							tracker_sparql_builder_predicate (_data_->_tmp46_, TRF_ONTOLOGY_DEFS_NCO_SUFFIX);
							_data_->_tmp47_ = _data_->builder;
							_data_->_tmp48_ = _data_->sname;
							_data_->_tmp49_ = folks_structured_name_get_suffixes (_data_->_tmp48_);
							_data_->_tmp50_ = _data_->_tmp49_;
							tracker_sparql_builder_object_string (_data_->_tmp47_, _data_->_tmp50_);
							_data_->_tmp51_ = _data_->builder;
							tracker_sparql_builder_predicate (_data_->_tmp51_, TRF_ONTOLOGY_DEFS_NCO_PREFIX);
							_data_->_tmp52_ = _data_->builder;
							_data_->_tmp53_ = _data_->sname;
							_data_->_tmp54_ = folks_structured_name_get_prefixes (_data_->_tmp53_);
							_data_->_tmp55_ = _data_->_tmp54_;
							tracker_sparql_builder_object_string (_data_->_tmp52_, _data_->_tmp55_);
							_g_object_unref0 (_data_->sname);
						} else {
							_data_->_tmp56_ = _data_->k;
							_data_->_tmp57_ = NULL;
							_data_->_tmp57_ = folks_persona_store_detail_key (FOLKS_PERSONA_DETAIL_IS_FAVOURITE);
							if (g_strcmp0 (_data_->_tmp56_, _data_->_tmp57_) == 0) {
								_data_->_tmp58_ = _data_->v;
								_data_->_tmp59_ = FALSE;
								_data_->_tmp59_ = g_value_get_boolean (_data_->_tmp58_);
								if (_data_->_tmp59_) {
									_data_->_tmp60_ = _data_->builder;
									tracker_sparql_builder_subject (_data_->_tmp60_, "_:p");
									_data_->_tmp61_ = _data_->builder;
									tracker_sparql_builder_predicate (_data_->_tmp61_, TRF_ONTOLOGY_DEFS_NAO_TAG);
									_data_->_tmp62_ = _data_->builder;
									tracker_sparql_builder_object (_data_->_tmp62_, TRF_ONTOLOGY_DEFS_NAO_FAVORITE);
								}
							} else {
								_data_->_tmp63_ = _data_->k;
								_data_->_tmp64_ = NULL;
								_data_->_tmp64_ = folks_persona_store_detail_key (FOLKS_PERSONA_DETAIL_AVATAR);
								if (g_strcmp0 (_data_->_tmp63_, _data_->_tmp64_) == 0) {
									_data_->_tmp65_ = _data_->v;
									_data_->_tmp66_ = NULL;
									_data_->_tmp66_ = g_value_get_object (_data_->_tmp65_);
									_data_->_tmp67_ = _g_object_ref0 (G_LOADABLE_ICON (_data_->_tmp66_));
									_data_->new_avatar = _data_->_tmp67_;
									_data_->_tmp68_ = _data_->new_avatar;
									if (_data_->_tmp68_ != NULL) {
										_data_->_tmp69_ = _data_->new_avatar;
										_data_->_tmp70_ = _g_object_ref0 (_data_->_tmp69_);
										_g_object_unref0 (_data_->avatar);
										_data_->avatar = _data_->_tmp70_;
									}
									_g_object_unref0 (_data_->new_avatar);
								} else {
									_data_->_tmp71_ = _data_->k;
									_data_->_tmp72_ = NULL;
									_data_->_tmp72_ = folks_persona_store_detail_key (FOLKS_PERSONA_DETAIL_BIRTHDAY);
									if (g_strcmp0 (_data_->_tmp71_, _data_->_tmp72_) == 0) {
										_data_->_tmp73_ = _data_->v;
										_data_->_tmp74_ = NULL;
										_data_->_tmp74_ = g_value_get_boxed (_data_->_tmp73_);
										_data_->_tmp75_ = _g_date_time_ref0 ((GDateTime*) _data_->_tmp74_);
										_data_->birthday = _data_->_tmp75_;
										_data_->_tmp76_ = _data_->builder;
										tracker_sparql_builder_subject (_data_->_tmp76_, "_:p");
										_data_->_tmp77_ = _data_->builder;
										tracker_sparql_builder_predicate (_data_->_tmp77_, TRF_ONTOLOGY_DEFS_NCO_BIRTHDAY);
										_data_->_tmp78_ = _data_->birthday;
										memset (&_data_->_tmp79_, 0, sizeof (GTimeVal));
										g_date_time_to_timeval (_data_->_tmp78_, &_data_->_tmp79_);
										_data_->tv = _data_->_tmp79_;
										_data_->_tmp80_ = _data_->builder;
										_data_->_tmp81_ = NULL;
										_data_->_tmp81_ = g_time_val_to_iso8601 (&_data_->tv);
										_data_->_tmp82_ = _data_->_tmp81_;
										tracker_sparql_builder_object_string (_data_->_tmp80_, _data_->_tmp82_);
										_g_free0 (_data_->_tmp82_);
										_g_date_time_unref0 (_data_->birthday);
									} else {
										_data_->_tmp83_ = _data_->k;
										_data_->_tmp84_ = NULL;
										_data_->_tmp84_ = folks_persona_store_detail_key (FOLKS_PERSONA_DETAIL_GENDER);
										if (g_strcmp0 (_data_->_tmp83_, _data_->_tmp84_) == 0) {
											_data_->_tmp85_ = _data_->v;
											_data_->_tmp86_ = 0;
											_data_->_tmp86_ = g_value_get_enum (_data_->_tmp85_);
											_data_->gender = (FolksGender) _data_->_tmp86_;
											_data_->_tmp87_ = _data_->gender;
											if (_data_->_tmp87_ != FOLKS_GENDER_UNSPECIFIED) {
												_data_->_tmp88_ = _data_->builder;
												tracker_sparql_builder_subject (_data_->_tmp88_, "_:p");
												_data_->_tmp89_ = _data_->builder;
												tracker_sparql_builder_predicate (_data_->_tmp89_, TRF_ONTOLOGY_DEFS_NCO_GENDER);
												_data_->_tmp90_ = _data_->gender;
												if (_data_->_tmp90_ == FOLKS_GENDER_MALE) {
													_data_->_tmp91_ = _data_->builder;
													tracker_sparql_builder_object (_data_->_tmp91_, TRF_ONTOLOGY_DEFS_NCO_MALE);
												} else {
													_data_->_tmp92_ = _data_->builder;
													tracker_sparql_builder_object (_data_->_tmp92_, TRF_ONTOLOGY_DEFS_NCO_FEMALE);
												}
											}
										} else {
											_data_->_tmp93_ = _data_->k;
											_data_->_tmp94_ = NULL;
											_data_->_tmp94_ = folks_persona_store_detail_key (FOLKS_PERSONA_DETAIL_EMAIL_ADDRESSES);
											if (g_strcmp0 (_data_->_tmp93_, _data_->_tmp94_) == 0) {
												_data_->_tmp95_ = _data_->v;
												_data_->_tmp96_ = NULL;
												_data_->_tmp96_ = g_value_get_object (_data_->_tmp95_);
												_data_->_tmp97_ = _g_object_ref0 (GEE_SET (_data_->_tmp96_));
												_data_->email_addresses = _data_->_tmp97_;
												_data_->_tmp98_ = _data_->builder;
												_data_->_tmp99_ = _data_->email_addresses;
												_data_->_state_ = 1;
												_trf_persona_store_build_update_query_set (_data_->self, _data_->_tmp98_, _data_->_tmp99_, "_:p", TRF_ATTRIB_EMAILS, trf_persona_store_add_persona_from_details_ready, _data_);
												return FALSE;
												_state_1:
												_trf_persona_store_build_update_query_set_finish (_data_->self, _data_->_res_);
												_g_object_unref0 (_data_->email_addresses);
											} else {
												_data_->_tmp100_ = _data_->k;
												_data_->_tmp101_ = NULL;
												_data_->_tmp101_ = folks_persona_store_detail_key (FOLKS_PERSONA_DETAIL_IM_ADDRESSES);
												if (g_strcmp0 (_data_->_tmp100_, _data_->_tmp101_) == 0) {
													_data_->_tmp102_ = _data_->v;
													_data_->_tmp103_ = NULL;
													_data_->_tmp103_ = g_value_get_object (_data_->_tmp102_);
													_data_->_tmp104_ = _g_object_ref0 (GEE_MULTI_MAP (_data_->_tmp103_));
													_data_->im_addresses = _data_->_tmp104_;
													_data_->im_cnt = 0;
													{
														_data_->_tmp105_ = _data_->im_addresses;
														_data_->_tmp106_ = NULL;
														_data_->_tmp106_ = gee_multi_map_get_keys (_data_->_tmp105_);
														_data_->_tmp107_ = _data_->_tmp106_;
														_data_->_tmp108_ = NULL;
														_data_->_tmp108_ = gee_iterable_iterator ((GeeIterable*) _data_->_tmp107_);
														_data_->_tmp109_ = _data_->_tmp108_;
														_g_object_unref0 (_data_->_tmp107_);
														_data_->_proto_it = _data_->_tmp109_;
														while (TRUE) {
															_data_->_tmp110_ = _data_->_proto_it;
															_data_->_tmp111_ = FALSE;
															_data_->_tmp111_ = gee_iterator_next (_data_->_tmp110_);
															if (!_data_->_tmp111_) {
																break;
															}
															_data_->_tmp112_ = _data_->_proto_it;
															_data_->_tmp113_ = NULL;
															_data_->_tmp113_ = gee_iterator_get (_data_->_tmp112_);
															_data_->proto = (gchar*) _data_->_tmp113_;
															_data_->_tmp114_ = _data_->im_addresses;
															_data_->_tmp115_ = _data_->proto;
															_data_->_tmp116_ = NULL;
															_data_->_tmp116_ = gee_multi_map_get (_data_->_tmp114_, _data_->_tmp115_);
															_data_->addrs_a = _data_->_tmp116_;
															{
																_data_->_tmp117_ = _data_->addrs_a;
																_data_->_tmp118_ = NULL;
																_data_->_tmp118_ = gee_iterable_iterator ((GeeIterable*) _data_->_tmp117_);
																_data_->_im_fd_it = _data_->_tmp118_;
																while (TRUE) {
																	_data_->_tmp119_ = _data_->_im_fd_it;
																	_data_->_tmp120_ = FALSE;
																	_data_->_tmp120_ = gee_iterator_next (_data_->_tmp119_);
																	if (!_data_->_tmp120_) {
																		break;
																	}
																	_data_->_tmp121_ = _data_->_im_fd_it;
																	_data_->_tmp122_ = NULL;
																	_data_->_tmp122_ = gee_iterator_get (_data_->_tmp121_);
																	_data_->im_fd = (FolksImFieldDetails*) _data_->_tmp122_;
																	_data_->_tmp123_ = _data_->im_cnt;
																	_data_->_tmp124_ = NULL;
																	_data_->_tmp124_ = g_strdup_printf ("_:im_affl%d", _data_->_tmp123_);
																	_data_->im_affl = _data_->_tmp124_;
																	_data_->_tmp125_ = _data_->im_cnt;
																	_data_->_tmp126_ = NULL;
																	_data_->_tmp126_ = g_strdup_printf ("_:im%d", _data_->_tmp125_);
																	_data_->im = _data_->_tmp126_;
																	_data_->_tmp127_ = _data_->builder;
																	_data_->_tmp128_ = _data_->im;
																	tracker_sparql_builder_subject (_data_->_tmp127_, _data_->_tmp128_);
																	_data_->_tmp129_ = _data_->builder;
																	tracker_sparql_builder_predicate (_data_->_tmp129_, "a");
																	_data_->_tmp130_ = _data_->builder;
																	tracker_sparql_builder_object (_data_->_tmp130_, TRF_ONTOLOGY_DEFS_NCO_IMADDRESS);
																	_data_->_tmp131_ = _data_->builder;
																	tracker_sparql_builder_predicate (_data_->_tmp131_, TRF_ONTOLOGY_DEFS_NCO_IMID);
																	_data_->_tmp132_ = _data_->builder;
																	_data_->_tmp133_ = _data_->im_fd;
																	_data_->_tmp134_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) _data_->_tmp133_);
																	_data_->_tmp135_ = _data_->_tmp134_;
																	tracker_sparql_builder_object_string (_data_->_tmp132_, (const gchar*) _data_->_tmp135_);
																	_data_->_tmp136_ = _data_->builder;
																	tracker_sparql_builder_predicate (_data_->_tmp136_, TRF_ONTOLOGY_DEFS_NCO_IMPROTOCOL);
																	_data_->_tmp137_ = _data_->builder;
																	_data_->_tmp138_ = _data_->proto;
																	tracker_sparql_builder_object_string (_data_->_tmp137_, _data_->_tmp138_);
																	_data_->_tmp139_ = _data_->builder;
																	_data_->_tmp140_ = _data_->im_affl;
																	tracker_sparql_builder_subject (_data_->_tmp139_, _data_->_tmp140_);
																	_data_->_tmp141_ = _data_->builder;
																	tracker_sparql_builder_predicate (_data_->_tmp141_, "a");
																	_data_->_tmp142_ = _data_->builder;
																	tracker_sparql_builder_object (_data_->_tmp142_, TRF_ONTOLOGY_DEFS_NCO_AFFILIATION);
																	_data_->_tmp143_ = _data_->builder;
																	tracker_sparql_builder_predicate (_data_->_tmp143_, TRF_ONTOLOGY_DEFS_NCO_HAS_IMADDRESS);
																	_data_->_tmp144_ = _data_->builder;
																	_data_->_tmp145_ = _data_->im;
																	tracker_sparql_builder_object (_data_->_tmp144_, _data_->_tmp145_);
																	_data_->_tmp146_ = _data_->builder;
																	tracker_sparql_builder_subject (_data_->_tmp146_, "_:p");
																	_data_->_tmp147_ = _data_->builder;
																	tracker_sparql_builder_predicate (_data_->_tmp147_, TRF_ONTOLOGY_DEFS_NCO_HAS_AFFILIATION);
																	_data_->_tmp148_ = _data_->builder;
																	_data_->_tmp149_ = _data_->im_affl;
																	tracker_sparql_builder_object (_data_->_tmp148_, _data_->_tmp149_);
																	_data_->_tmp150_ = _data_->im_cnt;
																	_data_->im_cnt = _data_->_tmp150_ + 1;
																	_g_free0 (_data_->im);
																	_g_free0 (_data_->im_affl);
																	_g_object_unref0 (_data_->im_fd);
																}
																_g_object_unref0 (_data_->_im_fd_it);
															}
															_g_object_unref0 (_data_->addrs_a);
															_g_free0 (_data_->proto);
														}
														_g_object_unref0 (_data_->_proto_it);
													}
													_g_object_unref0 (_data_->im_addresses);
												} else {
													_data_->_tmp151_ = _data_->k;
													_data_->_tmp152_ = NULL;
													_data_->_tmp152_ = folks_persona_store_detail_key (FOLKS_PERSONA_DETAIL_NOTES);
													if (g_strcmp0 (_data_->_tmp151_, _data_->_tmp152_) == 0) {
														_data_->_tmp153_ = _data_->v;
														_data_->_tmp154_ = NULL;
														_data_->_tmp154_ = g_value_get_object (_data_->_tmp153_);
														_data_->_tmp155_ = _g_object_ref0 (GEE_HASH_SET (_data_->_tmp154_));
														_data_->notes = _data_->_tmp155_;
														{
															_data_->_tmp156_ = _data_->notes;
															_data_->_tmp157_ = NULL;
															_data_->_tmp157_ = gee_abstract_collection_iterator ((GeeAbstractCollection*) _data_->_tmp156_);
															_data_->_n_it = _data_->_tmp157_;
															while (TRUE) {
																_data_->_tmp158_ = _data_->_n_it;
																_data_->_tmp159_ = FALSE;
																_data_->_tmp159_ = gee_iterator_next (_data_->_tmp158_);
																if (!_data_->_tmp159_) {
																	break;
																}
																_data_->_tmp160_ = _data_->_n_it;
																_data_->_tmp161_ = NULL;
																_data_->_tmp161_ = gee_iterator_get (_data_->_tmp160_);
																_data_->n = (FolksNoteFieldDetails*) _data_->_tmp161_;
																_data_->_tmp162_ = _data_->builder;
																tracker_sparql_builder_subject (_data_->_tmp162_, "_:p");
																_data_->_tmp163_ = _data_->builder;
																tracker_sparql_builder_predicate (_data_->_tmp163_, TRF_ONTOLOGY_DEFS_NCO_NOTE);
																_data_->_tmp164_ = _data_->builder;
																_data_->_tmp165_ = _data_->n;
																_data_->_tmp166_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) _data_->_tmp165_);
																_data_->_tmp167_ = _data_->_tmp166_;
																tracker_sparql_builder_object_string (_data_->_tmp164_, (const gchar*) _data_->_tmp167_);
																_g_object_unref0 (_data_->n);
															}
															_g_object_unref0 (_data_->_n_it);
														}
														_g_object_unref0 (_data_->notes);
													} else {
														_data_->_tmp168_ = _data_->k;
														_data_->_tmp169_ = NULL;
														_data_->_tmp169_ = folks_persona_store_detail_key (FOLKS_PERSONA_DETAIL_PHONE_NUMBERS);
														if (g_strcmp0 (_data_->_tmp168_, _data_->_tmp169_) == 0) {
															_data_->_tmp170_ = _data_->v;
															_data_->_tmp171_ = NULL;
															_data_->_tmp171_ = g_value_get_object (_data_->_tmp170_);
															_data_->_tmp172_ = _g_object_ref0 (GEE_SET (_data_->_tmp171_));
															_data_->phone_numbers = _data_->_tmp172_;
															_data_->_tmp173_ = _data_->builder;
															_data_->_tmp174_ = _data_->phone_numbers;
															_data_->_state_ = 2;
															_trf_persona_store_build_update_query_set (_data_->self, _data_->_tmp173_, _data_->_tmp174_, "_:p", TRF_ATTRIB_PHONES, trf_persona_store_add_persona_from_details_ready, _data_);
															return FALSE;
															_state_2:
															_trf_persona_store_build_update_query_set_finish (_data_->self, _data_->_res_);
															_g_object_unref0 (_data_->phone_numbers);
														} else {
															_data_->_tmp175_ = _data_->k;
															_data_->_tmp176_ = NULL;
															_data_->_tmp176_ = folks_persona_store_detail_key (FOLKS_PERSONA_DETAIL_ROLES);
															if (g_strcmp0 (_data_->_tmp175_, _data_->_tmp176_) == 0) {
																_data_->_tmp177_ = _data_->v;
																_data_->_tmp178_ = NULL;
																_data_->_tmp178_ = g_value_get_object (_data_->_tmp177_);
																_data_->_tmp179_ = _g_object_ref0 (GEE_HASH_SET (_data_->_tmp178_));
																_data_->roles = _data_->_tmp179_;
																_data_->roles_cnt = 0;
																{
																	_data_->_tmp180_ = _data_->roles;
																	_data_->_tmp181_ = NULL;
																	_data_->_tmp181_ = gee_abstract_collection_iterator ((GeeAbstractCollection*) _data_->_tmp180_);
																	_data_->_role_fd_it = _data_->_tmp181_;
																	while (TRUE) {
																		_data_->_tmp182_ = _data_->_role_fd_it;
																		_data_->_tmp183_ = FALSE;
																		_data_->_tmp183_ = gee_iterator_next (_data_->_tmp182_);
																		if (!_data_->_tmp183_) {
																			break;
																		}
																		_data_->_tmp184_ = _data_->_role_fd_it;
																		_data_->_tmp185_ = NULL;
																		_data_->_tmp185_ = gee_iterator_get (_data_->_tmp184_);
																		_data_->role_fd = (FolksRoleFieldDetails*) _data_->_tmp185_;
																		_data_->_tmp186_ = _data_->roles_cnt;
																		_data_->_tmp187_ = NULL;
																		_data_->_tmp187_ = g_strdup_printf ("_:role_affl%d", _data_->_tmp186_);
																		_data_->role_affl = _data_->_tmp187_;
																		_data_->_tmp188_ = _data_->builder;
																		_data_->_tmp189_ = _data_->role_affl;
																		tracker_sparql_builder_subject (_data_->_tmp188_, _data_->_tmp189_);
																		_data_->_tmp190_ = _data_->builder;
																		tracker_sparql_builder_predicate (_data_->_tmp190_, "a");
																		_data_->_tmp191_ = _data_->builder;
																		tracker_sparql_builder_object (_data_->_tmp191_, TRF_ONTOLOGY_DEFS_NCO_AFFILIATION);
																		_data_->_tmp192_ = _data_->builder;
																		tracker_sparql_builder_predicate (_data_->_tmp192_, TRF_ONTOLOGY_DEFS_NCO_ROLE);
																		_data_->_tmp193_ = _data_->builder;
																		_data_->_tmp194_ = _data_->role_fd;
																		_data_->_tmp195_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) _data_->_tmp194_);
																		_data_->_tmp196_ = _data_->_tmp195_;
																		_data_->_tmp197_ = folks_role_get_role ((FolksRole*) _data_->_tmp196_);
																		_data_->_tmp198_ = _data_->_tmp197_;
																		tracker_sparql_builder_object_string (_data_->_tmp193_, _data_->_tmp198_);
																		_data_->_tmp199_ = _data_->builder;
																		tracker_sparql_builder_predicate (_data_->_tmp199_, TRF_ONTOLOGY_DEFS_NCO_TITLE);
																		_data_->_tmp200_ = _data_->builder;
																		_data_->_tmp201_ = _data_->role_fd;
																		_data_->_tmp202_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) _data_->_tmp201_);
																		_data_->_tmp203_ = _data_->_tmp202_;
																		_data_->_tmp204_ = folks_role_get_title ((FolksRole*) _data_->_tmp203_);
																		_data_->_tmp205_ = _data_->_tmp204_;
																		tracker_sparql_builder_object_string (_data_->_tmp200_, _data_->_tmp205_);
																		_data_->_tmp206_ = _data_->builder;
																		tracker_sparql_builder_predicate (_data_->_tmp206_, TRF_ONTOLOGY_DEFS_NCO_ORG);
																		_data_->_tmp207_ = _data_->builder;
																		_data_->_tmp208_ = _data_->role_fd;
																		_data_->_tmp209_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) _data_->_tmp208_);
																		_data_->_tmp210_ = _data_->_tmp209_;
																		_data_->_tmp211_ = folks_role_get_organisation_name ((FolksRole*) _data_->_tmp210_);
																		_data_->_tmp212_ = _data_->_tmp211_;
																		tracker_sparql_builder_object_string (_data_->_tmp207_, _data_->_tmp212_);
																		_data_->_tmp213_ = _data_->builder;
																		tracker_sparql_builder_subject (_data_->_tmp213_, "_:p");
																		_data_->_tmp214_ = _data_->builder;
																		tracker_sparql_builder_predicate (_data_->_tmp214_, TRF_ONTOLOGY_DEFS_NCO_HAS_AFFILIATION);
																		_data_->_tmp215_ = _data_->builder;
																		_data_->_tmp216_ = _data_->role_affl;
																		tracker_sparql_builder_object (_data_->_tmp215_, _data_->_tmp216_);
																		_data_->_tmp217_ = _data_->roles_cnt;
																		_data_->roles_cnt = _data_->_tmp217_ + 1;
																		_g_free0 (_data_->role_affl);
																		_g_object_unref0 (_data_->role_fd);
																	}
																	_g_object_unref0 (_data_->_role_fd_it);
																}
																_g_object_unref0 (_data_->roles);
															} else {
																_data_->_tmp218_ = _data_->k;
																_data_->_tmp219_ = NULL;
																_data_->_tmp219_ = folks_persona_store_detail_key (FOLKS_PERSONA_DETAIL_POSTAL_ADDRESSES);
																if (g_strcmp0 (_data_->_tmp218_, _data_->_tmp219_) == 0) {
																	_data_->_tmp220_ = _data_->v;
																	_data_->_tmp221_ = NULL;
																	_data_->_tmp221_ = g_value_get_object (_data_->_tmp220_);
																	_data_->_tmp222_ = _g_object_ref0 (GEE_SET (_data_->_tmp221_));
																	_data_->postal_addresses = _data_->_tmp222_;
																	_data_->postal_cnt = 0;
																	{
																		_data_->_tmp223_ = _data_->postal_addresses;
																		_data_->_tmp224_ = NULL;
																		_data_->_tmp224_ = gee_iterable_iterator ((GeeIterable*) _data_->_tmp223_);
																		_data_->_pafd_it = _data_->_tmp224_;
																		while (TRUE) {
																			_data_->_tmp225_ = _data_->_pafd_it;
																			_data_->_tmp226_ = FALSE;
																			_data_->_tmp226_ = gee_iterator_next (_data_->_tmp225_);
																			if (!_data_->_tmp226_) {
																				break;
																			}
																			_data_->_tmp227_ = _data_->_pafd_it;
																			_data_->_tmp228_ = NULL;
																			_data_->_tmp228_ = gee_iterator_get (_data_->_tmp227_);
																			_data_->pafd = (FolksPostalAddressFieldDetails*) _data_->_tmp228_;
																			_data_->_tmp229_ = _data_->pafd;
																			_data_->_tmp230_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) _data_->_tmp229_);
																			_data_->_tmp231_ = _data_->_tmp230_;
																			_data_->_tmp232_ = _g_object_ref0 ((FolksPostalAddress*) _data_->_tmp231_);
																			_data_->pa = _data_->_tmp232_;
																			_data_->_tmp233_ = _data_->postal_cnt;
																			_data_->_tmp234_ = NULL;
																			_data_->_tmp234_ = g_strdup_printf ("_:postal_affl%d", _data_->_tmp233_);
																			_data_->postal_affl = _data_->_tmp234_;
																			_data_->_tmp235_ = _data_->postal_cnt;
																			_data_->_tmp236_ = NULL;
																			_data_->_tmp236_ = g_strdup_printf ("_:postal%d", _data_->_tmp235_);
																			_data_->postal = _data_->_tmp236_;
																			_data_->_tmp237_ = _data_->builder;
																			_data_->_tmp238_ = _data_->postal;
																			tracker_sparql_builder_subject (_data_->_tmp237_, _data_->_tmp238_);
																			_data_->_tmp239_ = _data_->builder;
																			tracker_sparql_builder_predicate (_data_->_tmp239_, "a");
																			_data_->_tmp240_ = _data_->builder;
																			tracker_sparql_builder_object (_data_->_tmp240_, TRF_ONTOLOGY_DEFS_NCO_POSTAL_ADDRESS);
																			_data_->_tmp241_ = _data_->builder;
																			tracker_sparql_builder_predicate (_data_->_tmp241_, TRF_ONTOLOGY_DEFS_NCO_POBOX);
																			_data_->_tmp242_ = _data_->builder;
																			_data_->_tmp243_ = _data_->pa;
																			_data_->_tmp244_ = folks_postal_address_get_po_box (_data_->_tmp243_);
																			_data_->_tmp245_ = _data_->_tmp244_;
																			tracker_sparql_builder_object_string (_data_->_tmp242_, _data_->_tmp245_);
																			_data_->_tmp246_ = _data_->builder;
																			tracker_sparql_builder_predicate (_data_->_tmp246_, TRF_ONTOLOGY_DEFS_NCO_LOCALITY);
																			_data_->_tmp247_ = _data_->builder;
																			_data_->_tmp248_ = _data_->pa;
																			_data_->_tmp249_ = folks_postal_address_get_locality (_data_->_tmp248_);
																			_data_->_tmp250_ = _data_->_tmp249_;
																			tracker_sparql_builder_object_string (_data_->_tmp247_, _data_->_tmp250_);
																			_data_->_tmp251_ = _data_->builder;
																			tracker_sparql_builder_predicate (_data_->_tmp251_, TRF_ONTOLOGY_DEFS_NCO_POSTALCODE);
																			_data_->_tmp252_ = _data_->builder;
																			_data_->_tmp253_ = _data_->pa;
																			_data_->_tmp254_ = folks_postal_address_get_postal_code (_data_->_tmp253_);
																			_data_->_tmp255_ = _data_->_tmp254_;
																			tracker_sparql_builder_object_string (_data_->_tmp252_, _data_->_tmp255_);
																			_data_->_tmp256_ = _data_->builder;
																			tracker_sparql_builder_predicate (_data_->_tmp256_, TRF_ONTOLOGY_DEFS_NCO_STREET_ADDRESS);
																			_data_->_tmp257_ = _data_->builder;
																			_data_->_tmp258_ = _data_->pa;
																			_data_->_tmp259_ = folks_postal_address_get_street (_data_->_tmp258_);
																			_data_->_tmp260_ = _data_->_tmp259_;
																			tracker_sparql_builder_object_string (_data_->_tmp257_, _data_->_tmp260_);
																			_data_->_tmp261_ = _data_->builder;
																			tracker_sparql_builder_predicate (_data_->_tmp261_, TRF_ONTOLOGY_DEFS_NCO_EXTENDED_ADDRESS);
																			_data_->_tmp262_ = _data_->builder;
																			_data_->_tmp263_ = _data_->pa;
																			_data_->_tmp264_ = folks_postal_address_get_extension (_data_->_tmp263_);
																			_data_->_tmp265_ = _data_->_tmp264_;
																			tracker_sparql_builder_object_string (_data_->_tmp262_, _data_->_tmp265_);
																			_data_->_tmp266_ = _data_->builder;
																			tracker_sparql_builder_predicate (_data_->_tmp266_, TRF_ONTOLOGY_DEFS_NCO_COUNTRY);
																			_data_->_tmp267_ = _data_->builder;
																			_data_->_tmp268_ = _data_->pa;
																			_data_->_tmp269_ = folks_postal_address_get_country (_data_->_tmp268_);
																			_data_->_tmp270_ = _data_->_tmp269_;
																			tracker_sparql_builder_object_string (_data_->_tmp267_, _data_->_tmp270_);
																			_data_->_tmp271_ = _data_->builder;
																			tracker_sparql_builder_predicate (_data_->_tmp271_, TRF_ONTOLOGY_DEFS_NCO_REGION);
																			_data_->_tmp272_ = _data_->builder;
																			_data_->_tmp273_ = _data_->pa;
																			_data_->_tmp274_ = folks_postal_address_get_region (_data_->_tmp273_);
																			_data_->_tmp275_ = _data_->_tmp274_;
																			tracker_sparql_builder_object_string (_data_->_tmp272_, _data_->_tmp275_);
																			_data_->_tmp276_ = _data_->builder;
																			_data_->_tmp277_ = _data_->postal_affl;
																			tracker_sparql_builder_subject (_data_->_tmp276_, _data_->_tmp277_);
																			_data_->_tmp278_ = _data_->builder;
																			tracker_sparql_builder_predicate (_data_->_tmp278_, "a");
																			_data_->_tmp279_ = _data_->builder;
																			tracker_sparql_builder_object (_data_->_tmp279_, TRF_ONTOLOGY_DEFS_NCO_AFFILIATION);
																			_data_->_tmp280_ = _data_->builder;
																			tracker_sparql_builder_predicate (_data_->_tmp280_, TRF_ONTOLOGY_DEFS_NCO_HAS_POSTAL_ADDRESS);
																			_data_->_tmp281_ = _data_->builder;
																			_data_->_tmp282_ = _data_->postal;
																			tracker_sparql_builder_object (_data_->_tmp281_, _data_->_tmp282_);
																			_data_->_tmp283_ = _data_->builder;
																			tracker_sparql_builder_subject (_data_->_tmp283_, "_:p");
																			_data_->_tmp284_ = _data_->builder;
																			tracker_sparql_builder_predicate (_data_->_tmp284_, TRF_ONTOLOGY_DEFS_NCO_HAS_AFFILIATION);
																			_data_->_tmp285_ = _data_->builder;
																			_data_->_tmp286_ = _data_->postal_affl;
																			tracker_sparql_builder_object (_data_->_tmp285_, _data_->_tmp286_);
																			_data_->_tmp287_ = _data_->postal_cnt;
																			_data_->postal_cnt = _data_->_tmp287_ + 1;
																			_g_free0 (_data_->postal);
																			_g_free0 (_data_->postal_affl);
																			_g_object_unref0 (_data_->pa);
																			_g_object_unref0 (_data_->pafd);
																		}
																		_g_object_unref0 (_data_->_pafd_it);
																	}
																	_g_object_unref0 (_data_->postal_addresses);
																} else {
																	_data_->_tmp288_ = _data_->k;
																	_data_->_tmp289_ = NULL;
																	_data_->_tmp289_ = folks_persona_store_detail_key (FOLKS_PERSONA_DETAIL_URLS);
																	if (g_strcmp0 (_data_->_tmp288_, _data_->_tmp289_) == 0) {
																		_data_->_tmp290_ = _data_->v;
																		_data_->_tmp291_ = NULL;
																		_data_->_tmp291_ = g_value_get_object (_data_->_tmp290_);
																		_data_->_tmp292_ = _g_object_ref0 (GEE_SET (_data_->_tmp291_));
																		_data_->url_fds = _data_->_tmp292_;
																		_data_->url_cnt = 0;
																		{
																			_data_->_tmp293_ = _data_->url_fds;
																			_data_->_tmp294_ = NULL;
																			_data_->_tmp294_ = gee_iterable_iterator ((GeeIterable*) _data_->_tmp293_);
																			_data_->_url_fd_it = _data_->_tmp294_;
																			while (TRUE) {
																				_data_->_tmp295_ = _data_->_url_fd_it;
																				_data_->_tmp296_ = FALSE;
																				_data_->_tmp296_ = gee_iterator_next (_data_->_tmp295_);
																				if (!_data_->_tmp296_) {
																					break;
																				}
																				_data_->_tmp297_ = _data_->_url_fd_it;
																				_data_->_tmp298_ = NULL;
																				_data_->_tmp298_ = gee_iterator_get (_data_->_tmp297_);
																				_data_->url_fd = (FolksUrlFieldDetails*) _data_->_tmp298_;
																				_data_->_tmp299_ = _data_->url_cnt;
																				_data_->_tmp300_ = NULL;
																				_data_->_tmp300_ = g_strdup_printf ("_:url_affl%d", _data_->_tmp299_);
																				_data_->url_affl = _data_->_tmp300_;
																				_data_->_tmp301_ = _data_->builder;
																				_data_->_tmp302_ = _data_->url_affl;
																				tracker_sparql_builder_subject (_data_->_tmp301_, _data_->_tmp302_);
																				_data_->_tmp303_ = _data_->builder;
																				tracker_sparql_builder_predicate (_data_->_tmp303_, "a");
																				_data_->_tmp304_ = _data_->builder;
																				tracker_sparql_builder_object (_data_->_tmp304_, TRF_ONTOLOGY_DEFS_NCO_AFFILIATION);
																				_data_->_tmp305_ = _data_->builder;
																				tracker_sparql_builder_predicate (_data_->_tmp305_, TRF_ONTOLOGY_DEFS_NCO_URL);
																				_data_->_tmp306_ = _data_->builder;
																				_data_->_tmp307_ = _data_->url_fd;
																				_data_->_tmp308_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) _data_->_tmp307_);
																				_data_->_tmp309_ = _data_->_tmp308_;
																				tracker_sparql_builder_object_string (_data_->_tmp306_, (const gchar*) _data_->_tmp309_);
																				_data_->_tmp310_ = _data_->builder;
																				tracker_sparql_builder_subject (_data_->_tmp310_, "_:p");
																				_data_->_tmp311_ = _data_->builder;
																				tracker_sparql_builder_predicate (_data_->_tmp311_, TRF_ONTOLOGY_DEFS_NCO_HAS_AFFILIATION);
																				_data_->_tmp312_ = _data_->builder;
																				_data_->_tmp313_ = _data_->url_affl;
																				tracker_sparql_builder_object (_data_->_tmp312_, _data_->_tmp313_);
																				_data_->_tmp314_ = _data_->url_cnt;
																				_data_->url_cnt = _data_->_tmp314_ + 1;
																				_g_free0 (_data_->url_affl);
																				_g_object_unref0 (_data_->url_fd);
																			}
																			_g_object_unref0 (_data_->_url_fd_it);
																		}
																		_g_object_unref0 (_data_->url_fds);
																	} else {
																		_data_->_tmp315_ = _data_->k;
																		_data_->_tmp316_ = NULL;
																		_data_->_tmp316_ = folks_persona_store_detail_key (FOLKS_PERSONA_DETAIL_LOCAL_IDS);
																		if (g_strcmp0 (_data_->_tmp315_, _data_->_tmp316_) == 0) {
																			_data_->_tmp317_ = _data_->v;
																			_data_->_tmp318_ = NULL;
																			_data_->_tmp318_ = g_value_get_object (_data_->_tmp317_);
																			_data_->_tmp319_ = _g_object_ref0 (GEE_HASH_SET (_data_->_tmp318_));
																			_data_->local_ids = _data_->_tmp319_;
																			_data_->_tmp320_ = _data_->local_ids;
																			_data_->_tmp321_ = NULL;
																			_data_->_tmp321_ = trf_persona_store_serialize_local_ids ((GeeSet*) _data_->_tmp320_);
																			_data_->ids = _data_->_tmp321_;
																			_data_->_tmp322_ = _data_->builder;
																			tracker_sparql_builder_subject (_data_->_tmp322_, "_:folks_ids");
																			_data_->_tmp323_ = _data_->builder;
																			tracker_sparql_builder_predicate (_data_->_tmp323_, "a");
																			_data_->_tmp324_ = _data_->builder;
																			tracker_sparql_builder_object (_data_->_tmp324_, TRF_ONTOLOGY_DEFS_NAO_PROPERTY);
																			_data_->_tmp325_ = _data_->builder;
																			tracker_sparql_builder_predicate (_data_->_tmp325_, TRF_ONTOLOGY_DEFS_NAO_PROPERTY_NAME);
																			_data_->_tmp326_ = _data_->builder;
																			tracker_sparql_builder_object_string (_data_->_tmp326_, TRF_PERSONA_STORE__LOCAL_ID_PROPERTY_NAME);
																			_data_->_tmp327_ = _data_->builder;
																			tracker_sparql_builder_predicate (_data_->_tmp327_, TRF_ONTOLOGY_DEFS_NAO_PROPERTY_VALUE);
																			_data_->_tmp328_ = _data_->builder;
																			_data_->_tmp329_ = _data_->ids;
																			tracker_sparql_builder_object_string (_data_->_tmp328_, _data_->_tmp329_);
																			_data_->_tmp330_ = _data_->builder;
																			tracker_sparql_builder_subject (_data_->_tmp330_, "_:p");
																			_data_->_tmp331_ = _data_->builder;
																			tracker_sparql_builder_predicate (_data_->_tmp331_, TRF_ONTOLOGY_DEFS_NAO_HAS_PROPERTY);
																			_data_->_tmp332_ = _data_->builder;
																			tracker_sparql_builder_object (_data_->_tmp332_, "_:folks_ids");
																			_g_free0 (_data_->ids);
																			_g_object_unref0 (_data_->local_ids);
																		} else {
																			_data_->_tmp333_ = _data_->k;
																			_data_->_tmp334_ = NULL;
																			_data_->_tmp334_ = folks_persona_store_detail_key (FOLKS_PERSONA_DETAIL_WEB_SERVICE_ADDRESSES);
																			if (g_strcmp0 (_data_->_tmp333_, _data_->_tmp334_) == 0) {
																				_data_->_tmp335_ = _data_->v;
																				_data_->_tmp336_ = NULL;
																				_data_->_tmp336_ = g_value_get_object (_data_->_tmp335_);
																				_data_->_tmp337_ = _g_object_ref0 (GEE_MULTI_MAP (_data_->_tmp336_));
																				_data_->ws_obj = _data_->_tmp337_;
																				_data_->_tmp338_ = _data_->ws_obj;
																				_data_->_tmp339_ = NULL;
																				_data_->_tmp339_ = trf_persona_store_serialize_web_services (_data_->_tmp338_);
																				_data_->ws_addrs = _data_->_tmp339_;
																				_data_->_tmp340_ = _data_->builder;
																				tracker_sparql_builder_subject (_data_->_tmp340_, "_:folks_ws_ids");
																				_data_->_tmp341_ = _data_->builder;
																				tracker_sparql_builder_predicate (_data_->_tmp341_, "a");
																				_data_->_tmp342_ = _data_->builder;
																				tracker_sparql_builder_object (_data_->_tmp342_, TRF_ONTOLOGY_DEFS_NAO_PROPERTY);
																				_data_->_tmp343_ = _data_->builder;
																				tracker_sparql_builder_predicate (_data_->_tmp343_, TRF_ONTOLOGY_DEFS_NAO_PROPERTY_NAME);
																				_data_->_tmp344_ = _data_->builder;
																				tracker_sparql_builder_object_string (_data_->_tmp344_, TRF_PERSONA_STORE__WSD_PROPERTY_NAME);
																				_data_->_tmp345_ = _data_->builder;
																				tracker_sparql_builder_predicate (_data_->_tmp345_, TRF_ONTOLOGY_DEFS_NAO_PROPERTY_VALUE);
																				_data_->_tmp346_ = _data_->builder;
																				_data_->_tmp347_ = _data_->ws_addrs;
																				tracker_sparql_builder_object_string (_data_->_tmp346_, _data_->_tmp347_);
																				_data_->_tmp348_ = _data_->builder;
																				tracker_sparql_builder_subject (_data_->_tmp348_, "_:p");
																				_data_->_tmp349_ = _data_->builder;
																				tracker_sparql_builder_predicate (_data_->_tmp349_, TRF_ONTOLOGY_DEFS_NAO_HAS_PROPERTY);
																				_data_->_tmp350_ = _data_->builder;
																				tracker_sparql_builder_object (_data_->_tmp350_, "_:folks_ws_ids");
																				_g_free0 (_data_->ws_addrs);
																				_g_object_unref0 (_data_->ws_obj);
																			} else {
																				_data_->_tmp351_ = NULL;
																				_data_->_tmp351_ = _ ("Unrecognized parameter %s by the  %s PersonaStore:\n')");
																				_data_->_tmp352_ = folks_persona_store_get_type_id ((FolksPersonaStore*) _data_->self);
																				_data_->_tmp353_ = _data_->_tmp352_;
																				_data_->_tmp354_ = _data_->k;
																				_data_->_tmp355_ = g_error_new (FOLKS_PERSONA_STORE_ERROR, FOLKS_PERSONA_STORE_ERROR_INVALID_ARGUMENT, _data_->_tmp351_, _data_->_tmp353_, _data_->_tmp354_);
																				_data_->_inner_error_ = _data_->_tmp355_;
																				if (_data_->_inner_error_->domain == FOLKS_PERSONA_STORE_ERROR) {
																					g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
																					g_error_free (_data_->_inner_error_);
																					__vala_GValue_free0 (_data_->v);
																					_g_list_free0 (_data_->k_collection);
																					_g_object_unref0 (_data_->builder);
																					_g_object_unref0 (_data_->avatar);
																					if (_data_->_state_ == 0) {
																						g_simple_async_result_complete_in_idle (_data_->_async_result);
																					} else {
																						g_simple_async_result_complete (_data_->_async_result);
																					}
																					g_object_unref (_data_->_async_result);
																					return FALSE;
																				} else {
																					__vala_GValue_free0 (_data_->v);
																					_g_list_free0 (_data_->k_collection);
																					_g_object_unref0 (_data_->builder);
																					_g_object_unref0 (_data_->avatar);
																					g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
																					g_clear_error (&_data_->_inner_error_);
																					return FALSE;
																				}
																			}
																		}
																	}
																}
															}
														}
													}
												}
											}
										}
									}
								}
							}
						}
					}
				}
				__vala_GValue_free0 (_data_->v);
			}
		}
		_g_list_free0 (_data_->k_collection);
	}
	_data_->_tmp356_ = _data_->builder;
	tracker_sparql_builder_insert_close (_data_->_tmp356_);
	_data_->ret = NULL;
	{
		_data_->_tmp357_ = _data_->self->priv->_personas;
		g_static_rec_mutex_lock (&_data_->self->priv->__lock__personas);
		{
			_data_->_tmp358_ = _data_->builder;
			_data_->_tmp359_ = tracker_sparql_builder_get_result (_data_->_tmp358_);
			_data_->_tmp360_ = _data_->_tmp359_;
			_data_->_state_ = 3;
			_trf_persona_store_insert_persona (_data_->self, _data_->_tmp360_, "p", trf_persona_store_add_persona_from_details_ready, _data_);
			return FALSE;
			_state_3:
			_data_->_tmp361_ = NULL;
			_data_->_tmp361_ = _trf_persona_store_insert_persona_finish (_data_->self, _data_->_res_);
			_data_->contact_urn = _data_->_tmp361_;
			_data_->_tmp362_ = _data_->contact_urn;
			if (_data_->_tmp362_ != NULL) {
				_data_->_tmp363_ = _data_->contact_urn;
				_data_->_tmp364_ = NULL;
				_data_->_tmp364_ = g_strdup_printf (" FILTER(?_contact = <%s>) ", _data_->_tmp363_);
				_data_->filter = _data_->_tmp364_;
				_data_->_tmp365_ = _data_->filter;
				_data_->_tmp366_ = NULL;
				_data_->_tmp366_ = g_strdup_printf (TRF_PERSONA_STORE__INITIAL_QUERY, _data_->_tmp365_);
				_data_->query = _data_->_tmp366_;
				_data_->_tmp367_ = _data_->query;
				_data_->_state_ = 4;
				_trf_persona_store_do_add_contacts (_data_->self, _data_->_tmp367_, trf_persona_store_add_persona_from_details_ready, _data_);
				return FALSE;
				_state_4:
				_data_->_tmp368_ = NULL;
				_data_->_tmp368_ = _trf_persona_store_do_add_contacts_finish (_data_->self, _data_->_res_);
				_data_->ret_personas = _data_->_tmp368_;
				{
					_data_->_tmp369_ = _data_->ret_personas;
					_data_->_tmp370_ = NULL;
					_data_->_tmp370_ = gee_abstract_collection_iterator ((GeeAbstractCollection*) _data_->_tmp369_);
					_data_->_p_it = _data_->_tmp370_;
					while (TRUE) {
						_data_->_tmp371_ = _data_->_p_it;
						_data_->_tmp372_ = FALSE;
						_data_->_tmp372_ = gee_iterator_next (_data_->_tmp371_);
						if (!_data_->_tmp372_) {
							break;
						}
						_data_->_tmp373_ = _data_->_p_it;
						_data_->_tmp374_ = NULL;
						_data_->_tmp374_ = gee_iterator_get (_data_->_tmp373_);
						_data_->p = (TrfPersona*) _data_->_tmp374_;
						_data_->_tmp375_ = _data_->p;
						_data_->_tmp376_ = _g_object_ref0 (_data_->_tmp375_);
						_g_object_unref0 (_data_->ret);
						_data_->ret = _data_->_tmp376_;
						_g_object_unref0 (_data_->p);
						break;
					}
					_g_object_unref0 (_data_->_p_it);
				}
				_g_object_unref0 (_data_->ret_personas);
				_g_free0 (_data_->query);
				_g_free0 (_data_->filter);
			} else {
				g_debug ("trf-persona-store.vala:758: Failed to inserting the new persona  into " \
"Tracker.");
			}
			_g_free0 (_data_->contact_urn);
		}
		__finally1:
		{
			_data_->_tmp377_ = _data_->self->priv->_personas;
			g_static_rec_mutex_unlock (&_data_->self->priv->__lock__personas);
		}
		if (_data_->_inner_error_ != NULL) {
			if (_data_->_inner_error_->domain == FOLKS_PERSONA_STORE_ERROR) {
				g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
				g_error_free (_data_->_inner_error_);
				_g_object_unref0 (_data_->ret);
				_g_object_unref0 (_data_->builder);
				_g_object_unref0 (_data_->avatar);
				if (_data_->_state_ == 0) {
					g_simple_async_result_complete_in_idle (_data_->_async_result);
				} else {
					g_simple_async_result_complete (_data_->_async_result);
				}
				g_object_unref (_data_->_async_result);
				return FALSE;
			} else {
				_g_object_unref0 (_data_->ret);
				_g_object_unref0 (_data_->builder);
				_g_object_unref0 (_data_->avatar);
				g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
				g_clear_error (&_data_->_inner_error_);
				return FALSE;
			}
		}
	}
	_data_->_tmp379_ = _data_->ret;
	if (_data_->_tmp379_ != NULL) {
		_data_->_tmp380_ = _data_->avatar;
		_data_->_tmp378_ = _data_->_tmp380_ != NULL;
	} else {
		_data_->_tmp378_ = FALSE;
	}
	_data_->_tmp381_ = _data_->_tmp378_;
	if (_data_->_tmp381_) {
		_data_->_tmp382_ = _data_->ret;
		_data_->_tmp383_ = _data_->avatar;
		_data_->_state_ = 5;
		_trf_persona_store_set_avatar (_data_->self, (FolksPersona*) _data_->_tmp382_, _data_->_tmp383_, trf_persona_store_add_persona_from_details_ready, _data_);
		return FALSE;
		_state_5:
		_trf_persona_store_set_avatar_finish (_data_->self, _data_->_res_);
	}
	_data_->result = (FolksPersona*) _data_->ret;
	_g_object_unref0 (_data_->builder);
	_g_object_unref0 (_data_->avatar);
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
	_g_object_unref0 (_data_->ret);
	_g_object_unref0 (_data_->builder);
	_g_object_unref0 (_data_->avatar);
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


/**
   * Returns "service1:addr1,addr2;service2:addr3,.."
   *
   * @since 0.5.1
   */
gchar* trf_persona_store_serialize_web_services (GeeMultiMap* ws_obj) {
	gchar* result = NULL;
	gchar* _tmp0_;
	gchar* str;
	g_return_val_if_fail (ws_obj != NULL, NULL);
	_tmp0_ = g_strdup ("");
	str = _tmp0_;
	{
		GeeMultiMap* _tmp1_;
		GeeSet* _tmp2_ = NULL;
		GeeSet* _tmp3_;
		GeeIterator* _tmp4_ = NULL;
		GeeIterator* _tmp5_;
		GeeIterator* _service_it;
		_tmp1_ = ws_obj;
		_tmp2_ = gee_multi_map_get_keys (_tmp1_);
		_tmp3_ = _tmp2_;
		_tmp4_ = gee_iterable_iterator ((GeeIterable*) _tmp3_);
		_tmp5_ = _tmp4_;
		_g_object_unref0 (_tmp3_);
		_service_it = _tmp5_;
		while (TRUE) {
			GeeIterator* _tmp6_;
			gboolean _tmp7_ = FALSE;
			GeeIterator* _tmp8_;
			gpointer _tmp9_ = NULL;
			gchar* service;
			const gchar* _tmp10_;
			const gchar* _tmp13_;
			const gchar* _tmp14_;
			gchar* _tmp15_;
			gchar* _tmp16_;
			gchar* _tmp17_;
			GeeMultiMap* _tmp18_;
			const gchar* _tmp19_;
			GeeCollection* _tmp20_ = NULL;
			GeeCollection* ws_fds;
			gboolean first;
			_tmp6_ = _service_it;
			_tmp7_ = gee_iterator_next (_tmp6_);
			if (!_tmp7_) {
				break;
			}
			_tmp8_ = _service_it;
			_tmp9_ = gee_iterator_get (_tmp8_);
			service = (gchar*) _tmp9_;
			_tmp10_ = str;
			if (g_strcmp0 (_tmp10_, "") != 0) {
				const gchar* _tmp11_;
				gchar* _tmp12_;
				_tmp11_ = str;
				_tmp12_ = g_strconcat (_tmp11_, ";", NULL);
				_g_free0 (str);
				str = _tmp12_;
			}
			_tmp13_ = str;
			_tmp14_ = service;
			_tmp15_ = g_strconcat (_tmp14_, ":", NULL);
			_tmp16_ = _tmp15_;
			_tmp17_ = g_strconcat (_tmp13_, _tmp16_, NULL);
			_g_free0 (str);
			str = _tmp17_;
			_g_free0 (_tmp16_);
			_tmp18_ = ws_obj;
			_tmp19_ = service;
			_tmp20_ = gee_multi_map_get (_tmp18_, _tmp19_);
			ws_fds = _tmp20_;
			first = TRUE;
			{
				GeeCollection* _tmp21_;
				GeeIterator* _tmp22_ = NULL;
				GeeIterator* _ws_fd_it;
				_tmp21_ = ws_fds;
				_tmp22_ = gee_iterable_iterator ((GeeIterable*) _tmp21_);
				_ws_fd_it = _tmp22_;
				while (TRUE) {
					GeeIterator* _tmp23_;
					gboolean _tmp24_ = FALSE;
					GeeIterator* _tmp25_;
					gpointer _tmp26_ = NULL;
					FolksWebServiceFieldDetails* ws_fd;
					gboolean _tmp27_;
					const gchar* _tmp30_;
					FolksWebServiceFieldDetails* _tmp31_;
					gconstpointer _tmp32_;
					const gchar* _tmp33_;
					gchar* _tmp34_;
					_tmp23_ = _ws_fd_it;
					_tmp24_ = gee_iterator_next (_tmp23_);
					if (!_tmp24_) {
						break;
					}
					_tmp25_ = _ws_fd_it;
					_tmp26_ = gee_iterator_get (_tmp25_);
					ws_fd = (FolksWebServiceFieldDetails*) _tmp26_;
					_tmp27_ = first;
					if (_tmp27_ == FALSE) {
						const gchar* _tmp28_;
						gchar* _tmp29_;
						_tmp28_ = str;
						_tmp29_ = g_strconcat (_tmp28_, ",", NULL);
						_g_free0 (str);
						str = _tmp29_;
					}
					_tmp30_ = str;
					_tmp31_ = ws_fd;
					_tmp32_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) _tmp31_);
					_tmp33_ = _tmp32_;
					_tmp34_ = g_strconcat (_tmp30_, (const gchar*) _tmp33_, NULL);
					_g_free0 (str);
					str = _tmp34_;
					first = FALSE;
					_g_object_unref0 (ws_fd);
				}
				_g_object_unref0 (_ws_fd_it);
			}
			_g_object_unref0 (ws_fds);
			_g_free0 (service);
		}
		_g_object_unref0 (_service_it);
	}
	result = str;
	return result;
}


/**
   * Transforms "service1:addr1,addr2;service2:addr3,.." to
   *   --->  HashMultiMap<string, string>
   *
   * @since 0.5.1
   */
GeeMultiMap* trf_persona_store_unserialize_web_services (const gchar* ws_addrs) {
	GeeMultiMap* result = NULL;
	GeeHashMultiMap* _tmp0_;
	GeeHashMultiMap* ret;
	const gchar* _tmp1_;
	gchar** _tmp2_;
	gchar** _tmp3_ = NULL;
	gchar** services;
	gint services_length1;
	gint _services_size_;
	gchar** _tmp4_;
	gint _tmp4__length1;
	g_return_val_if_fail (ws_addrs != NULL, NULL);
	_tmp0_ = gee_hash_multi_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, FOLKS_TYPE_WEB_SERVICE_FIELD_DETAILS, (GBoxedCopyFunc) g_object_ref, g_object_unref, NULL, NULL, (GHashFunc) folks_abstract_field_details_hash, (GEqualFunc) folks_abstract_field_details_equal);
	ret = _tmp0_;
	_tmp1_ = ws_addrs;
	_tmp3_ = _tmp2_ = g_strsplit (_tmp1_, ";", 0);
	services = _tmp3_;
	services_length1 = _vala_array_length (_tmp2_);
	_services_size_ = services_length1;
	_tmp4_ = services;
	_tmp4__length1 = services_length1;
	{
		gchar** service_line_collection = NULL;
		gint service_line_collection_length1 = 0;
		gint _service_line_collection_size_ = 0;
		gint service_line_it = 0;
		service_line_collection = _tmp4_;
		service_line_collection_length1 = _tmp4__length1;
		for (service_line_it = 0; service_line_it < _tmp4__length1; service_line_it = service_line_it + 1) {
			gchar* _tmp5_;
			gchar* service_line = NULL;
			_tmp5_ = g_strdup (service_line_collection[service_line_it]);
			service_line = _tmp5_;
			{
				const gchar* _tmp6_;
				gchar** _tmp7_;
				gchar** _tmp8_ = NULL;
				gchar** service_t;
				gint service_t_length1;
				gint _service_t_size_;
				gchar** _tmp9_;
				gint _tmp9__length1;
				const gchar* _tmp10_;
				gchar* _tmp11_;
				gchar* service_name;
				gchar** _tmp12_;
				gint _tmp12__length1;
				const gchar* _tmp13_;
				gchar** _tmp14_;
				gchar** _tmp15_ = NULL;
				gchar** addrs;
				gint addrs_length1;
				gint _addrs_size_;
				gchar** _tmp16_;
				gint _tmp16__length1;
				_tmp6_ = service_line;
				_tmp8_ = _tmp7_ = g_strsplit (_tmp6_, ":", 0);
				service_t = _tmp8_;
				service_t_length1 = _vala_array_length (_tmp7_);
				_service_t_size_ = service_t_length1;
				_tmp9_ = service_t;
				_tmp9__length1 = service_t_length1;
				_tmp10_ = _tmp9_[0];
				_tmp11_ = g_strdup (_tmp10_);
				service_name = _tmp11_;
				_tmp12_ = service_t;
				_tmp12__length1 = service_t_length1;
				_tmp13_ = _tmp12_[1];
				_tmp15_ = _tmp14_ = g_strsplit (_tmp13_, ",", 0);
				addrs = _tmp15_;
				addrs_length1 = _vala_array_length (_tmp14_);
				_addrs_size_ = addrs_length1;
				_tmp16_ = addrs;
				_tmp16__length1 = addrs_length1;
				{
					gchar** a_collection = NULL;
					gint a_collection_length1 = 0;
					gint _a_collection_size_ = 0;
					gint a_it = 0;
					a_collection = _tmp16_;
					a_collection_length1 = _tmp16__length1;
					for (a_it = 0; a_it < _tmp16__length1; a_it = a_it + 1) {
						gchar* _tmp17_;
						gchar* a = NULL;
						_tmp17_ = g_strdup (a_collection[a_it]);
						a = _tmp17_;
						{
							GeeHashMultiMap* _tmp18_;
							const gchar* _tmp19_;
							const gchar* _tmp20_;
							FolksWebServiceFieldDetails* _tmp21_;
							FolksWebServiceFieldDetails* _tmp22_;
							_tmp18_ = ret;
							_tmp19_ = service_name;
							_tmp20_ = a;
							_tmp21_ = folks_web_service_field_details_new (_tmp20_, NULL);
							_tmp22_ = _tmp21_;
							gee_multi_map_set ((GeeMultiMap*) _tmp18_, _tmp19_, _tmp22_);
							_g_object_unref0 (_tmp22_);
							_g_free0 (a);
						}
					}
				}
				addrs = (_vala_array_free (addrs, addrs_length1, (GDestroyNotify) g_free), NULL);
				_g_free0 (service_name);
				service_t = (_vala_array_free (service_t, service_t_length1, (GDestroyNotify) g_free), NULL);
				_g_free0 (service_line);
			}
		}
	}
	result = (GeeMultiMap*) ret;
	services = (_vala_array_free (services, services_length1, (GDestroyNotify) g_free), NULL);
	return result;
}


/**
   * Transform HashSet<string> to "id1,id2,.."
   *
   * @since 0.5.1
   */
gchar* trf_persona_store_serialize_local_ids (GeeSet* local_ids) {
	gchar* result = NULL;
	gchar* _tmp0_;
	gchar* str;
	g_return_val_if_fail (local_ids != NULL, NULL);
	_tmp0_ = g_strdup ("");
	str = _tmp0_;
	{
		GeeSet* _tmp1_;
		GeeIterator* _tmp2_ = NULL;
		GeeIterator* _id_it;
		_tmp1_ = local_ids;
		_tmp2_ = gee_iterable_iterator ((GeeIterable*) _tmp1_);
		_id_it = _tmp2_;
		while (TRUE) {
			GeeIterator* _tmp3_;
			gboolean _tmp4_ = FALSE;
			GeeIterator* _tmp5_;
			gpointer _tmp6_ = NULL;
			gchar* id;
			const gchar* _tmp7_;
			const gchar* _tmp10_;
			const gchar* _tmp11_;
			gchar* _tmp12_;
			_tmp3_ = _id_it;
			_tmp4_ = gee_iterator_next (_tmp3_);
			if (!_tmp4_) {
				break;
			}
			_tmp5_ = _id_it;
			_tmp6_ = gee_iterator_get (_tmp5_);
			id = (gchar*) _tmp6_;
			_tmp7_ = str;
			if (g_strcmp0 (_tmp7_, "") != 0) {
				const gchar* _tmp8_;
				gchar* _tmp9_;
				_tmp8_ = str;
				_tmp9_ = g_strconcat (_tmp8_, ",", NULL);
				_g_free0 (str);
				str = _tmp9_;
			}
			_tmp10_ = str;
			_tmp11_ = id;
			_tmp12_ = g_strconcat (_tmp10_, _tmp11_, NULL);
			_g_free0 (str);
			str = _tmp12_;
			_g_free0 (id);
		}
		_g_object_unref0 (_id_it);
	}
	result = str;
	return result;
}


/**
   * Transform from id1,id2,.. to HashSet<string>
   *
   * @since 0.5.1
   */
GeeSet* trf_persona_store_unserialize_local_ids (const gchar* local_ids) {
	GeeSet* result = NULL;
	GeeHashSet* _tmp0_;
	GeeHashSet* ids;
	const gchar* _tmp1_;
	g_return_val_if_fail (local_ids != NULL, NULL);
	_tmp0_ = gee_hash_set_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL, NULL);
	ids = _tmp0_;
	_tmp1_ = local_ids;
	if (g_strcmp0 (_tmp1_, "") != 0) {
		const gchar* _tmp2_;
		gchar** _tmp3_;
		gchar** _tmp4_ = NULL;
		gchar** ids_a;
		gint ids_a_length1;
		gint _ids_a_size_;
		gchar** _tmp5_;
		gint _tmp5__length1;
		_tmp2_ = local_ids;
		_tmp4_ = _tmp3_ = g_strsplit (_tmp2_, ",", 0);
		ids_a = _tmp4_;
		ids_a_length1 = _vala_array_length (_tmp3_);
		_ids_a_size_ = ids_a_length1;
		_tmp5_ = ids_a;
		_tmp5__length1 = ids_a_length1;
		{
			gchar** id_collection = NULL;
			gint id_collection_length1 = 0;
			gint _id_collection_size_ = 0;
			gint id_it = 0;
			id_collection = _tmp5_;
			id_collection_length1 = _tmp5__length1;
			for (id_it = 0; id_it < _tmp5__length1; id_it = id_it + 1) {
				gchar* _tmp6_;
				gchar* id = NULL;
				_tmp6_ = g_strdup (id_collection[id_it]);
				id = _tmp6_;
				{
					GeeHashSet* _tmp7_;
					const gchar* _tmp8_;
					_tmp7_ = ids;
					_tmp8_ = id;
					gee_abstract_collection_add ((GeeAbstractCollection*) _tmp7_, _tmp8_);
					_g_free0 (id);
				}
			}
		}
		ids_a = (_vala_array_free (ids_a, ids_a_length1, (GDestroyNotify) g_free), NULL);
	}
	result = (GeeSet*) ids;
	return result;
}


static void trf_persona_store_real_remove_persona_data_free (gpointer _data) {
	TrfPersonaStoreRemovePersonaData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->persona);
	_g_object_unref0 (_data_->self);
	g_slice_free (TrfPersonaStoreRemovePersonaData, _data_);
}


static void trf_persona_store_real_remove_persona (FolksPersonaStore* base, FolksPersona* persona, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	TrfPersonaStore * self;
	TrfPersonaStoreRemovePersonaData* _data_;
	TrfPersonaStore* _tmp0_;
	FolksPersona* _tmp1_;
	FolksPersona* _tmp2_;
	self = (TrfPersonaStore*) base;
	_data_ = g_slice_new0 (TrfPersonaStoreRemovePersonaData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, trf_persona_store_real_remove_persona);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, trf_persona_store_real_remove_persona_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = persona;
	_tmp2_ = _g_object_ref0 (_tmp1_);
	_data_->persona = _tmp2_;
	trf_persona_store_real_remove_persona_co (_data_);
}


static void trf_persona_store_real_remove_persona_finish (FolksPersonaStore* base, GAsyncResult* _res_, GError** error) {
	TrfPersonaStoreRemovePersonaData* _data_;
	if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
		return;
	}
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
}


/**
   * Remove a {@link Persona} from the PersonaStore.
   *
   * See {@link Folks.PersonaStore.remove_persona}.
   *
   */
static void trf_persona_store_remove_persona_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	TrfPersonaStoreRemovePersonaData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	trf_persona_store_real_remove_persona_co (_data_);
}


static gboolean trf_persona_store_real_remove_persona_co (TrfPersonaStoreRemovePersonaData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		case 2:
		goto _state_2;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->persona;
	_data_->_state_ = 1;
	_trf_persona_store_remove_attributes_from_persona (_data_->self, _data_->_tmp0_, _REMOVE_ALL_ATTRIBS, trf_persona_store_remove_persona_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp1_ = NULL;
	_data_->_tmp1_ = _trf_persona_store_remove_attributes_from_persona_finish (_data_->self, _data_->_res_);
	_data_->urn = _data_->_tmp1_;
	_data_->_tmp2_ = g_strdup (" DELETE { " " %s ?p ?o " "} " "WHERE { " " %s ?p ?o " "} ");
	_data_->q = _data_->_tmp2_;
	_data_->_tmp3_ = NULL;
	_data_->_tmp3_ = g_strdup_printf (_data_->q, _data_->urn, _data_->urn);
	_data_->_tmp4_ = _data_->_tmp3_;
	_data_->_state_ = 2;
	_trf_persona_store_tracker_update (_data_->self, _data_->_tmp4_, "remove_persona", trf_persona_store_remove_persona_ready, _data_);
	return FALSE;
	_state_2:
	_trf_persona_store_tracker_update_finish (_data_->self, _data_->_res_);
	_g_free0 (_data_->_tmp4_);
	_g_free0 (_data_->q);
	_g_free0 (_data_->urn);
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


static void _trf_persona_store_remove_attributes_from_persona_data_free (gpointer _data) {
	TrfPersonaStoreRemoveAttributesFromPersonaData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->persona);
	_g_free0 (_data_->result);
	_g_object_unref0 (_data_->self);
	g_slice_free (TrfPersonaStoreRemoveAttributesFromPersonaData, _data_);
}


static void _trf_persona_store_remove_attributes_from_persona (TrfPersonaStore* self, FolksPersona* persona, gchar remove_flag, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	TrfPersonaStoreRemoveAttributesFromPersonaData* _data_;
	TrfPersonaStore* _tmp0_;
	FolksPersona* _tmp1_;
	FolksPersona* _tmp2_;
	gchar _tmp3_;
	_data_ = g_slice_new0 (TrfPersonaStoreRemoveAttributesFromPersonaData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, _trf_persona_store_remove_attributes_from_persona);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, _trf_persona_store_remove_attributes_from_persona_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = persona;
	_tmp2_ = _g_object_ref0 (_tmp1_);
	_data_->persona = _tmp2_;
	_tmp3_ = remove_flag;
	_data_->remove_flag = _tmp3_;
	_trf_persona_store_remove_attributes_from_persona_co (_data_);
}


static gchar* _trf_persona_store_remove_attributes_from_persona_finish (TrfPersonaStore* self, GAsyncResult* _res_) {
	gchar* result;
	TrfPersonaStoreRemoveAttributesFromPersonaData* _data_;
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
	result = _data_->result;
	_data_->result = NULL;
	return result;
}


static void _trf_persona_store_remove_attributes_from_persona_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	TrfPersonaStoreRemoveAttributesFromPersonaData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	_trf_persona_store_remove_attributes_from_persona_co (_data_);
}


static gboolean _trf_persona_store_remove_attributes_from_persona_co (TrfPersonaStoreRemoveAttributesFromPersonaData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		case 2:
		goto _state_2;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->persona;
	_data_->_state_ = 1;
	_trf_persona_store_urn_from_persona (_data_->self, _data_->_tmp0_, _trf_persona_store_remove_attributes_from_persona_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp1_ = NULL;
	_data_->_tmp1_ = _trf_persona_store_urn_from_persona_finish (_data_->self, _data_->_res_);
	_data_->urn = _data_->_tmp1_;
	_data_->_tmp2_ = _data_->remove_flag;
	_data_->_state_ = 2;
	_trf_persona_store_remove_attributes (_data_->self, _data_->urn, _data_->_tmp2_, _trf_persona_store_remove_attributes_from_persona_ready, _data_);
	return FALSE;
	_state_2:
	_trf_persona_store_remove_attributes_finish (_data_->self, _data_->_res_);
	_data_->result = _data_->urn;
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
	_g_free0 (_data_->urn);
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


static void _trf_persona_store_build_update_query_set_data_free (gpointer _data) {
	TrfPersonaStoreBuildUpdateQuerySetData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->builder);
	_g_object_unref0 (_data_->properties);
	_g_free0 (_data_->contact_var);
	_g_object_unref0 (_data_->self);
	g_slice_free (TrfPersonaStoreBuildUpdateQuerySetData, _data_);
}


static void _trf_persona_store_build_update_query_set (TrfPersonaStore* self, TrackerSparqlBuilder* builder, GeeSet* properties, const gchar* contact_var, TrfAttrib attrib, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	TrfPersonaStoreBuildUpdateQuerySetData* _data_;
	TrfPersonaStore* _tmp0_;
	TrackerSparqlBuilder* _tmp1_;
	TrackerSparqlBuilder* _tmp2_;
	GeeSet* _tmp3_;
	GeeSet* _tmp4_;
	const gchar* _tmp5_;
	const gchar* _tmp6_;
	TrfAttrib _tmp7_;
	_data_ = g_slice_new0 (TrfPersonaStoreBuildUpdateQuerySetData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, _trf_persona_store_build_update_query_set);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, _trf_persona_store_build_update_query_set_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = builder;
	_tmp2_ = _g_object_ref0 (_tmp1_);
	_data_->builder = _tmp2_;
	_tmp3_ = properties;
	_tmp4_ = _g_object_ref0 (_tmp3_);
	_data_->properties = _tmp4_;
	_tmp5_ = contact_var;
	_tmp6_ = g_strdup (_tmp5_);
	_data_->contact_var = _tmp6_;
	_tmp7_ = attrib;
	_data_->attrib = _tmp7_;
	_trf_persona_store_build_update_query_set_co (_data_);
}


static void _trf_persona_store_build_update_query_set_finish (TrfPersonaStore* self, GAsyncResult* _res_) {
	TrfPersonaStoreBuildUpdateQuerySetData* _data_;
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
}


static void _trf_persona_store_build_update_query_set_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	TrfPersonaStoreBuildUpdateQuerySetData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	_trf_persona_store_build_update_query_set_co (_data_);
}


static gboolean _trf_persona_store_build_update_query_set_co (TrfPersonaStoreBuildUpdateQuerySetData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->affl_var = NULL;
	_data_->obj_var = NULL;
	_data_->related_attrib = NULL;
	_data_->related_prop = NULL;
	_data_->related_connection = NULL;
	_data_->_tmp0_ = _data_->attrib;
	switch (_data_->_tmp0_) {
		case TRF_ATTRIB_PHONES:
		{
			_data_->related_attrib = TRF_ONTOLOGY_DEFS_NCO_PHONE;
			_data_->related_prop = TRF_ONTOLOGY_DEFS_NCO_PHONE_PROP;
			_data_->related_connection = TRF_ONTOLOGY_DEFS_NCO_HAS_PHONE;
			_data_->_tmp1_ = g_strdup ("_:phone_affl%d");
			_g_free0 (_data_->affl_var);
			_data_->affl_var = _data_->_tmp1_;
			_data_->_tmp2_ = g_strdup ("_:phone%d");
			_g_free0 (_data_->obj_var);
			_data_->obj_var = _data_->_tmp2_;
			break;
		}
		case TRF_ATTRIB_EMAILS:
		{
			_data_->related_attrib = TRF_ONTOLOGY_DEFS_NCO_EMAIL;
			_data_->related_prop = TRF_ONTOLOGY_DEFS_NCO_EMAIL_PROP;
			_data_->related_connection = TRF_ONTOLOGY_DEFS_NCO_HAS_EMAIL;
			_data_->_tmp3_ = g_strdup ("_:email_affl%d");
			_g_free0 (_data_->affl_var);
			_data_->affl_var = _data_->_tmp3_;
			_data_->_tmp4_ = g_strdup ("_:email%d");
			_g_free0 (_data_->obj_var);
			_data_->obj_var = _data_->_tmp4_;
			break;
		}
		default:
		break;
	}
	_data_->cnt = 0;
	{
		_data_->_tmp5_ = _data_->properties;
		_data_->_tmp6_ = NULL;
		_data_->_tmp6_ = gee_iterable_iterator ((GeeIterable*) _data_->_tmp5_);
		_data_->_p_it = _data_->_tmp6_;
		while (TRUE) {
			_data_->_tmp7_ = _data_->_p_it;
			_data_->_tmp8_ = FALSE;
			_data_->_tmp8_ = gee_iterator_next (_data_->_tmp7_);
			if (!_data_->_tmp8_) {
				break;
			}
			_data_->_tmp9_ = _data_->_p_it;
			_data_->_tmp10_ = NULL;
			_data_->_tmp10_ = gee_iterator_get (_data_->_tmp9_);
			_data_->p = (FolksAbstractFieldDetails*) _data_->_tmp10_;
			_data_->_tmp11_ = _data_->affl_var;
			_data_->_tmp12_ = _data_->cnt;
			_data_->_tmp13_ = NULL;
			_data_->_tmp13_ = g_strdup_printf (_data_->_tmp11_, _data_->_tmp12_);
			_data_->affl = _data_->_tmp13_;
			_data_->_tmp14_ = _data_->related_attrib;
			_data_->_tmp15_ = _data_->related_prop;
			_data_->_tmp16_ = _data_->p;
			_data_->_tmp17_ = folks_abstract_field_details_get_value (_data_->_tmp16_);
			_data_->_tmp18_ = _data_->_tmp17_;
			_data_->_state_ = 1;
			_trf_persona_store_urn_from_property (_data_->self, _data_->_tmp14_, _data_->_tmp15_, (const gchar*) _data_->_tmp18_, _trf_persona_store_build_update_query_set_ready, _data_);
			return FALSE;
			_state_1:
			_data_->_tmp19_ = NULL;
			_data_->_tmp19_ = _trf_persona_store_urn_from_property_finish (_data_->self, _data_->_res_);
			_data_->obj = _data_->_tmp19_;
			_data_->_tmp20_ = _data_->obj;
			if (g_strcmp0 (_data_->_tmp20_, "") == 0) {
				_data_->_tmp21_ = _data_->obj_var;
				_data_->_tmp22_ = _data_->cnt;
				_data_->_tmp23_ = NULL;
				_data_->_tmp23_ = g_strdup_printf (_data_->_tmp21_, _data_->_tmp22_);
				_g_free0 (_data_->obj);
				_data_->obj = _data_->_tmp23_;
				_data_->_tmp24_ = _data_->builder;
				_data_->_tmp25_ = _data_->obj;
				tracker_sparql_builder_subject (_data_->_tmp24_, _data_->_tmp25_);
				_data_->_tmp26_ = _data_->builder;
				tracker_sparql_builder_predicate (_data_->_tmp26_, "a");
				_data_->_tmp27_ = _data_->builder;
				_data_->_tmp28_ = _data_->related_attrib;
				tracker_sparql_builder_object (_data_->_tmp27_, _data_->_tmp28_);
				_data_->_tmp29_ = _data_->builder;
				_data_->_tmp30_ = _data_->related_prop;
				tracker_sparql_builder_predicate (_data_->_tmp29_, _data_->_tmp30_);
				_data_->_tmp31_ = _data_->builder;
				_data_->_tmp32_ = _data_->p;
				_data_->_tmp33_ = folks_abstract_field_details_get_value (_data_->_tmp32_);
				_data_->_tmp34_ = _data_->_tmp33_;
				tracker_sparql_builder_object_string (_data_->_tmp31_, (const gchar*) _data_->_tmp34_);
			}
			_data_->_tmp35_ = _data_->builder;
			_data_->_tmp36_ = _data_->affl;
			tracker_sparql_builder_subject (_data_->_tmp35_, _data_->_tmp36_);
			_data_->_tmp37_ = _data_->builder;
			tracker_sparql_builder_predicate (_data_->_tmp37_, "a");
			_data_->_tmp38_ = _data_->builder;
			tracker_sparql_builder_object (_data_->_tmp38_, TRF_ONTOLOGY_DEFS_NCO_AFFILIATION);
			_data_->_tmp39_ = _data_->builder;
			_data_->_tmp40_ = _data_->related_connection;
			tracker_sparql_builder_predicate (_data_->_tmp39_, _data_->_tmp40_);
			_data_->_tmp41_ = _data_->builder;
			_data_->_tmp42_ = _data_->obj;
			tracker_sparql_builder_object (_data_->_tmp41_, _data_->_tmp42_);
			_data_->_tmp43_ = _data_->builder;
			_data_->_tmp44_ = _data_->contact_var;
			tracker_sparql_builder_subject (_data_->_tmp43_, _data_->_tmp44_);
			_data_->_tmp45_ = _data_->builder;
			tracker_sparql_builder_predicate (_data_->_tmp45_, TRF_ONTOLOGY_DEFS_NCO_HAS_AFFILIATION);
			_data_->_tmp46_ = _data_->builder;
			_data_->_tmp47_ = _data_->affl;
			tracker_sparql_builder_object (_data_->_tmp46_, _data_->_tmp47_);
			_data_->_tmp48_ = _data_->cnt;
			_data_->cnt = _data_->_tmp48_ + 1;
			_g_free0 (_data_->obj);
			_g_free0 (_data_->affl);
			_g_object_unref0 (_data_->p);
		}
		_g_object_unref0 (_data_->_p_it);
	}
	_g_free0 (_data_->obj_var);
	_g_free0 (_data_->affl_var);
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


static void _trf_persona_store_remove_attributes_data_free (gpointer _data) {
	TrfPersonaStoreRemoveAttributesData* _data_;
	_data_ = _data;
	_g_free0 (_data_->urn);
	_g_object_unref0 (_data_->self);
	g_slice_free (TrfPersonaStoreRemoveAttributesData, _data_);
}


static void _trf_persona_store_remove_attributes (TrfPersonaStore* self, const gchar* urn, gchar remove_flag, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	TrfPersonaStoreRemoveAttributesData* _data_;
	TrfPersonaStore* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	gchar _tmp3_;
	_data_ = g_slice_new0 (TrfPersonaStoreRemoveAttributesData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, _trf_persona_store_remove_attributes);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, _trf_persona_store_remove_attributes_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = urn;
	_tmp2_ = g_strdup (_tmp1_);
	_data_->urn = _tmp2_;
	_tmp3_ = remove_flag;
	_data_->remove_flag = _tmp3_;
	_trf_persona_store_remove_attributes_co (_data_);
}


static void _trf_persona_store_remove_attributes_finish (TrfPersonaStore* self, GAsyncResult* _res_) {
	TrfPersonaStoreRemoveAttributesData* _data_;
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
}


static void _trf_persona_store_remove_attributes_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	TrfPersonaStoreRemoveAttributesData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	_trf_persona_store_remove_attributes_co (_data_);
}


static gboolean _trf_persona_store_remove_attributes_co (TrfPersonaStoreRemoveAttributesData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		case 2:
		goto _state_2;
		case 3:
		goto _state_3;
		case 4:
		goto _state_4;
		case 5:
		goto _state_5;
		case 6:
		goto _state_6;
		case 7:
		goto _state_7;
		case 8:
		goto _state_8;
		case 9:
		goto _state_9;
		case 10:
		goto _state_10;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->urn;
	_data_->_state_ = 1;
	_trf_persona_store_affiliations_from_persona (_data_->self, _data_->_tmp0_, _trf_persona_store_remove_attributes_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp1_ = NULL;
	_data_->_tmp1_ = _trf_persona_store_affiliations_from_persona_finish (_data_->self, _data_->_res_);
	_data_->affiliations = _data_->_tmp1_;
	{
		_data_->_tmp2_ = _data_->affiliations;
		_data_->_tmp3_ = NULL;
		_data_->_tmp3_ = gee_abstract_collection_iterator ((GeeAbstractCollection*) _data_->_tmp2_);
		_data_->_affl_it = _data_->_tmp3_;
		while (TRUE) {
			_data_->_tmp4_ = _data_->_affl_it;
			_data_->_tmp5_ = FALSE;
			_data_->_tmp5_ = gee_iterator_next (_data_->_tmp4_);
			if (!_data_->_tmp5_) {
				break;
			}
			_data_->_tmp6_ = _data_->_affl_it;
			_data_->_tmp7_ = NULL;
			_data_->_tmp7_ = gee_iterator_get (_data_->_tmp6_);
			_data_->affl = (gchar*) _data_->_tmp7_;
			_data_->got_attrib = FALSE;
			_data_->_tmp9_ = _data_->remove_flag;
			if ((_data_->_tmp9_ & _REMOVE_ALL_ATTRIBS) == _REMOVE_ALL_ATTRIBS) {
				_data_->_tmp8_ = TRUE;
			} else {
				_data_->_tmp10_ = _data_->remove_flag;
				_data_->_tmp8_ = (_data_->_tmp10_ & _REMOVE_PHONES) == _REMOVE_PHONES;
			}
			_data_->_tmp11_ = _data_->_tmp8_;
			if (_data_->_tmp11_) {
				_data_->_tmp12_ = _data_->affl;
				_data_->_state_ = 2;
				_trf_persona_store_phones_from_affiliation (_data_->self, _data_->_tmp12_, _trf_persona_store_remove_attributes_ready, _data_);
				return FALSE;
				_state_2:
				_data_->_tmp13_ = NULL;
				_data_->_tmp13_ = _trf_persona_store_phones_from_affiliation_finish (_data_->self, _data_->_res_);
				_data_->phones = _data_->_tmp13_;
				{
					_data_->_tmp14_ = _data_->phones;
					_data_->_tmp15_ = NULL;
					_data_->_tmp15_ = gee_abstract_collection_iterator ((GeeAbstractCollection*) _data_->_tmp14_);
					_data_->_phone_it = _data_->_tmp15_;
					while (TRUE) {
						_data_->_tmp16_ = _data_->_phone_it;
						_data_->_tmp17_ = FALSE;
						_data_->_tmp17_ = gee_iterator_next (_data_->_tmp16_);
						if (!_data_->_tmp17_) {
							break;
						}
						_data_->_tmp18_ = _data_->_phone_it;
						_data_->_tmp19_ = NULL;
						_data_->_tmp19_ = gee_iterator_get (_data_->_tmp18_);
						_data_->phone = (gchar*) _data_->_tmp19_;
						_data_->got_attrib = TRUE;
						_data_->_tmp20_ = _data_->phone;
						_data_->_state_ = 3;
						_trf_persona_store_delete_resource (_data_->self, _data_->_tmp20_, TRUE, _trf_persona_store_remove_attributes_ready, _data_);
						return FALSE;
						_state_3:
						_trf_persona_store_delete_resource_finish (_data_->self, _data_->_res_);
						_g_free0 (_data_->phone);
					}
					_g_object_unref0 (_data_->_phone_it);
				}
				_g_object_unref0 (_data_->phones);
			}
			_data_->_tmp22_ = _data_->remove_flag;
			if ((_data_->_tmp22_ & _REMOVE_ALL_ATTRIBS) == _REMOVE_ALL_ATTRIBS) {
				_data_->_tmp21_ = TRUE;
			} else {
				_data_->_tmp23_ = _data_->remove_flag;
				_data_->_tmp21_ = (_data_->_tmp23_ & _REMOVE_POSTALS) == _REMOVE_POSTALS;
			}
			_data_->_tmp24_ = _data_->_tmp21_;
			if (_data_->_tmp24_) {
				_data_->_tmp25_ = _data_->affl;
				_data_->_state_ = 4;
				_trf_persona_store_postals_from_affiliation (_data_->self, _data_->_tmp25_, _trf_persona_store_remove_attributes_ready, _data_);
				return FALSE;
				_state_4:
				_data_->_tmp26_ = NULL;
				_data_->_tmp26_ = _trf_persona_store_postals_from_affiliation_finish (_data_->self, _data_->_res_);
				_data_->postals = _data_->_tmp26_;
				{
					_data_->_tmp27_ = _data_->postals;
					_data_->_tmp28_ = NULL;
					_data_->_tmp28_ = gee_abstract_collection_iterator ((GeeAbstractCollection*) _data_->_tmp27_);
					_data_->_postal_it = _data_->_tmp28_;
					while (TRUE) {
						_data_->_tmp29_ = _data_->_postal_it;
						_data_->_tmp30_ = FALSE;
						_data_->_tmp30_ = gee_iterator_next (_data_->_tmp29_);
						if (!_data_->_tmp30_) {
							break;
						}
						_data_->_tmp31_ = _data_->_postal_it;
						_data_->_tmp32_ = NULL;
						_data_->_tmp32_ = gee_iterator_get (_data_->_tmp31_);
						_data_->postal = (gchar*) _data_->_tmp32_;
						_data_->got_attrib = TRUE;
						_data_->_tmp33_ = _data_->postal;
						_data_->_state_ = 5;
						_trf_persona_store_delete_resource (_data_->self, _data_->_tmp33_, TRUE, _trf_persona_store_remove_attributes_ready, _data_);
						return FALSE;
						_state_5:
						_trf_persona_store_delete_resource_finish (_data_->self, _data_->_res_);
						_g_free0 (_data_->postal);
					}
					_g_object_unref0 (_data_->_postal_it);
				}
				_g_object_unref0 (_data_->postals);
			}
			_data_->_tmp35_ = _data_->remove_flag;
			if ((_data_->_tmp35_ & _REMOVE_ALL_ATTRIBS) == _REMOVE_ALL_ATTRIBS) {
				_data_->_tmp34_ = TRUE;
			} else {
				_data_->_tmp36_ = _data_->remove_flag;
				_data_->_tmp34_ = (_data_->_tmp36_ & _REMOVE_IM_ADDRS) == _REMOVE_IM_ADDRS;
			}
			_data_->_tmp37_ = _data_->_tmp34_;
			if (_data_->_tmp37_) {
				_data_->_tmp38_ = _data_->affl;
				_data_->_state_ = 6;
				_trf_persona_store_imaddrs_from_affiliation (_data_->self, _data_->_tmp38_, _trf_persona_store_remove_attributes_ready, _data_);
				return FALSE;
				_state_6:
				_data_->_tmp39_ = NULL;
				_data_->_tmp39_ = _trf_persona_store_imaddrs_from_affiliation_finish (_data_->self, _data_->_res_);
				_data_->im_addrs = _data_->_tmp39_;
				{
					_data_->_tmp40_ = _data_->im_addrs;
					_data_->_tmp41_ = NULL;
					_data_->_tmp41_ = gee_abstract_collection_iterator ((GeeAbstractCollection*) _data_->_tmp40_);
					_data_->_im_addr_it = _data_->_tmp41_;
					while (TRUE) {
						_data_->_tmp42_ = _data_->_im_addr_it;
						_data_->_tmp43_ = FALSE;
						_data_->_tmp43_ = gee_iterator_next (_data_->_tmp42_);
						if (!_data_->_tmp43_) {
							break;
						}
						_data_->_tmp44_ = _data_->_im_addr_it;
						_data_->_tmp45_ = NULL;
						_data_->_tmp45_ = gee_iterator_get (_data_->_tmp44_);
						_data_->im_addr = (gchar*) _data_->_tmp45_;
						_data_->got_attrib = TRUE;
						_data_->_tmp46_ = _data_->im_addr;
						_data_->_state_ = 7;
						_trf_persona_store_delete_resource (_data_->self, _data_->_tmp46_, TRUE, _trf_persona_store_remove_attributes_ready, _data_);
						return FALSE;
						_state_7:
						_trf_persona_store_delete_resource_finish (_data_->self, _data_->_res_);
						_g_free0 (_data_->im_addr);
					}
					_g_object_unref0 (_data_->_im_addr_it);
				}
				_g_object_unref0 (_data_->im_addrs);
			}
			_data_->_tmp48_ = _data_->remove_flag;
			if ((_data_->_tmp48_ & _REMOVE_ALL_ATTRIBS) == _REMOVE_ALL_ATTRIBS) {
				_data_->_tmp47_ = TRUE;
			} else {
				_data_->_tmp49_ = _data_->remove_flag;
				_data_->_tmp47_ = (_data_->_tmp49_ & _REMOVE_EMAILS) == _REMOVE_EMAILS;
			}
			_data_->_tmp50_ = _data_->_tmp47_;
			if (_data_->_tmp50_) {
				_data_->_tmp51_ = _data_->affl;
				_data_->_state_ = 8;
				_trf_persona_store_emails_from_affiliation (_data_->self, _data_->_tmp51_, _trf_persona_store_remove_attributes_ready, _data_);
				return FALSE;
				_state_8:
				_data_->_tmp52_ = NULL;
				_data_->_tmp52_ = _trf_persona_store_emails_from_affiliation_finish (_data_->self, _data_->_res_);
				_data_->emails = _data_->_tmp52_;
				{
					_data_->_tmp53_ = _data_->emails;
					_data_->_tmp54_ = NULL;
					_data_->_tmp54_ = gee_abstract_collection_iterator ((GeeAbstractCollection*) _data_->_tmp53_);
					_data_->_email_it = _data_->_tmp54_;
					while (TRUE) {
						_data_->_tmp55_ = _data_->_email_it;
						_data_->_tmp56_ = FALSE;
						_data_->_tmp56_ = gee_iterator_next (_data_->_tmp55_);
						if (!_data_->_tmp56_) {
							break;
						}
						_data_->_tmp57_ = _data_->_email_it;
						_data_->_tmp58_ = NULL;
						_data_->_tmp58_ = gee_iterator_get (_data_->_tmp57_);
						_data_->email = (gchar*) _data_->_tmp58_;
						_data_->got_attrib = TRUE;
						_data_->_tmp59_ = _data_->email;
						_data_->_state_ = 9;
						_trf_persona_store_delete_resource (_data_->self, _data_->_tmp59_, TRUE, _trf_persona_store_remove_attributes_ready, _data_);
						return FALSE;
						_state_9:
						_trf_persona_store_delete_resource_finish (_data_->self, _data_->_res_);
						_g_free0 (_data_->email);
					}
					_g_object_unref0 (_data_->_email_it);
				}
				_g_object_unref0 (_data_->emails);
			}
			_data_->_tmp61_ = _data_->got_attrib;
			if (_data_->_tmp61_) {
				_data_->_tmp60_ = TRUE;
			} else {
				_data_->_tmp62_ = _data_->remove_flag;
				_data_->_tmp60_ = (_data_->_tmp62_ & _REMOVE_ALL_ATTRIBS) == _REMOVE_ALL_ATTRIBS;
			}
			_data_->_tmp63_ = _data_->_tmp60_;
			if (_data_->_tmp63_) {
				_data_->_tmp64_ = _data_->affl;
				_data_->_state_ = 10;
				_trf_persona_store_delete_resource (_data_->self, _data_->_tmp64_, TRUE, _trf_persona_store_remove_attributes_ready, _data_);
				return FALSE;
				_state_10:
				_trf_persona_store_delete_resource_finish (_data_->self, _data_->_res_);
			}
			_g_free0 (_data_->affl);
		}
		_g_object_unref0 (_data_->_affl_it);
	}
	_g_object_unref0 (_data_->affiliations);
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


static void trf_persona_store_real_prepare_data_free (gpointer _data) {
	TrfPersonaStorePrepareData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->self);
	g_slice_free (TrfPersonaStorePrepareData, _data_);
}


static void trf_persona_store_real_prepare (FolksPersonaStore* base, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	TrfPersonaStore * self;
	TrfPersonaStorePrepareData* _data_;
	TrfPersonaStore* _tmp0_;
	self = (TrfPersonaStore*) base;
	_data_ = g_slice_new0 (TrfPersonaStorePrepareData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, trf_persona_store_real_prepare);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, trf_persona_store_real_prepare_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	trf_persona_store_real_prepare_co (_data_);
}


static void trf_persona_store_real_prepare_finish (FolksPersonaStore* base, GAsyncResult* _res_, GError** error) {
	TrfPersonaStorePrepareData* _data_;
	if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
		return;
	}
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
}


/**
   * Prepare the PersonaStore for use.
   *
   * TODO: we should throw different errors dependening on what went wrong
   *       when we were trying to setup the PersonaStore.
   *
   * See {@link Folks.PersonaStore.prepare}.
   */
static void trf_persona_store_prepare_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	TrfPersonaStorePrepareData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	trf_persona_store_real_prepare_co (_data_);
}


static void __trf_persona_store_graph_updated_cb_gd_bus_signal_callback (GDBusConnection* connection, const gchar* sender_name, const gchar* object_path, const gchar* interface_name, const gchar* signal_name, GVariant* parameters, gpointer self) {
	_trf_persona_store_graph_updated_cb (self, connection, sender_name, object_path, interface_name, signal_name, parameters);
}


static gboolean trf_persona_store_real_prepare_co (TrfPersonaStorePrepareData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		case 2:
		goto _state_2;
		case 3:
		goto _state_3;
		case 4:
		goto _state_4;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	{
		_data_->_tmp0_ = _data_->self->priv->_is_prepared;
		g_static_rec_mutex_lock (&_data_->self->priv->__lock__is_prepared);
		{
			_data_->_tmp1_ = _data_->self->priv->_is_prepared;
			if (!_data_->_tmp1_) {
				{
					_data_->_state_ = 1;
					tracker_sparql_connection_get_async (NULL, trf_persona_store_prepare_ready, _data_);
					return FALSE;
					_state_1:
					_data_->_tmp2_ = NULL;
					_data_->_tmp2_ = tracker_sparql_connection_get_finish (_data_->_res_, &_data_->_inner_error_);
					_data_->_tmp3_ = _data_->_tmp2_;
					if (_data_->_inner_error_ != NULL) {
						if (_data_->_inner_error_->domain == G_IO_ERROR) {
							goto __catch3_g_io_error;
						}
						if (_data_->_inner_error_->domain == TRACKER_SPARQL_ERROR) {
							goto __catch3_tracker_sparql_error;
						}
						if (_data_->_inner_error_->domain == G_DBUS_ERROR) {
							goto __catch3_g_dbus_error;
						}
						goto __finally3;
					}
					_g_object_unref0 (_data_->self->priv->_connection);
					_data_->self->priv->_connection = _data_->_tmp3_;
					_data_->_state_ = 2;
					_trf_persona_store_build_predicates_table (_data_->self, trf_persona_store_prepare_ready, _data_);
					return FALSE;
					_state_2:
					_trf_persona_store_build_predicates_table_finish (_data_->self, _data_->_res_);
					_data_->_tmp4_ = NULL;
					_data_->_tmp4_ = g_strdup_printf (TRF_PERSONA_STORE__INITIAL_QUERY, "");
					_data_->_tmp5_ = _data_->_tmp4_;
					_data_->_state_ = 3;
					_trf_persona_store_do_add_contacts (_data_->self, _data_->_tmp5_, trf_persona_store_prepare_ready, _data_);
					return FALSE;
					_state_3:
					_data_->_tmp6_ = NULL;
					_data_->_tmp6_ = _trf_persona_store_do_add_contacts_finish (_data_->self, _data_->_res_);
					_data_->_tmp7_ = _data_->_tmp6_;
					_g_object_unref0 (_data_->_tmp7_);
					_g_free0 (_data_->_tmp5_);
					_data_->_state_ = 4;
					g_async_initable_new_async (TYPE_RESOURCES_PROXY, 0, NULL, trf_persona_store_prepare_ready, _data_, "g-flags", G_DBUS_PROXY_FLAGS_DO_NOT_CONNECT_SIGNALS | G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES, "g-name", TRF_PERSONA_STORE__OBJECT_NAME, "g-bus-type", G_BUS_TYPE_SESSION, "g-object-path", TRF_PERSONA_STORE__OBJECT_PATH, "g-interface-name", "org.freedesktop.Tracker1.Resources", NULL);
					return FALSE;
					_state_4:
					_data_->_tmp8_ = NULL;
					_data_->_tmp8_ = g_async_initable_new_finish (_data_->_source_object_, _data_->_res_, &_data_->_inner_error_);
					_data_->_tmp9_ = (Resources*) _data_->_tmp8_;
					if (_data_->_inner_error_ != NULL) {
						if (_data_->_inner_error_->domain == G_IO_ERROR) {
							goto __catch3_g_io_error;
						}
						if (_data_->_inner_error_->domain == TRACKER_SPARQL_ERROR) {
							goto __catch3_tracker_sparql_error;
						}
						if (_data_->_inner_error_->domain == G_DBUS_ERROR) {
							goto __catch3_g_dbus_error;
						}
						{
							_data_->_tmp10_ = _data_->self->priv->_is_prepared;
							g_static_rec_mutex_unlock (&_data_->self->priv->__lock__is_prepared);
						}
						g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
						g_clear_error (&_data_->_inner_error_);
						return FALSE;
					}
					_g_object_unref0 (_data_->self->priv->_resources_object);
					_data_->self->priv->_resources_object = _data_->_tmp9_;
					_data_->_tmp11_ = _data_->self->priv->_resources_object;
					_data_->_tmp12_ = NULL;
					g_object_get ((GDBusProxy*) _data_->_tmp11_, "g-connection", &_data_->_tmp12_, NULL);
					_data_->_tmp13_ = _data_->_tmp12_;
					_data_->_tmp14_ = _data_->_tmp13_;
					g_dbus_connection_signal_subscribe (_data_->_tmp14_, TRF_PERSONA_STORE__OBJECT_NAME, TRF_PERSONA_STORE__OBJECT_IFACE, "GraphUpdated", TRF_PERSONA_STORE__OBJECT_PATH, TRF_ONTOLOGY_DEFS_PERSON_CLASS, G_DBUS_SIGNAL_FLAGS_NONE, __trf_persona_store_graph_updated_cb_gd_bus_signal_callback, g_object_ref (_data_->self), g_object_unref);
					_g_object_unref0 (_data_->_tmp14_);
					_data_->self->priv->_is_prepared = TRUE;
					g_object_notify ((GObject*) _data_->self, "is-prepared");
					_data_->self->priv->_is_quiescent = TRUE;
					g_object_notify ((GObject*) _data_->self, "is-quiescent");
				}
				goto __finally3;
				__catch3_g_io_error:
				{
					_data_->e1 = _data_->_inner_error_;
					_data_->_inner_error_ = NULL;
					_data_->_tmp15_ = _data_->e1;
					_data_->_tmp16_ = _data_->_tmp15_->message;
					g_warning ("trf-persona-store.vala:1095: Could not connect to D-Bus service: %s", _data_->_tmp16_);
					g_signal_emit_by_name ((FolksPersonaStore*) _data_->self, "removed");
					_data_->_tmp17_ = _data_->e1;
					_data_->_tmp18_ = _data_->_tmp17_->message;
					_data_->_tmp19_ = g_error_new_literal (FOLKS_PERSONA_STORE_ERROR, FOLKS_PERSONA_STORE_ERROR_INVALID_ARGUMENT, _data_->_tmp18_);
					_data_->_inner_error_ = _data_->_tmp19_;
					_g_error_free0 (_data_->e1);
					goto __finally3;
				}
				goto __finally3;
				__catch3_tracker_sparql_error:
				{
					_data_->e2 = _data_->_inner_error_;
					_data_->_inner_error_ = NULL;
					_data_->_tmp20_ = _data_->e2;
					_data_->_tmp21_ = _data_->_tmp20_->message;
					g_warning ("trf-persona-store.vala:1102: Error fetching SPARQL connection handler:" \
" %s", _data_->_tmp21_);
					g_signal_emit_by_name ((FolksPersonaStore*) _data_->self, "removed");
					_data_->_tmp22_ = _data_->e2;
					_data_->_tmp23_ = _data_->_tmp22_->message;
					_data_->_tmp24_ = g_error_new_literal (FOLKS_PERSONA_STORE_ERROR, FOLKS_PERSONA_STORE_ERROR_INVALID_ARGUMENT, _data_->_tmp23_);
					_data_->_inner_error_ = _data_->_tmp24_;
					_g_error_free0 (_data_->e2);
					goto __finally3;
				}
				goto __finally3;
				__catch3_g_dbus_error:
				{
					_data_->e3 = _data_->_inner_error_;
					_data_->_inner_error_ = NULL;
					_data_->_tmp25_ = _data_->e3;
					_data_->_tmp26_ = _data_->_tmp25_->message;
					g_warning ("trf-persona-store.vala:1109: Could not connect to D-Bus service: %s", _data_->_tmp26_);
					g_signal_emit_by_name ((FolksPersonaStore*) _data_->self, "removed");
					_data_->_tmp27_ = _data_->e3;
					_data_->_tmp28_ = _data_->_tmp27_->message;
					_data_->_tmp29_ = g_error_new_literal (FOLKS_PERSONA_STORE_ERROR, FOLKS_PERSONA_STORE_ERROR_INVALID_ARGUMENT, _data_->_tmp28_);
					_data_->_inner_error_ = _data_->_tmp29_;
					_g_error_free0 (_data_->e3);
					goto __finally3;
				}
				__finally3:
				if (_data_->_inner_error_ != NULL) {
					goto __finally2;
				}
			}
		}
		__finally2:
		{
			_data_->_tmp30_ = _data_->self->priv->_is_prepared;
			g_static_rec_mutex_unlock (&_data_->self->priv->__lock__is_prepared);
		}
		if (_data_->_inner_error_ != NULL) {
			g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
			g_error_free (_data_->_inner_error_);
			if (_data_->_state_ == 0) {
				g_simple_async_result_complete_in_idle (_data_->_async_result);
			} else {
				g_simple_async_result_complete (_data_->_async_result);
			}
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
	}
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


gint trf_persona_store_get_favorite_id (TrfPersonaStore* self) {
	gint result = 0;
	GeeTreeMap* _tmp0_;
	gpointer _tmp1_ = NULL;
	g_return_val_if_fail (self != NULL, 0);
	_tmp0_ = trf_persona_store__prefix_tracker_id;
	_tmp1_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp0_, TRF_ONTOLOGY_DEFS_NAO_FAVORITE);
	result = GPOINTER_TO_INT (_tmp1_);
	return result;
}


gint trf_persona_store_get_gender_male_id (TrfPersonaStore* self) {
	gint result = 0;
	GeeTreeMap* _tmp0_;
	gpointer _tmp1_ = NULL;
	g_return_val_if_fail (self != NULL, 0);
	_tmp0_ = trf_persona_store__prefix_tracker_id;
	_tmp1_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp0_, TRF_ONTOLOGY_DEFS_NCO_MALE);
	result = GPOINTER_TO_INT (_tmp1_);
	return result;
}


gint trf_persona_store_get_gender_female_id (TrfPersonaStore* self) {
	gint result = 0;
	GeeTreeMap* _tmp0_;
	gpointer _tmp1_ = NULL;
	g_return_val_if_fail (self != NULL, 0);
	_tmp0_ = trf_persona_store__prefix_tracker_id;
	_tmp1_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp0_, TRF_ONTOLOGY_DEFS_NCO_FEMALE);
	result = GPOINTER_TO_INT (_tmp1_);
	return result;
}


static void _trf_persona_store_build_predicates_table_data_free (gpointer _data) {
	TrfPersonaStoreBuildPredicatesTableData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->self);
	g_slice_free (TrfPersonaStoreBuildPredicatesTableData, _data_);
}


static void _trf_persona_store_build_predicates_table (TrfPersonaStore* self, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	TrfPersonaStoreBuildPredicatesTableData* _data_;
	TrfPersonaStore* _tmp0_;
	_data_ = g_slice_new0 (TrfPersonaStoreBuildPredicatesTableData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, _trf_persona_store_build_predicates_table);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, _trf_persona_store_build_predicates_table_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_trf_persona_store_build_predicates_table_co (_data_);
}


static void _trf_persona_store_build_predicates_table_finish (TrfPersonaStore* self, GAsyncResult* _res_) {
	TrfPersonaStoreBuildPredicatesTableData* _data_;
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
}


static void _trf_persona_store_build_predicates_table_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	TrfPersonaStoreBuildPredicatesTableData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	_trf_persona_store_build_predicates_table_co (_data_);
}


static gboolean _trf_persona_store_build_predicates_table_co (TrfPersonaStoreBuildPredicatesTableData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		case 2:
		goto _state_2;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = trf_persona_store__prefix_tracker_id;
	if (_data_->_tmp0_ != NULL) {
		if (_data_->_state_ == 0) {
			g_simple_async_result_complete_in_idle (_data_->_async_result);
		} else {
			g_simple_async_result_complete (_data_->_async_result);
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_state_ = 1;
	_trf_persona_store_build_urn_prefix_table (_data_->self, _trf_persona_store_build_predicates_table_ready, _data_);
	return FALSE;
	_state_1:
	_trf_persona_store_build_urn_prefix_table_finish (_data_->self, _data_->_res_);
	_data_->_tmp1_ = gee_tree_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, G_TYPE_INT, NULL, NULL, NULL, NULL);
	_g_object_unref0 (trf_persona_store__prefix_tracker_id);
	trf_persona_store__prefix_tracker_id = _data_->_tmp1_;
	_data_->_tmp2_ = g_strdup ("SELECT  ");
	_data_->query = _data_->_tmp2_;
	{
		_data_->_tmp3_ = trf_persona_store__urn_prefix;
		_data_->_tmp4_ = gee_map_get_keys ((GeeMap*) _data_->_tmp3_);
		_data_->_tmp5_ = _data_->_tmp4_;
		_data_->_tmp6_ = _data_->_tmp5_;
		_data_->_tmp7_ = NULL;
		_data_->_tmp7_ = gee_iterable_iterator ((GeeIterable*) _data_->_tmp6_);
		_data_->_tmp8_ = _data_->_tmp7_;
		_g_object_unref0 (_data_->_tmp6_);
		_data_->_urn_t_it = _data_->_tmp8_;
		while (TRUE) {
			_data_->_tmp9_ = _data_->_urn_t_it;
			_data_->_tmp10_ = FALSE;
			_data_->_tmp10_ = gee_iterator_next (_data_->_tmp9_);
			if (!_data_->_tmp10_) {
				break;
			}
			_data_->_tmp11_ = _data_->_urn_t_it;
			_data_->_tmp12_ = NULL;
			_data_->_tmp12_ = gee_iterator_get (_data_->_tmp11_);
			_data_->urn_t = (gchar*) _data_->_tmp12_;
			_data_->_tmp13_ = _data_->query;
			_data_->_tmp14_ = _data_->urn_t;
			_data_->_tmp15_ = g_strconcat (" tracker:id(", _data_->_tmp14_, NULL);
			_data_->_tmp16_ = _data_->_tmp15_;
			_data_->_tmp17_ = g_strconcat (_data_->_tmp16_, ")", NULL);
			_data_->_tmp18_ = _data_->_tmp17_;
			_data_->_tmp19_ = g_strconcat (_data_->_tmp13_, _data_->_tmp18_, NULL);
			_g_free0 (_data_->query);
			_data_->query = _data_->_tmp19_;
			_g_free0 (_data_->_tmp18_);
			_g_free0 (_data_->_tmp16_);
			_g_free0 (_data_->urn_t);
		}
		_g_object_unref0 (_data_->_urn_t_it);
	}
	_data_->_tmp20_ = _data_->query;
	_data_->_tmp21_ = g_strconcat (_data_->_tmp20_, " WHERE {} ", NULL);
	_g_free0 (_data_->query);
	_data_->query = _data_->_tmp21_;
	{
		_data_->_tmp22_ = _data_->self->priv->_connection;
		_data_->_tmp23_ = _data_->query;
		_data_->_state_ = 2;
		tracker_sparql_connection_query_async (_data_->_tmp22_, _data_->_tmp23_, NULL, _trf_persona_store_build_predicates_table_ready, _data_);
		return FALSE;
		_state_2:
		_data_->_tmp24_ = NULL;
		_data_->_tmp24_ = tracker_sparql_connection_query_finish (_data_->_tmp22_, _data_->_res_, &_data_->_inner_error_);
		_data_->cursor = _data_->_tmp24_;
		if (_data_->_inner_error_ != NULL) {
			if (_data_->_inner_error_->domain == TRACKER_SPARQL_ERROR) {
				goto __catch4_tracker_sparql_error;
			}
			goto __catch4_g_error;
		}
		while (TRUE) {
			_data_->_tmp25_ = _data_->cursor;
			_data_->_tmp26_ = FALSE;
			_data_->_tmp26_ = tracker_sparql_cursor_next (_data_->_tmp25_, NULL, &_data_->_inner_error_);
			_data_->_tmp27_ = _data_->_tmp26_;
			if (_data_->_inner_error_ != NULL) {
				_g_object_unref0 (_data_->cursor);
				if (_data_->_inner_error_->domain == TRACKER_SPARQL_ERROR) {
					goto __catch4_tracker_sparql_error;
				}
				goto __catch4_g_error;
			}
			if (!_data_->_tmp27_) {
				break;
			}
			_data_->i = 0;
			{
				_data_->_tmp28_ = trf_persona_store__urn_prefix;
				_data_->_tmp29_ = gee_map_get_keys ((GeeMap*) _data_->_tmp28_);
				_data_->_tmp30_ = _data_->_tmp29_;
				_data_->_tmp31_ = _data_->_tmp30_;
				_data_->_tmp32_ = NULL;
				_data_->_tmp32_ = gee_iterable_iterator ((GeeIterable*) _data_->_tmp31_);
				_data_->_tmp33_ = _data_->_tmp32_;
				_g_object_unref0 (_data_->_tmp31_);
				_data_->_urn_it = _data_->_tmp33_;
				while (TRUE) {
					_data_->_tmp34_ = _data_->_urn_it;
					_data_->_tmp35_ = FALSE;
					_data_->_tmp35_ = gee_iterator_next (_data_->_tmp34_);
					if (!_data_->_tmp35_) {
						break;
					}
					_data_->_tmp36_ = _data_->_urn_it;
					_data_->_tmp37_ = NULL;
					_data_->_tmp37_ = gee_iterator_get (_data_->_tmp36_);
					_data_->urn = (gchar*) _data_->_tmp37_;
					_data_->_tmp38_ = _data_->cursor;
					_data_->_tmp39_ = _data_->i;
					_data_->_tmp40_ = 0LL;
					_data_->_tmp40_ = tracker_sparql_cursor_get_integer (_data_->_tmp38_, _data_->_tmp39_);
					_data_->tracker_id = (gint) _data_->_tmp40_;
					_data_->_tmp41_ = trf_persona_store__urn_prefix;
					_data_->_tmp42_ = _data_->urn;
					_data_->_tmp43_ = NULL;
					_data_->_tmp43_ = gee_abstract_map_get ((GeeAbstractMap*) _data_->_tmp41_, _data_->_tmp42_);
					_data_->_tmp44_ = (gchar*) _data_->_tmp43_;
					_data_->_tmp45_ = NULL;
					_data_->_tmp45_ = g_strdup (_data_->_tmp44_);
					_data_->_tmp46_ = _data_->_tmp45_;
					_g_free0 (_data_->_tmp44_);
					_data_->prefix = _data_->_tmp46_;
					_data_->_tmp47_ = trf_persona_store__prefix_tracker_id;
					_data_->_tmp48_ = _data_->prefix;
					_data_->_tmp49_ = _data_->tracker_id;
					gee_abstract_map_set ((GeeAbstractMap*) _data_->_tmp47_, _data_->_tmp48_, GINT_TO_POINTER (_data_->_tmp49_));
					_data_->_tmp50_ = _data_->i;
					_data_->i = _data_->_tmp50_ + 1;
					_g_free0 (_data_->prefix);
					_g_free0 (_data_->urn);
				}
				_g_object_unref0 (_data_->_urn_it);
			}
		}
		_g_object_unref0 (_data_->cursor);
	}
	goto __finally4;
	__catch4_tracker_sparql_error:
	{
		_data_->e1 = _data_->_inner_error_;
		_data_->_inner_error_ = NULL;
		_data_->_tmp51_ = _data_->query;
		_data_->_tmp52_ = _data_->e1;
		_data_->_tmp53_ = _data_->_tmp52_->message;
		g_warning ("trf-persona-store.vala:1172: Couldn't build predicates table: %s %s", _data_->_tmp51_, _data_->_tmp53_);
		_g_error_free0 (_data_->e1);
	}
	goto __finally4;
	__catch4_g_error:
	{
		_data_->e2 = _data_->_inner_error_;
		_data_->_inner_error_ = NULL;
		_data_->_tmp54_ = _data_->query;
		_data_->_tmp55_ = _data_->e2;
		_data_->_tmp56_ = _data_->_tmp55_->message;
		g_warning ("trf-persona-store.vala:1176: Couldn't build predicates table: %s %s", _data_->_tmp54_, _data_->_tmp56_);
		_g_error_free0 (_data_->e2);
	}
	__finally4:
	if (_data_->_inner_error_ != NULL) {
		_g_free0 (_data_->query);
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
		g_clear_error (&_data_->_inner_error_);
		return FALSE;
	}
	_g_free0 (_data_->query);
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


static void _trf_persona_store_build_urn_prefix_table_data_free (gpointer _data) {
	TrfPersonaStoreBuildUrnPrefixTableData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->self);
	g_slice_free (TrfPersonaStoreBuildUrnPrefixTableData, _data_);
}


static void _trf_persona_store_build_urn_prefix_table (TrfPersonaStore* self, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	TrfPersonaStoreBuildUrnPrefixTableData* _data_;
	TrfPersonaStore* _tmp0_;
	_data_ = g_slice_new0 (TrfPersonaStoreBuildUrnPrefixTableData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, _trf_persona_store_build_urn_prefix_table);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, _trf_persona_store_build_urn_prefix_table_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_trf_persona_store_build_urn_prefix_table_co (_data_);
}


static void _trf_persona_store_build_urn_prefix_table_finish (TrfPersonaStore* self, GAsyncResult* _res_) {
	TrfPersonaStoreBuildUrnPrefixTableData* _data_;
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
}


static gboolean _trf_persona_store_build_urn_prefix_table_co (TrfPersonaStoreBuildUrnPrefixTableData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = trf_persona_store__urn_prefix;
	if (_data_->_tmp0_ != NULL) {
		if (_data_->_state_ == 0) {
			g_simple_async_result_complete_in_idle (_data_->_async_result);
		} else {
			g_simple_async_result_complete (_data_->_async_result);
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp1_ = gee_tree_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL, NULL);
	_g_object_unref0 (trf_persona_store__urn_prefix);
	trf_persona_store__urn_prefix = _data_->_tmp1_;
	_data_->_tmp2_ = trf_persona_store__urn_prefix;
	gee_abstract_map_set ((GeeAbstractMap*) _data_->_tmp2_, TRF_ONTOLOGY_DEFS_NCO_URL_PREFIX "nco#fullname>", TRF_ONTOLOGY_DEFS_NCO_FULLNAME);
	_data_->_tmp3_ = trf_persona_store__urn_prefix;
	gee_abstract_map_set ((GeeAbstractMap*) _data_->_tmp3_, TRF_ONTOLOGY_DEFS_NCO_URL_PREFIX "nco#nameFamily>", TRF_ONTOLOGY_DEFS_NCO_FAMILY);
	_data_->_tmp4_ = trf_persona_store__urn_prefix;
	gee_abstract_map_set ((GeeAbstractMap*) _data_->_tmp4_, TRF_ONTOLOGY_DEFS_NCO_URL_PREFIX "nco#nameGiven>", TRF_ONTOLOGY_DEFS_NCO_GIVEN);
	_data_->_tmp5_ = trf_persona_store__urn_prefix;
	gee_abstract_map_set ((GeeAbstractMap*) _data_->_tmp5_, TRF_ONTOLOGY_DEFS_NCO_URL_PREFIX "nco#nameAdditional>", TRF_ONTOLOGY_DEFS_NCO_ADDITIONAL);
	_data_->_tmp6_ = trf_persona_store__urn_prefix;
	gee_abstract_map_set ((GeeAbstractMap*) _data_->_tmp6_, TRF_ONTOLOGY_DEFS_NCO_URL_PREFIX "nco#nameHonorificSuffix>", TRF_ONTOLOGY_DEFS_NCO_SUFFIX);
	_data_->_tmp7_ = trf_persona_store__urn_prefix;
	gee_abstract_map_set ((GeeAbstractMap*) _data_->_tmp7_, TRF_ONTOLOGY_DEFS_NCO_URL_PREFIX "nco#nameHonorificPrefix>", TRF_ONTOLOGY_DEFS_NCO_PREFIX);
	_data_->_tmp8_ = trf_persona_store__urn_prefix;
	gee_abstract_map_set ((GeeAbstractMap*) _data_->_tmp8_, TRF_ONTOLOGY_DEFS_NCO_URL_PREFIX "nco#nickname>", TRF_ONTOLOGY_DEFS_NCO_NICKNAME);
	_data_->_tmp9_ = trf_persona_store__urn_prefix;
	gee_abstract_map_set ((GeeAbstractMap*) _data_->_tmp9_, TRF_ONTOLOGY_DEFS_RDF_URL_PREFIX "22-rdf-syntax-ns#type>", TRF_ONTOLOGY_DEFS_RDF_TYPE);
	_data_->_tmp10_ = trf_persona_store__urn_prefix;
	gee_abstract_map_set ((GeeAbstractMap*) _data_->_tmp10_, TRF_ONTOLOGY_DEFS_NCO_URL_PREFIX "nco#PersonContact>", TRF_ONTOLOGY_DEFS_NCO_PERSON);
	_data_->_tmp11_ = trf_persona_store__urn_prefix;
	gee_abstract_map_set ((GeeAbstractMap*) _data_->_tmp11_, TRF_ONTOLOGY_DEFS_NCO_URL_PREFIX "nco#websiteUrl>", TRF_ONTOLOGY_DEFS_NCO_WEBSITE);
	_data_->_tmp12_ = trf_persona_store__urn_prefix;
	gee_abstract_map_set ((GeeAbstractMap*) _data_->_tmp12_, TRF_ONTOLOGY_DEFS_NCO_URL_PREFIX "nco#blogUrl>", TRF_ONTOLOGY_DEFS_NCO_BLOG);
	_data_->_tmp13_ = trf_persona_store__urn_prefix;
	gee_abstract_map_set ((GeeAbstractMap*) _data_->_tmp13_, TRF_ONTOLOGY_DEFS_NCO_URL_PREFIX "nco#url>", TRF_ONTOLOGY_DEFS_NCO_URL);
	_data_->_tmp14_ = trf_persona_store__urn_prefix;
	gee_abstract_map_set ((GeeAbstractMap*) _data_->_tmp14_, TRF_ONTOLOGY_DEFS_NAO_URL_PREFIX "nao#predefined-tag-favorite>", TRF_ONTOLOGY_DEFS_NAO_FAVORITE);
	_data_->_tmp15_ = trf_persona_store__urn_prefix;
	gee_abstract_map_set ((GeeAbstractMap*) _data_->_tmp15_, TRF_ONTOLOGY_DEFS_NAO_URL_PREFIX "nao#hasTag>", TRF_ONTOLOGY_DEFS_NAO_TAG);
	_data_->_tmp16_ = trf_persona_store__urn_prefix;
	gee_abstract_map_set ((GeeAbstractMap*) _data_->_tmp16_, TRF_ONTOLOGY_DEFS_NCO_URL_PREFIX "nco#hasEmailAddress>", TRF_ONTOLOGY_DEFS_NCO_HAS_EMAIL);
	_data_->_tmp17_ = trf_persona_store__urn_prefix;
	gee_abstract_map_set ((GeeAbstractMap*) _data_->_tmp17_, TRF_ONTOLOGY_DEFS_NCO_URL_PREFIX "nco#hasPhoneNumber>", TRF_ONTOLOGY_DEFS_NCO_HAS_PHONE);
	_data_->_tmp18_ = trf_persona_store__urn_prefix;
	gee_abstract_map_set ((GeeAbstractMap*) _data_->_tmp18_, TRF_ONTOLOGY_DEFS_NCO_URL_PREFIX "nco#hasAffiliation>", TRF_ONTOLOGY_DEFS_NCO_HAS_AFFILIATION);
	_data_->_tmp19_ = trf_persona_store__urn_prefix;
	gee_abstract_map_set ((GeeAbstractMap*) _data_->_tmp19_, TRF_ONTOLOGY_DEFS_NCO_URL_PREFIX "nco#birthDate>", TRF_ONTOLOGY_DEFS_NCO_BIRTHDAY);
	_data_->_tmp20_ = trf_persona_store__urn_prefix;
	gee_abstract_map_set ((GeeAbstractMap*) _data_->_tmp20_, TRF_ONTOLOGY_DEFS_NCO_URL_PREFIX "nco#note>", TRF_ONTOLOGY_DEFS_NCO_NOTE);
	_data_->_tmp21_ = trf_persona_store__urn_prefix;
	gee_abstract_map_set ((GeeAbstractMap*) _data_->_tmp21_, TRF_ONTOLOGY_DEFS_NCO_URL_PREFIX "nco#gender>", TRF_ONTOLOGY_DEFS_NCO_GENDER);
	_data_->_tmp22_ = trf_persona_store__urn_prefix;
	gee_abstract_map_set ((GeeAbstractMap*) _data_->_tmp22_, TRF_ONTOLOGY_DEFS_NCO_URL_PREFIX "nco#gender-male>", TRF_ONTOLOGY_DEFS_NCO_MALE);
	_data_->_tmp23_ = trf_persona_store__urn_prefix;
	gee_abstract_map_set ((GeeAbstractMap*) _data_->_tmp23_, TRF_ONTOLOGY_DEFS_NCO_URL_PREFIX "nco#gender-female>", TRF_ONTOLOGY_DEFS_NCO_FEMALE);
	_data_->_tmp24_ = trf_persona_store__urn_prefix;
	gee_abstract_map_set ((GeeAbstractMap*) _data_->_tmp24_, TRF_ONTOLOGY_DEFS_NCO_URL_PREFIX "nco#photo>", TRF_ONTOLOGY_DEFS_NCO_PHOTO);
	_data_->_tmp25_ = trf_persona_store__urn_prefix;
	gee_abstract_map_set ((GeeAbstractMap*) _data_->_tmp25_, TRF_ONTOLOGY_DEFS_NAO_URL_PREFIX "nao#hasProperty>", TRF_ONTOLOGY_DEFS_NAO_PROPERTY);
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


static void _trf_persona_store_graph_updated_cb (TrfPersonaStore* self, GDBusConnection* connection, const gchar* sender_name, const gchar* object_path, const gchar* interface_name, const gchar* signal_name, GVariant* parameters) {
	gchar* _tmp0_;
	gchar* class_name;
	GVariantIter* iter_del;
	GVariantIter* iter_ins;
	GVariant* _tmp1_;
	const gchar* _tmp2_;
	GVariantIter* _tmp3_;
	GVariantIter* _tmp4_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (connection != NULL);
	g_return_if_fail (sender_name != NULL);
	g_return_if_fail (object_path != NULL);
	g_return_if_fail (interface_name != NULL);
	g_return_if_fail (signal_name != NULL);
	g_return_if_fail (parameters != NULL);
	_tmp0_ = g_strdup ("");
	class_name = _tmp0_;
	iter_del = NULL;
	iter_ins = NULL;
	_tmp1_ = parameters;
	g_variant_get (_tmp1_, "(sa(iiii)a(iiii))", &class_name, &iter_del, &iter_ins, NULL);
	_tmp2_ = class_name;
	if (g_strcmp0 (_tmp2_, TRF_ONTOLOGY_DEFS_PERSON_CLASS) != 0) {
		_g_variant_iter_free0 (iter_ins);
		_g_variant_iter_free0 (iter_del);
		_g_free0 (class_name);
		return;
	}
	_tmp3_ = iter_del;
	iter_del = NULL;
	_tmp4_ = iter_ins;
	iter_ins = NULL;
	_trf_persona_store_handle_events (self, _tmp3_, _tmp4_, NULL, NULL);
	_g_variant_iter_free0 (iter_ins);
	_g_variant_iter_free0 (iter_del);
	_g_free0 (class_name);
}


static void _trf_persona_store_handle_events_data_free (gpointer _data) {
	TrfPersonaStoreHandleEventsData* _data_;
	_data_ = _data;
	_g_variant_iter_free0 (_data_->iter_del);
	_g_variant_iter_free0 (_data_->iter_ins);
	_g_object_unref0 (_data_->self);
	g_slice_free (TrfPersonaStoreHandleEventsData, _data_);
}


static void _trf_persona_store_handle_events (TrfPersonaStore* self, GVariantIter* iter_del, GVariantIter* iter_ins, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	TrfPersonaStoreHandleEventsData* _data_;
	TrfPersonaStore* _tmp0_;
	GVariantIter* _tmp1_;
	GVariantIter* _tmp2_;
	_data_ = g_slice_new0 (TrfPersonaStoreHandleEventsData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, _trf_persona_store_handle_events);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, _trf_persona_store_handle_events_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = iter_del;
	_g_variant_iter_free0 (_data_->iter_del);
	_data_->iter_del = _tmp1_;
	_tmp2_ = iter_ins;
	_g_variant_iter_free0 (_data_->iter_ins);
	_data_->iter_ins = _tmp2_;
	_trf_persona_store_handle_events_co (_data_);
}


static void _trf_persona_store_handle_events_finish (TrfPersonaStore* self, GAsyncResult* _res_) {
	TrfPersonaStoreHandleEventsData* _data_;
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
}


static void _trf_persona_store_handle_events_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	TrfPersonaStoreHandleEventsData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	_trf_persona_store_handle_events_co (_data_);
}


static gboolean _trf_persona_store_handle_events_co (TrfPersonaStoreHandleEventsData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		case 2:
		goto _state_2;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->iter_del;
	_data_->iter_del = NULL;
	_data_->_state_ = 1;
	_trf_persona_store_handle_delete_events (_data_->self, _data_->_tmp0_, _trf_persona_store_handle_events_ready, _data_);
	return FALSE;
	_state_1:
	_trf_persona_store_handle_delete_events_finish (_data_->self, _data_->_res_);
	_data_->_tmp1_ = _data_->iter_ins;
	_data_->iter_ins = NULL;
	_data_->_state_ = 2;
	_trf_persona_store_handle_insert_events (_data_->self, _data_->_tmp1_, _trf_persona_store_handle_events_ready, _data_);
	return FALSE;
	_state_2:
	_trf_persona_store_handle_insert_events_finish (_data_->self, _data_->_res_);
	_g_variant_iter_free0 (_data_->iter_del);
	_g_variant_iter_free0 (_data_->iter_ins);
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


static void _trf_persona_store_handle_delete_events_data_free (gpointer _data) {
	TrfPersonaStoreHandleDeleteEventsData* _data_;
	_data_ = _data;
	_g_variant_iter_free0 (_data_->iter_del);
	_g_object_unref0 (_data_->self);
	g_slice_free (TrfPersonaStoreHandleDeleteEventsData, _data_);
}


static void _trf_persona_store_handle_delete_events (TrfPersonaStore* self, GVariantIter* iter_del, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	TrfPersonaStoreHandleDeleteEventsData* _data_;
	TrfPersonaStore* _tmp0_;
	GVariantIter* _tmp1_;
	_data_ = g_slice_new0 (TrfPersonaStoreHandleDeleteEventsData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, _trf_persona_store_handle_delete_events);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, _trf_persona_store_handle_delete_events_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = iter_del;
	_g_variant_iter_free0 (_data_->iter_del);
	_data_->iter_del = _tmp1_;
	_trf_persona_store_handle_delete_events_co (_data_);
}


static void _trf_persona_store_handle_delete_events_finish (TrfPersonaStore* self, GAsyncResult* _res_) {
	TrfPersonaStoreHandleDeleteEventsData* _data_;
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
}


static void _trf_persona_store_handle_delete_events_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	TrfPersonaStoreHandleDeleteEventsData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	_trf_persona_store_handle_delete_events_co (_data_);
}


static gboolean _trf_persona_store_handle_delete_events_co (TrfPersonaStoreHandleDeleteEventsData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = gee_hash_set_new (TRF_TYPE_PERSONA, (GBoxedCopyFunc) g_object_ref, g_object_unref, NULL, NULL);
	_data_->removed_personas = _data_->_tmp0_;
	_data_->_tmp1_ = trf_persona_store__prefix_tracker_id;
	_data_->_tmp2_ = NULL;
	_data_->_tmp2_ = gee_abstract_map_get ((GeeAbstractMap*) _data_->_tmp1_, TRF_ONTOLOGY_DEFS_NCO_PERSON);
	_data_->nco_person_id = GPOINTER_TO_INT (_data_->_tmp2_);
	_data_->_tmp3_ = trf_persona_store__prefix_tracker_id;
	_data_->_tmp4_ = NULL;
	_data_->_tmp4_ = gee_abstract_map_get ((GeeAbstractMap*) _data_->_tmp3_, TRF_ONTOLOGY_DEFS_RDF_TYPE);
	_data_->rdf_type_id = GPOINTER_TO_INT (_data_->_tmp4_);
	memset (&_data_->e, 0, sizeof (Event));
	while (TRUE) {
		_data_->_tmp5_ = _data_->iter_del;
		_data_->_tmp6_ = FALSE;
		_data_->_tmp6_ = g_variant_iter_next (_data_->_tmp5_, "(iiii)", &_data_->e.graph_id, &_data_->e.subject_id, &_data_->e.pred_id, &_data_->e.object_id, NULL);
		if (!_data_->_tmp6_) {
			break;
		}
		_data_->_tmp7_ = folks_persona_store_get_id ((FolksPersonaStore*) _data_->self);
		_data_->_tmp8_ = _data_->_tmp7_;
		_data_->_tmp9_ = _data_->e;
		_data_->_tmp10_ = _data_->_tmp9_.subject_id;
		_data_->_tmp11_ = NULL;
		_data_->_tmp11_ = g_strdup_printf ("%i", _data_->_tmp10_);
		_data_->_tmp12_ = _data_->_tmp11_;
		_data_->_tmp13_ = NULL;
		_data_->_tmp13_ = trf_persona_build_iid (_data_->_tmp8_, _data_->_tmp12_);
		_data_->_tmp14_ = _data_->_tmp13_;
		_g_free0 (_data_->_tmp12_);
		_data_->p_id = _data_->_tmp14_;
		_data_->_tmp16_ = _data_->e;
		_data_->_tmp17_ = _data_->_tmp16_.pred_id;
		_data_->_tmp18_ = _data_->rdf_type_id;
		if (_data_->_tmp17_ == _data_->_tmp18_) {
			_data_->_tmp19_ = _data_->e;
			_data_->_tmp20_ = _data_->_tmp19_.object_id;
			_data_->_tmp21_ = _data_->nco_person_id;
			_data_->_tmp15_ = _data_->_tmp20_ == _data_->_tmp21_;
		} else {
			_data_->_tmp15_ = FALSE;
		}
		_data_->_tmp22_ = _data_->_tmp15_;
		if (_data_->_tmp22_) {
			{
				_data_->_tmp23_ = _data_->self->priv->_personas;
				g_static_rec_mutex_lock (&_data_->self->priv->__lock__personas);
				{
					_data_->_tmp24_ = _data_->self->priv->_personas;
					_data_->_tmp25_ = _data_->p_id;
					_data_->_tmp26_ = NULL;
					_data_->_tmp26_ = gee_abstract_map_get ((GeeAbstractMap*) _data_->_tmp24_, _data_->_tmp25_);
					_data_->removed_p = (TrfPersona*) _data_->_tmp26_;
					_data_->_tmp27_ = _data_->removed_p;
					if (_data_->_tmp27_ != NULL) {
						_data_->_tmp28_ = _data_->removed_personas;
						_data_->_tmp29_ = _data_->removed_p;
						gee_abstract_collection_add ((GeeAbstractCollection*) _data_->_tmp28_, _data_->_tmp29_);
						_data_->_tmp30_ = _data_->self->priv->_personas;
						_data_->_tmp31_ = _data_->removed_p;
						_data_->_tmp32_ = folks_persona_get_iid ((FolksPersona*) _data_->_tmp31_);
						_data_->_tmp33_ = _data_->_tmp32_;
						gee_abstract_map_unset ((GeeAbstractMap*) _data_->_tmp30_, _data_->_tmp33_, NULL);
					}
					_g_object_unref0 (_data_->removed_p);
				}
				__finally5:
				{
					_data_->_tmp34_ = _data_->self->priv->_personas;
					g_static_rec_mutex_unlock (&_data_->self->priv->__lock__personas);
				}
				if (_data_->_inner_error_ != NULL) {
					_g_free0 (_data_->p_id);
					_g_object_unref0 (_data_->removed_personas);
					_g_variant_iter_free0 (_data_->iter_del);
					g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
					g_clear_error (&_data_->_inner_error_);
					return FALSE;
				}
			}
		} else {
			_data_->_tmp35_ = _data_->self->priv->_personas;
			_data_->_tmp36_ = _data_->p_id;
			_data_->_tmp37_ = NULL;
			_data_->_tmp37_ = gee_abstract_map_get ((GeeAbstractMap*) _data_->_tmp35_, _data_->_tmp36_);
			_data_->persona = (TrfPersona*) _data_->_tmp37_;
			_data_->_tmp38_ = _data_->persona;
			if (_data_->_tmp38_ != NULL) {
				_data_->_tmp39_ = _data_->persona;
				_data_->_tmp40_ = _data_->e;
				_data_->_state_ = 1;
				_trf_persona_store_do_update (_data_->self, _data_->_tmp39_, &_data_->_tmp40_, FALSE, _trf_persona_store_handle_delete_events_ready, _data_);
				return FALSE;
				_state_1:
				_trf_persona_store_do_update_finish (_data_->self, _data_->_res_);
			}
			_g_object_unref0 (_data_->persona);
		}
		_g_free0 (_data_->p_id);
	}
	_data_->_tmp41_ = _data_->removed_personas;
	_data_->_tmp42_ = gee_collection_get_size ((GeeCollection*) _data_->_tmp41_);
	_data_->_tmp43_ = _data_->_tmp42_;
	if (_data_->_tmp43_ > 0) {
		_data_->_tmp44_ = _data_->removed_personas;
		_folks_persona_store_emit_personas_changed ((FolksPersonaStore*) _data_->self, NULL, (GeeSet*) _data_->_tmp44_, NULL, NULL, FOLKS_GROUP_DETAILS_CHANGE_REASON_NONE);
	}
	_g_object_unref0 (_data_->removed_personas);
	_g_variant_iter_free0 (_data_->iter_del);
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


static void _trf_persona_store_handle_insert_events_data_free (gpointer _data) {
	TrfPersonaStoreHandleInsertEventsData* _data_;
	_data_ = _data;
	_g_variant_iter_free0 (_data_->iter_ins);
	_g_object_unref0 (_data_->self);
	g_slice_free (TrfPersonaStoreHandleInsertEventsData, _data_);
}


static void _trf_persona_store_handle_insert_events (TrfPersonaStore* self, GVariantIter* iter_ins, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	TrfPersonaStoreHandleInsertEventsData* _data_;
	TrfPersonaStore* _tmp0_;
	GVariantIter* _tmp1_;
	_data_ = g_slice_new0 (TrfPersonaStoreHandleInsertEventsData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, _trf_persona_store_handle_insert_events);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, _trf_persona_store_handle_insert_events_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = iter_ins;
	_g_variant_iter_free0 (_data_->iter_ins);
	_data_->iter_ins = _tmp1_;
	_trf_persona_store_handle_insert_events_co (_data_);
}


static void _trf_persona_store_handle_insert_events_finish (TrfPersonaStore* self, GAsyncResult* _res_) {
	TrfPersonaStoreHandleInsertEventsData* _data_;
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
}


static void _trf_persona_store_handle_insert_events_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	TrfPersonaStoreHandleInsertEventsData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	_trf_persona_store_handle_insert_events_co (_data_);
}


static gboolean _trf_persona_store_handle_insert_events_co (TrfPersonaStoreHandleInsertEventsData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = gee_hash_set_new (TRF_TYPE_PERSONA, (GBoxedCopyFunc) g_object_ref, g_object_unref, NULL, NULL);
	_data_->added_personas = _data_->_tmp0_;
	memset (&_data_->e, 0, sizeof (Event));
	while (TRUE) {
		_data_->_tmp1_ = _data_->iter_ins;
		_data_->_tmp2_ = FALSE;
		_data_->_tmp2_ = g_variant_iter_next (_data_->_tmp1_, "(iiii)", &_data_->e.graph_id, &_data_->e.subject_id, &_data_->e.pred_id, &_data_->e.object_id, NULL);
		if (!_data_->_tmp2_) {
			break;
		}
		_data_->_tmp3_ = _data_->e;
		_data_->_tmp4_ = _data_->_tmp3_.subject_id;
		_data_->_tmp5_ = NULL;
		_data_->_tmp5_ = g_strdup_printf ("%i", _data_->_tmp4_);
		_data_->subject_tracker_id = _data_->_tmp5_;
		_data_->_tmp6_ = folks_persona_store_get_id ((FolksPersonaStore*) _data_->self);
		_data_->_tmp7_ = _data_->_tmp6_;
		_data_->_tmp8_ = _data_->subject_tracker_id;
		_data_->_tmp9_ = NULL;
		_data_->_tmp9_ = trf_persona_build_iid (_data_->_tmp7_, _data_->_tmp8_);
		_data_->p_id = _data_->_tmp9_;
		{
			_data_->_tmp10_ = _data_->self->priv->_personas;
			g_static_rec_mutex_lock (&_data_->self->priv->__lock__personas);
			{
				_data_->_tmp11_ = _data_->self->priv->_personas;
				_data_->_tmp12_ = _data_->p_id;
				_data_->_tmp13_ = NULL;
				_data_->_tmp13_ = gee_abstract_map_get ((GeeAbstractMap*) _data_->_tmp11_, _data_->_tmp12_);
				_g_object_unref0 (_data_->persona);
				_data_->persona = (TrfPersona*) _data_->_tmp13_;
				_data_->_tmp14_ = _data_->persona;
				if (_data_->_tmp14_ == NULL) {
					_data_->_tmp15_ = _data_->subject_tracker_id;
					_data_->_tmp16_ = trf_persona_new (_data_->self, _data_->_tmp15_, NULL);
					_g_object_unref0 (_data_->persona);
					_data_->persona = _data_->_tmp16_;
					_data_->_tmp17_ = _data_->self->priv->_personas;
					_data_->_tmp18_ = _data_->persona;
					_data_->_tmp19_ = folks_persona_get_iid ((FolksPersona*) _data_->_tmp18_);
					_data_->_tmp20_ = _data_->_tmp19_;
					_data_->_tmp21_ = _data_->persona;
					gee_abstract_map_set ((GeeAbstractMap*) _data_->_tmp17_, _data_->_tmp20_, _data_->_tmp21_);
					_data_->_tmp22_ = _data_->added_personas;
					_data_->_tmp23_ = _data_->persona;
					gee_abstract_collection_add ((GeeAbstractCollection*) _data_->_tmp22_, _data_->_tmp23_);
				}
			}
			__finally6:
			{
				_data_->_tmp24_ = _data_->self->priv->_personas;
				g_static_rec_mutex_unlock (&_data_->self->priv->__lock__personas);
			}
			if (_data_->_inner_error_ != NULL) {
				_g_object_unref0 (_data_->persona);
				_g_free0 (_data_->p_id);
				_g_free0 (_data_->subject_tracker_id);
				_g_object_unref0 (_data_->added_personas);
				_g_variant_iter_free0 (_data_->iter_ins);
				g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
				g_clear_error (&_data_->_inner_error_);
				return FALSE;
			}
		}
		_data_->_tmp25_ = _data_->persona;
		_data_->_tmp26_ = _data_->e;
		_data_->_state_ = 1;
		_trf_persona_store_do_update (_data_->self, _data_->_tmp25_, &_data_->_tmp26_, TRUE, _trf_persona_store_handle_insert_events_ready, _data_);
		return FALSE;
		_state_1:
		_trf_persona_store_do_update_finish (_data_->self, _data_->_res_);
		_g_object_unref0 (_data_->persona);
		_g_free0 (_data_->p_id);
		_g_free0 (_data_->subject_tracker_id);
	}
	_data_->_tmp27_ = _data_->added_personas;
	_data_->_tmp28_ = gee_collection_get_size ((GeeCollection*) _data_->_tmp27_);
	_data_->_tmp29_ = _data_->_tmp28_;
	if (_data_->_tmp29_ > 0) {
		_data_->_tmp30_ = _data_->added_personas;
		_folks_persona_store_emit_personas_changed ((FolksPersonaStore*) _data_->self, (GeeSet*) _data_->_tmp30_, NULL, NULL, NULL, FOLKS_GROUP_DETAILS_CHANGE_REASON_NONE);
	}
	_g_object_unref0 (_data_->added_personas);
	_g_variant_iter_free0 (_data_->iter_ins);
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


static void _trf_persona_store_do_add_contacts_data_free (gpointer _data) {
	TrfPersonaStoreDoAddContactsData* _data_;
	_data_ = _data;
	_g_free0 (_data_->query);
	_g_object_unref0 (_data_->result);
	_g_object_unref0 (_data_->self);
	g_slice_free (TrfPersonaStoreDoAddContactsData, _data_);
}


static void _trf_persona_store_do_add_contacts (TrfPersonaStore* self, const gchar* query, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	TrfPersonaStoreDoAddContactsData* _data_;
	TrfPersonaStore* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	_data_ = g_slice_new0 (TrfPersonaStoreDoAddContactsData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, _trf_persona_store_do_add_contacts);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, _trf_persona_store_do_add_contacts_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = query;
	_tmp2_ = g_strdup (_tmp1_);
	_data_->query = _tmp2_;
	_trf_persona_store_do_add_contacts_co (_data_);
}


static GeeHashSet* _trf_persona_store_do_add_contacts_finish (TrfPersonaStore* self, GAsyncResult* _res_) {
	GeeHashSet* result;
	TrfPersonaStoreDoAddContactsData* _data_;
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
	result = _data_->result;
	_data_->result = NULL;
	return result;
}


static void _trf_persona_store_do_add_contacts_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	TrfPersonaStoreDoAddContactsData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	_trf_persona_store_do_add_contacts_co (_data_);
}


static gboolean _trf_persona_store_do_add_contacts_co (TrfPersonaStoreDoAddContactsData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = gee_hash_set_new (TRF_TYPE_PERSONA, (GBoxedCopyFunc) g_object_ref, g_object_unref, NULL, NULL);
	_data_->added_personas = _data_->_tmp0_;
	{
		_data_->_tmp1_ = _data_->self->priv->_connection;
		_data_->_tmp2_ = _data_->query;
		_data_->_state_ = 1;
		tracker_sparql_connection_query_async (_data_->_tmp1_, _data_->_tmp2_, NULL, _trf_persona_store_do_add_contacts_ready, _data_);
		return FALSE;
		_state_1:
		_data_->_tmp3_ = NULL;
		_data_->_tmp3_ = tracker_sparql_connection_query_finish (_data_->_tmp1_, _data_->_res_, &_data_->_inner_error_);
		_data_->cursor = _data_->_tmp3_;
		if (_data_->_inner_error_ != NULL) {
			goto __catch7_g_error;
		}
		while (TRUE) {
			_data_->_tmp4_ = _data_->cursor;
			_data_->_tmp5_ = FALSE;
			_data_->_tmp5_ = tracker_sparql_cursor_next (_data_->_tmp4_, NULL, &_data_->_inner_error_);
			_data_->_tmp6_ = _data_->_tmp5_;
			if (_data_->_inner_error_ != NULL) {
				_g_object_unref0 (_data_->cursor);
				goto __catch7_g_error;
			}
			if (!_data_->_tmp6_) {
				break;
			}
			_data_->_tmp7_ = _data_->cursor;
			_data_->_tmp8_ = 0LL;
			_data_->_tmp8_ = tracker_sparql_cursor_get_integer (_data_->_tmp7_, (gint) TRF_FIELDS_TRACKER_ID);
			_data_->tracker_id = (gint) _data_->_tmp8_;
			_data_->_tmp9_ = folks_persona_store_get_id ((FolksPersonaStore*) _data_->self);
			_data_->_tmp10_ = _data_->_tmp9_;
			_data_->_tmp11_ = _data_->tracker_id;
			_data_->_tmp12_ = NULL;
			_data_->_tmp12_ = g_strdup_printf ("%i", _data_->_tmp11_);
			_data_->_tmp13_ = _data_->_tmp12_;
			_data_->_tmp14_ = NULL;
			_data_->_tmp14_ = trf_persona_build_iid (_data_->_tmp10_, _data_->_tmp13_);
			_data_->_tmp15_ = _data_->_tmp14_;
			_g_free0 (_data_->_tmp13_);
			_data_->p_id = _data_->_tmp15_;
			_data_->_tmp16_ = _data_->self->priv->_personas;
			_data_->_tmp17_ = _data_->p_id;
			_data_->_tmp18_ = NULL;
			_data_->_tmp18_ = gee_abstract_map_get ((GeeAbstractMap*) _data_->_tmp16_, _data_->_tmp17_);
			_data_->_tmp19_ = (TrfPersona*) _data_->_tmp18_;
			_data_->_tmp20_ = _data_->_tmp19_ == NULL;
			_g_object_unref0 (_data_->_tmp19_);
			if (_data_->_tmp20_) {
				_data_->_tmp21_ = _data_->tracker_id;
				_data_->_tmp22_ = NULL;
				_data_->_tmp22_ = g_strdup_printf ("%i", _data_->_tmp21_);
				_data_->_tmp23_ = _data_->_tmp22_;
				_data_->_tmp24_ = _data_->cursor;
				_data_->_tmp25_ = trf_persona_new (_data_->self, _data_->_tmp23_, _data_->_tmp24_);
				_data_->_tmp26_ = _data_->_tmp25_;
				_g_free0 (_data_->_tmp23_);
				_data_->persona = _data_->_tmp26_;
				_data_->_tmp27_ = _data_->self->priv->_personas;
				_data_->_tmp28_ = _data_->persona;
				_data_->_tmp29_ = folks_persona_get_iid ((FolksPersona*) _data_->_tmp28_);
				_data_->_tmp30_ = _data_->_tmp29_;
				_data_->_tmp31_ = _data_->persona;
				gee_abstract_map_set ((GeeAbstractMap*) _data_->_tmp27_, _data_->_tmp30_, _data_->_tmp31_);
				_data_->_tmp32_ = _data_->added_personas;
				_data_->_tmp33_ = _data_->persona;
				gee_abstract_collection_add ((GeeAbstractCollection*) _data_->_tmp32_, _data_->_tmp33_);
				_g_object_unref0 (_data_->persona);
			}
			_g_free0 (_data_->p_id);
		}
		_data_->_tmp34_ = _data_->added_personas;
		_data_->_tmp35_ = gee_collection_get_size ((GeeCollection*) _data_->_tmp34_);
		_data_->_tmp36_ = _data_->_tmp35_;
		if (_data_->_tmp36_ > 0) {
			_data_->_tmp37_ = _data_->added_personas;
			_folks_persona_store_emit_personas_changed ((FolksPersonaStore*) _data_->self, (GeeSet*) _data_->_tmp37_, NULL, NULL, NULL, FOLKS_GROUP_DETAILS_CHANGE_REASON_NONE);
		}
		_g_object_unref0 (_data_->cursor);
	}
	goto __finally7;
	__catch7_g_error:
	{
		_data_->e = _data_->_inner_error_;
		_data_->_inner_error_ = NULL;
		_data_->_tmp38_ = _data_->query;
		_data_->_tmp39_ = _data_->e;
		_data_->_tmp40_ = _data_->_tmp39_->message;
		g_warning ("trf-persona-store.vala:1370: Couldn't perform queries: %s %s", _data_->_tmp38_, _data_->_tmp40_);
		_g_error_free0 (_data_->e);
	}
	__finally7:
	if (_data_->_inner_error_ != NULL) {
		_g_object_unref0 (_data_->added_personas);
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
		g_clear_error (&_data_->_inner_error_);
		return FALSE;
	}
	_data_->result = _data_->added_personas;
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
	_g_object_unref0 (_data_->added_personas);
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


static void _trf_persona_store_do_update_data_free (gpointer _data) {
	TrfPersonaStoreDoUpdateData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->p);
	_g_object_unref0 (_data_->self);
	g_slice_free (TrfPersonaStoreDoUpdateData, _data_);
}


static void _trf_persona_store_do_update (TrfPersonaStore* self, TrfPersona* p, Event* e, gboolean adding, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	TrfPersonaStoreDoUpdateData* _data_;
	TrfPersonaStore* _tmp0_;
	TrfPersona* _tmp1_;
	TrfPersona* _tmp2_;
	Event _tmp3_;
	gboolean _tmp4_;
	_data_ = g_slice_new0 (TrfPersonaStoreDoUpdateData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, _trf_persona_store_do_update);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, _trf_persona_store_do_update_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = p;
	_tmp2_ = _g_object_ref0 (_tmp1_);
	_data_->p = _tmp2_;
	_tmp3_ = *e;
	_data_->e = _tmp3_;
	_tmp4_ = adding;
	_data_->adding = _tmp4_;
	_trf_persona_store_do_update_co (_data_);
}


static void _trf_persona_store_do_update_finish (TrfPersonaStore* self, GAsyncResult* _res_) {
	TrfPersonaStoreDoUpdateData* _data_;
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
}


static void _trf_persona_store_do_update_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	TrfPersonaStoreDoUpdateData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	_trf_persona_store_do_update_co (_data_);
}


static gboolean _trf_persona_store_do_update_co (TrfPersonaStoreDoUpdateData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		case 2:
		goto _state_2;
		case 3:
		goto _state_3;
		case 4:
		goto _state_4;
		case 5:
		goto _state_5;
		case 6:
		goto _state_6;
		case 7:
		goto _state_7;
		case 8:
		goto _state_8;
		case 9:
		goto _state_9;
		case 10:
		goto _state_10;
		case 11:
		goto _state_11;
		case 12:
		goto _state_12;
		case 13:
		goto _state_13;
		case 14:
		goto _state_14;
		case 15:
		goto _state_15;
		case 16:
		goto _state_16;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->e;
	_data_->_tmp1_ = _data_->_tmp0_.pred_id;
	_data_->_tmp2_ = trf_persona_store__prefix_tracker_id;
	_data_->_tmp3_ = NULL;
	_data_->_tmp3_ = gee_abstract_map_get ((GeeAbstractMap*) _data_->_tmp2_, TRF_ONTOLOGY_DEFS_NCO_FULLNAME);
	if (_data_->_tmp1_ == GPOINTER_TO_INT (_data_->_tmp3_)) {
		_data_->_tmp4_ = g_strdup ("");
		_data_->fullname = _data_->_tmp4_;
		_data_->_tmp5_ = _data_->adding;
		if (_data_->_tmp5_) {
			_data_->_tmp6_ = _data_->e;
			_data_->_tmp7_ = _data_->_tmp6_.subject_id;
			_data_->_state_ = 1;
			_trf_persona_store_get_property (_data_->self, _data_->_tmp7_, TRF_ONTOLOGY_DEFS_NCO_FULLNAME, TRF_ONTOLOGY_DEFS_NCO_PERSON, _trf_persona_store_do_update_ready, _data_);
			return FALSE;
			_state_1:
			_data_->_tmp8_ = NULL;
			_data_->_tmp8_ = _trf_persona_store_get_property_finish (_data_->self, _data_->_res_);
			_g_free0 (_data_->fullname);
			_data_->fullname = _data_->_tmp8_;
		}
		_data_->_tmp9_ = _data_->p;
		_data_->_tmp10_ = _data_->fullname;
		_trf_persona_update_full_name (_data_->_tmp9_, _data_->_tmp10_);
		_g_free0 (_data_->fullname);
	} else {
		_data_->_tmp11_ = _data_->e;
		_data_->_tmp12_ = _data_->_tmp11_.pred_id;
		_data_->_tmp13_ = trf_persona_store__prefix_tracker_id;
		_data_->_tmp14_ = NULL;
		_data_->_tmp14_ = gee_abstract_map_get ((GeeAbstractMap*) _data_->_tmp13_, TRF_ONTOLOGY_DEFS_NCO_NICKNAME);
		if (_data_->_tmp12_ == GPOINTER_TO_INT (_data_->_tmp14_)) {
			_data_->_tmp15_ = g_strdup ("");
			_data_->nickname = _data_->_tmp15_;
			_data_->_tmp16_ = _data_->adding;
			if (_data_->_tmp16_) {
				_data_->_tmp17_ = _data_->e;
				_data_->_tmp18_ = _data_->_tmp17_.subject_id;
				_data_->_state_ = 2;
				_trf_persona_store_get_property (_data_->self, _data_->_tmp18_, TRF_ONTOLOGY_DEFS_NCO_NICKNAME, TRF_ONTOLOGY_DEFS_NCO_PERSON, _trf_persona_store_do_update_ready, _data_);
				return FALSE;
				_state_2:
				_data_->_tmp19_ = NULL;
				_data_->_tmp19_ = _trf_persona_store_get_property_finish (_data_->self, _data_->_res_);
				_g_free0 (_data_->nickname);
				_data_->nickname = _data_->_tmp19_;
			}
			_data_->_tmp20_ = _data_->p;
			_data_->_tmp21_ = _data_->nickname;
			_trf_persona_update_nickname (_data_->_tmp20_, _data_->_tmp21_);
			_g_free0 (_data_->nickname);
		} else {
			_data_->_tmp22_ = _data_->e;
			_data_->_tmp23_ = _data_->_tmp22_.pred_id;
			_data_->_tmp24_ = trf_persona_store__prefix_tracker_id;
			_data_->_tmp25_ = NULL;
			_data_->_tmp25_ = gee_abstract_map_get ((GeeAbstractMap*) _data_->_tmp24_, TRF_ONTOLOGY_DEFS_NCO_FAMILY);
			if (_data_->_tmp23_ == GPOINTER_TO_INT (_data_->_tmp25_)) {
				_data_->_tmp26_ = g_strdup ("");
				_data_->family_name = _data_->_tmp26_;
				_data_->_tmp27_ = _data_->adding;
				if (_data_->_tmp27_) {
					_data_->_tmp28_ = _data_->e;
					_data_->_tmp29_ = _data_->_tmp28_.subject_id;
					_data_->_state_ = 3;
					_trf_persona_store_get_property (_data_->self, _data_->_tmp29_, TRF_ONTOLOGY_DEFS_NCO_FAMILY, TRF_ONTOLOGY_DEFS_NCO_PERSON, _trf_persona_store_do_update_ready, _data_);
					return FALSE;
					_state_3:
					_data_->_tmp30_ = NULL;
					_data_->_tmp30_ = _trf_persona_store_get_property_finish (_data_->self, _data_->_res_);
					_g_free0 (_data_->family_name);
					_data_->family_name = _data_->_tmp30_;
				}
				_data_->_tmp31_ = _data_->p;
				_data_->_tmp32_ = _data_->family_name;
				_trf_persona_update_family_name (_data_->_tmp31_, _data_->_tmp32_);
				_g_free0 (_data_->family_name);
			} else {
				_data_->_tmp33_ = _data_->e;
				_data_->_tmp34_ = _data_->_tmp33_.pred_id;
				_data_->_tmp35_ = trf_persona_store__prefix_tracker_id;
				_data_->_tmp36_ = NULL;
				_data_->_tmp36_ = gee_abstract_map_get ((GeeAbstractMap*) _data_->_tmp35_, TRF_ONTOLOGY_DEFS_NCO_GIVEN);
				if (_data_->_tmp34_ == GPOINTER_TO_INT (_data_->_tmp36_)) {
					_data_->_tmp37_ = g_strdup ("");
					_data_->given_name = _data_->_tmp37_;
					_data_->_tmp38_ = _data_->adding;
					if (_data_->_tmp38_) {
						_data_->_tmp39_ = _data_->e;
						_data_->_tmp40_ = _data_->_tmp39_.subject_id;
						_data_->_state_ = 4;
						_trf_persona_store_get_property (_data_->self, _data_->_tmp40_, TRF_ONTOLOGY_DEFS_NCO_GIVEN, TRF_ONTOLOGY_DEFS_NCO_PERSON, _trf_persona_store_do_update_ready, _data_);
						return FALSE;
						_state_4:
						_data_->_tmp41_ = NULL;
						_data_->_tmp41_ = _trf_persona_store_get_property_finish (_data_->self, _data_->_res_);
						_g_free0 (_data_->given_name);
						_data_->given_name = _data_->_tmp41_;
					}
					_data_->_tmp42_ = _data_->p;
					_data_->_tmp43_ = _data_->given_name;
					_trf_persona_update_given_name (_data_->_tmp42_, _data_->_tmp43_);
					_g_free0 (_data_->given_name);
				} else {
					_data_->_tmp44_ = _data_->e;
					_data_->_tmp45_ = _data_->_tmp44_.pred_id;
					_data_->_tmp46_ = trf_persona_store__prefix_tracker_id;
					_data_->_tmp47_ = NULL;
					_data_->_tmp47_ = gee_abstract_map_get ((GeeAbstractMap*) _data_->_tmp46_, TRF_ONTOLOGY_DEFS_NCO_ADDITIONAL);
					if (_data_->_tmp45_ == GPOINTER_TO_INT (_data_->_tmp47_)) {
						_data_->_tmp48_ = g_strdup ("");
						_data_->additional_name = _data_->_tmp48_;
						_data_->_tmp49_ = _data_->adding;
						if (_data_->_tmp49_) {
							_data_->_tmp50_ = _data_->e;
							_data_->_tmp51_ = _data_->_tmp50_.subject_id;
							_data_->_state_ = 5;
							_trf_persona_store_get_property (_data_->self, _data_->_tmp51_, TRF_ONTOLOGY_DEFS_NCO_ADDITIONAL, TRF_ONTOLOGY_DEFS_NCO_PERSON, _trf_persona_store_do_update_ready, _data_);
							return FALSE;
							_state_5:
							_data_->_tmp52_ = NULL;
							_data_->_tmp52_ = _trf_persona_store_get_property_finish (_data_->self, _data_->_res_);
							_g_free0 (_data_->additional_name);
							_data_->additional_name = _data_->_tmp52_;
						}
						_data_->_tmp53_ = _data_->p;
						_data_->_tmp54_ = _data_->additional_name;
						_trf_persona_update_additional_names (_data_->_tmp53_, _data_->_tmp54_);
						_g_free0 (_data_->additional_name);
					} else {
						_data_->_tmp55_ = _data_->e;
						_data_->_tmp56_ = _data_->_tmp55_.pred_id;
						_data_->_tmp57_ = trf_persona_store__prefix_tracker_id;
						_data_->_tmp58_ = NULL;
						_data_->_tmp58_ = gee_abstract_map_get ((GeeAbstractMap*) _data_->_tmp57_, TRF_ONTOLOGY_DEFS_NCO_SUFFIX);
						if (_data_->_tmp56_ == GPOINTER_TO_INT (_data_->_tmp58_)) {
							_data_->_tmp59_ = g_strdup ("");
							_data_->suffix_name = _data_->_tmp59_;
							_data_->_tmp60_ = _data_->adding;
							if (_data_->_tmp60_) {
								_data_->_tmp61_ = _data_->e;
								_data_->_tmp62_ = _data_->_tmp61_.subject_id;
								_data_->_state_ = 6;
								_trf_persona_store_get_property (_data_->self, _data_->_tmp62_, TRF_ONTOLOGY_DEFS_NCO_SUFFIX, TRF_ONTOLOGY_DEFS_NCO_PERSON, _trf_persona_store_do_update_ready, _data_);
								return FALSE;
								_state_6:
								_data_->_tmp63_ = NULL;
								_data_->_tmp63_ = _trf_persona_store_get_property_finish (_data_->self, _data_->_res_);
								_g_free0 (_data_->suffix_name);
								_data_->suffix_name = _data_->_tmp63_;
							}
							_data_->_tmp64_ = _data_->p;
							_data_->_tmp65_ = _data_->suffix_name;
							_trf_persona_update_suffixes (_data_->_tmp64_, _data_->_tmp65_);
							_g_free0 (_data_->suffix_name);
						} else {
							_data_->_tmp66_ = _data_->e;
							_data_->_tmp67_ = _data_->_tmp66_.pred_id;
							_data_->_tmp68_ = trf_persona_store__prefix_tracker_id;
							_data_->_tmp69_ = NULL;
							_data_->_tmp69_ = gee_abstract_map_get ((GeeAbstractMap*) _data_->_tmp68_, TRF_ONTOLOGY_DEFS_NCO_PREFIX);
							if (_data_->_tmp67_ == GPOINTER_TO_INT (_data_->_tmp69_)) {
								_data_->_tmp70_ = g_strdup ("");
								_data_->prefix_name = _data_->_tmp70_;
								_data_->_tmp71_ = _data_->adding;
								if (_data_->_tmp71_) {
									_data_->_tmp72_ = _data_->e;
									_data_->_tmp73_ = _data_->_tmp72_.subject_id;
									_data_->_state_ = 7;
									_trf_persona_store_get_property (_data_->self, _data_->_tmp73_, TRF_ONTOLOGY_DEFS_NCO_PREFIX, TRF_ONTOLOGY_DEFS_NCO_PERSON, _trf_persona_store_do_update_ready, _data_);
									return FALSE;
									_state_7:
									_data_->_tmp74_ = NULL;
									_data_->_tmp74_ = _trf_persona_store_get_property_finish (_data_->self, _data_->_res_);
									_g_free0 (_data_->prefix_name);
									_data_->prefix_name = _data_->_tmp74_;
								}
								_data_->_tmp75_ = _data_->p;
								_data_->_tmp76_ = _data_->prefix_name;
								_trf_persona_update_prefixes (_data_->_tmp75_, _data_->_tmp76_);
								_g_free0 (_data_->prefix_name);
							} else {
								_data_->_tmp77_ = _data_->e;
								_data_->_tmp78_ = _data_->_tmp77_.pred_id;
								_data_->_tmp79_ = trf_persona_store__prefix_tracker_id;
								_data_->_tmp80_ = NULL;
								_data_->_tmp80_ = gee_abstract_map_get ((GeeAbstractMap*) _data_->_tmp79_, TRF_ONTOLOGY_DEFS_NAO_TAG);
								if (_data_->_tmp78_ == GPOINTER_TO_INT (_data_->_tmp80_)) {
									_data_->_tmp81_ = _data_->e;
									_data_->_tmp82_ = _data_->_tmp81_.object_id;
									_data_->_tmp83_ = 0;
									_data_->_tmp83_ = trf_persona_store_get_favorite_id (_data_->self);
									if (_data_->_tmp82_ == _data_->_tmp83_) {
										_data_->_tmp84_ = _data_->adding;
										if (_data_->_tmp84_) {
											_data_->_tmp85_ = _data_->p;
											_trf_persona_set_favourite (_data_->_tmp85_, TRUE);
										} else {
											_data_->_tmp86_ = _data_->p;
											_trf_persona_set_favourite (_data_->_tmp86_, FALSE);
										}
									}
								} else {
									_data_->_tmp87_ = _data_->e;
									_data_->_tmp88_ = _data_->_tmp87_.pred_id;
									_data_->_tmp89_ = trf_persona_store__prefix_tracker_id;
									_data_->_tmp90_ = NULL;
									_data_->_tmp90_ = gee_abstract_map_get ((GeeAbstractMap*) _data_->_tmp89_, TRF_ONTOLOGY_DEFS_NCO_HAS_EMAIL);
									if (_data_->_tmp88_ == GPOINTER_TO_INT (_data_->_tmp90_)) {
										_data_->_tmp91_ = _data_->adding;
										if (_data_->_tmp91_) {
											_data_->_tmp92_ = _data_->e;
											_data_->_tmp93_ = _data_->_tmp92_.object_id;
											_data_->_state_ = 8;
											_trf_persona_store_get_property (_data_->self, _data_->_tmp93_, TRF_ONTOLOGY_DEFS_NCO_EMAIL_PROP, TRF_ONTOLOGY_DEFS_NCO_EMAIL, _trf_persona_store_do_update_ready, _data_);
											return FALSE;
											_state_8:
											_data_->_tmp94_ = NULL;
											_data_->_tmp94_ = _trf_persona_store_get_property_finish (_data_->self, _data_->_res_);
											_data_->email = _data_->_tmp94_;
											_data_->_tmp95_ = _data_->p;
											_data_->_tmp96_ = _data_->email;
											_data_->_tmp97_ = _data_->e;
											_data_->_tmp98_ = _data_->_tmp97_.object_id;
											_data_->_tmp99_ = NULL;
											_data_->_tmp99_ = g_strdup_printf ("%i", _data_->_tmp98_);
											_data_->_tmp100_ = _data_->_tmp99_;
											_trf_persona_add_email (_data_->_tmp95_, _data_->_tmp96_, _data_->_tmp100_);
											_g_free0 (_data_->_tmp100_);
											_g_free0 (_data_->email);
										} else {
											_data_->_tmp101_ = _data_->p;
											_data_->_tmp102_ = _data_->e;
											_data_->_tmp103_ = _data_->_tmp102_.object_id;
											_data_->_tmp104_ = NULL;
											_data_->_tmp104_ = g_strdup_printf ("%i", _data_->_tmp103_);
											_data_->_tmp105_ = _data_->_tmp104_;
											_trf_persona_remove_email (_data_->_tmp101_, _data_->_tmp105_);
											_g_free0 (_data_->_tmp105_);
										}
									} else {
										_data_->_tmp106_ = _data_->e;
										_data_->_tmp107_ = _data_->_tmp106_.pred_id;
										_data_->_tmp108_ = trf_persona_store__prefix_tracker_id;
										_data_->_tmp109_ = NULL;
										_data_->_tmp109_ = gee_abstract_map_get ((GeeAbstractMap*) _data_->_tmp108_, TRF_ONTOLOGY_DEFS_NCO_HAS_PHONE);
										if (_data_->_tmp107_ == GPOINTER_TO_INT (_data_->_tmp109_)) {
											_data_->_tmp110_ = _data_->adding;
											if (_data_->_tmp110_) {
												_data_->_tmp111_ = _data_->e;
												_data_->_tmp112_ = _data_->_tmp111_.object_id;
												_data_->_state_ = 9;
												_trf_persona_store_get_property (_data_->self, _data_->_tmp112_, TRF_ONTOLOGY_DEFS_NCO_PHONE_PROP, TRF_ONTOLOGY_DEFS_NCO_PHONE, _trf_persona_store_do_update_ready, _data_);
												return FALSE;
												_state_9:
												_data_->_tmp113_ = NULL;
												_data_->_tmp113_ = _trf_persona_store_get_property_finish (_data_->self, _data_->_res_);
												_data_->phone = _data_->_tmp113_;
												_data_->_tmp114_ = _data_->p;
												_data_->_tmp115_ = _data_->phone;
												_data_->_tmp116_ = _data_->e;
												_data_->_tmp117_ = _data_->_tmp116_.object_id;
												_data_->_tmp118_ = NULL;
												_data_->_tmp118_ = g_strdup_printf ("%i", _data_->_tmp117_);
												_data_->_tmp119_ = _data_->_tmp118_;
												_trf_persona_add_phone (_data_->_tmp114_, _data_->_tmp115_, _data_->_tmp119_);
												_g_free0 (_data_->_tmp119_);
												_g_free0 (_data_->phone);
											} else {
												_data_->_tmp120_ = _data_->p;
												_data_->_tmp121_ = _data_->e;
												_data_->_tmp122_ = _data_->_tmp121_.object_id;
												_data_->_tmp123_ = NULL;
												_data_->_tmp123_ = g_strdup_printf ("%i", _data_->_tmp122_);
												_data_->_tmp124_ = _data_->_tmp123_;
												_trf_persona_remove_phone (_data_->_tmp120_, _data_->_tmp124_);
												_g_free0 (_data_->_tmp124_);
											}
										} else {
											_data_->_tmp125_ = _data_->e;
											_data_->_tmp126_ = _data_->_tmp125_.pred_id;
											_data_->_tmp127_ = trf_persona_store__prefix_tracker_id;
											_data_->_tmp128_ = NULL;
											_data_->_tmp128_ = gee_abstract_map_get ((GeeAbstractMap*) _data_->_tmp127_, TRF_ONTOLOGY_DEFS_NCO_HAS_AFFILIATION);
											if (_data_->_tmp126_ == GPOINTER_TO_INT (_data_->_tmp128_)) {
												_data_->_tmp129_ = _data_->adding;
												if (_data_->_tmp129_) {
													_data_->_tmp130_ = _data_->e;
													_data_->_tmp131_ = _data_->_tmp130_.subject_id;
													_data_->_tmp132_ = NULL;
													_data_->_tmp132_ = g_strdup_printf ("%i", _data_->_tmp131_);
													_data_->_tmp133_ = _data_->_tmp132_;
													_data_->_tmp134_ = _data_->e;
													_data_->_tmp135_ = _data_->_tmp134_.object_id;
													_data_->_tmp136_ = NULL;
													_data_->_tmp136_ = g_strdup_printf ("%i", _data_->_tmp135_);
													_data_->_tmp137_ = _data_->_tmp136_;
													_data_->_state_ = 10;
													_trf_persona_store_get_affl_info (_data_->self, _data_->_tmp133_, _data_->_tmp137_, _trf_persona_store_do_update_ready, _data_);
													return FALSE;
													_state_10:
													_data_->_tmp138_ = NULL;
													_data_->_tmp138_ = _trf_persona_store_get_affl_info_finish (_data_->self, _data_->_res_);
													_data_->_tmp139_ = _data_->_tmp138_;
													_g_free0 (_data_->_tmp137_);
													_g_free0 (_data_->_tmp133_);
													_data_->affl_info = _data_->_tmp139_;
													_data_->_tmp140_ = _data_->affl_info;
													_data_->_tmp141_ = NULL;
													_data_->_tmp141_ = trf_affl_info_to_string (_data_->_tmp140_);
													_data_->_tmp142_ = _data_->_tmp141_;
													g_debug ("trf-persona-store.vala:1512: affl_info : %s", _data_->_tmp142_);
													_g_free0 (_data_->_tmp142_);
													_data_->_tmp143_ = _data_->affl_info;
													_data_->_tmp144_ = trf_affl_info_get_im_tracker_id (_data_->_tmp143_);
													_data_->_tmp145_ = _data_->_tmp144_;
													if (_data_->_tmp145_ != NULL) {
														_data_->_tmp146_ = _data_->p;
														_data_->_tmp147_ = _data_->affl_info;
														_data_->_tmp148_ = trf_affl_info_get_im_nickname (_data_->_tmp147_);
														_data_->_tmp149_ = _data_->_tmp148_;
														_trf_persona_update_nickname (_data_->_tmp146_, _data_->_tmp149_);
														_data_->_tmp150_ = _data_->affl_info;
														_data_->_tmp151_ = trf_affl_info_get_im_proto (_data_->_tmp150_);
														_data_->_tmp152_ = _data_->_tmp151_;
														if (_data_->_tmp152_ != NULL) {
															_data_->_tmp153_ = _data_->p;
															_data_->_tmp154_ = _data_->affl_info;
															_data_->_tmp155_ = trf_affl_info_get_affl_tracker_id (_data_->_tmp154_);
															_data_->_tmp156_ = _data_->_tmp155_;
															_data_->_tmp157_ = _data_->affl_info;
															_data_->_tmp158_ = trf_affl_info_get_im_proto (_data_->_tmp157_);
															_data_->_tmp159_ = _data_->_tmp158_;
															_data_->_tmp160_ = _data_->affl_info;
															_data_->_tmp161_ = trf_affl_info_get_im_account_id (_data_->_tmp160_);
															_data_->_tmp162_ = _data_->_tmp161_;
															_trf_persona_add_im_address (_data_->_tmp153_, _data_->_tmp156_, _data_->_tmp159_, _data_->_tmp162_, TRUE);
														}
													}
													_data_->_tmp163_ = _data_->affl_info;
													_data_->_tmp164_ = trf_affl_info_get_affl_tracker_id (_data_->_tmp163_);
													_data_->_tmp165_ = _data_->_tmp164_;
													if (_data_->_tmp165_ != NULL) {
														_data_->_tmp167_ = _data_->affl_info;
														_data_->_tmp168_ = trf_affl_info_get_title (_data_->_tmp167_);
														_data_->_tmp169_ = _data_->_tmp168_;
														if (_data_->_tmp169_ != NULL) {
															_data_->_tmp166_ = TRUE;
														} else {
															_data_->_tmp170_ = _data_->affl_info;
															_data_->_tmp171_ = trf_affl_info_get_org (_data_->_tmp170_);
															_data_->_tmp172_ = _data_->_tmp171_;
															_data_->_tmp166_ = _data_->_tmp172_ != NULL;
														}
														_data_->_tmp173_ = _data_->_tmp166_;
														if (_data_->_tmp173_) {
															_data_->_tmp174_ = _data_->p;
															_data_->_tmp175_ = _data_->affl_info;
															_data_->_tmp176_ = trf_affl_info_get_affl_tracker_id (_data_->_tmp175_);
															_data_->_tmp177_ = _data_->_tmp176_;
															_data_->_tmp178_ = _data_->affl_info;
															_data_->_tmp179_ = trf_affl_info_get_role (_data_->_tmp178_);
															_data_->_tmp180_ = _data_->_tmp179_;
															_data_->_tmp181_ = _data_->affl_info;
															_data_->_tmp182_ = trf_affl_info_get_title (_data_->_tmp181_);
															_data_->_tmp183_ = _data_->_tmp182_;
															_data_->_tmp184_ = _data_->affl_info;
															_data_->_tmp185_ = trf_affl_info_get_org (_data_->_tmp184_);
															_data_->_tmp186_ = _data_->_tmp185_;
															_trf_persona_add_role (_data_->_tmp174_, _data_->_tmp177_, _data_->_tmp180_, _data_->_tmp183_, _data_->_tmp186_);
														}
													}
													_data_->_tmp187_ = _data_->affl_info;
													_data_->_tmp188_ = _data_->_tmp187_->postal_address_fd;
													if (_data_->_tmp188_ != NULL) {
														_data_->_tmp189_ = _data_->p;
														_data_->_tmp190_ = _data_->affl_info;
														_data_->_tmp191_ = _data_->_tmp190_->postal_address_fd;
														_trf_persona_add_postal_address (_data_->_tmp189_, _data_->_tmp191_);
													}
													_data_->_tmp192_ = _data_->affl_info;
													_data_->_tmp193_ = trf_affl_info_get_phone (_data_->_tmp192_);
													_data_->_tmp194_ = _data_->_tmp193_;
													if (_data_->_tmp194_ != NULL) {
														_data_->_tmp195_ = _data_->p;
														_data_->_tmp196_ = _data_->affl_info;
														_data_->_tmp197_ = trf_affl_info_get_phone (_data_->_tmp196_);
														_data_->_tmp198_ = _data_->_tmp197_;
														_data_->_tmp199_ = _data_->e;
														_data_->_tmp200_ = _data_->_tmp199_.object_id;
														_data_->_tmp201_ = NULL;
														_data_->_tmp201_ = g_strdup_printf ("%i", _data_->_tmp200_);
														_data_->_tmp202_ = _data_->_tmp201_;
														_trf_persona_add_phone (_data_->_tmp195_, _data_->_tmp198_, _data_->_tmp202_);
														_g_free0 (_data_->_tmp202_);
													}
													_data_->_tmp203_ = _data_->affl_info;
													_data_->_tmp204_ = trf_affl_info_get_email (_data_->_tmp203_);
													_data_->_tmp205_ = _data_->_tmp204_;
													if (_data_->_tmp205_ != NULL) {
														_data_->_tmp206_ = _data_->p;
														_data_->_tmp207_ = _data_->affl_info;
														_data_->_tmp208_ = trf_affl_info_get_email (_data_->_tmp207_);
														_data_->_tmp209_ = _data_->_tmp208_;
														_data_->_tmp210_ = _data_->e;
														_data_->_tmp211_ = _data_->_tmp210_.object_id;
														_data_->_tmp212_ = NULL;
														_data_->_tmp212_ = g_strdup_printf ("%i", _data_->_tmp211_);
														_data_->_tmp213_ = _data_->_tmp212_;
														_trf_persona_add_email (_data_->_tmp206_, _data_->_tmp209_, _data_->_tmp213_);
														_g_free0 (_data_->_tmp213_);
													}
													_data_->_tmp214_ = _data_->affl_info;
													_data_->_tmp215_ = trf_affl_info_get_website (_data_->_tmp214_);
													_data_->_tmp216_ = _data_->_tmp215_;
													if (_data_->_tmp216_ != NULL) {
														_data_->_tmp217_ = _data_->p;
														_data_->_tmp218_ = _data_->affl_info;
														_data_->_tmp219_ = trf_affl_info_get_website (_data_->_tmp218_);
														_data_->_tmp220_ = _data_->_tmp219_;
														_data_->_tmp221_ = _data_->affl_info;
														_data_->_tmp222_ = trf_affl_info_get_affl_tracker_id (_data_->_tmp221_);
														_data_->_tmp223_ = _data_->_tmp222_;
														_trf_persona_add_url (_data_->_tmp217_, _data_->_tmp220_, _data_->_tmp223_, "website");
													}
													_data_->_tmp224_ = _data_->affl_info;
													_data_->_tmp225_ = trf_affl_info_get_blog (_data_->_tmp224_);
													_data_->_tmp226_ = _data_->_tmp225_;
													if (_data_->_tmp226_ != NULL) {
														_data_->_tmp227_ = _data_->p;
														_data_->_tmp228_ = _data_->affl_info;
														_data_->_tmp229_ = trf_affl_info_get_blog (_data_->_tmp228_);
														_data_->_tmp230_ = _data_->_tmp229_;
														_data_->_tmp231_ = _data_->affl_info;
														_data_->_tmp232_ = trf_affl_info_get_affl_tracker_id (_data_->_tmp231_);
														_data_->_tmp233_ = _data_->_tmp232_;
														_trf_persona_add_url (_data_->_tmp227_, _data_->_tmp230_, _data_->_tmp233_, "blog");
													}
													_data_->_tmp234_ = _data_->affl_info;
													_data_->_tmp235_ = trf_affl_info_get_url (_data_->_tmp234_);
													_data_->_tmp236_ = _data_->_tmp235_;
													if (_data_->_tmp236_ != NULL) {
														_data_->_tmp237_ = _data_->p;
														_data_->_tmp238_ = _data_->affl_info;
														_data_->_tmp239_ = trf_affl_info_get_url (_data_->_tmp238_);
														_data_->_tmp240_ = _data_->_tmp239_;
														_data_->_tmp241_ = _data_->affl_info;
														_data_->_tmp242_ = trf_affl_info_get_affl_tracker_id (_data_->_tmp241_);
														_data_->_tmp243_ = _data_->_tmp242_;
														_trf_persona_add_url (_data_->_tmp237_, _data_->_tmp240_, _data_->_tmp243_, "url");
													}
													_g_object_unref0 (_data_->affl_info);
												} else {
													_data_->_tmp244_ = _data_->p;
													_data_->_tmp245_ = _data_->e;
													_data_->_tmp246_ = _data_->_tmp245_.object_id;
													_data_->_tmp247_ = NULL;
													_data_->_tmp247_ = g_strdup_printf ("%i", _data_->_tmp246_);
													_data_->_tmp248_ = _data_->_tmp247_;
													_trf_persona_remove_im_address (_data_->_tmp244_, _data_->_tmp248_, TRUE);
													_g_free0 (_data_->_tmp248_);
													_data_->_tmp249_ = _data_->p;
													_data_->_tmp250_ = _data_->e;
													_data_->_tmp251_ = _data_->_tmp250_.object_id;
													_data_->_tmp252_ = NULL;
													_data_->_tmp252_ = g_strdup_printf ("%i", _data_->_tmp251_);
													_data_->_tmp253_ = _data_->_tmp252_;
													_trf_persona_remove_role (_data_->_tmp249_, _data_->_tmp253_);
													_g_free0 (_data_->_tmp253_);
													_data_->_tmp254_ = _data_->p;
													_data_->_tmp255_ = _data_->e;
													_data_->_tmp256_ = _data_->_tmp255_.object_id;
													_data_->_tmp257_ = NULL;
													_data_->_tmp257_ = g_strdup_printf ("%i", _data_->_tmp256_);
													_data_->_tmp258_ = _data_->_tmp257_;
													_trf_persona_remove_postal_address (_data_->_tmp254_, _data_->_tmp258_);
													_g_free0 (_data_->_tmp258_);
													_data_->_tmp259_ = _data_->p;
													_data_->_tmp260_ = _data_->e;
													_data_->_tmp261_ = _data_->_tmp260_.object_id;
													_data_->_tmp262_ = NULL;
													_data_->_tmp262_ = g_strdup_printf ("%i", _data_->_tmp261_);
													_data_->_tmp263_ = _data_->_tmp262_;
													_trf_persona_remove_phone (_data_->_tmp259_, _data_->_tmp263_);
													_g_free0 (_data_->_tmp263_);
													_data_->_tmp264_ = _data_->p;
													_data_->_tmp265_ = _data_->e;
													_data_->_tmp266_ = _data_->_tmp265_.object_id;
													_data_->_tmp267_ = NULL;
													_data_->_tmp267_ = g_strdup_printf ("%i", _data_->_tmp266_);
													_data_->_tmp268_ = _data_->_tmp267_;
													_trf_persona_remove_email (_data_->_tmp264_, _data_->_tmp268_);
													_g_free0 (_data_->_tmp268_);
													_data_->_tmp269_ = _data_->p;
													_data_->_tmp270_ = _data_->e;
													_data_->_tmp271_ = _data_->_tmp270_.object_id;
													_data_->_tmp272_ = NULL;
													_data_->_tmp272_ = g_strdup_printf ("%i", _data_->_tmp271_);
													_data_->_tmp273_ = _data_->_tmp272_;
													_trf_persona_remove_url (_data_->_tmp269_, _data_->_tmp273_);
													_g_free0 (_data_->_tmp273_);
												}
											} else {
												_data_->_tmp274_ = _data_->e;
												_data_->_tmp275_ = _data_->_tmp274_.pred_id;
												_data_->_tmp276_ = trf_persona_store__prefix_tracker_id;
												_data_->_tmp277_ = NULL;
												_data_->_tmp277_ = gee_abstract_map_get ((GeeAbstractMap*) _data_->_tmp276_, TRF_ONTOLOGY_DEFS_NCO_BIRTHDAY);
												if (_data_->_tmp275_ == GPOINTER_TO_INT (_data_->_tmp277_)) {
													_data_->_tmp278_ = g_strdup ("");
													_data_->bday = _data_->_tmp278_;
													_data_->_tmp279_ = _data_->adding;
													if (_data_->_tmp279_) {
														_data_->_tmp280_ = _data_->e;
														_data_->_tmp281_ = _data_->_tmp280_.subject_id;
														_data_->_state_ = 11;
														_trf_persona_store_get_property (_data_->self, _data_->_tmp281_, TRF_ONTOLOGY_DEFS_NCO_BIRTHDAY, TRF_ONTOLOGY_DEFS_NCO_PERSON, _trf_persona_store_do_update_ready, _data_);
														return FALSE;
														_state_11:
														_data_->_tmp282_ = NULL;
														_data_->_tmp282_ = _trf_persona_store_get_property_finish (_data_->self, _data_->_res_);
														_g_free0 (_data_->bday);
														_data_->bday = _data_->_tmp282_;
													}
													_data_->_tmp283_ = _data_->p;
													_data_->_tmp284_ = _data_->bday;
													_trf_persona_set_birthday (_data_->_tmp283_, _data_->_tmp284_);
													_g_free0 (_data_->bday);
												} else {
													_data_->_tmp285_ = _data_->e;
													_data_->_tmp286_ = _data_->_tmp285_.pred_id;
													_data_->_tmp287_ = trf_persona_store__prefix_tracker_id;
													_data_->_tmp288_ = NULL;
													_data_->_tmp288_ = gee_abstract_map_get ((GeeAbstractMap*) _data_->_tmp287_, TRF_ONTOLOGY_DEFS_NCO_NOTE);
													if (_data_->_tmp286_ == GPOINTER_TO_INT (_data_->_tmp288_)) {
														_data_->_tmp289_ = g_strdup ("");
														_data_->note = _data_->_tmp289_;
														_data_->_tmp290_ = _data_->adding;
														if (_data_->_tmp290_) {
															_data_->_tmp291_ = _data_->e;
															_data_->_tmp292_ = _data_->_tmp291_.subject_id;
															_data_->_state_ = 12;
															_trf_persona_store_get_property (_data_->self, _data_->_tmp292_, TRF_ONTOLOGY_DEFS_NCO_NOTE, TRF_ONTOLOGY_DEFS_NCO_PERSON, _trf_persona_store_do_update_ready, _data_);
															return FALSE;
															_state_12:
															_data_->_tmp293_ = NULL;
															_data_->_tmp293_ = _trf_persona_store_get_property_finish (_data_->self, _data_->_res_);
															_g_free0 (_data_->note);
															_data_->note = _data_->_tmp293_;
														}
														_data_->_tmp294_ = _data_->p;
														_data_->_tmp295_ = _data_->note;
														_trf_persona_set_note (_data_->_tmp294_, _data_->_tmp295_);
														_g_free0 (_data_->note);
													} else {
														_data_->_tmp296_ = _data_->e;
														_data_->_tmp297_ = _data_->_tmp296_.pred_id;
														_data_->_tmp298_ = trf_persona_store__prefix_tracker_id;
														_data_->_tmp299_ = NULL;
														_data_->_tmp299_ = gee_abstract_map_get ((GeeAbstractMap*) _data_->_tmp298_, TRF_ONTOLOGY_DEFS_NCO_GENDER);
														if (_data_->_tmp297_ == GPOINTER_TO_INT (_data_->_tmp299_)) {
															_data_->_tmp300_ = _data_->adding;
															if (_data_->_tmp300_) {
																_data_->_tmp301_ = _data_->p;
																_data_->_tmp302_ = _data_->e;
																_data_->_tmp303_ = _data_->_tmp302_.object_id;
																_trf_persona_set_gender (_data_->_tmp301_, _data_->_tmp303_);
															} else {
																_data_->_tmp304_ = _data_->p;
																_trf_persona_set_gender (_data_->_tmp304_, 0);
															}
														} else {
															_data_->_tmp305_ = _data_->e;
															_data_->_tmp306_ = _data_->_tmp305_.pred_id;
															_data_->_tmp307_ = trf_persona_store__prefix_tracker_id;
															_data_->_tmp308_ = NULL;
															_data_->_tmp308_ = gee_abstract_map_get ((GeeAbstractMap*) _data_->_tmp307_, TRF_ONTOLOGY_DEFS_NCO_PHOTO);
															if (_data_->_tmp306_ == GPOINTER_TO_INT (_data_->_tmp308_)) {
																_data_->_tmp309_ = g_strdup ("");
																_data_->avatar_url = _data_->_tmp309_;
																_data_->_tmp310_ = _data_->adding;
																if (_data_->_tmp310_) {
																	_data_->_tmp311_ = _data_->e;
																	_data_->_tmp312_ = _data_->_tmp311_.object_id;
																	_data_->_state_ = 13;
																	_trf_persona_store_get_property (_data_->self, _data_->_tmp312_, TRF_ONTOLOGY_DEFS_NIE_URL, TRF_ONTOLOGY_DEFS_NFO_IMAGE, _trf_persona_store_do_update_ready, _data_);
																	return FALSE;
																	_state_13:
																	_data_->_tmp313_ = NULL;
																	_data_->_tmp313_ = _trf_persona_store_get_property_finish (_data_->self, _data_->_res_);
																	_g_free0 (_data_->avatar_url);
																	_data_->avatar_url = _data_->_tmp313_;
																}
																_data_->_tmp314_ = _data_->p;
																_data_->_tmp315_ = _data_->avatar_url;
																_trf_persona_set_avatar_from_uri (_data_->_tmp314_, _data_->_tmp315_);
																_g_free0 (_data_->avatar_url);
															} else {
																_data_->_tmp316_ = _data_->e;
																_data_->_tmp317_ = _data_->_tmp316_.pred_id;
																_data_->_tmp318_ = trf_persona_store__prefix_tracker_id;
																_data_->_tmp319_ = NULL;
																_data_->_tmp319_ = gee_abstract_map_get ((GeeAbstractMap*) _data_->_tmp318_, TRF_ONTOLOGY_DEFS_NAO_PROPERTY);
																if (_data_->_tmp317_ == GPOINTER_TO_INT (_data_->_tmp319_)) {
																	_data_->_tmp320_ = _data_->adding;
																	if (_data_->_tmp320_) {
																		_data_->_tmp321_ = _data_->e;
																		_data_->_tmp322_ = _data_->_tmp321_.object_id;
																		_data_->_tmp323_ = 0;
																		_data_->_state_ = 14;
																		_trf_persona_store_get_nao_property_by_prop_id (_data_->self, _data_->_tmp322_, _trf_persona_store_do_update_ready, _data_);
																		return FALSE;
																		_state_14:
																		_data_->_tmp324_ = NULL;
																		_data_->_tmp324_ = _trf_persona_store_get_nao_property_by_prop_id_finish (_data_->self, _data_->_res_, &_data_->_tmp323_);
																		_data_->prop_info = _data_->_tmp324_;
																		_data_->prop_info_length1 = _data_->_tmp323_;
																		_data_->_prop_info_size_ = _data_->prop_info_length1;
																		_data_->_tmp325_ = _data_->prop_info;
																		_data_->_tmp325__length1 = _data_->prop_info_length1;
																		_data_->_tmp326_ = _data_->_tmp325_[0];
																		if (g_strcmp0 (_data_->_tmp326_, TRF_PERSONA_STORE__LOCAL_ID_PROPERTY_NAME) == 0) {
																			_data_->_tmp327_ = _data_->p;
																			_data_->_tmp328_ = _data_->prop_info;
																			_data_->_tmp328__length1 = _data_->prop_info_length1;
																			_data_->_tmp329_ = _data_->_tmp328_[1];
																			_trf_persona_set_local_ids (_data_->_tmp327_, _data_->_tmp329_);
																		} else {
																			_data_->_tmp330_ = _data_->prop_info;
																			_data_->_tmp330__length1 = _data_->prop_info_length1;
																			_data_->_tmp331_ = _data_->_tmp330_[0];
																			if (g_strcmp0 (_data_->_tmp331_, TRF_PERSONA_STORE__WSD_PROPERTY_NAME) == 0) {
																				_data_->_tmp332_ = _data_->p;
																				_data_->_tmp333_ = _data_->prop_info;
																				_data_->_tmp333__length1 = _data_->prop_info_length1;
																				_data_->_tmp334_ = _data_->_tmp333_[1];
																				_trf_persona_set_web_service_addrs (_data_->_tmp332_, _data_->_tmp334_);
																			}
																		}
																		_data_->prop_info = (_vala_array_free (_data_->prop_info, _data_->prop_info_length1, (GDestroyNotify) g_free), NULL);
																	} else {
																		_data_->_tmp335_ = _data_->e;
																		_data_->_tmp336_ = _data_->_tmp335_.subject_id;
																		_data_->_state_ = 15;
																		_trf_persona_store_get_nao_property_by_person_id (_data_->self, _data_->_tmp336_, TRF_PERSONA_STORE__LOCAL_ID_PROPERTY_NAME, _trf_persona_store_do_update_ready, _data_);
																		return FALSE;
																		_state_15:
																		_data_->_tmp337_ = NULL;
																		_data_->_tmp337_ = _trf_persona_store_get_nao_property_by_person_id_finish (_data_->self, _data_->_res_);
																		_data_->local_ids = _data_->_tmp337_;
																		_data_->_tmp338_ = _data_->e;
																		_data_->_tmp339_ = _data_->_tmp338_.subject_id;
																		_data_->_state_ = 16;
																		_trf_persona_store_get_nao_property_by_person_id (_data_->self, _data_->_tmp339_, TRF_PERSONA_STORE__WSD_PROPERTY_NAME, _trf_persona_store_do_update_ready, _data_);
																		return FALSE;
																		_state_16:
																		_data_->_tmp340_ = NULL;
																		_data_->_tmp340_ = _trf_persona_store_get_nao_property_by_person_id_finish (_data_->self, _data_->_res_);
																		_data_->ws_addrs = _data_->_tmp340_;
																		_data_->_tmp341_ = _data_->p;
																		_data_->_tmp342_ = _data_->local_ids;
																		_trf_persona_set_local_ids (_data_->_tmp341_, _data_->_tmp342_);
																		_data_->_tmp343_ = _data_->p;
																		_data_->_tmp344_ = _data_->ws_addrs;
																		_trf_persona_set_web_service_addrs (_data_->_tmp343_, _data_->_tmp344_);
																		_g_free0 (_data_->ws_addrs);
																		_g_free0 (_data_->local_ids);
																	}
																}
															}
														}
													}
												}
											}
										}
									}
								}
							}
						}
					}
				}
			}
		}
	}
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


static void _trf_persona_store_get_property_data_free (gpointer _data) {
	TrfPersonaStoreGetPropertyData* _data_;
	_data_ = _data;
	_g_free0 (_data_->property);
	_g_free0 (_data_->subject_type);
	_g_free0 (_data_->result);
	_g_object_unref0 (_data_->self);
	g_slice_free (TrfPersonaStoreGetPropertyData, _data_);
}


static void _trf_persona_store_get_property (TrfPersonaStore* self, gint subject_tracker_id, const gchar* property, const gchar* subject_type, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	TrfPersonaStoreGetPropertyData* _data_;
	TrfPersonaStore* _tmp0_;
	gint _tmp1_;
	const gchar* _tmp2_;
	const gchar* _tmp3_;
	const gchar* _tmp4_;
	const gchar* _tmp5_;
	_data_ = g_slice_new0 (TrfPersonaStoreGetPropertyData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, _trf_persona_store_get_property);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, _trf_persona_store_get_property_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = subject_tracker_id;
	_data_->subject_tracker_id = _tmp1_;
	_tmp2_ = property;
	_tmp3_ = g_strdup (_tmp2_);
	_data_->property = _tmp3_;
	_tmp4_ = subject_type;
	_tmp5_ = g_strdup (_tmp4_);
	_data_->subject_type = _tmp5_;
	_trf_persona_store_get_property_co (_data_);
}


static gchar* _trf_persona_store_get_property_finish (TrfPersonaStore* self, GAsyncResult* _res_) {
	gchar* result;
	TrfPersonaStoreGetPropertyData* _data_;
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
	result = _data_->result;
	_data_->result = NULL;
	return result;
}


static void _trf_persona_store_get_property_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	TrfPersonaStoreGetPropertyData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	_trf_persona_store_get_property_co (_data_);
}


static gboolean _trf_persona_store_get_property_co (TrfPersonaStoreGetPropertyData* _data_) {
	static const char query_template[] = "SELECT ?property WHERE" " { ?p a %s ; " "   %s ?property " " . FILTER(tracker:id(?p) = %d ) }";
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->subject_type;
	_data_->_tmp1_ = _data_->property;
	_data_->_tmp2_ = _data_->subject_tracker_id;
	_data_->_tmp3_ = NULL;
	_data_->_tmp3_ = g_strdup_printf (query_template, _data_->_tmp0_, _data_->_tmp1_, _data_->_tmp2_);
	_data_->query = _data_->_tmp3_;
	_data_->_state_ = 1;
	_trf_persona_store_single_value_query (_data_->self, _data_->query, _trf_persona_store_get_property_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp4_ = NULL;
	_data_->_tmp4_ = _trf_persona_store_single_value_query_finish (_data_->self, _data_->_res_);
	_data_->result = _data_->_tmp4_;
	_g_free0 (_data_->query);
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
	_g_free0 (_data_->query);
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


static void _trf_persona_store_get_nao_property_by_person_id_data_free (gpointer _data) {
	TrfPersonaStoreGetNaoPropertyByPersonIdData* _data_;
	_data_ = _data;
	_g_free0 (_data_->prop_name);
	_g_free0 (_data_->result);
	_g_object_unref0 (_data_->self);
	g_slice_free (TrfPersonaStoreGetNaoPropertyByPersonIdData, _data_);
}


static void _trf_persona_store_get_nao_property_by_person_id (TrfPersonaStore* self, gint nco_person_id, const gchar* prop_name, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	TrfPersonaStoreGetNaoPropertyByPersonIdData* _data_;
	TrfPersonaStore* _tmp0_;
	gint _tmp1_;
	const gchar* _tmp2_;
	const gchar* _tmp3_;
	_data_ = g_slice_new0 (TrfPersonaStoreGetNaoPropertyByPersonIdData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, _trf_persona_store_get_nao_property_by_person_id);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, _trf_persona_store_get_nao_property_by_person_id_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = nco_person_id;
	_data_->nco_person_id = _tmp1_;
	_tmp2_ = prop_name;
	_tmp3_ = g_strdup (_tmp2_);
	_data_->prop_name = _tmp3_;
	_trf_persona_store_get_nao_property_by_person_id_co (_data_);
}


static gchar* _trf_persona_store_get_nao_property_by_person_id_finish (TrfPersonaStore* self, GAsyncResult* _res_) {
	gchar* result;
	TrfPersonaStoreGetNaoPropertyByPersonIdData* _data_;
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
	result = _data_->result;
	_data_->result = NULL;
	return result;
}


static void _trf_persona_store_get_nao_property_by_person_id_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	TrfPersonaStoreGetNaoPropertyByPersonIdData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	_trf_persona_store_get_nao_property_by_person_id_co (_data_);
}


static gboolean _trf_persona_store_get_nao_property_by_person_id_co (TrfPersonaStoreGetNaoPropertyByPersonIdData* _data_) {
	static const char query_t[] = "SELECT " " ?prop_value " "WHERE { " " ?p a " TRF_ONTOLOGY_DEFS_NCO_PERSON " ; " TRF_ONTOLOGY_DEFS_NAO_HAS_PROPERTY " ?prop . " " ?prop " TRF_ONTOLOGY_DEFS_NAO_PROPERTY_NAME " ?prop_name . " " ?prop " TRF_ONTOLOGY_DEFS_NAO_PROPERTY_VALUE " ?prop_value . " " FILTER (tracker:id(?p) = %d && ?prop_name = '%s') } ";
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->nco_person_id;
	_data_->_tmp1_ = _data_->prop_name;
	_data_->_tmp2_ = NULL;
	_data_->_tmp2_ = g_strdup_printf (query_t, _data_->_tmp0_, _data_->_tmp1_);
	_data_->query = _data_->_tmp2_;
	_data_->_state_ = 1;
	_trf_persona_store_single_value_query (_data_->self, _data_->query, _trf_persona_store_get_nao_property_by_person_id_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp3_ = NULL;
	_data_->_tmp3_ = _trf_persona_store_single_value_query_finish (_data_->self, _data_->_res_);
	_data_->result = _data_->_tmp3_;
	_g_free0 (_data_->query);
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
	_g_free0 (_data_->query);
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


static void _trf_persona_store_get_nao_property_by_prop_id_data_free (gpointer _data) {
	TrfPersonaStoreGetNaoPropertyByPropIdData* _data_;
	_data_ = _data;
	_data_->result = (_vala_array_free (_data_->result, _data_->result_length1, (GDestroyNotify) g_free), NULL);
	_g_object_unref0 (_data_->self);
	g_slice_free (TrfPersonaStoreGetNaoPropertyByPropIdData, _data_);
}


static void _trf_persona_store_get_nao_property_by_prop_id (TrfPersonaStore* self, gint nao_prop_id, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	TrfPersonaStoreGetNaoPropertyByPropIdData* _data_;
	TrfPersonaStore* _tmp0_;
	gint _tmp1_;
	_data_ = g_slice_new0 (TrfPersonaStoreGetNaoPropertyByPropIdData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, _trf_persona_store_get_nao_property_by_prop_id);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, _trf_persona_store_get_nao_property_by_prop_id_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = nao_prop_id;
	_data_->nao_prop_id = _tmp1_;
	_trf_persona_store_get_nao_property_by_prop_id_co (_data_);
}


static gchar** _trf_persona_store_get_nao_property_by_prop_id_finish (TrfPersonaStore* self, GAsyncResult* _res_, int* result_length1) {
	gchar** result;
	TrfPersonaStoreGetNaoPropertyByPropIdData* _data_;
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
	result = _data_->result;
	*result_length1 = _data_->result_length1;
	_data_->result = NULL;
	return result;
}


static void _trf_persona_store_get_nao_property_by_prop_id_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	TrfPersonaStoreGetNaoPropertyByPropIdData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	_trf_persona_store_get_nao_property_by_prop_id_co (_data_);
}


static gboolean _trf_persona_store_get_nao_property_by_prop_id_co (TrfPersonaStoreGetNaoPropertyByPropIdData* _data_) {
	static const char query_t[] = "SELECT " " fn:concat(?prop_name, '\t', ?prop_value)" "WHERE { " " ?p a " TRF_ONTOLOGY_DEFS_NCO_PERSON " ; " TRF_ONTOLOGY_DEFS_NAO_HAS_PROPERTY " ?prop . " " ?prop " TRF_ONTOLOGY_DEFS_NAO_PROPERTY_NAME " ?prop_name . " " ?prop " TRF_ONTOLOGY_DEFS_NAO_PROPERTY_VALUE " ?prop_value . " " FILTER (tracker:id(?prop) = %d) } ";
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->nao_prop_id;
	_data_->_tmp1_ = NULL;
	_data_->_tmp1_ = g_strdup_printf (query_t, _data_->_tmp0_);
	_data_->query = _data_->_tmp1_;
	_data_->_state_ = 1;
	_trf_persona_store_single_value_query (_data_->self, _data_->query, _trf_persona_store_get_nao_property_by_prop_id_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp2_ = NULL;
	_data_->_tmp2_ = _trf_persona_store_single_value_query_finish (_data_->self, _data_->_res_);
	_data_->ret = _data_->_tmp2_;
	_data_->_tmp4_ = NULL;
	_data_->_tmp4_ = _data_->_tmp3_ = g_strsplit (_data_->ret, "\t", 0);
	_data_->_tmp5_ = _data_->_tmp4_;
	_data_->_tmp5__length1 = _vala_array_length (_data_->_tmp3_);
	_data_->result_length1 = _data_->_tmp5__length1;
	_data_->result = _data_->_tmp5_;
	_g_free0 (_data_->ret);
	_g_free0 (_data_->query);
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
	_g_free0 (_data_->ret);
	_g_free0 (_data_->query);
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


static void _trf_persona_store_get_affl_info_data_free (gpointer _data) {
	TrfPersonaStoreGetAfflInfoData* _data_;
	_data_ = _data;
	_g_free0 (_data_->person_id);
	_g_free0 (_data_->affiliation_id);
	_g_object_unref0 (_data_->result);
	_g_object_unref0 (_data_->self);
	g_slice_free (TrfPersonaStoreGetAfflInfoData, _data_);
}


static void _trf_persona_store_get_affl_info (TrfPersonaStore* self, const gchar* person_id, const gchar* affiliation_id, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	TrfPersonaStoreGetAfflInfoData* _data_;
	TrfPersonaStore* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	const gchar* _tmp3_;
	const gchar* _tmp4_;
	_data_ = g_slice_new0 (TrfPersonaStoreGetAfflInfoData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, _trf_persona_store_get_affl_info);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, _trf_persona_store_get_affl_info_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = person_id;
	_tmp2_ = g_strdup (_tmp1_);
	_data_->person_id = _tmp2_;
	_tmp3_ = affiliation_id;
	_tmp4_ = g_strdup (_tmp3_);
	_data_->affiliation_id = _tmp4_;
	_trf_persona_store_get_affl_info_co (_data_);
}


static TrfAfflInfo* _trf_persona_store_get_affl_info_finish (TrfPersonaStore* self, GAsyncResult* _res_) {
	TrfAfflInfo* result;
	TrfPersonaStoreGetAfflInfoData* _data_;
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
	result = _data_->result;
	_data_->result = NULL;
	return result;
}


static void _trf_persona_store_get_affl_info_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	TrfPersonaStoreGetAfflInfoData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	_trf_persona_store_get_affl_info_co (_data_);
}


static gboolean _trf_persona_store_get_affl_info_co (TrfPersonaStoreGetAfflInfoData* _data_) {
	static const char query_template[] = "SELECT " "tracker:id(?i) " TRF_ONTOLOGY_DEFS_NCO_IMPROTOCOL "(?i) " TRF_ONTOLOGY_DEFS_NCO_IMID "(?i) " "tracker:id(?a) " TRF_ONTOLOGY_DEFS_NCO_ROLE "(?a) " TRF_ONTOLOGY_DEFS_NCO_ORG "(?a) " TRF_ONTOLOGY_DEFS_NCO_TITLE "(?a) " TRF_ONTOLOGY_DEFS_NCO_POBOX "(?postal) " TRF_ONTOLOGY_DEFS_NCO_DISTRICT "(?postal) " TRF_ONTOLOGY_DEFS_NCO_COUNTY "(?postal) " TRF_ONTOLOGY_DEFS_NCO_LOCALITY "(?postal) " TRF_ONTOLOGY_DEFS_NCO_POSTALCODE "(?postal) " TRF_ONTOLOGY_DEFS_NCO_STREET_ADDRESS "(?postal) " TRF_ONTOLOGY_DEFS_NCO_ADDRESS_LOCATION "(?postal) " TRF_ONTOLOGY_DEFS_NCO_EXTENDED_ADDRESS "(?postal) " TRF_ONTOLOGY_DEFS_NCO_COUNTRY "(?postal) " TRF_ONTOLOGY_DEFS_NCO_REGION "(?postal) " TRF_ONTOLOGY_DEFS_NCO_EMAIL_PROP "(?e) " TRF_ONTOLOGY_DEFS_NCO_PHONE_PROP "(?number) " TRF_ONTOLOGY_DEFS_NCO_WEBSITE "(?a) " TRF_ONTOLOGY_DEFS_NCO_BLOG "(?a) " TRF_ONTOLOGY_DEFS_NCO_URL "(?a) " TRF_ONTOLOGY_DEFS_NCO_IM_NICKNAME "(?i) " "WHERE { " " ?p a " TRF_ONTOLOGY_DEFS_NCO_PERSON " ; " TRF_ONTOLOGY_DEFS_NCO_HAS_AFFILIATION " ?a . " " OPTIONAL { ?a " TRF_ONTOLOGY_DEFS_NCO_HAS_IMADDRESS " ?i } . " " OPTIONAL { ?a " TRF_ONTOLOGY_DEFS_NCO_HAS_POSTAL_ADDRESS "               ?postal } . " " OPTIONAL { ?a " TRF_ONTOLOGY_DEFS_NCO_HAS_EMAIL " ?e } . " " OPTIONAL { ?a " TRF_ONTOLOGY_DEFS_NCO_HAS_PHONE " ?number }  " " FILTER(tracker:id(?p) = %s" " && tracker:id(?a) = %s" " ) } ";
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		case 2:
		goto _state_2;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = trf_affl_info_new ();
	_data_->affl_info = _data_->_tmp0_;
	_data_->_tmp1_ = _data_->person_id;
	_data_->_tmp2_ = _data_->affiliation_id;
	_data_->_tmp3_ = NULL;
	_data_->_tmp3_ = g_strdup_printf (query_template, _data_->_tmp1_, _data_->_tmp2_);
	_data_->query = _data_->_tmp3_;
	_data_->_tmp4_ = _data_->query;
	g_debug ("trf-persona-store.vala:1736: _get_affl_info: %s", _data_->_tmp4_);
	{
		_data_->_tmp5_ = _data_->self->priv->_connection;
		_data_->_tmp6_ = _data_->query;
		_data_->_state_ = 1;
		tracker_sparql_connection_query_async (_data_->_tmp5_, _data_->_tmp6_, NULL, _trf_persona_store_get_affl_info_ready, _data_);
		return FALSE;
		_state_1:
		_data_->_tmp7_ = NULL;
		_data_->_tmp7_ = tracker_sparql_connection_query_finish (_data_->_tmp5_, _data_->_res_, &_data_->_inner_error_);
		_data_->cursor = _data_->_tmp7_;
		if (_data_->_inner_error_ != NULL) {
			if (_data_->_inner_error_->domain == TRACKER_SPARQL_ERROR) {
				goto __catch8_tracker_sparql_error;
			}
			goto __catch8_g_error;
		}
		while (TRUE) {
			_data_->_tmp8_ = _data_->cursor;
			_data_->_state_ = 2;
			tracker_sparql_cursor_next_async (_data_->_tmp8_, NULL, _trf_persona_store_get_affl_info_ready, _data_);
			return FALSE;
			_state_2:
			_data_->_tmp9_ = FALSE;
			_data_->_tmp9_ = tracker_sparql_cursor_next_finish (_data_->_tmp8_, _data_->_res_, &_data_->_inner_error_);
			_data_->_tmp10_ = _data_->_tmp9_;
			if (_data_->_inner_error_ != NULL) {
				_g_object_unref0 (_data_->cursor);
				if (_data_->_inner_error_->domain == TRACKER_SPARQL_ERROR) {
					goto __catch8_tracker_sparql_error;
				}
				goto __catch8_g_error;
			}
			if (!_data_->_tmp10_) {
				break;
			}
			_data_->_tmp11_ = _data_->affl_info;
			_data_->_tmp12_ = _data_->cursor;
			_data_->_tmp13_ = NULL;
			_data_->_tmp13_ = tracker_sparql_cursor_get_string (_data_->_tmp12_, (gint) TRF_AFFL_INFO_FIELDS_IM_TRACKER_ID, NULL);
			_data_->_tmp14_ = NULL;
			_data_->_tmp14_ = g_strdup (_data_->_tmp13_);
			_data_->_tmp15_ = _data_->_tmp14_;
			trf_affl_info_set_im_tracker_id (_data_->_tmp11_, _data_->_tmp15_);
			_g_free0 (_data_->_tmp15_);
			_data_->_tmp16_ = _data_->affl_info;
			_data_->_tmp17_ = _data_->cursor;
			_data_->_tmp18_ = NULL;
			_data_->_tmp18_ = tracker_sparql_cursor_get_string (_data_->_tmp17_, (gint) TRF_AFFL_INFO_FIELDS_IM_PROTOCOL, NULL);
			_data_->_tmp19_ = NULL;
			_data_->_tmp19_ = g_strdup (_data_->_tmp18_);
			_data_->_tmp20_ = _data_->_tmp19_;
			trf_affl_info_set_im_proto (_data_->_tmp16_, _data_->_tmp20_);
			_g_free0 (_data_->_tmp20_);
			_data_->_tmp21_ = _data_->affl_info;
			_data_->_tmp22_ = _data_->cursor;
			_data_->_tmp23_ = NULL;
			_data_->_tmp23_ = tracker_sparql_cursor_get_string (_data_->_tmp22_, (gint) TRF_AFFL_INFO_FIELDS_IM_ACCOUNT_ID, NULL);
			_data_->_tmp24_ = NULL;
			_data_->_tmp24_ = g_strdup (_data_->_tmp23_);
			_data_->_tmp25_ = _data_->_tmp24_;
			trf_affl_info_set_im_account_id (_data_->_tmp21_, _data_->_tmp25_);
			_g_free0 (_data_->_tmp25_);
			_data_->_tmp26_ = _data_->affl_info;
			_data_->_tmp27_ = _data_->cursor;
			_data_->_tmp28_ = NULL;
			_data_->_tmp28_ = tracker_sparql_cursor_get_string (_data_->_tmp27_, (gint) TRF_AFFL_INFO_FIELDS_IM_NICKNAME, NULL);
			_data_->_tmp29_ = NULL;
			_data_->_tmp29_ = g_strdup (_data_->_tmp28_);
			_data_->_tmp30_ = _data_->_tmp29_;
			trf_affl_info_set_im_nickname (_data_->_tmp26_, _data_->_tmp30_);
			_g_free0 (_data_->_tmp30_);
			_data_->_tmp31_ = _data_->affl_info;
			_data_->_tmp32_ = _data_->cursor;
			_data_->_tmp33_ = NULL;
			_data_->_tmp33_ = tracker_sparql_cursor_get_string (_data_->_tmp32_, (gint) TRF_AFFL_INFO_FIELDS_AFFL_TRACKER_ID, NULL);
			_data_->_tmp34_ = NULL;
			_data_->_tmp34_ = g_strdup (_data_->_tmp33_);
			_data_->_tmp35_ = _data_->_tmp34_;
			trf_affl_info_set_affl_tracker_id (_data_->_tmp31_, _data_->_tmp35_);
			_g_free0 (_data_->_tmp35_);
			_data_->_tmp36_ = _data_->affl_info;
			_data_->_tmp37_ = _data_->cursor;
			_data_->_tmp38_ = NULL;
			_data_->_tmp38_ = tracker_sparql_cursor_get_string (_data_->_tmp37_, (gint) TRF_AFFL_INFO_FIELDS_AFFL_ROLE, NULL);
			_data_->_tmp39_ = NULL;
			_data_->_tmp39_ = g_strdup (_data_->_tmp38_);
			_data_->_tmp40_ = _data_->_tmp39_;
			trf_affl_info_set_role (_data_->_tmp36_, _data_->_tmp40_);
			_g_free0 (_data_->_tmp40_);
			_data_->_tmp41_ = _data_->affl_info;
			_data_->_tmp42_ = _data_->cursor;
			_data_->_tmp43_ = NULL;
			_data_->_tmp43_ = tracker_sparql_cursor_get_string (_data_->_tmp42_, (gint) TRF_AFFL_INFO_FIELDS_AFFL_ORG, NULL);
			_data_->_tmp44_ = NULL;
			_data_->_tmp44_ = g_strdup (_data_->_tmp43_);
			_data_->_tmp45_ = _data_->_tmp44_;
			trf_affl_info_set_org (_data_->_tmp41_, _data_->_tmp45_);
			_g_free0 (_data_->_tmp45_);
			_data_->_tmp46_ = _data_->affl_info;
			_data_->_tmp47_ = _data_->cursor;
			_data_->_tmp48_ = NULL;
			_data_->_tmp48_ = tracker_sparql_cursor_get_string (_data_->_tmp47_, (gint) TRF_AFFL_INFO_FIELDS_AFFL_TITLE, NULL);
			_data_->_tmp49_ = NULL;
			_data_->_tmp49_ = g_strdup (_data_->_tmp48_);
			_data_->_tmp50_ = _data_->_tmp49_;
			trf_affl_info_set_title (_data_->_tmp46_, _data_->_tmp50_);
			_g_free0 (_data_->_tmp50_);
			_data_->_tmp51_ = _data_->cursor;
			_data_->_tmp52_ = NULL;
			_data_->_tmp52_ = tracker_sparql_cursor_get_string (_data_->_tmp51_, (gint) TRF_AFFL_INFO_FIELDS_AFFL_POBOX, NULL);
			_data_->_tmp53_ = NULL;
			_data_->_tmp53_ = g_strdup (_data_->_tmp52_);
			_data_->po_box = _data_->_tmp53_;
			_data_->_tmp54_ = _data_->cursor;
			_data_->_tmp55_ = NULL;
			_data_->_tmp55_ = tracker_sparql_cursor_get_string (_data_->_tmp54_, (gint) TRF_AFFL_INFO_FIELDS_AFFL_EXTENDED_ADDRESS, NULL);
			_data_->_tmp56_ = NULL;
			_data_->_tmp56_ = g_strdup (_data_->_tmp55_);
			_data_->extension = _data_->_tmp56_;
			_data_->_tmp57_ = _data_->cursor;
			_data_->_tmp58_ = NULL;
			_data_->_tmp58_ = tracker_sparql_cursor_get_string (_data_->_tmp57_, (gint) TRF_AFFL_INFO_FIELDS_AFFL_STREET_ADDRESS, NULL);
			_data_->_tmp59_ = NULL;
			_data_->_tmp59_ = g_strdup (_data_->_tmp58_);
			_data_->street = _data_->_tmp59_;
			_data_->_tmp60_ = _data_->cursor;
			_data_->_tmp61_ = NULL;
			_data_->_tmp61_ = tracker_sparql_cursor_get_string (_data_->_tmp60_, (gint) TRF_AFFL_INFO_FIELDS_AFFL_LOCALITY, NULL);
			_data_->_tmp62_ = NULL;
			_data_->_tmp62_ = g_strdup (_data_->_tmp61_);
			_data_->locality = _data_->_tmp62_;
			_data_->_tmp63_ = _data_->cursor;
			_data_->_tmp64_ = NULL;
			_data_->_tmp64_ = tracker_sparql_cursor_get_string (_data_->_tmp63_, (gint) TRF_AFFL_INFO_FIELDS_AFFL_REGION, NULL);
			_data_->_tmp65_ = NULL;
			_data_->_tmp65_ = g_strdup (_data_->_tmp64_);
			_data_->region = _data_->_tmp65_;
			_data_->_tmp66_ = _data_->cursor;
			_data_->_tmp67_ = NULL;
			_data_->_tmp67_ = tracker_sparql_cursor_get_string (_data_->_tmp66_, (gint) TRF_AFFL_INFO_FIELDS_AFFL_POSTALCODE, NULL);
			_data_->_tmp68_ = NULL;
			_data_->_tmp68_ = g_strdup (_data_->_tmp67_);
			_data_->postal_code = _data_->_tmp68_;
			_data_->_tmp69_ = _data_->cursor;
			_data_->_tmp70_ = NULL;
			_data_->_tmp70_ = tracker_sparql_cursor_get_string (_data_->_tmp69_, (gint) TRF_AFFL_INFO_FIELDS_AFFL_COUNTRY, NULL);
			_data_->_tmp71_ = NULL;
			_data_->_tmp71_ = g_strdup (_data_->_tmp70_);
			_data_->country = _data_->_tmp71_;
			_data_->_tmp72_ = _data_->po_box;
			_data_->_tmp73_ = _data_->extension;
			_data_->_tmp74_ = _data_->street;
			_data_->_tmp75_ = _data_->locality;
			_data_->_tmp76_ = _data_->region;
			_data_->_tmp77_ = _data_->postal_code;
			_data_->_tmp78_ = _data_->country;
			_data_->_tmp79_ = _data_->affl_info;
			_data_->_tmp80_ = trf_affl_info_get_affl_tracker_id (_data_->_tmp79_);
			_data_->_tmp81_ = _data_->_tmp80_;
			_data_->_tmp82_ = folks_postal_address_new (_data_->_tmp72_, _data_->_tmp73_, _data_->_tmp74_, _data_->_tmp75_, _data_->_tmp76_, _data_->_tmp77_, _data_->_tmp78_, NULL, _data_->_tmp81_);
			_data_->postal_address = _data_->_tmp82_;
			_data_->_tmp83_ = _data_->affl_info;
			_data_->_tmp84_ = _data_->postal_address;
			_data_->_tmp85_ = folks_postal_address_field_details_new (_data_->_tmp84_, NULL);
			_g_object_unref0 (_data_->_tmp83_->postal_address_fd);
			_data_->_tmp83_->postal_address_fd = _data_->_tmp85_;
			_data_->_tmp86_ = _data_->affl_info;
			_data_->_tmp87_ = _data_->cursor;
			_data_->_tmp88_ = NULL;
			_data_->_tmp88_ = tracker_sparql_cursor_get_string (_data_->_tmp87_, (gint) TRF_AFFL_INFO_FIELDS_AFFL_EMAIL, NULL);
			_data_->_tmp89_ = NULL;
			_data_->_tmp89_ = g_strdup (_data_->_tmp88_);
			_data_->_tmp90_ = _data_->_tmp89_;
			trf_affl_info_set_email (_data_->_tmp86_, _data_->_tmp90_);
			_g_free0 (_data_->_tmp90_);
			_data_->_tmp91_ = _data_->affl_info;
			_data_->_tmp92_ = _data_->cursor;
			_data_->_tmp93_ = NULL;
			_data_->_tmp93_ = tracker_sparql_cursor_get_string (_data_->_tmp92_, (gint) TRF_AFFL_INFO_FIELDS_AFFL_PHONE, NULL);
			_data_->_tmp94_ = NULL;
			_data_->_tmp94_ = g_strdup (_data_->_tmp93_);
			_data_->_tmp95_ = _data_->_tmp94_;
			trf_affl_info_set_phone (_data_->_tmp91_, _data_->_tmp95_);
			_g_free0 (_data_->_tmp95_);
			_data_->_tmp96_ = _data_->affl_info;
			_data_->_tmp97_ = _data_->cursor;
			_data_->_tmp98_ = NULL;
			_data_->_tmp98_ = tracker_sparql_cursor_get_string (_data_->_tmp97_, (gint) TRF_AFFL_INFO_FIELDS_AFFL_WEBSITE, NULL);
			_data_->_tmp99_ = NULL;
			_data_->_tmp99_ = g_strdup (_data_->_tmp98_);
			_data_->_tmp100_ = _data_->_tmp99_;
			trf_affl_info_set_website (_data_->_tmp96_, _data_->_tmp100_);
			_g_free0 (_data_->_tmp100_);
			_data_->_tmp101_ = _data_->affl_info;
			_data_->_tmp102_ = _data_->cursor;
			_data_->_tmp103_ = NULL;
			_data_->_tmp103_ = tracker_sparql_cursor_get_string (_data_->_tmp102_, (gint) TRF_AFFL_INFO_FIELDS_AFFL_BLOG, NULL);
			_data_->_tmp104_ = NULL;
			_data_->_tmp104_ = g_strdup (_data_->_tmp103_);
			_data_->_tmp105_ = _data_->_tmp104_;
			trf_affl_info_set_blog (_data_->_tmp101_, _data_->_tmp105_);
			_g_free0 (_data_->_tmp105_);
			_data_->_tmp106_ = _data_->affl_info;
			_data_->_tmp107_ = _data_->cursor;
			_data_->_tmp108_ = NULL;
			_data_->_tmp108_ = tracker_sparql_cursor_get_string (_data_->_tmp107_, (gint) TRF_AFFL_INFO_FIELDS_AFFL_URL, NULL);
			_data_->_tmp109_ = NULL;
			_data_->_tmp109_ = g_strdup (_data_->_tmp108_);
			_data_->_tmp110_ = _data_->_tmp109_;
			trf_affl_info_set_url (_data_->_tmp106_, _data_->_tmp110_);
			_g_free0 (_data_->_tmp110_);
			_g_object_unref0 (_data_->postal_address);
			_g_free0 (_data_->country);
			_g_free0 (_data_->postal_code);
			_g_free0 (_data_->region);
			_g_free0 (_data_->locality);
			_g_free0 (_data_->street);
			_g_free0 (_data_->extension);
			_g_free0 (_data_->po_box);
		}
		_g_object_unref0 (_data_->cursor);
	}
	goto __finally8;
	__catch8_tracker_sparql_error:
	{
		_data_->e1 = _data_->_inner_error_;
		_data_->_inner_error_ = NULL;
		_data_->_tmp111_ = _data_->query;
		_data_->_tmp112_ = _data_->e1;
		_data_->_tmp113_ = _data_->_tmp112_->message;
		g_warning ("trf-persona-store.vala:1797: Couldn't fetch affiliation info: %s %s", _data_->_tmp111_, _data_->_tmp113_);
		_g_error_free0 (_data_->e1);
	}
	goto __finally8;
	__catch8_g_error:
	{
		_data_->e2 = _data_->_inner_error_;
		_data_->_inner_error_ = NULL;
		_data_->_tmp114_ = _data_->query;
		_data_->_tmp115_ = _data_->e2;
		_data_->_tmp116_ = _data_->_tmp115_->message;
		g_warning ("trf-persona-store.vala:1802: Couldn't fetch affiliation info: %s %s", _data_->_tmp114_, _data_->_tmp116_);
		_g_error_free0 (_data_->e2);
	}
	__finally8:
	if (_data_->_inner_error_ != NULL) {
		_g_free0 (_data_->query);
		_g_object_unref0 (_data_->affl_info);
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
		g_clear_error (&_data_->_inner_error_);
		return FALSE;
	}
	_data_->result = _data_->affl_info;
	_g_free0 (_data_->query);
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
	_g_free0 (_data_->query);
	_g_object_unref0 (_data_->affl_info);
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


static void _trf_persona_store_insert_persona_data_free (gpointer _data) {
	TrfPersonaStoreInsertPersonaData* _data_;
	_data_ = _data;
	_g_free0 (_data_->query);
	_g_free0 (_data_->persona_var);
	_g_free0 (_data_->result);
	_g_object_unref0 (_data_->self);
	g_slice_free (TrfPersonaStoreInsertPersonaData, _data_);
}


static void _trf_persona_store_insert_persona (TrfPersonaStore* self, const gchar* query, const gchar* persona_var, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	TrfPersonaStoreInsertPersonaData* _data_;
	TrfPersonaStore* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	const gchar* _tmp3_;
	const gchar* _tmp4_;
	_data_ = g_slice_new0 (TrfPersonaStoreInsertPersonaData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, _trf_persona_store_insert_persona);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, _trf_persona_store_insert_persona_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = query;
	_tmp2_ = g_strdup (_tmp1_);
	_data_->query = _tmp2_;
	_tmp3_ = persona_var;
	_tmp4_ = g_strdup (_tmp3_);
	_data_->persona_var = _tmp4_;
	_trf_persona_store_insert_persona_co (_data_);
}


static gchar* _trf_persona_store_insert_persona_finish (TrfPersonaStore* self, GAsyncResult* _res_) {
	gchar* result;
	TrfPersonaStoreInsertPersonaData* _data_;
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
	result = _data_->result;
	_data_->result = NULL;
	return result;
}


static void _trf_persona_store_insert_persona_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	TrfPersonaStoreInsertPersonaData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	_trf_persona_store_insert_persona_co (_data_);
}


static gboolean _trf_persona_store_insert_persona_co (TrfPersonaStoreInsertPersonaData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->contact_urn = NULL;
	{
		_data_->_tmp0_ = _data_->query;
		g_debug ("trf-persona-store.vala:1816: _insert_persona: %s", _data_->_tmp0_);
		_data_->_tmp1_ = _data_->self->priv->_connection;
		_data_->_tmp2_ = _data_->query;
		_data_->_state_ = 1;
		tracker_sparql_connection_update_blank_async (_data_->_tmp1_, _data_->_tmp2_, G_PRIORITY_DEFAULT, NULL, _trf_persona_store_insert_persona_ready, _data_);
		return FALSE;
		_state_1:
		_data_->_tmp3_ = NULL;
		_data_->_tmp3_ = tracker_sparql_connection_update_blank_finish (_data_->_tmp1_, _data_->_res_, &_data_->_inner_error_);
		_data_->_tmp4_ = _data_->_tmp3_;
		if (_data_->_inner_error_ != NULL) {
			goto __catch9_g_error;
		}
		_g_variant_unref0 (_data_->variant);
		_data_->variant = _data_->_tmp4_;
		_data_->anon_var = NULL;
		_data_->_tmp5_ = _data_->variant;
		_data_->_tmp6_ = NULL;
		_data_->_tmp6_ = g_variant_iter_new (_data_->_tmp5_);
		_g_variant_iter_free0 (_data_->iter1);
		_data_->iter1 = _data_->_tmp6_;
		while (TRUE) {
			_data_->_tmp7_ = _data_->iter1;
			_data_->_tmp8_ = FALSE;
			_data_->_tmp8_ = g_variant_iter_next (_data_->_tmp7_, "aa{ss}", &_data_->iter2, NULL);
			if (!_data_->_tmp8_) {
				break;
			}
			_data_->_tmp9_ = _data_->iter2;
			if (_data_->_tmp9_ == NULL) {
				continue;
			}
			while (TRUE) {
				_data_->_tmp10_ = _data_->iter2;
				_data_->_tmp11_ = FALSE;
				_data_->_tmp11_ = g_variant_iter_next (_data_->_tmp10_, "a{ss}", &_data_->iter3, NULL);
				if (!_data_->_tmp11_) {
					break;
				}
				_data_->_tmp12_ = _data_->iter3;
				if (_data_->_tmp12_ == NULL) {
					continue;
				}
				while (TRUE) {
					_data_->_tmp13_ = _data_->iter3;
					_data_->_tmp14_ = FALSE;
					_data_->_tmp14_ = g_variant_iter_next (_data_->_tmp13_, "{ss}", &_data_->anon_var, &_data_->contact_urn, NULL);
					if (!_data_->_tmp14_) {
						break;
					}
					_data_->_tmp15_ = _data_->anon_var;
					_data_->_tmp16_ = _data_->persona_var;
					if (g_strcmp0 (_data_->_tmp15_, _data_->_tmp16_) == 0) {
						_data_->result = _data_->contact_urn;
						_g_free0 (_data_->anon_var);
						_g_variant_iter_free0 (_data_->iter3);
						_g_variant_iter_free0 (_data_->iter2);
						_g_variant_iter_free0 (_data_->iter1);
						_g_variant_unref0 (_data_->variant);
						if (_data_->_state_ == 0) {
							g_simple_async_result_complete_in_idle (_data_->_async_result);
						} else {
							g_simple_async_result_complete (_data_->_async_result);
						}
						g_object_unref (_data_->_async_result);
						return FALSE;
					}
				}
			}
		}
		_g_free0 (_data_->anon_var);
		_g_variant_iter_free0 (_data_->iter3);
		_g_variant_iter_free0 (_data_->iter2);
		_g_variant_iter_free0 (_data_->iter1);
	}
	goto __finally9;
	__catch9_g_error:
	{
		_data_->e = _data_->_inner_error_;
		_data_->_inner_error_ = NULL;
		_g_free0 (_data_->contact_urn);
		_data_->contact_urn = NULL;
		_data_->_tmp17_ = _data_->e;
		_data_->_tmp18_ = _data_->_tmp17_->message;
		g_warning ("trf-persona-store.vala:1849: Couldn't insert nco:PersonContact: %s", _data_->_tmp18_);
		_g_error_free0 (_data_->e);
	}
	__finally9:
	if (_data_->_inner_error_ != NULL) {
		_g_free0 (_data_->contact_urn);
		_g_variant_unref0 (_data_->variant);
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
		g_clear_error (&_data_->_inner_error_);
		return FALSE;
	}
	_data_->result = NULL;
	_g_free0 (_data_->contact_urn);
	_g_variant_unref0 (_data_->variant);
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
	_g_free0 (_data_->contact_urn);
	_g_variant_unref0 (_data_->variant);
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


static void _trf_persona_store_single_value_query_data_free (gpointer _data) {
	TrfPersonaStoreSingleValueQueryData* _data_;
	_data_ = _data;
	_g_free0 (_data_->query);
	_g_free0 (_data_->result);
	_g_object_unref0 (_data_->self);
	g_slice_free (TrfPersonaStoreSingleValueQueryData, _data_);
}


static void _trf_persona_store_single_value_query (TrfPersonaStore* self, const gchar* query, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	TrfPersonaStoreSingleValueQueryData* _data_;
	TrfPersonaStore* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	_data_ = g_slice_new0 (TrfPersonaStoreSingleValueQueryData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, _trf_persona_store_single_value_query);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, _trf_persona_store_single_value_query_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = query;
	_tmp2_ = g_strdup (_tmp1_);
	_data_->query = _tmp2_;
	_trf_persona_store_single_value_query_co (_data_);
}


static gchar* _trf_persona_store_single_value_query_finish (TrfPersonaStore* self, GAsyncResult* _res_) {
	gchar* result;
	TrfPersonaStoreSingleValueQueryData* _data_;
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
	result = _data_->result;
	_data_->result = NULL;
	return result;
}


static void _trf_persona_store_single_value_query_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	TrfPersonaStoreSingleValueQueryData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	_trf_persona_store_single_value_query_co (_data_);
}


static gboolean _trf_persona_store_single_value_query_co (TrfPersonaStoreSingleValueQueryData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->query;
	_data_->_state_ = 1;
	_trf_persona_store_multi_value_query (_data_->self, _data_->_tmp0_, _trf_persona_store_single_value_query_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp1_ = NULL;
	_data_->_tmp1_ = _trf_persona_store_multi_value_query_finish (_data_->self, _data_->_res_);
	_data_->rows = _data_->_tmp1_;
	{
		_data_->_tmp2_ = _data_->rows;
		_data_->_tmp3_ = NULL;
		_data_->_tmp3_ = gee_abstract_collection_iterator ((GeeAbstractCollection*) _data_->_tmp2_);
		_data_->_r_it = _data_->_tmp3_;
		while (TRUE) {
			_data_->_tmp4_ = _data_->_r_it;
			_data_->_tmp5_ = FALSE;
			_data_->_tmp5_ = gee_iterator_next (_data_->_tmp4_);
			if (!_data_->_tmp5_) {
				break;
			}
			_data_->_tmp6_ = _data_->_r_it;
			_data_->_tmp7_ = NULL;
			_data_->_tmp7_ = gee_iterator_get (_data_->_tmp6_);
			_data_->r = (gchar*) _data_->_tmp7_;
			_data_->result = _data_->r;
			_g_object_unref0 (_data_->_r_it);
			_g_object_unref0 (_data_->rows);
			if (_data_->_state_ == 0) {
				g_simple_async_result_complete_in_idle (_data_->_async_result);
			} else {
				g_simple_async_result_complete (_data_->_async_result);
			}
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
		_g_object_unref0 (_data_->_r_it);
	}
	_data_->_tmp8_ = g_strdup ("");
	_data_->result = _data_->_tmp8_;
	_g_object_unref0 (_data_->rows);
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
	_g_object_unref0 (_data_->rows);
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


static void _trf_persona_store_multi_value_query_data_free (gpointer _data) {
	TrfPersonaStoreMultiValueQueryData* _data_;
	_data_ = _data;
	_g_free0 (_data_->query);
	_g_object_unref0 (_data_->result);
	_g_object_unref0 (_data_->self);
	g_slice_free (TrfPersonaStoreMultiValueQueryData, _data_);
}


static void _trf_persona_store_multi_value_query (TrfPersonaStore* self, const gchar* query, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	TrfPersonaStoreMultiValueQueryData* _data_;
	TrfPersonaStore* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	_data_ = g_slice_new0 (TrfPersonaStoreMultiValueQueryData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, _trf_persona_store_multi_value_query);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, _trf_persona_store_multi_value_query_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = query;
	_tmp2_ = g_strdup (_tmp1_);
	_data_->query = _tmp2_;
	_trf_persona_store_multi_value_query_co (_data_);
}


static GeeHashSet* _trf_persona_store_multi_value_query_finish (TrfPersonaStore* self, GAsyncResult* _res_) {
	GeeHashSet* result;
	TrfPersonaStoreMultiValueQueryData* _data_;
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
	result = _data_->result;
	_data_->result = NULL;
	return result;
}


static void _trf_persona_store_multi_value_query_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	TrfPersonaStoreMultiValueQueryData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	_trf_persona_store_multi_value_query_co (_data_);
}


static gboolean _trf_persona_store_multi_value_query_co (TrfPersonaStoreMultiValueQueryData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = gee_hash_set_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL, NULL);
	_data_->ret = _data_->_tmp0_;
	_data_->_tmp1_ = _data_->query;
	g_debug ("trf-persona-store.vala:1869: [_multi_value_query] %s", _data_->_tmp1_);
	{
		_data_->_tmp2_ = _data_->self->priv->_connection;
		_data_->_tmp3_ = _data_->query;
		_data_->_state_ = 1;
		tracker_sparql_connection_query_async (_data_->_tmp2_, _data_->_tmp3_, NULL, _trf_persona_store_multi_value_query_ready, _data_);
		return FALSE;
		_state_1:
		_data_->_tmp4_ = NULL;
		_data_->_tmp4_ = tracker_sparql_connection_query_finish (_data_->_tmp2_, _data_->_res_, &_data_->_inner_error_);
		_data_->cursor = _data_->_tmp4_;
		if (_data_->_inner_error_ != NULL) {
			if (_data_->_inner_error_->domain == TRACKER_SPARQL_ERROR) {
				goto __catch10_tracker_sparql_error;
			}
			goto __catch10_g_error;
		}
		while (TRUE) {
			_data_->_tmp5_ = _data_->cursor;
			_data_->_tmp6_ = FALSE;
			_data_->_tmp6_ = tracker_sparql_cursor_next (_data_->_tmp5_, NULL, &_data_->_inner_error_);
			_data_->_tmp7_ = _data_->_tmp6_;
			if (_data_->_inner_error_ != NULL) {
				_g_object_unref0 (_data_->cursor);
				if (_data_->_inner_error_->domain == TRACKER_SPARQL_ERROR) {
					goto __catch10_tracker_sparql_error;
				}
				goto __catch10_g_error;
			}
			if (!_data_->_tmp7_) {
				break;
			}
			_data_->_tmp8_ = _data_->cursor;
			_data_->_tmp9_ = NULL;
			_data_->_tmp9_ = tracker_sparql_cursor_get_string (_data_->_tmp8_, 0, NULL);
			_data_->_tmp10_ = g_strdup (_data_->_tmp9_);
			_data_->prop = _data_->_tmp10_;
			_data_->_tmp11_ = _data_->prop;
			if (_data_->_tmp11_ != NULL) {
				_data_->_tmp12_ = _data_->ret;
				_data_->_tmp13_ = _data_->prop;
				gee_abstract_collection_add ((GeeAbstractCollection*) _data_->_tmp12_, _data_->_tmp13_);
			}
			_g_free0 (_data_->prop);
		}
		_g_object_unref0 (_data_->cursor);
	}
	goto __finally10;
	__catch10_tracker_sparql_error:
	{
		_data_->e1 = _data_->_inner_error_;
		_data_->_inner_error_ = NULL;
		_data_->_tmp14_ = _data_->query;
		_data_->_tmp15_ = _data_->e1;
		_data_->_tmp16_ = _data_->_tmp15_->message;
		g_warning ("trf-persona-store.vala:1883: Couldn't run query: %s %s", _data_->_tmp14_, _data_->_tmp16_);
		_g_error_free0 (_data_->e1);
	}
	goto __finally10;
	__catch10_g_error:
	{
		_data_->e2 = _data_->_inner_error_;
		_data_->_inner_error_ = NULL;
		_data_->_tmp17_ = _data_->query;
		_data_->_tmp18_ = _data_->e2;
		_data_->_tmp19_ = _data_->_tmp18_->message;
		g_warning ("trf-persona-store.vala:1887: Couldn't run query: %s %s", _data_->_tmp17_, _data_->_tmp19_);
		_g_error_free0 (_data_->e2);
	}
	__finally10:
	if (_data_->_inner_error_ != NULL) {
		_g_object_unref0 (_data_->ret);
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
		g_clear_error (&_data_->_inner_error_);
		return FALSE;
	}
	_data_->result = _data_->ret;
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
	_g_object_unref0 (_data_->ret);
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


static void _trf_persona_store_urn_from_tracker_id_data_free (gpointer _data) {
	TrfPersonaStoreUrnFromTrackerIdData* _data_;
	_data_ = _data;
	_g_free0 (_data_->tracker_id);
	_g_free0 (_data_->result);
	_g_object_unref0 (_data_->self);
	g_slice_free (TrfPersonaStoreUrnFromTrackerIdData, _data_);
}


static void _trf_persona_store_urn_from_tracker_id (TrfPersonaStore* self, const gchar* tracker_id, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	TrfPersonaStoreUrnFromTrackerIdData* _data_;
	TrfPersonaStore* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	_data_ = g_slice_new0 (TrfPersonaStoreUrnFromTrackerIdData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, _trf_persona_store_urn_from_tracker_id);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, _trf_persona_store_urn_from_tracker_id_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = tracker_id;
	_tmp2_ = g_strdup (_tmp1_);
	_data_->tracker_id = _tmp2_;
	_trf_persona_store_urn_from_tracker_id_co (_data_);
}


static gchar* _trf_persona_store_urn_from_tracker_id_finish (TrfPersonaStore* self, GAsyncResult* _res_) {
	gchar* result;
	TrfPersonaStoreUrnFromTrackerIdData* _data_;
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
	result = _data_->result;
	_data_->result = NULL;
	return result;
}


static void _trf_persona_store_urn_from_tracker_id_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	TrfPersonaStoreUrnFromTrackerIdData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	_trf_persona_store_urn_from_tracker_id_co (_data_);
}


static gboolean _trf_persona_store_urn_from_tracker_id_co (TrfPersonaStoreUrnFromTrackerIdData* _data_) {
	static const char query[] = "SELECT fn:concat('<', tracker:uri(%s), '>') " "WHERE {}";
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->tracker_id;
	_data_->_tmp1_ = NULL;
	_data_->_tmp1_ = g_strdup_printf (query, _data_->_tmp0_);
	_data_->_tmp2_ = _data_->_tmp1_;
	_data_->_state_ = 1;
	_trf_persona_store_single_value_query (_data_->self, _data_->_tmp2_, _trf_persona_store_urn_from_tracker_id_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp3_ = NULL;
	_data_->_tmp3_ = _trf_persona_store_single_value_query_finish (_data_->self, _data_->_res_);
	_data_->_tmp4_ = _data_->_tmp3_;
	_g_free0 (_data_->_tmp2_);
	_data_->result = _data_->_tmp4_;
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


static void _trf_persona_store_set_nickname_data_free (gpointer _data) {
	TrfPersonaStoreSetNicknameData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->persona);
	_g_free0 (_data_->nickname);
	_g_object_unref0 (_data_->self);
	g_slice_free (TrfPersonaStoreSetNicknameData, _data_);
}


void _trf_persona_store_set_nickname (TrfPersonaStore* self, TrfPersona* persona, const gchar* nickname, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	TrfPersonaStoreSetNicknameData* _data_;
	TrfPersonaStore* _tmp0_;
	TrfPersona* _tmp1_;
	TrfPersona* _tmp2_;
	const gchar* _tmp3_;
	const gchar* _tmp4_;
	_data_ = g_slice_new0 (TrfPersonaStoreSetNicknameData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, _trf_persona_store_set_nickname);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, _trf_persona_store_set_nickname_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = persona;
	_tmp2_ = _g_object_ref0 (_tmp1_);
	_data_->persona = _tmp2_;
	_tmp3_ = nickname;
	_tmp4_ = g_strdup (_tmp3_);
	_data_->nickname = _tmp4_;
	_trf_persona_store_set_nickname_co (_data_);
}


void _trf_persona_store_set_nickname_finish (TrfPersonaStore* self, GAsyncResult* _res_) {
	TrfPersonaStoreSetNicknameData* _data_;
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
}


static void _trf_persona_store_set_nickname_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	TrfPersonaStoreSetNicknameData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	_trf_persona_store_set_nickname_co (_data_);
}


static gboolean _trf_persona_store_set_nickname_co (TrfPersonaStoreSetNicknameData* _data_) {
	static const char query_t[] = "DELETE { " " ?p " TRF_ONTOLOGY_DEFS_NCO_NICKNAME " ?n  " "} " "WHERE { " " ?p a " TRF_ONTOLOGY_DEFS_NCO_PERSON " ; " TRF_ONTOLOGY_DEFS_NCO_NICKNAME " ?n . " " FILTER(tracker:id(?p) = %s) " "} " "INSERT { " " ?p " TRF_ONTOLOGY_DEFS_NCO_NICKNAME " '%s' " "} " "WHERE { " " ?p a " TRF_ONTOLOGY_DEFS_NCO_PERSON " . " "FILTER (tracker:id(?p) = %s) " "} ";
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->persona;
	_data_->_tmp1_ = NULL;
	_data_->_tmp1_ = trf_persona_tracker_id (_data_->_tmp0_);
	_data_->_tmp2_ = _data_->_tmp1_;
	_data_->_tmp3_ = _data_->nickname;
	_data_->_tmp4_ = _data_->persona;
	_data_->_tmp5_ = NULL;
	_data_->_tmp5_ = trf_persona_tracker_id (_data_->_tmp4_);
	_data_->_tmp6_ = _data_->_tmp5_;
	_data_->_tmp7_ = NULL;
	_data_->_tmp7_ = g_strdup_printf (query_t, _data_->_tmp2_, _data_->_tmp3_, _data_->_tmp6_);
	_data_->_tmp8_ = _data_->_tmp7_;
	_g_free0 (_data_->_tmp6_);
	_g_free0 (_data_->_tmp2_);
	_data_->query = _data_->_tmp8_;
	_data_->_state_ = 1;
	_trf_persona_store_tracker_update (_data_->self, _data_->query, "change_nickname", _trf_persona_store_set_nickname_ready, _data_);
	return FALSE;
	_state_1:
	_trf_persona_store_tracker_update_finish (_data_->self, _data_->_res_);
	_g_free0 (_data_->query);
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


static void _trf_persona_store_set_local_ids_data_free (gpointer _data) {
	TrfPersonaStoreSetLocalIdsData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->persona);
	_g_object_unref0 (_data_->local_ids);
	_g_object_unref0 (_data_->self);
	g_slice_free (TrfPersonaStoreSetLocalIdsData, _data_);
}


void _trf_persona_store_set_local_ids (TrfPersonaStore* self, TrfPersona* persona, GeeSet* local_ids, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	TrfPersonaStoreSetLocalIdsData* _data_;
	TrfPersonaStore* _tmp0_;
	TrfPersona* _tmp1_;
	TrfPersona* _tmp2_;
	GeeSet* _tmp3_;
	GeeSet* _tmp4_;
	_data_ = g_slice_new0 (TrfPersonaStoreSetLocalIdsData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, _trf_persona_store_set_local_ids);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, _trf_persona_store_set_local_ids_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = persona;
	_tmp2_ = _g_object_ref0 (_tmp1_);
	_data_->persona = _tmp2_;
	_tmp3_ = local_ids;
	_tmp4_ = _g_object_ref0 (_tmp3_);
	_data_->local_ids = _tmp4_;
	_trf_persona_store_set_local_ids_co (_data_);
}


void _trf_persona_store_set_local_ids_finish (TrfPersonaStore* self, GAsyncResult* _res_) {
	TrfPersonaStoreSetLocalIdsData* _data_;
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
}


static void _trf_persona_store_set_local_ids_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	TrfPersonaStoreSetLocalIdsData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	_trf_persona_store_set_local_ids_co (_data_);
}


static gboolean _trf_persona_store_set_local_ids_co (TrfPersonaStoreSetLocalIdsData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->local_ids;
	_data_->_tmp1_ = NULL;
	_data_->_tmp1_ = trf_persona_store_serialize_local_ids (_data_->_tmp0_);
	_data_->ids = _data_->_tmp1_;
	_data_->_tmp2_ = _data_->persona;
	_data_->_state_ = 1;
	_trf_persona_store_set_tracker_property (_data_->self, _data_->_tmp2_, TRF_PERSONA_STORE__LOCAL_ID_PROPERTY_NAME, _data_->ids, "_set_local_ids", _trf_persona_store_set_local_ids_ready, _data_);
	return FALSE;
	_state_1:
	_trf_persona_store_set_tracker_property_finish (_data_->self, _data_->_res_);
	_g_free0 (_data_->ids);
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


static void _trf_persona_store_set_web_service_addrs_data_free (gpointer _data) {
	TrfPersonaStoreSetWebServiceAddrsData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->persona);
	_g_object_unref0 (_data_->ws_obj);
	_g_object_unref0 (_data_->self);
	g_slice_free (TrfPersonaStoreSetWebServiceAddrsData, _data_);
}


void _trf_persona_store_set_web_service_addrs (TrfPersonaStore* self, TrfPersona* persona, GeeMultiMap* ws_obj, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	TrfPersonaStoreSetWebServiceAddrsData* _data_;
	TrfPersonaStore* _tmp0_;
	TrfPersona* _tmp1_;
	TrfPersona* _tmp2_;
	GeeMultiMap* _tmp3_;
	GeeMultiMap* _tmp4_;
	_data_ = g_slice_new0 (TrfPersonaStoreSetWebServiceAddrsData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, _trf_persona_store_set_web_service_addrs);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, _trf_persona_store_set_web_service_addrs_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = persona;
	_tmp2_ = _g_object_ref0 (_tmp1_);
	_data_->persona = _tmp2_;
	_tmp3_ = ws_obj;
	_tmp4_ = _g_object_ref0 (_tmp3_);
	_data_->ws_obj = _tmp4_;
	_trf_persona_store_set_web_service_addrs_co (_data_);
}


void _trf_persona_store_set_web_service_addrs_finish (TrfPersonaStore* self, GAsyncResult* _res_) {
	TrfPersonaStoreSetWebServiceAddrsData* _data_;
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
}


static void _trf_persona_store_set_web_service_addrs_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	TrfPersonaStoreSetWebServiceAddrsData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	_trf_persona_store_set_web_service_addrs_co (_data_);
}


static gboolean _trf_persona_store_set_web_service_addrs_co (TrfPersonaStoreSetWebServiceAddrsData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->ws_obj;
	_data_->_tmp1_ = NULL;
	_data_->_tmp1_ = trf_persona_store_serialize_web_services (_data_->_tmp0_);
	_data_->ws_addrs = _data_->_tmp1_;
	_data_->_tmp2_ = _data_->persona;
	_data_->_state_ = 1;
	_trf_persona_store_set_tracker_property (_data_->self, _data_->_tmp2_, TRF_PERSONA_STORE__WSD_PROPERTY_NAME, _data_->ws_addrs, "_set_web_service_addrs", _trf_persona_store_set_web_service_addrs_ready, _data_);
	return FALSE;
	_state_1:
	_trf_persona_store_set_tracker_property_finish (_data_->self, _data_->_res_);
	_g_free0 (_data_->ws_addrs);
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


static void _trf_persona_store_set_tracker_property_data_free (gpointer _data) {
	TrfPersonaStoreSetTrackerPropertyData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->persona);
	_g_free0 (_data_->prop_name);
	_g_free0 (_data_->prop_value);
	_g_free0 (_data_->callers_name);
	_g_object_unref0 (_data_->self);
	g_slice_free (TrfPersonaStoreSetTrackerPropertyData, _data_);
}


static void _trf_persona_store_set_tracker_property (TrfPersonaStore* self, TrfPersona* persona, const gchar* prop_name, const gchar* prop_value, const gchar* callers_name, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	TrfPersonaStoreSetTrackerPropertyData* _data_;
	TrfPersonaStore* _tmp0_;
	TrfPersona* _tmp1_;
	TrfPersona* _tmp2_;
	const gchar* _tmp3_;
	const gchar* _tmp4_;
	const gchar* _tmp5_;
	const gchar* _tmp6_;
	const gchar* _tmp7_;
	const gchar* _tmp8_;
	_data_ = g_slice_new0 (TrfPersonaStoreSetTrackerPropertyData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, _trf_persona_store_set_tracker_property);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, _trf_persona_store_set_tracker_property_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = persona;
	_tmp2_ = _g_object_ref0 (_tmp1_);
	_data_->persona = _tmp2_;
	_tmp3_ = prop_name;
	_tmp4_ = g_strdup (_tmp3_);
	_data_->prop_name = _tmp4_;
	_tmp5_ = prop_value;
	_tmp6_ = g_strdup (_tmp5_);
	_data_->prop_value = _tmp6_;
	_tmp7_ = callers_name;
	_tmp8_ = g_strdup (_tmp7_);
	_data_->callers_name = _tmp8_;
	_trf_persona_store_set_tracker_property_co (_data_);
}


static void _trf_persona_store_set_tracker_property_finish (TrfPersonaStore* self, GAsyncResult* _res_) {
	TrfPersonaStoreSetTrackerPropertyData* _data_;
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
}


static void _trf_persona_store_set_tracker_property_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	TrfPersonaStoreSetTrackerPropertyData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	_trf_persona_store_set_tracker_property_co (_data_);
}


static gboolean _trf_persona_store_set_tracker_property_co (TrfPersonaStoreSetTrackerPropertyData* _data_) {
	static const char query_t[] = "DELETE " " { ?p " TRF_ONTOLOGY_DEFS_NAO_HAS_PROPERTY " ?prop } " "WHERE { " " ?p a " TRF_ONTOLOGY_DEFS_NCO_PERSON " ; " TRF_ONTOLOGY_DEFS_NAO_HAS_PROPERTY " ?prop . " " ?prop " TRF_ONTOLOGY_DEFS_NAO_PROPERTY_NAME " ?prop_name . " " FILTER (tracker:id(?p) = %s && ?name = '%s' ) } " "INSERT { " " _:prop a " TRF_ONTOLOGY_DEFS_NAO_PROPERTY " ; " TRF_ONTOLOGY_DEFS_NAO_PROPERTY_NAME " '%s' ; " TRF_ONTOLOGY_DEFS_NAO_PROPERTY_VALUE " '%s' . " " ?p " TRF_ONTOLOGY_DEFS_NAO_HAS_PROPERTY " _:prop " "} " "WHERE { " " ?p a nco:PersonContact . " "FILTER (tracker:id(?p) = %s) } ";
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->persona;
	_data_->_tmp1_ = NULL;
	_data_->_tmp1_ = trf_persona_tracker_id (_data_->_tmp0_);
	_data_->_tmp2_ = _data_->_tmp1_;
	_data_->_tmp3_ = _data_->prop_name;
	_data_->_tmp4_ = _data_->prop_name;
	_data_->_tmp5_ = _data_->prop_value;
	_data_->_tmp6_ = _data_->persona;
	_data_->_tmp7_ = NULL;
	_data_->_tmp7_ = trf_persona_tracker_id (_data_->_tmp6_);
	_data_->_tmp8_ = _data_->_tmp7_;
	_data_->_tmp9_ = NULL;
	_data_->_tmp9_ = g_strdup_printf (query_t, _data_->_tmp2_, _data_->_tmp3_, _data_->_tmp4_, _data_->_tmp5_, _data_->_tmp8_);
	_data_->_tmp10_ = _data_->_tmp9_;
	_g_free0 (_data_->_tmp8_);
	_g_free0 (_data_->_tmp2_);
	_data_->query = _data_->_tmp10_;
	_data_->_tmp11_ = _data_->callers_name;
	_data_->_state_ = 1;
	_trf_persona_store_tracker_update (_data_->self, _data_->query, _data_->_tmp11_, _trf_persona_store_set_tracker_property_ready, _data_);
	return FALSE;
	_state_1:
	_trf_persona_store_tracker_update_finish (_data_->self, _data_->_res_);
	_g_free0 (_data_->query);
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


static void _trf_persona_store_set_is_favourite_data_free (gpointer _data) {
	TrfPersonaStoreSetIsFavouriteData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->persona);
	_g_object_unref0 (_data_->self);
	g_slice_free (TrfPersonaStoreSetIsFavouriteData, _data_);
}


void _trf_persona_store_set_is_favourite (TrfPersonaStore* self, FolksPersona* persona, gboolean is_favourite, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	TrfPersonaStoreSetIsFavouriteData* _data_;
	TrfPersonaStore* _tmp0_;
	FolksPersona* _tmp1_;
	FolksPersona* _tmp2_;
	gboolean _tmp3_;
	_data_ = g_slice_new0 (TrfPersonaStoreSetIsFavouriteData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, _trf_persona_store_set_is_favourite);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, _trf_persona_store_set_is_favourite_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = persona;
	_tmp2_ = _g_object_ref0 (_tmp1_);
	_data_->persona = _tmp2_;
	_tmp3_ = is_favourite;
	_data_->is_favourite = _tmp3_;
	_trf_persona_store_set_is_favourite_co (_data_);
}


void _trf_persona_store_set_is_favourite_finish (TrfPersonaStore* self, GAsyncResult* _res_) {
	TrfPersonaStoreSetIsFavouriteData* _data_;
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
}


static void _trf_persona_store_set_is_favourite_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	TrfPersonaStoreSetIsFavouriteData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	_trf_persona_store_set_is_favourite_co (_data_);
}


static gboolean _trf_persona_store_set_is_favourite_co (TrfPersonaStoreSetIsFavouriteData* _data_) {
	static const char ins_q[] = "INSERT { " " ?p " TRF_ONTOLOGY_DEFS_NAO_TAG " " TRF_ONTOLOGY_DEFS_NAO_FAVORITE "} " "WHERE { " " ?p a " TRF_ONTOLOGY_DEFS_NCO_PERSON " FILTER (tracker:id(?p) = %s) " "} ";
	static const char del_q[] = "DELETE { " " ?p " TRF_ONTOLOGY_DEFS_NAO_TAG " " TRF_ONTOLOGY_DEFS_NAO_FAVORITE " " "} " "WHERE { " " ?p a " TRF_ONTOLOGY_DEFS_NCO_PERSON " FILTER (tracker:id(?p) = %s) " "} ";
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->is_favourite;
	if (_data_->_tmp0_) {
		_data_->_tmp1_ = _data_->persona;
		_data_->_tmp2_ = NULL;
		_data_->_tmp2_ = trf_persona_tracker_id (TRF_PERSONA (_data_->_tmp1_));
		_data_->_tmp3_ = _data_->_tmp2_;
		_data_->_tmp4_ = NULL;
		_data_->_tmp4_ = g_strdup_printf (ins_q, _data_->_tmp3_);
		_g_free0 (_data_->query);
		_data_->query = _data_->_tmp4_;
		_g_free0 (_data_->_tmp3_);
	} else {
		_data_->_tmp5_ = _data_->persona;
		_data_->_tmp6_ = NULL;
		_data_->_tmp6_ = trf_persona_tracker_id (TRF_PERSONA (_data_->_tmp5_));
		_data_->_tmp7_ = _data_->_tmp6_;
		_data_->_tmp8_ = NULL;
		_data_->_tmp8_ = g_strdup_printf (del_q, _data_->_tmp7_);
		_g_free0 (_data_->query);
		_data_->query = _data_->_tmp8_;
		_g_free0 (_data_->_tmp7_);
	}
	_data_->_tmp9_ = _data_->query;
	_data_->_state_ = 1;
	_trf_persona_store_tracker_update (_data_->self, _data_->_tmp9_, "change_is_favourite", _trf_persona_store_set_is_favourite_ready, _data_);
	return FALSE;
	_state_1:
	_trf_persona_store_tracker_update_finish (_data_->self, _data_->_res_);
	_g_free0 (_data_->query);
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


static void _trf_persona_store_set_emails_data_free (gpointer _data) {
	TrfPersonaStoreSetEmailsData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->persona);
	_g_object_unref0 (_data_->emails);
	_g_object_unref0 (_data_->self);
	g_slice_free (TrfPersonaStoreSetEmailsData, _data_);
}


void _trf_persona_store_set_emails (TrfPersonaStore* self, FolksPersona* persona, GeeSet* emails, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	TrfPersonaStoreSetEmailsData* _data_;
	TrfPersonaStore* _tmp0_;
	FolksPersona* _tmp1_;
	FolksPersona* _tmp2_;
	GeeSet* _tmp3_;
	GeeSet* _tmp4_;
	_data_ = g_slice_new0 (TrfPersonaStoreSetEmailsData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, _trf_persona_store_set_emails);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, _trf_persona_store_set_emails_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = persona;
	_tmp2_ = _g_object_ref0 (_tmp1_);
	_data_->persona = _tmp2_;
	_tmp3_ = emails;
	_tmp4_ = _g_object_ref0 (_tmp3_);
	_data_->emails = _tmp4_;
	_trf_persona_store_set_emails_co (_data_);
}


void _trf_persona_store_set_emails_finish (TrfPersonaStore* self, GAsyncResult* _res_) {
	TrfPersonaStoreSetEmailsData* _data_;
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
}


static void _trf_persona_store_set_emails_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	TrfPersonaStoreSetEmailsData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	_trf_persona_store_set_emails_co (_data_);
}


static gboolean _trf_persona_store_set_emails_co (TrfPersonaStoreSetEmailsData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->persona;
	_data_->_tmp1_ = _data_->emails;
	_data_->_state_ = 1;
	_trf_persona_store_set_unique_attrib_set (_data_->self, _data_->_tmp0_, _data_->_tmp1_, TRF_ATTRIB_EMAILS, _trf_persona_store_set_emails_ready, _data_);
	return FALSE;
	_state_1:
	_trf_persona_store_set_unique_attrib_set_finish (_data_->self, _data_->_res_);
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


static void _trf_persona_store_set_phones_data_free (gpointer _data) {
	TrfPersonaStoreSetPhonesData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->persona);
	_g_object_unref0 (_data_->phone_numbers);
	_g_object_unref0 (_data_->self);
	g_slice_free (TrfPersonaStoreSetPhonesData, _data_);
}


void _trf_persona_store_set_phones (TrfPersonaStore* self, FolksPersona* persona, GeeSet* phone_numbers, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	TrfPersonaStoreSetPhonesData* _data_;
	TrfPersonaStore* _tmp0_;
	FolksPersona* _tmp1_;
	FolksPersona* _tmp2_;
	GeeSet* _tmp3_;
	GeeSet* _tmp4_;
	_data_ = g_slice_new0 (TrfPersonaStoreSetPhonesData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, _trf_persona_store_set_phones);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, _trf_persona_store_set_phones_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = persona;
	_tmp2_ = _g_object_ref0 (_tmp1_);
	_data_->persona = _tmp2_;
	_tmp3_ = phone_numbers;
	_tmp4_ = _g_object_ref0 (_tmp3_);
	_data_->phone_numbers = _tmp4_;
	_trf_persona_store_set_phones_co (_data_);
}


void _trf_persona_store_set_phones_finish (TrfPersonaStore* self, GAsyncResult* _res_) {
	TrfPersonaStoreSetPhonesData* _data_;
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
}


static void _trf_persona_store_set_phones_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	TrfPersonaStoreSetPhonesData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	_trf_persona_store_set_phones_co (_data_);
}


static gboolean _trf_persona_store_set_phones_co (TrfPersonaStoreSetPhonesData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->persona;
	_data_->_tmp1_ = _data_->phone_numbers;
	_data_->_state_ = 1;
	_trf_persona_store_set_unique_attrib_set (_data_->self, _data_->_tmp0_, _data_->_tmp1_, TRF_ATTRIB_PHONES, _trf_persona_store_set_phones_ready, _data_);
	return FALSE;
	_state_1:
	_trf_persona_store_set_unique_attrib_set_finish (_data_->self, _data_->_res_);
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


static void _trf_persona_store_set_unique_attrib_set_data_free (gpointer _data) {
	TrfPersonaStoreSetUniqueAttribSetData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->persona);
	_g_object_unref0 (_data_->properties);
	_g_object_unref0 (_data_->self);
	g_slice_free (TrfPersonaStoreSetUniqueAttribSetData, _data_);
}


void _trf_persona_store_set_unique_attrib_set (TrfPersonaStore* self, FolksPersona* persona, GeeSet* properties, TrfAttrib attrib, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	TrfPersonaStoreSetUniqueAttribSetData* _data_;
	TrfPersonaStore* _tmp0_;
	FolksPersona* _tmp1_;
	FolksPersona* _tmp2_;
	GeeSet* _tmp3_;
	GeeSet* _tmp4_;
	TrfAttrib _tmp5_;
	_data_ = g_slice_new0 (TrfPersonaStoreSetUniqueAttribSetData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, _trf_persona_store_set_unique_attrib_set);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, _trf_persona_store_set_unique_attrib_set_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = persona;
	_tmp2_ = _g_object_ref0 (_tmp1_);
	_data_->persona = _tmp2_;
	_tmp3_ = properties;
	_tmp4_ = _g_object_ref0 (_tmp3_);
	_data_->properties = _tmp4_;
	_tmp5_ = attrib;
	_data_->attrib = _tmp5_;
	_trf_persona_store_set_unique_attrib_set_co (_data_);
}


void _trf_persona_store_set_unique_attrib_set_finish (TrfPersonaStore* self, GAsyncResult* _res_) {
	TrfPersonaStoreSetUniqueAttribSetData* _data_;
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
}


static void _trf_persona_store_set_unique_attrib_set_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	TrfPersonaStoreSetUniqueAttribSetData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	_trf_persona_store_set_unique_attrib_set_co (_data_);
}


static gboolean _trf_persona_store_set_unique_attrib_set_co (TrfPersonaStoreSetUniqueAttribSetData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		case 2:
		goto _state_2;
		case 3:
		goto _state_3;
		case 4:
		goto _state_4;
		case 5:
		goto _state_5;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->query_name = NULL;
	_data_->_tmp0_ = _data_->persona;
	_data_->_tmp1_ = NULL;
	_data_->_tmp1_ = trf_persona_tracker_id (TRF_PERSONA (_data_->_tmp0_));
	_data_->p_id = _data_->_tmp1_;
	_data_->_tmp2_ = tracker_sparql_builder_new_update ();
	_data_->builder = _data_->_tmp2_;
	_data_->_tmp3_ = _data_->builder;
	tracker_sparql_builder_insert_open (_data_->_tmp3_, NULL);
	_data_->_tmp4_ = _data_->attrib;
	switch (_data_->_tmp4_) {
		case TRF_ATTRIB_PHONES:
		{
			_data_->_tmp5_ = g_strdup ("_set_phones");
			_g_free0 (_data_->query_name);
			_data_->query_name = _data_->_tmp5_;
			_data_->_tmp6_ = _data_->persona;
			_data_->_state_ = 1;
			_trf_persona_store_remove_attributes_from_persona (_data_->self, _data_->_tmp6_, _REMOVE_PHONES, _trf_persona_store_set_unique_attrib_set_ready, _data_);
			return FALSE;
			_state_1:
			_data_->_tmp7_ = NULL;
			_data_->_tmp7_ = _trf_persona_store_remove_attributes_from_persona_finish (_data_->self, _data_->_res_);
			_data_->_tmp8_ = _data_->_tmp7_;
			_g_free0 (_data_->_tmp8_);
			_data_->_tmp9_ = _data_->builder;
			_data_->_tmp10_ = _data_->properties;
			_data_->_state_ = 2;
			_trf_persona_store_build_update_query_set (_data_->self, _data_->_tmp9_, _data_->_tmp10_, "?contact", TRF_ATTRIB_PHONES, _trf_persona_store_set_unique_attrib_set_ready, _data_);
			return FALSE;
			_state_2:
			_trf_persona_store_build_update_query_set_finish (_data_->self, _data_->_res_);
			break;
		}
		case TRF_ATTRIB_EMAILS:
		{
			_data_->_tmp11_ = g_strdup ("_set_emailss");
			_g_free0 (_data_->query_name);
			_data_->query_name = _data_->_tmp11_;
			_data_->_tmp12_ = _data_->persona;
			_data_->_state_ = 3;
			_trf_persona_store_remove_attributes_from_persona (_data_->self, _data_->_tmp12_, _REMOVE_EMAILS, _trf_persona_store_set_unique_attrib_set_ready, _data_);
			return FALSE;
			_state_3:
			_data_->_tmp13_ = NULL;
			_data_->_tmp13_ = _trf_persona_store_remove_attributes_from_persona_finish (_data_->self, _data_->_res_);
			_data_->_tmp14_ = _data_->_tmp13_;
			_g_free0 (_data_->_tmp14_);
			_data_->_tmp15_ = _data_->builder;
			_data_->_tmp16_ = _data_->properties;
			_data_->_state_ = 4;
			_trf_persona_store_build_update_query_set (_data_->self, _data_->_tmp15_, _data_->_tmp16_, "?contact", TRF_ATTRIB_EMAILS, _trf_persona_store_set_unique_attrib_set_ready, _data_);
			return FALSE;
			_state_4:
			_trf_persona_store_build_update_query_set_finish (_data_->self, _data_->_res_);
			break;
		}
		default:
		break;
	}
	_data_->_tmp17_ = _data_->builder;
	tracker_sparql_builder_insert_close (_data_->_tmp17_);
	_data_->_tmp18_ = _data_->builder;
	tracker_sparql_builder_where_open (_data_->_tmp18_);
	_data_->_tmp19_ = _data_->builder;
	tracker_sparql_builder_subject (_data_->_tmp19_, "?contact");
	_data_->_tmp20_ = _data_->builder;
	tracker_sparql_builder_predicate (_data_->_tmp20_, "a");
	_data_->_tmp21_ = _data_->builder;
	tracker_sparql_builder_object (_data_->_tmp21_, TRF_ONTOLOGY_DEFS_NCO_PERSON);
	_data_->_tmp22_ = _data_->p_id;
	_data_->_tmp23_ = NULL;
	_data_->_tmp23_ = g_strdup_printf (" FILTER(tracker:id(?contact) = %s) ", _data_->_tmp22_);
	_data_->filter = _data_->_tmp23_;
	_data_->_tmp24_ = _data_->builder;
	tracker_sparql_builder_append (_data_->_tmp24_, _data_->filter);
	_data_->_tmp25_ = _data_->builder;
	tracker_sparql_builder_where_close (_data_->_tmp25_);
	_data_->_tmp26_ = _data_->builder;
	_data_->_tmp27_ = tracker_sparql_builder_get_result (_data_->_tmp26_);
	_data_->_tmp28_ = _data_->_tmp27_;
	_data_->_tmp29_ = _data_->query_name;
	_data_->_state_ = 5;
	_trf_persona_store_tracker_update (_data_->self, _data_->_tmp28_, _data_->_tmp29_, _trf_persona_store_set_unique_attrib_set_ready, _data_);
	return FALSE;
	_state_5:
	_trf_persona_store_tracker_update_finish (_data_->self, _data_->_res_);
	_g_free0 (_data_->filter);
	_g_object_unref0 (_data_->builder);
	_g_free0 (_data_->p_id);
	_g_free0 (_data_->query_name);
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


static void _trf_persona_store_set_urls_data_free (gpointer _data) {
	TrfPersonaStoreSetUrlsData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->persona);
	_g_object_unref0 (_data_->urls);
	_g_object_unref0 (_data_->self);
	g_slice_free (TrfPersonaStoreSetUrlsData, _data_);
}


void _trf_persona_store_set_urls (TrfPersonaStore* self, FolksPersona* persona, GeeSet* urls, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	TrfPersonaStoreSetUrlsData* _data_;
	TrfPersonaStore* _tmp0_;
	FolksPersona* _tmp1_;
	FolksPersona* _tmp2_;
	GeeSet* _tmp3_;
	GeeSet* _tmp4_;
	_data_ = g_slice_new0 (TrfPersonaStoreSetUrlsData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, _trf_persona_store_set_urls);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, _trf_persona_store_set_urls_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = persona;
	_tmp2_ = _g_object_ref0 (_tmp1_);
	_data_->persona = _tmp2_;
	_tmp3_ = urls;
	_tmp4_ = _g_object_ref0 (_tmp3_);
	_data_->urls = _tmp4_;
	_trf_persona_store_set_urls_co (_data_);
}


void _trf_persona_store_set_urls_finish (TrfPersonaStore* self, GAsyncResult* _res_) {
	TrfPersonaStoreSetUrlsData* _data_;
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
}


static void _trf_persona_store_set_urls_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	TrfPersonaStoreSetUrlsData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	_trf_persona_store_set_urls_co (_data_);
}


static gboolean _trf_persona_store_set_urls_co (TrfPersonaStoreSetUrlsData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->persona;
	_data_->_tmp1_ = _data_->urls;
	_data_->_state_ = 1;
	_trf_persona_store_set_attrib_set (_data_->self, _data_->_tmp0_, _data_->_tmp1_, TRF_ATTRIB_URLS, _trf_persona_store_set_urls_ready, _data_);
	return FALSE;
	_state_1:
	_trf_persona_store_set_attrib_set_finish (_data_->self, _data_->_res_);
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


static void _trf_persona_store_set_im_addresses_data_free (gpointer _data) {
	TrfPersonaStoreSetImAddressesData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->persona);
	_g_object_unref0 (_data_->im_addresses);
	_g_object_unref0 (_data_->self);
	g_slice_free (TrfPersonaStoreSetImAddressesData, _data_);
}


void _trf_persona_store_set_im_addresses (TrfPersonaStore* self, FolksPersona* persona, GeeMultiMap* im_addresses, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	TrfPersonaStoreSetImAddressesData* _data_;
	TrfPersonaStore* _tmp0_;
	FolksPersona* _tmp1_;
	FolksPersona* _tmp2_;
	GeeMultiMap* _tmp3_;
	GeeMultiMap* _tmp4_;
	_data_ = g_slice_new0 (TrfPersonaStoreSetImAddressesData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, _trf_persona_store_set_im_addresses);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, _trf_persona_store_set_im_addresses_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = persona;
	_tmp2_ = _g_object_ref0 (_tmp1_);
	_data_->persona = _tmp2_;
	_tmp3_ = im_addresses;
	_tmp4_ = _g_object_ref0 (_tmp3_);
	_data_->im_addresses = _tmp4_;
	_trf_persona_store_set_im_addresses_co (_data_);
}


void _trf_persona_store_set_im_addresses_finish (TrfPersonaStore* self, GAsyncResult* _res_) {
	TrfPersonaStoreSetImAddressesData* _data_;
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
}


static void _trf_persona_store_set_im_addresses_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	TrfPersonaStoreSetImAddressesData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	_trf_persona_store_set_im_addresses_co (_data_);
}


static gboolean _trf_persona_store_set_im_addresses_co (TrfPersonaStoreSetImAddressesData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = gee_hash_set_new (FOLKS_TYPE_IM_FIELD_DETAILS, (GBoxedCopyFunc) g_object_ref, g_object_unref, NULL, NULL);
	_data_->ims = _data_->_tmp0_;
	{
		_data_->_tmp1_ = _data_->im_addresses;
		_data_->_tmp2_ = NULL;
		_data_->_tmp2_ = gee_multi_map_get_keys (_data_->_tmp1_);
		_data_->_tmp3_ = _data_->_tmp2_;
		_data_->_tmp4_ = NULL;
		_data_->_tmp4_ = gee_iterable_iterator ((GeeIterable*) _data_->_tmp3_);
		_data_->_tmp5_ = _data_->_tmp4_;
		_g_object_unref0 (_data_->_tmp3_);
		_data_->_proto_it = _data_->_tmp5_;
		while (TRUE) {
			_data_->_tmp6_ = _data_->_proto_it;
			_data_->_tmp7_ = FALSE;
			_data_->_tmp7_ = gee_iterator_next (_data_->_tmp6_);
			if (!_data_->_tmp7_) {
				break;
			}
			_data_->_tmp8_ = _data_->_proto_it;
			_data_->_tmp9_ = NULL;
			_data_->_tmp9_ = gee_iterator_get (_data_->_tmp8_);
			_data_->proto = (gchar*) _data_->_tmp9_;
			_data_->_tmp10_ = _data_->im_addresses;
			_data_->_tmp11_ = _data_->proto;
			_data_->_tmp12_ = NULL;
			_data_->_tmp12_ = gee_multi_map_get (_data_->_tmp10_, _data_->_tmp11_);
			_data_->addrs = _data_->_tmp12_;
			{
				_data_->_tmp13_ = _data_->addrs;
				_data_->_tmp14_ = NULL;
				_data_->_tmp14_ = gee_iterable_iterator ((GeeIterable*) _data_->_tmp13_);
				_data_->_im_fd_it = _data_->_tmp14_;
				while (TRUE) {
					_data_->_tmp15_ = _data_->_im_fd_it;
					_data_->_tmp16_ = FALSE;
					_data_->_tmp16_ = gee_iterator_next (_data_->_tmp15_);
					if (!_data_->_tmp16_) {
						break;
					}
					_data_->_tmp17_ = _data_->_im_fd_it;
					_data_->_tmp18_ = NULL;
					_data_->_tmp18_ = gee_iterator_get (_data_->_tmp17_);
					_data_->im_fd = (FolksImFieldDetails*) _data_->_tmp18_;
					_data_->_tmp19_ = _data_->im_fd;
					_data_->_tmp20_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) _data_->_tmp19_);
					_data_->_tmp21_ = _data_->_tmp20_;
					_data_->_tmp22_ = folks_im_field_details_new ((const gchar*) _data_->_tmp21_, NULL);
					_data_->new_im_fd = _data_->_tmp22_;
					_data_->_tmp23_ = _data_->new_im_fd;
					_data_->_tmp24_ = _data_->proto;
					folks_abstract_field_details_set_parameter ((FolksAbstractFieldDetails*) _data_->_tmp23_, "proto", _data_->_tmp24_);
					_data_->_tmp25_ = _data_->ims;
					_data_->_tmp26_ = _data_->new_im_fd;
					gee_abstract_collection_add ((GeeAbstractCollection*) _data_->_tmp25_, _data_->_tmp26_);
					_g_object_unref0 (_data_->new_im_fd);
					_g_object_unref0 (_data_->im_fd);
				}
				_g_object_unref0 (_data_->_im_fd_it);
			}
			_g_object_unref0 (_data_->addrs);
			_g_free0 (_data_->proto);
		}
		_g_object_unref0 (_data_->_proto_it);
	}
	_data_->_tmp27_ = _data_->persona;
	_data_->_tmp28_ = _data_->ims;
	_data_->_state_ = 1;
	_trf_persona_store_set_attrib_set (_data_->self, _data_->_tmp27_, (GeeSet*) _data_->_tmp28_, TRF_ATTRIB_IM_ADDRESSES, _trf_persona_store_set_im_addresses_ready, _data_);
	return FALSE;
	_state_1:
	_trf_persona_store_set_attrib_set_finish (_data_->self, _data_->_res_);
	_g_object_unref0 (_data_->ims);
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


static void _trf_persona_store_set_postal_addresses_data_free (gpointer _data) {
	TrfPersonaStoreSetPostalAddressesData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->persona);
	_g_object_unref0 (_data_->postal_addresses);
	_g_object_unref0 (_data_->self);
	g_slice_free (TrfPersonaStoreSetPostalAddressesData, _data_);
}


void _trf_persona_store_set_postal_addresses (TrfPersonaStore* self, FolksPersona* persona, GeeSet* postal_addresses, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	TrfPersonaStoreSetPostalAddressesData* _data_;
	TrfPersonaStore* _tmp0_;
	FolksPersona* _tmp1_;
	FolksPersona* _tmp2_;
	GeeSet* _tmp3_;
	GeeSet* _tmp4_;
	_data_ = g_slice_new0 (TrfPersonaStoreSetPostalAddressesData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, _trf_persona_store_set_postal_addresses);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, _trf_persona_store_set_postal_addresses_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = persona;
	_tmp2_ = _g_object_ref0 (_tmp1_);
	_data_->persona = _tmp2_;
	_tmp3_ = postal_addresses;
	_tmp4_ = _g_object_ref0 (_tmp3_);
	_data_->postal_addresses = _tmp4_;
	_trf_persona_store_set_postal_addresses_co (_data_);
}


void _trf_persona_store_set_postal_addresses_finish (TrfPersonaStore* self, GAsyncResult* _res_) {
	TrfPersonaStoreSetPostalAddressesData* _data_;
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
}


static void _trf_persona_store_set_postal_addresses_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	TrfPersonaStoreSetPostalAddressesData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	_trf_persona_store_set_postal_addresses_co (_data_);
}


static gboolean _trf_persona_store_set_postal_addresses_co (TrfPersonaStoreSetPostalAddressesData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->persona;
	_data_->_tmp1_ = _data_->postal_addresses;
	_data_->_state_ = 1;
	_trf_persona_store_set_attrib_set (_data_->self, _data_->_tmp0_, _data_->_tmp1_, TRF_ATTRIB_POSTAL_ADDRESSES, _trf_persona_store_set_postal_addresses_ready, _data_);
	return FALSE;
	_state_1:
	_trf_persona_store_set_attrib_set_finish (_data_->self, _data_->_res_);
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


static void _trf_persona_store_set_roles_data_free (gpointer _data) {
	TrfPersonaStoreSetRolesData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->persona);
	_g_object_unref0 (_data_->roles);
	_g_object_unref0 (_data_->self);
	g_slice_free (TrfPersonaStoreSetRolesData, _data_);
}


void _trf_persona_store_set_roles (TrfPersonaStore* self, FolksPersona* persona, GeeSet* roles, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	TrfPersonaStoreSetRolesData* _data_;
	TrfPersonaStore* _tmp0_;
	FolksPersona* _tmp1_;
	FolksPersona* _tmp2_;
	GeeSet* _tmp3_;
	GeeSet* _tmp4_;
	_data_ = g_slice_new0 (TrfPersonaStoreSetRolesData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, _trf_persona_store_set_roles);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, _trf_persona_store_set_roles_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = persona;
	_tmp2_ = _g_object_ref0 (_tmp1_);
	_data_->persona = _tmp2_;
	_tmp3_ = roles;
	_tmp4_ = _g_object_ref0 (_tmp3_);
	_data_->roles = _tmp4_;
	_trf_persona_store_set_roles_co (_data_);
}


void _trf_persona_store_set_roles_finish (TrfPersonaStore* self, GAsyncResult* _res_) {
	TrfPersonaStoreSetRolesData* _data_;
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
}


static void _trf_persona_store_set_roles_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	TrfPersonaStoreSetRolesData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	_trf_persona_store_set_roles_co (_data_);
}


static gboolean _trf_persona_store_set_roles_co (TrfPersonaStoreSetRolesData* _data_) {
	static const char del_t[] = "DELETE { " " ?p " TRF_ONTOLOGY_DEFS_NCO_HAS_AFFILIATION " ?a " "} " "WHERE { " " ?p a " TRF_ONTOLOGY_DEFS_NCO_PERSON "; " " " TRF_ONTOLOGY_DEFS_NCO_HAS_AFFILIATION " ?a . " " OPTIONAL { ?a " TRF_ONTOLOGY_DEFS_NCO_ORG " ?o } . " " OPTIONAL { ?a " TRF_ONTOLOGY_DEFS_NCO_ROLE " ?r } . " " OPTIONAL { ?a " TRF_ONTOLOGY_DEFS_NCO_TITLE " ?t } . " " FILTER(tracker:id(?p) = %s) " "} ";
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->persona;
	_data_->_tmp1_ = NULL;
	_data_->_tmp1_ = trf_persona_tracker_id (TRF_PERSONA (_data_->_tmp0_));
	_data_->p_id = _data_->_tmp1_;
	_data_->_tmp2_ = _data_->p_id;
	_data_->_tmp3_ = NULL;
	_data_->_tmp3_ = g_strdup_printf (del_t, _data_->_tmp2_);
	_data_->del_q = _data_->_tmp3_;
	_data_->_tmp4_ = tracker_sparql_builder_new_update ();
	_data_->builder = _data_->_tmp4_;
	_data_->_tmp5_ = _data_->builder;
	tracker_sparql_builder_insert_open (_data_->_tmp5_, NULL);
	_data_->i = 0;
	{
		_data_->_tmp6_ = _data_->roles;
		_data_->_tmp7_ = NULL;
		_data_->_tmp7_ = gee_iterable_iterator ((GeeIterable*) _data_->_tmp6_);
		_data_->_role_fd_it = _data_->_tmp7_;
		while (TRUE) {
			_data_->_tmp8_ = _data_->_role_fd_it;
			_data_->_tmp9_ = FALSE;
			_data_->_tmp9_ = gee_iterator_next (_data_->_tmp8_);
			if (!_data_->_tmp9_) {
				break;
			}
			_data_->_tmp10_ = _data_->_role_fd_it;
			_data_->_tmp11_ = NULL;
			_data_->_tmp11_ = gee_iterator_get (_data_->_tmp10_);
			_data_->role_fd = (FolksRoleFieldDetails*) _data_->_tmp11_;
			_data_->_tmp12_ = _data_->i;
			_data_->_tmp13_ = NULL;
			_data_->_tmp13_ = g_strdup_printf ("_:a%d", _data_->_tmp12_);
			_data_->affl = _data_->_tmp13_;
			_data_->_tmp14_ = _data_->builder;
			_data_->_tmp15_ = _data_->affl;
			tracker_sparql_builder_subject (_data_->_tmp14_, _data_->_tmp15_);
			_data_->_tmp16_ = _data_->builder;
			tracker_sparql_builder_predicate (_data_->_tmp16_, "a");
			_data_->_tmp17_ = _data_->builder;
			tracker_sparql_builder_object (_data_->_tmp17_, TRF_ONTOLOGY_DEFS_NCO_AFFILIATION);
			_data_->_tmp18_ = _data_->builder;
			tracker_sparql_builder_predicate (_data_->_tmp18_, TRF_ONTOLOGY_DEFS_NCO_ROLE);
			_data_->_tmp19_ = _data_->builder;
			_data_->_tmp20_ = _data_->role_fd;
			_data_->_tmp21_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) _data_->_tmp20_);
			_data_->_tmp22_ = _data_->_tmp21_;
			_data_->_tmp23_ = folks_role_get_role ((FolksRole*) _data_->_tmp22_);
			_data_->_tmp24_ = _data_->_tmp23_;
			tracker_sparql_builder_object_string (_data_->_tmp19_, _data_->_tmp24_);
			_data_->_tmp25_ = _data_->builder;
			tracker_sparql_builder_predicate (_data_->_tmp25_, TRF_ONTOLOGY_DEFS_NCO_TITLE);
			_data_->_tmp26_ = _data_->builder;
			_data_->_tmp27_ = _data_->role_fd;
			_data_->_tmp28_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) _data_->_tmp27_);
			_data_->_tmp29_ = _data_->_tmp28_;
			_data_->_tmp30_ = folks_role_get_title ((FolksRole*) _data_->_tmp29_);
			_data_->_tmp31_ = _data_->_tmp30_;
			tracker_sparql_builder_object_string (_data_->_tmp26_, _data_->_tmp31_);
			_data_->_tmp32_ = _data_->builder;
			tracker_sparql_builder_predicate (_data_->_tmp32_, TRF_ONTOLOGY_DEFS_NCO_ORG);
			_data_->_tmp33_ = _data_->builder;
			_data_->_tmp34_ = _data_->role_fd;
			_data_->_tmp35_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) _data_->_tmp34_);
			_data_->_tmp36_ = _data_->_tmp35_;
			_data_->_tmp37_ = folks_role_get_organisation_name ((FolksRole*) _data_->_tmp36_);
			_data_->_tmp38_ = _data_->_tmp37_;
			tracker_sparql_builder_object_string (_data_->_tmp33_, _data_->_tmp38_);
			_data_->_tmp39_ = _data_->builder;
			tracker_sparql_builder_subject (_data_->_tmp39_, "?contact");
			_data_->_tmp40_ = _data_->builder;
			tracker_sparql_builder_predicate (_data_->_tmp40_, TRF_ONTOLOGY_DEFS_NCO_HAS_AFFILIATION);
			_data_->_tmp41_ = _data_->builder;
			_data_->_tmp42_ = _data_->affl;
			tracker_sparql_builder_object (_data_->_tmp41_, _data_->_tmp42_);
			_g_free0 (_data_->affl);
			_g_object_unref0 (_data_->role_fd);
		}
		_g_object_unref0 (_data_->_role_fd_it);
	}
	_data_->_tmp43_ = _data_->builder;
	tracker_sparql_builder_insert_close (_data_->_tmp43_);
	_data_->_tmp44_ = _data_->builder;
	tracker_sparql_builder_where_open (_data_->_tmp44_);
	_data_->_tmp45_ = _data_->builder;
	tracker_sparql_builder_subject (_data_->_tmp45_, "?contact");
	_data_->_tmp46_ = _data_->builder;
	tracker_sparql_builder_predicate (_data_->_tmp46_, "a");
	_data_->_tmp47_ = _data_->builder;
	tracker_sparql_builder_object (_data_->_tmp47_, TRF_ONTOLOGY_DEFS_NCO_PERSON);
	_data_->_tmp48_ = _data_->p_id;
	_data_->_tmp49_ = NULL;
	_data_->_tmp49_ = g_strdup_printf (" FILTER(tracker:id(?contact) = %s) ", _data_->_tmp48_);
	_data_->filter = _data_->_tmp49_;
	_data_->_tmp50_ = _data_->builder;
	tracker_sparql_builder_append (_data_->_tmp50_, _data_->filter);
	_data_->_tmp51_ = _data_->builder;
	tracker_sparql_builder_where_close (_data_->_tmp51_);
	_data_->_tmp52_ = _data_->del_q;
	_data_->_tmp53_ = _data_->builder;
	_data_->_tmp54_ = tracker_sparql_builder_get_result (_data_->_tmp53_);
	_data_->_tmp55_ = _data_->_tmp54_;
	_data_->_tmp56_ = g_strconcat (_data_->_tmp52_, _data_->_tmp55_, NULL);
	_data_->_tmp57_ = _data_->_tmp56_;
	_data_->_state_ = 1;
	_trf_persona_store_tracker_update (_data_->self, _data_->_tmp57_, "_set_roles", _trf_persona_store_set_roles_ready, _data_);
	return FALSE;
	_state_1:
	_trf_persona_store_tracker_update_finish (_data_->self, _data_->_res_);
	_g_free0 (_data_->_tmp57_);
	_g_free0 (_data_->filter);
	_g_object_unref0 (_data_->builder);
	_g_free0 (_data_->del_q);
	_g_free0 (_data_->p_id);
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


static void _trf_persona_store_set_notes_data_free (gpointer _data) {
	TrfPersonaStoreSetNotesData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->persona);
	_g_object_unref0 (_data_->notes);
	_g_object_unref0 (_data_->self);
	g_slice_free (TrfPersonaStoreSetNotesData, _data_);
}


void _trf_persona_store_set_notes (TrfPersonaStore* self, FolksPersona* persona, GeeSet* notes, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	TrfPersonaStoreSetNotesData* _data_;
	TrfPersonaStore* _tmp0_;
	FolksPersona* _tmp1_;
	FolksPersona* _tmp2_;
	GeeSet* _tmp3_;
	GeeSet* _tmp4_;
	_data_ = g_slice_new0 (TrfPersonaStoreSetNotesData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, _trf_persona_store_set_notes);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, _trf_persona_store_set_notes_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = persona;
	_tmp2_ = _g_object_ref0 (_tmp1_);
	_data_->persona = _tmp2_;
	_tmp3_ = notes;
	_tmp4_ = _g_object_ref0 (_tmp3_);
	_data_->notes = _tmp4_;
	_trf_persona_store_set_notes_co (_data_);
}


void _trf_persona_store_set_notes_finish (TrfPersonaStore* self, GAsyncResult* _res_) {
	TrfPersonaStoreSetNotesData* _data_;
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
}


static void _trf_persona_store_set_notes_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	TrfPersonaStoreSetNotesData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	_trf_persona_store_set_notes_co (_data_);
}


static gboolean _trf_persona_store_set_notes_co (TrfPersonaStoreSetNotesData* _data_) {
	static const char del_t[] = "DELETE { " "?p " TRF_ONTOLOGY_DEFS_NCO_NOTE " ?n " "} " "WHERE {" " ?p a nco:PersonContact ; " TRF_ONTOLOGY_DEFS_NCO_NOTE " ?n . " " FILTER(tracker:id(?p) = %s)" "}";
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->persona;
	_data_->_tmp1_ = NULL;
	_data_->_tmp1_ = trf_persona_tracker_id (TRF_PERSONA (_data_->_tmp0_));
	_data_->p_id = _data_->_tmp1_;
	_data_->_tmp2_ = _data_->p_id;
	_data_->_tmp3_ = NULL;
	_data_->_tmp3_ = g_strdup_printf (del_t, _data_->_tmp2_);
	_data_->del_q = _data_->_tmp3_;
	_data_->_tmp4_ = tracker_sparql_builder_new_update ();
	_data_->builder = _data_->_tmp4_;
	_data_->_tmp5_ = _data_->builder;
	tracker_sparql_builder_insert_open (_data_->_tmp5_, NULL);
	{
		_data_->_tmp6_ = _data_->notes;
		_data_->_tmp7_ = NULL;
		_data_->_tmp7_ = gee_iterable_iterator ((GeeIterable*) _data_->_tmp6_);
		_data_->_n_it = _data_->_tmp7_;
		while (TRUE) {
			_data_->_tmp8_ = _data_->_n_it;
			_data_->_tmp9_ = FALSE;
			_data_->_tmp9_ = gee_iterator_next (_data_->_tmp8_);
			if (!_data_->_tmp9_) {
				break;
			}
			_data_->_tmp10_ = _data_->_n_it;
			_data_->_tmp11_ = NULL;
			_data_->_tmp11_ = gee_iterator_get (_data_->_tmp10_);
			_data_->n = (FolksNoteFieldDetails*) _data_->_tmp11_;
			_data_->_tmp12_ = _data_->builder;
			tracker_sparql_builder_subject (_data_->_tmp12_, "?contact");
			_data_->_tmp13_ = _data_->builder;
			tracker_sparql_builder_predicate (_data_->_tmp13_, TRF_ONTOLOGY_DEFS_NCO_NOTE);
			_data_->_tmp14_ = _data_->builder;
			_data_->_tmp15_ = _data_->n;
			_data_->_tmp16_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) _data_->_tmp15_);
			_data_->_tmp17_ = _data_->_tmp16_;
			tracker_sparql_builder_object_string (_data_->_tmp14_, (const gchar*) _data_->_tmp17_);
			_g_object_unref0 (_data_->n);
		}
		_g_object_unref0 (_data_->_n_it);
	}
	_data_->_tmp18_ = _data_->builder;
	tracker_sparql_builder_insert_close (_data_->_tmp18_);
	_data_->_tmp19_ = _data_->builder;
	tracker_sparql_builder_where_open (_data_->_tmp19_);
	_data_->_tmp20_ = _data_->builder;
	tracker_sparql_builder_subject (_data_->_tmp20_, "?contact");
	_data_->_tmp21_ = _data_->builder;
	tracker_sparql_builder_predicate (_data_->_tmp21_, "a");
	_data_->_tmp22_ = _data_->builder;
	tracker_sparql_builder_object (_data_->_tmp22_, TRF_ONTOLOGY_DEFS_NCO_PERSON);
	_data_->_tmp23_ = _data_->p_id;
	_data_->_tmp24_ = NULL;
	_data_->_tmp24_ = g_strdup_printf (" FILTER(tracker:id(?contact) = %s) ", _data_->_tmp23_);
	_data_->filter = _data_->_tmp24_;
	_data_->_tmp25_ = _data_->builder;
	tracker_sparql_builder_append (_data_->_tmp25_, _data_->filter);
	_data_->_tmp26_ = _data_->builder;
	tracker_sparql_builder_where_close (_data_->_tmp26_);
	_data_->_tmp27_ = _data_->del_q;
	_data_->_tmp28_ = _data_->builder;
	_data_->_tmp29_ = tracker_sparql_builder_get_result (_data_->_tmp28_);
	_data_->_tmp30_ = _data_->_tmp29_;
	_data_->_tmp31_ = g_strconcat (_data_->_tmp27_, _data_->_tmp30_, NULL);
	_data_->_tmp32_ = _data_->_tmp31_;
	_data_->_state_ = 1;
	_trf_persona_store_tracker_update (_data_->self, _data_->_tmp32_, "_set_notes", _trf_persona_store_set_notes_ready, _data_);
	return FALSE;
	_state_1:
	_trf_persona_store_tracker_update_finish (_data_->self, _data_->_res_);
	_g_free0 (_data_->_tmp32_);
	_g_free0 (_data_->filter);
	_g_object_unref0 (_data_->builder);
	_g_free0 (_data_->del_q);
	_g_free0 (_data_->p_id);
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


static void _trf_persona_store_set_birthday_data_free (gpointer _data) {
	TrfPersonaStoreSetBirthdayData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->persona);
	_g_date_time_unref0 (_data_->bday);
	_g_object_unref0 (_data_->self);
	g_slice_free (TrfPersonaStoreSetBirthdayData, _data_);
}


void _trf_persona_store_set_birthday (TrfPersonaStore* self, FolksPersona* persona, GDateTime* bday, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	TrfPersonaStoreSetBirthdayData* _data_;
	TrfPersonaStore* _tmp0_;
	FolksPersona* _tmp1_;
	FolksPersona* _tmp2_;
	GDateTime* _tmp3_;
	_data_ = g_slice_new0 (TrfPersonaStoreSetBirthdayData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, _trf_persona_store_set_birthday);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, _trf_persona_store_set_birthday_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = persona;
	_tmp2_ = _g_object_ref0 (_tmp1_);
	_data_->persona = _tmp2_;
	_tmp3_ = bday;
	_g_date_time_unref0 (_data_->bday);
	_data_->bday = _tmp3_;
	_trf_persona_store_set_birthday_co (_data_);
}


void _trf_persona_store_set_birthday_finish (TrfPersonaStore* self, GAsyncResult* _res_) {
	TrfPersonaStoreSetBirthdayData* _data_;
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
}


static void _trf_persona_store_set_birthday_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	TrfPersonaStoreSetBirthdayData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	_trf_persona_store_set_birthday_co (_data_);
}


static gboolean _trf_persona_store_set_birthday_co (TrfPersonaStoreSetBirthdayData* _data_) {
	static const char q_t[] = "DELETE { " " ?p " TRF_ONTOLOGY_DEFS_NCO_BIRTHDAY " ?b " "} " "WHERE { " " ?p a " TRF_ONTOLOGY_DEFS_NCO_PERSON "; " TRF_ONTOLOGY_DEFS_NCO_BIRTHDAY " ?b . " " FILTER (tracker:id(?p) = %s ) " "} " "INSERT { " " ?p " TRF_ONTOLOGY_DEFS_NCO_BIRTHDAY " '%s' " "} " "WHERE { " " ?p a " TRF_ONTOLOGY_DEFS_NCO_PERSON " . " " FILTER (tracker:id(?p) = %s) " "} ";
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->persona;
	_data_->_tmp1_ = NULL;
	_data_->_tmp1_ = trf_persona_tracker_id (TRF_PERSONA (_data_->_tmp0_));
	_data_->p_id = _data_->_tmp1_;
	_data_->_tmp2_ = _data_->bday;
	memset (&_data_->_tmp3_, 0, sizeof (GTimeVal));
	g_date_time_to_timeval (_data_->_tmp2_, &_data_->_tmp3_);
	_data_->tv = _data_->_tmp3_;
	_data_->_tmp4_ = NULL;
	_data_->_tmp4_ = g_time_val_to_iso8601 (&_data_->tv);
	_data_->_tmp5_ = _data_->_tmp4_;
	_data_->_tmp6_ = NULL;
	_data_->_tmp6_ = g_strdup_printf (q_t, _data_->p_id, _data_->_tmp5_, _data_->p_id);
	_data_->_tmp7_ = _data_->_tmp6_;
	_g_free0 (_data_->_tmp5_);
	_data_->query = _data_->_tmp7_;
	_data_->_state_ = 1;
	_trf_persona_store_tracker_update (_data_->self, _data_->query, "_set_birthday", _trf_persona_store_set_birthday_ready, _data_);
	return FALSE;
	_state_1:
	_trf_persona_store_tracker_update_finish (_data_->self, _data_->_res_);
	_g_free0 (_data_->query);
	_g_free0 (_data_->p_id);
	_g_date_time_unref0 (_data_->bday);
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


static void _trf_persona_store_set_gender_data_free (gpointer _data) {
	TrfPersonaStoreSetGenderData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->persona);
	_g_object_unref0 (_data_->self);
	g_slice_free (TrfPersonaStoreSetGenderData, _data_);
}


void _trf_persona_store_set_gender (TrfPersonaStore* self, FolksPersona* persona, FolksGender gender, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	TrfPersonaStoreSetGenderData* _data_;
	TrfPersonaStore* _tmp0_;
	FolksPersona* _tmp1_;
	FolksPersona* _tmp2_;
	FolksGender _tmp3_;
	_data_ = g_slice_new0 (TrfPersonaStoreSetGenderData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, _trf_persona_store_set_gender);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, _trf_persona_store_set_gender_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = persona;
	_tmp2_ = _g_object_ref0 (_tmp1_);
	_data_->persona = _tmp2_;
	_tmp3_ = gender;
	_data_->gender = _tmp3_;
	_trf_persona_store_set_gender_co (_data_);
}


void _trf_persona_store_set_gender_finish (TrfPersonaStore* self, GAsyncResult* _res_) {
	TrfPersonaStoreSetGenderData* _data_;
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
}


static void _trf_persona_store_set_gender_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	TrfPersonaStoreSetGenderData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	_trf_persona_store_set_gender_co (_data_);
}


static gboolean _trf_persona_store_set_gender_co (TrfPersonaStoreSetGenderData* _data_) {
	static const char del_t[] = "DELETE { " " ?p " TRF_ONTOLOGY_DEFS_NCO_GENDER " ?g " "} " "WHERE { " " ?p a " TRF_ONTOLOGY_DEFS_NCO_PERSON " ; " TRF_ONTOLOGY_DEFS_NCO_GENDER " ?g . " " FILTER (tracker:id(?p) = %s) " "} ";
	static const char ins_t[] = "INSERT { " " ?p " TRF_ONTOLOGY_DEFS_NCO_GENDER " %s " "} " "WHERE { " " ?p a " TRF_ONTOLOGY_DEFS_NCO_PERSON " . " " FILTER (tracker:id(?p) = %s) " "} ";
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->persona;
	_data_->_tmp1_ = NULL;
	_data_->_tmp1_ = trf_persona_tracker_id (TRF_PERSONA (_data_->_tmp0_));
	_data_->p_id = _data_->_tmp1_;
	_data_->_tmp2_ = _data_->gender;
	if (_data_->_tmp2_ == FOLKS_GENDER_UNSPECIFIED) {
		_data_->_tmp3_ = _data_->p_id;
		_data_->_tmp4_ = NULL;
		_data_->_tmp4_ = g_strdup_printf (del_t, _data_->_tmp3_);
		_g_free0 (_data_->query);
		_data_->query = _data_->_tmp4_;
	} else {
		_data_->_tmp5_ = _data_->gender;
		if (_data_->_tmp5_ == FOLKS_GENDER_MALE) {
			_data_->_tmp6_ = g_strdup (TRF_ONTOLOGY_DEFS_NCO_URL_PREFIX "nco#gender-male>");
			_g_free0 (_data_->gender_urn);
			_data_->gender_urn = _data_->_tmp6_;
		} else {
			_data_->_tmp7_ = g_strdup (TRF_ONTOLOGY_DEFS_NCO_URL_PREFIX "nco#gender-female>");
			_g_free0 (_data_->gender_urn);
			_data_->gender_urn = _data_->_tmp7_;
		}
		_data_->_tmp8_ = _data_->p_id;
		_data_->_tmp9_ = NULL;
		_data_->_tmp9_ = g_strdup_printf (del_t, _data_->_tmp8_);
		_data_->_tmp10_ = _data_->_tmp9_;
		_data_->_tmp11_ = _data_->gender_urn;
		_data_->_tmp12_ = _data_->p_id;
		_data_->_tmp13_ = NULL;
		_data_->_tmp13_ = g_strdup_printf (ins_t, _data_->_tmp11_, _data_->_tmp12_);
		_data_->_tmp14_ = _data_->_tmp13_;
		_data_->_tmp15_ = g_strconcat (_data_->_tmp10_, _data_->_tmp14_, NULL);
		_g_free0 (_data_->query);
		_data_->query = _data_->_tmp15_;
		_g_free0 (_data_->_tmp14_);
		_g_free0 (_data_->_tmp10_);
		_g_free0 (_data_->gender_urn);
	}
	_data_->_tmp16_ = _data_->query;
	_data_->_state_ = 1;
	_trf_persona_store_tracker_update (_data_->self, _data_->_tmp16_, "_set_gender", _trf_persona_store_set_gender_ready, _data_);
	return FALSE;
	_state_1:
	_trf_persona_store_tracker_update_finish (_data_->self, _data_->_res_);
	_g_free0 (_data_->query);
	_g_free0 (_data_->p_id);
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


static void _trf_persona_store_set_avatar_data_free (gpointer _data) {
	TrfPersonaStoreSetAvatarData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->persona);
	_g_object_unref0 (_data_->avatar);
	_g_object_unref0 (_data_->self);
	g_slice_free (TrfPersonaStoreSetAvatarData, _data_);
}


void _trf_persona_store_set_avatar (TrfPersonaStore* self, FolksPersona* persona, GLoadableIcon* avatar, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	TrfPersonaStoreSetAvatarData* _data_;
	TrfPersonaStore* _tmp0_;
	FolksPersona* _tmp1_;
	FolksPersona* _tmp2_;
	GLoadableIcon* _tmp3_;
	GLoadableIcon* _tmp4_;
	_data_ = g_slice_new0 (TrfPersonaStoreSetAvatarData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, _trf_persona_store_set_avatar);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, _trf_persona_store_set_avatar_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = persona;
	_tmp2_ = _g_object_ref0 (_tmp1_);
	_data_->persona = _tmp2_;
	_tmp3_ = avatar;
	_tmp4_ = _g_object_ref0 (_tmp3_);
	_data_->avatar = _tmp4_;
	_trf_persona_store_set_avatar_co (_data_);
}


void _trf_persona_store_set_avatar_finish (TrfPersonaStore* self, GAsyncResult* _res_) {
	TrfPersonaStoreSetAvatarData* _data_;
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
}


static void _trf_persona_store_set_avatar_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	TrfPersonaStoreSetAvatarData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	_trf_persona_store_set_avatar_co (_data_);
}


static gboolean _trf_persona_store_set_avatar_co (TrfPersonaStoreSetAvatarData* _data_) {
	static const char query_d[] = "DELETE {" " ?c " TRF_ONTOLOGY_DEFS_NCO_PHOTO " ?p " " } " "WHERE { " " ?c a " TRF_ONTOLOGY_DEFS_NCO_PERSON " ; " TRF_ONTOLOGY_DEFS_NCO_PHOTO " ?p . " " FILTER(tracker:id(?c) = %s) " "} ";
	static const char query_i[] = "INSERT { " " _:i a " TRF_ONTOLOGY_DEFS_NFO_IMAGE ", " TRF_ONTOLOGY_DEFS_NIE_DATAOBJECT " ; " TRF_ONTOLOGY_DEFS_NIE_URL " '%s' . " " ?c " TRF_ONTOLOGY_DEFS_NCO_PHOTO " _:i " "} " "WHERE { " " ?c a nco:PersonContact . " " FILTER(tracker:id(?c) = %s) " "}";
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		case 2:
		goto _state_2;
		case 3:
		goto _state_3;
		case 4:
		goto _state_4;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->persona;
	_data_->_tmp1_ = NULL;
	_data_->_tmp1_ = trf_persona_tracker_id (TRF_PERSONA (_data_->_tmp0_));
	_data_->p_id = _data_->_tmp1_;
	_data_->_tmp2_ = _data_->p_id;
	_data_->_tmp3_ = 0;
	_data_->_tmp3_ = atoi (_data_->_tmp2_);
	_data_->_state_ = 1;
	_trf_persona_store_get_property (_data_->self, _data_->_tmp3_, TRF_ONTOLOGY_DEFS_NCO_PHOTO, TRF_ONTOLOGY_DEFS_NCO_PERSON, _trf_persona_store_set_avatar_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp4_ = NULL;
	_data_->_tmp4_ = _trf_persona_store_get_property_finish (_data_->self, _data_->_res_);
	_data_->image_urn = _data_->_tmp4_;
	_data_->_tmp5_ = _data_->image_urn;
	if (g_strcmp0 (_data_->_tmp5_, "") != 0) {
		_data_->_tmp6_ = _data_->image_urn;
		_data_->_tmp7_ = NULL;
		_data_->_tmp7_ = g_strdup_printf ("<%s>", _data_->_tmp6_);
		_data_->_tmp8_ = _data_->_tmp7_;
		_trf_persona_store_delete_resource (_data_->self, _data_->_tmp8_, TRUE, NULL, NULL);
		_g_free0 (_data_->_tmp8_);
	}
	_data_->_tmp9_ = _data_->p_id;
	_data_->_tmp10_ = NULL;
	_data_->_tmp10_ = g_strdup_printf (query_d, _data_->_tmp9_);
	_data_->query = _data_->_tmp10_;
	_data_->_tmp11_ = NULL;
	_data_->_tmp11_ = folks_avatar_cache_dup ();
	_data_->cache = _data_->_tmp11_;
	_data_->_tmp12_ = _data_->avatar;
	if (_data_->_tmp12_ != NULL) {
		{
			_data_->_tmp13_ = _data_->cache;
			_data_->_tmp14_ = _data_->persona;
			_data_->_tmp15_ = folks_persona_get_uid (_data_->_tmp14_);
			_data_->_tmp16_ = _data_->_tmp15_;
			_data_->_tmp17_ = _data_->avatar;
			_data_->_state_ = 2;
			folks_avatar_cache_store_avatar (_data_->_tmp13_, _data_->_tmp16_, _data_->_tmp17_, _trf_persona_store_set_avatar_ready, _data_);
			return FALSE;
			_state_2:
			_data_->_tmp18_ = NULL;
			_data_->_tmp18_ = folks_avatar_cache_store_avatar_finish (_data_->_tmp13_, _data_->_res_, &_data_->_inner_error_);
			_data_->uri = _data_->_tmp18_;
			if (_data_->_inner_error_ != NULL) {
				goto __catch11_g_error;
			}
			_data_->_tmp19_ = _data_->query;
			_data_->_tmp20_ = _data_->uri;
			_data_->_tmp21_ = _data_->p_id;
			_data_->_tmp22_ = NULL;
			_data_->_tmp22_ = g_strdup_printf (query_i, _data_->_tmp20_, _data_->_tmp21_);
			_data_->_tmp23_ = _data_->_tmp22_;
			_data_->_tmp24_ = g_strconcat (_data_->_tmp19_, _data_->_tmp23_, NULL);
			_g_free0 (_data_->query);
			_data_->query = _data_->_tmp24_;
			_g_free0 (_data_->_tmp23_);
			_g_free0 (_data_->uri);
		}
		goto __finally11;
		__catch11_g_error:
		{
			_data_->e1 = _data_->_inner_error_;
			_data_->_inner_error_ = NULL;
			_data_->_tmp25_ = _data_->persona;
			_data_->_tmp26_ = folks_persona_get_uid (_data_->_tmp25_);
			_data_->_tmp27_ = _data_->_tmp26_;
			_data_->_tmp28_ = _data_->e1;
			_data_->_tmp29_ = _data_->_tmp28_->message;
			g_warning ("trf-persona-store.vala:2286: Couldn't cache avatar for Trf.Persona '%s" \
"': %s", _data_->_tmp27_, _data_->_tmp29_);
			_g_error_free0 (_data_->e1);
		}
		__finally11:
		if (_data_->_inner_error_ != NULL) {
			_g_object_unref0 (_data_->cache);
			_g_free0 (_data_->query);
			_g_free0 (_data_->image_urn);
			_g_free0 (_data_->p_id);
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
			g_clear_error (&_data_->_inner_error_);
			return FALSE;
		}
	} else {
		{
			_data_->_tmp30_ = _data_->cache;
			_data_->_tmp31_ = _data_->persona;
			_data_->_tmp32_ = folks_persona_get_uid (_data_->_tmp31_);
			_data_->_tmp33_ = _data_->_tmp32_;
			_data_->_state_ = 3;
			folks_avatar_cache_remove_avatar (_data_->_tmp30_, _data_->_tmp33_, _trf_persona_store_set_avatar_ready, _data_);
			return FALSE;
			_state_3:
			folks_avatar_cache_remove_avatar_finish (_data_->_tmp30_, _data_->_res_, &_data_->_inner_error_);
			if (_data_->_inner_error_ != NULL) {
				goto __catch12_g_error;
			}
		}
		goto __finally12;
		__catch12_g_error:
		{
			_data_->e2 = _data_->_inner_error_;
			_data_->_inner_error_ = NULL;
			_g_error_free0 (_data_->e2);
		}
		__finally12:
		if (_data_->_inner_error_ != NULL) {
			_g_object_unref0 (_data_->cache);
			_g_free0 (_data_->query);
			_g_free0 (_data_->image_urn);
			_g_free0 (_data_->p_id);
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
			g_clear_error (&_data_->_inner_error_);
			return FALSE;
		}
	}
	_data_->_tmp34_ = _data_->query;
	_data_->_state_ = 4;
	_trf_persona_store_tracker_update (_data_->self, _data_->_tmp34_, "_set_avatar", _trf_persona_store_set_avatar_ready, _data_);
	return FALSE;
	_state_4:
	_trf_persona_store_tracker_update_finish (_data_->self, _data_->_res_);
	_g_object_unref0 (_data_->cache);
	_g_free0 (_data_->query);
	_g_free0 (_data_->image_urn);
	_g_free0 (_data_->p_id);
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


static void _trf_persona_store_set_structured_name_data_free (gpointer _data) {
	TrfPersonaStoreSetStructuredNameData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->persona);
	_g_object_unref0 (_data_->sname);
	_g_object_unref0 (_data_->self);
	g_slice_free (TrfPersonaStoreSetStructuredNameData, _data_);
}


void _trf_persona_store_set_structured_name (TrfPersonaStore* self, FolksPersona* persona, FolksStructuredName* sname, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	TrfPersonaStoreSetStructuredNameData* _data_;
	TrfPersonaStore* _tmp0_;
	FolksPersona* _tmp1_;
	FolksPersona* _tmp2_;
	FolksStructuredName* _tmp3_;
	FolksStructuredName* _tmp4_;
	_data_ = g_slice_new0 (TrfPersonaStoreSetStructuredNameData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, _trf_persona_store_set_structured_name);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, _trf_persona_store_set_structured_name_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = persona;
	_tmp2_ = _g_object_ref0 (_tmp1_);
	_data_->persona = _tmp2_;
	_tmp3_ = sname;
	_tmp4_ = _g_object_ref0 (_tmp3_);
	_data_->sname = _tmp4_;
	_trf_persona_store_set_structured_name_co (_data_);
}


void _trf_persona_store_set_structured_name_finish (TrfPersonaStore* self, GAsyncResult* _res_) {
	TrfPersonaStoreSetStructuredNameData* _data_;
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
}


static void _trf_persona_store_set_structured_name_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	TrfPersonaStoreSetStructuredNameData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	_trf_persona_store_set_structured_name_co (_data_);
}


static gboolean _trf_persona_store_set_structured_name_co (TrfPersonaStoreSetStructuredNameData* _data_) {
	static const char query_d[] = "DELETE { " " ?p " TRF_ONTOLOGY_DEFS_NCO_FAMILY " ?family . " " ?p " TRF_ONTOLOGY_DEFS_NCO_GIVEN " ?given . " " ?p " TRF_ONTOLOGY_DEFS_NCO_ADDITIONAL " ?adi . " " ?p " TRF_ONTOLOGY_DEFS_NCO_PREFIX " ?prefix . " " ?p " TRF_ONTOLOGY_DEFS_NCO_SUFFIX " ?suffix " "} " "WHERE { " " ?p a " TRF_ONTOLOGY_DEFS_NCO_PERSON " .  " " OPTIONAL { ?p " TRF_ONTOLOGY_DEFS_NCO_FAMILY " ?family } . " " OPTIONAL { ?p " TRF_ONTOLOGY_DEFS_NCO_GIVEN " ?given } . " " OPTIONAL { ?p " TRF_ONTOLOGY_DEFS_NCO_ADDITIONAL " ?adi } . " " OPTIONAL { ?p " TRF_ONTOLOGY_DEFS_NCO_PREFIX " ?prefix } . " " OPTIONAL { ?p " TRF_ONTOLOGY_DEFS_NCO_SUFFIX " ?suffix } . " " FILTER (tracker:id(?p) = %s) " "} ";
	static const char query_i[] = "INSERT { " " ?p " TRF_ONTOLOGY_DEFS_NCO_FAMILY " '%s'; " " " TRF_ONTOLOGY_DEFS_NCO_GIVEN " '%s'; " " " TRF_ONTOLOGY_DEFS_NCO_ADDITIONAL " '%s'; " " " TRF_ONTOLOGY_DEFS_NCO_PREFIX " '%s'; " " " TRF_ONTOLOGY_DEFS_NCO_SUFFIX " '%s' " " } " "WHERE { " " ?p a " TRF_ONTOLOGY_DEFS_NCO_PERSON " . " " FILTER (tracker:id(?p) = %s) " "} ";
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->persona;
	_data_->_tmp1_ = NULL;
	_data_->_tmp1_ = trf_persona_tracker_id (TRF_PERSONA (_data_->_tmp0_));
	_data_->p_id = _data_->_tmp1_;
	_data_->_tmp2_ = _data_->p_id;
	_data_->_tmp3_ = NULL;
	_data_->_tmp3_ = g_strdup_printf (query_d, _data_->_tmp2_);
	_data_->query = _data_->_tmp3_;
	_data_->_tmp4_ = _data_->sname;
	if (_data_->_tmp4_ != NULL) {
		_data_->_tmp5_ = _data_->sname;
		_data_->_tmp6_ = folks_structured_name_get_family_name (_data_->_tmp5_);
		_data_->_tmp7_ = _data_->_tmp6_;
		_data_->_tmp8_ = _data_->sname;
		_data_->_tmp9_ = folks_structured_name_get_given_name (_data_->_tmp8_);
		_data_->_tmp10_ = _data_->_tmp9_;
		_data_->_tmp11_ = _data_->sname;
		_data_->_tmp12_ = folks_structured_name_get_additional_names (_data_->_tmp11_);
		_data_->_tmp13_ = _data_->_tmp12_;
		_data_->_tmp14_ = _data_->sname;
		_data_->_tmp15_ = folks_structured_name_get_prefixes (_data_->_tmp14_);
		_data_->_tmp16_ = _data_->_tmp15_;
		_data_->_tmp17_ = _data_->sname;
		_data_->_tmp18_ = folks_structured_name_get_suffixes (_data_->_tmp17_);
		_data_->_tmp19_ = _data_->_tmp18_;
		_data_->_tmp20_ = _data_->p_id;
		_data_->_tmp21_ = NULL;
		_data_->_tmp21_ = g_strdup_printf (query_i, _data_->_tmp7_, _data_->_tmp10_, _data_->_tmp13_, _data_->_tmp16_, _data_->_tmp19_, _data_->_tmp20_);
		_g_free0 (_data_->query);
		_data_->query = _data_->_tmp21_;
	}
	_data_->_tmp22_ = _data_->query;
	_data_->_state_ = 1;
	_trf_persona_store_tracker_update (_data_->self, _data_->_tmp22_, "_set_structured_name", _trf_persona_store_set_structured_name_ready, _data_);
	return FALSE;
	_state_1:
	_trf_persona_store_tracker_update_finish (_data_->self, _data_->_res_);
	_g_free0 (_data_->query);
	_g_free0 (_data_->p_id);
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


static void _trf_persona_store_set_full_name_data_free (gpointer _data) {
	TrfPersonaStoreSetFullNameData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->persona);
	_g_free0 (_data_->full_name);
	_g_object_unref0 (_data_->self);
	g_slice_free (TrfPersonaStoreSetFullNameData, _data_);
}


void _trf_persona_store_set_full_name (TrfPersonaStore* self, FolksPersona* persona, const gchar* full_name, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	TrfPersonaStoreSetFullNameData* _data_;
	TrfPersonaStore* _tmp0_;
	FolksPersona* _tmp1_;
	FolksPersona* _tmp2_;
	const gchar* _tmp3_;
	const gchar* _tmp4_;
	_data_ = g_slice_new0 (TrfPersonaStoreSetFullNameData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, _trf_persona_store_set_full_name);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, _trf_persona_store_set_full_name_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = persona;
	_tmp2_ = _g_object_ref0 (_tmp1_);
	_data_->persona = _tmp2_;
	_tmp3_ = full_name;
	_tmp4_ = g_strdup (_tmp3_);
	_data_->full_name = _tmp4_;
	_trf_persona_store_set_full_name_co (_data_);
}


void _trf_persona_store_set_full_name_finish (TrfPersonaStore* self, GAsyncResult* _res_) {
	TrfPersonaStoreSetFullNameData* _data_;
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
}


static void _trf_persona_store_set_full_name_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	TrfPersonaStoreSetFullNameData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	_trf_persona_store_set_full_name_co (_data_);
}


static gboolean _trf_persona_store_set_full_name_co (TrfPersonaStoreSetFullNameData* _data_) {
	static const char query_t[] = "DELETE { " " ?p " TRF_ONTOLOGY_DEFS_NCO_FULLNAME " ?fn " "} " "WHERE { " " ?p a " TRF_ONTOLOGY_DEFS_NCO_PERSON " .  " " OPTIONAL { ?p " TRF_ONTOLOGY_DEFS_NCO_FULLNAME " ?fn } . " " FILTER (tracker:id(?p) = %s) " "} " "INSERT { " " ?p " TRF_ONTOLOGY_DEFS_NCO_FULLNAME " '%s' " "} " "WHERE { " " ?p a " TRF_ONTOLOGY_DEFS_NCO_PERSON " . " " FILTER (tracker:id(?p) = %s) " "} ";
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->persona;
	_data_->_tmp1_ = NULL;
	_data_->_tmp1_ = trf_persona_tracker_id (TRF_PERSONA (_data_->_tmp0_));
	_data_->p_id = _data_->_tmp1_;
	_data_->_tmp2_ = _data_->full_name;
	_data_->_tmp3_ = NULL;
	_data_->_tmp3_ = g_strdup_printf (query_t, _data_->p_id, _data_->_tmp2_, _data_->p_id);
	_data_->query = _data_->_tmp3_;
	_data_->_state_ = 1;
	_trf_persona_store_tracker_update (_data_->self, _data_->query, "_set_full_name", _trf_persona_store_set_full_name_ready, _data_);
	return FALSE;
	_state_1:
	_trf_persona_store_tracker_update_finish (_data_->self, _data_->_res_);
	_g_free0 (_data_->query);
	_g_free0 (_data_->p_id);
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


static void _trf_persona_store_set_attrib_set_data_free (gpointer _data) {
	TrfPersonaStoreSetAttribSetData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->persona);
	_g_object_unref0 (_data_->attribs);
	_g_object_unref0 (_data_->self);
	g_slice_free (TrfPersonaStoreSetAttribSetData, _data_);
}


static void _trf_persona_store_set_attrib_set (TrfPersonaStore* self, FolksPersona* persona, GeeSet* attribs, TrfAttrib what, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	TrfPersonaStoreSetAttribSetData* _data_;
	TrfPersonaStore* _tmp0_;
	FolksPersona* _tmp1_;
	FolksPersona* _tmp2_;
	GeeSet* _tmp3_;
	GeeSet* _tmp4_;
	TrfAttrib _tmp5_;
	_data_ = g_slice_new0 (TrfPersonaStoreSetAttribSetData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, _trf_persona_store_set_attrib_set);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, _trf_persona_store_set_attrib_set_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = persona;
	_tmp2_ = _g_object_ref0 (_tmp1_);
	_data_->persona = _tmp2_;
	_tmp3_ = attribs;
	_tmp4_ = _g_object_ref0 (_tmp3_);
	_data_->attribs = _tmp4_;
	_tmp5_ = what;
	_data_->what = _tmp5_;
	_trf_persona_store_set_attrib_set_co (_data_);
}


static void _trf_persona_store_set_attrib_set_finish (TrfPersonaStore* self, GAsyncResult* _res_) {
	TrfPersonaStoreSetAttribSetData* _data_;
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
}


static void _trf_persona_store_set_attrib_set_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	TrfPersonaStoreSetAttribSetData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	_trf_persona_store_set_attrib_set_co (_data_);
}


static gboolean _trf_persona_store_set_attrib_set_co (TrfPersonaStoreSetAttribSetData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		case 2:
		goto _state_2;
		case 3:
		goto _state_3;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->persona;
	_data_->_tmp1_ = NULL;
	_data_->_tmp1_ = trf_persona_tracker_id (TRF_PERSONA (_data_->_tmp0_));
	_data_->p_id = _data_->_tmp1_;
	_data_->related_attrib = NULL;
	_data_->related_prop = NULL;
	_data_->related_prop_2 = NULL;
	_data_->related_connection = NULL;
	_data_->_tmp2_ = _data_->what;
	switch (_data_->_tmp2_) {
		case TRF_ATTRIB_IM_ADDRESSES:
		{
			_data_->related_attrib = TRF_ONTOLOGY_DEFS_NCO_IMADDRESS;
			_data_->related_prop = TRF_ONTOLOGY_DEFS_NCO_IMID;
			_data_->related_prop_2 = TRF_ONTOLOGY_DEFS_NCO_IMPROTOCOL;
			_data_->related_connection = TRF_ONTOLOGY_DEFS_NCO_HAS_IMADDRESS;
			_data_->_tmp3_ = _data_->persona;
			_data_->_state_ = 1;
			_trf_persona_store_remove_attributes_from_persona (_data_->self, _data_->_tmp3_, _REMOVE_IM_ADDRS, _trf_persona_store_set_attrib_set_ready, _data_);
			return FALSE;
			_state_1:
			_data_->_tmp4_ = NULL;
			_data_->_tmp4_ = _trf_persona_store_remove_attributes_from_persona_finish (_data_->self, _data_->_res_);
			_data_->_tmp5_ = _data_->_tmp4_;
			_g_free0 (_data_->_tmp5_);
			break;
		}
		case TRF_ATTRIB_POSTAL_ADDRESSES:
		{
			_data_->related_attrib = TRF_ONTOLOGY_DEFS_NCO_POSTAL_ADDRESS;
			_data_->related_connection = TRF_ONTOLOGY_DEFS_NCO_HAS_POSTAL_ADDRESS;
			_data_->_tmp6_ = _data_->persona;
			_data_->_state_ = 2;
			_trf_persona_store_remove_attributes_from_persona (_data_->self, _data_->_tmp6_, _REMOVE_POSTALS, _trf_persona_store_set_attrib_set_ready, _data_);
			return FALSE;
			_state_2:
			_data_->_tmp7_ = NULL;
			_data_->_tmp7_ = _trf_persona_store_remove_attributes_from_persona_finish (_data_->self, _data_->_res_);
			_data_->_tmp8_ = _data_->_tmp7_;
			_g_free0 (_data_->_tmp8_);
			break;
		}
		case TRF_ATTRIB_URLS:
		{
			_data_->related_attrib = TRF_ONTOLOGY_DEFS_NCO_URL;
			_data_->related_connection = TRF_ONTOLOGY_DEFS_NCO_URL;
			break;
		}
		default:
		break;
	}
	_data_->_tmp9_ = tracker_sparql_builder_new_update ();
	_data_->builder = _data_->_tmp9_;
	_data_->_tmp10_ = _data_->builder;
	tracker_sparql_builder_insert_open (_data_->_tmp10_, NULL);
	_data_->i = 0;
	{
		_data_->_tmp11_ = _data_->attribs;
		_data_->_tmp12_ = NULL;
		_data_->_tmp12_ = gee_iterable_iterator ((GeeIterable*) _data_->_tmp11_);
		_data_->_p_it = _data_->_tmp12_;
		while (TRUE) {
			_data_->_tmp13_ = _data_->_p_it;
			_data_->_tmp14_ = FALSE;
			_data_->_tmp14_ = gee_iterator_next (_data_->_tmp13_);
			if (!_data_->_tmp14_) {
				break;
			}
			_data_->_tmp15_ = _data_->_p_it;
			_data_->_tmp16_ = NULL;
			_data_->_tmp16_ = gee_iterator_get (_data_->_tmp15_);
			_data_->p = (GObject*) _data_->_tmp16_;
			_data_->fd = NULL;
			_data_->pafd = NULL;
			_data_->pa = NULL;
			_data_->_tmp17_ = _data_->i;
			_data_->_tmp18_ = NULL;
			_data_->_tmp18_ = g_strdup_printf ("_:a%d", _data_->_tmp17_);
			_data_->affl = _data_->_tmp18_;
			_data_->attr = NULL;
			_data_->_tmp19_ = _data_->what;
			switch (_data_->_tmp19_) {
				case TRF_ATTRIB_POSTAL_ADDRESSES:
				{
					_data_->_tmp20_ = _data_->p;
					_data_->_tmp21_ = _g_object_ref0 (FOLKS_POSTAL_ADDRESS_FIELD_DETAILS (_data_->_tmp20_));
					_g_object_unref0 (_data_->pafd);
					_data_->pafd = _data_->_tmp21_;
					_data_->_tmp22_ = _data_->pafd;
					_data_->_tmp23_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) _data_->_tmp22_);
					_data_->_tmp24_ = _data_->_tmp23_;
					_data_->_tmp25_ = _g_object_ref0 ((FolksPostalAddress*) _data_->_tmp24_);
					_g_object_unref0 (_data_->pa);
					_data_->pa = _data_->_tmp25_;
					_data_->_tmp26_ = _data_->i;
					_data_->_tmp27_ = NULL;
					_data_->_tmp27_ = g_strdup_printf ("_:p%d", _data_->_tmp26_);
					_g_free0 (_data_->attr);
					_data_->attr = _data_->_tmp27_;
					_data_->_tmp28_ = _data_->builder;
					_data_->_tmp29_ = _data_->attr;
					tracker_sparql_builder_subject (_data_->_tmp28_, _data_->_tmp29_);
					_data_->_tmp30_ = _data_->builder;
					tracker_sparql_builder_predicate (_data_->_tmp30_, "a");
					_data_->_tmp31_ = _data_->builder;
					_data_->_tmp32_ = _data_->related_attrib;
					tracker_sparql_builder_object (_data_->_tmp31_, _data_->_tmp32_);
					_data_->_tmp33_ = _data_->builder;
					tracker_sparql_builder_predicate (_data_->_tmp33_, TRF_ONTOLOGY_DEFS_NCO_POBOX);
					_data_->_tmp34_ = _data_->builder;
					_data_->_tmp35_ = _data_->pa;
					_data_->_tmp36_ = folks_postal_address_get_po_box (_data_->_tmp35_);
					_data_->_tmp37_ = _data_->_tmp36_;
					tracker_sparql_builder_object_string (_data_->_tmp34_, _data_->_tmp37_);
					_data_->_tmp38_ = _data_->builder;
					tracker_sparql_builder_predicate (_data_->_tmp38_, TRF_ONTOLOGY_DEFS_NCO_LOCALITY);
					_data_->_tmp39_ = _data_->builder;
					_data_->_tmp40_ = _data_->pa;
					_data_->_tmp41_ = folks_postal_address_get_locality (_data_->_tmp40_);
					_data_->_tmp42_ = _data_->_tmp41_;
					tracker_sparql_builder_object_string (_data_->_tmp39_, _data_->_tmp42_);
					_data_->_tmp43_ = _data_->builder;
					tracker_sparql_builder_predicate (_data_->_tmp43_, TRF_ONTOLOGY_DEFS_NCO_POSTALCODE);
					_data_->_tmp44_ = _data_->builder;
					_data_->_tmp45_ = _data_->pa;
					_data_->_tmp46_ = folks_postal_address_get_postal_code (_data_->_tmp45_);
					_data_->_tmp47_ = _data_->_tmp46_;
					tracker_sparql_builder_object_string (_data_->_tmp44_, _data_->_tmp47_);
					_data_->_tmp48_ = _data_->builder;
					tracker_sparql_builder_predicate (_data_->_tmp48_, TRF_ONTOLOGY_DEFS_NCO_STREET_ADDRESS);
					_data_->_tmp49_ = _data_->builder;
					_data_->_tmp50_ = _data_->pa;
					_data_->_tmp51_ = folks_postal_address_get_street (_data_->_tmp50_);
					_data_->_tmp52_ = _data_->_tmp51_;
					tracker_sparql_builder_object_string (_data_->_tmp49_, _data_->_tmp52_);
					_data_->_tmp53_ = _data_->builder;
					tracker_sparql_builder_predicate (_data_->_tmp53_, TRF_ONTOLOGY_DEFS_NCO_EXTENDED_ADDRESS);
					_data_->_tmp54_ = _data_->builder;
					_data_->_tmp55_ = _data_->pa;
					_data_->_tmp56_ = folks_postal_address_get_extension (_data_->_tmp55_);
					_data_->_tmp57_ = _data_->_tmp56_;
					tracker_sparql_builder_object_string (_data_->_tmp54_, _data_->_tmp57_);
					_data_->_tmp58_ = _data_->builder;
					tracker_sparql_builder_predicate (_data_->_tmp58_, TRF_ONTOLOGY_DEFS_NCO_COUNTRY);
					_data_->_tmp59_ = _data_->builder;
					_data_->_tmp60_ = _data_->pa;
					_data_->_tmp61_ = folks_postal_address_get_country (_data_->_tmp60_);
					_data_->_tmp62_ = _data_->_tmp61_;
					tracker_sparql_builder_object_string (_data_->_tmp59_, _data_->_tmp62_);
					_data_->_tmp63_ = _data_->builder;
					tracker_sparql_builder_predicate (_data_->_tmp63_, TRF_ONTOLOGY_DEFS_NCO_REGION);
					_data_->_tmp64_ = _data_->builder;
					_data_->_tmp65_ = _data_->pa;
					_data_->_tmp66_ = folks_postal_address_get_region (_data_->_tmp65_);
					_data_->_tmp67_ = _data_->_tmp66_;
					tracker_sparql_builder_object_string (_data_->_tmp64_, _data_->_tmp67_);
					break;
				}
				case TRF_ATTRIB_URLS:
				{
					_data_->_tmp68_ = _data_->p;
					_data_->_tmp69_ = _g_object_ref0 ((FolksAbstractFieldDetails*) FOLKS_URL_FIELD_DETAILS (_data_->_tmp68_));
					_g_object_unref0 (_data_->fd);
					_data_->fd = _data_->_tmp69_;
					_data_->_tmp70_ = _data_->fd;
					_data_->_tmp71_ = NULL;
					_data_->_tmp71_ = folks_abstract_field_details_get_parameter_values (_data_->_tmp70_, "type");
					_data_->type_p = _data_->_tmp71_;
					_data_->_tmp72_ = _data_->type_p;
					_data_->_tmp73_ = FALSE;
					_data_->_tmp73_ = gee_collection_contains (_data_->_tmp72_, "blog");
					if (_data_->_tmp73_) {
						_data_->related_connection = TRF_ONTOLOGY_DEFS_NCO_BLOG;
					} else {
						_data_->_tmp74_ = _data_->type_p;
						_data_->_tmp75_ = FALSE;
						_data_->_tmp75_ = gee_collection_contains (_data_->_tmp74_, "website");
						if (_data_->_tmp75_) {
							_data_->related_connection = TRF_ONTOLOGY_DEFS_NCO_WEBSITE;
						} else {
							_data_->_tmp76_ = _data_->type_p;
							_data_->_tmp77_ = FALSE;
							_data_->_tmp77_ = gee_collection_contains (_data_->_tmp76_, "url");
							if (_data_->_tmp77_) {
								_data_->related_connection = TRF_ONTOLOGY_DEFS_NCO_URL;
							}
						}
					}
					_data_->_tmp78_ = _data_->fd;
					_data_->_tmp79_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) FOLKS_URL_FIELD_DETAILS (_data_->_tmp78_));
					_data_->_tmp80_ = _data_->_tmp79_;
					_data_->_tmp81_ = NULL;
					_data_->_tmp81_ = g_strdup_printf ("'%s'", (const gchar*) _data_->_tmp80_);
					_g_free0 (_data_->attr);
					_data_->attr = _data_->_tmp81_;
					_g_object_unref0 (_data_->type_p);
					break;
				}
				default:
				case TRF_ATTRIB_IM_ADDRESSES:
				{
					_data_->_tmp82_ = _data_->p;
					_data_->_tmp83_ = _g_object_ref0 ((FolksAbstractFieldDetails*) FOLKS_IM_FIELD_DETAILS (_data_->_tmp82_));
					_g_object_unref0 (_data_->fd);
					_data_->fd = _data_->_tmp83_;
					_data_->_tmp84_ = _data_->i;
					_data_->_tmp85_ = NULL;
					_data_->_tmp85_ = g_strdup_printf ("_:p%d", _data_->_tmp84_);
					_g_free0 (_data_->attr);
					_data_->attr = _data_->_tmp85_;
					_data_->_tmp86_ = _data_->builder;
					_data_->_tmp87_ = _data_->attr;
					tracker_sparql_builder_subject (_data_->_tmp86_, _data_->_tmp87_);
					_data_->_tmp88_ = _data_->builder;
					tracker_sparql_builder_predicate (_data_->_tmp88_, "a");
					_data_->_tmp89_ = _data_->builder;
					_data_->_tmp90_ = _data_->related_attrib;
					tracker_sparql_builder_object (_data_->_tmp89_, _data_->_tmp90_);
					_data_->_tmp91_ = _data_->builder;
					_data_->_tmp92_ = _data_->related_prop;
					tracker_sparql_builder_predicate (_data_->_tmp91_, _data_->_tmp92_);
					_data_->_tmp93_ = _data_->builder;
					_data_->_tmp94_ = _data_->fd;
					_data_->_tmp95_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) FOLKS_IM_FIELD_DETAILS (_data_->_tmp94_));
					_data_->_tmp96_ = _data_->_tmp95_;
					tracker_sparql_builder_object_string (_data_->_tmp93_, (const gchar*) _data_->_tmp96_);
					_data_->_tmp97_ = _data_->what;
					if (_data_->_tmp97_ == TRF_ATTRIB_IM_ADDRESSES) {
						_data_->_tmp98_ = _data_->builder;
						_data_->_tmp99_ = _data_->related_prop_2;
						tracker_sparql_builder_predicate (_data_->_tmp98_, _data_->_tmp99_);
						_data_->_tmp100_ = _data_->fd;
						_data_->_tmp101_ = NULL;
						_data_->_tmp101_ = folks_abstract_field_details_get_parameter_values (_data_->_tmp100_, "proto");
						_data_->_tmp102_ = _data_->_tmp101_;
						_data_->_tmp103_ = 0;
						_data_->_tmp104_ = NULL;
						_data_->_tmp104_ = gee_collection_to_array (_data_->_tmp102_, &_data_->_tmp103_);
						_data_->_tmp105_ = _data_->_tmp104_;
						_data_->_tmp105__length1 = _data_->_tmp103_;
						_g_object_unref0 (_data_->_tmp102_);
						_data_->im_params = _data_->_tmp105_;
						_data_->im_params_length1 = _data_->_tmp105__length1;
						_data_->_im_params_size_ = _data_->im_params_length1;
						_data_->_tmp106_ = _data_->builder;
						_data_->_tmp107_ = _data_->im_params;
						_data_->_tmp107__length1 = _data_->im_params_length1;
						_data_->_tmp108_ = _data_->_tmp107_[0];
						tracker_sparql_builder_object_string (_data_->_tmp106_, _data_->_tmp108_);
						_data_->im_params = (_vala_array_free (_data_->im_params, _data_->im_params_length1, (GDestroyNotify) g_free), NULL);
					}
					break;
				}
			}
			_data_->_tmp109_ = _data_->builder;
			_data_->_tmp110_ = _data_->affl;
			tracker_sparql_builder_subject (_data_->_tmp109_, _data_->_tmp110_);
			_data_->_tmp111_ = _data_->builder;
			tracker_sparql_builder_predicate (_data_->_tmp111_, "a");
			_data_->_tmp112_ = _data_->builder;
			tracker_sparql_builder_object (_data_->_tmp112_, TRF_ONTOLOGY_DEFS_NCO_AFFILIATION);
			_data_->_tmp113_ = _data_->builder;
			_data_->_tmp114_ = _data_->related_connection;
			tracker_sparql_builder_predicate (_data_->_tmp113_, _data_->_tmp114_);
			_data_->_tmp115_ = _data_->builder;
			_data_->_tmp116_ = _data_->attr;
			tracker_sparql_builder_object (_data_->_tmp115_, _data_->_tmp116_);
			_data_->_tmp117_ = _data_->builder;
			tracker_sparql_builder_subject (_data_->_tmp117_, "?contact");
			_data_->_tmp118_ = _data_->builder;
			tracker_sparql_builder_predicate (_data_->_tmp118_, TRF_ONTOLOGY_DEFS_NCO_HAS_AFFILIATION);
			_data_->_tmp119_ = _data_->builder;
			_data_->_tmp120_ = _data_->affl;
			tracker_sparql_builder_object (_data_->_tmp119_, _data_->_tmp120_);
			_data_->_tmp121_ = _data_->i;
			_data_->i = _data_->_tmp121_ + 1;
			_g_free0 (_data_->attr);
			_g_free0 (_data_->affl);
			_g_object_unref0 (_data_->pa);
			_g_object_unref0 (_data_->pafd);
			_g_object_unref0 (_data_->fd);
			_g_object_unref0 (_data_->p);
		}
		_g_object_unref0 (_data_->_p_it);
	}
	_data_->_tmp122_ = _data_->builder;
	tracker_sparql_builder_insert_close (_data_->_tmp122_);
	_data_->_tmp123_ = _data_->builder;
	tracker_sparql_builder_where_open (_data_->_tmp123_);
	_data_->_tmp124_ = _data_->builder;
	tracker_sparql_builder_subject (_data_->_tmp124_, "?contact");
	_data_->_tmp125_ = _data_->builder;
	tracker_sparql_builder_predicate (_data_->_tmp125_, "a");
	_data_->_tmp126_ = _data_->builder;
	tracker_sparql_builder_object (_data_->_tmp126_, TRF_ONTOLOGY_DEFS_NCO_PERSON);
	_data_->_tmp127_ = _data_->p_id;
	_data_->_tmp128_ = NULL;
	_data_->_tmp128_ = g_strdup_printf (" FILTER(tracker:id(?contact) = %s) ", _data_->_tmp127_);
	_data_->filter = _data_->_tmp128_;
	_data_->_tmp129_ = _data_->builder;
	tracker_sparql_builder_append (_data_->_tmp129_, _data_->filter);
	_data_->_tmp130_ = _data_->builder;
	tracker_sparql_builder_where_close (_data_->_tmp130_);
	_data_->_tmp131_ = _data_->builder;
	_data_->_tmp132_ = tracker_sparql_builder_get_result (_data_->_tmp131_);
	_data_->_tmp133_ = _data_->_tmp132_;
	_data_->_state_ = 3;
	_trf_persona_store_tracker_update (_data_->self, _data_->_tmp133_, "set_attrib", _trf_persona_store_set_attrib_set_ready, _data_);
	return FALSE;
	_state_3:
	_trf_persona_store_tracker_update_finish (_data_->self, _data_->_res_);
	_g_free0 (_data_->filter);
	_g_object_unref0 (_data_->builder);
	_g_free0 (_data_->p_id);
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


static void _trf_persona_store_tracker_update_data_free (gpointer _data) {
	TrfPersonaStoreTrackerUpdateData* _data_;
	_data_ = _data;
	_g_free0 (_data_->query);
	_g_free0 (_data_->caller);
	_g_object_unref0 (_data_->self);
	g_slice_free (TrfPersonaStoreTrackerUpdateData, _data_);
}


static void _trf_persona_store_tracker_update (TrfPersonaStore* self, const gchar* query, const gchar* caller, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	TrfPersonaStoreTrackerUpdateData* _data_;
	TrfPersonaStore* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	const gchar* _tmp3_;
	const gchar* _tmp4_;
	_data_ = g_slice_new0 (TrfPersonaStoreTrackerUpdateData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, _trf_persona_store_tracker_update);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, _trf_persona_store_tracker_update_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = query;
	_tmp2_ = g_strdup (_tmp1_);
	_data_->query = _tmp2_;
	_tmp3_ = caller;
	_tmp4_ = g_strdup (_tmp3_);
	_data_->caller = _tmp4_;
	_trf_persona_store_tracker_update_co (_data_);
}


static gboolean _trf_persona_store_tracker_update_finish (TrfPersonaStore* self, GAsyncResult* _res_) {
	gboolean result;
	TrfPersonaStoreTrackerUpdateData* _data_;
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
	result = _data_->result;
	return result;
}


static void _trf_persona_store_tracker_update_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	TrfPersonaStoreTrackerUpdateData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	_trf_persona_store_tracker_update_co (_data_);
}


static gboolean _trf_persona_store_tracker_update_co (TrfPersonaStoreTrackerUpdateData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->ret = FALSE;
	_data_->_tmp0_ = _data_->caller;
	_data_->_tmp1_ = _data_->query;
	g_debug ("trf-persona-store.vala:2507: %s: %s", _data_->_tmp0_, _data_->_tmp1_);
	{
		_data_->_tmp2_ = _data_->self->priv->_connection;
		_data_->_tmp3_ = _data_->query;
		_data_->_state_ = 1;
		tracker_sparql_connection_update_async (_data_->_tmp2_, _data_->_tmp3_, G_PRIORITY_DEFAULT, NULL, _trf_persona_store_tracker_update_ready, _data_);
		return FALSE;
		_state_1:
		tracker_sparql_connection_update_finish (_data_->_tmp2_, _data_->_res_, &_data_->_inner_error_);
		if (_data_->_inner_error_ != NULL) {
			if (_data_->_inner_error_->domain == TRACKER_SPARQL_ERROR) {
				goto __catch13_tracker_sparql_error;
			}
			if (_data_->_inner_error_->domain == G_IO_ERROR) {
				goto __catch13_g_io_error;
			}
			if (_data_->_inner_error_->domain == G_DBUS_ERROR) {
				goto __catch13_g_dbus_error;
			}
			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
			g_clear_error (&_data_->_inner_error_);
			return FALSE;
		}
		_data_->ret = TRUE;
	}
	goto __finally13;
	__catch13_tracker_sparql_error:
	{
		_data_->e1 = _data_->_inner_error_;
		_data_->_inner_error_ = NULL;
		_data_->_tmp4_ = _data_->caller;
		_data_->_tmp5_ = _data_->e1;
		_data_->_tmp6_ = _data_->_tmp5_->message;
		_data_->_tmp7_ = _data_->query;
		g_warning ("trf-persona-store.vala:2516: [%s] SPARQL syntax error: %s. Query: %s", _data_->_tmp4_, _data_->_tmp6_, _data_->_tmp7_);
		_g_error_free0 (_data_->e1);
	}
	goto __finally13;
	__catch13_g_io_error:
	{
		_data_->e2 = _data_->_inner_error_;
		_data_->_inner_error_ = NULL;
		_data_->_tmp8_ = _data_->caller;
		_data_->_tmp9_ = _data_->e2;
		_data_->_tmp10_ = _data_->_tmp9_->message;
		g_warning ("trf-persona-store.vala:2521: [%s] IO error: %s", _data_->_tmp8_, _data_->_tmp10_);
		_g_error_free0 (_data_->e2);
	}
	goto __finally13;
	__catch13_g_dbus_error:
	{
		_data_->e3 = _data_->_inner_error_;
		_data_->_inner_error_ = NULL;
		_data_->_tmp11_ = _data_->caller;
		_data_->_tmp12_ = _data_->e3;
		_data_->_tmp13_ = _data_->_tmp12_->message;
		g_warning ("trf-persona-store.vala:2526: [%s] DBus error: %s", _data_->_tmp11_, _data_->_tmp13_);
		_g_error_free0 (_data_->e3);
	}
	__finally13:
	if (_data_->_inner_error_ != NULL) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
		g_clear_error (&_data_->_inner_error_);
		return FALSE;
	}
	_data_->result = _data_->ret;
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


static void _trf_persona_store_affiliations_from_persona_data_free (gpointer _data) {
	TrfPersonaStoreAffiliationsFromPersonaData* _data_;
	_data_ = _data;
	_g_free0 (_data_->urn);
	_g_object_unref0 (_data_->result);
	_g_object_unref0 (_data_->self);
	g_slice_free (TrfPersonaStoreAffiliationsFromPersonaData, _data_);
}


static void _trf_persona_store_affiliations_from_persona (TrfPersonaStore* self, const gchar* urn, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	TrfPersonaStoreAffiliationsFromPersonaData* _data_;
	TrfPersonaStore* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	_data_ = g_slice_new0 (TrfPersonaStoreAffiliationsFromPersonaData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, _trf_persona_store_affiliations_from_persona);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, _trf_persona_store_affiliations_from_persona_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = urn;
	_tmp2_ = g_strdup (_tmp1_);
	_data_->urn = _tmp2_;
	_trf_persona_store_affiliations_from_persona_co (_data_);
}


static GeeHashSet* _trf_persona_store_affiliations_from_persona_finish (TrfPersonaStore* self, GAsyncResult* _res_) {
	GeeHashSet* result;
	TrfPersonaStoreAffiliationsFromPersonaData* _data_;
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
	result = _data_->result;
	_data_->result = NULL;
	return result;
}


static void _trf_persona_store_affiliations_from_persona_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	TrfPersonaStoreAffiliationsFromPersonaData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	_trf_persona_store_affiliations_from_persona_co (_data_);
}


static gboolean _trf_persona_store_affiliations_from_persona_co (TrfPersonaStoreAffiliationsFromPersonaData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->urn;
	_data_->_state_ = 1;
	_trf_persona_store_linked_resources (_data_->self, _data_->_tmp0_, TRF_ONTOLOGY_DEFS_NCO_PERSON, TRF_ONTOLOGY_DEFS_NCO_HAS_AFFILIATION, _trf_persona_store_affiliations_from_persona_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp1_ = NULL;
	_data_->_tmp1_ = _trf_persona_store_linked_resources_finish (_data_->self, _data_->_res_);
	_data_->result = _data_->_tmp1_;
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


static void _trf_persona_store_phones_from_affiliation_data_free (gpointer _data) {
	TrfPersonaStorePhonesFromAffiliationData* _data_;
	_data_ = _data;
	_g_free0 (_data_->affl);
	_g_object_unref0 (_data_->result);
	_g_object_unref0 (_data_->self);
	g_slice_free (TrfPersonaStorePhonesFromAffiliationData, _data_);
}


static void _trf_persona_store_phones_from_affiliation (TrfPersonaStore* self, const gchar* affl, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	TrfPersonaStorePhonesFromAffiliationData* _data_;
	TrfPersonaStore* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	_data_ = g_slice_new0 (TrfPersonaStorePhonesFromAffiliationData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, _trf_persona_store_phones_from_affiliation);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, _trf_persona_store_phones_from_affiliation_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = affl;
	_tmp2_ = g_strdup (_tmp1_);
	_data_->affl = _tmp2_;
	_trf_persona_store_phones_from_affiliation_co (_data_);
}


static GeeHashSet* _trf_persona_store_phones_from_affiliation_finish (TrfPersonaStore* self, GAsyncResult* _res_) {
	GeeHashSet* result;
	TrfPersonaStorePhonesFromAffiliationData* _data_;
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
	result = _data_->result;
	_data_->result = NULL;
	return result;
}


static void _trf_persona_store_phones_from_affiliation_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	TrfPersonaStorePhonesFromAffiliationData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	_trf_persona_store_phones_from_affiliation_co (_data_);
}


static gboolean _trf_persona_store_phones_from_affiliation_co (TrfPersonaStorePhonesFromAffiliationData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->affl;
	_data_->_state_ = 1;
	_trf_persona_store_linked_resources (_data_->self, _data_->_tmp0_, TRF_ONTOLOGY_DEFS_NCO_AFFILIATION, TRF_ONTOLOGY_DEFS_NCO_HAS_PHONE, _trf_persona_store_phones_from_affiliation_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp1_ = NULL;
	_data_->_tmp1_ = _trf_persona_store_linked_resources_finish (_data_->self, _data_->_res_);
	_data_->result = _data_->_tmp1_;
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


static void _trf_persona_store_postals_from_affiliation_data_free (gpointer _data) {
	TrfPersonaStorePostalsFromAffiliationData* _data_;
	_data_ = _data;
	_g_free0 (_data_->affl);
	_g_object_unref0 (_data_->result);
	_g_object_unref0 (_data_->self);
	g_slice_free (TrfPersonaStorePostalsFromAffiliationData, _data_);
}


static void _trf_persona_store_postals_from_affiliation (TrfPersonaStore* self, const gchar* affl, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	TrfPersonaStorePostalsFromAffiliationData* _data_;
	TrfPersonaStore* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	_data_ = g_slice_new0 (TrfPersonaStorePostalsFromAffiliationData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, _trf_persona_store_postals_from_affiliation);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, _trf_persona_store_postals_from_affiliation_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = affl;
	_tmp2_ = g_strdup (_tmp1_);
	_data_->affl = _tmp2_;
	_trf_persona_store_postals_from_affiliation_co (_data_);
}


static GeeHashSet* _trf_persona_store_postals_from_affiliation_finish (TrfPersonaStore* self, GAsyncResult* _res_) {
	GeeHashSet* result;
	TrfPersonaStorePostalsFromAffiliationData* _data_;
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
	result = _data_->result;
	_data_->result = NULL;
	return result;
}


static void _trf_persona_store_postals_from_affiliation_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	TrfPersonaStorePostalsFromAffiliationData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	_trf_persona_store_postals_from_affiliation_co (_data_);
}


static gboolean _trf_persona_store_postals_from_affiliation_co (TrfPersonaStorePostalsFromAffiliationData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->affl;
	_data_->_state_ = 1;
	_trf_persona_store_linked_resources (_data_->self, _data_->_tmp0_, TRF_ONTOLOGY_DEFS_NCO_AFFILIATION, TRF_ONTOLOGY_DEFS_NCO_HAS_POSTAL_ADDRESS, _trf_persona_store_postals_from_affiliation_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp1_ = NULL;
	_data_->_tmp1_ = _trf_persona_store_linked_resources_finish (_data_->self, _data_->_res_);
	_data_->result = _data_->_tmp1_;
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


static void _trf_persona_store_imaddrs_from_affiliation_data_free (gpointer _data) {
	TrfPersonaStoreImaddrsFromAffiliationData* _data_;
	_data_ = _data;
	_g_free0 (_data_->affl);
	_g_object_unref0 (_data_->result);
	_g_object_unref0 (_data_->self);
	g_slice_free (TrfPersonaStoreImaddrsFromAffiliationData, _data_);
}


static void _trf_persona_store_imaddrs_from_affiliation (TrfPersonaStore* self, const gchar* affl, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	TrfPersonaStoreImaddrsFromAffiliationData* _data_;
	TrfPersonaStore* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	_data_ = g_slice_new0 (TrfPersonaStoreImaddrsFromAffiliationData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, _trf_persona_store_imaddrs_from_affiliation);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, _trf_persona_store_imaddrs_from_affiliation_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = affl;
	_tmp2_ = g_strdup (_tmp1_);
	_data_->affl = _tmp2_;
	_trf_persona_store_imaddrs_from_affiliation_co (_data_);
}


static GeeHashSet* _trf_persona_store_imaddrs_from_affiliation_finish (TrfPersonaStore* self, GAsyncResult* _res_) {
	GeeHashSet* result;
	TrfPersonaStoreImaddrsFromAffiliationData* _data_;
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
	result = _data_->result;
	_data_->result = NULL;
	return result;
}


static void _trf_persona_store_imaddrs_from_affiliation_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	TrfPersonaStoreImaddrsFromAffiliationData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	_trf_persona_store_imaddrs_from_affiliation_co (_data_);
}


static gboolean _trf_persona_store_imaddrs_from_affiliation_co (TrfPersonaStoreImaddrsFromAffiliationData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->affl;
	_data_->_state_ = 1;
	_trf_persona_store_linked_resources (_data_->self, _data_->_tmp0_, TRF_ONTOLOGY_DEFS_NCO_AFFILIATION, TRF_ONTOLOGY_DEFS_NCO_HAS_IMADDRESS, _trf_persona_store_imaddrs_from_affiliation_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp1_ = NULL;
	_data_->_tmp1_ = _trf_persona_store_linked_resources_finish (_data_->self, _data_->_res_);
	_data_->result = _data_->_tmp1_;
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


static void _trf_persona_store_emails_from_affiliation_data_free (gpointer _data) {
	TrfPersonaStoreEmailsFromAffiliationData* _data_;
	_data_ = _data;
	_g_free0 (_data_->affl);
	_g_object_unref0 (_data_->result);
	_g_object_unref0 (_data_->self);
	g_slice_free (TrfPersonaStoreEmailsFromAffiliationData, _data_);
}


static void _trf_persona_store_emails_from_affiliation (TrfPersonaStore* self, const gchar* affl, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	TrfPersonaStoreEmailsFromAffiliationData* _data_;
	TrfPersonaStore* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	_data_ = g_slice_new0 (TrfPersonaStoreEmailsFromAffiliationData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, _trf_persona_store_emails_from_affiliation);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, _trf_persona_store_emails_from_affiliation_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = affl;
	_tmp2_ = g_strdup (_tmp1_);
	_data_->affl = _tmp2_;
	_trf_persona_store_emails_from_affiliation_co (_data_);
}


static GeeHashSet* _trf_persona_store_emails_from_affiliation_finish (TrfPersonaStore* self, GAsyncResult* _res_) {
	GeeHashSet* result;
	TrfPersonaStoreEmailsFromAffiliationData* _data_;
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
	result = _data_->result;
	_data_->result = NULL;
	return result;
}


static void _trf_persona_store_emails_from_affiliation_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	TrfPersonaStoreEmailsFromAffiliationData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	_trf_persona_store_emails_from_affiliation_co (_data_);
}


static gboolean _trf_persona_store_emails_from_affiliation_co (TrfPersonaStoreEmailsFromAffiliationData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->affl;
	_data_->_state_ = 1;
	_trf_persona_store_linked_resources (_data_->self, _data_->_tmp0_, TRF_ONTOLOGY_DEFS_NCO_AFFILIATION, TRF_ONTOLOGY_DEFS_NCO_HAS_EMAIL, _trf_persona_store_emails_from_affiliation_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp1_ = NULL;
	_data_->_tmp1_ = _trf_persona_store_linked_resources_finish (_data_->self, _data_->_res_);
	_data_->result = _data_->_tmp1_;
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


static void _trf_persona_store_resource_usage_count_data_free (gpointer _data) {
	TrfPersonaStoreResourceUsageCountData* _data_;
	_data_ = _data;
	_g_free0 (_data_->resource);
	_g_object_unref0 (_data_->self);
	g_slice_free (TrfPersonaStoreResourceUsageCountData, _data_);
}


static void _trf_persona_store_resource_usage_count (TrfPersonaStore* self, const gchar* resource, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	TrfPersonaStoreResourceUsageCountData* _data_;
	TrfPersonaStore* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	_data_ = g_slice_new0 (TrfPersonaStoreResourceUsageCountData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, _trf_persona_store_resource_usage_count);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, _trf_persona_store_resource_usage_count_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = resource;
	_tmp2_ = g_strdup (_tmp1_);
	_data_->resource = _tmp2_;
	_trf_persona_store_resource_usage_count_co (_data_);
}


static gint _trf_persona_store_resource_usage_count_finish (TrfPersonaStore* self, GAsyncResult* _res_) {
	gint result;
	TrfPersonaStoreResourceUsageCountData* _data_;
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
	result = _data_->result;
	return result;
}


/**
   * Retrieve the list of linked resources of a given subject
   *
   * @param resource          the urn of the resource in <urn> format
   * @return number of resources linking to this resource
   */
static void _trf_persona_store_resource_usage_count_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	TrfPersonaStoreResourceUsageCountData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	_trf_persona_store_resource_usage_count_co (_data_);
}


static gboolean _trf_persona_store_resource_usage_count_co (TrfPersonaStoreResourceUsageCountData* _data_) {
	static const char query_t[] = "SELECT " " count(?s) " "WHERE { " " %s a rdfs:Resource . " " ?s ?p %s } ";
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->resource;
	_data_->_tmp1_ = _data_->resource;
	_data_->_tmp2_ = NULL;
	_data_->_tmp2_ = g_strdup_printf (query_t, _data_->_tmp0_, _data_->_tmp1_);
	_data_->query = _data_->_tmp2_;
	_data_->_state_ = 1;
	_trf_persona_store_single_value_query (_data_->self, _data_->query, _trf_persona_store_resource_usage_count_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp3_ = NULL;
	_data_->_tmp3_ = _trf_persona_store_single_value_query_finish (_data_->self, _data_->_res_);
	_data_->_result_ = _data_->_tmp3_;
	_data_->_tmp4_ = 0;
	_data_->_tmp4_ = atoi (_data_->_result_);
	_data_->result = _data_->_tmp4_;
	_g_free0 (_data_->_result_);
	_g_free0 (_data_->query);
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
	_g_free0 (_data_->_result_);
	_g_free0 (_data_->query);
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


static void _trf_persona_store_delete_resource_data_free (gpointer _data) {
	TrfPersonaStoreDeleteResourceData* _data_;
	_data_ = _data;
	_g_free0 (_data_->resource_urn);
	_g_object_unref0 (_data_->self);
	g_slice_free (TrfPersonaStoreDeleteResourceData, _data_);
}


static void _trf_persona_store_delete_resource (TrfPersonaStore* self, const gchar* resource_urn, gboolean check_count, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	TrfPersonaStoreDeleteResourceData* _data_;
	TrfPersonaStore* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	gboolean _tmp3_;
	_data_ = g_slice_new0 (TrfPersonaStoreDeleteResourceData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, _trf_persona_store_delete_resource);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, _trf_persona_store_delete_resource_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = resource_urn;
	_tmp2_ = g_strdup (_tmp1_);
	_data_->resource_urn = _tmp2_;
	_tmp3_ = check_count;
	_data_->check_count = _tmp3_;
	_trf_persona_store_delete_resource_co (_data_);
}


static gboolean _trf_persona_store_delete_resource_finish (TrfPersonaStore* self, GAsyncResult* _res_) {
	gboolean result;
	TrfPersonaStoreDeleteResourceData* _data_;
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
	result = _data_->result;
	return result;
}


static void _trf_persona_store_delete_resource_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	TrfPersonaStoreDeleteResourceData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	_trf_persona_store_delete_resource_co (_data_);
}


static gboolean _trf_persona_store_delete_resource_co (TrfPersonaStoreDeleteResourceData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		case 2:
		goto _state_2;
		case 3:
		goto _state_3;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->deleted = FALSE;
	_data_->_tmp0_ = g_strdup (" DELETE { " " %s a rdfs:Resource " "} " "WHERE { " " %s a rdfs:Resource " "} ");
	_data_->query_t = _data_->_tmp0_;
	_data_->_tmp1_ = _data_->query_t;
	_data_->_tmp2_ = _data_->resource_urn;
	_data_->_tmp3_ = _data_->resource_urn;
	_data_->_tmp4_ = NULL;
	_data_->_tmp4_ = g_strdup_printf (_data_->_tmp1_, _data_->_tmp2_, _data_->_tmp3_);
	_data_->query = _data_->_tmp4_;
	_data_->_tmp5_ = _data_->check_count;
	if (_data_->_tmp5_) {
		_data_->_tmp6_ = _data_->resource_urn;
		_data_->_state_ = 1;
		_trf_persona_store_resource_usage_count (_data_->self, _data_->_tmp6_, _trf_persona_store_delete_resource_ready, _data_);
		return FALSE;
		_state_1:
		_data_->_tmp7_ = 0;
		_data_->_tmp7_ = _trf_persona_store_resource_usage_count_finish (_data_->self, _data_->_res_);
		_data_->count = _data_->_tmp7_;
		_data_->_tmp8_ = _data_->count;
		if (_data_->_tmp8_ == 1) {
			_data_->_tmp9_ = _data_->query;
			_data_->_state_ = 2;
			_trf_persona_store_tracker_update (_data_->self, _data_->_tmp9_, "_delete_resource", _trf_persona_store_delete_resource_ready, _data_);
			return FALSE;
			_state_2:
			_data_->_tmp10_ = FALSE;
			_data_->_tmp10_ = _trf_persona_store_tracker_update_finish (_data_->self, _data_->_res_);
			_data_->deleted = _data_->_tmp10_;
		}
	} else {
		_data_->_tmp11_ = _data_->query;
		_data_->_state_ = 3;
		_trf_persona_store_tracker_update (_data_->self, _data_->_tmp11_, "_delete_resource", _trf_persona_store_delete_resource_ready, _data_);
		return FALSE;
		_state_3:
		_data_->_tmp12_ = FALSE;
		_data_->_tmp12_ = _trf_persona_store_tracker_update_finish (_data_->self, _data_->_res_);
		_data_->deleted = _data_->_tmp12_;
	}
	_data_->result = _data_->deleted;
	_g_free0 (_data_->query);
	_g_free0 (_data_->query_t);
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
	_g_free0 (_data_->query);
	_g_free0 (_data_->query_t);
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


static void _trf_persona_store_linked_resources_data_free (gpointer _data) {
	TrfPersonaStoreLinkedResourcesData* _data_;
	_data_ = _data;
	_g_free0 (_data_->urn);
	_g_free0 (_data_->subject_type);
	_g_free0 (_data_->linking_predicate);
	_g_object_unref0 (_data_->result);
	_g_object_unref0 (_data_->self);
	g_slice_free (TrfPersonaStoreLinkedResourcesData, _data_);
}


static void _trf_persona_store_linked_resources (TrfPersonaStore* self, const gchar* urn, const gchar* subject_type, const gchar* linking_predicate, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	TrfPersonaStoreLinkedResourcesData* _data_;
	TrfPersonaStore* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	const gchar* _tmp3_;
	const gchar* _tmp4_;
	const gchar* _tmp5_;
	const gchar* _tmp6_;
	_data_ = g_slice_new0 (TrfPersonaStoreLinkedResourcesData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, _trf_persona_store_linked_resources);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, _trf_persona_store_linked_resources_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = urn;
	_tmp2_ = g_strdup (_tmp1_);
	_data_->urn = _tmp2_;
	_tmp3_ = subject_type;
	_tmp4_ = g_strdup (_tmp3_);
	_data_->subject_type = _tmp4_;
	_tmp5_ = linking_predicate;
	_tmp6_ = g_strdup (_tmp5_);
	_data_->linking_predicate = _tmp6_;
	_trf_persona_store_linked_resources_co (_data_);
}


static GeeHashSet* _trf_persona_store_linked_resources_finish (TrfPersonaStore* self, GAsyncResult* _res_) {
	GeeHashSet* result;
	TrfPersonaStoreLinkedResourcesData* _data_;
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
	result = _data_->result;
	_data_->result = NULL;
	return result;
}


/**
   * Retrieve the list of linked resources of a given subject
   *
   * @param urn               the urn of the subject in <urn> format
   * @param subject_type      i.e: nco:Person, nco:Affiliation, etc
   * @param linking_predicate i.e.: nco:hasAffiliation
   * @return a list of linked resources (in <urn> format)
   */
static void _trf_persona_store_linked_resources_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	TrfPersonaStoreLinkedResourcesData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	_trf_persona_store_linked_resources_co (_data_);
}


static gboolean _trf_persona_store_linked_resources_co (TrfPersonaStoreLinkedResourcesData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = g_strdup ("SELECT " " fn:concat('<',?linkedr,'>')  " "WHERE { " " %s a %s; " " %s ?linkedr " "} ");
	_data_->query_t = _data_->_tmp0_;
	_data_->_tmp1_ = _data_->urn;
	_data_->_tmp2_ = _data_->subject_type;
	_data_->_tmp3_ = _data_->linking_predicate;
	_data_->_tmp4_ = NULL;
	_data_->_tmp4_ = g_strdup_printf (_data_->query_t, _data_->_tmp1_, _data_->_tmp2_, _data_->_tmp3_);
	_data_->query = _data_->_tmp4_;
	_data_->_state_ = 1;
	_trf_persona_store_multi_value_query (_data_->self, _data_->query, _trf_persona_store_linked_resources_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp5_ = NULL;
	_data_->_tmp5_ = _trf_persona_store_multi_value_query_finish (_data_->self, _data_->_res_);
	_data_->result = _data_->_tmp5_;
	_g_free0 (_data_->query);
	_g_free0 (_data_->query_t);
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
	_g_free0 (_data_->query);
	_g_free0 (_data_->query_t);
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


static void _trf_persona_store_urn_from_persona_data_free (gpointer _data) {
	TrfPersonaStoreUrnFromPersonaData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->persona);
	_g_free0 (_data_->result);
	_g_object_unref0 (_data_->self);
	g_slice_free (TrfPersonaStoreUrnFromPersonaData, _data_);
}


static void _trf_persona_store_urn_from_persona (TrfPersonaStore* self, FolksPersona* persona, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	TrfPersonaStoreUrnFromPersonaData* _data_;
	TrfPersonaStore* _tmp0_;
	FolksPersona* _tmp1_;
	FolksPersona* _tmp2_;
	_data_ = g_slice_new0 (TrfPersonaStoreUrnFromPersonaData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, _trf_persona_store_urn_from_persona);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, _trf_persona_store_urn_from_persona_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = persona;
	_tmp2_ = _g_object_ref0 (_tmp1_);
	_data_->persona = _tmp2_;
	_trf_persona_store_urn_from_persona_co (_data_);
}


static gchar* _trf_persona_store_urn_from_persona_finish (TrfPersonaStore* self, GAsyncResult* _res_) {
	gchar* result;
	TrfPersonaStoreUrnFromPersonaData* _data_;
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
	result = _data_->result;
	_data_->result = NULL;
	return result;
}


static void _trf_persona_store_urn_from_persona_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	TrfPersonaStoreUrnFromPersonaData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	_trf_persona_store_urn_from_persona_co (_data_);
}


static gboolean _trf_persona_store_urn_from_persona_co (TrfPersonaStoreUrnFromPersonaData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->persona;
	_data_->_tmp1_ = NULL;
	_data_->_tmp1_ = trf_persona_tracker_id (TRF_PERSONA (_data_->_tmp0_));
	_data_->id = _data_->_tmp1_;
	_data_->_state_ = 1;
	_trf_persona_store_urn_from_tracker_id (_data_->self, _data_->id, _trf_persona_store_urn_from_persona_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp2_ = NULL;
	_data_->_tmp2_ = _trf_persona_store_urn_from_tracker_id_finish (_data_->self, _data_->_res_);
	_data_->result = _data_->_tmp2_;
	_g_free0 (_data_->id);
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
	_g_free0 (_data_->id);
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


static void _trf_persona_store_urn_from_property_data_free (gpointer _data) {
	TrfPersonaStoreUrnFromPropertyData* _data_;
	_data_ = _data;
	_g_free0 (_data_->class_name);
	_g_free0 (_data_->property_name);
	_g_free0 (_data_->property_value);
	_g_free0 (_data_->result);
	_g_object_unref0 (_data_->self);
	g_slice_free (TrfPersonaStoreUrnFromPropertyData, _data_);
}


static void _trf_persona_store_urn_from_property (TrfPersonaStore* self, const gchar* class_name, const gchar* property_name, const gchar* property_value, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	TrfPersonaStoreUrnFromPropertyData* _data_;
	TrfPersonaStore* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	const gchar* _tmp3_;
	const gchar* _tmp4_;
	const gchar* _tmp5_;
	const gchar* _tmp6_;
	_data_ = g_slice_new0 (TrfPersonaStoreUrnFromPropertyData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, _trf_persona_store_urn_from_property);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, _trf_persona_store_urn_from_property_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = class_name;
	_tmp2_ = g_strdup (_tmp1_);
	_data_->class_name = _tmp2_;
	_tmp3_ = property_name;
	_tmp4_ = g_strdup (_tmp3_);
	_data_->property_name = _tmp4_;
	_tmp5_ = property_value;
	_tmp6_ = g_strdup (_tmp5_);
	_data_->property_value = _tmp6_;
	_trf_persona_store_urn_from_property_co (_data_);
}


static gchar* _trf_persona_store_urn_from_property_finish (TrfPersonaStore* self, GAsyncResult* _res_) {
	gchar* result;
	TrfPersonaStoreUrnFromPropertyData* _data_;
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
	result = _data_->result;
	_data_->result = NULL;
	return result;
}


/**
   * Helper method to figure out if a constrained property
   * already exists.
   */
static void _trf_persona_store_urn_from_property_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	TrfPersonaStoreUrnFromPropertyData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	_trf_persona_store_urn_from_property_co (_data_);
}


static gboolean _trf_persona_store_urn_from_property_co (TrfPersonaStoreUrnFromPropertyData* _data_) {
	static const char query_template[] = "SELECT " " fn:concat('<', ?o, '>') " "WHERE { " " ?o a %s ; " " %s ?prop_val . " "FILTER (?prop_val = '%s') " "}";
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->class_name;
	_data_->_tmp1_ = _data_->property_name;
	_data_->_tmp2_ = _data_->property_value;
	_data_->_tmp3_ = NULL;
	_data_->_tmp3_ = g_strdup_printf (query_template, _data_->_tmp0_, _data_->_tmp1_, _data_->_tmp2_);
	_data_->query = _data_->_tmp3_;
	_data_->_state_ = 1;
	_trf_persona_store_single_value_query (_data_->self, _data_->query, _trf_persona_store_urn_from_property_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp4_ = NULL;
	_data_->_tmp4_ = _trf_persona_store_single_value_query_finish (_data_->self, _data_->_res_);
	_data_->result = _data_->_tmp4_;
	_g_free0 (_data_->query);
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
	_g_free0 (_data_->query);
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


static const gchar* trf_persona_store_real_get_type_id (FolksPersonaStore* base) {
	const gchar* result;
	TrfPersonaStore* self;
	self = (TrfPersonaStore*) base;
	result = BACKEND_NAME;
	return result;
}


static FolksMaybeBool trf_persona_store_real_get_can_add_personas (FolksPersonaStore* base) {
	FolksMaybeBool result;
	TrfPersonaStore* self;
	self = (TrfPersonaStore*) base;
	result = FOLKS_MAYBE_BOOL_TRUE;
	return result;
}


static FolksMaybeBool trf_persona_store_real_get_can_alias_personas (FolksPersonaStore* base) {
	FolksMaybeBool result;
	TrfPersonaStore* self;
	self = (TrfPersonaStore*) base;
	result = FOLKS_MAYBE_BOOL_FALSE;
	return result;
}


static FolksMaybeBool trf_persona_store_real_get_can_group_personas (FolksPersonaStore* base) {
	FolksMaybeBool result;
	TrfPersonaStore* self;
	self = (TrfPersonaStore*) base;
	result = FOLKS_MAYBE_BOOL_FALSE;
	return result;
}


static FolksMaybeBool trf_persona_store_real_get_can_remove_personas (FolksPersonaStore* base) {
	FolksMaybeBool result;
	TrfPersonaStore* self;
	self = (TrfPersonaStore*) base;
	result = FOLKS_MAYBE_BOOL_TRUE;
	return result;
}


static gboolean trf_persona_store_real_get_is_prepared (FolksPersonaStore* base) {
	gboolean result;
	TrfPersonaStore* self;
	gboolean _tmp0_;
	self = (TrfPersonaStore*) base;
	_tmp0_ = self->priv->_is_prepared;
	result = _tmp0_;
	return result;
}


static gchar** trf_persona_store_real_get_always_writeable_properties (FolksPersonaStore* base, int* result_length1) {
	gchar** result;
	TrfPersonaStore* self;
	gchar** _tmp0_;
	gint _tmp0__length1;
	self = (TrfPersonaStore*) base;
	_tmp0_ = TRF_PERSONA_STORE__always_writeable_properties;
	_tmp0__length1 = G_N_ELEMENTS (TRF_PERSONA_STORE__always_writeable_properties);
	if (result_length1) {
		*result_length1 = _tmp0__length1;
	}
	result = _tmp0_;
	return result;
}


static gboolean trf_persona_store_real_get_is_quiescent (FolksPersonaStore* base) {
	gboolean result;
	TrfPersonaStore* self;
	gboolean _tmp0_;
	self = (TrfPersonaStore*) base;
	_tmp0_ = self->priv->_is_quiescent;
	result = _tmp0_;
	return result;
}


static GeeMap* trf_persona_store_real_get_personas (FolksPersonaStore* base) {
	GeeMap* result;
	TrfPersonaStore* self;
	GeeMap* _tmp0_;
	self = (TrfPersonaStore*) base;
	_tmp0_ = self->priv->_personas_ro;
	result = _tmp0_;
	return result;
}


static void trf_persona_store_class_init (TrfPersonaStoreClass * klass) {
	trf_persona_store_parent_class = g_type_class_peek_parent (klass);
	g_type_class_add_private (klass, sizeof (TrfPersonaStorePrivate));
	FOLKS_PERSONA_STORE_CLASS (klass)->add_persona_from_details = trf_persona_store_real_add_persona_from_details;
	FOLKS_PERSONA_STORE_CLASS (klass)->add_persona_from_details_finish = trf_persona_store_real_add_persona_from_details_finish;
	FOLKS_PERSONA_STORE_CLASS (klass)->remove_persona = trf_persona_store_real_remove_persona;
	FOLKS_PERSONA_STORE_CLASS (klass)->remove_persona_finish = trf_persona_store_real_remove_persona_finish;
	FOLKS_PERSONA_STORE_CLASS (klass)->prepare = trf_persona_store_real_prepare;
	FOLKS_PERSONA_STORE_CLASS (klass)->prepare_finish = trf_persona_store_real_prepare_finish;
	FOLKS_PERSONA_STORE_CLASS (klass)->get_type_id = trf_persona_store_real_get_type_id;
	FOLKS_PERSONA_STORE_CLASS (klass)->get_can_add_personas = trf_persona_store_real_get_can_add_personas;
	FOLKS_PERSONA_STORE_CLASS (klass)->get_can_alias_personas = trf_persona_store_real_get_can_alias_personas;
	FOLKS_PERSONA_STORE_CLASS (klass)->get_can_group_personas = trf_persona_store_real_get_can_group_personas;
	FOLKS_PERSONA_STORE_CLASS (klass)->get_can_remove_personas = trf_persona_store_real_get_can_remove_personas;
	FOLKS_PERSONA_STORE_CLASS (klass)->get_is_prepared = trf_persona_store_real_get_is_prepared;
	FOLKS_PERSONA_STORE_CLASS (klass)->get_always_writeable_properties = trf_persona_store_real_get_always_writeable_properties;
	FOLKS_PERSONA_STORE_CLASS (klass)->get_is_quiescent = trf_persona_store_real_get_is_quiescent;
	FOLKS_PERSONA_STORE_CLASS (klass)->get_personas = trf_persona_store_real_get_personas;
	G_OBJECT_CLASS (klass)->get_property = _vala_trf_persona_store_get_property;
	G_OBJECT_CLASS (klass)->finalize = trf_persona_store_finalize;
	/**
	   * The type of persona store this is.
	   *
	   * See {@link Folks.PersonaStore.type_id}.
	   */
	g_object_class_override_property (G_OBJECT_CLASS (klass), TRF_PERSONA_STORE_TYPE_ID, "type-id");
	/**
	   * Whether this PersonaStore can add {@link Folks.Persona}s.
	   *
	   * See {@link Folks.PersonaStore.can_add_personas}.
	   *
	   * @since 0.5.0
	   */
	g_object_class_override_property (G_OBJECT_CLASS (klass), TRF_PERSONA_STORE_CAN_ADD_PERSONAS, "can-add-personas");
	/**
	   * Whether this PersonaStore can set the alias of {@link Folks.Persona}s.
	   *
	   * See {@link Folks.PersonaStore.can_alias_personas}.
	   *
	   * @since 0.5.0
	   */
	g_object_class_override_property (G_OBJECT_CLASS (klass), TRF_PERSONA_STORE_CAN_ALIAS_PERSONAS, "can-alias-personas");
	/**
	   * Whether this PersonaStore can set the groups of {@link Folks.Persona}s.
	   *
	   * See {@link Folks.PersonaStore.can_group_personas}.
	   *
	   * @since 0.5.0
	   */
	g_object_class_override_property (G_OBJECT_CLASS (klass), TRF_PERSONA_STORE_CAN_GROUP_PERSONAS, "can-group-personas");
	/**
	   * Whether this PersonaStore can remove {@link Folks.Persona}s.
	   *
	   * See {@link Folks.PersonaStore.can_remove_personas}.
	   *
	   * @since 0.5.0
	   */
	g_object_class_override_property (G_OBJECT_CLASS (klass), TRF_PERSONA_STORE_CAN_REMOVE_PERSONAS, "can-remove-personas");
	/**
	   * Whether this PersonaStore has been prepared.
	   *
	   * See {@link Folks.PersonaStore.is_prepared}.
	   *
	   * @since 0.5.0
	   */
	g_object_class_override_property (G_OBJECT_CLASS (klass), TRF_PERSONA_STORE_IS_PREPARED, "is-prepared");
	/**
	   * {@inheritDoc}
	   *
	   * @since 0.6.2
	   */
	g_object_class_override_property (G_OBJECT_CLASS (klass), TRF_PERSONA_STORE_ALWAYS_WRITEABLE_PROPERTIES, "always-writeable-properties");
	g_object_class_override_property (G_OBJECT_CLASS (klass), TRF_PERSONA_STORE_IS_QUIESCENT, "is-quiescent");
	/**
	   * The {@link Persona}s exposed by this PersonaStore.
	   *
	   * See {@link Folks.PersonaStore.personas}.
	   */
	g_object_class_override_property (G_OBJECT_CLASS (klass), TRF_PERSONA_STORE_PERSONAS, "personas");
}


static void trf_persona_store_instance_init (TrfPersonaStore * self) {
	self->priv = TRF_PERSONA_STORE_GET_PRIVATE (self);
	g_static_rec_mutex_init (&self->priv->__lock__personas);
	g_static_rec_mutex_init (&self->priv->__lock__is_prepared);
	self->priv->_is_prepared = FALSE;
	self->priv->_is_quiescent = FALSE;
}


static void trf_persona_store_finalize (GObject* obj) {
	TrfPersonaStore * self;
	self = TRF_PERSONA_STORE (obj);
	g_static_rec_mutex_free (&self->priv->__lock__personas);
	_g_object_unref0 (self->priv->_personas);
	_g_object_unref0 (self->priv->_personas_ro);
	g_static_rec_mutex_free (&self->priv->__lock__is_prepared);
	_g_object_unref0 (self->priv->_resources_object);
	_g_object_unref0 (self->priv->_connection);
	G_OBJECT_CLASS (trf_persona_store_parent_class)->finalize (obj);
}


/**
 * A persona store.
 * It will create {@link Persona}s for each contacts on the main addressbook.
 */
GType trf_persona_store_get_type (void) {
	static volatile gsize trf_persona_store_type_id__volatile = 0;
	if (g_once_init_enter (&trf_persona_store_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (TrfPersonaStoreClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) trf_persona_store_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (TrfPersonaStore), 0, (GInstanceInitFunc) trf_persona_store_instance_init, NULL };
		GType trf_persona_store_type_id;
		trf_persona_store_type_id = g_type_register_static (FOLKS_TYPE_PERSONA_STORE, "TrfPersonaStore", &g_define_type_info, 0);
		g_once_init_leave (&trf_persona_store_type_id__volatile, trf_persona_store_type_id);
	}
	return trf_persona_store_type_id__volatile;
}


static void _vala_trf_persona_store_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
	TrfPersonaStore * self;
	self = TRF_PERSONA_STORE (object);
	switch (property_id) {
		case TRF_PERSONA_STORE_TYPE_ID:
		g_value_set_string (value, folks_persona_store_get_type_id ((FolksPersonaStore*) self));
		break;
		case TRF_PERSONA_STORE_CAN_ADD_PERSONAS:
		g_value_set_enum (value, folks_persona_store_get_can_add_personas ((FolksPersonaStore*) self));
		break;
		case TRF_PERSONA_STORE_CAN_ALIAS_PERSONAS:
		g_value_set_enum (value, folks_persona_store_get_can_alias_personas ((FolksPersonaStore*) self));
		break;
		case TRF_PERSONA_STORE_CAN_GROUP_PERSONAS:
		g_value_set_enum (value, folks_persona_store_get_can_group_personas ((FolksPersonaStore*) self));
		break;
		case TRF_PERSONA_STORE_CAN_REMOVE_PERSONAS:
		g_value_set_enum (value, folks_persona_store_get_can_remove_personas ((FolksPersonaStore*) self));
		break;
		case TRF_PERSONA_STORE_IS_PREPARED:
		g_value_set_boolean (value, folks_persona_store_get_is_prepared ((FolksPersonaStore*) self));
		break;
		case TRF_PERSONA_STORE_ALWAYS_WRITEABLE_PROPERTIES:
		{
			int length;
			g_value_set_boxed (value, folks_persona_store_get_always_writeable_properties ((FolksPersonaStore*) self, &length));
		}
		break;
		case TRF_PERSONA_STORE_IS_QUIESCENT:
		g_value_set_boolean (value, folks_persona_store_get_is_quiescent ((FolksPersonaStore*) self));
		break;
		case TRF_PERSONA_STORE_PERSONAS:
		g_value_set_object (value, folks_persona_store_get_personas ((FolksPersonaStore*) self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}


static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func) {
	if ((array != NULL) && (destroy_func != NULL)) {
		int i;
		for (i = 0; i < array_length; i = i + 1) {
			if (((gpointer*) array)[i] != NULL) {
				destroy_func (((gpointer*) array)[i]);
			}
		}
	}
}


static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func) {
	_vala_array_destroy (array, array_length, destroy_func);
	g_free (array);
}


static gint _vala_array_length (gpointer array) {
	int length;
	length = 0;
	if (array) {
		while (((gpointer*) array)[length]) {
			length++;
		}
	}
	return length;
}



