Open Semantic Framework PHP API  3.0
 All Data Structures Namespaces Files Functions Variables Pages
CrudReadQuery Class Reference

Crud Read Query to a OSF Crud Read web service endpoint. More...

Inheritance diagram for CrudReadQuery:

Public Member Functions

 __construct ($network, $appID, $apiKey, $userID)
 Constructor. More...
 
 uri ($uris)
 Set the URI(s) of the records' description needed to be returned by the user. More...
 
 dataset ($uris)
 Set the URI(s) of the dataset where the instance record is indexed. More...
 
 includeLinksback ()
 Specifies that the reference to the other instance records referring to the target instance record will be added in the resultset. More...
 
 excludeLinksback ()
 Specifies that the reference to the other instance records referring to the target instance record won't be added in the resultset. More...
 
 includeReification ()
 Specifies that you want to include the reification information for the returned records. More...
 
 excludeReification ()
 Specifies that you want to exclude the reification information for the returned records. More...
 
 lang ($lang= 'en')
 Specifies the language of the records to be returned by the search endpoint. More...
 
 includeAttributes ($attributes)
 Set a list of attribute URIs to include in the resultset returned by the endpoint. More...
 

Detailed Description

Crud Read Query to a OSF Crud Read web service endpoint.

The CRUD: Read Web service is used to get the description of a target instance record indexed in a dataset belonging to a WSF (Web Services Framework).

Here is a code example of how this class can be used by developers:

// Use the CrudReadQuery class
// Create the CrudReadQuery object
$cread = new CrudReadQuery("http://demo.citizen-dan.org/ws/");
// Get the description of the Nursery_schools record
$cread->uri("http://purl.org/ontology/muni#Nursery_schools");
// Exclude possible linksback
$cread->excludeLinksback();
// Exclude possible reification statements
$cread->excludeReification();
// Send the crud read query to the endpoint
$cread->send();
print_r($cread);
// Get back the resultset returned by the endpoint
$resultset = $cread->getResultset();
// Print different serializations for that resultset
print_r($resultset->getResultset());
See also
http://wiki.opensemanticframework.org/index.php/CRUD:_Read
Author
Frederick Giasson, Structured Dynamics LLC.

Definition at line 55 of file CrudReadQuery.php.

Constructor & Destructor Documentation

__construct (   $network,
  $appID,
  $apiKey,
  $userID 
)

Constructor.

Parameters
mixed$networkOSF network where to send this query. Ex: http://localhost/ws/
mixed$appIDThe Application ID of the instance instance to key. The APP-ID is related to the API-KEY
mixed$apiKeyThe API Key of the OSF web service endpoints
mixed$userIDThe ID of the user that is doing the query

Definition at line 65 of file CrudReadQuery.php.

Member Function Documentation

dataset (   $uris)

Set the URI(s) of the dataset where the instance record is indexed.

If this parameter is omitted (empty), the web service will query all the datasets of the system, that can be read by the requester, to try to find a definition for this record URI

Optional: This function could be called before sending the query

Parameters
mixed$urisA single URI string, or an array or URI strings that refers to the datasets where the requested record URIs are indexed. If we have set an array: array("a", "b", "c") for uri(), then we have to list the dataset URIs in the same order, such that we have: array("dataset-a", "dataset-b", "dataset-c").
See also
http://wiki.opensemanticframework.org/index.php/CRUD:_Read#Web_Service_Endpoint_Information
Author
Frederick Giasson, Structured Dynamics LLC.*

Definition at line 142 of file CrudReadQuery.php.

excludeLinksback ( )

Specifies that the reference to the other instance records referring to the target instance record won't be added in the resultset.

This is the default behavior of this service.

See also
http://wiki.opensemanticframework.org/index.php/CRUD:_Read#Web_Service_Endpoint_Information
Author
Frederick Giasson, Structured Dynamics LLC.*

Definition at line 187 of file CrudReadQuery.php.

excludeReification ( )

Specifies that you want to exclude the reification information for the returned records.

Reified information is meta-information about some attribute/values defined for the records.

This is the default behavior of the service.

See also
http://wiki.opensemanticframework.org/index.php/CRUD:_Read#Web_Service_Endpoint_Information
Author
Frederick Giasson, Structured Dynamics LLC.

Definition at line 221 of file CrudReadQuery.php.

includeAttributes (   $attributes)

Set a list of attribute URIs to include in the resultset returned by the endpoint.

All the attributes used to defined the returned resultset that are not listed in this array will be ignored, and won't be returned by the endpoint. This is normally used when you know the properties you need for your application, and that you want to limit the bandwidth and minimize the size of the resultset.

Optional: This function could be called before sending the query

Parameters
mixed$attributesAn array of attribute URIs to see in the resultset
See also
http://wiki.opensemanticframework.org/index.php/CRUD:_Read#Web_Service_Endpoint_Information
Author
Frederick Giasson, Structured Dynamics LLC.

Definition at line 263 of file CrudReadQuery.php.

includeLinksback ( )

Specifies that the reference to the other instance records referring to the target instance record will be added in the resultset.

See also
http://wiki.opensemanticframework.org/index.php/CRUD:_Read#Web_Service_Endpoint_Information
Author
Frederick Giasson, Structured Dynamics LLC.*

Definition at line 170 of file CrudReadQuery.php.

includeReification ( )

Specifies that you want to include the reification information for the returned records.

Reified information is meta-information about some attribute/values defined for the records.

See also
http://wiki.opensemanticframework.org/index.php/CRUD:_Read#Web_Service_Endpoint_Information
Author
Frederick Giasson, Structured Dynamics LLC.*

Definition at line 203 of file CrudReadQuery.php.

lang (   $lang = 'en')

Specifies the language of the records to be returned by the search endpoint.

Only the textual information of the requested language will be returned to the user. If no textual information is available for a record, for a requested language, then only non-textual information will be returned about the record. The default is "en"; however, if the parameter is an empty string, then all the language strings for the record(s) will be returned.

The default behavior is that the language is 'en' (English)

See also
http://wiki.opensemanticframework.org/index.php/CRUD:_Read#Web_Service_Endpoint_Information
Author
Frederick Giasson, Structured Dynamics LLC.

Definition at line 241 of file CrudReadQuery.php.

uri (   $uris)

Set the URI(s) of the records' description needed to be returned by the user.

Required: This function must be called before sending the query

Parameters
mixed$urisA single URI string, or an array or URI strings that refers to the record(s) that have to be returned by the endpoint
See also
http://wiki.opensemanticframework.org/index.php/CRUD:_Read#Web_Service_Endpoint_Information
Author
Frederick Giasson, Structured Dynamics LLC.*

Definition at line 105 of file CrudReadQuery.php.