<docbook><section><title>VirtTipsAndTricksGuideAllGraphs</title><bridgehead class="http://www.w3.org/1999/xhtml:h2">How to obtain all graphs Example</bridgehead>
<orderedlist spacing="compact"><listitem><emphasis>Using SPARQL Query:</emphasis> The most popular way for obtaining all graphs list, presuming every graph contains at least one triple for some rdf:type of some subject, is to execute the following query: <programlisting>SQL&gt; SPARQL
SELECT DISTINCT ?g 
WHERE 
  { 
     GRAPH ?g {?s a ?t}
  }
</programlisting></listitem>
<listitem><emphasis>Using Virtuoso built-in function:</emphasis>: Another solution is to use the Virtuoso <ulink url="http://docs.openlinksw.com/virtuoso/fn_sparql_select_known_graphs.html">DB.DBA.SPARQL_SELECT_KNOWN_GRAPHS</ulink> function: <programlisting>SQL&gt; DB.DBA.SPARQL_SELECT_KNOWN_GRAPHS();
GRAPH_IRI
VARCHAR
_______________________________________________________________________________

http://www.openlinksw.com/schemas/virtrdf#
http://localhost:8890/DAV
http://localhost:8890/dataspace
http://localhost:8890/dataspace/inf

4 Rows. -- 14 msec.
</programlisting></listitem>
</orderedlist><bridgehead class="http://www.w3.org/1999/xhtml:h3">Related</bridgehead>
<itemizedlist mark="bullet" spacing="compact"><listitem><ulink url="VirtTipsAndTricksGuide">Virtuoso Tips and Tricks Collection</ulink> </listitem>
<listitem><ulink url="http://docs.openlinksw.com/virtuoso/rdfperformancetuning.html#rdfperfgetallgraphs">Virtuoso Documentation</ulink> </listitem>
</itemizedlist></section></docbook>