shex 0.6.3 → 0.6.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +98 -87
- data/VERSION +1 -1
- data/lib/shex/algebra/and.rb +3 -12
- data/lib/shex/algebra/each_of.rb +2 -12
- data/lib/shex/algebra/import.rb +6 -0
- data/lib/shex/algebra/not.rb +3 -10
- data/lib/shex/algebra/one_of.rb +2 -12
- data/lib/shex/algebra/operator.rb +26 -13
- data/lib/shex/algebra/or.rb +3 -12
- data/lib/shex/algebra/schema.rb +2 -9
- data/lib/shex/algebra/shape.rb +4 -2
- data/lib/shex/algebra/shape_expression.rb +29 -0
- data/lib/shex/algebra/start.rb +2 -10
- data/lib/shex/algebra/stem.rb +5 -1
- data/lib/shex/algebra/stem_range.rb +3 -1
- data/lib/shex/algebra/triple_constraint.rb +1 -1
- data/lib/shex/algebra/triple_expression.rb +18 -0
- data/lib/shex/algebra.rb +0 -1
- data/lib/shex/meta.rb +25 -38
- data/lib/shex/parser.rb +112 -128
- data/lib/shex/terminals.rb +5 -25
- data/lib/shex.rb +4 -2
- metadata +4 -3
data/lib/shex/terminals.rb
CHANGED
@@ -43,7 +43,11 @@ module ShEx
|
|
43
43
|
# 160s
|
44
44
|
ECHAR = /\\[tbnrf\\"']/
|
45
45
|
|
46
|
-
WS =
|
46
|
+
WS = %r((
|
47
|
+
\s
|
48
|
+
| (?:\#[^\n\r]*)
|
49
|
+
| (?:/\*(?:(?:\*[^/])|[^*])*\*/)
|
50
|
+
)+)xmu.freeze
|
47
51
|
|
48
52
|
# 69
|
49
53
|
RDF_TYPE = /a/.freeze
|
@@ -92,30 +96,6 @@ module ShEx
|
|
92
96
|
CODE = /\{(?:[^%\\]|\\[%\\]|#{UCHAR})*%#{WS}*\}/m.freeze
|
93
97
|
# 70
|
94
98
|
REPEAT_RANGE = /\{\s*#{INTEGER}(?:,#{WS}*(?:#{INTEGER}|\*)?)?#{WS}*\}/.freeze
|
95
|
-
|
96
|
-
# String terminals, mixed case sensitivity
|
97
|
-
STR_EXPR = %r(true|false
|
98
|
-
|\^\^|\/\/
|
99
|
-
|[\(\)\{\}\[\],\.;\=\-\~!\|\&\@\$\?\+\*\%\^a]|
|
100
|
-
(?i:OR|AND|NOT
|
101
|
-
|BASE|PREFIX
|
102
|
-
|IRI|BNODE|NONLITERAL
|
103
|
-
|MINLENGTH|MAXLENGTH|LENGTH
|
104
|
-
|MAXINCLUSIVE|MAXEXCLUSIVE
|
105
|
-
|MININCLUSIVE|MINEXCLUSIVE
|
106
|
-
|TOTALDIGITS|FRACTIONDIGITS
|
107
|
-
|START
|
108
|
-
|EXTERNAL|CLOSED|EXTRA|LITERAL
|
109
|
-
)
|
110
|
-
)x.freeze
|
111
|
-
|
112
|
-
# Map terminals to canonical form
|
113
|
-
STR_MAP = %w{OR AND NOT BASE PREFIX IRI BNODE NONLITERAL
|
114
|
-
MINLENGTH MAXLENGTH LENGTH MININCLUSIVE MAXINCLUSIVE MINEXCLUSIVE MAXEXCLUSIVE
|
115
|
-
TOTALDIGITS FRACTIONDIGITS START EXTERNAL CLOSED EXTRA LITERAL}.
|
116
|
-
inject({}) do |memo, t|
|
117
|
-
memo.merge(t.downcase => t)
|
118
|
-
end
|
119
99
|
|
120
100
|
end
|
121
101
|
end
|
data/lib/shex.rb
CHANGED
@@ -1,10 +1,12 @@
|
|
1
|
+
require 'rdf'
|
2
|
+
require 'sxp'
|
3
|
+
require 'shex/format'
|
4
|
+
|
1
5
|
##
|
2
6
|
# A ShEx runtime for RDF.rb.
|
3
7
|
#
|
4
8
|
# @see https://shex.io/shex-semantics/#shexc
|
5
9
|
module ShEx
|
6
|
-
require 'rdf'
|
7
|
-
require 'shex/format'
|
8
10
|
autoload :Algebra, 'shex/algebra'
|
9
11
|
autoload :Meta, 'shex/meta'
|
10
12
|
autoload :Parser, 'shex/parser'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: shex
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gregg Kellogg
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-09-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rdf
|
@@ -230,6 +230,7 @@ files:
|
|
230
230
|
- lib/shex/algebra/annotation.rb
|
231
231
|
- lib/shex/algebra/each_of.rb
|
232
232
|
- lib/shex/algebra/external.rb
|
233
|
+
- lib/shex/algebra/import.rb
|
233
234
|
- lib/shex/algebra/language.rb
|
234
235
|
- lib/shex/algebra/node_constraint.rb
|
235
236
|
- lib/shex/algebra/not.rb
|
@@ -274,7 +275,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
274
275
|
- !ruby/object:Gem::Version
|
275
276
|
version: '0'
|
276
277
|
requirements: []
|
277
|
-
rubygems_version: 3.2.
|
278
|
+
rubygems_version: 3.2.22
|
278
279
|
signing_key:
|
279
280
|
specification_version: 4
|
280
281
|
summary: Implementation of Shape Expressions (ShEx) for RDF.rb
|