Create quads hierarchy
* Move nquads into quad. * Create cquads simplified parser in quad. * Move Triple (renamed Quad) to quad. Also made sure mongo actually implements BulkLoader.
This commit is contained in:
parent
01bc63810b
commit
401c58426f
51 changed files with 13400 additions and 5495 deletions
|
|
@ -19,13 +19,13 @@ import (
|
|||
"reflect"
|
||||
"testing"
|
||||
|
||||
"github.com/google/cayley/graph"
|
||||
"github.com/google/cayley/quad"
|
||||
)
|
||||
|
||||
var parseTests = []struct {
|
||||
message string
|
||||
input string
|
||||
expect []*graph.Triple
|
||||
expect []*quad.Quad
|
||||
err error
|
||||
}{
|
||||
{
|
||||
|
|
@ -34,7 +34,7 @@ var parseTests = []struct {
|
|||
{"subject": "foo", "predicate": "bar", "object": "baz"},
|
||||
{"subject": "foo", "predicate": "bar", "object": "baz", "provenance": "graph"}
|
||||
]`,
|
||||
expect: []*graph.Triple{
|
||||
expect: []*quad.Quad{
|
||||
{"foo", "bar", "baz", ""},
|
||||
{"foo", "bar", "baz", "graph"},
|
||||
},
|
||||
|
|
@ -45,7 +45,7 @@ var parseTests = []struct {
|
|||
input: `[
|
||||
{"subject": "foo", "predicate": "bar", "object": "foo", "something_else": "extra data"}
|
||||
]`,
|
||||
expect: []*graph.Triple{
|
||||
expect: []*quad.Quad{
|
||||
{"foo", "bar", "foo", ""},
|
||||
},
|
||||
err: nil,
|
||||
|
|
@ -56,7 +56,7 @@ var parseTests = []struct {
|
|||
{"subject": "foo", "predicate": "bar"}
|
||||
]`,
|
||||
expect: nil,
|
||||
err: fmt.Errorf("Invalid triple at index %d. %v", 0, &graph.Triple{"foo", "bar", "", ""}),
|
||||
err: fmt.Errorf("Invalid triple at index %d. %v", 0, &quad.Quad{"foo", "bar", "", ""}),
|
||||
},
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue