diff --git a/rdfunit-core/src/main/resources/org/aksw/rdfunit/autoGeneratorsDSP.ttl b/rdfunit-core/src/main/resources/org/aksw/rdfunit/autoGeneratorsDSP.ttl index 5373590aa..14d1f0741 100644 --- a/rdfunit-core/src/main/resources/org/aksw/rdfunit/autoGeneratorsDSP.ttl +++ b/rdfunit-core/src/main/resources/org/aksw/rdfunit/autoGeneratorsDSP.ttl @@ -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 \ No newline at end of file diff --git a/rdfunit-validate/src/test/resources/org/aksw/rdfunit/validate/data/dsp/dsp_constraints.ttl b/rdfunit-validate/src/test/resources/org/aksw/rdfunit/validate/data/dsp/dsp_constraints.ttl index 6619e57c0..24f0e7911 100644 --- a/rdfunit-validate/src/test/resources/org/aksw/rdfunit/validate/data/dsp/dsp_constraints.ttl +++ b/rdfunit-validate/src/test/resources/org/aksw/rdfunit/validate/data/dsp/dsp_constraints.ttl @@ -126,4 +126,34 @@ exdsp:languageOccurrenceDisallowedTemplateSA # Standalone dsp:languageOccurrence "disallowed"^^dsp:occurrence ; ] ] - . \ No newline at end of file + . + +#############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 \ No newline at end of file diff --git a/rdfunit-validate/src/test/resources/org/aksw/rdfunit/validate/data/dsp/language_Correct.ttl b/rdfunit-validate/src/test/resources/org/aksw/rdfunit/validate/data/dsp/language_Correct.ttl new file mode 100644 index 000000000..ae9dcfcad --- /dev/null +++ b/rdfunit-validate/src/test/resources/org/aksw/rdfunit/validate/data/dsp/language_Correct.ttl @@ -0,0 +1,14 @@ +@prefix exdsp: . + +@prefix xsd: . +@prefix rdf: . +@prefix rdfs: . +@prefix owl: . + +# Sample correct data for testing + +exdsp:correct1 a exdsp:languageClass ; + exdsp:languageProp "value"@en . + +exdsp:correct2 exdsp:languagePropSA "value"@en . + diff --git a/rdfunit-validate/src/test/resources/org/aksw/rdfunit/validate/data/dsp/language_Wrong.ttl b/rdfunit-validate/src/test/resources/org/aksw/rdfunit/validate/data/dsp/language_Wrong.ttl new file mode 100644 index 000000000..20190fff3 --- /dev/null +++ b/rdfunit-validate/src/test/resources/org/aksw/rdfunit/validate/data/dsp/language_Wrong.ttl @@ -0,0 +1,18 @@ +@prefix exdsp: . + +@prefix xsd: . +@prefix rdf: . +@prefix rdfs: . +@prefix 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