Skip to content

Commit

Permalink
dsp:language #22
Browse files Browse the repository at this point in the history
  • Loading branch information
jimkont committed Sep 9, 2014
1 parent ac02c75 commit c2dbb49
Show file tree
Hide file tree
Showing 4 changed files with 87 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,29 @@ rutg:DSPLANG-OC a rut:TestGenerator ;
rut:annotationValue rlog:ERROR] ;
.

##########################################
# dsp:literalConstraint -> dsp:language
##########################################

# no domain check disallowed
rutg:DSPLANG-OC a rut:TestGenerator ;
dcterms:description """Generate all rdfs:range constrains defined in a schema (when range is wrongly defined)"""@en ;
rut:sparqlGenerator """ select distinct ?P1 ('!=' as ?OP) (str(?lang) as ?V1) ?DESCRIPTION where {
?s a dsp:DescriptionTemplate .
?s dsp:statementTemplate/dsp:property ?P1 .
?s dsp:statementTemplate/dsp:literalConstraint/dsp:language ?lang .
#FILTER NOT EXISTS {?s dsp:statementTemplate/dsp:literalConstraint/dsp:language ?lang2 .
# FILTER (?lang != ?lang2)}
BIND (concat(str(?P1)," language is different from: ", str(?lang)) AS ?DESCRIPTION)} """ ;
rut:basedOnPattern rutp:CHECKLANG ;
rut:resultAnnotation [
a rut:ResultAnnotation ;
rut:annotationProperty rlog:level ;
rut:annotationValue rlog:ERROR] ;
.



# TODO dsp:literalConstraint -> dsp:language
# TODO dsp:literalConstraint -> dsp:syntaxEncodingSchemeOccurrence
Original file line number Diff line number Diff line change
Expand Up @@ -126,4 +126,34 @@ exdsp:languageOccurrenceDisallowedTemplateSA # Standalone
dsp:languageOccurrence "disallowed"^^dsp:occurrence ;
]
]
.
.

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

exdsp:languageTemplate
a dsp:DescriptionTemplate ;
dsp:resourceClass exdsp:languageClass ;
dsp:statementTemplate [
a dsp:LiteralStatementTemplate ;
dsp:property exdsp:languageProp ;
dsp:literalConstraint [
a dsp:LiteralConstraint ;
dsp:language "en"^^xsd:language ;
]
]
.

exdsp:languageTemplateSA # Standalone
a dsp:DescriptionTemplate ;
dsp:statementTemplate [
a dsp:LiteralStatementTemplate ;
dsp:property exdsp:languagePropSA ;
dsp:literalConstraint [
a dsp:LiteralConstraint ;
dsp:language "en"^^xsd:language ;
]
]
.

# TODO multiple languages
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
@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:languageClass ;
exdsp:languageProp "value"@en .

exdsp:correct2 exdsp:languagePropSA "value"@en .

Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
@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

# TODO support lang per domain
#exdsp:correct1 a exdsp:languageClass ;
# exdsp:languageProp "value"@en .

exdsp:wrong2 exdsp:languagePropSA "value"@it . # 1 error

exdsp:wrong3 exdsp:languagePropSA "value"@el . # 1 error

exdsp:wrong4 exdsp:languagePropSA "value" . # 1 error

0 comments on commit c2dbb49

Please sign in to comment.