Skip to content
Snippets Groups Projects
Commit bd9f12a7 authored by Manish R Jain's avatar Manish R Jain
Browse files

Also parse _uid_ from object id.

parent ada9ab03
No related branches found
No related tags found
No related merge requests found
......@@ -53,6 +53,24 @@ var testNQuads = []struct {
ObjectValue: nil,
},
},
{
input: `<some_subject_id> <predicate> _uid_:0x01 .`,
nq: NQuad{
Subject: "some_subject_id",
Predicate: "predicate",
ObjectId: "_uid_:0x01",
ObjectValue: nil,
},
},
{
input: `_uid_:0x01 <predicate> _uid_:0x02 .`,
nq: NQuad{
Subject: "_uid_:0x01",
Predicate: "predicate",
ObjectId: "_uid_:0x02",
ObjectValue: nil,
},
},
{
input: `_:alice <follows> _:bob0 .`,
nq: NQuad{
......@@ -119,6 +137,10 @@ var testNQuads = []struct {
input: "_uid_: 0x01 <knows> <something> .",
hasErr: true,
},
{
input: "<alice> <knows> _uid_: 0x01 .",
hasErr: true,
},
{
input: `_:alice "knows" stuff .`,
hasErr: true,
......
......@@ -267,7 +267,13 @@ func lexObject(l *lex.Lexer) lex.StateFn {
}
if r == '_' {
l.Depth += 1
return lexBlankNode(l, itemObject, lexText)
r = l.Next()
if r == 'u' {
return lexUidNode(l, itemObject, lexText)
} else if r == ':' {
return lexBlankNode(l, itemObject, lexText)
}
}
if r == '"' {
l.Ignore()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment