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

Parsing n-triples is faulty => Exception: Unexpected "typeIRI" on line 1. #26

Closed
k00ni opened this issue Jul 2, 2018 · 2 comments
Closed
Labels

Comments

@k00ni
Copy link
Collaborator

k00ni commented Jul 2, 2018

hardf seems to have a hard time parsing triples like:

<http://example.org/show/218> <http://www.w3.org/2000/01/rdf-schema#label> "That Seventies Show"^^<http://www.w3.org/2001/XMLSchema#string> .
<http://example.org/show/218> <http://www.w3.org/2000/01/rdf-schema#label> "That Seventies Show" .
<http://example.org/show/218> <http://example.org/show/localName> "That Seventies Show"@en .
<http://example.org/show/218> <http://example.org/show/localName> "Cette Série des Années Septante"@fr-be .
<http://example.org/#spiderman> <http://example.org/text> "Multi-line\nliteral with many quotes (\"\"\"\"\")\nand two apostrophes ('')." .
<http://en.wikipedia.org/wiki/Helium> <http://example.org/elements/atomicNumber> "2"^^<http://www.w3.org/2001/XMLSchema#integer> .
<http://en.wikipedia.org/wiki/Helium> <http://example.org/elements/specificGravity> "1.663E-4"^^<http://www.w3.org/2001/XMLSchema#double> .

Source: https://www.w3.org/TR/n-triples/#sec-literals (removed the comments)

I always get the following error:

Exception: Unexpected "typeIRI" on line 1.

/app/src/Saft/Addition/hardf/vendor/pietercolpaert/hardf/src/N3Lexer.php:411
/app/src/Saft/Addition/hardf/vendor/pietercolpaert/hardf/src/N3Lexer.php:41
/app/src/Saft/Addition/hardf/vendor/pietercolpaert/hardf/src/N3Lexer.php:441
/app/src/Saft/Addition/hardf/vendor/pietercolpaert/hardf/src/TriGParser.php:986
/app/src/Saft/Addition/hardf/vendor/pietercolpaert/hardf/src/TriGParser.php:969

Test setup

$parser = new TriGParser([
    'format' => 'triple'
]);

$str = '<http://example.org/show/218> <http://www.w3.org/2000/01/rdf-schema#label> "That Seventies Show"^^<http://www.w3.org/2001/XMLSchema#string> .
';
$parser->parse($str);
// $parser->parseChunk($str); also fails

Any idea? @pietercolpaert

@k00ni k00ni added the bug label Jul 2, 2018
@k00ni k00ni changed the title Parsing n-triples faulty: Parsing n-triples faulty => Exception: Unexpected "typeIRI" on line 1. Jul 2, 2018
@k00ni k00ni changed the title Parsing n-triples faulty => Exception: Unexpected "typeIRI" on line 1. Parsing n-triples is faulty => Exception: Unexpected "typeIRI" on line 1. Jul 2, 2018
@pietercolpaert
Copy link
Owner

@k00ni probably because of $parser = new TriGParser(['format' => 'triple')); → triple is not a known format. Can you test this again with turtle?

@k00ni
Copy link
Collaborator Author

k00ni commented Aug 22, 2018

Currently very busy, but will test it later. Sorry for the delayed answer.

@k00ni k00ni added invalid and removed bug labels Nov 21, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants