<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN" 
               "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
<!ENTITY version SYSTEM "version.xml">
]>
<refentry id="rasqal-section-data">
<refmeta>
<refentrytitle role="top_of_page" id="rasqal-section-data.top_of_page">Data Graphs</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>RASQAL Library</refmiscinfo>
</refmeta>

<refnamediv>
<refname>Data Graphs</refname>
<refpurpose>RDF graph sources for triples.</refpurpose>
<!--[<xref linkend="desc" endterm="desc.title"/>]-->
</refnamediv>

<refsynopsisdiv id="rasqal-section-data.synopsis" role="synopsis">
<title role="synopsis.title">Synopsis</title>

<synopsis>
                    <link linkend="rasqal-data-graph">rasqal_data_graph</link>;
<link linkend="rasqal-data-graph">rasqal_data_graph</link>*  <link linkend="rasqal-new-data-graph">rasqal_new_data_graph</link>               (<link linkend="raptor-uri">raptor_uri</link> *uri,
                                                         <link linkend="raptor-uri">raptor_uri</link> *name_uri,
                                                         <link linkend="int">int</link> flags);
<link linkend="void">void</link>                <link linkend="rasqal-free-data-graph">rasqal_free_data_graph</link>              (<link linkend="rasqal-data-graph">rasqal_data_graph</link> *dg);
enum                <link linkend="rasqal-data-graph-flags">rasqal_data_graph_flags</link>;
<link linkend="void">void</link>                <link linkend="rasqal-data-graph-print">rasqal_data_graph_print</link>             (<link linkend="rasqal-data-graph">rasqal_data_graph</link> *dg,
                                                         <link linkend="FILE:CAPS">FILE</link> *fh);
</synopsis>
</refsynopsisdiv>









<refsect1 id="rasqal-section-data.description" role="desc">
<title role="desc.title">Description</title>
<para>
Data graphs are used in the query to describe RDF graphs that can be
used to query against.  The graphs can be used either with <link linkend="raptor-uri"><type>raptor_uri</type></link>
to name the graph, or without a name.  The query language determines
which graphs are used in the query.
</para>
</refsect1>

<refsect1 id="rasqal-section-data.details" role="details">
<title role="details.title">Details</title>
<refsect2 id="rasqal-data-graph" role="struct">
<title>rasqal_data_graph</title>
<indexterm zone="rasqal-data-graph"><primary>rasqal_data_graph</primary></indexterm><programlisting>typedef struct {
  raptor_uri* uri;
  raptor_uri* name_uri;
  int flags;
} rasqal_data_graph;
</programlisting>
<para>
A source of RDF data for querying. 
</para>
<para>
The <link linkend="uri"><type>uri</type></link> is the original source (base URI) of the content.  It may
also have an additional name <parameter>name_uri</parameter> as long as <parameter>flags</parameter> is
<link linkend="RASQAL-DATA-NAMED:CAPS"><literal>RASQAL_DATA_NAMED</literal></link></para>
<para>

</para><variablelist role="struct">
<varlistentry>
<term><link linkend="raptor-uri">raptor_uri</link>&nbsp;*<structfield>uri</structfield>;</term>
<listitem><simpara> source URI
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><link linkend="raptor-uri">raptor_uri</link>&nbsp;*<structfield>name_uri</structfield>;</term>
<listitem><simpara> name of graph for <link linkend="RASQAL-DATA-NAMED:CAPS"><literal>RASQAL_DATA_NAMED</literal></link>
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><link linkend="int">int</link>&nbsp;<structfield>flags</structfield>;</term>
<listitem><simpara> <link linkend="RASQAL-DATA-GRAPH-NAMED:CAPS"><literal>RASQAL_DATA_GRAPH_NAMED</literal></link> or <link linkend="RASQAL-DATA-GRAPH-BACKGROUND:CAPS"><literal>RASQAL_DATA_GRAPH_BACKGROUND</literal></link>
</simpara></listitem>
</varlistentry>
</variablelist></refsect2>
<refsect2 id="rasqal-new-data-graph" role="function">
<title>rasqal_new_data_graph ()</title>
<indexterm zone="rasqal-new-data-graph"><primary>rasqal_new_data_graph</primary></indexterm><programlisting><link linkend="rasqal-data-graph">rasqal_data_graph</link>*  rasqal_new_data_graph               (<link linkend="raptor-uri">raptor_uri</link> *uri,
                                                         <link linkend="raptor-uri">raptor_uri</link> *name_uri,
                                                         <link linkend="int">int</link> flags);</programlisting>
<para>
Constructor - create a new <link linkend="rasqal-data-graph"><type>rasqal_data_graph</type></link>.
</para>
<para>
The name_uri is only used when the flags are <link linkend="RASQAL-DATA-GRAPH-NAMED:CAPS"><literal>RASQAL_DATA_GRAPH_NAMED</literal></link>.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>uri</parameter>&nbsp;:</term>
<listitem><simpara> source URI
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>name_uri</parameter>&nbsp;:</term>
<listitem><simpara> name of graph (or NULL)
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>flags</parameter>&nbsp;:</term>
<listitem><simpara> <link linkend="RASQAL-DATA-GRAPH-NAMED:CAPS"><literal>RASQAL_DATA_GRAPH_NAMED</literal></link> or <link linkend="RASQAL-DATA-GRAPH-BACKGROUND:CAPS"><literal>RASQAL_DATA_GRAPH_BACKGROUND</literal></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> a new <link linkend="rasqal-data-graph"><type>rasqal_data_graph</type></link> or NULL on failure.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="rasqal-free-data-graph" role="function">
<title>rasqal_free_data_graph ()</title>
<indexterm zone="rasqal-free-data-graph"><primary>rasqal_free_data_graph</primary></indexterm><programlisting><link linkend="void">void</link>                rasqal_free_data_graph              (<link linkend="rasqal-data-graph">rasqal_data_graph</link> *dg);</programlisting>
<para>
Destructor - destroy a <link linkend="rasqal-data-graph"><type>rasqal_data_graph</type></link> object.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>dg</parameter>&nbsp;:</term>
<listitem><simpara> <link linkend="rasqal-data-graph"><type>rasqal_data_graph</type></link> object
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="rasqal-data-graph-flags" role="enum">
<title>enum rasqal_data_graph_flags</title>
<indexterm zone="rasqal-data-graph-flags"><primary>rasqal_data_graph_flags</primary></indexterm><programlisting>typedef enum {
  RASQAL_DATA_GRAPH_NONE  = 0,
  RASQAL_DATA_GRAPH_NAMED = 1,
  RASQAL_DATA_GRAPH_BACKGROUND = 2,
} rasqal_data_graph_flags;
</programlisting>
<para>
Flags for the type of <link linkend="rasqal-data-graph"><type>rasqal_data_graph</type></link>.
</para>
<para>
These are used by <link linkend="rasqal-query-add-data-graph"><function>rasqal_query_add_data_graph()</function></link>. See <link linkend="rasqal-data-graph"><type>rasqal_data_graph</type></link>.</para>
<para>

</para><variablelist role="enum">
<varlistentry id="RASQAL-DATA-GRAPH-NONE:CAPS" role="constant">
<term><literal>RASQAL_DATA_GRAPH_NONE</literal></term>
<listitem><simpara> Internal.
</simpara></listitem>
</varlistentry>
<varlistentry id="RASQAL-DATA-GRAPH-NAMED:CAPS" role="constant">
<term><literal>RASQAL_DATA_GRAPH_NAMED</literal></term>
<listitem><simpara> Graphs with a source and name.
</simpara></listitem>
</varlistentry>
<varlistentry id="RASQAL-DATA-GRAPH-BACKGROUND:CAPS" role="constant">
<term><literal>RASQAL_DATA_GRAPH_BACKGROUND</literal></term>
<listitem><simpara> Graphs with a source only.
</simpara></listitem>
</varlistentry>
</variablelist></refsect2>
<refsect2 id="rasqal-data-graph-print" role="function">
<title>rasqal_data_graph_print ()</title>
<indexterm zone="rasqal-data-graph-print"><primary>rasqal_data_graph_print</primary></indexterm><programlisting><link linkend="void">void</link>                rasqal_data_graph_print             (<link linkend="rasqal-data-graph">rasqal_data_graph</link> *dg,
                                                         <link linkend="FILE:CAPS">FILE</link> *fh);</programlisting>
<para>
Print a Rasqal data graph in a debug format.
</para>
<para>
The print debug format may change in any release.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>dg</parameter>&nbsp;:</term>
<listitem><simpara> <link linkend="rasqal-data-graph"><type>rasqal_data_graph</type></link> object
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>fh</parameter>&nbsp;:</term>
<listitem><simpara> the <link linkend="FILE:CAPS"><type>FILE</type></link>* handle to print to
</simpara></listitem></varlistentry>
</variablelist></refsect2>

</refsect1>




</refentry>
