Rename Provenance -> Label
's/Provenance/Label/g' 's/provenance/label/g' with human vetting.
This commit is contained in:
parent
410202f3e0
commit
274d9ef57e
20 changed files with 416 additions and 416 deletions
|
|
@ -63,7 +63,7 @@
|
|||
if label < 0 {
|
||||
panic("unexpected parser state: label start not set")
|
||||
}
|
||||
q.Provenance = unEscape(data[label:p], isEscaped)
|
||||
q.Label = unEscape(data[label:p], isEscaped)
|
||||
isEscaped = false
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -41,10 +41,10 @@ var testNTriples = []struct {
|
|||
message: "parse triple with commment",
|
||||
input: `_:100000 </film/performance/actor> </en/larry_fine_1902> . # example from 30movies`,
|
||||
expect: &quad.Quad{
|
||||
Subject: "_:100000",
|
||||
Predicate: "</film/performance/actor>",
|
||||
Object: "</en/larry_fine_1902>",
|
||||
Provenance: "",
|
||||
Subject: "_:100000",
|
||||
Predicate: "</film/performance/actor>",
|
||||
Object: "</en/larry_fine_1902>",
|
||||
Label: "",
|
||||
},
|
||||
err: nil,
|
||||
},
|
||||
|
|
@ -53,10 +53,10 @@ var testNTriples = []struct {
|
|||
message: "parse triple with commment",
|
||||
input: `_:10011 </film/performance/character> "Tomás de Torquemada" . # example from 30movies with unicode`,
|
||||
expect: &quad.Quad{
|
||||
Subject: "_:10011",
|
||||
Predicate: "</film/performance/character>",
|
||||
Object: `"Tomás de Torquemada"`,
|
||||
Provenance: "",
|
||||
Subject: "_:10011",
|
||||
Predicate: "</film/performance/character>",
|
||||
Object: `"Tomás de Torquemada"`,
|
||||
Label: "",
|
||||
},
|
||||
err: nil,
|
||||
},
|
||||
|
|
@ -66,10 +66,10 @@ var testNTriples = []struct {
|
|||
message: "parse triple with commment",
|
||||
input: `<http://one.example/subject1> <http://one.example/predicate1> <http://one.example/object1> . # comments here`,
|
||||
expect: &quad.Quad{
|
||||
Subject: "<http://one.example/subject1>",
|
||||
Predicate: "<http://one.example/predicate1>",
|
||||
Object: "<http://one.example/object1>",
|
||||
Provenance: "",
|
||||
Subject: "<http://one.example/subject1>",
|
||||
Predicate: "<http://one.example/predicate1>",
|
||||
Object: "<http://one.example/object1>",
|
||||
Label: "",
|
||||
},
|
||||
err: nil,
|
||||
},
|
||||
|
|
@ -77,10 +77,10 @@ var testNTriples = []struct {
|
|||
message: "parse triple with blank subject node, literal object and no comment (1)",
|
||||
input: `_:subject1 <http://an.example/predicate1> "object1" .`,
|
||||
expect: &quad.Quad{
|
||||
Subject: "_:subject1",
|
||||
Predicate: "<http://an.example/predicate1>",
|
||||
Object: `"object1"`,
|
||||
Provenance: "",
|
||||
Subject: "_:subject1",
|
||||
Predicate: "<http://an.example/predicate1>",
|
||||
Object: `"object1"`,
|
||||
Label: "",
|
||||
},
|
||||
err: nil,
|
||||
},
|
||||
|
|
@ -88,10 +88,10 @@ var testNTriples = []struct {
|
|||
message: "parse triple with blank subject node, literal object and no comment (2)",
|
||||
input: `_:subject2 <http://an.example/predicate2> "object2" .`,
|
||||
expect: &quad.Quad{
|
||||
Subject: "_:subject2",
|
||||
Predicate: "<http://an.example/predicate2>",
|
||||
Object: `"object2"`,
|
||||
Provenance: "",
|
||||
Subject: "_:subject2",
|
||||
Predicate: "<http://an.example/predicate2>",
|
||||
Object: `"object2"`,
|
||||
Label: "",
|
||||
},
|
||||
err: nil,
|
||||
},
|
||||
|
|
@ -101,10 +101,10 @@ var testNTriples = []struct {
|
|||
message: "parse triple with three IRIREFs",
|
||||
input: `<http://example.org/#spiderman> <http://www.perceive.net/schemas/relationship/enemyOf> <http://example.org/#green-goblin> .`,
|
||||
expect: &quad.Quad{
|
||||
Subject: "<http://example.org/#spiderman>",
|
||||
Predicate: "<http://www.perceive.net/schemas/relationship/enemyOf>",
|
||||
Object: "<http://example.org/#green-goblin>",
|
||||
Provenance: "",
|
||||
Subject: "<http://example.org/#spiderman>",
|
||||
Predicate: "<http://www.perceive.net/schemas/relationship/enemyOf>",
|
||||
Object: "<http://example.org/#green-goblin>",
|
||||
Label: "",
|
||||
},
|
||||
err: nil,
|
||||
},
|
||||
|
|
@ -114,10 +114,10 @@ var testNTriples = []struct {
|
|||
message: "parse triple with blank node labelled subject and object and IRIREF predicate (1)",
|
||||
input: `_:alice <http://xmlns.com/foaf/0.1/knows> _:bob .`,
|
||||
expect: &quad.Quad{
|
||||
Subject: "_:alice",
|
||||
Predicate: "<http://xmlns.com/foaf/0.1/knows>",
|
||||
Object: "_:bob",
|
||||
Provenance: "",
|
||||
Subject: "_:alice",
|
||||
Predicate: "<http://xmlns.com/foaf/0.1/knows>",
|
||||
Object: "_:bob",
|
||||
Label: "",
|
||||
},
|
||||
err: nil,
|
||||
},
|
||||
|
|
@ -125,10 +125,10 @@ var testNTriples = []struct {
|
|||
message: "parse triple with blank node labelled subject and object and IRIREF predicate (2)",
|
||||
input: `_:bob <http://xmlns.com/foaf/0.1/knows> _:alice .`,
|
||||
expect: &quad.Quad{
|
||||
Subject: "_:bob",
|
||||
Predicate: "<http://xmlns.com/foaf/0.1/knows>",
|
||||
Object: "_:alice",
|
||||
Provenance: "",
|
||||
Subject: "_:bob",
|
||||
Predicate: "<http://xmlns.com/foaf/0.1/knows>",
|
||||
Object: "_:alice",
|
||||
Label: "",
|
||||
},
|
||||
err: nil,
|
||||
},
|
||||
|
|
@ -138,10 +138,10 @@ var testNTriples = []struct {
|
|||
message: "parse quad with commment",
|
||||
input: `<http://one.example/subject1> <http://one.example/predicate1> <http://one.example/object1> <http://example.org/graph3> . # comments here`,
|
||||
expect: &quad.Quad{
|
||||
Subject: "<http://one.example/subject1>",
|
||||
Predicate: "<http://one.example/predicate1>",
|
||||
Object: "<http://one.example/object1>",
|
||||
Provenance: "<http://example.org/graph3>",
|
||||
Subject: "<http://one.example/subject1>",
|
||||
Predicate: "<http://one.example/predicate1>",
|
||||
Object: "<http://one.example/object1>",
|
||||
Label: "<http://example.org/graph3>",
|
||||
},
|
||||
err: nil,
|
||||
},
|
||||
|
|
@ -149,10 +149,10 @@ var testNTriples = []struct {
|
|||
message: "parse quad with blank subject node, literal object, IRIREF predicate and label, and no comment (1)",
|
||||
input: `_:subject1 <http://an.example/predicate1> "object1" <http://example.org/graph1> .`,
|
||||
expect: &quad.Quad{
|
||||
Subject: "_:subject1",
|
||||
Predicate: "<http://an.example/predicate1>",
|
||||
Object: `"object1"`,
|
||||
Provenance: "<http://example.org/graph1>",
|
||||
Subject: "_:subject1",
|
||||
Predicate: "<http://an.example/predicate1>",
|
||||
Object: `"object1"`,
|
||||
Label: "<http://example.org/graph1>",
|
||||
},
|
||||
err: nil,
|
||||
},
|
||||
|
|
@ -160,10 +160,10 @@ var testNTriples = []struct {
|
|||
message: "parse quad with blank subject node, literal object, IRIREF predicate and label, and no comment (2)",
|
||||
input: `_:subject2 <http://an.example/predicate2> "object2" <http://example.org/graph5> .`,
|
||||
expect: &quad.Quad{
|
||||
Subject: "_:subject2",
|
||||
Predicate: "<http://an.example/predicate2>",
|
||||
Object: `"object2"`,
|
||||
Provenance: "<http://example.org/graph5>",
|
||||
Subject: "_:subject2",
|
||||
Predicate: "<http://an.example/predicate2>",
|
||||
Object: `"object2"`,
|
||||
Label: "<http://example.org/graph5>",
|
||||
},
|
||||
err: nil,
|
||||
},
|
||||
|
|
@ -173,10 +173,10 @@ var testNTriples = []struct {
|
|||
message: "parse quad with all IRIREF parts",
|
||||
input: `<http://example.org/#spiderman> <http://www.perceive.net/schemas/relationship/enemyOf> <http://example.org/#green-goblin> <http://example.org/graphs/spiderman> .`,
|
||||
expect: &quad.Quad{
|
||||
Subject: "<http://example.org/#spiderman>",
|
||||
Predicate: "<http://www.perceive.net/schemas/relationship/enemyOf>",
|
||||
Object: "<http://example.org/#green-goblin>",
|
||||
Provenance: "<http://example.org/graphs/spiderman>",
|
||||
Subject: "<http://example.org/#spiderman>",
|
||||
Predicate: "<http://www.perceive.net/schemas/relationship/enemyOf>",
|
||||
Object: "<http://example.org/#green-goblin>",
|
||||
Label: "<http://example.org/graphs/spiderman>",
|
||||
},
|
||||
err: nil,
|
||||
},
|
||||
|
|
@ -186,10 +186,10 @@ var testNTriples = []struct {
|
|||
message: "parse quad with blank node labelled subject and object and IRIREF predicate and label (1)",
|
||||
input: `_:alice <http://xmlns.com/foaf/0.1/knows> _:bob <http://example.org/graphs/john> .`,
|
||||
expect: &quad.Quad{
|
||||
Subject: "_:alice",
|
||||
Predicate: "<http://xmlns.com/foaf/0.1/knows>",
|
||||
Object: "_:bob",
|
||||
Provenance: "<http://example.org/graphs/john>",
|
||||
Subject: "_:alice",
|
||||
Predicate: "<http://xmlns.com/foaf/0.1/knows>",
|
||||
Object: "_:bob",
|
||||
Label: "<http://example.org/graphs/john>",
|
||||
},
|
||||
err: nil,
|
||||
},
|
||||
|
|
@ -197,10 +197,10 @@ var testNTriples = []struct {
|
|||
message: "parse quad with blank node labelled subject and object and IRIREF predicate and label (2)",
|
||||
input: `_:bob <http://xmlns.com/foaf/0.1/knows> _:alice <http://example.org/graphs/james> .`,
|
||||
expect: &quad.Quad{
|
||||
Subject: "_:bob",
|
||||
Predicate: "<http://xmlns.com/foaf/0.1/knows>",
|
||||
Object: "_:alice",
|
||||
Provenance: "<http://example.org/graphs/james>",
|
||||
Subject: "_:bob",
|
||||
Predicate: "<http://xmlns.com/foaf/0.1/knows>",
|
||||
Object: "_:alice",
|
||||
Label: "<http://example.org/graphs/james>",
|
||||
},
|
||||
err: nil,
|
||||
},
|
||||
|
|
@ -210,10 +210,10 @@ var testNTriples = []struct {
|
|||
message: "parse triple with all IRIREF parts",
|
||||
input: `<http://example.org/bob#me> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .`,
|
||||
expect: &quad.Quad{
|
||||
Subject: "<http://example.org/bob#me>",
|
||||
Predicate: "<http://www.w3.org/1999/02/22-rdf-syntax-ns#type>",
|
||||
Object: "<http://xmlns.com/foaf/0.1/Person>",
|
||||
Provenance: "",
|
||||
Subject: "<http://example.org/bob#me>",
|
||||
Predicate: "<http://www.w3.org/1999/02/22-rdf-syntax-ns#type>",
|
||||
Object: "<http://xmlns.com/foaf/0.1/Person>",
|
||||
Label: "",
|
||||
},
|
||||
err: nil,
|
||||
},
|
||||
|
|
@ -221,10 +221,10 @@ var testNTriples = []struct {
|
|||
message: "parse triple with all IRIREF parts",
|
||||
input: `<http://example.org/bob#me> <http://xmlns.com/foaf/0.1/knows> <http://example.org/alice#me> .`,
|
||||
expect: &quad.Quad{
|
||||
Subject: "<http://example.org/bob#me>",
|
||||
Predicate: "<http://xmlns.com/foaf/0.1/knows>",
|
||||
Object: "<http://example.org/alice#me>",
|
||||
Provenance: "",
|
||||
Subject: "<http://example.org/bob#me>",
|
||||
Predicate: "<http://xmlns.com/foaf/0.1/knows>",
|
||||
Object: "<http://example.org/alice#me>",
|
||||
Label: "",
|
||||
},
|
||||
err: nil,
|
||||
},
|
||||
|
|
@ -232,10 +232,10 @@ var testNTriples = []struct {
|
|||
message: "parse triple with IRIREF schema on literal object",
|
||||
input: `<http://example.org/bob#me> <http://schema.org/birthDate> "1990-07-04"^^<http://www.w3.org/2001/XMLSchema#date> .`,
|
||||
expect: &quad.Quad{
|
||||
Subject: "<http://example.org/bob#me>",
|
||||
Predicate: "<http://schema.org/birthDate>",
|
||||
Object: `"1990-07-04"^^<http://www.w3.org/2001/XMLSchema#date>`,
|
||||
Provenance: "",
|
||||
Subject: "<http://example.org/bob#me>",
|
||||
Predicate: "<http://schema.org/birthDate>",
|
||||
Object: `"1990-07-04"^^<http://www.w3.org/2001/XMLSchema#date>`,
|
||||
Label: "",
|
||||
},
|
||||
err: nil,
|
||||
},
|
||||
|
|
@ -243,10 +243,10 @@ var testNTriples = []struct {
|
|||
message: "parse commented IRIREF in triple",
|
||||
input: `<http://example.org/bob#me> <http://xmlns.com/foaf/0.1/topic_interest> <http://www.wikidata.org/entity/Q12418> .`,
|
||||
expect: &quad.Quad{
|
||||
Subject: "<http://example.org/bob#me>",
|
||||
Predicate: "<http://xmlns.com/foaf/0.1/topic_interest>",
|
||||
Object: "<http://www.wikidata.org/entity/Q12418>",
|
||||
Provenance: "",
|
||||
Subject: "<http://example.org/bob#me>",
|
||||
Predicate: "<http://xmlns.com/foaf/0.1/topic_interest>",
|
||||
Object: "<http://www.wikidata.org/entity/Q12418>",
|
||||
Label: "",
|
||||
},
|
||||
err: nil,
|
||||
},
|
||||
|
|
@ -254,10 +254,10 @@ var testNTriples = []struct {
|
|||
message: "parse triple with literal subject",
|
||||
input: `<http://www.wikidata.org/entity/Q12418> <http://purl.org/dc/terms/title> "Mona Lisa" .`,
|
||||
expect: &quad.Quad{
|
||||
Subject: "<http://www.wikidata.org/entity/Q12418>",
|
||||
Predicate: "<http://purl.org/dc/terms/title>",
|
||||
Object: `"Mona Lisa"`,
|
||||
Provenance: "",
|
||||
Subject: "<http://www.wikidata.org/entity/Q12418>",
|
||||
Predicate: "<http://purl.org/dc/terms/title>",
|
||||
Object: `"Mona Lisa"`,
|
||||
Label: "",
|
||||
},
|
||||
err: nil,
|
||||
},
|
||||
|
|
@ -265,10 +265,10 @@ var testNTriples = []struct {
|
|||
message: "parse triple with all IRIREF parts (1)",
|
||||
input: `<http://www.wikidata.org/entity/Q12418> <http://purl.org/dc/terms/creator> <http://dbpedia.org/resource/Leonardo_da_Vinci> .`,
|
||||
expect: &quad.Quad{
|
||||
Subject: "<http://www.wikidata.org/entity/Q12418>",
|
||||
Predicate: "<http://purl.org/dc/terms/creator>",
|
||||
Object: "<http://dbpedia.org/resource/Leonardo_da_Vinci>",
|
||||
Provenance: "",
|
||||
Subject: "<http://www.wikidata.org/entity/Q12418>",
|
||||
Predicate: "<http://purl.org/dc/terms/creator>",
|
||||
Object: "<http://dbpedia.org/resource/Leonardo_da_Vinci>",
|
||||
Label: "",
|
||||
},
|
||||
err: nil,
|
||||
},
|
||||
|
|
@ -276,10 +276,10 @@ var testNTriples = []struct {
|
|||
message: "parse triple with all IRIREF parts (2)",
|
||||
input: `<http://data.europeana.eu/item/04802/243FA8618938F4117025F17A8B813C5F9AA4D619> <http://purl.org/dc/terms/subject> <http://www.wikidata.org/entity/Q12418> .`,
|
||||
expect: &quad.Quad{
|
||||
Subject: "<http://data.europeana.eu/item/04802/243FA8618938F4117025F17A8B813C5F9AA4D619>",
|
||||
Predicate: "<http://purl.org/dc/terms/subject>",
|
||||
Object: "<http://www.wikidata.org/entity/Q12418>",
|
||||
Provenance: "",
|
||||
Subject: "<http://data.europeana.eu/item/04802/243FA8618938F4117025F17A8B813C5F9AA4D619>",
|
||||
Predicate: "<http://purl.org/dc/terms/subject>",
|
||||
Object: "<http://www.wikidata.org/entity/Q12418>",
|
||||
Label: "",
|
||||
},
|
||||
err: nil,
|
||||
},
|
||||
|
|
@ -289,10 +289,10 @@ var testNTriples = []struct {
|
|||
message: "parse commented IRIREF in quad (1)",
|
||||
input: `<http://example.org/bob#me> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> <http://example.org/bob> .`,
|
||||
expect: &quad.Quad{
|
||||
Subject: "<http://example.org/bob#me>",
|
||||
Predicate: "<http://www.w3.org/1999/02/22-rdf-syntax-ns#type>",
|
||||
Object: "<http://xmlns.com/foaf/0.1/Person>",
|
||||
Provenance: "<http://example.org/bob>",
|
||||
Subject: "<http://example.org/bob#me>",
|
||||
Predicate: "<http://www.w3.org/1999/02/22-rdf-syntax-ns#type>",
|
||||
Object: "<http://xmlns.com/foaf/0.1/Person>",
|
||||
Label: "<http://example.org/bob>",
|
||||
},
|
||||
err: nil,
|
||||
},
|
||||
|
|
@ -300,10 +300,10 @@ var testNTriples = []struct {
|
|||
message: "parse quad with all IRIREF parts",
|
||||
input: `<http://example.org/bob#me> <http://xmlns.com/foaf/0.1/knows> <http://example.org/alice#me> <http://example.org/bob> .`,
|
||||
expect: &quad.Quad{
|
||||
Subject: "<http://example.org/bob#me>",
|
||||
Predicate: "<http://xmlns.com/foaf/0.1/knows>",
|
||||
Object: "<http://example.org/alice#me>",
|
||||
Provenance: "<http://example.org/bob>",
|
||||
Subject: "<http://example.org/bob#me>",
|
||||
Predicate: "<http://xmlns.com/foaf/0.1/knows>",
|
||||
Object: "<http://example.org/alice#me>",
|
||||
Label: "<http://example.org/bob>",
|
||||
},
|
||||
err: nil,
|
||||
},
|
||||
|
|
@ -311,10 +311,10 @@ var testNTriples = []struct {
|
|||
message: "parse quad with IRIREF schema on literal object",
|
||||
input: `<http://example.org/bob#me> <http://schema.org/birthDate> "1990-07-04"^^<http://www.w3.org/2001/XMLSchema#date> <http://example.org/bob> .`,
|
||||
expect: &quad.Quad{
|
||||
Subject: "<http://example.org/bob#me>",
|
||||
Predicate: "<http://schema.org/birthDate>",
|
||||
Object: `"1990-07-04"^^<http://www.w3.org/2001/XMLSchema#date>`,
|
||||
Provenance: "<http://example.org/bob>",
|
||||
Subject: "<http://example.org/bob#me>",
|
||||
Predicate: "<http://schema.org/birthDate>",
|
||||
Object: `"1990-07-04"^^<http://www.w3.org/2001/XMLSchema#date>`,
|
||||
Label: "<http://example.org/bob>",
|
||||
},
|
||||
err: nil,
|
||||
},
|
||||
|
|
@ -322,10 +322,10 @@ var testNTriples = []struct {
|
|||
message: "parse commented IRIREF in quad (2)",
|
||||
input: `<http://example.org/bob#me> <http://xmlns.com/foaf/0.1/topic_interest> <http://www.wikidata.org/entity/Q12418> <http://example.org/bob> .`,
|
||||
expect: &quad.Quad{
|
||||
Subject: "<http://example.org/bob#me>",
|
||||
Predicate: "<http://xmlns.com/foaf/0.1/topic_interest>",
|
||||
Object: "<http://www.wikidata.org/entity/Q12418>",
|
||||
Provenance: "<http://example.org/bob>",
|
||||
Subject: "<http://example.org/bob#me>",
|
||||
Predicate: "<http://xmlns.com/foaf/0.1/topic_interest>",
|
||||
Object: "<http://www.wikidata.org/entity/Q12418>",
|
||||
Label: "<http://example.org/bob>",
|
||||
},
|
||||
err: nil,
|
||||
},
|
||||
|
|
@ -333,10 +333,10 @@ var testNTriples = []struct {
|
|||
message: "parse literal object and colon qualified label in quad",
|
||||
input: `<http://www.wikidata.org/entity/Q12418> <http://purl.org/dc/terms/title> "Mona Lisa" <https://www.wikidata.org/wiki/Special:EntityData/Q12418> .`,
|
||||
expect: &quad.Quad{
|
||||
Subject: "<http://www.wikidata.org/entity/Q12418>",
|
||||
Predicate: "<http://purl.org/dc/terms/title>",
|
||||
Object: `"Mona Lisa"`,
|
||||
Provenance: "<https://www.wikidata.org/wiki/Special:EntityData/Q12418>",
|
||||
Subject: "<http://www.wikidata.org/entity/Q12418>",
|
||||
Predicate: "<http://purl.org/dc/terms/title>",
|
||||
Object: `"Mona Lisa"`,
|
||||
Label: "<https://www.wikidata.org/wiki/Special:EntityData/Q12418>",
|
||||
},
|
||||
err: nil,
|
||||
},
|
||||
|
|
@ -344,10 +344,10 @@ var testNTriples = []struct {
|
|||
message: "parse all IRIREF parts with colon qualified label in quad (1)",
|
||||
input: `<http://www.wikidata.org/entity/Q12418> <http://purl.org/dc/terms/creator> <http://dbpedia.org/resource/Leonardo_da_Vinci> <https://www.wikidata.org/wiki/Special:EntityData/Q12418> .`,
|
||||
expect: &quad.Quad{
|
||||
Subject: "<http://www.wikidata.org/entity/Q12418>",
|
||||
Predicate: "<http://purl.org/dc/terms/creator>",
|
||||
Object: "<http://dbpedia.org/resource/Leonardo_da_Vinci>",
|
||||
Provenance: "<https://www.wikidata.org/wiki/Special:EntityData/Q12418>",
|
||||
Subject: "<http://www.wikidata.org/entity/Q12418>",
|
||||
Predicate: "<http://purl.org/dc/terms/creator>",
|
||||
Object: "<http://dbpedia.org/resource/Leonardo_da_Vinci>",
|
||||
Label: "<https://www.wikidata.org/wiki/Special:EntityData/Q12418>",
|
||||
},
|
||||
err: nil,
|
||||
},
|
||||
|
|
@ -355,10 +355,10 @@ var testNTriples = []struct {
|
|||
message: "parse all IRIREF parts with colon qualified label in quad (2)",
|
||||
input: `<http://data.europeana.eu/item/04802/243FA8618938F4117025F17A8B813C5F9AA4D619> <http://purl.org/dc/terms/subject> <http://www.wikidata.org/entity/Q12418> <https://www.wikidata.org/wiki/Special:EntityData/Q12418> .`,
|
||||
expect: &quad.Quad{
|
||||
Subject: "<http://data.europeana.eu/item/04802/243FA8618938F4117025F17A8B813C5F9AA4D619>",
|
||||
Predicate: "<http://purl.org/dc/terms/subject>",
|
||||
Object: "<http://www.wikidata.org/entity/Q12418>",
|
||||
Provenance: "<https://www.wikidata.org/wiki/Special:EntityData/Q12418>",
|
||||
Subject: "<http://data.europeana.eu/item/04802/243FA8618938F4117025F17A8B813C5F9AA4D619>",
|
||||
Predicate: "<http://purl.org/dc/terms/subject>",
|
||||
Object: "<http://www.wikidata.org/entity/Q12418>",
|
||||
Label: "<https://www.wikidata.org/wiki/Special:EntityData/Q12418>",
|
||||
},
|
||||
err: nil,
|
||||
},
|
||||
|
|
@ -366,10 +366,10 @@ var testNTriples = []struct {
|
|||
message: "parse all IRIREF parts (quad section - 1)",
|
||||
input: `<http://example.org/bob> <http://purl.org/dc/terms/publisher> <http://example.org> .`,
|
||||
expect: &quad.Quad{
|
||||
Subject: "<http://example.org/bob>",
|
||||
Predicate: "<http://purl.org/dc/terms/publisher>",
|
||||
Object: "<http://example.org>",
|
||||
Provenance: "",
|
||||
Subject: "<http://example.org/bob>",
|
||||
Predicate: "<http://purl.org/dc/terms/publisher>",
|
||||
Object: "<http://example.org>",
|
||||
Label: "",
|
||||
},
|
||||
err: nil,
|
||||
},
|
||||
|
|
@ -377,10 +377,10 @@ var testNTriples = []struct {
|
|||
message: "parse all IRIREF parts (quad section - 2)",
|
||||
input: `<http://example.org/bob> <http://purl.org/dc/terms/rights> <http://creativecommons.org/licenses/by/3.0/> .`,
|
||||
expect: &quad.Quad{
|
||||
Subject: "<http://example.org/bob>",
|
||||
Predicate: "<http://purl.org/dc/terms/rights>",
|
||||
Object: "<http://creativecommons.org/licenses/by/3.0/>",
|
||||
Provenance: "",
|
||||
Subject: "<http://example.org/bob>",
|
||||
Predicate: "<http://purl.org/dc/terms/rights>",
|
||||
Object: "<http://creativecommons.org/licenses/by/3.0/>",
|
||||
Label: "",
|
||||
},
|
||||
err: nil,
|
||||
},
|
||||
|
|
@ -402,10 +402,10 @@ var testNTriples = []struct {
|
|||
message: "parse incomplete quad",
|
||||
input: `<http://example.org/bob#me> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> .`,
|
||||
expect: &quad.Quad{
|
||||
Subject: "<http://example.org/bob#me>",
|
||||
Predicate: "<http://www.w3.org/1999/02/22-rdf-syntax-ns#type>",
|
||||
Object: "",
|
||||
Provenance: "",
|
||||
Subject: "<http://example.org/bob#me>",
|
||||
Predicate: "<http://www.w3.org/1999/02/22-rdf-syntax-ns#type>",
|
||||
Object: "",
|
||||
Label: "",
|
||||
},
|
||||
err: fmt.Errorf("%v: unexpected rune '.' at 78", quad.ErrInvalid),
|
||||
},
|
||||
|
|
@ -413,10 +413,10 @@ var testNTriples = []struct {
|
|||
message: "parse incomplete quad",
|
||||
input: `<http://example.org/bob#me> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> .`,
|
||||
expect: &quad.Quad{
|
||||
Subject: "<http://example.org/bob#me>",
|
||||
Predicate: "<http://www.w3.org/1999/02/22-rdf-syntax-ns#type>",
|
||||
Object: "",
|
||||
Provenance: "",
|
||||
Subject: "<http://example.org/bob#me>",
|
||||
Predicate: "<http://www.w3.org/1999/02/22-rdf-syntax-ns#type>",
|
||||
Object: "",
|
||||
Label: "",
|
||||
},
|
||||
err: fmt.Errorf("%v: unexpected rune '.' at 78", quad.ErrInvalid),
|
||||
},
|
||||
|
|
|
|||
|
|
@ -619,7 +619,7 @@ tr96:
|
|||
if label < 0 {
|
||||
panic("unexpected parser state: label start not set")
|
||||
}
|
||||
q.Provenance = unEscape(data[label:p], isEscaped)
|
||||
q.Label = unEscape(data[label:p], isEscaped)
|
||||
isEscaped = false
|
||||
|
||||
goto st10
|
||||
|
|
@ -660,7 +660,7 @@ tr39:
|
|||
if label < 0 {
|
||||
panic("unexpected parser state: label start not set")
|
||||
}
|
||||
q.Provenance = unEscape(data[label:p], isEscaped)
|
||||
q.Label = unEscape(data[label:p], isEscaped)
|
||||
isEscaped = false
|
||||
|
||||
goto st88
|
||||
|
|
@ -785,7 +785,7 @@ tr38:
|
|||
if label < 0 {
|
||||
panic("unexpected parser state: label start not set")
|
||||
}
|
||||
q.Provenance = unEscape(data[label:p], isEscaped)
|
||||
q.Label = unEscape(data[label:p], isEscaped)
|
||||
isEscaped = false
|
||||
|
||||
goto st13
|
||||
|
|
@ -1202,7 +1202,7 @@ tr55:
|
|||
if label < 0 {
|
||||
panic("unexpected parser state: label start not set")
|
||||
}
|
||||
q.Provenance = unEscape(data[label:p], isEscaped)
|
||||
q.Label = unEscape(data[label:p], isEscaped)
|
||||
isEscaped = false
|
||||
|
||||
goto st90
|
||||
|
|
@ -2682,7 +2682,7 @@ tr97:
|
|||
if label < 0 {
|
||||
panic("unexpected parser state: label start not set")
|
||||
}
|
||||
q.Provenance = unEscape(data[label:p], isEscaped)
|
||||
q.Label = unEscape(data[label:p], isEscaped)
|
||||
isEscaped = false
|
||||
|
||||
goto st92
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue