Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RDF prefixes not parsed in turtle parser #59

Open
samuell opened this issue Oct 18, 2013 · 0 comments
Open

RDF prefixes not parsed in turtle parser #59

samuell opened this issue Oct 18, 2013 · 0 comments

Comments

@samuell
Copy link
Contributor

samuell commented Oct 18, 2013

Steps to reproduce:

  1. Place the following code in a PHP file, test.php, inside the ARC2 folder:
<?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
print_r( $parser->nsp );
  1. Execute the php script:
php test.php

Expected result:

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 result:

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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant