summaryrefslogtreecommitdiff
path: root/docs/reference/libtracker-sparql/migrating-1to2.xml
blob: 677b9a468c718c51243ffae030e0b765eee85949 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<?xml version='1.0'?>

<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
               "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
<!ENTITY % local.common.attrib "xmlns:xi  CDATA  #FIXED 'http://www.w3.org/2003/XInclude'">
]>
<chapter id="tracker-migrating-1-to-2">
  <title>Migrating from libtracker-sparql 1.x to 2.0</title>

  <para>
    Tracker 2.0 is a new major version, containing some possibly
    incompatible changes. Most of the changes are not hard to adapt,
    and even unlikely to be a problem if the ported application was
    kept up-to-date in its usage of 1.x.
  </para>

  <section>
    <title>Stricter SPARQL1.1</title>
    <para>
      Tracker supports a large subset of the SPARQL1.1 definition,
      and offers a number of nonstandard features that are useful.
      There is however one nonstandard feature that brings no
      added value.
    </para>
    <programlisting>
# These were equivalent in Tracker 1.x
SELECT ?u AS ?foo WHERE { ?u ... }
SELECT ?u AS foo WHERE { ?u ... }
    </programlisting>
    <para>
      The latter form is not observed in the SPARQL1.1 spec, and
      support for it has been dropped in Tracker 2.0. If you want
      to make queries that work on both Tracker 2.0 and 1.x, use
      the former form, which has also been supported for a long
      time in 1.x.
    </para>
  </section>

  <section>
    <title>No getters for direct/bus SPARQL connections</title>
    <para>
      Those have been deprecated for a long time in 1.x and have
      been removed for 2.0. Use tracker_sparql_connection_get(),
      which will smartly use direct/bus connections underneath
      depending on the type of query.
    </para>
  </section>

  <section>
    <title>TrackerSparqlBuilder is deprecated</title>
    <para>
      Users are encouraged to use TrackerResource, included in
      the last 1.x releases, and now being the preferred method
      to create SPARQL updates for your data.
    </para>
  </section>
</chapter>