CommonParser Class Reference
commON serialization parsing class More...
Public Member Functions | |
| __construct ($content) | |
| Constructor. It takes the commON CSV file content as input. | |
| getCsvRecords () | |
| Returns the array of records parsed from the CSV file. | |
| getCommonRecords () | |
| Returns the array of parsed commON records. | |
| getLinkageSchema () | |
| Returns the array of the parsed linkage schema. | |
| getDataset () | |
| Returns the array of the parsed dataset. | |
| getCsvErrors () | |
| Check for CSV parsing errors. | |
| getCommonErrors () | |
| Check for commON parsing errors. | |
| getRdfN3 ($baseInstance="", $baseOntology="") | |
| Generate a RDF file serialized in N3 by using the parsed commON records and the related linkage schema. | |
| getLinkedProperty ($targetAttribute) | |
| Return the URI of the property that has been linked to a commON attribute by the Linkage Schema. | |
| getLinkedType ($targetType) | |
| Return the URI of the type that has been linked to a commON type by the Linkage Schema. | |
Private Member Functions | |
| csvParser () | |
| Parse a CSV files to produce the structure used by the commonParser function. | |
| commonParser () | |
| Create the commON records form the parsed CSV records. | |
| getReifiedAttribute ($attribute) | |
| Check if an attribute is a reification attribute. | |
| escapeN3 ($literal) | |
| Apply N3 serialization escaping rules to a literal. | |
Private Attributes | |
| $csvRecords = array() | |
| All CSV records extracted from the CSV file. | |
| $commonRecords = array() | |
| Array with all parsed commON records. | |
| $commonLinkageSchema = array() | |
| Array describing the linkage schema (if defined) of a commON file. | |
| $commonDataset = array() | |
| Array describing the dataset. | |
| $csvErrors = array() | |
| CSV Parsing errors stack. | |
| $commonErrors = array() | |
| commON Validation errors stack | |
Detailed Description
commON serialization parsing class
This class will parse a commON CSV file and parse it to extract commON instance records.
- Todo:
Implementing the "metaFile" keyword
Implementing the structure Schema & "schema" keyword
Implementing the "listSeparator" keyword
Implementing the "listSeparatorEscape" keyword
Implementing the "seqNum" keyword
Definition at line 29 of file CommonParser.php.
Constructor & Destructor Documentation
| __construct | ( | $ | content | ) |
Constructor. It takes the commON CSV file content as input.
- Parameters:
-
[in] $content commON CSV file content
Definition at line 288 of file CommonParser.php.
References commonParser(), and csvParser().

Member Function Documentation
| commonParser | ( | ) | [private] |
Create the commON records form the parsed CSV records.
- Returns:
- returns NULL
Definition at line 581 of file CommonParser.php.
References $record, $type, and getReifiedAttribute().
Referenced by __construct().

| csvParser | ( | ) | [private] |
Parse a CSV files to produce the structure used by the commonParser function.
- Returns:
- returns NULL
Definition at line 404 of file CommonParser.php.
References $record.
Referenced by __construct().
| escapeN3 | ( | $ | literal | ) | [private] |
Apply N3 serialization escaping rules to a literal.
- Parameters:
-
[in] $literal Literal to be escaped
- Returns:
- return the N3 escaped literal ready to be used in a N3 serialized file.
Definition at line 1410 of file CommonParser.php.
Referenced by getRdfN3().
| getCommonErrors | ( | ) |
Check for commON parsing errors.
- Returns:
- Return FALSE if no errors; returns an array of error messages if any.
Definition at line 384 of file CommonParser.php.
| getCommonRecords | ( | ) |
Returns the array of parsed commON records.
- Returns:
- returns an array of commON records.
Definition at line 326 of file CommonParser.php.
| getCsvErrors | ( | ) |
Check for CSV parsing errors.
- Returns:
- Return FALSE if no errors; returns an array of error messages if any.
Definition at line 364 of file CommonParser.php.
| getCsvRecords | ( | ) |
Returns the array of records parsed from the CSV file.
- Returns:
- returns an array of records.
Definition at line 311 of file CommonParser.php.
| getDataset | ( | ) |
Returns the array of the parsed dataset.
- Returns:
- returns an array of the parsed dataset
Definition at line 352 of file CommonParser.php.
| getLinkageSchema | ( | ) |
Returns the array of the parsed linkage schema.
- Returns:
- returns an array of the parsed linkage schema
- See also:
- Linkage Schema Internal Structure
Definition at line 340 of file CommonParser.php.
| getLinkedProperty | ( | $ | targetAttribute | ) |
Return the URI of the property that has been linked to a commON attribute by the Linkage Schema.
- Parameters:
-
[in] $targetAttribute Target attribute, from the commON file, that we try to link to an external vocabulary/schema/ontology
- Returns:
- return the URI of the linked property, or an empty string if such a linked property doesn't exist.
Definition at line 1340 of file CommonParser.php.
Referenced by getRdfN3().
| getLinkedType | ( | $ | targetType | ) |
Return the URI of the type that has been linked to a commON type by the Linkage Schema.
- Parameters:
-
[in] $targetType Target type, from the commON file, that we try to link to an external vocabulary/schema/ontology
- Returns:
- return the URI of the linked type, or an empty string if such a linked type doesn't exist.
Definition at line 1375 of file CommonParser.php.
References $type.
Referenced by getRdfN3().
| getRdfN3 | ( | $ | baseInstance = "", |
|
| $ | baseOntology = "" | |||
| ) |
Generate a RDF file serialized in N3 by using the parsed commON records and the related linkage schema.
- Parameters:
-
[in] $baseInstance Base URI of the instance records to be converted [in] $baseOntology Base URI of the ontology used to create new attributes and types. This is used when there is nothing defined in the linkage schema for an attribute or type.
- Returns:
- return the serialized RDF file in N3
Definition at line 1182 of file CommonParser.php.
References $record, $type, escapeN3(), getLinkedProperty(), and getLinkedType().

| getReifiedAttribute | ( | $ | attribute | ) | [private] |
Check if an attribute is a reification attribute.
- Returns:
- return FALSE if it is not a reification attribute, return the structure array( "attribute" => "...", "reifidAttribute" => "...") structure.
Definition at line 1156 of file CommonParser.php.
Referenced by commonParser().
Field Documentation
$commonDataset = array() [private] |
Array describing the dataset.
Definition at line 270 of file CommonParser.php.
$commonErrors = array() [private] |
commON Validation errors stack
Definition at line 276 of file CommonParser.php.
$commonLinkageSchema = array() [private] |
Array describing the linkage schema (if defined) of a commON file.
Definition at line 267 of file CommonParser.php.
$commonRecords = array() [private] |
Array with all parsed commON records.
Definition at line 168 of file CommonParser.php.
$csvErrors = array() [private] |
CSV Parsing errors stack.
Definition at line 273 of file CommonParser.php.
$csvRecords = array() [private] |
All CSV records extracted from the CSV file.
Definition at line 83 of file CommonParser.php.
The documentation for this class was generated from the following file:
