@prefix rule: . @prefix qb: . @prefix sdmx-dimension: . @prefix leri: . @prefix ler: . @prefix rdfs: . @prefix dc: . @prefix eg: . @prefix xsd: . @prefix cedarterms: . # priwa1: prices must be decimals leri:priwa1 a rule:SPARQLRule, ler:EditRule ; rule:content """ PREFIX leri: PREFIX cedarterms: PREFIX qb: PREFIX ler: PREFIX xsd: IF { ?obs a qb:Observation . ?measure a qb:MeasureProperty . ?obs ?measure ?price . FILTER (datatype(?price) != xsd:decimal) } THEN { ?obs ler:inconsistentWith leri:priwa1 . } """; ler:scope qb:Observation ; ler:component qb:MeasureProperty, cedarterms:price ; rdfs:label "class(price) == 'decimal'"@en ; rdfs:comment "A price must be a decimal number"@en ; dc:creator ; dc:date "2015-01-08T16:03:40+01:00"^^xsd:dateTime . # priwa2: price > 0 leri:priwa2 a rule:SPARQLRule, ler:EditRule ; rule:content """ PREFIX leri: PREFIX cedarterms: PREFIX qb: PREFIX ler: PREFIX xsd: IF { ?obs a qb:Observation . ?measure a qb:MeasureProperty . ?obs ?measure ?price . FILTER (?price <= 0) } THEN { ?obs ler:inconsistentWith leri:priwa2 . } """; ler:scope qb:Observation ; ler:component qb:MeasureProperty, cedarterms:price ; rdfs:label "price > 0"@en ; rdfs:comment "A price must be a positive number"@en ; dc:creator ; dc:date "2015-01-08T16:03:40+01:00"^^xsd:dateTime . # priwa3: dataset follows a lognormal distribution # See http://en.wikipedia.org/wiki/Probability_distribution#Common_probability_distributions leri:priwa3 a rule:SPARQLRule, ler:EditRule ; rule:content """ PREFIX leri: PREFIX cedarterms: PREFIX qb: PREFIX ler: PREFIX xsd: PREFIX stardog: IF { ?ds a qb:DataSet . ?measure a qb:MeasureProperty . FILTER (stardog:R("ks.test", "log(rnorm)", ?ds, ?measure) <= 0.05) } THEN { ?obs ler:inconsistentWith leri:priwa3 . } """; ler:scope qb:DataSet ; ler:component qb:MeasureProperty, cedarterms:price ; rdfs:label "ks.test(ds, log(rnorm))$p.value > 0.005"@en ; rdfs:comment "Prices must follow a log-normal distribution"@en ; dc:creator ; dc:date "2015-01-08T16:03:40+01:00"^^xsd:dateTime .