[tracker] libtracker-sparql: Add TrackerResource/NamespaceManager to docs
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker] libtracker-sparql: Add TrackerResource/NamespaceManager to docs
- Date: Sat, 16 Jul 2016 17:22:58 +0000 (UTC)
commit 4c973df9a26cfd6bccfb040179548d593f05023f
Author: Carlos Garnacho <carlosg gnome org>
Date: Sat Jul 16 19:12:53 2016 +0200
libtracker-sparql: Add TrackerResource/NamespaceManager to docs
And document the missing functions.
.../libtracker-sparql/libtracker-sparql-docs.sgml | 2 +
.../libtracker-sparql-sections.txt | 59 +++++
.../libtracker-sparql/libtracker-sparql.types | 4 +-
src/libtracker-sparql/tracker-namespace-manager.c | 4 +-
src/libtracker-sparql/tracker-resource.c | 253 +++++++++++++++++++-
5 files changed, 318 insertions(+), 4 deletions(-)
---
diff --git a/docs/reference/libtracker-sparql/libtracker-sparql-docs.sgml
b/docs/reference/libtracker-sparql/libtracker-sparql-docs.sgml
index 70f63e3..795c97f 100644
--- a/docs/reference/libtracker-sparql/libtracker-sparql-docs.sgml
+++ b/docs/reference/libtracker-sparql/libtracker-sparql-docs.sgml
@@ -28,6 +28,8 @@
</para>
</partintro>
+ <xi:include href="xml/tracker-resource.xml"/>
+ <xi:include href="xml/tracker-namespace-manager.xml"/>
<xi:include href="xml/tracker-sparql-builder.xml"/>
<xi:include href="xml/tracker-sparql-connection.xml"/>
<xi:include href="xml/tracker-sparql-cursor.xml"/>
diff --git a/docs/reference/libtracker-sparql/libtracker-sparql-sections.txt
b/docs/reference/libtracker-sparql/libtracker-sparql-sections.txt
index a328248..ddb458d 100644
--- a/docs/reference/libtracker-sparql/libtracker-sparql-sections.txt
+++ b/docs/reference/libtracker-sparql/libtracker-sparql-sections.txt
@@ -9,6 +9,65 @@ tracker_sparql_escape_uri_vprintf
</SECTION>
<SECTION>
+<FILE>tracker-resource</FILE>
+<TITLE>TrackerResource</TITLE>
+TrackerResource
+tracker_resource_new
+tracker_resource_set_boolean
+tracker_resource_set_double
+tracker_resource_set_gvalue
+tracker_resource_set_identifier
+tracker_resource_set_int
+tracker_resource_set_int64
+tracker_resource_set_relation
+tracker_resource_set_string
+tracker_resource_set_uri
+tracker_resource_add_boolean
+tracker_resource_add_double
+tracker_resource_add_gvalue
+tracker_resource_add_int
+tracker_resource_add_int64
+tracker_resource_add_relation
+tracker_resource_add_string
+tracker_resource_add_uri
+tracker_resource_get_first_boolean
+tracker_resource_get_first_double
+tracker_resource_get_first_int
+tracker_resource_get_first_int64
+tracker_resource_get_first_relation
+tracker_resource_get_first_string
+tracker_resource_get_first_uri
+tracker_resource_get_identifier
+tracker_resource_get_values
+tracker_resource_identifier_compare_func
+tracker_resource_print_sparql_update
+tracker_resource_print_turtle
+<SUBSECTION Standard>
+TrackerResourceClass
+TRACKER_RESOURCE
+TRACKER_IS_RESOURCE
+TRACKER_TYPE_RESOURCE
+tracker_resource_get_type
+TRACKER_RESOURCE_CLASS
+TRACKER_IS_RESOURCE_CLASS
+TRACKER_RESOURCE_GET_CLASS
+</SECTION>
+
+<SECTION>
+<FILE>tracker-namespace-manager</FILE>
+<TITLE>TrackerNamespaceManager</TITLE>
+tracker_namespace_manager_add_prefix
+tracker_namespace_manager_expand_uri
+tracker_namespace_manager_get_default
+tracker_namespace_manager_has_prefix
+tracker_namespace_manager_lookup_prefix
+tracker_namespace_manager_new
+tracker_namespace_manager_print_turtle
+<SUBSECTION Standard>
+TRACKER_TYPE_NAMESPACE_MANAGER
+</SECTION>
+
+<SECTION>
<FILE>tracker-sparql-builder</FILE>
<TITLE>TrackerSparqlBuilder</TITLE>
TrackerSparqlBuilder
diff --git a/docs/reference/libtracker-sparql/libtracker-sparql.types
b/docs/reference/libtracker-sparql/libtracker-sparql.types
index 10b4f32..411babe 100644
--- a/docs/reference/libtracker-sparql/libtracker-sparql.types
+++ b/docs/reference/libtracker-sparql/libtracker-sparql.types
@@ -1,4 +1,6 @@
+tracker_resource_get_type
+tracker_namespace_manager_get_type
tracker_sparql_builder_get_type
tracker_sparql_builder_state_get_type
tracker_sparql_connection_get_type
-tracker_sparql_cursor_get_type
\ No newline at end of file
+tracker_sparql_cursor_get_type
diff --git a/src/libtracker-sparql/tracker-namespace-manager.c
b/src/libtracker-sparql/tracker-namespace-manager.c
index a96284e..21a5a48 100644
--- a/src/libtracker-sparql/tracker-namespace-manager.c
+++ b/src/libtracker-sparql/tracker-namespace-manager.c
@@ -53,9 +53,9 @@ G_DEFINE_TYPE_WITH_PRIVATE (TrackerNamespaceManager, tracker_namespace_manager,
* short prefixes for them to avoid typing full URLs all the time.
*
* The syntax used is that of Compact URIs (CURIEs) as defined here:
- * <https://www.w3.org/TR/2010/NOTE-curie-20101216/>
+ * (https://www.w3.org/TR/2010/NOTE-curie-20101216)
*
- * Usually you'll want to use the default namespace manager, as returned by
+ * Usually you will want to use the default namespace manager, as returned by
* tracker_namespace_manager_get_default(). This has a set of well-known
* prefixes predefined.
* </para>
diff --git a/src/libtracker-sparql/tracker-resource.c b/src/libtracker-sparql/tracker-resource.c
index bf8e66d..78e7d8e 100644
--- a/src/libtracker-sparql/tracker-resource.c
+++ b/src/libtracker-sparql/tracker-resource.c
@@ -94,6 +94,12 @@ tracker_resource_class_init (TrackerResourceClass *klass)
object_class->get_property = get_property;
object_class->set_property = set_property;
+ /**
+ * TrackerResource:identifier
+ *
+ * The URI identifier for this class, or %NULL for a
+ * blank node.
+ */
g_object_class_install_property (object_class,
PROP_IDENTIFIER,
g_param_spec_string ("identifier",
@@ -334,12 +340,93 @@ validate_pointer (const void *pointer,
GINT_TO_POINTER (TRUE)); \
};
+/**
+ * tracker_resource_set_boolean:
+ * @self: the #TrackerResource
+ * @property_uri: a string identifying the property to modify
+ * @value: the property object
+ *
+ * Sets a single-valued boolean object.
+ *
+ * Since: 1.10
+ */
SET_PROPERTY_FOR_GTYPE (tracker_resource_set_boolean, gboolean, G_TYPE_BOOLEAN, g_value_set_boolean,
validate_boolean);
+
+/**
+ * tracker_resource_set_double:
+ * @self: the #TrackerResource
+ * @property_uri: a string identifying the property to modify
+ * @value: the property object
+ *
+ * Sets a single-valued double object.
+ *
+ * Since: 1.10
+ */
SET_PROPERTY_FOR_GTYPE (tracker_resource_set_double, double, G_TYPE_DOUBLE, g_value_set_double,
validate_double);
+
+/**
+ * tracker_resource_set_int:
+ * @self: the #TrackerResource
+ * @property_uri: a string identifying the property to modify
+ * @value: the property object
+ *
+ * Sets a single-valued integer object.
+ *
+ * Since: 1.10
+ */
SET_PROPERTY_FOR_GTYPE (tracker_resource_set_int, int, G_TYPE_INT, g_value_set_int, validate_int);
+
+/**
+ * tracker_resource_set_int64:
+ * @self: the #TrackerResource
+ * @property_uri: a string identifying the property to modify
+ * @value: the property object
+ *
+ * Sets a single-valued integer object.
+ *
+ * Since: 1.10
+ */
SET_PROPERTY_FOR_GTYPE (tracker_resource_set_int64, gint64, G_TYPE_INT64, g_value_set_int64, validate_int64);
+
+/**
+ * tracker_resource_set_relation:
+ * @self: the #TrackerResource
+ * @property_uri: a string identifying the property to modify
+ * @resource: the property object
+ *
+ * Sets a single-valued resource object as a #TrackerResource. This
+ * function produces similar RDF to tracker_resource_set_uri(),
+ * although in this function the URI will depend on the identifier
+ * set on @resource.
+ *
+ * Since: 1.10
+ */
SET_PROPERTY_FOR_GTYPE (tracker_resource_set_relation, TrackerResource *, TRACKER_TYPE_RESOURCE,
g_value_set_object, validate_pointer);
+
+/**
+ * tracker_resource_set_string:
+ * @self: the #TrackerResource
+ * @property_uri: a string identifying the property to modify
+ * @value: the property object
+ *
+ * Sets a single-valued string object.
+ *
+ * Since: 1.10
+ */
SET_PROPERTY_FOR_GTYPE (tracker_resource_set_string, const char *, G_TYPE_STRING, g_value_set_string,
validate_pointer);
+
+/**
+ * tracker_resource_set_uri:
+ * @self: the #TrackerResource
+ * @property_uri: a string identifying the property to modify
+ * @value: the property object
+ *
+ * Sets a single-valued resource object as a string URI. This function
+ * produces similar RDF to tracker_resource_set_relation(), although
+ * it requires that the URI is previously known.
+ *
+ * Since: 1.10
+ */
SET_PROPERTY_FOR_GTYPE (tracker_resource_set_uri, const char *, TRACKER_TYPE_URI, g_value_set_string,
validate_pointer);
/**
@@ -458,12 +545,93 @@ tracker_resource_add_gvalue (TrackerResource *self,
} \
};
+/**
+ * tracker_resource_add_boolean:
+ * @self: the #TrackerResource
+ * @property_uri: a string identifying the property to modify
+ * @value: the property object
+ *
+ * Adds a boolean object to a multi-valued property.
+ *
+ * Since: 1.10
+ */
ADD_PROPERTY_FOR_GTYPE (tracker_resource_add_boolean, gboolean, G_TYPE_BOOLEAN, g_value_set_boolean,
validate_boolean);
+
+/**
+ * tracker_resource_add_double:
+ * @self: the #TrackerResource
+ * @property_uri: a string identifying the property to modify
+ * @value: the property object
+ *
+ * Adds a double object to a multi-valued property.
+ *
+ * Since: 1.10
+ */
ADD_PROPERTY_FOR_GTYPE (tracker_resource_add_double, double, G_TYPE_DOUBLE, g_value_set_double,
validate_double);
+
+/**
+ * tracker_resource_add_int:
+ * @self: the #TrackerResource
+ * @property_uri: a string identifying the property to modify
+ * @value: the property object
+ *
+ * Adds an integer object to a multi-valued property.
+ *
+ * Since: 1.10
+ */
ADD_PROPERTY_FOR_GTYPE (tracker_resource_add_int, int, G_TYPE_INT, g_value_set_int, validate_int);
+
+/**
+ * tracker_resource_add_boolean:
+ * @self: the #TrackerResource
+ * @property_uri: a string identifying the property to modify
+ * @value: the property object
+ *
+ * Adds an integer object to a multi-valued property.
+ *
+ * Since: 1.10
+ */
ADD_PROPERTY_FOR_GTYPE (tracker_resource_add_int64, gint64, G_TYPE_INT64, g_value_set_int64, validate_int64);
+
+/**
+ * tracker_resource_add_relation:
+ * @self: the #TrackerResource
+ * @property_uri: a string identifying the property to modify
+ * @resource: the property object
+ *
+ * Adds a resource object to a multi-valued property. This
+ * function produces similar RDF to tracker_resource_add_uri(),
+ * although in this function the URI will depend on the identifier
+ * set on @resource.
+ *
+ * Since: 1.10
+ */
ADD_PROPERTY_FOR_GTYPE (tracker_resource_add_relation, TrackerResource *, TRACKER_TYPE_RESOURCE,
g_value_set_object, validate_pointer);
+
+/**
+ * tracker_resource_add_string:
+ * @self: the #TrackerResource
+ * @property_uri: a string identifying the property to modify
+ * @value: the property object
+ *
+ * Adds a string object to a multi-valued property.
+ *
+ * Since: 1.10
+ */
ADD_PROPERTY_FOR_GTYPE (tracker_resource_add_string, const char *, G_TYPE_STRING, g_value_set_string,
validate_pointer);
+
+/**
+ * tracker_resource_add_uri:
+ * @self: the #TrackerResource
+ * @property_uri: a string identifying the property to modify
+ * @value: the property object
+ *
+ * Adds a resource object to a multi-valued property. This function
+ * produces similar RDF to tracker_resource_add_relation(), although
+ * it requires that the URI is previously known.
+ *
+ * Since: 1.10
+ */
ADD_PROPERTY_FOR_GTYPE (tracker_resource_add_uri, const char *, TRACKER_TYPE_URI, g_value_set_string,
validate_pointer);
@@ -544,12 +712,95 @@ GList *tracker_resource_get_values (TrackerResource *self,
return get_function (value); \
};
+/**
+ * tracker_resource_get_first_boolean:
+ * @self: A #TrackerResource
+ * @property_uri: a string identifying the property to look up
+ *
+ * Returns the first boolean object previously assigned to a property.
+ *
+ * Returns: the first boolean object
+ *
+ * Since: 1.10
+ */
GET_PROPERTY_FOR_GTYPE (tracker_resource_get_first_boolean, gboolean, G_TYPE_BOOLEAN, g_value_get_boolean,
FALSE);
+
+/**
+ * tracker_resource_get_first_double:
+ * @self: A #TrackerResource
+ * @property_uri: a string identifying the property to look up
+ *
+ * Returns the first double object previously assigned to a property.
+ *
+ * Returns: the first double object
+ *
+ * Since: 1.10
+ */
GET_PROPERTY_FOR_GTYPE (tracker_resource_get_first_double, double, G_TYPE_DOUBLE, g_value_get_double, 0.0);
+
+/**
+ * tracker_resource_get_first_int:
+ * @self: A #TrackerResource
+ * @property_uri: a string identifying the property to look up
+ *
+ * Returns the first integer object previously assigned to a property.
+ *
+ * Returns: the first integer object
+ *
+ * Since: 1.10
+ */
GET_PROPERTY_FOR_GTYPE (tracker_resource_get_first_int, int, G_TYPE_INT, g_value_get_int, 0);
+
+/**
+ * tracker_resource_get_first_int64:
+ * @self: A #TrackerResource
+ * @property_uri: a string identifying the property to look up
+ *
+ * Returns the first integer object previously assigned to a property.
+ *
+ * Returns: the first integer object
+ *
+ * Since: 1.10
+ */
GET_PROPERTY_FOR_GTYPE (tracker_resource_get_first_int64, gint64, G_TYPE_INT64, g_value_get_int64, 0);
+
+/**
+ * tracker_resource_get_first_relation:
+ * @self: A #TrackerResource
+ * @property_uri: a string identifying the property to look up
+ *
+ * Returns the first resource object previously assigned to a property.
+ *
+ * Returns: the first resource object
+ *
+ * Since: 1.10
+ */
GET_PROPERTY_FOR_GTYPE (tracker_resource_get_first_relation, TrackerResource *, TRACKER_TYPE_RESOURCE,
g_value_get_object, NULL);
+
+/**
+ * tracker_resource_get_first_string:
+ * @self: A #TrackerResource
+ * @property_uri: a string identifying the property to look up
+ *
+ * Returns the first string object previously assigned to a property.
+ *
+ * Returns: the first string object
+ *
+ * Since: 1.10
+ */
GET_PROPERTY_FOR_GTYPE (tracker_resource_get_first_string, const char *, G_TYPE_STRING, g_value_get_string,
NULL);
+
+/**
+ * tracker_resource_get_first_uri:
+ * @self: A #TrackerResource
+ * @property_uri: a string identifying the property to look up
+ *
+ * Returns the first resource object previously assigned to a property.
+ *
+ * Returns: the first resource object as an URI.
+ *
+ * Since: 1.10
+ */
GET_PROPERTY_FOR_GTYPE (tracker_resource_get_first_uri, const char *, TRACKER_TYPE_URI, g_value_get_string,
NULL);
/**
@@ -910,7 +1161,7 @@ generate_turtle (TrackerResource *resource,
/**
* tracker_resource_print_turtle:
- * @resource: a #TrackerResource
+ * @self: a #TrackerResource
* @namespaces: (allow-none): a set of prefixed URLs, or %NULL to use the
* default set
*
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]