[moriarty] r248 committed - Testing autogeneration

1 view
Skip to first unread message

mori...@googlecode.com

unread,
Jan 13, 2010, 7:16:54 PM1/13/10
to moriar...@googlegroups.com
Revision: 248
Author: innovateer
Date: Wed Jan 13 16:15:41 2010
Log: Testing autogeneration
http://code.google.com/p/moriarty/source/detail?r=248

Modified:
/wiki/ClassList.wiki
/wiki/DataTable.wiki
/wiki/DataTableResult.wiki

=======================================
--- /wiki/ClassList.wiki Wed Jan 13 06:40:33 2010
+++ /wiki/ClassList.wiki Wed Jan 13 16:15:41 2010
@@ -18,7 +18,7 @@
* [CurlHttpClient] - A CURL based http client implementation.
* [PhpHttpClient] - A CURL based http client implementation.
* [DataTable] - DataTable is Moriarty's implementation of the Active
Record pattern for RDF data.
- * [DataTableResult]
+ * [DataTableResult] - Represents a set of results returned from a
DataTable query.
* [FacetService] - Represents a store's facet service.
* [Graph] - The base class for graphs in a store.
* [Metabox] - Represents a store's metabox.
=======================================
--- /wiki/DataTable.wiki Wed Jan 13 01:00:06 2010
+++ /wiki/DataTable.wiki Wed Jan 13 16:15:41 2010
@@ -176,6 +176,8 @@

Inserts data into a platform store. It optionally takes a single parameter
which is a comma separated list of types (which must be mapped short
names). These are added as rdf:type properties for the inserted resource.
If multiple types are specified then multiple rdf:types will be added.

+Note that this method is in beta: it has been tested but there may be
unusual corner cases that could result in data corruption
+
Insert a new resource description for something with a name of "scooby"
and a type of http://example.org/person:

<code language="php">
@@ -382,7 +384,9 @@
public void update()
}}}

-Updates data in a platform store.
+Updates data in a platform store.
+
+Note that this method is in beta: it has been tested but there may be
unusual corner cases that could result in data corruption

Update the resource description for anything with a name of "shaggy" to
have a name of "scooby":

=======================================
--- /wiki/DataTableResult.wiki Fri Jan 8 00:56:36 2010
+++ /wiki/DataTableResult.wiki Wed Jan 13 16:15:41 2010
@@ -1,5 +1,7 @@
#sidebar Sidebar
#labels Autogenerated
+#summary Represents a set of results returned from a DataTable query.
+
*note:* this page is automatically generated from embedded documentation
in the PHP source.

= Overview =
@@ -7,14 +9,14 @@
== Constructors ==
* [#DataTableResult DataTableResult]
== Methods ==
- * [#num_fields num_fields]
- * [#num_rows num_rows]
- * [#result result]
- * [#result_array result_array]
+ * [#num_fields num_fields] - Returns the number of fields in the result
set.
+ * [#num_rows num_rows] - Returns the number of rows in the result set.
+ * [#result result] - Returns the query result as an array of objects, or
an empty array on any failure.
+ * [#result_array result_array] - Returns the query result as an array of
associative arrays, or an empty array on any failure.
* [#row row]
- * [#row_array row_array]
- * [#rowdata rowdata]
- * [#to_string to_string]
+ * [#row_array row_array] - Returns an associative array containing a
single result row.
+ * [#rowdata rowdata] - Returns an associative array containing metadata
about the values in the specified row.
+ * [#to_string to_string] - Returns a tabular string representation of the
results.

= Constructor Detail =

@@ -34,7 +36,7 @@
public void num_fields()
}}}

-
+Returns the number of fields in the result set.

== num_rows ==

@@ -42,7 +44,7 @@
public void num_rows()
}}}

-
+Returns the number of rows in the result set.

== result ==

@@ -50,7 +52,21 @@
public void result()
}}}

-
+Returns the query result as an array of objects, or an empty array on any
failure. Each field in the original query is mapped to an object variable.
+
+For example:
+
+<code language="php">
+$dt = new DataTable('http://api.talis.com/stores/mystore');
+$dt->map('http://xmlns.com/foaf/0.1/name', 'name');
+$dt->map('http://xmlns.com/foaf/0.1/nick', 'nick');
+$dt->select('name,nick')->limit(10);
+$res = $dt->get();
+foreach ($res->result() as $row) {
+ echo $row->name;
+ echo $row->nick;
+}
+</code>

== result_array ==

@@ -58,7 +74,19 @@
public void result_array()
}}}

-
+Returns the query result as an array of associative arrays, or an empty
array on any failure. The keys and values of the associative array
correspond with the fields and values in the results.
+
+For example:
+
+<code language="php">
+$dt->select('name,nick')->limit(10);
+$res = $dt->get();
+
+foreach ($res->result_array() as $row) {
+ echo $row['name'];
+ echo $row['nick'];
+}
+</code>

== row ==

@@ -74,7 +102,7 @@
public void row_array(mixed index)
}}}

-
+Returns an associative array containing a single result row. The $index
parameter is optional and defaults to zero.

== rowdata ==

@@ -82,7 +110,25 @@
public void rowdata(mixed index)
}}}

-
+Returns an associative array containing metadata about the values in the
specified row. The array keys correspond to field names and the values to
another associative array containing the metadata for that field's value.
The $index parameter is optional and defaults to zero.
+
+The following metadata keys are available:
+
+<ul>
+<li>type - the type of the field's value, one of "uri", "bnode"
or "literal"</li>
+<li>datatype - the datatype of a literal value, or null if no datatype was
detected</li>
+<li>lang - the language code of a literal value, or null if no language
was detected</li>
+</ul>
+For example:
+
+<code language="php">
+$dt->select('name,nick')->limit(10);
+$res = $dt->get();
+$rowdata = $res->rowdata(5);
+echo $rowdata['name']['type'];
+echo $rowdata['name']['lang'];
+echo $rowdata['name']['datatype'];
+</code>

== to_string ==

@@ -90,7 +136,7 @@
public void to_string()
}}}

-
+Returns a tabular string representation of the results.

Reply all
Reply to author
Forward
0 new messages