Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/N3Parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ export default class N3Parser {
return this._completePredicateLiteral;
}
else
this._subject = this._literal(token.value, this._namedNode(token.prefix));
this._predicate = this._literal(token.value, this._namedNode(token.prefix));

break;
case '.':
Expand Down
10 changes: 10 additions & 0 deletions test/N3Parser-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1794,6 +1794,16 @@ describe('Parser', () => {
['greaterThan', '"a"', '"b"']
));

it('should parse subject predicate and object as integer',
shouldParse(parser, '1 1 1.',
['"1"^^http://www.w3.org/2001/XMLSchema#integer', '"1"^^http://www.w3.org/2001/XMLSchema#integer', '"1"^^http://www.w3.org/2001/XMLSchema#integer']
));

it('should parse literals with integer as predicate',
shouldParse(parser, '<greaterThan> 1 "b".',
['greaterThan', '"1"^^http://www.w3.org/2001/XMLSchema#integer', '"b"']
));

it('should parse literals with datatype as predicate in graph',
shouldParse(parser, '<x> <y> {<greaterThan> "a"^^<c> "b"^^<c>}.',
['x', 'y', '_:b0'],
Expand Down