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. | |
| getErrors () | |
| Check for errors. | |
| getRdfN3 ($baseInstance, $baseOntology) | |
| Generate a RDF file serialized in N3 by using the parsed commON records and the related 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. | |
| 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. | |
| 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. | |
| $errors = array() | |
| Parsing errors stack. | |
Detailed Description
commON serialization parsing classThis class will parse a commON CSV file and parse it to extract commON instance records.
- Todo:
- Implementing the "&&dataset" processing keyword
- Todo:
- Implementing the "metaFile" keyword
- Todo:
- Implementing the structure Schema & "schema" keyword
- Todo:
- Implementing the "listSeparator" keyword
- Todo:
- Implementing the "listSeparatorEscape" keyword
- Todo:
- Implementing the "seqNum" keyword
Definition at line 30 of file CommonParser.php.
Constructor & Destructor Documentation
| CommonParser::__construct | ( | $ | content | ) |
Constructor. It takes the commON CSV file content as input.
- Parameters:
-
[in] $content commON CSV file content
Definition at line 283 of file CommonParser.php.
References commonParser(), and csvParser().

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

| CommonParser::csvParser | ( | ) | [private] |
Parse a CSV files to produce the structure used by the commonParser function.
- Returns:
- returns NULL
Definition at line 376 of file CommonParser.php.
Referenced by __construct().
| CommonParser::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 1164 of file CommonParser.php.
Referenced by getRdfN3().
| CommonParser::getCommonRecords | ( | ) |
Returns the array of parsed commON records.
- Returns:
- returns an array of commON records.
Definition at line 324 of file CommonParser.php.
| CommonParser::getCsvRecords | ( | ) |
Returns the array of records parsed from the CSV file.
- Returns:
- returns an array of records.
Definition at line 306 of file CommonParser.php.
| CommonParser::getErrors | ( | ) |
Check for errors.
- Returns:
- Return FALSE if no errors; returns an array of error messages if any.
Definition at line 356 of file CommonParser.php.
| CommonParser::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 341 of file CommonParser.php.
| CommonParser::getLinkedProperty | ( | $ | targetAttribute | ) | [private] |
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 1094 of file CommonParser.php.
Referenced by getRdfN3().
| CommonParser::getLinkedType | ( | $ | targetType | ) | [private] |
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 1129 of file CommonParser.php.
Referenced by getRdfN3().
| CommonParser::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 949 of file CommonParser.php.
References escapeN3(), getLinkedProperty(), and getLinkedType().

| CommonParser::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 924 of file CommonParser.php.
Referenced by commonParser().
Member Data Documentation
CommonParser::$commonLinkageSchema = array() [private] |
Array describing the linkage schema (if defined) of a commON file.
Definition at line 268 of file CommonParser.php.
CommonParser::$commonRecords = array() [private] |
CommonParser::$csvRecords = array() [private] |
CommonParser::$errors = array() [private] |
The documentation for this class was generated from the following file:
