Permalink
Browse files

Merge branch 'master' into langString-ATstar

  • Loading branch information...
ericprud committed Oct 7, 2018
2 parents 4c01b2f + 7ac2e4c commit c6129c9834b24780f7bf8978e98371d6db1365cc
Showing with 55 additions and 50 deletions.
  1. +39 −48 doc/ShExJ.jsg
  2. +7 −0 negativeSyntax/manifest.jsonld
  3. +7 −0 negativeSyntax/manifest.ttl
  4. +1 −1 package.json
  5. +1 −1 validation/manifest.jsonld
View
@@ -13,79 +13,69 @@
; # All objects have a type property corresponding to the production name, e.g. "Schema"
Schema {
"@context":"http://www.w3.org/ns/shex.jsonld"
imports:[IRIREF+]? startActs:[SemAct+]? start:(shapeExpr|labeledShapeExpr)? shapes:[labeledShapeExpr+]? }
"@context":"http://www.w3.org/ns/shex.jsonld"?
imports:[IRI+]?
startActs:[SemAct+]? start:(shapeExpr|labeledShapeExpr)? shapes:[labeledShapeExpr+]?
}
# labeled Shape Expressions
labeledShapeExpr = labeledShapeOr | labeledShapeAnd | labeledShapeNot | labeledNodeConstraint | labeledShape | labeledShapeExternal | shapeExprLabel ;
labeledShapeExpr = labeledShapeOr | labeledShapeAnd | labeledShapeNot | labeledNodeConstraint | labeledShape | shapeExprLabel | labeledShapeExternal;
labeledShapeOr { type:"ShapeOr" id:shapeExprLabel shapeExprs:[shapeExpr{2,}] }
labeledShapeAnd { type:"ShapeAnd" id:shapeExprLabel shapeExprs:[shapeExpr{2,}] }
labeledShapeNot { type:"ShapeNot" id:shapeExprLabel shapeExpr:shapeExpr }
labeledNodeConstraint { type:"NodeConstraint" id:shapeExprLabel nodeKind:("iri"|"bnode"|"nonliteral"|"literal")? datatype:IRIREF? xsFacet* values:[valueSetValue+]? }
labeledShape { type:"Shape" id:shapeExprLabel virtual:BOOL? closed:BOOL? extra:[IRIREF+]? expression:tripleExpr? inherit:[shapeExprLabel+]? semActs:[SemAct+]? annotations:[Annotation+]? }
labeledNodeConstraint { type:"NodeConstraint" id:shapeExprLabel nodeKind:("iri"|"bnode"|"nonliteral"|"literal")? datatype:IRI? xsFacet* values:[valueSetValue+]? }
labeledShape { type:"Shape" id:shapeExprLabel virtual:BOOL? closed:BOOL? extra:[IRI+]? expression:tripleExpr? inherit:[shapeExprLabel+]? semActs:[SemAct+]? annotations:[Annotation+]? }
labeledShapeExternal { type:"ShapeExternal" id:shapeExprLabel }
# Shape Expressions
shapeExpr = ShapeOr | ShapeAnd | ShapeNot | NodeConstraint | Shape | ShapeExternal | shapeExprRef ;
shapeExpr = ShapeOr | ShapeAnd | ShapeNot | NodeConstraint | Shape | shapeExprLabel | ShapeExternal;
ShapeOr { shapeExprs:[shapeExpr{2,}] }
ShapeAnd { shapeExprs:[shapeExpr{2,}] }
ShapeNot { shapeExpr:shapeExpr }
NodeConstraint { nodeKind:("iri"|"bnode"|"nonliteral"|"literal")? datatype:IRI? xsFacet* values:[valueSetValue+]? }
Shape { virtual:BOOL? closed:BOOL? extra:[IRI+]? expression:tripleExpr? inherit:[shapeExprLabel+]? semActs:[SemAct+]? }
ShapeExternal { }
shapeExprRef = shapeExprLabel ;
shapeExprLabel = IRIREF|BNODE ;
NodeConstraint { nodeKind:("iri"|"bnode"|"nonliteral"|"literal")? datatype:IRIREF? xsFacet* values:[valueSetValue+]? }
# Triple Expressions
tripleExpr = EachOf | OneOf | TripleConstraint | tripleExprLabel ;
EachOf { id:tripleExprLabel? expressions:[tripleExpr{2,}] min:INTEGER? max:(INTEGER|"unbounded")? semActs:[SemAct+]? annotations:[Annotation+]? }
OneOf { id:tripleExprLabel? expressions:[tripleExpr{2,}] min:INTEGER? max:(INTEGER|"unbounded")? semActs:[SemAct+]? annotations:[Annotation+]? }
TripleConstraint { id:tripleExprLabel? inverse:BOOL? negated:BOOL? predicate:IRI valueExpr:shapeExpr? min:INTEGER? max:(INTEGER|"unbounded")? semActs:[SemAct+]? annotations:[Annotation+]? }
# XML Schema facets
xsFacet = stringFacet | numericFacet ;
stringFacet = (length|minlength|maxlength):INTEGER | pattern:STRING flags:STRING? ;
numericFacet = (mininclusive|minexclusive|maxinclusive|maxexclusive):numericLiteral
| (totaldigits|fractiondigits):INTEGER ;
numericLiteral = INTEGER|DECIMAL|DOUBLE ;
# Value Sets
valueSetValue = objectValue | IriStem | IriStemRange | LiteralStem | LiteralStemRange | Language | LanguageStem | LanguageStemRange ;
objectValue = IRIREF|ObjectLiteral ;
ObjectLiteral { value:STRING language:LANGTAG? type:IRIREF? }
IriStem { stem:IRIREF }
IriStemRange { stem:(IRIREF|Wildcard) exclusions:[IRIREF|IriStem +] }
LiteralStem { stem:STRING }
LiteralStemRange { stem:(STRING|Wildcard) exclusions:[STRING|LiteralStem +] }
Language { languageTag:LANGTAG }
LanguageStem { stem:LANGTAG }
LanguageStemRange{ stem:(LANGTAG|Wildcard) exclusions:[LANGTAG|LanguageStem +] }
objectValue = IRI|ObjectLiteral ;
IriStem { stem:IRI } # IriStemRange with exclusions
IriStemRange { stem:(IRI|Wildcard) exclusions:[objectValue|IriStem +]? }
LiteralStem { stem:STRING } # LiteralStemRange with exclusions
LiteralStemRange { stem:(STRING|Wildcard) exclusions:[objectValue|LiteralStem +]? }
Language { languageTag: LANGTAG }
LanguageStem { stem:EMPTYLANGTAG }
LanguageStemRange{ stem:(EMPTYLANGTAG|Wildcard) exclusions:[LANGTAG|LanguageStem +] }
Wildcard { }
# Shape { abstract:BOOL? closed:BOOL? extra:[IRIREF+]? expression:tripleExpr? restrict:[shapeExprLabel+]? extend:[shapeExprLabel+]? semActs:[SemAct+]? annotations:[Annotation+]? }
Shape { closed:BOOL? extra:[IRIREF+]? expression:tripleExpr? semActs:[SemAct+]? annotations:[Annotation+]? }
SemAct { name:IRI code:STRING? }
Annotation { predicate:IRI object:objectValue }
# Triple Expressions
tripleExpr = EachOf | OneOf | TripleConstraint | tripleExprRef ;
EachOf { id:tripleExprLabel? expressions:[tripleExpr{2,}] min:INTEGER? max:INTEGER? semActs:[SemAct+]? annotations:[Annotation+]? }
OneOf { id:tripleExprLabel? expressions:[tripleExpr{2,}] min:INTEGER? max:INTEGER? semActs:[SemAct+]? annotations:[Annotation+]? }
# TripleConstraint { id:tripleExprLabel? inverse:BOOL? negated:BOOL? predicate:IRIREF valueExpr:shapeExpr? min:INTEGER? max:INTEGER? semActs:[SemAct+]? annotations:[Annotation+]? }
TripleConstraint { id:tripleExprLabel? inverse:BOOL? predicate:IRIREF valueExpr:shapeExpr? min:INTEGER? max:INTEGER? semActs:[SemAct+]? annotations:[Annotation+]? }
tripleExprRef = tripleExprLabel ;
tripleExprLabel = IRIREF|BNODE ;
SemAct { name:IRIREF code:STRING? }
Annotation { predicate:IRIREF object:objectValue }
shapeExprLabel = IRI|BNODE ;
tripleExprLabel = IRI|BNODE ;
numericLiteral = INTEGER|DECIMAL|DOUBLE ;
RDFLiteral = SIMPLE_LITERAL|DATATYPE_LITERAL|LANG_LITERAL ;
ObjectLiteral { value:STRING language:STRING? type:STRING? }
# Terminals used in productions:
# Turtle IRIREF without enclosing "<>"s
IRIREF : (PN_CHARS | '.' | ':' | '/' | '\\' | '#' | '@' | '%' | '&' | UCHAR)* ;
# Turtle BLANK_NODE_LABEL
BNODE : '_:' (PN_CHARS_U | [0-9]) ((PN_CHARS | '.')* PN_CHARS)? ;
# JSON boolean values
BOOL : "true" | "false" ;
# Turtle INTEGER
INTEGER : [+-]? [0-9] + ;
# Turtle DECIMAL
DECIMAL : [+-]? [0-9]* '.' [0-9] + ;
# Turtle DOUBLE
DOUBLE : [+-]? ([0-9] + '.' [0-9]* EXPONENT | '.' [0-9]+ EXPONENT | [0-9]+ EXPONENT) ;
# BCP47 Language-Tag
LANGTAG : ([a-zA-Z])+('-'([a-zA-Z0-9])+)* ;
# any JSON string
IRI : (PN_CHARS | '.' | ':' | '/' | '\\' | '#' | '@' | '%' | '&' | UCHAR)* ; # <http://www.w3.org/TR/turtle/#grammar-production-IRIREF> - "<>"s
BNODE : '_:' (PN_CHARS_U | [0-9]) ((PN_CHARS | '.')* PN_CHARS)? ; # <http://www.w3.org/TR/turtle/#grammar-production-BLANK_NODE_LABEL>
BOOL : "true" | "false" ; # JSON boolean tokens
INTEGER : [+-]? [0-9] + ; # <http://www.w3.org/TR/turtle/#grammar-production-INTEGER>
DECIMAL : [+-]? [0-9]* '.' [0-9] + ; # <http://www.w3.org/TR/turtle/#grammar-production-DECIMAL>
DOUBLE : [+-]? ([0-9] + '.' [0-9]* EXPONENT | '.' [0-9]+ EXPONENT | [0-9]+ EXPONENT) ; # <http://www.w3.org/TR/turtle/#grammar-production-DOUBLE>
STRING : .* ;
# Terminals use only in other terminals:
@@ -101,4 +91,5 @@ UCHAR : '\\u' HEX HEX HEX HEX
| '\\U' HEX HEX HEX HEX HEX HEX HEX HEX ;
HEX : [0-9] | [A-F] | [a-f] ;
EXPONENT : [eE] [+-]? [0-9]+ ;
LANGTAG : [a-zA-Z] + ('-' [a-zA-Z0-9] +)* ;
EMPTYLANGTAG : (([a-zA-Z])+('-'([a-zA-Z0-9])+)*)? ;
@@ -11,6 +11,13 @@
"@type": "mf:Manifest",
"rdfs:comment": "ShEx negative syntax tests",
"entries": [
{
"@id": "#directShapeExpression",
"@type": "sht:NegativeSyntax",
"name": "directShapeExpression",
"status": "mf:proposed",
"shex": "directShapeExpression.shex"
},
{
"@id": "#1decimalMininclusiveroman-numeral",
"@type": "sht:NegativeSyntax",
@@ -8,6 +8,7 @@
<> a mf:Manifest ;
rdfs:comment "ShEx negative syntax tests" ;
mf:entries (
<#directShapeExpression>
<#1decimalMininclusiveroman-numeral>
<#1dotAnnot_AIRIREF>
<#1dotUnlabeledCode1>
@@ -109,6 +110,12 @@
<#1val1literalStemMinuslanguage3>
) .
<#directShapeExpression> a sht:NegativeSyntax ;
mf:name "directShapeExpression" ;
mf:status mf:proposed ;
sx:shex <directShapeExpression.shex> ;
.
<#1decimalMininclusiveroman-numeral> a sht:NegativeSyntax ;
mf:name "1decimalMininclusiveroman-numeral" ;
mf:status mf:proposed ;
View
@@ -1,6 +1,6 @@
{
"name": "shex-test",
"version": "2.0.1",
"version": "2.0.2",
"description": "Shape Expressions library tests.",
"author": {
"name": "Eric Prud'hommeaux",
@@ -19014,4 +19014,4 @@
]
}
]
}
}

0 comments on commit c6129c9

Please sign in to comment.