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 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102
|
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
-
- This file is part of the OpenLink Software Virtuoso Open-Source (VOS)
- project.
-
- Copyright (C) 1998-2018 OpenLink Software
-
- This project is free software; you can redistribute it and/or modify it
- under the terms of the GNU General Public License as published by the
- Free Software Foundation; only version 2 of the License, dated June 1991.
-
- This program 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
- General Public License for more details.
-
- You should have received a copy of the GNU General Public License along
- with this program; if not, write to the Free Software Foundation, Inc.,
- 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-->
<refentry id="fn_GROUP_DIGEST">
<refmeta>
<refentrytitle>DB.DBA.GROUP_DIGEST</refentrytitle>
<refmiscinfo>rdf</refmiscinfo>
</refmeta>
<refnamediv>
<refname>DB.DBA.GROUP_DIGEST</refname>
<refpurpose>returns an arbitrary value from the multiset passed to it.</refpurpose>
</refnamediv>
<refsynopsisdiv>
<funcsynopsis id="fsyn_GROUP_DIGEST">
<funcprototype id="fproto_GROUP_DIGEST">
<funcdef><function>DB.DBA.GROUP_DIGEST</function></funcdef>
<paramdef>in <parameter>token</parameter> varchar</paramdef>
<paramdef>in <parameter>delim</parameter> varchar</paramdef>
<paramdef>in <parameter>maxlen</parameter> integer</paramdef>
<paramdef>in <parameter>mode</parameter> integer</paramdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1 id="desc_GROUP_DIGEST">
<title>Description</title>
<para>DB.DBA.GROUP_DIGEST is aggregate function that performs a string concatenation across
the values of an expression with a group. The order of the strings is not specified.
The separator character used in the concatenation may be given with the scalar
argument delimiter. The function is an extended version of sql:GROUP_CONCAT(), with
two more arguments: maxlen and mode.</para>
<para>Note: the "sql:" prefix is mandatory when this aggregate is used in SPARQL queries.
In SQL queries the prefix is "DB.DBA".
</para>
</refsect1>
<refsect1 id="params_GROUP_DIGEST">
<title>Parameters</title>
<refsect2><title>token</title>
<para>An item that should be added to a delimited list.</para>
</refsect2>
<refsect2><title>delim</title>
<para>The delimeter character to be used in the concatenation.</para>
</refsect2>
<refsect2><title>maxlen</title>
<para>The maximal allowed length of the result, in characters. Redundant values will be ignored.
If the last value does not fit in the "maxlen" entirely, then it can be truncated and "..." is
placed at the end of the resulting string.</para>
</refsect2>
<refsect2><title>mode</title>
<para>Bitmask of properties. Right now only bit 1 is used and others are reserved. If the value
of the argument is 1 then duplicate values are ignored; value 0 will put duplicate values like
in case of sql:GROUP_CONCAT ().</para>
</refsect2>
</refsect1>
<refsect1 id="ret_GROUP_DIGEST"><title>Return Types</title>
<para>any</para>
</refsect1>
<refsect1 id="examples_GROUP_DIGEST">
<title>Examples</title>
<example id="ex_GROUP_DIGEST"><title>Get all ?assets as a list with delimiters.</title>
<programlisting><![CDATA[
SQL>SPARQL
SELECT ?view (sql:GROUP_DIGEST (?path, ' ', 1000, 1)) as ?path_list
(sql:GROUP_DIGEST (?asset, ' ', 1000, 1)) as ?asset_list
FROM <http://mygraph.com>
WHERE
{
?view <viewPath> ?path ;
<viewContent> ?asset ;
<viewType> 'phyview'.
};
]]></programlisting>
</example>
</refsect1>
<refsect1 id="seealso_GROUP_DIGEST">
<title>See Also</title>
<para><link linkend="fn_SAMPLE"><function>DB.DBA.SAMPLE</function></link></para>
<para><link linkend="fn_GROUP_CONCAT"><function>DB.DBA.GROUP_CONCAT</function></link></para>
<para><link linkend="fn_GROUP_CONCAT_DISTINCT"><function>DB.DBA.GROUP_CONCAT_DISTINCT</function></link></para>
<para><link linkend="samplegroupconcatdigest">Differences between DB.DBA.SAMPLE, DB.DBA.GROUP_CONCAT and
DB.DBA.GROUP_DIGEST functions usage.</link></para>
</refsect1>
</refentry>
|