Class: RdfParser ---------------------------------------------------------------------------------- An RDF paser. This class reads RDF data from files or URIs and generates models out of it. All valid RDF XML syntaxes defined by the W3C in RDF/XML Syntax Specification (Revised) - W3C Working Draft 10 October 2003 ( http://www.w3.org/TR/2003/WD-rdf-syntax-grammar-20031010/ ) are supported. The parser is based on the PHP version of repat ( http://phpxmlclasses.sourceforge.net/show_doc.php?class=class_rdf_parser.html ) by Luis Argerich ( lrargerich@yahoo.com ). <BR><BR>History:<UL> <LI>12-06-2004 : improved namespace handling added ( tobias.gauss@web.de )</LI> <LI>08-13-2004 : Bug in rdf:resource="" fixed</LI> <LI>08-10-2004 : function for converting strings to its unicode NFC form added. Benjamin Nowack < bnowack@appmosphere.com ></LI> <LI>06-01-2004 : Bug in xml:lang fixed, some bugs in the handling of collections fixed</LI> <LI>05-03-2004 : generateModel(): added optional parameter $rdfBaseURI to set the rdf base URI manually for strings when there's no xml:base stated < mail@d-westphal.de >.</LI> <LI>11-18-2003 : Made compliant with the latest RDF Specification (10. October 2003) < radol@gmx.de >. Support for several aspects of the RDF Specification was added or fixed, among others: bugs in handling of xml:base and resolving relative URIs fixed, support for parseType="Literal" (XMLLiterals) added, support for parseType="Collection" added, handling of xml:lang improved, handling of containers improved, handling of empty property elements improved, handling of RDF vocabulary improved, some cases of reification fixed, Several methods have been changed, unused variables and parameters removed (see CVS for details). new private methods: _is_forbidden_rdf_property_attribute(), _is_forbidden_rdf_property_element ($local_name), _is_rdf_node_element(), _is_forbidded_node_element(), _report_error(), _handle_collection_element(), _handle_xml_start_element(), _handle_xml_end_element(), _join_name_and_declare_prefix(), _end_collection(), _start_ns_declaration_handler(), removed private methods: _delete_elements(), _end_empty_resource_property(), rdf_resolve_uri() BUGS WHICH HAVE NOT BEED FIXED: - correct handling of non US-ASCII characters</LI> <LI>07-27-2003 : Functions addapted to the new class tree (MemModel extends Model)</LI> <LI>04-23-2003 : Bug concerning bnode recognition fixed.</LI> <LI>04-03-2003 : Bug concerning bnode identifier generation fixed.</LI> <LI>01-10-2003 : Support for rdf:datatype and rdf:nodeID added.</LI> <LI>01-05-2003 : Support for rdf:seeAlso added.</LI> <LI>11-07-2002 : Possibility to pass RDF code directly to the method generateModel() added.</LI> <LI>10-25-2002 : Bug concerning 1 character long literals fixed.</LI> <LI>09-24-2002 : Recognition of blank nodes improved.</LI> <LI>09-10-2002 : First version of this class.</LI> </UL>
|
PHP | _end_literal_property() |
---|
property elements with text only as content set the state to IN_PROPERTY_LITERAL. as character data is received from expat, it is saved in a buffer and reported when the end tag is received.
PHP | _handle_collection_element(unknown $namespace_uri, unknown $local_name, unknown $attributes) |
---|
Arguments
PHP | _handle_property_attributes(string $subject_type, string $subject, string $attributes, string $xml_lang, string $bag_id, string $statements) |
---|
Arguments
PHP | _handle_property_element(unknown $namespace_uri, unknown $local_name, unknown $attributes) |
---|
Arguments
PHP | _handle_resource_element(string $namespace_uri, string $local_name, string $attributes, string $parent) |
---|
Arguments
PHP | _handle_xml_start_element(unknown $namespace_uri, unknown $local_name, unknown $attributes) |
---|
Arguments
PHP | _join_name_and_declare_prefix(string $namespace_uri, string $local_name) |
---|
Arguments
PHP | _parse_uri(string $uri, string $buffer, unknown $scheme, unknown $authority, unknown $path, unknown $query, unknown $fragment) |
---|
This function returns an associative array returning any of the various components of the URL that are present. This includes the $arr=parse_url($url) scheme - e.g. http host port user pass path query - after the question mark ? fragment - after the hashmark #
Arguments
PHP | _report_statement(string $subject_type, string $subject, string $predicate, string $ordinal, string $object_type, string $object, string $xml_lang, string $bag_id, string $statements, string $statement_id, unknown $datatype) |
---|
Arguments
PHP | _resolve_uri_reference(string $base_uri, string $reference_uri, unknown $buffer) |
---|
Arguments
PHP | _split_name(string $name, unknown $buffer, unknown $namespace_uri, unknown $local_name) |
---|
Arguments
PHP | _start_element_handler(string $parser, string $name, string $attributes) |
---|
Arguments
PHP | _start_ns_declaration_handler(unknown $parser, string $ns_prefix, string $ns_uri) |
---|
Arguments
PHP | object add_statement_to_model(unknown $user_data, string $subject_type, string $subject, string $predicate, string $ordinal, string $object_type, string $object, string $xml_lang, unknown $datatype) |
---|
Adds a new statement to the model This method is called by generateModel().
Arguments
)
Return
MemModel
PHP | object generateModel(string $base, boolean $rdfBaseURI, boolean $model) |
---|
public functions
Generates a new MemModel from a URI, a file or from memory. If you want to parse an RDF document, pass the URI or location in the filesystem of the RDF document. You can also pass RDF code direct to the function. If you pass RDF code directly to the parser and there is no xml:base included, you should set the base URI manually using the optional second parameter $rdfBaseURI. Make sure that here are proper namespace declarations in your input document.
Arguments
Return
MemModel
PHP | is_valid_id(string $id) |
---|
IDs which contain CombiningChars or Extenders (see http://www.w3.org/TR/REC-xml-names/#NT-NCName ) are assumed to be invalid. If you want to use IDs containing these characters you can turn off the validating by setting the constant VALIDATE_IDS to FALSE (see constants.php).
Arguments
PHP | string str2unicode_nfc(string $str) |
---|
Private Methods
converts a string to its unicode NFC form (e.g. \uHHHH or \UHHHHHHHH).
Arguments