This video shows the activity in the constuct development repository from July 2005 to Jan 2009, frames were generated using the codeswarm system, and the video was rendered using the Virtual Dub application.
Author Archive for matt
Using PHP to access construct is desirable to allow interesting construct based web applications to be developed that allow easy implementation, and rapid prototyping. On this basis, we developed a PHP class that allows a developer to connect to a running instance of Construct and manipulate data quicky and easily, without the need to run standalone JAVA applications.
(Download Construct PHP Class)
The PHP Class has been tested on Windows versions of PHP (using XAMPP) and on Mac XServe (Darwin), it should work with any webserver running PHP 5, (possibly 4) with sockets support.
The Construct PHP Class also contains a file called constructmananger.php and example.php, the Construct Manager uses the Construct class to give an advanced web interface to Construct, and the Example shows a simple implementation of a sparql query using the Construct class.
Put the files in any web accessible directory, and edit the example.php file to point at the machine that is running Construct.
<?php
$host = "localhost";
// find the class
include_once('Construct.class.php');
// create a new construct object
$construct = new Construct($host);
?>
After importing the class and instatiating it (see above) it is then possible to query Construct as shown below
// prepare a query
$sparql_query = "SELECT ?subject ?predicate ?object WHERE {?subject ?predicate ?object}";
// execute query
try{
$results = $construct->query($sparql_query);
}Catch(Exception $e){
// catch any problems
echo $e->getMessage();
exit();
}
// output the results
print_r($results);
The results are returned as a PHP array by default, but can also be returned as JSON, XML or a Simple XML Object.
$construct->query($querystring, [$xsl=null, [$format=null, [&$error=null]]])
Where $querystring is the SPARQL query, $xsl is the xsl-stylesheet to apply (send null if not used), $format indicated the format of the returned data, and $error is an array into which errors should be placed. Values in [] are optional.
The values for format are:
JSON, XML, XMLOBJECT or ARRAY
It is also possible to insert data, the following gives an example
$timeout = "30000"; // Time in ms to keep data in store
try{
$success = $construct->insert($rdftriplets, $timeout);
}Catch(Exception $e){
echo $e-getMessage();
}
Where $rdftriplets are in valid n-triple format.
If links are unavailable, you can try here
![[del.icio.us]](http://www.construct-infrastructure.org/wp-content/plugins/bookmarkify/delicious.png)
![[Digg]](http://www.construct-infrastructure.org/wp-content/plugins/bookmarkify/digg.png)
![[Google]](http://www.construct-infrastructure.org/wp-content/plugins/bookmarkify/google.png)
![[StumbleUpon]](http://www.construct-infrastructure.org/wp-content/plugins/bookmarkify/stumbleupon.png)
![[Windows Live]](http://www.construct-infrastructure.org/wp-content/plugins/bookmarkify/windowslive.png)
![[Yahoo!]](http://www.construct-infrastructure.org/wp-content/plugins/bookmarkify/yahoo.png)
![[Email]](http://www.construct-infrastructure.org/wp-content/plugins/bookmarkify/email.png)