Skip to content

Commit

Permalink
add tests for dsp:literal #22
Browse files Browse the repository at this point in the history
  • Loading branch information
jimkont committed Sep 9, 2014
1 parent 48f13ab commit 920578c
Show file tree
Hide file tree
Showing 6 changed files with 77 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,9 @@ public void setUp() throws Exception {
testsWithErrors.put("dsp/languageOccurrence_Wrong.ttl", 2);
testsWithErrors.put("dsp/language_Correct.ttl", 0);
testsWithErrors.put("dsp/language_Wrong.ttl", 3);
testsWithErrors.put("dsp/literal_Wrong.ttl", 1);
testsWithErrors.put("dsp/isLiteral_Wrong.ttl", 1);
testsWithErrors.put("dsp/literal_Correct.ttl", 0);
testsWithErrors.put("dsp/literal_Wrong.ttl", 4);

// Resource Shapes
testsWithErrors.put("rs/valueType_Correct.ttl", 0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,28 @@ exdsp:languageOccurrenceDisallowedTemplateSA # Standalone
]
.

#############3
####################
# dsp:literal

exdsp:languageOccurrenceDisallowedTemplate
dsp:resourceClass exdsp:LiteralValuesClass ;
a dsp:DescriptionTemplate ;
dsp:resourceClass exdsp:languageOccurrenceDisallowedClass ;
dsp:statementTemplate [
a dsp:LiteralStatementTemplate ;
dsp:property exdsp:literalValuesProp ;
dsp:literalConstraint [
a dsp:LiteralConstraint ;
dsp:literal "value1-en"@en,
"value1-de"@de ,
"value" ,
"1"^^xsd:integer;
]
]
.


##############
# dsp:language

exdsp:languageTemplate
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
@prefix exdsp: <http://example.com/dsp#> .

@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .

# Sample correct data for testing


exdsp:wrong2 exdsp:languagePropSA exdsp:value2 . # 1 error, should be literal

Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
@prefix exdsp: <http://example.com/dsp#> .

@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .

# Sample correct data for testing

exdsp:correct1 a exdsp:LiteralValuesClass ;
exdsp:literalValuesProp "value1-en"@en;
.

exdsp:correct2 a exdsp:LiteralValuesClass ;
exdsp:literalValuesProp "value1-de"@de;
.

exdsp:correct3 a exdsp:LiteralValuesClass ;
exdsp:literalValuesProp "value" ;
.

exdsp:correct4 a exdsp:LiteralValuesClass ;
exdsp:literalValuesProp "1"^^xsd:integer;
.

Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,19 @@

# Sample correct data for testing

exdsp:wrong1 a exdsp:LiteralValuesClass ;
exdsp:literalValuesProp "value1-en"@de; # 1 error
.

exdsp:wrong2 exdsp:languagePropSA exdsp:value2 . # 1 error, should be literal
exdsp:wrong2 a exdsp:LiteralValuesClass ;
exdsp:literalValuesProp "value1-de"@en; # 1 error
.

exdsp:wrong3 a exdsp:LiteralValuesClass ;
exdsp:literalValuesProp "value NOT" ; # 1 error
.

exdsp:wrong4 a exdsp:LiteralValuesClass ;
exdsp:literalValuesProp "111"^^xsd:integer; # 1 error
.

Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,11 @@ exrs:wrongA2
exrs:propOccurs-Exactly-one exrs:Anything2 ; # 1 error occurs twice
.


exrs:wrongB1
a exrs:Occurs-One-or-many-Class ; # 1 error <1
.




# exrs:wrongC1 a exrs:OccursZero-or-many-Class ; # No need to check this
# exrs:wrongC1 a exrs:OccursZero-or-many-Class . # No need to check this

exrs:wrongD1
a exrs:Occurs-Zero-or-one-Class ;
Expand Down

0 comments on commit 920578c

Please sign in to comment.