ConverterIrJSON Class Reference
[Converter irJSON Web Service]
Convert irJSON data into RDF. More...


Public Member Functions | |
| __construct ($document="", $docmime="application/iron+json", $include_dataset_description="false", $registered_ip, $requester_ip) | |
| Constructor. | |
| __destruct () | |
| pipeline_getError () | |
| Returns the error structure. | |
| pipeline_getResultset () | |
| Generate the converted irJSON 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. | |
| jsonRemoveTrailingCommas ($json) | |
| jsonEscape ($str) | |
| nbPredicates (&$subject, &$xml, $predicate) | |
| 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. | |
| splitUri ($str, &$base, &$ext) | |
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. | |
| $track_create = FALSE | |
| Enable the tracking of records changes from the Crud Create web service endpoint. | |
| $track_update = FALSE | |
| Enable the tracking of records changes from the Crud Update web service endpoint. | |
| $track_delete = FALSE | |
| Enable the tracking of records changes from the Crud Delete web service endpoint. | |
| $tracking_endpoint = "" | |
| Specifies a specific WSF tracking web service endpoint URL to access the tracking endpoint. This is useful to put all the record changes tracking on a different, dedicated purposes, WSF server. If this parameter is commented, we will use the wsf_base_url to access the tracking endpoints. If it is uncommented, then we will use the endpoint specified by this parameter. | |
| $triplestore_port = "8890" | |
| Port number where the triple store server is reachable. | |
| $solr_port = "8983" | |
| Port number where the Solr store server is reachable. | |
| $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. | |
| $fields_index_folder = "/tmp/" | |
| This is the folder there the file of the index where all the fields defined in Solr are indexed. You have to make sure that the web server has write access to this folder. This folder path has to end with a slash "/". | |
| $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. | |
| $owlapiNbSessions | |
| Number of sessions (threads) to use in parallel. | |
| $owlapiBridgeURI | |
| URL where the Java Bridge can be accessed from this server. | |
| $geoEnabled = FALSE | |
Private Member Functions | |
| getLinkedProperty ($property, &$linkageSchema) | |
| 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. | |
| irJSONParsingError () | |
| 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. | |
| $errorMessages = "" | |
| Error message to report. | |
| $requester_ip = "" | |
| IP of the requester. | |
| $registered_ip = "" | |
| Requested IP. | |
| $parser | |
| Parser. | |
| $include_dataset_description | |
| Include Dataset Description in the output. | |
| $namespaces = array() | |
| Defined dummany namespaces/prefixes used for data conversion for some serializations. | |
| $customLinkageSchema | |
| Custom linkage schema used to include within the dataset's description when no linkage schemas exists for some types and attributes. | |
| $errorMessenger | |
| Error messages of this web service. | |
Detailed Description
Convert irJSON data into RDF.
This class takes irJSON files as input, convert them into RDF using linkage schemas, and output RDF in different formats.
Definition at line 27 of file ConverterIrJSON.php.
Constructor & Destructor Documentation
| __construct | ( | $ | document = "", |
|
| $ | docmime = "application/iron+json", |
|||
| $ | include_dataset_description = "false", |
|||
| $ | registered_ip, | |||
| $ | requester_ip | |||
| ) |
Constructor.
Initialize the irJSON Converter Web Service
- Parameters:
-
[in] $document Text of a irJSON document [in] $docmime Mime type of the document [in] $include_dataset_description Specifies if you want to include the description of the dataset in the resultset output [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 ConverterIrJSON.php.
References $docmime, $document, $include_dataset_description, $registered_ip, $requester_ip, and WebService::__construct().

| __destruct | ( | ) |
Reimplemented from WebService.
Definition at line 181 of file ConverterIrJSON.php.
Referenced by ws_respond().
Member Function Documentation
| 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://"
Definition at line 605 of file ConverterIrJSON.php.
References $url.
| getLinkedProperty | ( | $ | property, | |
| &$ | linkageSchema | |||
| ) | [private] |
- Todo:
- Add this new property in the internal ontology of the node.
Definition at line 239 of file ConverterIrJSON.php.
Referenced by pipeline_getResultset().
| 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 1919 of file ConverterIrJSON.php.
References WebService::$uri.
Referenced by pipeline_serialize(), and pipeline_serialize_reification().
| 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 638 of file ConverterIrJSON.php.
Referenced by pipeline_getResultset().
| irJSONParsingError | ( | ) | [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
Definition at line 2001 of file ConverterIrJSON.php.
| 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 591 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().
| jsonEscape | ( | $ | str | ) |
Definition at line 1684 of file ConverterIrJSON.php.
Referenced by pipeline_serialize().
| jsonRemoveTrailingCommas | ( | $ | json | ) |
Definition at line 1678 of file ConverterIrJSON.php.
Referenced by pipeline_serialize().
| nbPredicates | ( | &$ | subject, | |
| &$ | xml, | |||
| $ | predicate | |||
| ) |
Definition at line 1686 of file ConverterIrJSON.php.
Referenced by pipeline_serialize().
| 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 702 of file ConverterIrJSON.php.
References ws_conneg().

| pipeline_getError | ( | ) |
Returns the error structure.
- Returns:
- returns the error structure
Reimplemented from WebService.
Definition at line 237 of file ConverterIrJSON.php.
| pipeline_getResponseHeaderStatus | ( | ) |
Returns the response HTTP header status.
- Returns:
- returns the response HTTP header status
Reimplemented from WebService.
Definition at line 715 of file ConverterIrJSON.php.
| pipeline_getResponseHeaderStatusMsg | ( | ) |
Returns the response HTTP header status message.
- Returns:
- returns the response HTTP header status message
Reimplemented from WebService.
Definition at line 727 of file ConverterIrJSON.php.
| 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 741 of file ConverterIrJSON.php.
| pipeline_getResultset | ( | ) |
Generate the converted irJSON items using the internal XML representation.
- Returns:
- a XML document
- Todo:
- Add this new type in the internal ontology of the node.
Reimplemented from WebService.
Definition at line 276 of file ConverterIrJSON.php.
References $type, WebService::$uri, getLinkedProperty(), and injectDoctype().
Referenced by pipeline_serialize(), pipeline_serialize_reification(), and ws_serialize().

| pipeline_serialize | ( | ) |
Serialize the converted UCB Memorial Data content into different serialization formats.
- Returns:
- returns the serialized content
- Todo:
- : custom linkage file
- Todo:
- : custom linkage file
- Todo:
- : custom linkage file
- Todo:
- : custom linkage file
- Todo:
- : custom linkage file
- Todo:
- : custom linkage file
Reimplemented from WebService.
Definition at line 753 of file ConverterIrJSON.php.
References $type, WebService::$uri, getNamespace(), jsonEscape(), jsonRemoveTrailingCommas(), nbPredicates(), pipeline_getResultset(), splitUri(), and WebService::xmlEncode().
Referenced by ws_serialize().

| pipeline_serialize_reification | ( | ) |
Non implemented method (only defined).
Reimplemented from WebService.
Definition at line 1701 of file ConverterIrJSON.php.
References getNamespace(), pipeline_getResultset(), and WebService::xmlEncode().
Referenced by ws_serialize().

| process | ( | ) |
Convert the target document.
Reimplemented from WebService.
Definition at line 2011 of file ConverterIrJSON.php.
| splitUri | ( | $ | str, | |
| &$ | base, | |||
| &$ | ext | |||
| ) | [protected] |
Definition at line 203 of file ConverterIrJSON.php.
Referenced by pipeline_serialize().
| uriEncode | ( | $ | uri | ) | [private] |
Normalize the remaining of a URI.
- Parameters:
-
[in] $uri The remaining of a URI to normalize
- Returns:
- a Normalized remaining URI
Definition at line 1953 of file ConverterIrJSON.php.
References WebService::$uri.
| validateQuery | ( | ) | [protected] |
Validate a query to this web service.
- Returns:
- TRUE if valid; FALSE otherwise
Reimplemented from WebService.
Definition at line 201 of file ConverterIrJSON.php.
| 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 667 of file ConverterIrJSON.php.
References $supportedSerializations.
Referenced by pipeline_conneg().
| 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 1975 of file ConverterIrJSON.php.
References __destruct().

| ws_serialize | ( | ) |
Serialize the converted UCB Memorial Data content into different serialization formats.
- Returns:
- returns the serialized content
Reimplemented from WebService.
Definition at line 1846 of file ConverterIrJSON.php.
References pipeline_getResultset(), pipeline_serialize(), and pipeline_serialize_reification().

| 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 569 of file WebService.php.
Referenced by ConverterCommON::pipeline_getResultset(), Sparql::pipeline_serialize(), Search::pipeline_serialize(), DatasetRead::pipeline_serialize(), CrudRead::pipeline_serialize(), ConverterTsv::pipeline_serialize(), pipeline_serialize(), ConverterBibtex::pipeline_serialize(), Browse::pipeline_serialize(), AuthLister::pipeline_serialize(), Search::pipeline_serialize_reification(), CrudRead::pipeline_serialize_reification(), pipeline_serialize_reification(), Browse::pipeline_serialize_reification(), CrudUpdate::process(), and CrudCreate::process().
Field Documentation
$conneg [private] |
Conneg object that manage the content negotiation capabilities of the web service.
Definition at line 33 of file ConverterIrJSON.php.
$crud_usage [protected, inherited] |
The CRUD usage of the Authentication Registrar web service.
Definition at line 122 of file WebService.php.
Referenced by AuthRegistrarWs::ws_conneg().
$customLinkageSchema [private] |
Custom linkage schema used to include within the dataset's description when no linkage schemas exists for some types and attributes.
Definition at line 68 of file ConverterIrJSON.php.
$data_ini = "/data/" [static, inherited] |
data.ini file folder
Definition at line 32 of file WebService.php.
Referenced by WebService::__construct(), and Logger::__construct().
$db [private] |
Database connection.
Definition at line 30 of file ConverterIrJSON.php.
$db_dsn = "" [protected, inherited] |
Database DSN connection.
Definition at line 44 of file WebService.php.
$db_host = "localhost" [protected, inherited] |
Database host.
Definition at line 47 of file WebService.php.
$db_password = "" [protected, inherited] |
Database password.
Definition at line 41 of file WebService.php.
$db_username = "" [protected, inherited] |
Database user name.
Definition at line 38 of file WebService.php.
$docmime [private] |
Mime type of the document.
Definition at line 42 of file ConverterIrJSON.php.
Referenced by __construct().
$dtdBaseURL = "" [protected, inherited] |
DTD URL of the web service.
Definition at line 50 of file WebService.php.
$dtdURL [private] |
URL where the DTD of the XML document can be located on the Web.
Definition at line 36 of file ConverterIrJSON.php.
$endpoint [protected, inherited] |
The endpoint of the Authentication Registrar web service.
Definition at line 125 of file WebService.php.
Referenced by CrudUpdate::process(), CrudDelete::process(), and CrudCreate::process().
$errorMessages = "" [private] |
Error message to report.
Definition at line 48 of file ConverterIrJSON.php.
$errorMessenger [private] |
Error messages of this web service.
Definition at line 76 of file ConverterIrJSON.php.
$fields_index_folder = "/tmp/" [protected, inherited] |
This is the folder there the file of the index where all the fields defined in Solr are indexed. You have to make sure that the web server has write access to this folder. This folder path has to end with a slash "/".
Definition at line 113 of file WebService.php.
$geoEnabled = FALSE [protected, inherited] |
Definition at line 133 of file WebService.php.
$include_dataset_description [private] |
Include Dataset Description in the output.
Definition at line 60 of file ConverterIrJSON.php.
Referenced by __construct().
$log_table = "SD.WSF.ws_queries_log" [protected, inherited] |
Name of the logging table on the Virtuoso instance.
Definition at line 100 of file WebService.php.
$namespaces = array() [private] |
Defined dummany namespaces/prefixes used for data conversion for some serializations.
Definition at line 63 of file ConverterIrJSON.php.
$network_ini = "/usr/share/structwsf/" [static, inherited] |
network.ini file folder
Definition at line 35 of file WebService.php.
Referenced by WebService::__construct().
$ontological_structure_folder = "" [protected, inherited] |
Path to the structWSF ontological structure.
Definition at line 74 of file WebService.php.
$ontologies_files_folder = "" [protected, inherited] |
Path to the ontologies description files (in RDFS and OWL).
Definition at line 68 of file WebService.php.
$owlapiBridgeURI [protected, inherited] |
URL where the Java Bridge can be accessed from this server.
Definition at line 131 of file WebService.php.
$owlapiNbSessions [protected, inherited] |
Number of sessions (threads) to use in parallel.
Definition at line 128 of file WebService.php.
$parser [private] |
Parser.
Definition at line 57 of file ConverterIrJSON.php.
$registered_ip = "" [private] |
$requester_ip = "" [private] |
IP of the requester.
Definition at line 51 of file ConverterIrJSON.php.
Referenced by __construct().
$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 107 of file WebService.php.
$solr_host = "localhost" [protected, inherited] |
Hostname where to send queries to the Solr instance.
Definition at line 71 of file WebService.php.
$solr_port = "8983" [protected, inherited] |
Port number where the Solr store server is reachable.
Definition at line 96 of file WebService.php.
$supportedSerializations [static] |
array ("application/iron+json", "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 71 of file ConverterIrJSON.php.
Referenced by ws_conneg().
$text [private] |
Text being converted.
Definition at line 39 of file ConverterIrJSON.php.
$title [protected, inherited] |
The Title of the Authentication Registrar web service.
Definition at line 119 of file WebService.php.
Referenced by DatasetUpdate::__construct(), and DatasetRead::process().
$track_create = FALSE [protected, inherited] |
Enable the tracking of records changes from the Crud Create web service endpoint.
Definition at line 77 of file WebService.php.
$track_delete = FALSE [protected, inherited] |
Enable the tracking of records changes from the Crud Delete web service endpoint.
Definition at line 83 of file WebService.php.
$track_update = FALSE [protected, inherited] |
Enable the tracking of records changes from the Crud Update web service endpoint.
Definition at line 80 of file WebService.php.
$tracking_endpoint = "" [protected, inherited] |
Specifies a specific WSF tracking web service endpoint URL to access the tracking endpoint. This is useful to put all the record changes tracking on a different, dedicated purposes, WSF server. If this parameter is commented, we will use the wsf_base_url to access the tracking endpoints. If it is uncommented, then we will use the endpoint specified by this parameter.
Definition at line 90 of file WebService.php.
$triplestore_port = "8890" [protected, inherited] |
Port number where the triple store server is reachable.
Definition at line 93 of file WebService.php.
$type [private] |
Type of the resource being converted.
Definition at line 45 of file ConverterIrJSON.php.
Referenced by pipeline_getResultset(), and pipeline_serialize().
$uri [protected, inherited] |
The URI of the Authentication Registrar web service.
Definition at line 116 of file WebService.php.
Referenced by DatasetUpdate::__construct(), DatasetRead::__construct(), DatasetDelete::__construct(), DatasetCreate::__construct(), CrudRead::__construct(), CrudDelete::__construct(), ConverterBibtex::get_uri_label(), Sparql::getNamespace(), Search::getNamespace(), DatasetRead::getNamespace(), CrudRead::getNamespace(), ConverterTsv::getNamespace(), getNamespace(), ConverterCommON::getNamespace(), Browse::getNamespace(), Sparql::pipeline_getResultset(), Search::pipeline_getResultset(), ConverterTsv::pipeline_getResultset(), pipeline_getResultset(), Browse::pipeline_getResultset(), pipeline_serialize(), Sparql::prefixToUri(), Search::process(), CrudUpdate::process(), CrudCreate::process(), Browse::process(), AuthRegistrarAccess::process(), DatasetRead::uriEncode(), ConverterTsv::uriEncode(), uriEncode(), ConverterCommON::uriEncode(), ConverterBibtex::uriEncode(), and AuthRegistrarAccess::uriEncode().
$wsf_base_path = "" [protected, inherited] |
Local server path of the WSF files.
Definition at line 59 of file WebService.php.
$wsf_base_url = "" [protected, inherited] |
Base URL of the WSF.
Definition at line 56 of file WebService.php.
$wsf_graph = "" [protected, inherited] |
The graph where the Web Services Framework description has been indexed.
Definition at line 53 of file WebService.php.
$wsf_local_ip = "" [protected, inherited] |
Local server path of the WSF files.
Definition at line 62 of file WebService.php.
$wsf_solr_core = "" [protected, inherited] |
The core to use for Solr; "" for no core.
Definition at line 65 of file WebService.php.
The documentation for this class was generated from the following file:
