topical media & game development
server-php-xml-class-rdql-class-rdql.htm / htm
<html>
<head>
<title>RDQL (class_rdql.php)</title>
<link rel="stylesheet" href="main.css" type="text/css">
</head>
<body>
<div align="center">
<table border="0" width="80%" cellpadding="0" cellspacing="0">
<tr>
<td bgcolor="#aaaaee" class="text" align="center"><a href="http://phpxmlclasses.sourceforge.net/">PHP XML Classes</a></td>
</tr>
</table>
<table border="0" width="80%" cellpadding="0" cellspacing="0">
<tr>
<td bgcolor="#aaaaee" class="textblbl" align="center">RDQL (class_rdql.php)</td>
</tr>
</table>
<br/>
<table border="0" width="80%">
<tr>
<td bgcolor="#eeeeff" class="text">Description: This class is a PHP implementation of the <a href="rdql.html">RDQL language</a>, a
language to query RDF documents. This class can be used to query RDF documents from local files or URLs. There's a
RDQL tutorial describing this RDQL implementation <a href="rdql.html">here</a>.
</td>
</tr>
</table>
<br/>
<table border="0" bgcolor="ddddff" width="80%">
<tr>
<td valign="top" class="text" width="50%"><b>NEWS:</b>
<ul>
<li> 2002-06-30 First version of this class released.
</ul>
</td>
<td valign="top" width="50%" class="text">
This class code as well as the documentation are hosted at <a href="http://www.sourceforge.net">SourceForge</a>
please visit our <a href="http://phpxmlclasses.sourceforge.net/">SourceForge page</a> for releases, documentation, bug-tracking, support
forums and mailing lists.
</td>
</tr>
</table>
<br/>
<table border="0" width="80%" cellpadding="0" cellspacing="0">
<tr>
<td class="textbl" bgcolor="aaaaee" width="50%">Resources</td>
<td class="textbl" bgcolor="aaaaee" width="50%">Requirements</td>
</tr>
</table>
<table border="1" width="80%" cellpadding="0" cellspacing="0">
<tr>
<td valign="top" bgcolor="eeeeff" class="text" width="50%">
<ul>
<li><a class="textbl" href="http://www.sourceforge.net/projects/phpxmlclasses">Downloads</a>
<li><a class="textbl" href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/phpxmlclasses/rdql/">Browse CVS</a>
<li><a class="textbl" href="http://sourceforge.net/tracker/?atid=470965&group_id=53613&func=browse">Report Bugs</a>
<li><a class="textbl" href="http://phpxmlclasses.sourceforge.net/rdql.html">RDQL Tutorial (html)</a>
</ul>
</td>
<td valign="top" bgcolor="eeeeff" class="text" width="50%">
<ul>
<li>PHP 4.0.5+
</ul>
</td>
</tr>
</table>
<br/>
<table border="0" width="80%" cellpadding="0" cellspacing="0">
<tr>
<td class="textbl" bgcolor="aaaaee" width="50%">Features</td>
<td class="textbl" bgcolor="aaaaee" width="50%">To-dos</td>
</tr>
</table>
<table border="1" width="80%" cellpadding="0" cellspacing="0">
<tr>
<td valign="top" bgcolor="eeeeff" class="text" width="50%">
<ul>
<li>RDQL queries can be applied to documents in the local file systems, URLs or combinations.
<li>Multiple documents can be queried
</ul>
</td>
<td valign="top" bgcolor="ddddff" class="text" width="50%">
<ul>
<li> We have to add error handling to this class.
<li> Errors are not handled, if your RDQL query has an error then a PHP error will appear.
</ul>
</td>
</tr>
</table>
<br/>
<table border="0" bgcolor="ddddff" width="80%">
<tr>
<!--
<td valign="top" class="text" width="50%"><b>To-do/future releases:</b>
<ul>
<li>Class
<li>Class
<li>Class
</ul>
</td> -->
<td valign="top" width="100%" class="text">
Contact: <a href="mailto:lrargerich@yahoo.com">Luis Argerich</a>
</td>
</tr>
</table>
<br/>
<table border="0" bgcolor="ddddff" width="80%">
<tr>
<!--
<td valign="top" class="text" width="50%"><b>To-do/future releases:</b>
<ul>
<li>Class
<li>Class
<li>Class
</ul>
</td> -->
<td valign="top" width="100%" class="text">
Detailed description and usage:<br/>
<b>Using the class:</b><br/><br/>
The best way to use the class is using the rdql_query_url method of the
RDQL_query_document class. For example:
<pre>
a_query);
</pre>
The result is an array of asociative arrays, you can use a print_r(query)</CODE>
<BR>
Queries a URL or pathname</TD>
</TR>
<!-- A ROW -->
</TABLE>
<P>
<!-- METHOD SUMMARY -->
<!-- ============ METHOD DETAIL ========== -->
<A NAME="method_detail"><!-- --></A>
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=1><FONT SIZE="+2">
<B>Method Detail</B></FONT></TD>
</TR>
</TABLE>
<!-- method -->
<A NAME="class32method1"><!-- --></A>
<H3>rdql_query_url</H3>
<PRE>
Array <B>rdql_query_url</B>(string query - The RDQL query to be executed<br><DT><B>Returns:</B><DD>An array of asociative arrays. Each member of the array is a row of the RDQL result. Each row is an asociative array in the form RDQL_VAR_NAME => value<DT><B>Throws:</B><DD><CODE>None</CODE>
</DL>
</DD>
</DL>
<HR>
<!-- a method -->
<!-- ============ METHOD DETAIL ========== -->
<a name="class33"></a>
<h3>RDF_iterator</h3>
Extends: None
Description: The RDQL engine receives an RDF iterator object when constructed, the iterator is the object that knows how to access and traverse an RDF document indicated in the FROM part of the RDQL query. This allows the implementation of a RDQL engine accessing RDF documents from different sources (files, a database, etc)
<br>
<!-- METHOD SUMMARY -->
<A NAME="pDomNode_method_summary"><!-- --></A>
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=2><FONT SIZE="+2">
<B>Method Summary</B></FONT></TD>
</TR>
<!-- A ROW -->
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="#class33method1">tuple_match</A></B>(array tuple)</CODE>
<BR>
Indicates if a tuple matches a condition</TD>
</TR>
<!-- A ROW -->
<!-- A ROW -->
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> array</CODE></FONT></TD>
<TD><CODE><B><A HREF="#class33method2">find_tuples</A></B>(array tuple)</CODE>
<BR>
Find tuples matching the values passed as arguments</TD>
</TR>
<!-- A ROW -->
</TABLE>
<P>
<!-- METHOD SUMMARY -->
<!-- ============ METHOD DETAIL ========== -->
<A NAME="method_detail"><!-- --></A>
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=1><FONT SIZE="+2">
<B>Method Detail</B></FONT></TD>
</TR>
</TABLE>
<!-- method -->
<A NAME="class33method1"><!-- --></A>
<H3>tuple_match</H3>
<PRE>
boolean <B>tuple_match</B>(array tuple)</PRE>
<DL>
<DD>This method is implemented in the abstract RDF_iterator match, classes extending this class can use tuple_match to check if an RDF tuple matches a condition.<DD>
<DL>
<DT><B>Parameters:</B><DD>
tuple - This is an array with the RDF tuple being compared in the form (subject, predicate, object)<br><DT><B>Returns:</B><DD>True if the tuple matches the condition, false if not<DT><B>Throws:</B><DD><CODE>None</CODE>
</DL>
</DD>
</DL>
<HR>
<!-- a method -->
<!-- method -->
<A NAME="class33method2"><!-- --></A>
<H3>find_tuples</H3>
<PRE>
array <B>find_tuples</B>(array tuple)</PRE>
<DL>
<DD>This method must be implemented in classes extendin the RDF_iterator class. The method must return an array where each member of the array is an asoc array matching RDQL variables with values found in triplets of the RDF document. You can use the tuple_match method defined in this class to compare a tuple against a condition. (This method receives the condition for subject, predicate and object)<DD>
<DL>
<DT><B>Parameters:</B><DD>
<DT><B>Returns:</B><DD>An array of asocs.<DT><B>Throws:</B><DD><CODE>None</CODE>
</DL>
</DD>
</DL>
<HR>
<!-- a method -->
<!-- ============ METHOD DETAIL ========== -->
<a name="class34"></a>
<h3>RDQL_query</h3>
Extends: None
Description: This class implements a generic RDQL engine that can be used to process RDQL queries against RDF documents from different data-sources.
<br>
<!-- METHOD SUMMARY -->
<A NAME="pDomNode_method_summary"><!-- --></A>
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=2><FONT SIZE="+2">
<B>Method Summary</B></FONT></TD>
</TR>
<!-- A ROW -->
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="#class34method1">RDQL_query</A></B>(RDF_iterator
(C) Æliens
20/2/2008
You may not copy or print any of this material without explicit permission of the author or the publisher.
In case of other copyright issues, contact the author.