sparql 3.1.7 → 3.1.8

Sign up to get free protection for your applications and to get access to all the features.
@@ -754,7 +754,7 @@ module SPARQL::Grammar
754
754
  end
755
755
  end
756
756
 
757
- # [65] DataBlockValue ::= EmbTD | iri | RDFLiteral | NumericLiteral | BooleanLiteral | 'UNDEF'
757
+ # [65] DataBlockValue ::= QuotedTriple | iri | RDFLiteral | NumericLiteral | BooleanLiteral | 'UNDEF'
758
758
  production(:DataBlockValue) do |input, data, callback|
759
759
  add_prod_datum :DataBlockValue, data.values.first
760
760
  end
@@ -833,7 +833,7 @@ module SPARQL::Grammar
833
833
  add_prod_datum(:ConstructTemplate, data[:ConstructTemplate])
834
834
  end
835
835
 
836
- # [75] TriplesSameSubject ::= VarOrTermOrEmbTP PropertyListNotEmpty
836
+ # [75] TriplesSameSubject ::= VarOrTermOrQuotedTP PropertyListNotEmpty
837
837
  # | TriplesNode PropertyList
838
838
  production(:TriplesSameSubject) do |input, data, callback|
839
839
  add_prod_datum(:pattern, data[:pattern])
@@ -842,8 +842,8 @@ module SPARQL::Grammar
842
842
  # [77] PropertyListNotEmpty ::= Verb ObjectList
843
843
  # ( ';' ( Verb ObjectList )? )*
844
844
  start_production(:PropertyListNotEmpty) do |input, data, callback|
845
- subject = input[:VarOrTermOrEmbTP] || input[:TriplesNode] || input[:GraphNode]
846
- error(nil, "Expected VarOrTermOrEmbTP or TriplesNode or GraphNode", production: :PropertyListNotEmpty) if validate? && !subject
845
+ subject = input[:VarOrTermOrQuotedTP] || input[:TriplesNode] || input[:GraphNode]
846
+ error(nil, "Expected VarOrTermOrQuotedTP or TriplesNode or GraphNode", production: :PropertyListNotEmpty) if validate? && !subject
847
847
  data[:Subject] = subject
848
848
  end
849
849
  production(:PropertyListNotEmpty) do |input, data, callback|
@@ -899,7 +899,7 @@ module SPARQL::Grammar
899
899
  add_prod_datum(:pattern, data[:pattern])
900
900
  end
901
901
 
902
- # [81] TriplesSameSubjectPath ::= VarOrTermOrEmbTP PropertyListPathNotEmpty | TriplesNode PropertyListPath
902
+ # [81] TriplesSameSubjectPath ::= VarOrTermOrQuotedTP PropertyListPathNotEmpty | TriplesNode PropertyListPath
903
903
  production(:TriplesSameSubjectPath) do |input, data, callback|
904
904
  add_prod_datum(:pattern, data[:pattern])
905
905
  add_prod_datum(:path, data[:path])
@@ -907,8 +907,8 @@ module SPARQL::Grammar
907
907
 
908
908
  # [83] PropertyListPathNotEmpty ::= ( VerbPath | VerbSimple ) ObjectList ( ';' ( ( VerbPath | VerbSimple ) ObjectList )? )*
909
909
  start_production(:PropertyListPathNotEmpty) do |input, data, callback|
910
- subject = input[:VarOrTermOrEmbTP] || input[:TriplesNode] || input[:GraphNode]
911
- error(nil, "Expected VarOrTermOrEmbTP, got nothing", production: :PropertyListPathNotEmpty) if validate? && !subject
910
+ subject = input[:VarOrTermOrQuotedTP] || input[:TriplesNode] || input[:GraphNode]
911
+ error(nil, "Expected VarOrTermOrQuotedTP, got nothing", production: :PropertyListPathNotEmpty) if validate? && !subject
912
912
  data[:Subject] = subject
913
913
  end
914
914
  production(:PropertyListPathNotEmpty) do |input, data, callback|
@@ -954,7 +954,7 @@ module SPARQL::Grammar
954
954
  data[:Verb] = Array(input[:Verb]).first
955
955
  end
956
956
  production(:ObjectPath) do |input, data, callback|
957
- object = data[:VarOrTermOrEmbTP] || data[:TriplesNode] || data[:GraphNode]
957
+ object = data[:VarOrTermOrQuotedTP] || data[:TriplesNode] || data[:GraphNode]
958
958
  if object
959
959
  if prod_data[:Verb]
960
960
  if data[:pattern] && data[:path]
@@ -1116,24 +1116,24 @@ module SPARQL::Grammar
1116
1116
  add_prod_datum(:path, data[:path])
1117
1117
  end
1118
1118
 
1119
- # [104] GraphNode ::= VarOrTermOrEmbTP | TriplesNode
1119
+ # [104] GraphNode ::= VarOrTermOrQuotedTP | TriplesNode
1120
1120
  production(:GraphNode) do |input, data, callback|
1121
- term = data[:VarOrTermOrEmbTP] || data[:TriplesNode]
1121
+ term = data[:VarOrTermOrQuotedTP] || data[:TriplesNode]
1122
1122
  add_prod_datum(:pattern, data[:pattern])
1123
1123
  add_prod_datum(:GraphNode, term)
1124
1124
  end
1125
1125
 
1126
- # [105] GraphNodePath ::= VarOrTermOrEmbTP | TriplesNodePath
1126
+ # [105] GraphNodePath ::= VarOrTermOrQuotedTP | TriplesNodePath
1127
1127
  production(:GraphNodePath) do |input, data, callback|
1128
- term = data[:VarOrTermOrEmbTP] || data[:TriplesNode]
1128
+ term = data[:VarOrTermOrQuotedTP] || data[:TriplesNode]
1129
1129
  add_prod_datum(:pattern, data[:pattern])
1130
1130
  add_prod_datum(:path, data[:path])
1131
1131
  add_prod_datum(:GraphNode, term)
1132
1132
  end
1133
1133
 
1134
- # [106s] VarOrTermOrEmbTP ::= Var | GraphTerm | EmbTP
1135
- production(:VarOrTermOrEmbTP) do |input, data, callback|
1136
- data.values.each {|v| add_prod_datum(:VarOrTermOrEmbTP, v)}
1134
+ # [106s] VarOrTermOrQuotedTP ::= Var | GraphTerm | EmbTP
1135
+ production(:VarOrTermOrQuotedTP) do |input, data, callback|
1136
+ data.values.each {|v| add_prod_datum(:VarOrTermOrQuotedTP, v)}
1137
1137
  end
1138
1138
 
1139
1139
  # [107] VarOrIri ::= Var | iri
@@ -1151,22 +1151,6 @@ module SPARQL::Grammar
1151
1151
  data[:NIL])
1152
1152
  end
1153
1153
 
1154
- # [174] EmbTP ::= '<<' EmbSubjectOrObject Verb EmbSubjectOrObject '>>'
1155
- production(:EmbTP) do |input, data, callback|
1156
- subject, object = data[:EmbSubjectOrObject]
1157
- predicate = data[:Verb]
1158
- add_pattern(:EmbTP,
1159
- subject: subject,
1160
- predicate: predicate,
1161
- object: object)
1162
- end
1163
-
1164
- # [175] EmbSubjectOrObject ::= Var | BlankNode | iri | RDFLiteral
1165
- # | NumericLiteral | BooleanLiteral | EmbTP
1166
- production(:EmbSubjectOrObject) do |input, data, callback|
1167
- data.values.each {|v| add_prod_datum(:EmbSubjectOrObject, v)}
1168
- end
1169
-
1170
1154
  # [110] Expression ::= ConditionalOrExpression
1171
1155
  production(:Expression) do |input, data, callback|
1172
1156
  add_prod_datum(:Expression, data[:Expression])
@@ -1306,7 +1290,7 @@ module SPARQL::Grammar
1306
1290
  # | iriOrFunction | RDFLiteral
1307
1291
  # | NumericLiteral | BooleanLiteral
1308
1292
  # | Var
1309
- # | ExprEmbTP
1293
+ # | ExprQuotedTP
1310
1294
  production(:PrimaryExpression) do |input, data, callback|
1311
1295
  if data[:Expression]
1312
1296
  add_prod_datum(:Expression, data[:Expression])
@@ -1328,21 +1312,6 @@ module SPARQL::Grammar
1328
1312
  add_prod_datum(:UnaryExpression, data[:UnaryExpression])
1329
1313
  end
1330
1314
 
1331
- # [119a] ExprEmbTP ::= '<<' ExprVarOrTerm Verb ExprVarOrTerm '>>'
1332
- production(:ExprEmbTP) do |input, data, callback|
1333
- subject, object = data[:ExprVarOrTerm]
1334
- predicate = data[:Verb]
1335
- add_pattern(:ExprEmbTP,
1336
- subject: subject,
1337
- predicate: predicate,
1338
- object: object)
1339
- end
1340
-
1341
- # [119b] ExprVarOrTerm ::= iri | RDFLiteral | NumericLiteral | BooleanLiteral | Var | ExprEmbTP
1342
- production(:ExprVarOrTerm) do |input, data, callback|
1343
- data.values.each {|v| add_prod_datum(:ExprVarOrTerm, v)}
1344
- end
1345
-
1346
1315
  # [121] BuiltInCall ::= Aggregate
1347
1316
  # | 'STR' '(' Expression ')'
1348
1317
  # | 'LANG' '(' Expression ')'
@@ -1507,15 +1476,38 @@ module SPARQL::Grammar
1507
1476
  add_prod_datum(:UnaryExpression, data[:UnaryExpression])
1508
1477
  end
1509
1478
 
1510
- # [177] AnnotationPattern ::= '{|' PropertyListNotEmpty '|}'
1511
- #start_production(:AnnotationPattern) do |input, data, callback|
1512
- # data[:TriplesNode] = prod_data[:TriplesNode].first
1513
- #end
1514
- #production(:AnnotationPattern) do |input, data, callback|
1515
- # add_prod_datum(:pattern, data[:pattern])
1516
- #end
1479
+ # [174] QuotedTP ::= '<<' qtSubjectOrObject Verb qtSubjectOrObject '>>'
1480
+ production(:QuotedTP) do |input, data, callback|
1481
+ subject, object = data[:qtSubjectOrObject]
1482
+ predicate = data[:Verb]
1483
+ add_pattern(:QuotedTP,
1484
+ subject: subject,
1485
+ predicate: predicate,
1486
+ object: object)
1487
+ end
1488
+
1489
+ # [175] QuotedTriple ::= '<<' DataValueTerm (iri | 'a') DataValueTerm '>>'
1490
+ production(:QuotedTriple) do |input, data, callback|
1491
+ subject, object = data[:DataValueTerm]
1492
+ predicate = data[:iri]
1493
+ add_pattern(:QuotedTriple,
1494
+ subject: subject,
1495
+ predicate: predicate,
1496
+ object: object)
1497
+ end
1498
+
1499
+ # [176] qtSubjectOrObject ::= Var | BlankNode | iri | RDFLiteral
1500
+ # | NumericLiteral | BooleanLiteral | QuotedTP
1501
+ production(:qtSubjectOrObject) do |input, data, callback|
1502
+ data.values.each {|v| add_prod_datum(:qtSubjectOrObject, v)}
1503
+ end
1517
1504
 
1518
- # [178] AnnotationPatternPath ::= '{|' PropertyListPathNotEmpty '|}'
1505
+ # [177] DataValueTerm ::= iri | RDFLiteral | NumericLiteral | BooleanLiteral | QuotedTriple
1506
+ production(:DataValueTerm) do |input, data, callback|
1507
+ add_prod_datum :DataValueTerm, data.values.first
1508
+ end
1509
+
1510
+ # [180] AnnotationPatternPath ::= '{|' PropertyListPathNotEmpty '|}'
1519
1511
  start_production(:AnnotationPatternPath) do |input, data, callback|
1520
1512
  data[:TriplesNode] = input[:TriplesNode]
1521
1513
  end
@@ -1529,21 +1521,21 @@ module SPARQL::Grammar
1529
1521
  end
1530
1522
  end
1531
1523
 
1532
- # [179] EmbTD ::= '<<' DataValueTerm ( iri | 'a' ) DataValueTerm '>>'
1533
- production(:EmbTD) do |input, data, callback|
1534
- subject, object = data[:DataValueTerm]
1535
- predicate = data[:iri]
1536
- add_pattern(:EmbTD,
1524
+ # [181] ExprQuotedTP ::= '<<' ExprVarOrTerm Verb ExprVarOrTerm '>>'
1525
+ production(:ExprQuotedTP) do |input, data, callback|
1526
+ subject, object = data[:ExprVarOrTerm]
1527
+ predicate = data[:Verb]
1528
+ add_pattern(:ExprQuotedTP,
1537
1529
  subject: subject,
1538
1530
  predicate: predicate,
1539
1531
  object: object)
1540
1532
  end
1541
1533
 
1542
- # [180] DataValueTerm ::= EmbTD | iri | RDFLiteral | NumericLiteral | BooleanLiteral
1543
- production(:DataValueTerm) do |input, data, callback|
1544
- add_prod_datum :DataValueTerm, data.values.first
1534
+ # [182] ExprVarOrTerm ::= iri | RDFLiteral | NumericLiteral | BooleanLiteral | Var | ExprQuotedTP
1535
+ production(:ExprVarOrTerm) do |input, data, callback|
1536
+ data.values.each {|v| add_prod_datum(:ExprVarOrTerm, v)}
1545
1537
  end
1546
-
1538
+
1547
1539
  ##
1548
1540
  # Initializes a new parser instance.
1549
1541
  #
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sparql
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.7
4
+ version: 3.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gregg Kellogg
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2021-05-29 00:00:00.000000000 Z
12
+ date: 2021-08-25 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rdf
@@ -73,6 +73,20 @@ dependencies:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
75
  version: '3.2'
76
+ - !ruby/object:Gem::Dependency
77
+ name: logger
78
+ requirement: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '1.4'
83
+ type: :runtime
84
+ prerelease: false
85
+ version_requirements: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: '1.4'
76
90
  - !ruby/object:Gem::Dependency
77
91
  name: sxp
78
92
  requirement: !ruby/object:Gem::Requirement