My favorites | Sign in
Project Home Downloads Wiki Issues Source
Search
for
SparqlServiceBase  
Represents the base class for various sparql services.
Autogenerated
Updated Jan 13, 2010 by innovat...@gmail.com

note: this page is automatically generated from embedded documentation in the PHP source.

Overview

Constructors

Methods

Constructor Detail

SparqlServiceBase

public SparqlServiceBase(mixed uri, mixed credentials, mixed request_factory)

Create a new instance of this class

Param:
string uri URI of the sparql service
Credentials credentials the credentials to use for authenticated requests (optional)

Method Detail

ask

public void ask(mixed query)

Execute an ask sparql query

Param:
string query the ask query to execute
Return:
HttpResponse

construct_to_simple_graph

public void construct_to_simple_graph(mixed query)

Deprecated:
use graph_to_simple_graph

construct_to_triple_list

public void construct_to_triple_list(mixed query)

Deprecated:
triple lists are deprecated

describe

public void describe(mixed uri, mixed type, mixed output)

Obtain a bounded description of a given resource. Various types of description are supported:

  • cbd - concise bounded description
  • scbd - symmetric bounded description
  • lcbd - labelled bounded description
  • slcbd - symmetric labelled bounded description
See http://n2.talis.com/wiki/Bounded_Descriptions_in_RDF for more information on these types of description Only cbd type is supported for arrays of URIs
Param:
mixed uri the URI of the resource to be described or an array of URIs
string type the type of bounded description to be obtained (optional)
string output the format of the RDF to return - one of rdf, turtle, ntriples or json (optional)
Return:
HttpResponse

describe_to_simple_graph

public void describe_to_simple_graph(mixed uri, mixed type)

Obtain a bounded description of a given resource as a SimpleGraph. An empty SimpleGraph is returned if any HTTP errors occur.

Param:
mixed uri the URI of the resource to be described or an array of URIs
Return:
SimpleGraph

describe_to_triple_list

public void describe_to_triple_list(mixed uri)

Deprecated:
triple lists are deprecated

graph

public void graph(mixed query, mixed output)

Execute a graph type sparql query, i.e. a describe or a construct

Param:
string query the describe or construct query to execute
Return:
HttpResponse

graph_to_simple_graph

public void graph_to_simple_graph(mixed query)

Execute a graph type sparql query and obtain the result as a SimpleGraph. An empty SimpleGraph is returned if any HTTP errors occur.

Param:
string query the describe or construct query to execute
Return:
SimpleGraph

graph_to_triple_list

public void graph_to_triple_list(mixed query)

Deprecated:
triple lists are deprecated

parse_ask_results

public void parse_ask_results(mixed xml)

Parse the SPARQL XML results format from an ask query.

Param:
string xml the results XML to parse
Return:
array true if the query result was true, false otherwise

parse_select_results

public void parse_select_results(mixed xml)

Parse the SPARQL XML results format into an array. The array consist of one element per result. Each element is an associative array where the keys correspond to the variable name and the values are another associative array with the following keys:

  • type => the type of the result binding, one of 'uri', 'literal' or 'bnode'
  • value => the value of the result binding
  • lang => the language code (if any) of the result binding
  • datatype => the datatype uri (if any) of the result binding
For example: $results2['foo']['value'] will obtain the value of the foo variable for the third result
Param:
string xml the results XML to parse
Return:
array

query

public void query(mixed query, mixed mime)

Execute an arbitrary query on the sparql service. Will use GET for short queries to enhance cacheability.

Param:
string query the query to execute
string mime the media type of the expected response or the short name as listed at http://n2.talis.com/wiki/Store_Sparql_Service#Output_Formats (optional, defaults to RDF/XML and SPARQL results XML)
Return:
HttpResponse

select

public void select(mixed query)

Execute a select sparql query

Param:
string query the select query to execute
Return:
HttpResponse

select_to_array

public void select_to_array(mixed query)

Execute a select sparql query and return the results as an array. An empty array is returned if any HTTP errors occur.

Param:
string query the select query to execute
Return:
array parsed results in format returned by parse_select_results method

Generated by PHPDoctor 2RC2


Sign in to add a comment
Powered by Google Project Hosting