ConverterTsv Class Reference
[Converter TSV Web Service]

Convert TSV data into RDF. More...

Inherits WebService.

Collaboration diagram for ConverterTsv:

List of all members.

Public Member Functions

 __construct ($document="", $docmime="text/tsv", $delimiter="\t", $base_uri="http://www.baseuri.com/resource/", $registered_ip, $requester_ip)
 Constructor.
 __destruct ()
 pipeline_getError ()
 Returns the error structure.
 pipeline_getResultset ()
 Generate the converted TSV items using the internal XML representation.
 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 converted UCB Memorial Data content into different serialization formats.
 pipeline_serialize_reification ()
 Non implemented method (only defined).
 ws_serialize ()
 Serialize the converted UCB Memorial Data content into different serialization formats.
 ws_respond ($content)
 Sends the HTTP response to the requester.
 process ()
 Convert the target document.
 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 serialization mime types 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

 get_domain ($url)
 Get the domain of a URL.
 getNamespace ($uri)
 Get the namespace of a URI.
 uriEncode ($uri)
 Normalize the remaining of a URI.
 tsvParsingError ()
 Parse the TSV file for declaraton error (properties or classes used in the file that are not defined on the node).

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.
 $text
 Text being converted.
 $docmime
 Mime type of the document.
 $type
 Type of the resource being converted.
 $tsvResources
 Parsed TSV data items.
 $baseURI
 Base URI for the resources being created by this convertion process.
 $errorMessages = ""
 Error message to report.
 $requester_ip = ""
 IP of the requester.
 $registered_ip = ""
 Requested IP.
 $delimiter = ""
 Delimiter character of the TSV file.
 $errorMessenger
 Error messages of this web service.


Detailed Description

Convert TSV data into RDF.

This class takes TSV (table separeted values) files as input, convert them into RDF using the BKN Ontology, and output RDF in different formats.


Author:
Frederick Giasson, Structured Dynamics LLC.
Todo:
Implementing the input of RDF and output in TSV' format



Definition at line 30 of file ConverterTsv.php.


Constructor & Destructor Documentation

ConverterTsv::__construct ( document = "",
docmime = "text/tsv",
delimiter = "\t",
base_uri = "http://www.baseuri.com/resource/",
registered_ip,
requester_ip 
)

Constructor.

Initialize the TSV Converter Web Service


Parameters:
[in] $document Text of a Bibtex document
[in] $docmime The mime type of the incoming document to convert
[in] $delimiter Delimiter used to split fields of a record row
[in] $base_uri The base URI to use to create the URIs of the resources created by this web service
[in] $registered_ip Target IP address registered in the WSF
[in] $requester_ip IP address of the requester
Returns:
returns NULL
Author:
Frederick Giasson, Structured Dynamics LLC.



Definition at line 122 of file ConverterTsv.php.

References $base_uri, $delimiter, $docmime, $document, $registered_ip, $requester_ip, and WebService::__construct().

Here is the call graph for this function:

ConverterTsv::__destruct (  ) 

Reimplemented from WebService.

Definition at line 171 of file ConverterTsv.php.

Referenced by ws_respond().


Member Function Documentation

ConverterTsv::get_domain ( url  )  [private]

Get the domain of a URL.


Parameters:
[in] $url the full URL
Returns:
the domain name of the URL *with* the prefix "http://"
Author:
Frederick Giasson, Structured Dynamics LLC.



Definition at line 280 of file ConverterTsv.php.

References $url.

Referenced by pipeline_getResultset().

ConverterTsv::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
Author:
Frederick Giasson, Structured Dynamics LLC.



Definition at line 724 of file ConverterTsv.php.

References WebService::$uri.

Referenced by pipeline_serialize().

ConverterTsv::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
Author:
Frederick Giasson, Structured Dynamics LLC.



Reimplemented from WebService.

Definition at line 313 of file ConverterTsv.php.

Referenced by pipeline_getResultset().

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
Author:
Frederick Giasson, Structured Dynamics LLC.



Definition at line 398 of file WebService.php.

Referenced by Sparql::pipeline_serialize(), Search::pipeline_serialize(), DatasetRead::pipeline_serialize(), CrudRead::pipeline_serialize(), Browse::pipeline_serialize(), and AuthLister::pipeline_serialize().

ConverterTsv::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
Author:
Frederick Giasson, Structured Dynamics LLC.



Reimplemented from WebService.

Definition at line 387 of file ConverterTsv.php.

References ws_conneg().

Here is the call graph for this function:

ConverterTsv::pipeline_getError (  ) 

Returns the error structure.


Returns:
returns the error structure
Author:
Frederick Giasson, Structured Dynamics LLC.



Reimplemented from WebService.

Definition at line 203 of file ConverterTsv.php.

ConverterTsv::pipeline_getResponseHeaderStatus (  ) 

Returns the response HTTP header status.


Returns:
returns the response HTTP header status
Author:
Frederick Giasson, Structured Dynamics LLC.



Reimplemented from WebService.

Definition at line 400 of file ConverterTsv.php.

ConverterTsv::pipeline_getResponseHeaderStatusMsg (  ) 

Returns the response HTTP header status message.


Returns:
returns the response HTTP header status message
Author:
Frederick Giasson, Structured Dynamics LLC.



Reimplemented from WebService.

Definition at line 412 of file ConverterTsv.php.

ConverterTsv::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
Author:
Frederick Giasson, Structured Dynamics LLC.



Reimplemented from WebService.

Definition at line 426 of file ConverterTsv.php.

ConverterTsv::pipeline_getResultset (  ) 

Generate the converted TSV items using the internal XML representation.


Returns:
a XML document
Author:
Frederick Giasson, Structured Dynamics LLC.



Reimplemented from WebService.

Definition at line 215 of file ConverterTsv.php.

References WebService::$uri, get_domain(), injectDoctype(), uriEncode(), and WebService::xmlEncode().

Referenced by pipeline_serialize(), and ws_serialize().

Here is the call graph for this function:

ConverterTsv::pipeline_serialize (  ) 

Serialize the converted UCB Memorial Data content into different serialization formats.


Returns:
returns the serialized content
Author:
Frederick Giasson, Structured Dynamics LLC.



Reimplemented from WebService.

Definition at line 438 of file ConverterTsv.php.

References getNamespace(), pipeline_getResultset(), and WebService::xmlEncode().

Referenced by ws_serialize().

Here is the call graph for this function:

ConverterTsv::pipeline_serialize_reification (  ) 

Non implemented method (only defined).


Author:
Frederick Giasson, Structured Dynamics LLC.



Reimplemented from WebService.

Definition at line 645 of file ConverterTsv.php.

Referenced by ws_serialize().

ConverterTsv::process (  ) 

Convert the target document.


Author:
Frederick Giasson, Structured Dynamics LLC.



Reimplemented from WebService.

Definition at line 918 of file ConverterTsv.php.

ConverterTsv::tsvParsingError (  )  [private]

Parse the TSV file for declaraton error (properties or classes used in the file that are not defined on the node).


Returns:
returns TRUE if there is errors; FALSE otherwise
Author:
Frederick Giasson, Structured Dynamics LLC.



Definition at line 806 of file ConverterTsv.php.

Referenced by ws_serialize().

ConverterTsv::uriEncode ( uri  )  [private]

Normalize the remaining of a URI.


Parameters:
[in] $uri The remaining of a URI to normalize
Returns:
a Normalized remaining URI
Author:
Frederick Giasson, Structured Dynamics LLC.



Definition at line 758 of file ConverterTsv.php.

References WebService::$uri.

Referenced by pipeline_getResultset().

ConverterTsv::validateQuery (  )  [protected]

Validate a query to this web service.


Returns:
TRUE if valid; FALSE otherwise
Author:
Frederick Giasson, Structured Dynamics LLC.



Reimplemented from WebService.

Definition at line 191 of file ConverterTsv.php.

ConverterTsv::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
Author:
Frederick Giasson, Structured Dynamics LLC.



Reimplemented from WebService.

Definition at line 342 of file ConverterTsv.php.

References $supportedSerializations.

Referenced by pipeline_conneg().

ConverterTsv::ws_respond ( content  ) 

Sends the HTTP response to the requester.


Parameters:
[in] $content The content (body) of the response.
Returns:
NULL
Author:
Frederick Giasson, Structured Dynamics LLC.



Reimplemented from WebService.

Definition at line 780 of file ConverterTsv.php.

References __destruct().

Here is the call graph for this function:

ConverterTsv::ws_serialize (  ) 

Serialize the converted UCB Memorial Data content into different serialization formats.


Returns:
returns the serialized content
Author:
Frederick Giasson, Structured Dynamics LLC.



Reimplemented from WebService.

Definition at line 657 of file ConverterTsv.php.

References pipeline_getResultset(), pipeline_serialize(), pipeline_serialize_reification(), and tsvParsingError().

Here is the call graph for this function:


Member Data Documentation

ConverterTsv::$baseURI [private]

Base URI for the resources being created by this convertion process.

Definition at line 54 of file ConverterTsv.php.

ConverterTsv::$conneg [private]

Conneg object that manage the content negotiation capabilities of the web service.

Definition at line 36 of file ConverterTsv.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().

ConverterTsv::$db [private]

Database connection.

Definition at line 33 of file ConverterTsv.php.

WebService::$db_dsn = "" [protected, inherited]

Database DSN connection.

Definition at line 46 of file WebService.php.

WebService::$db_host = "localhost" [protected, inherited]

Database host.

Definition at line 49 of file WebService.php.

WebService::$db_password = "" [protected, inherited]

Database password.

Definition at line 43 of file WebService.php.

WebService::$db_username = "" [protected, inherited]

Database user name.

Definition at line 40 of file WebService.php.

ConverterTsv::$delimiter = "" [private]

Delimiter character of the TSV file.

Definition at line 66 of file ConverterTsv.php.

Referenced by __construct().

ConverterTsv::$docmime [private]

Mime type of the document.

Definition at line 45 of file ConverterTsv.php.

Referenced by __construct().

WebService::$dtdBaseURL = "" [protected, inherited]

DTD URL of the web service.

Definition at line 52 of file WebService.php.

ConverterTsv::$dtdURL [private]

URL where the DTD of the XML document can be located on the Web.

Definition at line 39 of file ConverterTsv.php.

WebService::$endpoint [protected, inherited]

The endpoint of the Authentication Registrar web service.

Definition at line 98 of file WebService.php.

ConverterTsv::$errorMessages = "" [private]

Error message to report.

Definition at line 57 of file ConverterTsv.php.

ConverterTsv::$errorMessenger [private]

Initial value:

    '{
                        "ws": "/ws/converter/irv/",
                        "_200": {
                          "id": "WS-CONVERTER-IRV-200",
                          "level": "Warning",
                          "name": "No data to convert",
                          "description": "No data to convert"
                        },
                        "_201": {
                          "id": "WS-CONVERTER-IRV-201",
                          "level": "Warning",
                          "name": "Document mime not supported (supported mimes: text/tsv, text/csv and text/xml)",
                          "description": "Document mime not supported (supported mimes: text/tsv, text/csv and text/xml)"
                        },
                        "_300": {
                          "id": "WS-CONVERTER-IRV-300",
                          "level": "Warning",
                          "name": "Parsing Errors",
                          "description": "Parsing Errors"
                        },
                        "_301": {
                          "id": "WS-CONVERTER-IRV-301",
                          "level": "Warning",
                          "name": "No TSV data converted",
                          "description": "No TSV data converted"
                        }  
                      }'
Error messages of this web service.

Definition at line 74 of file ConverterTsv.php.

WebService::$log_table = "SD.WSF.ws_queries_log" [protected, inherited]

Name of the logging table on the Virtuoso instance.

Definition at line 79 of file WebService.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().

WebService::$ontological_structure_folder = "" [protected, inherited]

Path to the structWSF ontological structure.

Definition at line 76 of file WebService.php.

WebService::$ontologies_files_folder = "" [protected, inherited]

Path to the ontologies description files (in RDFS and OWL).

Definition at line 70 of file WebService.php.

ConverterTsv::$registered_ip = "" [private]

Requested IP.

Definition at line 63 of file ConverterTsv.php.

Referenced by __construct().

ConverterTsv::$requester_ip = "" [private]

IP of the requester.

Definition at line 60 of file ConverterTsv.php.

Referenced by __construct().

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]

Hostname where to send queries to the Solr instance.

Definition at line 73 of file WebService.php.

ConverterTsv::$supportedSerializations [static]

Initial value:

    array ("application/rdf+xml", "application/rdf+n3", "application/*", "text/tsv", "text/csv", "text/xml", "text/*",
      "*/*")
Supported serialization mime types by this Web service.

Definition at line 69 of file ConverterTsv.php.

Referenced by ws_conneg().

ConverterTsv::$text [private]

Text being converted.

Definition at line 42 of file ConverterTsv.php.

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().

ConverterTsv::$tsvResources [private]

Parsed TSV data items.

Definition at line 51 of file ConverterTsv.php.

ConverterTsv::$type [private]

Type of the resource being converted.

Definition at line 48 of file ConverterTsv.php.

WebService::$wsf_base_path = "" [protected, inherited]

Local server path of the WSF files.

Definition at line 61 of file WebService.php.

WebService::$wsf_base_url = "" [protected, inherited]

Base URL of the WSF.

Definition at line 58 of file WebService.php.

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]

Local server path of the WSF files.

Definition at line 64 of file WebService.php.

WebService::$wsf_solr_core = "" [protected, inherited]

The core to use for Solr; "" for no core.

Definition at line 67 of file WebService.php.


The documentation for this class was generated from the following file:
Copyright © 2009. Structured Dynamics LLC Structured Dynamics LLC. All rights reserved.