Sparql Class Reference
SPARQL Web Service. It sends SPARQL queries to datasets indexed in the structWSF instance. More...Inherits WebService.

Public Member Functions | |
| __construct ($query, $dataset, $limit, $offset, $registered_ip, $requester_ip) | |
| Constructor. | |
| __destruct () | |
| pipeline_getError () | |
| Returns the error structure. | |
| pipeline_getResultset () | |
| Create a resultset in a pipelined mode based on the processed information by the Web service. | |
| injectDoctype ($xmlDoc) | |
| Inject the DOCType in a XML document. | |
| ws_conneg ($accept, $accept_charset, $accept_encoding, $accept_language) | |
| Do content negotiation as an external Web Service. | |
| pipeline_conneg ($accept, $accept_charset, $accept_encoding, $accept_language) | |
| Do content negotiation as an internal, pipelined, Web Service that is part of a Compound Web Service. | |
| pipeline_getResponseHeaderStatus () | |
| Returns the response HTTP header status. | |
| pipeline_getResponseHeaderStatusMsg () | |
| Returns the response HTTP header status message. | |
| pipeline_getResponseHeaderStatusMsgExt () | |
| Returns the response HTTP header status message extension. | |
| pipeline_serialize () | |
| Serialize the web service answer. | |
| pipeline_serialize_reification () | |
| Non implemented method (only defined). | |
| ws_serialize () | |
| Serialize the web service answer. | |
| ws_respond ($content) | |
| Sends the HTTP response to the requester. | |
| process () | |
| Send the SPARQL query to the triple store of this WSF. | |
| xmlEncode ($string) | |
| Encode content to be included in XML files. | |
| jsonEncode ($string) | |
| Encode a string to put in a JSON value. | |
Static Public Attributes | |
| static | $supportedSerializations |
| Supported MIME serializations by this web service. | |
| static | $data_ini = "/data/" |
| data.ini file folder | |
| static | $network_ini = "/usr/share/structwsf/" |
| network.ini file folder | |
Protected Member Functions | |
| validateQuery () | |
| Validate a query to this web service. | |
Protected Attributes | |
| $db_username = "" | |
| Database user name. | |
| $db_password = "" | |
| Database password. | |
| $db_dsn = "" | |
| Database DSN connection. | |
| $db_host = "localhost" | |
| Database host. | |
| $dtdBaseURL = "" | |
| DTD URL of the web service. | |
| $wsf_graph = "" | |
| The graph where the Web Services Framework description has been indexed. | |
| $wsf_base_url = "" | |
| Base URL of the WSF. | |
| $wsf_base_path = "" | |
| Local server path of the WSF files. | |
| $wsf_local_ip = "" | |
| Local server path of the WSF files. | |
| $wsf_solr_core = "" | |
| The core to use for Solr; "" for no core. | |
| $ontologies_files_folder = "" | |
| Path to the ontologies description files (in RDFS and OWL). | |
| $solr_host = "localhost" | |
| Hostname where to send queries to the Solr instance. | |
| $ontological_structure_folder = "" | |
| Path to the structWSF ontological structure. | |
| $log_table = "SD.WSF.ws_queries_log" | |
| Name of the logging table on the Virtuoso instance. | |
| $solr_auto_commit = FALSE | |
| Auto commit handled by the Solr data management systems. If this parameter is true, then this means Solr will handle the commit operation by itself. If it is false, then the web services will trigger the commit operations. Usually, Auto-commit should be handled by Solr when the size of the dataset is too big, otherwise operation such as delete could take much time. | |
| $uri | |
| The URI of the Authentication Registrar web service. | |
| $title | |
| The Title of the Authentication Registrar web service. | |
| $crud_usage | |
| The CRUD usage of the Authentication Registrar web service. | |
| $endpoint | |
| The endpoint of the Authentication Registrar web service. | |
Private Member Functions | |
| getNamespace ($uri) | |
| Get the namespace of a URI. | |
| xml2ary (&$string) | |
| _del_p (&$ary) | |
| ary2xml ($cary, $d=0, $forcetag= '') | |
| ins2ary (&$ary, $element, $pos) | |
Private Attributes | |
| $db | |
| Database connection. | |
| $conneg | |
| Conneg object that manage the content negotiation capabilities of the web service. | |
| $dtdURL | |
| URL where the DTD of the XML document can be located on the Web. | |
| $query = "" | |
| Sparql query. | |
| $dataset = "" | |
| Dataset where t send the query. | |
| $requester_ip = "" | |
| IP of the requester. | |
| $limit = "" | |
| Limit of the number of results to return in the resultset. | |
| $offset = "" | |
| Offset of the "sub-resultset" from the total resultset of the query. | |
| $registered_ip = "" | |
| Requested IP. | |
| $sparqlContent = "" | |
| SPARQL query content resultset. | |
| $instanceRecordsObjectLiteral = array() | |
| Instance records from the query where the object of the triple is a literal. | |
| $instanceRecordsObjectResource = array() | |
| Instance records from the query where the object of the triple is a resource. | |
| $namespaces | |
| Namespaces/Prefixes binding. | |
| $errorMessenger | |
| Error messages of this web service. | |
Detailed Description
SPARQL Web Service. It sends SPARQL queries to datasets indexed in the structWSF instance.
Definition at line 26 of file Sparql.php.
Constructor & Destructor Documentation
| Sparql::__construct | ( | $ | query, | |
| $ | dataset, | |||
| $ | limit, | |||
| $ | offset, | |||
| $ | registered_ip, | |||
| $ | requester_ip | |||
| ) |
Constructor.
Initialize the Sparql Web Service
- Parameters:
-
[in] $query SPARQL query to send to the triple store of the WSF [in] $dataset Dataset URI where to send the query [in] $limit Limit of the number of results to return in the resultset [in] $offset Offset of the "sub-resultset" from the total resultset of the query [in] $registered_ip Target IP address registered in the WSF [in] $requester_ip IP address of the requester
- Returns:
- returns NULL
Definition at line 130 of file Sparql.php.
References $dataset, $limit, $offset, $query, $registered_ip, $requester_ip, and WebService::__construct().

| Sparql::__destruct | ( | ) |
Reimplemented from WebService.
Definition at line 177 of file Sparql.php.
Referenced by ws_respond().
Member Function Documentation
| Sparql::_del_p | ( | &$ | ary | ) | [private] |
| Sparql::ary2xml | ( | $ | cary, | |
| $ | d = 0, |
|||
| $ | forcetag = '' | |||
| ) | [private] |
Definition at line 1288 of file Sparql.php.
| Sparql::getNamespace | ( | $ | uri | ) | [private] |
Get the namespace of a URI.
- Parameters:
-
[in] $uri Uri of the resource from which we want the namespace
- Returns:
- returns the extracted namespace
Definition at line 548 of file Sparql.php.
References WebService::$uri.
Referenced by pipeline_serialize().
| Sparql::injectDoctype | ( | $ | xmlDoc | ) |
Inject the DOCType in a XML document.
- Parameters:
-
[in] $xmlDoc The XML document where to inject the doctype
- Returns:
- a XML document with a doctype
Reimplemented from WebService.
Definition at line 399 of file Sparql.php.
Referenced by pipeline_getResultset().
| Sparql::ins2ary | ( | &$ | ary, | |
| $ | element, | |||
| $ | pos | |||
| ) | [private] |
Definition at line 1319 of file Sparql.php.
| WebService::jsonEncode | ( | $ | string | ) | [inherited] |
Encode a string to put in a JSON value.
- Parameters:
-
[in] $string The string to escape
- Returns:
- returns the escaped string
Definition at line 398 of file WebService.php.
Referenced by pipeline_serialize(), Search::pipeline_serialize(), DatasetRead::pipeline_serialize(), CrudRead::pipeline_serialize(), Browse::pipeline_serialize(), and AuthLister::pipeline_serialize().
| Sparql::pipeline_conneg | ( | $ | accept, | |
| $ | accept_charset, | |||
| $ | accept_encoding, | |||
| $ | accept_language | |||
| ) |
Do content negotiation as an internal, pipelined, Web Service that is part of a Compound Web Service.
- Parameters:
-
[in] $accept Accepted mime types (HTTP header) [in] $accept_charset Accepted charsets (HTTP header) [in] $accept_encoding Accepted encodings (HTTP header) [in] $accept_language Accepted languages (HTTP header)
- Returns:
- returns NULL
Reimplemented from WebService.
Definition at line 495 of file Sparql.php.
References ws_conneg().

| Sparql::pipeline_getError | ( | ) |
Returns the error structure.
- Returns:
- returns the error structure
Reimplemented from WebService.
Definition at line 254 of file Sparql.php.
| Sparql::pipeline_getResponseHeaderStatus | ( | ) |
Returns the response HTTP header status.
- Returns:
- returns the response HTTP header status
Reimplemented from WebService.
Definition at line 508 of file Sparql.php.
| Sparql::pipeline_getResponseHeaderStatusMsg | ( | ) |
Returns the response HTTP header status message.
- Returns:
- returns the response HTTP header status message
Reimplemented from WebService.
Definition at line 520 of file Sparql.php.
| Sparql::pipeline_getResponseHeaderStatusMsgExt | ( | ) |
Returns the response HTTP header status message extension.
- Returns:
- returns the response HTTP header status message extension
- Note:
- The extension of a HTTP status message is
Reimplemented from WebService.
Definition at line 534 of file Sparql.php.
| Sparql::pipeline_getResultset | ( | ) |
Create a resultset in a pipelined mode based on the processed information by the Web service.
- Returns:
- a resultset XML document
Reimplemented from WebService.
Definition at line 267 of file Sparql.php.
References Namespaces::$dcterms, Namespaces::$foaf, Namespaces::$rdfs, Namespaces::$skos_2004, Namespaces::$skos_2008, $type, WebService::$uri, injectDoctype(), and WebService::xmlEncode().
Referenced by pipeline_serialize(), and ws_serialize().

| Sparql::pipeline_serialize | ( | ) |
Serialize the web service answer.
- Returns:
- returns the serialized content
Reimplemented from WebService.
Definition at line 601 of file Sparql.php.
References getNamespace(), WebService::jsonEncode(), pipeline_getResultset(), and WebService::xmlEncode().
Referenced by ws_serialize().

| Sparql::pipeline_serialize_reification | ( | ) |
Non implemented method (only defined).
Reimplemented from WebService.
Definition at line 917 of file Sparql.php.
Referenced by ws_serialize().
| Sparql::process | ( | ) |
Send the SPARQL query to the triple store of this WSF.
Reimplemented from WebService.
Definition at line 1010 of file Sparql.php.
References $ws_av, and xml2ary().

| Sparql::validateQuery | ( | ) | [protected] |
Validate a query to this web service.
- Returns:
- TRUE if valid; FALSE otherwise
- Note:
- This function is not used by the authentication validator web service
Reimplemented from WebService.
Definition at line 199 of file Sparql.php.
References $ws_av.
Referenced by ws_conneg().
| Sparql::ws_conneg | ( | $ | accept, | |
| $ | accept_charset, | |||
| $ | accept_encoding, | |||
| $ | accept_language | |||
| ) |
Do content negotiation as an external Web Service.
- Parameters:
-
[in] $accept Accepted mime types (HTTP header) [in] $accept_charset Accepted charsets (HTTP header) [in] $accept_encoding Accepted encodings (HTTP header) [in] $accept_language Accepted languages (HTTP header)
- Returns:
- returns NULL
Reimplemented from WebService.
Definition at line 427 of file Sparql.php.
References $supportedSerializations, and validateQuery().
Referenced by pipeline_conneg().

| Sparql::ws_respond | ( | $ | content | ) |
Sends the HTTP response to the requester.
- Parameters:
-
[in] $content The content (body) of the response.
- Returns:
- NULL
Reimplemented from WebService.
Definition at line 985 of file Sparql.php.
References __destruct().

| Sparql::ws_serialize | ( | ) |
Serialize the web service answer.
- Returns:
- returns the serialized content
Reimplemented from WebService.
Definition at line 929 of file Sparql.php.
References pipeline_getResultset(), pipeline_serialize(), and pipeline_serialize_reification().

| Sparql::xml2ary | ( | &$ | string | ) | [private] |
Definition at line 1219 of file Sparql.php.
References _del_p().
Referenced by process().

| WebService::xmlEncode | ( | $ | string | ) | [inherited] |
Encode content to be included in XML files.
- Parameters:
-
[in] $string The content string to be encoded
- Returns:
- returns the encoded string
Definition at line 383 of file WebService.php.
Referenced by pipeline_getResultset(), Search::pipeline_getResultset(), DatasetRead::pipeline_getResultset(), CrudRead::pipeline_getResultset(), ConverterTsv::pipeline_getResultset(), ConverterIrJSON::pipeline_getResultset(), Browse::pipeline_getResultset(), AuthLister::pipeline_getResultset(), pipeline_serialize(), Search::pipeline_serialize(), CrudRead::pipeline_serialize(), ConverterTsv::pipeline_serialize(), ConverterIrJSON::pipeline_serialize(), ConverterBibtex::pipeline_serialize(), Browse::pipeline_serialize(), Search::pipeline_serialize_reification(), CrudRead::pipeline_serialize_reification(), Browse::pipeline_serialize_reification(), CrudUpdate::process(), and CrudCreate::process().
Member Data Documentation
Sparql::$conneg [private] |
Conneg object that manage the content negotiation capabilities of the web service.
Definition at line 32 of file Sparql.php.
WebService::$crud_usage [protected, inherited] |
The CRUD usage of the Authentication Registrar web service.
Definition at line 95 of file WebService.php.
Referenced by AuthRegistrarWs::ws_conneg().
WebService::$data_ini = "/data/" [static, inherited] |
data.ini file folder
Definition at line 34 of file WebService.php.
Referenced by WebService::__construct(), and Logger::__construct().
Sparql::$dataset = "" [private] |
Dataset where t send the query.
Definition at line 41 of file Sparql.php.
Referenced by __construct().
Sparql::$db [private] |
WebService::$db_dsn = "" [protected, inherited] |
WebService::$db_host = "localhost" [protected, inherited] |
WebService::$db_password = "" [protected, inherited] |
WebService::$db_username = "" [protected, inherited] |
WebService::$dtdBaseURL = "" [protected, inherited] |
Sparql::$dtdURL [private] |
URL where the DTD of the XML document can be located on the Web.
Definition at line 35 of file Sparql.php.
WebService::$endpoint [protected, inherited] |
The endpoint of the Authentication Registrar web service.
Definition at line 98 of file WebService.php.
Sparql::$errorMessenger [private] |
Sparql::$instanceRecordsObjectLiteral = array() [private] |
Instance records from the query where the object of the triple is a literal.
Definition at line 59 of file Sparql.php.
Sparql::$instanceRecordsObjectResource = array() [private] |
Instance records from the query where the object of the triple is a resource.
Definition at line 62 of file Sparql.php.
Sparql::$limit = "" [private] |
Limit of the number of results to return in the resultset.
Definition at line 47 of file Sparql.php.
Referenced by __construct().
WebService::$log_table = "SD.WSF.ws_queries_log" [protected, inherited] |
Sparql::$namespaces [private] |
Initial value:
array ("http://www.w3.org/2002/07/owl#" => "owl", "http://www.w3.org/1999/02/22-rdf-syntax-ns#" => "rdf",
"http://www.w3.org/2000/01/rdf-schema#" => "rdfs", "http://purl.org/ontology/wsf#" => "wsf")
Definition at line 65 of file Sparql.php.
WebService::$network_ini = "/usr/share/structwsf/" [static, inherited] |
network.ini file folder
Definition at line 37 of file WebService.php.
Referenced by WebService::__construct().
Sparql::$offset = "" [private] |
Offset of the "sub-resultset" from the total resultset of the query.
Definition at line 50 of file Sparql.php.
Referenced by __construct().
WebService::$ontological_structure_folder = "" [protected, inherited] |
WebService::$ontologies_files_folder = "" [protected, inherited] |
Path to the ontologies description files (in RDFS and OWL).
Definition at line 70 of file WebService.php.
Sparql::$query = "" [private] |
Sparql::$registered_ip = "" [private] |
Sparql::$requester_ip = "" [private] |
WebService::$solr_auto_commit = FALSE [protected, inherited] |
Auto commit handled by the Solr data management systems. If this parameter is true, then this means Solr will handle the commit operation by itself. If it is false, then the web services will trigger the commit operations. Usually, Auto-commit should be handled by Solr when the size of the dataset is too big, otherwise operation such as delete could take much time.
Definition at line 86 of file WebService.php.
WebService::$solr_host = "localhost" [protected, inherited] |
Sparql::$sparqlContent = "" [private] |
Sparql::$supportedSerializations [static] |
Initial value:
array ("application/json", "text/xml", "application/sparql-results+xml", "application/sparql-results+json",
"text/html", "application/rdf+xml", "application/rdf+n3", "application/*", "text/plain", "text/*", "*/*")
Definition at line 71 of file Sparql.php.
Referenced by ws_conneg().
WebService::$title [protected, inherited] |
The Title of the Authentication Registrar web service.
Definition at line 92 of file WebService.php.
Referenced by DatasetUpdate::__construct(), and DatasetRead::process().
WebService::$uri [protected, inherited] |
The URI of the Authentication Registrar web service.
Definition at line 89 of file WebService.php.
Referenced by DatasetUpdate::__construct(), DatasetRead::__construct(), DatasetDelete::__construct(), DatasetCreate::__construct(), CrudRead::__construct(), CrudDelete::__construct(), ConverterBibtex::get_uri_label(), getNamespace(), Search::getNamespace(), DatasetRead::getNamespace(), CrudRead::getNamespace(), ConverterTsv::getNamespace(), ConverterIrJSON::getNamespace(), Browse::getNamespace(), pipeline_getResultset(), Search::pipeline_getResultset(), ConverterTsv::pipeline_getResultset(), ConverterIrJSON::pipeline_getResultset(), Browse::pipeline_getResultset(), ConverterIrJSON::pipeline_serialize(), Search::process(), CrudUpdate::process(), CrudCreate::process(), Browse::process(), AuthRegistrarAccess::process(), DatasetRead::uriEncode(), ConverterTsv::uriEncode(), ConverterIrJSON::uriEncode(), ConverterBibtex::uriEncode(), and AuthRegistrarAccess::uriEncode().
WebService::$wsf_base_path = "" [protected, inherited] |
WebService::$wsf_base_url = "" [protected, inherited] |
WebService::$wsf_graph = "" [protected, inherited] |
The graph where the Web Services Framework description has been indexed.
Definition at line 55 of file WebService.php.
WebService::$wsf_local_ip = "" [protected, inherited] |
WebService::$wsf_solr_core = "" [protected, inherited] |
The documentation for this class was generated from the following file:
