Created
October 18, 2013 11:58
-
-
Save samuell/7040538 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| require_once('ARC2.php'); | |
| // Init parser | |
| $parser = ARC2::getTurtleParser(); | |
| $turtle = <<<EOD | |
| @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . | |
| @prefix cd: <http://www.recshop.fake/cd#> . | |
| @prefix countries: <http://www.countries.org/onto/> . | |
| @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . | |
| <http://www.recshop.fake/cd/Empire Burlesque> | |
| cd:artist "Bob Dylan" ; | |
| cd:country countries:USA ; | |
| cd:company "Columbia" ; | |
| cd:price "10.90" ; | |
| cd:year "1985" . | |
| <http://www.recshop.fake/cd/Hide your heart> | |
| cd:artist "Bonnie Tyler" ; | |
| cd:country "UK" ; | |
| cd:company "CBS Records" ; | |
| cd:price "9.90" ; | |
| cd:year "1988" . | |
| countries:USA | |
| rdfs:label "USA" . | |
| countries:Albums | |
| rdfs:subClassOf countries:MediaCollections . | |
| EOD; | |
| $parser->parse( $turtle ); | |
| // Print out the name spaces array | |
| echo print_r( $parser->nsp ); | |
| /* ----------------------------------------------------- | |
| * Output should be: | |
| * Array | |
| * ( | |
| * [http://www.w3.org/1999/02/22-rdf-syntax-ns#] => rdf | |
| * [http://www.recshop.fake/cd#] => cd | |
| * [http://www.countries.org/onto/] => countries | |
| * [http://www.w3.org/2000/01/rdf-schema#] => rdfs | |
| * ) | |
| * ----------------------------------------------------- | |
| * Actual output is: | |
| * Array | |
| * ( | |
| * [http://www.w3.org/XML/1998/namespace] => xml | |
| * [http://www.w3.org/1999/02/22-rdf-syntax-ns#] => rdf | |
| * [http://www.w3.org/2001/XMLSchema#] => xsd | |
| * ) | |
| * ----------------------------------------------------- | |
| */ | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment